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