@everymatrix/general-input 1.44.0 → 1.45.2

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 (139) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +3873 -1756
  3. package/dist/cjs/general-input.cjs.entry.js +65 -63
  4. package/dist/cjs/general-input.cjs.js +17 -11
  5. package/dist/cjs/index-8cb018cb.js +1316 -0
  6. package/dist/cjs/index.cjs.js +13 -13
  7. package/dist/cjs/loader.cjs.js +7 -13
  8. package/dist/cjs/locale.utils-76c75c40.js +147 -0
  9. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +77 -78
  10. package/dist/collection/collection-manifest.json +14 -14
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +368 -353
  12. package/dist/collection/components/checkbox-input/checkbox-input.js +325 -315
  13. package/dist/collection/components/date-input/date-input.css +2 -2
  14. package/dist/collection/components/date-input/date-input.js +397 -376
  15. package/dist/collection/components/email-input/email-input.css +7 -11
  16. package/dist/collection/components/email-input/email-input.js +404 -385
  17. package/dist/collection/components/general-input/general-input.js +373 -368
  18. package/dist/collection/components/general-input/index.js +1 -0
  19. package/dist/collection/components/number-input/number-input.js +370 -352
  20. package/dist/collection/components/password-input/password-input.css +2 -4
  21. package/dist/collection/components/password-input/password-input.js +513 -540
  22. package/dist/collection/components/radio-input/radio-input.js +301 -286
  23. package/dist/collection/components/select-input/select-input.css +8 -9
  24. package/dist/collection/components/select-input/select-input.js +427 -414
  25. package/dist/collection/components/tel-input/tel-input.css +1 -1
  26. package/dist/collection/components/tel-input/tel-input.js +440 -422
  27. package/dist/collection/components/text-input/text-input.css +0 -1
  28. package/dist/collection/components/text-input/text-input.js +444 -429
  29. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +327 -340
  30. package/dist/collection/index.js +13 -13
  31. package/dist/collection/utils/locale.utils.js +133 -133
  32. package/dist/collection/utils/utils.js +3 -3
  33. package/dist/esm/app-globals-0f993ce5.js +3 -0
  34. package/dist/esm/checkbox-group-input_10.entry.js +3873 -1756
  35. package/dist/esm/general-input.entry.js +65 -63
  36. package/dist/esm/general-input.js +14 -11
  37. package/dist/esm/index-514fda47.js +1287 -0
  38. package/dist/esm/index.js +13 -13
  39. package/dist/esm/loader.js +7 -13
  40. package/dist/esm/locale.utils-ca41bf95.js +144 -0
  41. package/dist/esm/toggle-checkbox-input.entry.js +77 -78
  42. package/dist/general-input/general-input.esm.js +1 -1
  43. package/dist/general-input/p-03e81c11.js +2 -0
  44. package/dist/general-input/p-aec71434.js +1 -0
  45. package/dist/general-input/p-e1255160.js +1 -0
  46. package/dist/general-input/p-eb454344.entry.js +1 -0
  47. package/dist/general-input/p-ecdc294b.entry.js +5430 -0
  48. package/dist/general-input/p-f92ab852.entry.js +1 -0
  49. package/dist/stencil.config.dev.js +17 -0
  50. package/dist/stencil.config.js +14 -19
  51. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  52. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  53. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +68 -68
  54. package/dist/types/components/checkbox-input/checkbox-input.d.ts +61 -62
  55. package/dist/types/components/date-input/date-input.d.ts +78 -78
  56. package/dist/types/components/email-input/email-input.d.ts +77 -77
  57. package/dist/types/components/general-input/general-input.d.ts +72 -72
  58. package/dist/types/components/general-input/index.d.ts +1 -0
  59. package/dist/types/components/number-input/number-input.d.ts +71 -71
  60. package/dist/types/components/password-input/password-input.d.ts +87 -92
  61. package/dist/types/components/radio-input/radio-input.d.ts +55 -55
  62. package/dist/types/components/select-input/select-input.d.ts +79 -79
  63. package/dist/types/components/tel-input/tel-input.d.ts +85 -85
  64. package/dist/types/components/text-input/text-input.d.ts +81 -81
  65. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +63 -68
  66. package/dist/types/components.d.ts +201 -39
  67. package/dist/types/stencil-public-runtime.d.ts +142 -33
  68. package/dist/types/utils/locale.utils.d.ts +8 -8
  69. package/dist/types/utils/types.d.ts +54 -54
  70. package/loader/cdn.js +1 -3
  71. package/loader/index.cjs.js +1 -3
  72. package/loader/index.d.ts +13 -1
  73. package/loader/index.es2017.js +1 -3
  74. package/loader/index.js +1 -3
  75. package/loader/package.json +1 -0
  76. package/package.json +8 -1
  77. package/dist/cjs/index-132a0774.js +0 -1327
  78. package/dist/cjs/locale.utils-2fa6f747.js +0 -147
  79. package/dist/components/active-mixin.js +0 -975
  80. package/dist/components/checkbox-group-input.d.ts +0 -11
  81. package/dist/components/checkbox-group-input.js +0 -6
  82. package/dist/components/checkbox-group-input2.js +0 -1078
  83. package/dist/components/checkbox-input.d.ts +0 -11
  84. package/dist/components/checkbox-input.js +0 -6
  85. package/dist/components/checkbox-input2.js +0 -132
  86. package/dist/components/date-input.d.ts +0 -11
  87. package/dist/components/date-input.js +0 -6
  88. package/dist/components/date-input2.js +0 -11556
  89. package/dist/components/email-input.d.ts +0 -11
  90. package/dist/components/email-input.js +0 -6
  91. package/dist/components/email-input2.js +0 -171
  92. package/dist/components/field-mixin.js +0 -12426
  93. package/dist/components/general-input.d.ts +0 -11
  94. package/dist/components/general-input.js +0 -6
  95. package/dist/components/general-input2.js +0 -350
  96. package/dist/components/index.d.ts +0 -26
  97. package/dist/components/index.js +0 -18
  98. package/dist/components/input-field-shared-styles.js +0 -1211
  99. package/dist/components/number-input.d.ts +0 -11
  100. package/dist/components/number-input.js +0 -6
  101. package/dist/components/number-input2.js +0 -158
  102. package/dist/components/password-input.d.ts +0 -11
  103. package/dist/components/password-input.js +0 -6
  104. package/dist/components/password-input2.js +0 -1059
  105. package/dist/components/radio-input.d.ts +0 -11
  106. package/dist/components/radio-input.js +0 -6
  107. package/dist/components/radio-input2.js +0 -114
  108. package/dist/components/select-input.d.ts +0 -11
  109. package/dist/components/select-input.js +0 -6
  110. package/dist/components/select-input2.js +0 -183
  111. package/dist/components/tel-input.d.ts +0 -11
  112. package/dist/components/tel-input.js +0 -6
  113. package/dist/components/tel-input2.js +0 -197
  114. package/dist/components/text-input.d.ts +0 -11
  115. package/dist/components/text-input.js +0 -6
  116. package/dist/components/text-input2.js +0 -199
  117. package/dist/components/toggle-checkbox-input.d.ts +0 -11
  118. package/dist/components/toggle-checkbox-input.js +0 -6
  119. package/dist/components/tooltipIcon.js +0 -146
  120. package/dist/components/vaadin-button.js +0 -490
  121. package/dist/components/vaadin-combo-box.js +0 -4512
  122. package/dist/components/virtual-keyboard-controller.js +0 -2001
  123. package/dist/esm/index-db76d5b5.js +0 -1299
  124. package/dist/esm/locale.utils-30fb5289.js +0 -144
  125. package/dist/esm/polyfills/core-js.js +0 -11
  126. package/dist/esm/polyfills/css-shim.js +0 -1
  127. package/dist/esm/polyfills/dom.js +0 -79
  128. package/dist/esm/polyfills/es5-html-element.js +0 -1
  129. package/dist/esm/polyfills/index.js +0 -34
  130. package/dist/esm/polyfills/system.js +0 -6
  131. package/dist/general-input/p-04d4b145.js +0 -1
  132. package/dist/general-input/p-a8221ce9.entry.js +0 -1
  133. package/dist/general-input/p-b408093e.js +0 -1
  134. package/dist/general-input/p-b64caafa.entry.js +0 -3646
  135. package/dist/general-input/p-c85c0e4d.entry.js +0 -1
  136. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -2
  137. /package/dist/cjs/{tooltipIcon-092a795f.js → tooltipIcon-7e9ee226.js} +0 -0
  138. /package/dist/esm/{tooltipIcon-99c1c7b7.js → tooltipIcon-0a5a06a2.js} +0 -0
  139. /package/dist/general-input/{p-f4f4ccda.js → p-2dccd0bf.js} +0 -0
