@everymatrix/general-input 1.10.2 → 1.15.0

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 (96) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +35539 -0
  2. package/dist/cjs/general-input.cjs.entry.js +34 -13
  3. package/dist/cjs/general-input.cjs.js +2 -2
  4. package/dist/cjs/{index-64a5cb7f.js → index-132a0774.js} +119 -6
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/locale.utils-7665b010.js +71 -0
  7. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +85 -0
  8. package/dist/cjs/tooltipIcon-092a795f.js +5 -0
  9. package/dist/collection/collection-manifest.json +3 -1
  10. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +62 -0
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +366 -0
  12. package/dist/collection/components/checkbox-input/checkbox-input.css +47 -1
  13. package/dist/collection/components/checkbox-input/checkbox-input.js +143 -16
  14. package/dist/collection/components/date-input/date-input.css +64 -30
  15. package/dist/collection/components/date-input/date-input.js +194 -13
  16. package/dist/collection/components/email-input/email-input.css +63 -28
  17. package/dist/collection/components/email-input/email-input.js +197 -21
  18. package/dist/collection/components/general-input/general-input.js +163 -21
  19. package/dist/collection/components/number-input/number-input.css +65 -30
  20. package/dist/collection/components/number-input/number-input.js +174 -19
  21. package/dist/collection/components/password-input/password-input.css +120 -29
  22. package/dist/collection/components/password-input/password-input.js +341 -25
  23. package/dist/collection/components/radio-input/radio-input.css +22 -1
  24. package/dist/collection/components/radio-input/radio-input.js +89 -10
  25. package/dist/collection/components/select-input/select-input.css +75 -22
  26. package/dist/collection/components/select-input/select-input.js +180 -37
  27. package/dist/collection/components/tel-input/tel-input.css +91 -33
  28. package/dist/collection/components/tel-input/tel-input.js +202 -24
  29. package/dist/collection/components/text-input/text-input.css +63 -28
  30. package/dist/collection/components/text-input/text-input.js +208 -39
  31. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +76 -0
  32. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +324 -0
  33. package/dist/collection/utils/locale.utils.js +52 -13
  34. package/dist/collection/utils/tooltipIcon.svg +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 +1125 -0
  39. package/dist/components/checkbox-input2.js +62 -12
  40. package/dist/components/date-input2.js +10247 -15
  41. package/dist/components/email-input2.js +98 -21
  42. package/dist/components/field-mixin.js +12712 -0
  43. package/dist/components/general-input.js +1 -118
  44. package/dist/components/general-input2.js +331 -0
  45. package/dist/components/input-field-shared-styles.js +1114 -0
  46. package/dist/components/number-input2.js +92 -16
  47. package/dist/components/password-input2.js +924 -24
  48. package/dist/components/pattern-mixin.js +85 -0
  49. package/dist/components/radio-input2.js +45 -11
  50. package/dist/components/select-input2.js +87 -27
  51. package/dist/components/tel-input2.js +122 -22
  52. package/dist/components/text-input2.js +120 -34
  53. package/dist/components/toggle-checkbox-input.d.ts +11 -0
  54. package/dist/components/toggle-checkbox-input.js +6 -0
  55. package/dist/components/tooltipIcon.js +70 -0
  56. package/dist/components/vaadin-button.js +461 -0
  57. package/dist/components/vaadin-combo-box.js +4329 -0
  58. package/dist/components/virtual-keyboard-controller.js +2658 -0
  59. package/dist/esm/checkbox-group-input_10.entry.js +35526 -0
  60. package/dist/esm/general-input.entry.js +34 -13
  61. package/dist/esm/general-input.js +2 -2
  62. package/dist/esm/{index-df80f936.js → index-db76d5b5.js} +118 -7
  63. package/dist/esm/loader.js +2 -2
  64. package/dist/esm/locale.utils-95ea2605.js +68 -0
  65. package/dist/esm/toggle-checkbox-input.entry.js +81 -0
  66. package/dist/esm/tooltipIcon-99c1c7b7.js +3 -0
  67. package/dist/general-input/general-input.esm.js +1 -1
  68. package/dist/general-input/p-0966f523.entry.js +3581 -0
  69. package/dist/general-input/p-916a1319.entry.js +1 -0
  70. package/dist/general-input/p-b408093e.js +1 -0
  71. package/dist/general-input/p-c2d4d6ac.entry.js +1 -0
  72. package/dist/general-input/p-f4f4ccda.js +1 -0
  73. package/dist/general-input/p-f6132f1d.js +1 -0
  74. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +74 -0
  75. package/dist/types/components/checkbox-input/checkbox-input.d.ts +28 -2
  76. package/dist/types/components/date-input/date-input.d.ts +43 -1
  77. package/dist/types/components/email-input/email-input.d.ts +37 -3
  78. package/dist/types/components/general-input/general-input.d.ts +30 -0
  79. package/dist/types/components/number-input/number-input.d.ts +34 -3
  80. package/dist/types/components/password-input/password-input.d.ts +56 -7
  81. package/dist/types/components/radio-input/radio-input.d.ts +17 -1
  82. package/dist/types/components/select-input/select-input.d.ts +36 -3
  83. package/dist/types/components/tel-input/tel-input.d.ts +40 -5
  84. package/dist/types/components/text-input/text-input.d.ts +84 -0
  85. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
  86. package/dist/types/components.d.ts +568 -9
  87. package/dist/types/utils/locale.utils.d.ts +9 -0
  88. package/dist/types/utils/types.d.ts +41 -9
  89. package/package.json +8 -1
  90. package/dist/cjs/checkbox-input_9.cjs.entry.js +0 -623
  91. package/dist/components/locale.utils.js +0 -29
  92. package/dist/esm/checkbox-input_9.entry.js +0 -611
  93. package/dist/general-input/p-1703fce3.entry.js +0 -1
  94. package/dist/general-input/p-d9f7fa2e.js +0 -1
  95. package/dist/general-input/p-dea0a4ac.entry.js +0 -1
  96. /package/dist/types/Users/{user/workspace/everymatrix → adrian.pripon/Documents/Work}/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -0
