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/draggable.ui.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import "./styles/draggable.css";
|
|
2
|
-
import { Widget, WidgetTypes } from "./widget.ui";
|
|
3
|
-
export class Draggable {
|
|
4
|
-
constructor(widget, orientation = "both") {
|
|
5
|
-
Object.defineProperty(this, "target", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: void 0
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "background", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "dragging", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: false
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "dragDistX", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: void 0
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(this, "dragDistY", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: void 0
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(this, "dragOrientation", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: void 0
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(this, "minX", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
value: void 0
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(this, "minY", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true,
|
|
51
|
-
value: void 0
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(this, "maxX", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true,
|
|
56
|
-
writable: true,
|
|
57
|
-
value: void 0
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(this, "maxY", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true,
|
|
63
|
-
value: void 0
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(this, "draggingClass", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: void 0
|
|
70
|
-
});
|
|
71
|
-
this.target = widget;
|
|
72
|
-
this.background = new Widget(this.target.id + ".Draggable.Background", "div", null);
|
|
73
|
-
this.background.setType(WidgetTypes.CUSTOM);
|
|
74
|
-
this.background.addClass("WUIDraggableBackground");
|
|
75
|
-
this.draggingClass = null;
|
|
76
|
-
this.dragDistX = 0;
|
|
77
|
-
this.dragDistY = 0;
|
|
78
|
-
this.maxX = null;
|
|
79
|
-
this.maxY = null;
|
|
80
|
-
this.minX = null;
|
|
81
|
-
this.minY = null;
|
|
82
|
-
this.dragOrientation = orientation;
|
|
83
|
-
this.target.subscribe({
|
|
84
|
-
event: "mousedown",
|
|
85
|
-
then: (e, _w) => {
|
|
86
|
-
this.startDrag(e);
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
this.background.subscribe({
|
|
90
|
-
event: "mousemove",
|
|
91
|
-
then: (e, _w) => {
|
|
92
|
-
this.draggingTarget(e);
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
this.background.subscribe({
|
|
96
|
-
event: "mouseup",
|
|
97
|
-
then: (_e, _w) => {
|
|
98
|
-
this.endDrag();
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
this.background.subscribe({
|
|
102
|
-
event: "mouseout",
|
|
103
|
-
then: (_e, _w) => {
|
|
104
|
-
this.endDrag();
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
this.background.subscribe({
|
|
108
|
-
event: "mouseleave",
|
|
109
|
-
then: (_e, _w) => {
|
|
110
|
-
this.endDrag();
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
this.background.setVisible(false);
|
|
114
|
-
}
|
|
115
|
-
setBackgroundCursor(cursor) {
|
|
116
|
-
this.background.getBody().style.cursor = cursor;
|
|
117
|
-
}
|
|
118
|
-
setDraggingClass(draggingClass) {
|
|
119
|
-
this.draggingClass = draggingClass;
|
|
120
|
-
}
|
|
121
|
-
startDrag(e) {
|
|
122
|
-
e.preventDefault();
|
|
123
|
-
const mouseX = e.clientX;
|
|
124
|
-
const mouseY = e.clientY;
|
|
125
|
-
this.dragDistX = Math.abs(this.target.getX() - mouseX);
|
|
126
|
-
this.dragDistY = Math.abs(this.target.getY() - mouseY);
|
|
127
|
-
this.dragging = true;
|
|
128
|
-
this.background.setVisible(true);
|
|
129
|
-
this.background.raisteTop();
|
|
130
|
-
if (this.draggingClass) {
|
|
131
|
-
this.target.addClass(this.draggingClass);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
draggingTarget(e) {
|
|
135
|
-
if (!this.dragging) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
e.preventDefault();
|
|
139
|
-
const mouseX = e.clientX;
|
|
140
|
-
const mouseY = e.clientY;
|
|
141
|
-
if (this.dragOrientation === "both" || this.dragOrientation === "horizontal") {
|
|
142
|
-
let newX = mouseX - this.dragDistX;
|
|
143
|
-
if (this.maxX != null && newX > this.maxX) {
|
|
144
|
-
newX = this.maxX;
|
|
145
|
-
}
|
|
146
|
-
if (this.minX != null && newX < this.minX) {
|
|
147
|
-
newX = this.minX;
|
|
148
|
-
}
|
|
149
|
-
this.target.setX(newX);
|
|
150
|
-
}
|
|
151
|
-
if (this.dragOrientation === "both" || this.dragOrientation === "vertical") {
|
|
152
|
-
let newY = mouseY - this.dragDistY;
|
|
153
|
-
if (this.maxY != null && newY > this.maxY) {
|
|
154
|
-
newY = this.maxY;
|
|
155
|
-
}
|
|
156
|
-
if (this.minY != null && newY < this.minY) {
|
|
157
|
-
newY = this.minY;
|
|
158
|
-
}
|
|
159
|
-
this.target.setY(newY);
|
|
160
|
-
}
|
|
161
|
-
this.target.run("drag");
|
|
162
|
-
}
|
|
163
|
-
endDrag() {
|
|
164
|
-
this.dragging = false;
|
|
165
|
-
this.background.setVisible(false);
|
|
166
|
-
if (this.draggingClass) {
|
|
167
|
-
this.target.deleteClass(this.draggingClass);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
setMaxX(x) {
|
|
171
|
-
this.maxX = x;
|
|
172
|
-
}
|
|
173
|
-
setMaxY(y) {
|
|
174
|
-
this.maxY = y;
|
|
175
|
-
}
|
|
176
|
-
setMinX(x) {
|
|
177
|
-
this.minX = x;
|
|
178
|
-
}
|
|
179
|
-
setMinY(y) {
|
|
180
|
-
this.minY = y;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
//# sourceMappingURL=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AG,CAAC,CAAC;IAClB,CAAC;CACJ"}
|
package/lib/ui/hpanel.ui.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Draggable } from "./draggable.ui";
|
|
2
|
-
import "./styles/hpanel.css";
|
|
3
|
-
import { WidgetProps } from "./widget.builder";
|
|
4
|
-
import { Widget } from "./widget.ui";
|
|
5
|
-
export declare class HPanel extends Widget {
|
|
6
|
-
leftContent: Widget | null;
|
|
7
|
-
rightContent: Widget | null;
|
|
8
|
-
leftWidth: number | null;
|
|
9
|
-
rightWidth: number | null;
|
|
10
|
-
handler: Widget;
|
|
11
|
-
draggable: Draggable;
|
|
12
|
-
constructor(id: string, parent?: Widget | null);
|
|
13
|
-
private updateHandlerOpacity;
|
|
14
|
-
setLeft(content: Widget, fixWidth?: number | null): void;
|
|
15
|
-
setRight(content: Widget, fixWidth?: number | null): void;
|
|
16
|
-
private updateSizeFromHandlerPosition;
|
|
17
|
-
setLeftWidth(width: number): void;
|
|
18
|
-
setRightWidth(width: number): void;
|
|
19
|
-
render(): void;
|
|
20
|
-
free(): void;
|
|
21
|
-
}
|
|
22
|
-
export type WHPanelProps = WidgetProps & {
|
|
23
|
-
children: any;
|
|
24
|
-
};
|
|
25
|
-
export declare const WHPanel: (props: WHPanelProps) => any;
|
|
26
|
-
export declare function createHPanel(id: string, content: any, parent?: Widget | null): HPanel;
|
package/lib/ui/hpanel.ui.jsx
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { UID } from "../core/uid";
|
|
2
|
-
import { Draggable } from "./draggable.ui";
|
|
3
|
-
import "./styles/hpanel.css";
|
|
4
|
-
import { createWidget, normalizeWidget } from "./widget.builder";
|
|
5
|
-
import { connectWidgetCallback, getOnlyEventProps, Widget, WidgetAlignTypes, WidgetTypes, } from "./widget.ui";
|
|
6
|
-
const HPANEL_HANDLER_SIZE = 4;
|
|
7
|
-
export class HPanel extends Widget {
|
|
8
|
-
constructor(id, parent = null) {
|
|
9
|
-
super(id, "div", parent);
|
|
10
|
-
Object.defineProperty(this, "leftContent", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: void 0
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(this, "rightContent", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(this, "leftWidth", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: void 0
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "rightWidth", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: void 0
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(this, "handler", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: void 0
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(this, "draggable", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: void 0
|
|
45
|
-
});
|
|
46
|
-
this.setAlign(WidgetAlignTypes.HORIZONTAL);
|
|
47
|
-
this.setType(WidgetTypes.FILL);
|
|
48
|
-
this.handler = new Widget(id + ".handler", "div", null);
|
|
49
|
-
this.handler.addClass("WUIHPanelHandler");
|
|
50
|
-
this.draggable = new Draggable(this.handler, "horizontal");
|
|
51
|
-
this.draggable.setDraggingClass("WUIHPanelDragging");
|
|
52
|
-
this.draggable.setBackgroundCursor("col-resize");
|
|
53
|
-
this.handler.subscribe({
|
|
54
|
-
event: "drag",
|
|
55
|
-
then: (_e, _w) => {
|
|
56
|
-
this.updateSizeFromHandlerPosition();
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
this.subscribe({
|
|
60
|
-
event: "mousemove",
|
|
61
|
-
then: (e, _w) => {
|
|
62
|
-
this.updateHandlerOpacity(e);
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
this.leftContent = null;
|
|
66
|
-
this.rightContent = null;
|
|
67
|
-
this.leftWidth = null;
|
|
68
|
-
this.rightWidth = null;
|
|
69
|
-
}
|
|
70
|
-
updateHandlerOpacity(e) {
|
|
71
|
-
const handlerX = this.handler.getX();
|
|
72
|
-
const mouseX = e.clientX;
|
|
73
|
-
const umbral = 100; //Distancia donde comienza a aparecer.
|
|
74
|
-
const minDistance = 20; //Distancia a la que toma 100 de opacidad
|
|
75
|
-
const distance = Math.abs(mouseX - handlerX);
|
|
76
|
-
if (distance < umbral && distance > minDistance) {
|
|
77
|
-
const ratio = 1 - distance / umbral;
|
|
78
|
-
this.handler.getBody().style.opacity = ratio.toString();
|
|
79
|
-
}
|
|
80
|
-
else if (distance < minDistance) {
|
|
81
|
-
this.handler.getBody().style.opacity = "1";
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
this.handler.getBody().style.opacity = "0";
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
setLeft(content, fixWidth = null) {
|
|
88
|
-
this.leftContent = content;
|
|
89
|
-
this.leftWidth = fixWidth;
|
|
90
|
-
if (fixWidth !== null) {
|
|
91
|
-
this.rightWidth = null;
|
|
92
|
-
this.leftContent.setFixedSize(fixWidth);
|
|
93
|
-
}
|
|
94
|
-
this.addChild(content);
|
|
95
|
-
const spacer = new Widget("spacer." + Date.now().toString(), "div", null);
|
|
96
|
-
spacer.setType(WidgetTypes.FILL);
|
|
97
|
-
spacer.setFixedSize(HPANEL_HANDLER_SIZE);
|
|
98
|
-
this.addChild(spacer);
|
|
99
|
-
}
|
|
100
|
-
setRight(content, fixWidth = null) {
|
|
101
|
-
this.rightContent = content;
|
|
102
|
-
this.rightWidth = fixWidth;
|
|
103
|
-
if (fixWidth !== null) {
|
|
104
|
-
this.leftWidth = null;
|
|
105
|
-
this.rightContent.setFixedSize(fixWidth);
|
|
106
|
-
}
|
|
107
|
-
this.addChild(content);
|
|
108
|
-
}
|
|
109
|
-
updateSizeFromHandlerPosition() {
|
|
110
|
-
if (this.leftWidth !== null) {
|
|
111
|
-
const leftX = this.leftContent ? this.leftContent.getX(true) : 0;
|
|
112
|
-
this.leftWidth = this.handler.getX() - leftX;
|
|
113
|
-
}
|
|
114
|
-
else if (this.rightWidth !== null) {
|
|
115
|
-
this.rightWidth = this.getW() - this.handler.getX();
|
|
116
|
-
}
|
|
117
|
-
this.render();
|
|
118
|
-
}
|
|
119
|
-
setLeftWidth(width) {
|
|
120
|
-
this.leftWidth = width;
|
|
121
|
-
this.rightWidth = null;
|
|
122
|
-
}
|
|
123
|
-
setRightWidth(width) {
|
|
124
|
-
this.leftWidth = null;
|
|
125
|
-
this.rightWidth = width;
|
|
126
|
-
}
|
|
127
|
-
render() {
|
|
128
|
-
super.render();
|
|
129
|
-
this.handler.setW(HPANEL_HANDLER_SIZE);
|
|
130
|
-
this.handler.setH(this.getH());
|
|
131
|
-
if (this.leftWidth !== null) {
|
|
132
|
-
const leftX = this.leftContent ? this.leftContent.getX(true) : 0;
|
|
133
|
-
this.handler.setX(leftX + this.leftWidth);
|
|
134
|
-
this.leftContent?.setFixedSize(this.leftWidth);
|
|
135
|
-
}
|
|
136
|
-
else if (this.rightWidth !== null) {
|
|
137
|
-
const rightX = this.rightContent ? this.rightContent.getX(true) : 0;
|
|
138
|
-
this.handler.setX(rightX + this.rightWidth);
|
|
139
|
-
this.rightContent?.setFixedSize(this.rightWidth);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
if (this.leftWidth === null) {
|
|
143
|
-
this.leftWidth = this.getW() / 2 - HPANEL_HANDLER_SIZE / 2;
|
|
144
|
-
}
|
|
145
|
-
const leftX = this.leftContent ? this.leftContent.getX(true) : 0;
|
|
146
|
-
this.handler.setX(leftX + this.leftWidth);
|
|
147
|
-
this.leftContent?.setFixedSize(this.leftWidth);
|
|
148
|
-
}
|
|
149
|
-
this.handler.setY(this.getY(true));
|
|
150
|
-
}
|
|
151
|
-
free() {
|
|
152
|
-
this.handler.free();
|
|
153
|
-
this.leftContent?.free();
|
|
154
|
-
this.rightContent?.free();
|
|
155
|
-
//this.draggable.free();
|
|
156
|
-
super.free();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
export const WHPanel = (props) => {
|
|
160
|
-
if (!props.id) {
|
|
161
|
-
props.id = "Icon." + UID();
|
|
162
|
-
}
|
|
163
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
164
|
-
return normalizeWidget(<div id={props.id} w-hpanel>
|
|
165
|
-
{props.children}
|
|
166
|
-
</div>, props);
|
|
167
|
-
};
|
|
168
|
-
export function createHPanel(id, content, parent = null) {
|
|
169
|
-
let newPanel = new HPanel(id, parent);
|
|
170
|
-
content.childNodes.forEach((item, index) => {
|
|
171
|
-
const widget = createWidget(item);
|
|
172
|
-
if (widget !== null) {
|
|
173
|
-
if (index === 0) {
|
|
174
|
-
newPanel.setLeft(widget, widget.getFixedSize());
|
|
175
|
-
}
|
|
176
|
-
else if (index === 1) {
|
|
177
|
-
newPanel.setRight(widget);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
return newPanel;
|
|
182
|
-
}
|
|
183
|
-
//# sourceMappingURL=hpanel.ui.jsx.map
|
package/lib/ui/hpanel.ui.jsx.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hpanel.ui.jsx","sourceRoot":"","sources":["../../src/ui/hpanel.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAe,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EACH,qBAAq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,CAAC,QAAQ,CACnB;QAAA,EAAE,GAAG,CAAC,EACN,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,EAAU,EAAE,OAAY,EAAE,SAAwB,IAAI;IAC/E,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAEtC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAiB,EAAE,KAAa,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAElC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACd,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACrB,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IconButton, wIconButtonProps } from "./IconButton.ui";
|
|
2
|
-
import { Menu } from "./menu.ui";
|
|
3
|
-
import { SelectItem } from "../types/select.item.type";
|
|
4
|
-
import { WidgetProps } from "./widget.builder";
|
|
5
|
-
import { Widget } from "./widget.ui";
|
|
6
|
-
export declare class IconButtonMenu extends IconButton {
|
|
7
|
-
menu: Menu;
|
|
8
|
-
items: Array<SelectItem>;
|
|
9
|
-
selectedItem: SelectItem | null;
|
|
10
|
-
whenOptionClicked: (args: any) => {} | void;
|
|
11
|
-
constructor(id: string, icon: string);
|
|
12
|
-
setOnOptionClicked(cb: ({}: {}) => {} | void): void;
|
|
13
|
-
addItem(id: string, label: string, icon: string): void;
|
|
14
|
-
}
|
|
15
|
-
export type WIconButtonMenuProps = WidgetProps & wIconButtonProps & {
|
|
16
|
-
icon?: string | null;
|
|
17
|
-
onOptionClicked?: (args: any) => {} | void;
|
|
18
|
-
children: any;
|
|
19
|
-
};
|
|
20
|
-
export type WIconButtonMenuItemProps = {
|
|
21
|
-
id: string;
|
|
22
|
-
label?: string | null;
|
|
23
|
-
icon?: string | null;
|
|
24
|
-
};
|
|
25
|
-
export declare const WIconButtonMenu: (props: WIconButtonMenuProps) => any;
|
|
26
|
-
export declare const WIconButtonMenuItem: (props: WIconButtonMenuItemProps) => JSX.Element;
|
|
27
|
-
export declare function createIconButtonMenu(id: string, content: any, _parent?: Widget | null): IconButtonMenu;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { IconButton } from "./IconButton.ui";
|
|
2
|
-
import { Menu } from "./menu.ui";
|
|
3
|
-
import { SelectItem } from "../types/select.item.type";
|
|
4
|
-
import { normalizeWidget } from "./widget.builder";
|
|
5
|
-
import { connectWidgetCallback, getOnlyEventProps } from "./widget.ui";
|
|
6
|
-
import { UID } from "../core/uid";
|
|
7
|
-
import { connectCustomWidget } from "./widget.collection";
|
|
8
|
-
export class IconButtonMenu extends IconButton {
|
|
9
|
-
constructor(id, icon) {
|
|
10
|
-
super(id, icon);
|
|
11
|
-
Object.defineProperty(this, "menu", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "items", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: void 0
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "selectedItem", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: void 0
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(this, "whenOptionClicked", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: void 0
|
|
34
|
-
});
|
|
35
|
-
this.whenOptionClicked = () => { };
|
|
36
|
-
this.menu = new Menu(this.id + ".menu", this.id, null);
|
|
37
|
-
this.items = new Array();
|
|
38
|
-
this.selectedItem = null;
|
|
39
|
-
this.subscribe({
|
|
40
|
-
event: "click",
|
|
41
|
-
then: () => {
|
|
42
|
-
this.menu.clearOptions();
|
|
43
|
-
this.items.forEach((item) => {
|
|
44
|
-
this.menu.addOption(item.id, item.icon, item.label);
|
|
45
|
-
});
|
|
46
|
-
this.menu.wakeUp();
|
|
47
|
-
if (this.getW() > this.menu.getW()) {
|
|
48
|
-
this.menu.setW(this.getBody().clientWidth);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
this.menu.subscribe({
|
|
53
|
-
event: "option-clicked",
|
|
54
|
-
then: (_e, clickedOption) => {
|
|
55
|
-
const option = clickedOption;
|
|
56
|
-
const fintOption = this.items.find((item) => item.id === option.id);
|
|
57
|
-
if (fintOption) {
|
|
58
|
-
this.selectedItem = fintOption;
|
|
59
|
-
this.whenOptionClicked({ id: fintOption.id });
|
|
60
|
-
}
|
|
61
|
-
// const selectedText = this.selectedItem?.label;
|
|
62
|
-
// if (selectedText) {
|
|
63
|
-
// this.setText(selectedText);
|
|
64
|
-
// } else {
|
|
65
|
-
// this.setText("");
|
|
66
|
-
// }
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
setOnOptionClicked(cb) {
|
|
71
|
-
this.whenOptionClicked = cb;
|
|
72
|
-
}
|
|
73
|
-
addItem(id, label, icon) {
|
|
74
|
-
this.items.push(new SelectItem(id, label, icon));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export const WIconButtonMenu = (props) => {
|
|
78
|
-
if (!props.id) {
|
|
79
|
-
props.id = "IconButtonMenu." + UID();
|
|
80
|
-
}
|
|
81
|
-
connectWidgetCallback(props.id, getOnlyEventProps(props));
|
|
82
|
-
connectCustomWidget("widget-custom-added-" + props.id, {
|
|
83
|
-
event: "widget-load",
|
|
84
|
-
then: (_e, _w) => {
|
|
85
|
-
if (!props.id)
|
|
86
|
-
return;
|
|
87
|
-
const widget = w.get(props.id);
|
|
88
|
-
if (props.onOptionClicked) {
|
|
89
|
-
widget.setOnOptionClicked(props.onOptionClicked);
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
return normalizeWidget(<div id={props.id} w-icon-button-menu w-text={props.text} w-icon={props.icon} w-variant={props.variant} w-color={props.color} w-width={props.width} w-height={props.height}>
|
|
94
|
-
{props.children}
|
|
95
|
-
</div>, props);
|
|
96
|
-
};
|
|
97
|
-
export const WIconButtonMenuItem = (props) => {
|
|
98
|
-
return (<div w-icon-button-menu-item id={props.id} w-label={props.label} w-icon={props.icon}></div>);
|
|
99
|
-
};
|
|
100
|
-
export function createIconButtonMenu(id, content, _parent = null) {
|
|
101
|
-
const btnIcon = content.getAttribute("w-icon");
|
|
102
|
-
const btnText = content.getAttribute("w-text");
|
|
103
|
-
const btnColor = content.getAttribute("w-color");
|
|
104
|
-
const btnVariant = content.getAttribute("w-variant");
|
|
105
|
-
const dataWidth = content.getAttribute("w-width");
|
|
106
|
-
const dataHeight = content.getAttribute("w-height");
|
|
107
|
-
let newIconButtonMenu = new IconButtonMenu(id, btnIcon || "home");
|
|
108
|
-
if (btnText) {
|
|
109
|
-
newIconButtonMenu.setText(btnText);
|
|
110
|
-
}
|
|
111
|
-
if (btnColor) {
|
|
112
|
-
newIconButtonMenu.setColor(btnColor);
|
|
113
|
-
}
|
|
114
|
-
if (btnVariant) {
|
|
115
|
-
newIconButtonMenu.setVariant(btnVariant);
|
|
116
|
-
}
|
|
117
|
-
if (dataWidth) {
|
|
118
|
-
newIconButtonMenu.setInitialW(dataWidth);
|
|
119
|
-
}
|
|
120
|
-
if (dataHeight) {
|
|
121
|
-
newIconButtonMenu.setInitialH(dataHeight);
|
|
122
|
-
}
|
|
123
|
-
content.childNodes.forEach((menuItem, index) => {
|
|
124
|
-
if (menuItem.getAttribute("w-icon-button-menu-item") !== null) {
|
|
125
|
-
const itemId = menuItem.getAttribute("id");
|
|
126
|
-
const itemLabel = menuItem.getAttribute("w-label");
|
|
127
|
-
const itemIcon = menuItem.getAttribute("w-icon");
|
|
128
|
-
if (itemId !== null) {
|
|
129
|
-
newIconButtonMenu.addItem(itemId, itemLabel || "Unnamed" + index, itemIcon || "");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
return newIconButtonMenu;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=iconButtonMenu.ui.jsx.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconButtonMenu.ui.jsx","sourceRoot":"","sources":["../../src/ui/iconButtonMenu.ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAU,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,OAAO,cAAe,SAAQ,UAAU;IAO1C,YAAmB,EAAU,EAAE,IAAY;QACvC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAPpB;;;;;WAAW;QACX;;;;;WAAyB;QACzB;;;;;WAAgC;QAEhC;;;;;WAA4C;QAKxC,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QAElC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,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
export declare class Image extends Widget {
|
|
5
|
-
imageContainer: Widget;
|
|
6
|
-
image: Widget;
|
|
7
|
-
constructor(id: string, src?: string, parent?: Widget | null);
|
|
8
|
-
render(): void;
|
|
9
|
-
fillWidth(): void;
|
|
10
|
-
fillHeight(): void;
|
|
11
|
-
setAlternateText(text: string): void;
|
|
12
|
-
setImageUrl(url: string): void;
|
|
13
|
-
getImageUrl(): string | null;
|
|
14
|
-
getAlternateText(): string | null;
|
|
15
|
-
}
|
|
16
|
-
export type wImageProps = WidgetProps & {
|
|
17
|
-
src: string;
|
|
18
|
-
alt?: string | null;
|
|
19
|
-
fillWidth?: boolean | null;
|
|
20
|
-
fillHeight?: boolean | null;
|
|
21
|
-
width?: number | null;
|
|
22
|
-
height?: number | null;
|
|
23
|
-
};
|
|
24
|
-
export declare const WImage: (props: wImageProps) => any;
|
|
25
|
-
export declare function createImage(id: string, content: any, parent?: Widget | null): Image;
|