@fluid-topics/ftds-period-picker 2.2.18 → 2.2.20

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.
@@ -21,7 +21,8 @@ import { FtdsButton } from "@fluid-topics/ftds-button";
21
21
  import { FtdsBaseInput } from "@fluid-topics/ftds-base-input";
22
22
  export class FtdsPeriodPickerInSelect extends withI18n(toFtInput(FtdsBase)) {
23
23
  get displayValue() {
24
- var _a, _b, _c;
24
+ var _a, _b;
25
+ var _c;
25
26
  if (this.displayMode == FtdsPeriodPickerInSelectDisplayMode.labels) {
26
27
  return ((_a = this.currentSelection) === null || _a === void 0 ? void 0 : _a.key) === "custom" ? this.formatCustomDateRange(this.currentSelection.selector()) : (_c = (_b = this.currentSelection) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : "";
27
28
  }
@@ -63,11 +64,12 @@ export class FtdsPeriodPickerInSelect extends withI18n(toFtInput(FtdsBase)) {
63
64
  (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
64
65
  }
65
66
  willUpdate() {
66
- var _a, _b, _c, _d;
67
- const defaultKey = (_b = (_a = this.defaultPeriod) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : this.defaultValueKey;
67
+ var _a, _b, _c;
68
+ var _d;
69
+ const defaultKey = (_d = (_a = this.defaultPeriod) === null || _a === void 0 ? void 0 : _a.key) !== null && _d !== void 0 ? _d : this.defaultValueKey;
68
70
  if (!this.currentSelection && defaultKey) {
69
71
  if (defaultKey === "custom") {
70
- this.value = { from: (_c = this.defaultPeriod) === null || _c === void 0 ? void 0 : _c.from, to: (_d = this.defaultPeriod) === null || _d === void 0 ? void 0 : _d.to };
72
+ this.value = { from: (_b = this.defaultPeriod) === null || _b === void 0 ? void 0 : _b.from, to: (_c = this.defaultPeriod) === null || _c === void 0 ? void 0 : _c.to };
71
73
  this.currentSelection = {
72
74
  key: "custom",
73
75
  label: this.customPeriodLabel,
@@ -94,15 +94,12 @@ export class FtdsPeriodPicker extends withI18n(toFtInput(FtdsBase)) {
94
94
  @input=${(e) => e.stopPropagation()}
95
95
  @input-validated=${(e) => e.stopPropagation()}
96
96
  aria-label="${ftPeriodI18nContext.messages.pickAPeriod()}">
97
- ${repeat(this.periodOptions, (option) => option.key, (option) => {
98
- var _a;
99
- return html `
97
+ ${repeat(this.periodOptions, (option) => option.key, (option) => { var _a; return html `
100
98
  <ftds-radio value="${option.key}"
101
99
  ?checked=${((_a = this.currentSelection) === null || _a === void 0 ? void 0 : _a.key) === option.key}>
102
100
  ${option.label}
103
101
  </ftds-radio>
104
- `;
105
- })}
102
+ `; })}
106
103
  <ftds-radio value="custom"
107
104
  ?checked=${((_a = this.currentSelection) === null || _a === void 0 ? void 0 : _a.key) === "custom"}>
108
105
  ${this.customPeriodLabel}