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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-b8688617.js');
3
+ const index = require('./index-e37f73fe.js');
4
4
 
5
5
  function month(date) {
6
6
  const d = new Date(date);
@@ -14,7 +14,8 @@ function month(date) {
14
14
  d.setDate(day++);
15
15
  r.push(index.dist.Date.create(d));
16
16
  }
17
- result.push(r);
17
+ if (row < 5 || index.dist.Date.firstOfMonth(r[0]) == index.dist.Date.firstOfMonth(date))
18
+ result.push(r);
18
19
  }
19
20
  return result;
20
21
  }
@@ -16570,28 +16570,28 @@ const CurrencyCode = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(Curre
16570
16570
  var _Date = _commonjsHelpers.createCommonjsModule(function (module, exports) {
16571
16571
  "use strict";
16572
16572
  Object.defineProperty(exports, "__esModule", { value: true });
16573
- exports.IsoDate = void 0;
16574
- var IsoDate;
16575
- (function (IsoDate) {
16573
+ exports.Date = void 0;
16574
+ var Date;
16575
+ (function (Date) {
16576
16576
  function is(value) {
16577
16577
  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));
16578
16578
  }
16579
- IsoDate.is = is;
16579
+ Date.is = is;
16580
16580
  function parse(value, time) {
16581
- return new Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16581
+ return new globalThis.Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16582
16582
  }
16583
- IsoDate.parse = parse;
16583
+ Date.parse = parse;
16584
16584
  function create(value) {
16585
16585
  return value.toISOString().substring(0, 10);
16586
16586
  }
16587
- IsoDate.create = create;
16587
+ Date.create = create;
16588
16588
  function now() {
16589
- return create(new Date());
16589
+ return create(new globalThis.Date());
16590
16590
  }
16591
- IsoDate.now = now;
16591
+ Date.now = now;
16592
16592
  function localize(value, locale) {
16593
- const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16594
- const localeOptions = {
16593
+ return (is(value) ? parse(value) : value)
16594
+ .toLocaleString(locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale, {
16595
16595
  year: "numeric",
16596
16596
  month: "2-digit",
16597
16597
  day: "2-digit",
@@ -16599,11 +16599,82 @@ var IsoDate;
16599
16599
  minute: "2-digit",
16600
16600
  second: "2-digit",
16601
16601
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16602
- };
16603
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions).substring(0, 10);
16602
+ })
16603
+ .substring(0, 10);
16604
+ }
16605
+ Date.localize = localize;
16606
+ function next(date, days = 1) {
16607
+ let result;
16608
+ if (typeof days == "number") {
16609
+ const r = parse(date);
16610
+ r.setDate(r.getDate() + days);
16611
+ result = Date.create(r);
16612
+ }
16613
+ else {
16614
+ result = date;
16615
+ if (days.years)
16616
+ result = nextYear(result, days.years);
16617
+ if (days.months)
16618
+ result = nextMonth(result, days.months);
16619
+ if (days.days)
16620
+ result = next(result, days.days);
16621
+ }
16622
+ return result;
16623
+ }
16624
+ Date.next = next;
16625
+ function previous(date, days = 1) {
16626
+ let result;
16627
+ if (typeof days == "number") {
16628
+ const r = parse(date);
16629
+ r.setDate(r.getDate() - days);
16630
+ result = Date.create(r);
16631
+ }
16632
+ else {
16633
+ result = date;
16634
+ if (days.years)
16635
+ result = previousYear(result, days.years);
16636
+ if (days.months)
16637
+ result = previousMonth(result, days.months);
16638
+ if (days.days)
16639
+ result = previous(result, days.days);
16640
+ }
16641
+ return result;
16642
+ }
16643
+ Date.previous = previous;
16644
+ function nextMonth(date, months = 1) {
16645
+ const result = parse(date);
16646
+ result.setMonth(result.getMonth() + months);
16647
+ return Date.create(result);
16648
+ }
16649
+ Date.nextMonth = nextMonth;
16650
+ function previousMonth(date, months = 1) {
16651
+ return nextMonth(date, -months);
16652
+ }
16653
+ Date.previousMonth = previousMonth;
16654
+ function nextYear(date, years = 1) {
16655
+ const result = parse(date);
16656
+ result.setFullYear(result.getFullYear() + years);
16657
+ return Date.create(result);
16658
+ }
16659
+ Date.nextYear = nextYear;
16660
+ function previousYear(date, years = 1) {
16661
+ return nextYear(date, -years);
16662
+ }
16663
+ Date.previousYear = previousYear;
16664
+ function firstOfMonth(date) {
16665
+ const result = parse(date);
16666
+ result.setDate(1);
16667
+ return Date.create(result);
16668
+ }
16669
+ Date.firstOfMonth = firstOfMonth;
16670
+ function lastOfMonth(date) {
16671
+ const result = parse(date);
16672
+ result.setMonth(result.getMonth() + 1);
16673
+ result.setDate(-1);
16674
+ return Date.create(result);
16604
16675
  }
16605
- IsoDate.localize = localize;
16606
- })(IsoDate = exports.IsoDate || (exports.IsoDate = {}));
16676
+ Date.lastOfMonth = lastOfMonth;
16677
+ })(Date = exports.Date || (exports.Date = {}));
16607
16678
  //# sourceMappingURL=Date.js.map