@@ -1,6 +1,25 @@
1
- import { Component, h, Prop, State, Watch, Event } from '@stencil/core';
1
+ import { Component, h, Prop, State, Watch, Event, Listen } from '@stencil/core';
2
2
  import { translate } from '../../utils/locale.utils';
3
+ import tooltipIcon from '../../utils/tooltipIcon.svg';
3
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
+ }
4
23
  validityChanged() {
5
24
  this.validityStateHandler({ valid: this.isValid, name: this.name });
6
25
  if (this.emitValue == true) {
@@ -18,13 +37,31 @@ export class CheckboxInput {
18
37
  valueHandler(inputValueEvent) {
19
38
  this.sendInputValue.emit(inputValueEvent);
20
39
  }
21
- connectedCallback() {
40
+ handleClickOutside(event) {
41
+ if (event.composedPath()[0] === this.tooltipIconReference)
42
+ return;
43
+ if (event.composedPath()[0] !== this.tooltipReference)
44
+ this.showTooltip = false;
45
+ }
46
+ componentDidRender() {
47
+ // start custom styling area
48
+ if (!this.limitStylingAppends && this.stylingContainer) {
49
+ if (this.clientStyling)
50
+ this.setClientStyling();
51
+ this.limitStylingAppends = true;
52
+ }
53
+ // end custom styling area
54
+ }
55
+ componentDidLoad() {
56
+ if (this.defaultValue) {
57
+ this.value = this.defaultValue;
58
+ this.valueHandler({ name: this.name, value: this.value });
59
+ }
22
60
  }
23
61
  handleClick() {
24
- this.value = this.inputReference.checked;
62
+ this.value = this.inputReference.checked.toString();
25
63
  this.errorMessage = this.setErrorMessage();
26
64
  this.isValid = this.setValidity();
27
- this.validityStateHandler({ valid: this.isValid, name: this.name });
28
65
  this.emitValueHandler(true);
29
66
  }
30
67
  setValidity() {
@@ -35,14 +72,25 @@ export class CheckboxInput {
35
72
  return translate('requiredError', this.language);
36
73
  }
37
74
  }
75
+ renderLabel() {
76
+ return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input` },
77
+ h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
78
+ }
79
+ renderTooltip() {
80
+ if (this.showTooltip) {
81
+ return (h("div", { class: `checkbox__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
82
+ }
83
+ return null;
84
+ }
38
85
  render() {
39
- return h("div", { class: 'checkbox__wrapper' },
40
- h("input", { type: "checkbox", id: `${this.name}__input`, ref: (el) => this.inputReference = el, name: this.name, required: this.validation.mandatory, value: 'jdjdj', onClick: () => this.handleClick() }),
41
- h("label", { htmlFor: `${this.name}__input` },
42
- this.displayName,
43
- " ",
44
- this.validation.mandatory ? '*' : ''),
45
- h("small", { class: 'checkbox__error-message' }, this.errorMessage));
86
+ return h("div", { class: `checkbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el },
87
+ h("input", { class: 'checkbox__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() }),
88
+ this.renderLabel(),
89
+ h("small", { class: 'checkbox__error-message' }, this.errorMessage),
90
+ h("div", { class: 'checkbox__wrapper--relative' },
91
+ this.tooltip &&
92
+ h("img", { class: 'checkbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
93
+ this.renderTooltip()));
46
94
  }
47
95
  static get is() { return "checkbox-input"; }
48
96
  static get encapsulation() { return "shadow"; }
@@ -68,7 +116,7 @@ export class CheckboxInput {
68
116
  "text": "Name of the input."
69
117
  },
70
118
  "attribute": "name",
71
- "reflect": false
119
+ "reflect": true
72
120
  },
73
121
  "displayName": {
74
122
  "type": "string",
@@ -85,7 +133,59 @@ export class CheckboxInput {
85
133
  "text": "Name of input to be shown to the user."
86
134
  },
87
135
  "attribute": "display-name",
88
- "reflect": false
136
+ "reflect": true
137
+ },
138
+ "defaultValue": {
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": "Default value for the input."
151
+ },
152
+ "attribute": "default-value",
153
+ "reflect": true,
154
+ "defaultValue": "''"
155
+ },
156
+ "autofilled": {
157
+ "type": "boolean",
158
+ "mutable": false,
159
+ "complexType": {
160
+ "original": "boolean",
161
+ "resolved": "boolean",
162
+ "references": {}
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": "Boolean. Determines if input should be readonly."
169
+ },
170
+ "attribute": "autofilled",
171
+ "reflect": true
172
+ },
173
+ "tooltip": {
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": "Tooltip text."
186
+ },
187
+ "attribute": "tooltip",
188
+ "reflect": true
89
189
  },
90
190
  "validation": {
91
191
  "type": "unknown",
@@ -122,7 +222,7 @@ export class CheckboxInput {
122
222
  "text": "Currently selected language."
123
223
  },
124
224
  "attribute": "language",
125
- "reflect": false
225
+ "reflect": true
126
226
  },
127
227
  "emitValue": {
128
228
  "type": "boolean",
@@ -139,12 +239,32 @@ export class CheckboxInput {
139
239
  "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
140
240
  },
141
241
  "attribute": "emit-value",
142
- "reflect": false
242
+ "reflect": true
243
+ },
244
+ "clientStyling": {
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": "Client custom styling via inline style"
257
+ },
258
+ "attribute": "client-styling",
259
+ "reflect": true,
260
+ "defaultValue": "''"
143
261
  }
144
262
  }; }
145
263
  static get states() { return {
146
264
  "errorMessage": {},
147
- "isValid": {}
265
+ "isValid": {},
266
+ "limitStylingAppends": {},
267
+ "showTooltip": {}
148
268
  }; }
149
269
  static get events() { return [{
150
270
  "method": "sendValidityState",
@@ -194,4 +314,11 @@ export class CheckboxInput {
194
314
  "propName": "emitValue",
195
315
  "methodName": "emitValueHandler"
196
316
  }]; }
317
+ static get listeners() { return [{
318
+ "name": "click",
319
+ "method": "handleClickOutside",
320
+ "target": "document",
321
+ "capture": false,
322
+ "passive": false
323
+ }]; }
197
324
  }
@@ -6,55 +6,89 @@
6
6
  box-sizing: border-box;
7
7
  }
8
8
 
9
+ .date {
10
+ font-family: "Roboto";
11
+ font-style: normal;
12
+ }
9
13
  .date__wrapper {
10
14
  position: relative;
11
- display: flex;
12
- flex-direction: column-reverse;
13
- padding-top: 10px;
15
+ width: 100%;
16
+ padding-top: 26px;
17
+ }
18
+ .date__wrapper--autofilled {
19
+ pointer-events: none;
20
+ }
21
+ .date__wrapper--autofilled .date__label {
22
+ color: #979797;
23
+ }
24
+ .date__wrapper--autofilled .date__input::part(input-field) {
25
+ color: #979797;
14
26
  }
15
27
  .date__label {
16
- color: #474747;
28
+ font-family: inherit;
29
+ font-style: normal;
30
+ font-weight: 500;
17
31
  font-size: 16px;
32
+ line-height: 20px;
33
+ color: #2A3841;
18
34
  position: absolute;
19
- bottom: 15px;
20
- left: 5px;
21
- transform: translateY(-25px);
22
- transition: all 0.3s cubic-bezier(0.5, 0, 0.5, 1);
35
+ top: 0;
36
+ left: 0;
23
37
  }
24
38
  .date__label--required::after {
25
39
  content: "*";
26
- margin-left: 5px;
27
- color: #666666;
40
+ font-family: inherit;
41
+ color: #2A3841;
42
+ margin-left: 2px;
28
43
  }
29
44
  .date__input {
45
+ border: none;
30
46
  width: inherit;
31
- padding: 15px 6px;
32
47
  position: relative;
33
- border: none;
34
- border-bottom: 3px solid #666666;
35
- background-color: transparent;
36
- color: #666666;
37
- font-size: 16px;
38
- font-family: inherit;
39
48
  }
40
- .date__input:focus {
41
- outline: none;
42
- box-shadow: 0 5px 5px rgba(16, 15, 15, 0.1);
49
+ .date__input[focused]::part(input-field) {
50
+ border-color: #3E3E3E;
43
51
  }
44
- .date__input::placeholder {
45
- color: #666666;
52
+ .date__input[invalid]::part(input-field) {
53
+ border-color: #cc0000b3;
46
54
  }
47
- .date__input--invalid {
48
- border-bottom: 3px solid #cc0000;
49
- }
50
- .date__input:placeholder-shown + .date__label {
51
- opacity: 0;
52
- visibility: hidden;
53
- transform: translateY(0);
55
+ .date__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;
54
67
  }
55
68
  .date__error-message {
56
69
  position: absolute;
57
70
  top: calc(100% + 5px);
58
71
  left: 0;
59
- color: #cc0000;
72
+ color: #cc0000b3;
73
+ }
74
+ .date__tooltip-icon {
75
+ position: absolute;
76
+ right: 0;
77
+ bottom: 10px;
78
+ }
79
+ .date__tooltip {
80
+ position: absolute;
81
+ bottom: 35px;
82
+ right: 10px;
83
+ background-color: #FFFFFF;
84
+ border: 1px solid #B0B0B0;
85
+ color: #2B2D3F;
86
+ padding: 10px;
87
+ border-radius: 5px;
88
+ opacity: 0;
89
+ transition: opacity 0.3s ease-in-out;
90
+ z-index: 10;
91
+ }
92
+ .date__tooltip.visible {
93
+ opacity: 1;
60
94
  }
@@ -1,6 +1,39 @@
1
- import { Component, h, State, Prop, Watch, Event } from '@stencil/core';
1
+ import { Component, h, State, Prop, Watch, Event, Element, Listen } from '@stencil/core';
2
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';
3
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
+ }
4
37
  validityChanged() {
5
38
  this.validityStateHandler({ valid: this.isValid, name: this.name });
6
39
  if (this.emitValue == true) {
@@ -18,17 +51,56 @@ export class DateInput {
18
51
  valueHandler(inputValueEvent) {
19
52
  this.sendInputValue.emit(inputValueEvent);
20
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;
71
+ }
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 });
82
+ }
83
+ }
21
84
  handleInput(event) {
22
85
  this.value = event.target.value;
23
- this.errorMessage = this.setErrorMessage();
86
+ this.touched = true;
87
+ this.valueAsDate = dateFnsParse(this.value || '', 'yyyy-MM-dd', new Date());
24
88
  this.isValid = this.setValidity();
25
- this.validityStateHandler({ valid: this.isValid, name: this.name });
89
+ this.errorMessage = this.setErrorMessage();
26
90
  this.emitValueHandler(true);
27
91
  }
28
92
  setValidity() {
29
- return this.inputReference.validity.valid;
93
+ if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
94
+ return false;
95
+ }
96
+ else {
97
+ return this.inputReference.validity.valid;
98
+ }
30
99
  }
31
100
  setErrorMessage() {
101
+ if (isBefore(this.valueAsDate, this.minDate) || isAfter(this.valueAsDate, this.maxDate)) {
102
+ return translate('dateError2', this.language);
103
+ }
32
104
  if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
33
105
  return translate('dateError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
34
106
  }
@@ -36,14 +108,27 @@ export class DateInput {
36
108
  return translate('requiredError', this.language);
37
109
  }
38
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 }));
114
+ }
115
+ return null;
116
+ }
39
117
  render() {
40
- return h("div", { class: 'date__wrapper' },
41
- h("input", { id: `${this.name}__input`, type: 'date', class: `date__input`, value: this.defaultValue, placeholder: `${this.displayName} ${this.validation.mandatory ? '*' : ''}`, ref: (el) => this.inputReference = el, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: (e) => this.handleInput(e) }),
118
+ let invalidClass = '';
119
+ if (this.touched) {
120
+ invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
121
+ }
122
+ return h("div", { class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el },
42
123
  h("label", { class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` },
43
124
  this.displayName,
44
125
  " ",
45
126
  this.validation.mandatory ? '*' : ''),
46
- h("small", { class: 'date__error-message' }, this.errorMessage));
127
+ 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 }),
128
+ h("small", { class: 'date__error-message' }, this.errorMessage),
129
+ this.tooltip &&
130
+ h("img", { class: 'date__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
131
+ this.renderTooltip());
47
132
  }
48
133
  static get is() { return "date-input"; }
49
134
  static get encapsulation() { return "shadow"; }
@@ -69,7 +154,7 @@ export class DateInput {
69
154
  "text": "Name of the input."
70
155
  },
71
156
  "attribute": "name",
72
- "reflect": false
157
+ "reflect": true
73
158
  },
