@wavemaker-ai/app-ng-runtime 1.0.0-rc.314 → 1.0.0-rc.319

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/build-task/bundles/index.umd.js +16 -7
  2. package/build-task/fesm2022/index.mjs +16 -7
  3. package/build-task/fesm2022/index.mjs.map +1 -1
  4. package/components/base/bundles/index.umd.js +301 -4
  5. package/components/base/fesm2022/index.mjs +300 -4
  6. package/components/base/fesm2022/index.mjs.map +1 -1
  7. package/components/base/index.d.ts +106 -2
  8. package/components/basic/anchor/bundles/index.umd.js +4 -5
  9. package/components/basic/anchor/fesm2022/index.mjs +4 -5
  10. package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
  11. package/components/basic/anchor/index.d.ts +1 -0
  12. package/components/basic/icon/bundles/index.umd.js +3 -3
  13. package/components/basic/icon/fesm2022/index.mjs +4 -4
  14. package/components/basic/icon/fesm2022/index.mjs.map +1 -1
  15. package/components/basic/icon/index.d.ts +1 -0
  16. package/components/basic/search/bundles/index.umd.js +6 -3
  17. package/components/basic/search/fesm2022/index.mjs +7 -4
  18. package/components/basic/search/fesm2022/index.mjs.map +1 -1
  19. package/components/basic/search/index.d.ts +3 -0
  20. package/components/basic/spinner/bundles/index.umd.js +5 -3
  21. package/components/basic/spinner/fesm2022/index.mjs +6 -4
  22. package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
  23. package/components/basic/spinner/index.d.ts +1 -0
  24. package/components/chart/bundles/index.umd.js +4 -3
  25. package/components/chart/fesm2022/index.mjs +5 -4
  26. package/components/chart/fesm2022/index.mjs.map +1 -1
  27. package/components/chart/index.d.ts +1 -0
  28. package/components/containers/accordion/bundles/index.umd.js +4 -3
  29. package/components/containers/accordion/fesm2022/index.mjs +5 -4
  30. package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  31. package/components/containers/accordion/index.d.ts +1 -0
  32. package/components/containers/panel/bundles/index.umd.js +3 -3
  33. package/components/containers/panel/fesm2022/index.mjs +4 -4
  34. package/components/containers/panel/fesm2022/index.mjs.map +1 -1
  35. package/components/containers/panel/index.d.ts +3 -0
  36. package/components/containers/tabs/bundles/index.umd.js +5 -4
  37. package/components/containers/tabs/fesm2022/index.mjs +6 -5
  38. package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  39. package/components/containers/wizard/bundles/index.umd.js +8 -6
  40. package/components/containers/wizard/fesm2022/index.mjs +9 -7
  41. package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  42. package/components/containers/wizard/index.d.ts +2 -0
  43. package/components/data/card/bundles/index.umd.js +3 -3
  44. package/components/data/card/fesm2022/index.mjs +4 -4
  45. package/components/data/card/fesm2022/index.mjs.map +1 -1
  46. package/components/data/form/bundles/index.umd.js +6 -3
  47. package/components/data/form/fesm2022/index.mjs +7 -4
  48. package/components/data/form/fesm2022/index.mjs.map +1 -1
  49. package/components/data/form/index.d.ts +2 -0
  50. package/components/data/list/bundles/index.umd.js +5 -3
  51. package/components/data/list/fesm2022/index.mjs +6 -4
  52. package/components/data/list/fesm2022/index.mjs.map +1 -1
  53. package/components/data/list/index.d.ts +2 -0
  54. package/components/data/table/bundles/index.umd.js +4 -3
  55. package/components/data/table/fesm2022/index.mjs +5 -4
  56. package/components/data/table/fesm2022/index.mjs.map +1 -1
  57. package/components/data/table/index.d.ts +1 -0
  58. package/components/dialogs/default/bundles/index.umd.js +2 -2
  59. package/components/dialogs/default/fesm2022/index.mjs +3 -3
  60. package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  61. package/components/input/button/bundles/index.umd.js +4 -5
  62. package/components/input/button/fesm2022/index.mjs +4 -5
  63. package/components/input/button/fesm2022/index.mjs.map +1 -1
  64. package/components/input/button/index.d.ts +3 -0
  65. package/components/input/checkbox/bundles/index.umd.js +6 -4
  66. package/components/input/checkbox/fesm2022/index.mjs +7 -5
  67. package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
  68. package/components/input/checkbox/index.d.ts +2 -0
  69. package/components/input/file-upload/bundles/index.umd.js +5 -3
  70. package/components/input/file-upload/fesm2022/index.mjs +6 -4
  71. package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  72. package/components/input/file-upload/index.d.ts +3 -0
  73. package/components/input/rating/bundles/index.umd.js +9 -3
  74. package/components/input/rating/fesm2022/index.mjs +10 -4
  75. package/components/input/rating/fesm2022/index.mjs.map +1 -1
  76. package/components/input/rating/index.d.ts +6 -0
  77. package/components/input/slider/bundles/index.umd.js +5 -3
  78. package/components/input/slider/fesm2022/index.mjs +6 -4
  79. package/components/input/slider/fesm2022/index.mjs.map +1 -1
  80. package/components/input/slider/index.d.ts +2 -0
  81. package/components/input/switch/bundles/index.umd.js +6 -3
  82. package/components/input/switch/fesm2022/index.mjs +7 -4
  83. package/components/input/switch/fesm2022/index.mjs.map +1 -1
  84. package/components/input/switch/index.d.ts +2 -0
  85. package/components/input/text/bundles/index.umd.js +7 -5
  86. package/components/input/text/fesm2022/index.mjs +8 -6
  87. package/components/input/text/fesm2022/index.mjs.map +1 -1
  88. package/components/input/text/index.d.ts +2 -0
  89. package/components/navigation/menu/bundles/index.umd.js +4 -3
  90. package/components/navigation/menu/fesm2022/index.mjs +5 -4
  91. package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  92. package/components/navigation/menu/index.d.ts +1 -0
  93. package/components/navigation/navbar/bundles/index.umd.js +5 -5
  94. package/components/navigation/navbar/fesm2022/index.mjs +5 -5
  95. package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
  96. package/components/navigation/navbar/index.d.ts +1 -0
  97. package/npm-shrinkwrap.json +2 -2
  98. package/package-lock.json +2 -2
  99. package/package.json +1 -1
  100. package/runtime/base/bundles/index.umd.js +23 -1
  101. package/runtime/base/fesm2022/index.mjs +23 -1
  102. package/runtime/base/fesm2022/index.mjs.map +1 -1
  103. package/runtime/base/index.d.ts +5 -0
  104. package/transpiler/bundles/index.umd.js +2 -0
  105. package/transpiler/fesm2022/index.mjs +2 -0
  106. package/transpiler/fesm2022/index.mjs.map +1 -1
