@everymatrix/general-input 0.0.1 → 1.0.69

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 (141) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +20007 -16663
  3. package/dist/cjs/general-input.cjs.entry.js +67 -40
  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 +16 -0
  7. package/dist/cjs/loader.cjs.js +7 -13
  8. package/dist/cjs/locale.utils-7a3dfe2f.js +128 -0
  9. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +91 -0
  10. package/dist/cjs/tooltipIcon-7e9ee226.js +5 -0
  11. package/dist/collection/collection-manifest.json +14 -13
  12. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +26 -6
  13. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +372 -335
  14. package/dist/collection/components/checkbox-input/checkbox-input.css +16 -10
  15. package/dist/collection/components/checkbox-input/checkbox-input.js +325 -310
  16. package/dist/collection/components/date-input/date-input.css +35 -19
  17. package/dist/collection/components/date-input/date-input.js +401 -328
  18. package/dist/collection/components/email-input/email-input.css +30 -18
  19. package/dist/collection/components/email-input/email-input.js +405 -365
  20. package/dist/collection/components/general-input/general-input.css +1 -0
  21. package/dist/collection/components/general-input/general-input.js +374 -291
  22. package/dist/collection/components/general-input/index.js +1 -0
  23. package/dist/collection/components/number-input/number-input.css +28 -16
  24. package/dist/collection/components/number-input/number-input.js +371 -334
  25. package/dist/collection/components/password-input/password-input.css +105 -11
  26. package/dist/collection/components/password-input/password-input.js +518 -378
  27. package/dist/collection/components/radio-input/radio-input.css +4 -4
  28. package/dist/collection/components/radio-input/radio-input.js +301 -287
  29. package/dist/collection/components/select-input/select-input.css +47 -19
  30. package/dist/collection/components/select-input/select-input.js +428 -398
  31. package/dist/collection/components/tel-input/tel-input.css +52 -23
  32. package/dist/collection/components/tel-input/tel-input.js +441 -404
  33. package/dist/collection/components/text-input/text-input.css +33 -18
  34. package/dist/collection/components/text-input/text-input.js +446 -389
  35. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
  36. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +336 -0
  37. package/dist/collection/index.js +16 -0
  38. package/dist/collection/utils/locale.utils.js +118 -21
  39. package/dist/collection/utils/tooltipIcon.svg +4 -4
  40. package/dist/collection/utils/utils.js +3 -3
  41. package/dist/esm/app-globals-0f993ce5.js +3 -0
  42. package/dist/esm/checkbox-group-input_10.entry.js +20007 -16663
  43. package/dist/esm/general-input.entry.js +67 -40
  44. package/dist/esm/general-input.js +14 -11
  45. package/dist/esm/index-514fda47.js +1287 -0
  46. package/dist/esm/index.js +16 -1
  47. package/dist/esm/loader.js +7 -13
  48. package/dist/esm/locale.utils-21605050.js +125 -0
  49. package/dist/esm/toggle-checkbox-input.entry.js +87 -0
  50. package/dist/esm/tooltipIcon-0a5a06a2.js +3 -0
  51. package/dist/general-input/general-input.esm.js +1 -1
  52. package/dist/general-input/index.esm.js +1 -0
  53. package/dist/general-input/p-03e81c11.js +2 -0
  54. package/dist/general-input/p-2dccd0bf.js +1 -0
  55. package/dist/general-input/p-34939f14.entry.js +1 -0
  56. package/dist/general-input/p-b32f19c2.entry.js +5430 -0
  57. package/dist/general-input/p-c43bb82e.entry.js +1 -0
  58. package/dist/general-input/p-cfe9eb31.js +1 -0
  59. package/dist/general-input/p-e1255160.js +1 -0
  60. package/dist/stencil.config.dev.js +17 -0
  61. package/dist/stencil.config.js +14 -19
  62. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  63. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  64. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +69 -67
  65. package/dist/types/components/checkbox-input/checkbox-input.d.ts +61 -60
  66. package/dist/types/components/date-input/date-input.d.ts +79 -65
  67. package/dist/types/components/email-input/email-input.d.ts +76 -73
  68. package/dist/types/components/general-input/general-input.d.ts +72 -57
  69. package/dist/types/components/general-input/index.d.ts +1 -0
  70. package/dist/types/components/number-input/number-input.d.ts +70 -66
  71. package/dist/types/components/password-input/password-input.d.ts +87 -75
  72. package/dist/types/components/radio-input/radio-input.d.ts +55 -55
  73. package/dist/types/components/select-input/select-input.d.ts +78 -77
  74. package/dist/types/components/tel-input/tel-input.d.ts +84 -80
  75. package/dist/types/components/text-input/text-input.d.ts +81 -78
  76. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
  77. package/dist/types/components.d.ts +331 -25
  78. package/dist/types/stencil-public-runtime.d.ts +142 -33
  79. package/dist/types/utils/locale.utils.d.ts +13 -1
  80. package/dist/types/utils/types.d.ts +58 -47
  81. package/loader/cdn.js +1 -3
  82. package/loader/index.cjs.js +1 -3
  83. package/loader/index.d.ts +13 -1
  84. package/loader/index.es2017.js +1 -3
  85. package/loader/index.js +1 -3
  86. package/loader/package.json +1 -0
  87. package/package.json +9 -9
  88. package/dist/cjs/index-1768513d.js +0 -1286
  89. package/dist/components/active-mixin.js +0 -975
  90. package/dist/components/checkbox-group-input.d.ts +0 -11
  91. package/dist/components/checkbox-group-input.js +0 -6
  92. package/dist/components/checkbox-group-input2.js +0 -5793
  93. package/dist/components/checkbox-input.d.ts +0 -11
  94. package/dist/components/checkbox-input.js +0 -6
  95. package/dist/components/checkbox-input2.js +0 -127
  96. package/dist/components/date-input.d.ts +0 -11
  97. package/dist/components/date-input.js +0 -6
  98. package/dist/components/date-input2.js +0 -5182
  99. package/dist/components/email-input.d.ts +0 -11
  100. package/dist/components/email-input.js +0 -6
  101. package/dist/components/email-input2.js +0 -150
  102. package/dist/components/field-mixin.js +0 -12712
  103. package/dist/components/general-input.d.ts +0 -11
  104. package/dist/components/general-input.js +0 -140
  105. package/dist/components/index.d.ts +0 -26
  106. package/dist/components/index.js +0 -1
  107. package/dist/components/input-field-shared-styles.js +0 -1067
  108. package/dist/components/number-input.d.ts +0 -11
  109. package/dist/components/number-input.js +0 -6
  110. package/dist/components/number-input2.js +0 -139
  111. package/dist/components/password-input.d.ts +0 -11
  112. package/dist/components/password-input.js +0 -6
  113. package/dist/components/password-input2.js +0 -879
  114. package/dist/components/pattern-mixin.js +0 -85
  115. package/dist/components/radio-input.d.ts +0 -11
  116. package/dist/components/radio-input.js +0 -6
  117. package/dist/components/radio-input2.js +0 -115
  118. package/dist/components/select-input.d.ts +0 -11
  119. package/dist/components/select-input.js +0 -6
  120. package/dist/components/select-input2.js +0 -166
  121. package/dist/components/tel-input.d.ts +0 -11
  122. package/dist/components/tel-input.js +0 -6
  123. package/dist/components/tel-input2.js +0 -178
  124. package/dist/components/text-input.d.ts +0 -11
  125. package/dist/components/text-input.js +0 -6
  126. package/dist/components/text-input2.js +0 -157
  127. package/dist/components/tooltipIcon.js +0 -30
  128. package/dist/components/vaadin-button.js +0 -461
  129. package/dist/components/vaadin-combo-box.js +0 -4329
  130. package/dist/components/virtual-keyboard-controller.js +0 -2693
  131. package/dist/esm/index-7e24a6f1.js +0 -1259
  132. package/dist/esm/polyfills/core-js.js +0 -11
  133. package/dist/esm/polyfills/css-shim.js +0 -1
  134. package/dist/esm/polyfills/dom.js +0 -79
  135. package/dist/esm/polyfills/es5-html-element.js +0 -1
  136. package/dist/esm/polyfills/index.js +0 -34
  137. package/dist/esm/polyfills/system.js +0 -6
  138. package/dist/general-input/p-61d76ec3.entry.js +0 -1
  139. package/dist/general-input/p-a79eb0a3.entry.js +0 -4413
  140. package/dist/general-input/p-fb647820.js +0 -1
  141. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -2
