MCPcopy Create free account
hub / github.com/neomjs/neo / createMainContainer

Function createMainContainer

buildScripts/create/example.mjs:97–158  ·  view source on GitHub ↗
(classFolder, componentPath, componentChunk, name)

Source from the content-addressed store, hash-verified

95
96
97function createMainContainer(classFolder, componentPath, componentChunk, name) {
98 const template = [];
99
100 template.push(
101 "import ConfigurationViewport from '../../ConfigurationViewport.mjs';",
102 "import NumberField from '../../../src/form/field/Number.mjs';",
103 `import ${name} from '../../../src/${componentPath}.mjs';`,
104 "",
105 "/**",
106 ` * @class Neo.examples.${componentChunk.toLowerCase()}.MainContainer`,
107 " * @extends Neo.examples.ConfigurationViewport",
108 " */",
109 "class MainContainer extends ConfigurationViewport {",
110 " static config = {",
111 ` className: 'Neo.examples.${componentChunk.toLowerCase()}.MainContainer',`,
112 " autoMount: true,",
113 " configItemLabelWidth: 110,",
114 " configItemWidth: 230,",
115 " layout: { ntype: 'hbox', align: 'stretch' }",
116 " }",
117 "",
118 " createConfigurationComponents() {",
119 " let me = this;",
120 "",
121 " return [{",
122 " module: NumberField,",
123 " clearable: true,",
124 " labelText: 'height',",
125 " listeners: { change: me.onConfigChange.bind(me, 'height') },",
126 " maxValue: 100,",
127 " minValue: 20,",
128 " stepSize: 2,",
129 " style: { marginTop: '10px' },",
130 " value: me.exampleComponent.height",
131 " }, {",
132 " module: NumberField,",
133 " clearable: true,",
134 " labelText: 'width',",
135 " listeners: { change: me.onConfigChange.bind(me, 'width') },",
136 " maxValue: 300,",
137 " minValue: 100,",
138 " stepSize: 5,",
139 " style: { marginTop: '10px' },",
140 " value: me.exampleComponent.width",
141 " }]",
142 " }",
143 "",
144 " createExampleComponent() {",
145 " return Neo.create({",
146 ` module: ${name},`,
147 " height: 30,",
148 " width: 100",
149 " // property_xy: <value>",
150 " })",
151 " }",
152 "}",
153 "",
154 "export default Neo.setupClass(MainContainer);"

Callers 1

example.mjsFile · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected