@everymatrix/general-input-hsl 0.0.1

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 (95) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_13.cjs.entry.js +7303 -0
  3. package/dist/cjs/general-input-hsl-2832e412.js +5800 -0
  4. package/dist/cjs/general-input-hsl.cjs.js +25 -0
  5. package/dist/cjs/index-6f821b8d.js +1299 -0
  6. package/dist/cjs/index.cjs.js +10 -0
  7. package/dist/cjs/loader.cjs.js +15 -0
  8. package/dist/collection/collection-manifest.json +24 -0
  9. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +89 -0
  10. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +390 -0
  11. package/dist/collection/components/checkbox-input/checkbox-input.css +78 -0
  12. package/dist/collection/components/checkbox-input/checkbox-input.js +344 -0
  13. package/dist/collection/components/date-input/date-input.css +101 -0
  14. package/dist/collection/components/date-input/date-input.js +466 -0
  15. package/dist/collection/components/email-input/email-input.css +95 -0
  16. package/dist/collection/components/email-input/email-input.js +429 -0
  17. package/dist/collection/components/general-input-hsl/general-input-hsl.css +4 -0
  18. package/dist/collection/components/general-input-hsl/general-input-hsl.js +438 -0
  19. package/dist/collection/components/general-input-hsl/index.js +1 -0
  20. package/dist/collection/components/number-input/number-input.css +102 -0
  21. package/dist/collection/components/number-input/number-input.js +393 -0
  22. package/dist/collection/components/password-input/password-input.css +193 -0
  23. package/dist/collection/components/password-input/password-input.js +573 -0
  24. package/dist/collection/components/radio-input/radio-input.css +43 -0
  25. package/dist/collection/components/radio-input/radio-input.js +319 -0
  26. package/dist/collection/components/select-input/select-input.css +121 -0
  27. package/dist/collection/components/select-input/select-input.js +488 -0
  28. package/dist/collection/components/tel-input/tel-input.css +145 -0
  29. package/dist/collection/components/tel-input/tel-input.js +468 -0
  30. package/dist/collection/components/text-input/text-input.css +97 -0
  31. package/dist/collection/components/text-input/text-input.js +489 -0
  32. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
  33. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +366 -0
  34. package/dist/collection/components/twofa-input/twofa-input.css +56 -0
  35. package/dist/collection/components/twofa-input/twofa-input.js +495 -0
  36. package/dist/collection/index.js +1 -0
  37. package/dist/collection/utils/locale.utils.js +81 -0
  38. package/dist/collection/utils/tooltipIcon.svg +5 -0
  39. package/dist/collection/utils/types.js +1 -0
  40. package/dist/collection/utils/utils.js +3 -0
  41. package/dist/esm/app-globals-0f993ce5.js +3 -0
  42. package/dist/esm/checkbox-group-input_13.entry.js +7288 -0
  43. package/dist/esm/general-input-hsl-31f19ad0.js +5797 -0
  44. package/dist/esm/general-input-hsl.js +20 -0
  45. package/dist/esm/index-8598bfb7.js +1270 -0
  46. package/dist/esm/index.js +2 -0
  47. package/dist/esm/loader.js +11 -0
  48. package/dist/general-input-hsl/app-globals-0f993ce5.js +1 -0
  49. package/dist/general-input-hsl/checkbox-group-input_13.entry.js +1 -0
  50. package/dist/general-input-hsl/general-input-hsl-31f19ad0.js +5614 -0
  51. package/dist/general-input-hsl/general-input-hsl.esm.js +1 -0
  52. package/dist/general-input-hsl/index-8598bfb7.js +2 -0
  53. package/dist/general-input-hsl/index.esm.js +1 -0
  54. package/dist/index.cjs.js +1 -0
  55. package/dist/index.js +1 -0
  56. package/dist/stencil.config.dev.js +19 -0
  57. package/dist/stencil.config.js +19 -0
  58. package/dist/storybook/main.js +43 -0
  59. package/dist/storybook/preview.js +9 -0
  60. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  61. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/stencil.config.d.ts +2 -0
  62. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/stencil.config.dev.d.ts +2 -0
  63. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/storybook/main.d.ts +3 -0
  64. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/packages/stencil/general-input-hsl/storybook/preview.d.ts +70 -0
  65. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/index.d.ts +3 -0
  66. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  67. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  68. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-input-hsl/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  69. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
  70. package/dist/types/components/checkbox-input/checkbox-input.d.ts +67 -0
  71. package/dist/types/components/date-input/date-input.d.ts +89 -0
  72. package/dist/types/components/email-input/email-input.d.ts +81 -0
  73. package/dist/types/components/general-input-hsl/general-input-hsl.d.ts +84 -0
  74. package/dist/types/components/general-input-hsl/index.d.ts +1 -0
  75. package/dist/types/components/number-input/number-input.d.ts +75 -0
  76. package/dist/types/components/password-input/password-input.d.ts +97 -0
  77. package/dist/types/components/radio-input/radio-input.d.ts +60 -0
  78. package/dist/types/components/select-input/select-input.d.ts +85 -0
  79. package/dist/types/components/tel-input/tel-input.d.ts +89 -0
  80. package/dist/types/components/text-input/text-input.d.ts +86 -0
  81. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +73 -0
  82. package/dist/types/components/twofa-input/twofa-input.d.ts +84 -0
  83. package/dist/types/components.d.ts +1599 -0
  84. package/dist/types/index.d.ts +1 -0
  85. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  86. package/dist/types/utils/locale.utils.d.ts +13 -0
  87. package/dist/types/utils/types.d.ts +111 -0
  88. package/dist/types/utils/utils.d.ts +1 -0
  89. package/loader/cdn.js +1 -0
  90. package/loader/index.cjs.js +1 -0
  91. package/loader/index.d.ts +24 -0
  92. package/loader/index.es2017.js +1 -0
  93. package/loader/index.js +2 -0
  94. package/loader/package.json +11 -0
  95. package/package.json +27 -0