@@ -0,0 +1,82 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .togglecheckbox {
10
+ font-family: "Roboto";
11
+ font-style: normal;
12
+ font-size: 15px;
13
+ }
14
+ .togglecheckbox__wrapper {
15
+ position: relative;
16
+ }
17
+ .togglecheckbox__wrapper--flex {
18
+ display: flex;
19
+ gap: 10px;
20
+ align-items: baseline;
21
+ }
22
+ .togglecheckbox__wrapper--relative {
23
+ position: relative;
24
+ display: inline;
25
+ }
26
+ .togglecheckbox__input {
27
+ transform: scale(1.307, 1.307);
28
+ margin-left: 2px;
29
+ accent-color: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
30
+ }
31
+ .togglecheckbox__label {
32
+ font-style: inherit;
33
+ font-family: inherit;
34
+ font-weight: 400;
35
+ font-size: 16px;
36
+ color: var(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));
37
+ line-height: 1.5;
38
+ cursor: pointer;
39
+ padding: 0;
40
+ }
41
+ .togglecheckbox__label-text {
42
+ font-size: 16px;
43
+ }
44
+ .togglecheckbox__label a {
45
+ color: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
46
+ }
47
+ .togglecheckbox__error-message {
48
+ position: absolute;
49
+ top: calc(100% + 5px);
50
+ left: 0;
51
+ color: var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));
52
+ }
53
+ .togglecheckbox__tooltip-icon {
54
+ width: 16px;
55
+ height: auto;
56
+ }
57
+ .togglecheckbox__tooltip {
58
+ position: absolute;
59
+ top: 0;
60
+ right: 0;
61
+ background-color: var(--emfe-w-color-white, #FFFFFF);
62
+ border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
63
+ color: var(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));
64
+ padding: 10px;
65
+ border-radius: 5px;
66
+ opacity: 0;
67
+ transition: opacity 0.3s ease-in-out;
68
+ z-index: 10;
69
+ }
70
+ .togglecheckbox__tooltip.visible {
71
+ opacity: 1;
72
+ }
73
+ .togglecheckbox__fields-wrapper {
74
+ margin-top: 40px;
75
+ display: flex;
76
+ flex-direction: column;
77
+ gap: 40px;
78
+ }
79
+
80
+ .hidden {
81
+ display: none;
82
+ }
@@ -0,0 +1,336 @@
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.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.options = undefined;
16
+ this.autofilled = undefined;
17
+ this.tooltip = undefined;
18
+ this.validation = undefined;
19
+ this.language = undefined;
20
+ this.emitValue = undefined;
21
+ this.clientStyling = '';
22
+ this.errorMessage = undefined;
23
+ this.isValid = undefined;
24
+ this.limitStylingAppends = false;
25
+ this.showTooltip = false;
26
+ this.showFields = undefined;
27
+ }
28
+ validityStateHandler(inputStateEvent) {
29
+ this.sendValidityState.emit(inputStateEvent);
30
+ }
31
+ valueHandler(inputValueEvent) {
32
+ this.sendInputValue.emit(inputValueEvent);
33
+ }
34
+ handleClickOutside(event) {
35
+ if (event.composedPath()[0] === this.tooltipIconReference)
36
+ return;
37
+ if (event.composedPath()[0] !== this.tooltipReference)
38
+ this.showTooltip = false;
39
+ }
40
+ componentDidRender() {
41
+ // start custom styling area
42
+ if (!this.limitStylingAppends && this.stylingContainer) {
43
+ if (this.clientStyling)
44
+ this.setClientStyling();
45
+ this.limitStylingAppends = true;
46
+ }
47
+ // end custom styling area
48
+ }
49
+ handleClick() {
50
+ this.showFields = this.checkboxReference.checked;
51
+ this.errorMessage = this.setErrorMessage();
52
+ this.isValid = this.setValidity();
53
+ }
54
+ setValidity() {
55
+ return this.checkboxReference.validity.valid;
56
+ }
57
+ setErrorMessage() {
58
+ if (this.checkboxReference.validity.valueMissing) {
59
+ return translate('requiredError', this.language);
60
+ }
61
+ }
62
+ renderLabel() {
63
+ return (h("label", { class: 'togglecheckbox__label', htmlFor: `${this.name}__input` }, h("div", { class: 'togglecheckbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
64
+ }
65
+ renderTooltip() {
66
+ if (this.showTooltip) {
67
+ return (h("div", { class: `togglecheckbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
68
+ }
69
+ return null;
70
+ }
71
+ render() {
72
+ return h("div", { key: 'd5a645fdc3409f4efdc3319c07cded8c1931991c', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'c18e410777502b3609dd0872487cc8281e1adf25', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '7c2f6204300b5c046c9ad909089619f39f6cda83', 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: '24e57e5a5dd20e5f646a69c4fa0c0bbbe38aba1f', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: 'eea41bc49a5c572d86a595880d4c60093f15156e', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
73
+ h("img", { key: 'bb093e1c928cf87ea69a2c49a784395bd82e542e', class: 'togglecheckbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: 'eda4df7b1669eca99d4013877e2ef082ea54984c', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
74
+ 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 });
75
+ })));
76
+ }
77
+ static get is() { return "toggle-checkbox-input"; }
78
+ static get encapsulation() { return "shadow"; }
79
+ static get originalStyleUrls() {
80
+ return {
81
+ "$": ["toggle-checkbox-input.scss"]
82
+ };
83
+ }
84
+ static get styleUrls() {
85
+ return {
86
+ "$": ["toggle-checkbox-input.css"]
87
+ };
88
+ }
89
+ static get properties() {
90
+ return {
91
+ "name": {
92
+ "type": "string",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "string",
96
+ "resolved": "string",
97
+ "references": {}
98
+ },
99
+ "required": false,
100
+ "optional": false,
101
+ "docs": {
102
+ "tags": [],
103
+ "text": "Name of the input."
104
+ },
105
+ "attribute": "name",
106
+ "reflect": true
107
+ },
108
+ "displayName": {
109
+ "type": "string",
110
+ "mutable": false,
111
+ "complexType": {
112
+ "original": "string",
113
+ "resolved": "string",
114
+ "references": {}
115
+ },
116
+ "required": false,
117
+ "optional": false,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": "Name of input to be shown to the user."
121
+ },
122
+ "attribute": "display-name",
123
+ "reflect": true
124
+ },
125
+ "defaultValue": {
126
+ "type": "string",
127
+ "mutable": false,
128
+ "complexType": {
129
+ "original": "string",
130
+ "resolved": "string",
131
+ "references": {}
132
+ },
133
+ "required": false,
134
+ "optional": false,
135
+ "docs": {
136
+ "tags": [],
137
+ "text": "Default value for the input."
138
+ },
139
+ "attribute": "default-value",
140
+ "reflect": true,
141
+ "defaultValue": "''"
142
+ },
143
+ "options": {
144
+ "type": "unknown",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "RegCfgContentField[]",
148
+ "resolved": "RegCfgContentField[]",
149
+ "references": {
150
+ "RegCfgContentField": {
151
+ "location": "import",
152
+ "path": "../../utils/types",
153
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::RegCfgContentField"
154
+ }
155
+ }
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Options of the input."
162
+ }
163
+ },
164
+ "autofilled": {
165
+ "type": "boolean",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "boolean",
169
+ "resolved": "boolean",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": "Boolean. Determines if input should be readonly."
177
+ },
178
+ "attribute": "autofilled",
179
+ "reflect": true
180
+ },
181
+ "tooltip": {
182
+ "type": "string",
183
+ "mutable": false,
184
+ "complexType": {
185
+ "original": "string",
186
+ "resolved": "string",
187
+ "references": {}
188
+ },
189
+ "required": false,
190
+ "optional": false,
191
+ "docs": {
192
+ "tags": [],
193
+ "text": "Tooltip text."
194
+ },
195
+ "attribute": "tooltip",
196
+ "reflect": true
197
+ },
198
+ "validation": {
199
+ "type": "unknown",
200
+ "mutable": false,
201
+ "complexType": {
202
+ "original": "ValidationSchema",
203
+ "resolved": "ValidationSchema",
204
+ "references": {
205
+ "ValidationSchema": {
206
+ "location": "import",
207
+ "path": "../../utils/types",
208
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::ValidationSchema"
209
+ }
210
+ }
211
+ },
212
+ "required": false,
213
+ "optional": false,
214
+ "docs": {
215
+ "tags": [],
216
+ "text": "Object of validation rules for the input."
217
+ }
218
+ },
219
+ "language": {
220
+ "type": "string",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "string",
224
+ "resolved": "string",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": false,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": "Currently selected language."
232
+ },
233
+ "attribute": "language",
234
+ "reflect": true
235
+ },
236
+ "emitValue": {
237
+ "type": "boolean",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "boolean",
241
+ "resolved": "boolean",
242
+ "references": {}
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
249
+ },
250
+ "attribute": "emit-value",
251
+ "reflect": true
252
+ },
253
+ "clientStyling": {
254
+ "type": "string",
255
+ "mutable": false,
256
+ "complexType": {
257
+ "original": "string",
258
+ "resolved": "string",
259
+ "references": {}
260
+ },
261
+ "required": false,
262
+ "optional": false,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": "Client custom styling via inline style"
266
+ },
267
+ "attribute": "client-styling",
268
+ "reflect": true,
269
+ "defaultValue": "''"
270
+ }
271
+ };
272
+ }
273
+ static get states() {
274
+ return {
275
+ "errorMessage": {},
276
+ "isValid": {},
277
+ "limitStylingAppends": {},
278
+ "showTooltip": {},
279
+ "showFields": {}
280
+ };
281
+ }
282
+ static get events() {
283
+ return [{
284
+ "method": "sendValidityState",
285
+ "name": "sendValidityState",
286
+ "bubbles": true,
287
+ "cancelable": true,
288
+ "composed": true,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": ""
292
+ },
293
+ "complexType": {
294
+ "original": "InputStateEvent",
295
+ "resolved": "InputStateEvent",
296
+ "references": {
297
+ "InputStateEvent": {
298
+ "location": "import",
299
+ "path": "../../utils/types",
300
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputStateEvent"
301
+ }
302
+ }
303
+ }
304
+ }, {
305
+ "method": "sendInputValue",
306
+ "name": "sendInputValue",
307
+ "bubbles": true,
308
+ "cancelable": true,
309
+ "composed": true,
310
+ "docs": {
311
+ "tags": [],
312
+ "text": ""
313
+ },
314
+ "complexType": {
315
+ "original": "InputValueEvent",
316
+ "resolved": "InputValueEvent",
317
+ "references": {
318
+ "InputValueEvent": {
319
+ "location": "import",
320
+ "path": "../../utils/types",
321
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputValueEvent"
322
+ }
323
+ }
324
+ }
325
+ }];
326
+ }
327
+ static get listeners() {
328
+ return [{
329
+ "name": "click",
330
+ "method": "handleClickOutside",
331
+ "target": "document",
332
+ "capture": false,
333
+ "passive": false
334
+ }];
335
+ }
336
+ }
@@ -1 +1,17 @@
1
+ function safeDecorator(fn) {
2
+ // eslint-disable-next-line func-names
3
+ return function (...args) {
4
+ try {
5
+ return fn.apply(this, args);
6
+ }
7
+ catch (error) {
8
+ if (error instanceof DOMException &&
9
+ error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')) {
10
+ return false;
11
+ }
12
+ throw error;
13
+ }
14
+ };
15
+ }
16
+ customElements.define = safeDecorator(customElements.define);
1
17
  export * from './components';
@@ -1,26 +1,123 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const TRANSLATIONS = {
3
- "en": {
4
- "dateError": 'The selected date should be between {min} and {max}',
5
- "numberLengthError": 'The number should be between {min} and {max}',
6
- "lengthError": `The length should be between {minLength} and {maxLength}`,
7
- "requiredError": 'This input is required.',
8
- },
9
- "hu": {
10
- "dateError": 'A választott dátumnak {min} és {max} között kell lennie',
11
- "numberLengthError": 'A számnak {min} és {max} között kell lennie',
12
- "lengthError": `A hossznak {minLength} és {maxLength} között kell lennie`,
13
- "requiredError": 'Ez a beviteli mező kötelező.',
14
- }
2
+ export const TRANSLATIONS = {
3
+ "en": {
4
+ "dateError": 'The selected date should be between {min} and {max}',
5
+ "dateError2": 'The selected date is not within the accepted range',
6
+ "numberLengthError": 'The number should be between {min} and {max}',
7
+ "lengthError": `The length should be between {minLength} and {maxLength}`,
8
+ "requiredError": 'This input is required.',
9
+ "invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
10
+ "passwordStrength": "Password strength",
11
+ "passwordStrengthWeak": "is not adequate",
12
+ "passwordStrengthStrong": "is adequate",
13
+ "SpecialCharactersNotAllowed": 'Should not contain special characters',
14
+ "InvalidEmailFormat": "Invalid email format.",
15
+ "EmailNotMatching": "Emails not matching!",
16
+ "PasswordNotMatching": "Passwords not matching",
17
+ "MustIncludeNumber": "include a number",
18
+ "MustContainCapital": "contain capital letters",
19
+ "MustIncludePunctation": "punctuation",
20
+ "OnlyNumbers": "Should contains only numbers."
21
+ },
22
+ "hu": {
23
+ "dateError": 'A választott dátumnak {min} és {max} között kell lennie',
24
+ "numberLengthError": 'A számnak {min} és {max} között kell lennie',
25
+ "lengthError": `A hossznak {minLength} és {maxLength} között kell lennie`,
26
+ "requiredError": 'Ez a beviteli mező kötelező.',
27
+ "invalidOriginalPasswordError": "Initial password field does not validate all criteria.",
28
+ "passwordStrength": "Jelszó erőssége",
29
+ "passwordStrengthWeak": "nem megfelelő",
30
+ "passwordStrengthStrong": "megfelelő",
31
+ "SpecialCharactersNotAllowed": 'Nem tartalmazhat speciális karaktereket',
32
+ "InvalidEmailFormat": "Érvénytelen e-mail formátum.",
33
+ "EmailNotMatching": "Az e-mailek nem egyeznek!",
34
+ "PasswordNotMatching": "A jelszavak nem egyeznek",
35
+ "MustIncludeNumber": "tartalmaznia kell egy számot",
36
+ "MustContainCapital": "nagybetűket kell tartalmaznia",
37
+ "MustIncludePunctation": "írásjelet",
38
+ "OnlyNumbers": "Csak számokat kell tartalmaznia."
39
+ },
40
+ "hr": {
41
+ "dateError": 'Odabrani datum treba biti između {min} i {max}',
42
+ "dateError2": 'Odabrani datum nije unutar prihvaćenog raspona',
43
+ "numberLengthError": 'Broj bi trebao biti između {min} i {max}',
44
+ "lengthError": `Duljina bi trebala biti između {minLength} i {maxLength}`,
45
+ "requiredError": 'Ovaj unos je obavezan.',
46
+ "invalidOriginalPasswordError": "Polje početne lozinke ne potvrđuje sve kriterije",
47
+ "passwordStrength": "Jačina zaporke",
48
+ "passwordStrengthWeak": "nije adekvatno",
49
+ "passwordStrengthStrong": "je adekvatan",
50
+ "SpecialCharactersNotAllowed": 'Ne smije sadržavati posebne znakove',
51
+ "InvalidEmailFormat": "Nevažeći format e-maila",
52
+ "EmailNotMatching": "E-mailovi se ne podudaraju!",
53
+ "PasswordNotMatching": "Lozinke se ne podudaraju",
54
+ "MustIncludeNumber": "uključiti broj",
55
+ "MustContainCapital": "sadrže velika slova",
56
+ "MustIncludePunctation": "interpunkcija",
57
+ "OnlyNumbers": "Treba sadržavati samo brojeve."
58
+ },
59
+ 'pt-br': {
60
+ "dateError": "A data selecionada deve estar entre {min} e {max}",
61
+ "dateError2": "A data selecionada não está dentro de um intervalo válido",
62
+ "numberLengthError": "O número deve estar entre {min} e {max}",
63
+ "lengthError": "O comprimento deve estar entre {minLength} e {maxLength}",
64
+ "requiredError": "Este campo é obrigatório",
65
+ "invalidOriginalPasswordError": "O campo de senha inicial não faz parte dos critérios válidos",
66
+ "PasswordStrength": "Força da senha",
67
+ "PasswordStrengthWeak": "Não é adequado",
68
+ "PasswordStrengthStrong": "é apropriado",
69
+ "SpecialCharactersNotAllowed": "Não deve conter caracteres especiais",
70
+ "InvalidEmailFormat": "Formato de email inválido",
71
+ "EmailNotMatching": "E-mail não corresponde",
72
+ "PasswordNotMatching": "Senha não corresponde",
73
+ "MustIncludeNumber": "inclui um número",
74
+ "MustContainCapital": "contém letras maiúsculas",
75
+ "MustIncludePunctation": "pontuação",
76
+ "OnlyNumbers": "Deve conter apenas números"
77
+ },
78
+ 'es-mx': {
79
+ "dateError": "La fecha seleccionada debe ser entre {min} y {max}",
80
+ "dateError2": "La fecha seleccionada no está dentro de un rango válido",
81
+ "numberLengthError": "El número debe ser entre {min} y {max}",
82
+ "lengthError": "La longitud deber ser entre {minLength} y {maxLength}",
83
+ "requiredError": "Este campo es requerido",
84
+ "invalidOriginalPasswordError": "El campo de contraseña inicial no es parte del criterio válido",
85
+ "PasswordStrength": "La fortaleza de la contraseña",
86
+ "PasswordStrengthWeak": "no es adecuada",
87
+ "PasswordStrengthStrong": "es adecuada",
88
+ "SpecialCharactersNotAllowed": "No debe contener caracteres especiales",
89
+ "InvalidEmailFormat": "Formato inválido de correo",
90
+ "EmailNotMatching": "El correo electrónico no coincide",
91
+ "PasswordNotMatching": "La contraseña no coincide",
92
+ "MustIncludeNumber": "incluye un número",
93
+ "MustContainCapital": "contiene mayúsculas",
94
+ "MustIncludePunctation": "puntuación",
95
+ "OnlyNumbers": "Solo debe contener números"
96
+ }
15
97
  };
16
98
  export const translate = (key, customLang, values) => {
17
- const lang = customLang;
18
- let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
19
- if (values !== undefined) {
20
- for (const [key, value] of Object.entries(values.values)) {
21
- const regex = new RegExp(`{${key}}`, 'g');
22
- translation = translation.replace(regex, value);
99
+ const lang = customLang;
100
+ let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
101
+ if (values !== undefined) {
102
+ for (const [key, value] of Object.entries(values.values)) {
103
+ const regex = new RegExp(`{${key}}`, 'g');
104
+ translation = translation.replace(regex, value);
105
+ }
23
106
  }
24
- }
25
- return translation;
107
+ return translation;
108
+ };
109
+ export const getTranslations = (url) => {
110
+ // fetch url, get the data, replace the TRANSLATIONS content
111
+ return new Promise((resolve) => {
112
+ fetch(url)
113
+ .then((res) => res.json())
114
+ .then((data) => {
115
+ Object.keys(data).forEach((item) => {
116
+ for (let key in data[item]) {
117
+ TRANSLATIONS[item][key] = data[item][key];
118
+ }
119
+ });
120
+ resolve(true);
121
+ });
122
+ });
26
123
  };
@@ -1,5 +1,5 @@
1
- <svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect x="11.9099" y="16.15" width="1.82" height="7.60001" transform="rotate(-180 11.9099 16.15)" fill="#2B2D3F"/>
3
- <rect x="11.9099" y="6.65002" width="1.82" height="1.90001" transform="rotate(-180 11.9099 6.65002)" fill="#2B2D3F"/>
4
- <path fill-rule="evenodd" clip-rule="evenodd" d="M0.98999 10.45C0.98999 4.67768 5.47197 0 11 0C16.528 0 21.01 4.67768 21.01 10.45C21.01 16.221 16.528 20.9 11 20.9C5.47197 20.9 0.98999 16.221 0.98999 10.45ZM2.80999 10.4506C2.80999 15.1723 6.47677 19 11 19C15.522 19 19.19 15.1723 19.19 10.4506C19.19 5.72891 15.522 1.90001 11 1.90001C6.47677 1.90001 2.80999 5.72891 2.80999 10.4506Z" fill="#2B2D3F"/>
1
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="6" cy="6" r="5.5" stroke="#979797"/>
3
+ <rect x="5" y="5" width="2" height="5" fill="#979797"/>
4
+ <circle cx="6" cy="3" r="1" fill="#979797"/>
5
5
  </svg>
@@ -1,5 +1,5 @@
1
1
  export function formatName(name) {
2
- return name
3
- .replace(/([A-Z])/g, ' $1')
4
- .replace(/^./, function (str) { return str.toUpperCase(); });
2
+ return name
3
+ .replace(/([A-Z])/g, ' $1')
4
+ .replace(/^./, function (str) { return str.toUpperCase(); });
5
5
  }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };