@everymatrix/general-input 1.32.4 → 1.33.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 (136) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +36077 -0
  2. package/dist/cjs/general-input.cjs.entry.js +75 -0
  3. package/dist/cjs/general-input.cjs.js +19 -0
  4. package/dist/cjs/index-132a0774.js +1327 -0
  5. package/dist/cjs/index.cjs.js +18 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/cjs/locale.utils-cef1d3b6.js +128 -0
  8. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +85 -0
  9. package/dist/cjs/tooltipIcon-092a795f.js +5 -0
  10. package/dist/collection/collection-manifest.json +23 -0
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +82 -0
  12. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +366 -0
  13. package/dist/collection/components/checkbox-input/checkbox-input.css +68 -0
  14. package/dist/collection/components/checkbox-input/checkbox-input.js +324 -0
  15. package/dist/collection/components/date-input/date-input.css +101 -0
  16. package/dist/collection/components/date-input/date-input.js +396 -0
  17. package/dist/collection/components/email-input/email-input.css +95 -0
  18. package/dist/collection/components/email-input/email-input.js +403 -0
  19. package/dist/collection/components/general-input/general-input.css +4 -0
  20. package/dist/collection/components/general-input/general-input.js +373 -0
  21. package/dist/collection/components/number-input/number-input.css +102 -0
  22. package/dist/collection/components/number-input/number-input.js +368 -0
  23. package/dist/collection/components/password-input/password-input.css +182 -0
  24. package/dist/collection/components/password-input/password-input.js +527 -0
  25. package/dist/collection/components/radio-input/radio-input.css +43 -0
  26. package/dist/collection/components/radio-input/radio-input.js +297 -0
  27. package/dist/collection/components/select-input/select-input.css +122 -0
  28. package/dist/collection/components/select-input/select-input.js +429 -0
  29. package/dist/collection/components/tel-input/tel-input.css +145 -0
  30. package/dist/collection/components/tel-input/tel-input.js +440 -0
  31. package/dist/collection/components/text-input/text-input.css +98 -0
  32. package/dist/collection/components/text-input/text-input.js +448 -0
  33. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
  34. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +324 -0
  35. package/dist/collection/index.js +17 -0
  36. package/dist/collection/utils/locale.utils.js +123 -0
  37. package/dist/collection/utils/tooltipIcon.svg +5 -0
  38. package/dist/collection/utils/types.js +1 -0
  39. package/dist/collection/utils/utils.js +5 -0
  40. package/dist/components/active-mixin.js +975 -0
  41. package/dist/components/checkbox-group-input.d.ts +11 -0
  42. package/dist/components/checkbox-group-input.js +6 -0
  43. package/dist/components/checkbox-group-input2.js +1078 -0
  44. package/dist/components/checkbox-input.d.ts +11 -0
  45. package/dist/components/checkbox-input.js +6 -0
  46. package/dist/components/checkbox-input2.js +129 -0
  47. package/dist/components/date-input.d.ts +11 -0
  48. package/dist/components/date-input.js +6 -0
  49. package/dist/components/date-input2.js +11556 -0
  50. package/dist/components/email-input.d.ts +11 -0
  51. package/dist/components/email-input.js +6 -0
  52. package/dist/components/email-input2.js +171 -0
  53. package/dist/components/field-mixin.js +12426 -0
  54. package/dist/components/general-input.d.ts +11 -0
  55. package/dist/components/general-input.js +6 -0
  56. package/dist/components/general-input2.js +341 -0
  57. package/dist/components/index.d.ts +26 -0
  58. package/dist/components/index.js +18 -0
  59. package/dist/components/input-field-shared-styles.js +1211 -0
  60. package/dist/components/number-input.d.ts +11 -0
  61. package/dist/components/number-input.js +6 -0
  62. package/dist/components/number-input2.js +158 -0
  63. package/dist/components/password-input.d.ts +11 -0
  64. package/dist/components/password-input.js +6 -0
  65. package/dist/components/password-input2.js +1041 -0
  66. package/dist/components/radio-input.d.ts +11 -0
  67. package/dist/components/radio-input.js +6 -0
  68. package/dist/components/radio-input2.js +114 -0
  69. package/dist/components/select-input.d.ts +11 -0
  70. package/dist/components/select-input.js +6 -0
  71. package/dist/components/select-input2.js +183 -0
  72. package/dist/components/tel-input.d.ts +11 -0
  73. package/dist/components/tel-input.js +6 -0
  74. package/dist/components/tel-input2.js +197 -0
  75. package/dist/components/text-input.d.ts +11 -0
  76. package/dist/components/text-input.js +6 -0
  77. package/dist/components/text-input2.js +199 -0
  78. package/dist/components/toggle-checkbox-input.d.ts +11 -0
  79. package/dist/components/toggle-checkbox-input.js +6 -0
  80. package/dist/components/tooltipIcon.js +127 -0
  81. package/dist/components/vaadin-button.js +490 -0
  82. package/dist/components/vaadin-combo-box.js +4512 -0
  83. package/dist/components/virtual-keyboard-controller.js +2001 -0
  84. package/dist/esm/checkbox-group-input_10.entry.js +36064 -0
  85. package/dist/esm/general-input.entry.js +71 -0
  86. package/dist/esm/general-input.js +17 -0
  87. package/dist/esm/index-db76d5b5.js +1299 -0
  88. package/dist/esm/index.js +16 -0
  89. package/dist/esm/loader.js +17 -0
  90. package/dist/esm/locale.utils-de759721.js +125 -0
  91. package/dist/esm/polyfills/core-js.js +11 -0
  92. package/dist/esm/polyfills/css-shim.js +1 -0
  93. package/dist/esm/polyfills/dom.js +79 -0
  94. package/dist/esm/polyfills/es5-html-element.js +1 -0
  95. package/dist/esm/polyfills/index.js +34 -0
  96. package/dist/esm/polyfills/system.js +6 -0
  97. package/dist/esm/toggle-checkbox-input.entry.js +81 -0
  98. package/dist/esm/tooltipIcon-99c1c7b7.js +3 -0
  99. package/dist/general-input/general-input.esm.js +1 -0
  100. package/dist/general-input/index.esm.js +1 -0
  101. package/dist/general-input/p-10efdf3f.js +1 -0
  102. package/dist/general-input/p-613c3e00.entry.js +1 -0
  103. package/dist/general-input/p-660bcdd1.entry.js +1 -0
  104. package/dist/general-input/p-9b6b0396.entry.js +3646 -0
  105. package/dist/general-input/p-b408093e.js +1 -0
  106. package/dist/general-input/p-f4f4ccda.js +1 -0
  107. package/dist/index.cjs.js +1 -0
  108. package/dist/index.js +1 -0
  109. package/dist/stencil.config.js +22 -0
  110. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +2 -0
  111. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
  112. package/dist/types/components/checkbox-input/checkbox-input.d.ts +65 -0
  113. package/dist/types/components/date-input/date-input.d.ts +84 -0
  114. package/dist/types/components/email-input/email-input.d.ts +80 -0
  115. package/dist/types/components/general-input/general-input.d.ts +75 -0
  116. package/dist/types/components/number-input/number-input.d.ts +74 -0
  117. package/dist/types/components/password-input/password-input.d.ts +91 -0
  118. package/dist/types/components/radio-input/radio-input.d.ts +59 -0
  119. package/dist/types/components/select-input/select-input.d.ts +83 -0
  120. package/dist/types/components/tel-input/tel-input.d.ts +89 -0
  121. package/dist/types/components/text-input/text-input.d.ts +84 -0
  122. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
  123. package/dist/types/components.d.ts +1268 -0
  124. package/dist/types/index.d.ts +1 -0
  125. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  126. package/dist/types/utils/locale.utils.d.ts +17 -0
  127. package/dist/types/utils/types.d.ts +87 -0
  128. package/dist/types/utils/utils.d.ts +1 -0
  129. package/loader/cdn.js +3 -0
  130. package/loader/index.cjs.js +3 -0
  131. package/loader/index.d.ts +12 -0
  132. package/loader/index.es2017.js +3 -0
  133. package/loader/index.js +4 -0
  134. package/loader/package.json +10 -0
  135. package/package.json +2 -3
  136. package/LICENSE +0 -21