@@ -0,0 +1,366 @@
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
4
+ export class ToggleCheckboxInput {
5
+ constructor() {
6
+ this.callBackObject = {};
7
+ this.subFieldsObject = {};
8
+ this.value = '';
9
+ this.handleRevealField = (event, fieldName) => {
10
+ event.stopPropagation();
11
+ window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
12
+ };
13
+ this.setClientStyling = () => {
14
+ let sheet = document.createElement('style');
15
+ sheet.innerHTML = this.clientStyling;
16
+ this.stylingContainer.prepend(sheet);
17
+ };
18
+ this.name = undefined;
19
+ this.displayName = undefined;
20
+ this.defaultValue = '';
21
+ this.options = undefined;
22
+ this.autofilled = undefined;
23
+ this.tooltip = undefined;
24
+ this.validation = undefined;
25
+ this.language = undefined;
26
+ this.emitValue = undefined;
27
+ this.clientStyling = '';
28
+ this.errorMessage = undefined;
29
+ this.isValid = undefined;
30
+ this.limitStylingAppends = false;
31
+ this.showTooltip = false;
32
+ this.showFields = this.defaultValue === 'true';
33
+ }
34
+ handleStylingChange(newValue, oldValue) {
35
+ if (newValue !== oldValue)
36
+ this.setClientStyling();
37
+ }
38
+ validityStateHandler(inputStateEvent) {
39
+ this.sendValidityState.emit(inputStateEvent);
40
+ }
41
+ valueHandler(inputValueEvent) {
42
+ this.sendInputValue.emit(inputValueEvent);
43
+ }
44
+ handleClickOutside(event) {
45
+ if (event.composedPath()[0] === this.tooltipIconReference)
46
+ return;
47
+ if (event.composedPath()[0] !== this.tooltipReference)
48
+ this.showTooltip = false;
49
+ }
50
+ componentDidRender() {
51
+ // start custom styling area
52
+ if (!this.limitStylingAppends && this.stylingContainer) {
53
+ if (this.clientStyling)
54
+ this.setClientStyling();
55
+ this.limitStylingAppends = true;
56
+ }
57
+ // end custom styling area
58
+ }
59
+ componentDidLoad() {
60
+ if (this.options.length === 0)
61
+ return;
62
+ this.options.forEach((subField) => {
63
+ this.callBackObject[subField.name] = (e) => { this.handleRevealField(e, subField.name); };
64
+ this.subFieldsObject[subField.name].addEventListener('click', this.callBackObject[subField.name]);
65
+ });
66
+ }
67
+ handleClick() {
68
+ this.showFields = this.checkboxReference.checked;
69
+ this.errorMessage = this.setErrorMessage();
70
+ this.isValid = this.setValidity();
71
+ this.valueHandler({ name: this.name, value: this.checkboxReference.checked ? 'true' : 'false', type: 'toggle' });
72
+ }
73
+ setValidity() {
74
+ return this.checkboxReference.validity.valid;
75
+ }
76
+ setErrorMessage() {
77
+ if (this.checkboxReference.validity.valueMissing) {
78
+ return translate('requiredError', this.language);
79
+ }
80
+ }
81
+ disconnectedCallback() {
82
+ this.options.forEach((subField) => {
83
+ this.subFieldsObject[subField.name].removeEventListener('click', this.callBackObject[subField.name]);
84
+ });
85
+ }
86
+ renderLabel() {
87
+ return (h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
88
+ }
89
+ renderTooltip() {
90
+ if (this.showTooltip) {
91
+ return (h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
92
+ }
93
+ return null;
94
+ }
95
+ render() {
96
+ return h("div", { key: '834edab3849682f5ac58ee1fab10a036aa8e3320', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '27d7e35329afcd2af8a8e6a75864a0f1b9aa65bf', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '0cc1a7c807e2e68061946310bc12452dfc484664', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: '4f26bf1daede31f7da140950bf581546fd25bbfc', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '2794f0b513213331c29d3b14e46e4cca4e9d95d9', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
97
+ h("img", { key: 'ccfc85b68d33f32034b243dbba45f867933b6538', class: 'togglecheckbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '8f0086c49d44b71f8b8df63b5dac39add3dfd7f4', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
98
+ return h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
99
+ })));
100
+ }
101
+ static get is() { return "toggle-checkbox-input"; }
102
+ static get encapsulation() { return "shadow"; }
103
+ static get originalStyleUrls() {
104
+ return {
105
+ "$": ["toggle-checkbox-input.scss"]
106
+ };
107
+ }
108
+ static get styleUrls() {
109
+ return {
110
+ "$": ["toggle-checkbox-input.css"]
111
+ };
112
+ }
113
+ static get properties() {
114
+ return {
115
+ "name": {
116
+ "type": "string",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "string",
120
+ "resolved": "string",
121
+ "references": {}
122
+ },
123
+ "required": false,
124
+ "optional": false,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": "Name of the input."
128
+ },
129
+ "attribute": "name",
130
+ "reflect": true
131
+ },
132
+ "displayName": {
133
+ "type": "string",
134
+ "mutable": false,
135
+ "complexType": {
136
+ "original": "string",
137
+ "resolved": "string",
138
+ "references": {}
139
+ },
140
+ "required": false,
141
+ "optional": false,
142
+ "docs": {
143
+ "tags": [],
144
+ "text": "Name of input to be shown to the user."
145
+ },
146
+ "attribute": "display-name",
147
+ "reflect": true
148
+ },
149
+ "defaultValue": {
150
+ "type": "string",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "string",
154
+ "resolved": "string",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Default value for the input."
162
+ },
163
+ "attribute": "default-value",
164
+ "reflect": true,
165
+ "defaultValue": "''"
166
+ },
167
+ "options": {
168
+ "type": "unknown",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "RegCfgContentField[]",
172
+ "resolved": "RegCfgContentField[]",
173
+ "references": {
174
+ "RegCfgContentField": {
175
+ "location": "import",
176
+ "path": "../../utils/types",
177
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::RegCfgContentField"
178
+ }
179
+ }
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "Options of the input."
186
+ }
187
+ },
188
+ "autofilled": {
189
+ "type": "boolean",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "boolean",
193
+ "resolved": "boolean",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Boolean. Determines if input should be readonly."
201
+ },
202
+ "attribute": "autofilled",
203
+ "reflect": true
204
+ },
205
+ "tooltip": {
206
+ "type": "string",
207
+ "mutable": false,
208
+ "complexType": {
209
+ "original": "string",
210
+ "resolved": "string",
211
+ "references": {}
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "Tooltip text."
218
+ },
219
+ "attribute": "tooltip",
220
+ "reflect": true
221
+ },
222
+ "validation": {
223
+ "type": "unknown",
224
+ "mutable": false,
225
+ "complexType": {
226
+ "original": "ValidationSchema",
227
+ "resolved": "ValidationSchema",
228
+ "references": {
229
+ "ValidationSchema": {
230
+ "location": "import",
231
+ "path": "../../utils/types",
232
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::ValidationSchema"
233
+ }
234
+ }
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "Object of validation rules for the input."
241
+ }
242
+ },
243
+ "language": {
244
+ "type": "string",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "string",
248
+ "resolved": "string",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": "Currently selected language."
256
+ },
257
+ "attribute": "language",
258
+ "reflect": true
259
+ },
260
+ "emitValue": {
261
+ "type": "boolean",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "boolean",
265
+ "resolved": "boolean",
266
+ "references": {}
267
+ },
268
+ "required": false,
269
+ "optional": false,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
273
+ },
274
+ "attribute": "emit-value",
275
+ "reflect": true
276
+ },
277
+ "clientStyling": {
278
+ "type": "string",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "string",
282
+ "resolved": "string",
283
+ "references": {}
284
+ },
285
+ "required": false,
286
+ "optional": false,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": "Client custom styling via inline style"
290
+ },
291
+ "attribute": "client-styling",
292
+ "reflect": true,
293
+ "defaultValue": "''"
294
+ }
295
+ };
296
+ }
297
+ static get states() {
298
+ return {
299
+ "errorMessage": {},
300
+ "isValid": {},
301
+ "limitStylingAppends": {},
302
+ "showTooltip": {},
303
+ "showFields": {}
304
+ };
305
+ }
306
+ static get events() {
307
+ 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
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputStateEvent"
325
+ }
326
+ }
327
+ }
328
+ }, {
329
+ "method": "sendInputValue",
330
+ "name": "sendInputValue",
331
+ "bubbles": true,
332
+ "cancelable": true,
333
+ "composed": true,
334
+ "docs": {
335
+ "tags": [],
336
+ "text": ""
337
+ },
338
+ "complexType": {
339
+ "original": "InputValueEvent",
340
+ "resolved": "InputValueEvent",
341
+ "references": {
342
+ "InputValueEvent": {
343
+ "location": "import",
344
+ "path": "../../utils/types",
345
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputValueEvent"
346
+ }
347
+ }
348
+ }
349
+ }];
350
+ }
351
+ static get watchers() {
352
+ return [{
353
+ "propName": "clientStyling",
354
+ "methodName": "handleStylingChange"
355
+ }];
356
+ }
357
+ static get listeners() {
358
+ return [{
359
+ "name": "click",
360
+ "method": "handleClickOutside",
361
+ "target": "document",
362
+ "capture": false,
363
+ "passive": false
364
+ }];
365
+ }
366
+ }
@@ -0,0 +1,56 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .twofa {
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 10px;
13
+ }
14
+ .twofa__description {
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 10px;
18
+ align-items: center;
19
+ justify-content: center;
20
+ }
21
+ .twofa__error-message {
22
+ text-align: center;
23
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
24
+ }
25
+ .twofa__input-wrapper {
26
+ display: flex;
27
+ justify-content: center;
28
+ }
29
+ .twofa__input-wrapper input {
30
+ width: 35px;
31
+ height: 35px;
32
+ padding: 10px;
33
+ text-align: center;
34
+ border-radius: var(--emw--border-radius-small, 5px);
35
+ margin-left: 5px;
36
+ margin-right: 5px;
37
+ border: 2px solid var(--emw--otp-border-color, #55525c);
38
+ font-weight: var(--emw-font-weight-bold, 800);
39
+ outline: none;
40
+ transition: all 0.1s;
41
+ }
42
+ .twofa__input-wrapper input:focus {
43
+ border: 2px solid var(--emw--color-primary, #22B04E);
44
+ box-shadow: 0 0 2px 2px var(--emw--color-primary, #22B04E);
45
+ }
46
+ .twofa__button-wrapper {
47
+ justify-content: center;
48
+ text-align: center;
49
+ }
50
+ .twofa__button-wrapper button {
51
+ border: none;
52
+ background: none;
53
+ font-weight: var(--emw-font-weight-bold, 800);
54
+ color: var(--emw--color-primary, #22B04E);
55
+ cursor: pointer;
56
+ }