<%@
required (
'Uize.Array.Join',
'Uize.Str.Repeat'
);
input ({
widgetNamespace:'string',
superclass:'string',
developers:'array',
hasHtml:'boolean',
hasCss:'boolean',
hasLoc:'boolean'
});
%><%
var
_input = input,
_widgetNamespace = _input.widgetNamespace,
_widgetModuleName = _widgetNamespace + '.Widget',
_widgetVisualSamplerModuleName = _widgetNamespace + '.VisualSampler',
_htmlModuleName = _widgetNamespace + '.Html',
_cssModuleName = _widgetNamespace + '.Css',
_required = []
;
_input.hasHtml && _required.push (_htmlModuleName);
_input.hasCss && _required.push (_cssModuleName);
%><%
.headComment
%>/* Module Meta Data
type: Class
importance: 1
codeCompleteness: 5
docCompleteness: 5
*/
/*?
Introduction
The =<%= _widgetModuleName %>= module implements a widget class.
*DEVELOPERS:* <%= Uize.Array.Join.hugJoin (_input.developers || [],'`','`',', ') %>
Visual Sampler
Below is a visual sampler of the =<%= _widgetModuleName %>= class...
.............<%= Uize.Str.Repeat.repeat ('.',_widgetVisualSamplerModuleName.length) %>
<< widget >>
widgetClass: <%= _widgetVisualSamplerModuleName %>
.............<%= Uize.Str.Repeat.repeat ('.',_widgetVisualSamplerModuleName.length) %>
*/
<%@
startBlock ('locPart')
%> hasLoc:true<%@
endBlock ()
%><%@
startBlock ('htmlPart')
%> set:{
html:<%= _htmlModuleName %>
}<%@
endBlock ()
%><%@
startBlock ('cssPart')
%> staticProperties:{
cssModule:<%= _cssModuleName %>
}<%@
endBlock ()
%>
Uize.module ({
name:'<%= _widgetModuleName %>',
superclass:'<%= _input.superclass || 'Uize.Widget.V2' %>',
required:<%= _required -> json -> indent{amount:1} %>,
builder:function (_superclass) {
'use strict';
return _superclass.subclass ({
<%
var _parts = [];
_input.hasLoc && _parts.push (locPart ());
_input.hasHtml && _parts.push (htmlPart ());
_input.hasCss && _parts.push (cssPart ());
%><%=
_parts.join (',\n\n')
%>
});
}
});