16608
16679
  });
16609
16680
 
@@ -16634,7 +16705,7 @@ var DateTime;
16634
16705
  DateTime.now = now;
16635
16706
  function localize(value, locale) {
16636
16707
  const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16637
- const localeOptions = {
16708
+ return (is(value) ? parse(value) : value).toLocaleString(localeString, {
16638
16709
  year: "numeric",
16639
16710
  month: "2-digit",
16640
16711
  day: "2-digit",
@@ -16642,8 +16713,7 @@ var DateTime;
16642
16713
  minute: "2-digit",
16643
16714
  second: "2-digit",
16644
16715
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16645
- };
16646
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions);
16716
+ });
16647
16717
  }
16648
16718
  DateTime.localize = localize;
16649
16719
  })(DateTime = exports.DateTime || (exports.DateTime = {}));
@@ -18418,7 +18488,7 @@ Object.defineProperty(exports, "Currency", { enumerable: true, get: function ()
18418
18488
 
18419
18489
  Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return CurrencyCode_1.CurrencyCode; } });
18420
18490
 
18421
- Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date.IsoDate; } });
18491
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date.Date; } });
18422
18492
 
18423
18493
  Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return DateTime_1.DateTime; } });
18424
18494
 
@@ -16547,27 +16547,27 @@ exports.CurrencyCode = void 0;
16547
16547
 
