@everymatrix/general-input 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 (121) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +34870 -0
  2. package/dist/cjs/general-input.cjs.entry.js +51 -0
  3. package/dist/cjs/general-input.cjs.js +19 -0
  4. package/dist/cjs/index-1768513d.js +1286 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/collection/collection-manifest.json +22 -0
  8. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +62 -0
  9. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +344 -0
  10. package/dist/collection/components/checkbox-input/checkbox-input.css +62 -0
  11. package/dist/collection/components/checkbox-input/checkbox-input.js +322 -0
  12. package/dist/collection/components/date-input/date-input.css +85 -0
  13. package/dist/collection/components/date-input/date-input.js +341 -0
  14. package/dist/collection/components/email-input/email-input.css +83 -0
  15. package/dist/collection/components/email-input/email-input.js +382 -0
  16. package/dist/collection/components/general-input/general-input.css +3 -0
  17. package/dist/collection/components/general-input/general-input.js +296 -0
  18. package/dist/collection/components/number-input/number-input.css +90 -0
  19. package/dist/collection/components/number-input/number-input.js +349 -0
  20. package/dist/collection/components/password-input/password-input.css +86 -0
  21. package/dist/collection/components/password-input/password-input.js +395 -0
  22. package/dist/collection/components/radio-input/radio-input.css +43 -0
  23. package/dist/collection/components/radio-input/radio-input.js +298 -0
  24. package/dist/collection/components/select-input/select-input.css +93 -0
  25. package/dist/collection/components/select-input/select-input.js +412 -0
  26. package/dist/collection/components/tel-input/tel-input.css +116 -0
  27. package/dist/collection/components/tel-input/tel-input.js +421 -0
  28. package/dist/collection/components/text-input/text-input.css +83 -0
  29. package/dist/collection/components/text-input/text-input.js +406 -0
  30. package/dist/collection/index.js +1 -0
  31. package/dist/collection/utils/locale.utils.js +26 -0
  32. package/dist/collection/utils/tooltipIcon.svg +5 -0
  33. package/dist/collection/utils/types.js +1 -0
  34. package/dist/collection/utils/utils.js +5 -0
  35. package/dist/components/active-mixin.js +975 -0
  36. package/dist/components/checkbox-group-input.d.ts +11 -0
  37. package/dist/components/checkbox-group-input.js +6 -0
  38. package/dist/components/checkbox-group-input2.js +5793 -0
  39. package/dist/components/checkbox-input.d.ts +11 -0
  40. package/dist/components/checkbox-input.js +6 -0
  41. package/dist/components/checkbox-input2.js +127 -0
  42. package/dist/components/date-input.d.ts +11 -0
  43. package/dist/components/date-input.js +6 -0
  44. package/dist/components/date-input2.js +5182 -0
  45. package/dist/components/email-input.d.ts +11 -0
  46. package/dist/components/email-input.js +6 -0
  47. package/dist/components/email-input2.js +150 -0
  48. package/dist/components/field-mixin.js +12712 -0
  49. package/dist/components/general-input.d.ts +11 -0
  50. package/dist/components/general-input.js +140 -0
  51. package/dist/components/index.d.ts +26 -0
  52. package/dist/components/index.js +1 -0
  53. package/dist/components/input-field-shared-styles.js +1067 -0
  54. package/dist/components/number-input.d.ts +11 -0
  55. package/dist/components/number-input.js +6 -0
  56. package/dist/components/number-input2.js +139 -0
  57. package/dist/components/password-input.d.ts +11 -0
  58. package/dist/components/password-input.js +6 -0
  59. package/dist/components/password-input2.js +879 -0
  60. package/dist/components/pattern-mixin.js +85 -0
  61. package/dist/components/radio-input.d.ts +11 -0
  62. package/dist/components/radio-input.js +6 -0
  63. package/dist/components/radio-input2.js +115 -0
  64. package/dist/components/select-input.d.ts +11 -0
  65. package/dist/components/select-input.js +6 -0
  66. package/dist/components/select-input2.js +166 -0
  67. package/dist/components/tel-input.d.ts +11 -0
  68. package/dist/components/tel-input.js +6 -0
  69. package/dist/components/tel-input2.js +178 -0
  70. package/dist/components/text-input.d.ts +11 -0
  71. package/dist/components/text-input.js +6 -0
  72. package/dist/components/text-input2.js +157 -0
  73. package/dist/components/tooltipIcon.js +30 -0
  74. package/dist/components/vaadin-button.js +461 -0
  75. package/dist/components/vaadin-combo-box.js +4329 -0
  76. package/dist/components/virtual-keyboard-controller.js +2693 -0
  77. package/dist/esm/checkbox-group-input_10.entry.js +34857 -0
  78. package/dist/esm/general-input.entry.js +47 -0
  79. package/dist/esm/general-input.js +17 -0
  80. package/dist/esm/index-7e24a6f1.js +1259 -0
  81. package/dist/esm/index.js +1 -0
  82. package/dist/esm/loader.js +17 -0
  83. package/dist/esm/polyfills/core-js.js +11 -0
  84. package/dist/esm/polyfills/css-shim.js +1 -0
  85. package/dist/esm/polyfills/dom.js +79 -0
  86. package/dist/esm/polyfills/es5-html-element.js +1 -0
  87. package/dist/esm/polyfills/index.js +34 -0
  88. package/dist/esm/polyfills/system.js +6 -0
  89. package/dist/general-input/general-input.esm.js +1 -0
  90. package/dist/general-input/index.esm.js +0 -0
  91. package/dist/general-input/p-61d76ec3.entry.js +1 -0
  92. package/dist/general-input/p-a79eb0a3.entry.js +4413 -0
  93. package/dist/general-input/p-fb647820.js +1 -0
  94. package/dist/index.cjs.js +1 -0
  95. package/dist/index.js +1 -0
  96. package/dist/stencil.config.js +22 -0
  97. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +2 -0
  98. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +72 -0
  99. package/dist/types/components/checkbox-input/checkbox-input.d.ts +64 -0
  100. package/dist/types/components/date-input/date-input.d.ts +70 -0
  101. package/dist/types/components/email-input/email-input.d.ts +77 -0
  102. package/dist/types/components/general-input/general-input.d.ts +60 -0
  103. package/dist/types/components/number-input/number-input.d.ts +70 -0
  104. package/dist/types/components/password-input/password-input.d.ts +79 -0
  105. package/dist/types/components/radio-input/radio-input.d.ts +59 -0
  106. package/dist/types/components/select-input/select-input.d.ts +82 -0
  107. package/dist/types/components/tel-input/tel-input.d.ts +85 -0
  108. package/dist/types/components/text-input/text-input.d.ts +81 -0
  109. package/dist/types/components.d.ts +1140 -0
  110. package/dist/types/index.d.ts +1 -0
  111. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  112. package/dist/types/utils/locale.utils.d.ts +5 -0
  113. package/dist/types/utils/types.d.ts +76 -0
  114. package/dist/types/utils/utils.d.ts +1 -0
  115. package/loader/cdn.js +3 -0
  116. package/loader/index.cjs.js +3 -0
  117. package/loader/index.d.ts +12 -0
  118. package/loader/index.es2017.js +3 -0
  119. package/loader/index.js +4 -0
  120. package/loader/package.json +10 -0
  121. package/package.json +26 -0