74
159
  "displayName": {
75
160
  "type": "string",
@@ -86,7 +171,24 @@ export class DateInput {
86
171
  "text": "Name of input to be shown to the user."
87
172
  },
88
173
  "attribute": "display-name",
89
- "reflect": false
174
+ "reflect": true
175
+ },
176
+ "placeholder": {
177
+ "type": "string",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "string",
181
+ "resolved": "string",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": "Placeholder text to be shown."
189
+ },
190
+ "attribute": "placeholder",
191
+ "reflect": true
90
192
  },
91
193
  "validation": {
92
194
  "type": "unknown",
@@ -123,7 +225,41 @@ export class DateInput {
123
225
  "text": "Default value for the input."
124
226
  },
125
227
  "attribute": "default-value",
126
- "reflect": false
228
+ "reflect": true
229
+ },
230
+ "autofilled": {
231
+ "type": "boolean",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "boolean",
235
+ "resolved": "boolean",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "Boolean. Determines if input should be readonly."
243
+ },
244
+ "attribute": "autofilled",
245
+ "reflect": true
246
+ },
247
+ "tooltip": {
248
+ "type": "string",
249
+ "mutable": false,
250
+ "complexType": {
251
+ "original": "string",
252
+ "resolved": "string",
253
+ "references": {}
254
+ },
255
+ "required": false,
256
+ "optional": false,
257
+ "docs": {
258
+ "tags": [],
259
+ "text": "Tooltip text."
260
+ },
261
+ "attribute": "tooltip",
262
+ "reflect": true
127
263
  },
