@six-group/ui-library 5.0.0-rc.2 → 5.0.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/dist/cjs/six-date.cjs.entry.js +38 -33
- package/dist/cjs/six-date.cjs.entry.js.map +1 -1
- package/dist/cjs/six-date.entry.cjs.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +3 -3
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.entry.cjs.js.map +1 -1
- package/dist/collection/components/six-date/iso-date.js +32 -0
- package/dist/collection/components/six-date/iso-date.js.map +1 -1
- package/dist/collection/components/six-date/six-date.js +7 -34
- package/dist/collection/components/six-date/six-date.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +4 -4
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/components/six-date.js +38 -33
- package/dist/components/six-date.js.map +1 -1
- package/dist/components/six-datepicker.js +3 -3
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components.json +4 -4
- package/dist/esm/six-date.entry.js +38 -33
- package/dist/esm/six-date.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +3 -3
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/types/components/six-date/iso-date.d.ts +2 -0
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
- package/dist/types/components.d.ts +4 -4
- package/dist/ui-library/p-38c51fd1.entry.js +2 -0
- package/dist/ui-library/p-38c51fd1.entry.js.map +1 -0
- package/dist/ui-library/{p-18e755bc.entry.js → p-c33533c4.entry.js} +2 -2
- package/dist/ui-library/p-c33533c4.entry.js.map +1 -0
- package/dist/ui-library/six-date.entry.esm.js.map +1 -1
- package/dist/ui-library/six-datepicker.entry.esm.js.map +1 -1
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/package.json +1 -1
- package/dist/ui-library/p-18e755bc.entry.js.map +0 -1
- package/dist/ui-library/p-3dc98466.entry.js +0 -2
- package/dist/ui-library/p-3dc98466.entry.js.map +0 -1
|
@@ -22216,6 +22216,38 @@ function toPointerDate(isoDate) {
|
|
|
22216
22216
|
day: parseInt(isoDate.slice(8), 10),
|
|
22217
22217
|
};
|
|
22218
22218
|
}
|
|
22219
|
+
function nextPointerDate(selectionMode, pointerDate) {
|
|
22220
|
+
if (selectionMode === 'day') {
|
|
22221
|
+
if (pointerDate.month === 12) {
|
|
22222
|
+
return { year: pointerDate.year + 1, month: 1, day: 1 };
|
|
22223
|
+
}
|
|
22224
|
+
else {
|
|
22225
|
+
return { year: pointerDate.year, month: pointerDate.month + 1, day: 1 };
|
|
22226
|
+
}
|
|
22227
|
+
}
|
|
22228
|
+
else if (selectionMode === 'month') {
|
|
22229
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 1 });
|
|
22230
|
+
}
|
|
22231
|
+
else if (selectionMode === 'year') {
|
|
22232
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 25 });
|
|
22233
|
+
}
|
|
22234
|
+
return pointerDate;
|
|
22235
|
+
}
|
|
22236
|
+
function previousPointerDate(selectionMode, pointerDate) {
|
|
22237
|
+
switch (selectionMode) {
|
|
22238
|
+
case 'day':
|
|
22239
|
+
if (pointerDate.month === 1) {
|
|
22240
|
+
return { year: pointerDate.year - 1, month: 12, day: 1 };
|
|
22241
|
+
}
|
|
22242
|
+
else {
|
|
22243
|
+
return { year: pointerDate.year, month: pointerDate.month - 1, day: 1 };
|
|
22244
|
+
}
|
|
22245
|
+
case 'month':
|
|
22246
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 1 });
|
|
22247
|
+
case 'year':
|
|
22248
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 25 });
|
|
22249
|
+
}
|
|
22250
|
+
}
|
|
22219
22251
|
function todayAsPointerDate() {
|
|
22220
22252
|
const today = new Date();
|
|
22221
22253
|
return {
|
|
@@ -22507,38 +22539,10 @@ const SixDate$1 = /*@__PURE__*/ proxyCustomElement(class SixDate extends H {
|
|
|
22507
22539
|
this.clearable = false;
|
|
22508
22540
|
this.panelHideInProgress = false;
|
|
22509
22541
|
this.handlePreviousClick = () => {
|
|
22510
|
-
|
|
22511
|
-
case 'day':
|
|
22512
|
-
if (this.pointerDate.month === 0) {
|
|
22513
|
-
this.pointerDate = { year: this.pointerDate.year - 1, month: 11, day: 1 };
|
|
22514
|
-
}
|
|
22515
|
-
else {
|
|
22516
|
-
this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month - 1, day: 1 };
|
|
22517
|
-
}
|
|
22518
|
-
break;
|
|
22519
|
-
case 'month':
|
|
22520
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - 1 });
|
|
22521
|
-
break;
|
|
22522
|
-
case 'year':
|
|
22523
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - NUMBER_OF_YEARS_SHOWN });
|
|
22524
|
-
break;
|
|
22525
|
-
}
|
|
22542
|
+
this.pointerDate = previousPointerDate(this.selectionMode, this.pointerDate);
|
|
22526
22543
|
};
|
|
22527
22544
|
this.handleNextClick = () => {
|
|
22528
|
-
|
|
22529
|
-
if (this.pointerDate.month === 11) {
|
|
22530
|
-
this.pointerDate = { year: this.pointerDate.year + 1, month: 0, day: 1 };
|
|
22531
|
-
}
|
|
22532
|
-
else {
|
|
22533
|
-
this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month + 1, day: 1 };
|
|
22534
|
-
}
|
|
22535
|
-
}
|
|
22536
|
-
else if (this.selectionMode === 'month') {
|
|
22537
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + 1 });
|
|
22538
|
-
}
|
|
22539
|
-
else if (this.selectionMode === 'year') {
|
|
22540
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + NUMBER_OF_YEARS_SHOWN });
|
|
22541
|
-
}
|
|
22545
|
+
this.pointerDate = nextPointerDate(this.selectionMode, this.pointerDate);
|
|
22542
22546
|
};
|
|
22543
22547
|
this.handleDocumentMouseDown = (event) => {
|
|
22544
22548
|
const baseElement = this.getSixInputBaseElement();
|
|
@@ -22620,6 +22624,7 @@ const SixDate$1 = /*@__PURE__*/ proxyCustomElement(class SixDate extends H {
|
|
|
22620
22624
|
if (warning != null) {
|
|
22621
22625
|
console.warn(warning);
|
|
22622
22626
|
}
|
|
22627
|
+
this.updateInputElementValue();
|
|
22623
22628
|
}
|
|
22624
22629
|
getSixInputBaseElement() {
|
|
22625
22630
|
var _a, _b;
|
|
@@ -22660,7 +22665,7 @@ const SixDate$1 = /*@__PURE__*/ proxyCustomElement(class SixDate extends H {
|
|
|
22660
22665
|
});
|
|
22661
22666
|
}
|
|
22662
22667
|
updateInputElementValue() {
|
|
22663
|
-
if (this.inputElement) {
|
|
22668
|
+
if (this.inputElement && document.activeElement !== this.host) {
|
|
22664
22669
|
this.inputElement.value = this.value === '' ? '' : formatDate(this.value, this.dateFormat);
|
|
22665
22670
|
}
|
|
22666
22671
|
}
|
|
@@ -22681,7 +22686,7 @@ const SixDate$1 = /*@__PURE__*/ proxyCustomElement(class SixDate extends H {
|
|
|
22681
22686
|
this.popoverHelper = undefined;
|
|
22682
22687
|
}
|
|
22683
22688
|
render() {
|
|
22684
|
-
return (h("div", { key: '
|
|
22689
|
+
return (h("div", { key: '67c2f836f5a0ea61277913ca44a80293eedd918b', class: "container" }, h("six-input", { key: '5286b304057f010d92449309174cd773196ae475', ref: (el) => (this.inputElement = el), placeholder: this.placeholder == null ? this.dateFormat : this.placeholder, readonly: this.readonly, disabled: this.disabled, name: this.name, label: this.label, required: this.required, helpText: this.helpText, errorText: this.errorText, errorTextCount: this.errorTextCount, invalid: this.invalid, onKeyDown: this.handleInputKeyDown, onInput: this.handleInputChange, onBlur: this.handleInputBlur, "onSix-input-clear": this.handleInputClearClick, size: this.size, clearable: this.clearable, "aria-describedby": "date-format" }, h("six-icon", { key: '703b5a74be97b95359fc5fc368d798296dde318b', slot: "prefix", size: this.size === 'large' ? 'medium' : this.size }, "today"), hasSlot(this.host, 'label') ? (h("span", { slot: "label" }, h("slot", { name: "label" }))) : null, hasSlot(this.host, 'error-text') ? (h("span", { slot: "error-text" }, h("slot", { name: "error-text" }))) : null, hasSlot(this.host, 'help-text') ? (h("span", { slot: "help-text" }, h("slot", { name: "help-text" }))) : null), h("span", { key: 'fc7017ccfb60c332d81dda8b119ab86ee3bca1ce', id: "date-format", class: "sr-only" }, translateFormatHelp(this.language, this.dateFormat)), h("div", { key: '7426abbf8087e77dde6fb636454f1560ff9cb9da', ref: (el) => (this.positioner = el), class: "positioner" }, h("div", { key: '00596fb0f2710d52bdf8a74b0778622e73a7d998', class: "panel", ref: (el) => (this.panel = el) }, h("header", { key: '0bd4e94ee5e1ee032c98fb03b02f5835b86a1ba1', class: "panel__header" }, h("six-icon-button", { key: '54d5d8a3bdfa458f86b45f47fdc1742a9b355b2e', tabindex: "-1", class: "previous", onClick: this.handlePreviousClick, name: "arrow_back_ios" }), this.selectionMode === 'day' && (h("div", { key: '897b517718904cd3ddc2db09a8c69dbda8c941b5', class: "selector", onClick: () => (this.selectionMode = 'month') }, translateMonth(this.pointerDate.month, this.language), h("six-icon", { key: 'e3b05945fec95ee7d50ffff1758ac763b89773f9' }, "arrow_drop_down"))), this.selectionMode !== 'year' && (h("div", { key: '856d4133e83d45b76213391486b6365d30770e98', class: "selector", onClick: () => (this.selectionMode = 'year') }, this.pointerDate.year, h("six-icon", { key: '9e9318767a8e89c5e783dda3c6265a5adb88cb1f' }, "arrow_drop_down"))), this.selectionMode === 'year' && (h("div", { key: '52cbce14c980cab96acd2dccbb73a147ddf44373', class: "selector" }, this.pointerDate.year - Math.floor(NUMBER_OF_YEARS_SHOWN / 2), " \u2013", ' ', this.pointerDate.year + Math.floor(NUMBER_OF_YEARS_SHOWN / 2))), h("six-icon-button", { key: '421c1577505136a613405b4c878dc18ce49df323', tabindex: "-1", class: "next", onClick: this.handleNextClick, name: "arrow_forward_ios" })), this.selectionMode === 'day' && (h(DaySelection, { key: '7354b17d7e70534be7f3aaad0225156bbdd4a186', language: this.language, calendarGrid: createCalendarGrid({
|
|
22685
22690
|
year: this.pointerDate.year,
|
|
22686
22691
|
month: this.pointerDate.month,
|
|
22687
22692
|
selected: this.value || undefined,
|
|
@@ -22689,7 +22694,7 @@ const SixDate$1 = /*@__PURE__*/ proxyCustomElement(class SixDate extends H {
|
|
|
22689
22694
|
maxDate: this.max,
|
|
22690
22695
|
dateFormat: this.dateFormat,
|
|
22691
22696
|
allowedDates: this.allowedDates,
|
|
22692
|
-
}), dayClicked: this.handleDayClick })), this.selectionMode === 'month' && (h(MonthSelection, { key: '
|
|
22697
|
+
}), dayClicked: this.handleDayClick })), this.selectionMode === 'month' && (h(MonthSelection, { key: '6055bd60a6deebdb8308a3c8ad66cfde9f1e2e7c', language: this.language, selected: this.value, monthClicked: this.handleMonthClicked })), this.selectionMode === 'year' && (h(YearSelection, { key: 'f0cf7fbc0ac3b72b53e5aa9c57207bba91c718b7', selected: this.value, pointerYear: this.pointerDate.year, yearCount: NUMBER_OF_YEARS_SHOWN, yearClicked: this.handleYearClicked }))))));
|
|
22693
22698
|
}
|
|
22694
22699
|
get host() { return this; }
|
|
22695
22700
|
static get watchers() { return {
|