@@ -0,0 +1,341 @@
1
+ import { Component, h, State, Prop, Watch, Event, Element, Listen } from '@stencil/core';
2
+ import { translate } from '../../utils/locale.utils';
3
+ import '@vaadin/date-picker';
4
+ import tooltipIcon from '../../utils/tooltipIcon.svg';
5
+ export class DateInput {
6
+ constructor() {
7
+ /**
8
+ * Client custom styling via inline style
9
+ */
10
+ this.clientStyling = '';
11
+ this.limitStylingAppends = false;
12
+ this.showTooltip = false;
13
+ this.setClientStyling = () => {
14
+ let sheet = document.createElement('style');
15
+ sheet.innerHTML = this.clientStyling;
16
+ this.stylingContainer.prepend(sheet);
17
+ };
18
+ }
19
+ validityChanged() {
20
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
21
+ if (this.emitValue == true) {
22
+ this.valueHandler({ name: this.name, value: this.value });
23
+ }
24
+ }
25
+ validityStateHandler(inputStateEvent) {
26
+ this.sendValidityState.emit(inputStateEvent);
27
+ }
28
+ emitValueHandler(newValue) {
29
+ if (newValue == true && this.isValid) {
30
+ this.valueHandler({ name: this.name, value: this.value });
31
+ }
32
+ }
33
+ valueHandler(inputValueEvent) {
34
+ this.sendInputValue.emit(inputValueEvent);
35
+ }
36
+ handleClickOutside(event) {
37
+ if (event.composedPath()[0] === this.tooltipIconReference)
38
+ return;
39
+ if (event.composedPath()[0] !== this.tooltipReference)
40
+ this.showTooltip = false;
41
+ }
42
+ componentDidRender() {
43
+ // start custom styling area
44
+ if (!this.limitStylingAppends && this.stylingContainer) {
45
+ if (this.clientStyling)
46
+ this.setClientStyling();
47
+ this.limitStylingAppends = true;
48
+ }
49
+ // end custom styling area
50
+ if (this.defaultValue) {
51
+ this.value = this.defaultValue;
52
+ this.valueHandler({ name: this.name, value: this.value });
53
+ }
54
+ }
55
+ componentDidLoad() {
56
+ this.inputReference = this.element.shadowRoot.querySelector('input');
57
+ }
58
+ handleInput(event) {
59
+ this.value = event.target.value;
60
+ this.errorMessage = this.setErrorMessage();
61
+ this.isValid = this.setValidity();
62
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
63
+ this.emitValueHandler(true);
64
+ }
65
+ setValidity() {
66
+ return this.inputReference.validity.valid;
67
+ }
68
+ setErrorMessage() {
69
+ if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
70
+ return translate('dateError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
71
+ }
72
+ if (this.inputReference.validity.valueMissing) {
73
+ return translate('requiredError', this.language);
74
+ }
75
+ }
76
+ renderTooltip() {
77
+ if (this.showTooltip) {
78
+ return (h("div", { class: `date__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
79
+ }
80
+ return null;
81
+ }
82
+ render() {
83
+ const invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'date__input--invalid';
84
+ return h("div", { class: 'date__wrapper', ref: el => this.stylingContainer = el },
85
+ h("label", { class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` },
86
+ this.displayName,
87
+ " ",
88
+ this.validation.mandatory ? '*' : ''),
89
+ h("vaadin-date-picker", { id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder} ${this.placeholder && this.validation.mandatory ? '*' : ''}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onBlur: (e) => this.handleInput(e) }),
90
+ h("small", { class: 'date__error-message' }, this.errorMessage),
91
+ this.tooltip &&
92
+ h("img", { class: 'date__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
93
+ this.renderTooltip());
94
+ }
95
+ static get is() { return "date-input"; }
96
+ static get encapsulation() { return "shadow"; }
97
+ static get originalStyleUrls() { return {
98
+ "$": ["date-input.scss"]
99
+ }; }
100
+ static get styleUrls() { return {
101
+ "$": ["date-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
+ "placeholder": {
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": "Placeholder text to be shown."
151
+ },
152
+ "attribute": "placeholder",
153
+ "reflect": true
154
+ },
155
+ "validation": {
156
+ "type": "unknown",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "ValidationSchema",
160
+ "resolved": "ValidationSchema",
161
+ "references": {
162
+ "ValidationSchema": {
163
+ "location": "import",
164
+ "path": "../../utils/types"
165
+ }
166
+ }
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": "Object of validation rules for the input."
173
+ }
174
+ },
175
+ "defaultValue": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "string",
180
+ "resolved": "string",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Default value for the input."
188
+ },
189
+ "attribute": "default-value",
190
+ "reflect": true
191
+ },
192
+ "autofilled": {
193
+ "type": "boolean",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "boolean",
197
+ "resolved": "boolean",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Boolean. Determines if input should be readonly."
205
+ },
206
+ "attribute": "autofilled",
207
+ "reflect": true
208
+ },
209
+ "tooltip": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "string",
214
+ "resolved": "string",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "Tooltip text."
222
+ },
223
+ "attribute": "tooltip",
224
+ "reflect": true
225
+ },
226
+ "language": {
227
+ "type": "string",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "string",
231
+ "resolved": "string",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "Currently selected language."
239
+ },
240
+ "attribute": "language",
241
+ "reflect": true
242
+ },
243
+ "emitValue": {
244
+ "type": "boolean",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "boolean",
248
+ "resolved": "boolean",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
256
+ },
257
+ "attribute": "emit-value",
258
+ "reflect": true
259
+ },
260
+ "clientStyling": {
261
+ "type": "string",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "string",
265
+ "resolved": "string",
266
+ "references": {}
267
+ },
268
+ "required": false,
269
+ "optional": false,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": "Client custom styling via inline style"
273
+ },
274
+ "attribute": "client-styling",
275
+ "reflect": true,
276
+ "defaultValue": "''"
277
+ }
278
+ }; }
279
+ static get states() { return {
280
+ "errorMessage": {},
281
+ "isValid": {},
282
+ "limitStylingAppends": {},
283
+ "showTooltip": {}
284
+ }; }
285
+ static get events() { return [{
286
+ "method": "sendValidityState",
287
+ "name": "sendValidityState",
288
+ "bubbles": true,
289
+ "cancelable": true,
290
+ "composed": true,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": ""
294
+ },
295
+ "complexType": {
296
+ "original": "InputStateEvent",
297
+ "resolved": "InputStateEvent",
298
+ "references": {
299
+ "InputStateEvent": {
300
+ "location": "import",
301
+ "path": "../../utils/types"
302
+ }
303
+ }
304
+ }
305
+ }, {
306
+ "method": "sendInputValue",
307
+ "name": "sendInputValue",
308
+ "bubbles": true,
309
+ "cancelable": true,
310
+ "composed": true,
311
+ "docs": {
312
+ "tags": [],
313
+ "text": ""
314
+ },
315
+ "complexType": {
316
+ "original": "InputValueEvent",
317
+ "resolved": "InputValueEvent",
318
+ "references": {
319
+ "InputValueEvent": {
320
+ "location": "import",
321
+ "path": "../../utils/types"
322
+ }
323
+ }
324
+ }
325
+ }]; }
326
+ static get elementRef() { return "element"; }
327
+ static get watchers() { return [{
328
+ "propName": "isValid",
329
+ "methodName": "validityChanged"
330
+ }, {
331
+ "propName": "emitValue",
332
+ "methodName": "emitValueHandler"
333
+ }]; }
334
+ static get listeners() { return [{
335
+ "name": "click",
336
+ "method": "handleClickOutside",
337
+ "target": "document",
338
+ "capture": false,
339
+ "passive": false
340
+ }]; }
341
+ }
@@ -0,0 +1,83 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ padding: 0;
5
+ margin: 0;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .email {
10
+ font-family: "Roboto";
11
+ font-style: normal;
12
+ }
13
+ .email__wrapper {
14
+ position: relative;
15
+ width: 100%;
16
+ }
17
+ .email__wrapper--flex {
18
+ display: flex;
19
+ gap: 5px;
20
+ }
21
+ .email__wrapper--relative {
22
+ position: relative;
23
+ }
24
+ .email__label {
25
+ font-family: inherit;
26
+ font-style: normal;
27
+ font-weight: 500;
28
+ font-size: 16px;
29
+ line-height: 20px;
30
+ color: #1F1F1F;
31
+ }
32
+ .email__label--required::after {
33
+ content: "*";
34
+ font-family: inherit;
35
+ color: #1F1F1F;
36
+ margin-left: 2px;
37
+ }
38
+ .email__input {
39
+ border-radius: 4px;
40
+ background-color: transparent;
41
+ font-family: inherit;
42
+ font-style: normal;
43
+ font-weight: 300;
44
+ font-size: 16px;
45
+ line-height: 19px;
46
+ color: #2A2E3F;
47
+ padding: 8px 20px;
48
+ width: inherit;
49
+ position: relative;
50
+ border: 2px solid #DEE1EE;
51
+ }
52
+ .email__input:focus {
53
+ outline-color: #3E3E3E;
54
+ }
55
+ .email__input--invalid {
56
+ border: 2px solid #cc0000b3;
57
+ }
58
+ .email__error-message {
59
+ position: absolute;
60
+ top: calc(100% + 5px);
61
+ left: 0;
62
+ color: #cc0000b3;
63
+ }
64
+ .email__tooltip-icon {
65
+ width: 16px;
66
+ height: auto;
67
+ }
68
+ .email__tooltip {
69
+ position: absolute;
70
+ top: 0;
71
+ left: 20px;
72
+ background-color: #FFFFFF;
73
+ border: 1px solid #B0B0B0;
74
+ color: #2B2D3F;
75
+ padding: 10px;
76
+ border-radius: 5px;
77
+ opacity: 0;
78
+ transition: opacity 0.3s ease-in-out;
79
+ z-index: 10;
80
+ }
81
+ .email__tooltip.visible {
82
+ opacity: 1;
83
+ }