@everymatrix/general-input 1.44.0 → 1.45.2

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 (139) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +3873 -1756
  3. package/dist/cjs/general-input.cjs.entry.js +65 -63
  4. package/dist/cjs/general-input.cjs.js +17 -11
  5. package/dist/cjs/index-8cb018cb.js +1316 -0
  6. package/dist/cjs/index.cjs.js +13 -13
  7. package/dist/cjs/loader.cjs.js +7 -13
  8. package/dist/cjs/locale.utils-76c75c40.js +147 -0
  9. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +77 -78
  10. package/dist/collection/collection-manifest.json +14 -14
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +368 -353
  12. package/dist/collection/components/checkbox-input/checkbox-input.js +325 -315
  13. package/dist/collection/components/date-input/date-input.css +2 -2
  14. package/dist/collection/components/date-input/date-input.js +397 -376
  15. package/dist/collection/components/email-input/email-input.css +7 -11
  16. package/dist/collection/components/email-input/email-input.js +404 -385
  17. package/dist/collection/components/general-input/general-input.js +373 -368
  18. package/dist/collection/components/general-input/index.js +1 -0
  19. package/dist/collection/components/number-input/number-input.js +370 -352
  20. package/dist/collection/components/password-input/password-input.css +2 -4
  21. package/dist/collection/components/password-input/password-input.js +513 -540
  22. package/dist/collection/components/radio-input/radio-input.js +301 -286
  23. package/dist/collection/components/select-input/select-input.css +8 -9
  24. package/dist/collection/components/select-input/select-input.js +427 -414
  25. package/dist/collection/components/tel-input/tel-input.css +1 -1
  26. package/dist/collection/components/tel-input/tel-input.js +440 -422
  27. package/dist/collection/components/text-input/text-input.css +0 -1
  28. package/dist/collection/components/text-input/text-input.js +444 -429
  29. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +327 -340
  30. package/dist/collection/index.js +13 -13
  31. package/dist/collection/utils/locale.utils.js +133 -133
  32. package/dist/collection/utils/utils.js +3 -3
  33. package/dist/esm/app-globals-0f993ce5.js +3 -0
  34. package/dist/esm/checkbox-group-input_10.entry.js +3873 -1756
  35. package/dist/esm/general-input.entry.js +65 -63
  36. package/dist/esm/general-input.js +14 -11
  37. package/dist/esm/index-514fda47.js +1287 -0
  38. package/dist/esm/index.js +13 -13
  39. package/dist/esm/loader.js +7 -13
  40. package/dist/esm/locale.utils-ca41bf95.js +144 -0
  41. package/dist/esm/toggle-checkbox-input.entry.js +77 -78
  42. package/dist/general-input/general-input.esm.js +1 -1
  43. package/dist/general-input/p-03e81c11.js +2 -0
  44. package/dist/general-input/p-aec71434.js +1 -0
  45. package/dist/general-input/p-e1255160.js +1 -0
  46. package/dist/general-input/p-eb454344.entry.js +1 -0
  47. package/dist/general-input/p-ecdc294b.entry.js +5430 -0
  48. package/dist/general-input/p-f92ab852.entry.js +1 -0
  49. package/dist/stencil.config.dev.js +17 -0
  50. package/dist/stencil.config.js +14 -19
  51. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  52. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  53. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +68 -68
  54. package/dist/types/components/checkbox-input/checkbox-input.d.ts +61 -62
  55. package/dist/types/components/date-input/date-input.d.ts +78 -78
  56. package/dist/types/components/email-input/email-input.d.ts +77 -77
  57. package/dist/types/components/general-input/general-input.d.ts +72 -72
  58. package/dist/types/components/general-input/index.d.ts +1 -0
  59. package/dist/types/components/number-input/number-input.d.ts +71 -71
  60. package/dist/types/components/password-input/password-input.d.ts +87 -92
  61. package/dist/types/components/radio-input/radio-input.d.ts +55 -55
  62. package/dist/types/components/select-input/select-input.d.ts +79 -79
  63. package/dist/types/components/tel-input/tel-input.d.ts +85 -85
  64. package/dist/types/components/text-input/text-input.d.ts +81 -81
  65. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +63 -68
  66. package/dist/types/components.d.ts +201 -39
  67. package/dist/types/stencil-public-runtime.d.ts +142 -33
  68. package/dist/types/utils/locale.utils.d.ts +8 -8
  69. package/dist/types/utils/types.d.ts +54 -54
  70. package/loader/cdn.js +1 -3
  71. package/loader/index.cjs.js +1 -3
  72. package/loader/index.d.ts +13 -1
  73. package/loader/index.es2017.js +1 -3
  74. package/loader/index.js +1 -3
  75. package/loader/package.json +1 -0
  76. package/package.json +8 -1
  77. package/dist/cjs/index-132a0774.js +0 -1327
  78. package/dist/cjs/locale.utils-2fa6f747.js +0 -147
  79. package/dist/components/active-mixin.js +0 -975
  80. package/dist/components/checkbox-group-input.d.ts +0 -11
  81. package/dist/components/checkbox-group-input.js +0 -6
  82. package/dist/components/checkbox-group-input2.js +0 -1078
  83. package/dist/components/checkbox-input.d.ts +0 -11
  84. package/dist/components/checkbox-input.js +0 -6
  85. package/dist/components/checkbox-input2.js +0 -132
  86. package/dist/components/date-input.d.ts +0 -11
  87. package/dist/components/date-input.js +0 -6
  88. package/dist/components/date-input2.js +0 -11556
  89. package/dist/components/email-input.d.ts +0 -11
  90. package/dist/components/email-input.js +0 -6
  91. package/dist/components/email-input2.js +0 -171
  92. package/dist/components/field-mixin.js +0 -12426
  93. package/dist/components/general-input.d.ts +0 -11
  94. package/dist/components/general-input.js +0 -6
  95. package/dist/components/general-input2.js +0 -350
  96. package/dist/components/index.d.ts +0 -26
  97. package/dist/components/index.js +0 -18
  98. package/dist/components/input-field-shared-styles.js +0 -1211
  99. package/dist/components/number-input.d.ts +0 -11
  100. package/dist/components/number-input.js +0 -6
  101. package/dist/components/number-input2.js +0 -158
  102. package/dist/components/password-input.d.ts +0 -11
  103. package/dist/components/password-input.js +0 -6
  104. package/dist/components/password-input2.js +0 -1059
  105. package/dist/components/radio-input.d.ts +0 -11
  106. package/dist/components/radio-input.js +0 -6
  107. package/dist/components/radio-input2.js +0 -114
  108. package/dist/components/select-input.d.ts +0 -11
  109. package/dist/components/select-input.js +0 -6
  110. package/dist/components/select-input2.js +0 -183
  111. package/dist/components/tel-input.d.ts +0 -11
  112. package/dist/components/tel-input.js +0 -6
  113. package/dist/components/tel-input2.js +0 -197
  114. package/dist/components/text-input.d.ts +0 -11
  115. package/dist/components/text-input.js +0 -6
  116. package/dist/components/text-input2.js +0 -199
  117. package/dist/components/toggle-checkbox-input.d.ts +0 -11
  118. package/dist/components/toggle-checkbox-input.js +0 -6
  119. package/dist/components/tooltipIcon.js +0 -146
  120. package/dist/components/vaadin-button.js +0 -490
  121. package/dist/components/vaadin-combo-box.js +0 -4512
  122. package/dist/components/virtual-keyboard-controller.js +0 -2001
  123. package/dist/esm/index-db76d5b5.js +0 -1299
  124. package/dist/esm/locale.utils-30fb5289.js +0 -144
  125. package/dist/esm/polyfills/core-js.js +0 -11
  126. package/dist/esm/polyfills/css-shim.js +0 -1
  127. package/dist/esm/polyfills/dom.js +0 -79
  128. package/dist/esm/polyfills/es5-html-element.js +0 -1
  129. package/dist/esm/polyfills/index.js +0 -34
  130. package/dist/esm/polyfills/system.js +0 -6
  131. package/dist/general-input/p-04d4b145.js +0 -1
  132. package/dist/general-input/p-a8221ce9.entry.js +0 -1
  133. package/dist/general-input/p-b408093e.js +0 -1
  134. package/dist/general-input/p-b64caafa.entry.js +0 -3646
  135. package/dist/general-input/p-c85c0e4d.entry.js +0 -1
  136. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -2
  137. /package/dist/cjs/{tooltipIcon-092a795f.js → tooltipIcon-7e9ee226.js} +0 -0
  138. /package/dist/esm/{tooltipIcon-99c1c7b7.js → tooltipIcon-0a5a06a2.js} +0 -0
  139. /package/dist/general-input/{p-f4f4ccda.js → p-2dccd0bf.js} +0 -0
