@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.
Files changed (35) hide show
  1. package/dist/cjs/six-date.cjs.entry.js +38 -33
  2. package/dist/cjs/six-date.cjs.entry.js.map +1 -1
  3. package/dist/cjs/six-date.entry.cjs.js.map +1 -1
  4. package/dist/cjs/six-datepicker.cjs.entry.js +3 -3
  5. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  6. package/dist/cjs/six-datepicker.entry.cjs.js.map +1 -1
  7. package/dist/collection/components/six-date/iso-date.js +32 -0
  8. package/dist/collection/components/six-date/iso-date.js.map +1 -1
  9. package/dist/collection/components/six-date/six-date.js +7 -34
  10. package/dist/collection/components/six-date/six-date.js.map +1 -1
  11. package/dist/collection/components/six-datepicker/six-datepicker.js +4 -4
  12. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  13. package/dist/components/six-date.js +38 -33
  14. package/dist/components/six-date.js.map +1 -1
  15. package/dist/components/six-datepicker.js +3 -3
  16. package/dist/components/six-datepicker.js.map +1 -1
  17. package/dist/components.json +4 -4
  18. package/dist/esm/six-date.entry.js +38 -33
  19. package/dist/esm/six-date.entry.js.map +1 -1
  20. package/dist/esm/six-datepicker.entry.js +3 -3
  21. package/dist/esm/six-datepicker.entry.js.map +1 -1
  22. package/dist/types/components/six-date/iso-date.d.ts +2 -0
  23. package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
  24. package/dist/types/components.d.ts +4 -4
  25. package/dist/ui-library/p-38c51fd1.entry.js +2 -0
  26. package/dist/ui-library/p-38c51fd1.entry.js.map +1 -0
  27. package/dist/ui-library/{p-18e755bc.entry.js → p-c33533c4.entry.js} +2 -2
  28. package/dist/ui-library/p-c33533c4.entry.js.map +1 -0
  29. package/dist/ui-library/six-date.entry.esm.js.map +1 -1
  30. package/dist/ui-library/six-datepicker.entry.esm.js.map +1 -1
  31. package/dist/ui-library/ui-library.esm.js +1 -1
  32. package/package.json +1 -1
  33. package/dist/ui-library/p-18e755bc.entry.js.map +0 -1
  34. package/dist/ui-library/p-3dc98466.entry.js +0 -2
  35. 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
- switch (this.selectionMode) {
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
- if (this.selectionMode === 'day') {
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: '2fccfb9c005bf6ac4906be3735c3b0fc61bfad8f', class: "container" }, h("six-input", { key: '453bf29f4aec7bc192d1bc5191c7f74a93f0ac48', 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: '93e4add573a5617e9f90e9e8060a9a3a6ec10b98', 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: '5fb919b6861ed8307de1105c881350d4094bbf52', id: "date-format", class: "sr-only" }, translateFormatHelp(this.language, this.dateFormat)), h("div", { key: 'ccddb6c5b5c49f77d31d2d0c75742cc0ffbda2ee', ref: (el) => (this.positioner = el), class: "positioner" }, h("div", { key: '3eec69b5bac555fd542cab3a967700403af68750', class: "panel", ref: (el) => (this.panel = el) }, h("header", { key: 'a16e0c72e430580b0f0c229476b7c45ea50e194a', class: "panel__header" }, h("six-icon-button", { key: 'bfc02505301c5264de2934f3f4f3fcea52cacf07', tabindex: "-1", class: "previous", onClick: this.handlePreviousClick, name: "arrow_back_ios" }), this.selectionMode === 'day' && (h("div", { key: '2f64e3cc6f2ee9326c953f81b1ea6a3f5ab13551', class: "selector", onClick: () => (this.selectionMode = 'month') }, translateMonth(this.pointerDate.month, this.language), h("six-icon", { key: '9372e403d994348716322f39d7e30971c3d37842' }, "arrow_drop_down"))), this.selectionMode !== 'year' && (h("div", { key: '16a3de3dd5207eeb91d341a02b93b11e707f3372', class: "selector", onClick: () => (this.selectionMode = 'year') }, this.pointerDate.year, h("six-icon", { key: '81024acff597b548875a7500cbb5aab7ba47952e' }, "arrow_drop_down"))), this.selectionMode === 'year' && (h("div", { key: 'f8615b0ca8ce732a18776e3677a997fd43d9fac4', 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: '0e689a5621ae8a62415c4a19efb64a983b720115', tabindex: "-1", class: "next", onClick: this.handleNextClick, name: "arrow_forward_ios" })), this.selectionMode === 'day' && (h(DaySelection, { key: '6fe9920a9449418460e069eefa96adda867c2eb3', language: this.language, calendarGrid: createCalendarGrid({
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: 'ad02bb9d8b6c96abf77ccd30585490b2236fbfd0', language: this.language, selected: this.value, monthClicked: this.handleMonthClicked })), this.selectionMode === 'year' && (h(YearSelection, { key: 'a14118d8b9ec16182522d1de6dc12d9026ef3aa3', selected: this.value, pointerYear: this.pointerDate.year, yearCount: NUMBER_OF_YEARS_SHOWN, yearClicked: this.handleYearClicked }))))));
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 {