128
264
  "language": {
129
265
  "type": "string",
@@ -140,7 +276,7 @@ export class DateInput {
140
276
  "text": "Currently selected language."
141
277
  },
142
278
  "attribute": "language",
143
- "reflect": false
279
+ "reflect": true
144
280
  },
145
281
  "emitValue": {
146
282
  "type": "boolean",
@@ -157,12 +293,49 @@ export class DateInput {
157
293
  "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
158
294
  },
159
295
  "attribute": "emit-value",
160
- "reflect": false
296
+ "reflect": true
297
+ },
298
+ "clientStyling": {
299
+ "type": "string",
300
+ "mutable": false,
301
+ "complexType": {
302
+ "original": "string",
303
+ "resolved": "string",
304
+ "references": {}
305
+ },
306
+ "required": false,
307
+ "optional": false,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Client custom styling via inline style"
311
+ },
312
+ "attribute": "client-styling",
313
+ "reflect": true,
314
+ "defaultValue": "''"
315
+ },
316
+ "dateFormat": {
317
+ "type": "string",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "string",
321
+ "resolved": "string",
322
+ "references": {}
323
+ },
324
+ "required": false,
325
+ "optional": false,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "Date format for date picker."
329
+ },
330
+ "attribute": "date-format",
331
+ "reflect": true
161
332
  }
162
333
  }; }
163
334
  static get states() { return {
164
335
  "errorMessage": {},
165
- "isValid": {}
336
+ "isValid": {},
337
+ "limitStylingAppends": {},
338
+ "showTooltip": {}
166
339
  }; }
167
340
  static get events() { return [{
168
341
  "method": "sendValidityState",
@@ -205,6 +378,7 @@ export class DateInput {
205
378
  }
206
379
  }
207
380
  }]; }
381
+ static get elementRef() { return "element"; }
208
382
  static get watchers() { return [{
209
383
  "propName": "isValid",
210
384
  "methodName": "validityChanged"
@@ -212,4 +386,11 @@ export class DateInput {
212
386
  "propName": "emitValue",
213
387
  "methodName": "emitValueHandler"
214
388
  }]; }
389
+ static get listeners() { return [{
390
+ "name": "click",
391
+ "method": "handleClickOutside",
392
+ "target": "document",
393
+ "capture": false,
394
+ "passive": false
395
+ }]; }
215
396
  }