@getflip/swirl-components 0.245.0 → 0.246.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.
- package/components.json +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-date-input.cjs.entry.js +8 -5
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-date-input/swirl-date-input.js +9 -4
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-date-input.js +10 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-date-input.entry.js +8 -5
- package/dist/swirl-components/p-4eee9225.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-date-input/swirl-date-input.d.ts +1 -0
- package/package.json +1 -1
- package/dist/swirl-components/p-2702437c.entry.js +0 -1
|
@@ -14,7 +14,6 @@ export class SwirlDateInput {
|
|
|
14
14
|
const value = event.target.value;
|
|
15
15
|
if (value === "") {
|
|
16
16
|
this.value = undefined;
|
|
17
|
-
this.valueChange.emit(undefined);
|
|
18
17
|
}
|
|
19
18
|
const newDate = parse(value, this.format, new Date());
|
|
20
19
|
// First, escape any backslashes in the format string
|
|
@@ -30,7 +29,6 @@ export class SwirlDateInput {
|
|
|
30
29
|
}
|
|
31
30
|
const newValue = format(newDate, internalDateFormat);
|
|
32
31
|
this.value = newValue;
|
|
33
|
-
this.valueChange.emit(newValue);
|
|
34
32
|
};
|
|
35
33
|
this.onInput = (event) => {
|
|
36
34
|
this.onChange(event);
|
|
@@ -60,7 +58,6 @@ export class SwirlDateInput {
|
|
|
60
58
|
const newDateValue = event.detail;
|
|
61
59
|
const newValue = format(newDateValue, internalDateFormat);
|
|
62
60
|
this.value = newValue;
|
|
63
|
-
this.valueChange.emit(newValue);
|
|
64
61
|
this.setReadOnly(true);
|
|
65
62
|
this.pickerPopover.close();
|
|
66
63
|
};
|
|
@@ -105,6 +102,11 @@ export class SwirlDateInput {
|
|
|
105
102
|
watchFormat() {
|
|
106
103
|
this.setupMask();
|
|
107
104
|
}
|
|
105
|
+
watchValue(newValue, oldValue) {
|
|
106
|
+
if (newValue !== oldValue) {
|
|
107
|
+
this.valueChange.emit(newValue);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
108
110
|
focus() {
|
|
109
111
|
setTimeout(() => {
|
|
110
112
|
this.inputEl.focus();
|
|
@@ -146,7 +148,7 @@ export class SwirlDateInput {
|
|
|
146
148
|
const className = classnames("date-input", {
|
|
147
149
|
"date-input--inline": this.inline,
|
|
148
150
|
});
|
|
149
|
-
return (h(Host, { key: '
|
|
151
|
+
return (h(Host, { key: '4fecdc2c5c3c8867366412afb5bd291dd54c80a9' }, h("div", { key: '86985bdee20db680754d5c4ac43600d98c7925e6', class: className }, h("input", { key: 'c176c65c65304c05da96e75a439b2a0cd5c2f7d7', "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "date-input__input", disabled: this.disabled, readonly: this.readonly, id: this.id, inputmode: "numeric", onClick: this.onClick, onMouseDown: this.onMouseDown, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, placeholder: this.placeholder, ref: (el) => (this.inputEl = el), required: this.required, type: "text", value: displayValue }), h("swirl-popover-trigger", { key: '61deaa551a562cf9db853ac9f8d5c0c219df63c3', swirlPopover: `popover-${this.id}` }, h("button", { key: '6410e2ea408f1c31999acb4f0730ce8a1cf3d03e', "aria-label": this.datePickerTriggerLabel, class: "date-input__date-picker-button", disabled: this.disabled, type: "button" }, h("swirl-icon-today", { key: 'f613cf3eee53f7f77326988526ac9b4cd4824b96', size: this.iconSize })))), !this.disabled && (h("swirl-popover", { key: '693df7dab5cbf40b292d2a1ef7f8380e106a45d4', animation: "scale-in-y", id: `popover-${this.id}`, label: this.datePickerLabel, placement: "bottom-end", ref: (el) => (this.pickerPopover = el) }, h("swirl-date-picker", { key: 'c13127734a990e3cbb1c3c8831e9aec6398b40d7', disableDate: this.datePickerDisableDate, firstDayOfWeek: this.firstDayOfWeek, labels: this.labels, locale: this.locale, onValueChange: this.onPickDate, value: dateValue, startDate: dateValue })))));
|
|
150
152
|
}
|
|
151
153
|
static get is() { return "swirl-date-input"; }
|
|
152
154
|
static get encapsulation() { return "scoped"; }
|
|
@@ -512,6 +514,9 @@ export class SwirlDateInput {
|
|
|
512
514
|
return [{
|
|
513
515
|
"propName": "format",
|
|
514
516
|
"methodName": "watchFormat"
|
|
517
|
+
}, {
|
|
518
|
+
"propName": "value",
|
|
519
|
+
"methodName": "watchValue"
|
|
515
520
|
}];
|
|
516
521
|
}
|
|
517
522
|
}
|