smoothly 0.1.69 → 0.1.70

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 (33) hide show
  1. package/dist/cjs/{generate-5e7cd3f7.js → generate-7f7f7d99.js} +3 -2
  2. package/dist/cjs/{index-b8688617.js → index-e37f73fe.js} +89 -19
  3. package/dist/cjs/smoothly-accordion_43.cjs.entry.js +104 -33
  4. package/dist/cjs/smoothly-calendar.cjs.entry.js +7 -7
  5. package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
  6. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
  7. package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
  8. package/dist/cjs/smoothly-input-month.cjs.entry.js +11 -11
  9. package/dist/collection/components/calendar/generate.js +2 -1
  10. package/dist/collection/components/calendar/index.js +4 -4
  11. package/dist/collection/components/calendar/style.css +29 -11
  12. package/dist/collection/components/input-month/index.js +8 -8
  13. package/dist/collection/components/input-month/style.css +0 -6
  14. package/dist/custom-elements/index.js +105 -34
  15. package/dist/{smoothly/generate-fc812e0f.js → esm/generate-7090dc14.js} +3 -2
  16. package/dist/{smoothly/index-046ba252.js → esm/index-13251390.js} +89 -19
  17. package/dist/esm/smoothly-accordion_43.entry.js +104 -33
  18. package/dist/esm/smoothly-calendar.entry.js +7 -7
  19. package/dist/esm/smoothly-display-amount.entry.js +1 -1
  20. package/dist/esm/smoothly-input-date-range.entry.js +1 -1
  21. package/dist/esm/smoothly-input-date.entry.js +1 -1
  22. package/dist/esm/smoothly-input-month.entry.js +11 -11
  23. package/dist/{esm/generate-fc812e0f.js → smoothly/generate-7090dc14.js} +3 -2
  24. package/dist/{esm/index-046ba252.js → smoothly/index-13251390.js} +89 -19
  25. package/dist/smoothly/p-2e35abfc.entry.js +1 -0
  26. package/dist/smoothly/smoothly-calendar.entry.js +7 -7
  27. package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
  28. package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
  29. package/dist/smoothly/smoothly-input-date.entry.js +1 -1
  30. package/dist/smoothly/smoothly-input-month.entry.js +11 -11
  31. package/dist/types/components/input-month/index.d.ts +1 -1
  32. package/package.json +2 -2
  33. package/dist/smoothly/p-9439cb96.entry.js +0 -1