@@ -1,393 +1,414 @@
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
- import dateFnsFormat from 'date-fns/format';
6
- import dateFnsParse from 'date-fns/parse';
7
- import { isBefore, isAfter } from 'date-fns';
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import "@vaadin/date-picker";
4
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
5
+ import dateFnsFormat from "date-fns/format";
6
+ import dateFnsParse from "date-fns/parse";
7
+ import { isBefore, isAfter } from "date-fns";
8
8
  export class DateInput {
9
- constructor() {
10
- /**
11
- * Client custom styling via inline style
12
- */
13
- this.clientStyling = '';
14
- this.limitStylingAppends = false;
15
- this.showTooltip = false;
16
- this.touched = false;
17
- this.formatDate = (dateParts) => {
18
- const { year, month, day } = dateParts;
19
- const date = new Date(year, month, day);
20
- return dateFnsFormat(date, this.dateFormat || 'yyyy-MM-dd');
21
- };
22
- this.parseDate = (inputValue) => {
23
- const date = dateFnsParse(inputValue, this.dateFormat || 'yyyy-MM-dd', new Date());
24
- return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
25
- };
26
- this.handleBlur = () => {
27
- this.isValid = this.setValidity();
28
- this.errorMessage = this.setErrorMessage();
29
- this.touched = true;
30
- };
31
- this.setClientStyling = () => {
32
- let sheet = document.createElement('style');
33
- sheet.innerHTML = this.clientStyling;
34
- this.stylingContainer.prepend(sheet);
35
- };
36
- }
37
- validityChanged() {
38
- this.validityStateHandler({ valid: this.isValid, name: this.name });
39
- if (this.emitValue == true) {
40
- this.valueHandler({ name: this.name, value: this.value });
9
+ constructor() {
10
+ this.touched = false;
11
+ this.formatDate = (dateParts) => {
12
+ const { year, month, day } = dateParts;
13
+ const date = new Date(year, month, day);
14
+ return dateFnsFormat(date, this.dateFormat || 'yyyy-MM-dd');
15
+ };
16
+ this.parseDate = (inputValue) => {
17
+ const date = dateFnsParse(inputValue, this.dateFormat || 'yyyy-MM-dd', new Date());
18
+ return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
19
+ };
20
+ this.handleBlur = () => {
21
+ this.isValid = this.setValidity();
22
+ this.errorMessage = this.setErrorMessage();
23
+ this.touched = true;
24
+ };
25
+ this.setClientStyling = () => {
26
+ let sheet = document.createElement('style');
27
+ sheet.innerHTML = this.clientStyling;
28
+ this.stylingContainer.prepend(sheet);
29
+ };
30
+ this.name = undefined;
31
+ this.displayName = undefined;
32
+ this.placeholder = undefined;
33
+ this.validation = undefined;
34
+ this.defaultValue = undefined;
35
+ this.autofilled = undefined;
36
+ this.tooltip = undefined;
37
+ this.language = undefined;
38
+ this.emitValue = undefined;
39
+ this.clientStyling = '';
40
+ this.dateFormat = undefined;
41
+ this.errorMessage = undefined;
42
+ this.isValid = undefined;
43
+ this.limitStylingAppends = false;
44
+ this.showTooltip = false;
41
45
  }
42
- }
43
- validityStateHandler(inputStateEvent) {
44
- this.sendValidityState.emit(inputStateEvent);
45
- }
46
- emitValueHandler(newValue) {
47
- if (newValue == true && this.isValid) {
48
- this.valueHandler({ name: this.name, value: this.value });
46
+ validityChanged() {
47
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
48
+ if (this.emitValue == true) {
49
+ this.valueHandler({ name: this.name, value: this.value });
50
+ }
49
51
  }
50
- }
51
- valueHandler(inputValueEvent) {
52
- this.sendInputValue.emit(inputValueEvent);
53
- }
54
- handleClickOutside(event) {
55
- if (event.composedPath()[0] === this.tooltipIconReference)
56
- return;
57
- if (event.composedPath()[0] !== this.tooltipReference)
58
- this.showTooltip = false;
59
- }
60
- connectedCallback() {
61
- var _a, _b;
62
- this.minDate = dateFnsParse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
63
- this.maxDate = dateFnsParse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
64
- }
65
- componentDidRender() {
66
- // start custom styling area
67
- if (!this.limitStylingAppends && this.stylingContainer) {
68
- if (this.clientStyling)
69
- this.setClientStyling();
70
- this.limitStylingAppends = true;
52
+ validityStateHandler(inputStateEvent) {
53
+ this.sendValidityState.emit(inputStateEvent);
71
54
  }
72
- // end custom styling area
73
- }
74
- componentDidLoad() {
75
- this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
76
- this.inputReference = this.element.shadowRoot.querySelector('input');
77
- this.datePicker.i18n = Object.assign(Object.assign({}, this.datePicker.i18n), { formatDate: this.formatDate, parseDate: this.parseDate });
78
- this.isValid = this.setValidity();
79
- if (this.defaultValue) {
80
- this.value = this.defaultValue;
81
- this.valueHandler({ name: this.name, value: this.value });
55
+ emitValueHandler(newValue) {
56
+ if (newValue == true && this.isValid) {
57
+ this.valueHandler({ name: this.name, value: this.value });
58
+ }
82
59
  }
83
- }
84
- handleInput(event) {
85
- this.value = event.target.value;
86
- this.touched = true;
87
- this.valueAsDate = dateFnsParse(this.value || '', 'yyyy-MM-dd', new Date());
88
- this.isValid = this.setValidity();
89
- this.errorMessage = this.setErrorMessage();
90
- this.emitValueHandler(true);
91
- }
92
- setValidity() {
93
- if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
94
- return false;
60
+ valueHandler(inputValueEvent) {
61
+ this.sendInputValue.emit(inputValueEvent);
95
62
  }
96
- else {
97
- return this.inputReference.validity.valid;
63
+ handleClickOutside(event) {
64
+ if (event.composedPath()[0] === this.tooltipIconReference)
65
+ return;
66
+ if (event.composedPath()[0] !== this.tooltipReference)
67
+ this.showTooltip = false;
98
68
  }
99
- }
100
- setErrorMessage() {
101
- if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
102
- return translate('dateError2', this.language);
69
+ connectedCallback() {
70
+ var _a, _b;
71
+ this.minDate = dateFnsParse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
72
+ this.maxDate = dateFnsParse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
103
73
  }
104
- if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
105
- return translate('dateError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
74
+ componentDidRender() {
75
+ // start custom styling area
76
+ if (!this.limitStylingAppends && this.stylingContainer) {
77
+ if (this.clientStyling)
78
+ this.setClientStyling();
79
+ this.limitStylingAppends = true;
80
+ }
81
+ // end custom styling area
106
82
  }
107
- if (this.inputReference.validity.valueMissing) {
108
- return translate('requiredError', this.language);
83
+ componentDidLoad() {
84
+ this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
85
+ this.inputReference = this.element.shadowRoot.querySelector('input');
86
+ this.datePicker.i18n = Object.assign(Object.assign({}, this.datePicker.i18n), { formatDate: this.formatDate, parseDate: this.parseDate });
87
+ this.isValid = this.setValidity();
88
+ if (this.defaultValue) {
89
+ this.value = this.defaultValue;
90
+ this.valueHandler({ name: this.name, value: this.value });
91
+ }
109
92
  }
110
- }
111
- renderTooltip() {
112
- if (this.showTooltip) {
113
- return (h("div", { class: `date__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
93
+ handleInput(event) {
94
+ this.value = event.target.value;
95
+ this.touched = true;
96
+ this.valueAsDate = dateFnsParse(this.value || '', 'yyyy-MM-dd', new Date());
97
+ this.isValid = this.setValidity();
98
+ this.errorMessage = this.setErrorMessage();
99
+ this.emitValueHandler(true);
114
100
  }
115
- return null;
116
- }
117
- render() {
118
- let invalidClass = '';
119
- if (this.touched) {
120
- invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
101
+ setValidity() {
102
+ if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
103
+ return false;
104
+ }
105
+ else {
106
+ return this.inputReference.validity.valid;
107
+ }
121
108
  }
122
- return h("div", { class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el },
123
- h("label", { class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName),
124
- h("vaadin-date-picker", { id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onBlur: this.handleBlur }),
125
- h("small", { class: 'date__error-message' }, this.errorMessage),
126
- this.tooltip &&
127
- h("img", { class: 'date__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
128
- this.renderTooltip());
129
- }
130
- static get is() { return "date-input"; }
131
- static get encapsulation() { return "shadow"; }
132
- static get originalStyleUrls() { return {
133
- "$": ["date-input.scss"]
134
- }; }
135
- static get styleUrls() { return {
136
- "$": ["date-input.css"]
137
- }; }
138
- static get properties() { return {
139
- "name": {
140
- "type": "string",
141
- "mutable": false,
142
- "complexType": {
143
- "original": "string",
144
- "resolved": "string",
145
- "references": {}
146
- },
147
- "required": false,
148
- "optional": false,
149
- "docs": {
150
- "tags": [],
151
- "text": "Name of the input."
152
- },
153
- "attribute": "name",
154
- "reflect": true
155
- },
156
- "displayName": {
157
- "type": "string",
158
- "mutable": false,
159
- "complexType": {
160
- "original": "string",
161
- "resolved": "string",
162
- "references": {}
163
- },
164
- "required": false,
165
- "optional": false,
166
- "docs": {
167
- "tags": [],
168
- "text": "Name of input to be shown to the user."
169
- },
170
- "attribute": "display-name",
171
- "reflect": true
172
- },
173
- "placeholder": {
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": "Placeholder text to be shown."
186
- },
187
- "attribute": "placeholder",
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
- }
109
+ setErrorMessage() {
110
+ if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
111
+ return translate('dateError2', this.language);
112
+ }
113
+ if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
114
+ return translate('dateError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
115
+ }
116
+ if (this.inputReference.validity.valueMissing) {
117
+ return translate('requiredError', this.language);
201
118
  }
202
- },
203
- "required": false,
204
- "optional": false,
205
- "docs": {
206
- "tags": [],
207
- "text": "Object of validation rules for the input."
208
- }
209
- },
210
- "defaultValue": {
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": "Default value for the input."
223
- },
224
- "attribute": "default-value",
225
- "reflect": true
226
- },
227
- "autofilled": {
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": "Boolean. Determines if input should be readonly."
240
- },
241
- "attribute": "autofilled",
242
- "reflect": true
243
- },
244
- "tooltip": {
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": "Tooltip text."
257
- },
258
- "attribute": "tooltip",
259
- "reflect": true
260
- },
261
- "language": {
262
- "type": "string",
263
- "mutable": false,
264
- "complexType": {
265
- "original": "string",
266
- "resolved": "string",
267
- "references": {}
268
- },
269
- "required": false,
270
- "optional": false,
271
- "docs": {
272
- "tags": [],
273
- "text": "Currently selected language."
274
- },
275
- "attribute": "language",
276
- "reflect": true
277
- },
278
- "emitValue": {
279
- "type": "boolean",
280
- "mutable": false,
281
- "complexType": {
282
- "original": "boolean",
283
- "resolved": "boolean",
284
- "references": {}
285
- },
286
- "required": false,
287
- "optional": false,
288
- "docs": {
289
- "tags": [],
290
- "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
291
- },
292
- "attribute": "emit-value",
293
- "reflect": true
294
- },
295
- "clientStyling": {
296
- "type": "string",
297
- "mutable": false,
298
- "complexType": {
299
- "original": "string",
300
- "resolved": "string",
301
- "references": {}
302
- },
303
- "required": false,
304
- "optional": false,
305
- "docs": {
306
- "tags": [],
307
- "text": "Client custom styling via inline style"
308
- },
309
- "attribute": "client-styling",
310
- "reflect": true,
311
- "defaultValue": "''"
312
- },
313
- "dateFormat": {
314
- "type": "string",
315
- "mutable": false,
316
- "complexType": {
317
- "original": "string",
318
- "resolved": "string",
319
- "references": {}
320
- },
321
- "required": false,
322
- "optional": false,
323
- "docs": {
324
- "tags": [],
325
- "text": "Date format for date picker."
326
- },
327
- "attribute": "date-format",
328
- "reflect": true
329
119
  }
330
- }; }
331
- static get states() { return {
332
- "errorMessage": {},
333
- "isValid": {},
334
- "limitStylingAppends": {},
335
- "showTooltip": {}
336
- }; }
337
- static get events() { return [{
338
- "method": "sendValidityState",
339
- "name": "sendValidityState",
340
- "bubbles": true,
341
- "cancelable": true,
342
- "composed": true,
343
- "docs": {
344
- "tags": [],
345
- "text": ""
346
- },
347
- "complexType": {
348
- "original": "InputStateEvent",
349
- "resolved": "InputStateEvent",
350
- "references": {
351
- "InputStateEvent": {
352
- "location": "import",
353
- "path": "../../utils/types"
354
- }
120
+ renderTooltip() {
121
+ if (this.showTooltip) {
122
+ return (h("div", { class: `date__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
355
123
  }
356
- }
357
- }, {
358
- "method": "sendInputValue",
359
- "name": "sendInputValue",
360
- "bubbles": true,
361
- "cancelable": true,
362
- "composed": true,
363
- "docs": {
364
- "tags": [],
365
- "text": ""
366
- },
367
- "complexType": {
368
- "original": "InputValueEvent",
369
- "resolved": "InputValueEvent",
370
- "references": {
371
- "InputValueEvent": {
372
- "location": "import",
373
- "path": "../../utils/types"
374
- }
124
+ return null;
125
+ }
126
+ render() {
127
+ let invalidClass = '';
128
+ if (this.touched) {
129
+ invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
375
130
  }
376
- }
377
- }]; }
378
- static get elementRef() { return "element"; }
379
- static get watchers() { return [{
380
- "propName": "isValid",
381
- "methodName": "validityChanged"
382
- }, {
383
- "propName": "emitValue",
384
- "methodName": "emitValueHandler"
385
- }]; }
386
- static get listeners() { return [{
387
- "name": "click",
388
- "method": "handleClickOutside",
389
- "target": "document",
390
- "capture": false,
391
- "passive": false
392
- }]; }
131
+ return h("div", { key: '7fd02e4a0be8222ba408a59b5a32384a7ae979ae', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: '8a9d7390bcee99105d65d406d86d6be997a333ad', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, " ", this.validation.mandatory ? '*' : ''), h("vaadin-date-picker", { key: 'b8640a92030fde948dae7a4698d0937e701b720c', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onBlur: this.handleBlur }), h("small", { key: '45585438da48ddaf16c7301059d1e50b63e56a95', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
132
+ h("img", { key: '4195a881e57441fd9faee6411760715e1cac12f5', class: 'date__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
133
+ }
134
+ static get is() { return "date-input"; }
135
+ static get encapsulation() { return "shadow"; }
136
+ static get originalStyleUrls() {
137
+ return {
138
+ "$": ["date-input.scss"]
139
+ };
140
+ }
141
+ static get styleUrls() {
142
+ return {
143
+ "$": ["date-input.css"]
144
+ };
145
+ }
146
+ static get properties() {
147
+ return {
148
+ "name": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": false,
157
+ "optional": false,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": "Name of the input."
161
+ },
162
+ "attribute": "name",
163
+ "reflect": true
164
+ },
165
+ "displayName": {
166
+ "type": "string",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "string",
170
+ "resolved": "string",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": false,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "Name of input to be shown to the user."
178
+ },
179
+ "attribute": "display-name",
180
+ "reflect": true
181
+ },
182
+ "placeholder": {
183
+ "type": "string",
184
+ "mutable": false,
185
+ "complexType": {
186
+ "original": "string",
187
+ "resolved": "string",
188
+ "references": {}
189
+ },
190
+ "required": false,
191
+ "optional": false,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": "Placeholder text to be shown."
195
+ },
196
+ "attribute": "placeholder",
197
+ "reflect": true
198
+ },
199
+ "validation": {
200
+ "type": "unknown",
201
+ "mutable": false,
202
+ "complexType": {
203
+ "original": "ValidationSchema",
204
+ "resolved": "ValidationSchema",
205
+ "references": {
206
+ "ValidationSchema": {
207
+ "location": "import",
208
+ "path": "../../utils/types",
209
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::ValidationSchema"
210
+ }
211
+ }
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "Object of validation rules for the input."
218
+ }
219
+ },
220
+ "defaultValue": {
221
+ "type": "string",
222
+ "mutable": false,
223
+ "complexType": {
224
+ "original": "string",
225
+ "resolved": "string",
226
+ "references": {}
227
+ },
228
+ "required": false,
229
+ "optional": false,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": "Default value for the input."
233
+ },
234
+ "attribute": "default-value",
235
+ "reflect": true
236
+ },
237
+ "autofilled": {
238
+ "type": "boolean",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "boolean",
242
+ "resolved": "boolean",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": "Boolean. Determines if input should be readonly."
250
+ },
251
+ "attribute": "autofilled",
252
+ "reflect": true
253
+ },
254
+ "tooltip": {
255
+ "type": "string",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "string",
259
+ "resolved": "string",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": "Tooltip text."
267
+ },
268
+ "attribute": "tooltip",
269
+ "reflect": true
270
+ },
271
+ "language": {
272
+ "type": "string",
273
+ "mutable": false,
274
+ "complexType": {
275
+ "original": "string",
276
+ "resolved": "string",
277
+ "references": {}
278
+ },
279
+ "required": false,
280
+ "optional": false,
281
+ "docs": {
282
+ "tags": [],
283
+ "text": "Currently selected language."
284
+ },
285
+ "attribute": "language",
286
+ "reflect": true
287
+ },
288
+ "emitValue": {
289
+ "type": "boolean",
290
+ "mutable": false,
291
+ "complexType": {
292
+ "original": "boolean",
293
+ "resolved": "boolean",
294
+ "references": {}
295
+ },
296
+ "required": false,
297
+ "optional": false,
298
+ "docs": {
299
+ "tags": [],
300
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
301
+ },
302
+ "attribute": "emit-value",
303
+ "reflect": true
304
+ },
305
+ "clientStyling": {
306
+ "type": "string",
307
+ "mutable": false,
308
+ "complexType": {
309
+ "original": "string",
310
+ "resolved": "string",
311
+ "references": {}
312
+ },
313
+ "required": false,
314
+ "optional": false,
315
+ "docs": {
316
+ "tags": [],
317
+ "text": "Client custom styling via inline style"
318
+ },
319
+ "attribute": "client-styling",
320
+ "reflect": true,
321
+ "defaultValue": "''"
322
+ },
323
+ "dateFormat": {
324
+ "type": "string",
325
+ "mutable": false,
326
+ "complexType": {
327
+ "original": "string",
328
+ "resolved": "string",
329
+ "references": {}
330
+ },
331
+ "required": false,
332
+ "optional": false,
333
+ "docs": {
334
+ "tags": [],
335
+ "text": "Date format for date picker."
336
+ },
337
+ "attribute": "date-format",
338
+ "reflect": true
339
+ }
340
+ };
341
+ }
342
+ static get states() {
343
+ return {
344
+ "errorMessage": {},
345
+ "isValid": {},
346
+ "limitStylingAppends": {},
347
+ "showTooltip": {}
348
+ };
349
+ }
350
+ static get events() {
351
+ return [{
352
+ "method": "sendValidityState",
353
+ "name": "sendValidityState",
354
+ "bubbles": true,
355
+ "cancelable": true,
356
+ "composed": true,
357
+ "docs": {
358
+ "tags": [],
359
+ "text": ""
360
+ },
361
+ "complexType": {
362
+ "original": "InputStateEvent",
363
+ "resolved": "InputStateEvent",
364
+ "references": {
365
+ "InputStateEvent": {
366
+ "location": "import",
367
+ "path": "../../utils/types",
368
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputStateEvent"
369
+ }
370
+ }
371
+ }
372
+ }, {
373
+ "method": "sendInputValue",
374
+ "name": "sendInputValue",
375
+ "bubbles": true,
376
+ "cancelable": true,
377
+ "composed": true,
378
+ "docs": {
379
+ "tags": [],
380
+ "text": ""
381
+ },
382
+ "complexType": {
383
+ "original": "InputValueEvent",
384
+ "resolved": "InputValueEvent",
385
+ "references": {
386
+ "InputValueEvent": {
387
+ "location": "import",
388
+ "path": "../../utils/types",
389
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputValueEvent"
390
+ }
391
+ }
392
+ }
393
+ }];
394
+ }
395
+ static get elementRef() { return "element"; }
396
+ static get watchers() {
397
+ return [{
398
+ "propName": "isValid",
399
+ "methodName": "validityChanged"
400
+ }, {
401
+ "propName": "emitValue",
402
+ "methodName": "emitValueHandler"
403
+ }];
404
+ }
405
+ static get listeners() {
406
+ return [{
407
+ "name": "click",
408
+ "method": "handleClickOutside",
409
+ "target": "document",
410
+ "capture": false,
411
+ "passive": false
412
+ }];
413
+ }
393
414
  }