@gez/date-time-kit 2.0.0-alpha.25 → 2.0.0-alpha.28

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.
@@ -43,6 +43,7 @@ export declare class Ele extends UiBase<Attrs, Emits> {
43
43
  */
44
44
  toggleOpen: (force?: boolean) => boolean | null;
45
45
  connectedCallback(): void;
46
+ disconnectedCallback(): boolean | void;
46
47
  protected _onAttrChanged(name: string, oldValue: string | null, newValue: string | null): void;
47
48
  private _onToggleClick;
48
49
  private _onDocClick;
@@ -127,6 +127,12 @@ export class Ele extends UiBase {
127
127
  this._bindEvt(this._els.trigger)("click", this._onToggleClick);
128
128
  this.strategy = this.strategy;
129
129
  }
130
+ disconnectedCallback() {
131
+ var _a2;
132
+ (_a2 = this._cleanupAutoUpdate) == null ? void 0 : _a2.call(this);
133
+ document.removeEventListener("click", this._onDocClick, true);
134
+ return super.disconnectedCallback();
135
+ }
130
136
  _onAttrChanged(name, oldValue, newValue) {
131
137
  var _a2;
132
138
  super._onAttrChanged(name, oldValue, newValue);
@@ -110,6 +110,14 @@ export declare const localeInfo2UTCInfo: (info: PeriodTimeInfo) => {
110
110
  end: Date;
111
111
  /** Timezone offset in minutes. e.g. UTC+05:45 => `-345`, UTC-01:00 => `60` */
112
112
  tzOffset: number;
113
+ } | {
114
+ type: "last90Days";
115
+ /** Locale time */
116
+ start: Date;
117
+ /** Locale time */
118
+ end: Date;
119
+ /** Timezone offset in minutes. e.g. UTC+05:45 => `-345`, UTC-01:00 => `60` */
120
+ tzOffset: number;
113
121
  } | {
114
122
  type: "last180Days";
115
123
  /** Locale time */
@@ -207,6 +215,14 @@ export declare const UTCInfo2LocaleInfo: (info: PeriodTimeInfo) => {
207
215
  end: Date;
208
216
  /** Timezone offset in minutes. e.g. UTC+05:45 => `-345`, UTC-01:00 => `60` */
209
217
  tzOffset: number;
218
+ } | {
219
+ type: "last90Days";
220
+ /** Locale time */
221
+ start: Date;
222
+ /** Locale time */
223
+ end: Date;
224
+ /** Timezone offset in minutes. e.g. UTC+05:45 => `-345`, UTC-01:00 => `60` */
225
+ tzOffset: number;
210
226
  } | {
211
227
  type: "last180Days";
212
228
  /** Locale time */
@@ -9,6 +9,7 @@ export const limitKeys = [
9
9
  "last7Days",
10
10
  "month",
11
11
  "last30Days",
12
+ "last90Days",
12
13
  "last180Days",
13
14
  "last6Month",
14
15
  "year"
@@ -74,6 +75,11 @@ const presetPeriods = {
74
75
  start: (t) => t.setDate(t.getDate() - 29),
75
76
  end: noop
76
77
  }),
78
+ last90Days: (ops) => genPeriodTimes({
79
+ ...ops,
80
+ start: (t) => t.setDate(t.getDate() - 89),
81
+ end: noop
82
+ }),
77
83
  last180Days: (ops) => genPeriodTimes({
78
84
  ...ops,
79
85
  start: (t) => t.setDate(t.getDate() - 179),
package/dist/i18n.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type DataLimit = 'all' | 'today' | 'yesterday' | 'week' | 'lastWeek' | 'last7Days' | 'month' | 'last30Days' | 'last180Days' | 'last6Month' | 'year';
1
+ export type DataLimit = 'all' | 'today' | 'yesterday' | 'week' | 'lastWeek' | 'last7Days' | 'month' | 'last30Days' | 'last90Days' | 'last180Days' | 'last6Month' | 'year';
2
2
  export declare const langs: readonly ["en-US", "zh-CN", "zh-TW", "id-ID", "vi-VN", "th-TH", "ms-MY", "ko-KR", "ar-AE"];
3
3
  export type Lang = (typeof langs)[number];
4
4
  export type I18nCfg = {
package/dist/i18n.mjs CHANGED
@@ -26,6 +26,7 @@ export const i18n = {
26
26
  last7Days: "Last 7 Days",
27
27
  month: "This Month",
28
28
  last30Days: "Last 30 Days",
29
+ last90Days: "Last 90 Days",
29
30
  last180Days: "Last 180 Days",
30
31
  last6Month: "Last 6 Month",
31
32
  year: "This Year",
@@ -80,6 +81,7 @@ export const i18n = {
80
81
  last7Days: "\u6700\u8FD17\u5929",
81
82
  month: "\u672C\u6708",
82
83
  last30Days: "\u6700\u8FD130\u5929",
84
+ last90Days: "\u6700\u8FD190\u5929",
83
85
  last180Days: "\u6700\u8FD1180\u5929",
84
86
  last6Month: "\u6700\u8FD16\u4E2A\u6708",
85
87
  year: "\u4ECA\u5E74",
@@ -134,6 +136,7 @@ export const i18n = {
134
136
  last7Days: "\u6700\u8FD17\u5929",
135
137
  month: "\u672C\u6708",
136
138
  last30Days: "\u6700\u8FD130\u5929",
139
+ last90Days: "\u6700\u8FD190\u5929",
137
140
  last180Days: "\u6700\u8FD1180\u5929",
138
141
  last6Month: "\u6700\u8FD16\u500B\u6708",
139
142
  year: "\u4ECA\u5E74",
@@ -182,6 +185,7 @@ export const i18n = {
182
185
  last7Days: "7 hari terakhir",
183
186
  month: "Bulan ini",
184
187
  last30Days: "30 hari terakhir",
188
+ last90Days: "90 hari terakhir",
185
189
  last180Days: "180 hari terakhir",
186
190
  last6Month: "6 bulan terakhir",
187
191
  year: "Tahun ini",
@@ -236,6 +240,7 @@ export const i18n = {
236
240
  last7Days: "Trong 7 ng\xE0y qua",
237
241
  month: "Th\xE1ng n\xE0y",
238
242
  last30Days: "Trong 30 ng\xE0y tr\u01B0\u1EDBc",
243
+ last90Days: "Trong 90 ng\xE0y tr\u01B0\u1EDBc",
239
244
  last180Days: "Trong 180 ng\xE0y tr\u01B0\u1EDBc",
240
245
  last6Month: "Trong 6 th\xE1ng tr\u01B0\u1EDBc",
241
246
  year: "N\u0103m nay",
@@ -290,6 +295,7 @@ export const i18n = {
290
295
  last7Days: "7 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
291
296
  month: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E19\u0E35\u0E49",
292
297
  last30Days: "30 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
298
+ last90Days: "90 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
293
299
  last180Days: "180 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
294
300
  last6Month: "6 \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
295
301
  year: "\u0E1B\u0E35\u0E19\u0E35\u0E49",
@@ -344,6 +350,7 @@ export const i18n = {
344
350
  last7Days: "7 hari lepas",
345
351
  month: "Bulan ini",
346
352
  last30Days: "30 hari lepas",
353
+ last90Days: "90 hari lepas",
347
354
  last180Days: "180 hari lepas",
348
355
  last6Month: "6 bulan lepas",
349
356
  year: "Tahun ini",
@@ -398,6 +405,7 @@ export const i18n = {
398
405
  last7Days: "\uC9C0\uB09C 7\uC77C",
399
406
  month: "\uC774\uBC88\uB2EC",
400
407
  last30Days: "\uC9C0\uB09C 30\uC77C",
408
+ last90Days: "\uC9C0\uB09C 90\uC77C",
401
409
  last180Days: "\uC9C0\uB09C 180\uC77C",
402
410
  last6Month: "\uC9C0\uB09C 6\uAC1C\uC6D4",
403
411
  year: "\uC62C\uD574",
@@ -458,6 +466,7 @@ export const i18n = {
458
466
  last7Days: "\u0622\u062E\u0631 7 \u0623\u064A\u0627\u0645",
459
467
  month: "\u0647\u0630\u0627 \u0627\u0644\u0634\u0647\u0631",
460
468
  last30Days: "\u0622\u062E\u0631 30 \u064A\u0648\u0645\u064B\u0627",
469
+ last90Days: "\u0622\u062E\u0631 90 \u064A\u0648\u0645\u064B\u0627",
461
470
  last180Days: "\u0622\u062E\u0631 180 \u064A\u0648\u0645\u064B\u0627",
462
471
  last6Month: "\u0622\u062E\u0631 6 \u0623\u0634\u0647\u0631",
463
472
  // 注意:阿拉伯语复数形式
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "unbuild": "3.6.0",
21
21
  "vitest": "3.2.4"
22
22
  },
23
- "version": "2.0.0-alpha.25",
23
+ "version": "2.0.0-alpha.28",
24
24
  "type": "module",
25
25
  "private": false,
26
26
  "exports": {
@@ -39,5 +39,5 @@
39
39
  "template",
40
40
  "public"
41
41
  ],
42
- "gitHead": "5f7bbab4613cfb586c7cd0e30a41f88a7f63eb70"
42
+ "gitHead": "d11a1ac9f6c362d913ef10103a6e275f08f6420d"
43
43
  }
@@ -136,6 +136,11 @@ export class Ele extends UiBase<Attrs, Emits> {
136
136
  this._bindEvt(this._els.trigger)('click', this._onToggleClick);
137
137
  this.strategy = this.strategy;
138
138
  }
139
+ public disconnectedCallback() {
140
+ this._cleanupAutoUpdate?.();
141
+ document.removeEventListener('click', this._onDocClick, true);
142
+ return super.disconnectedCallback();
143
+ }
139
144
 
140
145
  protected _onAttrChanged(
141
146
  name: string,
@@ -14,6 +14,7 @@ export const limitKeys: DataLimit[] = [
14
14
  'last7Days',
15
15
  'month',
16
16
  'last30Days',
17
+ 'last90Days',
17
18
  'last180Days',
18
19
  'last6Month',
19
20
  'year'
@@ -109,6 +110,12 @@ const presetPeriods = {
109
110
  start: (t) => t.setDate(t.getDate() - 29),
110
111
  end: noop
111
112
  }),
113
+ last90Days: (ops: QuickGenPeriodTimesOptions) =>
114
+ genPeriodTimes({
115
+ ...ops,
116
+ start: (t) => t.setDate(t.getDate() - 89),
117
+ end: noop
118
+ }),
112
119
  last180Days: (ops: QuickGenPeriodTimesOptions) =>
113
120
  genPeriodTimes({
114
121
  ...ops,
package/src/i18n.ts CHANGED
@@ -7,6 +7,7 @@ export type DataLimit =
7
7
  | 'last7Days'
8
8
  | 'month'
9
9
  | 'last30Days'
10
+ | 'last90Days'
10
11
  | 'last180Days'
11
12
  | 'last6Month'
12
13
  | 'year';
@@ -89,6 +90,7 @@ export const i18n: I18n = {
89
90
  last7Days: 'Last 7 Days',
90
91
  month: 'This Month',
91
92
  last30Days: 'Last 30 Days',
93
+ last90Days: 'Last 90 Days',
92
94
  last180Days: 'Last 180 Days',
93
95
  last6Month: 'Last 6 Month',
94
96
  year: 'This Year',
@@ -143,6 +145,7 @@ export const i18n: I18n = {
143
145
  last7Days: '最近7天',
144
146
  month: '本月',
145
147
  last30Days: '最近30天',
148
+ last90Days: '最近90天',
146
149
  last180Days: '最近180天',
147
150
  last6Month: '最近6个月',
148
151
  year: '今年',
@@ -197,6 +200,7 @@ export const i18n: I18n = {
197
200
  last7Days: '最近7天',
198
201
  month: '本月',
199
202
  last30Days: '最近30天',
203
+ last90Days: '最近90天',
200
204
  last180Days: '最近180天',
201
205
  last6Month: '最近6個月',
202
206
  year: '今年',
@@ -245,6 +249,7 @@ export const i18n: I18n = {
245
249
  last7Days: '7 hari terakhir',
246
250
  month: 'Bulan ini',
247
251
  last30Days: '30 hari terakhir',
252
+ last90Days: '90 hari terakhir',
248
253
  last180Days: '180 hari terakhir',
249
254
  last6Month: '6 bulan terakhir',
250
255
  year: 'Tahun ini',
@@ -299,6 +304,7 @@ export const i18n: I18n = {
299
304
  last7Days: 'Trong 7 ngày qua',
300
305
  month: 'Tháng này',
301
306
  last30Days: 'Trong 30 ngày trước',
307
+ last90Days: 'Trong 90 ngày trước',
302
308
  last180Days: 'Trong 180 ngày trước',
303
309
  last6Month: 'Trong 6 tháng trước',
304
310
  year: 'Năm nay',
@@ -353,6 +359,7 @@ export const i18n: I18n = {
353
359
  last7Days: '7 วันที่ผ่านมา',
354
360
  month: 'เดือนนี้',
355
361
  last30Days: '30 วันที่ผ่านมา',
362
+ last90Days: '90 วันที่ผ่านมา',
356
363
  last180Days: '180 วันที่ผ่านมา',
357
364
  last6Month: '6 เดือนที่ผ่านมา',
358
365
  year: 'ปีนี้',
@@ -407,6 +414,7 @@ export const i18n: I18n = {
407
414
  last7Days: '7 hari lepas',
408
415
  month: 'Bulan ini',
409
416
  last30Days: '30 hari lepas',
417
+ last90Days: '90 hari lepas',
410
418
  last180Days: '180 hari lepas',
411
419
  last6Month: '6 bulan lepas',
412
420
  year: 'Tahun ini',
@@ -462,6 +470,7 @@ export const i18n: I18n = {
462
470
  last7Days: '지난 7일',
463
471
  month: '이번달',
464
472
  last30Days: '지난 30일',
473
+ last90Days: '지난 90일',
465
474
  last180Days: '지난 180일',
466
475
  last6Month: '지난 6개월',
467
476
  year: '올해',
@@ -522,6 +531,7 @@ export const i18n: I18n = {
522
531
  last7Days: 'آخر 7 أيام',
523
532
  month: 'هذا الشهر',
524
533
  last30Days: 'آخر 30 يومًا',
534
+ last90Days: 'آخر 90 يومًا',
525
535
  last180Days: 'آخر 180 يومًا',
526
536
  last6Month: 'آخر 6 أشهر', // 注意:阿拉伯语复数形式
527
537
  year: 'هذه السنة',