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