@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
|
@@ -22212,6 +22212,38 @@ function toPointerDate(isoDate) {
|
|
|
22212
22212
|
day: parseInt(isoDate.slice(8), 10),
|
|
22213
22213
|
};
|
|
22214
22214
|
}
|
|
22215
|
+
function nextPointerDate(selectionMode, pointerDate) {
|
|
22216
|
+
if (selectionMode === 'day') {
|
|
22217
|
+
if (pointerDate.month === 12) {
|
|
22218
|
+
return { year: pointerDate.year + 1, month: 1, day: 1 };
|
|
22219
|
+
}
|
|
22220
|
+
else {
|
|
22221
|
+
return { year: pointerDate.year, month: pointerDate.month + 1, day: 1 };
|
|
22222
|
+
}
|
|
22223
|
+
}
|
|
22224
|
+
else if (selectionMode === 'month') {
|
|
22225
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 1 });
|
|
22226
|
+
}
|
|
22227
|
+
else if (selectionMode === 'year') {
|
|
22228
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 25 });
|
|
22229
|
+
}
|
|
22230
|
+
return pointerDate;
|
|
22231
|
+
}
|
|
22232
|
+
function previousPointerDate(selectionMode, pointerDate) {
|
|
22233
|
+
switch (selectionMode) {
|
|
22234
|
+
case 'day':
|
|
22235
|
+
if (pointerDate.month === 1) {
|
|
22236
|
+
return { year: pointerDate.year - 1, month: 12, day: 1 };
|
|
22237
|
+
}
|
|
22238
|
+
else {
|
|
22239
|
+
return { year: pointerDate.year, month: pointerDate.month - 1, day: 1 };
|
|
22240
|
+
}
|
|
22241
|
+
case 'month':
|
|
22242
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 1 });
|
|
22243
|
+
case 'year':
|
|
22244
|
+
return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 25 });
|
|
22245
|
+
}
|
|
22246
|
+
}
|
|
22215
22247
|
function todayAsPointerDate() {
|
|
22216
22248
|
const today = new Date();
|
|
22217
22249
|
return {
|
|
@@ -22501,38 +22533,10 @@ const SixDate = class {
|
|
|
22501
22533
|
this.clearable = false;
|
|
22502
22534
|
this.panelHideInProgress = false;
|
|
22503
22535
|
this.handlePreviousClick = () => {
|
|
22504
|
-
|
|
22505
|
-
case 'day':
|
|
22506
|
-
if (this.pointerDate.month === 0) {
|
|
22507
|
-
this.pointerDate = { year: this.pointerDate.year - 1, month: 11, day: 1 };
|
|
22508
|
-
}
|
|
22509
|
-
else {
|
|
22510
|
-
this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month - 1, day: 1 };
|
|
22511
|
-
}
|
|
22512
|
-
break;
|
|
22513
|
-
case 'month':
|
|
22514
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - 1 });
|
|
22515
|
-
break;
|
|
22516
|
-
case 'year':
|
|
22517
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - NUMBER_OF_YEARS_SHOWN });
|
|
22518
|
-
break;
|
|
22519
|
-
}
|
|
22536
|
+
this.pointerDate = previousPointerDate(this.selectionMode, this.pointerDate);
|
|
22520
22537
|
};
|
|
22521
22538
|
this.handleNextClick = () => {
|
|
22522
|
-
|
|
22523
|
-
if (this.pointerDate.month === 11) {
|
|
22524
|
-
this.pointerDate = { year: this.pointerDate.year + 1, month: 0, day: 1 };
|
|
22525
|
-
}
|
|
22526
|
-
else {
|
|
22527
|
-
this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month + 1, day: 1 };
|
|
22528
|
-
}
|
|
22529
|
-
}
|
|
22530
|
-
else if (this.selectionMode === 'month') {
|
|
22531
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + 1 });
|
|
22532
|
-
}
|
|
22533
|
-
else if (this.selectionMode === 'year') {
|
|
22534
|
-
this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + NUMBER_OF_YEARS_SHOWN });
|
|
22535
|
-
}
|
|
22539
|
+
this.pointerDate = nextPointerDate(this.selectionMode, this.pointerDate);
|
|
22536
22540
|
};
|
|
22537
22541
|
this.handleDocumentMouseDown = (event) => {
|
|
22538
22542
|
const baseElement = this.getSixInputBaseElement();
|
|
@@ -22614,6 +22618,7 @@ const SixDate = class {
|
|
|
22614
22618
|
if (warning != null) {
|
|
22615
22619
|
console.warn(warning);
|
|
22616
22620
|
}
|
|
22621
|
+
this.updateInputElementValue();
|
|
22617
22622
|
}
|
|
22618
22623
|
getSixInputBaseElement() {
|
|
22619
22624
|
var _a, _b;
|
|
@@ -22654,7 +22659,7 @@ const SixDate = class {
|
|
|
22654
22659
|
});
|
|
22655
22660
|
}
|
|
22656
22661
|
updateInputElementValue() {
|
|
22657
|
-
if (this.inputElement) {
|
|
22662
|
+
if (this.inputElement && document.activeElement !== this.host) {
|
|
22658
22663
|
this.inputElement.value = this.value === '' ? '' : formatDate(this.value, this.dateFormat);
|
|
22659
22664
|
}
|
|
22660
22665
|
}
|
|
@@ -22675,7 +22680,7 @@ const SixDate = class {
|
|
|
22675
22680
|
this.popoverHelper = undefined;
|
|
22676
22681
|
}
|
|
22677
22682
|
render() {
|
|
22678
|
-
return (h("div", { key: '
|
|
22683
|
+
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({
|
|
22679
22684
|
year: this.pointerDate.year,
|
|
22680
22685
|
month: this.pointerDate.month,
|
|
22681
22686
|
selected: this.value || undefined,
|
|
@@ -22683,7 +22688,7 @@ const SixDate = class {
|
|
|
22683
22688
|
maxDate: this.max,
|
|
22684
22689
|
dateFormat: this.dateFormat,
|
|
22685
22690
|
allowedDates: this.allowedDates,
|
|
22686
|
-
}), dayClicked: this.handleDayClick })), this.selectionMode === 'month' && (h(MonthSelection, { key: '
|
|
22691
|
+
}), 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 }))))));
|
|
22687
22692
|
}
|
|
22688
22693
|
get host() { return getElement(this); }
|
|
22689
22694
|
static get watchers() { return {
|