16548
16548
  var _Date$1 = createCommonjsModule(function (module, exports) {
16549
16549
  Object.defineProperty(exports, "__esModule", { value: true });
16550
- exports.IsoDate = void 0;
16551
- (function (IsoDate) {
16550
+ exports.Date = void 0;
16551
+ (function (Date) {
16552
16552
  function is(value) {
16553
16553
  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));
16554
16554
  }
16555
- IsoDate.is = is;
16555
+ Date.is = is;
16556
16556
  function parse(value, time) {
16557
- return new Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16557
+ return new globalThis.Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
16558
16558
  }
16559
- IsoDate.parse = parse;
16559
+ Date.parse = parse;
16560
16560
  function create(value) {
16561
16561
  return value.toISOString().substring(0, 10);
16562
16562
  }
16563
- IsoDate.create = create;
16563
+ Date.create = create;
16564
16564
  function now() {
16565
- return create(new Date());
16565
+ return create(new globalThis.Date());
16566
16566
  }
16567
- IsoDate.now = now;
16567
+ Date.now = now;
16568
16568
  function localize(value, locale) {
16569
- const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16570
- const localeOptions = {
16569
+ return (is(value) ? parse(value) : value)
16570
+ .toLocaleString(locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale, {
16571
16571
  year: "numeric",
16572
16572
  month: "2-digit",
16573
16573
  day: "2-digit",
@@ -16575,11 +16575,82 @@ exports.IsoDate = void 0;
16575
16575
  minute: "2-digit",
16576
16576
  second: "2-digit",
16577
16577
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16578
- };
16579
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions).substring(0, 10);
16578
+ })
16579
+ .substring(0, 10);
16580
16580
  }
16581
- IsoDate.localize = localize;
16582
- })(exports.IsoDate || (exports.IsoDate = {}));
16581
+ Date.localize = localize;
16582
+ function next(date, days = 1) {
16583
+ let result;
16584
+ if (typeof days == "number") {
16585
+ const r = parse(date);
16586
+ r.setDate(r.getDate() + days);
16587
+ result = Date.create(r);
16588
+ }
16589
+ else {
16590
+ result = date;
16591
+ if (days.years)
16592
+ result = nextYear(result, days.years);
16593
+ if (days.months)
16594
+ result = nextMonth(result, days.months);
16595
+ if (days.days)
16596
+ result = next(result, days.days);
16597
+ }
16598
+ return result;
16599
+ }
16600
+ Date.next = next;
16601
+ function previous(date, days = 1) {
16602
+ let result;
16603
+ if (typeof days == "number") {
16604
+ const r = parse(date);
16605
+ r.setDate(r.getDate() - days);
16606
+ result = Date.create(r);
16607
+ }
16608
+ else {
16609
+ result = date;
16610
+ if (days.years)
16611
+ result = previousYear(result, days.years);
16612
+ if (days.months)
16613
+ result = previousMonth(result, days.months);
16614
+ if (days.days)
16615
+ result = previous(result, days.days);
16616
+ }
16617
+ return result;
16618
+ }
16619
+ Date.previous = previous;
16620
+ function nextMonth(date, months = 1) {
16621
+ const result = parse(date);
16622
+ result.setMonth(result.getMonth() + months);
16623
+ return Date.create(result);
16624
+ }
16625
+ Date.nextMonth = nextMonth;
16626
+ function previousMonth(date, months = 1) {
16627
+ return nextMonth(date, -months);
16628
+ }
16629
+ Date.previousMonth = previousMonth;
16630
+ function nextYear(date, years = 1) {
16631
+ const result = parse(date);
16632
+ result.setFullYear(result.getFullYear() + years);
16633
+ return Date.create(result);
16634
+ }
16635
+ Date.nextYear = nextYear;
16636
+ function previousYear(date, years = 1) {
16637
+ return nextYear(date, -years);
16638
+ }
16639
+ Date.previousYear = previousYear;
16640
+ function firstOfMonth(date) {
16641
+ const result = parse(date);
16642
+ result.setDate(1);
16643
+ return Date.create(result);
16644
+ }
16645
+ Date.firstOfMonth = firstOfMonth;
16646
+ function lastOfMonth(date) {
16647
+ const result = parse(date);
16648
+ result.setMonth(result.getMonth() + 1);
16649
+ result.setDate(-1);
16650
+ return Date.create(result);
16651
+ }
16652
+ Date.lastOfMonth = lastOfMonth;
16653
+ })(exports.Date || (exports.Date = {}));
16583
16654
  //# sourceMappingURL=Date.js.map
16584
16655
  });
16585
16656
 
@@ -16606,7 +16677,7 @@ exports.DateTime = void 0;
16606
16677
  DateTime.now = now;
16607
16678
  function localize(value, locale) {
16608
16679
  const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
16609
- const localeOptions = {
16680
+ return (is(value) ? parse(value) : value).toLocaleString(localeString, {
16610
16681
  year: "numeric",
16611
16682
  month: "2-digit",
16612
16683
  day: "2-digit",
@@ -16614,8 +16685,7 @@ exports.DateTime = void 0;
16614
16685
  minute: "2-digit",
16615
16686
  second: "2-digit",
16616
16687
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
16617
- };
16618
- return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions);
16688
+ });
16619
16689
  }
16620
16690
  DateTime.localize = localize;
16621
16691
  })(exports.DateTime || (exports.DateTime = {}));
@@ -18362,7 +18432,7 @@ Object.defineProperty(exports, "Currency", { enumerable: true, get: function ()
18362
18432
 
18363
18433
  Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return CurrencyCode_1$2.CurrencyCode; } });
18364
18434
 
18365
- Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$1.IsoDate; } });
18435
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$1.Date; } });
18366
18436
 
18367
18437
  Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return DateTime_1$2.DateTime; } });
18368
18438
 
@@ -18386,7 +18456,8 @@ function month(date) {
18386
18456
  d.setDate(day++);
18387
18457
  r.push(dist$4.Date.create(d));
18388
18458
  }
18389
- result.push(r);
18459
+ if (row < 5 || dist$4.Date.firstOfMonth(r[0]) == dist$4.Date.firstOfMonth(date))
18460
+ result.push(r);
18390
18461
  }
18391
18462
  return result;
18392
18463
  }
