@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,344 @@
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
4
+ export class CheckboxInput {
5
+ constructor() {
6
+ this.value = '';
7
+ this.setClientStyling = () => {
8
+ let sheet = document.createElement('style');
9
+ sheet.innerHTML = this.clientStyling;
10
+ this.stylingContainer.prepend(sheet);
11
+ };
12
+ this.name = undefined;
13
+ this.displayName = undefined;
14
+ this.defaultValue = '';
15
+ this.autofilled = undefined;
16
+ this.tooltip = undefined;
17
+ this.validation = undefined;
18
+ this.language = undefined;
19
+ this.emitValue = undefined;
20
+ this.clientStyling = '';
21
+ this.errorMessage = undefined;
22
+ this.isValid = undefined;
23
+ this.limitStylingAppends = false;
24
+ this.showTooltip = false;
25
+ }
26
+ handleStylingChange(newValue, oldValue) {
27
+ if (newValue !== oldValue)
28
+ this.setClientStyling();
29
+ }
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 });
34
+ }
35
+ }
36
+ validityStateHandler(inputStateEvent) {
37
+ this.sendValidityState.emit(inputStateEvent);
38
+ }
39
+ emitValueHandler(newValue) {
40
+ if (newValue == true && this.isValid) {
41
+ this.valueHandler({ name: this.name, value: this.value });
42
+ }
43
+ }
44
+ valueHandler(inputValueEvent) {
45
+ this.sendInputValue.emit(inputValueEvent);
46
+ }
47
+ handleClickOutside(event) {
48
+ if (event.composedPath()[0] === this.tooltipIconReference)
49
+ return;
50
+ if (event.composedPath()[0] !== this.tooltipReference)
51
+ this.showTooltip = false;
52
+ }
53
+ componentDidRender() {
54
+ // start custom styling area
55
+ if (!this.limitStylingAppends && this.stylingContainer) {
56
+ if (this.clientStyling)
57
+ this.setClientStyling();
58
+ this.limitStylingAppends = true;
59
+ }
60
+ // end custom styling area
61
+ }
62
+ componentDidLoad() {
63
+ this.inputReference = this.vaadinCheckbox.querySelector('input');
64
+ if (this.defaultValue) {
65
+ this.value = this.defaultValue;
66
+ this.valueHandler({ name: this.name, value: this.value });
67
+ }
68
+ }
69
+ handleCheckbox(e) {
70
+ this.value = e.target.checked.toString();
71
+ this.isValid = this.setValidity();
72
+ this.errorMessage = this.setErrorMessage();
73
+ this.emitValueHandler(true);
74
+ }
75
+ setValidity() {
76
+ return this.inputReference.validity.valid;
77
+ }
78
+ setErrorMessage() {
79
+ if (this.inputReference.validity.valueMissing) {
80
+ return translate('requiredError', this.language);
81
+ }
82
+ }
83
+ renderLabel() {
84
+ return (h("label", { class: "checkbox__label", htmlFor: `${this.name}__input`, slot: "label" }, h("div", { class: "checkbox__label-text", innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
85
+ }
86
+ renderTooltip() {
87
+ if (this.showTooltip) {
88
+ return (h("div", { class: `checkbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => (this.tooltipReference = el), innerHTML: this.tooltip }));
89
+ }
90
+ return null;
91
+ }
92
+ render() {
93
+ return (h("div", { key: 'e9dfb4e2a6b99d740eaa7d94d1ff3aea9587bcc9', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, h("vaadin-checkbox", { key: 'cc2a8d1c131bd04febf221538f01d7334169d92a', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (h("img", { key: 'a94be7eefe15593f0cfa90d89bed1f536bd51103', class: "checkboxgroup__tooltip-icon", src: tooltipIcon, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
94
+ }
95
+ static get is() { return "checkbox-input"; }
96
+ static get encapsulation() { return "shadow"; }
97
+ static get originalStyleUrls() {
98
+ return {
99
+ "$": ["checkbox-input.scss"]
100
+ };
101
+ }
102
+ static get styleUrls() {
103
+ return {
104
+ "$": ["checkbox-input.css"]
105
+ };
106
+ }
107
+ static get properties() {
108
+ return {
109
+ "name": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "Name of the input."
122
+ },
123
+ "attribute": "name",
124
+ "reflect": true
125
+ },
126
+ "displayName": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Name of input to be shown to the user."
139
+ },
140
+ "attribute": "display-name",
141
+ "reflect": true
142
+ },
143
+ "defaultValue": {
144
+ "type": "string",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "string",
148
+ "resolved": "string",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": "Default value for the input."
156
+ },
157
+ "attribute": "default-value",
158
+ "reflect": true,
159
+ "defaultValue": "''"
160
+ },
161
+ "autofilled": {
162
+ "type": "boolean",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "boolean",
166
+ "resolved": "boolean",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Boolean. Determines if input should be readonly."
174
+ },
175
+ "attribute": "autofilled",
176
+ "reflect": true
177
+ },
178
+ "tooltip": {
179
+ "type": "string",
180
+ "mutable": false,
181
+ "complexType": {
182
+ "original": "string",
183
+ "resolved": "string",
184
+ "references": {}
185
+ },
186
+ "required": false,
187
+ "optional": false,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": "Tooltip text."
191
+ },
192
+ "attribute": "tooltip",
193
+ "reflect": true
194
+ },
195
+ "validation": {
196
+ "type": "unknown",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "ValidationSchema",
200
+ "resolved": "ValidationSchema",
201
+ "references": {
202
+ "ValidationSchema": {
203
+ "location": "import",
204
+ "path": "../../utils/types",
205
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::ValidationSchema"
206
+ }
207
+ }
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": "Object of validation rules for the input."
214
+ }
215
+ },
216
+ "language": {
217
+ "type": "string",
218
+ "mutable": false,
219
+ "complexType": {
220
+ "original": "string",
221
+ "resolved": "string",
222
+ "references": {}
223
+ },
224
+ "required": false,
225
+ "optional": false,
226
+ "docs": {
227
+ "tags": [],
228
+ "text": "Currently selected language."
229
+ },
230
+ "attribute": "language",
231
+ "reflect": true
232
+ },
233
+ "emitValue": {
234
+ "type": "boolean",
235
+ "mutable": false,
236
+ "complexType": {
237
+ "original": "boolean",
238
+ "resolved": "boolean",
239
+ "references": {}
240
+ },
241
+ "required": false,
242
+ "optional": false,
243
+ "docs": {
244
+ "tags": [],
245
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
246
+ },
247
+ "attribute": "emit-value",
248
+ "reflect": true
249
+ },
250
+ "clientStyling": {
251
+ "type": "string",
252
+ "mutable": false,
253
+ "complexType": {
254
+ "original": "string",
255
+ "resolved": "string",
256
+ "references": {}
257
+ },
258
+ "required": false,
259
+ "optional": false,
260
+ "docs": {
261
+ "tags": [],
262
+ "text": "Client custom styling via inline style"
263
+ },
264
+ "attribute": "client-styling",
265
+ "reflect": true,
266
+ "defaultValue": "''"
267
+ }
268
+ };
269
+ }
270
+ static get states() {
271
+ return {
272
+ "errorMessage": {},
273
+ "isValid": {},
274
+ "limitStylingAppends": {},
275
+ "showTooltip": {}
276
+ };
277
+ }
278
+ static get events() {
279
+ return [{
280
+ "method": "sendValidityState",
281
+ "name": "sendValidityState",
282
+ "bubbles": true,
283
+ "cancelable": true,
284
+ "composed": true,
285
+ "docs": {
286
+ "tags": [],
287
+ "text": ""
288
+ },
289
+ "complexType": {
290
+ "original": "InputStateEvent",
291
+ "resolved": "InputStateEvent",
292
+ "references": {
293
+ "InputStateEvent": {
294
+ "location": "import",
295
+ "path": "../../utils/types",
296
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputStateEvent"
297
+ }
298
+ }
299
+ }
300
+ }, {
301
+ "method": "sendInputValue",
302
+ "name": "sendInputValue",
303
+ "bubbles": true,
304
+ "cancelable": true,
305
+ "composed": true,
306
+ "docs": {
307
+ "tags": [],
308
+ "text": ""
309
+ },
310
+ "complexType": {
311
+ "original": "InputValueEvent",
312
+ "resolved": "InputValueEvent",
313
+ "references": {
314
+ "InputValueEvent": {
315
+ "location": "import",
316
+ "path": "../../utils/types",
317
+ "id": "../../../../packages/stencil/general-input-hsl/src/utils/types.ts::InputValueEvent"
318
+ }
319
+ }
320
+ }
321
+ }];
322
+ }
323
+ static get watchers() {
324
+ return [{
325
+ "propName": "clientStyling",
326
+ "methodName": "handleStylingChange"
327
+ }, {
328
+ "propName": "isValid",
329
+ "methodName": "validityChanged"
330
+ }, {
331
+ "propName": "emitValue",
332
+ "methodName": "emitValueHandler"
333
+ }];
334
+ }
335
+ static get listeners() {
336
+ return [{
337
+ "name": "click",
338
+ "method": "handleClickOutside",
339
+ "target": "document",
340
+ "capture": false,
341
+ "passive": false
342
+ }];
343
+ }
344
+ }
@@ -0,0 +1,101 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .date {
10
+ font-family: "Roboto";
11
+ font-style: normal;
12
+ }
13
+ .date__wrapper {
14
+ position: relative;
15
+ width: 100%;
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 5px;
19
+ height: 100%;
20
+ }
21
+ .date__wrapper--autofilled {
22
+ pointer-events: none;
23
+ }
24
+ .date__wrapper--autofilled .date__label {
25
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
26
+ }
27
+ .date__wrapper--autofilled .date__input::part(input-field) {
28
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
29
+ }
30
+ .date__label {
31
+ font-family: inherit;
32
+ font-style: normal;
33
+ font-weight: 500;
34
+ font-size: 16px;
35
+ line-height: 20px;
36
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
37
+ }
38
+ .date__label--required::after {
39
+ content: "*";
40
+ font-family: inherit;
41
+ color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
42
+ margin-left: 2px;
43
+ }
44
+ .date__input {
45
+ border: none;
46
+ width: inherit;
47
+ position: relative;
48
+ }
49
+ .date__input[focused]::part(input-field) {
50
+ border-color: var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));
51
+ }
52
+ .date__input[invalid]::part(input-field) {
53
+ border: 1px solid var(--emw--color-error, var(--emw--color-red, #ed0909));
54
+ }
55
+ .date__input::part(input-field) {
56
+ border-radius: 4px;
57
+ background-color: var(--emw--color-white, #FFFFFF);
58
+ border: 1px solid var(--emw--color-gray-100, #E6E6E6);
59
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
60
+ font-family: inherit;
61
+ font-style: normal;
62
+ font-size: 16px;
63
+ font-weight: 300;
64
+ line-height: 1.5;
65
+ padding: 0;
66
+ height: 44px;
67
+ }
68
+ .date__input > input {
69
+ padding: 5px 15px;
70
+ }
71
+ .date__input::part(toggle-button) {
72
+ position: relative;
73
+ right: 10px;
74
+ }
75
+ .date__error-message {
76
+ position: absolute;
77
+ top: calc(100% + 5px);
78
+ left: 0;
79
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
80
+ }
81
+ .date__tooltip-icon {
82
+ position: absolute;
83
+ right: 0;
84
+ bottom: 10px;
85
+ }
86
+ .date__tooltip {
87
+ position: absolute;
88
+ bottom: 35px;
89
+ right: 10px;
90
+ background-color: var(--emw--color-white, #FFFFFF);
91
+ border: 1px solid var(--emw--color-gray-100, #E6E6E6);
92
+ color: var(--emw--registration-typography, var(--emw--color-black, #000000));
93
+ padding: 10px;
94
+ border-radius: 5px;
95
+ opacity: 0;
96
+ transition: opacity 0.3s ease-in-out;
97
+ z-index: 10;
98
+ }
99
+ .date__tooltip.visible {
100
+ opacity: 1;
101
+ }