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