@@ -37,7 +37,9 @@
37
37
  ['hint', base.PROP_ANY],
38
38
  ['arialabel', base.PROP_STRING],
39
39
  ['iconclass', base.PROP_STRING],
40
+ ['iconurl', base.PROP_STRING],
40
41
  ['checkediconclass', { value: '', ...base.PROP_STRING }],
42
+ ['checkediconurl', { value: '', PROP_STRING: base.PROP_STRING }],
41
43
  ['name', base.PROP_STRING],
42
44
  ['orderby', base.PROP_STRING],
43
45
  ['required', base.PROP_BOOLEAN],
@@ -60,6 +62,7 @@
60
62
  this._debounceSetSelectedValue = null;
61
63
  this.multiple = this.getAttr("multiple") === "true";
62
64
  this.checkediconclass = this.getAttr("checkediconclass");
65
+ this.checkediconurl = this.getAttr("checkediconurl");
63
66
  this._debounceSetSelectedValue = core.debounce((val) => {
64
67
  this.setSelectedValue();
65
68
  this.updateHighlighter(val);
@@ -204,14 +207,14 @@
204
207
  static { this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: SwitchComponent, isStandalone: true, selector: "[wmSwitch]", providers: [
205
208
  base.provideAs(SwitchComponent, forms.NG_VALUE_ACCESSOR, true),
206
209
  base.provideAsWidgetRef(SwitchComponent)
207
- ], exportAs: ["wmSwitch"], usesInheritance: true, ngImport: i0__namespace, template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && opt.dataObject[iconclass] && (!opt.selected ||!checkediconclass)) {\n <i aria-hidden=\"true\" [ngClass]=\"['app-icon', opt.dataObject[iconclass] || opt['icon']]\"></i>\n }\n @if (opt.selected && checkediconclass) {\n <i aria-hidden=\"true\" [ngClass]=\"[checkediconclass]\"></i>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n", dependencies: [{ kind: "ngmodule", type: i1.CommonModule }, { kind: "directive", type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: base.TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }] }); }
210
+ ], exportAs: ["wmSwitch"], usesInheritance: true, ngImport: i0__namespace, template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && (opt.dataObject[iconclass] || opt.dataObject[iconurl]) && (!opt.selected || !checkediconclass)) {\n <wm-app-icon [iconclass]=\"opt.dataObject[iconclass] || opt['icon']\" [iconurl]=\"opt.dataObject[iconurl] || opt['icon']\"></wm-app-icon>\n }\n @if (opt.selected && (checkediconclass || checkediconurl)) {\n <wm-app-icon [iconclass]=\"checkediconclass\" [iconurl]=\"checkediconurl\"></wm-app-icon>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n", dependencies: [{ kind: "ngmodule", type: i1.CommonModule }, { kind: "directive", type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: base.TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "component", type: base.WmAppIconComponent, selector: "wm-app-icon", inputs: ["iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
208
211
  }
209
212
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0__namespace, type: SwitchComponent, decorators: [{
210
213
  type: i0.Component,
211
- args: [{ standalone: true, imports: [i1.CommonModule, base.TextContentDirective], selector: '[wmSwitch]', providers: [
214
+ args: [{ standalone: true, imports: [i1.CommonModule, base.TextContentDirective, base.WmAppIconComponent], selector: '[wmSwitch]', providers: [
212
215
  base.provideAs(SwitchComponent, forms.NG_VALUE_ACCESSOR, true),
213
216
  base.provideAsWidgetRef(SwitchComponent)
214
- ], exportAs: 'wmSwitch', template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && opt.dataObject[iconclass] && (!opt.selected ||!checkediconclass)) {\n <i aria-hidden=\"true\" [ngClass]=\"['app-icon', opt.dataObject[iconclass] || opt['icon']]\"></i>\n }\n @if (opt.selected && checkediconclass) {\n <i aria-hidden=\"true\" [ngClass]=\"[checkediconclass]\"></i>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n" }]
217
+ ], exportAs: 'wmSwitch', template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && (opt.dataObject[iconclass] || opt.dataObject[iconurl]) && (!opt.selected || !checkediconclass)) {\n <wm-app-icon [iconclass]=\"opt.dataObject[iconclass] || opt['icon']\" [iconurl]=\"opt.dataObject[iconurl] || opt['icon']\"></wm-app-icon>\n }\n @if (opt.selected && (checkediconclass || checkediconurl)) {\n <wm-app-icon [iconclass]=\"checkediconclass\" [iconurl]=\"checkediconurl\"></wm-app-icon>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n" }]
215
218
  }], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
216
219
  type: i0.Inject,
217
220
  args: ['EXPLICIT_CONTEXT']
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
4
4
  import { Inject, Optional, Component } from '@angular/core';
5
5
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
6
  import { FormWidgetType, debounce, $appDigest, setCSS, isDefined, toBoolean } from '@wm/core';
7
- import { PROP_STRING, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, register, registerFormWidget, styler, TextContentDirective, provideAs, provideAsWidgetRef } from '@wm/components/base';
7
+ import { PROP_STRING, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, register, registerFormWidget, styler, TextContentDirective, WmAppIconComponent, provideAs, provideAsWidgetRef } from '@wm/components/base';
8
8
  import { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';
9
9
  import { find, findIndex, forEach, isUndefined, isNull, trim, isArray } from 'lodash-es';
10
10
 
@@ -21,7 +21,9 @@ const switchProps = new Map([
21
21
  ['hint', PROP_ANY],
22
22
  ['arialabel', PROP_STRING],
23
23
  ['iconclass', PROP_STRING],
24
+ ['iconurl', PROP_STRING],
24
25
  ['checkediconclass', { value: '', ...PROP_STRING }],
26
+ ['checkediconurl', { value: '', PROP_STRING }],
25
27
  ['name', PROP_STRING],
26
28
  ['orderby', PROP_STRING],
27
29
  ['required', PROP_BOOLEAN],
@@ -44,6 +46,7 @@ class SwitchComponent extends DatasetAwareFormComponent {
44
46
  this._debounceSetSelectedValue = null;
45
47
  this.multiple = this.getAttr("multiple") === "true";
46
48
  this.checkediconclass = this.getAttr("checkediconclass");
49
+ this.checkediconurl = this.getAttr("checkediconurl");
47
50
  this._debounceSetSelectedValue = debounce((val) => {
48
51
  this.setSelectedValue();
49
52
  this.updateHighlighter(val);
@@ -188,14 +191,14 @@ class SwitchComponent extends DatasetAwareFormComponent {
188
191
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: SwitchComponent, isStandalone: true, selector: "[wmSwitch]", providers: [
189
192
  provideAs(SwitchComponent, NG_VALUE_ACCESSOR, true),
190
193
  provideAsWidgetRef(SwitchComponent)
191
- ], exportAs: ["wmSwitch"], usesInheritance: true, ngImport: i0, template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && opt.dataObject[iconclass] && (!opt.selected ||!checkediconclass)) {\n <i aria-hidden=\"true\" [ngClass]=\"['app-icon', opt.dataObject[iconclass] || opt['icon']]\"></i>\n }\n @if (opt.selected && checkediconclass) {\n <i aria-hidden=\"true\" [ngClass]=\"[checkediconclass]\"></i>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }] }); }
194
+ ], exportAs: ["wmSwitch"], usesInheritance: true, ngImport: i0, template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && (opt.dataObject[iconclass] || opt.dataObject[iconurl]) && (!opt.selected || !checkediconclass)) {\n <wm-app-icon [iconclass]=\"opt.dataObject[iconclass] || opt['icon']\" [iconurl]=\"opt.dataObject[iconurl] || opt['icon']\"></wm-app-icon>\n }\n @if (opt.selected && (checkediconclass || checkediconurl)) {\n <wm-app-icon [iconclass]=\"checkediconclass\" [iconurl]=\"checkediconurl\"></wm-app-icon>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "component", type: WmAppIconComponent, selector: "wm-app-icon", inputs: ["iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
192
195
  }
193
196
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SwitchComponent, decorators: [{
194
197
  type: Component,
195
- args: [{ standalone: true, imports: [CommonModule, TextContentDirective], selector: '[wmSwitch]', providers: [
198
+ args: [{ standalone: true, imports: [CommonModule, TextContentDirective, WmAppIconComponent], selector: '[wmSwitch]', providers: [
196
199
  provideAs(SwitchComponent, NG_VALUE_ACCESSOR, true),
197
200
  provideAsWidgetRef(SwitchComponent)
198
- ], exportAs: 'wmSwitch', template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && opt.dataObject[iconclass] && (!opt.selected ||!checkediconclass)) {\n <i aria-hidden=\"true\" [ngClass]=\"['app-icon', opt.dataObject[iconclass] || opt['icon']]\"></i>\n }\n @if (opt.selected && checkediconclass) {\n <i aria-hidden=\"true\" [ngClass]=\"[checkediconclass]\"></i>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n" }]
201
+ ], exportAs: 'wmSwitch', template: "<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && (opt.dataObject[iconclass] || opt.dataObject[iconurl]) && (!opt.selected || !checkediconclass)) {\n <wm-app-icon [iconclass]=\"opt.dataObject[iconclass] || opt['icon']\" [iconurl]=\"opt.dataObject[iconurl] || opt['icon']\"></wm-app-icon>\n }\n @if (opt.selected && (checkediconclass || checkediconurl)) {\n <wm-app-icon [iconclass]=\"checkediconclass\" [iconurl]=\"checkediconurl\"></wm-app-icon>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n" }]
199
202
  }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
200
203
  type: Inject,
201
204
  args: ['EXPLICIT_CONTEXT']
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/input/switch/src/switch.props.ts","../../../../../projects/components/widgets/input/switch/src/switch.component.ts","../../../../../projects/components/widgets/input/switch/src/switch.component.html","../../../../../projects/components/widgets/input/switch/src/index.ts"],"sourcesContent":["import {PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, register, registerFormWidget} from '@wm/components/base';\nimport {FormWidgetType} from '@wm/core';\n\nexport const switchProps = new Map(\n [\n ['class', PROP_STRING],\n ['compareby', PROP_STRING],\n ['datafield', PROP_STRING],\n ['dataset', {value: 'yes, no, maybe', ...PROP_ANY}],\n ['datavaluesource', PROP_ANY],\n ['datavalue', PROP_STRING],\n ['disabled', PROP_BOOLEAN],\n ['displayexpression', PROP_STRING],\n ['displayfield', PROP_STRING],\n ['hint', PROP_ANY],\n ['arialabel', PROP_STRING],\n ['iconclass', PROP_STRING],\n ['checkediconclass', {value: '', ...PROP_STRING}],\n ['name', PROP_STRING],\n ['orderby', PROP_STRING],\n ['required', PROP_BOOLEAN],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['tabindex', {value: 0, ...PROP_NUMBER}]\n ]\n);\n\n\nexport const registerProps = () => {\n register(\n 'wm-switch',\n switchProps\n );\n registerFormWidget(\n FormWidgetType.SWITCH,\n new Map(switchProps)\n );\n registerFormWidget(\n FormWidgetType.TOGGLE,\n new Map(switchProps)\n );\n};\n","import { CommonModule } from '@angular/common';\nimport {AfterViewInit, Component, Inject, Injector, OnDestroy, Optional} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {$appDigest, debounce, isDefined, setCSS, toBoolean} from '@wm/core';\nimport { DataSetItem, provideAs, provideAsWidgetRef, styler, TextContentDirective } from '@wm/components/base';\nimport { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';\n\nimport { registerProps } from './switch.props';\nimport {find, findIndex, forEach, isArray, isNull, isUndefined, trim} from \"lodash-es\";\n\ndeclare const $;\n\nconst DEFAULT_CLS = 'app-switch';\nconst WIDGET_CONFIG = {widgetType: 'wm-switch', hostClass: DEFAULT_CLS};\n\n@Component({\n standalone: true,\n imports: [CommonModule, TextContentDirective],\n selector: '[wmSwitch]',\n templateUrl: './switch.component.html',\n providers: [\n provideAs(SwitchComponent, NG_VALUE_ACCESSOR, true),\n provideAsWidgetRef(SwitchComponent)\n ],\n exportAs: 'wmSwitch'\n})\nexport class SwitchComponent extends DatasetAwareFormComponent implements AfterViewInit, OnDestroy {\n static initializeProps = registerProps();\n\n options = [];\n selectedItem: DataSetItem;\n iconclass;\n checkediconclass;\n multiple: boolean;\n private btnwidth;\n public disabled: boolean;\n public required: boolean;\n private _debounceSetSelectedValue: Function | null = null;\n public name: string;\n public hint:any;\n\n constructor(inj: Injector, @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any) {\n super(inj, WIDGET_CONFIG, explicitContext);\n this.multiple = this.getAttr(\"multiple\") === \"true\";\n this.checkediconclass = this.getAttr(\"checkediconclass\");\n\n this._debounceSetSelectedValue = debounce((val) => {\n this.setSelectedValue();\n this.updateHighlighter(val);\n // only for default value trigger app digest to apply the selectedItem\n if (val) {\n $appDigest();\n }\n }, 200);\n\n const datasetSubscription = this.dataset$.subscribe(() => this.updateSwitchOptions());\n\n this.registerDestroyListener(() => datasetSubscription.unsubscribe());\n\n const datavalueSubscription = this.datavalue$.subscribe(() => {\n if (this._debounceSetSelectedValue) {\n this._debounceSetSelectedValue(true);\n }\n });\n this.registerDestroyListener(() => datavalueSubscription.unsubscribe());\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n styler(this.nativeElement as HTMLElement, this);\n }\n\n onStyleChange(key: string, nv: any, ov?: any) {\n if (key === 'height') {\n setCSS(this.nativeElement, 'overflow', nv ? 'auto' : '');\n } else {\n super.onStyleChange(key, nv, ov);\n }\n }\n\n // This function sets the selectedItem by either using compareby fields or selected flag on datasetItems.\n private setSelectedValue() {\n if (isDefined(this.datavalue) || isDefined(this.toBeProcessedDatavalue)) {\n this.selectedItem = find(this.datasetItems, {selected: true});\n return;\n }\n\n // If no value is provided, set first value as default if options are available else set -1 ie no selection\n // this.selectOptAtIndex(0);\n }\n\n // set the css for switch overlay element.\n // set the selected index from the datasetItems and highlight the datavalue on switch.\n private updateSwitchOptions() {\n if (this.datasetItems.length && !this.multiple) {\n this.btnwidth = (100 / this.datasetItems.length);\n setCSS(this.nativeElement.querySelector('.app-switch-overlay') as HTMLElement, 'width', this.btnwidth + '%');\n }\n\n if (this._debounceSetSelectedValue) {\n this._debounceSetSelectedValue(true);\n }\n }\n\n // This function animates the highlighted span on to the selected value.\n private updateHighlighter(skipAnimation?) {\n const handler = $(this.nativeElement).find('span.app-switch-overlay');\n\n this.setSelectedValue();\n\n let left,\n index = this.selectedItem ? findIndex(this.datasetItems, {key: this.selectedItem.key}) : -1;\n\n if (index === undefined || index === null) {\n index = -1;\n }\n left = index * this.btnwidth;\n if (skipAnimation) {\n handler.css('left', left + '%');\n } else {\n handler.animate({\n left: left + '%'\n }, 300);\n }\n }\n\n selectOptAtIndex($index) {\n if (!this.datasetItems.length) {\n return;\n }\n const opt = this.datasetItems[$index];\n this._modelByValue = opt.value;\n }\n\n // Triggered on selected the option from the switch.\n // set the index and highlight the default value. Invoke onchange event handler.\n selectOpt($event, $index, option) {\n $event.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n if(this.multiple) {\n const keys = [];\n this.datasetItems[$index].selected = !this.datasetItems[$index].selected;\n forEach(this.datasetItems, (item: any) => {\n if(item.selected)\n keys.push(item.key);\n });\n this.modelByKey = keys;\n this.selectedItem = find(this.datasetItems, {selected: true});\n }\n else {\n this.modelByKey = option.key;\n if (!this.multiple && this.selectedItem && $index === findIndex(this.datasetItems, {key: this.selectedItem.key})) {\n if (this.datasetItems.length === 2) {\n $index = $index === 1 ? 0 : 1;\n } else {\n return;\n }\n }\n this.selectedItem = this.datasetItems[$index];\n this.updateHighlighter();\n }\n\n this.invokeOnTouched();\n // invoke on datavalue change.\n this.invokeOnChange(this.datavalue, $event || {}, true);\n $appDigest();\n }\n\n onPropertyChange(key, nv, ov?) {\n if (key === 'disabled' && !toBoolean(nv)) {\n this.nativeElement.removeAttribute(key);\n } else {\n if(key==='hint')\n {\n if (isUndefined(nv) || isNull(nv) || trim(nv) === '') {\n this.hint=[];\n }\n else if (!isArray(nv)) {\n this.hint= [nv];\n }\n }\n super.onPropertyChange(key, nv, ov);\n }\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Nullify debounced function closure\n // This closure captures 'this' and prevents garbage collection\n this._debounceSetSelectedValue = null;\n\n // MEMORY LEAK FIX: Clear options array\n this.options = [];\n\n // MEMORY LEAK FIX: Clear selected item reference\n this.selectedItem = null;\n\n // MEMORY LEAK FIX: Clear hint array\n if (this.hint) {\n this.hint = [];\n }\n\n // Call parent ngOnDestroy\n super.ngOnDestroy();\n }\n}\n","<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && opt.dataObject[iconclass] && (!opt.selected ||!checkediconclass)) {\n <i aria-hidden=\"true\" [ngClass]=\"['app-icon', opt.dataObject[iconclass] || opt['icon']]\"></i>\n }\n @if (opt.selected && checkediconclass) {\n <i aria-hidden=\"true\" [ngClass]=\"[checkediconclass]\"></i>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;AAGO,MAAM,WAAW,GAAG,IAAI,GAAG,CAC9B;IACI,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,SAAS,EAAE,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,QAAQ,EAAC,CAAC;IACnD,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,UAAU,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,CAAA,CAAA;;4FASjC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;iCACI,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAAA,QAAA,EACjC,YAAY,EAAA,SAAA,EAEX;AACP,wBAAA,SAAS,CAAA,eAAA,EAAkB,iBAAiB,EAAE,IAAI,CAAC;AACnD,wBAAA,kBAAkB,CAAA,eAAA;AACrB,qBAAA,EAAA,QAAA,EACS,UAAU,EAAA,QAAA,EAAA,2hDAAA,EAAA;;0BAiBQ,MAAM;2BAAC,kBAAkB;;0BAAG;;;AE1C5D;;AAEG;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/input/switch/src/switch.props.ts","../../../../../projects/components/widgets/input/switch/src/switch.component.ts","../../../../../projects/components/widgets/input/switch/src/switch.component.html","../../../../../projects/components/widgets/input/switch/src/index.ts"],"sourcesContent":["import {PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, register, registerFormWidget} from '@wm/components/base';\nimport {FormWidgetType} from '@wm/core';\n\nexport const switchProps = new Map(\n [\n ['class', PROP_STRING],\n ['compareby', PROP_STRING],\n ['datafield', PROP_STRING],\n ['dataset', {value: 'yes, no, maybe', ...PROP_ANY}],\n ['datavaluesource', PROP_ANY],\n ['datavalue', PROP_STRING],\n ['disabled', PROP_BOOLEAN],\n ['displayexpression', PROP_STRING],\n ['displayfield', PROP_STRING],\n ['hint', PROP_ANY],\n ['arialabel', PROP_STRING],\n ['iconclass', PROP_STRING],\n ['iconurl', PROP_STRING],\n ['checkediconclass', {value : '',...PROP_STRING}],\n ['checkediconurl', {value : '', PROP_STRING}],\n ['name', PROP_STRING],\n ['orderby', PROP_STRING],\n ['required', PROP_BOOLEAN],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['tabindex', {value: 0, ...PROP_NUMBER}]\n ]\n);\n\n\nexport const registerProps = () => {\n register(\n 'wm-switch',\n switchProps\n );\n registerFormWidget(\n FormWidgetType.SWITCH,\n new Map(switchProps)\n );\n registerFormWidget(\n FormWidgetType.TOGGLE,\n new Map(switchProps)\n );\n};\n","import { CommonModule } from '@angular/common';\nimport {AfterViewInit, Component, Inject, Injector, OnDestroy, Optional} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {$appDigest, debounce, isDefined, setCSS, toBoolean} from '@wm/core';\nimport { DataSetItem, provideAs, provideAsWidgetRef, styler, TextContentDirective, WmAppIconComponent } from '@wm/components/base';\nimport { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';\n\nimport { registerProps } from './switch.props';\nimport {find, findIndex, forEach, isArray, isNull, isUndefined, trim} from \"lodash-es\";\n\ndeclare const $;\n\nconst DEFAULT_CLS = 'app-switch';\nconst WIDGET_CONFIG = {widgetType: 'wm-switch', hostClass: DEFAULT_CLS};\n\n@Component({\n standalone: true,\n imports: [CommonModule, TextContentDirective, WmAppIconComponent],\n selector: '[wmSwitch]',\n templateUrl: './switch.component.html',\n providers: [\n provideAs(SwitchComponent, NG_VALUE_ACCESSOR, true),\n provideAsWidgetRef(SwitchComponent)\n ],\n exportAs: 'wmSwitch'\n})\nexport class SwitchComponent extends DatasetAwareFormComponent implements AfterViewInit, OnDestroy {\n static initializeProps = registerProps();\n\n options = [];\n selectedItem: DataSetItem;\n iconclass;\n iconurl: string;\n checkediconclass;\n checkediconurl: string;\n multiple: boolean;\n private btnwidth;\n public disabled: boolean;\n public required: boolean;\n private _debounceSetSelectedValue: Function | null = null;\n public name: string;\n public hint:any;\n\n constructor(inj: Injector, @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any) {\n super(inj, WIDGET_CONFIG, explicitContext);\n this.multiple = this.getAttr(\"multiple\") === \"true\";\n this.checkediconclass = this.getAttr(\"checkediconclass\");\n this.checkediconurl = this.getAttr(\"checkediconurl\");\n\n this._debounceSetSelectedValue = debounce((val) => {\n this.setSelectedValue();\n this.updateHighlighter(val);\n // only for default value trigger app digest to apply the selectedItem\n if (val) {\n $appDigest();\n }\n }, 200);\n\n const datasetSubscription = this.dataset$.subscribe(() => this.updateSwitchOptions());\n\n this.registerDestroyListener(() => datasetSubscription.unsubscribe());\n\n const datavalueSubscription = this.datavalue$.subscribe(() => {\n if (this._debounceSetSelectedValue) {\n this._debounceSetSelectedValue(true);\n }\n });\n this.registerDestroyListener(() => datavalueSubscription.unsubscribe());\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n styler(this.nativeElement as HTMLElement, this);\n }\n\n onStyleChange(key: string, nv: any, ov?: any) {\n if (key === 'height') {\n setCSS(this.nativeElement, 'overflow', nv ? 'auto' : '');\n } else {\n super.onStyleChange(key, nv, ov);\n }\n }\n\n // This function sets the selectedItem by either using compareby fields or selected flag on datasetItems.\n private setSelectedValue() {\n if (isDefined(this.datavalue) || isDefined(this.toBeProcessedDatavalue)) {\n this.selectedItem = find(this.datasetItems, {selected: true});\n return;\n }\n\n // If no value is provided, set first value as default if options are available else set -1 ie no selection\n // this.selectOptAtIndex(0);\n }\n\n // set the css for switch overlay element.\n // set the selected index from the datasetItems and highlight the datavalue on switch.\n private updateSwitchOptions() {\n if (this.datasetItems.length && !this.multiple) {\n this.btnwidth = (100 / this.datasetItems.length);\n setCSS(this.nativeElement.querySelector('.app-switch-overlay') as HTMLElement, 'width', this.btnwidth + '%');\n }\n\n if (this._debounceSetSelectedValue) {\n this._debounceSetSelectedValue(true);\n }\n }\n\n // This function animates the highlighted span on to the selected value.\n private updateHighlighter(skipAnimation?) {\n const handler = $(this.nativeElement).find('span.app-switch-overlay');\n\n this.setSelectedValue();\n\n let left,\n index = this.selectedItem ? findIndex(this.datasetItems, {key: this.selectedItem.key}) : -1;\n\n if (index === undefined || index === null) {\n index = -1;\n }\n left = index * this.btnwidth;\n if (skipAnimation) {\n handler.css('left', left + '%');\n } else {\n handler.animate({\n left: left + '%'\n }, 300);\n }\n }\n\n selectOptAtIndex($index) {\n if (!this.datasetItems.length) {\n return;\n }\n const opt = this.datasetItems[$index];\n this._modelByValue = opt.value;\n }\n\n // Triggered on selected the option from the switch.\n // set the index and highlight the default value. Invoke onchange event handler.\n selectOpt($event, $index, option) {\n $event.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n if(this.multiple) {\n const keys = [];\n this.datasetItems[$index].selected = !this.datasetItems[$index].selected;\n forEach(this.datasetItems, (item: any) => {\n if(item.selected)\n keys.push(item.key);\n });\n this.modelByKey = keys;\n this.selectedItem = find(this.datasetItems, {selected: true});\n }\n else {\n this.modelByKey = option.key;\n if (!this.multiple && this.selectedItem && $index === findIndex(this.datasetItems, {key: this.selectedItem.key})) {\n if (this.datasetItems.length === 2) {\n $index = $index === 1 ? 0 : 1;\n } else {\n return;\n }\n }\n this.selectedItem = this.datasetItems[$index];\n this.updateHighlighter();\n }\n\n this.invokeOnTouched();\n // invoke on datavalue change.\n this.invokeOnChange(this.datavalue, $event || {}, true);\n $appDigest();\n }\n\n onPropertyChange(key, nv, ov?) {\n if (key === 'disabled' && !toBoolean(nv)) {\n this.nativeElement.removeAttribute(key);\n } else {\n if(key==='hint')\n {\n if (isUndefined(nv) || isNull(nv) || trim(nv) === '') {\n this.hint=[];\n }\n else if (!isArray(nv)) {\n this.hint= [nv];\n }\n }\n super.onPropertyChange(key, nv, ov);\n }\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Nullify debounced function closure\n // This closure captures 'this' and prevents garbage collection\n this._debounceSetSelectedValue = null;\n\n // MEMORY LEAK FIX: Clear options array\n this.options = [];\n\n // MEMORY LEAK FIX: Clear selected item reference\n this.selectedItem = null;\n\n // MEMORY LEAK FIX: Clear hint array\n if (this.hint) {\n this.hint = [];\n }\n\n // Call parent ngOnDestroy\n super.ngOnDestroy();\n }\n}\n","<div role=\"group\" class=\"btn-group btn-group-justified\" [ngClass]=\"{'multi-select': multiple}\">\n @for (opt of datasetItems; track opt) {\n <a\n focus-target\n href=\"javascript:void(0);\"\n class=\"btn btn-default\"\n [title]=\"hint?hint:opt.key\"\n [name]=\"'wm-switch-' + opt.key\"\n role=\"button\"\n [title]=\"hint?.[opt.index-1]?hint[opt.index-1]:(hint?.[0]?hint[0]:(opt[displayfield]||opt.label))\"\n [ngClass]=\"{'selected': opt.selected, 'disabled': disabled}\"\n [attr.aria-pressed]=\"opt.selected ? true : false\"\n (click)=\"selectOpt($event, $index, opt)\"\n >\n @if (opt.dataObject && (opt.dataObject[iconclass] || opt.dataObject[iconurl]) && (!opt.selected || !checkediconclass)) {\n <wm-app-icon [iconclass]=\"opt.dataObject[iconclass] || opt['icon']\" [iconurl]=\"opt.dataObject[iconurl] || opt['icon']\"></wm-app-icon>\n }\n @if (opt.selected && (checkediconclass || checkediconurl)) {\n <wm-app-icon [iconclass]=\"checkediconclass\" [iconurl]=\"checkediconurl\"></wm-app-icon>\n }\n <span class=\"caption\" [textContent]=\"opt[displayfield] || opt.label\"></span>\n </a>\n }\n</div>\n@if (!multiple) {\n <span [title]=\"selectedItem ? selectedItem.label : modelByKey\" aria-hidden=\"true\"\n class=\"btn btn-primary app-switch-overlay switch-handle\">\n <i [ngClass]=\"[checkediconclass]\"></i>\n <span class=\"caption\">{{selectedItem ? selectedItem.label : modelByKey}}</span>\n </span>\n}\n<input [name]=\"name\" class=\"model-holder ng-hide\" [disabled]=\"disabled\" [value]=\"modelByKey\" [required]=\"required\" aria-hidden=\"true\">\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;AAGO,MAAM,WAAW,GAAG,IAAI,GAAG,CAC9B;IACI,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,SAAS,EAAE,EAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,QAAQ,EAAC,CAAC;IACnD,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,WAAW,EAAE,WAAW,CAAC;IA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AAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,oBAAoB,mFAAE,kBAAkB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,kBAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,KAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FASrD,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;iCACI,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EACrD,YAAY,EAAA,SAAA,EAEX;AACP,wBAAA,SAAS,CAAA,eAAA,EAAkB,iBAAiB,EAAE,IAAI,CAAC;AACnD,wBAAA,kBAAkB,CAAA,eAAA;AACrB,qBAAA,EAAA,QAAA,EACS,UAAU,EAAA,QAAA,EAAA,ipDAAA,EAAA;;0BAmBQ,MAAM;2BAAC,kBAAkB;;0BAAG;;;AE5C5D;;AAEG;;;;"}
@@ -8,7 +8,9 @@ declare class SwitchComponent extends DatasetAwareFormComponent implements After
8
8
  options: any[];
9
9
  selectedItem: DataSetItem;
10
10
  iconclass: any;
11
+ iconurl: string;
11
12
  checkediconclass: any;
13
+ checkediconurl: string;
12
14
  multiple: boolean;
13
15
  private btnwidth;
14
16
  disabled: boolean;
@@ -928,7 +928,9 @@
928
928
  ['conditionalclass', base.PROP_ANY],
929
929
  ['conditionalstyle', base.PROP_ANY],
930
930
  ['trailingiconclass', base.PROP_STRING],
931
- ['leadingiconclass', base.PROP_STRING]
931
+ ['leadingiconclass', base.PROP_STRING],
932
+ ['leadingiconurl', base.PROP_STRING],
933
+ ['trailingiconurl', base.PROP_STRING]
932
934
  ]);
933
935
  const registerProps = () => {
934
936
  base.register('wm-input-text', inputTextTypeProps);
@@ -970,7 +972,7 @@
970
972
  }
971
973
  }
972
974
  get computedClasses() {
973
- return { 'with-leading-icon': this.leadingiconclass, 'with-trailing-icon': this.trailingiconclass,
975
+ return { 'with-leading-icon': this.leadingiconclass || this.leadingiconurl, 'with-trailing-icon': this.trailingiconclass || this.trailingiconurl,
974
976
  ...(typeof this.conditionalclass === 'string' ? { [this.conditionalclass]: true } : this.conditionalclass || {}) };
975
977
  }
976
978
  get mask() {
@@ -1042,15 +1044,15 @@
1042
1044
  base.provideAs(InputTextComponent, i2.NG_VALUE_ACCESSOR, true),
1043
1045
  base.provideAs(InputTextComponent, i2.NG_VALIDATORS, true),
1044
1046
  base.provideAsWidgetRef(InputTextComponent)
1045
- ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "ngModel", first: true, predicate: i2.NgModel, descendants: true }, { propertyName: "imask", first: true, predicate: ["input"], descendants: true, read: i3.IMaskDirective }], usesInheritance: true, ngImport: i0__namespace, template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"leadingiconclass\"></i>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"trailingiconclass\"></i>\n</button>\n", dependencies: [{ kind: "ngmodule", type: i1.CommonModule }, { kind: "directive", type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: i2.FormsModule }, { kind: "directive", type: i2__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2__namespace.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2__namespace.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: i3.IMaskModule }, { kind: "directive", type: i3__namespace.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }] }); }
1047
+ ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "ngModel", first: true, predicate: i2.NgModel, descendants: true }, { propertyName: "imask", first: true, predicate: ["input"], descendants: true, read: i3.IMaskDirective }], usesInheritance: true, ngImport: i0__namespace, template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass || leadingiconurl\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <wm-app-icon [iconclass]=\"leadingiconclass\" [iconurl]=\"leadingiconurl\"></wm-app-icon>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass || trailingiconurl\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <wm-app-icon [iconclass]=\"trailingiconclass\" [iconurl]=\"trailingiconurl\"></wm-app-icon>\n</button>\n", dependencies: [{ kind: "ngmodule", type: i1.CommonModule }, { kind: "directive", type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: i2.FormsModule }, { kind: "directive", type: i2__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2__namespace.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2__namespace.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: i3.IMaskModule }, { kind: "directive", type: i3__namespace.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }, { kind: "component", type: base.WmAppIconComponent, selector: "wm-app-icon", inputs: ["iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
1046
1048
  }
1047
1049
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0__namespace, type: InputTextComponent, decorators: [{
1048
1050
  type: i0.Component,
1049
- args: [{ standalone: true, imports: [i1.CommonModule, i2.FormsModule, i3.IMaskModule], selector: 'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]', providers: [
1051
+ args: [{ standalone: true, imports: [i1.CommonModule, i2.FormsModule, i3.IMaskModule, base.WmAppIconComponent], selector: 'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]', providers: [
1050
1052
  base.provideAs(InputTextComponent, i2.NG_VALUE_ACCESSOR, true),
1051
1053
  base.provideAs(InputTextComponent, i2.NG_VALIDATORS, true),
1052
1054
  base.provideAsWidgetRef(InputTextComponent)
1053
- ], template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"leadingiconclass\"></i>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"trailingiconclass\"></i>\n</button>\n" }]
1055
+ ], template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass || leadingiconurl\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <wm-app-icon [iconclass]=\"leadingiconclass\" [iconurl]=\"leadingiconurl\"></wm-app-icon>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass || trailingiconurl\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <wm-app-icon [iconclass]=\"trailingiconclass\" [iconurl]=\"trailingiconurl\"></wm-app-icon>\n</button>\n" }]
1054
1056
  }], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
1055
1057
  type: i0.Inject,
1056
1058
  args: ['EXPLICIT_CONTEXT']
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Inject, Optional, Injectable, Injector, ViewChild, Component } from '@angular/core';
3
3
  import { switchClass, $appDigest, addClass, isDefined, AbstractI18nService, FormWidgetType } from '@wm/core';
4
- import { styler, WidgetConfig, INPUTMODE, TrailingZeroDecimalPipe, PROP_BOOLEAN, PROP_STRING, PROP_ANY, PROP_NUMBER, register, provideAs, provideAsWidgetRef, registerFormWidget } from '@wm/components/base';
4
+ import { styler, WidgetConfig, INPUTMODE, TrailingZeroDecimalPipe, PROP_BOOLEAN, PROP_STRING, PROP_ANY, PROP_NUMBER, register, provideAs, provideAsWidgetRef, registerFormWidget, WmAppIconComponent } from '@wm/components/base';
5
5
  import { BaseFormCustomComponent } from '@wm/components/input/base-form-custom';
6
6
  import { isString, get, includes, isUndefined, isNull, round, intersection, toArray } from 'lodash-es';
7
7
  import { __decorate, __param, __metadata } from 'tslib';
@@ -914,7 +914,9 @@ const inputTextTypeProps = new Map([
914
914
  ['conditionalclass', PROP_ANY],
915
915
  ['conditionalstyle', PROP_ANY],
916
916
  ['trailingiconclass', PROP_STRING],
917
- ['leadingiconclass', PROP_STRING]
917
+ ['leadingiconclass', PROP_STRING],
918
+ ['leadingiconurl', PROP_STRING],
919
+ ['trailingiconurl', PROP_STRING]
918
920
  ]);
919
921
  const registerProps = () => {
920
922
  register('wm-input-text', inputTextTypeProps);
@@ -956,7 +958,7 @@ class InputTextComponent extends BaseInput {
956
958
  }
957
959
  }
958
960
  get computedClasses() {
959
- return { 'with-leading-icon': this.leadingiconclass, 'with-trailing-icon': this.trailingiconclass,
961
+ return { 'with-leading-icon': this.leadingiconclass || this.leadingiconurl, 'with-trailing-icon': this.trailingiconclass || this.trailingiconurl,
960
962
  ...(typeof this.conditionalclass === 'string' ? { [this.conditionalclass]: true } : this.conditionalclass || {}) };
961
963
  }
962
964
  get mask() {
@@ -1028,15 +1030,15 @@ class InputTextComponent extends BaseInput {
1028
1030
  provideAs(InputTextComponent, NG_VALUE_ACCESSOR, true),
1029
1031
  provideAs(InputTextComponent, NG_VALIDATORS, true),
1030
1032
  provideAsWidgetRef(InputTextComponent)
1031
- ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "ngModel", first: true, predicate: NgModel, descendants: true }, { propertyName: "imask", first: true, predicate: ["input"], descendants: true, read: IMaskDirective }], usesInheritance: true, ngImport: i0, template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"leadingiconclass\"></i>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"trailingiconclass\"></i>\n</button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: IMaskModule }, { kind: "directive", type: i3.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }] }); }
1033
+ ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "ngModel", first: true, predicate: NgModel, descendants: true }, { propertyName: "imask", first: true, predicate: ["input"], descendants: true, read: IMaskDirective }], usesInheritance: true, ngImport: i0, template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass || leadingiconurl\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <wm-app-icon [iconclass]=\"leadingiconclass\" [iconurl]=\"leadingiconurl\"></wm-app-icon>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass || trailingiconurl\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <wm-app-icon [iconclass]=\"trailingiconclass\" [iconurl]=\"trailingiconurl\"></wm-app-icon>\n</button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: IMaskModule }, { kind: "directive", type: i3.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }, { kind: "component", type: WmAppIconComponent, selector: "wm-app-icon", inputs: ["iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
1032
1034
  }