@@ -0,0 +1,324 @@
1
+ import { Component, h, Prop, State, Watch, Event, Listen } from '@stencil/core';
2
+ import { translate } from '../../utils/locale.utils';
3
+ import tooltipIcon from '../../utils/tooltipIcon.svg';
4
+ export class CheckboxInput {
5
+ constructor() {
6
+ /**
7
+ * Default value for the input.
8
+ */
9
+ this.defaultValue = '';
10
+ /**
11
+ * Client custom styling via inline style
12
+ */
13
+ this.clientStyling = '';
14
+ this.limitStylingAppends = false;
15
+ this.showTooltip = false;
16
+ this.value = '';
17
+ this.setClientStyling = () => {
18
+ let sheet = document.createElement('style');
19
+ sheet.innerHTML = this.clientStyling;
20
+ this.stylingContainer.prepend(sheet);
21
+ };
22
+ }
23
+ validityChanged() {
24
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
25
+ if (this.emitValue == true) {
26
+ this.valueHandler({ name: this.name, value: this.value });
27
+ }
28
+ }
29
+ validityStateHandler(inputStateEvent) {
30
+ this.sendValidityState.emit(inputStateEvent);
31
+ }
32
+ emitValueHandler(newValue) {
33
+ if (newValue == true && this.isValid) {
34
+ this.valueHandler({ name: this.name, value: this.value });
35
+ }
36
+ }
37
+ valueHandler(inputValueEvent) {
38
+ this.sendInputValue.emit(inputValueEvent);
39
+ }
40
+ handleClickOutside(event) {
41
+ if (event.composedPath()[0] === this.tooltipIconReference)
42
+ return;
43
+ if (event.composedPath()[0] !== this.tooltipReference)
44
+ this.showTooltip = false;
45
+ }
46
+ componentDidRender() {
47
+ // start custom styling area
48
+ if (!this.limitStylingAppends && this.stylingContainer) {
49
+ if (this.clientStyling)
50
+ this.setClientStyling();
51
+ this.limitStylingAppends = true;
52
+ }
53
+ // end custom styling area
54
+ }
55
+ componentDidLoad() {
56
+ if (this.defaultValue) {
57
+ this.value = this.defaultValue;
58
+ this.valueHandler({ name: this.name, value: this.value });
59
+ }
60
+ }
61
+ handleClick() {
62
+ this.value = this.inputReference.checked.toString();
63
+ this.errorMessage = this.setErrorMessage();
64
+ this.isValid = this.setValidity();
65
+ this.emitValueHandler(true);
66
+ }
67
+ setValidity() {
68
+ return this.inputReference.validity.valid;
69
+ }
70
+ setErrorMessage() {
71
+ if (this.inputReference.validity.valueMissing) {
72
+ return translate('requiredError', this.language);
73
+ }
74
+ }
75
+ renderLabel() {
76
+ return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input` },
77
+ h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
78
+ }
79
+ renderTooltip() {
80
+ if (this.showTooltip) {
81
+ return (h("div", { class: `checkbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
82
+ }
83
+ return null;
84
+ }
85
+ render() {
86
+ return h("div", { class: `checkbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el },
87
+ h("input", { class: 'checkbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.inputReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }),
88
+ this.renderLabel(),
89
+ h("small", { class: 'checkbox__error-message' }, this.errorMessage),
90
+ h("div", { class: 'checkbox__wrapper--relative' },
91
+ this.tooltip &&
92
+ h("img", { class: 'checkbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
93
+ this.renderTooltip()));
94
+ }
95
+ static get is() { return "checkbox-input"; }
96
+ static get encapsulation() { return "shadow"; }
97
+ static get originalStyleUrls() { return {
98
+ "$": ["checkbox-input.scss"]
99
+ }; }
100
+ static get styleUrls() { return {
101
+ "$": ["checkbox-input.css"]
102
+ }; }
103
+ static get properties() { return {
104
+ "name": {
105
+ "type": "string",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "string",
109
+ "resolved": "string",
110
+ "references": {}
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": "Name of the input."
117
+ },
118
+ "attribute": "name",
119
+ "reflect": true
120
+ },
121
+ "displayName": {
122
+ "type": "string",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "string",
126
+ "resolved": "string",
127
+ "references": {}
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": "Name of input to be shown to the user."
134
+ },
135
+ "attribute": "display-name",
136
+ "reflect": true
137
+ },
138
+ "defaultValue": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "Default value for the input."
151
+ },
152
+ "attribute": "default-value",
153
+ "reflect": true,
154
+ "defaultValue": "''"
155
+ },
156
+ "autofilled": {
157
+ "type": "boolean",
158
+ "mutable": false,
159
+ "complexType": {
160
+ "original": "boolean",
161
+ "resolved": "boolean",
162
+ "references": {}
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": "Boolean. Determines if input should be readonly."
169
+ },
170
+ "attribute": "autofilled",
171
+ "reflect": true
172
+ },
173
+ "tooltip": {
174
+ "type": "string",
175
+ "mutable": false,
176
+ "complexType": {
177
+ "original": "string",
178
+ "resolved": "string",
179
+ "references": {}
180
+ },
181
+ "required": false,
182
+ "optional": false,
183
+ "docs": {
184
+ "tags": [],
185
+ "text": "Tooltip text."
186
+ },
187
+ "attribute": "tooltip",
188
+ "reflect": true
189
+ },
190
+ "validation": {
191
+ "type": "unknown",
192
+ "mutable": false,
193
+ "complexType": {
194
+ "original": "ValidationSchema",
195
+ "resolved": "ValidationSchema",
196
+ "references": {
197
+ "ValidationSchema": {
198
+ "location": "import",
199
+ "path": "../../utils/types"
200
+ }
201
+ }
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "Object of validation rules for the input."
208
+ }
209
+ },
210
+ "language": {
211
+ "type": "string",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "string",
215
+ "resolved": "string",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "Currently selected language."
223
+ },
224
+ "attribute": "language",
225
+ "reflect": true
226
+ },
227
+ "emitValue": {
228
+ "type": "boolean",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "boolean",
232
+ "resolved": "boolean",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
240
+ },
241
+ "attribute": "emit-value",
242
+ "reflect": true
243
+ },
244
+ "clientStyling": {
245
+ "type": "string",
246
+ "mutable": false,
247
+ "complexType": {
248
+ "original": "string",
249
+ "resolved": "string",
250
+ "references": {}
251
+ },
252
+ "required": false,
253
+ "optional": false,
254
+ "docs": {
255
+ "tags": [],
256
+ "text": "Client custom styling via inline style"
257
+ },
258
+ "attribute": "client-styling",
259
+ "reflect": true,
260
+ "defaultValue": "''"
261
+ }
262
+ }; }
263
+ static get states() { return {
264
+ "errorMessage": {},
265
+ "isValid": {},
266
+ "limitStylingAppends": {},
267
+ "showTooltip": {}
268
+ }; }
269
+ static get events() { return [{
270
+ "method": "sendValidityState",
271
+ "name": "sendValidityState",
272
+ "bubbles": true,
273
+ "cancelable": true,
274
+ "composed": true,
275
+ "docs": {
276
+ "tags": [],
277
+ "text": ""
278
+ },
279
+ "complexType": {
280
+ "original": "InputStateEvent",
281
+ "resolved": "InputStateEvent",
282
+ "references": {
283
+ "InputStateEvent": {
284
+ "location": "import",
285
+ "path": "../../utils/types"
286
+ }
287
+ }
288
+ }
289
+ }, {
290
+ "method": "sendInputValue",
291
+ "name": "sendInputValue",
292
+ "bubbles": true,
293
+ "cancelable": true,
294
+ "composed": true,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": ""
298
+ },
299
+ "complexType": {
300
+ "original": "InputValueEvent",
301
+ "resolved": "InputValueEvent",
302
+ "references": {
303
+ "InputValueEvent": {
304
+ "location": "import",
305
+ "path": "../../utils/types"
306
+ }
307
+ }
308
+ }
309
+ }]; }
310
+ static get watchers() { return [{
311
+ "propName": "isValid",
312
+ "methodName": "validityChanged"
313
+ }, {
314
+ "propName": "emitValue",
315
+ "methodName": "emitValueHandler"
316
+ }]; }
317
+ static get listeners() { return [{
318
+ "name": "click",
319
+ "method": "handleClickOutside",
320
+ "target": "document",
321
+ "capture": false,
322
+ "passive": false
323
+ }]; }
324
+ }
@@ -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(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));
26
+ }
27
+ .date__wrapper--autofilled .date__input::part(input-field) {
28
+ color: var(--emfe-w-registration-typography, var(--emfe-w-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(--emfe-w-registration-typography, var(--emfe-w-color-black, #000000));
37
+ }
38
+ .date__label--required::after {
39
+ content: "*";
40
+ font-family: inherit;
41
+ color: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
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(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
51
+ }
52
+ .date__input[invalid]::part(input-field) {
53
+ border: 1px solid var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));
54
+ }
55
+ .date__input::part(input-field) {
56
+ border-radius: 4px;
57
+ background-color: var(--emfe-w-color-white, #FFFFFF);
58
+ border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
59
+ color: var(--emfe-w-registration-typography, var(--emfe-w-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: #cc0000b3;
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(--emfe-w-color-white, #FFFFFF);
91
+ border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
92
+ color: var(--emfe-w-registration-typography, var(--emfe-w-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
+ }