@gez/date-time-kit 1.1.4 → 2.0.0-alpha.1

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 (83) hide show
  1. package/dist/assets/arrow-down.svg +1 -0
  2. package/dist/assets/arrow-left-double.svg +1 -0
  3. package/dist/assets/arrow-left.svg +1 -0
  4. package/dist/assets/arrow-right-double.svg +1 -0
  5. package/dist/assets/arrow-right.svg +1 -0
  6. package/dist/assets/back-arrow.svg +1 -0
  7. package/dist/assets/time.svg +1 -0
  8. package/dist/components/calendar/index.css +108 -0
  9. package/dist/components/calendar/index.d.ts +84 -0
  10. package/dist/components/calendar/index.mjs +238 -0
  11. package/dist/components/date-time-selector/index.d.ts +53 -0
  12. package/dist/components/date-time-selector/index.mjs +180 -0
  13. package/dist/components/date-time-selector/styleStr.d.ts +1 -0
  14. package/dist/components/date-time-selector/styleStr.mjs +6 -0
  15. package/dist/components/hhmmss-ms-list-grp/index.css +60 -0
  16. package/dist/components/hhmmss-ms-list-grp/index.d.ts +54 -0
  17. package/dist/components/hhmmss-ms-list-grp/index.mjs +226 -0
  18. package/dist/components/i18n/index.d.ts +13 -0
  19. package/dist/components/i18n/index.mjs +42 -0
  20. package/dist/components/num-list/index.css +35 -0
  21. package/dist/components/num-list/index.d.ts +68 -0
  22. package/dist/components/num-list/index.mjs +259 -0
  23. package/dist/components/period-selector/index.css +153 -0
  24. package/dist/components/period-selector/index.d.ts +77 -0
  25. package/dist/components/period-selector/index.mjs +331 -0
  26. package/dist/components/popover/index.d.ts +34 -0
  27. package/dist/components/popover/index.mjs +104 -0
  28. package/dist/components/quick-selector/index.css +167 -0
  29. package/dist/components/quick-selector/index.d.ts +86 -0
  30. package/dist/components/quick-selector/index.mjs +379 -0
  31. package/dist/components/web-component-base/index.css +9 -0
  32. package/dist/components/web-component-base/index.d.ts +46 -0
  33. package/dist/components/web-component-base/index.mjs +118 -0
  34. package/dist/components/web-component-base/scrollbar.css +25 -0
  35. package/dist/components/yyyymm-nav/index.css +92 -0
  36. package/dist/components/yyyymm-nav/index.d.ts +62 -0
  37. package/dist/components/yyyymm-nav/index.mjs +160 -0
  38. package/dist/components/yyyymmdd-list-grp/index.css +32 -0
  39. package/dist/components/yyyymmdd-list-grp/index.d.ts +52 -0
  40. package/dist/components/yyyymmdd-list-grp/index.mjs +181 -0
  41. package/dist/i18n.d.ts +36 -0
  42. package/dist/i18n.mjs +368 -0
  43. package/dist/index.d.ts +8 -0
  44. package/dist/index.mjs +17 -0
  45. package/dist/utils.d.ts +12 -0
  46. package/dist/utils.mjs +21 -0
  47. package/package.json +37 -63
  48. package/src/assets/arrow-down.svg +1 -0
  49. package/src/assets/arrow-left-double.svg +1 -0
  50. package/src/assets/arrow-left.svg +1 -0
  51. package/src/assets/arrow-right-double.svg +1 -0
  52. package/src/assets/arrow-right.svg +1 -0
  53. package/src/assets/back-arrow.svg +1 -0
  54. package/src/assets/time.svg +1 -0
  55. package/src/components/calendar/index.scss +128 -0
  56. package/src/components/calendar/index.ts +453 -0
  57. package/src/components/date-time-selector/index.ts +239 -0
  58. package/src/components/date-time-selector/styleStr.ts +86 -0
  59. package/src/components/hhmmss-ms-list-grp/index.scss +61 -0
  60. package/src/components/hhmmss-ms-list-grp/index.ts +387 -0
  61. package/src/components/i18n/index.ts +48 -0
  62. package/src/components/num-list/index.scss +38 -0
  63. package/src/components/num-list/index.ts +357 -0
  64. package/src/components/period-selector/index.scss +161 -0
  65. package/src/components/period-selector/index.ts +581 -0
  66. package/src/components/popover/index.ts +127 -0
  67. package/src/components/quick-selector/index.scss +183 -0
  68. package/src/components/quick-selector/index.ts +656 -0
  69. package/src/components/web-component-base/index.scss +11 -0
  70. package/src/components/web-component-base/index.ts +235 -0
  71. package/src/components/web-component-base/scrollbar.scss +30 -0
  72. package/src/components/yyyymm-nav/index.scss +108 -0
  73. package/src/components/yyyymm-nav/index.ts +319 -0
  74. package/src/components/yyyymmdd-list-grp/index.scss +33 -0
  75. package/src/components/yyyymmdd-list-grp/index.ts +290 -0
  76. package/src/i18n.ts +415 -0
  77. package/src/index.ts +13 -0
  78. package/src/utils.ts +36 -0
  79. package/README.md +0 -152
  80. package/dist/index.css +0 -1
  81. package/dist/index.html +0 -85
  82. package/dist/index.js +0 -145
  83. package/type.d.ts +0 -164
