@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,52 @@
|
|
1
|
+
/* * Use App.getDependency for Dependency Injection * eg: var DialogService = App.getDependency('DialogService'); */
|
2
|
+
/* perform any action on widgets/variables within this block */
|
3
|
+
Widget.onReady = function () {
|
4
|
+
/*
|
5
|
+
* variables can be accessed through 'Widget.Variables' property here
|
6
|
+
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
|
7
|
+
* Widget.Variables.loggedInUser.getData()
|
8
|
+
*
|
9
|
+
* widgets can be accessed through 'Widget.Widgets' property here
|
10
|
+
* e.g. to get value of text widget named 'username' use following script
|
11
|
+
* 'Widget.Widgets.username.datavalue'
|
12
|
+
*/
|
13
|
+
setTimeout(function () {
|
14
|
+
// Extract the numeric value and unit from progress_value
|
15
|
+
var progressValue = Widget.props.progress_value;
|
16
|
+
var numericValue = parseFloat(progressValue);
|
17
|
+
var unit = progressValue.slice(-1);
|
18
|
+
// This will be "%" or "p"
|
19
|
+
// Check if the value is in percentage or pixels
|
20
|
+
if (unit === "%") {
|
21
|
+
// Compare if the percentage value is equal to or greater than 100
|
22
|
+
if (numericValue >= 100) {
|
23
|
+
Widget.Widgets.container4.class += " full-width";
|
24
|
+
}
|
25
|
+
}
|
26
|
+
else if (unit === "p") {
|
27
|
+
// Assume "px" value, convert to numeric and compare if it's >= 100 pixels
|
28
|
+
if (numericValue >= 100) {
|
29
|
+
Widget.Widgets.container4.class += "";
|
30
|
+
}
|
31
|
+
}
|
32
|
+
// Apply indeterminate or determinate class based on progress_type
|
33
|
+
if (Widget.props.progress_type === "Indeterminate") {
|
34
|
+
Widget.Widgets.container1.class += " indeterminate";
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
Widget.Widgets.container1.class += " determinate";
|
38
|
+
}
|
39
|
+
// Set the progress width based on progress_value
|
40
|
+
Widget.Variables.staticVariable1.dataSet.dataValue = progressValue + "%";
|
41
|
+
Widget.Widgets.container2.$element[0].style.setProperty("--progress-width", progressValue + "%");
|
42
|
+
var transitionDuration = Widget.props.transition_duration ? Widget.props.transition_duration : 1;
|
43
|
+
console.log(transitionDuration);
|
44
|
+
// debugger;
|
45
|
+
var progressTrack = Widget.Widgets.container4.$element[0];
|
46
|
+
var progress = Widget.Widgets.container2.$element[0];
|
47
|
+
var transitionValue = "".concat(parseFloat(transitionDuration), "s");
|
48
|
+
progress.style.setProperty("--transition-duration", transitionValue);
|
49
|
+
progressTrack.style.setProperty("--transition-duration", transitionValue); // Apply to the track as well
|
50
|
+
console.log('transition :', transitionValue);
|
51
|
+
}, 500);
|
52
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var radio_set = {
|
2
|
+
"markup": "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-container+name%3D%22container1%22%3E%0A++++++++%3Cwm-composite+name%3D%22composite%22+required%3D%22false%22%3E%0A++++++++++++%3Cwm-label+class%3D%22control-label%22+notag%3D%22true%22+name%3D%22label1%22+required%3D%22false%22+caption%3D%22bind%3Aprops.label_text%22%3E%3C%2Fwm-label%3E%0A++++++++++++%3Cwm-container+name%3D%22container2%22%3E%0A++++++++++++++++%3Cwm-radioset+height%3D%22auto%22+name%3D%22radioset%22+disabled%3D%22bind%3Aprops.state+%3D%3D+%26quot%3BDisabled%26quot%3B%22+readonly%3D%22false%22+dataset%3D%22bind%3Aprops.data_set%22+datafield%3D%22All+Fields%22+required%3D%22bind%3Aprops.required%22+usekeys%3D%22false%22+datavalue%3D%22bind%3Aprops.default_value%22%3E%3C%2Fwm-radioset%3E%0A++++++++++++%3C%2Fwm-container%3E%0A++++++++%3C%2Fwm-composite%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+Partials%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+++++*+Partials+can+be+accessed+through+%27Widget.Partials%27+property+here%0A+++++*+e.g.+to+get+value+of+text+Partial+named+%27username%27+use+following+script%0A+++++*+%27Widget.Partials.username.datavalue%27%0A+++++*%2F%0A++++if+%28Widget.props.layout+%3D%3D%3D+%22horizontal%22%29+%7B%0A++++++++Widget.Widgets.radioset.class+%2B%3D+%27+horizontal%27%3B%0A++++%7D+else+%7B%0A++++++++Widget.Widgets.radioset.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.radioset.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.radioset.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.radioset.class+%2B%3D+%27+start-placement%27%3B%0A++++%7D+else+%7B%0A++++++++Widget.Widgets.radioset.class+%2B%3D+%27%27%3B%0A++++%7D%0A%0A++++Widget.Widgets.composite.required+%3D+Widget.props.required%3B%0A%0A%7D%3B",
|
4
|
+
"styles": ".app-label.control-label+%7B%0A++++margin-bottom%3A+8px%3B%0A%7D%0A%0A.app-radioset.inline.list-group.horizontal+%7B%0A++++display%3A+flex%3B%0A++++align-items%3A+center%3B%0A++++gap%3A+20px+32px%3B%0A++++overflow%3A+visible%3B%0A++++flex-wrap%3A+wrap%3B%0A++++padding-left%3A+10px%3B%0A%7D%0A%0A.app-radioset.inline.list-group.vertical+%7B%0A++++display%3A+flex%3B%0A++++flex-direction%3A+column%3B%0A++++gap%3A+20px%3B%0A++++padding-left%3A+10px%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.wm-app+.form-group+.app-radioset.horizontal+.radio%2B.radio%2C%0A.wm-app+.form-group+.app-radioset.vertical+.radio%2B.radio+%7B%0A++++margin-top%3A+0px%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radio.radio%2C%0A.app-radioset.vertical+.app-radio.radio+%7B%0A++++width%3A+auto%3B%0A++++vertical-align%3A+unset%3B%0A++++display%3A+unset%3B%0A++++margin-top%3A+unset%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radio.radio+input%5Btype%3D%22radio%22%5D%2C%0A.app-radioset.vertical+.app-radio.radio+input%5Btype%3D%22radio%22%5D+%7B%0A++++margin-right%3A+-12px%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radio.radio+input%5Btype%3D%22radio%22%5D%3Afocus%2C%0A.app-radioset.vertical+.app-radio.radio+input%5Btype%3D%22radio%22%5D%3Afocus+%7B%0A++++outline%3A+none+%21important%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%2C%0A.app-radioset.vertical+.app-radioset-label+%7B%0A++++z-index%3A+0%3B%0A++++position%3A+relative%3B%0A++++display%3A+inline-block%3B%0A++++color%3A+var%28--wm-color-on-background%29%3B%0A++++font-size%3A+16px%3B%0A++++line-height%3A+1.5%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%2C%0A.app-radioset.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++-webkit-appearance%3A+none%3B%0A++++z-index%3A+-1%3B%0A++++position%3A+absolute%3B%0A++++left%3A+-8px%3B%0A++++top%3A+-7px%3B%0A++++margin%3A+0%3B%0A++++border-radius%3A+50%25%3B%0A++++width%3A+40px%3B%0A++++height%3A+40px%3B%0A%7D%0A%0A.app-radioset.horizontal+.radio.app-radio+.caption%2C%0A.app-radioset.vertical+.radio.app-radio+.caption+%7B%0A++++position%3A+relative%3B%0A++++width%3A+100%25%3B%0A++++cursor%3A+pointer%3B%0A++++padding-left%3A+32px%3B%0A++++display%3A+inline-flex%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.app-radioset.horizontal+.radio.app-radio+.caption%3A%3Abefore%2C%0A.app-radioset.vertical+.radio.app-radio+.caption%3A%3Abefore+%7B%0A++++content%3A+%22%22%3B%0A++++display%3A+inline-block%3B%0A++++box-sizing%3A+border-box%3B%0A++++margin%3A+3px+14px+3px+1px%3B%0A++++border%3A+solid+2px%3B%0A++++border-color%3A+var%28--wm-color-on-surface%29%3B%0A++++border-radius%3A+50%25%3B%0A++++width%3A+22px%3B%0A++++height%3A+22px%3B%0A++++vertical-align%3A+top%3B%0A++++transition%3A+border-color+0.2s%3B%0A++++position%3A+absolute%3B%0A++++left%3A+0%3B%0A%7D%0A%0A.app-radioset.horizontal+.radio.app-radio+.caption%3A%3Aafter%2C%0A.app-radioset.vertical+.radio.app-radio+.caption%3A%3Aafter+%7B%0A++++height%3A+12px%3B%0A++++width%3A+12px%3B%0A++++box-sizing%3A+border-box%3B%0A++++position%3A+absolute%3B%0A++++content%3A+%22%22%3B%0A++++border-radius%3A+50%25%3B%0A++++background%3A+transparent%3B%0A++++top%3A+6px%3B%0A++++left%3A+6px%3B%0A++++-webkit-transition%3A+all+0.2s+ease%3B%0A++++transition%3A+all+0.2s+ease%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Ahover%3Einput%2C%0A.app-radioset.vertical+.app-radioset-label%3Ahover%3Einput+%7B%0A++++background%3A+var%28--wm-color-on-surface-hover%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Abefore%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Abefore+%7B%0A++++border-color%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label.disabled%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter%2C%0A.app-radioset.vertical+.app-radioset-label.disabled%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++background%3A+var%28--wm-color-on-surface%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label.disabled%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Abefore%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Abefore+%7B%0A++++border-color%3A+var%28--wm-color-on-surface%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Afocus%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Afocus+%7B%0A++++background%3A+var%28--wm-color-primary-focus%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Ahover%3Einput%5Btype%3D%22radio%22%5D%3Achecked%3Ahover%2C%0A.app-radioset.vertical+.app-radioset-label%3Ahover%3Einput%5Btype%3D%22radio%22%5D%3Achecked%3Ahover+%7B%0A++++background%3A+var%28--wm-color-primary-hover%29%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Ahover+input%3Adisabled%2C%0A.app-radioset.vertical+.app-radioset-label%3Ahover+input%3Adisabled+%7B%0A++++opacity%3A+0%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label.disabled+.caption%2C%0A.app-radioset.vertical+.app-radioset-label.disabled+.caption+%7B%0A++++cursor%3A+not-allowed%3B%0A%7D%0A%0A.app-radioset.horizontal+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%3Achecked%2B.caption%3A%3Abefore%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%3Achecked%2B.caption%3A%3Abefore+%7B%0A++++border-color%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.app-radioset.horizontal.app-radioset-label%3Einput%3Adisabled%2C%0A.app-radioset.vertical+.app-radioset-label%3Einput%3Adisabled+%7B%0A++++opacity%3A+0%3B%0A%7D%0A%0A%0A%2F*+%23%23%23%23%23%23%23%23%23+top+placement+styles+%23%23%23%23%23%23%23%23%23+*%2F%0A%0A.app-radioset.inline.list-group.vertical.top-placement+%7B%0A++++max-width%3A+max-content%3B%0A++++min-width%3A+40px%3B%0A++++padding%3A+0%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.app-radioset.inline.list-group.horizontal.top-placement+%7B%0A++++padding-left%3A+0%3B%0A%7D%0A%0A.app-radioset.vertical.top-placement+.app-radio.radio+%7B%0A++++padding-bottom%3A+32px%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radio.radio+%7B%0A++++padding-bottom%3A+40px%3B%0A++++padding-inline%3A+10px%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radioset-label%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+%7B%0A++++display%3A+inline%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radioset-label+.caption%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+.caption+%7B%0A++++padding-left%3A+0%3B%0A++++display%3A+inline%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+21px%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.app-radioset.horizontal.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++top%3A+26px%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++margin%3A+3px+1px+3px+0px%3B%0A%7D%0A%0A.app-radioset.horizontal.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.app-radioset.horizontal.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.app-radioset.vertical.top-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++margin-top%3A+28px%3B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A%7D%0A%0A%0A%2F*+%23%23%23%23%23%23%23%23%23+bottom+placement+styles+%23%23%23%23%23%23%23%23%23+*%2F%0A%0A.app-radioset.vertical.bottom-placement+.app-radio+.app-radioset-label+%7B%0A++++width%3A+auto%3B%0A%7D%0A%0A.app-radioset.horizontal.bottom-placement+.app-radio.radio+%7B%0A++++padding-inline%3A+10px%3B%0A%7D%0A%0A.app-radioset.inline.list-group.horizontal.bottom-placement+%7B%0A++++padding-left%3A+0%3B%0A%7D%0A%0A.app-radioset.inline.list-group.vertical.bottom-placement+%7B%0A++++max-width%3A+max-content%3B%0A++++min-width%3A+40px%3B%0A++++padding%3A+0%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.app-radioset.horizontal.bottom-placement+.app-radioset-label+.caption%2C%0A.app-radioset.vertical.bottom-placement+.app-radioset-label+.caption+%7B%0A++++padding-top%3A+30px%3B%0A++++padding-bottom%3A+0px%3B%0A++++overflow%3A+visible%3B%0A++++display%3A+inline-block%3B%0A++++padding-left%3A+unset%3B%0A%7D%0A%0A.app-radioset.horizontal.bottom-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++padding-top%3A+40px%3B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+-6px%3B%0A%7D%0A%0A.app-radioset.vertical.bottom-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++padding-top%3A+40px%3B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+-8px%3B%0A%7D%0A%0A.bottom-placement.app-radioset.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.bottom-placement.app-radioset.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+0%3B%0A++++margin%3A+3px+1px+1px+1px%3B%0A++++margin-inline%3A+0%3B%0A%7D%0A%0A.bottom-placement.app-radioset.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.bottom-placement.app-radioset.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+8px%3B%0A%7D%0A%0A.bottom-placement.app-radioset.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.bottom-placement.app-radioset.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+unset%3B%0A++++bottom%3A+28px%3B%0A++++margin-inline%3A+0%3B%0A%7D%0A%0A.bottom-placement.app-radioset.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.bottom-placement.app-radioset.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++left%3A+50%25%3B%0A++++transform%3A+translateX%28-50%25%29%3B%0A++++top%3A+6px%3B%0A%7D%0A%0A%0A%2F*+%23%23%23%23%23%23%23%23%23+start+placement+styles+%23%23%23%23%23%23%23%23%23+*%2F%0A%0A.app-radioset.inline.list-group.horizontal.start-placement%2C%0A.app-radioset.inline.list-group.vertical.start-placement+%7B%0A++++padding-left%3A+0%3B%0A%7D%0A%0A.app-radioset.horizontal.start-placement+.app-radioset-label+.caption%2C%0A.app-radioset.vertical.start-placement+.app-radioset-label+.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.app-radioset.horizontal.start-placement+.app-radioset-label+.caption+%7B%0A++++padding-left%3A+unset%3B%0A++++padding-right%3A+28px%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.app-radioset.inline.list-group.horizontal.start-placement+%7B%0A++++padding-left%3A+unset%3B%0A%7D%0A%0A.app-radioset.start-placement.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.app-radioset.start-placement.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++left%3A+unset%3B%0A++++right%3A+0px%3B%0A++++margin%3A+2px+11px+2px+2px%3B%0A%7D%0A%0A.app-radioset.start-placement.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.app-radioset.start-placement.vertical+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++left%3A+unset%3B%0A++++right%3A+16px%3B%0A%7D%0A%0A.app-radioset.start-placement.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Adisabled%29%2B.caption%3A%3Abefore%2C%0A.app-radioset.start-placement.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++left%3A+unset%3B%0A++++right%3A+-4px%3B%0A++++margin%3A+1px%3B%0A%7D%0A%0A.app-radioset.start-placement.horizontal+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Anot%28%3Achecked%29%2B.caption%3A%3Aafter%2C%0A.start-placement.horizontal.app-radioset+.app-radioset-label+input%5Btype%3D%22radio%22%5D%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++left%3A+unset%3B%0A++++right%3A+2px%3B%0A%7D%0A%0A.app-radioset.app-radioset.horizontal.start-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++right%3A+0%3B%0A++++left%3A+unset%3B%0A%7D%0A%0A.app-radioset.vertical.start-placement+.app-radioset-label+input%5Btype%3D%22radio%22%5D+%7B%0A++++right%3A+14px%3B%0A++++left%3A+unset%3B%0A%7D%0A%0A.wm-app+.app-container%3Ahas%28.start-placement%29+%7B%0A++++width%3A+100%25%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%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.%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%20RadioSet%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%22options%22%20%3A%20%5B%20%22yes%22%2C%20%22no%22%2C%20%22maybe%22%20%5D%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%20RadioSet%20label%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
|
+
};
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
* Use App.getDependency for Dependency Injection
|
3
|
+
* eg: var DialogService = App.getDependency('DialogService');
|
4
|
+
*/
|
5
|
+
/* perform any action on Partials/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
|
+
* Partials can be accessed through 'Widget.Partials' property here
|
13
|
+
* e.g. to get value of text Partial named 'username' use following script
|
14
|
+
* 'Widget.Partials.username.datavalue'
|
15
|
+
*/
|
16
|
+
if (Widget.props.layout === "horizontal") {
|
17
|
+
Widget.Widgets.radioset.class += ' horizontal';
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
Widget.Widgets.radioset.class += ' vertical';
|
21
|
+
}
|
22
|
+
if (Widget.props.label_placement === "top") {
|
23
|
+
Widget.Widgets.radioset.class += ' top-placement';
|
24
|
+
}
|
25
|
+
else if (Widget.props.label_placement === "bottom") {
|
26
|
+
Widget.Widgets.radioset.class += ' bottom-placement';
|
27
|
+
}
|
28
|
+
else if (Widget.props.label_placement === "start") {
|
29
|
+
Widget.Widgets.radioset.class += ' start-placement';
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
Widget.Widgets.radioset.class += '';
|
33
|
+
}
|
34
|
+
Widget.Widgets.composite.required = Widget.props.required;
|
35
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var slider = {
|
2
|
+
"markup": "%3Cwm-custom-widget-container+name%3D%22partial1%22%3E%0A++++%3Cwm-composite+name%3D%22composite1%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-button+class%3D%22btn-icon%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22decrementButton%22+iconclass%3D%22bind%3Aprops.start_icon%22+on-click%3D%22decrementButtonClick%28%24event%2C+widget%29%22%3E%3C%2Fwm-button%3E%0A++++++++++++%3Cwm-slider+name%3D%22slider1%22+class%3D%22cst-slider%22+minvalue%3D%22bind%3Aprops.min_value%22+maxvalue%3D%22bind%3Aprops.max_value%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%3E%3C%2Fwm-slider%3E%0A++++++++++++%3Cwm-button+class%3D%22btn-icon%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22incrementButton%22+iconclass%3D%22bind%3Aprops.end_icon%22+on-click%3D%22incrementButtonClick%28%24event%2C+widget%29%22%3E%3C%2Fwm-button%3E%0A++++++++%3C%2Fwm-container%3E%0A++++%3C%2Fwm-composite%3E%0A%3C%2Fwm-custom-widget-container%3E",
|
3
|
+
"script": "Widget.onPropertyChange+%3D+function%28propname%2C+newvalue%2C+oldvalue%29+%7B%0A++++const+%7B%0A++++++++start_icon%2C%0A++++++++end_icon%2C%0A++++++++show_icons%2C%0A++++++++icon_actions%2C%0A++++++++value%3A+datavalue%2C%0A++++++++show_labels%2C%0A++++%7D+%3D+Widget.props%3B%0A++++const+widgetMap+%3D+Widget.Widgets%3B%0A++++const+showIconsBool+%3D+convertToBoolean%28show_icons%29%3B%0A++++const+showLabelsBool+%3D+convertToBoolean%28show_labels%29%3B%0A++++const+iconActionsBool+%3D+convertToBoolean%28icon_actions%29%3B%0A%0A++++switch+%28propname%29+%7B%0A++++++++case+%22prop-show_icons%22%3A%0A++++++++++++toggleIconsVisibility%28%0A++++++++++++++++showIconsBool%2C%0A++++++++++++++++start_icon%2C%0A++++++++++++++++end_icon%2C%0A++++++++++++++++iconActionsBool%2C%0A++++++++++++++++widgetMap%0A++++++++++++%29%3B%0A++++++++++++break%3B%0A++++++++case+%22prop-start_icon%22%3A%0A++++++++++++updateStartIconVisibility%28iconActionsBool%2C+widgetMap%29%3B%0A++++++++++++break%3B%0A++++++++case+%22prop-end_icon%22%3A%0A++++++++++++updateEndIconVisibility%28iconActionsBool%2C+widgetMap%29%3B%0A++++++++++++break%3B%0A++++++++case+%22prop-value%22%3A%0A++++++++++++updateSliderValue%28datavalue%2C+widgetMap%29%3B%0A++++++++++++break%3B%0A++++++++case+%22prop-show_labels%22%3A%0A++++++++++++toggleLabelVisibilty%28showLabelsBool%2C+widgetMap%29%3B%0A++++++++++++break%3B%0A++++++++case+%22prop-max_value%22%3A%0A++++++++case+%22prop-min_value%22%3A%0A++++++++++++updateSliderValue%28datavalue%2C+widgetMap%29%3B%0A++++++++++++break%3B%0A++++%7D%0A%7D%3B%0A%0AWidget.onReady+%3D+function%28%29+%7B%0A++++const+%7B%0A++++++++start_icon%2C%0A++++++++end_icon%2C%0A++++++++show_icons%2C%0A++++++++icon_actions%2C%0A++++++++value%3A+datavalue%2C%0A++++++++show_labels%2C%0A++++%7D+%3D+Widget.props%3B%0A++++const+widgetMap+%3D+Widget.Widgets%3B%0A%0A++++const+showIconsBool+%3D+convertToBoolean%28show_icons%29%3B%0A++++const+showLabelsBool+%3D+convertToBoolean%28show_labels%29%3B%0A++++const+iconActionsBool+%3D+convertToBoolean%28icon_actions%29%3B%0A++++toggleIconsVisibility%28%0A++++++++showIconsBool%2C%0A++++++++start_icon%2C%0A++++++++end_icon%2C%0A++++++++iconActionsBool%2C%0A++++++++widgetMap%0A++++%29%3B%0A++++toggleLabelVisibilty%28showLabelsBool%2C+widgetMap%29%3B%0A++++updateSliderValue%28datavalue%2C+widgetMap%29%3B%0A++++activeSliderElement%28widgetMap%29%3B%0A%7D%3B%0A%0Afunction+convertToBoolean%28value%29+%7B%0A++++return+value+%3D%3D%3D+true+%7C%7C+value+%3D%3D%3D+%22true%22%3B%0A%7D%0A%0Afunction+updateStartIconVisibility%28iconActionsBool%2C+widgetMap%29+%7B%0A++++const+%7B%0A++++++++decrementButton%0A++++%7D+%3D+widgetMap%3B%0A++++decrementButton.show+%3D+true%3B%0A++++decrementButton.nativeElement.style.pointerEvents+%3D+iconActionsBool+%3F%0A++++++++%22auto%22+%3A%0A++++++++%22none%22%3B%0A%7D%0A%0Afunction+updateEndIconVisibility%28iconActionsBool%2C+widgetMap%29+%7B%0A++++const+%7B%0A++++++++incrementButton%0A++++%7D+%3D+widgetMap%3B%0A++++incrementButton.show+%3D+true%3B%0A++++incrementButton.nativeElement.style.pointerEvents+%3D+iconActionsBool+%3F%0A++++++++%22auto%22+%3A%0A++++++++%22none%22%3B%0A%7D%0A%0Afunction+updateSliderValue%28datavalue%2C+widgetMap%29+%7B%0A++++const+%7B%0A++++++++slider1%0A++++%7D+%3D+widgetMap%3B%0A%0A++++if+%28datavalue+%21%3D%3D+undefined%29+%7B%0A++++++++slider1.datavalue+%3D+Number%28datavalue%29%3B%0A++++%7D%0A++++slider1.nativeElement.style.setProperty%28%22--end%22%2C+%28100+-+getSliderPercentage%28slider1.datavalue%29%29+%2B+%27%25%27%29%3B%0A%7D%0A%0Afunction+toggleIconsVisibility%28%0A++++showIconsBool%2C%0A++++startIcon%2C%0A++++endIcon%2C%0A++++iconActionsBool%2C%0A++++widgetMap%0A%29+%7B%0A++++const+%7B%0A++++++++decrementButton%2C%0A++++++++incrementButton%0A++++%7D+%3D+widgetMap%3B%0A%0A++++if+%28showIconsBool%29+%7B%0A++++++++if+%28startIcon%29+updateStartIconVisibility%28iconActionsBool%2C+widgetMap%29%3B%0A++++++++if+%28endIcon%29+updateEndIconVisibility%28iconActionsBool%2C+widgetMap%29%3B%0A++++%7D+else+%7B%0A++++++++if+%28startIcon%29+decrementButton.show+%3D+false%3B%0A++++++++if+%28endIcon%29+incrementButton.show+%3D+false%3B%0A++++%7D%0A%7D%0A%0Afunction+toggleLabelVisibilty%28showLabelsBool%2C+widgetMap%29+%7B%0A++++if+%28showLabelsBool%29+%7B%0A++++++++widgetMap.slider1.nativeElement.classList.remove%28%22hide-labels%22%29%3B%0A++++%7D+else+%7B%0A++++++++widgetMap.slider1.nativeElement.classList.add%28%22hide-labels%22%29%3B%0A++++%7D%0A%7D%0A%0Afunction+activeSliderElement%28widgetMap%29+%7B%0A++++const+activeSlider+%3D+widgetMap.slider1.nativeElement%3B+%2F%2F+Get+the+slider+element%0A++++if+%28activeSlider%29+%7B%0A++++++++%2F%2F+Create+a+new+div+element%0A++++++++const+newDiv+%3D+document.createElement%28%22p%22%29%3B%0A++++++++newDiv.className+%3D+%22active-slider%22%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+*+Convert+slider+value+to+percentage+based+on+min+and+max%0A+*%2F%0Afunction+getSliderPercentage%28value%29+%7B%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++++return+%28%28value+-+minValue%29+%2F+%28maxValue+-+minValue%29%29+*+100%3B%0A%7D%0A%0AWidget.slider1Change+%3D+function%28%24event%2C+widget%2C+newVal%2C+oldVal%29+%7B%0A++++const+sliderValue+%3D%0A++++++++100+-+getSliderPercentage%28newVal%29+%2B+%22%25%22%3B%0A++++widget.nativeElement.style.setProperty%28%22--end%22%2C+sliderValue%29%3B%0A%7D%3B%0A%0Afunction+moveSlider%28direction%2C+widgetMap%29+%7B%0A++++const+%7B%0A++++++++slider1%0A++++%7D+%3D+widgetMap%3B%0A%0A++++let+newValue+%3D+Number%28slider1.datavalue%29+%2B+direction%3B%0A++++newValue+%3D+Math.max%28Math.min%28newValue%2C+slider1.maxvalue%29%2C+slider1.minvalue%29%3B%0A++++slider1.datavalue+%3D+newValue%3B%0A++++Widget.slider1Change%28null%2C+slider1%2C+newValue%2C+slider1.datavalue%29%3B%0A%7D%0A%0AWidget.decrementButtonClick+%3D+function%28%24event%2C+widget%29+%7B%0A++++moveSlider%28-1%2C+Widget.Widgets%29%3B%0A%7D%3B%0A%0AWidget.incrementButtonClick+%3D+function%28%24event%2C+widget%29+%7B%0A++++moveSlider%281%2C+Widget.Widgets%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%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.continous-slider+%7B%0A++++display%3A+flex%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%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+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.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%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+24px%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.hide-labels%3E.app-slider-value.pull-left+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A.app-container.filled-slider+.app-slider.slider.cst-slider.hide-labels%3E.app-slider-value.pull-right+%7B%0A++++display%3A+none%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%22Defines%20whether%20the%20widget%20is%20interactive%20or%20not.%20%27Enabled%27%20means%20the%20widget%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_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%22The%20text%20displayed%20on%20the%20label%20of%20the%20widget.%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%20%22show_labels%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%20Labels%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Determines%20whether%20icons%20should%20be%20displayed%20on%20the%20widget.%20When%20set%20to%20true%2C%20icons%20will%20be%20shown.%20When%20false%2C%20icons%20will%20be%20hidden.%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%22show_icons%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%20Icons%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Determines%20whether%20icons%20should%20be%20displayed%20on%20the%20widget.%20When%20set%20to%20true%2C%20icons%20will%20be%20shown.%20When%20false%2C%20icons%20will%20be%20hidden.%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%22start_icon%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%22Start%20Icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22The%20icon%20to%20be%20displayed%20at%20the%20start%20of%20the%20widget.%20Select%20an%20appropriate%20icon%20from%20the%20available%20options.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22%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%22end_icon%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%22End%20Icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22The%20icon%20to%20be%20displayed%20at%20the%20end%20of%20the%20widget.%20Select%20an%20appropriate%20icon%20from%20the%20available%20options.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22%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%22icon_actions%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%22Icon%20Actions%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Determines%20whether%20the%20icons%20on%20the%20widget%20are%20interactive.%20When%20set%20to%20true%2C%20icons%20will%20respond%20to%20user%20actions%20(e.g.%2C%20clicks).%20When%20false%2C%20icons%20will%20be%20displayed%20but%20not%20interactive.%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%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%20default%20value%20for%20the%20slider.%20This%20value%20is%20used%20when%20the%20widget%20is%20initially%20rendered.%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%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%22Function%20to%20be%20called%20when%20the%20value%20of%20the%20slider%20changes.%20This%20function%20receives%20parameters%20such%20as%20the%20event%2C%20widget%2C%20new%20value%2C%20and%20old%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%2C%0A%20%20%20%20%22onDecrement%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%20Decrement%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Function%20to%20be%20called%20when%20the%20value%20of%20the%20slider%20changes.%20This%20function%20receives%20parameters%20such%20as%20the%20event%2C%20widget%2C%20new%20value%2C%20and%20old%20value.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22decrementButtonClick(%24event%2C%20widget)%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22onIncrement%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%20Increment%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Function%20to%20be%20called%20when%20the%20value%20of%20the%20slider%20changes.%20This%20function%20receives%20parameters%20such%20as%20the%20event%2C%20widget%2C%20new%20value%2C%20and%20old%20value.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22incrementButtonClick(%24event%2C%20widget)%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A"
|
7
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
declare function convertToBoolean(value: any): boolean;
|
2
|
+
declare function updateStartIconVisibility(iconActionsBool: any, widgetMap: any): void;
|
3
|
+
declare function updateEndIconVisibility(iconActionsBool: any, widgetMap: any): void;
|
4
|
+
declare function updateSliderValue(datavalue: any, widgetMap: any): void;
|
5
|
+
declare function toggleIconsVisibility(showIconsBool: any, startIcon: any, endIcon: any, iconActionsBool: any, widgetMap: any): void;
|
6
|
+
declare function toggleLabelVisibilty(showLabelsBool: any, widgetMap: any): void;
|
7
|
+
declare function activeSliderElement(): void;
|
8
|
+
declare function activeSliderElement(widgetMap: any): void;
|
9
|
+
declare function getSliderPercentage(value: any): number;
|
10
|
+
declare function getSliderPercentage(value: any): number;
|
11
|
+
declare function moveSlider(direction: any, widgetMap: any): void;
|
@@ -0,0 +1,121 @@
|
|
1
|
+
Widget.onPropertyChange = function (propname, newvalue, oldvalue) {
|
2
|
+
var _a = Widget.props, start_icon = _a.start_icon, end_icon = _a.end_icon, show_icons = _a.show_icons, icon_actions = _a.icon_actions, datavalue = _a.value, show_labels = _a.show_labels;
|
3
|
+
var widgetMap = Widget.Widgets;
|
4
|
+
var showIconsBool = convertToBoolean(show_icons);
|
5
|
+
var showLabelsBool = convertToBoolean(show_labels);
|
6
|
+
var iconActionsBool = convertToBoolean(icon_actions);
|
7
|
+
switch (propname) {
|
8
|
+
case "prop-show_icons":
|
9
|
+
toggleIconsVisibility(showIconsBool, start_icon, end_icon, iconActionsBool, widgetMap);
|
10
|
+
break;
|
11
|
+
case "prop-start_icon":
|
12
|
+
updateStartIconVisibility(iconActionsBool, widgetMap);
|
13
|
+
break;
|
14
|
+
case "prop-end_icon":
|
15
|
+
updateEndIconVisibility(iconActionsBool, widgetMap);
|
16
|
+
break;
|
17
|
+
case "prop-value":
|
18
|
+
updateSliderValue(datavalue, widgetMap);
|
19
|
+
break;
|
20
|
+
case "prop-show_labels":
|
21
|
+
toggleLabelVisibilty(showLabelsBool, widgetMap);
|
22
|
+
break;
|
23
|
+
case "prop-max_value":
|
24
|
+
case "prop-min_value":
|
25
|
+
updateSliderValue(datavalue, widgetMap);
|
26
|
+
break;
|
27
|
+
}
|
28
|
+
};
|
29
|
+
Widget.onReady = function () {
|
30
|
+
var _a = Widget.props, start_icon = _a.start_icon, end_icon = _a.end_icon, show_icons = _a.show_icons, icon_actions = _a.icon_actions, datavalue = _a.value, show_labels = _a.show_labels;
|
31
|
+
var widgetMap = Widget.Widgets;
|
32
|
+
var showIconsBool = convertToBoolean(show_icons);
|
33
|
+
var showLabelsBool = convertToBoolean(show_labels);
|
34
|
+
var iconActionsBool = convertToBoolean(icon_actions);
|
35
|
+
toggleIconsVisibility(showIconsBool, start_icon, end_icon, iconActionsBool, widgetMap);
|
36
|
+
toggleLabelVisibilty(showLabelsBool, widgetMap);
|
37
|
+
updateSliderValue(datavalue, widgetMap);
|
38
|
+
activeSliderElement(widgetMap);
|
39
|
+
};
|
40
|
+
function convertToBoolean(value) {
|
41
|
+
return value === true || value === "true";
|
42
|
+
}
|
43
|
+
function updateStartIconVisibility(iconActionsBool, widgetMap) {
|
44
|
+
var decrementButton = widgetMap.decrementButton;
|
45
|
+
decrementButton.show = true;
|
46
|
+
decrementButton.nativeElement.style.pointerEvents = iconActionsBool ?
|
47
|
+
"auto" :
|
48
|
+
"none";
|
49
|
+
}
|
50
|
+
function updateEndIconVisibility(iconActionsBool, widgetMap) {
|
51
|
+
var incrementButton = widgetMap.incrementButton;
|
52
|
+
incrementButton.show = true;
|
53
|
+
incrementButton.nativeElement.style.pointerEvents = iconActionsBool ?
|
54
|
+
"auto" :
|
55
|
+
"none";
|
56
|
+
}
|
57
|
+
function updateSliderValue(datavalue, widgetMap) {
|
58
|
+
var slider1 = widgetMap.slider1;
|
59
|
+
if (datavalue !== undefined) {
|
60
|
+
slider1.datavalue = Number(datavalue);
|
61
|
+
}
|
62
|
+
slider1.nativeElement.style.setProperty("--end", (100 - getSliderPercentage(slider1.datavalue)) + '%');
|
63
|
+
}
|
64
|
+
function toggleIconsVisibility(showIconsBool, startIcon, endIcon, iconActionsBool, widgetMap) {
|
65
|
+
var decrementButton = widgetMap.decrementButton, incrementButton = widgetMap.incrementButton;
|
66
|
+
if (showIconsBool) {
|
67
|
+
if (startIcon)
|
68
|
+
updateStartIconVisibility(iconActionsBool, widgetMap);
|
69
|
+
if (endIcon)
|
70
|
+
updateEndIconVisibility(iconActionsBool, widgetMap);
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
if (startIcon)
|
74
|
+
decrementButton.show = false;
|
75
|
+
if (endIcon)
|
76
|
+
incrementButton.show = false;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
function toggleLabelVisibilty(showLabelsBool, widgetMap) {
|
80
|
+
if (showLabelsBool) {
|
81
|
+
widgetMap.slider1.nativeElement.classList.remove("hide-labels");
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
widgetMap.slider1.nativeElement.classList.add("hide-labels");
|
85
|
+
}
|
86
|
+
}
|
87
|
+
function activeSliderElement(widgetMap) {
|
88
|
+
var activeSlider = widgetMap.slider1.nativeElement; // Get the slider element
|
89
|
+
if (activeSlider) {
|
90
|
+
// Create a new div element
|
91
|
+
var newDiv = document.createElement("p");
|
92
|
+
newDiv.className = "active-slider"; // Set a class for styling
|
93
|
+
// Append the new element to slider container
|
94
|
+
activeSlider.appendChild(newDiv);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
/*
|
98
|
+
* Convert slider value to percentage based on min and max
|
99
|
+
*/
|
100
|
+
function getSliderPercentage(value) {
|
101
|
+
var minValue = parseInt(Widget.props.min_value, 10);
|
102
|
+
var maxValue = parseInt(Widget.props.max_value, 10);
|
103
|
+
return ((value - minValue) / (maxValue - minValue)) * 100;
|
104
|
+
}
|
105
|
+
Widget.slider1Change = function ($event, widget, newVal, oldVal) {
|
106
|
+
var sliderValue = 100 - getSliderPercentage(newVal) + "%";
|
107
|
+
widget.nativeElement.style.setProperty("--end", sliderValue);
|
108
|
+
};
|
109
|
+
function moveSlider(direction, widgetMap) {
|
110
|
+
var slider1 = widgetMap.slider1;
|
111
|
+
var newValue = Number(slider1.datavalue) + direction;
|
112
|
+
newValue = Math.max(Math.min(newValue, slider1.maxvalue), slider1.minvalue);
|
113
|
+
slider1.datavalue = newValue;
|
114
|
+
Widget.slider1Change(null, slider1, newValue, slider1.datavalue);
|
115
|
+
}
|
116
|
+
Widget.decrementButtonClick = function ($event, widget) {
|
117
|
+
moveSlider(-1, Widget.Widgets);
|
118
|
+
};
|
119
|
+
Widget.incrementButtonClick = function ($event, widget) {
|
120
|
+
moveSlider(1, Widget.Widgets);
|
121
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var switch_button = {
|
2
|
+
markup: "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-composite+name%3D%22composite%22+required%3D%22false%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+conditionalclass%3D%22bind%3A%7B%27filled-switch-wrapper%27%3A+props.switch_type+%3D%3D%3D+%26quot%3BFilled%26quot%3B%2C%0A%27condensed-switch-wrapper%27%3A+props.switch_type+%3D%3D%3D+%26quot%3BCondensed%26quot%3B%2C++++%0A%27iOS-switch-wrapper%27%3Aprops.switch_type++%3D%3D%3D+%26quot%3BIOS%26quot%3B%7D%22%3E%0A++++++++++++%3Cwm-checkbox+caption%3D%22Toggle%22+type%3D%22toggle%22+name%3D%22toggle%22+disabled%3D%22bind%3Aprops.state%3D%3D%26quot%3BDisabled%26quot%3B%3Ftrue%3Afalse%22+datavalue%3D%22bind%3Aprops.selected%22+checkedvalue%3D%22true%22+uncheckedvalue%3D%22false%22+required%3D%22bind%3Aprops.required%22+show%3D%22true%22%3E%3C%2Fwm-checkbox%3E%0A++++++++++++%3Cwm-container+name%3D%22container2%22+class%3D%22icon-container%22+show%3D%22true%22%3E%0A++++++++++++++++%3Cwm-icon+name%3D%22icon1%22+iconclass%3D%22bind%3Aprops.unselected_icon%22+show%3D%22bind%3Aprops.unselected_icon%22+class%3D%22start-icon%22%3E%3C%2Fwm-icon%3E%0A++++++++++++++++%3Cwm-icon+name%3D%22icon2%22+iconclass%3D%22bind%3Aprops.selected_icon%22+show%3D%22bind%3Aprops.selected_icon%22+class%3D%22end-icon%22%3E%3C%2Fwm-icon%3E%0A++++++++++++%3C%2Fwm-container%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+*+Example%3A%0A+*+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+++++*+Access+variables+through+%27Widget.Variables%27%0A+++++*+Example%3A+To+get+data+from+a+static+variable+named+%27loggedInUser%27%2C+use%3A%0A+++++*+Widget.Variables.loggedInUser.getData%28%29%0A+++++*%0A+++++*+Access+widgets+through+%27Widget.Widgets%27%0A+++++*+Example%3A+To+get+the+value+of+a+text+widget+named+%27username%27%2C+use%3A%0A+++++*+Widget.Widgets.username.datavalue%0A+++++*%2F%0A%0A++++%2F%2F+Set+CSS+classes+for+the+toggle+widget+based+on+the+switch+type%0A++++if+%28Widget.props.switch_type+%3D%3D%3D+%22Filled%22%29+%7B%0A++++++++%2F%2F+Add+%27filled-switch%27+and+possibly+%27icon%27+class%0A++++++++if+%28Widget.props.icon.toString%28%29.toLowerCase%28%29+%3D%3D%3D+%27true%27%29+%7B%0A++++++++++++Widget.Widgets.toggle.class+%2B%3D+%27+filled-switch+icon%27%3B%0A++++++++%7D+else+%7B%0A++++++++++++Widget.Widgets.toggle.class+%2B%3D+%27+filled-switch%27%3B%0A++++++++%7D%0A++++++++%2F%2F+Add+%27unselected-icon%27+class+if+no+unselected_icon+is+specified%0A++++++++if+%28Widget.props.unselected_icon+%3D%3D+null+%7C%7C+Widget.props.unselected_icon+%3D%3D%3D+%22%22+%7C%7C+Widget.props.unselected_icon+%3D%3D%3D+%22+%22%29+%7B%0A++++++++++++Widget.Widgets.toggle.class+%2B%3D+%27+filled-switch+icon+unselected-icon%27%3B%0A++++++++%7D%0A%0A++++%7D+else+if+%28Widget.props.switch_type+%3D%3D%3D+%22Condensed%22%29+%7B%0A++++++++%2F%2F+Add+%27condensed-switch%27+class%0A++++++++Widget.Widgets.toggle.class+%2B%3D+%27+condensed-switch%27%3B%0A++++%7D+else+if+%28Widget.props.switch_type+%3D%3D%3D+%22IOS%22%29+%7B%0A++++++++%2F%2F+Add+%27iOS-switch%27+class%0A++++++++Widget.Widgets.toggle.class+%2B%3D+%27+iOS-switch%27%3B%0A++++%7D%0A%0A++++%2F%2F+Set+the+%27required%27+property+for+the+composite+widget%0A++++Widget.Widgets.composite.required+%3D+Widget.props.required%3B%0A%0A++++%2F%2F+Set+the+%27checkedvalue%27+and+%27uncheckedvalue%27+properties+for+the+toggle+widget%0A++++Widget.Widgets.toggle.checkedvalue+%3D+Widget.props.checked_value%3B%0A++++Widget.Widgets.toggle.uncheckedvalue+%3D+Widget.props.unchecked_value%3B%0A%0A++++%2F%2F+Retrieve+the+selected+value+from+page+parameters%0A++++var+selectedValue+%3D+Widget.props.selected%3B%0A%0A++++%2F%2F+Determine+the+correct+%27datavalue%27+based+on+the+selected+value%0A++++if+%28selectedValue+%3D%3D%3D+Widget.Widgets.toggle.checkedvalue%29+%7B%0A++++++++%2F%2F+If+selected+value+matches+the+checked+value%2C+set+datavalue+to+checked+value%0A++++++++Widget.Widgets.toggle.datavalue+%3D+Widget.Widgets.toggle.checkedvalue%3B%0A++++%7D+else+if+%28selectedValue+%3D%3D%3D+Widget.Widgets.toggle.uncheckedvalue%29+%7B%0A++++++++%2F%2F+If+selected+value+matches+the+unchecked+value%2C+set+datavalue+to+unchecked+value%0A++++++++Widget.Widgets.toggle.datavalue+%3D+Widget.Widgets.toggle.uncheckedvalue%3B%0A++++%7D+else+%7B%0A++++++++%2F%2F+Log+a+warning+if+the+selected+value+does+not+match+known+values%0A++++++++console.warn%28%27Selected+value+does+not+match+any+known+value%27%29%3B%0A++++++++%2F%2F+Optionally+set+to+a+default+value+or+handle+the+error%0A++++++++Widget.Widgets.toggle.datavalue+%3D+Widget.Widgets.toggle.uncheckedvalue%3B+%2F%2F+Default+to+unchecked%0A++++%7D%0A%7D",
|
4
|
+
styles: ".condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch+%7B%0A++++padding%3A+6px+0%3B%0A++++left%3A+-6px%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.unchecked%2C%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel+%7B%0A++++z-index%3A+0%3B%0A++++position%3A+relative%3B%0A++++display%3A+inline-block%3B%0A++++color%3A+rgba%280%2C+0%2C+0%2C+0.87%29%3B%0A++++background-color%3A+unset+%21important%3B%0A++++border%3A+unset%3B%0A++++width%3A+auto%3B%0A++++height%3A+unset%3B%0A++++box-shadow%3A+unset%3B%0A++++border-radius%3A+unset%3B%0A++++overflow%3A+visible%3B%0A++++min-height%3A+unset%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.unchecked%3E.switch+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A%0A%2F*+Input+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput+%7B%0A++++appearance%3A+none%3B%0A++++-moz-appearance%3A+none%3B%0A++++-webkit-appearance%3A+none%3B%0A++++z-index%3A+-1%3B%0A++++position%3A+absolute%3B%0A++++top%3A+-8px%3B%0A++++display%3A+block%3B%0A++++margin%3A+0%3B%0A++++border-radius%3A+50%25%3B%0A++++width%3A+40px%3B%0A++++height%3A+40px%3B%0A++++background-color%3A+rgba%280%2C+0%2C+0%2C+0.38%29%3B%0A++++outline%3A+none%3B%0A++++opacity%3A+0%3B%0A++++transform%3A+scale%281%29%3B%0A++++pointer-events%3A+none%3B%0A++++transition%3A+opacity+0.3s+0.1s%2C+transform+0.2s+0.1s%3B%0A++++right%3A+0px%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.unchecked%3Einput+%7B%0A++++left%3A+4px%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-checkbox.checkbox.condensed-switch+label+input%3Afocus+%7B%0A++++outline%3A+unset+%21important%3B%0A%7D%0A%0A%0A%2F*+Caption+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3E.caption+%7B%0A++++display%3A+inline-block%3B%0A++++width%3A+100%25%3B%0A++++cursor%3A+pointer%3B%0A++++min-height%3A+unset%3B%0A++++padding-left%3A+unset%3B%0A++++margin-top%3A+unset%3B%0A%7D%0A%0A%0A%2F*+Track+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3E.caption%3A%3Abefore+%7B%0A++++content%3A+%22%22%3B%0A++++%2F*+float%3A+right%3B+*%2F%0A++++display%3A+inline-block%3B%0A++++margin%3A+5px+0+5px+14px%3B%0A++++border-radius%3A+7px%3B%0A++++width%3A+40px%3B%0A++++height%3A+14px%3B%0A++++background-color%3A+rgba%280%2C+0%2C+0%2C+0.38%29%3B%0A++++vertical-align%3A+top%3B%0A++++transition%3A+background-color+0.2s%2C+opacity+0.2s%3B%0A++++visibility%3A+visible%3B%0A++++float%3A+left%3B%0A++++border%3A+unset%3B%0A++++top%3A+unset%3B%0A++++left%3A+unset%3B%0A%7D%0A%0A%0A%2F*+Thumb+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3E.caption%3A%3Aafter+%7B%0A++++content%3A+%22%22%3B%0A++++position%3A+absolute%3B%0A++++top%3A+3px%3B%0A++++border-radius%3A+50%25%3B%0A++++width%3A+20px%3B%0A++++height%3A+20px%3B%0A++++background-color%3A+var%28--wm-color-on-primary%29%3B%0A++++box-shadow%3A+0+3px+1px+-2px+rgba%280%2C+0%2C+0%2C+0.2%29%2C+0+2px+2px+0+rgba%280%2C+0%2C+0%2C+0.14%29%2C+0+1px+5px+0+rgba%280%2C+0%2C+0%2C+0.12%29%3B%0A++++transition%3A+background-color+0.2s%2C+transform+0.2s%3B%0A++++visibility%3A+visible%3B%0A++++left%3A+16px%3B%0A++++border%3A+unset%3B%0A++++transform%3A+unset%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.unchecked%3E.caption%3A%3Aafter+%7B%0A++++left%3A+14px%3B%0A%7D%0A%0A%0A%2F*+Checked+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Achecked+%7B%0A++++background-color%3A+var%28--wm-color-surface-tint%29%3B%0A++++left%3A+25px%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++background-color%3A+var%28--wm-color-surface-tint%29%3B%0A++++transform%3A+translateX%2818px%29%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch+input%5Btype%3Dcheckbox%5D%3Achecked%7E.switch%2C%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.unchecked%3E.switch+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A%0A%2F*+Hover%2C+Focus+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Ahover%3Einput+%7B%0A++++opacity%3A+0.04%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Afocus+%7B%0A++++opacity%3A+0.12%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Ahover%3Einput%3Afocus+%7B%0A++++opacity%3A+0.16%3B%0A%7D%0A%0A%0A%2F*+Active+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Aactive+%7B%0A++++opacity%3A+1%3B%0A++++transform%3A+scale%280%29%3B%0A++++transition%3A+transform+0s%2C+opacity+0s%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Aactive%2B.caption%3A%3Abefore+%7B%0A++++background-color%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel%3Einput%3Achecked%3Aactive%2B.caption%3A%3Abefore+%7B%0A++++background-color%3A+var%28--wm-state-primary-active%29%3B%0A%7D%0A%0A%0A%2F*+Disabled+*%2F%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.disabled%3Einput%3Adisabled+%7B%0A++++opacity%3A+0%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.disabled%3Einput%3Adisabled%2B.caption+%7B%0A++++color%3A+var%28--wm-color-shadow%29%3B%0A++++cursor%3A+not-allowed%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch%3Elabel.disabled%3Einput%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++background-color%3A+rgba%280%2C+0%2C+0%2C+0.38%29%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-container.icon-container+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A%0A%2F*+iOS+Switch+Styles+*%2F%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label.unchecked%2C%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label+%7B%0A++++position%3A+relative%3B%0A++++display%3A+inline-block%3B%0A++++cursor%3A+pointer%3B%0A++++-webkit-tap-highlight-color%3A+transparent%3B%0A++++box-shadow%3A+unset%3B%0A++++border%3A+unset%3B%0A++++height%3A+unset%3B%0A++++width%3A+unset%3B%0A++++margin-left%3A+var%28--wm-space-1%29%3B%0A++++min-height%3A+unset%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label.unchecked+%7B%0A++++background-color%3A+%23E9E9EA+%21important%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+.caption+%7B%0A++++position%3A+relative%3B%0A++++display%3A+inline-block%3B%0A++++width%3A+46px%3B%0A++++height%3A+26px%3B%0A++++background-color%3A+%23E9E9EA%3B%0A++++border-radius%3A+23px%3B%0A++++vertical-align%3A+middle%3B%0A++++transition%3A+background-color+0.3s+ease%3B%0A++++min-height%3A+unset%3B%0A++++padding-left%3A+unset%3B%0A++++margin-top%3A+unset%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label+.caption%3A%3Abefore+%7B%0A++++all%3A+unset%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+.caption%3A%3Aafter+%7B%0A++++content%3A+%22%22%3B%0A++++position%3A+absolute%3B%0A++++left%3A+0%3B%0A++++top%3A+2px%3B%0A++++width%3A+22px%3B%0A++++height%3A+22px%3B%0A++++background-color%3A+%23fff%3B%0A++++border-radius%3A+11px%3B%0A++++box-shadow%3A+0px+2px+1px+-1px+rgba%280%2C+0%2C+0%2C+0.2%29%2C+0px+1px+1px+0px+rgba%280%2C+0%2C+0%2C+0.14%29%2C+0px+1px+3px+0px+rgba%280%2C+0%2C+0%2C+0.12%29%3B%0A++++transform%3A+translateX%282px%29%3B%0A++++transition%3A+transform+0.3s+ease%3B%0A++++visibility%3A+visible%3B%0A++++border%3A+unset%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+input+%7B%0A++++position%3A+absolute%3B%0A++++opacity%3A+0%3B%0A++++pointer-events%3A+none%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+input%3Achecked%2B.caption+%7B%0A++++background-color%3A+%2365C466%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+input%3Adisabled+%7B%0A++++visibility%3A+hidden%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label.disabled+%7B%0A++++cursor%3A+not-allowed%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+input%3Achecked%2B.caption%3A%3Aafter+%7B%0A++++transform%3A+translateX%2822px%29%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+input%5Btype%3Dcheckbox%5D%3Achecked%7E.switch%2C%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch%3Elabel.unchecked%3E.switch+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A.iOS-switch-wrapper+.app-container.icon-container+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A%0A%2F*+Material3+Design+Styles++*%2F%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.unchecked%2C%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+%7B%0A++++user-select%3A+none%3B%0A++++-webkit-tap-highlight-color%3A+transparent%3B%0A++++display%3A+block%3B%0A++++width%3A+50px%3B%0A++++min-height%3A+32px%3B%0A++++position%3A+relative%3B%0A++++cursor%3A+pointer%3B%0A++++box-shadow%3A+unset%3B%0A++++background-color%3A+unset%3B%0A++++border%3A+unset%3B%0A++++overflow%3A+visible%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.unchecked.disabled+.caption%3A%3Abefore+%7B%0A++++opacity%3A+0.38%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+.caption+%7B%0A++++position%3A+absolute%3B%0A++++inset%3A+0%3B%0A++++cursor%3A+pointer%3B%0A++++border%3A+2px+solid+var%28--wm-color-outline%29%3B%0A++++background-color%3A+var%28--wm-color-surface-container-highest%29%3B%0A++++border-radius%3A+28px%3B%0A++++visibility%3A+visible%3B%0A++++color%3A+transparent%3B%0A++++margin-top%3A+var%28--wm-space-0%29%3B%0A++++padding-left%3A+unset%3B%0A++++min-height%3A+unset%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+.caption%3A%3Abefore+%7B%0A++++content%3A+%22%22%3B%0A++++position%3A+absolute%3B%0A++++width%3A+16px%3B%0A++++height%3A+16px%3B%0A++++left%3A+0px%3B%0A++++top%3A+0px%3B%0A++++background-color%3A+var%28--wm-color-outline%29%3B%0A++++border-radius%3A+28px%3B%0A++++margin%3A+6px%3B%0A++++transition%3A+0.25s+ease-in%3B%0A++++visibility%3A+visible%3B%0A++++z-index%3A+1%3B%0A++++border%3A+unset%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch.icon.unselected-icon+label+.caption%3A%3Abefore+%7B%0A++++width%3A+16px%3B%0A++++height%3A+16px%3B%0A++++margin%3A+6px%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch.unselected-icon+label+input%3Achecked%2B.caption%3A%3Abefore%2C%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+input%3Achecked%2B.caption%3A%3Abefore+%7B%0A++++width%3A+24px%3B%0A++++height%3A+24px%3B%0A++++left%3A+calc%28100%25+-+28px%29%3B%0A++++background-color%3A+var%28--wm-color-on-primary%29%3B%0A++++margin%3A+2px%3B%0A++++border-color%3A+transparent%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch.icon+label+.caption%3A%3Abefore+%7B%0A++++width%3A+24px%3B%0A++++height%3A+24px%3B%0A++++margin%3A+2px%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Achecked%2Bspan.caption+%7B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A++++border%3A+2px+solid+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.app-composite-widget%3Ahas%28%5Bdisabled%3D%22true%22%5D%29%3Ahas%28.checkbox.app-toggle.filled-switch%29+%7B%0A++++opacity%3A+1%3B%0A%7D%0A%0A.app-composite-widget%3Ahas%28%5Bdisabled%3D%22true%22%5D%29%3Ahas%28.checkbox.app-toggle.filled-switch%29+.control-label+%7B%0A++++opacity%3A+0.38%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+.caption%3A%3Aafter+%7B%0A++++all%3A+unset%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+input%5Btype%3Dcheckbox%5D%3Achecked%7E.switch%2C%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch%3Elabel.unchecked%3E.switch+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch%3Elabel%3Einput%5Btype%3D%22checkbox%22%5D%3Adisabled%2Bspan.caption+%7B%0A++++border-color%3A+var%28--wm-state-opacity-focus%29%3B%0A++++background-color%3A+var%28--wm-state-on-surface-focus%29%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label+input%5Btype%3D%22checkbox%22%5D%3Ais%28%3Achecked%29%3Adisabled%2B.caption%3A%3Abefore+%7B%0A++++background-color%3A+var%28--wm-color-surface-bright%29%3B%0A++++color%3A+%23D3D3D3%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.unchecked.disabled+input%3Adisabled+.caption+%7B%0A++++border-color%3A+var%28--wm-state-surface-variant-focus%29%3B%0A%7D%0A%0A.filled-switch-wrapper+%7B%0A++++position%3A+relative%3B%0A++++width%3A+max-content%3B%0A++++margin%3A+8px+4px%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Einput+%7B%0A++++-webkit-appearance%3A+none%3B%0A++++z-index%3A+1%3B%0A++++position%3A+absolute%3B%0A++++left%3A+-4px%3B%0A++++top%3A+-4px%3B%0A++++display%3A+block%3B%0A++++margin%3A+0%3B%0A++++border-radius%3A+50%25%3B%0A++++width%3A+40px%3B%0A++++height%3A+40px%3B%0A++++background-color%3A+var%28--wm-color-on-background%29%3B%0A++++box-shadow%3A+none%3B%0A++++outline%3A+none%3B%0A++++opacity%3A+0%3B%0A++++transform%3A+scale%281%29%3B%0A++++overflow%3A+visible%3B%0A++++pointer-events%3A+none%3B%0A++++transition%3A+opacity+0.3s%2C+transform+0.25s%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Ahover%3Einput%3Ahover+%7B%0A++++opacity%3A+0.08%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Anot%28.disabled%29%3Ahover%3Einput%3Ahover%2Bspan.caption%3A%3Abefore+%7B%0A++++background-color%3A+var%28--wm-color-on-surface-variant%29%3B%0A%7D%0A%0A%0A%2F*+check+active+state*%2F%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Ahover%3Einput%3Achecked%3Ahover%2Bspan.caption%3A%3Abefore+%7B%0A++++background%3A+var%28--wm-color-primary-container%29%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Einput%3Achecked+%7B%0A++++left%3A+unset%3B%0A++++right%3A+-4px%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Ahover%3Einput%3Achecked+%7B%0A++++background%3A+var%28--wm-color-surface-tint%29%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Ahover%3Einput%3Afocus+%7B%0A++++opacity%3A+0.12%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label%3Ahover%3Einput%3Achecked%3Ahover+%7B%0A++++opacity%3A+0.16%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.disabled%3Ahover%3Einput%3Ahover+%7B%0A++++opacity%3A+0%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.disabled%3Espan.caption+%7B%0A++++cursor%3A+not-allowed%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-checkbox.checkbox.filled-switch+label+input%3Afocus+%7B%0A++++outline%3A+unset+%21important%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-container.icon-container+%7B%0A++++position%3A+absolute%3B%0A++++top%3A+0px%3B%0A++++left%3A+0px%3B%0A++++width%3A+100%25%3B%0A++++height%3A+calc%28100%25+-+4px%29%3B%0A++++display%3A+flex%3B%0A++++pointer-events%3A+none%3B%0A++++z-index%3A+1%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-container.icon-container+.app-icon-wrapper.start-icon+%7B%0A++++width%3A+100%25%3B%0A++++justify-content%3A+center%3B%0A++++display%3A+inline-flex+%21important%3B%0A++++align-items%3A+center%3B%0A++++height%3A+32px%3B%0A++++color%3A+var%28--wm-color-surface-container-highest%29%3B%0A++++font-size%3A+16px%3B%0A++++visibility%3A+hidden%3B%0A++++padding-left%3A+7px%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-container.icon-container+.app-icon-wrapper.start-icon+.app-icon%2C%0A.filled-switch-wrapper+.app-container.icon-container+.app-icon-wrapper.end-icon+.app-icon+%7B%0A++++padding-right%3A+var%28--wm-space-0%29%3B%0A%7D%0A%0A.filled-switch-wrapper+.app-container.icon-container+.app-icon-wrapper.end-icon+%7B%0A++++width%3A+100%25%3B%0A++++justify-content%3A+right%3B%0A++++display%3A+inline-flex%3B%0A++++padding-right%3A+9px%3B%0A++++height%3A+34px%3B%0A++++color%3A+var%28--wm-color-surface-tint%29%3B%0A++++visibility%3A+hidden%3B%0A++++align-items%3A+center%3B%0A%7D%0A%0A.filled-switch-wrapper+input%5Btype%3D%22checkbox%22%5D%3Achecked%7E.app-container.icon-container+%7B%0A++++visibility%3A+visible%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch.icon%29+.app-container.icon-container+%7B%0A++++display%3A+flex+%21important%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch%29+.app-container.icon-container+%7B%0A++++display%3A+none+%21important%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch+label+input%5Btype%3D%22checkbox%22%5D%3Ais%28%3Achecked%29%3Adisabled%2B.caption%29+.app-container.icon-container+.app-icon-wrapper.end-icon+%7B%0A++++color%3A+var%28--wm-color-surface-container-highest%29%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch.icon-checked+label.unchecked%29+.icon-container.app-container+.app-icon-wrapper.start-icon+%7B%0A++++visibility%3A+hidden%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch+label.unchecked%29+.icon-container.app-container+.app-icon-wrapper.start-icon+%7B%0A++++visibility%3A+visible%3B%0A%7D%0A%0A.filled-switch-wrapper%3Ahas%28.app-toggle.checkbox.filled-switch+label%3Einput%3Achecked%29+.icon-container.app-container+.app-icon-wrapper.end-icon+%7B%0A++++visibility%3A+visible%3B%0A%7D%0A%0A.condensed-switch-wrapper+.app-toggle.checkbox.condensed-switch+label.disabled%2C%0A.iOS-switch-wrapper+.app-toggle.checkbox.iOS-switch+label.disabled%2C%0A.filled-switch-wrapper+.app-toggle.checkbox.filled-switch+label.disabled+%7B%0A++++opacity%3A+unset%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%22switch_type%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%22Switch%20Type%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20style%20of%20the%20switch.%20Options%20include%20%27filled%27%2C%20%27condensed%27%2C%20and%20%27iOS%27.%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22Filled%22%2C%20%22Condensed%22%2C%20%22IOS%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Filled%22%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_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%22Sets%20the%20text%20displayed%20on%20the%20label%20of%20the%20switch.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22icon%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%22Switch%20Icons%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Enables%20or%20disables%20icon%20options%20for%20the%20switch.%20If%20true%2C%20you%20can%20select%20icons%20for%20the%20switch.%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%22selected_icon%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%22Selected%20Icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20icon%20to%20use%20when%20the%20switch%20is%20in%20the%20selected%20state.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22wi%20wi-check%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%22unselected_icon%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%22Unselected%20Icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20icon%20to%20use%20when%20the%20switch%20is%20in%20the%20unselected%20state.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22wi%20wi-clear%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%22selected%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%20of%20the%20switch.%20This%20value%20is%20used%20to%20represent%20the%20state%20of%20the%20switch.%20For%20example%2C%20%27true%27%20for%20checked%20and%20%27false%27%20for%20unchecked.%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%22checked_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%22Checked%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20value%20to%20represent%20the%20switch%20when%20it%20is%20checked.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22true%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22unchecked_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%22Unchecked%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20value%20to%20represent%20the%20switch%20when%20it%20is%20unchecked.%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%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%20switch%20is%20required.%20Set%20to%20true%20to%20make%20it%20a%20required%20field.%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
|
+
};
|
File without changes
|
@@ -0,0 +1,33 @@
|
|
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.switch_type === "filled") {
|
17
|
+
if (Widget.props.icon === "icon") {
|
18
|
+
Widget.Widgets.toggle.class += ' filled-switch icon';
|
19
|
+
}
|
20
|
+
else if (Widget.props.icon === "icon-checked") {
|
21
|
+
Widget.Widgets.toggle.class += ' filled-switch icon-checked';
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
Widget.Widgets.toggle.class += ' filled-switch';
|
25
|
+
}
|
26
|
+
}
|
27
|
+
else if (Widget.props.switch_type === "condensed") {
|
28
|
+
Widget.Widgets.toggle.class += ' condensed-switch';
|
29
|
+
}
|
30
|
+
else if (Widget.props.switch_type === "iOS") {
|
31
|
+
Widget.Widgets.toggle.class += ' iOS-switch';
|
32
|
+
}
|
33
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export var textfield = {
|
2
|
+
"markup": "%3Cwm-custom-widget-container%3E%0A++++%3Cwm-composite+name%3D%22composite%22+captionposition%3D%22floating%22+required%3D%22false%22%3E%0A++++++++%3Cwm-label+class%3D%22control-label%22+notag%3D%22true%22+name%3D%22labelCaption%22+caption%3D%22bind%3Aprops.label_text%22+conditionalclass%3D%22bind%3Aprops.style.toLowerCase%28%29%22%3E%3C%2Fwm-label%3E%0A++++++++%3Cwm-container+class%3D%22form-field-wrapper%22+name%3D%22container2%22%3E%0A++++++++++++%3Cwm-button+class%3D%22btn-icon+btn-leading-icon%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22buttonLeadingIcon%22+iconclass%3D%22bind%3Aprops.leading_icon_class%22+show%3D%22bind%3Aprops.leading_icon%22+deferload%3D%22false%22%3E%3C%2Fwm-button%3E%0A++++++++++++%3Cwm-text+name%3D%22textField%22+updateon%3D%22default%22+placeholder%3D%22bind%3Aprops.placeholder_text%22+conditionalclass%3D%22bind%3Aprops.style.toLowerCase%28%29%22+disabled%3D%22bind%3Aprops.state.toLowerCase%28%29+%3D%3D+%26quot%3Bdisabled%26quot%3B%22+datavalue%3D%22bind%3Aprops.input_text%22%3E%3C%2Fwm-text%3E%0A++++++++++++%3Cwm-button+class%3D%22btn-icon+btn-trailing-icon%22+caption%3D%22%22+type%3D%22button%22+margin%3D%22unset%22+name%3D%22buttonTrailingIcon%22+iconclass%3D%22bind%3Aprops.trailing_icon_class%22+on-click%3D%22buttonTrailingIconClick%28%24event%2C+widget%29%22+show%3D%22bind%3Aprops.trailing_icon%22+deferload%3D%22false%22%3E%3C%2Fwm-button%3E%0A++++++++%3C%2Fwm-container%3E%0A++++++++%3Cwm-container+class%3D%22help-wrapper%22+name%3D%22containerSupportingWrapper%22%3E%0A++++++++++++%3Cwm-label+padding%3D%22unset%22+class%3D%22p+help-block%22+type%3D%22p%22+name%3D%22labelSupportingText%22+caption%3D%22bind%3Aprops.supporting_text%22+show%3D%22bind%3Aprops.show_supporting_text%22%3E%3C%2Fwm-label%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%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+%27widgetMap%27+property+here%0A+++++*+e.g.+to+get+value+of+text+widget+named+%27username%27+use+following+script%0A+++++*+%27widgetMap.username.datavalue%27%0A+++++*%2F%0A++++const+widgetMap+%3D+Widget.Widgets%3B%0A++++const+%7B%0A++++++++leading_icon%2C%0A++++++++trailing_icon%2C%0A++++++++input_type%2C%0A++++++++required%0A++++%7D+%3D+Widget.props%0A++++handleLeadingIcon%28widgetMap%2C+leading_icon%29%3B%0A++++handleTrailingIcon%28widgetMap%2C+trailing_icon%29%3B%0A++++handleinputType%28widgetMap%2C+input_type%29%3B%0A++++handleRequired%28widgetMap%2C+required%29%3B%0A%7D%3B%0A%0AWidget.onPropertyChange+%3D+function%28propname%2C+newvalue%2C+oldvalue%29+%7B%0A++++const+widgetMap+%3D+Widget.Widgets%3B%0A++++const+%7B%0A++++++++leading_icon%2C%0A++++++++trailing_icon%2C%0A++++++++input_type%2C%0A++++++++required%0A++++%7D+%3D+Widget.props%0A++++switch+%28propname%29+%7B%0A++++++++case+%27prop-leading_icon%27%3A%0A++++++++++++handleLeadingIcon%28widgetMap%2C+leading_icon%29%3B%0A++++++++++++break%0A++++++++case+%27prop-trailing_icon%27%3A%0A++++++++++++handleTrailingIcon%28widgetMap%2C+trailing_icon%29%3B%0A++++++++++++break%0A++++++++case+%27prop-required%27%3A%0A++++++++++++handleRequired%28widgetMap%2C+required%29%3B%0A++++++++++++break%0A++++++++case+%27prop-input_type%27%3A%0A++++++++++++handleinputType%28widgetMap%2C+input_type%29%3B%0A++++++++++++break%0A++++%7D%0A%7D%0A%0Afunction+handleLeadingIcon%28widgetMap%2C+leading_icon%29+%7B%0A++++widgetMap.textField.nativeElement.classList.remove%28%27with-leading-icon%27%29%3B%0A++++widgetMap.labelCaption.nativeElement.classList.remove%28%27with-leading-icon%27%29%3B%0A++++if+%28leading_icon+%3D%3D+true%29+%7B%0A++++++++widgetMap.labelCaption.class+%2B%3D+%27+with-leading-icon%27%3B%0A++++++++widgetMap.textField.class+%2B%3D+%27+with-leading-icon%27%3B%0A++++%7D%0A%7D%0A%0Afunction+handleTrailingIcon%28widgetMap%2C+trailing_icon%29+%7B%0A++++widgetMap.textField.nativeElement.classList.remove%28%27with-trailing-icon%27%29%3B%0A++++widgetMap.labelCaption.nativeElement.classList.remove%28%27with-trailing-icon%27%29%3B%0A++++if+%28trailing_icon+%3D%3D+true%29+%7B%0A++++++++widgetMap.labelCaption.class+%2B%3D+%27+with-trailing-icon%27%3B%0A++++++++widgetMap.textField.class+%2B%3D+%27+with-trailing-icon%27%3B%0A++++%7D%0A%7D%0A%0Afunction+handleRequired%28widgetMap%2C+required%29+%7B%0A++++widgetMap.composite.required+%3D+required%3B%0A%7D%0A%0Afunction+handleinputType%28widgetMap%2C+input_type%29+%7B%0A++++widgetMap.textField.type+%3D+input_type%3B%0A%7D%0A%0AWidget.buttonTrailingIconClick+%3D+function%28%24event%2C+widget%29+%7B%0A++++%2F%2F+Widget.invokeEvent%28%27trailingIconButtonOnClick%27%29%3B%0A%7D%3B",
|
4
|
+
"styles": ".wm-app+.app-composite-widget+.form-field-wrapper+.form-control.with-leading-icon+%7B%0A++++padding-left%3A+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.form-control.with-trailing-icon+%7B%0A++++padding-right%3A+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.form-control.filled+%7B%0A++++--wm-form-control-background%3A+var%28--wm-color-surface-container-highest%29%3B%0A++++border-width%3A+0+0+1px+0%3B%0A++++border-radius%3A+var%28--wm-form-control-radius%29+var%28--wm-form-control-radius%29+0+0%3B%0A++++padding-bottom%3A+0%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.form-control.filled%3Afocus+%7B%0A++++box-shadow%3A+inset+0+-2px+0+0+var%28--wm-form-control-border-color-focus%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.form-control.filled.ng-touched.ng-invalid%3Afocus+%7B%0A++++box-shadow%3A+inset+0+-2px+0+0+var%28--wm-form-control-border-color-error%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.btn+%7B%0A++++padding%3A+0%3B%0A++++background%3A+none%3B%0A++++border%3A+none%3B%0A++++min-height%3A+auto%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.btn+.app-icon+%7B%0A++++font-size%3A+var%28--wm-icon-size-md%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.btn-leading-icon%2C%0A.wm-app+.app-composite-widget+.form-field-wrapper+.btn-trailing-icon+%7B%0A++++position%3A+absolute%3B%0A++++z-index%3A+1%3B%0A++++top%3A+calc%28calc%28var%28--wm-form-control-height%29+-+var%28--wm-btn-icon-height%29+-+var%28--wm-btn-icon-margin%29+-+var%28--wm-btn-icon-margin%29%29+%2F+2%29%3B%0A++++left%3A+0%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.form-field-wrapper+.btn-trailing-icon+%7B%0A++++left%3A+auto%3B%0A++++right%3A+0%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.help-wrapper+%7B%0A++++width%3A+100%25%3B%0A++++margin-top%3A+4px%3B%0A++++padding%3A+0+var%28--wm-form-control-padding%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.help-wrapper+.help-block+%7B%0A++++margin%3A+0%3B%0A++++padding%3A+0%3B%0A%7D%0A%0A.wm-app+.app-composite-widget+.help-wrapper+.help-block.required%3Aafter+%7B%0A++++display%3A+none%3B%0A%7D%0A%0A.wm-app+.app-composite-widget%3Ahas%28.form-control.ng-touched.ng-invalid%29+.help-wrapper+.help-block+%7B%0A++++--wm-help-block-color%3A+var%28--wm-color-error%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating%3Anot%28.float-active%29+.control-label.with-leading-icon+%7B%0A++++max-width%3A+calc%28100%25+-+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29+-+var%28--wm-form-control-padding%29%29%3B%0A++++left%3A+calc%28calc%28var%28--wm-form-control-padding%29*+1.5%29+%2B+var%28--wm-icon-size-md%29%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating%3Anot%28.float-active%29+.control-label.with-trailing-icon+%7B%0A++++max-width%3A+calc%28100%25+-+var%28--wm-form-control-padding%29+-+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating%3Anot%28.float-active%29+.control-label.with-leading-icon.with-trailing-icon+%7B%0A++++max-width%3A+calc%28100%25+-+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29+-+calc%28calc%28var%28--wm-form-control-padding%29*1.5%29+%2B+var%28--wm-icon-size-md%29%29%29%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating.float-active+.control-label.filled+%7B%0A++++left%3A+var%28--wm-form-control-padding%29%3B%0A++++top%3A+calc%28var%28--wm-form-control-height%29*0.15%29%3B%0A++++padding%3A+0%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating.float-active+.control-label.filled%3Abefore+%7B%0A++++background%3A+none%3B%0A%7D%0A%0A.wm-app+.app-composite-widget.caption-floating.float-active+.control-label.filled.with-leading-icon+%7B%0A++++left%3A+calc%28calc%28var%28--wm-form-control-padding%29*+1.5%29+%2B+var%28--wm-icon-size-md%29%29%3B%0A++++max-width%3A+calc%28100%25+-+var%28--wm-form-control-padding%29+-+var%28--wm-form-control-padding%29+-+calc%28calc%28var%28--wm-form-control-padding%29*+2.5%29+%2B+var%28--wm-icon-size-md%29%29%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%22style%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%22Style%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20style%20variant%20between%20outlined%20and%20filled.%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22Outlined%22%2C%20%22Filled%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Outlined%22%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%20TextField%20is%20interactive(enabled)%20or%20non-interactive(disabled)%20state.%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%22text_configurations%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%22Text%20configurations%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%22Input%20text%22%2C%20%22Label%20text%22%2C%20%22Placeholder%20text%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Input%20text%22%2C%0A%20%20%20%20%20%20%22show%22%20%3A%20false%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22leading_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%22Leading%20icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20to%20show%2Fhide%20the%20Leading%20Icon%2FButton.%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%22trailing_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%22Trailing%20icon%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20to%20show%2Fhide%20the%20Trailing%20Icon%2FButton.%20%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%22show_supporting_text%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%20supporting%20text%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20to%20show%2Fhide%20the%20Supporting%20text(help%20text).%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%22Caption%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20caption%20value%20of%20the%20TextField.%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%22placeholder_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%22Placeholder%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20caption%20text%20of%20the%20TextField.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Enter%20Text%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22input_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%22Default%20Value%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20default%20value%20of%20the%20TextField.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22supporting_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%22Supporting%20Text%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20supporting%20text(helper%20text)%20value%20of%20the%20TextField.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22Supporting%20Text%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%22Allows%20to%20specify%20the%20icon%20for%20the%20Leading%20Icon%2FButton%20from%20wm%20icon%20library.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22wi%20wi-search%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%22trailing_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%22Trailing%20Icon%20Class%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Allows%20to%20specify%20the%20icon%20for%20the%20Trailing%20Icon%2FButton%20from%20wm%20icon%20library.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22wi%20wi-clear%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%22input_type%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%22Input%20Type%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Specifies%20the%20input%20type%20between%20text%2C%20password%20and%20tel.%22%2C%0A%20%20%20%20%20%20%22options%22%20%3A%20%5B%20%22text%22%2C%20%22password%22%2C%20%22tel%22%20%5D%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22text%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%22Specifies%20the%20textfiled%20to%20be%20mandatory%20while%20submittion.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22false%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%22trailingIconButtonOnClick%22%20%3A%20%7B%0A%20%20%20%20%20%20%22type%22%20%3A%20%22event%22%2C%0A%20%20%20%20%20%20%22displayName%22%20%3A%20%22Trailing%20Icon%20Button%20onClick%22%2C%0A%20%20%20%20%20%20%22description%22%20%3A%20%22Function%20to%20be%20called%20when%20the%20value%20of%20the%20slider%20changes.%20This%20function%20receives%20parameters%20such%20as%20the%20event%2C%20widget%2C%20new%20value%2C%20and%20old%20value.%22%2C%0A%20%20%20%20%20%20%22value%22%20%3A%20%22buttonTrailingIconClick(%24event%2C%20widget)%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A"
|
7
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
declare function handleLeadingIcon(widgetMap: any, leading_icon: any): void;
|
2
|
+
declare function handleTrailingIcon(widgetMap: any, trailing_icon: any): void;
|
3
|
+
declare function handleRequired(widgetMap: any, required: any): void;
|
4
|
+
declare function handleinputType(widgetMap: any, input_type: any): void;
|
@@ -0,0 +1,65 @@
|
|
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 'widgetMap' property here
|
13
|
+
* e.g. to get value of text widget named 'username' use following script
|
14
|
+
* 'widgetMap.username.datavalue'
|
15
|
+
*/
|
16
|
+
var widgetMap = Widget.Widgets;
|
17
|
+
var _a = Widget.props, leading_icon = _a.leading_icon, trailing_icon = _a.trailing_icon, input_type = _a.input_type, required = _a.required;
|
18
|
+
handleLeadingIcon(widgetMap, leading_icon);
|
19
|
+
handleTrailingIcon(widgetMap, trailing_icon);
|
20
|
+
handleinputType(widgetMap, input_type);
|
21
|
+
handleRequired(widgetMap, required);
|
22
|
+
};
|
23
|
+
Widget.onPropertyChange = function (propname, newvalue, oldvalue) {
|
24
|
+
var widgetMap = Widget.Widgets;
|
25
|
+
var _a = Widget.props, leading_icon = _a.leading_icon, trailing_icon = _a.trailing_icon, input_type = _a.input_type, required = _a.required;
|
26
|
+
switch (propname) {
|
27
|
+
case 'prop-leading_icon':
|
28
|
+
handleLeadingIcon(widgetMap, leading_icon);
|
29
|
+
break;
|
30
|
+
case 'prop-trailing_icon':
|
31
|
+
handleTrailingIcon(widgetMap, trailing_icon);
|
32
|
+
break;
|
33
|
+
case 'prop-required':
|
34
|
+
handleRequired(widgetMap, required);
|
35
|
+
break;
|
36
|
+
case 'prop-input_type':
|
37
|
+
handleinputType(widgetMap, input_type);
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
};
|
41
|
+
function handleLeadingIcon(widgetMap, leading_icon) {
|
42
|
+
widgetMap.textField.nativeElement.classList.remove('with-leading-icon');
|
43
|
+
widgetMap.labelCaption.nativeElement.classList.remove('with-leading-icon');
|
44
|
+
if (leading_icon == true) {
|
45
|
+
widgetMap.labelCaption.class += ' with-leading-icon';
|
46
|
+
widgetMap.textField.class += ' with-leading-icon';
|
47
|
+
}
|
48
|
+
}
|
49
|
+
function handleTrailingIcon(widgetMap, trailing_icon) {
|
50
|
+
widgetMap.textField.nativeElement.classList.remove('with-trailing-icon');
|
51
|
+
widgetMap.labelCaption.nativeElement.classList.remove('with-trailing-icon');
|
52
|
+
if (trailing_icon == true) {
|
53
|
+
widgetMap.labelCaption.class += ' with-trailing-icon';
|
54
|
+
widgetMap.textField.class += ' with-trailing-icon';
|
55
|
+
}
|
56
|
+
}
|
57
|
+
function handleRequired(widgetMap, required) {
|
58
|
+
widgetMap.composite.required = required;
|
59
|
+
}
|
60
|
+
function handleinputType(widgetMap, input_type) {
|
61
|
+
widgetMap.textField.type = input_type;
|
62
|
+
}
|
63
|
+
Widget.buttonTrailingIconClick = function ($event, widget) {
|
64
|
+
// Widget.invokeEvent('trailingIconButtonOnClick');
|
65
|
+
};
|