overview-components 1.0.75 → 1.0.77
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/_virtual/FileSaver.min.js +4 -0
- package/dist/_virtual/_commonjsHelpers.js +4 -0
- package/dist/assets/icons/iconGlyphs.js +680 -0
- package/dist/components/lit-attachments-tab.js +11 -7
- package/dist/components/lit-badge.js +10 -7
- package/dist/components/lit-case-variables-tab.js +23 -19
- package/dist/components/lit-chart.js +24 -21
- package/dist/components/lit-data-grid-tanstack.js +42 -37
- package/dist/components/lit-filter-modal.js +6 -2
- package/dist/components/lit-multiselect-item.js +7 -3
- package/dist/components/lit-section-tab.js +15 -11
- package/dist/components/lit-tabs-overview.js +9 -5
- package/dist/components/react-wrappers/attachments-tab.js +1 -1
- package/dist/components/react-wrappers/badge.js +1 -1
- package/dist/components/react-wrappers/button.js +3 -3
- package/dist/components/react-wrappers/case-variables-tab.js +3 -3
- package/dist/components/react-wrappers/chart.js +3 -3
- package/dist/components/react-wrappers/data-grid-tanstack.js +1 -1
- package/dist/components/react-wrappers/filter-modal.js +4 -4
- package/dist/components/react-wrappers/progress-bar.js +5 -5
- package/dist/components/react-wrappers/section-tab.js +4 -4
- package/dist/components/react-wrappers/tabs-overview.js +3 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -32
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +432 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +390 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +131 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/node_modules/@lit/localize/init/install.js +11 -0
- package/dist/node_modules/@lit/localize/init/runtime.js +42 -0
- package/dist/node_modules/@lit/localize/internal/default-msg.js +10 -0
- package/dist/node_modules/@lit/localize/internal/deferred.js +21 -0
- package/dist/node_modules/@lit/localize/internal/fnv1a64.js +17 -0
- package/dist/node_modules/@lit/localize/internal/id-generation.js +14 -0
- package/dist/node_modules/@lit/localize/internal/locale-status-event.js +9 -0
- package/dist/node_modules/@lit/localize/internal/runtime-msg.js +42 -0
- package/dist/node_modules/@lit/localize/internal/str-tag.js +15 -0
- package/dist/node_modules/@lit/react/create-component.js +35 -0
- package/dist/node_modules/@lit/reactive-element/css-tag.js +32 -24
- package/dist/node_modules/@lit/reactive-element/reactive-element.js +4 -3
- package/dist/node_modules/@tanstack/lit-table/build/lib/index.js +104 -0
- package/dist/node_modules/@tanstack/lit-virtual/dist/esm/index.js +40 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1956 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +490 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/file-saver/dist/FileSaver.min.js +74 -0
- package/dist/node_modules/lit-element/lit-element.js +51 -0
- package/dist/node_modules/lit-html/directives/class-map.js +34 -0
- package/dist/node_modules/lit-html/lit-html.js +75 -74
- package/dist/node_modules/luxon/src/datetime.js +1793 -0
- package/dist/node_modules/luxon/src/duration.js +723 -0
- package/dist/node_modules/luxon/src/errors.js +40 -0
- package/dist/node_modules/luxon/src/impl/conversions.js +92 -0
- package/dist/node_modules/luxon/src/impl/diff.js +36 -0
- package/dist/node_modules/luxon/src/impl/digits.js +74 -0
- package/dist/node_modules/luxon/src/impl/english.js +138 -0
- package/dist/node_modules/luxon/src/impl/formats.js +150 -0
- package/dist/node_modules/luxon/src/impl/formatter.js +245 -0
- package/dist/node_modules/luxon/src/impl/invalid.js +11 -0
- package/dist/node_modules/luxon/src/impl/locale.js +282 -0
- package/dist/node_modules/luxon/src/impl/regexParser.js +202 -0
- package/dist/node_modules/luxon/src/impl/tokenParser.js +329 -0
- package/dist/node_modules/luxon/src/impl/util.js +206 -0
- package/dist/node_modules/luxon/src/impl/zoneUtil.js +19 -0
- package/dist/node_modules/luxon/src/info.js +180 -0
- package/dist/node_modules/luxon/src/interval.js +466 -0
- package/dist/node_modules/luxon/src/settings.js +150 -0
- package/dist/node_modules/luxon/src/zone.js +88 -0
- package/dist/node_modules/luxon/src/zones/IANAZone.js +178 -0
- package/dist/node_modules/luxon/src/zones/fixedOffsetZone.js +125 -0
- package/dist/node_modules/luxon/src/zones/invalidZone.js +41 -0
- package/dist/node_modules/luxon/src/zones/systemZone.js +47 -0
- package/dist/node_modules/sortablejs/modular/sortable.esm.js +1261 -0
- package/dist/shared/lit-button.js +11 -8
- package/dist/shared/lit-checkbox.js +155 -0
- package/dist/shared/lit-icon.js +282 -0
- package/dist/shared/lit-input.js +211 -0
- package/dist/shared/lit-menu.js +40 -0
- package/dist/shared/lit-modal.js +128 -0
- package/dist/shared/lit-pill.js +86 -0
- package/dist/shared/lit-progress-bar.js +10 -7
- package/dist/shared/lit-select.js +339 -0
- package/dist/shared/lit-tooltip.js +137 -0
- package/dist/shared/simple-tooltip.js +33 -31
- package/dist/shared/styles/button-shared-styles.js +6 -3
- package/dist/styles.js +174 -0
- package/dist/utils/custom-filters.js +8 -7
- package/dist/utils/date.js +6 -5
- package/dist/utils/getOperatorByType.js +4 -3
- package/dist/utils/localization.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { eraForDateTime as D, monthForDateTime as F, weekdayForDateTime as M, meridiemForDateTime as S } from "./english.js";
|
|
2
|
+
import { DATETIME_HUGE_WITH_SECONDS as _, DATETIME_FULL_WITH_SECONDS as p, DATETIME_MED_WITH_SECONDS as k, DATETIME_SHORT_WITH_SECONDS as w, DATETIME_HUGE as I, DATETIME_FULL as L, DATETIME_MED as g, DATETIME_SHORT as O, TIME_24_WITH_LONG_OFFSET as Z, TIME_24_WITH_SHORT_OFFSET as H, TIME_24_WITH_SECONDS as W, TIME_24_SIMPLE as d, TIME_WITH_LONG_OFFSET as N, TIME_WITH_SHORT_OFFSET as A, TIME_WITH_SECONDS as G, TIME_SIMPLE as C, DATE_HUGE as b, DATE_FULL as v, DATE_MED as R, DATE_SHORT as U } from "./formats.js";
|
|
3
|
+
import { padStart as q } from "./util.js";
|
|
4
|
+
function T(E, e) {
|
|
5
|
+
let r = "";
|
|
6
|
+
for (const t of E)
|
|
7
|
+
t.literal ? r += t.val : r += e(t.val);
|
|
8
|
+
return r;
|
|
9
|
+
}
|
|
10
|
+
const z = {
|
|
11
|
+
D: U,
|
|
12
|
+
DD: R,
|
|
13
|
+
DDD: v,
|
|
14
|
+
DDDD: b,
|
|
15
|
+
t: C,
|
|
16
|
+
tt: G,
|
|
17
|
+
ttt: A,
|
|
18
|
+
tttt: N,
|
|
19
|
+
T: d,
|
|
20
|
+
TT: W,
|
|
21
|
+
TTT: H,
|
|
22
|
+
TTTT: Z,
|
|
23
|
+
f: O,
|
|
24
|
+
ff: g,
|
|
25
|
+
fff: L,
|
|
26
|
+
ffff: I,
|
|
27
|
+
F: w,
|
|
28
|
+
FF: k,
|
|
29
|
+
FFF: p,
|
|
30
|
+
FFFF: _
|
|
31
|
+
};
|
|
32
|
+
class h {
|
|
33
|
+
static create(e, r = {}) {
|
|
34
|
+
return new h(e, r);
|
|
35
|
+
}
|
|
36
|
+
static parseFormat(e) {
|
|
37
|
+
let r = null, t = "", n = !1;
|
|
38
|
+
const s = [];
|
|
39
|
+
for (let c = 0; c < e.length; c++) {
|
|
40
|
+
const i = e.charAt(c);
|
|
41
|
+
i === "'" ? (t.length > 0 && s.push({ literal: n || /^\s+$/.test(t), val: t }), r = null, t = "", n = !n) : n || i === r ? t += i : (t.length > 0 && s.push({ literal: /^\s+$/.test(t), val: t }), t = i, r = i);
|
|
42
|
+
}
|
|
43
|
+
return t.length > 0 && s.push({ literal: n || /^\s+$/.test(t), val: t }), s;
|
|
44
|
+
}
|
|
45
|
+
static macroTokenToFormatOpts(e) {
|
|
46
|
+
return z[e];
|
|
47
|
+
}
|
|
48
|
+
constructor(e, r) {
|
|
49
|
+
this.opts = r, this.loc = e, this.systemLoc = null;
|
|
50
|
+
}
|
|
51
|
+
formatWithSystemDefault(e, r) {
|
|
52
|
+
return this.systemLoc === null && (this.systemLoc = this.loc.redefaultToSystem()), this.systemLoc.dtFormatter(e, { ...this.opts, ...r }).format();
|
|
53
|
+
}
|
|
54
|
+
dtFormatter(e, r = {}) {
|
|
55
|
+
return this.loc.dtFormatter(e, { ...this.opts, ...r });
|
|
56
|
+
}
|
|
57
|
+
formatDateTime(e, r) {
|
|
58
|
+
return this.dtFormatter(e, r).format();
|
|
59
|
+
}
|
|
60
|
+
formatDateTimeParts(e, r) {
|
|
61
|
+
return this.dtFormatter(e, r).formatToParts();
|
|
62
|
+
}
|
|
63
|
+
formatInterval(e, r) {
|
|
64
|
+
return this.dtFormatter(e.start, r).dtf.formatRange(e.start.toJSDate(), e.end.toJSDate());
|
|
65
|
+
}
|
|
66
|
+
resolvedOptions(e, r) {
|
|
67
|
+
return this.dtFormatter(e, r).resolvedOptions();
|
|
68
|
+
}
|
|
69
|
+
num(e, r = 0) {
|
|
70
|
+
if (this.opts.forceSimple)
|
|
71
|
+
return q(e, r);
|
|
72
|
+
const t = { ...this.opts };
|
|
73
|
+
return r > 0 && (t.padTo = r), this.loc.numberFormatter(t).format(e);
|
|
74
|
+
}
|
|
75
|
+
formatDateTimeFromString(e, r) {
|
|
76
|
+
const t = this.loc.listingMode() === "en", n = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", s = (a, m) => this.loc.extract(e, a, m), c = (a) => e.isOffsetFixed && e.offset === 0 && a.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, a.format) : "", i = () => t ? S(e) : s({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), o = (a, m) => t ? F(e, a) : s(m ? { month: a } : { month: a, day: "numeric" }, "month"), u = (a, m) => t ? M(e, a) : s(
|
|
77
|
+
m ? { weekday: a } : { weekday: a, month: "long", day: "numeric" },
|
|
78
|
+
"weekday"
|
|
79
|
+
), l = (a) => {
|
|
80
|
+
const m = h.macroTokenToFormatOpts(a);
|
|
81
|
+
return m ? this.formatWithSystemDefault(e, m) : a;
|
|
82
|
+
}, f = (a) => t ? D(e, a) : s({ era: a }, "era"), y = (a) => {
|
|
83
|
+
switch (a) {
|
|
84
|
+
case "S":
|
|
85
|
+
return this.num(e.millisecond);
|
|
86
|
+
case "u":
|
|
87
|
+
case "SSS":
|
|
88
|
+
return this.num(e.millisecond, 3);
|
|
89
|
+
case "s":
|
|
90
|
+
return this.num(e.second);
|
|
91
|
+
case "ss":
|
|
92
|
+
return this.num(e.second, 2);
|
|
93
|
+
case "uu":
|
|
94
|
+
return this.num(Math.floor(e.millisecond / 10), 2);
|
|
95
|
+
case "uuu":
|
|
96
|
+
return this.num(Math.floor(e.millisecond / 100));
|
|
97
|
+
case "m":
|
|
98
|
+
return this.num(e.minute);
|
|
99
|
+
case "mm":
|
|
100
|
+
return this.num(e.minute, 2);
|
|
101
|
+
case "h":
|
|
102
|
+
return this.num(e.hour % 12 === 0 ? 12 : e.hour % 12);
|
|
103
|
+
case "hh":
|
|
104
|
+
return this.num(e.hour % 12 === 0 ? 12 : e.hour % 12, 2);
|
|
105
|
+
case "H":
|
|
106
|
+
return this.num(e.hour);
|
|
107
|
+
case "HH":
|
|
108
|
+
return this.num(e.hour, 2);
|
|
109
|
+
case "Z":
|
|
110
|
+
return c({ format: "narrow", allowZ: this.opts.allowZ });
|
|
111
|
+
case "ZZ":
|
|
112
|
+
return c({ format: "short", allowZ: this.opts.allowZ });
|
|
113
|
+
case "ZZZ":
|
|
114
|
+
return c({ format: "techie", allowZ: this.opts.allowZ });
|
|
115
|
+
case "ZZZZ":
|
|
116
|
+
return e.zone.offsetName(e.ts, { format: "short", locale: this.loc.locale });
|
|
117
|
+
case "ZZZZZ":
|
|
118
|
+
return e.zone.offsetName(e.ts, { format: "long", locale: this.loc.locale });
|
|
119
|
+
case "z":
|
|
120
|
+
return e.zoneName;
|
|
121
|
+
case "a":
|
|
122
|
+
return i();
|
|
123
|
+
case "d":
|
|
124
|
+
return n ? s({ day: "numeric" }, "day") : this.num(e.day);
|
|
125
|
+
case "dd":
|
|
126
|
+
return n ? s({ day: "2-digit" }, "day") : this.num(e.day, 2);
|
|
127
|
+
case "c":
|
|
128
|
+
return this.num(e.weekday);
|
|
129
|
+
case "ccc":
|
|
130
|
+
return u("short", !0);
|
|
131
|
+
case "cccc":
|
|
132
|
+
return u("long", !0);
|
|
133
|
+
case "ccccc":
|
|
134
|
+
return u("narrow", !0);
|
|
135
|
+
case "E":
|
|
136
|
+
return this.num(e.weekday);
|
|
137
|
+
case "EEE":
|
|
138
|
+
return u("short", !1);
|
|
139
|
+
case "EEEE":
|
|
140
|
+
return u("long", !1);
|
|
141
|
+
case "EEEEE":
|
|
142
|
+
return u("narrow", !1);
|
|
143
|
+
case "L":
|
|
144
|
+
return n ? s({ month: "numeric", day: "numeric" }, "month") : this.num(e.month);
|
|
145
|
+
case "LL":
|
|
146
|
+
return n ? s({ month: "2-digit", day: "numeric" }, "month") : this.num(e.month, 2);
|
|
147
|
+
case "LLL":
|
|
148
|
+
return o("short", !0);
|
|
149
|
+
case "LLLL":
|
|
150
|
+
return o("long", !0);
|
|
151
|
+
case "LLLLL":
|
|
152
|
+
return o("narrow", !0);
|
|
153
|
+
case "M":
|
|
154
|
+
return n ? s({ month: "numeric" }, "month") : this.num(e.month);
|
|
155
|
+
case "MM":
|
|
156
|
+
return n ? s({ month: "2-digit" }, "month") : this.num(e.month, 2);
|
|
157
|
+
case "MMM":
|
|
158
|
+
return o("short", !1);
|
|
159
|
+
case "MMMM":
|
|
160
|
+
return o("long", !1);
|
|
161
|
+
case "MMMMM":
|
|
162
|
+
return o("narrow", !1);
|
|
163
|
+
case "y":
|
|
164
|
+
return n ? s({ year: "numeric" }, "year") : this.num(e.year);
|
|
165
|
+
case "yy":
|
|
166
|
+
return n ? s({ year: "2-digit" }, "year") : this.num(e.year.toString().slice(-2), 2);
|
|
167
|
+
case "yyyy":
|
|
168
|
+
return n ? s({ year: "numeric" }, "year") : this.num(e.year, 4);
|
|
169
|
+
case "yyyyyy":
|
|
170
|
+
return n ? s({ year: "numeric" }, "year") : this.num(e.year, 6);
|
|
171
|
+
case "G":
|
|
172
|
+
return f("short");
|
|
173
|
+
case "GG":
|
|
174
|
+
return f("long");
|
|
175
|
+
case "GGGGG":
|
|
176
|
+
return f("narrow");
|
|
177
|
+
case "kk":
|
|
178
|
+
return this.num(e.weekYear.toString().slice(-2), 2);
|
|
179
|
+
case "kkkk":
|
|
180
|
+
return this.num(e.weekYear, 4);
|
|
181
|
+
case "W":
|
|
182
|
+
return this.num(e.weekNumber);
|
|
183
|
+
case "WW":
|
|
184
|
+
return this.num(e.weekNumber, 2);
|
|
185
|
+
case "n":
|
|
186
|
+
return this.num(e.localWeekNumber);
|
|
187
|
+
case "nn":
|
|
188
|
+
return this.num(e.localWeekNumber, 2);
|
|
189
|
+
case "ii":
|
|
190
|
+
return this.num(e.localWeekYear.toString().slice(-2), 2);
|
|
191
|
+
case "iiii":
|
|
192
|
+
return this.num(e.localWeekYear, 4);
|
|
193
|
+
case "o":
|
|
194
|
+
return this.num(e.ordinal);
|
|
195
|
+
case "ooo":
|
|
196
|
+
return this.num(e.ordinal, 3);
|
|
197
|
+
case "q":
|
|
198
|
+
return this.num(e.quarter);
|
|
199
|
+
case "qq":
|
|
200
|
+
return this.num(e.quarter, 2);
|
|
201
|
+
case "X":
|
|
202
|
+
return this.num(Math.floor(e.ts / 1e3));
|
|
203
|
+
case "x":
|
|
204
|
+
return this.num(e.ts);
|
|
205
|
+
default:
|
|
206
|
+
return l(a);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
return T(h.parseFormat(r), y);
|
|
210
|
+
}
|
|
211
|
+
formatDurationFromString(e, r) {
|
|
212
|
+
const t = (o) => {
|
|
213
|
+
switch (o[0]) {
|
|
214
|
+
case "S":
|
|
215
|
+
return "millisecond";
|
|
216
|
+
case "s":
|
|
217
|
+
return "second";
|
|
218
|
+
case "m":
|
|
219
|
+
return "minute";
|
|
220
|
+
case "h":
|
|
221
|
+
return "hour";
|
|
222
|
+
case "d":
|
|
223
|
+
return "day";
|
|
224
|
+
case "w":
|
|
225
|
+
return "week";
|
|
226
|
+
case "M":
|
|
227
|
+
return "month";
|
|
228
|
+
case "y":
|
|
229
|
+
return "year";
|
|
230
|
+
default:
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}, n = (o) => (u) => {
|
|
234
|
+
const l = t(u);
|
|
235
|
+
return l ? this.num(o.get(l), u.length) : u;
|
|
236
|
+
}, s = h.parseFormat(r), c = s.reduce(
|
|
237
|
+
(o, { literal: u, val: l }) => u ? o : o.concat(l),
|
|
238
|
+
[]
|
|
239
|
+
), i = e.shiftTo(...c.map(t).filter((o) => o));
|
|
240
|
+
return T(s, n(i));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export {
|
|
244
|
+
h as default
|
|
245
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { validateWeekSettings as C, hasLocaleWeekInfo as S, roundTo as N, padStart as O, hasRelative as F } from "./util.js";
|
|
2
|
+
import { formatRelativeTime as I, months as W, weekdays as D, meridiems as x, eras as Z } from "./english.js";
|
|
3
|
+
import m from "../settings.js";
|
|
4
|
+
import l from "../datetime.js";
|
|
5
|
+
import v from "../zones/IANAZone.js";
|
|
6
|
+
let k = {};
|
|
7
|
+
function L(n, e = {}) {
|
|
8
|
+
const t = JSON.stringify([n, e]);
|
|
9
|
+
let s = k[t];
|
|
10
|
+
return s || (s = new Intl.ListFormat(n, e), k[t] = s), s;
|
|
11
|
+
}
|
|
12
|
+
let d = {};
|
|
13
|
+
function y(n, e = {}) {
|
|
14
|
+
const t = JSON.stringify([n, e]);
|
|
15
|
+
let s = d[t];
|
|
16
|
+
return s || (s = new Intl.DateTimeFormat(n, e), d[t] = s), s;
|
|
17
|
+
}
|
|
18
|
+
let g = {};
|
|
19
|
+
function E(n, e = {}) {
|
|
20
|
+
const t = JSON.stringify([n, e]);
|
|
21
|
+
let s = g[t];
|
|
22
|
+
return s || (s = new Intl.NumberFormat(n, e), g[t] = s), s;
|
|
23
|
+
}
|
|
24
|
+
let p = {};
|
|
25
|
+
function P(n, e = {}) {
|
|
26
|
+
const { base: t, ...s } = e, i = JSON.stringify([n, s]);
|
|
27
|
+
let r = p[i];
|
|
28
|
+
return r || (r = new Intl.RelativeTimeFormat(n, e), p[i] = r), r;
|
|
29
|
+
}
|
|
30
|
+
let f = null;
|
|
31
|
+
function R() {
|
|
32
|
+
return f || (f = new Intl.DateTimeFormat().resolvedOptions().locale, f);
|
|
33
|
+
}
|
|
34
|
+
let w = {};
|
|
35
|
+
function M(n) {
|
|
36
|
+
let e = w[n];
|
|
37
|
+
if (!e) {
|
|
38
|
+
const t = new Intl.Locale(n);
|
|
39
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, w[n] = e;
|
|
40
|
+
}
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
function z(n) {
|
|
44
|
+
const e = n.indexOf("-x-");
|
|
45
|
+
e !== -1 && (n = n.substring(0, e));
|
|
46
|
+
const t = n.indexOf("-u-");
|
|
47
|
+
if (t === -1)
|
|
48
|
+
return [n];
|
|
49
|
+
{
|
|
50
|
+
let s, i;
|
|
51
|
+
try {
|
|
52
|
+
s = y(n).resolvedOptions(), i = n;
|
|
53
|
+
} catch {
|
|
54
|
+
const u = n.substring(0, t);
|
|
55
|
+
s = y(u).resolvedOptions(), i = u;
|
|
56
|
+
}
|
|
57
|
+
const { numberingSystem: r, calendar: a } = s;
|
|
58
|
+
return [i, r, a];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function $(n, e, t) {
|
|
62
|
+
return (t || e) && (n.includes("-u-") || (n += "-u"), t && (n += `-ca-${t}`), e && (n += `-nu-${e}`)), n;
|
|
63
|
+
}
|
|
64
|
+
function J(n) {
|
|
65
|
+
const e = [];
|
|
66
|
+
for (let t = 1; t <= 12; t++) {
|
|
67
|
+
const s = l.utc(2009, t, 1);
|
|
68
|
+
e.push(n(s));
|
|
69
|
+
}
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
72
|
+
function U(n) {
|
|
73
|
+
const e = [];
|
|
74
|
+
for (let t = 1; t <= 7; t++) {
|
|
75
|
+
const s = l.utc(2016, 11, 13 + t);
|
|
76
|
+
e.push(n(s));
|
|
77
|
+
}
|
|
78
|
+
return e;
|
|
79
|
+
}
|
|
80
|
+
function c(n, e, t, s) {
|
|
81
|
+
const i = n.listingMode();
|
|
82
|
+
return i === "error" ? null : i === "en" ? t(e) : s(e);
|
|
83
|
+
}
|
|
84
|
+
function j(n) {
|
|
85
|
+
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem === "latn";
|
|
86
|
+
}
|
|
87
|
+
class A {
|
|
88
|
+
constructor(e, t, s) {
|
|
89
|
+
this.padTo = s.padTo || 0, this.floor = s.floor || !1;
|
|
90
|
+
const { padTo: i, floor: r, ...a } = s;
|
|
91
|
+
if (!t || Object.keys(a).length > 0) {
|
|
92
|
+
const o = { useGrouping: !1, ...s };
|
|
93
|
+
s.padTo > 0 && (o.minimumIntegerDigits = s.padTo), this.inf = E(e, o);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
format(e) {
|
|
97
|
+
if (this.inf) {
|
|
98
|
+
const t = this.floor ? Math.floor(e) : e;
|
|
99
|
+
return this.inf.format(t);
|
|
100
|
+
} else {
|
|
101
|
+
const t = this.floor ? Math.floor(e) : N(e, 3);
|
|
102
|
+
return O(t, this.padTo);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class G {
|
|
107
|
+
constructor(e, t, s) {
|
|
108
|
+
this.opts = s, this.originalZone = void 0;
|
|
109
|
+
let i;
|
|
110
|
+
if (this.opts.timeZone)
|
|
111
|
+
this.dt = e;
|
|
112
|
+
else if (e.zone.type === "fixed") {
|
|
113
|
+
const a = -1 * (e.offset / 60), o = a >= 0 ? `Etc/GMT+${a}` : `Etc/GMT${a}`;
|
|
114
|
+
e.offset !== 0 && v.create(o).valid ? (i = o, this.dt = e) : (i = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
115
|
+
} else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, i = e.zone.name) : (i = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
116
|
+
const r = { ...this.opts };
|
|
117
|
+
r.timeZone = r.timeZone || i, this.dtf = y(t, r);
|
|
118
|
+
}
|
|
119
|
+
format() {
|
|
120
|
+
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
121
|
+
}
|
|
122
|
+
formatToParts() {
|
|
123
|
+
const e = this.dtf.formatToParts(this.dt.toJSDate());
|
|
124
|
+
return this.originalZone ? e.map((t) => {
|
|
125
|
+
if (t.type === "timeZoneName") {
|
|
126
|
+
const s = this.originalZone.offsetName(this.dt.ts, {
|
|
127
|
+
locale: this.dt.locale,
|
|
128
|
+
format: this.opts.timeZoneName
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
...t,
|
|
132
|
+
value: s
|
|
133
|
+
};
|
|
134
|
+
} else
|
|
135
|
+
return t;
|
|
136
|
+
}) : e;
|
|
137
|
+
}
|
|
138
|
+
resolvedOptions() {
|
|
139
|
+
return this.dtf.resolvedOptions();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
class q {
|
|
143
|
+
constructor(e, t, s) {
|
|
144
|
+
this.opts = { style: "long", ...s }, !t && F() && (this.rtf = P(e, s));
|
|
145
|
+
}
|
|
146
|
+
format(e, t) {
|
|
147
|
+
return this.rtf ? this.rtf.format(e, t) : I(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
148
|
+
}
|
|
149
|
+
formatToParts(e, t) {
|
|
150
|
+
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const K = {
|
|
154
|
+
firstDay: 1,
|
|
155
|
+
minimalDays: 4,
|
|
156
|
+
weekend: [6, 7]
|
|
157
|
+
};
|
|
158
|
+
class h {
|
|
159
|
+
static fromOpts(e) {
|
|
160
|
+
return h.create(
|
|
161
|
+
e.locale,
|
|
162
|
+
e.numberingSystem,
|
|
163
|
+
e.outputCalendar,
|
|
164
|
+
e.weekSettings,
|
|
165
|
+
e.defaultToEN
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
static create(e, t, s, i, r = !1) {
|
|
169
|
+
const a = e || m.defaultLocale, o = a || (r ? "en-US" : R()), u = t || m.defaultNumberingSystem, T = s || m.defaultOutputCalendar, b = C(i) || m.defaultWeekSettings;
|
|
170
|
+
return new h(o, u, T, b, a);
|
|
171
|
+
}
|
|
172
|
+
static resetCache() {
|
|
173
|
+
f = null, d = {}, g = {}, p = {};
|
|
174
|
+
}
|
|
175
|
+
static fromObject({ locale: e, numberingSystem: t, outputCalendar: s, weekSettings: i } = {}) {
|
|
176
|
+
return h.create(e, t, s, i);
|
|
177
|
+
}
|
|
178
|
+
constructor(e, t, s, i, r) {
|
|
179
|
+
const [a, o, u] = z(e);
|
|
180
|
+
this.locale = a, this.numberingSystem = t || o || null, this.outputCalendar = s || u || null, this.weekSettings = i, this.intl = $(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = r, this.fastNumbersCached = null;
|
|
181
|
+
}
|
|
182
|
+
get fastNumbers() {
|
|
183
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = j(this)), this.fastNumbersCached;
|
|
184
|
+
}
|
|
185
|
+
listingMode() {
|
|
186
|
+
const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
187
|
+
return e && t ? "en" : "intl";
|
|
188
|
+
}
|
|
189
|
+
clone(e) {
|
|
190
|
+
return !e || Object.getOwnPropertyNames(e).length === 0 ? this : h.create(
|
|
191
|
+
e.locale || this.specifiedLocale,
|
|
192
|
+
e.numberingSystem || this.numberingSystem,
|
|
193
|
+
e.outputCalendar || this.outputCalendar,
|
|
194
|
+
C(e.weekSettings) || this.weekSettings,
|
|
195
|
+
e.defaultToEN || !1
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
redefaultToEN(e = {}) {
|
|
199
|
+
return this.clone({ ...e, defaultToEN: !0 });
|
|
200
|
+
}
|
|
201
|
+
redefaultToSystem(e = {}) {
|
|
202
|
+
return this.clone({ ...e, defaultToEN: !1 });
|
|
203
|
+
}
|
|
204
|
+
months(e, t = !1) {
|
|
205
|
+
return c(this, e, W, () => {
|
|
206
|
+
const s = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
207
|
+
return this.monthsCache[i][e] || (this.monthsCache[i][e] = J((r) => this.extract(r, s, "month"))), this.monthsCache[i][e];
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
weekdays(e, t = !1) {
|
|
211
|
+
return c(this, e, D, () => {
|
|
212
|
+
const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, i = t ? "format" : "standalone";
|
|
213
|
+
return this.weekdaysCache[i][e] || (this.weekdaysCache[i][e] = U(
|
|
214
|
+
(r) => this.extract(r, s, "weekday")
|
|
215
|
+
)), this.weekdaysCache[i][e];
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
meridiems() {
|
|
219
|
+
return c(
|
|
220
|
+
this,
|
|
221
|
+
void 0,
|
|
222
|
+
() => x,
|
|
223
|
+
() => {
|
|
224
|
+
if (!this.meridiemCache) {
|
|
225
|
+
const e = { hour: "numeric", hourCycle: "h12" };
|
|
226
|
+
this.meridiemCache = [l.utc(2016, 11, 13, 9), l.utc(2016, 11, 13, 19)].map(
|
|
227
|
+
(t) => this.extract(t, e, "dayperiod")
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
return this.meridiemCache;
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
eras(e) {
|
|
235
|
+
return c(this, e, Z, () => {
|
|
236
|
+
const t = { era: e };
|
|
237
|
+
return this.eraCache[e] || (this.eraCache[e] = [l.utc(-40, 1, 1), l.utc(2017, 1, 1)].map(
|
|
238
|
+
(s) => this.extract(s, t, "era")
|
|
239
|
+
)), this.eraCache[e];
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
extract(e, t, s) {
|
|
243
|
+
const i = this.dtFormatter(e, t), r = i.formatToParts(), a = r.find((o) => o.type.toLowerCase() === s);
|
|
244
|
+
return a ? a.value : null;
|
|
245
|
+
}
|
|
246
|
+
numberFormatter(e = {}) {
|
|
247
|
+
return new A(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
248
|
+
}
|
|
249
|
+
dtFormatter(e, t = {}) {
|
|
250
|
+
return new G(e, this.intl, t);
|
|
251
|
+
}
|
|
252
|
+
relFormatter(e = {}) {
|
|
253
|
+
return new q(this.intl, this.isEnglish(), e);
|
|
254
|
+
}
|
|
255
|
+
listFormatter(e = {}) {
|
|
256
|
+
return L(this.intl, e);
|
|
257
|
+
}
|
|
258
|
+
isEnglish() {
|
|
259
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
|
|
260
|
+
}
|
|
261
|
+
getWeekSettings() {
|
|
262
|
+
return this.weekSettings ? this.weekSettings : S() ? M(this.locale) : K;
|
|
263
|
+
}
|
|
264
|
+
getStartOfWeek() {
|
|
265
|
+
return this.getWeekSettings().firstDay;
|
|
266
|
+
}
|
|
267
|
+
getMinDaysInFirstWeek() {
|
|
268
|
+
return this.getWeekSettings().minimalDays;
|
|
269
|
+
}
|
|
270
|
+
getWeekendDays() {
|
|
271
|
+
return this.getWeekSettings().weekend;
|
|
272
|
+
}
|
|
273
|
+
equals(e) {
|
|
274
|
+
return this.locale === e.locale && this.numberingSystem === e.numberingSystem && this.outputCalendar === e.outputCalendar;
|
|
275
|
+
}
|
|
276
|
+
toString() {
|
|
277
|
+
return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
export {
|
|
281
|
+
h as default
|
|
282
|
+
};
|