package/dist/i18n.mjs ADDED
@@ -0,0 +1,368 @@
1
+ export const langs = [
2
+ "en-US",
3
+ "zh-CN",
4
+ "zh-TW",
5
+ "id-ID",
6
+ "vi-VN",
7
+ "th-TH",
8
+ "ms-MY",
9
+ "ko-KR",
10
+ "ar-AE"
11
+ ];
12
+ export const i18n = {
13
+ "en-US": {
14
+ box: {
15
+ confirm: "Done",
16
+ cancel: "Cancel",
17
+ select: "Select"
18
+ },
19
+ quick: {
20
+ all: "All",
21
+ today: "Today",
22
+ yesterday: "Yesterday",
23
+ week: "This Week",
24
+ lastWeek: "Last Week",
25
+ last7Days: "Last 7 Days",
26
+ month: "This Month",
27
+ last30Days: "Last 30 Days",
28
+ last180Days: "Last 180 Days",
29
+ last6Month: "Last 6 Month",
30
+ year: "This Year",
31
+ timezone: "Time Zone",
32
+ recommend: "Recommend",
33
+ timezoneList: "Time Zone"
34
+ },
35
+ date: {
36
+ sun: "Sun",
37
+ mon: "Mon",
38
+ tue: "Tue",
39
+ wed: "Wed",
40
+ thu: "Thu",
41
+ fri: "Fri",
42
+ sat: "Sat"
43
+ },
44
+ time: {
45
+ startTime: "Start Time",
46
+ endTime: "End Time",
47
+ startMillisecond: "Start Millisecond",
48
+ endMillisecond: "End Millisecond",
49
+ singleTitle: "Time Select"
50
+ }
51
+ },
52
+ "zh-CN": {
53
+ box: {
54
+ confirm: "\u5B8C\u6210",
55
+ cancel: "\u53D6\u6D88",
56
+ select: "Select"
57
+ },
58
+ quick: {
59
+ all: "\u5168\u90E8",
60
+ today: "\u4ECA\u5929",
61
+ yesterday: "\u6628\u5929",
62
+ week: "\u672C\u5468",
63
+ lastWeek: "\u4E0A\u5468",
64
+ last7Days: "\u6700\u8FD17\u5929",
65
+ month: "\u672C\u6708",
66
+ last30Days: "\u6700\u8FD130\u5929",
67
+ last180Days: "\u6700\u8FD1180\u5929",
68
+ last6Month: "\u6700\u8FD16\u4E2A\u6708",
69
+ year: "\u4ECA\u5E74",
70
+ timezone: "\u65F6\u533A",
71
+ recommend: "\u63A8\u8350",
72
+ timezoneList: "\u65F6\u533A"
73
+ },
74
+ date: {
75
+ sun: "\u65E5",
76
+ mon: "\u4E00",
77
+ tue: "\u4E8C",
78
+ wed: "\u4E09",
79
+ thu: "\u56DB",
80
+ fri: "\u4E94",
81
+ sat: "\u516D"
82
+ },
83
+ time: {
84
+ startTime: "\u5F00\u59CB\u65F6\u95F4",
85
+ endTime: "\u7ED3\u675F\u65F6\u95F4",
86
+ startMillisecond: "\u6BEB\u79D2",
87
+ endMillisecond: "\u6BEB\u79D2",
88
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
89
+ }
90
+ },
91
+ "zh-TW": {
92
+ box: {
93
+ confirm: "\u5B8C\u6210",
94
+ cancel: "\u53D6\u6D88",
95
+ select: "Select"
96
+ },
97
+ quick: {
98
+ all: "\u5168\u90E8",
99
+ today: "\u4ECA\u5929",
100
+ yesterday: "\u6628\u5929",
101
+ week: "\u672C\u5468",
102
+ lastWeek: "\u4E0A\u5468",
103
+ last7Days: "\u6700\u8FD17\u5929",
104
+ month: "\u672C\u6708",
105
+ last30Days: "\u6700\u8FD130\u5929",
106
+ last180Days: "\u6700\u8FD1180\u5929",
107
+ last6Month: "\u6700\u8FD16\u500B\u6708",
108
+ year: "\u4ECA\u5E74",
109
+ timezone: "\u6642\u5340",
110
+ recommend: "\u63A8\u85A6",
111
+ timezoneList: "\u6642\u5340"
112
+ },
113
+ date: {
114
+ sun: "\u65E5",
115
+ mon: "\u4E00",
116
+ tue: "\u4E8C",
117
+ wed: "\u4E09",
118
+ thu: "\u56DB",
119
+ fri: "\u4E94",
120
+ sat: "\u516D"
121
+ },
122
+ time: {
123
+ startTime: "\u958B\u59CB\u6642\u9593",
124
+ endTime: "\u7D50\u675F\u6642\u9593",
125
+ startMillisecond: "\u6BEB\u79D2",
126
+ endMillisecond: "\u6BEB\u79D2",
127
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
128
+ }
129
+ },
130
+ "id-ID": {
131
+ quick: {
132
+ all: "Semua",
133
+ today: "Hari ini",
134
+ yesterday: "Kemarin",
135
+ week: "Minggu ini",
136
+ lastWeek: "Minggu lalu",
137
+ last7Days: "7 hari terakhir",
138
+ month: "Bulan ini",
139
+ last30Days: "30 hari terakhir",
140
+ last180Days: "180 hari terakhir",
141
+ last6Month: "6 bulan terakhir",
142
+ year: "Tahun ini",
143
+ timezone: "Zona waktu",
144
+ recommend: "Rekomendasi",
145
+ timezoneList: "Zona waktu"
146
+ },
147
+ date: {
148
+ sun: "Sun",
149
+ mon: "Mon",
150
+ tue: "Tue",
151
+ wed: "Wed",
152
+ thu: "Thu",
153
+ fri: "Fri",
154
+ sat: "Sat"
155
+ },
156
+ time: {
157
+ startTime: "Waktu Mulai",
158
+ endTime: "Waktu Selesai",
159
+ startMillisecond: "Milidetik Mulai",
160
+ endMillisecond: "Milidetik Selesai",
161
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
162
+ },
163
+ box: {
164
+ confirm: "Selesai",
165
+ cancel: "Batal",
166
+ select: "Select"
167
+ }
168
+ },
169
+ "vi-VN": {
170
+ quick: {
171
+ all: "T\u1EA5t c\u1EA3",
172
+ today: "H\xF4m nay",
173
+ yesterday: "H\xF4m qua",
174
+ week: "Tu\u1EA7n n\xE0y",
175
+ lastWeek: "Tu\u1EA7n tr\u01B0\u1EDBc",
176
+ last7Days: "Trong 7 ng\xE0y qua",
177
+ month: "Th\xE1ng n\xE0y",
178
+ last30Days: "Trong 30 ng\xE0y tr\u01B0\u1EDBc",
179
+ last180Days: "Trong 180 ng\xE0y tr\u01B0\u1EDBc",
180
+ last6Month: "Trong 6 th\xE1ng tr\u01B0\u1EDBc",
181
+ year: "N\u0103m nay",
182
+ timezone: "M\xFAi gi\u1EDD",
183
+ recommend: "G\u1EE3i \xFD",
184
+ timezoneList: "M\xFAi gi\u1EDD"
185
+ },
186
+ date: {
187
+ sun: "CN",
188
+ mon: "T2",
189
+ tue: "T3",
190
+ wed: "T4",
191
+ thu: "T5",
192
+ fri: "T6",
193
+ sat: "T7"
194
+ },
195
+ time: {
196
+ startTime: "Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",
197
+ endTime: "Th\u1EDDi gian k\u1EBFt th\xFAc",
198
+ startMillisecond: "Mili gi\xE2y b\u1EAFt \u0111\u1EA7u",
199
+ endMillisecond: "Mili gi\xE2y k\u1EBFt th\xFAc",
200
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
201
+ },
202
+ box: {
203
+ confirm: "Ho\xE0n t\u1EA5t",
204
+ cancel: "H\u1EE7y",
205
+ select: "Select"
206
+ }
207
+ },
208
+ "th-TH": {
209
+ quick: {
210
+ all: "\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
211
+ today: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49",
212
+ yesterday: "\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E19",
213
+ week: "\u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C\u0E19\u0E35\u0E49",
214
+ lastWeek: "\u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27",
215
+ last7Days: "7 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
216
+ month: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E19\u0E35\u0E49",
217
+ last30Days: "30 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
218
+ last180Days: "180 \u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
219
+ last6Month: "6 \u0E40\u0E14\u0E37\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32",
220
+ year: "\u0E1B\u0E35\u0E19\u0E35\u0E49",
221
+ timezone: "\u0E40\u0E02\u0E15\u0E40\u0E27\u0E25\u0E32",
222
+ recommend: "\u0E41\u0E19\u0E30\u0E19\u0E33",
223
+ timezoneList: "\u0E40\u0E02\u0E15\u0E40\u0E27\u0E25\u0E32"
224
+ },
225
+ date: {
226
+ sun: "\u0E2D\u0E32.",
227
+ mon: "\u0E08.",
228
+ tue: "\u0E2D.",
229
+ wed: "\u0E1E.",
230
+ thu: "\u0E1E\u0E24.",
231
+ fri: "\u0E28.",
232
+ sat: "\u0E2A."
233
+ },
234
+ time: {
235
+ startTime: "\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
236
+ endTime: "\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14",
237
+ startMillisecond: "\u0E21\u0E34\u0E25\u0E25\u0E34\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
238
+ endMillisecond: "\u0E21\u0E34\u0E25\u0E25\u0E34\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14",
239
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
240
+ },
241
+ box: {
242
+ confirm: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19",
243
+ cancel: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
244
+ select: "Select"
245
+ }
246
+ },
247
+ "ms-MY": {
248
+ quick: {
249
+ all: "Semua",
250
+ today: "Hari ini",
251
+ yesterday: "Semalam",
252
+ week: "Minggu ini",
253
+ lastWeek: "Minggu lepas",
254
+ last7Days: "7 hari lepas",
255
+ month: "Bulan ini",
256
+ last30Days: "30 hari lepas",
257
+ last180Days: "180 hari lepas",
258
+ last6Month: "6 bulan lepas",
259
+ year: "Tahun ini",
260
+ timezone: "Zon masa",
261
+ recommend: "Cadangan",
262
+ timezoneList: "Zon masa"
263
+ },
264
+ date: {
265
+ sun: "Sun",
266
+ mon: "Mon",
267
+ tue: "Tue",
268
+ wed: "Wed",
269
+ thu: "Thu",
270
+ fri: "Fri",
271
+ sat: "Sat"
272
+ },
273
+ time: {
274
+ startTime: "Waktu Mula",
275
+ endTime: "Waktu Tamat",
276
+ startMillisecond: "Milisaat Mula",
277
+ endMillisecond: "Milisaat Tamat",
278
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
279
+ },
280
+ box: {
281
+ confirm: "Selesai",
282
+ cancel: "Batal",
283
+ select: "Select"
284
+ }
285
+ },
286
+ "ko-KR": {
287
+ quick: {
288
+ all: "\uC804\uCCB4",
289
+ today: "\uC624\uB298",
290
+ yesterday: "\uC5B4\uC81C",
291
+ week: "\uC774\uBC88\uC8FC",
292
+ lastWeek: "\uC9C0\uB09C\uC8FC",
293
+ last7Days: "\uC9C0\uB09C 7\uC77C",
294
+ month: "\uC774\uBC88\uB2EC",
295
+ last30Days: "\uC9C0\uB09C 30\uC77C",
296
+ last180Days: "\uC9C0\uB09C 180\uC77C",
297
+ last6Month: "\uC9C0\uB09C 6\uAC1C\uC6D4",
298
+ year: "\uC62C\uD574",
299
+ timezone: "\uC2DC\uAC04\uB300",
300
+ recommend: "\uCD94\uCC9C",
301
+ timezoneList: "\uC2DC\uAC04\uB300"
302
+ },
303
+ date: {
304
+ sun: "\uC77C",
305
+ mon: "\uC6D4",
306
+ tue: "\uD654",
307
+ wed: "\uC218",
308
+ thu: "\uBAA9",
309
+ fri: "\uAE08",
310
+ sat: "\uD1A0"
311
+ },
312
+ time: {
313
+ startTime: "\uC2DC\uC791 \uC2DC\uAC04",
314
+ endTime: "\uC885\uB8CC \uC2DC\uAC04",
315
+ startMillisecond: "\uC2DC\uC791 \uBC00\uB9AC\uCD08",
316
+ endMillisecond: "\uC885\uB8CC \uBC00\uB9AC\uCD08",
317
+ singleTitle: "\u65F6\u95F4\u9009\u62E9"
318
+ },
319
+ box: {
320
+ confirm: "\uC644\uB8CC",
321
+ cancel: "\uCDE8\uC18C",
322
+ select: "Select"
323
+ }
324
+ },
325
+ "ar-AE": {
326
+ box: {
327
+ confirm: "\u062A\u0645",
328
+ cancel: "\u0625\u0644\u063A\u0627\u0621",
329
+ select: "Select"
330
+ },
331
+ quick: {
332
+ all: "\u0627\u0644\u0643\u0644",
333
+ today: "\u0627\u0644\u064A\u0648\u0645",
334
+ yesterday: "\u0623\u0645\u0633",
335
+ week: "\u0647\u0630\u0627 \u0627\u0644\u0623\u0633\u0628\u0648\u0639",
336
+ lastWeek: "\u0627\u0644\u0623\u0633\u0628\u0648\u0639 \u0627\u0644\u0645\u0627\u0636\u064A",
337
+ last7Days: "\u0622\u062E\u0631 7 \u0623\u064A\u0627\u0645",
338
+ month: "\u0647\u0630\u0627 \u0627\u0644\u0634\u0647\u0631",
339
+ last30Days: "\u0622\u062E\u0631 30 \u064A\u0648\u0645\u064B\u0627",
340
+ last180Days: "\u0622\u062E\u0631 180 \u064A\u0648\u0645\u064B\u0627",
341
+ last6Month: "\u0622\u062E\u0631 6 \u0623\u0634\u0647\u0631",
342
+ // 注意:阿拉伯语复数形式
343
+ year: "\u0647\u0630\u0647 \u0627\u0644\u0633\u0646\u0629",
344
+ timezone: "\u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0632\u0645\u0646\u064A\u0629",
345
+ recommend: "\u0645\u064F\u0648\u0635\u0649 \u0628\u0647",
346
+ timezoneList: "\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u0646\u0627\u0637\u0642 \u0627\u0644\u0632\u0645\u0646\u064A\u0629"
347
+ },
348
+ date: {
349
+ sun: "\u0627\u0644\u0623\u062D\u062F",
350
+ // 缩写原则:使用完整单词首字母(阿拉伯语无单字缩写)
351
+ mon: "\u0627\u0644\u0627\u062B\u0646\u064A\u0646",
352
+ tue: "\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621",
353
+ wed: "\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
354
+ thu: "\u0627\u0644\u062E\u0645\u064A\u0633",
355
+ fri: "\u0627\u0644\u062C\u0645\u0639\u0629",
356
+ sat: "\u0627\u0644\u0633\u0628\u062A"
357
+ },
358
+ time: {
359
+ startTime: "\u0648\u0642\u062A \u0627\u0644\u0628\u062F\u0621",
360
+ endTime: "\u0648\u0642\u062A \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",
361
+ startMillisecond: "\u0645\u064A\u0644\u064A \u062B\u0627\u0646\u064A\u0629 (\u0628\u062F\u0621)",
362
+ // 技术术语补充说明
363
+ endMillisecond: "\u0645\u064A\u0644\u064A \u062B\u0627\u0646\u064A\u0629 (\u0627\u0646\u062A\u0647\u0627\u0621)",
364
+ singleTitle: "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0648\u0642\u062A"
365
+ }
366
+ }
367
+ };
368
+ export default i18n;
@@ -0,0 +1,8 @@
1
+ export * as DtI18nEle from './i18n';
2
+ export * as DtCalendar from './components/calendar';
3
+ export * as DtHhMmSsMsListGrp from './components/hhmmss-ms-list-grp';
4
+ export * as DtYyyyMmDdListGrp from './components/yyyymmdd-list-grp';
5
+ export * as DtQuickSelector from './components/quick-selector';
6
+ export * as DtPopover from './components/popover';
7
+ export * as DtDataTimeSelector from './components/date-time-selector';
8
+ export { i18n as dtI18n, type Lang as DtLang, type I18n as DtI18n } from './i18n';
package/dist/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ import * as DtI18nEle from "./i18n.mjs";
2
+ export { DtI18nEle };
3
+ import * as DtCalendar from "./components/calendar/index.mjs";
4
+ export { DtCalendar };
5
+ import * as DtHhMmSsMsListGrp from "./components/hhmmss-ms-list-grp/index.mjs";
6
+ export { DtHhMmSsMsListGrp };
7
+ import * as DtYyyyMmDdListGrp from "./components/yyyymmdd-list-grp/index.mjs";
8
+ export { DtYyyyMmDdListGrp };
9
+ import * as DtQuickSelector from "./components/quick-selector/index.mjs";
10
+ export { DtQuickSelector };
11
+ import * as DtPopover from "./components/popover/index.mjs";
12
+ export { DtPopover };
13
+ import * as DtDataTimeSelector from "./components/date-time-selector/index.mjs";
14
+ export { DtDataTimeSelector };
15
+ export {
16
+ i18n as dtI18n
17
+ } from "./i18n.mjs";
@@ -0,0 +1,12 @@
1
+ export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => string;
2
+ export declare const css: (strings: TemplateStringsArray, ...values: unknown[]) => string;
3
+ export declare const closestByEvent: (e: Event, selector: string, root?: HTMLElement | ShadowRoot) => HTMLElement | null;
4
+ /**
5
+ * Returns a debounced version of the provided function, ensuring that the
6
+ * function is only invoked after a specified delay in milliseconds has elapsed
7
+ * since the last time the debounced function was invoked.
8
+ *
9
+ * @param fn - The function to debounce.
10
+ * @returns A debounced version of the provided function.
11
+ */
12
+ export declare function debounce(fn: Function, delay?: number): <U>(this: U, ...args: any[]) => void;
package/dist/utils.mjs ADDED
@@ -0,0 +1,21 @@
1
+ export const html = (strings, ...values) => String.raw(strings, ...values);
2
+ export const css = html;
3
+ export const closestByEvent = (e, selector, root) => {
4
+ for (const target of e.composedPath()) {
5
+ if (target === root) return null;
6
+ if (!(target instanceof HTMLElement)) continue;
7
+ if (target.matches(selector)) {
8
+ return target;
9
+ }
10
+ }
11
+ return null;
12
+ };
13
+ export function debounce(fn, delay = 0) {
14
+ let timer = null;
15
+ return function(...args) {
16
+ if (timer !== null) clearTimeout(timer);
17
+ timer = setTimeout(() => {
18
+ fn.apply(this, args);
19
+ }, delay);
20
+ };
21
+ }
package/package.json CHANGED
@@ -1,66 +1,40 @@
1
1
  {
2
- "name": "@gez/date-time-kit",
3
- "version": "1.1.4",
4
- "description": "A JavaScript library for handling date and time operations efficiently.",
5
- "type": "module",
6
- "types": "type.d.ts",
7
- "exports": {
8
- ".": {
9
- "import": "./dist/index.js",
10
- "types": "./type.d.ts",
11
- "style": "./dist/index.css"
2
+ "name": "@gez/date-time-kit",
3
+ "template": "library",
4
+ "scripts": {
5
+ "lint:css": "pnpm run lint:js",
6
+ "lint:type": "tsc --noEmit",
7
+ "test": "vitest run --pass-with-no-tests",
8
+ "coverage": "vitest run --coverage --pass-with-no-tests",
9
+ "lint:js": "biome check --write --no-errors-on-unmatched",
10
+ "build": "unbuild"
12
11
  },
13
- "./dist/index.css": "./dist/index.css"
14
- },
15
- "main": "./dist/index.js",
16
- "module": "./dist/index.js",
17
- "files": [
18
- "dist",
19
- "type.d.ts"
20
- ],
21
- "scripts": {
22
- "build": "rsbuild build",
23
- "check": "biome check --write",
24
- "dev": "rsbuild dev --open",
25
- "format": "prettier --write .",
26
- "lint": "eslint .",
27
- "preview": "rsbuild preview",
28
- "prepublishOnly": "rsbuild build"
29
- },
30
- "devDependencies": {
31
- "@biomejs/biome": "^1.9.3",
32
- "@eslint/js": "^9.12.0",
33
- "@rsbuild/core": "^1.0.19",
34
- "eslint": "^9.12.0",
35
- "globals": "^15.11.0",
36
- "prettier": "^3.3.3",
37
- "sass-embedded": "^1.81.0",
38
- "sass-loader": "^16.0.3",
39
- "typescript": "^5.6.3",
40
- "typescript-eslint": "^8.8.1"
41
- },
42
- "dependencies": {
43
- "lodash": "^4.17.21"
44
- },
45
- "keywords": [
46
- "date",
47
- "time",
48
- "datetime",
49
- "utility",
50
- "javascript",
51
- "library"
52
- ],
53
- "repository": {
54
- "type": "git",
55
- "url": "https://github.com/dp-os/date-time-kit.git"
56
- },
57
- "author": "Wes Loong <wesloong@gmail.com>",
58
- "license": "MIT",
59
- "bugs": {
60
- "url": "https://github.com/dp-os/date-time-kit/issues"
61
- },
62
- "homepage": "https://github.com/dp-os/date-time-kit#readme",
63
- "engines": {
64
- "node": ">=14"
65
- }
12
+ "devDependencies": {
13
+ "@biomejs/biome": "1.9.4",
14
+ "@types/node": "^24.0.0",
15
+ "@vitest/coverage-v8": "3.2.4",
16
+ "typescript": "5.9.2",
17
+ "unbuild": "3.6.0",
18
+ "vitest": "3.2.4"
19
+ },
20
+ "version": "2.0.0-alpha.1",
21
+ "type": "module",
22
+ "private": false,
23
+ "exports": {
24
+ ".": {
25
+ "import": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts"
27
+ }
28
+ },
29
+ "module": "dist/index.mjs",
30
+ "types": "./dist/index.d.ts",
31
+ "files": [
32
+ "lib",
33
+ "src",
34
+ "dist",
35
+ "*.mjs",
36
+ "template",
37
+ "public"
38
+ ],
39
+ "gitHead": "b093b967b089c135d5ad669c9412f93ed5d6d669"
66
40
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="currentColor"><path d="m8.02 10.54 3.96-4.4a.583.583 0 0 0-.433-.973h-7.88a.583.583 0 0 0-.434.973l3.94 4.378c.216.24.585.26.824.044l.022-.021Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" fill="currentColor"><path d="M9.037 1.98a.5.5 0 1 1 .707.707l-5.87 5.87 5.774 5.774a.5.5 0 1 1-.707.707L2.813 8.911a.5.5 0 0 1 .051-.752.505.505 0 0 1 .045-.051L9.037 1.98ZM13.037 1.98a.5.5 0 0 1 .707.707l-5.87 5.87 5.774 5.774a.5.5 0 1 1-.707.707L6.813 8.911a.5.5 0 0 1 .051-.752.505.505 0 0 1 .045-.051l6.128-6.128Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" fill="currentColor"><path d="M11.687 1.703a.5.5 0 0 0-.707 0L4.852 7.83a.505.505 0 0 0-.045.05.5.5 0 0 0-.051.752l6.128 6.128a.5.5 0 0 0 .707-.707L5.817 8.28l5.87-5.87a.5.5 0 0 0 0-.707Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" fill="currentColor"><path d="M7.963 1.703a.5.5 0 0 0-.707.707l5.87 5.87-5.774 5.774a.5.5 0 0 0 .707.707l6.128-6.128a.5.5 0 0 0-.051-.751.493.493 0 0 0-.045-.051L7.963 1.703ZM3.963 1.703a.5.5 0 0 0-.707.707l5.87 5.87-5.774 5.774a.5.5 0 0 0 .707.707l6.128-6.128a.5.5 0 0 0-.051-.751.493.493 0 0 0-.045-.051L3.963 1.703Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" fill="currentColor"><path d="M5.256 1.703a.5.5 0 0 1 .707 0l6.128 6.128a.493.493 0 0 1 .045.05.5.5 0 0 1 .051.752l-6.128 6.128a.5.5 0 0 1-.707-.707l5.774-5.774-5.87-5.87a.5.5 0 0 1 0-.707Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"><path d="M9.894 5.106a.75.75 0 0 1 0 1.06L4.811 11.25 21 11.25a.75.75 0 0 1 0 1.5l-16.191-.001 5.085 5.085a.75.75 0 0 1-1.06 1.06L2.47 12.53a.75.75 0 0 1 0-1.06l6.364-6.364a.75.75 0 0 1 1.06 0Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="15" fill="currentColor"><path d="M7.4335 4.241a.4376.4376 0 0 0-.871.0594v3.783l.0044.0622a.4375.4375 0 0 0 .1921.3029L8.9242 9.877l.0566.0317a.4376.4376 0 0 0 .5495-.1559l.0317-.0566a.4376.4376 0 0 0-.1559-.5495L7.4375 7.8471V4.3004l-.004-.0593ZM7 1.6667c-3.2217 0-5.8333 2.6116-5.8333 5.8333 0 3.2217 2.6116 5.8333 5.8333 5.8333 3.2217 0 5.8333-2.6116 5.8333-5.8333 0-3.2217-2.6116-5.8333-5.8333-5.8333Zm0 .814c2.7721 0 5.0194 2.2472 5.0194 5.0193 0 2.7721-2.2473 5.0194-5.0194 5.0194S1.9806 10.2721 1.9806 7.5 4.228 2.4806 7 2.4806Z"/></svg>