@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,322 @@
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
+ if (this.emitValue == true) {
25
+ this.valueHandler({ name: this.name, value: this.value });
26
+ }
27
+ }
28
+ validityStateHandler(inputStateEvent) {
29
+ this.sendValidityState.emit(inputStateEvent);
30
+ }
31
+ emitValueHandler(newValue) {
32
+ if (newValue == true && this.isValid) {
33
+ this.valueHandler({ name: this.name, value: this.value });
34
+ }
35
+ }
36
+ valueHandler(inputValueEvent) {
37
+ this.sendInputValue.emit(inputValueEvent);
38
+ }
39
+ handleClickOutside(event) {
40
+ if (event.composedPath()[0] === this.tooltipIconReference)
41
+ return;
42
+ if (event.composedPath()[0] !== this.tooltipReference)
43
+ this.showTooltip = false;
44
+ }
45
+ componentDidRender() {
46
+ // start custom styling area
47
+ if (!this.limitStylingAppends && this.stylingContainer) {
48
+ if (this.clientStyling)
49
+ this.setClientStyling();
50
+ this.limitStylingAppends = true;
51
+ }
52
+ // end custom styling area
53
+ if (this.defaultValue) {
54
+ this.value = this.defaultValue;
55
+ this.valueHandler({ name: this.name, value: this.value });
56
+ }
57
+ }
58
+ handleClick() {
59
+ this.value = this.inputReference.checked.toString();
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.valueMissing) {
70
+ return translate('requiredError', this.language);
71
+ }
72
+ }
73
+ renderLabel() {
74
+ return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input` },
75
+ h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
76
+ }
77
+ renderTooltip() {
78
+ if (this.showTooltip) {
79
+ return (h("div", { class: `checkbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
80
+ }
81
+ return null;
82
+ }
83
+ render() {
84
+ return h("div", { class: 'checkbox__wrapper', ref: el => this.stylingContainer = el },
85
+ h("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() }),
86
+ this.renderLabel(),
87
+ h("small", { class: 'checkbox__error-message' }, this.errorMessage),
88
+ h("div", { class: 'checkbox__wrapper--relative' },
89
+ this.tooltip &&
90
+ h("img", { class: 'checkbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
91
+ this.renderTooltip()));
92
+ }
93
+ static get is() { return "checkbox-input"; }
94
+ static get encapsulation() { return "shadow"; }
95
+ static get originalStyleUrls() { return {
96
+ "$": ["checkbox-input.scss"]
97
+ }; }
98
+ static get styleUrls() { return {
99
+ "$": ["checkbox-input.css"]
100
+ }; }
101
+ static get properties() { return {
102
+ "name": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": "Name of the input."
115
+ },
116
+ "attribute": "name",
117
+ "reflect": true
118
+ },
119
+ "displayName": {
120
+ "type": "string",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": "Name of input to be shown to the user."
132
+ },
133
+ "attribute": "display-name",
134
+ "reflect": true
135
+ },
136
+ "defaultValue": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "string",
141
+ "resolved": "string",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": "Default value for the input."
149
+ },
150
+ "attribute": "default-value",
151
+ "reflect": true,
152
+ "defaultValue": "''"
153
+ },
154
+ "autofilled": {
155
+ "type": "boolean",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "boolean",
159
+ "resolved": "boolean",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": "Boolean. Determines if input should be readonly."
167
+ },
168
+ "attribute": "autofilled",
169
+ "reflect": true
170
+ },
171
+ "tooltip": {
172
+ "type": "string",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "string",
176
+ "resolved": "string",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": "Tooltip text."
184
+ },
185
+ "attribute": "tooltip",
186
+ "reflect": true
187
+ },
188
+ "validation": {
189
+ "type": "unknown",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "ValidationSchema",
193
+ "resolved": "ValidationSchema",
194
+ "references": {
195
+ "ValidationSchema": {
196
+ "location": "import",
197
+ "path": "../../utils/types"
198
+ }
199
+ }
200
+ },
201
+ "required": false,
202
+ "optional": false,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": "Object of validation rules for the input."
206
+ }
207
+ },
208
+ "language": {
209
+ "type": "string",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "string",
213
+ "resolved": "string",
214
+ "references": {}
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": "Currently selected language."
221
+ },
222
+ "attribute": "language",
223
+ "reflect": true
224
+ },
225
+ "emitValue": {
226
+ "type": "boolean",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "boolean",
230
+ "resolved": "boolean",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
238
+ },
239
+ "attribute": "emit-value",
240
+ "reflect": true
241
+ },
242
+ "clientStyling": {
243
+ "type": "string",
244
+ "mutable": false,
245
+ "complexType": {
246
+ "original": "string",
247
+ "resolved": "string",
248
+ "references": {}
249
+ },
250
+ "required": false,
251
+ "optional": false,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": "Client custom styling via inline style"
255
+ },
256
+ "attribute": "client-styling",
257
+ "reflect": true,
258
+ "defaultValue": "''"
259
+ }
260
+ }; }
261
+ static get states() { return {
262
+ "errorMessage": {},
263
+ "isValid": {},
264
+ "limitStylingAppends": {},
265
+ "showTooltip": {}
266
+ }; }
267
+ static get events() { return [{
268
+ "method": "sendValidityState",
269
+ "name": "sendValidityState",
270
+ "bubbles": true,
271
+ "cancelable": true,
272
+ "composed": true,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": ""
276
+ },
277
+ "complexType": {
278
+ "original": "InputStateEvent",
279
+ "resolved": "InputStateEvent",
280
+ "references": {
281
+ "InputStateEvent": {
282
+ "location": "import",
283
+ "path": "../../utils/types"
284
+ }
285
+ }
286
+ }
287
+ }, {
288
+ "method": "sendInputValue",
289
+ "name": "sendInputValue",
290
+ "bubbles": true,
291
+ "cancelable": true,
292
+ "composed": true,
293
+ "docs": {
294
+ "tags": [],
295
+ "text": ""
296
+ },
297
+ "complexType": {
298
+ "original": "InputValueEvent",
299
+ "resolved": "InputValueEvent",
300
+ "references": {
301
+ "InputValueEvent": {
302
+ "location": "import",
303
+ "path": "../../utils/types"
304
+ }
305
+ }
306
+ }
307
+ }]; }
308
+ static get watchers() { return [{
309
+ "propName": "isValid",
310
+ "methodName": "validityChanged"
311
+ }, {
312
+ "propName": "emitValue",
313
+ "methodName": "emitValueHandler"
314
+ }]; }
315
+ static get listeners() { return [{
316
+ "name": "click",
317
+ "method": "handleClickOutside",
318
+ "target": "document",
319
+ "capture": false,
320
+ "passive": false
321
+ }]; }
322
+ }
@@ -0,0 +1,85 @@
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
+ padding-top: 26px;
17
+ }
18
+ .date__label {
19
+ font-family: inherit;
20
+ font-style: normal;
21
+ font-weight: 500;
22
+ font-size: 16px;
23
+ line-height: 20px;
24
+ color: #1F1F1F;
25
+ position: absolute;
26
+ top: 0;
27
+ left: 0;
28
+ }
29
+ .date__label--required::after {
30
+ content: "*";
31
+ font-family: inherit;
32
+ color: #1F1F1F;
33
+ margin-left: 2px;
34
+ }
35
+ .date__input {
36
+ border: none;
37
+ width: inherit;
38
+ position: relative;
39
+ }
40
+ .date__input[focused]::part(input-field) {
41
+ border-color: #3E3E3E;
42
+ }
43
+ .date__input[invalid]::part(input-field) {
44
+ border-color: #cc0000b3;
45
+ }
46
+ .date__input::part(input-field) {
47
+ border-radius: 4px;
48
+ background-color: #FFFFFF;
49
+ border: 2px solid #DEE1EE;
50
+ color: #2A2E3F;
51
+ border-radius: 4px;
52
+ background-color: transparent;
53
+ font-family: inherit;
54
+ font-style: normal;
55
+ font-weight: 300;
56
+ font-size: 16px;
57
+ line-height: 19px;
58
+ }
59
+ .date__error-message {
60
+ position: absolute;
61
+ top: calc(100% + 5px);
62
+ left: 0;
63
+ color: #cc0000b3;
64
+ }
65
+ .date__tooltip-icon {
66
+ position: absolute;
67
+ right: 0;
68
+ bottom: 10px;
69
+ }
70
+ .date__tooltip {
71
+ position: absolute;
72
+ bottom: 35px;
73
+ right: 10px;
74
+ background-color: #FFFFFF;
75
+ border: 1px solid #B0B0B0;
76
+ color: #2B2D3F;
77
+ padding: 10px;
78
+ border-radius: 5px;
79
+ opacity: 0;
80
+ transition: opacity 0.3s ease-in-out;
81
+ z-index: 10;
82
+ }
83
+ .date__tooltip.visible {
84
+ opacity: 1;
85
+ }