@@ -5,23 +5,23 @@ export class MonthSelector {
5
5
  onValueChanged(next) {
6
6
  this.valueChanged.emit(next);
7
7
  }
8
+ adjustMonth(delta) {
9
+ var _a;
10
+ const date = Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : Date.now());
11
+ date.setMonth(date.getMonth() + delta);
12
+ this.value = Date.create(date);
13
+ }
8
14
  render() {
9
15
  var _a, _b;
10
16
  return [
11
- h("button", { onClick: () => this.adjustMonth(-1) },
17
+ h("div", { onClick: () => this.adjustMonth(-1) },
12
18
  h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
13
19
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.years((_a = this.value) !== null && _a !== void 0 ? _a : Date.now()).map(year => (h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
14
20
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.months((_b = this.value) !== null && _b !== void 0 ? _b : Date.now()).map(month => (h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
15
- h("button", { onClick: () => this.adjustMonth(1) },
21
+ h("div", { onClick: () => this.adjustMonth(1) },
16
22
  h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
17
23
  ];
18
24
  }
19
- adjustMonth(delta) {
20
- var _a;
21
- const date = Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : Date.now());
22
- date.setMonth(date.getMonth() + delta);
23
- this.value = Date.create(date);
24
- }
25
25
  static get is() { return "smoothly-input-month"; }
26
26
  static get encapsulation() { return "scoped"; }
27
27
  static get originalStyleUrls() { return {
@@ -3,12 +3,6 @@
3
3
  justify-content: space-between;
4
4
  font-size: large;
5
5
  }
6
- button {
7
- border: none;
8
- background: none;
9
- cursor: pointer;
10
- font-size: large;
11
- }
12
6
  smoothly-icon {
13
7
  font-size: smaller;
14
8
  }
@@ -19002,28 +19002,28 @@ const CurrencyCode$2 = /*@__PURE__*/getDefaultExportFromCjs(CurrencyCode_1$2);
19002
19002
  var _Date$2 = createCommonjsModule(function (module, exports) {
19003
19003
  "use strict";
19004
19004
  Object.defineProperty(exports, "__esModule", { value: true });
19005
- exports.IsoDate = void 0;
19006
- var IsoDate;
19007
- (function (IsoDate) {
19005
+ exports.Date = void 0;
19006
+ var Date;
19007
+ (function (Date) {
19008
19008
  function is(value) {
19009
19009
  return (typeof value == "string" && /^(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\d)$/.test(value));
19010
19010
  }
19011
- IsoDate.is = is;
19011
+ Date.is = is;
19012
19012
  function parse(value, time) {
19013
- return new Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
19013
+ return new globalThis.Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
19014
19014
  }
19015
- IsoDate.parse = parse;
19015
+ Date.parse = parse;
19016
19016
  function create(value) {
19017
19017
  return value.toISOString().substring(0, 10);
19018
19018
  }
19019
- IsoDate.create = create;
19019
+ Date.create = create;
19020
19020
  function now() {
19021
- return create(new Date());
19021
+ return create(new globalThis.Date());
19022
19022
  }
19023
- IsoDate.now = now;
19023
+ Date.now = now;
19024
19024
  function localize(value, locale) {
19025
- const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
19026
- const localeOptions = {
19025
+ return (is(value) ? parse(value) : value)
19026
+ .toLocaleString(locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale, {
19027
19027
  year: "numeric",
19028
19028
  month: "2-digit",
19029
19029
  day: "2-digit",
@@ -19031,11 +19031,82 @@ var IsoDate;
19031
19031
  minute: "2-digit",
19032
19032
  second: "2-digit",
19033
19033
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
19034
- };
19035
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions).substring(0, 10);
19034
+ })
19035
+ .substring(0, 10);
19036
19036
  }
19037
- IsoDate.localize = localize;
19038
- })(IsoDate = exports.IsoDate || (exports.IsoDate = {}));
19037
+ Date.localize = localize;
19038
+ function next(date, days = 1) {
19039
+ let result;
19040
+ if (typeof days == "number") {
19041
+ const r = parse(date);
19042
+ r.setDate(r.getDate() + days);
19043
+ result = Date.create(r);
19044
+ }
19045
+ else {
19046
+ result = date;
19047
+ if (days.years)
19048
+ result = nextYear(result, days.years);
19049
+ if (days.months)
19050
+ result = nextMonth(result, days.months);
19051
+ if (days.days)
19052
+ result = next(result, days.days);
19053
+ }
19054
+ return result;
19055
+ }
19056
+ Date.next = next;
19057
+ function previous(date, days = 1) {
19058
+ let result;
19059
+ if (typeof days == "number") {
19060
+ const r = parse(date);
19061
+ r.setDate(r.getDate() - days);
19062
+ result = Date.create(r);
19063
+ }
19064
+ else {
19065
+ result = date;
19066
+ if (days.years)
19067
+ result = previousYear(result, days.years);
19068
+ if (days.months)
19069
+ result = previousMonth(result, days.months);
19070
+ if (days.days)
19071
+ result = previous(result, days.days);
19072
+ }
19073
+ return result;
19074
+ }
19075
+ Date.previous = previous;
19076
+ function nextMonth(date, months = 1) {
19077
+ const result = parse(date);
19078
+ result.setMonth(result.getMonth() + months);
19079
+ return Date.create(result);
19080
+ }
19081
+ Date.nextMonth = nextMonth;
19082
+ function previousMonth(date, months = 1) {
19083
+ return nextMonth(date, -months);
19084
+ }
19085
+ Date.previousMonth = previousMonth;
19086
+ function nextYear(date, years = 1) {
19087
+ const result = parse(date);
19088
+ result.setFullYear(result.getFullYear() + years);
19089
+ return Date.create(result);
19090
+ }
19091
+ Date.nextYear = nextYear;
19092
+ function previousYear(date, years = 1) {
19093
+ return nextYear(date, -years);
19094
+ }
19095
+ Date.previousYear = previousYear;
19096
+ function firstOfMonth(date) {
19097
+ const result = parse(date);
19098
+ result.setDate(1);
19099
+ return Date.create(result);
19100
+ }
19101
+ Date.firstOfMonth = firstOfMonth;
19102
+ function lastOfMonth(date) {
19103
+ const result = parse(date);
19104
+ result.setMonth(result.getMonth() + 1);
19105
+ result.setDate(-1);
19106
+ return Date.create(result);
19107
+ }
19108
+ Date.lastOfMonth = lastOfMonth;
19109
+ })(Date = exports.Date || (exports.Date = {}));
19039
19110
  //# sourceMappingURL=Date.js.map
19040
19111
  });
19041
19112
 
@@ -19066,7 +19137,7 @@ var DateTime;
19066
19137
  DateTime.now = now;
19067
19138
  function localize(value, locale) {
19068
19139
  const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
19069
- const localeOptions = {
19140
+ return (is(value) ? parse(value) : value).toLocaleString(localeString, {
19070
19141
  year: "numeric",
19071
19142
  month: "2-digit",
19072
19143
  day: "2-digit",
@@ -19074,8 +19145,7 @@ var DateTime;
19074
19145
  minute: "2-digit",
19075
19146
  second: "2-digit",
19076
19147
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
19077
- };
19078
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions);
19148
+ });
19079
19149
  }
19080
19150
  DateTime.localize = localize;
19081
19151
  })(DateTime = exports.DateTime || (exports.DateTime = {}));
@@ -20850,7 +20920,7 @@ Object.defineProperty(exports, "Currency", { enumerable: true, get: function ()
20850
20920
 
20851
20921
  Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return CurrencyCode_1$2.CurrencyCode; } });
20852
20922
 
20853
- Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$2.IsoDate; } });
20923
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$2.Date; } });
20854
20924
 
