@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
@@ -22214,6 +22214,38 @@ function toPointerDate(isoDate) {
22214
22214
  day: parseInt(isoDate.slice(8), 10),
22215
22215
  };
22216
22216
  }
22217
+ function nextPointerDate(selectionMode, pointerDate) {
22218
+ if (selectionMode === 'day') {
22219
+ if (pointerDate.month === 12) {
22220
+ return { year: pointerDate.year + 1, month: 1, day: 1 };
22221
+ }
22222
+ else {
22223
+ return { year: pointerDate.year, month: pointerDate.month + 1, day: 1 };
22224
+ }
22225
+ }
22226
+ else if (selectionMode === 'month') {
22227
+ return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 1 });
22228
+ }
22229
+ else if (selectionMode === 'year') {
22230
+ return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year + 25 });
22231
+ }
22232
+ return pointerDate;
22233
+ }
22234
+ function previousPointerDate(selectionMode, pointerDate) {
22235
+ switch (selectionMode) {
22236
+ case 'day':
22237
+ if (pointerDate.month === 1) {
22238
+ return { year: pointerDate.year - 1, month: 12, day: 1 };
22239
+ }
22240
+ else {
22241
+ return { year: pointerDate.year, month: pointerDate.month - 1, day: 1 };
22242
+ }
22243
+ case 'month':
22244
+ return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 1 });
22245
+ case 'year':
22246
+ return Object.assign(Object.assign({}, pointerDate), { year: pointerDate.year - 25 });
22247
+ }
22248
+ }
22217
22249
  function todayAsPointerDate() {
22218
22250
  const today = new Date();
22219
22251
  return {
@@ -22503,38 +22535,10 @@ const SixDate = class {
22503
22535
  this.clearable = false;
22504
22536
  this.panelHideInProgress = false;
22505
22537
  this.handlePreviousClick = () => {
22506
- switch (this.selectionMode) {
22507
- case 'day':
22508
- if (this.pointerDate.month === 0) {
22509
- this.pointerDate = { year: this.pointerDate.year - 1, month: 11, day: 1 };
22510
- }
22511
- else {
22512
- this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month - 1, day: 1 };
22513
- }
22514
- break;
22515
- case 'month':
22516
- this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - 1 });
22517
- break;
22518
- case 'year':
22519
- this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year - NUMBER_OF_YEARS_SHOWN });
22520
- break;
22521
- }
22538
+ this.pointerDate = previousPointerDate(this.selectionMode, this.pointerDate);
22522
22539
  };
22523
22540
  this.handleNextClick = () => {
22524
- if (this.selectionMode === 'day') {
22525
- if (this.pointerDate.month === 11) {
22526
- this.pointerDate = { year: this.pointerDate.year + 1, month: 0, day: 1 };
22527
- }
22528
- else {
22529
- this.pointerDate = { year: this.pointerDate.year, month: this.pointerDate.month + 1, day: 1 };
22530
- }
22531
- }
22532
- else if (this.selectionMode === 'month') {
22533
- this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + 1 });
22534
- }
22535
- else if (this.selectionMode === 'year') {
22536
- this.pointerDate = Object.assign(Object.assign({}, this.pointerDate), { year: this.pointerDate.year + NUMBER_OF_YEARS_SHOWN });
22537
- }
22541
+ this.pointerDate = nextPointerDate(this.selectionMode, this.pointerDate);
22538
22542
  };
22539
22543
  this.handleDocumentMouseDown = (event) => {
22540
22544
  const baseElement = this.getSixInputBaseElement();
@@ -22616,6 +22620,7 @@ const SixDate = class {
22616
22620
  if (warning != null) {
22617
22621
  console.warn(warning);
22618
22622
  }
22623
+ this.updateInputElementValue();
22619
22624
  }
22620
22625
  getSixInputBaseElement() {
22621
22626
  var _a, _b;
@@ -22656,7 +22661,7 @@ const SixDate = class {
22656
22661
  });
22657
22662
  }
