@wavemaker/app-ng-runtime 12.0.0-next.45055 → 12.0.0-next.45058
Sign up to get free protection for your applications and to get access to all the features.
- app-ng-runtime/components/dialogs/default/base-dialog.d.ts +2 -0
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +3 -0
- app-ng-runtime/components/dialogs/default/esm2022/base-dialog.mjs +5 -2
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs +4 -1
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/dialogs/design-dialog/bundles/index.umd.js +19 -2
- app-ng-runtime/components/dialogs/design-dialog/dialog.component.d.ts +3 -2
- app-ng-runtime/components/dialogs/design-dialog/esm2022/dialog.component.mjs +20 -3
- app-ng-runtime/components/dialogs/design-dialog/fesm2022/index.mjs +19 -2
- app-ng-runtime/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/page/left-panel/bundles/index.umd.js +6 -2
- app-ng-runtime/components/page/left-panel/esm2022/left-panel.directive.mjs +9 -5
- app-ng-runtime/components/page/left-panel/fesm2022/index.mjs +8 -4
- app-ng-runtime/components/page/left-panel/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/page/left-panel/left-panel.directive.d.ts +2 -2
- app-ng-runtime/components/page/right-panel/bundles/index.umd.js +6 -2
- app-ng-runtime/components/page/right-panel/esm2022/right-panel.directive.mjs +9 -5
- app-ng-runtime/components/page/right-panel/fesm2022/index.mjs +8 -4
- app-ng-runtime/components/page/right-panel/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/page/right-panel/right-panel.directive.d.ts +2 -2
- app-ng-runtime/core/bundles/index.umd.js +12 -0
- app-ng-runtime/core/esm2022/public_api.mjs +2 -2
- app-ng-runtime/core/esm2022/utils/utils.mjs +9 -1
- app-ng-runtime/core/fesm2022/index.mjs +11 -1
- app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/core/public_api.d.ts +1 -1
- app-ng-runtime/core/utils/utils.d.ts +2 -0
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +9 -5
- app-ng-runtime/runtime/base/components/base-custom-widget.component.d.ts +2 -1
- app-ng-runtime/runtime/base/esm2022/components/base-custom-widget.component.mjs +9 -7
- app-ng-runtime/runtime/base/esm2022/public_api.mjs +1 -1
- app-ng-runtime/runtime/base/esm2022/types/types.mjs +3 -1
- app-ng-runtime/runtime/base/fesm2022/index.mjs +9 -6
- app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/runtime/base/types/types.d.ts +3 -0
- app-ng-runtime/runtime/dynamic/app/services/customwidget-config-provider.service.d.ts +8 -0
- app-ng-runtime/runtime/dynamic/bundles/index.umd.js +22 -4
- app-ng-runtime/runtime/dynamic/esm2022/app/app.module.mjs +4 -2
- app-ng-runtime/runtime/dynamic/esm2022/app/services/customwidget-config-provider.service.mjs +22 -0
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs +25 -5
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/scripts/custom-widgets-m3/src/checkbox_set/checkbox_set.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/checkbox_set/checkbox_set.js +38 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/checkbox_set/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/checkbox_set/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/discrete_slider/discrete_slider.d.ts +10 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/discrete_slider/discrete_slider.js +171 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/discrete_slider/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/discrete_slider/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/divider/divider.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/divider/divider.js +28 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/divider/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/divider/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/icon_button/icon_button.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/icon_button/icon_button.js +24 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/icon_button/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/icon_button/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/input_chip.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/input_chip.js +34 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/input_chip.variables.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/input_chip.variables.js +1 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/input_chip/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/payee_list/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/payee_list/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/payee_list/payee_list.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/payee_list/payee_list.js +19 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/progressbar/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/progressbar/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/progressbar/progressbar.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/progressbar/progressbar.js +52 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/radio_set/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/radio_set/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/radio_set/radio_set.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/radio_set/radio_set.js +35 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/slider/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/slider/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/slider/slider.d.ts +11 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/slider/slider.js +121 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/switch_button/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/switch_button/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/switch_button/switch_button.d.ts +0 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/switch_button/switch_button.js +33 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/textfield/page.min.d.ts +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/textfield/page.min.js +7 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/textfield/textfield.d.ts +4 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/textfield/textfield.js +65 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/widget-registry.d.ts +6 -0
- app-ng-runtime/scripts/custom-widgets-m3/src/widget-registry.js +68 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
* Use App.getDependency for Dependency Injection
|
3
|
+
* eg: var DialogService = App.getDependency('DialogService');
|
4
|
+
*/
|
5
|
+
/* perform any action on widgets/variables within this block */
|
6
|
+
Widget.onReady = function () {
|
7
|
+
/*
|
8
|
+
* variables can be accessed through 'Widget.Variables' property here
|
9
|
+
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
|
10
|
+
* Widget.Variables.loggedInUser.getData()
|
11
|
+
*
|
12
|
+
* widgets can be accessed through 'Widget.Widgets' property here
|
13
|
+
* e.g. to get value of text widget named 'username' use following script
|
14
|
+
* 'Widget.Widgets.username.datavalue'
|
15
|
+
*/
|
16
|
+
if (Widget.props.show_intermediate.toString().toLowerCase() === 'true') {
|
17
|
+
Widget.Widgets.checkboxset.class += ' intermediate-checkbox';
|
18
|
+
}
|
19
|
+
if (Widget.props.layout === "horizontal") {
|
20
|
+
Widget.Widgets.checkboxset.class += ' horizontal';
|
21
|
+
}
|
22
|
+
else {
|
23
|
+
Widget.Widgets.checkboxset.class += ' vertical';
|
24
|
+
}
|
25
|
+
if (Widget.props.label_placement === "top") {
|
26
|
+
Widget.Widgets.checkboxset.class += ' top-placement';
|
27
|
+
}
|
28
|
+
else if (Widget.props.label_placement === "bottom") {
|
29
|
+
Widget.Widgets.checkboxset.class += ' bottom-placement';
|
30
|
+
}
|
31
|
+
else if (Widget.props.label_placement === "start") {
|
32
|
+
Widget.Widgets.checkboxset.class += ' start-placement';
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
Widget.Widgets.checkboxset.class += '';
|
36
|
+
}
|
37
|
+
Widget.Widgets.composite.required = Widget.props.required;
|
38
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var checkbox_set = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-composite+name%3D%22composite%22%3E%0A++++++++%3Cwm-label+class%3D%22+control-label%22+notag%3D%22true%22+name%3D%22label1%22+caption%3D%22bind%3Aprops.label_text%22%3E%3C%2Fwm-label%3E%0A++++++++%3Cwm-container+name%3D%22container1%22%3E%0A++++++++++++%3Cwm-checkboxset+height%3D%22auto%22+name%3D%22checkboxset%22+dataset%3D%22bind%3Aprops.data_set%22+datafield%3D%22All+Fields%22+disabled%3D%22bind%3Aprops.state+%3D%3D+%26quot%3BDisabled%26quot%3B%22+required%3D%22bind%3Aprops.required%22+datavalue%3D%22bind%3Aprops.default_value%22%3E%3C%2Fwm-checkboxset%3E%0A++++++++%3C%2Fwm-container%3E%0A++++%3C%2Fwm-composite%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
script: "%2F*%0A+*+Use+App.getDependency+for+Dependency+Injection%0A+*+eg%3A+var+DialogService+%3D+App.getDependency%28%27DialogService%27%29%3B%0A+*%2F%0A%0A%2F*+perform+any+action+on+widgets%2Fvariables+within+this+block+*%2F%0AWidget.onReady+%3D+function%28%29+%7B%0A++++%2F*%0A+++++*+variables+can+be+accessed+through+%27Widget.Variables%27+property+here%0A+++++*+e.g.+to+get+dataSet+in+a+staticVariable+named+%27loggedInUser%27+use+following+script%0A+++++*+Widget.Variables.loggedInUser.getData%28%29%0A+++++*%0A+++++*+widgets+can+be+accessed+through+%27Widget.Widgets%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27Widget.Widgets.username.datavalue%27%0A+++++*%2F%0A++++if+%28Widget.props.show_intermediate.toString%28%29.toLowerCase%28%29+%3D%3D%3D+%27true%27%29+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+intermediate-checkbox%27%3B%0A++++%7D%0A%0A++++if+%28Widget.props.layout+%3D%3D%3D+%22horizontal%22%29+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+horizontal%27%3B%0A++++%7D+else+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+vertical%27%3B%0A++++%7D%0A++++if+%28Widget.props.label_placement+%3D%3D%3D+%22top%22%29+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+top-placement%27%3B%0A++++%7D+else+if+%28Widget.props.label_placement+%3D%3D%3D+%22bottom%22%29+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+bottom-placement%27%3B%0A++++%7D+else+if+%28Widget.props.label_placement+%3D%3D%3D+%22start%22%29+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27+start-placement%27%3B%0A++++%7D+else+%7B%0A++++++++Widget.Widgets.checkboxset.class+%2B%3D+%27%27%3B%0A++++%7D%0A++++Widget.Widgets.composite.required+%3D+Widget.props.required%3B%0A%0A%7D%3B",
|
4
|
+
styles: ".app-checkboxset.vertical+%7B%0A++++flex-direction%3A+column%3B%0A%7D%0A%0A.app-checkboxset.intermediate-checkbox+.app-checkboxset-label%3E.caption%3A%3Aafter+%7B%0A++++top%3A+calc%28100%25+-+25px%29%3B%0A++++height%3A+0px%3B%0A++++transform%3A+translate%283px%2C+4px%29+rotate%280deg%29+%21important%3B%0A%7D%0A%0A%0A%2F*+start+label+placement+styles++*%2F%0A%0A.app-checkboxset.horizontal.start-placement+.app-checkboxset-label%3E.caption%2C%0A.app-checkboxset.vertical.start-placement+.app-checkboxset-label%3E.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-right%3A+32px%3B%0A%7D%0A%0A.app-checkboxset.horizontal.start-placement+.checkbox%3Elabel+.caption%3Abefore%2C%0A.app-checkboxset.vertical.start-placement+.checkbox%3Elabel+.caption%3Abefore+%7B%0A++++left%3A+unset%3B%0A++++right%3A+1px%3B%0A%7D%0A%0A.app-checkboxset.horizontal.start-placement+.checkbox%3Elabel+.caption%3Aafter%2C%0A.app-checkboxset.vertical.start-placement+.checkbox%3Elabel+.caption%3Aafter+%7B%0A++++left%3A+unset%3B%0A++++right%3A+7px%3B%0A%7D%0A%0A.app-checkboxset.horizontal.start-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%2C%0A.app-checkboxset.vertical.start-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D+%7B%0A++++left%3A+unset%3B%0A++++right%3A+-10px%3B%0A%7D%0A%0A%0A%2F*+top+label+placement+styles++*%2F%0A%0A.app-checkboxset.horizontal.top-placement+.app-checkboxset-label%3E.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-bottom%3A+32px%3B%0A++++min-width%3A+20px%3B%0A++++justify-content%3A+center%3B%0A++++display%3A+inline-flex%3B%0A++++margin-top%3A+unset%3B%0A%7D%0A%0A.app-checkboxset.horizontal.top-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translate%28-6px%2C+4px%29+rotate%28-45deg%29+scale%281%29%3B%0A++++top%3A+32px%3B%0A%7D%0A%0A.app-checkboxset.horizontal.top-placement+.app-checkboxset-label%3E.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++top%3A+32px%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.horizontal.top-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D+%7B%0A++++left%3A+50%25%3B%0A++++top%3A+21px%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.vertical.top-placement+.app-checkboxset-label%3E.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-bottom%3A+unset%3B%0A++++padding-top%3A+32px%3B%0A%7D%0A%0A.app-checkboxset.vertical.top-placement+%7B%0A++++display%3A+flex%3B%0A++++min-width%3A+40px%3B%0A++++max-width%3A+max-content%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.app-checkboxset.vertical.top-placement+.app-checkboxset-label%3E.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.vertical.top-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.wm-app+.app-checkboxset.vertical.top-placement%3E.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translate%28-6px%2C+4px%29+rotate%28-45deg%29+scale%281%29%3B%0A%7D%0A%0A%0A%2F*+bottom+label+placement+style++*%2F%0A%0A.app-checkboxset.horizontal.bottom-placement+.app-checkboxset-label%3E.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-top%3A+32px%3B%0A++++min-width%3A+20px%3B%0A++++justify-content%3A+center%3B%0A++++display%3A+inline-flex%3B%0A++++margin-top%3A+unset%3B%0A%7D%0A%0A.app-checkboxset.horizontal.bottom-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translate%28-6px%2C+4px%29+rotate%28-45deg%29+scale%281%29%3B%0A++++top%3A+8px%3B%0A%7D%0A%0A.app-checkboxset.horizontal.bottom-placement+.app-checkboxset-label%3E.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++top%3A+8px%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.horizontal.bottom-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D+%7B%0A++++left%3A+50%25%3B%0A++++top%3A+-2px%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.vertical.bottom-placement+.app-checkboxset-label%3E.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-bottom%3A+unset%3B%0A++++padding-top%3A+32px%3B%0A%7D%0A%0A.app-checkboxset.vertical.bottom-placement+%7B%0A++++display%3A+flex%3B%0A++++min-width%3A+40px%3B%0A++++max-width%3A+max-content%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.app-checkboxset.vertical.bottom-placement+.app-checkboxset-label%3E.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.app-checkboxset.vertical.bottom-placement+.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A.wm-app+.app-checkboxset.vertical.bottom-placement%3E.app-checkbox.checkbox%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translate%28-6px%2C+4px%29+rotate%28-45deg%29+scale%281%29%3B%0A%7D%0A%0A.app-checkboxset.horizontal+.app-checkboxset-label.disabled%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3A%3Abefore%2C%0A.app-checkboxset.horizontal.intermediate-checkbox+.app-checkboxset-label.disabled%3Einput%5Btype%3D%22checkbox%22%5D%2B.caption%3A%3Abefore%2C%0A.app-checkboxset.vertical+.app-checkboxset-label.disabled%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2B.caption%3A%3Abefore%2C%0A.app-checkboxset.vertical.intermediate-checkbox+.app-checkboxset-label.disabled%3Einput%5Btype%3D%22checkbox%22%5D%2B.caption%3A%3Abefore+%7B%0A++++border-color%3A+var%28--wm-checkbox-border-color%29%3B%0A++++background-color%3A+var%28--wm-checkbox-border-color%29%3B%0A%7D",
|
5
|
+
variables: "%7B+%7D",
|
6
|
+
config: "%7B%0A%20%20%22widgetType%22%20%3A%20%22wm-custom-widget%22%2C%0A%20%20%22properties%22%20%3A%20%7B%0A%20%20%20%20%22layout%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Layout%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Defines%20the%20orientation%20of%20the%20element.%20%27horizontal%27%20indicates%20that%20the%20element%27s%20layout%20or%20behavior%20is%20aligned%20along%20the%20horizontal%20axis%20(left%20to%20right)%2C%20while%20%27vertical%27%20means%20the%20element%20is%20aligned%20along%20the%20vertical%20axis%20(top%20to%20bottom)%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22horizontal%22%2C%20%22vertical%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22horizontal%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22show_intermediate%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22boolean%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Intermediate%20checkbox%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Controls%20whether%20the%20checkbox%20shows%20an%20indeterminate%20state.%20True%20displays%20the%20intermediate%20state%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20false%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22state%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22State%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20whether%20the%20component%20is%20active%20or%20inactive.%20%27enabled%27%20means%20the%20component%20is%20interactive%20and%20functional%2C%20while%20%27disabled%27%20means%20it%20is%20non-interactive%20and%20inactive%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22Enabled%22%2C%20%22Disabled%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Enabled%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22label_placement%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Label%20placement%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20label%27s%20position%20relative%20to%20the%20component%2C%20with%20options%3A%20%27top%27%20(Label%20appears%20above%20the%20component)%2C%20%27bottom%27%20(Label%20appears%20below%20the%20component)%2C%20%27start%27%20(Label%20appears%20left%20of%20the%20component)%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22top%22%2C%20%22bottom%22%2C%20%22start%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22top%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22label_text%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Label%20text%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Label%20text%20informs%20users%20about%20what%20information%20is%20requested%20for%20a%20checkboxSet%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Label%20Text%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data_set%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Data%20Set%20values%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Defines%20the%20available%20options%20for%20the%20data%20set%2C%20typically%20a%20list%20of%20labels%20such%20as%20%27yes%27%2C%20%27no%27%2C%20%27maybe%27%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22yes%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22default_value%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Default%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20default%20value%20for%20the%20checked%20attribute.%20Default%20is%20%27yes%27%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22yes%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22required%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22boolean%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Required%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Indicates%20whether%20the%20checkboxSet%20is%20mandatory.%20True%20makes%20it%20required%3B%20false%20means%20it%20is%20optional%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20false%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22events%22%20%3A%20%7B%20%7D%0A%7D%0A",
|
7
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
declare function handleValueChange(): void;
|
2
|
+
declare function handleStepValueChange(): void;
|
3
|
+
declare function handleRequiredChange(): void;
|
4
|
+
declare function activeSliderElement(): void;
|
5
|
+
declare function activeSliderElement(widgetMap: any): void;
|
6
|
+
declare function configureDiscreteSlider(): void;
|
7
|
+
declare function updateSteps(): void;
|
8
|
+
declare function updateLabelVisibility(): void;
|
9
|
+
declare function getSliderPercentage(value: any): number;
|
10
|
+
declare function getSliderPercentage(value: any): number;
|
@@ -0,0 +1,171 @@
|
|
1
|
+
function handleValueChange() {
|
2
|
+
var initialValue = Number(Widget.props.value); // Use props.value for initial value
|
3
|
+
Widget.Widgets.slider1.$element[0].style.setProperty("--end", (100 - getSliderPercentage(initialValue)) + '%');
|
4
|
+
updateSteps();
|
5
|
+
configureDiscreteSlider();
|
6
|
+
updateLabelVisibility();
|
7
|
+
}
|
8
|
+
function handleStepValueChange() {
|
9
|
+
Widget.Widgets.slider1.step = Widget.props.step_value;
|
10
|
+
updateSteps();
|
11
|
+
configureDiscreteSlider();
|
12
|
+
updateLabelVisibility();
|
13
|
+
}
|
14
|
+
function handleRequiredChange() {
|
15
|
+
Widget.Widgets.composite.required = Widget.props.required;
|
16
|
+
}
|
17
|
+
Widget.onPropertyChange = function (propname, newvalue, oldvalue) {
|
18
|
+
switch (propname) {
|
19
|
+
case 'prop-value':
|
20
|
+
case 'prop-min_value':
|
21
|
+
case 'prop-max_value':
|
22
|
+
handleValueChange();
|
23
|
+
break;
|
24
|
+
case 'prop-step_value':
|
25
|
+
handleStepValueChange();
|
26
|
+
break;
|
27
|
+
case 'prop-required':
|
28
|
+
handleRequiredChange();
|
29
|
+
break;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
Widget.onReady = function () {
|
33
|
+
Widget.Widgets.container1.class += ' filled-slider discrete-slider';
|
34
|
+
handleValueChange();
|
35
|
+
handleRequiredChange();
|
36
|
+
configureDiscreteSlider();
|
37
|
+
handleStepValueChange();
|
38
|
+
updateSteps();
|
39
|
+
activeSliderElement();
|
40
|
+
updateLabelVisibility(); // Update label visibility based on initial value
|
41
|
+
};
|
42
|
+
function activeSliderElement() {
|
43
|
+
var activeSlider = Widget.Widgets.slider1.$element[0]; // Get the slider element
|
44
|
+
if (activeSlider) {
|
45
|
+
// Create a new div element
|
46
|
+
var newDiv = document.createElement('p');
|
47
|
+
newDiv.className = 'active-slider'; // Set a class for styling
|
48
|
+
// Append the new element to slider container
|
49
|
+
activeSlider.appendChild(newDiv);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
/*
|
53
|
+
* Configure the slider for discrete steps.
|
54
|
+
*/
|
55
|
+
function configureDiscreteSlider() {
|
56
|
+
var slider = Widget.Widgets.slider1; // Slider widget
|
57
|
+
var minValue = parseInt(Widget.props.min_value, 10);
|
58
|
+
var maxValue = parseInt(Widget.props.max_value, 10);
|
59
|
+
var stepValueParam = Widget.props.step_value;
|
60
|
+
var initialValue = Number(Widget.props.value); // Use props.value for initial value
|
61
|
+
var stepValue = parseInt(stepValueParam, 10);
|
62
|
+
if (isNaN(minValue) || isNaN(maxValue) || isNaN(stepValue) || stepValue <= 0) {
|
63
|
+
console.error("Invalid min, max, or step values");
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
// Set slider's min, max, and step attributes
|
67
|
+
slider.min = minValue;
|
68
|
+
slider.max = maxValue;
|
69
|
+
slider.step = stepValue;
|
70
|
+
// Ensure slider value is within the range
|
71
|
+
if (isNaN(initialValue) || initialValue < minValue || initialValue > maxValue) {
|
72
|
+
console.error("Slider value is out of range");
|
73
|
+
slider.datavalue = minValue; // Default to minValue if the provided value is invalid
|
74
|
+
}
|
75
|
+
else {
|
76
|
+
slider.datavalue = initialValue; // Set the slider to the provided value
|
77
|
+
}
|
78
|
+
// Set initial position
|
79
|
+
Widget.Widgets.slider1.$element[0].style.setProperty("--end", (100 - getSliderPercentage(slider.datavalue)) + '%');
|
80
|
+
}
|
81
|
+
/*
|
82
|
+
* Update the labels displayed on the slider.
|
83
|
+
*/
|
84
|
+
function updateSteps() {
|
85
|
+
var slider = Widget.Widgets.slider1;
|
86
|
+
var labelContainer = Widget.Widgets.container2;
|
87
|
+
if (slider && labelContainer) {
|
88
|
+
var minValue = parseInt(slider.min, 10);
|
89
|
+
var maxValue = parseInt(slider.max, 10);
|
90
|
+
var stepValue = parseInt(slider.step, 10);
|
91
|
+
// Calculate the number of steps
|
92
|
+
var numSteps = Math.ceil((maxValue - minValue) / stepValue);
|
93
|
+
// Clear existing labels
|
94
|
+
labelContainer.$element[0].innerHTML = '';
|
95
|
+
// Create and position labels for each step
|
96
|
+
for (var i = 0; i <= numSteps; i++) {
|
97
|
+
var stepLabel = document.createElement('p');
|
98
|
+
stepLabel.className = 'step-label';
|
99
|
+
var labelValue = minValue + (i * stepValue);
|
100
|
+
// Ensure labelValue does not exceed maxValue
|
101
|
+
if (labelValue > maxValue)
|
102
|
+
break;
|
103
|
+
stepLabel.textContent = labelValue;
|
104
|
+
// Calculate and set label position
|
105
|
+
var leftPosition = Math.round(((labelValue - minValue) / (maxValue - minValue)) * 100 * 100) / 100; // Rounded to two decimal places
|
106
|
+
var adjustedPosition = leftPosition - 1;
|
107
|
+
stepLabel.style.setProperty('--position', "".concat(adjustedPosition, "%"));
|
108
|
+
stepLabel.setAttribute('data-position', adjustedPosition);
|
109
|
+
// Append label to the container
|
110
|
+
labelContainer.$element[0].appendChild(stepLabel);
|
111
|
+
}
|
112
|
+
// Set container positioning and add event listener for updating label visibility
|
113
|
+
labelContainer.$element[0].style.position = 'relative';
|
114
|
+
Widget.Widgets.slider1.$element[0].addEventListener('input', updateLabelVisibility);
|
115
|
+
// Initial update of label visibility
|
116
|
+
updateLabelVisibility();
|
117
|
+
}
|
118
|
+
}
|
119
|
+
function updateLabelVisibility() {
|
120
|
+
var slider = Widget.Widgets.slider1;
|
121
|
+
var labels = Widget.Widgets.container2.$element[0].getElementsByClassName('step-label');
|
122
|
+
if (slider) {
|
123
|
+
var sliderValue = Number(slider.datavalue); // Get the current slider value
|
124
|
+
var minValue_1 = parseInt(slider.min, 10);
|
125
|
+
var maxValue_1 = parseInt(slider.max, 10);
|
126
|
+
var stepValue_1 = parseInt(slider.step, 10);
|
127
|
+
// Calculate the number of steps
|
128
|
+
var targets = Array.from({
|
129
|
+
length: Math.ceil((maxValue_1 - minValue_1) / stepValue_1) + 1
|
130
|
+
}, function (_, i) { return minValue_1 + i * stepValue_1; }).filter(function (value) { return value <= maxValue_1; });
|
131
|
+
// Update label states based on slider value and targets
|
132
|
+
for (var _i = 0, labels_1 = labels; _i < labels_1.length; _i++) {
|
133
|
+
var label = labels_1[_i];
|
134
|
+
var labelValue = parseInt(label.textContent, 10);
|
135
|
+
// Remove existing classes
|
136
|
+
label.classList.remove('hidden', 'inactive', 'active');
|
137
|
+
// Determine the label's state based on the slider value
|
138
|
+
if (targets.includes(labelValue)) {
|
139
|
+
if (labelValue === sliderValue) {
|
140
|
+
label.classList.add('hidden'); // Hide label if it matches the slider value
|
141
|
+
}
|
142
|
+
else if (labelValue < sliderValue) {
|
143
|
+
label.classList.add('inactive'); // Label is inactive if it is less than the slider value
|
144
|
+
}
|
145
|
+
else {
|
146
|
+
label.classList.add('active'); // Label is active if it is greater than the slider value
|
147
|
+
}
|
148
|
+
}
|
149
|
+
// Ensure that labels are visible based on their state
|
150
|
+
label.style.display = 'block';
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
/*
|
155
|
+
* Convert slider value to percentage based on min and max
|
156
|
+
*/
|
157
|
+
function getSliderPercentage(value) {
|
158
|
+
var slider = Widget.Widgets.slider1;
|
159
|
+
var minValue = parseInt(slider.min, 10);
|
160
|
+
var maxValue = parseInt(slider.max, 10);
|
161
|
+
return ((value - minValue) / (maxValue - minValue)) * 100;
|
162
|
+
}
|
163
|
+
/*
|
164
|
+
* Handle slider value changes.
|
165
|
+
*/
|
166
|
+
Widget.slider1Change = function ($event, widget, newVal, oldVal) {
|
167
|
+
var sliderValue = newVal; // Use the new slider value
|
168
|
+
widget.$element[0].style.setProperty("--end", (100 - getSliderPercentage(sliderValue)) + '%');
|
169
|
+
// Update label visibility on slider change
|
170
|
+
updateLabelVisibility();
|
171
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var discrete_slider = {
|
2
|
+
"markup": "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-composite+name%3D%22composite%22+class%3D%22slider-composite%22%3E%0A++++++++%3Cwm-label+class%3D%22control-label%22+notag%3D%22true%22+name%3D%22label1%22+caption%3D%22bind%3Aprops.label_text%22%3E%3C%2Fwm-label%3E%0A++++++++%3Cwm-container+name%3D%22container1%22+class%3D%22filled-slider%22%3E%0A++++++++++++%3Cwm-slider+name%3D%22slider1%22+class%3D%22cst-slider%22+datavalue%3D%22bind%3Aprops.value%22+on-change%3D%22slider1Change%28%24event%2C+widget%2C+newVal%2C+oldVal%29%22+disabled%3D%22bind%3Aprops.state%3D%3D%26quot%3BDisabled%26quot%3B%22+minvalue%3D%22bind%3Aprops.min_value%22+maxvalue%3D%22bind%3Aprops.max_value%22%3E%3C%2Fwm-slider%3E%0A++++++++%3C%2Fwm-container%3E%0A++++++++%3Cwm-container+name%3D%22container2%22+class%3D%22stop-indicator%22%3E%3C%2Fwm-container%3E%0A++++%3C%2Fwm-composite%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
"script": "function+handleValueChange%28%29+%7B%0A++++const+initialValue+%3D+Number%28Widget.props.value%29%3B+%2F%2F+Use+props.value+for+initial+value%0A++++Widget.Widgets.slider1.%24element%5B0%5D.style.setProperty%28%22--end%22%2C+%28100+-+getSliderPercentage%28initialValue%29%29+%2B+%27%25%27%29%3B%0A++++updateSteps%28%29%3B%0A++++configureDiscreteSlider%28%29%3B%0A++++updateLabelVisibility%28%29%3B%0A%7D%0A%0Afunction+handleStepValueChange%28%29+%7B%0A++++Widget.Widgets.slider1.step+%3D+Widget.props.step_value%3B%0A++++updateSteps%28%29%3B%0A++++configureDiscreteSlider%28%29%3B%0A++++updateLabelVisibility%28%29%3B%0A%7D%0A%0Afunction+handleRequiredChange%28%29+%7B%0A++++Widget.Widgets.composite.required+%3D+Widget.props.required%3B%0A%0A%7D%0A%0AWidget.onPropertyChange+%3D+function%28propname%2C+newvalue%2C+oldvalue%29+%7B%0A++++switch+%28propname%29+%7B%0A++++++++case+%27prop-value%27%3A%0A++++++++case+%27prop-min_value%27%3A%0A++++++++case+%27prop-max_value%27%3A%0A++++++++++++handleValueChange%28%29%3B%0A++++++++++++break%3B%0A++++++++case+%27prop-step_value%27%3A%0A++++++++++++handleStepValueChange%28%29%3B%0A++++++++++++break%3B%0A++++++++case+%27prop-required%27%3A%0A++++++++++++handleRequiredChange%28%29%3B%0A++++++++++++break%3B%0A++++%7D%0A%7D%0A%0A%0AWidget.onReady+%3D+function%28%29+%7B%0A++++Widget.Widgets.container1.class+%2B%3D+%27+filled-slider+discrete-slider%27%3B%0A++++handleValueChange%28%29%0A++++handleRequiredChange%28%29%0A++++configureDiscreteSlider%28%29%3B%0A++++handleStepValueChange%28%29%3B%0A++++updateSteps%28%29%3B%0A++++activeSliderElement%28%29%3B%0A++++updateLabelVisibility%28%29%3B+%2F%2F+Update+label+visibility+based+on+initial+value%0A%7D%3B%0A%0A%0A%0Afunction+activeSliderElement%28%29+%7B%0A++++const+activeSlider+%3D+Widget.Widgets.slider1.%24element%5B0%5D%3B+%2F%2F+Get+the+slider+element%0A%0A++++if+%28activeSlider%29+%7B%0A++++++++%2F%2F+Create+a+new+div+element%0A++++++++const+newDiv+%3D+document.createElement%28%27p%27%29%3B%0A++++++++newDiv.className+%3D+%27active-slider%27%3B+%2F%2F+Set+a+class+for+styling%0A++++++++%2F%2F+Append+the+new+element+to+slider+container%0A++++++++activeSlider.appendChild%28newDiv%29%3B%0A++++%7D%0A%7D%0A%0A%2F*+%0A+*+Configure+the+slider+for+discrete+steps.%0A+*%2F%0Afunction+configureDiscreteSlider%28%29+%7B%0A++++const+slider+%3D+Widget.Widgets.slider1%3B+%2F%2F+Slider+widget%0A++++const+minValue+%3D+parseInt%28Widget.props.min_value%2C+10%29%3B%0A++++const+maxValue+%3D+parseInt%28Widget.props.max_value%2C+10%29%3B%0A++++const+stepValueParam+%3D+Widget.props.step_value%3B%0A++++const+initialValue+%3D+Number%28Widget.props.value%29%3B+%2F%2F+Use+props.value+for+initial+value%0A%0A++++const+stepValue+%3D+parseInt%28stepValueParam%2C+10%29%3B%0A++++if+%28isNaN%28minValue%29+%7C%7C+isNaN%28maxValue%29+%7C%7C+isNaN%28stepValue%29+%7C%7C+stepValue+%3C%3D+0%29+%7B%0A++++++++console.error%28%22Invalid+min%2C+max%2C+or+step+values%22%29%3B%0A++++++++return%3B%0A++++%7D%0A%0A++++%2F%2F+Set+slider%27s+min%2C+max%2C+and+step+attributes%0A++++slider.min+%3D+minValue%3B%0A++++slider.max+%3D+maxValue%3B%0A++++slider.step+%3D+stepValue%3B%0A%0A++++%2F%2F+Ensure+slider+value+is+within+the+range%0A++++if+%28isNaN%28initialValue%29+%7C%7C+initialValue+%3C+minValue+%7C%7C+initialValue+%3E+maxValue%29+%7B%0A++++++++console.error%28%22Slider+value+is+out+of+range%22%29%3B%0A++++++++slider.datavalue+%3D+minValue%3B+%2F%2F+Default+to+minValue+if+the+provided+value+is+invalid%0A++++%7D+else+%7B%0A++++++++slider.datavalue+%3D+initialValue%3B+%2F%2F+Set+the+slider+to+the+provided+value%0A++++%7D%0A%0A++++%2F%2F+Set+initial+position%0A++++Widget.Widgets.slider1.%24element%5B0%5D.style.setProperty%28%22--end%22%2C+%28100+-+getSliderPercentage%28slider.datavalue%29%29+%2B+%27%25%27%29%3B%0A%7D%0A%0A%2F*%0A+*+Update+the+labels+displayed+on+the+slider.%0A+*%2F%0Afunction+updateSteps%28%29+%7B%0A++++const+slider+%3D+Widget.Widgets.slider1%3B%0A++++const+labelContainer+%3D+Widget.Widgets.container2%3B%0A%0A++++if+%28slider+%26%26+labelContainer%29+%7B%0A++++++++const+minValue+%3D+parseInt%28slider.min%2C+10%29%3B%0A++++++++const+maxValue+%3D+parseInt%28slider.max%2C+10%29%3B%0A++++++++const+stepValue+%3D+parseInt%28slider.step%2C+10%29%3B%0A%0A++++++++%2F%2F+Calculate+the+number+of+steps%0A++++++++const+numSteps+%3D+Math.ceil%28%28maxValue+-+minValue%29+%2F+stepValue%29%3B%0A%0A++++++++%2F%2F+Clear+existing+labels%0A++++++++labelContainer.%24element%5B0%5D.innerHTML+%3D+%27%27%3B%0A%0A++++++++%2F%2F+Create+and+position+labels+for+each+step%0A++++++++for+%28let+i+%3D+0%3B+i+%3C%3D+numSteps%3B+i%2B%2B%29+%7B%0A++++++++++++const+stepLabel+%3D+document.createElement%28%27p%27%29%3B%0A++++++++++++stepLabel.className+%3D+%27step-label%27%3B%0A++++++++++++const+labelValue+%3D+minValue+%2B+%28i+*+stepValue%29%3B%0A%0A++++++++++++%2F%2F+Ensure+labelValue+does+not+exceed+maxValue%0A++++++++++++if+%28labelValue+%3E+maxValue%29+break%3B%0A%0A++++++++++++stepLabel.textContent+%3D+labelValue%3B%0A%0A++++++++++++%2F%2F+Calculate+and+set+label+position%0A++++++++++++const+leftPosition+%3D+Math.round%28%28%28labelValue+-+minValue%29+%2F+%28maxValue+-+minValue%29%29+*+100+*+100%29+%2F+100%3B+%2F%2F+Rounded+to+two+decimal+places%0A++++++++++++const+adjustedPosition+%3D+leftPosition+-+1%3B%0A++++++++++++stepLabel.style.setProperty%28%27--position%27%2C+%60%24%7BadjustedPosition%7D%25%60%29%3B%0A%0A++++++++++++stepLabel.setAttribute%28%27data-position%27%2C+adjustedPosition%29%3B%0A%0A++++++++++++%2F%2F+Append+label+to+the+container%0A++++++++++++labelContainer.%24element%5B0%5D.appendChild%28stepLabel%29%3B%0A++++++++%7D%0A%0A++++++++%2F%2F+Set+container+positioning+and+add+event+listener+for+updating+label+visibility%0A++++++++labelContainer.%24element%5B0%5D.style.position+%3D+%27relative%27%3B%0A++++++++Widget.Widgets.slider1.%24element%5B0%5D.addEventListener%28%27input%27%2C+updateLabelVisibility%29%3B%0A%0A++++++++%2F%2F+Initial+update+of+label+visibility%0A++++++++updateLabelVisibility%28%29%3B%0A++++%7D%0A%7D%0A%0Afunction+updateLabelVisibility%28%29+%7B%0A++++const+slider+%3D+Widget.Widgets.slider1%3B%0A++++const+labels+%3D+Widget.Widgets.container2.%24element%5B0%5D.getElementsByClassName%28%27step-label%27%29%3B%0A%0A++++if+%28slider%29+%7B%0A++++++++const+sliderValue+%3D+Number%28slider.datavalue%29%3B+%2F%2F+Get+the+current+slider+value%0A++++++++const+minValue+%3D+parseInt%28slider.min%2C+10%29%3B%0A++++++++const+maxValue+%3D+parseInt%28slider.max%2C+10%29%3B%0A++++++++const+stepValue+%3D+parseInt%28slider.step%2C+10%29%3B%0A%0A++++++++%2F%2F+Calculate+the+number+of+steps%0A++++++++const+targets+%3D+Array.from%28%7B%0A++++++++++++length%3A+Math.ceil%28%28maxValue+-+minValue%29+%2F+stepValue%29+%2B+1%0A++++++++%7D%2C+%28_%2C+i%29+%3D%3E+minValue+%2B+i+*+stepValue%29.filter%28value+%3D%3E+value+%3C%3D+maxValue%29%3B%0A++++++++%2F%2F+Update+label+states+based+on+slider+value+and+targets%0A++++++++for+%28const+label+of+labels%29+%7B%0A++++++++++++const+labelValue+%3D+parseInt%28label.textContent%2C+10%29%3B%0A%0A++++++++++++%2F%2F+Remove+existing+classes%0A++++++++++++label.classList.remove%28%27hidden%27%2C+%27inactive%27%2C+%27active%27%29%3B%0A%0A++++++++++++%2F%2F+Determine+the+label%27s+state+based+on+the+slider+value%0A++++++++++++if+%28targets.includes%28labelValue%29%29+%7B%0A++++++++++++++++if+%28labelValue+%3D%3D%3D+sliderValue%29+%7B%0A++++++++++++++++++++label.classList.add%28%27hidden%27%29%3B+%2F%2F+Hide+label+if+it+matches+the+slider+value%0A++++++++++++++++%7D+else+if+%28labelValue+%3C+sliderValue%29+%7B%0A++++++++++++++++++++label.classList.add%28%27inactive%27%29%3B+%2F%2F+Label+is+inactive+if+it+is+less+than+the+slider+value%0A++++++++++++++++%7D+else+%7B%0A++++++++++++++++++++label.classList.add%28%27active%27%29%3B+%2F%2F+Label+is+active+if+it+is+greater+than+the+slider+value%0A++++++++++++++++%7D%0A++++++++++++%7D%0A%0A++++++++++++%2F%2F+Ensure+that+labels+are+visible+based+on+their+state%0A++++++++++++label.style.display+%3D+%27block%27%3B%0A++++++++%7D%0A++++%7D%0A%7D%0A%0A%2F*%0A+*+Convert+slider+value+to+percentage+based+on+min+and+max%0A+*%2F%0Afunction+getSliderPercentage%28value%29+%7B%0A++++const+slider+%3D+Widget.Widgets.slider1%3B%0A++++const+minValue+%3D+parseInt%28slider.min%2C+10%29%3B%0A++++const+maxValue+%3D+parseInt%28slider.max%2C+10%29%3B%0A++++return+%28%28value+-+minValue%29+%2F+%28maxValue+-+minValue%29%29+*+100%3B%0A%7D%0A%0A%2F*%0A+*+Handle+slider+value+changes.%0A+*%2F%0AWidget.slider1Change+%3D+function%28%24event%2C+widget%2C+newVal%2C+oldVal%29+%7B%0A++++const+sliderValue+%3D+newVal%3B+%2F%2F+Use+the+new+slider+value%0A++++widget.%24element%5B0%5D.style.setProperty%28%22--end%22%2C+%28100+-+getSliderPercentage%28sliderValue%29%29+%2B+%27%25%27%29%3B%0A%0A++++%2F%2F+Update+label+visibility+on+slider+change%0A++++updateLabelVisibility%28%29%3B%0A%7D%3B",
|
4
|
+
"styles": ".app-composite-widget.form-group%3Ahas%28.filled-slider%29+%7B%0A++++flex-direction%3A+column%3B%0A++++align-items%3A+start%3B%0A%7D%0A%0A.app-container.filled-slider+%7B%0A++++display%3A+flex%3B%0A++++gap%3A+12px%3B%0A++++position%3A+relative%3B%0A++++width%3A+100%25%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider+%7B%0A++++--start%3A+0%25%3B%0A++++--end%3A+100%25%3B%0A++++display%3A+flex%3B%0A++++align-items%3A+center+%21important%3B%0A++++inline-size%3A+auto%3B%0A++++block-size%3A+1.25rem%3B%0A++++margin%3A+1.125rem+0%3B%0A++++flex%3A+none%3B%0A++++direction%3A+ltr%3B%0A++++flex-grow%3A+1%3B%0A++++width%3A+100%25%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider.vertical+%7B%0A++++flex-direction%3A+row+%21important%3B%0A++++margin%3A+.5rem+auto+%21important%3B%0A++++padding%3A+50%25+0%3B%0A++++transform%3A+rotate%28-90deg%29%3B%0A++++inline-size%3A+100%25%3B%0A%7D%0A%0A.app-container.filled-slider%3Ahas%28.app-slider.slider.cst-slider.vertical%29+%7B%0A++++flex-direction%3A+column%3B%0A%7D%0A%0A.app-container.filled-slider.discrete-slider+%7B%0A++++display%3A+flex%3B%0A++++flex-direction%3A+column%3B%0A%7D%0A%0A%5Bdir%3Drtl%5D+.app-container.filled-slider+.app-slider.slider.cst-slider+%7B%0A++++transform%3A+scaleX%28-1%29%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput+%7B%0A++++appearance%3A+none%3B%0A++++box-shadow%3A+none%3B%0A++++border%3A+none%3B%0A++++outline%3A+none%3B%0A++++pointer-events%3A+none%3B%0A++++inline-size%3A+100%25%3B%0A++++block-size%3A+1rem%3B%0A++++background%3A+none%3B%0A++++z-index%3A+1%3B%0A++++padding%3A+0%3B%0A++++margin%3A+0%3B%0A++++opacity%3A+unset%3B%0A++++color%3A+unset%3B%0A++++height%3A+unset%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Aonly-of-type+%7B%0A++++pointer-events%3A+all%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%2Binput+%7B%0A++++position%3A+absolute%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3A%3A-webkit-slider-thumb+%7B%0A++++appearance%3A+none%3B%0A++++box-shadow%3A+none%3B%0A++++border%3A+none%3B%0A++++outline%3A+none%3B%0A++++pointer-events%3A+all%3B%0A++++block-size%3A+2.75rem%3B%0A++++inline-size%3A+0.25rem%3B%0A++++border-radius%3A+0.25rem%3B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A++++cursor%3A+grab%3B%0A++++margin%3A+0%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3A%3A-moz-range-thumb+%7B%0A++++appearance%3A+none%3B%0A++++box-shadow%3A+none%3B%0A++++border%3A+none%3B%0A++++outline%3A+none%3B%0A++++pointer-events%3A+all%3B%0A++++block-size%3A+2.75rem%3B%0A++++inline-size%3A+0.25rem%3B%0A++++border-radius%3A+0.25rem%3B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A++++cursor%3A+grab%3B%0A++++margin%3A+0%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3A%3A-webkit-slider-thumb%3Aactive+%7B%0A++++cursor%3A+grabbing%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3A%3A-moz-range-thumb%3Aactive+%7B%0A++++cursor%3A+grabbing%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Anot%28%3Adisabled%29%3Ais%28%3Afocus%29%3A%3A-webkit-slider-thumb+%7B%0A++++transform%3A+scaleX%280.6%29%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Anot%28%3Adisabled%29%3Ais%28%3Afocus%29%3A%3A-moz-range-thumb+%7B%0A++++transform%3A+scaleX%280.6%29%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Adisabled+%7B%0A++++cursor%3A+not-allowed%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Adisabled%3A%3A-moz-range-thumb+%7B%0A++++cursor%3A+not-allowed%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Einput%3Adisabled%3A%3A-webkit-slider-thumb+%7B%0A++++background%3A+var%28--wm-color-on-surface%29%3B%0A++++cursor%3A+not-allowed%3B%0A++++opacity%3A+0.38%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3A%3Abefore+%7B%0A++++content%3A+%22%22%3B%0A++++position%3A+absolute%3B%0A++++inline-size%3A+100%25%3B%0A++++block-size%3A+1rem%3B%0A++++border-radius%3A+1rem%3B%0A++++background%3A+var%28--wm-color-primary-container%29%3B%0A++++clip-path%3A+polygon%28calc%28var%28--start%29+-+0.5rem%29+0%2C+0+0%2C+0+100%25%2C+calc%28var%28--start%29+-+0.5rem%29+100%25%2C+calc%28var%28--start%29+-+0.5rem%29+0%2C+calc%28100%25+-+var%28--end%29+%2B+0.5rem%29+0%2C+100%25+0%2C+100%25+100%25%2C+calc%28100%25+-+var%28--end%29+%2B+0.5rem%29+100%25%2C+calc%28100%25+-+var%28--end%29+%2B+0.5rem%29+0%29%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3E.active-slider+%7B%0A++++position%3A+absolute%3B%0A++++block-size%3A+1rem%3B%0A++++border-radius%3A+1rem+0+0+1rem%3B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A++++z-index%3A+0%3B%0A++++float%3A+unset%3B%0A++++vertical-align%3A+baseline%3B%0A++++inset%3A+calc%2850%25+-+0.5rem%29+var%28--end%29+auto+var%28--start%29%3B%0A++++clip-path%3A+polygon%280+0%2C+calc%28100%25+-+0.5rem%29+0%2C+calc%28100%25+-+0.5rem%29+100%25%2C+0+100%25%29%3B%0A++++display%3A+block%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3E.app-slider-value+%7B%0A++++position%3A+absolute%3B%0A++++top%3A+36px%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3E.app-slider-value.pull-left+%7B%0A++++left%3A+0%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3E.app-slider-value.pull-right+%7B%0A++++right%3A+0%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Ahas%28input%3Adisabled%29%3A%3Abefore+%7B%0A++++background%3A+var%28+--wm-color-on-surface-focus%29%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider%3Ahas%28input%3Adisabled%29%3Ep.active-slider+%7B%0A++++background%3A+var%28--wm-color-on-surface%29%3B%0A++++opacity%3A+0.38%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider+input%5Btype%3Drange%5D%3A%3A-webkit-slider-runnable-track+%7B%0A++++background%3A+unset%3B%0A++++height%3A+unset%3B%0A++++position%3A+relative%3B%0A%7D%0A%0A%0A%2F*+Ensure+the+container+is+positioned+relatively+to+contain+absolutely+positioned+children+*%2F%0A%0A.app-container.stop-indicator+%7B%0A++++position%3A+relative%3B%0A++++box-sizing%3A+border-box%3B%0A++++width%3A+calc%28100%25+-+48px%29%3B%0A++++margin-inline%3A+auto%3B%0A%7D%0A%0A%0A%2F*+Style+for+individual+step+labels+*%2F%0A%0A.app-container.stop-indicator+.step-label+%7B%0A++++position%3A+absolute%3B%0A++++text-align%3A+center%3B%0A++++white-space%3A+nowrap%3B%0A++++left%3A+var%28--position%2C+0%25%29%3B%0A++++visibility%3A+hidden%3B%0A%7D%0A%0A.app-container.stop-indicator+.step-label.hidden+%7B%0A++++display%3A+none+%21important%3B%0A%7D%0A%0A.app-container.stop-indicator+.step-label.inactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-color-primary-container%29%3B%0A%7D%0A%0A.app-container.stop-indicator+.step-label.active%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.app-container.stop-indicator+.step-label%5Bdata-position%3D%2299%22%5D+%7B%0A++++--position%3A+98.5%25+%21important%3B%0A%7D%0A%0A.app-container.stop-indicator+.step-label%3A%3Abefore+%7B%0A++++position%3A+absolute%3B%0A++++height%3A+4px%3B%0A++++width%3A+4px%3B%0A++++left%3A+var%28--position%2C+0%25%29%3B%0A++++content%3A+%27%27%3B%0A++++top%3A+-30px%3B%0A++++visibility%3A+visible%3B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A++++border-radius%3A+50%25%3B%0A++++display%3A+block%3B%0A%7D",
|
5
|
+
"variables": "%7B+%7D",
|
6
|
+
"config": "%7B%0A%20%20%22widgetType%22%20%3A%20%22wm-custom-widget%22%2C%0A%20%20%22properties%22%20%3A%20%7B%0A%20%20%20%20%22state%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22State%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20interactivity%20of%20the%20widget.%20%27Enabled%27%20allows%20interaction%20with%20the%20widget%2C%20while%20%27Disabled%27%20makes%20the%20widget%20non-interactive%20and%20inactive.%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22Enabled%22%2C%20%22Disabled%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Enabled%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22label_text%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Label%20Text%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Defines%20the%20text%20that%20appears%20on%20the%20widget%E2%80%99s%20label.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Label%20Text%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22value%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Default%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Sets%20the%20initial%20value%20of%20the%20slider%20when%20the%20widget%20is%20first%20displayed.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%2250%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22step_value%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Step%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Defines%20the%20increment%20or%20decrement%20steps%20for%20the%20slider.%20This%20value%20controls%20the%20amount%20by%20which%20the%20slider%E2%80%99s%20value%20changes%20with%20each%20step.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%2210%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22min_value%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22integer%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Minimum%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20smallest%20value%20the%20slider%20can%20be%20set%20to.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%220%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22max_value%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22integer%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Maximum%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20largest%20value%20the%20slider%20can%20be%20set%20to.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22100%22%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22events%22%20%3A%20%7B%0A%20%20%20%20%22onChange%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22function%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22On%20Change%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Triggered%20when%20the%20slider%E2%80%99s%20value%20changes.%20The%20function%20receives%20parameters%20including%20the%20event%2C%20the%20widget%2C%20the%20new%20value%2C%20and%20the%20previous%20value.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22slider1Change(%24event%2C%20widget%2C%20newVal%2C%20oldVal)%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A"
|
7
|
+
};
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Widget.onReady = function () {
|
2
|
+
var orientation_array = Widget.props.orientation.toLowerCase().split("/");
|
3
|
+
var orientation = orientation_array[0]; // Vertical or Horizontal
|
4
|
+
var length = orientation_array[1];
|
5
|
+
Widget.Widgets.divider1.class = (" " + orientation + "-divider");
|
6
|
+
Widget.Widgets.divider1.class += (" " + length);
|
7
|
+
var divider1 = Widget.Widgets.divider1;
|
8
|
+
if (orientation === "vertical" && length === "full-width") {
|
9
|
+
var vertical_height = "".concat(Widget.props.vertical_height, "px");
|
10
|
+
divider1.$element.css({
|
11
|
+
'height': "".concat(vertical_height),
|
12
|
+
});
|
13
|
+
}
|
14
|
+
else if (orientation === "vertical" && length === "inset") {
|
15
|
+
var vertical_height = Widget.props.vertical_height - 16;
|
16
|
+
vertical_height = "".concat(vertical_height, "px");
|
17
|
+
divider1.$element.css({
|
18
|
+
'height': "".concat(vertical_height),
|
19
|
+
});
|
20
|
+
}
|
21
|
+
else if (orientation === "vertical" && length === "middle-inset") {
|
22
|
+
var vertical_height = Widget.props.vertical_height - 32;
|
23
|
+
vertical_height = "".concat(vertical_height, "px");
|
24
|
+
divider1.$element.css({
|
25
|
+
'height': "".concat(vertical_height),
|
26
|
+
});
|
27
|
+
}
|
28
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var divider = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-container+name%3D%22divider1%22+class%3D%22horizontal-divider+full-width%22+style%3D%22+%22%3E%3C%2Fwm-container%3E%0A%0A++++%3C%21--+Height+of+vertical+divider+will+be+supplied+using+inline+styles+and+the+value+can+be+picked+up+from+node+css.+%0A++++A+minimum+height+has+been+defined+in+the+event+that+the+user+uses+a+custom+widget+divider.+--%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
script: "Widget.onReady+%3D+function%28%29+%7B%0A++++const+orientation_array+%3D+Widget.props.orientation.toLowerCase%28%29.split%28%22%2F%22%29%3B%0A++++const+orientation+%3D+orientation_array%5B0%5D%3B+%2F%2F+Vertical+or+Horizontal%0A++++const+length+%3D+orientation_array%5B1%5D%3B%0A%0A++++Widget.Widgets.divider1.class+%3D+%28%22+%22+%2B+orientation+%2B+%22-divider%22%29%3B%0A++++Widget.Widgets.divider1.class+%2B%3D+%28%22+%22+%2B+length%29%3B%0A++++let+divider1+%3D+Widget.Widgets.divider1%3B%0A%0A++++if+%28orientation+%3D%3D%3D+%22vertical%22+%26%26+length+%3D%3D%3D+%22full-width%22%29+%7B%0A++++++++let+vertical_height+%3D+%60%24%7BWidget.props.vertical_height%7Dpx%60%3B%0A++++++++divider1.%24element.css%28%7B%0A++++++++++++%27height%27%3A+%60%24%7Bvertical_height%7D%60%2C%0A++++++++%7D%29%3B%0A++++%7D+else+if+%28orientation+%3D%3D%3D+%22vertical%22+%26%26+length+%3D%3D%3D+%22inset%22%29+%7B%0A++++++++let+vertical_height+%3D+Widget.props.vertical_height+-+16%3B%0A++++++++vertical_height+%3D+%60%24%7Bvertical_height%7Dpx%60%3B%0A++++++++divider1.%24element.css%28%7B%0A++++++++++++%27height%27%3A+%60%24%7Bvertical_height%7D%60%2C%0A++++++++%7D%29%3B%0A++++%7D+else+if+%28orientation+%3D%3D%3D+%22vertical%22+%26%26+length+%3D%3D%3D+%22middle-inset%22%29+%7B%0A++++++++let+vertical_height+%3D+Widget.props.vertical_height+-+32%3B%0A++++++++vertical_height+%3D+%60%24%7Bvertical_height%7Dpx%60%3B%0A++++++++divider1.%24element.css%28%7B%0A++++++++++++%27height%27%3A+%60%24%7Bvertical_height%7D%60%2C%0A++++++++%7D%29%3B%0A++++%7D%0A%0A%7D",
|
4
|
+
styles: ".horizontal-divider+%7B%0A++++display%3A+flex%3B%0A++++border-top%3A+1px+solid+%23CAC4D0%3B%0A++++height%3A+1px+%21important%3B%0A%7D%0A%0A.app-container%3E.horizontal-divider.full-width+%7B%0A++++width%3A+100%25%3B%0A++++margin%3A+auto%3B%0A++++padding%3A+0px%3B%0A%7D%0A%0A.horizontal-divider.inset+%7B%0A++++margin-left%3A+16px%3B%0A%7D%0A%0A.horizontal-divider.middle-inset+%7B%0A++++display%3A+flex%3B%0A++++margin-left%3A+16px%3B%0A++++margin-right%3A+16px%3B%0A%7D%0A%0A.vertical-divider+%7B%0A++++width%3A+1px%3B%0A++++border-left%3A+1px+solid+%23CAC4D0%3B%0A++++min-height%3A+1px%3B%0A%7D%0A%0A.vertical-divider.full-width+%7B%0A++++margin-top%3A+0%3B%0A++++margin-bottom%3A+0%3B%0A%7D%0A%0A.vertical-divider.inset+%7B%0A++++margin-top%3A+16px%3B%0A++++box-sizing%3A+border-box%3B%0A%7D%0A%0A.vertical-divider.middle-inset+%7B%0A++++margin-top%3A+16px%3B%0A++++margin-bottom%3A+16px%3B%0A%7D",
|
5
|
+
variables: "%7B+%7D",
|
6
|
+
config: "%7B%0A%20%20%22widgetType%22%20%3A%20%22wm-custom-widget%22%2C%0A%20%20%22properties%22%20%3A%20%7B%0A%20%20%20%20%22orientation%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Orientation%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Determines%20the%20style%20of%20the%20M3%20divider%20being%20used.%20Default%20value%20is%20horizontal%2Ffull-width.%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22horizontal%2Ffull-width%22%2C%20%22horizontal%2Fmiddle-inset%22%2C%20%22horizontal%2Finset%22%2C%20%22vertical%2Ffull-width%22%2C%20%22vertical%2Fmiddle-inset%22%2C%20%22vertical%2Finset%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22horizontal%2Ffull-width%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22vertical_height%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22integer%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Height%20(only%20for%20vertical)%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Determines%20the%20height%20of%20the%20vertical%20divider%20(in%20px)%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%202%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22events%22%20%3A%20%7B%0A%20%20%20%20%22onRender%22%20%3A%20%7B%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Callback%20action%20to%20test%20event%20in%20the%20properties%20panel%22%2C%0A%20%20%20%20%20%20%22eventData%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Render%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D"
|
7
|
+
};
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/*
|
2
|
+
* Use App.getDependency for Dependency Injection
|
3
|
+
* eg: var DialogService = App.getDependency('DialogService');
|
4
|
+
*/
|
5
|
+
/* perform any action on widgets/variables within this block */
|
6
|
+
Widget.onReady = function () {
|
7
|
+
/*
|
8
|
+
* variables can be accessed through 'Widget.Variables' property here
|
9
|
+
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
|
10
|
+
* Widget.Variables.loggedInUser.getData()
|
11
|
+
*
|
12
|
+
* widgets can be accessed through 'Widget.Widgets' property here
|
13
|
+
* e.g. to get value of text widget named 'username' use following script
|
14
|
+
* 'Widget.Widgets.username.datavalue'
|
15
|
+
*/
|
16
|
+
Widget.Widgets.iconButton.class += " " + Widget.props.style;
|
17
|
+
Widget.Widgets.iconButton.class += " " + Widget.props.tonal;
|
18
|
+
if (Widget.props.button_size == "small") {
|
19
|
+
Widget.Widgets.iconButton.class += " " + "icon-btn-sm";
|
20
|
+
}
|
21
|
+
else if (Widget.props.button_size == "large") {
|
22
|
+
Widget.Widgets.iconButton.class += " " + "icon-btn-lg";
|
23
|
+
}
|
24
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var icon_button = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-button+class%3D%22icon-btn%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22iconButton%22+iconclass%3D%22bind%3Aprops.icon_class%22+disabled%3D%22bind%3Aprops.state+%3D%3D+%26quot%3BDisabled%26quot%3B%22%3E%3C%2Fwm-button%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
script: "%2F*%0A+*+Use+App.getDependency+for+Dependency+Injection%0A+*+eg%3A+var+DialogService+%3D+App.getDependency%28%27DialogService%27%29%3B%0A+*%2F%0A%0A%2F*+perform+any+action+on+widgets%2Fvariables+within+this+block+*%2F%0AWidget.onReady+%3D+function%28%29+%7B%0A++++%2F*%0A+++++*+variables+can+be+accessed+through+%27Widget.Variables%27+property+here%0A+++++*+e.g.+to+get+dataSet+in+a+staticVariable+named+%27loggedInUser%27+use+following+script%0A+++++*+Widget.Variables.loggedInUser.getData%28%29%0A+++++*%0A+++++*+widgets+can+be+accessed+through+%27Widget.Widgets%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27Widget.Widgets.username.datavalue%27%0A+++++*%2F%0A%0A++++Widget.Widgets.iconButton.class+%2B%3D+%22+%22+%2B+Widget.props.style.toLowerCase%28%29%3B%0A%0A++++if+%28Widget.props.tonal+%21%3D%3D+%22None%22%29+%7B%0A++++++++Widget.Widgets.iconButton.class+%2B%3D+%22+%22+%2B+Widget.props.tonal.toLowerCase%28%29%3B%0A++++%7D+else+%7B%0A++++++++if+%28Widget.Widgets.iconButton.class.includes%28%22success%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22success%22%29%3B%0A++++++++%7D+else+if+%28Widget.Widgets.iconButton.class.includes%28%22error%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22error%22%29%3B%0A++++++++%7D+else+if+%28Widget.Widgets.iconButton.class.includes%28%22warning%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22warning%22%29%3B%0A++++++++%7D+else+if+%28Widget.Widgets.iconButton.class.includes%28%22info%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22info%22%29%3B%0A++++++++%7D%0A++++%7D%0A++++if+%28Widget.props.button_size+%3D%3D+%22Small%22%29+%7B%0A++++++++Widget.Widgets.iconButton.class+%2B%3D+%22+%22+%2B+%22icon-btn-sm%22%3B%0A++++%7D+else+if+%28Widget.props.button_size+%3D%3D+%22Large%22%29+%7B%0A++++++++Widget.Widgets.iconButton.class+%2B%3D+%22+%22+%2B+%22icon-btn-lg%22%3B%0A++++%7D+else+if+%28Widget.props.button_size+%3D%3D+%22Regular%22%29+%7B%0A++++++++if+%28Widget.Widgets.iconButton.class.includes%28%22icon-btn-sm%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22icon-btn-sm%22%29%3B%0A++++++++%7D+else+if+%28Widget.Widgets.iconButton.class.includes%28%22icon-btn-lg%22%29%29+%7B%0A++++++++++++Widget.Widgets.iconButton.class.remove%28%22icon-btn-lg%22%29%3B%0A++++++++%7D%0A++++%7D%0A%7D%3B",
|
4
|
+
styles: ".app-button.icon-btn+.app-icon+%7B%0A++++padding%3A+0%3B%0A++++font-size%3A+24px%3B%0A%7D%0A%0A.app-button.icon-btn+%7B%0A++++display%3A+inline-flex%3B%0A++++justify-content%3A+center%3B%0A++++align-items%3A+center%3B%0A++++padding%3A+8px%3B%0A++++min-height%3A+40px%3B%0A++++min-width%3A+40px%3B%0A++++border-radius%3A+100%25%3B%0A++++box-shadow%3A+none%3B%0A++++border-color%3A+transparent%3B%0A++++background-color%3A+transparent%3B%0A%7D%0A%0A.app-button.icon-btn%3A%3Abefore+%7B%0A++++content%3A+%27%27%3B%0A++++position%3A+absolute%3B%0A++++opacity%3A+0%3B%0A++++height%3A+100%25%3B%0A++++width%3A+100%25%3B%0A++++border-radius%3A+100%25%3B%0A%7D%0A%0A.app-button.icon-btn%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-surface-variant-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-surface-variant-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-surface-variant-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.filled+%7B%0A++++background%3A+var%28--wm-color-primary%29%3B%0A++++color%3A+var%28--wm-color-on-primary%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-primary-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.filled%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-primary-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.filled%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-on-primary-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined+%7B%0A++++color%3A+var%28--wm-color-on-surface-variant%29%3B%0A++++border%3A+1px+solid+var%28--wm-color-outline%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled%3Adisabled%2C%0A.app-button.icon-btn.filled.success%3Adisabled%2C%0A.app-button.icon-btn.filled.danger%3Adisabled%2C%0A.app-button.icon-btn.filled.info%3Adisabled%2C%0A.app-button.icon-btn.filled.warning%3Adisabled+%7B%0A++++background%3A+var%28--wm-state-on-surface-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined%3Adisabled%2C%0A.app-button.icon-btn.outlined.success%3Adisabled%2C%0A.app-button.icon-btn.outlined.danger%3Adisabled%2C%0A.app-button.icon-btn.outlined.info%3Adisabled%2C%0A.app-button.icon-btn.outlined.warning%3Adisabled+%7B%0A++++border-color%3A+var%28--wm-state-on-surface-focus%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.outlined%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.standard%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.filled.success%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.filled.danger%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.filled.info%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.filled.warning%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.outlined.success%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.outlined.danger%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.outlined.warning%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.outlined.info%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.standard.success%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.standard.danger%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.standard.warning%3Adisabled+.app-icon%2C%0A.app-button.icon-btn.standard.info%3Adisabled+.app-icon+%7B%0A++++opacity%3A+0.38%3B%0A++++color%3A+var%28--wm-color-on-surface%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled.icon-btn-sm%2C%0A.app-button.icon-btn.standard.icon-btn-sm%2C%0A.app-button.icon-btn.outlined.icon-btn-sm+%7B%0A++++display%3A+inline-flex%3B%0A++++justify-content%3A+center%3B%0A++++align-items%3A+center%3B%0A++++min-height%3A+32px%3B%0A++++min-width%3A+32px%3B%0A++++padding%3A+4px%3B%0A%7D%0A%0A.app-button.icon-btn.filled.icon-btn-sm+.app-icon%2C%0A.app-button.icon-btn.standard.icon-btn-sm+.app-icon%2C%0A.app-button.icon-btn.outlined.icon-btn-sm+.app-icon+%7B%0A++++font-size%3A+18px%3B%0A%7D%0A%0A.app-button.icon-btn.filled.icon-btn-lg%2C%0A.app-button.icon-btn.standard.icon-btn-lg%2C%0A.app-button.icon-btn.outlined.icon-btn-lg+%7B%0A++++display%3A+inline-flex%3B%0A++++justify-content%3A+center%3B%0A++++align-items%3A+center%3B%0A++++min-height%3A+48px%3B%0A++++min-width%3A+48px%3B%0A++++padding%3A+4px%3B%0A%7D%0A%0A.app-button.icon-btn.filled.icon-btn-lg+.app-icon%2C%0A.app-button.icon-btn.standard.icon-btn-lg+.app-icon%2C%0A.app-button.icon-btn.outlined.icon-btn-lg+.app-icon+%7B%0A++++font-size%3A+32px%3B%0A%7D%0A%0A.app-button.icon-btn.standard.success+.app-icon%2C%0A.app-button.icon-btn.outlined.success+.app-icon+%7B%0A++++color%3A+var%28--wm-color-success%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.success%3Ahover%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.success%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-success-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.success%3Afocus%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.success%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-success-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.success%3Aactive%3A%3Abefore%2C%0A.app-button.icon-btn.outlied.success%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-success-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined.success+%7B%0A++++border%3A+1px+solid+var%28--wm-color-success%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled.success+%7B%0A++++background%3A+var%28--wm-color-success%29%3B%0A++++color%3A+var%28--wm-color-on-success%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.info+.app-icon%2C%0A.app-button.icon-btn.outlined.info+.app-icon+%7B%0A++++color%3A+var%28--wm-color-info%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.info%3Ahover%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.info%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-info-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.info%3Afocus%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.info%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-info-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.info%3Aactive%3A%3Abefore%2C%0A.app-button.icon-btn.outlied.info%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-info-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined.info+%7B%0A++++border%3A+1px+solid+var%28--wm-color-info%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled.info+%7B%0A++++background%3A+var%28--wm-color-info%29%3B%0A++++color%3A+var%28--wm-color-on-info%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.error+.app-icon%2C%0A.app-button.icon-btn.outlined.error+.app-icon+%7B%0A++++color%3A+var%28--wm-color-error%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.error%3Ahover%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.error%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-error-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.error%3Afocus%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.error%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-error-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.error%3Aactive%3A%3Abefore%2C%0A.app-button.icon-btn.outlied.error%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-error-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined.error+%7B%0A++++border%3A+1px+solid+var%28--wm-color-error%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled.error+%7B%0A++++background%3A+var%28--wm-color-error%29%3B%0A++++color%3A+var%28--wm-color-on-error%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.warning+.app-icon%2C%0A.app-button.icon-btn.outlined.warning+.app-icon+%7B%0A++++color%3A+var%28--wm-color-warning%29%3B%0A%7D%0A%0A.app-button.icon-btn.standard.warning%3Ahover%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.warning%3Ahover%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-warning-hover%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.warning%3Afocus%3A%3Abefore%2C%0A.app-button.icon-btn.outlined.warning%3Afocus%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-warning-focus%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.standard.warning%3Aactive%3A%3Abefore%2C%0A.app-button.icon-btn.outlied.warning%3Aactive%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-state-warning-active%29%3B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-button.icon-btn.outlined.warning+%7B%0A++++border%3A+1px+solid+var%28--wm-color-warning%29%3B%0A%7D%0A%0A.app-button.icon-btn.filled.warning+%7B%0A++++background%3A+var%28--wm-color-warning%29%3B%0A++++color%3A+var%28--wm-color-on-warning%29%3B%0A%7D",
|
5
|
+
variables: "%7B+%7D",
|
6
|
+
config: "%7B%0A%09%22widgetType%22%3A%20%22wm-custom-widget%22%2C%0A%09%22properties%22%3A%20%7B%0A%09%09%22style%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22list%22%2C%0A%09%09%09%22displayName%22%3A%20%22Style%22%2C%0A%09%09%09%22description%22%3A%20%22%22%2C%0A%09%09%09%22options%22%3A%20%5B%22Filled%22%2C%20%22Outlined%22%2C%20%22Standard%22%5D%2C%0A%09%09%09%22value%22%3A%20%22Standard%22%0A%09%09%7D%2C%0A%09%09%22state%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22list%22%2C%0A%09%09%09%22displayName%22%3A%20%22State%22%2C%0A%09%09%09%22description%22%3A%20%22%22%2C%0A%09%09%09%22options%22%3A%20%5B%22Enabled%22%2C%20%22Disabled%22%5D%2C%0A%09%09%09%22value%22%3A%20%22Enabled%22%0A%09%09%7D%2C%0A%09%09%22icon_class%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22string%22%2C%0A%09%09%09%22displayName%22%3A%20%22Icon%20class%22%2C%0A%09%09%09%22description%22%3A%20%22%22%2C%0A%09%09%09%22value%22%3A%20%22fa%20fa-gear%22%2C%0A%09%09%09%22widget%22%3A%20%22select-icon%22%0A%09%09%7D%2C%0A%09%09%22button_size%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22list%22%2C%0A%09%09%09%22displayName%22%3A%20%22Button%20size%22%2C%0A%09%09%09%22description%22%3A%20%22This%20is%20an%20optinal%20property.%20the%20value%20for%20this%20property%20must%20be%20either%20small%20or%20large%22%2C%0A%09%09%09%22options%22%3A%20%5B%22Small%22%2C%20%22Regular%22%2C%20%22Large%22%5D%2C%0A%09%09%09%22value%22%3A%20%22Regular%22%0A%09%09%7D%2C%0A%09%09%22tonal%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22list%22%2C%0A%09%09%09%22displayName%22%3A%20%22Tonal%22%2C%0A%09%09%09%22description%22%3A%20%22This%20is%20an%20optinal%20property.%20The%20value%20for%20this%20property%20must%20be%20either%20success%2C%20error%2C%20info%20or%20warning%22%2C%0A%09%09%09%22options%22%3A%20%5B%22None%22%2C%20%22Success%22%2C%20%22Error%22%2C%20%22Info%22%2C%20%22Warning%22%5D%2C%0A%09%09%09%22value%22%3A%20%22None%22%0A%09%09%7D%0A%09%7D%2C%0A%09%22events%22%3A%20%7B%0A%09%09%22onRender%22%3A%20%7B%0A%09%09%09%22description%22%3A%20%22Callback%20action%20to%20test%20event%20in%20the%20properties%20panel%22%2C%0A%09%09%09%22eventData%22%3A%20%22%22%2C%0A%09%09%09%22displayName%22%3A%20%22Render%22%0A%09%09%7D%0A%09%7D%0A%7D%0A",
|
7
|
+
};
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/*
|
2
|
+
* Use App.getDependency for Dependency Injection
|
3
|
+
* eg: var DialogService = App.getDependency('DialogService');
|
4
|
+
*/
|
5
|
+
/* perform any action on widgets/variables within this block */
|
6
|
+
Widget.onReady = function () {
|
7
|
+
if (Widget.props.selected.toString().toLowerCase() === "true") {
|
8
|
+
Widget.Widgets.chip.class += " selected";
|
9
|
+
}
|
10
|
+
if (Widget.props.configuration.toString().toLowerCase().includes("avatar")) {
|
11
|
+
Widget.Widgets.chip.class += " rounded";
|
12
|
+
}
|
13
|
+
/*
|
14
|
+
* variables can be accessed through 'Widget.Variables' property here
|
15
|
+
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
|
16
|
+
* Widget.Variables.loggedInUser.getData()
|
17
|
+
*
|
18
|
+
* widgets can be accessed through 'Widget.Widgets' property here
|
19
|
+
* e.g. to get value of text widget named 'username' use following script
|
20
|
+
* 'Widget.Widgets.username.datavalue'
|
21
|
+
*/
|
22
|
+
};
|
23
|
+
Widget.button1Click = function ($event, widget) {
|
24
|
+
Widget.Widgets.chip.class += " clear";
|
25
|
+
};
|
26
|
+
Widget.chipClick = function ($event, widget) {
|
27
|
+
var isSelected = Widget.Widgets.chip.class.split(" ").includes("selected");
|
28
|
+
if (!isSelected) {
|
29
|
+
Widget.Widgets.chip.class += " selected";
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
Widget.Widgets.chip.class = Widget.Widgets.chip.class.split(" ").filter(function (val) { return val !== "selected"; }).join(" ");
|
33
|
+
}
|
34
|
+
};
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{ }
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var input_chip = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-container+name%3D%22chip%22+class%3D%22input-chip%22+on-click%3D%22chipClick%28%24event%2C+widget%29%22%3E%0A++++++++%3Cwm-container+name%3D%22state-layer%22+class%3D%22state-layer%22%3E%0A++++++++++++%3Cwm-icon+name%3D%22displayIcon%22+iconclass%3D%22bind%3Aprops.configuration.toLowerCase%28%29.includes%28%26quot%3Bicon%26quot%3B%29+%3F+props.leading_icon_class+%3A+%26quot%3Bfa+fa-user%26quot%3B%22+show%3D%22bind%3Aprops.configuration.toLowerCase%28%29.includes%28%26quot%3Bicon%26quot%3B%29%22+class%3D%22leading_icon%22%3E%3C%2Fwm-icon%3E%0A++++++++++++%3Cwm-container+name%3D%22monogramContent%22+show%3D%22bind%3Aprops.configuration.toLowerCase%28%29.includes%28%26quot%3Bavatar%26quot%3B%29%22%3E%0A++++++++++++++++%3Cwm-picture+name%3D%22pictureCase%22+class%3D%22avatarDisplay%22+picturesource%3D%22bind%3Aprops.picture_source%22%3E%3C%2Fwm-picture%3E%0A++++++++++++%3C%2Fwm-container%3E%0A++++++++++++%3Cwm-label+padding%3D%22unset%22+class%3D%22p+main-label%22+type%3D%22p%22+name%3D%22displayLabel%22+caption%3D%22bind%3Aprops.label_text%22%3E%3C%2Fwm-label%3E%0A++++++++++++%3Cwm-button+class%3D%22icon-button%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22closeIcon%22+iconclass%3D%22fa+fa-close%22+show%3D%22bind%3Aprops.show_closing_icon%22+on-click%3D%22button1Click%28%24event%2C+widget%29%22%3E%3C%2Fwm-button%3E%0A++++++++%3C%2Fwm-container%3E%0A++++%3C%2Fwm-container%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
script: "%2F*%0A+*+Use+App.getDependency+for+Dependency+Injection%0A+*+eg%3A+var+DialogService+%3D+App.getDependency%28%27DialogService%27%29%3B%0A+*%2F%0A%0A%2F*+perform+any+action+on+widgets%2Fvariables+within+this+block+*%2F%0AWidget.onReady+%3D+function%28%29+%7B%0A%0A++++if+%28Widget.props.selected.toString%28%29.toLowerCase%28%29+%3D%3D%3D+%22true%22%29+%7B%0A++++++++Widget.Widgets.chip.class+%2B%3D+%22+selected%22%3B%0A++++%7D%0A%0A++++if+%28Widget.props.configuration.toString%28%29.toLowerCase%28%29.includes%28%22avatar%22%29%29+%7B%0A++++++++Widget.Widgets.chip.class+%2B%3D+%22+rounded%22%3B%0A++++%7D%0A++++%2F*%0A+++++*+variables+can+be+accessed+through+%27Widget.Variables%27+property+here%0A+++++*+e.g.+to+get+dataSet+in+a+staticVariable+named+%27loggedInUser%27+use+following+script%0A+++++*+Widget.Variables.loggedInUser.getData%28%29%0A+++++*%0A+++++*+widgets+can+be+accessed+through+%27Widget.Widgets%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27Widget.Widgets.username.datavalue%27%0A+++++*%2F%0A%7D%3B%0AWidget.button1Click+%3D+function%28%24event%2C+widget%29+%7B%0A++++Widget.Widgets.chip.class+%2B%3D+%22+clear%22%3B%0A%7D%3B%0AWidget.chipClick+%3D+function%28%24event%2C+widget%29+%7B%0A++++const+isSelected+%3D+Widget.Widgets.chip.class.split%28%22+%22%29.includes%28%22selected%22%29%3B%0A++++if+%28%21isSelected%29+%7B%0A++++++++Widget.Widgets.chip.class+%2B%3D+%22+selected%22%3B%0A++++%7D+else+%7B%0A++++++++Widget.Widgets.chip.class+%3D+Widget.Widgets.chip.class.split%28%22+%22%29.filter%28%28val%29+%3D%3E+val+%21%3D%3D+%22selected%22%29.join%28%22+%22%29%3B%0A++++%7D%0A%7D%3B",
|
4
|
+
styles: ".input-chip%20%7B%0A%20%20%20%20display%3A%20flex%3B%0A%20%20%20%20justify-content%3A%20center%3B%0A%20%20%20%20align-items%3A%20center%3B%0A%20%20%20%20border-radius%3A%20var(--wm-radius-sm)%3B%0A%20%20%20%20border%3A%201px%20solid%20var(--wm-color-outline)%3B%0A%20%20%20%20color%3A%20var(--wm-on-surface-variant)%3B%0A%20%20%20%20text-align%3A%20center%3B%0A%20%20%20%20max-width%3A%20fit-content%3B%0A%7D%0A%0Ap.main-label%20%7B%0A%20%20%20%20font-family%3A%20var(--wm-label-large-font-family)%3B%0A%20%20%20%20font-size%3A%20var(--wm-label-large-font-size)%3B%0A%20%20%20%20font-style%3A%20normal%3B%0A%20%20%20%20font-weight%3A%20var(--wm-label-large-font-weight)%3B%0A%20%20%20%20line-height%3A%20var(--wm-label-large-line-height)%3B%0A%20%20%20%20letter-spacing%3A%20var(--wm-label-large-letter-spacing)%3B%0A%20%20%20%20margin%3A%20var(--wm-space-0)%3B%0A%7D%0A%0A.input-chip%3Ahover%20%7B%0A%20%20%20%20background%3A%20var(--wm-color-surface)%3B%0A%7D%0A%0A.input-chip.selected%20%7B%0A%20%20%20%20background%3A%20var(--wm-color-secondary-container)%3B%0A%7D%0A%0A.state-layer%20%7B%0A%20%20%20%20display%3A%20flex%3B%0A%20%20%20%20flex-direction%3A%20row%3B%0A%20%20%20%20align-items%3A%20center%3B%0A%20%20%20%20justify-content%3A%20center%3B%0A%20%20%20%20border-radius%3A%20var(--wm-radius-sm)%3B%0A%20%20%20%20padding%3A%20calc(var(--wm-rule-space)%20*%201.5)%20var(--wm-space-2)%3B%0A%20%20%20%20gap%3A%20var(--wm-space-2)%3B%0A%7D%0A%0A.state-layer%3Ahover%20%7B%0A%20%20%20%20background%3A%20var(--wm-state-on-surface-variant-hover)%3B%0A%7D%0A%0A.rounded%20.state-layer%20%7B%0A%20%20%20%20border-radius%3A%2030px%3B%0A%7D%0A%0A.selected%20%7B%0A%20%20%20%20border%3A%201px%20solid%20transparent%3B%0A%20%20%20%20border-radius%3A%20var(--wm-radius-sm)%3B%0A%20%20%20%20background%3A%20var(--wm-color-secondary-container)%3B%0A%7D%0A%0A.rounded%20%7B%0A%20%20%20%20border-radius%3A%2030px%3B%0A%7D%0A%0A.input-chip.clear%20%7B%0A%20%20%20%20display%3A%20none%3B%0A%7D%0A%0A.input-chip%20.state-layer%20.icon-button%20%7B%0A%20%20%20%20background-color%3A%20transparent%3B%0A%20%20%20%20border%3A%20var(--wm-radius-none)%3B%0A%20%20%20%20padding%3A%20var(--wm-space-0)%3B%0A%20%20%20%20min-height%3A%20fit-content%3B%0A%20%20%20%20min-width%3A%20fit-content%3B%0A%20%20%20%20font-family%3A%20var(--wm-label-large-font-family)%3B%0A%20%20%20%20font-size%3A%20var(--wm-label-large-font-size)%3B%0A%20%20%20%20font-style%3A%20normal%3B%0A%20%20%20%20font-weight%3A%20var(--wm-label-large-font-weight)%3B%0A%20%20%20%20line-height%3A%20var(--wm-label-large-line-height)%3B%0A%20%20%20%20letter-spacing%3A%20var(--wm-label-large-letter-spacing)%3B%0A%20%20%20%20margin%3A%20var(--wm-space-0)%3B%0A%7D%0A%0A.input-chip%20.app-icon-wrapper%20%7B%0A%20%20%20%20overflow%3A%20visible%3B%0A%20%20%20%20display%3A%20inline-flex%3B%0A%20%20%20%20align-items%3A%20center%3B%0A%7D%0A%0A.input-chip.selected%20.leading_icon%20%7B%0A%20%20%20%20color%3A%20var(--wm-color-primary)%3B%0A%7D%0A%0A.avatarDisplay%20%7B%0A%20%20%20%20height%3A%20var(--wm-space-6)%3B%0A%20%20%20%20width%3A%20var(--wm-space-6)%3B%0A%20%20%20%20border-radius%3A%20var(--wm-radius-full)%3B%0A%20%20%20%20vertical-align%3A%20bottom%3B%0A%7D%0A",
|
5
|
+
variables: "%7B+%7D",
|
6
|
+
config: "%7B%0A%20%20%22widgetType%22%20%3A%20%22wm-custom-widget%22%2C%0A%20%20%22properties%22%20%3A%20%7B%0A%20%20%20%20%22state%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22State%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22enabled%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22enabled%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22configuration%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22list%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22Label%20only%22%2C%20%22Label%20and%20Leading%20icon%22%2C%20%22Label%20%26%20avatar%22%20%5D%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Configuration%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Label%20only%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22show_closing_icon%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22boolean%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Show%20Closing%20icon%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22false%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22selected%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22boolean%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Selected%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22false%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22label_text%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Label%20text%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Label%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22leading_icon_class%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Leading%20Icon%20Class%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22fa%20fa-user%22%2C%0A%20%20%20%20%20%20%22widget%22%20%3A%20%22select-icon%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22picture_source%22%3A%20%7B%0A%20%20%20%20%20%20%22type%22%3A%20%22string%22%2C%0A%20%20%20%20%20%20%22displayName%22%3A%20%22source%22%2C%0A%20%20%20%20%20%20%22description%22%3A%20%22%22%2C%0A%20%20%20%20%20%20%22value%22%3A%20%22resources%2Fimages%2Fimagelists%2Fdefault-image.png%22%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22events%22%20%3A%20%7B%0A%20%20%20%20%22onRender%22%20%3A%20%7B%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Callback%20action%20to%20test%20event%20in%20the%20properties%20panel%22%2C%0A%20%20%20%20%20%20%22eventData%22%20%3A%20%22%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Render%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A"
|
7
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var payee_list = {
|
2
|
+
"markup": "%3Cwm-custom-widget-container+as%3D%22wm-checkboxset%22%3E%0A++++%3Cwm-label+class%3D%22p+media-heading%22+name%3D%22datavalue%22+caption%3D%22bind%3AwmCheckboxset.datavalue%22%3E%3C%2Fwm-label%3E%0A++++%3Cwm-list+listclass%3D%22list-group%22+itemclass%3D%22list-group-item%22+template%3D%22true%22+template-name%3D%22Contact+List%22+itemsperrow%3D%22xs-1+sm-1+md-1+lg-1%22+class%3D%22media-list%22+datafield%3D%22bind%3AwmCheckboxset.datafield%22+statehandler%3D%22URL%22+name%3D%22sizesList1%22+dataset%3D%22bind%3AwmCheckboxset.datasetItems%22%0A++++++++direction%3D%22vertical%22+on-click%3D%22selectItem%28%24event%2C+widget%29%22+navigation%3D%22None%22%3E%0A++++++++%3Cwm-listtemplate+layout%3D%22inline%22+name%3D%22listtemplate1%22%3E%0A++++++++++++%3Cwm-container+class%3D%22media-left%22+name%3D%22container2%22%3E%0A++++++++++++++++%3Cwm-icon+name%3D%22icon1%22+iconclass%3D%22wm-sl-l+sl-check%22+show%3D%22bind%3AwmCheckboxset.datasetItems%5B%24i%5D.selected%22%3E%3C%2Fwm-icon%3E%0A++++++++++++%3C%2Fwm-container%3E%0A++++++++++++%3Cwm-container+class%3D%22media-body%22+name%3D%22container3%22%3E%0A++++++++++++++++%3Cwm-picture+resizemode%3D%22contain%22+name%3D%22picture1%22+pictureplaceholder%3D%22bind%3AwmCheckboxset.datasetItems%5B%24i%5D.value.icon%22+shape%3D%22circle%22+width%3D%2250px%22+height%3D%2250px%22%3E%3C%2Fwm-picture%3E%0A++++++++++++++++%3Cwm-label+class%3D%22p+media-heading%22+name%3D%22firstName%22+caption%3D%22bind%3AwmCheckboxset.datasetItems%5B%24i%5D.value.firstName%22%3E%3C%2Fwm-label%3E%0A++++++++++++++++%3Cwm-label+class%3D%22p+media-heading%22+name%3D%22lastName%22+caption%3D%22bind%3AwmCheckboxset.datasetItems%5B%24i%5D.value.lastName%22%3E%3C%2Fwm-label%3E%0A++++++++++++++++%3Cwm-label+class%3D%22p+media-heading%22+name%3D%22details%22+caption%3D%22bind%3AwmCheckboxset.datasetItems%5B%24i%5D.value.details%22%3E%3C%2Fwm-label%3E%0A++++++++++++%3C%2Fwm-container%3E%0A++++++++%3C%2Fwm-listtemplate%3E%0A++++%3C%2Fwm-list%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
"script": "%2F*+%0A+*+Use+App.getDependency+for+Dependency+Injection%0A+*+eg%3A+var+DialogService+%3D+App.getDependency%28%27DialogService%27%29%3B%0A+*%2F%0A%0A%2F*+perform+any+action+on+widgets%2Fvariables+within+this+block+*%2F%0AWidget.onReady+%3D+function%28%29+%7B%0A++++%2F*+%0A+++++*+variables+can+be+accessed+through+%27Page.Variables%27+property+here%0A+++++*+e.g.+to+get+dataSet+in+a+staticVariable+named+%27loggedInUser%27+use+following+script%0A+++++*+Page.Variables.loggedInUser.getData%28%29%0A+++++*+%0A+++++*+widgets+can+be+accessed+through+%27Page.Widgets%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27Page.Widgets.username.datavalue%27%0A+++++*%2F%0A++++console.log%28%27wmcheckboxset%27%2C+Widget.wmCheckboxset%29%3B%0A%7D%3B%0A%0AWidget.selectItem+%3D+function%28%24event%2C+widget%29+%7B%0A++++Widget.wmCheckboxset._select%28widget.item%2C+%24event%29%3B%0A%7D%3B",
|
4
|
+
"styles": ".app-container+%7B%0A++++min-width%3A+30px%3B%0A%7D%0A%0A.media-heading+%7B%0A++++display%3A+inline-block+%21important%3B%0A++++width%3A+auto+%21important%3B%0A++++padding%3A+0+0+0+15px%3B%0A%7D",
|
5
|
+
"variables": "%7B+%7D",
|
6
|
+
"config": "%7B%0A%20%20%22widgetType%22%20%3A%20%22wm-checkboxset%22%2C%0A%22properties%22%20%3A%20%7B%7D%0A%7D%0A"
|
7
|
+
};
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/*
|
2
|
+
* Use App.getDependency for Dependency Injection
|
3
|
+
* eg: var DialogService = App.getDependency('DialogService');
|
4
|
+
*/
|
5
|
+
/* perform any action on widgets/variables within this block */
|
6
|
+
Widget.onReady = function () {
|
7
|
+
/*
|
8
|
+
* variables can be accessed through 'Widget.Variables' property here
|
9
|
+
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
|
10
|
+
* Widget.Variables.loggedInUser.getData()
|
11
|
+
*
|
12
|
+
* widgets can be accessed through 'Widget.Widgets' property here
|
13
|
+
* e.g. to get value of text widget named 'username' use following script
|
14
|
+
* 'Widget.Widgets.username.datavalue'
|
15
|
+
*/
|
16
|
+
};
|
17
|
+
Widget.selectItem = function ($event, widget) {
|
18
|
+
Widget.wmCheckboxset._select(widget.item, $event);
|
19
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var progressbar = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-container+name%3D%22container1%22+class%3D%22progress-wrapper%22%3E%0A++++++++%3Cwm-container+name%3D%22container2%22+class%3D%22progress-track%22%3E%0A++++++++++++%3Cwm-container+name%3D%22container3%22+class%3D%22dot%22%3E%3C%2Fwm-container%3E%0A++++++++++++%3Cwm-container+name%3D%22container4%22+class%3D%22progress%22%3E%3C%2Fwm-container%3E%0A++++++++++++%3Cwm-container+name%3D%22container5%22+class%3D%22progress-inactive-track%22%3E%3C%2Fwm-container%3E%0A++++++++%3C%2Fwm-container%3E%0A++++%3C%2Fwm-container%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
script: "%2F*+*+Use+App.getDependency+for+Dependency+Injection+*+eg%3A+var+DialogService+%3D+App.getDependency%28%27DialogService%27%29%3B+*%2F%0A%2F*+perform+any+action+on+widgets%2Fvariables+within+this+block+*%2F%0AWidget.onReady+%3D+function%28%29+%7B%0A++++%2F*%0A+++++*+variables+can+be+accessed+through+%27Widget.Variables%27+property+here%0A+++++*+e.g.+to+get+dataSet+in+a+staticVariable+named+%27loggedInUser%27+use+following+script%0A+++++*+Widget.Variables.loggedInUser.getData%28%29%0A+++++*%0A+++++*+widgets+can+be+accessed+through+%27Widget.Widgets%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27Widget.Widgets.username.datavalue%27%0A+++++*%2F%0A++++setTimeout%28function%28%29+%7B%0A++++++++%2F%2F+Extract+the+numeric+value+and+unit+from+progress_value++++%0A++++++++let+progressValue+%3D+Widget.props.progress%3B%0A++++++++let+numericValue+%3D+parseFloat%28progressValue%29%3B%0A++++++++let+unit+%3D+progressValue.slice%28-1%29%3B%0A%0A++++++++%2F%2F+This+will+be+%22%25%22+or+%22p%22+++++++%0A%0A++++++++%2F%2F+Check+if+the+value+is+in+percentage+or+pixels++++++++%0A%0A++++++++if+%28unit+%3D%3D%3D+%22%25%22%29+%7B%0A++++++++++++%2F%2F+Compare+if+the+percentage+value+is+equal+to+or+greater+than+100++%0A++++++++++++if+%28numericValue+%3E%3D+100%29+%7B%0A++++++++++++++++Widget.Widgets.container4.class+%2B%3D+%22+full-width%22%3B%0A++++++++++++%7D%0A++++++++%7D+else+if+%28unit+%3D%3D%3D+%22p%22%29+%7B%0A++++++++++++%2F%2F+Assume+%22px%22+value%2C+convert+to+numeric+and+compare+if+it%27s+%3E%3D+100+pixels+++%0A++++++++++++if+%28numericValue+%3E%3D+100%29+%7B%0A++++++++++++++++Widget.Widgets.container4.class+%2B%3D+%22%22%3B%0A++++++++++++%7D%0A++++++++%7D%0A++++++++%2F%2F+Apply+indeterminate+or+determinate+class+based+on+progress_type++++%0A++++++++if+%28Widget.props.progress_type+%3D%3D%3D+%22Indeterminate%22%29+%7B%0A++++++++++++Widget.Widgets.container1.class+%2B%3D+%22+indeterminate%22%3B%0A++++++++%7D+else+%7B%0A++++++++++++Widget.Widgets.container1.class+%2B%3D+%22+determinate%22%3B%0A++++++++%7D%0A++++++++%2F%2F+Set+the+progress+width+based+on+progress_value%0A++++++++Widget.Variables.staticVariable1.dataSet.dataValue+%3D+progressValue+%2B+%22%25%22%3B%0A++++++++Widget.Widgets.container2.%24element%5B0%5D.style.setProperty%28%22--progress-width%22%2C+progressValue+%2B+%22%25%22%29%3B%0A%0A++++++++let+transitionDuration+%3D+Widget.props.transition_duration+%3F+Widget.props.transition_duration+%3A+1%3B%0A++++++++console.log%28transitionDuration%29%3B%0A++++++++%2F%2F+debugger%3B%0A++++++++let+progressTrack+%3D+Widget.Widgets.container4.%24element%5B0%5D%3B%0A++++++++let+progress+%3D+Widget.Widgets.container2.%24element%5B0%5D%3B%0A++++++++let+transitionValue+%3D+%60%24%7BparseFloat%28transitionDuration%29%7Ds%60%3B%0A++++++++progress.style.setProperty%28%22--transition-duration%22%2C+transitionValue%29%3B%0A++++++++progressTrack.style.setProperty%28%22--transition-duration%22%2C+transitionValue%29%3B+%2F%2F+Apply+to+the+track+as+well%0A++++++++console.log%28%27transition+%3A%27%2C+transitionValue%29%3B%0A++++%7D%2C+500%29%3B%0A%0A%7D",
|
4
|
+
styles: ".app-container.progress-wrapper+%7B%0A++++display%3A+block%3B%0A%7D%0A%0A.app-container.progress-wrapper+.app-container.progress-track+%7B%0A++++display%3A+flex%3B%0A++++align-items%3A+center%3B%0A++++gap%3A+6px%3B%0A++++height%3A+10px%3B%0A++++width%3A+100%25%3B%0A++++border-radius%3A+8px%3B%0A++++position%3A+relative%3B%0A++++overflow%3A+hidden%3B%0A++++--progress-width%3A+0%25%3B%0A++++--transition-duration%3A+0.6%25%3B%0A++++%2F*+Default+width+of+progress+*%2F%0A%7D%0A%0A.app-container.progress-wrapper.indeterminate+.progress+%7B%0A++++animation%3A+progressAnimation+3s+linear+infinite%3B%0A%7D%0A%0A.app-container.progress-wrapper+.app-container.progress-track.app-container%3E.app-container.progress.full-width+%7B%0A++++border-top-right-radius%3A+0px%3B%0A++++border-bottom-right-radius%3A+0px%3B%0A%7D%0A%0A.app-container.progress-wrapper+.app-container.progress-track+.app-container.dot+%7B%0A++++height%3A+100%25%3B%0A++++width%3A+10px%3B%0A++++border-radius%3A+50%25%3B%0A++++display%3A+block%3B%0A++++background-color%3A+%236750A4%3B%0A++++position%3A+absolute%3B%0A++++right%3A+0%3B%0A++++z-index%3A+1%3B%0A%7D%0A%0A.app-container.progress-wrapper+.app-container.progress-track+.app-container.progress-inactive-track+%7B%0A++++background-color%3A+%23FEF7FF%3B%0A++++height%3A+100%25%3B%0A++++width%3A+calc%28100%25+-+var%28--progress-width%29%29%3B%0A++++%2F*+Full+width+initially+*%2F%0A++++border-radius%3A+8px%3B%0A++++position%3A+relative%3B%0A++++transition%3A+width+var%28--transition-duration%29+ease%3B%0A++++%2F*+transition%3A+width+0.6+ease%3B+*%2F%0A%7D%0A%0A.app-container.progress-wrapper+.app-container.progress-track+.app-container.progress+%7B%0A++++background-color%3A+%236750A4%3B%0A++++height%3A+100%25%3B%0A++++width%3A+var%28--progress-width%29%3B%0A++++%2F*+Width+controlled+by+custom+property+*%2F%0A++++border-radius%3A+8px%3B%0A++++transition%3A+width+var%28--transition-duration%29+ease%3B%0A++++%2F*+transition%3A+width+0.6+ease%3B+*%2F%0A%7D%0A%0A.app-container.progress-wrapper.indeterminate+.app-container.progress-track+.app-container.progress+%7B%0A++++width%3A+var%28--progress-width%29+%21important%3B%0A%7D%0A%0A.app-container.progress-wrapper.indeterminate+.app-container.progress-track+.app-container.progress-inactive-track+%7B%0A++++width%3A+calc%28100%25+-+var%28--progress-width%29%29+%21important%3B%0A%7D%0A%0A%40keyframes+progressAnimation+%7B%0A++++0%25+%7B%0A++++++++width%3A+0%25%3B%0A++++%7D%0A++++20%25+%7B%0A++++++++width%3A+30%25%3B%0A++++%7D%0A++++50%25+%7B%0A++++++++width%3A+100%25%3B%0A++++%7D%0A++++60%25+%7B%0A++++++++width%3A+700%25%3B%0A++++%7D%0A++++70%25+%7B%0A++++++++width%3A+1000%25%3B%0A++++%7D%0A++++100%25+%7B%0A++++++++width%3A+50000%25%3B%0A++++%7D%0A%7D",
|
5
|
+
variables: "%7B%0A++%22staticVariable1%22+%3A+%7B%0A++++%22_id%22+%3A+%22wm-staticVariable1-wm.Variable-1722513387770%22%2C%0A++++%22name%22+%3A+%22staticVariable1%22%2C%0A++++%22owner%22+%3A+%22Page%22%2C%0A++++%22category%22+%3A+%22wm.Variable%22%2C%0A++++%22dataBinding%22+%3A+%5B+%7B%0A++++++%22target%22+%3A+%22dataValue%22%2C%0A++++++%22value%22+%3A+%220%25%22%0A++++%7D+%5D%2C%0A++++%22dataSet%22+%3A+%7B%0A++++++%22dataValue%22+%3A+%22%22%0A++++%7D%2C%0A++++%22type%22+%3A+%22string%22%2C%0A++++%22isList%22+%3A+false%2C%0A++++%22twoWayBinding%22+%3A+false%2C%0A++++%22saveInPhonegap%22+%3A+false%0A++%7D%2C%0A++%22staticVariable2%22+%3A+%7B%0A++++%22_id%22+%3A+%22wm-staticVariable2-wm.Variable-1722940540972%22%2C%0A++++%22name%22+%3A+%22staticVariable2%22%2C%0A++++%22owner%22+%3A+%22Page%22%2C%0A++++%22category%22+%3A+%22wm.Variable%22%2C%0A++++%22dataBinding%22+%3A+%5B+%7B%0A++++++%22target%22+%3A+%22dataValue%22%2C%0A++++++%22value%22+%3A+%220%22%0A++++%7D+%5D%2C%0A++++%22dataSet%22+%3A+%5B+%7B%0A++++++%22dataValue%22+%3A+%22%22%0A++++%7D+%5D%2C%0A++++%22type%22+%3A+%22string%22%2C%0A++++%22isList%22+%3A+true%2C%0A++++%22twoWayBinding%22+%3A+false%2C%0A++++%22saveInPhonegap%22+%3A+false%0A++%7D%0A%7D",
|
6
|
+
config: "%7B%0A%09%22widgetType%22%3A%20%22wm-custom-widget%22%2C%0A%09%22properties%22%3A%20%7B%0A%09%09%22progress%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22string%22%2C%0A%09%09%09%22displayName%22%3A%20%22Progress%22%2C%0A%09%09%09%22description%22%3A%20%22Sets%20the%20current%20progress%20of%20the%20bar.%20This%20value%20represents%20the%20percentage%20of%20completion.%22%2C%0A%09%09%09%22value%22%3A%20%220%22%0A%09%09%7D%2C%0A%09%09%22progress_type%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22list%22%2C%0A%09%09%09%22displayName%22%3A%20%22Progress%20Type%22%2C%0A%09%09%09%22description%22%3A%20%22Specifies%20the%20type%20of%20progress%20bar.%20Options%20include%20%27determinate%27%20for%20a%20fixed%20progress%20bar%20or%20%27indeterminate%27%20for%20an%20animated%20progress%20bar%20without%20a%20fixed%20end.%22%2C%0A%09%09%09%22options%22%3A%20%5B%22Determinate%22%2C%20%22Indeterminate%22%5D%2C%0A%09%09%09%22value%22%3A%20%22Determinate%22%0A%09%09%7D%2C%0A%09%09%22transition_duration%22%3A%20%7B%0A%09%09%09%22type%22%3A%20%22string%22%2C%0A%09%09%09%22displayName%22%3A%20%22Transition%20Duration%22%2C%0A%09%09%09%22description%22%3A%20%22Defines%20the%20duration%20of%20the%20progress%20transition%20animation.%20This%20value%20should%20be%20specified%20in%20a%20time%20format%20such%20as%20%27500ms%27%20or%20%272s%27.%22%2C%0A%09%09%09%22value%22%3A%20%223s%22%0A%09%09%7D%0A%09%7D%2C%0A%09%22events%22%3A%20%7B%7D%0A%7D%0A",
|
7
|
+
};
|
File without changes
|