20855
20925
  Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return DateTime_1$2.DateTime; } });
20856
20926
 
@@ -20876,7 +20946,8 @@ function month(date) {
20876
20946
  d.setDate(day++);
20877
20947
  r.push(dist$4.Date.create(d));
20878
20948
  }
20879
- result.push(r);
20949
+ if (row < 5 || dist$4.Date.firstOfMonth(r[0]) == dist$4.Date.firstOfMonth(date))
20950
+ result.push(r);
20880
20951
  }
20881
20952
  return result;
20882
20953
  }
@@ -20921,7 +20992,7 @@ function years(current) {
20921
20992
  return result;
20922
20993
  }
20923
20994
 
20924
- const styleCss$B = ".sc-smoothly-calendar-h{display:block}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding:.5em .5em 0 .5em}th.sc-smoothly-calendar,td.sc-smoothly-calendar{text-align:center;padding:.5em;min-width:2em;background-color:rgb(var(--smoothly-default-shade))}td.sc-smoothly-calendar:nth-child(6),td.sc-smoothly-calendar:nth-child(7){color:rgb(var(--smoothly-light-shade))}td.sc-smoothly-calendar:not(.selected):hover{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.selected.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}td.sc-smoothly-calendar:not(.selected,.dateRange).sc-smoothly-calendar:not(:hover).today{background:rgb(var(--smoothly-dark-tint));color:rgb(var(--smoothly-dark-contrast))}td.dateRange.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}";
20995
+ const styleCss$B = ".sc-smoothly-calendar-h{display:block;--other-month-opacity:0.5}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding:0.5em 0.5em 0 0.5em}th.sc-smoothly-calendar,td.sc-smoothly-calendar{text-align:center;padding:0.5em;min-width:2em;background-color:rgb(var(--smoothly-default-shade));cursor:pointer;user-select:none}td.currentMonth.sc-smoothly-calendar{color:rgb(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:not(.currentMonth){color:rgba(var(--smoothly-default-contrast), var(--other-month-opacity))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(6):not(.currentMonth).dateRange,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).selected,td.sc-smoothly-calendar:nth-child(7):not(.currentMonth).dateRange{color:rgba(var(--smoothly-default-contrast))}td.sc-smoothly-calendar:nth-child(6),td.sc-smoothly-calendar:nth-child(7){color:rgb(var(--smoothly-danger-tint))}td.sc-smoothly-calendar:nth-child(6):not(.currentMonth),td.sc-smoothly-calendar:nth-child(7):not(.currentMonth){color:rgba(var(--smoothly-danger-tint), var(--other-month-opacity))}td.sc-smoothly-calendar:not(.selected):hover{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}td.selected.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-color))}td.sc-smoothly-calendar:not(.selected,.dateRange).sc-smoothly-calendar:not(:hover).today{background:rgb(var(--smoothly-dark-tint));color:rgb(var(--smoothly-dark-contrast))}td.dateRange.sc-smoothly-calendar{color:rgb(var(--smoothly-primary-contrast));background:rgb(var(--smoothly-primary-tint))}";
20925
20996
 
