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.
- package/dist/cjs/{generate-5e7cd3f7.js → generate-7f7f7d99.js} +3 -2
- package/dist/cjs/{index-b8688617.js → index-e37f73fe.js} +89 -19
- package/dist/cjs/smoothly-accordion_43.cjs.entry.js +104 -33
- package/dist/cjs/smoothly-calendar.cjs.entry.js +7 -7
- package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-input-month.cjs.entry.js +11 -11
- package/dist/collection/components/calendar/generate.js +2 -1
- package/dist/collection/components/calendar/index.js +4 -4
- package/dist/collection/components/calendar/style.css +29 -11
- package/dist/collection/components/input-month/index.js +8 -8
- package/dist/collection/components/input-month/style.css +0 -6
- package/dist/custom-elements/index.js +105 -34
- package/dist/{smoothly/generate-fc812e0f.js → esm/generate-7090dc14.js} +3 -2
- package/dist/{smoothly/index-046ba252.js → esm/index-13251390.js} +89 -19
- package/dist/esm/smoothly-accordion_43.entry.js +104 -33
- package/dist/esm/smoothly-calendar.entry.js +7 -7
- package/dist/esm/smoothly-display-amount.entry.js +1 -1
- package/dist/esm/smoothly-input-date-range.entry.js +1 -1
- package/dist/esm/smoothly-input-date.entry.js +1 -1
- package/dist/esm/smoothly-input-month.entry.js +11 -11
- package/dist/{esm/generate-fc812e0f.js → smoothly/generate-7090dc14.js} +3 -2
- package/dist/{esm/index-046ba252.js → smoothly/index-13251390.js} +89 -19
- package/dist/smoothly/p-2e35abfc.entry.js +1 -0
- package/dist/smoothly/smoothly-calendar.entry.js +7 -7
- package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
- package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
- package/dist/smoothly/smoothly-input-date.entry.js +1 -1
- package/dist/smoothly/smoothly-input-month.entry.js +11 -11
- package/dist/types/components/input-month/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/smoothly/p-9439cb96.entry.js +0 -1
|
@@ -16543,27 +16543,27 @@ exports.CurrencyCode = void 0;
|
|
|
16543
16543
|
|
|
16544
16544
|
var _Date$1 = createCommonjsModule(function (module, exports) {
|
|
16545
16545
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16546
|
-
exports.
|
|
16547
|
-
(function (
|
|
16546
|
+
exports.Date = void 0;
|
|
16547
|
+
(function (Date) {
|
|
16548
16548
|
function is(value) {
|
|
16549
16549
|
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));
|
|
16550
16550
|
}
|
|
16551
|
-
|
|
16551
|
+
Date.is = is;
|
|
16552
16552
|
function parse(value, time) {
|
|
16553
|
-
return new Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
|
|
16553
|
+
return new globalThis.Date(value + (time !== null && time !== void 0 ? time : "T12:00:00.000Z"));
|
|
16554
16554
|
}
|
|
16555
|
-
|
|
16555
|
+
Date.parse = parse;
|
|
16556
16556
|
function create(value) {
|
|
16557
16557
|
return value.toISOString().substring(0, 10);
|
|
16558
16558
|
}
|
|
16559
|
-
|
|
16559
|
+
Date.create = create;
|
|
16560
16560
|
function now() {
|
|
16561
|
-
return create(new Date());
|
|
16561
|
+
return create(new globalThis.Date());
|
|
16562
16562
|
}
|
|
16563
|
-
|
|
16563
|
+
Date.now = now;
|
|
16564
16564
|
function localize(value, locale) {
|
|
16565
|
-
|
|
16566
|
-
|
|
16565
|
+
return (is(value) ? parse(value) : value)
|
|
16566
|
+
.toLocaleString(locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale, {
|
|
16567
16567
|
year: "numeric",
|
|
16568
16568
|
month: "2-digit",
|
|
16569
16569
|
day: "2-digit",
|
|
@@ -16571,11 +16571,82 @@ exports.IsoDate = void 0;
|
|
|
16571
16571
|
minute: "2-digit",
|
|
16572
16572
|
second: "2-digit",
|
|
16573
16573
|
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
16574
|
-
}
|
|
16575
|
-
|
|
16574
|
+
})
|
|
16575
|
+
.substring(0, 10);
|
|
16576
16576
|
}
|
|
16577
|
-
|
|
16578
|
-
|
|
16577
|
+
Date.localize = localize;
|
|
16578
|
+
function next(date, days = 1) {
|
|
16579
|
+
let result;
|
|
16580
|
+
if (typeof days == "number") {
|
|
16581
|
+
const r = parse(date);
|
|
16582
|
+
r.setDate(r.getDate() + days);
|
|
16583
|
+
result = Date.create(r);
|
|
16584
|
+
}
|
|
16585
|
+
else {
|
|
16586
|
+
result = date;
|
|
16587
|
+
if (days.years)
|
|
16588
|
+
result = nextYear(result, days.years);
|
|
16589
|
+
if (days.months)
|
|
16590
|
+
result = nextMonth(result, days.months);
|
|
16591
|
+
if (days.days)
|
|
16592
|
+
result = next(result, days.days);
|
|
16593
|
+
}
|
|
16594
|
+
return result;
|
|
16595
|
+
}
|
|
16596
|
+
Date.next = next;
|
|
16597
|
+
function previous(date, days = 1) {
|
|
16598
|
+
let result;
|
|
16599
|
+
if (typeof days == "number") {
|
|
16600
|
+
const r = parse(date);
|
|
16601
|
+
r.setDate(r.getDate() - days);
|
|
16602
|
+
result = Date.create(r);
|
|
16603
|
+
}
|
|
16604
|
+
else {
|
|
16605
|
+
result = date;
|
|
16606
|
+
if (days.years)
|
|
16607
|
+
result = previousYear(result, days.years);
|
|
16608
|
+
if (days.months)
|
|
16609
|
+
result = previousMonth(result, days.months);
|
|
16610
|
+
if (days.days)
|
|
16611
|
+
result = previous(result, days.days);
|
|
16612
|
+
}
|
|
16613
|
+
return result;
|
|
16614
|
+
}
|
|
16615
|
+
Date.previous = previous;
|
|
16616
|
+
function nextMonth(date, months = 1) {
|
|
16617
|
+
const result = parse(date);
|
|
16618
|
+
result.setMonth(result.getMonth() + months);
|
|
16619
|
+
return Date.create(result);
|
|
16620
|
+
}
|
|
16621
|
+
Date.nextMonth = nextMonth;
|
|
16622
|
+
function previousMonth(date, months = 1) {
|
|
16623
|
+
return nextMonth(date, -months);
|
|
16624
|
+
}
|
|
16625
|
+
Date.previousMonth = previousMonth;
|
|
16626
|
+
function nextYear(date, years = 1) {
|
|
16627
|
+
const result = parse(date);
|
|
16628
|
+
result.setFullYear(result.getFullYear() + years);
|
|
16629
|
+
return Date.create(result);
|
|
16630
|
+
}
|
|
16631
|
+
Date.nextYear = nextYear;
|
|
16632
|
+
function previousYear(date, years = 1) {
|
|
16633
|
+
return nextYear(date, -years);
|
|
16634
|
+
}
|
|
16635
|
+
Date.previousYear = previousYear;
|
|
16636
|
+
function firstOfMonth(date) {
|
|
16637
|
+
const result = parse(date);
|
|
16638
|
+
result.setDate(1);
|
|
16639
|
+
return Date.create(result);
|
|
16640
|
+
}
|
|
16641
|
+
Date.firstOfMonth = firstOfMonth;
|
|
16642
|
+
function lastOfMonth(date) {
|
|
16643
|
+
const result = parse(date);
|
|
16644
|
+
result.setMonth(result.getMonth() + 1);
|
|
16645
|
+
result.setDate(-1);
|
|
16646
|
+
return Date.create(result);
|
|
16647
|
+
}
|
|
16648
|
+
Date.lastOfMonth = lastOfMonth;
|
|
16649
|
+
})(exports.Date || (exports.Date = {}));
|
|
16579
16650
|
//# sourceMappingURL=Date.js.map
|
|
16580
16651
|
});
|
|
16581
16652
|
|
|
@@ -16602,7 +16673,7 @@ exports.DateTime = void 0;
|
|
|
16602
16673
|
DateTime.now = now;
|
|
16603
16674
|
function localize(value, locale) {
|
|
16604
16675
|
const localeString = locale ? locale : Intl.DateTimeFormat().resolvedOptions().locale;
|
|
16605
|
-
|
|
16676
|
+
return (is(value) ? parse(value) : value).toLocaleString(localeString, {
|
|
16606
16677
|
year: "numeric",
|
|
16607
16678
|
month: "2-digit",
|
|
16608
16679
|
day: "2-digit",
|
|
@@ -16610,8 +16681,7 @@ exports.DateTime = void 0;
|
|
|
16610
16681
|
minute: "2-digit",
|
|
16611
16682
|
second: "2-digit",
|
|
16612
16683
|
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
16613
|
-
};
|
|
16614
|
-
return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions);
|
|
16684
|
+
});
|
|
16615
16685
|
}
|
|
16616
16686
|
DateTime.localize = localize;
|
|
16617
16687
|
})(exports.DateTime || (exports.DateTime = {}));
|
|
@@ -18358,7 +18428,7 @@ Object.defineProperty(exports, "Currency", { enumerable: true, get: function ()
|
|
|
18358
18428
|
|
|
18359
18429
|
Object.defineProperty(exports, "CurrencyCode", { enumerable: true, get: function () { return CurrencyCode_1$2.CurrencyCode; } });
|
|
18360
18430
|
|
|
18361
|
-
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$1.
|
|
18431
|
+
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return _Date$1.Date; } });
|
|
18362
18432
|
|
|
18363
18433
|
Object.defineProperty(exports, "DateTime", { enumerable: true, get: function () { return DateTime_1$2.DateTime; } });
|
|
18364
18434
|
|
|
@@ -18382,7 +18452,8 @@ function month(date) {
|
|
|
18382
18452
|
d.setDate(day++);
|
|
18383
18453
|
r.push(dist$4.Date.create(d));
|
|
18384
18454
|
}
|
|
18385
|
-
|
|
18455
|
+
if (row < 5 || dist$4.Date.firstOfMonth(r[0]) == dist$4.Date.firstOfMonth(date))
|
|
18456
|
+
result.push(r);
|
|
18386
18457
|
}
|
|
18387
18458
|
return result;
|
|
18388
18459
|
}
|
|
@@ -18427,7 +18498,7 @@ function years(current) {
|
|
|
18427
18498
|
return result;
|
|
18428
18499
|
}
|
|
18429
18500
|
|
|
18430
|
-
const styleCss$w = ".sc-smoothly-calendar-h{display:block}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding
|
|
18501
|
+
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))}";
|
|
18431
18502
|
|
|
18432
18503
|
const Calendar = class {
|
|
18433
18504
|
constructor(hostRef) {
|
|
@@ -18452,7 +18523,7 @@ const Calendar = class {
|
|
|
18452
18523
|
event.stopPropagation();
|
|
18453
18524
|
} }),
|
|
18454
18525
|
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 => {
|
|
18455
|
-
var _a, _b;
|
|
18526
|
+
var _a, _b, _c;
|
|
18456
18527
|
return (h("td", { tabindex: 1, onClick: () => {
|
|
18457
18528
|
this.valueChanged.emit((this.value = date));
|
|
18458
18529
|
this.clickCounter += 1;
|
|
@@ -18465,9 +18536,9 @@ const Calendar = class {
|
|
|
18465
18536
|
this.start = date;
|
|
18466
18537
|
}
|
|
18467
18538
|
}, class: (date == this.value ? ["selected"] : [])
|
|
18468
|
-
.concat(...(date == dist$4.Date.now() ? ["today"] : []),
|
|
18469
|
-
? dist$4.Date.parse(date) >= dist$4.Date.parse((
|
|
18470
|
-
dist$4.Date.parse(date) <= dist$4.Date.parse((
|
|
18539
|
+
.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
|
|
18540
|
+
? dist$4.Date.parse(date) >= dist$4.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
|
|
18541
|
+
dist$4.Date.parse(date) <= dist$4.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
18471
18542
|
? ["dateRange"]
|
|
18472
18543
|
: []
|
|
18473
18544
|
: "")
|
|
@@ -52169,7 +52240,7 @@ const SmoothlyInputDemo = class {
|
|
|
52169
52240
|
}
|
|
52170
52241
|
};
|
|
52171
52242
|
|
|
52172
|
-
const styleCss$k = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}
|
|
52243
|
+
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}";
|
|
52173
52244
|
|
|
52174
52245
|
const MonthSelector = class {
|
|
52175
52246
|
constructor(hostRef) {
|
|
@@ -52179,21 +52250,21 @@ const MonthSelector = class {
|
|
|
52179
52250
|
onValueChanged(next) {
|
|
52180
52251
|
this.valueChanged.emit(next);
|
|
52181
52252
|
}
|
|
52253
|
+
adjustMonth(delta) {
|
|
52254
|
+
var _a;
|
|
52255
|
+
const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
|
|
52256
|
+
date.setMonth(date.getMonth() + delta);
|
|
52257
|
+
this.value = dist$4.Date.create(date);
|
|
52258
|
+
}
|
|
52182
52259
|
render() {
|
|
52183
52260
|
var _a, _b;
|
|
52184
52261
|
return [
|
|
52185
|
-
h("
|
|
52262
|
+
h("div", { onClick: () => this.adjustMonth(-1) }, h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
|
|
52186
52263
|
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)))),
|
|
52187
52264
|
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)))),
|
|
52188
|
-
h("
|
|
52265
|
+
h("div", { onClick: () => this.adjustMonth(1) }, h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
|
|
52189
52266
|
];
|
|
52190
52267
|
}
|
|
52191
|
-
adjustMonth(delta) {
|
|
52192
|
-
var _a;
|
|
52193
|
-
const date = dist$4.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist$4.Date.now());
|
|
52194
|
-
date.setMonth(date.getMonth() + delta);
|
|
52195
|
-
this.value = dist$4.Date.create(date);
|
|
52196
|
-
}
|
|
52197
52268
|
static get watchers() { return {
|
|
52198
52269
|
"value": ["onValueChanged"]
|
|
52199
52270
|
}; }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, i as createEvent, h, j as getElement } from './index-0dd5f791.js';
|
|
2
|
-
import { d as dist } from './index-
|
|
3
|
-
import { w as weekdays, m as month } from './generate-
|
|
2
|
+
import { d as dist } from './index-13251390.js';
|
|
3
|
+
import { w as weekdays, m as month } from './generate-7090dc14.js';
|
|
4
4
|
import './_commonjsHelpers-8fe71198.js';
|
|
5
5
|
|
|
6
|
-
const styleCss = ".sc-smoothly-calendar-h{display:block}.sc-smoothly-calendar-h>smoothly-input-month.sc-smoothly-calendar{width:calc(100% - 1em);padding
|
|
6
|
+
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))}";
|
|
7
7
|
|
|
8
8
|
const Calendar = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -28,7 +28,7 @@ const Calendar = class {
|
|
|
28
28
|
event.stopPropagation();
|
|
29
29
|
} }),
|
|
30
30
|
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 => {
|
|
31
|
-
var _a, _b;
|
|
31
|
+
var _a, _b, _c;
|
|
32
32
|
return (h("td", { tabindex: 1, onClick: () => {
|
|
33
33
|
this.valueChanged.emit((this.value = date));
|
|
34
34
|
this.clickCounter += 1;
|
|
@@ -41,9 +41,9 @@ const Calendar = class {
|
|
|
41
41
|
this.start = date;
|
|
42
42
|
}
|
|
43
43
|
}, class: (date == this.value ? ["selected"] : [])
|
|
44
|
-
.concat(...(date == dist.Date.now() ? ["today"] : []),
|
|
45
|
-
? dist.Date.parse(date) >= dist.Date.parse((
|
|
46
|
-
dist.Date.parse(date) <= dist.Date.parse((
|
|
44
|
+
.concat(...(date == dist.Date.now() ? ["today"] : []), dist.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
45
|
+
? dist.Date.parse(date) >= dist.Date.parse((_b = this.start) !== null && _b !== void 0 ? _b : "") &&
|
|
46
|
+
dist.Date.parse(date) <= dist.Date.parse((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
47
47
|
? ["dateRange"]
|
|
48
48
|
: []
|
|
49
49
|
: "")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance } from './index-0dd5f791.js';
|
|
2
|
-
import { d as dist } from './index-
|
|
2
|
+
import { d as dist } from './index-13251390.js';
|
|
3
3
|
import './_commonjsHelpers-8fe71198.js';
|
|
4
4
|
|
|
5
5
|
const styleCss = ".sc-smoothly-display-amount-h{display:block}[hidden].sc-smoothly-display-amount-h{display:none}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, i as createEvent, h } from './index-0dd5f791.js';
|
|
2
|
-
import { d as dist } from './index-
|
|
2
|
+
import { d as dist } from './index-13251390.js';
|
|
3
3
|
import './_commonjsHelpers-8fe71198.js';
|
|
4
4
|
|
|
5
5
|
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}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, i as createEvent, h } from './index-0dd5f791.js';
|
|
2
|
-
import { d as dist } from './index-
|
|
2
|
+
import { d as dist } from './index-13251390.js';
|
|
3
3
|
import './_commonjsHelpers-8fe71198.js';
|
|
4
4
|
|
|
5
5
|
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))}";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, i as createEvent, h } from './index-0dd5f791.js';
|
|
2
|
-
import { d as dist } from './index-
|
|
3
|
-
import { y as years, a as months } from './generate-
|
|
2
|
+
import { d as dist } from './index-13251390.js';
|
|
3
|
+
import { y as years, a as months } from './generate-7090dc14.js';
|
|
4
4
|
import './_commonjsHelpers-8fe71198.js';
|
|
5
5
|
|
|
6
|
-
const styleCss = ".sc-smoothly-input-month-h{display:flex;justify-content:space-between;font-size:large}
|
|
6
|
+
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}";
|
|
7
7
|
|
|
8
8
|
const MonthSelector = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -13,21 +13,21 @@ const MonthSelector = class {
|
|
|
13
13
|
onValueChanged(next) {
|
|
14
14
|
this.valueChanged.emit(next);
|
|
15
15
|
}
|
|
16
|
+
adjustMonth(delta) {
|
|
17
|
+
var _a;
|
|
18
|
+
const date = dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist.Date.now());
|
|
19
|
+
date.setMonth(date.getMonth() + delta);
|
|
20
|
+
this.value = dist.Date.create(date);
|
|
21
|
+
}
|
|
16
22
|
render() {
|
|
17
23
|
var _a, _b;
|
|
18
24
|
return [
|
|
19
|
-
h("
|
|
25
|
+
h("div", { onClick: () => this.adjustMonth(-1) }, h("smoothly-icon", { name: "chevron-back-outline", size: "small" })),
|
|
20
26
|
h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, years((_a = this.value) !== null && _a !== void 0 ? _a : dist.Date.now()).map(year => (h("smoothly-item", { value: year.date, selected: year.selected }, year.name)))),
|
|
21
27
|
h("smoothly-selector", { onSelected: (e) => (this.value = e.detail) }, months((_b = this.value) !== null && _b !== void 0 ? _b : dist.Date.now()).map(month => (h("smoothly-item", { value: month.date, selected: month.selected }, month.name)))),
|
|
22
|
-
h("
|
|
28
|
+
h("div", { onClick: () => this.adjustMonth(1) }, h("smoothly-icon", { name: "chevron-forward-outline", size: "small" })),
|
|
23
29
|
];
|
|
24
30
|
}
|
|
25
|
-
adjustMonth(delta) {
|
|
26
|
-
var _a;
|
|
27
|
-
const date = dist.Date.parse((_a = this.value) !== null && _a !== void 0 ? _a : dist.Date.now());
|
|
28
|
-
date.setMonth(date.getMonth() + delta);
|
|
29
|
-
this.value = dist.Date.create(date);
|
|
30
|
-
}
|
|
31
31
|
static get watchers() { return {
|
|
32
32
|
"value": ["onValueChanged"]
|
|
33
33
|
}; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as dist } from './index-
|
|
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
|
-
|
|
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.
|
|
16572
|
-
var
|
|
16573
|
-
(function (
|
|
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
|
-
|
|
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
|
-
|
|
16581
|
+
Date.parse = parse;
|
|
16582
16582
|
function create(value) {
|
|
16583
16583
|
return value.toISOString().substring(0, 10);
|
|
16584
16584
|
}
|
|
16585
|
-
|
|
16585
|
+
Date.create = create;
|
|
16586
16586
|
function now() {
|
|
16587
|
-
return create(new Date());
|
|
16587
|
+
return create(new globalThis.Date());
|
|
16588
16588
|
}
|
|
16589
|
-
|
|
16589
|
+
Date.now = now;
|
|
16590
16590
|
function localize(value, locale) {
|
|
16591
|
-
|
|
16592
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16604
|
-
})(
|
|
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
|
-
|
|
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.
|
|
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
|
|