cedro 0.1.12 → 0.1.13
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/lib/assets/_virtual/_commonjsHelpers.js +1 -0
- package/lib/assets/_virtual/index.js +1 -0
- package/lib/assets/_virtual/modulepreload-polyfill.js +1 -0
- package/lib/assets/_virtual/named-references.js +1 -0
- package/lib/assets/_virtual/numeric-unicode-map.js +1 -0
- package/lib/assets/_virtual/surrogate-pairs.js +1 -0
- package/lib/assets/core/application.builder.js +1 -0
- package/lib/assets/core/application.core.js +1 -0
- package/lib/assets/core/jsxsupport.js +1 -0
- package/lib/assets/core/screeen.core.js +1 -0
- package/lib/assets/core/seo.js +1 -0
- package/lib/assets/core/themes.core.js +1 -0
- package/lib/assets/core/uid.js +1 -0
- package/lib/assets/index.js +5 -0
- package/lib/assets/material-icons-outlined.woff +0 -0
- package/lib/assets/material-icons-outlined.woff2 +0 -0
- package/lib/assets/material-icons-round.woff +0 -0
- package/lib/assets/material-icons-round.woff2 +0 -0
- package/lib/assets/material-icons-sharp.woff +0 -0
- package/lib/assets/material-icons-sharp.woff2 +0 -0
- package/lib/assets/material-icons-two-tone.woff +0 -0
- package/lib/assets/material-icons-two-tone.woff2 +0 -0
- package/lib/assets/material-icons.woff +0 -0
- package/lib/assets/material-icons.woff2 +0 -0
- package/lib/assets/node_modules/@fontsource/roboto/100.css +1 -0
- package/lib/assets/node_modules/@fontsource/roboto/300.css +1 -0
- package/lib/assets/node_modules/@fontsource/roboto/400.css +1 -0
- package/lib/assets/node_modules/@fontsource/roboto/500.css +1 -0
- package/lib/assets/node_modules/@fontsource/roboto/700.css +1 -0
- package/lib/assets/node_modules/@fontsource/roboto/900.css +1 -0
- package/lib/assets/node_modules/html-entities/lib/index.js +1 -0
- package/lib/assets/node_modules/html-entities/lib/named-references.js +2 -0
- package/lib/assets/node_modules/html-entities/lib/numeric-unicode-map.js +1 -0
- package/lib/assets/node_modules/html-entities/lib/surrogate-pairs.js +1 -0
- package/lib/assets/node_modules/material-icons/iconfont/material-icons.css +1 -0
- package/lib/assets/node_modules/navigo/lib/es/Q.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/constants.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/index.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/lifecycles.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/callHandler.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForAfterHook.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForAlreadyHook.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForBeforeHook.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForDeprecationMethods.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForForceOp.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForLeaveHook.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/checkForNotFoundHandler.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/errorOut.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/flushCurrent.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/matchPathToRegisteredRoutes.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/processMatches.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/setLocationPath.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/updateBrowserURL.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/updateState.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/middlewares/waitingList.js +1 -0
- package/lib/assets/node_modules/navigo/lib/es/utils.js +1 -0
- package/lib/assets/roboto-cyrillic-100-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-100-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-300-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-300-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-400-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-400-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-500-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-500-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-700-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-700-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-900-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-900-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-100-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-100-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-300-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-300-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-400-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-400-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-500-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-500-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-700-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-700-normal.woff2 +0 -0
- package/lib/assets/roboto-cyrillic-ext-900-normal.woff +0 -0
- package/lib/assets/roboto-cyrillic-ext-900-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-100-normal.woff +0 -0
- package/lib/assets/roboto-greek-100-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-300-normal.woff +0 -0
- package/lib/assets/roboto-greek-300-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-400-normal.woff +0 -0
- package/lib/assets/roboto-greek-400-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-500-normal.woff +0 -0
- package/lib/assets/roboto-greek-500-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-700-normal.woff +0 -0
- package/lib/assets/roboto-greek-700-normal.woff2 +0 -0
- package/lib/assets/roboto-greek-900-normal.woff +0 -0
- package/lib/assets/roboto-greek-900-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-100-normal.woff +0 -0
- package/lib/assets/roboto-latin-100-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-300-normal.woff +0 -0
- package/lib/assets/roboto-latin-300-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-400-normal.woff +0 -0
- package/lib/assets/roboto-latin-400-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-500-normal.woff +0 -0
- package/lib/assets/roboto-latin-500-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-700-normal.woff +0 -0
- package/lib/assets/roboto-latin-700-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-900-normal.woff +0 -0
- package/lib/assets/roboto-latin-900-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-100-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-100-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-300-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-300-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-400-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-400-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-500-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-500-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-700-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-700-normal.woff2 +0 -0
- package/lib/assets/roboto-latin-ext-900-normal.woff +0 -0
- package/lib/assets/roboto-latin-ext-900-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-100-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-100-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-300-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-300-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-400-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-400-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-500-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-500-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-700-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-700-normal.woff2 +0 -0
- package/lib/assets/roboto-vietnamese-900-normal.woff +0 -0
- package/lib/assets/roboto-vietnamese-900-normal.woff2 +0 -0
- package/lib/assets/types/select.item.type.js +1 -0
- package/lib/assets/ui/Icon.ui.js +1 -0
- package/lib/assets/ui/IconButton.ui.js +1 -0
- package/lib/assets/ui/Textbox.ui.js +1 -0
- package/lib/assets/ui/accordion.ui.js +1 -0
- package/lib/assets/ui/button.ui.js +1 -0
- package/lib/assets/ui/buttonColor.ui.js +1 -0
- package/lib/assets/ui/buttonmenu.ui.js +1 -0
- package/lib/assets/ui/buttonstack.ui.js +1 -0
- package/lib/assets/ui/checkbox.ui.js +1 -0
- package/lib/assets/ui/container.ui.js +1 -0
- package/lib/assets/ui/datagrid.ui.js +1 -0
- package/lib/assets/ui/dialog.js +1 -0
- package/lib/assets/ui/draggable.ui.js +1 -0
- package/lib/assets/ui/hpanel.ui.js +1 -0
- package/lib/assets/ui/iconButtonMenu.ui.js +1 -0
- package/lib/assets/ui/image.ui.js +1 -0
- package/lib/assets/ui/label.ui.js +1 -0
- package/lib/assets/ui/loading.ui.js +1 -0
- package/lib/assets/ui/menu.ui.js +1 -0
- package/lib/assets/ui/progressbar.ui.js +1 -0
- package/lib/assets/ui/radiobutton.ui.js +1 -0
- package/lib/assets/ui/scroll.ui.js +1 -0
- package/lib/assets/ui/select.ui.js +1 -0
- package/lib/assets/ui/styles/accordion.css +1 -0
- package/lib/assets/ui/styles/button.css +1 -0
- package/lib/assets/ui/styles/buttoncolor.css +1 -0
- package/lib/assets/ui/styles/container.css +1 -0
- package/lib/assets/ui/styles/datagrid.css +1 -0
- package/lib/assets/ui/styles/dialog.css +1 -0
- package/lib/assets/ui/styles/draggable.css +1 -0
- package/lib/assets/ui/styles/hpanel.css +1 -0
- package/lib/assets/ui/styles/icon.css +1 -0
- package/lib/assets/ui/styles/image.css +1 -0
- package/lib/assets/ui/styles/label.css +1 -0
- package/lib/assets/ui/styles/loading.css +1 -0
- package/lib/assets/ui/styles/main.css +1 -0
- package/lib/assets/ui/styles/menu.css +1 -0
- package/lib/assets/ui/styles/progressbar.css +1 -0
- package/lib/assets/ui/styles/scroll.css +1 -0
- package/lib/assets/ui/styles/select.css +1 -0
- package/lib/assets/ui/styles/stackbutton.css +1 -0
- package/lib/assets/ui/styles/tabs.css +1 -0
- package/lib/assets/ui/styles/textarea.css +1 -0
- package/lib/assets/ui/styles/textbox.css +1 -0
- package/lib/assets/ui/styles/toolbar.css +1 -0
- package/lib/assets/ui/styles/valuebar.css +1 -0
- package/lib/assets/ui/styles/vpanel.css +1 -0
- package/lib/assets/ui/styles/vstackbutton.css +1 -0
- package/lib/assets/ui/switch.ui.js +1 -0
- package/lib/assets/ui/tabs.ui.js +1 -0
- package/lib/assets/ui/textarea.ui.js +1 -0
- package/lib/assets/ui/toggle.ui.js +1 -0
- package/lib/assets/ui/toolbar.ui.js +1 -0
- package/lib/assets/ui/valuebar.ui.js +1 -0
- package/lib/assets/ui/vpanel.ui.js +1 -0
- package/lib/assets/ui/widget.builder.js +1 -0
- package/lib/assets/ui/widget.collection.js +1 -0
- package/lib/assets/ui/widget.ui.js +1 -0
- package/lib/cedro-logo.png +0 -0
- package/lib/cedro-logo.svg +97 -0
- package/lib/fangio.jpg +0 -0
- package/lib/material-icons-list.json/357/200/272Zone.Identifier +3 -0
- package/package.json +10 -4
- package/rollup.config.js +31 -0
- package/tsconfig.json +3 -0
- package/tsconfig.publish.json +3 -0
- package/vite.publish.config.ts +41 -0
- package/lib/core/application.builder.d.ts +0 -2
- package/lib/core/application.builder.jsx +0 -103
- package/lib/core/application.builder.jsx.map +0 -1
- package/lib/core/application.core.d.ts +0 -96
- package/lib/core/application.core.jsx +0 -290
- package/lib/core/application.core.jsx.map +0 -1
- package/lib/core/index.d.ts +0 -3
- package/lib/core/index.js +0 -4
- package/lib/core/index.js.map +0 -1
- package/lib/core/jsxsupport.d.ts +0 -13
- package/lib/core/jsxsupport.js +0 -82
- package/lib/core/jsxsupport.js.map +0 -1
- package/lib/core/screeen.core.d.ts +0 -41
- package/lib/core/screeen.core.js +0 -76
- package/lib/core/screeen.core.js.map +0 -1
- package/lib/core/seo.d.ts +0 -33
- package/lib/core/seo.js +0 -66
- package/lib/core/seo.js.map +0 -1
- package/lib/core/themes.core.d.ts +0 -22
- package/lib/core/themes.core.js +0 -317
- package/lib/core/themes.core.js.map +0 -1
- package/lib/core/uid.d.ts +0 -1
- package/lib/core/uid.js +0 -4
- package/lib/core/uid.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/interfaces/application.interface.d.ts +0 -39
- package/lib/interfaces/application.interface.js +0 -6
- package/lib/interfaces/application.interface.js.map +0 -1
- package/lib/interfaces/screen.interface.d.ts +0 -12
- package/lib/interfaces/screen.interface.js +0 -2
- package/lib/interfaces/screen.interface.js.map +0 -1
- package/lib/interfaces/themes.interface.d.ts +0 -15
- package/lib/interfaces/themes.interface.js +0 -2
- package/lib/interfaces/themes.interface.js.map +0 -1
- package/lib/interfaces/widget.interface.d.ts +0 -85
- package/lib/interfaces/widget.interface.js +0 -2
- package/lib/interfaces/widget.interface.js.map +0 -1
- package/lib/types/orientation.type.d.ts +0 -1
- package/lib/types/orientation.type.js +0 -2
- package/lib/types/orientation.type.js.map +0 -1
- package/lib/types/select.item.type.d.ts +0 -6
- package/lib/types/select.item.type.js +0 -26
- package/lib/types/select.item.type.js.map +0 -1
- package/lib/types/vector2d.type.d.ts +0 -4
- package/lib/types/vector2d.type.js +0 -2
- package/lib/types/vector2d.type.js.map +0 -1
- package/lib/ui/Icon.ui.d.ts +0 -31
- package/lib/ui/Icon.ui.jsx +0 -121
- package/lib/ui/Icon.ui.jsx.map +0 -1
- package/lib/ui/IconButton.ui.d.ts +0 -32
- package/lib/ui/IconButton.ui.jsx +0 -184
- package/lib/ui/IconButton.ui.jsx.map +0 -1
- package/lib/ui/Textbox.ui.d.ts +0 -32
- package/lib/ui/Textbox.ui.jsx +0 -152
- package/lib/ui/Textbox.ui.jsx.map +0 -1
- package/lib/ui/accordion.ui.d.ts +0 -27
- package/lib/ui/accordion.ui.jsx +0 -108
- package/lib/ui/accordion.ui.jsx.map +0 -1
- package/lib/ui/button.ui.d.ts +0 -44
- package/lib/ui/button.ui.jsx +0 -180
- package/lib/ui/button.ui.jsx.map +0 -1
- package/lib/ui/buttonColor.ui.d.ts +0 -14
- package/lib/ui/buttonColor.ui.jsx +0 -58
- package/lib/ui/buttonColor.ui.jsx.map +0 -1
- package/lib/ui/buttonmenu.ui.d.ts +0 -23
- package/lib/ui/buttonmenu.ui.jsx +0 -104
- package/lib/ui/buttonmenu.ui.jsx.map +0 -1
- package/lib/ui/buttonstack.ui.d.ts +0 -26
- package/lib/ui/buttonstack.ui.jsx +0 -138
- package/lib/ui/buttonstack.ui.jsx.map +0 -1
- package/lib/ui/checkbox.ui.d.ts +0 -12
- package/lib/ui/checkbox.ui.jsx +0 -29
- package/lib/ui/checkbox.ui.jsx.map +0 -1
- package/lib/ui/colors.ui.d.ts +0 -1
- package/lib/ui/colors.ui.js +0 -2
- package/lib/ui/colors.ui.js.map +0 -1
- package/lib/ui/container.ui.d.ts +0 -33
- package/lib/ui/container.ui.jsx +0 -96
- package/lib/ui/container.ui.jsx.map +0 -1
- package/lib/ui/datagrid.ui.d.ts +0 -119
- package/lib/ui/datagrid.ui.jsx +0 -445
- package/lib/ui/datagrid.ui.jsx.map +0 -1
- package/lib/ui/dialog.d.ts +0 -102
- package/lib/ui/dialog.jsx +0 -480
- package/lib/ui/dialog.jsx.map +0 -1
- package/lib/ui/draggable.ui.d.ts +0 -27
- package/lib/ui/draggable.ui.js +0 -183
- package/lib/ui/draggable.ui.js.map +0 -1
- package/lib/ui/hpanel.ui.d.ts +0 -26
- package/lib/ui/hpanel.ui.jsx +0 -183
- package/lib/ui/hpanel.ui.jsx.map +0 -1
- package/lib/ui/iconButtonMenu.ui.d.ts +0 -27
- package/lib/ui/iconButtonMenu.ui.jsx +0 -135
- package/lib/ui/iconButtonMenu.ui.jsx.map +0 -1
- package/lib/ui/image.ui.d.ts +0 -25
- package/lib/ui/image.ui.jsx +0 -88
- package/lib/ui/image.ui.jsx.map +0 -1
- package/lib/ui/index.d.ts +0 -30
- package/lib/ui/index.js +0 -30
- package/lib/ui/index.js.map +0 -1
- package/lib/ui/label.ui.d.ts +0 -37
- package/lib/ui/label.ui.jsx +0 -155
- package/lib/ui/label.ui.jsx.map +0 -1
- package/lib/ui/loading.ui.d.ts +0 -5
- package/lib/ui/loading.ui.js +0 -10
- package/lib/ui/loading.ui.js.map +0 -1
- package/lib/ui/menu.ui.d.ts +0 -19
- package/lib/ui/menu.ui.js +0 -186
- package/lib/ui/menu.ui.js.map +0 -1
- package/lib/ui/progressbar.ui.d.ts +0 -23
- package/lib/ui/progressbar.ui.jsx +0 -109
- package/lib/ui/progressbar.ui.jsx.map +0 -1
- package/lib/ui/radiobutton.ui.d.ts +0 -12
- package/lib/ui/radiobutton.ui.jsx +0 -29
- package/lib/ui/radiobutton.ui.jsx.map +0 -1
- package/lib/ui/scroll.ui.d.ts +0 -13
- package/lib/ui/scroll.ui.js +0 -163
- package/lib/ui/scroll.ui.js.map +0 -1
- package/lib/ui/select.ui.d.ts +0 -29
- package/lib/ui/select.ui.jsx +0 -129
- package/lib/ui/select.ui.jsx.map +0 -1
- package/lib/ui/switch.ui.d.ts +0 -12
- package/lib/ui/switch.ui.jsx +0 -29
- package/lib/ui/switch.ui.jsx.map +0 -1
- package/lib/ui/tabs.ui.d.ts +0 -40
- package/lib/ui/tabs.ui.jsx +0 -242
- package/lib/ui/tabs.ui.jsx.map +0 -1
- package/lib/ui/textarea.ui.d.ts +0 -13
- package/lib/ui/textarea.ui.jsx +0 -34
- package/lib/ui/textarea.ui.jsx.map +0 -1
- package/lib/ui/toggle.ui.d.ts +0 -11
- package/lib/ui/toggle.ui.jsx +0 -48
- package/lib/ui/toggle.ui.jsx.map +0 -1
- package/lib/ui/toolbar.ui.d.ts +0 -44
- package/lib/ui/toolbar.ui.jsx +0 -261
- package/lib/ui/toolbar.ui.jsx.map +0 -1
- package/lib/ui/valuebar.ui.d.ts +0 -23
- package/lib/ui/valuebar.ui.jsx +0 -144
- package/lib/ui/valuebar.ui.jsx.map +0 -1
- package/lib/ui/vpanel.ui.d.ts +0 -24
- package/lib/ui/vpanel.ui.jsx +0 -170
- package/lib/ui/vpanel.ui.jsx.map +0 -1
- package/lib/ui/widget.builder.d.ts +0 -25
- package/lib/ui/widget.builder.js +0 -216
- package/lib/ui/widget.builder.js.map +0 -1
- package/lib/ui/widget.collection.d.ts +0 -20
- package/lib/ui/widget.collection.js +0 -49
- package/lib/ui/widget.collection.js.map +0 -1
- package/lib/ui/widget.ui.d.ts +0 -337
- package/lib/ui/widget.ui.js +0 -964
- package/lib/ui/widget.ui.js.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { UID } from "../core/uid";
|
|
2
|
-
import { Label } from "./label.ui";
|
|
3
|
-
import "./styles/progressbar.css";
|
|
4
|
-
import { normalizeWidget } from "./widget.builder";
|
|
5
|
-
import { Widget, WidgetTypes, connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
6
|
-
const PROGRESS_BAR_HEIGHT = 40;
|
|
7
|
-
//icono para el progress bar interactivo humidity_high
|
|
8
|
-
export class ProgressBar extends Widget {
|
|
9
|
-
constructor(id, parent = null) {
|
|
10
|
-
super(id, "div", parent);
|
|
11
|
-
Object.defineProperty(this, "value", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "paddingBar", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: void 0
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "bar", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: void 0
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(this, "lblValue", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: void 0
|
|
34
|
-
});
|
|
35
|
-
this.setH(PROGRESS_BAR_HEIGHT);
|
|
36
|
-
this.paddingBar = 0;
|
|
37
|
-
this.bar = new Widget(id + ".bar", "div", this);
|
|
38
|
-
this.bar.addClass("WUIProgressBarBar");
|
|
39
|
-
this.value = 0;
|
|
40
|
-
this.addClass("WUIProgressBarContainer");
|
|
41
|
-
this.lblValue = new Label(id + ".value", "span", this);
|
|
42
|
-
this.lblValue.setType(WidgetTypes.CUSTOM);
|
|
43
|
-
this.lblValue.setVCentered(true);
|
|
44
|
-
this.lblValue.setHCentered(true);
|
|
45
|
-
this.lblValue.setText(this.value + "%");
|
|
46
|
-
this.lblValue.addClass("WUIProgressBarLabel");
|
|
47
|
-
}
|
|
48
|
-
setPaddingBar(p) {
|
|
49
|
-
this.paddingBar = p;
|
|
50
|
-
}
|
|
51
|
-
hideLabel() {
|
|
52
|
-
this.lblValue.setVisible(false);
|
|
53
|
-
}
|
|
54
|
-
displayLabel() {
|
|
55
|
-
this.lblValue.setVisible(true);
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
super.render();
|
|
59
|
-
const padding = this.paddingBar;
|
|
60
|
-
const width = this.getW() - padding;
|
|
61
|
-
const height = this.getH();
|
|
62
|
-
const widthBar = width * (this.value / 100);
|
|
63
|
-
this.lblValue.setX(padding);
|
|
64
|
-
this.lblValue.setY(0);
|
|
65
|
-
this.lblValue.setW(width);
|
|
66
|
-
this.lblValue.setH(height);
|
|
67
|
-
this.lblValue.raisteTop();
|
|
68
|
-
this.lblValue.render();
|
|
69
|
-
this.bar.setX(padding);
|
|
70
|
-
this.bar.setY(padding);
|
|
71
|
-
this.bar.setW(widthBar);
|
|
72
|
-
this.bar.setH(height - padding * 2);
|
|
73
|
-
}
|
|
74
|
-
setValue(value) {
|
|
75
|
-
this.value = value;
|
|
76
|
-
this.lblValue.setText(this.value + "%");
|
|
77
|
-
this.render();
|
|
78
|
-
}
|
|
79
|
-
getValue() {
|
|
80
|
-
return this.value;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
export const WProgressBar = (props) => {
|
|
84
|
-
if (!props.id) {
|
|
85
|
-
props.id = "ProgressBar." + UID();
|
|
86
|
-
}
|
|
87
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
88
|
-
return normalizeWidget(<div id={props.id} w-progressbar w-value={props.value} w-padding-bar={props.paddingBar} w-hide-label={props.hideLabel}></div>, props);
|
|
89
|
-
};
|
|
90
|
-
export function createProgressBar(id, content, parent = null) {
|
|
91
|
-
let newProgressBar = new ProgressBar(id, parent);
|
|
92
|
-
const dataValue = content.getAttribute("w-value");
|
|
93
|
-
const dataPaddingBar = content.getAttribute("w-padding-bar");
|
|
94
|
-
const dataHideLabel = content.getAttribute("w-hide-label");
|
|
95
|
-
if (dataValue) {
|
|
96
|
-
newProgressBar.setValue(parseInt(dataValue));
|
|
97
|
-
}
|
|
98
|
-
if (dataPaddingBar) {
|
|
99
|
-
newProgressBar.setPaddingBar(parseInt(dataPaddingBar));
|
|
100
|
-
}
|
|
101
|
-
if (dataHideLabel !== null) {
|
|
102
|
-
newProgressBar.hideLabel();
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
newProgressBar.displayLabel();
|
|
106
|
-
}
|
|
107
|
-
return newProgressBar;
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=progressbar.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progressbar.ui.jsx","sourceRoot":"","sources":["../../src/ui/progressbar.ui.t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Y,CAAC,cAAc,CAAC,CAAC;IAE3D,IAAI,SAAS,EAAE,CAAC;QACZ,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QACjB,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QACzB,cAAc,CAAC,SAAS,EAAE,CAAC;IAC/B,CAAC;SAAM,CAAC;QACJ,cAAc,CAAC,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,OAAO,cAAc,CAAC;AAC1B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ToggleButton } from "./toggle.ui";
|
|
2
|
-
import { WidgetProps } from "./widget.builder";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
export declare class RadioButton extends ToggleButton {
|
|
5
|
-
constructor(id: string, text?: string, parent?: Widget | null);
|
|
6
|
-
}
|
|
7
|
-
export type wRadioButtonProps = WidgetProps & {
|
|
8
|
-
text: string;
|
|
9
|
-
checked?: boolean | null;
|
|
10
|
-
};
|
|
11
|
-
export declare const WRadioButton: (props: wRadioButtonProps) => any;
|
|
12
|
-
export declare function createRadioButton(id: string, content: any, parent?: Widget | null): RadioButton;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { UID } from "../core/uid";
|
|
2
|
-
import { ToggleButton } from "./toggle.ui";
|
|
3
|
-
import { normalizeWidget } from "./widget.builder";
|
|
4
|
-
import { connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
5
|
-
export class RadioButton extends ToggleButton {
|
|
6
|
-
constructor(id, text = "", parent = null) {
|
|
7
|
-
super(id, text, "radio_button_checked", "radio_button_unchecked", parent);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export const WRadioButton = (props) => {
|
|
11
|
-
if (!props.id) {
|
|
12
|
-
props.id = "RadioButton." + UID();
|
|
13
|
-
}
|
|
14
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
15
|
-
return normalizeWidget(<div id={props.id} w-radiobutton w-text={props.text} w-checked={props.checked}/>, props);
|
|
16
|
-
};
|
|
17
|
-
export function createRadioButton(id, content, parent = null) {
|
|
18
|
-
const dataText = content.getAttribute("w-text");
|
|
19
|
-
const dataChecked = content.getAttribute("w-checked");
|
|
20
|
-
let newRadioButton = new RadioButton(id, dataText, parent);
|
|
21
|
-
if (dataChecked !== null) {
|
|
22
|
-
newRadioButton.setState(true);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
newRadioButton.setState(false);
|
|
26
|
-
}
|
|
27
|
-
return newRadioButton;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=radiobutton.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radiobutton.ui.jsx","sourceRoot":"","sources":["../../src/ui/radiobutton.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAU,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/E,MAAM,OAAO,WAAY,SAAQ,YAAY;IACzC,YAAY,EAAU,EAAE,OAAe,EAAE,EAAE,SAAwB,IAAI;QACnE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC;CACJ;AAOD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACrD,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;QACZ,KAAK,CAAC,EAAE,GAAG,cAAc,GAAG,GAAG,EAAE,CAAC;IACtC,CAAC;IAED,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1D,OAAO,eAAe,CAClB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAG,EACjF,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAC7B,EAAU,EACV,OAAY,EACZ,SAAwB,IAAI;IAE5B,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAEtD,IAAI,cAAc,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE3D,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACvB,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;SAAM,CAAC;QACJ,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,cAAc,CAAC;AAC1B,CAAC"}
|
package/lib/ui/scroll.ui.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { OrientationTypes } from "src/types/orientation.type";
|
|
2
|
-
import "./styles/scroll.css";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
import { Draggable } from "./draggable.ui";
|
|
5
|
-
export declare class Scroll extends Widget {
|
|
6
|
-
contentArea: Widget;
|
|
7
|
-
orientation: OrientationTypes;
|
|
8
|
-
drag: Draggable;
|
|
9
|
-
constructor(id: string, contentArea: Widget, orientation?: OrientationTypes);
|
|
10
|
-
private getScrollData;
|
|
11
|
-
private updateScrollPositionByScrollbar;
|
|
12
|
-
render(): void;
|
|
13
|
-
}
|
package/lib/ui/scroll.ui.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import "./styles/scroll.css";
|
|
2
|
-
import { Widget, WidgetTypes } from "./widget.ui";
|
|
3
|
-
import { Draggable } from "./draggable.ui";
|
|
4
|
-
const SCROLL_SIZE = 10;
|
|
5
|
-
export class Scroll extends Widget {
|
|
6
|
-
constructor(id, contentArea, orientation = "vertical") {
|
|
7
|
-
super(id, "div");
|
|
8
|
-
Object.defineProperty(this, "contentArea", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
configurable: true,
|
|
11
|
-
writable: true,
|
|
12
|
-
value: void 0
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(this, "orientation", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
configurable: true,
|
|
17
|
-
writable: true,
|
|
18
|
-
value: void 0
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(this, "drag", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: void 0
|
|
25
|
-
});
|
|
26
|
-
this.contentArea = contentArea;
|
|
27
|
-
this.orientation = orientation;
|
|
28
|
-
this.setType(WidgetTypes.CUSTOM);
|
|
29
|
-
this.getBody().style.overflow = "hidden";
|
|
30
|
-
this.getBody().style.position = "fixed";
|
|
31
|
-
this.addClass("WUIScrollbar");
|
|
32
|
-
this.drag = new Draggable(this, orientation);
|
|
33
|
-
this.contentArea.subscribe({
|
|
34
|
-
event: "wheel",
|
|
35
|
-
then: (e, _w) => {
|
|
36
|
-
const wheel = e;
|
|
37
|
-
this.contentArea.getBody().scrollBy(0, wheel.deltaY);
|
|
38
|
-
this.render();
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
this.subscribe({
|
|
42
|
-
event: "drag",
|
|
43
|
-
then: (_e, _w) => {
|
|
44
|
-
this.updateScrollPositionByScrollbar();
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
getScrollData() {
|
|
49
|
-
let returnData = {
|
|
50
|
-
scrollHeight: 0,
|
|
51
|
-
areaHeight: 0,
|
|
52
|
-
scrollBarHeight: 0,
|
|
53
|
-
scrollWidth: 0,
|
|
54
|
-
areaWidth: 0,
|
|
55
|
-
scrollBarWidth: 0,
|
|
56
|
-
scrollWidt: 0,
|
|
57
|
-
availablePositionSize: 0,
|
|
58
|
-
ratioScroll: 0,
|
|
59
|
-
position: 0,
|
|
60
|
-
scrollPositionY: 0,
|
|
61
|
-
};
|
|
62
|
-
if (this.orientation === "vertical") {
|
|
63
|
-
returnData.scrollHeight = this.contentArea.getBody().scrollHeight;
|
|
64
|
-
returnData.areaHeight = this.contentArea.getH();
|
|
65
|
-
returnData.scrollBarHeight =
|
|
66
|
-
returnData.areaHeight * (returnData.areaHeight / returnData.scrollHeight);
|
|
67
|
-
returnData.availablePositionSize =
|
|
68
|
-
returnData.areaHeight - returnData.scrollBarHeight - 1;
|
|
69
|
-
returnData.ratioScroll =
|
|
70
|
-
this.contentArea.getBody().scrollTop /
|
|
71
|
-
(returnData.areaHeight - returnData.scrollBarHeight);
|
|
72
|
-
returnData.position = returnData.availablePositionSize * returnData.ratioScroll;
|
|
73
|
-
if (returnData.scrollBarHeight >= returnData.areaHeight) {
|
|
74
|
-
returnData.scrollBarHeight = returnData.areaHeight;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else if (this.orientation === "horizontal") {
|
|
78
|
-
returnData.scrollWidth = this.contentArea.getBody().scrollWidth;
|
|
79
|
-
returnData.areaWidth = this.contentArea.getW();
|
|
80
|
-
returnData.scrollBarWidth =
|
|
81
|
-
returnData.areaWidth * (returnData.areaWidth / returnData.scrollWidth);
|
|
82
|
-
returnData.availablePositionSize = returnData.areaWidth - returnData.scrollBarWidth - 1;
|
|
83
|
-
returnData.ratioScroll =
|
|
84
|
-
this.contentArea.getBody().scrollLeft /
|
|
85
|
-
(returnData.areaWidth - returnData.scrollBarWidth);
|
|
86
|
-
returnData.position = returnData.availablePositionSize * returnData.ratioScroll;
|
|
87
|
-
returnData.scrollPositionY = this.contentArea.getH() + this.contentArea.getY();
|
|
88
|
-
if (returnData.scrollBarWidth >= returnData.areaWidth) {
|
|
89
|
-
returnData.scrollBarWidth = returnData.areaWidth;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return returnData;
|
|
93
|
-
}
|
|
94
|
-
updateScrollPositionByScrollbar() {
|
|
95
|
-
const scrollData = this.getScrollData();
|
|
96
|
-
if (this.orientation === "vertical") {
|
|
97
|
-
const recorrido = scrollData.scrollHeight - scrollData.areaHeight;
|
|
98
|
-
const maxY = this.drag.maxY ? this.drag.maxY : 1;
|
|
99
|
-
const ratio = (this.getY() - this.contentArea.getY(true)) / maxY;
|
|
100
|
-
this.contentArea.getBody().scrollTop = recorrido * ratio;
|
|
101
|
-
}
|
|
102
|
-
else if (this.orientation === "horizontal") {
|
|
103
|
-
const recorrido = scrollData.scrollWidth - scrollData.areaWidth;
|
|
104
|
-
const maxX = this.drag.maxX ? this.drag.maxX : 1;
|
|
105
|
-
const ratio = (this.getX() - this.contentArea.getX(true)) / maxX;
|
|
106
|
-
this.contentArea.getBody().scrollLeft = recorrido * ratio;
|
|
107
|
-
}
|
|
108
|
-
this.run("scroll");
|
|
109
|
-
}
|
|
110
|
-
render() {
|
|
111
|
-
super.render();
|
|
112
|
-
const scrollData = this.getScrollData();
|
|
113
|
-
if (this.orientation === "vertical") {
|
|
114
|
-
if (scrollData.areaHeight < scrollData.scrollHeight) {
|
|
115
|
-
this.setVisible(true);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
this.setVisible(false);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.setX(this.contentArea.getX(true) + this.contentArea.getW() - SCROLL_SIZE - 1);
|
|
122
|
-
this.setY(1 + this.contentArea.getY(true) + scrollData.position);
|
|
123
|
-
this.setH(scrollData.scrollBarHeight);
|
|
124
|
-
this.setW(SCROLL_SIZE);
|
|
125
|
-
this.raisteTop();
|
|
126
|
-
const minY = 1 + this.contentArea.getY(true);
|
|
127
|
-
const maxY = this.contentArea.getY(true) + scrollData.availablePositionSize;
|
|
128
|
-
this.drag.setMinY(minY);
|
|
129
|
-
this.drag.setMaxY(maxY);
|
|
130
|
-
if (this.getY() > maxY) {
|
|
131
|
-
this.setY(maxY);
|
|
132
|
-
}
|
|
133
|
-
if (this.getY() < minY) {
|
|
134
|
-
this.setY(minY);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
else if (this.orientation === "horizontal") {
|
|
138
|
-
if (scrollData.areaWidth < scrollData.scrollWidth) {
|
|
139
|
-
this.setVisible(true);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
this.setVisible(false);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
this.setX(1 + this.contentArea.getX(true) + scrollData.position);
|
|
146
|
-
this.setY(this.contentArea.getY(true) + scrollData.scrollPositionY - SCROLL_SIZE - 1);
|
|
147
|
-
this.setW(scrollData.scrollBarWidth);
|
|
148
|
-
this.setH(SCROLL_SIZE);
|
|
149
|
-
this.raisteTop();
|
|
150
|
-
const minX = 1 + this.contentArea.getX(true);
|
|
151
|
-
const maxX = this.contentArea.getX(true) + scrollData.availablePositionSize;
|
|
152
|
-
this.drag.setMinX(minX);
|
|
153
|
-
this.drag.setMaxX(maxX);
|
|
154
|
-
if (this.getX() > maxX) {
|
|
155
|
-
this.setX(maxX);
|
|
156
|
-
}
|
|
157
|
-
if (this.getX() < minX) {
|
|
158
|
-
this.setX(minX);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
//# sourceMappingURL=scroll.ui.js.map
|
package/lib/ui/scroll.ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.ui.js","sourceRoot":"","sources":["../../src/ui/scroll.ui.ts"],"names":[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,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YACjE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC;YACtF,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YACrC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACvB,IAAI,CAAC,SAAS,EAAE,CAAC;YAEjB,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,qBAAqB,CAAC;YAE5E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAExB,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;gBACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;YAED,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;gBACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
package/lib/ui/select.ui.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import "./styles/select.css";
|
|
2
|
-
import { Menu } from "./menu.ui";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
import { SelectItem } from "../types/select.item.type";
|
|
5
|
-
import { WidgetProps } from "./widget.builder";
|
|
6
|
-
export declare class Select extends Widget {
|
|
7
|
-
menu: Menu;
|
|
8
|
-
text: string;
|
|
9
|
-
title: string;
|
|
10
|
-
items: SelectItem[];
|
|
11
|
-
selectedItem: SelectItem | null;
|
|
12
|
-
constructor(id: string, parent?: Widget | null);
|
|
13
|
-
setValue(value: string): void;
|
|
14
|
-
setTitle(title: string): void;
|
|
15
|
-
addItem(id: string, label: string, icon: string): void;
|
|
16
|
-
}
|
|
17
|
-
export type WSelectProps = WidgetProps & {
|
|
18
|
-
title?: string;
|
|
19
|
-
value?: string;
|
|
20
|
-
children: any;
|
|
21
|
-
};
|
|
22
|
-
export type WSelectItemProps = {
|
|
23
|
-
id: string;
|
|
24
|
-
label?: string | null;
|
|
25
|
-
icon?: string | null;
|
|
26
|
-
};
|
|
27
|
-
export declare const WSelect: (props: WSelectProps) => any;
|
|
28
|
-
export declare const WSelectItem: (props: WSelectItemProps) => JSX.Element;
|
|
29
|
-
export declare function createSelect(id: string, content: any, parent?: Widget | null): Select;
|
package/lib/ui/select.ui.jsx
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import "./styles/select.css";
|
|
2
|
-
import { Menu } from "./menu.ui";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
import { SelectItem } from "../types/select.item.type";
|
|
5
|
-
import { normalizeWidget } from "./widget.builder";
|
|
6
|
-
import { UID } from "../core/uid";
|
|
7
|
-
export class Select extends Widget {
|
|
8
|
-
constructor(id, parent = null) {
|
|
9
|
-
super(id, "div", parent);
|
|
10
|
-
Object.defineProperty(this, "menu", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: void 0
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(this, "text", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(this, "title", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: void 0
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "items", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: void 0
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(this, "selectedItem", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: void 0
|
|
39
|
-
});
|
|
40
|
-
this.menu = new Menu(this.id + ".menu", this.id, null);
|
|
41
|
-
this.text = "";
|
|
42
|
-
this.title = "";
|
|
43
|
-
this.addClass("WUISelect");
|
|
44
|
-
this.items = [];
|
|
45
|
-
this.selectedItem = null;
|
|
46
|
-
this.subscribe({
|
|
47
|
-
event: "click",
|
|
48
|
-
then: () => {
|
|
49
|
-
this.menu.clearOptions();
|
|
50
|
-
this.items.forEach((item) => {
|
|
51
|
-
this.menu.addOption(item.id, item.icon, item.label);
|
|
52
|
-
});
|
|
53
|
-
this.menu.wakeUp();
|
|
54
|
-
if (this.getBody().clientWidth > this.menu.getBody().clientWidth) {
|
|
55
|
-
this.menu.setW(this.getBody().clientWidth);
|
|
56
|
-
this.menu.resize();
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
this.menu.subscribe({
|
|
61
|
-
event: "option-clicked",
|
|
62
|
-
then: (_e, clickedOption) => {
|
|
63
|
-
const option = clickedOption;
|
|
64
|
-
const fintOption = this.items.find((item) => item.id === option.id);
|
|
65
|
-
if (fintOption) {
|
|
66
|
-
this.selectedItem = fintOption;
|
|
67
|
-
}
|
|
68
|
-
const selectedText = this.selectedItem?.label;
|
|
69
|
-
if (selectedText) {
|
|
70
|
-
this.setValue(selectedText);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
this.setValue("");
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
setValue(value) {
|
|
79
|
-
this.text = value;
|
|
80
|
-
}
|
|
81
|
-
setTitle(title) {
|
|
82
|
-
this.title = title;
|
|
83
|
-
}
|
|
84
|
-
addItem(id, label, icon) {
|
|
85
|
-
this.items.push(new SelectItem(id, label, icon));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export const WSelect = (props) => {
|
|
89
|
-
if (!props.id) {
|
|
90
|
-
props.id = "Select." + UID();
|
|
91
|
-
}
|
|
92
|
-
return normalizeWidget(<div id={props.id} w-select w-title={props.title} w-value={props.value}>
|
|
93
|
-
{props.children}
|
|
94
|
-
</div>, props);
|
|
95
|
-
};
|
|
96
|
-
export const WSelectItem = (props) => {
|
|
97
|
-
return <div w-select-item id={props.id} w-label={props.label} w-icon={props.icon}></div>;
|
|
98
|
-
};
|
|
99
|
-
export function createSelect(id, content, parent = null) {
|
|
100
|
-
let newSelect = new Select(id, parent);
|
|
101
|
-
const dataTitle = content.getAttribute("w-title");
|
|
102
|
-
const dataValue = content.getAttribute("w-value");
|
|
103
|
-
const dataWidth = content.getAttribute("w-width");
|
|
104
|
-
const dataHeight = content.getAttribute("w-height");
|
|
105
|
-
if (dataTitle) {
|
|
106
|
-
newSelect.setTitle(dataTitle);
|
|
107
|
-
}
|
|
108
|
-
if (dataValue) {
|
|
109
|
-
newSelect.setValue(dataValue);
|
|
110
|
-
}
|
|
111
|
-
if (dataWidth) {
|
|
112
|
-
newSelect.setInitialW(dataWidth);
|
|
113
|
-
}
|
|
114
|
-
if (dataHeight) {
|
|
115
|
-
newSelect.setInitialH(dataHeight);
|
|
116
|
-
}
|
|
117
|
-
content.childNodes.forEach((menuItem, index) => {
|
|
118
|
-
if (menuItem.getAttribute("w-select-item") !== null) {
|
|
119
|
-
const itemId = menuItem.getAttribute("id");
|
|
120
|
-
const itemLabel = menuItem.getAttribute("w-label");
|
|
121
|
-
const itemIcon = menuItem.getAttribute("w-icon");
|
|
122
|
-
if (itemId !== null) {
|
|
123
|
-
newSelect.addItem(itemId, itemLabel || "Unnamed" + index, itemIcon || "");
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
return newSelect;
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=select.ui.jsx.map
|
package/lib/ui/select.ui.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.ui.jsx","sourceRoot":"","sources":["../../src/ui/select.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,OAAO,MAAO,SAAQ,MAAM;IAS9B,YAAY,EAAU,EAAE,SAAwB,IAAI;QAChD,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAT7B;;;;;WAAW;QACX;;;;;WAAa;QACb;;;;;WAAc;QAEd;;;;;WAAoB;QAEpB;;;;;WAAgC;QAI5B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC;YACX,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,GAAG,EAAE;gBACP,IAAI,CAAC,IAAI,CAAC,YAAY,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AC;AACrB,CAAC"}
|
package/lib/ui/switch.ui.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ToggleButton } from "./toggle.ui";
|
|
2
|
-
import { WidgetProps } from "./widget.builder";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
export declare class Switch extends ToggleButton {
|
|
5
|
-
constructor(id: string, text?: string, parent?: Widget | null);
|
|
6
|
-
}
|
|
7
|
-
export type wSwitchProps = WidgetProps & {
|
|
8
|
-
text: string;
|
|
9
|
-
checked?: boolean | null;
|
|
10
|
-
};
|
|
11
|
-
export declare const WSwitch: (props: wSwitchProps) => any;
|
|
12
|
-
export declare function createSwitch(id: string, content: any, parent?: Widget | null): Switch;
|
package/lib/ui/switch.ui.jsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { UID } from "../core/uid";
|
|
2
|
-
import { ToggleButton } from "./toggle.ui";
|
|
3
|
-
import { normalizeWidget } from "./widget.builder";
|
|
4
|
-
import { connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
5
|
-
export class Switch extends ToggleButton {
|
|
6
|
-
constructor(id, text = "", parent = null) {
|
|
7
|
-
super(id, text, "toggle_off", "toggle_on", parent);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export const WSwitch = (props) => {
|
|
11
|
-
if (!props.id) {
|
|
12
|
-
props.id = "Switch." + UID();
|
|
13
|
-
}
|
|
14
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
15
|
-
return normalizeWidget(<div id={props.id} w-switch w-text={props.text} w-checked={props.checked}/>, props);
|
|
16
|
-
};
|
|
17
|
-
export function createSwitch(id, content, parent = null) {
|
|
18
|
-
const dataText = content.getAttribute("w-text");
|
|
19
|
-
const dataChecked = content.getAttribute("w-checked");
|
|
20
|
-
let newSwitch = new Switch(id, dataText, parent);
|
|
21
|
-
if (dataChecked !== null) {
|
|
22
|
-
newSwitch.setState(true);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
newSwitch.setState(false);
|
|
26
|
-
}
|
|
27
|
-
return newSwitch;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=switch.ui.jsx.map
|
package/lib/ui/switch.ui.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"switch.ui.jsx","sourceRoot":"","sources":["../../src/ui/switch.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAU,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC/E,MAAM,OAAO,MAAO,SAAQ,YAAY;IACpC,YAAY,EAAU,EAAE,OAAe,EAAE,EAAE,SAAwB,IAAI;QACnE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACJ;AAOD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC3C,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;QACZ,KAAK,CAAC,EAAE,GAAG,SAAS,GAAG,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1D,OAAO,eAAe,CAClB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAG,EAC5E,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,EAAU,EAAE,OAAY,EAAE,SAAwB,IAAI;IAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAEtD,IAAI,SAAS,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEjD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACvB,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACJ,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
package/lib/ui/tabs.ui.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "./styles/tabs.css";
|
|
2
|
-
import { OrientationTypes } from "src/types/orientation.type";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
import { Toolbar } from "./toolbar.ui";
|
|
5
|
-
import { Scroll } from "./scroll.ui";
|
|
6
|
-
import { WidgetProps } from "./widget.builder";
|
|
7
|
-
export type TabItem = {
|
|
8
|
-
title: string;
|
|
9
|
-
content: Widget;
|
|
10
|
-
};
|
|
11
|
-
export declare class Tabs extends Widget {
|
|
12
|
-
orientation: OrientationTypes;
|
|
13
|
-
content: Widget;
|
|
14
|
-
itemControls: Toolbar;
|
|
15
|
-
items: Map<string, TabItem>;
|
|
16
|
-
itemsScrollable: Map<string, boolean>;
|
|
17
|
-
verticalScrollbar: Scroll | null;
|
|
18
|
-
constructor(id: string, parent?: Widget | null, orientation?: OrientationTypes);
|
|
19
|
-
setOrientation(orientation: OrientationTypes): void;
|
|
20
|
-
addTab(id: string, title: string, content: Widget, scrollable?: boolean): void;
|
|
21
|
-
addIconTab(id: string, icon: string, content: Widget, scrollable?: boolean): void;
|
|
22
|
-
setTab(id: string): void;
|
|
23
|
-
render(): void;
|
|
24
|
-
}
|
|
25
|
-
export type TabItemType = "text" | "icon-tab";
|
|
26
|
-
export type WTabProps = Omit<WidgetProps, "orientation"> & {
|
|
27
|
-
orientation?: OrientationTypes;
|
|
28
|
-
selectedTab?: number | null;
|
|
29
|
-
children: any;
|
|
30
|
-
};
|
|
31
|
-
export type WTabItemProps = {
|
|
32
|
-
title?: string | null;
|
|
33
|
-
icon?: string | null;
|
|
34
|
-
type?: TabItemType | null;
|
|
35
|
-
scrollable?: boolean | null;
|
|
36
|
-
children: any;
|
|
37
|
-
};
|
|
38
|
-
export declare const WTab: (props: WTabProps) => any;
|
|
39
|
-
export declare const WTabItem: (props: WTabItemProps) => JSX.Element;
|
|
40
|
-
export declare function createTab(id: string, content: any, parent?: Widget | null): Tabs;
|