1033
1035
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: InputTextComponent, decorators: [{
1034
1036
  type: Component,
1035
- args: [{ standalone: true, imports: [CommonModule, FormsModule, IMaskModule], selector: 'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]', providers: [
1037
+ args: [{ standalone: true, imports: [CommonModule, FormsModule, IMaskModule, WmAppIconComponent], selector: 'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]', providers: [
1036
1038
  provideAs(InputTextComponent, NG_VALUE_ACCESSOR, true),
1037
1039
  provideAs(InputTextComponent, NG_VALIDATORS, true),
1038
1040
  provideAsWidgetRef(InputTextComponent)
1039
- ], template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"leadingiconclass\"></i>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <i aria-hidden=\"true\" [ngClass]=\"trailingiconclass\"></i>\n</button>\n" }]
1041
+ ], template: "<button class=\"btn-leading-icon\" type=\"button\" name=\"leadingIcon\" *ngIf=\"leadingiconclass || leadingiconurl\" (click)=\"iconClickEvent($event, 'leadingiconclick')\">\n <wm-app-icon [iconclass]=\"leadingiconclass\" [iconurl]=\"leadingiconurl\"></wm-app-icon>\n</button>\n<input class=\"form-control app-textbox\"\n focus-target\n [type]=\"type\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel\"\n [(ngModel)]=\"datavalue\"\n [imask]=\"mask\"\n [unmask]=\"true\"\n [ngModelOptions]=\"ngModelOptions\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [maxlength]=\"maxchars\"\n [pattern]=\"regexp\"\n [attr.tabindex]=\"tabindex\"\n [attr.placeholder]=\"placeholder\"\n [attr.accesskey]=\"shortcutkey\"\n [autofocus]=\"autofocus\"\n [ngClass]=\"computedClasses\"\n [ngStyle]=\"conditionalstyle\"\n (ngModelChange)=\"handleChange($event)\"\n (blur)=\"handleBlur($event); checkForDisplayFormat($event)\"\n (focus)=\"checkForDisplayFormat($event)\"\n [autocomplete]=\"autocomplete ? 'on' : 'off'\"\n (keyup.enter)=\"flushViewChanges(input.value)\"\n #input>\n<button class=\"btn-trailing-icon\" type=\"button\" name=\"trailingIcon\" *ngIf=\"trailingiconclass || trailingiconurl\" (click)=\"iconClickEvent($event, 'trailingiconclick')\">\n <wm-app-icon [iconclass]=\"trailingiconclass\" [iconurl]=\"trailingiconurl\"></wm-app-icon>\n</button>\n" }]
1040
1042
  }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
1041
1043
  type: Inject,
1042
1044
  args: ['EXPLICIT_CONTEXT']