@jirawatpyk/aura-react 4.16.0 → 4.17.0

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.
@@ -0,0 +1,351 @@
1
+ 'use client';
2
+ const n = function(x) {
3
+ return Number(x).toLocaleString("en");
4
+ };
5
+ const nsv = function(x) {
6
+ return Number(x).toLocaleString("sv-SE");
7
+ };
8
+ const STRINGS = {
9
+ en: {
10
+ close: "Close",
11
+ dismiss: "Dismiss",
12
+ dismissToast: "Dismiss notification",
13
+ showPassword: "Show password",
14
+ filters: "Filters",
15
+ search: "Search",
16
+ clearFilters: "Clear all",
17
+ results: function(n2) {
18
+ return n2 === 1 ? "1 result" : n2.toLocaleString("en") + " results";
19
+ },
20
+ commandMenu: "Command menu",
21
+ commandPlaceholder: "Type a command or search\u2026",
22
+ commandHint: "\u2191\u2193 to move \xB7 Enter to open \xB7 Esc to close",
23
+ errorSummary: function(n2) {
24
+ return n2 === 1 ? "Fix 1 field to continue" : "Fix " + n2 + " fields to continue";
25
+ },
26
+ notifications: "Notifications",
27
+ mainNav: "Main",
28
+ breadcrumb: "Breadcrumb",
29
+ navigation: "Navigation",
30
+ openNav: "Open navigation",
31
+ collapseNav: "Collapse sidebar",
32
+ expandNav: "Expand sidebar",
33
+ searching: "Searching\u2026",
34
+ noMatches: "No matches",
35
+ clear: function(what) {
36
+ return "Clear " + (what || "selection");
37
+ },
38
+ keepTyping: function(total) {
39
+ return "Keep typing to narrow " + n(total) + " options";
40
+ },
41
+ sortAsc: "Sort ascending",
42
+ sortDesc: "Sort descending",
43
+ pin: "Pin to left",
44
+ unpin: "Unpin column",
45
+ moveLeft: "Move left",
46
+ moveRight: "Move right",
47
+ hideColumn: "Hide column",
48
+ resetColumns: "Reset columns",
49
+ selectRows: "Select rows",
50
+ selectAllRows: "Select all rows",
51
+ deselectAllRows: "Deselect all rows",
52
+ selectAll: "Select all",
53
+ selectRow: function(k) {
54
+ return "Select " + k;
55
+ },
56
+ selectedCount: function(c) {
57
+ return n(c) + " selected";
58
+ },
59
+ pinned: "Pinned",
60
+ columnOptions: function(label) {
61
+ return label + " column options";
62
+ },
63
+ column: function(label) {
64
+ return label ? label + " column" : "Column";
65
+ },
66
+ columns: "Columns",
67
+ showHideColumns: "Show or hide columns",
68
+ empty: "Nothing here yet",
69
+ loading: "Loading\u2026",
70
+ loadingRows: "Loading rows",
71
+ range: function(a, b, total) {
72
+ return a + "\u2013" + b + " of " + n(total);
73
+ },
74
+ page: function(p, total) {
75
+ return "Page " + p + " of " + total;
76
+ },
77
+ prevPage: "Previous page",
78
+ nextPage: "Next page",
79
+ rowCount: function(c) {
80
+ return n(c) + " rows";
81
+ },
82
+ actions: "Actions",
83
+ optional: "optional",
84
+ timePlaceholder: "hh:mm",
85
+ timeInvalid: "Type a time like 09:30",
86
+ timeOutOfRange: function(a, b) {
87
+ return "Choose a time between " + a + " and " + b;
88
+ },
89
+ dropFiles: "Drag files here or",
90
+ browse: "Choose files",
91
+ browseOne: "Choose a file",
92
+ remove: function(n2) {
93
+ return "Remove " + n2;
94
+ },
95
+ fileTooBig: function(max) {
96
+ return "Larger than " + max;
97
+ },
98
+ fileWrongType: "This file type isn\u2019t accepted",
99
+ tooManyFiles: function(n2) {
100
+ return "Up to " + n2 + " files";
101
+ },
102
+ colorScheme: "Colour scheme",
103
+ increase: "Increase",
104
+ decrease: "Decrease",
105
+ stepDone: "completed",
106
+ stepOf: function(i, total) {
107
+ return "Step " + i + " of " + total;
108
+ },
109
+ schemeLight: "Light",
110
+ schemeDark: "Dark",
111
+ schemeSystem: "System",
112
+ uploading: "Uploading\u2026",
113
+ images: "Images",
114
+ pagination: "Pagination",
115
+ pageN: function(p) {
116
+ return "Page " + p;
117
+ },
118
+ accepts: function(list, max) {
119
+ return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
120
+ }
121
+ },
122
+ th: {
123
+ close: "\u0E1B\u0E34\u0E14",
124
+ dismiss: "\u0E1B\u0E34\u0E14",
125
+ dismissToast: "\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
126
+ showPassword: "\u0E41\u0E2A\u0E14\u0E07\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",
127
+ filters: "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",
128
+ search: "\u0E04\u0E49\u0E19\u0E2B\u0E32",
129
+ clearFilters: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
130
+ results: function(n2) {
131
+ return n2.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
132
+ },
133
+ commandMenu: "\u0E40\u0E21\u0E19\u0E39\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07",
134
+ commandPlaceholder: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
135
+ commandHint: "\u2191\u2193 \u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19 \xB7 Enter \u0E40\u0E1B\u0E34\u0E14 \xB7 Esc \u0E1B\u0E34\u0E14",
136
+ errorSummary: function(n2) {
137
+ return "\u0E41\u0E01\u0E49\u0E44\u0E02 " + n2 + " \u0E0A\u0E48\u0E2D\u0E07\u0E01\u0E48\u0E2D\u0E19\u0E44\u0E1B\u0E15\u0E48\u0E2D";
138
+ },
139
+ notifications: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
140
+ mainNav: "\u0E40\u0E21\u0E19\u0E39\u0E2B\u0E25\u0E31\u0E01",
141
+ breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
142
+ navigation: "\u0E40\u0E21\u0E19\u0E39",
143
+ openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
144
+ collapseNav: "\u0E22\u0E48\u0E2D\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
145
+ expandNav: "\u0E02\u0E22\u0E32\u0E22\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
146
+ searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
147
+ noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
148
+ clear: function(what) {
149
+ return "\u0E25\u0E49\u0E32\u0E07" + (what || "\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01");
150
+ },
151
+ keepTyping: function(total) {
152
+ return "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E23\u0E2D\u0E07\u0E08\u0E32\u0E01 " + n(total) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
153
+ },
154
+ sortAsc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",
155
+ sortDesc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",
156
+ pin: "\u0E15\u0E23\u0E36\u0E07\u0E44\u0E27\u0E49\u0E0B\u0E49\u0E32\u0E22",
157
+ unpin: "\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
158
+ moveLeft: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22",
159
+ moveRight: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32",
160
+ hideColumn: "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
161
+ resetColumns: "\u0E04\u0E37\u0E19\u0E04\u0E48\u0E32\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
162
+ selectRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",
163
+ selectAllRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
164
+ deselectAllRows: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
165
+ selectAll: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
166
+ selectRow: function(k) {
167
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + k;
168
+ },
169
+ selectedCount: function(c) {
170
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + n(c) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
171
+ },
172
+ pinned: "\u0E15\u0E23\u0E36\u0E07\u0E2D\u0E22\u0E39\u0E48",
173
+ columnOptions: function(label) {
174
+ return "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label;
175
+ },
176
+ column: function(label) {
177
+ return label ? "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label : "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C";
178
+ },
179
+ columns: "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
180
+ showHideColumns: "\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
181
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
182
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",
183
+ loadingRows: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
184
+ range: function(a, b, total) {
185
+ return a + "\u2013" + b + " \u0E08\u0E32\u0E01 " + n(total);
186
+ },
187
+ page: function(p, total) {
188
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p + " / " + total;
189
+ },
190
+ prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
191
+ nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
192
+ rowCount: function(c) {
193
+ return n(c) + " \u0E41\u0E16\u0E27";
194
+ },
195
+ actions: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E32\u0E23",
196
+ optional: "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A",
197
+ timePlaceholder: "\u0E0A\u0E0A:\u0E19\u0E19",
198
+ timeInvalid: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A 09:30",
199
+ timeOutOfRange: function(a, b) {
200
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E27\u0E25\u0E32\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 " + a + "\u2013" + b + " \u0E19.";
201
+ },
202
+ dropFiles: "\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E27\u0E32\u0E07 \u0E2B\u0E23\u0E37\u0E2D",
203
+ browse: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
204
+ browseOne: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
205
+ remove: function(n2) {
206
+ return "\u0E25\u0E1A " + n2;
207
+ },
208
+ fileTooBig: function(max) {
209
+ return "\u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19 " + max;
210
+ },
211
+ fileWrongType: "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E44\u0E1F\u0E25\u0E4C\u0E0A\u0E19\u0E34\u0E14\u0E19\u0E35\u0E49",
212
+ tooManyFiles: function(n2) {
213
+ return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
214
+ },
215
+ colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
216
+ increase: "\u0E40\u0E1E\u0E34\u0E48\u0E21",
217
+ decrease: "\u0E25\u0E14",
218
+ stepDone: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27",
219
+ stepOf: function(i, total) {
220
+ return "\u0E02\u0E31\u0E49\u0E19\u0E17\u0E35\u0E48 " + i + " \u0E08\u0E32\u0E01 " + total;
221
+ },
222
+ schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
223
+ schemeDark: "\u0E21\u0E37\u0E14",
224
+ schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
225
+ uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u2026",
226
+ images: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
227
+ pagination: "\u0E40\u0E25\u0E02\u0E2B\u0E19\u0E49\u0E32",
228
+ pageN: function(p) {
229
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p;
230
+ },
231
+ accepts: function(list, max) {
232
+ return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
233
+ }
234
+ },
235
+ sv: {
236
+ close: "St\xE4ng",
237
+ dismiss: "St\xE4ng",
238
+ dismissToast: "St\xE4ng aviseringen",
239
+ showPassword: "Visa l\xF6senord",
240
+ filters: "Filter",
241
+ search: "S\xF6k",
242
+ clearFilters: "Rensa alla",
243
+ results: function(n2) {
244
+ return n2 === 1 ? "1 tr\xE4ff" : n2.toLocaleString("sv-SE") + " tr\xE4ffar";
245
+ },
246
+ commandMenu: "Kommandomeny",
247
+ commandPlaceholder: "Skriv ett kommando eller s\xF6k\u2026",
248
+ commandHint: "\u2191\u2193 flytta \xB7 Enter \xF6ppna \xB7 Esc st\xE4ng",
249
+ errorSummary: function(n2) {
250
+ return n2 === 1 ? "R\xE4tta 1 f\xE4lt f\xF6r att forts\xE4tta" : "R\xE4tta " + n2 + " f\xE4lt f\xF6r att forts\xE4tta";
251
+ },
252
+ notifications: "Aviseringar",
253
+ mainNav: "Huvudmeny",
254
+ breadcrumb: "Br\xF6dsmulor",
255
+ navigation: "Navigering",
256
+ openNav: "\xD6ppna menyn",
257
+ collapseNav: "F\xE4ll ihop sidof\xE4ltet",
258
+ expandNav: "F\xE4ll ut sidof\xE4ltet",
259
+ searching: "S\xF6ker\u2026",
260
+ noMatches: "Inga tr\xE4ffar",
261
+ clear: function(what) {
262
+ return "Rensa " + (what || "urvalet");
263
+ },
264
+ keepTyping: function(total) {
265
+ return "Skriv mer f\xF6r att begr\xE4nsa " + nsv(total) + " alternativ";
266
+ },
267
+ sortAsc: "Sortera stigande",
268
+ sortDesc: "Sortera fallande",
269
+ pin: "F\xE4st till v\xE4nster",
270
+ unpin: "Lossa kolumnen",
271
+ moveLeft: "Flytta v\xE4nster",
272
+ moveRight: "Flytta h\xF6ger",
273
+ hideColumn: "D\xF6lj kolumnen",
274
+ resetColumns: "\xC5terst\xE4ll kolumner",
275
+ selectRows: "V\xE4lj rader",
276
+ selectAllRows: "V\xE4lj alla rader",
277
+ deselectAllRows: "Avmarkera alla rader",
278
+ selectAll: "V\xE4lj alla",
279
+ selectRow: function(k) {
280
+ return "V\xE4lj " + k;
281
+ },
282
+ selectedCount: function(c) {
283
+ return nsv(c) + " valda";
284
+ },
285
+ pinned: "F\xE4st",
286
+ columnOptions: function(label) {
287
+ return "Alternativ f\xF6r kolumnen " + label;
288
+ },
289
+ column: function(label) {
290
+ return label ? "Kolumnen " + label : "Kolumn";
291
+ },
292
+ columns: "Kolumner",
293
+ showHideColumns: "Visa eller d\xF6lj kolumner",
294
+ empty: "Inget h\xE4r \xE4nnu",
295
+ loading: "Laddar\u2026",
296
+ loadingRows: "Laddar rader",
297
+ range: function(a, b, total) {
298
+ return a + "\u2013" + b + " av " + nsv(total);
299
+ },
300
+ page: function(p, total) {
301
+ return "Sida " + p + " av " + total;
302
+ },
303
+ prevPage: "F\xF6reg\xE5ende sida",
304
+ nextPage: "N\xE4sta sida",
305
+ rowCount: function(c) {
306
+ return nsv(c) + " rader";
307
+ },
308
+ actions: "\xC5tg\xE4rder",
309
+ optional: "valfritt",
310
+ timePlaceholder: "tt:mm",
311
+ timeInvalid: "Skriv en tid som 09:30",
312
+ timeOutOfRange: function(a, b) {
313
+ return "V\xE4lj en tid mellan " + a + " och " + b;
314
+ },
315
+ dropFiles: "Dra filer hit eller",
316
+ browse: "V\xE4lj filer",
317
+ browseOne: "V\xE4lj en fil",
318
+ remove: function(n2) {
319
+ return "Ta bort " + n2;
320
+ },
321
+ fileTooBig: function(max) {
322
+ return "St\xF6rre \xE4n " + max;
323
+ },
324
+ fileWrongType: "Den h\xE4r filtypen godtas inte",
325
+ tooManyFiles: function(n2) {
326
+ return "H\xF6gst " + n2 + " filer";
327
+ },
328
+ colorScheme: "F\xE4rgl\xE4ge",
329
+ increase: "\xD6ka",
330
+ decrease: "Minska",
331
+ stepDone: "klart",
332
+ stepOf: function(i, total) {
333
+ return "Steg " + i + " av " + total;
334
+ },
335
+ schemeLight: "Ljust",
336
+ schemeDark: "M\xF6rkt",
337
+ schemeSystem: "System",
338
+ uploading: "Laddar upp\u2026",
339
+ images: "Bilder",
340
+ pagination: "Sidnumrering",
341
+ pageN: function(p) {
342
+ return "Sida " + p;
343
+ },
344
+ accepts: function(list, max) {
345
+ return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
346
+ }
347
+ }
348
+ };
349
+ export {
350
+ STRINGS
351
+ };
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ function formatBytes(n) {
3
+ if (n == null) return "";
4
+ if (n < 1024) return n + " B";
5
+ let u = ["KB", "MB", "GB"], i = -1;
6
+ do {
7
+ n /= 1024;
8
+ i++;
9
+ } while (n >= 1024 && i < u.length - 1);
10
+ return (n >= 10 || Math.round(n) === n ? Math.round(n) : n.toFixed(1)) + " " + u[i];
11
+ }
12
+ function pad2(n) {
13
+ return (n < 10 ? "0" : "") + n;
14
+ }
15
+ function parseTime(text) {
16
+ let s = String(text || "").trim().toLowerCase().replace(/\s*(น\.?|นาฬิกา)$/, "").trim();
17
+ const pm = /\s*(pm|p\.m\.)$/.test(s), am = /\s*(am|a\.m\.)$/.test(s);
18
+ s = s.replace(/\s*(am|pm|a\.m\.|p\.m\.)$/, "");
19
+ const m = /^(\d{1,2})(?:[:.](\d{2}))?$/.exec(s) || /^(\d{1,2})(\d{2})$/.exec(s);
20
+ if (!m) return null;
21
+ let hh = +m[1], mm = m[2] ? +m[2] : 0;
22
+ if (pm && hh < 12) hh += 12;
23
+ if (am && hh === 12) hh = 0;
24
+ if (hh > 23 || mm > 59) return null;
25
+ return pad2(hh) + ":" + pad2(mm);
26
+ }
27
+ export {
28
+ formatBytes,
29
+ parseTime
30
+ };
package/dist/index.d.ts CHANGED
@@ -41,6 +41,11 @@ export interface ButtonLinkProps extends Omit<React$1.AnchorHTMLAttributes<HTMLA
41
41
  /** A router's link to render instead of `<a>`, e.g. `Link` from `next/link` (client-side navigation). It gets `href`, `className`, the children and the ref. */