22658
22663
  updateInputElementValue() {
22659
- if (this.inputElement) {
22664
+ if (this.inputElement && document.activeElement !== this.host) {
22660
22665
  this.inputElement.value = this.value === '' ? '' : formatDate(this.value, this.dateFormat);
22661
22666
  }
22662
22667
  }
@@ -22677,7 +22682,7 @@ const SixDate = class {
22677
22682
  this.popoverHelper = undefined;
22678
22683
  }
22679
22684
  render() {
22680
- return (index.h("div", { key: '2fccfb9c005bf6ac4906be3735c3b0fc61bfad8f', class: "container" }, index.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" }, index.h("six-icon", { key: '93e4add573a5617e9f90e9e8060a9a3a6ec10b98', slot: "prefix", size: this.size === 'large' ? 'medium' : this.size }, "today"), slot.hasSlot(this.host, 'label') ? (index.h("span", { slot: "label" }, index.h("slot", { name: "label" }))) : null, slot.hasSlot(this.host, 'error-text') ? (index.h("span", { slot: "error-text" }, index.h("slot", { name: "error-text" }))) : null, slot.hasSlot(this.host, 'help-text') ? (index.h("span", { slot: "help-text" }, index.h("slot", { name: "help-text" }))) : null), index.h("span", { key: '5fb919b6861ed8307de1105c881350d4094bbf52', id: "date-format", class: "sr-only" }, translateFormatHelp(this.language, this.dateFormat)), index.h("div", { key: 'ccddb6c5b5c49f77d31d2d0c75742cc0ffbda2ee', ref: (el) => (this.positioner = el), class: "positioner" }, index.h("div", { key: '3eec69b5bac555fd542cab3a967700403af68750', class: "panel", ref: (el) => (this.panel = el) }, index.h("header", { key: 'a16e0c72e430580b0f0c229476b7c45ea50e194a', class: "panel__header" }, index.h("six-icon-button", { key: 'bfc02505301c5264de2934f3f4f3fcea52cacf07', tabindex: "-1", class: "previous", onClick: this.handlePreviousClick, name: "arrow_back_ios" }), this.selectionMode === 'day' && (index.h("div", { key: '2f64e3cc6f2ee9326c953f81b1ea6a3f5ab13551', class: "selector", onClick: () => (this.selectionMode = 'month') }, translateMonth(this.pointerDate.month, this.language), index.h("six-icon", { key: '9372e403d994348716322f39d7e30971c3d37842' }, "arrow_drop_down"))), this.selectionMode !== 'year' && (index.h("div", { key: '16a3de3dd5207eeb91d341a02b93b11e707f3372', class: "selector", onClick: () => (this.selectionMode = 'year') }, this.pointerDate.year, index.h("six-icon", { key: '81024acff597b548875a7500cbb5aab7ba47952e' }, "arrow_drop_down"))), this.selectionMode === 'year' && (index.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))), index.h("six-icon-button", { key: '0e689a5621ae8a62415c4a19efb64a983b720115', tabindex: "-1", class: "next", onClick: this.handleNextClick, name: "arrow_forward_ios" })), this.selectionMode === 'day' && (index.h(DaySelection, { key: '6fe9920a9449418460e069eefa96adda867c2eb3', language: this.language, calendarGrid: createCalendarGrid({
22685
+ return (index.h("div", { key: '67c2f836f5a0ea61277913ca44a80293eedd918b', class: "container" }, index.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" }, index.h("six-icon", { key: '703b5a74be97b95359fc5fc368d798296dde318b', slot: "prefix", size: this.size === 'large' ? 'medium' : this.size }, "today"), slot.hasSlot(this.host, 'label') ? (index.h("span", { slot: "label" }, index.h("slot", { name: "label" }))) : null, slot.hasSlot(this.host, 'error-text') ? (index.h("span", { slot: "error-text" }, index.h("slot", { name: "error-text" }))) : null, slot.hasSlot(this.host, 'help-text') ? (index.h("span", { slot: "help-text" }, index.h("slot", { name: "help-text" }))) : null), index.h("span", { key: 'fc7017ccfb60c332d81dda8b119ab86ee3bca1ce', id: "date-format", class: "sr-only" }, translateFormatHelp(this.language, this.dateFormat)), index.h("div", { key: '7426abbf8087e77dde6fb636454f1560ff9cb9da', ref: (el) => (this.positioner = el), class: "positioner" }, index.h("div", { key: '00596fb0f2710d52bdf8a74b0778622e73a7d998', class: "panel", ref: (el) => (this.panel = el) }, index.h("header", { key: '0bd4e94ee5e1ee032c98fb03b02f5835b86a1ba1', class: "panel__header" }, index.h("six-icon-button", { key: '54d5d8a3bdfa458f86b45f47fdc1742a9b355b2e', tabindex: "-1", class: "previous", onClick: this.handlePreviousClick, name: "arrow_back_ios" }), this.selectionMode === 'day' && (index.h("div", { key: '897b517718904cd3ddc2db09a8c69dbda8c941b5', class: "selector", onClick: () => (this.selectionMode = 'month') }, translateMonth(this.pointerDate.month, this.language), index.h("six-icon", { key: 'e3b05945fec95ee7d50ffff1758ac763b89773f9' }, "arrow_drop_down"))), this.selectionMode !== 'year' && (index.h("div", { key: '856d4133e83d45b76213391486b6365d30770e98', class: "selector", onClick: () => (this.selectionMode = 'year') }, this.pointerDate.year, index.h("six-icon", { key: '9e9318767a8e89c5e783dda3c6265a5adb88cb1f' }, "arrow_drop_down"))), this.selectionMode === 'year' && (index.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))), index.h("six-icon-button", { key: '421c1577505136a613405b4c878dc18ce49df323', tabindex: "-1", class: "next", onClick: this.handleNextClick, name: "arrow_forward_ios" })), this.selectionMode === 'day' && (index.h(DaySelection, { key: '7354b17d7e70534be7f3aaad0225156bbdd4a186', language: this.language, calendarGrid: createCalendarGrid({
22681
22686
  year: this.pointerDate.year,
22682
22687
  month: this.pointerDate.month,
22683
22688
  selected: this.value || undefined,
@@ -22685,7 +22690,7 @@ const SixDate = class {
22685
22690
  maxDate: this.max,
22686
22691
  dateFormat: this.dateFormat,
22687
22692
  allowedDates: this.allowedDates,
22688
- }), dayClicked: this.handleDayClick })), this.selectionMode === 'month' && (index.h(MonthSelection, { key: 'ad02bb9d8b6c96abf77ccd30585490b2236fbfd0', language: this.language, selected: this.value, monthClicked: this.handleMonthClicked })), this.selectionMode === 'year' && (index.h(YearSelection, { key: 'a14118d8b9ec16182522d1de6dc12d9026ef3aa3', selected: this.value, pointerYear: this.pointerDate.year, yearCount: NUMBER_OF_YEARS_SHOWN, yearClicked: this.handleYearClicked }))))));
22693
+ }), dayClicked: this.handleDayClick })), this.selectionMode === 'month' && (index.h(MonthSelection, { key: '6055bd60a6deebdb8308a3c8ad66cfde9f1e2e7c', language: this.language, selected: this.value, monthClicked: this.handleMonthClicked })), this.selectionMode === 'year' && (index.h(YearSelection, { key: 'f0cf7fbc0ac3b72b53e5aa9c57207bba91c718b7', selected: this.value, pointerYear: this.pointerDate.year, yearCount: NUMBER_OF_YEARS_SHOWN, yearClicked: this.handleYearClicked }))))));
22689
22694
  }
22690
22695
  get host() { return index.getElement(this); }
22691
22696
  static get watchers() { return {