@@ -1,366 +1,381 @@
1
- import { Component, h, Prop, State, Event, Listen, Element, Watch } from '@stencil/core';
2
- import { translate } from '../../utils/locale.utils';
3
- import tooltipIcon from '../../utils/tooltipIcon.svg';
4
- import '@vaadin/checkbox';
5
- import '@vaadin/checkbox-group';
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
4
+ import "@vaadin/checkbox";
5
+ import "@vaadin/checkbox-group";
6
6
  export class CheckboxGroupInput {
7
- constructor() {
8
- /**
9
- * Default value for the input.
10
- */
11
- this.defaultValue = '';
12
- /**
13
- * Client custom styling via inline style
14
- */
15
- this.clientStyling = '';
16
- this.limitStylingAppends = false;
17
- this.showTooltip = false;
18
- this.selectedValues = [];
19
- this.value = null;
20
- this.setClientStyling = () => {
21
- let sheet = document.createElement('style');
22
- sheet.innerHTML = this.clientStyling;
23
- this.stylingContainer.prepend(sheet);
24
- };
25
- }
26
- validityChanged() {
27
- this.validityStateHandler({ valid: this.isValid, name: this.name });
28
- if (this.emitValue == true) {
29
- this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
7
+ constructor() {
8
+ this.value = null;
9
+ this.setClientStyling = () => {
10
+ let sheet = document.createElement('style');
11
+ sheet.innerHTML = this.clientStyling;
12
+ this.stylingContainer.prepend(sheet);
13
+ };
14
+ this.name = undefined;
15
+ this.displayName = undefined;
16
+ this.defaultValue = '';
17
+ this.autofilled = undefined;
18
+ this.tooltip = undefined;
19
+ this.options = undefined;
20
+ this.validation = undefined;
21
+ this.language = undefined;
22
+ this.emitValue = undefined;
23
+ this.clientStyling = '';
24
+ this.errorMessage = undefined;
25
+ this.isValid = undefined;
26
+ this.limitStylingAppends = false;
27
+ this.showTooltip = false;
28
+ this.selectedValues = [];
30
29
  }
31
- }
32
- setValue() {
33
- this.value = this.options.reduce((acc, option) => {
34
- acc[option.name] = this.selectedValues.includes(option.name);
35
- return acc;
36
- }, {});
37
- this.emitValueHandler(true);
38
- }
39
- validityStateHandler(inputStateEvent) {
40
- this.sendValidityState.emit(inputStateEvent);
41
- }
42
- emitValueHandler(newValue) {
43
- if (newValue == true && this.isValid) {
44
- this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
30
+ validityChanged() {
31
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
32
+ if (this.emitValue == true) {
33
+ this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
34
+ }
35
+ }
36
+ setValue() {
37
+ this.value = this.options.reduce((acc, option) => {
38
+ acc[option.name] = this.selectedValues.includes(option.name);
39
+ return acc;
40
+ }, {});
41
+ this.emitValueHandler(true);
45
42
  }
46
- }
47
- valueHandler(inputValueEvent) {
48
- this.sendInputValue.emit(inputValueEvent);
49
- }
50
- handleClickOutside(event) {
51
- if (event.composedPath()[0] === this.tooltipIconReference)
52
- return;
53
- if (event.composedPath()[0] !== this.tooltipReference)
54
- this.showTooltip = false;
55
- }
56
- componentDidRender() {
57
- // start custom styling area
58
- if (!this.limitStylingAppends && this.stylingContainer) {
59
- if (this.clientStyling)
60
- this.setClientStyling();
61
- this.limitStylingAppends = true;
43
+ validityStateHandler(inputStateEvent) {
44
+ this.sendValidityState.emit(inputStateEvent);
62
45
  }
63
- // end custom styling area
64
- }
65
- componentDidLoad() {
66
- this.inputReference = this.element.shadowRoot.querySelector('input');
67
- // For now this input has no validation. Send isValid as true immediately.
68
- //@TODO: add validation logic to it, if business reason arises.
69
- this.isValid = this.setValidity();
70
- if (this.defaultValue) {
71
- this.selectedValues = this.options.map((checkbox) => checkbox.name);
72
- this.value = this.defaultValue;
73
- this.valueHandler({ name: this.name, value: this.value });
46
+ emitValueHandler(newValue) {
47
+ if (newValue == true && this.isValid) {
48
+ this.valueHandler({ name: this.name, value: this.value, type: 'checkboxgroup' });
49
+ }
74
50
  }
75
- }
76
- setValidity() {
77
- return this.inputReference.validity.valid;
78
- }
79
- setErrorMessage() {
80
- if (this.inputReference.validity.valueMissing) {
81
- return translate('requiredError', this.language);
51
+ valueHandler(inputValueEvent) {
52
+ this.sendInputValue.emit(inputValueEvent);
82
53
  }
83
- }
84
- renderTooltip() {
85
- if (this.showTooltip) {
86
- return (h("div", { class: `checkboxgroup__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
54
+ handleClickOutside(event) {
55
+ if (event.composedPath()[0] === this.tooltipIconReference)
56
+ return;
57
+ if (event.composedPath()[0] !== this.tooltipReference)
58
+ this.showTooltip = false;
87
59
  }
88
- return null;
89
- }
90
- handleParentCheckbox(e) {
91
- // Logic for toggling the children checkboxes.
92
- this.selectedValues = e.target.checked
93
- ? this.options.map((checkbox) => checkbox.name)
94
- : [];
95
- }
96
- renderLabel() {
97
- return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' },
98
- h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
99
- }
100
- render() {
101
- return h("div", { class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el },
102
- h("div", { class: 'checkboxgroup__wrapper--flex' },
103
- h("vaadin-checkbox", { class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()),
104
- this.tooltip &&
105
- h("img", { class: 'checkboxgroup__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
106
- this.renderTooltip()),
107
- h("small", { class: 'checkboxgroup__error-message' }, this.errorMessage),
108
- h("vaadin-checkbox-group", { theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
109
- this.selectedValues = event.detail.value;
110
- } }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName }))));
111
- }
112
- static get is() { return "checkbox-group-input"; }
113
- static get encapsulation() { return "shadow"; }
114
- static get originalStyleUrls() { return {
115
- "$": ["checkbox-group-input.scss"]
116
- }; }
117
- static get styleUrls() { return {
118
- "$": ["checkbox-group-input.css"]
119
- }; }
120
- static get properties() { return {
121
- "name": {
122
- "type": "string",
123
- "mutable": false,
124
- "complexType": {
125
- "original": "string",
126
- "resolved": "string",
127
- "references": {}
128
- },
129
- "required": false,
130
- "optional": false,
131
- "docs": {
132
- "tags": [],
133
- "text": "Name of the input."
134
- },
135
- "attribute": "name",
136
- "reflect": true
137
- },
138
- "displayName": {
139
- "type": "string",
140
- "mutable": false,
141
- "complexType": {
142
- "original": "string",
143
- "resolved": "string",
144
- "references": {}
145
- },
146
- "required": false,
147
- "optional": false,
148
- "docs": {
149
- "tags": [],
150
- "text": "Name of input to be shown to the user."
151
- },
152
- "attribute": "display-name",
153
- "reflect": true
154
- },
155
- "defaultValue": {
156
- "type": "string",
157
- "mutable": false,
158
- "complexType": {
159
- "original": "string",
160
- "resolved": "string",
161
- "references": {}
162
- },
163
- "required": false,
164
- "optional": false,
165
- "docs": {
166
- "tags": [],
167
- "text": "Default value for the input."
168
- },
169
- "attribute": "default-value",
170
- "reflect": true,
171
- "defaultValue": "''"
172
- },
173
- "autofilled": {
174
- "type": "boolean",
175
- "mutable": false,
176
- "complexType": {
177
- "original": "boolean",
178
- "resolved": "boolean",
179
- "references": {}
180
- },
181
- "required": false,
182
- "optional": false,
183
- "docs": {
184
- "tags": [],
185
- "text": "Boolean. Determines if input should be readonly."
186
- },
187
- "attribute": "autofilled",
188
- "reflect": true
189
- },
190
- "tooltip": {
191
- "type": "string",
192
- "mutable": false,
193
- "complexType": {
194
- "original": "string",
195
- "resolved": "string",
196
- "references": {}
197
- },
198
- "required": false,
199
- "optional": false,
200
- "docs": {
201
- "tags": [],
202
- "text": "Tooltip text."
203
- },
204
- "attribute": "tooltip",
205
- "reflect": true
206
- },
207
- "options": {
208
- "type": "unknown",
209
- "mutable": false,
210
- "complexType": {
211
- "original": "RegCfgContentField[]",
212
- "resolved": "RegCfgContentField[]",
213
- "references": {
214
- "RegCfgContentField": {
215
- "location": "import",
216
- "path": "../../utils/types"
217
- }
60
+ componentDidRender() {
61
+ // start custom styling area
62
+ if (!this.limitStylingAppends && this.stylingContainer) {
63
+ if (this.clientStyling)
64
+ this.setClientStyling();
65
+ this.limitStylingAppends = true;
218
66
  }
219
- },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [],
224
- "text": "Options of the input."
225
- }
226
- },
227
- "validation": {
228
- "type": "unknown",
229
- "mutable": false,
230
- "complexType": {
231
- "original": "ValidationSchema",
232
- "resolved": "ValidationSchema",
233
- "references": {
234
- "ValidationSchema": {
235
- "location": "import",
236
- "path": "../../utils/types"
237
- }
67
+ // end custom styling area
68
+ }
69
+ componentDidLoad() {
70
+ this.inputReference = this.element.shadowRoot.querySelector('input');
71
+ // For now this input has no validation. Send isValid as true immediately.
72
+ //@TODO: add validation logic to it, if business reason arises.
73
+ this.isValid = this.setValidity();
74
+ if (this.defaultValue) {
75
+ this.selectedValues = this.options.map((checkbox) => checkbox.name);
76
+ this.value = this.defaultValue;
77
+ this.valueHandler({ name: this.name, value: this.value });
238
78
  }
239
- },
240
- "required": false,
241
- "optional": false,
242
- "docs": {
243
- "tags": [],
244
- "text": "Object of validation rules for the input."
245
- }
246
- },
247
- "language": {
248
- "type": "string",
249
- "mutable": false,
250
- "complexType": {
251
- "original": "string",
252
- "resolved": "string",
253
- "references": {}
254
- },
255
- "required": false,
256
- "optional": false,
257
- "docs": {
258
- "tags": [],
259
- "text": "Currently selected language."
260
- },
261
- "attribute": "language",
262
- "reflect": true
263
- },
264
- "emitValue": {
265
- "type": "boolean",
266
- "mutable": false,
267
- "complexType": {
268
- "original": "boolean",
269
- "resolved": "boolean",
270
- "references": {}
271
- },
272
- "required": false,
273
- "optional": false,
274
- "docs": {
275
- "tags": [],
276
- "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
277
- },
278
- "attribute": "emit-value",
279
- "reflect": true
280
- },
281
- "clientStyling": {
282
- "type": "string",
283
- "mutable": false,
284
- "complexType": {
285
- "original": "string",
286
- "resolved": "string",
287
- "references": {}
288
- },
289
- "required": false,
290
- "optional": false,
291
- "docs": {
292
- "tags": [],
293
- "text": "Client custom styling via inline style"
294
- },
295
- "attribute": "client-styling",
296
- "reflect": true,
297
- "defaultValue": "''"
298
79
  }
299
- }; }
300
- static get states() { return {
301
- "errorMessage": {},
302
- "isValid": {},
303
- "limitStylingAppends": {},
304
- "showTooltip": {},
305
- "selectedValues": {}
306
- }; }
307
- static get events() { return [{
308
- "method": "sendValidityState",
309
- "name": "sendValidityState",
310
- "bubbles": true,
311
- "cancelable": true,
312
- "composed": true,
313
- "docs": {
314
- "tags": [],
315
- "text": ""
316
- },
317
- "complexType": {
318
- "original": "InputStateEvent",
319
- "resolved": "InputStateEvent",
320
- "references": {
321
- "InputStateEvent": {
322
- "location": "import",
323
- "path": "../../utils/types"
324
- }
80
+ setValidity() {
81
+ return this.inputReference.validity.valid;
82
+ }
83
+ setErrorMessage() {
84
+ if (this.inputReference.validity.valueMissing) {
85
+ return translate('requiredError', this.language);
325
86
  }
326
- }
327
- }, {
328
- "method": "sendInputValue",
329
- "name": "sendInputValue",
330
- "bubbles": true,
331
- "cancelable": true,
332
- "composed": true,
333
- "docs": {
334
- "tags": [],
335
- "text": ""
336
- },
337
- "complexType": {
338
- "original": "InputValueEvent",
339
- "resolved": "InputValueEvent",
340
- "references": {
341
- "InputValueEvent": {
342
- "location": "import",
343
- "path": "../../utils/types"
344
- }
87
+ }
88
+ renderTooltip() {
89
+ if (this.showTooltip) {
90
+ return (h("div", { class: `checkboxgroup__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
345
91
  }
346
- }
347
- }]; }
348
- static get elementRef() { return "element"; }
349
- static get watchers() { return [{
350
- "propName": "isValid",
351
- "methodName": "validityChanged"
352
- }, {
353
- "propName": "selectedValues",
354
- "methodName": "setValue"
355
- }, {
356
- "propName": "emitValue",
357
- "methodName": "emitValueHandler"
358
- }]; }
359
- static get listeners() { return [{
360
- "name": "click",
361
- "method": "handleClickOutside",
362
- "target": "document",
363
- "capture": false,
364
- "passive": false
365
- }]; }
92
+ return null;
93
+ }
94
+ handleParentCheckbox(e) {
95
+ // Logic for toggling the children checkboxes.
96
+ this.selectedValues = e.target.checked
97
+ ? this.options.map((checkbox) => checkbox.name)
98
+ : [];
99
+ }
100
+ renderLabel() {
101
+ return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
102
+ }
103
+ render() {
104
+ return h("div", { key: 'fa45026502fd8d46aa537aee03210ad68d30e577', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '15ded4fd896920c6244806e49f300c124c27186d', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'd7eaa205877f8f12c9ef7d4f77018665806f5c7c', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
105
+ h("img", { key: 'aca39ed398415a6e2cef861be40dad33e0398759', class: 'checkboxgroup__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: 'a1a6e1c3c02edcca572b8826ffba06835ca451c3', class: 'checkboxgroup__error-message' }, this.errorMessage), h("vaadin-checkbox-group", { key: '9f5f8a945e4ba13d7d0da6d362c15d00a7796b71', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
106
+ this.selectedValues = event.detail.value;
107
+ } }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName }))));
108
+ }
109
+ static get is() { return "checkbox-group-input"; }
110
+ static get encapsulation() { return "shadow"; }
111
+ static get originalStyleUrls() {
112
+ return {
113
+ "$": ["checkbox-group-input.scss"]
114
+ };
115
+ }
116
+ static get styleUrls() {
117
+ return {
118
+ "$": ["checkbox-group-input.css"]
119
+ };
120
+ }
121
+ static get properties() {
122
+ return {
123
+ "name": {
124
+ "type": "string",
125
+ "mutable": false,
126
+ "complexType": {
127
+ "original": "string",
128
+ "resolved": "string",
129
+ "references": {}
130
+ },
131
+ "required": false,
132
+ "optional": false,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "Name of the input."
136
+ },
137
+ "attribute": "name",
138
+ "reflect": true
139
+ },
140
+ "displayName": {
141
+ "type": "string",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "string",
145
+ "resolved": "string",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "Name of input to be shown to the user."
153
+ },
154
+ "attribute": "display-name",
155
+ "reflect": true
156
+ },
157
+ "defaultValue": {
158
+ "type": "string",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "string",
162
+ "resolved": "string",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": false,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": "Default value for the input."
170
+ },
171
+ "attribute": "default-value",
172
+ "reflect": true,
173
+ "defaultValue": "''"
174
+ },
175
+ "autofilled": {
176
+ "type": "boolean",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "boolean",
180
+ "resolved": "boolean",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Boolean. Determines if input should be readonly."
188
+ },
189
+ "attribute": "autofilled",
190
+ "reflect": true
191
+ },
192
+ "tooltip": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Tooltip text."
205
+ },
206
+ "attribute": "tooltip",
207
+ "reflect": true
208
+ },
209
+ "options": {
210
+ "type": "unknown",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "RegCfgContentField[]",
214
+ "resolved": "RegCfgContentField[]",
215
+ "references": {
216
+ "RegCfgContentField": {
217
+ "location": "import",
218
+ "path": "../../utils/types",
219
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::RegCfgContentField"
220
+ }
221
+ }
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": "Options of the input."
228
+ }
229
+ },
230
+ "validation": {
231
+ "type": "unknown",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "ValidationSchema",
235
+ "resolved": "ValidationSchema",
236
+ "references": {
237
+ "ValidationSchema": {
238
+ "location": "import",
239
+ "path": "../../utils/types",
240
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::ValidationSchema"
241
+ }
242
+ }
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": "Object of validation rules for the input."
249
+ }
250
+ },
251
+ "language": {
252
+ "type": "string",
253
+ "mutable": false,
254
+ "complexType": {
255
+ "original": "string",
256
+ "resolved": "string",
257
+ "references": {}
258
+ },
259
+ "required": false,
260
+ "optional": false,
261
+ "docs": {
262
+ "tags": [],
263
+ "text": "Currently selected language."
264
+ },
265
+ "attribute": "language",
266
+ "reflect": true
267
+ },
268
+ "emitValue": {
269
+ "type": "boolean",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "boolean",
273
+ "resolved": "boolean",
274
+ "references": {}
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
281
+ },
282
+ "attribute": "emit-value",
283
+ "reflect": true
284
+ },
285
+ "clientStyling": {
286
+ "type": "string",
287
+ "mutable": false,
288
+ "complexType": {
289
+ "original": "string",
290
+ "resolved": "string",
291
+ "references": {}
292
+ },
293
+ "required": false,
294
+ "optional": false,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": "Client custom styling via inline style"
298
+ },
299
+ "attribute": "client-styling",
300
+ "reflect": true,
301
+ "defaultValue": "''"
302
+ }
303
+ };
304
+ }
305
+ static get states() {
306
+ return {
307
+ "errorMessage": {},
308
+ "isValid": {},
309
+ "limitStylingAppends": {},
310
+ "showTooltip": {},
311
+ "selectedValues": {}
312
+ };
313
+ }
314
+ static get events() {
315
+ return [{
316
+ "method": "sendValidityState",
317
+ "name": "sendValidityState",
318
+ "bubbles": true,
319
+ "cancelable": true,
320
+ "composed": true,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": ""
324
+ },
325
+ "complexType": {
326
+ "original": "InputStateEvent",
327
+ "resolved": "InputStateEvent",
328
+ "references": {
329
+ "InputStateEvent": {
330
+ "location": "import",
331
+ "path": "../../utils/types",
332
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputStateEvent"
333
+ }
334
+ }
335
+ }
336
+ }, {
337
+ "method": "sendInputValue",
338
+ "name": "sendInputValue",
339
+ "bubbles": true,
340
+ "cancelable": true,
341
+ "composed": true,
342
+ "docs": {
343
+ "tags": [],
344
+ "text": ""
345
+ },
346
+ "complexType": {
347
+ "original": "InputValueEvent",
348
+ "resolved": "InputValueEvent",
349
+ "references": {
350
+ "InputValueEvent": {
351
+ "location": "import",
352
+ "path": "../../utils/types",
353
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputValueEvent"
354
+ }
355
+ }
356
+ }
357
+ }];
358
+ }
359
+ static get elementRef() { return "element"; }
360
+ static get watchers() {
361
+ return [{
362
+ "propName": "isValid",
363
+ "methodName": "validityChanged"
364
+ }, {
365
+ "propName": "selectedValues",
366
+ "methodName": "setValue"
367
+ }, {
368
+ "propName": "emitValue",
369
+ "methodName": "emitValueHandler"
370
+ }];
371
+ }
372
+ static get listeners() {
373
+ return [{
374
+ "name": "click",
375
+ "method": "handleClickOutside",
376
+ "target": "document",
377
+ "capture": false,
378
+ "passive": false
379
+ }];
380
+ }
366
381
  }