42
42
  linkComponent?: React$1.ElementType | undefined;
43
43
  }
44
+ /** What DataTable's onStateChange reports: the sort and the 1-based page, together. */
45
+ export interface DataTableState {
46
+ sort: DataTableSort | null;
47
+ page: number;
48
+ }
44
49
  export interface DataTableColumn {
45
50
  /** Key into each row object. */
46
51
  key: string;
@@ -119,6 +124,10 @@ export interface DataTableProps {
119
124
  /** Initial page when uncontrolled. Default 1. */
120
125
  defaultPage?: number | undefined;
121
126
  onPageChange?: ((page: number) => void) | undefined;
127
+ /** Sort and page in one callback (4.17): a sort click reports `{ sort, page: 1 }` once, a page change
128
+ * `{ sort, page }`. When set, onSortChange and onPageChange are not called for them, so an app that keeps both in
129
+ * the URL does one navigation per click. Pair with `sort` + `page` for controlled state. */
130
+ onStateChange?: ((state: DataTableState) => void) | undefined;
122
131
  /** Adds drag/keyboard resize handles to every column that has a width. */
123
132
  resizable?: boolean | undefined;
124
133
  onColumnResize?: ((key: string, width: number) => void) | undefined;
@@ -362,10 +371,20 @@ export interface CommandProps {
362
371
  placeholder?: string | undefined;
363
372
  /** Default "No matches". */
364
373
  emptyText?: string | undefined;
374
+ /** Shown when nothing matches, instead of `emptyText`: any content, e.g. a hint and a "Create member" button. (4.17) */
375
+ empty?: React$1.ReactNode | undefined;
365
376
  /** ⌘K / Ctrl+K toggles the palette from anywhere on the page. Default true. */
366
377
  hotkey?: boolean | undefined;
367
- /** Replace the Thai-aware default filter. */
368
- filter?: ((item: CommandItem, query: string) => boolean) | undefined;
378
+ /** Replace the Thai-aware default filter, or `false` to show `items` as given — for results your server already
379
+ * searched (4.17). */
380
+ filter?: ((item: CommandItem, query: string) => boolean) | false | undefined;
381
+ /** The search text, controlled (4.17). Pair with `onQueryChange`; fetch results for it and pass them as `items`. */
382
+ query?: string | undefined;
383
+ /** Called on every keystroke, and with "" when the palette closes. (4.17) */
384
+ onQueryChange?: ((query: string) => void) | undefined;
385
+ /** Results are on their way: a "Searching…" row, `aria-busy`, and the result count announced when they arrive. The
386
+ * current items stay listed meanwhile. (4.17) */
387
+ loading?: boolean | undefined;
369
388
  className?: string | undefined;
370
389
  }
371
390
  export interface TextareaProps extends FieldProps, Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "required"> {
@@ -554,6 +573,8 @@ export interface BreadcrumbProps {
554
573
  onClick?: (() => void) | undefined;
555
574
  }>;
556
575
  label?: string | undefined;
576
+ /** Your router's link (e.g. `Link` from `next/link`) for this component; defaults to AuraProvider's `linkComponent`, then `<a>`. */
577
+ linkComponent?: React$1.ElementType | undefined;
557
578
  className?: string | undefined;
558
579
  }
559
580
  export interface AvatarProps {
@@ -813,6 +834,8 @@ export interface StatChange {
813
834
  label?: React$1.ReactNode | undefined;
814
835
  }
815
836
  export interface StatProps {
837
+ /** Your router's link (e.g. `Link` from `next/link`) for this component; defaults to AuraProvider's `linkComponent`, then `<a>`. */
838
+ linkComponent?: React$1.ElementType | undefined;
816
839
  label: React$1.ReactNode;
817
840
  value?: React$1.ReactNode | undefined;
818
841
  /** Small unit after the value ("งาน", "คน", "%"). */
@@ -943,9 +966,12 @@ export interface PaginationProps {
943
966
  onChange?: ((page: number) => void) | undefined;
944
967
  /** Pages shown each side of the current one. Default 1. */
945
968
  siblingCount?: number | undefined;
946
- /** Render real links (SEO, open in new tab); onChange still runs for client routing. */
969
+ /** Render real links — page numbers and the previous / next arrows (4.17) — through your router's link. With
970
+ * `onChange` too, onChange runs instead of following the link. */
947
971
  getHref?: ((page: number) => string) | undefined;
948
972
  label?: string | undefined;
973
+ /** Your router's link (e.g. `Link` from `next/link`) for this component; defaults to AuraProvider's `linkComponent`, then `<a>`. */
974
+ linkComponent?: React$1.ElementType | undefined;
949
975
  className?: string | undefined;
950
976
  }
951
977
  export interface AccordionItem {
@@ -1077,11 +1103,11 @@ export type FormatDateOptions = DateDisplayOptions & {
1077
1103
  };
1078
1104
  /** Format an ISO date for display, e.g. "18 ก.ย. 2569" (th, Buddhist) or "18 Sept 2026" (en, Gregorian). */
1079
1105
  export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
1106
+ /** Parse typed text: dd/mm/yyyy (Buddhist years ≥ 2400 are converted), d-m-yyyy, d.m.yyyy, yyyy-mm-dd or '18 ก.ย. 2569' / '18 Sep 2026'. */
1107
+ export declare function parseDate(text: string | null | undefined): ISODate | null;
1080
1108
  /** formatDate bound to the nearest AuraProvider: its locale and calendar (English, Gregorian without one).
1081
1109
  * Options you pass still win. Use it in components; plain formatDate() stays for code outside React. */
1082
1110
  export declare function useFormatDate(): (iso: ISODate | null | undefined, opts?: FormatDateOptions) => string;
1083
- /** Parse typed text: dd/mm/yyyy (Buddhist years ≥ 2400 are converted), d-m-yyyy, d.m.yyyy, yyyy-mm-dd or '18 ก.ย. 2569' / '18 Sep 2026'. */
1084
- export declare function parseDate(text: string | null | undefined): ISODate | null;
1085
1111
  export declare const Calendar: React$1.ForwardRefExoticComponent<CalendarProps & React$1.RefAttributes<HTMLDivElement>>;
1086
1112
  /** Typed date field + calendar popover. English / Gregorian unless a locale is set; `th` shows Buddhist-era dates (18 ก.ย. 2569) and accepts พ.ศ. or ค.ศ. years. The value is always a Gregorian ISO date. */
1087
1113
  export declare const DatePicker: React$1.ForwardRefExoticComponent<DatePickerProps & React$1.RefAttributes<HTMLInputElement>>;
@@ -1249,11 +1275,11 @@ export declare function useAuraLocale(): AuraLocaleValue;
1249
1275
  /** The provider's density, for portals that render outside its wrapper. */
1250
1276
  export declare function useDensity(): "comfortable" | "compact" | undefined;
1251
1277
  export declare const Stat: React$1.ForwardRefExoticComponent<StatProps & React$1.RefAttributes<HTMLElement>>;
1278
+ /** 1536 → "1.5 KB". */
1279
+ export declare function formatBytes(n: number | null | undefined): string;
1252
1280
  /** Parse typed time: 9 · 09 · 930 · 0930 · 9:30 · 9.30 · 09.30 น. · 9:30 pm → "HH:mm" (24-hour) or null. */
1253
1281
  export declare function parseTime(text: string | null | undefined): string | null;
1254
1282
  export declare const TimePicker: React$1.ForwardRefExoticComponent<TimePickerProps & React$1.RefAttributes<HTMLInputElement>>;
1255
- /** 1536 → "1.5 KB". */
1256
- export declare function formatBytes(n: number | null | undefined): string;
1257
1283
  export declare const FileUpload: React$1.ForwardRefExoticComponent<FileUploadProps & React$1.RefAttributes<HTMLInputElement>>;
1258
1284
  /** WCAG contrast ratio of two #hex colours. */
1259
1285
  export declare function contrast(a: string, b: string): number;