@@ -18431,7 +18502,7 @@ function years(current) {
18431
18502
  return result;
18432
18503
  }
18433
18504
 
18434
- const styleCss$w = ".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))}";
18505
+ const styleCss$w = ".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))}";
18435
18506
 
18436
18507
  const Calendar = class {
18437
18508
  constructor(hostRef) {
@@ -18456,7 +18527,7 @@ const Calendar = class {
18456
18527
  event.stopPropagation();
18457
18528
  } }),
18458
18529
  index.h("table", null, index.h("thead", null, index.h("tr", null, weekdays().map(day => (index.h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (index.h("tr", null, week.map(date => {
18459
- var _a, _b;
18530
+ var _a, _b, _c;
18460
18531
  return (index.h("td", { tabindex: 1, onClick: () => {
18461
18532
  this.valueChanged.emit((this.value = date));
18462
18533
  this.clickCounter += 1;
@@ -18469,9 +18540,9 @@ const Calendar = class {
18469
18540
  this.start = date;
18470
18541
  }
18471
18542
  }, class: (date == this.value ? ["selected"] : [])
18472
- .concat(...(date == dist$4.Date.now() ? ["today"] : []), date == this.value ? ["selected"] : [], this.doubleInput
18473
- ? dist$4.Date.parse(date) >= dist$4.Date.parse((_a = this.start) !== null && _a !== void 0 ? _a : "") &&
18474
- dist$4.Date.parse(date) <= dist$4.Date.parse((_b = this.end) !== null && _b !== void 0 ? _b : "")
18543
+ .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
18544
+ ? dist$4.Date.parse(date) >= dist$4.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
18545
+ dist$4.Date.parse(date) <= dist$4.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
18475
18546
  ? ["dateRange"]
18476
18547
  : []
18477
18548
  : "")
@@ -52173,7 +52244,7 @@ const SmoothlyInputDemo = class {
52173
52244
  }
52174
52245
  };
52175
52246
 
52176
- const styleCss$k = ".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}";
52247
+ const styleCss$k = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
52177
52248
 
52178
52249
  const MonthSelector = class {
52179
52250
  constructor(hostRef) {
@@ -52183,21 +52254,21 @@ const MonthSelector = class {
52183
52254
  onValueChanged(next) {
52184
52255
  this.valueChanged.emit(next);
52185
52256
  }
52257
+ adjustMonth(delta) {
52258
+ var _a;
52259
+ const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
52260
+ date.setMonth(date.getMonth() + delta);
52261
+ this.value = dist$4.Date.create(date);
52262
+ }
52186
52263
  render() {
52187
52264
  var _a, _b;
52188
52265
  return [
52189
- index.h("button", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
52266
+ index.h("div", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
52190
52267
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, years((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now()).map(year => (index.h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
52191
52268
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, months((_b = this.value) !== null && _b !== void 0 ? _b : dist$4.Date.now()).map(month => (index.h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
52192
- index.h("button", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
52269
+ index.h("div", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
52193
52270
  ];
52194
52271
  }
52195
- adjustMonth(delta) {
52196
- var _a;
52197
- const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
52198
- date.setMonth(date.getMonth() + delta);
52199
- this.value = dist$4.Date.create(date);
52200
- }
52201
52272
  static get watchers() { return {
52202
52273
  "value": ["onValueChanged"]
52203
52274
  }; }
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
7
- const generate = require('./generate-5e7cd3f7.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
+ const generate = require('./generate-7f7f7d99.js');
8
8
  require('./_commonjsHelpers-10109b76.js');
9
9
 
10
- const styleCss = ".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))}";
10
+ const styleCss = ".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))}";
11
11
 
12
12
  const Calendar = class {
13
13
  constructor(hostRef) {
@@ -32,7 +32,7 @@ const Calendar = class {
32
32
  event.stopPropagation();
33
33
  } }),
34
34
  index.h("table", null, index.h("thead", null, index.h("tr", null, generate.weekdays().map(day => (index.h("th", null, day))))), generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (index.h("tr", null, week.map(date => {
35
- var _a, _b;
35
+ var _a, _b, _c;
36
36
  return (index.h("td", { tabindex: 1, onClick: () => {
37
37
  this.valueChanged.emit((this.value = date));
38
38
  this.clickCounter += 1;
@@ -45,9 +45,9 @@ const Calendar = class {
45
45
  this.start = date;
46
46
  }
47
47
  }, class: (date == this.value ? ["selected"] : [])
48
- .concat(...(date == index$1.dist.Date.now() ? ["today"] : []), date == this.value ? ["selected"] : [], this.doubleInput
49
- ? index$1.dist.Date.parse(date) >= index$1.dist.Date.parse((_a = this.start) !== null && _a !== void 0 ? _a : "") &&
50
- index$1.dist.Date.parse(date) <= index$1.dist.Date.parse((_b = this.end) !== null && _b !== void 0 ? _b : "")
48
+ .concat(...(date == index$1.dist.Date.now() ? ["today"] : []), index$1.dist.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == index$1.dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
49
+ ? index$1.dist.Date.parse(date) >= index$1.dist.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
50
+ index$1.dist.Date.parse(date) <= index$1.dist.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
51
51
  ? ["dateRange"]
52
52
  : []
53
53
  : "")
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-display-amount-h{display:block}[hidden].sc-smoothly-display-amount-h{display:none}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-input-date-range-h{position:relative;display:block}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-range-h>div.sc-smoothly-input-date-range{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-range-h>nav.sc-smoothly-input-date-range>.arrow.sc-smoothly-input-date-range{position:absolute;z-index:9;transform:translate(10em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}.sc-smoothly-input-date-range-h>section.sc-smoothly-input-date-range{display:flex;flex-direction:row;align-items:center}.sc-smoothly-input-date-range-h>smoothly-input.sc-smoothly-input-date-range{padding:0}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
7
  require('./_commonjsHelpers-10109b76.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-input-date-h{position:relative}nav.sc-smoothly-input-date{position:absolute;z-index:10;top:3.5em;background-color:rgb(var(--smoothly-default-shade));max-width:22em}.sc-smoothly-input-date-h>div.sc-smoothly-input-date{position:fixed;width:100vw;height:100vh;z-index:2}.sc-smoothly-input-date-h>nav.sc-smoothly-input-date>.arrow.sc-smoothly-input-date{position:absolute;z-index:9;transform:translate(2em, -.55em) rotate(45deg);width:1em;height:1em;background-color:rgb(var(--smoothly-default-shade))}";
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b7e6a72c.js');
6
- const index$1 = require('./index-b8688617.js');
7
- const generate = require('./generate-5e7cd3f7.js');
6
+ const index$1 = require('./index-e37f73fe.js');
7
+ const generate = require('./generate-7f7f7d99.js');
8
8
  require('./_commonjsHelpers-10109b76.js');
9
9
 
10
- const styleCss = ".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}";
10
+ const styleCss = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}smoothly-icon.sc-smoothly-input-month{font-size:smaller}";
11
11
 
12
12
  const MonthSelector = class {
13
13
  constructor(hostRef) {
@@ -17,21 +17,21 @@ const MonthSelector = class {
17
17
  onValueChanged(next) {
18
18
  this.valueChanged.emit(next);
19
19
  }
20
+ adjustMonth(delta) {
21
+ var _a;
22
+ const date = index$1.dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now());
23
+ date.setMonth(date.getMonth() + delta);
24
+ this.value = index$1.dist.Date.create(date);
25
+ }
20
26
  render() {
21
27
  var _a, _b;
22
28
  return [
23
- index.h("button", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
29
+ index.h("div", { onClick: () => this.adjustMonth(-1) }, index.h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
24
30
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.years((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now()).map(year => (index.h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
25
31
  index.h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, generate.months((_b = this.value) !== null && _b !== void 0 ? _b : index$1.dist.Date.now()).map(month => (index.h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
26
- index.h("button", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
32
+ index.h("div", { onClick: () => this.adjustMonth(1) }, index.h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
27
33
  ];
28
34
  }
29
- adjustMonth(delta) {
30
- var _a;
31
- const date = index$1.dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : index$1.dist.Date.now());
32
- date.setMonth(date.getMonth() + delta);
33
- this.value = index$1.dist.Date.create(date);
34
- }
35
35
  static get watchers() { return {
36
36
  "value": ["onValueChanged"]
37
37
  }; }
@@ -11,7 +11,8 @@ export function month(date) {
11
11
  d.setDate(day++);
12
12
  r.push(isoly.Date.create(d));
13
13
  }
14
- result.push(r);
14
+ if (row < 5 || isoly.Date.firstOfMonth(r[0]) == isoly.Date.firstOfMonth(date))
15
+ result.push(r);
15
16
  }
16
17
  return result;
17
18
  }
@@ -23,7 +23,7 @@ export class Calendar {
23
23
  h("thead", null,
24
24
  h("tr", null, generate.weekdays().map(day => (h("th", null, day))))),
25
25
  generate.month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
26
- var _a, _b;
26
+ var _a, _b, _c;
27
27
  return (h("td", { tabindex: 1, onClick: () => {
28
28
  this.valueChanged.emit((this.value = date));
29
29
  this.clickCounter += 1;
@@ -36,9 +36,9 @@ export class Calendar {
36
36
  this.start = date;
37
37
  }
38
38
  }, class: (date == this.value ? ["selected"] : [])
39
- .concat(...(date == Date.now() ? ["today"] : []), date == this.value ? ["selected"] : [], this.doubleInput
40
- ? Date.parse(date) >= Date.parse((_a = this.start) !== null && _a !== void 0 ? _a : "") &&
41
- Date.parse(date) <= Date.parse((_b = this.end) !== null && _b !== void 0 ? _b : "")
39
+ .concat(...(date == Date.now() ? ["today"] : []), Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
40
+ ? Date.parse(date) >= Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
41
+ Date.parse(date) <= Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
42
42
  ? ["dateRange"]
43
43
  : []
44
44
  : "")
@@ -1,35 +1,53 @@
1
1
  :host {
2
- display: block;
2
+ display: block;
3
+ --other-month-opacity: 0.5;
3
4
  }
4
5
  :host > smoothly-input-month {
5
6
  width: calc(100% - 1em);
6
- padding: .5em .5em 0 .5em;
7
+ padding: 0.5em 0.5em 0 0.5em;
7
8
  }
8
9
  th,
9
10
  td {
10
11
  text-align: center;
11
- padding: .5em;
12
+ padding: 0.5em;
12
13
  min-width: 2em;
13
14
  background-color: rgb(var(--smoothly-default-shade));
15
+ cursor: pointer;
16
+ user-select: none;
17
+ }
18
+ td.currentMonth {
19
+ color: rgb(var(--smoothly-default-contrast));
20
+ }
21
+ td:not(.currentMonth) {
22
+ color: rgba(var(--smoothly-default-contrast), var(--other-month-opacity));
23
+ }
24
+ td:nth-child(6):not(.currentMonth).selected,
25
+ td:nth-child(6):not(.currentMonth).dateRange,
26
+ td:nth-child(7):not(.currentMonth).selected,
27
+ td:nth-child(7):not(.currentMonth).dateRange {
28
+ color: rgba(var(--smoothly-default-contrast));
14
29
  }
15
-
16
30
  td:nth-child(6),
17
31
  td:nth-child(7) {
18
- color: rgb(var(--smoothly-light-shade));
32
+ color: rgb(var(--smoothly-danger-tint));
33
+ }
34
+ td:nth-child(6):not(.currentMonth),
35
+ td:nth-child(7):not(.currentMonth) {
36
+ color: rgba(var(--smoothly-danger-tint), var(--other-month-opacity));
19
37
  }
20
38
  td:not(.selected):hover {
21
- color: rgb(var(--smoothly-primary-contrast));
22
- background: rgb(var(--smoothly-primary-tint));
39
+ color: rgb(var(--smoothly-primary-contrast));
40
+ background: rgb(var(--smoothly-primary-tint));
23
41
  }
24
42
  td.selected {
25
- color: rgb(var(--smoothly-primary-contrast));
26
- background: rgb(var(--smoothly-primary-color));
43
+ color: rgb(var(--smoothly-primary-contrast));
44
+ background: rgb(var(--smoothly-primary-color));
27
45
  }
28
46
  td:not(.selected,.dateRange):not(:hover).today {
29
- background: rgb(var(--smoothly-dark-tint));
47
+ background: rgb(var(--smoothly-dark-tint));
30
48
  color: rgb(var(--smoothly-dark-contrast));
31
49
  }
32
50
  td.dateRange {
33
51
  color: rgb(var(--smoothly-primary-contrast));
34
- background: rgb(var(--smoothly-primary-tint));
52
+ background: rgb(var(--smoothly-primary-tint));
35
53
  }