20926
20997
  const Calendar = class extends HTMLElement {
20927
20998
  constructor() {
@@ -20947,7 +21018,7 @@ const Calendar = class extends HTMLElement {
20947
21018
  event.stopPropagation();
20948
21019
  } }),
20949
21020
  h("table", null, h("thead", null, h("tr", null, weekdays().map(day => (h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
20950
- var _a, _b;
21021
+ var _a, _b, _c;
20951
21022
  return (h("td", { tabindex: 1, onClick: () => {
20952
21023
  this.valueChanged.emit((this.value = date));
20953
21024
  this.clickCounter += 1;
@@ -20960,9 +21031,9 @@ const Calendar = class extends HTMLElement {
20960
21031
  this.start = date;
20961
21032
  }
20962
21033
  }, class: (date == this.value ? ["selected"] : [])
20963
- .concat(...(date == dist$4.Date.now() ? ["today"] : []), date == this.value ? ["selected"] : [], this.doubleInput
20964
- ? dist$4.Date.parse(date) >= dist$4.Date.parse((_a = this.start) !== null && _a !== void 0 ? _a : "") &&
20965
- dist$4.Date.parse(date) <= dist$4.Date.parse((_b = this.end) !== null && _b !== void 0 ? _b : "")
21034
+ .concat(...(date == dist$4.Date.now() ? ["today"] : []), dist$4.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist$4.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
21035
+ ? dist$4.Date.parse(date) >= dist$4.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
21036
+ dist$4.Date.parse(date) <= dist$4.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
20966
21037
  ? ["dateRange"]
20967
21038
  : []
20968
21039
  : "")
@@ -55149,7 +55220,7 @@ const SmoothlyInputDemo$1 = class extends HTMLElement {
55149
55220
  }
55150
55221
  };
55151
55222
 
55152
- const styleCss$p = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}button.sc-smoothly-input-month{border:none;background:none;cursor:pointer;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
55223
+ const styleCss$p = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
55153
55224
 
55154
55225
  const MonthSelector = class extends HTMLElement {
55155
55226
  constructor() {
@@ -55160,21 +55231,21 @@ const MonthSelector = class extends HTMLElement {
55160
55231
  onValueChanged(next) {
55161
55232
  this.valueChanged.emit(next);
55162
55233
  }
55234
+ adjustMonth(delta) {
55235
+ var _a;
55236
+ const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
55237
+ date.setMonth(date.getMonth() + delta);
55238
+ this.value = dist$4.Date.create(date);
55239
+ }
55163
55240
  render() {
55164
55241
  var _a, _b;
55165
55242
  return [
55166
- h("button", { onClick: () => this.adjustMonth(-1) }, h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
55243
+ h("div", { onClick: () => this.adjustMonth(-1) }, h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
55167
55244
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, years((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now()).map(year => (h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
55168
55245
  h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, months((_b = this.value) !== null && _b !== void 0 ? _b : dist$4.Date.now()).map(month => (h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
55169
- h("button", { onClick: () => this.adjustMonth(1) }, h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
55246
+ h("div", { onClick: () => this.adjustMonth(1) }, h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
55170
55247
  ];
55171
55248
  }
55172
- adjustMonth(delta) {
55173
- var _a;
55174
- const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
55175
- date.setMonth(date.getMonth() + delta);
55176
- this.value = dist$4.Date.create(date);
55177
- }
55178
55249
  static get watchers() { return {
55179
55250
  "value": ["onValueChanged"]
55180
55251
  }; }
@@ -1,4 +1,4 @@
1
- import { d as dist } from './index-046ba252.js';
1
+ import { d as dist } from './index-13251390.js';
2
2
 
3
3
  function month(date) {
4
4
  const d = new Date(date);
@@ -12,7 +12,8 @@ function month(date) {
12
12
  d.setDate(day++);
13
13
  r.push(dist.Date.create(d));
14
14
  }
15
- result.push(r);
15
+ if (row < 5 || dist.Date.firstOfMonth(r[0]) == dist.Date.firstOfMonth(date))
16
+ result.push(r);
16
17
  }
17
18
  return result;
18
19
  }
@@ -16568,28 +16568,28 @@ const CurrencyCode = /*@__PURE__*/getDefaultExportFromCjs(CurrencyCode_1);
16568
16568
  var _Date = createCommonjsModule(function (module, exports) {
16569
16569
  "use strict";
16570
16570
  Object.defineProperty(exports, "__esModule", { value: true });
16571
- exports.IsoDate = void 0;
16572
- var IsoDate;
16573
- (function (IsoDate) {
16571
+ exports.Date = void 0;
16572
+ var Date;
16573
+ (function (Date) {
16574
16574
  function is(value) {
16575
16575
  return (typeof value == "string" && /^(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\d)|(\d{4}-[01]\d-[0-3]\d)$/.test(value));
16576
16576
  }
16577
- IsoDate.is = is;
16577
+ Date.is = is;
16578
16578
  function parse(value, time) {
16579
- return new Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16579
+ return new globalThis.Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16580
16580
  }
16581
- IsoDate.parse = parse;
16581
+ Date.parse = parse;
16582
16582
  function create(value) {
16583
16583
  return value.toISOString().substring(0, 10);
16584
16584
  }
16585
- IsoDate.create = create;
16585
+ Date.create = create;
16586
16586
  function now() {
16587
- return create(new Date());
16587
+ return create(new globalThis.Date());
16588
16588
  }
16589
- IsoDate.now = now;
16589
+ Date.now = now;
16590
16590
  function localize(value, locale) {
16591
- const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16592
- const localeOptions = {
16591
+ return (is(value) ? parse(value) : value)
16592
+ .toLocaleString(locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale, {
16593
16593
  year: "numeric",
16594
16594
  month: "2-digit",
16595
16595
  day: "2-digit",
@@ -16597,11 +16597,82 @@ var IsoDate;
16597
16597
  minute: "2-digit",
16598
16598
  second: "2-digit",
16599
16599
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16600
- };
16601
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions).substring(0, 10);
16600
+ })
16601
+ .substring(0, 10);
16602
+ }
16603
+ Date.localize = localize;
16604
+ function next(date, days = 1) {
16605
+ let result;
16606
+ if (typeof days == "number") {
16607
+ const r = parse(date);
16608
+ r.setDate(r.getDate() + days);
16609
+ result = Date.create(r);
16610
+ }
16611
+ else {
16612
+ result = date;
16613
+ if (days.years)
16614
+ result = nextYear(result, days.years);
16615
+ if (days.months)
16616
+ result = nextMonth(result, days.months);
16617
+ if (days.days)
16618
+ result = next(result, days.days);
16619
+ }
16620
+ return result;
16621
+ }
16622
+ Date.next = next;
16623
+ function previous(date, days = 1) {
16624
+ let result;
16625
+ if (typeof days == "number") {
16626
+ const r = parse(date);
16627
+ r.setDate(r.getDate() - days);
16628
+ result = Date.create(r);
16629
+ }
16630
+ else {
16631
+ result = date;
16632
+ if (days.years)
16633
+ result = previousYear(result, days.years);
16634
+ if (days.months)
16635
+ result = previousMonth(result, days.months);
16636
+ if (days.days)
16637
+ result = previous(result, days.days);
16638
+ }
16639
+ return result;
16640
+ }
16641
+ Date.previous = previous;
16642
+ function nextMonth(date, months = 1) {
16643
+ const result = parse(date);
16644
+ result.setMonth(result.getMonth() + months);
16645
+ return Date.create(result);
16646
+ }
16647
+ Date.nextMonth = nextMonth;
16648
+ function previousMonth(date, months = 1) {
16649
+ return nextMonth(date, -months);
16650
+ }
16651
+ Date.previousMonth = previousMonth;
16652
+ function nextYear(date, years = 1) {
16653
+ const result = parse(date);
16654
+ result.setFullYear(result.getFullYear() + years);
16655
+ return Date.create(result);
16656
+ }
16657
+ Date.nextYear = nextYear;
16658
+ function previousYear(date, years = 1) {
16659
+ return nextYear(date, -years);
16660
+ }
16661
+ Date.previousYear = previousYear;
16662
+ function firstOfMonth(date) {
16663
+ const result = parse(date);
16664
+ result.setDate(1);
16665
+ return Date.create(result);
16666
+ }
16667
+ Date.firstOfMonth = firstOfMonth;
16668
+ function lastOfMonth(date) {
16669
+ const result = parse(date);
16670
+ result.setMonth(result.getMonth() + 1);
16671
+ result.setDate(-1);
16672
+ return Date.create(result);
16602
16673
  }
16603
- IsoDate.localize = localize;
16604
- })(IsoDate = exports.IsoDate || (exports.IsoDate = {}));
16674
+ Date.lastOfMonth = lastOfMonth;
16675
+ })(Date = exports.Date || (exports.Date = {}));
16605
16676
  //# sourceMappingURL=Date.js.map
16606
16677
  });
16607
16678
 
@@ -16632,7 +16703,7 @@ var DateTime;
16632
16703
  DateTime.now = now;
16633
16704
  function localize(value, locale) {
16634
16705
  const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16635
- const localeOptions = {
16706
+ return (is(value) ? parse(value) : value).toLocaleString(localeString, {
16636
16707
  year: "numeric",
16637
16708
  month: "2-digit",
16638
16709
  day: "2-digit",
@@ -16640,8 +16711,7 @@ var DateTime;
16640
16711
  minute: "2-digit",
16641
16712
  second: "2-digit",
16642
16713
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16643
- };
16644
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions);
16714
+ });
16645
16715
  }
16646
16716
  DateTime.localize = localize;
16647
16717
  })(DateTime = exports.DateTime || (exports.DateTime = {}));
@@ -18416,7 +18486,7 @@ Object.defineProperty(exports, "Currency", { enumerable: true, get: function ()
18416
18486
 
18417
18487
  Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return CurrencyCode_1.CurrencyCode; } });
18418
18488
 
18419
- Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date.IsoDate; } });
18489
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date.Date; } });
18420
18490
 
18421
18491
  Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return DateTime_1.DateTime; } });
18422
18492