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
package/lib/ui/accordion.ui.jsx
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "./styles/accordion.css";
|
|
2
|
-
import { IconButton } from "./IconButton.ui";
|
|
3
|
-
import { Label } from "./label.ui";
|
|
4
|
-
import { Widget, WidgetTypes } from "./widget.ui";
|
|
5
|
-
import { createWidget, normalizeWidget } from "./widget.builder";
|
|
6
|
-
import { UID } from "../core/uid";
|
|
7
|
-
const ACCORDION_HEADER_HEIGHT = 40;
|
|
8
|
-
export class Accordion extends Widget {
|
|
9
|
-
constructor(id, parent = null) {
|
|
10
|
-
super(id, "div", parent);
|
|
11
|
-
Object.defineProperty(this, "items", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "selectedItemId", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: void 0
|
|
22
|
-
});
|
|
23
|
-
this.items = new Map();
|
|
24
|
-
this.selectedItemId = null;
|
|
25
|
-
this.addClass("WUIAccordion");
|
|
26
|
-
}
|
|
27
|
-
selectItem(id) {
|
|
28
|
-
this.fixItemsType();
|
|
29
|
-
const selected = this.items.get(id);
|
|
30
|
-
if (this.selectedItemId !== null) {
|
|
31
|
-
//deseleccionamos
|
|
32
|
-
const previous = this.items.get(this.selectedItemId);
|
|
33
|
-
if (previous) {
|
|
34
|
-
previous.content.setFixedSize(0);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (selected) {
|
|
38
|
-
this.selectedItemId = id;
|
|
39
|
-
selected.content.setFixedSize(null);
|
|
40
|
-
}
|
|
41
|
-
this.render();
|
|
42
|
-
}
|
|
43
|
-
fixItemsType() {
|
|
44
|
-
this.items.forEach((item) => {
|
|
45
|
-
item.header.deleteClass("WUIFixPosition");
|
|
46
|
-
item.header.addClass("WUINonFreePosition");
|
|
47
|
-
item.content.deleteClass("WUIFixPosition");
|
|
48
|
-
item.content.addClass("WUINonFreePosition");
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
addItem(title, icon, content) {
|
|
52
|
-
const headerId = this.id + ".item." + Array.from(this.items.entries()).length + ".header";
|
|
53
|
-
const header = icon !== "" ? new IconButton(headerId, icon) : new Label(headerId);
|
|
54
|
-
header.setType(WidgetTypes.FILL);
|
|
55
|
-
header.setFixedSize(ACCORDION_HEADER_HEIGHT);
|
|
56
|
-
header.setText(title);
|
|
57
|
-
header.deleteClass("WUIFixPosition");
|
|
58
|
-
header.addClass("WUINonFreePosition");
|
|
59
|
-
header.subscribe({
|
|
60
|
-
event: "click",
|
|
61
|
-
then: (_e, _w) => {
|
|
62
|
-
this.selectItem(headerId);
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
content.setType(WidgetTypes.FILL);
|
|
66
|
-
content.setFixedSize(0);
|
|
67
|
-
this.items.set(headerId, { header, content });
|
|
68
|
-
this.addChild(header);
|
|
69
|
-
this.addChild(content);
|
|
70
|
-
return headerId;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export const WAccordion = (props) => {
|
|
74
|
-
if (!props.id) {
|
|
75
|
-
props.id = "Accordion." + UID();
|
|
76
|
-
}
|
|
77
|
-
return normalizeWidget(<div id={props.id} w-accordion>
|
|
78
|
-
{props.children}
|
|
79
|
-
</div>, props);
|
|
80
|
-
};
|
|
81
|
-
export const WAccordionItem = (props) => {
|
|
82
|
-
return (<div w-accordion-item w-title={props.title} w-icon={props.icon}>
|
|
83
|
-
{props.children}
|
|
84
|
-
</div>);
|
|
85
|
-
};
|
|
86
|
-
export function createAccordion(id, content, parent = null) {
|
|
87
|
-
let newAccordion = new Accordion(id, parent);
|
|
88
|
-
let firstWidgetId = "";
|
|
89
|
-
content.childNodes.forEach((accordionItem, _index) => {
|
|
90
|
-
if (accordionItem.getAttribute("w-accordion-item") !== null) {
|
|
91
|
-
const accordionTitle = accordionItem.getAttribute("w-title");
|
|
92
|
-
const accordionIcon = accordionItem.getAttribute("w-icon");
|
|
93
|
-
if (!accordionItem.firstChild) {
|
|
94
|
-
throw new Error("Accordion Item must have a content");
|
|
95
|
-
}
|
|
96
|
-
const widget = createWidget(accordionItem.firstChild);
|
|
97
|
-
if (widget !== null) {
|
|
98
|
-
const itemId = newAccordion.addItem(accordionTitle || "Untitled", accordionIcon || "", widget);
|
|
99
|
-
if (firstWidgetId === "") {
|
|
100
|
-
firstWidgetId = itemId;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
newAccordion.selectItem(firstWidgetId);
|
|
106
|
-
return newAccordion;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=accordion.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.ui.jsx","sourceRoot":"","sources":["../../src/ui/accordion.ui.tsx"],"names":[],"m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,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,aAA0B,EAAE,MAAc,EAAE,EAAE;QACtE,IAAI,aAAa,CAAC,YAAY,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAAC;YAC1D,MAAM,cAAc,GAAG,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YAC7D,MAAM,aAAa,GAAG,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAE3D,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC1D,CAAC;YAED,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEtD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAC/B,cAAc,IAAI,UAAU,EAC5B,aAAa,IAAI,EAAE,EACnB,MAAM,CACT,CAAC;gBAEF,IAAI,aAAa,KAAK,EAAE,EAAE,CAAC;oBACvB,aAAa,GAAG,MAAM,CAAC;gBAC3B,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAEvC,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
package/lib/ui/button.ui.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import "./styles/button.css";
|
|
2
|
-
import "./styles/stackbutton.css";
|
|
3
|
-
import "./styles/vstackbutton.css";
|
|
4
|
-
import { Colors } from "./colors.ui";
|
|
5
|
-
import { Widget } from "./widget.ui";
|
|
6
|
-
import { WidgetProps } from "./widget.builder";
|
|
7
|
-
export type ButonVariants = "contained" | "outlined" | "text" | "stack-start" | "stack-middle" | "stack-end" | "stack-start-active" | "stack-middle-active" | "stack-end-active" | "stack-vertical-start" | "stack-vertical-middle" | "stack-vertical-end" | "stack-vertical-start-active" | "stack-vertical-middle-active" | "stack-vertical-end-active";
|
|
8
|
-
export type ButonSizes = "small" | "medium" | "large";
|
|
9
|
-
export declare class Button extends Widget {
|
|
10
|
-
variant: ButonVariants;
|
|
11
|
-
color: Colors;
|
|
12
|
-
fullWidth: boolean;
|
|
13
|
-
minWidth: boolean;
|
|
14
|
-
size: ButonSizes;
|
|
15
|
-
href: string;
|
|
16
|
-
text: string;
|
|
17
|
-
requiredWidth: number;
|
|
18
|
-
constructor(id: string, parent?: Widget | null);
|
|
19
|
-
private configureStyles;
|
|
20
|
-
protected updateRequiredWidth(): void;
|
|
21
|
-
init(): void;
|
|
22
|
-
setText(text: string): void;
|
|
23
|
-
setVariant(variant?: ButonVariants): void;
|
|
24
|
-
setColor(color?: Colors): void;
|
|
25
|
-
setFullWidth(fullWidth?: boolean): void;
|
|
26
|
-
setMinWidth(minWidth?: boolean): void;
|
|
27
|
-
setSize(size?: ButonSizes): void;
|
|
28
|
-
setHref(href: string): void;
|
|
29
|
-
getVariant(): ButonVariants;
|
|
30
|
-
getColor(): Colors;
|
|
31
|
-
getSize(): ButonSizes;
|
|
32
|
-
getHref(): string;
|
|
33
|
-
getText(): string;
|
|
34
|
-
getRequiredWidth(): number;
|
|
35
|
-
}
|
|
36
|
-
export type wButtonProps = WidgetProps & {
|
|
37
|
-
text: string;
|
|
38
|
-
variant?: ButonVariants | null;
|
|
39
|
-
color?: Colors | null;
|
|
40
|
-
width?: number | null;
|
|
41
|
-
height?: number | null;
|
|
42
|
-
};
|
|
43
|
-
export declare const WButton: (props: wButtonProps) => any;
|
|
44
|
-
export declare function createButton(id: string, content: any, parent?: Widget | null): Button;
|
package/lib/ui/button.ui.jsx
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import "./styles/button.css";
|
|
2
|
-
import "./styles/stackbutton.css";
|
|
3
|
-
import "./styles/vstackbutton.css";
|
|
4
|
-
import { Widget, WidgetTypes, connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
5
|
-
import { normalizeWidget } from "./widget.builder";
|
|
6
|
-
import { UID } from "../core/uid";
|
|
7
|
-
export class Button extends Widget {
|
|
8
|
-
constructor(id, parent = null) {
|
|
9
|
-
super(id, "button", parent);
|
|
10
|
-
Object.defineProperty(this, "variant", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: void 0
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(this, "color", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(this, "fullWidth", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: void 0
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "minWidth", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: void 0
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(this, "size", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: void 0
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(this, "href", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: void 0
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(this, "text", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: void 0
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(this, "requiredWidth", {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true,
|
|
56
|
-
value: void 0
|
|
57
|
-
});
|
|
58
|
-
this.requiredWidth = -1;
|
|
59
|
-
this.fullWidth = false;
|
|
60
|
-
this.minWidth = false;
|
|
61
|
-
//this.setType(WidgetTypes.CUSTOM);
|
|
62
|
-
this.variant = "text";
|
|
63
|
-
this.color = "primary"; //primary";
|
|
64
|
-
this.size = "medium";
|
|
65
|
-
this.href = "#";
|
|
66
|
-
this.text = "";
|
|
67
|
-
this.configureStyles();
|
|
68
|
-
this.init();
|
|
69
|
-
}
|
|
70
|
-
configureStyles() {
|
|
71
|
-
this.deleteAllClasses();
|
|
72
|
-
this.addClass(`WUIButton-${this.variant}`);
|
|
73
|
-
this.addClass(`WUIButton-${this.variant}-color-${this.color}`);
|
|
74
|
-
if (this.type === WidgetTypes.FILL) {
|
|
75
|
-
this.addClass("WUINonFreePosition");
|
|
76
|
-
}
|
|
77
|
-
else if (this.type === WidgetTypes.CUSTOM) {
|
|
78
|
-
this.addClass("WUINonFreePosition");
|
|
79
|
-
}
|
|
80
|
-
else if (this.type === WidgetTypes.FREE) {
|
|
81
|
-
this.addClass("WUIFixPosition");
|
|
82
|
-
}
|
|
83
|
-
this.updateRequiredWidth();
|
|
84
|
-
}
|
|
85
|
-
updateRequiredWidth() {
|
|
86
|
-
const div = document.createElement("div");
|
|
87
|
-
div.id = this.id + ".requiredWidth";
|
|
88
|
-
div.innerHTML = this.text;
|
|
89
|
-
div.classList.add(`WUIButton-${this.variant}`);
|
|
90
|
-
div.classList.add(`WUIButton-${this.variant}-color-${this.color}`);
|
|
91
|
-
div.style.position = "absolute";
|
|
92
|
-
div.style.overflow = "hidden";
|
|
93
|
-
document.body.appendChild(div);
|
|
94
|
-
this.requiredWidth = div.clientWidth;
|
|
95
|
-
div.parentNode?.removeChild(div);
|
|
96
|
-
}
|
|
97
|
-
init() {
|
|
98
|
-
super.init();
|
|
99
|
-
}
|
|
100
|
-
setText(text) {
|
|
101
|
-
this.text = text;
|
|
102
|
-
this.body.innerHTML = text;
|
|
103
|
-
this.updateRequiredWidth();
|
|
104
|
-
}
|
|
105
|
-
setVariant(variant = "contained") {
|
|
106
|
-
this.variant = variant;
|
|
107
|
-
this.configureStyles();
|
|
108
|
-
}
|
|
109
|
-
setColor(color = "primary") {
|
|
110
|
-
this.color = color;
|
|
111
|
-
this.configureStyles();
|
|
112
|
-
}
|
|
113
|
-
setFullWidth(fullWidth = false) {
|
|
114
|
-
this.fullWidth = fullWidth;
|
|
115
|
-
}
|
|
116
|
-
setMinWidth(minWidth = false) {
|
|
117
|
-
this.minWidth = minWidth;
|
|
118
|
-
if (this.minWidth) {
|
|
119
|
-
if (this.requiredWidth > 0) {
|
|
120
|
-
this.setW(this.requiredWidth);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
setSize(size = "medium") {
|
|
125
|
-
this.size = size;
|
|
126
|
-
}
|
|
127
|
-
setHref(href) {
|
|
128
|
-
this.href = href;
|
|
129
|
-
}
|
|
130
|
-
getVariant() {
|
|
131
|
-
return this.variant;
|
|
132
|
-
}
|
|
133
|
-
getColor() {
|
|
134
|
-
return this.color;
|
|
135
|
-
}
|
|
136
|
-
getSize() {
|
|
137
|
-
return this.size;
|
|
138
|
-
}
|
|
139
|
-
getHref() {
|
|
140
|
-
return this.href;
|
|
141
|
-
}
|
|
142
|
-
getText() {
|
|
143
|
-
return this.text;
|
|
144
|
-
}
|
|
145
|
-
getRequiredWidth() {
|
|
146
|
-
return this.requiredWidth;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
export const WButton = (props) => {
|
|
150
|
-
if (!props.id) {
|
|
151
|
-
props.id = "button." + UID();
|
|
152
|
-
}
|
|
153
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
154
|
-
return normalizeWidget(<button id={props.id} w-button w-text={props.text} w-variant={props.variant} w-color={props.color} w-width={props.width} w-height={props.height}/>, props);
|
|
155
|
-
};
|
|
156
|
-
export function createButton(id, content, parent = null) {
|
|
157
|
-
let newButton = new Button(id, parent);
|
|
158
|
-
const dataText = content.getAttribute("w-text");
|
|
159
|
-
const dataVariant = content.getAttribute("w-variant");
|
|
160
|
-
const dataColor = content.getAttribute("w-color");
|
|
161
|
-
const dataWidth = content.getAttribute("w-width");
|
|
162
|
-
const dataHeight = content.getAttribute("w-height");
|
|
163
|
-
if (dataText) {
|
|
164
|
-
newButton.setText(dataText);
|
|
165
|
-
}
|
|
166
|
-
if (dataVariant) {
|
|
167
|
-
newButton.setVariant(dataVariant);
|
|
168
|
-
}
|
|
169
|
-
if (dataColor) {
|
|
170
|
-
newButton.setColor(dataColor);
|
|
171
|
-
}
|
|
172
|
-
if (dataWidth) {
|
|
173
|
-
newButton.setInitialW(dataWidth);
|
|
174
|
-
}
|
|
175
|
-
if (dataHeight) {
|
|
176
|
-
newButton.setInitialH(dataHeight);
|
|
177
|
-
}
|
|
178
|
-
return newButton;
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=button.ui.jsx.map
|
package/lib/ui/button.ui.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.ui.jsx","sourceRoot":"","sources":["../../src/ui/button.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAoBlC,MAAM,OAAO,MAAO,SAAQ,MAAM;IAU9B,YAAY,EAAU,EAAE,SAAwB,IAAI;QAChD,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAVhC;;;;;WAAuB;QACvB;;;;;WAAc;QACd;;;;;WAAmB;QACnB;;;;;WAAkB;QAClB;;;;;WAAiB;QACjB;;;;;WAAa;QACb;;;;;WAAa;QACb;;;;;WAAsB;QAKlB,IAAI,CAAC,aAAa,GAAG,CAAC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AAC,CACrB,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,EACF,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,EAAU,EAAE,OAAY,EAAE,SAAwB,IAAI;IAC/E,IAAI,SAAS,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAEpD,IAAI,QAAQ,EAAE,CAAC;QACX,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QACd,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACb,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "./styles/buttoncolor.css";
|
|
2
|
-
import { Button, wButtonProps } from "./button.ui";
|
|
3
|
-
import { Widget } from "./widget.ui";
|
|
4
|
-
export declare class ButtonColor extends Button {
|
|
5
|
-
inputColor: Widget;
|
|
6
|
-
constructor(id: string, parent?: Widget | null);
|
|
7
|
-
setValue(value: string): void;
|
|
8
|
-
getValue(): string;
|
|
9
|
-
}
|
|
10
|
-
export type wButtonColorProps = Omit<wButtonProps, "text"> & {
|
|
11
|
-
value: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const WButtonColor: (props: wButtonColorProps) => any;
|
|
14
|
-
export declare function createButtonColor(id: string, content: any, parent?: Widget | null): ButtonColor;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import "./styles/buttoncolor.css";
|
|
2
|
-
import { Button } from "./button.ui";
|
|
3
|
-
import { connectWidgetCallback, getOnlyEventProps, Widget } from "./widget.ui";
|
|
4
|
-
import { normalizeWidget } from "./widget.builder";
|
|
5
|
-
import { UID } from "../core/uid";
|
|
6
|
-
export class ButtonColor extends Button {
|
|
7
|
-
constructor(id, parent = null) {
|
|
8
|
-
super(id, parent);
|
|
9
|
-
Object.defineProperty(this, "inputColor", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
configurable: true,
|
|
12
|
-
writable: true,
|
|
13
|
-
value: void 0
|
|
14
|
-
});
|
|
15
|
-
this.inputColor = new Widget(id + ".inputColor", "input", this);
|
|
16
|
-
this.inputColor.getBody().setAttribute("type", "color");
|
|
17
|
-
this.inputColor.addClass("WUIButtonColorInput");
|
|
18
|
-
}
|
|
19
|
-
setValue(value) {
|
|
20
|
-
this.inputColor.getBody().setAttribute("value", value);
|
|
21
|
-
}
|
|
22
|
-
getValue() {
|
|
23
|
-
const value = this.inputColor.getBody().getAttribute("value");
|
|
24
|
-
return value ? value : "";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export const WButtonColor = (props) => {
|
|
28
|
-
if (!props.id) {
|
|
29
|
-
props.id = "ButtonColor." + UID();
|
|
30
|
-
}
|
|
31
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
32
|
-
return normalizeWidget(<button id={props.id} w-button-color w-value={props.value} w-variant={props.variant} w-color={props.color} w-width={props.width} w-height={props.height}/>, props);
|
|
33
|
-
};
|
|
34
|
-
export function createButtonColor(id, content, parent = null) {
|
|
35
|
-
let newButton = new ButtonColor(id, parent);
|
|
36
|
-
const dataValue = content.getAttribute("w-value");
|
|
37
|
-
const dataVariant = content.getAttribute("w-variant");
|
|
38
|
-
const dataColor = content.getAttribute("w-color");
|
|
39
|
-
const dataWidth = content.getAttribute("w-width");
|
|
40
|
-
const dataHeight = content.getAttribute("w-height");
|
|
41
|
-
if (dataValue) {
|
|
42
|
-
newButton.setValue(dataValue);
|
|
43
|
-
}
|
|
44
|
-
if (dataVariant) {
|
|
45
|
-
newButton.setVariant(dataVariant);
|
|
46
|
-
}
|
|
47
|
-
if (dataColor) {
|
|
48
|
-
newButton.setColor(dataColor);
|
|
49
|
-
}
|
|
50
|
-
if (dataWidth) {
|
|
51
|
-
newButton.setInitialW(dataWidth);
|
|
52
|
-
}
|
|
53
|
-
if (dataHeight) {
|
|
54
|
-
newButton.setInitialH(dataHeight);
|
|
55
|
-
}
|
|
56
|
-
return newButton;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=buttonColor.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buttonColor.ui.jsx","sourceRoot":"","sources":["../../src/ui/buttonColor.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,OAAO,WAAY,SAAQ,MAAM;IAEnC,YAAY,EAAU,EAAE,SAAwB,IAAI;QAChD,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAFtB;;;;;WAAmB;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AC,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAC7B,EAAU,EACV,OAAY,EACZ,SAAwB,IAAI;IAE5B,IAAI,SAAS,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAEpD,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QACd,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACb,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SelectItem } from "../types/select.item.type";
|
|
2
|
-
import { Button, wButtonProps } from "./button.ui";
|
|
3
|
-
import { Menu } from "./menu.ui";
|
|
4
|
-
import { WidgetProps } from "./widget.builder";
|
|
5
|
-
import { Widget } from "./widget.ui";
|
|
6
|
-
export declare class ButtonMenu extends Button {
|
|
7
|
-
menu: Menu;
|
|
8
|
-
items: Array<SelectItem>;
|
|
9
|
-
selectedItem: SelectItem | null;
|
|
10
|
-
constructor(id: string);
|
|
11
|
-
addItem(id: string, label: string, icon: string): void;
|
|
12
|
-
}
|
|
13
|
-
export type WButtonMenuProps = WidgetProps & wButtonProps & {
|
|
14
|
-
children: any;
|
|
15
|
-
};
|
|
16
|
-
export type WButtonMenuItemProps = {
|
|
17
|
-
id: string;
|
|
18
|
-
label?: string | null;
|
|
19
|
-
icon?: string | null;
|
|
20
|
-
};
|
|
21
|
-
export declare const WButtonMenu: (props: WButtonMenuProps) => any;
|
|
22
|
-
export declare const WButtonMenuItem: (props: WButtonMenuItemProps) => JSX.Element;
|
|
23
|
-
export declare function createButtonMenu(id: string, content: any, _parent?: Widget | null): ButtonMenu;
|
package/lib/ui/buttonmenu.ui.jsx
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { UID } from "../core/uid";
|
|
2
|
-
import { SelectItem } from "../types/select.item.type";
|
|
3
|
-
import { Button } from "./button.ui";
|
|
4
|
-
import { Menu } from "./menu.ui";
|
|
5
|
-
import { normalizeWidget } from "./widget.builder";
|
|
6
|
-
export class ButtonMenu extends Button {
|
|
7
|
-
constructor(id) {
|
|
8
|
-
super(id);
|
|
9
|
-
Object.defineProperty(this, "menu", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
configurable: true,
|
|
12
|
-
writable: true,
|
|
13
|
-
value: void 0
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(this, "items", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true,
|
|
19
|
-
value: void 0
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(this, "selectedItem", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: void 0
|
|
26
|
-
});
|
|
27
|
-
this.menu = new Menu(this.id + ".menu", this.id, null);
|
|
28
|
-
this.items = new Array();
|
|
29
|
-
this.selectedItem = null;
|
|
30
|
-
this.subscribe({
|
|
31
|
-
event: "click",
|
|
32
|
-
then: () => {
|
|
33
|
-
this.menu.clearOptions();
|
|
34
|
-
this.items.forEach((item) => {
|
|
35
|
-
this.menu.addOption(item.id, item.icon, item.label);
|
|
36
|
-
});
|
|
37
|
-
this.menu.wakeUp();
|
|
38
|
-
if (this.getW() > this.menu.getW()) {
|
|
39
|
-
this.menu.setW(this.getBody().clientWidth);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
/*this.menu.subscribe({
|
|
44
|
-
event: "option-clicked",
|
|
45
|
-
then: (_e, clickedOption) => {
|
|
46
|
-
const option = clickedOption as IconButton;
|
|
47
|
-
|
|
48
|
-
const fintOption = this.items.find((item) => item.id === option.id);
|
|
49
|
-
|
|
50
|
-
if (fintOption) {
|
|
51
|
-
this.selectedItem = fintOption;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const selectedText = this.selectedItem?.label;
|
|
55
|
-
if (selectedText) {
|
|
56
|
-
this.setText(selectedText);
|
|
57
|
-
} else {
|
|
58
|
-
this.setText("");
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
});*/
|
|
62
|
-
}
|
|
63
|
-
addItem(id, label, icon) {
|
|
64
|
-
this.items.push(new SelectItem(id, label, icon));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export const WButtonMenu = (props) => {
|
|
68
|
-
if (!props.id) {
|
|
69
|
-
props.id = "ButtonMenu." + UID();
|
|
70
|
-
}
|
|
71
|
-
return normalizeWidget(<div id={props.id} w-button-menu w-text={props.text} w-variant={props.variant} w-color={props.color}>
|
|
72
|
-
{props.children}
|
|
73
|
-
</div>, props);
|
|
74
|
-
};
|
|
75
|
-
export const WButtonMenuItem = (props) => {
|
|
76
|
-
return <div w-button-menu-item id={props.id} w-label={props.label} w-icon={props.icon}></div>;
|
|
77
|
-
};
|
|
78
|
-
export function createButtonMenu(id, content, _parent = null) {
|
|
79
|
-
let newButtonMenu = new ButtonMenu(id);
|
|
80
|
-
const btnText = content.getAttribute("w-text");
|
|
81
|
-
const btnColor = content.getAttribute("w-color");
|
|
82
|
-
const btnVariant = content.getAttribute("w-variant");
|
|
83
|
-
if (btnText) {
|
|
84
|
-
newButtonMenu.setText(btnText);
|
|
85
|
-
}
|
|
86
|
-
if (btnColor) {
|
|
87
|
-
newButtonMenu.setColor(btnColor);
|
|
88
|
-
}
|
|
89
|
-
if (btnVariant) {
|
|
90
|
-
newButtonMenu.setVariant(btnVariant);
|
|
91
|
-
}
|
|
92
|
-
content.childNodes.forEach((menuItem, index) => {
|
|
93
|
-
if (menuItem.getAttribute("w-button-menu-item") !== null) {
|
|
94
|
-
const itemId = menuItem.getAttribute("id");
|
|
95
|
-
const itemLabel = menuItem.getAttribute("w-label");
|
|
96
|
-
const itemIcon = menuItem.getAttribute("w-icon");
|
|
97
|
-
if (itemId !== null) {
|
|
98
|
-
newButtonMenu.addItem(itemId, itemLabel || "Unnamed" + index, itemIcon || "");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return newButtonMenu;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=buttonmenu.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buttonmenu.ui.jsx","sourceRoot":"","sources":["../../src/ui/buttonmenu.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAGhE,MAAM,OAAO,UAAW,SAAQ,MAAM;IAKlC,YAAmB,EAAU;QACzB,KAAK,CAAC,EAAE,CAAC,CAAC;QALd;;;;;WAA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QACb,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAqB,EAAE,KAAa,EAAE,EAAE;QAChE,IAAI,QAAQ,CAAC,YAAY,CAAC,oBAAoB,CAAC,KAAK,IAAI,EAAE,CAAC;YACvD,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC3C,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YACnD,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAEjD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClB,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,IAAI,SAAS,GAAG,KAAK,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;YAClF,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACzB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { OrientationTypes } from "src/types/orientation.type";
|
|
2
|
-
import { IconButton } from "./IconButton.ui";
|
|
3
|
-
import { Button } from "./button.ui";
|
|
4
|
-
import { Widget } from "./widget.ui";
|
|
5
|
-
import { WidgetProps } from "./widget.builder";
|
|
6
|
-
export declare class ButtonStack extends Widget {
|
|
7
|
-
orientation: OrientationTypes;
|
|
8
|
-
buttons: Map<string, Button | IconButton>;
|
|
9
|
-
activeButton: string | null;
|
|
10
|
-
centeredButtons: boolean;
|
|
11
|
-
constructor(id: string, orientation?: OrientationTypes, parent?: Widget | null);
|
|
12
|
-
setActive(buttonId: string): void;
|
|
13
|
-
private configureStyles;
|
|
14
|
-
private setButtonVariant;
|
|
15
|
-
addButton(button: Button | IconButton): void;
|
|
16
|
-
private thereIsOnlyOneButton;
|
|
17
|
-
private thereAreTwoButtons;
|
|
18
|
-
private thereAreMoreThanTwoButtons;
|
|
19
|
-
setCenteredButtons(centeredButtons: boolean): void;
|
|
20
|
-
}
|
|
21
|
-
export type WButtonStackProps = WidgetProps & {
|
|
22
|
-
centerX?: boolean | null;
|
|
23
|
-
children: any;
|
|
24
|
-
};
|
|
25
|
-
export declare const WButtonStack: (props: WButtonStackProps) => any;
|
|
26
|
-
export declare function createButtonStack(id: string, content: any, parent?: Widget | null): ButtonStack;
|