cedro 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/dist/assets/_virtual/_commonjsHelpers.js +1 -0
- package/dist/assets/_virtual/index.js +1 -0
- package/dist/assets/_virtual/modulepreload-polyfill.js +1 -0
- package/dist/assets/_virtual/named-references.js +1 -0
- package/dist/assets/_virtual/numeric-unicode-map.js +1 -0
- package/dist/assets/_virtual/surrogate-pairs.js +1 -0
- package/dist/assets/core/application.builder.js +1 -0
- package/dist/assets/core/application.core.js +1 -0
- package/dist/assets/core/jsxsupport.js +1 -0
- package/dist/assets/core/screeen.core.js +1 -0
- package/dist/assets/core/seo.js +1 -0
- package/dist/assets/core/themes.core.js +1 -0
- package/dist/assets/core/uid.js +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/assets/material-icons-outlined.woff +0 -0
- package/dist/assets/material-icons-outlined.woff2 +0 -0
- package/dist/assets/material-icons-round.woff +0 -0
- package/dist/assets/material-icons-round.woff2 +0 -0
- package/dist/assets/material-icons-sharp.woff +0 -0
- package/dist/assets/material-icons-sharp.woff2 +0 -0
- package/dist/assets/material-icons-two-tone.woff +0 -0
- package/dist/assets/material-icons-two-tone.woff2 +0 -0
- package/dist/assets/material-icons.woff +0 -0
- package/dist/assets/material-icons.woff2 +0 -0
- package/dist/assets/node_modules/@fontsource/roboto/100.css +1 -0
- package/dist/assets/node_modules/@fontsource/roboto/300.css +1 -0
- package/dist/assets/node_modules/@fontsource/roboto/400.css +1 -0
- package/dist/assets/node_modules/@fontsource/roboto/500.css +1 -0
- package/dist/assets/node_modules/@fontsource/roboto/700.css +1 -0
- package/dist/assets/node_modules/@fontsource/roboto/900.css +1 -0
- package/dist/assets/node_modules/html-entities/lib/index.js +1 -0
- package/dist/assets/node_modules/html-entities/lib/named-references.js +2 -0
- package/dist/assets/node_modules/html-entities/lib/numeric-unicode-map.js +1 -0
- package/dist/assets/node_modules/html-entities/lib/surrogate-pairs.js +1 -0
- package/dist/assets/node_modules/material-icons/iconfont/material-icons.css +1 -0
- package/dist/assets/node_modules/navigo/lib/es/Q.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/constants.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/index.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/lifecycles.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/callHandler.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForAfterHook.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForAlreadyHook.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForBeforeHook.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForDeprecationMethods.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForForceOp.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForLeaveHook.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/checkForNotFoundHandler.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/errorOut.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/flushCurrent.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/matchPathToRegisteredRoutes.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/processMatches.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/setLocationPath.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/updateBrowserURL.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/updateState.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/middlewares/waitingList.js +1 -0
- package/dist/assets/node_modules/navigo/lib/es/utils.js +1 -0
- package/dist/assets/roboto-cyrillic-100-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-100-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-300-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-300-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-400-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-400-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-500-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-500-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-700-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-700-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-900-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-900-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-100-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-100-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-300-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-300-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-400-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-500-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-500-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-700-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/assets/roboto-cyrillic-ext-900-normal.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-900-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-100-normal.woff +0 -0
- package/dist/assets/roboto-greek-100-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-300-normal.woff +0 -0
- package/dist/assets/roboto-greek-300-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-400-normal.woff +0 -0
- package/dist/assets/roboto-greek-400-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-500-normal.woff +0 -0
- package/dist/assets/roboto-greek-500-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-700-normal.woff +0 -0
- package/dist/assets/roboto-greek-700-normal.woff2 +0 -0
- package/dist/assets/roboto-greek-900-normal.woff +0 -0
- package/dist/assets/roboto-greek-900-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-100-normal.woff +0 -0
- package/dist/assets/roboto-latin-100-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-300-normal.woff +0 -0
- package/dist/assets/roboto-latin-300-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-400-normal.woff +0 -0
- package/dist/assets/roboto-latin-400-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-500-normal.woff +0 -0
- package/dist/assets/roboto-latin-500-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-700-normal.woff +0 -0
- package/dist/assets/roboto-latin-700-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-900-normal.woff +0 -0
- package/dist/assets/roboto-latin-900-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-100-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-100-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-300-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-300-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-400-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-400-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-500-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-500-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-700-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-700-normal.woff2 +0 -0
- package/dist/assets/roboto-latin-ext-900-normal.woff +0 -0
- package/dist/assets/roboto-latin-ext-900-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-100-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-100-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-300-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-300-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-400-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-400-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-500-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-500-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-700-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-700-normal.woff2 +0 -0
- package/dist/assets/roboto-vietnamese-900-normal.woff +0 -0
- package/dist/assets/roboto-vietnamese-900-normal.woff2 +0 -0
- package/dist/assets/types/select.item.type.js +1 -0
- package/dist/assets/ui/Icon.ui.js +1 -0
- package/dist/assets/ui/IconButton.ui.js +1 -0
- package/dist/assets/ui/Textbox.ui.js +1 -0
- package/dist/assets/ui/accordion.ui.js +1 -0
- package/dist/assets/ui/button.ui.js +1 -0
- package/dist/assets/ui/buttonColor.ui.js +1 -0
- package/dist/assets/ui/buttonmenu.ui.js +1 -0
- package/dist/assets/ui/buttonstack.ui.js +1 -0
- package/dist/assets/ui/checkbox.ui.js +1 -0
- package/dist/assets/ui/container.ui.js +1 -0
- package/dist/assets/ui/datagrid.ui.js +1 -0
- package/dist/assets/ui/dialog.js +1 -0
- package/dist/assets/ui/draggable.ui.js +1 -0
- package/dist/assets/ui/hpanel.ui.js +1 -0
- package/dist/assets/ui/iconButtonMenu.ui.js +1 -0
- package/dist/assets/ui/image.ui.js +1 -0
- package/dist/assets/ui/label.ui.js +1 -0
- package/dist/assets/ui/loading.ui.js +1 -0
- package/dist/assets/ui/menu.ui.js +1 -0
- package/dist/assets/ui/progressbar.ui.js +1 -0
- package/dist/assets/ui/radiobutton.ui.js +1 -0
- package/dist/assets/ui/scroll.ui.js +1 -0
- package/dist/assets/ui/select.ui.js +1 -0
- package/dist/assets/ui/styles/accordion.css +1 -0
- package/dist/assets/ui/styles/button.css +1 -0
- package/dist/assets/ui/styles/buttoncolor.css +1 -0
- package/dist/assets/ui/styles/container.css +1 -0
- package/dist/assets/ui/styles/datagrid.css +1 -0
- package/dist/assets/ui/styles/dialog.css +1 -0
- package/dist/assets/ui/styles/draggable.css +1 -0
- package/dist/assets/ui/styles/hpanel.css +1 -0
- package/dist/assets/ui/styles/icon.css +1 -0
- package/dist/assets/ui/styles/image.css +1 -0
- package/dist/assets/ui/styles/label.css +1 -0
- package/dist/assets/ui/styles/loading.css +1 -0
- package/dist/assets/ui/styles/main.css +1 -0
- package/dist/assets/ui/styles/menu.css +1 -0
- package/dist/assets/ui/styles/progressbar.css +1 -0
- package/dist/assets/ui/styles/scroll.css +1 -0
- package/dist/assets/ui/styles/select.css +1 -0
- package/dist/assets/ui/styles/stackbutton.css +1 -0
- package/dist/assets/ui/styles/tabs.css +1 -0
- package/dist/assets/ui/styles/textarea.css +1 -0
- package/dist/assets/ui/styles/textbox.css +1 -0
- package/dist/assets/ui/styles/toolbar.css +1 -0
- package/dist/assets/ui/styles/valuebar.css +1 -0
- package/dist/assets/ui/styles/vpanel.css +1 -0
- package/dist/assets/ui/styles/vstackbutton.css +1 -0
- package/dist/assets/ui/switch.ui.js +1 -0
- package/dist/assets/ui/tabs.ui.js +1 -0
- package/dist/assets/ui/textarea.ui.js +1 -0
- package/dist/assets/ui/toggle.ui.js +1 -0
- package/dist/assets/ui/toolbar.ui.js +1 -0
- package/dist/assets/ui/valuebar.ui.js +1 -0
- package/dist/assets/ui/vpanel.ui.js +1 -0
- package/dist/assets/ui/widget.builder.js +1 -0
- package/dist/assets/ui/widget.collection.js +1 -0
- package/dist/assets/ui/widget.ui.js +1 -0
- package/dist/cedro-logo.png +0 -0
- package/dist/cedro-logo.svg +97 -0
- package/dist/fangio.jpg +0 -0
- package/dist/material-icons-list.json/357/200/272Zone.Identifier +3 -0
- package/package.json +4 -2
- package/src/core/application.builder.tsx +122 -60
- package/src/core/application.core.tsx +110 -11
- package/src/core/themes.core.ts +160 -1
- package/src/core/uid.ts +3 -3
- package/src/interfaces/application.interface.ts +3 -2
- package/src/interfaces/widget.interface.ts +3 -0
- package/src/types/select.item.type.ts +11 -0
- package/src/ui/Icon.ui.tsx +158 -0
- package/src/ui/IconButton.ui.tsx +51 -9
- package/src/ui/{textbox.ui.tsx → Textbox.ui.tsx} +23 -15
- package/src/ui/accordion.ui.tsx +152 -0
- package/src/ui/button.ui.tsx +55 -14
- package/src/ui/buttonColor.ui.tsx +87 -0
- package/src/ui/buttonmenu.ui.tsx +133 -0
- package/src/ui/{buttonstack.ui.ts → buttonstack.ui.tsx} +67 -1
- package/src/ui/checkbox.ui.tsx +9 -13
- package/src/ui/container.ui.tsx +140 -76
- package/src/ui/datagrid.ui.tsx +514 -0
- package/src/ui/dialog.tsx +143 -56
- package/src/ui/hpanel.ui.tsx +37 -11
- package/src/ui/iconButtonMenu.ui.tsx +175 -0
- package/src/ui/image.ui.tsx +123 -112
- package/src/ui/index.ts +8 -8
- package/src/ui/label.ui.tsx +61 -3
- package/src/ui/loading.ui.ts +10 -10
- package/src/ui/menu.ui.ts +2 -2
- package/src/ui/progressbar.ui.tsx +9 -8
- package/src/ui/{radiobutton.tsx → radiobutton.ui.tsx} +9 -13
- package/src/ui/scroll.ui.ts +13 -12
- package/src/ui/select.ui.tsx +143 -0
- package/src/ui/styles/button.css +114 -32
- package/src/ui/styles/buttoncolor.css +8 -8
- package/src/ui/styles/container.css +29 -0
- package/src/ui/styles/icon.css +29 -0
- package/src/ui/styles/image.css +19 -19
- package/src/ui/styles/label.css +63 -0
- package/src/ui/styles/loading.css +12 -12
- package/src/ui/styles/main.css +5 -0
- package/src/ui/styles/progressbar.css +2 -1
- package/src/ui/styles/select.css +13 -0
- package/src/ui/styles/stackbutton.css +36 -0
- package/src/ui/styles/tabs.css +5 -7
- package/src/ui/styles/textarea.css +13 -13
- package/src/ui/switch.ui.tsx +9 -13
- package/src/ui/tabs.ui.tsx +43 -22
- package/src/ui/textarea.ui.tsx +48 -0
- package/src/ui/toolbar.ui.tsx +17 -12
- package/src/ui/valuebar.ui.tsx +11 -13
- package/src/ui/vpanel.ui.tsx +19 -13
- package/src/ui/widget.builder.ts +243 -159
- package/src/ui/widget.collection.ts +24 -2
- package/src/ui/widget.ui.ts +79 -19
- package/src/ui/Icon.ui.ts +0 -64
- package/src/ui/accordion.ui.ts +0 -71
- package/src/ui/buttonColor.ui.ts +0 -24
- package/src/ui/buttonmenu.ui.ts +0 -59
- package/src/ui/datagrid.ui.ts +0 -231
- package/src/ui/iconButtonMenu.ui.ts +0 -59
- package/src/ui/select.ui.ts +0 -73
- package/src/ui/textarea.ui.ts +0 -20
- /package/src/ui/{toggle.ui.ts → toggle.ui.tsx} +0 -0
package/src/core/themes.core.ts
CHANGED
|
@@ -16,12 +16,15 @@ export class Theme implements ITheme {
|
|
|
16
16
|
|
|
17
17
|
export const LightTheme = new Theme("light");
|
|
18
18
|
export const DarkTheme = new Theme("dark");
|
|
19
|
+
export const CedroDarkTheme = new Theme("cedro-dark");
|
|
20
|
+
export const CedroLightTheme = new Theme("cedro");
|
|
19
21
|
|
|
20
22
|
LightTheme.add("--palette-text-primary", "rgba(0, 0, 0, 0.87)")
|
|
21
23
|
.add("--palette-text-secondary", "rgba(0, 0, 0, 0.6)")
|
|
22
24
|
.add("--palette-text-disabled", "rgba(0, 0, 0, 0.38)")
|
|
23
25
|
.add("--palette-background-default", "#ffffff")
|
|
24
26
|
.add("--palette-background-paper", "#ffffff")
|
|
27
|
+
.add("--palette-background-light", "#f5f5f5")
|
|
25
28
|
.add("--palette-action-active", "rgba(0, 0, 0, 0.54)")
|
|
26
29
|
.add("--palette-action-disabled", "rgba(0, 0, 0, 0.26)")
|
|
27
30
|
.add("--palette-action-hover", "#f5f5f5")
|
|
@@ -37,7 +40,7 @@ LightTheme.add("--palette-text-primary", "rgba(0, 0, 0, 0.87)")
|
|
|
37
40
|
|
|
38
41
|
.add("--palette-primary-main", "#90caf9")
|
|
39
42
|
.add("--palette-primary-dark", "#42a5f5")
|
|
40
|
-
.add("--palette-primary-light", "#
|
|
43
|
+
.add("--palette-primary-light", "#90caf9")
|
|
41
44
|
|
|
42
45
|
.add("--palette-primary-text-main", "#2a3b49")
|
|
43
46
|
.add("--palette-primary-text-dark", "#133048")
|
|
@@ -99,6 +102,7 @@ DarkTheme.add("--palette-text-primary", "#cdd0d3")
|
|
|
99
102
|
|
|
100
103
|
.add("--palette-background-default", "#121212")
|
|
101
104
|
.add("--palette-background-paper", "#121212")
|
|
105
|
+
.add("--palette-background-light", "rgba(255, 255, 255, 0.02)")
|
|
102
106
|
|
|
103
107
|
.add("--palette-action-active", "#ffffff")
|
|
104
108
|
.add("--palette-action-disabled", "rgba(255, 255, 255, 0.3)")
|
|
@@ -170,6 +174,161 @@ DarkTheme.add("--palette-text-primary", "#cdd0d3")
|
|
|
170
174
|
.add("--palette-success-text-dark", "#263b27")
|
|
171
175
|
.add("--palette-success-text-light", "#c3ddc5");
|
|
172
176
|
|
|
177
|
+
CedroDarkTheme.add("--palette-text-primary", "#d3d0c8")
|
|
178
|
+
.add("--palette-text-secondary", "#a6a29a")
|
|
179
|
+
.add("--palette-text-disabled", "rgba(80, 81, 82, 0.5)")
|
|
180
|
+
|
|
181
|
+
.add("--palette-background-default", "#655349")
|
|
182
|
+
.add("--palette-background-paper", "#56473e")
|
|
183
|
+
.add("--palette-background-light", "#6d5a4e")
|
|
184
|
+
|
|
185
|
+
.add("--palette-action-active", "#655447")
|
|
186
|
+
.add("--palette-action-disabled", "rgba(39, 32, 27, 0.3)")
|
|
187
|
+
.add("--palette-action-hover", "#56473e")
|
|
188
|
+
.add("--palette-action-selected", "rgba(255, 255, 255, 0.16)")
|
|
189
|
+
.add("--palette-action-disabled-bg", "rgba(255, 255, 255, 0.12)")
|
|
190
|
+
|
|
191
|
+
.add("--palette-divider", "rgba(255, 255, 255, 0.12)")
|
|
192
|
+
|
|
193
|
+
.add("--palette-link", "#ffa500")
|
|
194
|
+
.add("--palette-link-hover", "#c07e06")
|
|
195
|
+
|
|
196
|
+
/*PRIMARY*/
|
|
197
|
+
.add("--palette-primary-main", "#f9ca90")
|
|
198
|
+
.add("--palette-primary-dark", "#da9f56")
|
|
199
|
+
.add("--palette-primary-light", "#fcd09a")
|
|
200
|
+
|
|
201
|
+
.add("--palette-primary-text-main", "#2a3b49")
|
|
202
|
+
.add("--palette-primary-text-dark", "#133048")
|
|
203
|
+
.add("--palette-primary-text-light", "#43474b")
|
|
204
|
+
|
|
205
|
+
/*SECONDARY*/
|
|
206
|
+
|
|
207
|
+
.add("--palette-secondary-main", "#ce93d8")
|
|
208
|
+
.add("--palette-secondary-dark", "#ab47bc")
|
|
209
|
+
.add("--palette-secondary-light", "#f3e5f5")
|
|
210
|
+
|
|
211
|
+
.add("--palette-secondary-text-main", "#3d2b40")
|
|
212
|
+
.add("--palette-secondary-text-dark", "#e6c8eb")
|
|
213
|
+
.add("--palette-secondary-text-light", "#484348")
|
|
214
|
+
|
|
215
|
+
/*ERROR*/
|
|
216
|
+
|
|
217
|
+
.add("--palette-error-main", "#9e5656")
|
|
218
|
+
.add("--palette-error-dark", "#d32f2f")
|
|
219
|
+
.add("--palette-error-light", "#e57373")
|
|
220
|
+
|
|
221
|
+
.add("--palette-error-text-main", "#fbc7c3")
|
|
222
|
+
.add("--palette-error-text-dark", "#f1c1c1")
|
|
223
|
+
.add("--palette-error-text-light", "#432222")
|
|
224
|
+
|
|
225
|
+
/*WARNING*/
|
|
226
|
+
|
|
227
|
+
.add("--palette-warning-main", "#ffa726")
|
|
228
|
+
.add("--palette-warning-dark", "#ffb74d")
|
|
229
|
+
.add("--palette-warning-light", "#f57c00")
|
|
230
|
+
|
|
231
|
+
.add("--palette-warning-text-main", "#4b310b")
|
|
232
|
+
.add("--palette-warning-text-dark", "#4b3616")
|
|
233
|
+
.add("--palette-warning-text-light", "#482400")
|
|
234
|
+
|
|
235
|
+
/*INFO*/
|
|
236
|
+
|
|
237
|
+
.add("--palette-info-main", "#29b6f6")
|
|
238
|
+
.add("--palette-info-dark", "#4fc3f7")
|
|
239
|
+
.add("--palette-info-light", "#0288d1")
|
|
240
|
+
|
|
241
|
+
.add("--palette-info-text-main", "#0c3649")
|
|
242
|
+
.add("--palette-info-text-dark", "#173949")
|
|
243
|
+
.add("--palette-info-text-light", "#b3dbf1")
|
|
244
|
+
|
|
245
|
+
/*SUCCESS*/
|
|
246
|
+
|
|
247
|
+
.add("--palette-success-main", "#599062")
|
|
248
|
+
.add("--palette-success-dark", "#81c784")
|
|
249
|
+
.add("--palette-success-light", "#388e3c")
|
|
250
|
+
|
|
251
|
+
.add("--palette-success-text-main", "#1e371f")
|
|
252
|
+
.add("--palette-success-text-dark", "#263b27")
|
|
253
|
+
.add("--palette-success-text-light", "#c3ddc5");
|
|
254
|
+
|
|
255
|
+
CedroLightTheme.add("--palette-text-primary", "#4f3e2e")
|
|
256
|
+
.add("--palette-text-secondary", "rgba(0, 0, 0, 0.6)")
|
|
257
|
+
.add("--palette-text-disabled", "rgba(0, 0, 0, 0.38)")
|
|
258
|
+
.add("--palette-background-default", "#ffffff")
|
|
259
|
+
.add("--palette-background-paper", "#ffffff")
|
|
260
|
+
.add("--palette-background-light", "rgba(250, 243, 235, 0.5)")
|
|
261
|
+
.add("--palette-action-active", "rgba(0, 0, 0, 0.54)")
|
|
262
|
+
.add("--palette-action-disabled", "#ffe2ba")
|
|
263
|
+
.add("--palette-action-hover", "#f5f5f5")
|
|
264
|
+
.add("--palette-action-selected", "rgba(0, 0, 0, 0.08)")
|
|
265
|
+
.add("--palette-action-disabled-bg", "rgba(0, 0, 0, 0.12)")
|
|
266
|
+
|
|
267
|
+
.add("--palette-divider", "#ffe2ba")
|
|
268
|
+
|
|
269
|
+
.add("--palette-link", "#1d79ee")
|
|
270
|
+
.add("--palette-link-hover", "#3393f2")
|
|
271
|
+
|
|
272
|
+
/*PRIMARY*/
|
|
273
|
+
|
|
274
|
+
.add("--palette-primary-main", "#baf990")
|
|
275
|
+
.add("--palette-primary-dark", "#9bce79")
|
|
276
|
+
.add("--palette-primary-light", "#d1ffb2")
|
|
277
|
+
|
|
278
|
+
.add("--palette-primary-text-main", "#2a3b49")
|
|
279
|
+
.add("--palette-primary-text-dark", "#133048")
|
|
280
|
+
.add("--palette-primary-text-light", "#43474b")
|
|
281
|
+
|
|
282
|
+
/*SECONDARY*/
|
|
283
|
+
|
|
284
|
+
.add("--palette-secondary-main", "#ce93d8")
|
|
285
|
+
.add("--palette-secondary-dark", "#ab47bc")
|
|
286
|
+
.add("--palette-secondary-light", "#f3e5f5")
|
|
287
|
+
|
|
288
|
+
.add("--palette-secondary-text-main", "#3d2b40")
|
|
289
|
+
.add("--palette-secondary-text-dark", "#e6c8eb")
|
|
290
|
+
.add("--palette-secondary-text-light", "#484348")
|
|
291
|
+
|
|
292
|
+
/*ERROR*/
|
|
293
|
+
|
|
294
|
+
.add("--palette-error-main", "#f44336")
|
|
295
|
+
.add("--palette-error-dark", "#d32f2f")
|
|
296
|
+
.add("--palette-error-light", "#e57373")
|
|
297
|
+
|
|
298
|
+
.add("--palette-error-text-main", "#fbc7c3")
|
|
299
|
+
.add("--palette-error-text-dark", "#f1c1c1")
|
|
300
|
+
.add("--palette-error-text-light", "#432222")
|
|
301
|
+
|
|
302
|
+
/*WARNING*/
|
|
303
|
+
|
|
304
|
+
.add("--palette-warning-main", "#ffa726")
|
|
305
|
+
.add("--palette-warning-dark", "#ffb74d")
|
|
306
|
+
.add("--palette-warning-light", "#f57c00")
|
|
307
|
+
|
|
308
|
+
.add("--palette-warning-text-main", "#4b310b")
|
|
309
|
+
.add("--palette-warning-text-dark", "#4b3616")
|
|
310
|
+
.add("--palette-warning-text-light", "#482400")
|
|
311
|
+
|
|
312
|
+
/*INFO*/
|
|
313
|
+
|
|
314
|
+
.add("--palette-info-main", "#29b6f6")
|
|
315
|
+
.add("--palette-info-dark", "#4fc3f7")
|
|
316
|
+
.add("--palette-info-light", "#0288d1")
|
|
317
|
+
|
|
318
|
+
.add("--palette-info-text-main", "#0c3649")
|
|
319
|
+
.add("--palette-info-text-dark", "#173949")
|
|
320
|
+
.add("--palette-info-text-light", "#b3dbf1")
|
|
321
|
+
|
|
322
|
+
/*SUCCESS*/
|
|
323
|
+
|
|
324
|
+
.add("--palette-success-main", "#66bb6a")
|
|
325
|
+
.add("--palette-success-dark", "#81c784")
|
|
326
|
+
.add("--palette-success-light", "#388e3c")
|
|
327
|
+
|
|
328
|
+
.add("--palette-success-text-main", "#1e371f")
|
|
329
|
+
.add("--palette-success-text-dark", "#263b27")
|
|
330
|
+
.add("--palette-success-text-light", "#c3ddc5");
|
|
331
|
+
|
|
173
332
|
export class ThemeManager implements IThemeManager {
|
|
174
333
|
themes: ITheme[];
|
|
175
334
|
current: ITheme | null;
|
package/src/core/uid.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function UID(): string {
|
|
2
|
-
return "w-uid-" + Date.now().toString(36) + "-" + Math.random().toString(36);
|
|
3
|
-
}
|
|
1
|
+
export function UID(): string {
|
|
2
|
+
return "w-uid-" + Date.now().toString(36) + "-" + Math.random().toString(36);
|
|
3
|
+
}
|
|
@@ -4,7 +4,6 @@ import { IWidget, WUICallback, WUIEvent } from "./widget.interface";
|
|
|
4
4
|
import { Dialog } from "../ui/dialog";
|
|
5
5
|
import { Seo } from "../core/seo";
|
|
6
6
|
import { ThemeManager } from "../core/themes.core";
|
|
7
|
-
import { Vector2D } from "src/types/vector2d.type";
|
|
8
7
|
|
|
9
8
|
export interface IScreenSize {
|
|
10
9
|
minWidth: number;
|
|
@@ -30,6 +29,8 @@ export interface IApplication {
|
|
|
30
29
|
|
|
31
30
|
theme: ThemeManager;
|
|
32
31
|
|
|
32
|
+
loadedModule: any;
|
|
33
|
+
|
|
33
34
|
attachWidget(guest: IWidget, host: IWidget): void;
|
|
34
35
|
|
|
35
36
|
subscribe: (cb: WUICallback) => void;
|
|
@@ -48,7 +49,7 @@ export interface IApplication {
|
|
|
48
49
|
getRoot(): IWidget;
|
|
49
50
|
|
|
50
51
|
confirm(msg: string): void;
|
|
51
|
-
alert(msg: string): void;
|
|
52
|
+
alert(title: string, msg: string): void;
|
|
52
53
|
|
|
53
54
|
showLoading(): void;
|
|
54
55
|
hideLoading(): void;
|
|
@@ -13,6 +13,8 @@ export type WUIEvent =
|
|
|
13
13
|
| "mouseleave"
|
|
14
14
|
| "option-clicked"
|
|
15
15
|
| "wheel"
|
|
16
|
+
| "render"
|
|
17
|
+
| "scroll"
|
|
16
18
|
| "drag";
|
|
17
19
|
|
|
18
20
|
export type WUICallback = {
|
|
@@ -111,6 +113,7 @@ export interface IWidget {
|
|
|
111
113
|
getOverflow(): boolean;
|
|
112
114
|
|
|
113
115
|
addChild(child: IWidget | null): void;
|
|
116
|
+
populate(): void;
|
|
114
117
|
disableSelection(): void;
|
|
115
118
|
display(): void;
|
|
116
119
|
enableSelection(): void;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import "./styles/icon.css";
|
|
2
|
+
import { Colors } from "./colors.ui";
|
|
3
|
+
import { normalizeWidget, WidgetProps } from "./widget.builder";
|
|
4
|
+
import { connectWidgetCallback, getOnlyEventProps, Widget } from "./widget.ui";
|
|
5
|
+
import { UID } from "../core/uid";
|
|
6
|
+
|
|
7
|
+
export type IconVariants = "Filled" | "Outlined" | "Round" | "Sharp" | "Two Tone";
|
|
8
|
+
export type IconSizes = "small" | "medium" | "large" | "xlarge";
|
|
9
|
+
|
|
10
|
+
const iconSizesMap = {
|
|
11
|
+
small: "md-18",
|
|
12
|
+
medium: "md-24",
|
|
13
|
+
large: "md-36",
|
|
14
|
+
xlarge: "md-48",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const iconPixelSizesMap = {
|
|
18
|
+
small: "18px",
|
|
19
|
+
medium: "24px",
|
|
20
|
+
large: "36px",
|
|
21
|
+
xlarge: "48px",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export class Icon extends Widget {
|
|
25
|
+
variant: IconVariants;
|
|
26
|
+
color: Colors | null = null;
|
|
27
|
+
iconSize: IconSizes = "medium";
|
|
28
|
+
icon: string;
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
id: string,
|
|
32
|
+
icon: string,
|
|
33
|
+
variant: IconVariants = "Filled",
|
|
34
|
+
parent: Widget | null = null
|
|
35
|
+
) {
|
|
36
|
+
super(id, "span", parent);
|
|
37
|
+
|
|
38
|
+
this.variant = variant;
|
|
39
|
+
this.setColor("primary");
|
|
40
|
+
this.icon = icon;
|
|
41
|
+
|
|
42
|
+
this.setIconSize("medium");
|
|
43
|
+
|
|
44
|
+
if (this.variant === "Filled") {
|
|
45
|
+
this.addClass("material-icons");
|
|
46
|
+
} else {
|
|
47
|
+
this.addClass(
|
|
48
|
+
"material-icons-" + this.variant.toString().replace(" ", "-").toLowerCase()
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
this.setIcon(icon);
|
|
53
|
+
|
|
54
|
+
this.init();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public init(): void {
|
|
58
|
+
super.init();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public setIconSize(size: IconSizes = "medium"): void {
|
|
62
|
+
if (this.iconSize !== size) {
|
|
63
|
+
this.deleteClass(iconSizesMap[this.iconSize]);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
this.iconSize = size;
|
|
67
|
+
this.addClass(iconSizesMap[size]);
|
|
68
|
+
|
|
69
|
+
this.body.style.fontSize = iconPixelSizesMap[size];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public setIcon(icon: string): void {
|
|
73
|
+
this.icon = icon;
|
|
74
|
+
this.body.innerHTML = icon;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public setVariant(variant: IconVariants = "Filled"): void {
|
|
78
|
+
this.variant = variant;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public setColor(color: Colors = "primary"): void {
|
|
82
|
+
if (this.color !== color) {
|
|
83
|
+
this.deleteClass("WUI-icon-color-" + this.color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
this.addClass("WUI-icon-color-" + color);
|
|
87
|
+
|
|
88
|
+
this.color = color;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public getVariant(): IconVariants {
|
|
92
|
+
return this.variant;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public getColor(): Colors {
|
|
96
|
+
return this.color || "primary";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public getIcon(): string {
|
|
100
|
+
return this.icon;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public getIconSize(): IconSizes {
|
|
104
|
+
return this.iconSize;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public getRequiredWidth(): number {
|
|
108
|
+
const sizeString = iconPixelSizesMap[this.iconSize];
|
|
109
|
+
const size = parseInt(sizeString.split("px")[0]);
|
|
110
|
+
return size;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type wIconProps = WidgetProps & {
|
|
115
|
+
icon: string;
|
|
116
|
+
variant?: IconVariants | null;
|
|
117
|
+
color?: Colors | null;
|
|
118
|
+
size?: IconSizes | null;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const WIcon = (props: wIconProps) => {
|
|
122
|
+
if (!props.id) {
|
|
123
|
+
props.id = "Icon." + UID();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
127
|
+
|
|
128
|
+
return normalizeWidget(
|
|
129
|
+
<div
|
|
130
|
+
id={props.id}
|
|
131
|
+
w-icon
|
|
132
|
+
w-icon-name={props.icon}
|
|
133
|
+
w-variant={props.variant}
|
|
134
|
+
w-color={props.color}
|
|
135
|
+
w-size={props.size}
|
|
136
|
+
></div>,
|
|
137
|
+
props
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export function createIcon(id: string, content: any, parent: Widget | null = null): Icon {
|
|
142
|
+
const dataIcon = content.getAttribute("w-icon-name");
|
|
143
|
+
const dataVariant = content.getAttribute("w-variant") || "Filled";
|
|
144
|
+
const dataColor = content.getAttribute("w-color") || "primary";
|
|
145
|
+
const dataSize = content.getAttribute("w-size") || "medium";
|
|
146
|
+
|
|
147
|
+
let newIcon = new Icon(id, dataIcon, dataVariant, parent);
|
|
148
|
+
|
|
149
|
+
if (dataColor) {
|
|
150
|
+
newIcon.setColor(dataColor);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (dataSize) {
|
|
154
|
+
newIcon.setIconSize(dataSize);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return newIcon;
|
|
158
|
+
}
|
package/src/ui/IconButton.ui.tsx
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
import { Button, wButtonProps } from "./button.ui";
|
|
10
10
|
import { Icon } from "./Icon.ui";
|
|
11
11
|
import { Label } from "./label.ui";
|
|
12
|
+
import { normalizeWidget } from "./widget.builder";
|
|
13
|
+
import { UID } from "../core/uid";
|
|
12
14
|
|
|
13
15
|
export class IconButton extends Button {
|
|
14
16
|
icon: Icon;
|
|
@@ -16,10 +18,13 @@ export class IconButton extends Button {
|
|
|
16
18
|
|
|
17
19
|
showIcon: boolean;
|
|
18
20
|
showText: boolean;
|
|
21
|
+
centerX: boolean;
|
|
19
22
|
|
|
20
23
|
constructor(id: string, icon: string = "dark_mode", parent: Widget | null = null) {
|
|
21
24
|
super(id, parent);
|
|
22
25
|
|
|
26
|
+
this.centerX = false;
|
|
27
|
+
|
|
23
28
|
this.setAlign(WidgetAlignTypes.HORIZONTAL);
|
|
24
29
|
this.icon = new Icon(id + ".icon", icon, undefined, this);
|
|
25
30
|
this.label = new Label(id + ".label", undefined, this);
|
|
@@ -30,6 +35,16 @@ export class IconButton extends Button {
|
|
|
30
35
|
this.init();
|
|
31
36
|
}
|
|
32
37
|
|
|
38
|
+
protected updateRequiredWidth(): void {
|
|
39
|
+
if (!this.label) return;
|
|
40
|
+
if (!this.icon) return;
|
|
41
|
+
|
|
42
|
+
const labelWidth = this.label.getRequiredWidth();
|
|
43
|
+
const iconWith = this.icon.getRequiredWidth();
|
|
44
|
+
|
|
45
|
+
this.requiredWidth = labelWidth + iconWith + 70;
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
public displayIcon(): void {
|
|
34
49
|
this.showIcon = true;
|
|
35
50
|
this.icon.setVisible(true);
|
|
@@ -66,7 +81,8 @@ export class IconButton extends Button {
|
|
|
66
81
|
public render(): void {
|
|
67
82
|
super.render();
|
|
68
83
|
|
|
69
|
-
const
|
|
84
|
+
const labelWidth = this.label.getRequiredWidth();
|
|
85
|
+
const iconWidth = this.icon.getRequiredWidth();
|
|
70
86
|
const padding = 5;
|
|
71
87
|
|
|
72
88
|
if (this.onlyIcon()) {
|
|
@@ -81,10 +97,23 @@ export class IconButton extends Button {
|
|
|
81
97
|
this.label.getBody().style.position = "absolute";
|
|
82
98
|
this.icon.getBody().style.position = "absolute";
|
|
83
99
|
|
|
100
|
+
const availableWidth = this.getW() - padding * 5; //Doble padding a la derecha e izquierda y uno de separacion entre label y icon.
|
|
101
|
+
const requiredWidth = labelWidth + iconWidth + padding * 5;
|
|
102
|
+
|
|
84
103
|
const labelHeight = this.label.getBody().clientHeight;
|
|
85
104
|
|
|
86
|
-
|
|
105
|
+
let startX = availableWidth / 2 - (iconWidth + padding + labelWidth) / 2;
|
|
106
|
+
|
|
107
|
+
if (availableWidth < requiredWidth) {
|
|
108
|
+
startX = padding * 2;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!this.centerX) {
|
|
112
|
+
startX = padding * 2;
|
|
113
|
+
}
|
|
114
|
+
|
|
87
115
|
const startLabelX = startX + iconWidth + padding;
|
|
116
|
+
|
|
88
117
|
let startY = this.getH() / 2 - iconWidth / 2;
|
|
89
118
|
let startLabelY = this.getH() / 2 - labelHeight / 2;
|
|
90
119
|
|
|
@@ -112,10 +141,16 @@ export class IconButton extends Button {
|
|
|
112
141
|
public setText(text: string): void {
|
|
113
142
|
//super.setText(text);
|
|
114
143
|
this.label.setText(text);
|
|
144
|
+
this.updateRequiredWidth();
|
|
115
145
|
}
|
|
116
146
|
|
|
117
147
|
public setIcon(icon: string): void {
|
|
118
148
|
this.icon.setIcon(icon);
|
|
149
|
+
this.updateRequiredWidth();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public setCenterX(centerX: boolean): void {
|
|
153
|
+
this.centerX = centerX;
|
|
119
154
|
}
|
|
120
155
|
}
|
|
121
156
|
|
|
@@ -123,12 +158,17 @@ export type wIconButtonProps = Omit<wButtonProps, "text"> & {
|
|
|
123
158
|
icon?: string | null;
|
|
124
159
|
text?: string | null;
|
|
125
160
|
onlyIcon?: boolean | null;
|
|
161
|
+
centerX?: boolean | null;
|
|
126
162
|
};
|
|
127
163
|
|
|
128
164
|
export const WIconButton = (props: wIconButtonProps) => {
|
|
165
|
+
if (!props.id) {
|
|
166
|
+
props.id = "IconButton." + UID();
|
|
167
|
+
}
|
|
168
|
+
|
|
129
169
|
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
130
170
|
|
|
131
|
-
return (
|
|
171
|
+
return normalizeWidget(
|
|
132
172
|
<button
|
|
133
173
|
id={props.id}
|
|
134
174
|
w-icon-button
|
|
@@ -139,12 +179,9 @@ export const WIconButton = (props: wIconButtonProps) => {
|
|
|
139
179
|
w-color={props.color}
|
|
140
180
|
w-width={props.width}
|
|
141
181
|
w-height={props.height}
|
|
142
|
-
w-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
w-padding={props.padding}
|
|
146
|
-
w-type={props.type}
|
|
147
|
-
/>
|
|
182
|
+
w-center-x={props.centerX}
|
|
183
|
+
/>,
|
|
184
|
+
props
|
|
148
185
|
);
|
|
149
186
|
};
|
|
150
187
|
|
|
@@ -160,6 +197,7 @@ export function createIconButton(
|
|
|
160
197
|
const dataWidth = content.getAttribute("w-width");
|
|
161
198
|
const dataHeight = content.getAttribute("w-height");
|
|
162
199
|
const dataOnlyIcon = content.getAttribute("w-only-icon");
|
|
200
|
+
const dataCenterX = content.getAttribute("w-center-x");
|
|
163
201
|
|
|
164
202
|
let newIconButton = new IconButton(id, dataIcon, parent);
|
|
165
203
|
|
|
@@ -187,5 +225,9 @@ export function createIconButton(
|
|
|
187
225
|
newIconButton.onlyIcon();
|
|
188
226
|
}
|
|
189
227
|
|
|
228
|
+
if (dataCenterX) {
|
|
229
|
+
newIconButton.setCenterX(true);
|
|
230
|
+
}
|
|
231
|
+
|
|
190
232
|
return newIconButton;
|
|
191
233
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { WidgetProps } from "./widget.builder";
|
|
1
|
+
import { normalizeWidget, WidgetProps } from "./widget.builder";
|
|
2
2
|
import "./styles/textbox.css";
|
|
3
3
|
import { Widget, WidgetTypes, connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
4
|
+
import { UID } from "../core/uid";
|
|
4
5
|
|
|
5
6
|
export type InputTypes =
|
|
6
7
|
| "text"
|
|
@@ -53,7 +54,7 @@ export class Textbox extends Widget {
|
|
|
53
54
|
this.getBody().style.overflow = "";
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
getValue(): string {
|
|
57
|
+
public getValue(): string {
|
|
57
58
|
const value = (this.input.getBody() as HTMLInputElement).value;
|
|
58
59
|
|
|
59
60
|
if (value) return value;
|
|
@@ -61,7 +62,7 @@ export class Textbox extends Widget {
|
|
|
61
62
|
return "";
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
setValue(value: string): void {
|
|
65
|
+
public setValue(value: string): void {
|
|
65
66
|
(this.input.getBody() as HTMLInputElement).value = value;
|
|
66
67
|
this.positionLabel();
|
|
67
68
|
}
|
|
@@ -114,17 +115,17 @@ export class Textbox extends Widget {
|
|
|
114
115
|
super.render();
|
|
115
116
|
}
|
|
116
117
|
|
|
117
|
-
setTitle(title: string): void {
|
|
118
|
+
public setTitle(title: string): void {
|
|
118
119
|
this.title = title;
|
|
119
120
|
this.label.getBody().innerHTML = this.title;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
setInputType(type: InputTypes): void {
|
|
123
|
+
public setInputType(type: InputTypes): void {
|
|
123
124
|
this.inputType = type;
|
|
124
125
|
this.input.getBody().setAttribute("type", this.inputType);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
getTitle(): string {
|
|
128
|
+
public getTitle(): string {
|
|
128
129
|
return this.title;
|
|
129
130
|
}
|
|
130
131
|
|
|
@@ -132,11 +133,11 @@ export class Textbox extends Widget {
|
|
|
132
133
|
return this.label;
|
|
133
134
|
}*/
|
|
134
135
|
|
|
135
|
-
getInput(): Widget {
|
|
136
|
+
public getInput(): Widget {
|
|
136
137
|
return this.input;
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
getInputType(): string {
|
|
140
|
+
public getInputType(): string {
|
|
140
141
|
return this.inputType;
|
|
141
142
|
}
|
|
142
143
|
}
|
|
@@ -146,25 +147,27 @@ export type wTextBoxProps = WidgetProps & {
|
|
|
146
147
|
inputType?: InputTypes | null;
|
|
147
148
|
width?: number | null;
|
|
148
149
|
height?: number | null;
|
|
150
|
+
value?: string | null;
|
|
149
151
|
};
|
|
150
152
|
|
|
151
153
|
export const WTextbox = (props: wTextBoxProps) => {
|
|
154
|
+
if (!props.id) {
|
|
155
|
+
props.id = "Textbox." + UID();
|
|
156
|
+
}
|
|
157
|
+
|
|
152
158
|
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
153
159
|
|
|
154
|
-
return (
|
|
160
|
+
return normalizeWidget(
|
|
155
161
|
<input
|
|
156
162
|
id={props.id}
|
|
157
163
|
w-textbox
|
|
158
164
|
w-title={props.title}
|
|
165
|
+
w-value={props.value}
|
|
159
166
|
w-input-type={props.inputType}
|
|
160
167
|
w-width={props.width}
|
|
161
168
|
w-height={props.height}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
w-fixed-size={props.fixedSize}
|
|
165
|
-
w-padding={props.padding}
|
|
166
|
-
w-type={props.type}
|
|
167
|
-
/>
|
|
169
|
+
/>,
|
|
170
|
+
props
|
|
168
171
|
);
|
|
169
172
|
};
|
|
170
173
|
|
|
@@ -172,6 +175,7 @@ export function createTextbox(id: string, content: any, parent: Widget | null =
|
|
|
172
175
|
let newTextbox = new Textbox(id, parent);
|
|
173
176
|
|
|
174
177
|
const dataTitle = content.getAttribute("w-title");
|
|
178
|
+
const dataValue = content.getAttribute("w-value");
|
|
175
179
|
const dataInputType = content.getAttribute("w-input-type");
|
|
176
180
|
const dataWidth = content.getAttribute("w-width");
|
|
177
181
|
const dataHeight = content.getAttribute("w-height");
|
|
@@ -188,6 +192,10 @@ export function createTextbox(id: string, content: any, parent: Widget | null =
|
|
|
188
192
|
newTextbox.setInitialH(dataHeight);
|
|
189
193
|
}
|
|
190
194
|
|
|
195
|
+
if (dataValue) {
|
|
196
|
+
newTextbox.setValue(dataValue);
|
|
197
|
+
}
|
|
198
|
+
|
|
191
199
|
newTextbox.setTitle(dataTitle);
|
|
192
200
|
|
|
193
201
|
return newTextbox;
|