klun-ui 0.5.0 → 0.7.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.
- package/CHANGELOG.md +522 -0
- package/README.md +6 -0
- package/dist/{chunk-WONPY7ZX.js → chunk-2S6ZRGPW.js} +1554 -240
- package/dist/chunk-2S6ZRGPW.js.map +1 -0
- package/dist/{chunk-ODVX2AVA.cjs → chunk-DW4IUUWE.cjs} +1557 -235
- package/dist/chunk-DW4IUUWE.cjs.map +1 -0
- package/dist/index.cjs +267 -235
- package/dist/index.d.cts +690 -27
- package/dist/index.d.ts +690 -27
- package/dist/index.js +1 -1
- package/dist/styles.css +1306 -917
- package/dist/templates/index.cjs +943 -943
- package/dist/templates/index.js +1 -1
- package/package.json +10 -3
- package/dist/chunk-ODVX2AVA.cjs.map +0 -1
- package/dist/chunk-WONPY7ZX.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cx } from './chunk-T225J6LV.js';
|
|
2
|
-
import { createContext, forwardRef, useState, useRef, useEffect, useMemo, Children, useCallback, useLayoutEffect, Fragment as Fragment$1, createElement, useContext,
|
|
2
|
+
import { createContext, forwardRef, useState, useRef, useEffect, useMemo, Children, useCallback, useId, useLayoutEffect, isValidElement, cloneElement, Fragment as Fragment$1, createElement, useContext, useSyncExternalStore } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCorners, useDroppable, closestCenter } from '@dnd-kit/core';
|
|
5
5
|
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
6
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
6
|
+
import { CSS as CSS$1 } from '@dnd-kit/utilities';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
|
|
@@ -197,7 +197,7 @@ var enUS = {
|
|
|
197
197
|
banner: { dismiss: "Dismiss" },
|
|
198
198
|
toast: { dismiss: "Dismiss" },
|
|
199
199
|
fileUpload: { clickToUpload: "Click to upload", orDragAndDrop: "or drag and drop" },
|
|
200
|
-
imageUpload: { label: "Upload image", remove: "Remove" },
|
|
200
|
+
imageUpload: { label: "Upload image", remove: "Remove", hint: "PNG or JPG, up to 5MB" },
|
|
201
201
|
passwordStrength: { weak: "Weak", fair: "Fair", good: "Good", strong: "Strong" },
|
|
202
202
|
commandMenu: {
|
|
203
203
|
placeholder: "Type a command or search\u2026",
|
|
@@ -265,7 +265,14 @@ var enUS = {
|
|
|
265
265
|
perPage: "{size} / page",
|
|
266
266
|
selectRow: "Select row",
|
|
267
267
|
selectAll: "Select all rows"
|
|
268
|
-
}
|
|
268
|
+
},
|
|
269
|
+
wizard: { back: "\u4E0A\u4E00\u6B65", next: "\u4E0B\u4E00\u6B65", finish: "\u5B8C\u6210" },
|
|
270
|
+
a11y: { zoomIn: "Zoom in", zoomOut: "Zoom out", rotate: "Rotate", collapseStart: "Collapse start panel", collapseEnd: "Collapse end panel", bulkActions: "Bulk actions", clearSelection: "Clear selection", back: "Back" },
|
|
271
|
+
richEditor: { placeholder: "Write something\u2026", editorLabel: "Rich text editor" },
|
|
272
|
+
copy: { label: "Copy" },
|
|
273
|
+
emojiPicker: { searchPlaceholder: "Search emoji", emptyText: "No emoji found", addReaction: "Add reaction" },
|
|
274
|
+
sidebar: { searchPlaceholder: "Search", primary: "Primary" },
|
|
275
|
+
imageViewer: { reset: "Reset", download: "Download" }
|
|
269
276
|
};
|
|
270
277
|
var zhCN = {
|
|
271
278
|
locale: "zh-CN",
|
|
@@ -295,7 +302,7 @@ var zhCN = {
|
|
|
295
302
|
banner: { dismiss: "\u5173\u95ED" },
|
|
296
303
|
toast: { dismiss: "\u5173\u95ED" },
|
|
297
304
|
fileUpload: { clickToUpload: "\u70B9\u51FB\u4E0A\u4F20", orDragAndDrop: "\u6216\u62D6\u62FD\u5230\u6B64\u5904" },
|
|
298
|
-
imageUpload: { label: "\u4E0A\u4F20\u56FE\u7247", remove: "\u79FB\u9664" },
|
|
305
|
+
imageUpload: { label: "\u4E0A\u4F20\u56FE\u7247", remove: "\u79FB\u9664", hint: "\u652F\u6301 PNG \u6216 JPG\uFF0C\u6700\u5927 5MB" },
|
|
299
306
|
passwordStrength: { weak: "\u5F31", fair: "\u4E00\u822C", good: "\u826F\u597D", strong: "\u5F3A" },
|
|
300
307
|
commandMenu: {
|
|
301
308
|
placeholder: "\u8F93\u5165\u547D\u4EE4\u6216\u641C\u7D22\u2026",
|
|
@@ -363,7 +370,14 @@ var zhCN = {
|
|
|
363
370
|
perPage: "{size} / \u9875",
|
|
364
371
|
selectRow: "\u9009\u62E9\u672C\u884C",
|
|
365
372
|
selectAll: "\u5168\u9009"
|
|
366
|
-
}
|
|
373
|
+
},
|
|
374
|
+
wizard: { back: "\u4E0A\u4E00\u6B65", next: "\u4E0B\u4E00\u6B65", finish: "\u5B8C\u6210" },
|
|
375
|
+
a11y: { zoomIn: "\u653E\u5927", zoomOut: "\u7F29\u5C0F", rotate: "\u65CB\u8F6C", collapseStart: "\u6536\u8D77\u8D77\u59CB\u9762\u677F", collapseEnd: "\u6536\u8D77\u7ED3\u675F\u9762\u677F", bulkActions: "\u6279\u91CF\u64CD\u4F5C", clearSelection: "\u6E05\u9664\u9009\u62E9", back: "\u8FD4\u56DE" },
|
|
376
|
+
richEditor: { placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u2026", editorLabel: "\u5BCC\u6587\u672C\u7F16\u8F91\u5668" },
|
|
377
|
+
copy: { label: "\u590D\u5236" },
|
|
378
|
+
emojiPicker: { searchPlaceholder: "\u641C\u7D22\u8868\u60C5", emptyText: "\u6CA1\u6709\u627E\u5230\u8868\u60C5", addReaction: "\u6DFB\u52A0\u8868\u60C5" },
|
|
379
|
+
sidebar: { searchPlaceholder: "\u641C\u7D22", primary: "\u4E3B\u5BFC\u822A" },
|
|
380
|
+
imageViewer: { reset: "\u91CD\u7F6E", download: "\u4E0B\u8F7D" }
|
|
367
381
|
};
|
|
368
382
|
var zhTW = {
|
|
369
383
|
locale: "zh-TW",
|
|
@@ -387,13 +401,13 @@ var zhTW = {
|
|
|
387
401
|
},
|
|
388
402
|
timePicker: { am: "\u4E0A\u5348", pm: "\u4E0B\u5348" },
|
|
389
403
|
pagination: { previous: "\u4E0A\u4E00\u9801", next: "\u4E0B\u4E00\u9801" },
|
|
390
|
-
modal: { close: "\u95DC\u9589" },
|
|
404
|
+
modal: { close: "\u95DC\u9589", maximize: "\u6700\u5927\u5316", restore: "\u9084\u539F" },
|
|
391
405
|
drawer: { close: "\u95DC\u9589" },
|
|
392
406
|
alert: { dismiss: "\u95DC\u9589" },
|
|
393
407
|
banner: { dismiss: "\u95DC\u9589" },
|
|
394
408
|
toast: { dismiss: "\u95DC\u9589" },
|
|
395
409
|
fileUpload: { clickToUpload: "\u9EDE\u64CA\u4E0A\u50B3", orDragAndDrop: "\u6216\u62D6\u66F3\u5230\u6B64\u8655" },
|
|
396
|
-
imageUpload: { label: "\u4E0A\u50B3\u5716\u7247", remove: "\u79FB\u9664" },
|
|
410
|
+
imageUpload: { label: "\u4E0A\u50B3\u5716\u7247", remove: "\u79FB\u9664", hint: "\u652F\u63F4 PNG \u6216 JPG\uFF0C\u6700\u5927 5MB" },
|
|
397
411
|
passwordStrength: { weak: "\u5F31", fair: "\u4E00\u822C", good: "\u826F\u597D", strong: "\u5F37" },
|
|
398
412
|
commandMenu: {
|
|
399
413
|
placeholder: "\u8F38\u5165\u547D\u4EE4\u6216\u641C\u5C0B\u2026",
|
|
@@ -461,7 +475,14 @@ var zhTW = {
|
|
|
461
475
|
perPage: "{size} / \u9801",
|
|
462
476
|
selectRow: "\u9078\u64C7\u672C\u884C",
|
|
463
477
|
selectAll: "\u5168\u9078"
|
|
464
|
-
}
|
|
478
|
+
},
|
|
479
|
+
wizard: { back: "\u623B\u308B", next: "\u6B21\u3078", finish: "\u5B8C\u4E86" },
|
|
480
|
+
a11y: { zoomIn: "\u653E\u5927", zoomOut: "\u7E2E\u5C0F", rotate: "\u65CB\u8F49", collapseStart: "\u6536\u5408\u8D77\u59CB\u9762\u677F", collapseEnd: "\u6536\u5408\u7D50\u675F\u9762\u677F", bulkActions: "\u6279\u6B21\u64CD\u4F5C", clearSelection: "\u6E05\u9664\u9078\u53D6", back: "\u8FD4\u56DE" },
|
|
481
|
+
richEditor: { placeholder: "\u8ACB\u8F38\u5165\u5167\u5BB9\u2026", editorLabel: "\u5BCC\u6587\u5B57\u7DE8\u8F2F\u5668" },
|
|
482
|
+
copy: { label: "\u8907\u88FD" },
|
|
483
|
+
emojiPicker: { searchPlaceholder: "\u641C\u5C0B\u8868\u60C5", emptyText: "\u627E\u4E0D\u5230\u8868\u60C5", addReaction: "\u65B0\u589E\u8868\u60C5" },
|
|
484
|
+
sidebar: { searchPlaceholder: "\u641C\u5C0B", primary: "\u4E3B\u5C0E\u89BD" },
|
|
485
|
+
imageViewer: { reset: "\u91CD\u8A2D", download: "\u4E0B\u8F09" }
|
|
465
486
|
};
|
|
466
487
|
var jaJP = {
|
|
467
488
|
locale: "ja-JP",
|
|
@@ -485,13 +506,15 @@ var jaJP = {
|
|
|
485
506
|
},
|
|
486
507
|
timePicker: { am: "\u5348\u524D", pm: "\u5348\u5F8C" },
|
|
487
508
|
pagination: { previous: "\u524D\u3078", next: "\u6B21\u3078" },
|
|
488
|
-
modal: { close: "\u9589\u3058\u308B" },
|
|
509
|
+
modal: { close: "\u9589\u3058\u308B", maximize: "\u6700\u5927\u5316", restore: "\u5143\u306B\u623B\u3059" },
|
|
510
|
+
select: { placeholder: "\u9078\u629E" },
|
|
511
|
+
counterInput: { decrease: "\u6E1B\u3089\u3059", increase: "\u5897\u3084\u3059" },
|
|
489
512
|
drawer: { close: "\u9589\u3058\u308B" },
|
|
490
513
|
alert: { dismiss: "\u9589\u3058\u308B" },
|
|
491
514
|
banner: { dismiss: "\u9589\u3058\u308B" },
|
|
492
515
|
toast: { dismiss: "\u9589\u3058\u308B" },
|
|
493
516
|
fileUpload: { clickToUpload: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9", orDragAndDrop: "\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7" },
|
|
494
|
-
imageUpload: { label: "\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9", remove: "\u524A\u9664" },
|
|
517
|
+
imageUpload: { label: "\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9", remove: "\u524A\u9664", hint: "PNG \u307E\u305F\u306F JPG\u3001\u6700\u5927 5MB" },
|
|
495
518
|
passwordStrength: { weak: "\u5F31\u3044", fair: "\u666E\u901A", good: "\u826F\u3044", strong: "\u5F37\u3044" },
|
|
496
519
|
commandMenu: {
|
|
497
520
|
placeholder: "\u30B3\u30DE\u30F3\u30C9\u3092\u5165\u529B\u307E\u305F\u306F\u691C\u7D22\u2026",
|
|
@@ -554,8 +577,17 @@ var jaJP = {
|
|
|
554
577
|
previous: "\u524D\u3078",
|
|
555
578
|
next: "\u6B21\u3078",
|
|
556
579
|
pageRange: "{total} \u4EF6\u4E2D {from}\u2013{to}",
|
|
557
|
-
perPage: "{size} \u4EF6 / \u30DA\u30FC\u30B8"
|
|
558
|
-
|
|
580
|
+
perPage: "{size} \u4EF6 / \u30DA\u30FC\u30B8",
|
|
581
|
+
selectRow: "\u884C\u3092\u9078\u629E",
|
|
582
|
+
selectAll: "\u3059\u3079\u3066\u9078\u629E"
|
|
583
|
+
},
|
|
584
|
+
wizard: { back: "\uC774\uC804", next: "\uB2E4\uC74C", finish: "\uC644\uB8CC" },
|
|
585
|
+
a11y: { zoomIn: "\u62E1\u5927", zoomOut: "\u7E2E\u5C0F", rotate: "\u56DE\u8EE2", collapseStart: "\u958B\u59CB\u30D1\u30CD\u30EB\u3092\u6298\u308A\u305F\u305F\u3080", collapseEnd: "\u7D42\u4E86\u30D1\u30CD\u30EB\u3092\u6298\u308A\u305F\u305F\u3080", bulkActions: "\u4E00\u62EC\u64CD\u4F5C", clearSelection: "\u9078\u629E\u3092\u89E3\u9664", back: "\u623B\u308B" },
|
|
586
|
+
richEditor: { placeholder: "\u5185\u5BB9\u3092\u5165\u529B\u2026", editorLabel: "\u30EA\u30C3\u30C1\u30C6\u30AD\u30B9\u30C8\u30A8\u30C7\u30A3\u30BF\u30FC" },
|
|
587
|
+
copy: { label: "\u30B3\u30D4\u30FC" },
|
|
588
|
+
emojiPicker: { searchPlaceholder: "\u7D75\u6587\u5B57\u3092\u691C\u7D22", emptyText: "\u7D75\u6587\u5B57\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093", addReaction: "\u30EA\u30A2\u30AF\u30B7\u30E7\u30F3\u3092\u8FFD\u52A0" },
|
|
589
|
+
sidebar: { searchPlaceholder: "\u691C\u7D22", primary: "\u30E1\u30A4\u30F3\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3" },
|
|
590
|
+
imageViewer: { reset: "\u30EA\u30BB\u30C3\u30C8", download: "\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9" }
|
|
559
591
|
};
|
|
560
592
|
var koKR = {
|
|
561
593
|
locale: "ko-KR",
|
|
@@ -579,13 +611,15 @@ var koKR = {
|
|
|
579
611
|
},
|
|
580
612
|
timePicker: { am: "\uC624\uC804", pm: "\uC624\uD6C4" },
|
|
581
613
|
pagination: { previous: "\uC774\uC804", next: "\uB2E4\uC74C" },
|
|
582
|
-
modal: { close: "\uB2EB\uAE30" },
|
|
614
|
+
modal: { close: "\uB2EB\uAE30", maximize: "\uCD5C\uB300\uD654", restore: "\uBCF5\uC6D0" },
|
|
615
|
+
select: { placeholder: "\uC120\uD0DD" },
|
|
616
|
+
counterInput: { decrease: "\uAC10\uC18C", increase: "\uC99D\uAC00" },
|
|
583
617
|
drawer: { close: "\uB2EB\uAE30" },
|
|
584
618
|
alert: { dismiss: "\uB2EB\uAE30" },
|
|
585
619
|
banner: { dismiss: "\uB2EB\uAE30" },
|
|
586
620
|
toast: { dismiss: "\uB2EB\uAE30" },
|
|
587
621
|
fileUpload: { clickToUpload: "\uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC", orDragAndDrop: "\uB610\uB294 \uB4DC\uB798\uADF8 \uC564 \uB4DC\uB86D" },
|
|
588
|
-
imageUpload: { label: "\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC", remove: "\uC81C\uAC70" },
|
|
622
|
+
imageUpload: { label: "\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC", remove: "\uC81C\uAC70", hint: "PNG \uB610\uB294 JPG, \uCD5C\uB300 5MB" },
|
|
589
623
|
passwordStrength: { weak: "\uC57D\uD568", fair: "\uBCF4\uD1B5", good: "\uC591\uD638", strong: "\uAC15\uD568" },
|
|
590
624
|
commandMenu: {
|
|
591
625
|
placeholder: "\uBA85\uB839\uC5B4 \uC785\uB825 \uB610\uB294 \uAC80\uC0C9\u2026",
|
|
@@ -648,8 +682,17 @@ var koKR = {
|
|
|
648
682
|
previous: "\uC774\uC804",
|
|
649
683
|
next: "\uB2E4\uC74C",
|
|
650
684
|
pageRange: "{total}\uAC1C \uC911 {from}\u2013{to}",
|
|
651
|
-
perPage: "{size}\uAC1C / \uD398\uC774\uC9C0"
|
|
652
|
-
|
|
685
|
+
perPage: "{size}\uAC1C / \uD398\uC774\uC9C0",
|
|
686
|
+
selectRow: "\uD589 \uC120\uD0DD",
|
|
687
|
+
selectAll: "\uC804\uCCB4 \uC120\uD0DD"
|
|
688
|
+
},
|
|
689
|
+
wizard: { back: "Retour", next: "Suivant", finish: "Terminer" },
|
|
690
|
+
a11y: { zoomIn: "\uD655\uB300", zoomOut: "\uCD95\uC18C", rotate: "\uD68C\uC804", collapseStart: "\uC2DC\uC791 \uD328\uB110 \uC811\uAE30", collapseEnd: "\uB05D \uD328\uB110 \uC811\uAE30", bulkActions: "\uC77C\uAD04 \uC791\uC5C5", clearSelection: "\uC120\uD0DD \uD574\uC81C", back: "\uB4A4\uB85C" },
|
|
691
|
+
richEditor: { placeholder: "\uB0B4\uC6A9\uC744 \uC785\uB825\u2026", editorLabel: "\uB9AC\uCE58 \uD14D\uC2A4\uD2B8 \uD3B8\uC9D1\uAE30" },
|
|
692
|
+
copy: { label: "\uBCF5\uC0AC" },
|
|
693
|
+
emojiPicker: { searchPlaceholder: "\uC774\uBAA8\uC9C0 \uAC80\uC0C9", emptyText: "\uC774\uBAA8\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C", addReaction: "\uBC18\uC751 \uCD94\uAC00" },
|
|
694
|
+
sidebar: { searchPlaceholder: "\uAC80\uC0C9", primary: "\uAE30\uBCF8 \uD0D0\uC0C9" },
|
|
695
|
+
imageViewer: { reset: "\uC7AC\uC124\uC815", download: "\uB2E4\uC6B4\uB85C\uB4DC" }
|
|
653
696
|
};
|
|
654
697
|
var frFR = {
|
|
655
698
|
locale: "fr-FR",
|
|
@@ -673,13 +716,15 @@ var frFR = {
|
|
|
673
716
|
},
|
|
674
717
|
timePicker: { am: "AM", pm: "PM" },
|
|
675
718
|
pagination: { previous: "Pr\xE9c\xE9dent", next: "Suivant" },
|
|
676
|
-
modal: { close: "Fermer" },
|
|
719
|
+
modal: { close: "Fermer", maximize: "Agrandir", restore: "Restaurer" },
|
|
720
|
+
select: { placeholder: "S\xE9lectionner" },
|
|
721
|
+
counterInput: { decrease: "Diminuer", increase: "Augmenter" },
|
|
677
722
|
drawer: { close: "Fermer" },
|
|
678
723
|
alert: { dismiss: "Fermer" },
|
|
679
724
|
banner: { dismiss: "Fermer" },
|
|
680
725
|
toast: { dismiss: "Fermer" },
|
|
681
726
|
fileUpload: { clickToUpload: "Cliquez pour t\xE9l\xE9verser", orDragAndDrop: "ou glissez-d\xE9posez" },
|
|
682
|
-
imageUpload: { label: "T\xE9l\xE9verser une image", remove: "Supprimer" },
|
|
727
|
+
imageUpload: { label: "T\xE9l\xE9verser une image", remove: "Supprimer", hint: "PNG ou JPG, jusqu'\xE0 5 Mo" },
|
|
683
728
|
passwordStrength: { weak: "Faible", fair: "Moyen", good: "Bon", strong: "Fort" },
|
|
684
729
|
commandMenu: {
|
|
685
730
|
placeholder: "Tapez une commande ou recherchez\u2026",
|
|
@@ -742,8 +787,17 @@ var frFR = {
|
|
|
742
787
|
previous: "Pr\xE9c\xE9dent",
|
|
743
788
|
next: "Suivant",
|
|
744
789
|
pageRange: "{from}\u2013{to} sur {total}",
|
|
745
|
-
perPage: "{size} / page"
|
|
746
|
-
|
|
790
|
+
perPage: "{size} / page",
|
|
791
|
+
selectRow: "S\xE9lectionner la ligne",
|
|
792
|
+
selectAll: "Tout s\xE9lectionner"
|
|
793
|
+
},
|
|
794
|
+
wizard: { back: "Zur\xFCck", next: "Weiter", finish: "Fertig" },
|
|
795
|
+
a11y: { zoomIn: "Zoom avant", zoomOut: "Zoom arri\xE8re", rotate: "Pivoter", collapseStart: "R\xE9duire le panneau de d\xE9but", collapseEnd: "R\xE9duire le panneau de fin", bulkActions: "Actions group\xE9es", clearSelection: "Effacer la s\xE9lection", back: "Retour" },
|
|
796
|
+
richEditor: { placeholder: "\xC9crivez quelque chose\u2026", editorLabel: "\xC9diteur de texte enrichi" },
|
|
797
|
+
copy: { label: "Copier" },
|
|
798
|
+
emojiPicker: { searchPlaceholder: "Rechercher un emoji", emptyText: "Aucun emoji trouv\xE9", addReaction: "Ajouter une r\xE9action" },
|
|
799
|
+
sidebar: { searchPlaceholder: "Rechercher", primary: "Navigation principale" },
|
|
800
|
+
imageViewer: { reset: "R\xE9initialiser", download: "T\xE9l\xE9charger" }
|
|
747
801
|
};
|
|
748
802
|
var deDE = {
|
|
749
803
|
locale: "de-DE",
|
|
@@ -767,13 +821,15 @@ var deDE = {
|
|
|
767
821
|
},
|
|
768
822
|
timePicker: { am: "AM", pm: "PM" },
|
|
769
823
|
pagination: { previous: "Zur\xFCck", next: "Weiter" },
|
|
770
|
-
modal: { close: "Schlie\xDFen" },
|
|
824
|
+
modal: { close: "Schlie\xDFen", maximize: "Maximieren", restore: "Wiederherstellen" },
|
|
825
|
+
select: { placeholder: "Ausw\xE4hlen" },
|
|
826
|
+
counterInput: { decrease: "Verringern", increase: "Erh\xF6hen" },
|
|
771
827
|
drawer: { close: "Schlie\xDFen" },
|
|
772
828
|
alert: { dismiss: "Schlie\xDFen" },
|
|
773
829
|
banner: { dismiss: "Schlie\xDFen" },
|
|
774
830
|
toast: { dismiss: "Schlie\xDFen" },
|
|
775
831
|
fileUpload: { clickToUpload: "Zum Hochladen klicken", orDragAndDrop: "oder per Drag & Drop" },
|
|
776
|
-
imageUpload: { label: "Bild hochladen", remove: "Entfernen" },
|
|
832
|
+
imageUpload: { label: "Bild hochladen", remove: "Entfernen", hint: "PNG oder JPG, bis zu 5 MB" },
|
|
777
833
|
passwordStrength: { weak: "Schwach", fair: "Mittel", good: "Gut", strong: "Stark" },
|
|
778
834
|
commandMenu: {
|
|
779
835
|
placeholder: "Befehl eingeben oder suchen\u2026",
|
|
@@ -836,8 +892,17 @@ var deDE = {
|
|
|
836
892
|
previous: "Zur\xFCck",
|
|
837
893
|
next: "Weiter",
|
|
838
894
|
pageRange: "{from}\u2013{to} von {total}",
|
|
839
|
-
perPage: "{size} / Seite"
|
|
840
|
-
|
|
895
|
+
perPage: "{size} / Seite",
|
|
896
|
+
selectRow: "Zeile ausw\xE4hlen",
|
|
897
|
+
selectAll: "Alle ausw\xE4hlen"
|
|
898
|
+
},
|
|
899
|
+
wizard: { back: "Atr\xE1s", next: "Siguiente", finish: "Finalizar" },
|
|
900
|
+
a11y: { zoomIn: "Vergr\xF6\xDFern", zoomOut: "Verkleinern", rotate: "Drehen", collapseStart: "Startbereich einklappen", collapseEnd: "Endbereich einklappen", bulkActions: "Mehrfachaktionen", clearSelection: "Auswahl aufheben", back: "Zur\xFCck" },
|
|
901
|
+
richEditor: { placeholder: "Etwas eingeben\u2026", editorLabel: "Rich-Text-Editor" },
|
|
902
|
+
copy: { label: "Kopieren" },
|
|
903
|
+
emojiPicker: { searchPlaceholder: "Emoji suchen", emptyText: "Kein Emoji gefunden", addReaction: "Reaktion hinzuf\xFCgen" },
|
|
904
|
+
sidebar: { searchPlaceholder: "Suchen", primary: "Hauptnavigation" },
|
|
905
|
+
imageViewer: { reset: "Zur\xFCcksetzen", download: "Herunterladen" }
|
|
841
906
|
};
|
|
842
907
|
var esES = {
|
|
843
908
|
locale: "es-ES",
|
|
@@ -861,13 +926,15 @@ var esES = {
|
|
|
861
926
|
},
|
|
862
927
|
timePicker: { am: "AM", pm: "PM" },
|
|
863
928
|
pagination: { previous: "Anterior", next: "Siguiente" },
|
|
864
|
-
modal: { close: "Cerrar" },
|
|
929
|
+
modal: { close: "Cerrar", maximize: "Maximizar", restore: "Restaurar" },
|
|
930
|
+
select: { placeholder: "Seleccionar" },
|
|
931
|
+
counterInput: { decrease: "Disminuir", increase: "Aumentar" },
|
|
865
932
|
drawer: { close: "Cerrar" },
|
|
866
933
|
alert: { dismiss: "Cerrar" },
|
|
867
934
|
banner: { dismiss: "Cerrar" },
|
|
868
935
|
toast: { dismiss: "Cerrar" },
|
|
869
936
|
fileUpload: { clickToUpload: "Haz clic para subir", orDragAndDrop: "o arrastra y suelta" },
|
|
870
|
-
imageUpload: { label: "Subir imagen", remove: "Eliminar" },
|
|
937
|
+
imageUpload: { label: "Subir imagen", remove: "Eliminar", hint: "PNG o JPG, hasta 5 MB" },
|
|
871
938
|
passwordStrength: { weak: "D\xE9bil", fair: "Regular", good: "Buena", strong: "Fuerte" },
|
|
872
939
|
commandMenu: {
|
|
873
940
|
placeholder: "Escribe un comando o busca\u2026",
|
|
@@ -930,8 +997,17 @@ var esES = {
|
|
|
930
997
|
previous: "Anterior",
|
|
931
998
|
next: "Siguiente",
|
|
932
999
|
pageRange: "{from}\u2013{to} de {total}",
|
|
933
|
-
perPage: "{size} / p\xE1gina"
|
|
934
|
-
|
|
1000
|
+
perPage: "{size} / p\xE1gina",
|
|
1001
|
+
selectRow: "Seleccionar fila",
|
|
1002
|
+
selectAll: "Seleccionar todo"
|
|
1003
|
+
},
|
|
1004
|
+
wizard: { back: "Voltar", next: "Avan\xE7ar", finish: "Concluir" },
|
|
1005
|
+
a11y: { zoomIn: "Acercar", zoomOut: "Alejar", rotate: "Girar", collapseStart: "Contraer panel inicial", collapseEnd: "Contraer panel final", bulkActions: "Acciones masivas", clearSelection: "Borrar selecci\xF3n", back: "Atr\xE1s" },
|
|
1006
|
+
richEditor: { placeholder: "Escribe algo\u2026", editorLabel: "Editor de texto enriquecido" },
|
|
1007
|
+
copy: { label: "Copiar" },
|
|
1008
|
+
emojiPicker: { searchPlaceholder: "Buscar emoji", emptyText: "No se encontraron emojis", addReaction: "A\xF1adir reacci\xF3n" },
|
|
1009
|
+
sidebar: { searchPlaceholder: "Buscar", primary: "Navegaci\xF3n principal" },
|
|
1010
|
+
imageViewer: { reset: "Restablecer", download: "Descargar" }
|
|
935
1011
|
};
|
|
936
1012
|
var ptBR = {
|
|
937
1013
|
locale: "pt-BR",
|
|
@@ -955,13 +1031,15 @@ var ptBR = {
|
|
|
955
1031
|
},
|
|
956
1032
|
timePicker: { am: "AM", pm: "PM" },
|
|
957
1033
|
pagination: { previous: "Anterior", next: "Pr\xF3ximo" },
|
|
958
|
-
modal: { close: "Fechar" },
|
|
1034
|
+
modal: { close: "Fechar", maximize: "Maximizar", restore: "Restaurar" },
|
|
1035
|
+
select: { placeholder: "Selecionar" },
|
|
1036
|
+
counterInput: { decrease: "Diminuir", increase: "Aumentar" },
|
|
959
1037
|
drawer: { close: "Fechar" },
|
|
960
1038
|
alert: { dismiss: "Fechar" },
|
|
961
1039
|
banner: { dismiss: "Fechar" },
|
|
962
1040
|
toast: { dismiss: "Fechar" },
|
|
963
1041
|
fileUpload: { clickToUpload: "Clique para enviar", orDragAndDrop: "ou arraste e solte" },
|
|
964
|
-
imageUpload: { label: "Enviar imagem", remove: "Remover" },
|
|
1042
|
+
imageUpload: { label: "Enviar imagem", remove: "Remover", hint: "PNG ou JPG, at\xE9 5 MB" },
|
|
965
1043
|
passwordStrength: { weak: "Fraca", fair: "Razo\xE1vel", good: "Boa", strong: "Forte" },
|
|
966
1044
|
commandMenu: {
|
|
967
1045
|
placeholder: "Digite um comando ou pesquise\u2026",
|
|
@@ -1024,8 +1102,17 @@ var ptBR = {
|
|
|
1024
1102
|
previous: "Anterior",
|
|
1025
1103
|
next: "Pr\xF3ximo",
|
|
1026
1104
|
pageRange: "{from}\u2013{to} de {total}",
|
|
1027
|
-
perPage: "{size} / p\xE1gina"
|
|
1028
|
-
|
|
1105
|
+
perPage: "{size} / p\xE1gina",
|
|
1106
|
+
selectRow: "Selecionar linha",
|
|
1107
|
+
selectAll: "Selecionar tudo"
|
|
1108
|
+
},
|
|
1109
|
+
wizard: { back: "\u041D\u0430\u0437\u0430\u0434", next: "\u0414\u0430\u043B\u0435\u0435", finish: "\u0413\u043E\u0442\u043E\u0432\u043E" },
|
|
1110
|
+
a11y: { zoomIn: "Ampliar", zoomOut: "Reduzir", rotate: "Girar", collapseStart: "Recolher painel inicial", collapseEnd: "Recolher painel final", bulkActions: "A\xE7\xF5es em massa", clearSelection: "Limpar sele\xE7\xE3o", back: "Voltar" },
|
|
1111
|
+
richEditor: { placeholder: "Escreva algo\u2026", editorLabel: "Editor de texto rico" },
|
|
1112
|
+
copy: { label: "Copiar" },
|
|
1113
|
+
emojiPicker: { searchPlaceholder: "Pesquisar emoji", emptyText: "Nenhum emoji encontrado", addReaction: "Adicionar rea\xE7\xE3o" },
|
|
1114
|
+
sidebar: { searchPlaceholder: "Pesquisar", primary: "Navega\xE7\xE3o principal" },
|
|
1115
|
+
imageViewer: { reset: "Redefinir", download: "Baixar" }
|
|
1029
1116
|
};
|
|
1030
1117
|
var ruRU = {
|
|
1031
1118
|
locale: "ru-RU",
|
|
@@ -1049,13 +1136,15 @@ var ruRU = {
|
|
|
1049
1136
|
},
|
|
1050
1137
|
timePicker: { am: "AM", pm: "PM" },
|
|
1051
1138
|
pagination: { previous: "\u041D\u0430\u0437\u0430\u0434", next: "\u0412\u043F\u0435\u0440\u0451\u0434" },
|
|
1052
|
-
modal: { close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" },
|
|
1139
|
+
modal: { close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", maximize: "\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C", restore: "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C" },
|
|
1140
|
+
select: { placeholder: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" },
|
|
1141
|
+
counterInput: { decrease: "\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C", increase: "\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C" },
|
|
1053
1142
|
drawer: { close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" },
|
|
1054
1143
|
alert: { dismiss: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" },
|
|
1055
1144
|
banner: { dismiss: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" },
|
|
1056
1145
|
toast: { dismiss: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" },
|
|
1057
1146
|
fileUpload: { clickToUpload: "\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438", orDragAndDrop: "\u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435" },
|
|
1058
|
-
imageUpload: { label: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", remove: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C" },
|
|
1147
|
+
imageUpload: { label: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", remove: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", hint: "PNG \u0438\u043B\u0438 JPG, \u0434\u043E 5 \u041C\u0411" },
|
|
1059
1148
|
passwordStrength: { weak: "\u0421\u043B\u0430\u0431\u044B\u0439", fair: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439", good: "\u0425\u043E\u0440\u043E\u0448\u0438\u0439", strong: "\u041D\u0430\u0434\u0451\u0436\u043D\u044B\u0439" },
|
|
1060
1149
|
commandMenu: {
|
|
1061
1150
|
placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0438\u043B\u0438 \u043F\u043E\u0438\u0441\u043A\u2026",
|
|
@@ -1118,8 +1207,17 @@ var ruRU = {
|
|
|
1118
1207
|
previous: "\u041D\u0430\u0437\u0430\u0434",
|
|
1119
1208
|
next: "\u0412\u043F\u0435\u0440\u0451\u0434",
|
|
1120
1209
|
pageRange: "{from}\u2013{to} \u0438\u0437 {total}",
|
|
1121
|
-
perPage: "{size} / \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"
|
|
1122
|
-
|
|
1210
|
+
perPage: "{size} / \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",
|
|
1211
|
+
selectRow: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443",
|
|
1212
|
+
selectAll: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"
|
|
1213
|
+
},
|
|
1214
|
+
wizard: { back: "\u0631\u062C\u0648\u0639", next: "\u0627\u0644\u062A\u0627\u0644\u064A", finish: "\u0625\u0646\u0647\u0627\u0621" },
|
|
1215
|
+
a11y: { zoomIn: "\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C", zoomOut: "\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C", rotate: "\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C", collapseStart: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u0443\u044E \u043F\u0430\u043D\u0435\u043B\u044C", collapseEnd: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043A\u043E\u043D\u0435\u0447\u043D\u0443\u044E \u043F\u0430\u043D\u0435\u043B\u044C", bulkActions: "\u041C\u0430\u0441\u0441\u043E\u0432\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", clearSelection: "\u0421\u043D\u044F\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435", back: "\u041D\u0430\u0437\u0430\u0434" },
|
|
1216
|
+
richEditor: { placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\u2026", editorLabel: "\u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430" },
|
|
1217
|
+
copy: { label: "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C" },
|
|
1218
|
+
emojiPicker: { searchPlaceholder: "\u041F\u043E\u0438\u0441\u043A \u044D\u043C\u043E\u0434\u0437\u0438", emptyText: "\u042D\u043C\u043E\u0434\u0437\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B", addReaction: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0430\u043A\u0446\u0438\u044E" },
|
|
1219
|
+
sidebar: { searchPlaceholder: "\u041F\u043E\u0438\u0441\u043A", primary: "\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044F" },
|
|
1220
|
+
imageViewer: { reset: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C", download: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C" }
|
|
1123
1221
|
};
|
|
1124
1222
|
var arSA = {
|
|
1125
1223
|
locale: "ar-SA",
|
|
@@ -1143,13 +1241,15 @@ var arSA = {
|
|
|
1143
1241
|
},
|
|
1144
1242
|
timePicker: { am: "\u0635", pm: "\u0645" },
|
|
1145
1243
|
pagination: { previous: "\u0627\u0644\u0633\u0627\u0628\u0642", next: "\u0627\u0644\u062A\u0627\u0644\u064A" },
|
|
1146
|
-
modal: { close: "\u0625\u063A\u0644\u0627\u0642" },
|
|
1244
|
+
modal: { close: "\u0625\u063A\u0644\u0627\u0642", maximize: "\u062A\u0643\u0628\u064A\u0631", restore: "\u0627\u0633\u062A\u0639\u0627\u062F\u0629" },
|
|
1245
|
+
select: { placeholder: "\u062A\u062D\u062F\u064A\u062F" },
|
|
1246
|
+
counterInput: { decrease: "\u062A\u0642\u0644\u064A\u0644", increase: "\u0632\u064A\u0627\u062F\u0629" },
|
|
1147
1247
|
drawer: { close: "\u0625\u063A\u0644\u0627\u0642" },
|
|
1148
1248
|
alert: { dismiss: "\u0625\u063A\u0644\u0627\u0642" },
|
|
1149
1249
|
banner: { dismiss: "\u0625\u063A\u0644\u0627\u0642" },
|
|
1150
1250
|
toast: { dismiss: "\u0625\u063A\u0644\u0627\u0642" },
|
|
1151
1251
|
fileUpload: { clickToUpload: "\u0627\u0646\u0642\u0631 \u0644\u0644\u0631\u0641\u0639", orDragAndDrop: "\u0623\u0648 \u0627\u0633\u062D\u0628 \u0648\u0623\u0641\u0644\u062A" },
|
|
1152
|
-
imageUpload: { label: "\u0631\u0641\u0639 \u0635\u0648\u0631\u0629", remove: "\u0625\u0632\u0627\u0644\u0629" },
|
|
1252
|
+
imageUpload: { label: "\u0631\u0641\u0639 \u0635\u0648\u0631\u0629", remove: "\u0625\u0632\u0627\u0644\u0629", hint: "PNG \u0623\u0648 JPG\u060C \u062D\u062A\u0649 5 \u0645\u064A\u062C\u0627\u0628\u0627\u064A\u062A" },
|
|
1153
1253
|
passwordStrength: { weak: "\u0636\u0639\u064A\u0641", fair: "\u0645\u0642\u0628\u0648\u0644", good: "\u062C\u064A\u062F", strong: "\u0642\u0648\u064A" },
|
|
1154
1254
|
commandMenu: {
|
|
1155
1255
|
placeholder: "\u0627\u0643\u062A\u0628 \u0623\u0645\u0631\u064B\u0627 \u0623\u0648 \u0627\u0628\u062D\u062B\u2026",
|
|
@@ -1212,8 +1312,17 @@ var arSA = {
|
|
|
1212
1312
|
previous: "\u0627\u0644\u0633\u0627\u0628\u0642",
|
|
1213
1313
|
next: "\u0627\u0644\u062A\u0627\u0644\u064A",
|
|
1214
1314
|
pageRange: "{from}\u2013{to} \u0645\u0646 {total}",
|
|
1215
|
-
perPage: "{size} / \u0635\u0641\u062D\u0629"
|
|
1216
|
-
|
|
1315
|
+
perPage: "{size} / \u0635\u0641\u062D\u0629",
|
|
1316
|
+
selectRow: "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0635\u0641",
|
|
1317
|
+
selectAll: "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644"
|
|
1318
|
+
},
|
|
1319
|
+
wizard: { back: "Indietro", next: "Avanti", finish: "Fine" },
|
|
1320
|
+
a11y: { zoomIn: "\u062A\u0643\u0628\u064A\u0631", zoomOut: "\u062A\u0635\u063A\u064A\u0631", rotate: "\u062A\u062F\u0648\u064A\u0631", collapseStart: "\u0637\u064A \u0627\u0644\u0644\u0648\u062D\u0629 \u0627\u0644\u0623\u0648\u0644\u0649", collapseEnd: "\u0637\u064A \u0627\u0644\u0644\u0648\u062D\u0629 \u0627\u0644\u0623\u062E\u064A\u0631\u0629", bulkActions: "\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u062C\u0645\u0627\u0639\u064A\u0629", clearSelection: "\u0625\u0644\u063A\u0627\u0621 \u0627\u0644\u062A\u062D\u062F\u064A\u062F", back: "\u0631\u062C\u0648\u0639" },
|
|
1321
|
+
richEditor: { placeholder: "\u0627\u0643\u062A\u0628 \u0634\u064A\u0626\u064B\u0627\u2026", editorLabel: "\u0645\u062D\u0631\u0631 \u0646\u0635 \u0645\u0646\u0633\u0642" },
|
|
1322
|
+
copy: { label: "\u0646\u0633\u062E" },
|
|
1323
|
+
emojiPicker: { searchPlaceholder: "\u0627\u0644\u0628\u062D\u062B \u0639\u0646 \u0631\u0645\u0632 \u062A\u0639\u0628\u064A\u0631\u064A", emptyText: "\u0644\u0645 \u064A\u062A\u0645 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u0631\u0645\u0648\u0632", addReaction: "\u0625\u0636\u0627\u0641\u0629 \u062A\u0641\u0627\u0639\u0644" },
|
|
1324
|
+
sidebar: { searchPlaceholder: "\u0628\u062D\u062B", primary: "\u0627\u0644\u062A\u0646\u0642\u0644 \u0627\u0644\u0631\u0626\u064A\u0633\u064A" },
|
|
1325
|
+
imageViewer: { reset: "\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646", download: "\u062A\u0646\u0632\u064A\u0644" }
|
|
1217
1326
|
};
|
|
1218
1327
|
var itIT = {
|
|
1219
1328
|
locale: "it-IT",
|
|
@@ -1237,13 +1346,15 @@ var itIT = {
|
|
|
1237
1346
|
},
|
|
1238
1347
|
timePicker: { am: "AM", pm: "PM" },
|
|
1239
1348
|
pagination: { previous: "Precedente", next: "Successivo" },
|
|
1240
|
-
modal: { close: "Chiudi" },
|
|
1349
|
+
modal: { close: "Chiudi", maximize: "Ingrandisci", restore: "Ripristina" },
|
|
1350
|
+
select: { placeholder: "Seleziona" },
|
|
1351
|
+
counterInput: { decrease: "Diminuisci", increase: "Aumenta" },
|
|
1241
1352
|
drawer: { close: "Chiudi" },
|
|
1242
1353
|
alert: { dismiss: "Chiudi" },
|
|
1243
1354
|
banner: { dismiss: "Chiudi" },
|
|
1244
1355
|
toast: { dismiss: "Chiudi" },
|
|
1245
1356
|
fileUpload: { clickToUpload: "Clicca per caricare", orDragAndDrop: "o trascina qui" },
|
|
1246
|
-
imageUpload: { label: "Carica immagine", remove: "Rimuovi" },
|
|
1357
|
+
imageUpload: { label: "Carica immagine", remove: "Rimuovi", hint: "PNG o JPG, fino a 5 MB" },
|
|
1247
1358
|
passwordStrength: { weak: "Debole", fair: "Discreta", good: "Buona", strong: "Forte" },
|
|
1248
1359
|
commandMenu: {
|
|
1249
1360
|
placeholder: "Digita un comando o cerca\u2026",
|
|
@@ -1306,8 +1417,17 @@ var itIT = {
|
|
|
1306
1417
|
previous: "Precedente",
|
|
1307
1418
|
next: "Successivo",
|
|
1308
1419
|
pageRange: "{from}\u2013{to} di {total}",
|
|
1309
|
-
perPage: "{size} / pagina"
|
|
1310
|
-
|
|
1420
|
+
perPage: "{size} / pagina",
|
|
1421
|
+
selectRow: "Seleziona riga",
|
|
1422
|
+
selectAll: "Seleziona tutto"
|
|
1423
|
+
},
|
|
1424
|
+
wizard: { back: "Terug", next: "Volgende", finish: "Voltooien" },
|
|
1425
|
+
a11y: { zoomIn: "Ingrandisci", zoomOut: "Riduci", rotate: "Ruota", collapseStart: "Comprimi pannello iniziale", collapseEnd: "Comprimi pannello finale", bulkActions: "Azioni multiple", clearSelection: "Cancella selezione", back: "Indietro" },
|
|
1426
|
+
richEditor: { placeholder: "Scrivi qualcosa\u2026", editorLabel: "Editor di testo formattato" },
|
|
1427
|
+
copy: { label: "Copia" },
|
|
1428
|
+
emojiPicker: { searchPlaceholder: "Cerca emoji", emptyText: "Nessun emoji trovato", addReaction: "Aggiungi reazione" },
|
|
1429
|
+
sidebar: { searchPlaceholder: "Cerca", primary: "Navigazione principale" },
|
|
1430
|
+
imageViewer: { reset: "Reimposta", download: "Scarica" }
|
|
1311
1431
|
};
|
|
1312
1432
|
var nlNL = {
|
|
1313
1433
|
locale: "nl-NL",
|
|
@@ -1331,13 +1451,15 @@ var nlNL = {
|
|
|
1331
1451
|
},
|
|
1332
1452
|
timePicker: { am: "AM", pm: "PM" },
|
|
1333
1453
|
pagination: { previous: "Vorige", next: "Volgende" },
|
|
1334
|
-
modal: { close: "Sluiten" },
|
|
1454
|
+
modal: { close: "Sluiten", maximize: "maximaliseren", restore: "Herstellen" },
|
|
1455
|
+
select: { placeholder: "Selecteren" },
|
|
1456
|
+
counterInput: { decrease: "Verlagen", increase: "Verhogen" },
|
|
1335
1457
|
drawer: { close: "Sluiten" },
|
|
1336
1458
|
alert: { dismiss: "Sluiten" },
|
|
1337
1459
|
banner: { dismiss: "Sluiten" },
|
|
1338
1460
|
toast: { dismiss: "Sluiten" },
|
|
1339
1461
|
fileUpload: { clickToUpload: "Klik om te uploaden", orDragAndDrop: "of sleep hierheen" },
|
|
1340
|
-
imageUpload: { label: "Afbeelding uploaden", remove: "Verwijderen" },
|
|
1462
|
+
imageUpload: { label: "Afbeelding uploaden", remove: "Verwijderen", hint: "PNG of JPG, max. 5 MB" },
|
|
1341
1463
|
passwordStrength: { weak: "Zwak", fair: "Redelijk", good: "Goed", strong: "Sterk" },
|
|
1342
1464
|
commandMenu: {
|
|
1343
1465
|
placeholder: "Typ een opdracht of zoek\u2026",
|
|
@@ -1400,8 +1522,17 @@ var nlNL = {
|
|
|
1400
1522
|
previous: "Vorige",
|
|
1401
1523
|
next: "Volgende",
|
|
1402
1524
|
pageRange: "{from}\u2013{to} van {total}",
|
|
1403
|
-
perPage: "{size} / pagina"
|
|
1404
|
-
|
|
1525
|
+
perPage: "{size} / pagina",
|
|
1526
|
+
selectRow: "Rij selecteren",
|
|
1527
|
+
selectAll: "Alles selecteren"
|
|
1528
|
+
},
|
|
1529
|
+
wizard: { back: "Wstecz", next: "Dalej", finish: "Zako\u0144cz" },
|
|
1530
|
+
a11y: { zoomIn: "Inzoomen", zoomOut: "Uitzoomen", rotate: "Roteren", collapseStart: "Startpaneel samenvouwen", collapseEnd: "Eindpaneel samenvouwen", bulkActions: "Bulkacties", clearSelection: "Selectie wissen", back: "Terug" },
|
|
1531
|
+
richEditor: { placeholder: "Schrijf iets\u2026", editorLabel: "Rich text-editor" },
|
|
1532
|
+
copy: { label: "Kopi\xEBren" },
|
|
1533
|
+
emojiPicker: { searchPlaceholder: "Emoji zoeken", emptyText: "Geen emoji gevonden", addReaction: "Reactie toevoegen" },
|
|
1534
|
+
sidebar: { searchPlaceholder: "Zoeken", primary: "Hoofdnavigatie" },
|
|
1535
|
+
imageViewer: { reset: "Herstellen", download: "Downloaden" }
|
|
1405
1536
|
};
|
|
1406
1537
|
var plPL = {
|
|
1407
1538
|
locale: "pl-PL",
|
|
@@ -1425,13 +1556,15 @@ var plPL = {
|
|
|
1425
1556
|
},
|
|
1426
1557
|
timePicker: { am: "AM", pm: "PM" },
|
|
1427
1558
|
pagination: { previous: "Poprzednia", next: "Nast\u0119pna" },
|
|
1428
|
-
modal: { close: "Zamknij" },
|
|
1559
|
+
modal: { close: "Zamknij", maximize: "Maksymalizuj", restore: "Przywr\xF3\u0107" },
|
|
1560
|
+
select: { placeholder: "Wybierz" },
|
|
1561
|
+
counterInput: { decrease: "Zmniejsz", increase: "Zwi\u0119ksz" },
|
|
1429
1562
|
drawer: { close: "Zamknij" },
|
|
1430
1563
|
alert: { dismiss: "Zamknij" },
|
|
1431
1564
|
banner: { dismiss: "Zamknij" },
|
|
1432
1565
|
toast: { dismiss: "Zamknij" },
|
|
1433
1566
|
fileUpload: { clickToUpload: "Kliknij, aby przes\u0142a\u0107", orDragAndDrop: "lub przeci\u0105gnij i upu\u015B\u0107" },
|
|
1434
|
-
imageUpload: { label: "Prze\u015Blij obraz", remove: "Usu\u0144" },
|
|
1567
|
+
imageUpload: { label: "Prze\u015Blij obraz", remove: "Usu\u0144", hint: "PNG lub JPG, do 5 MB" },
|
|
1435
1568
|
passwordStrength: { weak: "S\u0142abe", fair: "\u015Arednie", good: "Dobre", strong: "Silne" },
|
|
1436
1569
|
commandMenu: {
|
|
1437
1570
|
placeholder: "Wpisz polecenie lub szukaj\u2026",
|
|
@@ -1494,8 +1627,17 @@ var plPL = {
|
|
|
1494
1627
|
previous: "Poprzednia",
|
|
1495
1628
|
next: "Nast\u0119pna",
|
|
1496
1629
|
pageRange: "{from}\u2013{to} z {total}",
|
|
1497
|
-
perPage: "{size} / strona"
|
|
1498
|
-
|
|
1630
|
+
perPage: "{size} / strona",
|
|
1631
|
+
selectRow: "Zaznacz wiersz",
|
|
1632
|
+
selectAll: "Zaznacz wszystko"
|
|
1633
|
+
},
|
|
1634
|
+
wizard: { back: "Geri", next: "\u0130leri", finish: "Bitir" },
|
|
1635
|
+
a11y: { zoomIn: "Powi\u0119ksz", zoomOut: "Pomniejsz", rotate: "Obr\xF3\u0107", collapseStart: "Zwi\u0144 panel pocz\u0105tkowy", collapseEnd: "Zwi\u0144 panel ko\u0144cowy", bulkActions: "Akcje zbiorcze", clearSelection: "Wyczy\u015B\u0107 zaznaczenie", back: "Wstecz" },
|
|
1636
|
+
richEditor: { placeholder: "Wpisz co\u015B\u2026", editorLabel: "Edytor tekstu sformatowanego" },
|
|
1637
|
+
copy: { label: "Kopiuj" },
|
|
1638
|
+
emojiPicker: { searchPlaceholder: "Szukaj emoji", emptyText: "Nie znaleziono emoji", addReaction: "Dodaj reakcj\u0119" },
|
|
1639
|
+
sidebar: { searchPlaceholder: "Szukaj", primary: "Nawigacja g\u0142\xF3wna" },
|
|
1640
|
+
imageViewer: { reset: "Resetuj", download: "Pobierz" }
|
|
1499
1641
|
};
|
|
1500
1642
|
var trTR = {
|
|
1501
1643
|
locale: "tr-TR",
|
|
@@ -1519,13 +1661,15 @@ var trTR = {
|
|
|
1519
1661
|
},
|
|
1520
1662
|
timePicker: { am: "\xD6\xD6", pm: "\xD6S" },
|
|
1521
1663
|
pagination: { previous: "\xD6nceki", next: "Sonraki" },
|
|
1522
|
-
modal: { close: "Kapat" },
|
|
1664
|
+
modal: { close: "Kapat", maximize: "Ekran\u0131 kapla", restore: "Geri y\xFCkle" },
|
|
1665
|
+
select: { placeholder: "Se\xE7" },
|
|
1666
|
+
counterInput: { decrease: "Azalt", increase: "Art\u0131r" },
|
|
1523
1667
|
drawer: { close: "Kapat" },
|
|
1524
1668
|
alert: { dismiss: "Kapat" },
|
|
1525
1669
|
banner: { dismiss: "Kapat" },
|
|
1526
1670
|
toast: { dismiss: "Kapat" },
|
|
1527
1671
|
fileUpload: { clickToUpload: "Y\xFCklemek i\xE7in t\u0131klay\u0131n", orDragAndDrop: "veya s\xFCr\xFCkleyip b\u0131rak\u0131n" },
|
|
1528
|
-
imageUpload: { label: "G\xF6rsel y\xFCkle", remove: "Kald\u0131r" },
|
|
1672
|
+
imageUpload: { label: "G\xF6rsel y\xFCkle", remove: "Kald\u0131r", hint: "PNG veya JPG, en fazla 5 MB" },
|
|
1529
1673
|
passwordStrength: { weak: "Zay\u0131f", fair: "Orta", good: "\u0130yi", strong: "G\xFC\xE7l\xFC" },
|
|
1530
1674
|
commandMenu: {
|
|
1531
1675
|
placeholder: "Bir komut yaz\u0131n veya aray\u0131n\u2026",
|
|
@@ -1588,8 +1732,17 @@ var trTR = {
|
|
|
1588
1732
|
previous: "\xD6nceki",
|
|
1589
1733
|
next: "Sonraki",
|
|
1590
1734
|
pageRange: "{total} \xF6\u011Feden {from}\u2013{to}",
|
|
1591
|
-
perPage: "{size} / sayfa"
|
|
1592
|
-
|
|
1735
|
+
perPage: "{size} / sayfa",
|
|
1736
|
+
selectRow: "Sat\u0131r\u0131 se\xE7",
|
|
1737
|
+
selectAll: "T\xFCm\xFCn\xFC se\xE7"
|
|
1738
|
+
},
|
|
1739
|
+
wizard: { back: "Quay l\u1EA1i", next: "Ti\u1EBFp theo", finish: "Ho\xE0n t\u1EA5t" },
|
|
1740
|
+
a11y: { zoomIn: "Yak\u0131nla\u015Ft\u0131r", zoomOut: "Uzakla\u015Ft\u0131r", rotate: "D\xF6nd\xFCr", collapseStart: "Ba\u015Flang\u0131\xE7 panelini daralt", collapseEnd: "Biti\u015F panelini daralt", bulkActions: "Toplu i\u015Flemler", clearSelection: "Se\xE7imi temizle", back: "Geri" },
|
|
1741
|
+
richEditor: { placeholder: "Bir \u015Feyler yaz\u0131n\u2026", editorLabel: "Zengin metin d\xFCzenleyici" },
|
|
1742
|
+
copy: { label: "Kopyala" },
|
|
1743
|
+
emojiPicker: { searchPlaceholder: "Emoji ara", emptyText: "Emoji bulunamad\u0131", addReaction: "Tepki ekle" },
|
|
1744
|
+
sidebar: { searchPlaceholder: "Ara", primary: "Ana gezinme" },
|
|
1745
|
+
imageViewer: { reset: "S\u0131f\u0131rla", download: "\u0130ndir" }
|
|
1593
1746
|
};
|
|
1594
1747
|
var viVN = {
|
|
1595
1748
|
locale: "vi-VN",
|
|
@@ -1613,13 +1766,15 @@ var viVN = {
|
|
|
1613
1766
|
},
|
|
1614
1767
|
timePicker: { am: "SA", pm: "CH" },
|
|
1615
1768
|
pagination: { previous: "Tr\u01B0\u1EDBc", next: "Sau" },
|
|
1616
|
-
modal: { close: "\u0110\xF3ng" },
|
|
1769
|
+
modal: { close: "\u0110\xF3ng", maximize: "Ph\xF3ng to", restore: "Kh\xF4i ph\u1EE5c" },
|
|
1770
|
+
select: { placeholder: "Ch\u1ECDn" },
|
|
1771
|
+
counterInput: { decrease: "Gi\u1EA3m", increase: "T\u0103ng" },
|
|
1617
1772
|
drawer: { close: "\u0110\xF3ng" },
|
|
1618
1773
|
alert: { dismiss: "\u0110\xF3ng" },
|
|
1619
1774
|
banner: { dismiss: "\u0110\xF3ng" },
|
|
1620
1775
|
toast: { dismiss: "\u0110\xF3ng" },
|
|
1621
1776
|
fileUpload: { clickToUpload: "Nh\u1EA5p \u0111\u1EC3 t\u1EA3i l\xEAn", orDragAndDrop: "ho\u1EB7c k\xE9o v\xE0 th\u1EA3" },
|
|
1622
|
-
imageUpload: { label: "T\u1EA3i \u1EA3nh l\xEAn", remove: "X\xF3a" },
|
|
1777
|
+
imageUpload: { label: "T\u1EA3i \u1EA3nh l\xEAn", remove: "X\xF3a", hint: "PNG ho\u1EB7c JPG, t\u1ED1i \u0111a 5MB" },
|
|
1623
1778
|
passwordStrength: { weak: "Y\u1EBFu", fair: "Trung b\xECnh", good: "T\u1ED1t", strong: "M\u1EA1nh" },
|
|
1624
1779
|
commandMenu: {
|
|
1625
1780
|
placeholder: "Nh\u1EADp l\u1EC7nh ho\u1EB7c t\xECm ki\u1EBFm\u2026",
|
|
@@ -1682,8 +1837,17 @@ var viVN = {
|
|
|
1682
1837
|
previous: "Tr\u01B0\u1EDBc",
|
|
1683
1838
|
next: "Sau",
|
|
1684
1839
|
pageRange: "{from}\u2013{to} trong {total}",
|
|
1685
|
-
perPage: "{size} / trang"
|
|
1686
|
-
|
|
1840
|
+
perPage: "{size} / trang",
|
|
1841
|
+
selectRow: "Ch\u1ECDn h\xE0ng",
|
|
1842
|
+
selectAll: "Ch\u1ECDn t\u1EA5t c\u1EA3"
|
|
1843
|
+
},
|
|
1844
|
+
wizard: { back: "Kembali", next: "Berikutnya", finish: "Selesai" },
|
|
1845
|
+
a11y: { zoomIn: "Ph\xF3ng to", zoomOut: "Thu nh\u1ECF", rotate: "Xoay", collapseStart: "Thu g\u1ECDn b\u1EA3ng \u0111\u1EA7u", collapseEnd: "Thu g\u1ECDn b\u1EA3ng cu\u1ED1i", bulkActions: "Thao t\xE1c h\xE0ng lo\u1EA1t", clearSelection: "B\u1ECF ch\u1ECDn", back: "Quay l\u1EA1i" },
|
|
1846
|
+
richEditor: { placeholder: "Vi\u1EBFt n\u1ED9i dung\u2026", editorLabel: "Tr\xECnh so\u1EA1n th\u1EA3o v\u0103n b\u1EA3n" },
|
|
1847
|
+
copy: { label: "Sao ch\xE9p" },
|
|
1848
|
+
emojiPicker: { searchPlaceholder: "T\xECm emoji", emptyText: "Kh\xF4ng t\xECm th\u1EA5y emoji", addReaction: "Th\xEAm c\u1EA3m x\xFAc" },
|
|
1849
|
+
sidebar: { searchPlaceholder: "T\xECm ki\u1EBFm", primary: "\u0110i\u1EC1u h\u01B0\u1EDBng ch\xEDnh" },
|
|
1850
|
+
imageViewer: { reset: "\u0110\u1EB7t l\u1EA1i", download: "T\u1EA3i xu\u1ED1ng" }
|
|
1687
1851
|
};
|
|
1688
1852
|
var idID = {
|
|
1689
1853
|
locale: "id-ID",
|
|
@@ -1707,13 +1871,15 @@ var idID = {
|
|
|
1707
1871
|
},
|
|
1708
1872
|
timePicker: { am: "AM", pm: "PM" },
|
|
1709
1873
|
pagination: { previous: "Sebelumnya", next: "Berikutnya" },
|
|
1710
|
-
modal: { close: "Tutup" },
|
|
1874
|
+
modal: { close: "Tutup", maximize: "Maksimalkan", restore: "Pulihkan" },
|
|
1875
|
+
select: { placeholder: "Pilih" },
|
|
1876
|
+
counterInput: { decrease: "Kurangi", increase: "Tambah" },
|
|
1711
1877
|
drawer: { close: "Tutup" },
|
|
1712
1878
|
alert: { dismiss: "Tutup" },
|
|
1713
1879
|
banner: { dismiss: "Tutup" },
|
|
1714
1880
|
toast: { dismiss: "Tutup" },
|
|
1715
1881
|
fileUpload: { clickToUpload: "Klik untuk mengunggah", orDragAndDrop: "atau seret dan lepas" },
|
|
1716
|
-
imageUpload: { label: "Unggah gambar", remove: "Hapus" },
|
|
1882
|
+
imageUpload: { label: "Unggah gambar", remove: "Hapus", hint: "PNG atau JPG, maks. 5 MB" },
|
|
1717
1883
|
passwordStrength: { weak: "Lemah", fair: "Cukup", good: "Baik", strong: "Kuat" },
|
|
1718
1884
|
commandMenu: {
|
|
1719
1885
|
placeholder: "Ketik perintah atau cari\u2026",
|
|
@@ -1776,8 +1942,17 @@ var idID = {
|
|
|
1776
1942
|
previous: "Sebelumnya",
|
|
1777
1943
|
next: "Berikutnya",
|
|
1778
1944
|
pageRange: "{from}\u2013{to} dari {total}",
|
|
1779
|
-
perPage: "{size} / halaman"
|
|
1780
|
-
|
|
1945
|
+
perPage: "{size} / halaman",
|
|
1946
|
+
selectRow: "Pilih baris",
|
|
1947
|
+
selectAll: "Pilih semua"
|
|
1948
|
+
},
|
|
1949
|
+
wizard: { back: "Kembali", next: "Berikutnya", finish: "Selesai" },
|
|
1950
|
+
a11y: { zoomIn: "Perbesar", zoomOut: "Perkecil", rotate: "Putar", collapseStart: "Ciutkan panel awal", collapseEnd: "Ciutkan panel akhir", bulkActions: "Tindakan massal", clearSelection: "Hapus pilihan", back: "Kembali" },
|
|
1951
|
+
richEditor: { placeholder: "Tulis sesuatu\u2026", editorLabel: "Editor teks kaya" },
|
|
1952
|
+
copy: { label: "Salin" },
|
|
1953
|
+
emojiPicker: { searchPlaceholder: "Cari emoji", emptyText: "Emoji tidak ditemukan", addReaction: "Tambahkan reaksi" },
|
|
1954
|
+
sidebar: { searchPlaceholder: "Cari", primary: "Navigasi utama" },
|
|
1955
|
+
imageViewer: { reset: "Setel ulang", download: "Unduh" }
|
|
1781
1956
|
};
|
|
1782
1957
|
var locales = {
|
|
1783
1958
|
enUS,
|
|
@@ -1798,6 +1973,275 @@ var locales = {
|
|
|
1798
1973
|
viVN,
|
|
1799
1974
|
idID
|
|
1800
1975
|
};
|
|
1976
|
+
|
|
1977
|
+
// src/components/config/size.ts
|
|
1978
|
+
var SIZE_CONTRACTS = {
|
|
1979
|
+
/* ── 控件族:跟随全局档位,且自有档位 = 规范档位 ── */
|
|
1980
|
+
Button: {
|
|
1981
|
+
scale: ["tiny", "xsmall", "small", "medium", "large"],
|
|
1982
|
+
fallback: "medium",
|
|
1983
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" },
|
|
1984
|
+
tiers: { xsmall: "xsmall", small: "small", medium: "medium", large: "large" },
|
|
1985
|
+
// 同一个文件里还有 fancy / compact / link 三种按钮刻度(KDS §2.4 的显式附属动作)
|
|
1986
|
+
extraScales: [
|
|
1987
|
+
["small", "medium", "large"],
|
|
1988
|
+
["small", "medium"]
|
|
1989
|
+
]
|
|
1990
|
+
},
|
|
1991
|
+
ButtonGroup: {
|
|
1992
|
+
scale: ["small", "medium", "large"],
|
|
1993
|
+
fallback: "medium",
|
|
1994
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
1995
|
+
},
|
|
1996
|
+
Input: {
|
|
1997
|
+
scale: ["xsmall", "small", "medium", "large"],
|
|
1998
|
+
fallback: "medium",
|
|
1999
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" },
|
|
2000
|
+
tiers: { xsmall: "xsmall", small: "small", medium: "medium", large: "large" }
|
|
2001
|
+
},
|
|
2002
|
+
Select: {
|
|
2003
|
+
scale: ["xsmall", "small", "medium", "large"],
|
|
2004
|
+
fallback: "medium",
|
|
2005
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" },
|
|
2006
|
+
tiers: { xsmall: "xsmall", small: "small", medium: "medium", large: "large" }
|
|
2007
|
+
},
|
|
2008
|
+
Textarea: {
|
|
2009
|
+
scale: ["xsmall", "small", "medium", "large"],
|
|
2010
|
+
fallback: "medium",
|
|
2011
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2012
|
+
},
|
|
2013
|
+
AutoComplete: {
|
|
2014
|
+
scale: ["small", "medium", "large"],
|
|
2015
|
+
fallback: "medium",
|
|
2016
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2017
|
+
},
|
|
2018
|
+
Cascader: {
|
|
2019
|
+
scale: ["small", "medium", "large"],
|
|
2020
|
+
fallback: "medium",
|
|
2021
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2022
|
+
},
|
|
2023
|
+
SelectMenu: {
|
|
2024
|
+
scale: ["small", "medium", "large"],
|
|
2025
|
+
fallback: "medium",
|
|
2026
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2027
|
+
},
|
|
2028
|
+
CounterInput: {
|
|
2029
|
+
scale: ["small", "medium", "large"],
|
|
2030
|
+
fallback: "medium",
|
|
2031
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2032
|
+
},
|
|
2033
|
+
DigitInput: {
|
|
2034
|
+
scale: ["small", "medium", "large"],
|
|
2035
|
+
fallback: "medium",
|
|
2036
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2037
|
+
},
|
|
2038
|
+
CronEditor: {
|
|
2039
|
+
scale: ["small", "medium"],
|
|
2040
|
+
fallback: "medium",
|
|
2041
|
+
fromGlobal: { small: "small", medium: "medium", large: "medium" }
|
|
2042
|
+
},
|
|
2043
|
+
Checkbox: {
|
|
2044
|
+
scale: ["small", "medium", "large"],
|
|
2045
|
+
fallback: "medium",
|
|
2046
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2047
|
+
},
|
|
2048
|
+
Radio: {
|
|
2049
|
+
scale: ["small", "medium", "large"],
|
|
2050
|
+
fallback: "medium",
|
|
2051
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2052
|
+
},
|
|
2053
|
+
Switch: {
|
|
2054
|
+
scale: ["small", "medium", "large"],
|
|
2055
|
+
fallback: "medium",
|
|
2056
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2057
|
+
},
|
|
2058
|
+
Slider: {
|
|
2059
|
+
scale: ["small", "medium", "large"],
|
|
2060
|
+
fallback: "medium",
|
|
2061
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2062
|
+
},
|
|
2063
|
+
RangeSlider: {
|
|
2064
|
+
scale: ["sm", "md", "lg"],
|
|
2065
|
+
fallback: "md",
|
|
2066
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" },
|
|
2067
|
+
tiers: { small: "sm", medium: "md", large: "lg" }
|
|
2068
|
+
},
|
|
2069
|
+
ColorSlider: {
|
|
2070
|
+
scale: ["small", "medium", "large"],
|
|
2071
|
+
fallback: "medium",
|
|
2072
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2073
|
+
},
|
|
2074
|
+
HorizontalFilter: {
|
|
2075
|
+
scale: ["small", "medium"],
|
|
2076
|
+
fallback: "medium",
|
|
2077
|
+
fromGlobal: { small: "small", medium: "medium", large: "medium" }
|
|
2078
|
+
},
|
|
2079
|
+
CompactSelect: {
|
|
2080
|
+
scale: ["xsmall", "small", "medium"],
|
|
2081
|
+
fallback: "small",
|
|
2082
|
+
fromGlobal: { small: "small", medium: "medium", large: "medium" }
|
|
2083
|
+
},
|
|
2084
|
+
CompactSelectForInput: {
|
|
2085
|
+
scale: ["small", "medium", "large"],
|
|
2086
|
+
fallback: "small",
|
|
2087
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2088
|
+
},
|
|
2089
|
+
ColorDot: {
|
|
2090
|
+
scale: ["sm", "md", "lg"],
|
|
2091
|
+
fallback: "md",
|
|
2092
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" },
|
|
2093
|
+
tiers: { small: "sm", medium: "md", large: "lg" }
|
|
2094
|
+
},
|
|
2095
|
+
/* ── 信息/展示族:跟随全局档位,但档位刻意比控件少 ── */
|
|
2096
|
+
Badge: {
|
|
2097
|
+
scale: ["small", "medium"],
|
|
2098
|
+
fallback: "medium",
|
|
2099
|
+
fromGlobal: { small: "small", medium: "medium", large: "medium" },
|
|
2100
|
+
tiers: { xsmall: "small", small: "small", medium: "medium", large: "medium" }
|
|
2101
|
+
},
|
|
2102
|
+
StatusBadge: {
|
|
2103
|
+
scale: ["small", "medium"],
|
|
2104
|
+
fallback: "medium",
|
|
2105
|
+
fromGlobal: { small: "small", medium: "medium", large: "medium" }
|
|
2106
|
+
},
|
|
2107
|
+
ChartLegend: {
|
|
2108
|
+
scale: ["sm", "md"],
|
|
2109
|
+
fallback: "md",
|
|
2110
|
+
fromGlobal: { small: "sm", medium: "md", large: "md" }
|
|
2111
|
+
},
|
|
2112
|
+
ContentLabel: {
|
|
2113
|
+
scale: ["sm", "md"],
|
|
2114
|
+
fallback: "md",
|
|
2115
|
+
fromGlobal: { small: "sm", medium: "md", large: "md" }
|
|
2116
|
+
},
|
|
2117
|
+
GaugeBar: {
|
|
2118
|
+
scale: ["sm", "md", "lg"],
|
|
2119
|
+
fallback: "md",
|
|
2120
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" }
|
|
2121
|
+
},
|
|
2122
|
+
KeyIcon: {
|
|
2123
|
+
scale: ["xs", "sm", "md", "lg", "xl"],
|
|
2124
|
+
fallback: "md",
|
|
2125
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" }
|
|
2126
|
+
},
|
|
2127
|
+
Money: {
|
|
2128
|
+
scale: ["sm", "md", "lg", "big"],
|
|
2129
|
+
fallback: "md",
|
|
2130
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" }
|
|
2131
|
+
},
|
|
2132
|
+
StatusDot: {
|
|
2133
|
+
scale: ["xs", "sm", "md", "lg"],
|
|
2134
|
+
fallback: "sm",
|
|
2135
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" }
|
|
2136
|
+
},
|
|
2137
|
+
Item: {
|
|
2138
|
+
scale: ["default", "small", "xsmall"],
|
|
2139
|
+
fallback: "default",
|
|
2140
|
+
fromGlobal: { small: "small", medium: "default", large: "default" }
|
|
2141
|
+
},
|
|
2142
|
+
Toggle: {
|
|
2143
|
+
scale: ["small", "medium", "large"],
|
|
2144
|
+
fallback: "medium",
|
|
2145
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2146
|
+
},
|
|
2147
|
+
CopyButton: {
|
|
2148
|
+
scale: ["sm", "md", "lg"],
|
|
2149
|
+
fallback: "md",
|
|
2150
|
+
fromGlobal: { small: "sm", medium: "md", large: "lg" }
|
|
2151
|
+
},
|
|
2152
|
+
CheckboxGroup: {
|
|
2153
|
+
scale: ["small", "medium", "large"],
|
|
2154
|
+
fallback: "medium",
|
|
2155
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" },
|
|
2156
|
+
inherits: "Checkbox"
|
|
2157
|
+
},
|
|
2158
|
+
Statistic: {
|
|
2159
|
+
scale: ["small", "medium", "large"],
|
|
2160
|
+
fallback: "medium",
|
|
2161
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2162
|
+
},
|
|
2163
|
+
Descriptions: {
|
|
2164
|
+
scale: ["small", "medium", "large"],
|
|
2165
|
+
fallback: "medium",
|
|
2166
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2167
|
+
},
|
|
2168
|
+
List: {
|
|
2169
|
+
scale: ["small", "medium", "large"],
|
|
2170
|
+
fallback: "medium",
|
|
2171
|
+
fromGlobal: { small: "small", medium: "medium", large: "large" }
|
|
2172
|
+
},
|
|
2173
|
+
/* ── 组件自有刻度:不跟随全局档位,理由必须写清 ── */
|
|
2174
|
+
Avatar: {
|
|
2175
|
+
scale: ["20", "24", "32", "40", "48", "56", "64", "72", "80"],
|
|
2176
|
+
fallback: "40",
|
|
2177
|
+
exempt: "\u5C3A\u5BF8\u5373\u50CF\u7D20\u523B\u5EA6\uFF08\u540C MUI/Ant \u7684 Avatar size:number \u53E3\u5F84\uFF09\uFF0C9 \u6863\u8986\u76D6\u5934\u50CF\u5806\u53E0\u7684\u5168\u90E8\u7528\u6CD5\uFF1B\u63A5\u5168\u5C40\u6863\u4F4D\u4F1A\u628A 40px \u5934\u50CF\u5728\u4E24\u6863\u4E4B\u95F4\u8DF3\u53D8\uFF0C\u5C5E\u7834\u574F\u6027\u89C6\u89C9\u53D8\u66F4\uFF0C\u987B\u5355\u72EC\u51B3\u8BAE\u3002"
|
|
2178
|
+
},
|
|
2179
|
+
ActorAvatar: {
|
|
2180
|
+
scale: ["20", "24", "32", "40", "56"],
|
|
2181
|
+
fallback: "24",
|
|
2182
|
+
exempt: "\u540C Avatar\uFF1A\u50CF\u7D20\u523B\u5EA6\uFF0C\u4E0D\u662F\u63A7\u4EF6\u6863\u4F4D\u3002"
|
|
2183
|
+
},
|
|
2184
|
+
AvatarGroup: {
|
|
2185
|
+
scale: ["24", "32", "40", "48"],
|
|
2186
|
+
fallback: "40",
|
|
2187
|
+
exempt: "\u540C Avatar\uFF1A\u50CF\u7D20\u523B\u5EA6\uFF08\u51B3\u5B9A\u53E0\u52A0\u5934\u50CF\u4E0E +N \u5FBD\u6807\u7684\u76F4\u5F84\uFF09\u3002"
|
|
2188
|
+
},
|
|
2189
|
+
Space: {
|
|
2190
|
+
scale: ["none", "xs", "sm", "md", "lg", "xl", "2xl"],
|
|
2191
|
+
fallback: "md",
|
|
2192
|
+
exempt: "\u8FD9\u662F**\u95F4\u8DDD\u523B\u5EA6**\uFF08gap\uFF09\uFF0C\u4E0D\u662F\u63A7\u4EF6\u5C3A\u5BF8\uFF1BKDS \xA71.4 \u7684\u7A7A\u95F4\u9636\u4E0E\u63A7\u4EF6\u6863\u4F4D\u662F\u4E24\u6761\u8F74\u3002"
|
|
2193
|
+
},
|
|
2194
|
+
InputGroup: {
|
|
2195
|
+
scale: ["xsmall", "icon-xsmall", "icon-small"],
|
|
2196
|
+
fallback: "xsmall",
|
|
2197
|
+
exempt: "\u8BE5 size \u63CF\u8FF0\u7684\u662F\u7EC4\u5185\u5D4C\u6309\u94AE\u7684\u53D8\u4F53\uFF08\u542B icon-* \u5F62\u6001\uFF09\uFF0C\u4E0D\u662F\u63A7\u4EF6\u9AD8\u5EA6\u6863\u4F4D\u3002"
|
|
2198
|
+
},
|
|
2199
|
+
Drawer: {
|
|
2200
|
+
scale: ["default", "large"],
|
|
2201
|
+
fallback: "default",
|
|
2202
|
+
exempt: "\u5BBD\u5EA6\u6863\u4F4D\uFF08480/640/800 \u53E3\u5F84\uFF09\uFF0C\u4E0D\u662F\u63A7\u4EF6\u5C3A\u5BF8\uFF1B\u6D6E\u5C42\u5BBD\u5EA6\u7531\u4EFB\u52A1\u51B3\u5B9A\uFF0C\u4E0D\u968F\u5168\u5C40 size \u6F02\u79FB\u3002"
|
|
2203
|
+
},
|
|
2204
|
+
CircularProgress: {
|
|
2205
|
+
scale: ["number"],
|
|
2206
|
+
fallback: "number",
|
|
2207
|
+
exempt: "\u6570\u503C\u76F4\u5F84\uFF08px\uFF09\uFF0C\u7531\u8C03\u7528\u65B9\u6309\u5BB9\u5668\u7ED9\u5B9A\u3002"
|
|
2208
|
+
},
|
|
2209
|
+
ImageUpload: {
|
|
2210
|
+
scale: ["number"],
|
|
2211
|
+
fallback: "number",
|
|
2212
|
+
exempt: "\u6570\u503C\u8FB9\u957F\uFF08px\uFF09\uFF0C\u7531\u8C03\u7528\u65B9\u6309\u5BB9\u5668\u7ED9\u5B9A\u3002"
|
|
2213
|
+
},
|
|
2214
|
+
Rating: {
|
|
2215
|
+
scale: ["number"],
|
|
2216
|
+
fallback: "number",
|
|
2217
|
+
exempt: "\u6570\u503C\u661F\u6807\u5B57\u53F7\uFF08px\uFF09\u3002"
|
|
2218
|
+
},
|
|
2219
|
+
Spinner: {
|
|
2220
|
+
scale: ["number"],
|
|
2221
|
+
fallback: "number",
|
|
2222
|
+
exempt: "\u6570\u503C\u76F4\u5F84\uFF08px\uFF09\uFF1B\u547D\u540D\u6863\u4F4D\u89C1 SpinnerSize\uFF0C\u7531\u8C03\u7528\u65B9\u6309\u5BB9\u5668\u9009\u5B9A\u3002"
|
|
2223
|
+
},
|
|
2224
|
+
Splitter: {
|
|
2225
|
+
scale: ["number"],
|
|
2226
|
+
fallback: "number",
|
|
2227
|
+
exempt: "\u5206\u5272\u6761\u539A\u5EA6/\u5C3A\u5BF8\uFF0C\u63A5\u53D7\u6570\u503C\u6216 CSS \u957F\u5EA6\uFF0C\u5C5E\u5E03\u5C40\u91CF\u800C\u975E\u63A7\u4EF6\u6863\u4F4D\u3002"
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
function resolveSize(name, explicit, global) {
|
|
2231
|
+
const contract = SIZE_CONTRACTS[name];
|
|
2232
|
+
if (explicit !== void 0) return explicit;
|
|
2233
|
+
if (global && contract.fromGlobal) {
|
|
2234
|
+
const mapped = contract.fromGlobal[global];
|
|
2235
|
+
if (mapped !== void 0) return mapped;
|
|
2236
|
+
}
|
|
2237
|
+
return contract.fallback;
|
|
2238
|
+
}
|
|
2239
|
+
function tierOf(name, tier) {
|
|
2240
|
+
const contract = SIZE_CONTRACTS[name];
|
|
2241
|
+
if (contract.tiers?.[tier]) return contract.tiers[tier];
|
|
2242
|
+
const entry = Object.entries(contract.fromGlobal ?? {}).find(([g]) => g === tier);
|
|
2243
|
+
return entry ? entry[1] : void 0;
|
|
2244
|
+
}
|
|
1801
2245
|
var DEFAULT_CONFIG = {
|
|
1802
2246
|
locale: enUS,
|
|
1803
2247
|
size: void 0,
|
|
@@ -1873,6 +2317,7 @@ function ConfigProvider({
|
|
|
1873
2317
|
{
|
|
1874
2318
|
className: "klun-config",
|
|
1875
2319
|
dir: value.dir,
|
|
2320
|
+
lang: (value.locale ?? enUS).locale,
|
|
1876
2321
|
"data-theme": value.theme,
|
|
1877
2322
|
"data-mode": value.accent,
|
|
1878
2323
|
"data-radius": value.radius && value.radius !== "default" ? value.radius : void 0,
|
|
@@ -1899,6 +2344,41 @@ function useMappedSize(explicit, map, fallback) {
|
|
|
1899
2344
|
if (size !== void 0) return map[size];
|
|
1900
2345
|
return fallback;
|
|
1901
2346
|
}
|
|
2347
|
+
function useScaleSize(name, explicit) {
|
|
2348
|
+
const { size } = useContext(ConfigContext);
|
|
2349
|
+
return resolveSize(name, explicit, size);
|
|
2350
|
+
}
|
|
2351
|
+
function domDensity() {
|
|
2352
|
+
if (typeof document === "undefined") return void 0;
|
|
2353
|
+
const v = document.documentElement.dataset.density;
|
|
2354
|
+
return v === "compact" || v === "default" || v === "kk" ? v : void 0;
|
|
2355
|
+
}
|
|
2356
|
+
var densityObserver = null;
|
|
2357
|
+
var densityListeners = /* @__PURE__ */ new Set();
|
|
2358
|
+
function subscribeDensity(cb) {
|
|
2359
|
+
densityListeners.add(cb);
|
|
2360
|
+
if (!densityObserver && typeof MutationObserver !== "undefined" && typeof document !== "undefined") {
|
|
2361
|
+
densityObserver = new MutationObserver(() => {
|
|
2362
|
+
for (const l of densityListeners) l();
|
|
2363
|
+
});
|
|
2364
|
+
densityObserver.observe(document.documentElement, {
|
|
2365
|
+
attributes: true,
|
|
2366
|
+
attributeFilter: ["data-density"]
|
|
2367
|
+
});
|
|
2368
|
+
}
|
|
2369
|
+
return () => {
|
|
2370
|
+
densityListeners.delete(cb);
|
|
2371
|
+
if (!densityListeners.size && densityObserver) {
|
|
2372
|
+
densityObserver.disconnect();
|
|
2373
|
+
densityObserver = null;
|
|
2374
|
+
}
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
function useDensity() {
|
|
2378
|
+
const { density } = useContext(ConfigContext);
|
|
2379
|
+
const dom = useSyncExternalStore(subscribeDensity, domDensity, () => void 0);
|
|
2380
|
+
return density ?? dom ?? "default";
|
|
2381
|
+
}
|
|
1902
2382
|
var COMPACT_SIZE_MAP = { small: "small", medium: "medium", large: "medium" };
|
|
1903
2383
|
function Spinner({ className, size }) {
|
|
1904
2384
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1953,15 +2433,14 @@ var Button = forwardRef(function Button2(props, ref) {
|
|
|
1953
2433
|
size: _s2,
|
|
1954
2434
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1955
2435
|
loading: _l2,
|
|
1956
|
-
|
|
1957
|
-
type: _t,
|
|
2436
|
+
type: type2 = "button",
|
|
1958
2437
|
...rest2
|
|
1959
2438
|
} = props;
|
|
1960
2439
|
return /* @__PURE__ */ jsxs(
|
|
1961
2440
|
"button",
|
|
1962
2441
|
{
|
|
1963
2442
|
ref,
|
|
1964
|
-
type:
|
|
2443
|
+
type: type2,
|
|
1965
2444
|
disabled: disabled2 || loading,
|
|
1966
2445
|
"aria-busy": loading || void 0,
|
|
1967
2446
|
className: cx(
|
|
@@ -2018,7 +2497,7 @@ var Button = forwardRef(function Button2(props, ref) {
|
|
|
2018
2497
|
...rest2,
|
|
2019
2498
|
children: [
|
|
2020
2499
|
loading ? /* @__PURE__ */ jsx("span", { className: "klun-compact-button__icon", children: /* @__PURE__ */ jsx(Spinner, { className: "klun-compact-button__spinner" }) }) : icon2 ? /* @__PURE__ */ jsx("span", { className: "klun-compact-button__icon", children: icon2 }) : null,
|
|
2021
|
-
loading ? null : children2
|
|
2500
|
+
loading ? children2 != null ? /* @__PURE__ */ jsx("span", { className: "klun-compact-button__label-sr", children: children2 }) : null : children2
|
|
2022
2501
|
]
|
|
2023
2502
|
}
|
|
2024
2503
|
);
|
|
@@ -2196,15 +2675,18 @@ var CopyButton = forwardRef(
|
|
|
2196
2675
|
value,
|
|
2197
2676
|
children,
|
|
2198
2677
|
onCopied,
|
|
2199
|
-
size
|
|
2678
|
+
size: sizeProp,
|
|
2200
2679
|
variant = "ghost",
|
|
2201
2680
|
copyIcon = "ri-file-copy-line",
|
|
2202
2681
|
doneIcon = "ri-check-line",
|
|
2203
|
-
title
|
|
2682
|
+
title: titleProp,
|
|
2204
2683
|
onClick,
|
|
2205
2684
|
className,
|
|
2206
2685
|
...props
|
|
2207
2686
|
}, ref) {
|
|
2687
|
+
const size = useScaleSize("CopyButton", sizeProp);
|
|
2688
|
+
const { copy: localeCopy } = useLocale();
|
|
2689
|
+
const title = titleProp ?? localeCopy.label;
|
|
2208
2690
|
const [done, setDone] = useState(false);
|
|
2209
2691
|
const timer = useRef(null);
|
|
2210
2692
|
useEffect(() => () => clearTimeout(timer.current ?? void 0), []);
|
|
@@ -2245,7 +2727,7 @@ var CopyButton = forwardRef(
|
|
|
2245
2727
|
CopyButton.displayName = "CopyButton";
|
|
2246
2728
|
var Toggle = forwardRef(function Toggle2({
|
|
2247
2729
|
variant = "default",
|
|
2248
|
-
size
|
|
2730
|
+
size: sizeProp,
|
|
2249
2731
|
pressed,
|
|
2250
2732
|
defaultPressed = false,
|
|
2251
2733
|
onPressedChange,
|
|
@@ -2254,6 +2736,7 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
2254
2736
|
disabled,
|
|
2255
2737
|
...props
|
|
2256
2738
|
}, ref) {
|
|
2739
|
+
const size = useScaleSize("Toggle", sizeProp);
|
|
2257
2740
|
const [internal, setInternal] = useState(defaultPressed);
|
|
2258
2741
|
const controlled = pressed !== void 0;
|
|
2259
2742
|
const isPressed = controlled ? pressed : internal;
|
|
@@ -2547,7 +3030,8 @@ var AvatarGroup = forwardRef(function AvatarGroup2({ avatars = [], size = "40",
|
|
|
2547
3030
|
);
|
|
2548
3031
|
});
|
|
2549
3032
|
AvatarGroup.displayName = "AvatarGroup";
|
|
2550
|
-
var Badge = forwardRef(function Badge2({ color = "gray", variant = "lighter", size
|
|
3033
|
+
var Badge = forwardRef(function Badge2({ color = "gray", variant = "lighter", size: sizeProp, leadingIcon, dot = false, className, children, ...props }, ref) {
|
|
3034
|
+
const size = useScaleSize("Badge", sizeProp);
|
|
2551
3035
|
return /* @__PURE__ */ jsxs(
|
|
2552
3036
|
"span",
|
|
2553
3037
|
{
|
|
@@ -2581,6 +3065,7 @@ var BulkActionBar = forwardRef(
|
|
|
2581
3065
|
className,
|
|
2582
3066
|
...props
|
|
2583
3067
|
}, ref) {
|
|
3068
|
+
const { a11y } = useLocale();
|
|
2584
3069
|
const visible = open != null ? open : count > 0;
|
|
2585
3070
|
const [mounted, setMounted] = useState(visible);
|
|
2586
3071
|
const [show, setShow] = useState(visible);
|
|
@@ -2601,7 +3086,7 @@ var BulkActionBar = forwardRef(
|
|
|
2601
3086
|
{
|
|
2602
3087
|
ref,
|
|
2603
3088
|
role: "toolbar",
|
|
2604
|
-
"aria-label":
|
|
3089
|
+
"aria-label": a11y.bulkActions,
|
|
2605
3090
|
"data-show": show ? "" : void 0,
|
|
2606
3091
|
className: cx(
|
|
2607
3092
|
"klun-bulk-action-bar",
|
|
@@ -2622,8 +3107,8 @@ var BulkActionBar = forwardRef(
|
|
|
2622
3107
|
{
|
|
2623
3108
|
type: "button",
|
|
2624
3109
|
onClick: onClear,
|
|
2625
|
-
"aria-label":
|
|
2626
|
-
title:
|
|
3110
|
+
"aria-label": a11y.clearSelection,
|
|
3111
|
+
title: a11y.clearSelection,
|
|
2627
3112
|
className: "klun-bulk-action-bar__clear",
|
|
2628
3113
|
children: /* @__PURE__ */ jsx("i", { className: "ri-close-line", "aria-hidden": true })
|
|
2629
3114
|
}
|
|
@@ -2667,6 +3152,16 @@ var Carousel = forwardRef(function Carousel2({
|
|
|
2667
3152
|
const { carousel } = useLocale();
|
|
2668
3153
|
const slides = Children.toArray(children);
|
|
2669
3154
|
const count = slides.length;
|
|
3155
|
+
const rootRef = useRef(null);
|
|
3156
|
+
const hadFocusInside = useRef(false);
|
|
3157
|
+
const attachRootRef = useCallback(
|
|
3158
|
+
(el) => {
|
|
3159
|
+
rootRef.current = el;
|
|
3160
|
+
if (typeof ref === "function") ref(el);
|
|
3161
|
+
else if (ref) ref.current = el;
|
|
3162
|
+
},
|
|
3163
|
+
[ref]
|
|
3164
|
+
);
|
|
2670
3165
|
const [inner, setInner] = useState(defaultIndex);
|
|
2671
3166
|
const cur = index !== void 0 ? index : inner;
|
|
2672
3167
|
const [hover, setHover] = useState(false);
|
|
@@ -2685,6 +3180,12 @@ var Carousel = forwardRef(function Carousel2({
|
|
|
2685
3180
|
const id = setInterval(() => go(cur + 1), interval);
|
|
2686
3181
|
return () => clearInterval(id);
|
|
2687
3182
|
}, [autoplay, hover, cur, interval, count, go]);
|
|
3183
|
+
useEffect(() => {
|
|
3184
|
+
const root = rootRef.current;
|
|
3185
|
+
if (!root || !hadFocusInside.current) return;
|
|
3186
|
+
const active = document.activeElement;
|
|
3187
|
+
if (active && !root.contains(active)) root.focus();
|
|
3188
|
+
}, [cur]);
|
|
2688
3189
|
const arrowBtn = (dir) => /* @__PURE__ */ jsx(
|
|
2689
3190
|
"button",
|
|
2690
3191
|
{
|
|
@@ -2698,11 +3199,20 @@ var Carousel = forwardRef(function Carousel2({
|
|
|
2698
3199
|
return /* @__PURE__ */ jsxs(
|
|
2699
3200
|
"div",
|
|
2700
3201
|
{
|
|
2701
|
-
ref,
|
|
3202
|
+
ref: attachRootRef,
|
|
2702
3203
|
onMouseEnter: () => setHover(true),
|
|
2703
3204
|
onMouseLeave: () => setHover(false),
|
|
3205
|
+
onFocus: () => {
|
|
3206
|
+
hadFocusInside.current = true;
|
|
3207
|
+
},
|
|
3208
|
+
onBlur: (e) => {
|
|
3209
|
+
if (e.relatedTarget) {
|
|
3210
|
+
hadFocusInside.current = rootRef.current?.contains(e.relatedTarget) ?? false;
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
2704
3213
|
className: cx("klun-carousel", className),
|
|
2705
3214
|
style: { height, ...style },
|
|
3215
|
+
tabIndex: -1,
|
|
2706
3216
|
...props,
|
|
2707
3217
|
children: [
|
|
2708
3218
|
/* @__PURE__ */ jsx(
|
|
@@ -2710,7 +3220,20 @@ var Carousel = forwardRef(function Carousel2({
|
|
|
2710
3220
|
{
|
|
2711
3221
|
className: "klun-carousel__track",
|
|
2712
3222
|
style: { transform: `translateX(-${cur * 100}%)` },
|
|
2713
|
-
children: slides.map((s, i) =>
|
|
3223
|
+
children: slides.map((s, i) => {
|
|
3224
|
+
const active = i === cur;
|
|
3225
|
+
return /* @__PURE__ */ jsx(
|
|
3226
|
+
"div",
|
|
3227
|
+
{
|
|
3228
|
+
className: "klun-carousel__slide",
|
|
3229
|
+
"data-active": active || void 0,
|
|
3230
|
+
...!active ? { inert: "" } : {},
|
|
3231
|
+
"aria-hidden": !active || void 0,
|
|
3232
|
+
children: s
|
|
3233
|
+
},
|
|
3234
|
+
i
|
|
3235
|
+
);
|
|
3236
|
+
})
|
|
2714
3237
|
}
|
|
2715
3238
|
),
|
|
2716
3239
|
arrows && count > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2733,7 +3256,8 @@ var Carousel = forwardRef(function Carousel2({
|
|
|
2733
3256
|
);
|
|
2734
3257
|
});
|
|
2735
3258
|
Carousel.displayName = "Carousel";
|
|
2736
|
-
var ChartLegend = forwardRef(function ChartLegend2({ items: items2 = [], direction = "row", dot = "round", size
|
|
3259
|
+
var ChartLegend = forwardRef(function ChartLegend2({ items: items2 = [], direction = "row", dot = "round", size: sizeProp, className, ...props }, ref) {
|
|
3260
|
+
const size = useScaleSize("ChartLegend", sizeProp);
|
|
2737
3261
|
return /* @__PURE__ */ jsx(
|
|
2738
3262
|
"div",
|
|
2739
3263
|
{
|
|
@@ -2946,7 +3470,8 @@ var LogViewer = forwardRef(function LogViewer2({
|
|
|
2946
3470
|
);
|
|
2947
3471
|
});
|
|
2948
3472
|
LogViewer.displayName = "LogViewer";
|
|
2949
|
-
var ContentLabel = forwardRef(function ContentLabel2({ children, icon, color = "gray", size
|
|
3473
|
+
var ContentLabel = forwardRef(function ContentLabel2({ children, icon, color = "gray", size: sizeProp, className, ...props }, ref) {
|
|
3474
|
+
const size = useScaleSize("ContentLabel", sizeProp);
|
|
2950
3475
|
return /* @__PURE__ */ jsxs(
|
|
2951
3476
|
"span",
|
|
2952
3477
|
{
|
|
@@ -3069,11 +3594,12 @@ function StatusBadge({
|
|
|
3069
3594
|
map,
|
|
3070
3595
|
dot = true,
|
|
3071
3596
|
variant = "light",
|
|
3072
|
-
size
|
|
3597
|
+
size: sizeProp,
|
|
3073
3598
|
pulse = false,
|
|
3074
3599
|
className,
|
|
3075
3600
|
...props
|
|
3076
3601
|
}) {
|
|
3602
|
+
const size = useScaleSize("StatusBadge", sizeProp);
|
|
3077
3603
|
const k2 = keyOf(status);
|
|
3078
3604
|
const resolvedTone = tone || map && map[k2] || STATUS_TONE[k2] || "neutral";
|
|
3079
3605
|
const color = TONE_COLOR[resolvedTone] || "gray";
|
|
@@ -3109,7 +3635,9 @@ function useTick(ms) {
|
|
|
3109
3635
|
return () => clearInterval(id);
|
|
3110
3636
|
}, [ms]);
|
|
3111
3637
|
}
|
|
3112
|
-
var RelativeTime = forwardRef(function RelativeTime2({ date, locale, live = true, every = 6e4, absolute, className, ...props }, ref) {
|
|
3638
|
+
var RelativeTime = forwardRef(function RelativeTime2({ date, locale: localeProp, live = true, every = 6e4, absolute, className, ...props }, ref) {
|
|
3639
|
+
const { locale: ctxLocaleName } = useLocale();
|
|
3640
|
+
const locale = localeProp ?? ctxLocaleName;
|
|
3113
3641
|
useTick(live ? every : 0);
|
|
3114
3642
|
const rel = Format.relTime(date, { locale });
|
|
3115
3643
|
const title = Format.absTime(date, { locale });
|
|
@@ -3640,7 +4168,8 @@ var ItemGroup = forwardRef(
|
|
|
3640
4168
|
}
|
|
3641
4169
|
);
|
|
3642
4170
|
ItemGroup.displayName = "ItemGroup";
|
|
3643
|
-
var Item = forwardRef(function Item2({ variant = "default", size
|
|
4171
|
+
var Item = forwardRef(function Item2({ variant = "default", size: sizeProp, className, ...props }, ref) {
|
|
4172
|
+
const size = useScaleSize("Item", sizeProp);
|
|
3644
4173
|
return /* @__PURE__ */ jsx(
|
|
3645
4174
|
"div",
|
|
3646
4175
|
{
|
|
@@ -3889,7 +4418,7 @@ function KanbanCardView({
|
|
|
3889
4418
|
dropAfter && "klun-kanban__card--dropafter"
|
|
3890
4419
|
),
|
|
3891
4420
|
style: {
|
|
3892
|
-
transform: CSS.Transform.toString(transform),
|
|
4421
|
+
transform: CSS$1.Transform.toString(transform),
|
|
3893
4422
|
transition,
|
|
3894
4423
|
...card.accent ? { boxShadow: `inset 3px 0 0 ${card.accent}` } : null
|
|
3895
4424
|
},
|
|
@@ -3906,7 +4435,8 @@ var Kbd = forwardRef(function Kbd2({ className, children, ...props }, ref) {
|
|
|
3906
4435
|
return /* @__PURE__ */ jsx("kbd", { ref, className: cx("klun-kbd", className), ...props, children });
|
|
3907
4436
|
});
|
|
3908
4437
|
Kbd.displayName = "Kbd";
|
|
3909
|
-
var KeyIcon = forwardRef(function KeyIcon2({ icon, color = "blue", appearance = "light", size
|
|
4438
|
+
var KeyIcon = forwardRef(function KeyIcon2({ icon, color = "blue", appearance = "light", size: sizeProp, css, className, style, ...props }, ref) {
|
|
4439
|
+
const size = useScaleSize("KeyIcon", sizeProp);
|
|
3910
4440
|
return /* @__PURE__ */ jsx(
|
|
3911
4441
|
"span",
|
|
3912
4442
|
{
|
|
@@ -4323,20 +4853,23 @@ var Money = forwardRef(function Money2({
|
|
|
4323
4853
|
value,
|
|
4324
4854
|
cents = false,
|
|
4325
4855
|
currency = "USD",
|
|
4326
|
-
locale,
|
|
4856
|
+
locale: localeProp,
|
|
4327
4857
|
period,
|
|
4328
4858
|
periodLabels,
|
|
4329
4859
|
minimumFractionDigits,
|
|
4330
4860
|
maximumFractionDigits,
|
|
4331
4861
|
signDisplay,
|
|
4332
4862
|
tone = "default",
|
|
4333
|
-
size
|
|
4863
|
+
size: sizeProp,
|
|
4334
4864
|
strikethrough = false,
|
|
4335
4865
|
prefix,
|
|
4336
4866
|
suffix,
|
|
4337
4867
|
className,
|
|
4338
4868
|
...props
|
|
4339
4869
|
}, ref) {
|
|
4870
|
+
const size = useScaleSize("Money", sizeProp);
|
|
4871
|
+
const { locale: ctxLocaleName } = useLocale();
|
|
4872
|
+
const locale = localeProp ?? ctxLocaleName;
|
|
4340
4873
|
const { text, period: periodSuffix } = Format.money(value, {
|
|
4341
4874
|
currency,
|
|
4342
4875
|
cents,
|
|
@@ -4384,7 +4917,9 @@ function Digit({ value }) {
|
|
|
4384
4917
|
) });
|
|
4385
4918
|
}
|
|
4386
4919
|
var NumberFlow = forwardRef(
|
|
4387
|
-
function NumberFlow2({ value, locales:
|
|
4920
|
+
function NumberFlow2({ value, locales: localesProp, format, prefix, suffix, label, className, ...props }, ref) {
|
|
4921
|
+
const { locale: ctxLocaleName } = useLocale();
|
|
4922
|
+
const locales2 = localesProp ?? ctxLocaleName;
|
|
4388
4923
|
const text = new Intl.NumberFormat(locales2, {
|
|
4389
4924
|
minimumFractionDigits: format?.minimumFractionDigits,
|
|
4390
4925
|
maximumFractionDigits: format?.maximumFractionDigits,
|
|
@@ -4519,14 +5054,66 @@ var Rating = forwardRef(function Rating2({ value = 0, max = 5, onChange, readOnl
|
|
|
4519
5054
|
)) });
|
|
4520
5055
|
});
|
|
4521
5056
|
Rating.displayName = "Rating";
|
|
4522
|
-
var
|
|
4523
|
-
|
|
5057
|
+
var FOCUSABLE = [
|
|
5058
|
+
"a[href]",
|
|
5059
|
+
"button:not([disabled])",
|
|
5060
|
+
"input:not([disabled]):not([type='hidden'])",
|
|
5061
|
+
"select:not([disabled])",
|
|
5062
|
+
"textarea:not([disabled])",
|
|
5063
|
+
"[tabindex]:not([tabindex='-1'])"
|
|
5064
|
+
].join(",");
|
|
5065
|
+
var ACTIVATABLE = [
|
|
5066
|
+
"button",
|
|
5067
|
+
"a[href]",
|
|
5068
|
+
"input[type='button']",
|
|
5069
|
+
"input[type='submit']",
|
|
5070
|
+
"input[type='reset']",
|
|
5071
|
+
"input[type='checkbox']",
|
|
5072
|
+
"input[type='radio']",
|
|
5073
|
+
"summary",
|
|
5074
|
+
"[role='button']",
|
|
5075
|
+
"[role='link']"
|
|
5076
|
+
].join(",");
|
|
5077
|
+
var Popover = forwardRef(function Popover2({
|
|
5078
|
+
trigger,
|
|
5079
|
+
children,
|
|
5080
|
+
align = "start",
|
|
5081
|
+
width = 280,
|
|
5082
|
+
className,
|
|
5083
|
+
open,
|
|
5084
|
+
defaultOpen = false,
|
|
5085
|
+
onOpenChange,
|
|
5086
|
+
panelId,
|
|
5087
|
+
...props
|
|
5088
|
+
}, ref) {
|
|
5089
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
5090
|
+
const controlled = open !== void 0;
|
|
5091
|
+
const isOpen = controlled ? Boolean(open) : internalOpen;
|
|
5092
|
+
const onOpenChangeRef = useRef(onOpenChange);
|
|
5093
|
+
onOpenChangeRef.current = onOpenChange;
|
|
5094
|
+
const setOpen = useCallback(
|
|
5095
|
+
(next) => {
|
|
5096
|
+
if (!controlled) setInternalOpen(next);
|
|
5097
|
+
onOpenChangeRef.current?.(next);
|
|
5098
|
+
},
|
|
5099
|
+
[controlled]
|
|
5100
|
+
);
|
|
4524
5101
|
const wrapRef = useRef(null);
|
|
5102
|
+
const triggerRef = useRef(null);
|
|
4525
5103
|
const panelRef = useRef(null);
|
|
4526
5104
|
const portal = typeof document !== "undefined";
|
|
4527
5105
|
const [pos, setPos] = useState(null);
|
|
5106
|
+
const generatedId = useId();
|
|
5107
|
+
const resolvedPanelId = panelId ?? `klun-popover-${generatedId}`;
|
|
5108
|
+
const [hasFocusableChild, setHasFocusableChild] = useState(false);
|
|
4528
5109
|
useEffect(() => {
|
|
4529
|
-
|
|
5110
|
+
const root = triggerRef.current;
|
|
5111
|
+
if (!root) return;
|
|
5112
|
+
setHasFocusableChild(root.querySelector(FOCUSABLE) != null);
|
|
5113
|
+
}, [trigger]);
|
|
5114
|
+
const openedByKeyboard = useRef(false);
|
|
5115
|
+
useEffect(() => {
|
|
5116
|
+
if (!isOpen) return;
|
|
4530
5117
|
const h = (e) => {
|
|
4531
5118
|
const t = e.target;
|
|
4532
5119
|
if (wrapRef.current?.contains(t)) return;
|
|
@@ -4535,9 +5122,9 @@ var Popover = forwardRef(function Popover2({ trigger, children, align = "left",
|
|
|
4535
5122
|
};
|
|
4536
5123
|
document.addEventListener("mousedown", h);
|
|
4537
5124
|
return () => document.removeEventListener("mousedown", h);
|
|
4538
|
-
}, [
|
|
5125
|
+
}, [isOpen, setOpen]);
|
|
4539
5126
|
useLayoutEffect(() => {
|
|
4540
|
-
if (!
|
|
5127
|
+
if (!isOpen || !portal) return;
|
|
4541
5128
|
const anchor = wrapRef.current;
|
|
4542
5129
|
const panel2 = panelRef.current;
|
|
4543
5130
|
if (!anchor || !panel2) return;
|
|
@@ -4550,7 +5137,9 @@ var Popover = forwardRef(function Popover2({ trigger, children, align = "left",
|
|
|
4550
5137
|
const below = window.innerHeight - a.bottom;
|
|
4551
5138
|
const openUp = below < ph + gap && a.top > below;
|
|
4552
5139
|
const top = openUp ? Math.max(margin, a.top - gap - ph) : Math.min(a.bottom + gap, window.innerHeight - margin - ph);
|
|
4553
|
-
|
|
5140
|
+
const rtl = getComputedStyle(anchor).direction === "rtl";
|
|
5141
|
+
const side = align === "start" ? rtl ? "right" : "left" : align === "end" ? rtl ? "left" : "right" : align;
|
|
5142
|
+
let left = side === "right" ? a.right - pw : a.left;
|
|
4554
5143
|
if (left + pw > window.innerWidth - margin) left = window.innerWidth - margin - pw;
|
|
4555
5144
|
if (left < margin) left = margin;
|
|
4556
5145
|
setPos({ left, top });
|
|
@@ -4562,10 +5151,58 @@ var Popover = forwardRef(function Popover2({ trigger, children, align = "left",
|
|
|
4562
5151
|
window.removeEventListener("scroll", place2, true);
|
|
4563
5152
|
window.removeEventListener("resize", place2);
|
|
4564
5153
|
};
|
|
4565
|
-
}, [
|
|
5154
|
+
}, [isOpen, portal, align, width]);
|
|
4566
5155
|
useEffect(() => {
|
|
4567
|
-
if (!
|
|
4568
|
-
}, [
|
|
5156
|
+
if (!isOpen) setPos(null);
|
|
5157
|
+
}, [isOpen]);
|
|
5158
|
+
useLayoutEffect(() => {
|
|
5159
|
+
if (!isOpen || !openedByKeyboard.current) return;
|
|
5160
|
+
if (!pos) return;
|
|
5161
|
+
openedByKeyboard.current = false;
|
|
5162
|
+
const panel2 = panelRef.current;
|
|
5163
|
+
if (!panel2) return;
|
|
5164
|
+
const first = panel2.querySelector(FOCUSABLE);
|
|
5165
|
+
(first ?? panel2).focus?.();
|
|
5166
|
+
}, [isOpen, pos]);
|
|
5167
|
+
const focusTrigger = useCallback(() => {
|
|
5168
|
+
const root = triggerRef.current;
|
|
5169
|
+
if (!root) return;
|
|
5170
|
+
const inner = root.querySelector(FOCUSABLE);
|
|
5171
|
+
(inner ?? root).focus?.();
|
|
5172
|
+
}, []);
|
|
5173
|
+
const onPanelKeyDown = (e) => {
|
|
5174
|
+
if (e.key !== "Escape") return;
|
|
5175
|
+
e.stopPropagation();
|
|
5176
|
+
setOpen(false);
|
|
5177
|
+
focusTrigger();
|
|
5178
|
+
};
|
|
5179
|
+
const onTriggerKeyDown = (e) => {
|
|
5180
|
+
if (e.key === "Escape") {
|
|
5181
|
+
if (!isOpen) return;
|
|
5182
|
+
e.stopPropagation();
|
|
5183
|
+
setOpen(false);
|
|
5184
|
+
focusTrigger();
|
|
5185
|
+
return;
|
|
5186
|
+
}
|
|
5187
|
+
if (e.key === "ArrowDown") {
|
|
5188
|
+
e.preventDefault();
|
|
5189
|
+
if (!isOpen) {
|
|
5190
|
+
openedByKeyboard.current = true;
|
|
5191
|
+
setOpen(true);
|
|
5192
|
+
}
|
|
5193
|
+
return;
|
|
5194
|
+
}
|
|
5195
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
5196
|
+
const target = e.target;
|
|
5197
|
+
const nativeActivation = target != null && target !== triggerRef.current && target.closest?.(ACTIVATABLE) != null;
|
|
5198
|
+
if (nativeActivation) return;
|
|
5199
|
+
if (!isOpen) {
|
|
5200
|
+
e.preventDefault();
|
|
5201
|
+
openedByKeyboard.current = true;
|
|
5202
|
+
setOpen(true);
|
|
5203
|
+
}
|
|
5204
|
+
}
|
|
5205
|
+
};
|
|
4569
5206
|
const setRefs = (node) => {
|
|
4570
5207
|
wrapRef.current = node;
|
|
4571
5208
|
if (typeof ref === "function") ref(node);
|
|
@@ -4581,11 +5218,14 @@ var Popover = forwardRef(function Popover2({ trigger, children, align = "left",
|
|
|
4581
5218
|
// keep hidden until measured to avoid a flash at the top-left corner
|
|
4582
5219
|
visibility: pos ? "visible" : "hidden"
|
|
4583
5220
|
};
|
|
4584
|
-
const panel =
|
|
5221
|
+
const panel = isOpen ? /* @__PURE__ */ jsx(
|
|
4585
5222
|
"div",
|
|
4586
5223
|
{
|
|
4587
5224
|
ref: panelRef,
|
|
5225
|
+
id: resolvedPanelId,
|
|
4588
5226
|
role: "dialog",
|
|
5227
|
+
tabIndex: -1,
|
|
5228
|
+
onKeyDown: onPanelKeyDown,
|
|
4589
5229
|
className: cx(
|
|
4590
5230
|
"klun-popover__panel",
|
|
4591
5231
|
// in-flow fallback keeps the legacy left/right anchoring classes
|
|
@@ -4595,8 +5235,25 @@ var Popover = forwardRef(function Popover2({ trigger, children, align = "left",
|
|
|
4595
5235
|
children: content
|
|
4596
5236
|
}
|
|
4597
5237
|
) : null;
|
|
5238
|
+
const triggerAria = {
|
|
5239
|
+
"aria-haspopup": "dialog",
|
|
5240
|
+
"aria-expanded": isOpen,
|
|
5241
|
+
...isOpen ? { "aria-controls": resolvedPanelId } : null
|
|
5242
|
+
};
|
|
5243
|
+
const triggerNode = isValidElement(trigger) ? cloneElement(trigger, triggerAria) : trigger;
|
|
5244
|
+
const wrapperIsTrigger = !hasFocusableChild;
|
|
4598
5245
|
return /* @__PURE__ */ jsxs("span", { ref: setRefs, className: cx("klun-popover", className), ...props, children: [
|
|
4599
|
-
/* @__PURE__ */ jsx(
|
|
5246
|
+
/* @__PURE__ */ jsx(
|
|
5247
|
+
"span",
|
|
5248
|
+
{
|
|
5249
|
+
ref: triggerRef,
|
|
5250
|
+
className: "klun-popover__trigger",
|
|
5251
|
+
onClick: () => setOpen(!isOpen),
|
|
5252
|
+
onKeyDown: onTriggerKeyDown,
|
|
5253
|
+
...wrapperIsTrigger ? { role: "button", tabIndex: 0, ...triggerAria } : !isValidElement(trigger) ? triggerAria : null,
|
|
5254
|
+
children: triggerNode
|
|
5255
|
+
}
|
|
5256
|
+
),
|
|
4600
5257
|
portal ? panel && createPortal(panel, document.body) : panel
|
|
4601
5258
|
] });
|
|
4602
5259
|
});
|
|
@@ -4959,11 +5616,14 @@ var EmojiPicker = forwardRef(
|
|
|
4959
5616
|
groups = EMOJI_GROUPS,
|
|
4960
5617
|
columns = 8,
|
|
4961
5618
|
searchable = true,
|
|
4962
|
-
searchPlaceholder
|
|
4963
|
-
emptyText
|
|
5619
|
+
searchPlaceholder: searchPlaceholderProp,
|
|
5620
|
+
emptyText: emptyTextProp,
|
|
4964
5621
|
className,
|
|
4965
5622
|
...props
|
|
4966
5623
|
}, ref) {
|
|
5624
|
+
const { emojiPicker } = useLocale();
|
|
5625
|
+
const searchPlaceholder = searchPlaceholderProp ?? emojiPicker.searchPlaceholder;
|
|
5626
|
+
const emptyText = emptyTextProp ?? emojiPicker.emptyText;
|
|
4967
5627
|
const [query, setQuery] = useState("");
|
|
4968
5628
|
const q = query.trim().toLowerCase();
|
|
4969
5629
|
const results = useMemo(() => {
|
|
@@ -5008,7 +5668,9 @@ var EmojiPicker = forwardRef(
|
|
|
5008
5668
|
EmojiPicker.displayName = "EmojiPicker";
|
|
5009
5669
|
var QUICK_EMOJIS = ["\u{1F44D}", "\u{1F44C}", "\u2764\uFE0F", "\u2705", "\u{1F389}", "\u{1F615}", "\u{1F680}", "\u{1F440}"];
|
|
5010
5670
|
var QuickEmojiPicker = forwardRef(
|
|
5011
|
-
function QuickEmojiPicker2({ onSelect, emojis = QUICK_EMOJIS, align = "left", label
|
|
5671
|
+
function QuickEmojiPicker2({ onSelect, emojis = QUICK_EMOJIS, align = "left", label: labelProp, className }, ref) {
|
|
5672
|
+
const { emojiPicker } = useLocale();
|
|
5673
|
+
const label = labelProp ?? emojiPicker.addReaction;
|
|
5012
5674
|
return /* @__PURE__ */ jsx(
|
|
5013
5675
|
Popover,
|
|
5014
5676
|
{
|
|
@@ -5153,6 +5815,16 @@ var Tooltip = forwardRef(function Tooltip2({ content, side = "top", delay = 200,
|
|
|
5153
5815
|
transform: "none",
|
|
5154
5816
|
visibility: pos ? "visible" : "hidden"
|
|
5155
5817
|
};
|
|
5818
|
+
const tooltipId = `${useId()}tooltip`;
|
|
5819
|
+
const describedBy = open && content && !disabled ? tooltipId : void 0;
|
|
5820
|
+
const childProps = isValidElement(children) ? children.props : null;
|
|
5821
|
+
const triggerNode = childProps != null ? cloneElement(
|
|
5822
|
+
children,
|
|
5823
|
+
// 合并而非覆盖调用方已有的 aria-describedby
|
|
5824
|
+
{
|
|
5825
|
+
"aria-describedby": [childProps["aria-describedby"], describedBy].filter(Boolean).join(" ") || void 0
|
|
5826
|
+
}
|
|
5827
|
+
) : children;
|
|
5156
5828
|
return /* @__PURE__ */ jsxs(
|
|
5157
5829
|
"span",
|
|
5158
5830
|
{
|
|
@@ -5162,13 +5834,15 @@ var Tooltip = forwardRef(function Tooltip2({ content, side = "top", delay = 200,
|
|
|
5162
5834
|
onMouseLeave: hide,
|
|
5163
5835
|
onFocus: show,
|
|
5164
5836
|
onBlur: hide,
|
|
5837
|
+
...childProps == null ? { "aria-describedby": describedBy } : null,
|
|
5165
5838
|
children: [
|
|
5166
|
-
|
|
5839
|
+
triggerNode,
|
|
5167
5840
|
open && content && typeof document !== "undefined" ? createPortal(
|
|
5168
5841
|
/* @__PURE__ */ jsx(
|
|
5169
5842
|
"span",
|
|
5170
5843
|
{
|
|
5171
5844
|
ref: bubbleRef,
|
|
5845
|
+
id: tooltipId,
|
|
5172
5846
|
role: "tooltip",
|
|
5173
5847
|
className: cx("klun-tooltip__bubble", `klun-tooltip__bubble--${side}`),
|
|
5174
5848
|
style: bubbleStyle,
|
|
@@ -5297,7 +5971,8 @@ var Statistic = forwardRef(function Statistic2({ label, value, prefix, suffix, p
|
|
|
5297
5971
|
});
|
|
5298
5972
|
Statistic.displayName = "Statistic";
|
|
5299
5973
|
var SIZES2 = { xs: 6, sm: 8, md: 10, lg: 12 };
|
|
5300
|
-
var StatusDot = forwardRef(function StatusDot2({ tone = "neutral", size
|
|
5974
|
+
var StatusDot = forwardRef(function StatusDot2({ tone = "neutral", size: sizeProp, pulse = false, label, className, style, ...props }, ref) {
|
|
5975
|
+
const size = useScaleSize("StatusDot", sizeProp);
|
|
5301
5976
|
const sizeStyle = { ["--klun-status-dot-size"]: `${SIZES2[size] ?? SIZES2.sm}px` };
|
|
5302
5977
|
const dot = /* @__PURE__ */ jsx("span", { className: cx("klun-status-dot__dot", pulse && "klun-status-dot--pulse"), style: sizeStyle });
|
|
5303
5978
|
if (label == null) {
|
|
@@ -5648,7 +6323,7 @@ function TableToolbar({
|
|
|
5648
6323
|
selectedRows,
|
|
5649
6324
|
clearSelection
|
|
5650
6325
|
}) {
|
|
5651
|
-
const { table } = useLocale();
|
|
6326
|
+
const { table, a11y } = useLocale();
|
|
5652
6327
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5653
6328
|
showToolbar ? /* @__PURE__ */ jsxs("div", { className: "klun-table__toolbar", children: [
|
|
5654
6329
|
title != null ? /* @__PURE__ */ jsx("span", { className: "klun-table__title", children: title }) : /* @__PURE__ */ jsx("span", { className: "klun-table__title-spacer" }),
|
|
@@ -5671,7 +6346,7 @@ function TableToolbar({
|
|
|
5671
6346
|
{
|
|
5672
6347
|
type: "button",
|
|
5673
6348
|
onClick: clearSelection,
|
|
5674
|
-
"aria-label":
|
|
6349
|
+
"aria-label": a11y.clearSelection,
|
|
5675
6350
|
className: "klun-table__selbar-clear",
|
|
5676
6351
|
children: /* @__PURE__ */ jsx("i", { className: "ri-close-line" })
|
|
5677
6352
|
}
|
|
@@ -5849,9 +6524,44 @@ function TableHead({
|
|
|
5849
6524
|
setSort,
|
|
5850
6525
|
activeFilters,
|
|
5851
6526
|
setFilter,
|
|
5852
|
-
startResize
|
|
6527
|
+
startResize,
|
|
6528
|
+
setColumnWidth
|
|
5853
6529
|
}) {
|
|
5854
6530
|
const { table } = useLocale();
|
|
6531
|
+
const [resizerW, setResizerW] = useState({});
|
|
6532
|
+
const widthForA11y = (c) => {
|
|
6533
|
+
const w = widthOf(c);
|
|
6534
|
+
if (typeof w === "number") return w;
|
|
6535
|
+
if (typeof c.width === "number") return c.width;
|
|
6536
|
+
return resizerW[c.key] ?? (c.minWidth || 64);
|
|
6537
|
+
};
|
|
6538
|
+
const onResizerKeyDown = (e, c) => {
|
|
6539
|
+
const min = c.minWidth || 64;
|
|
6540
|
+
const step = e.shiftKey ? 32 : 8;
|
|
6541
|
+
const current = resizerW[c.key] ?? widthForA11y(c);
|
|
6542
|
+
let next = null;
|
|
6543
|
+
switch (e.key) {
|
|
6544
|
+
case "ArrowLeft":
|
|
6545
|
+
next = current - step;
|
|
6546
|
+
break;
|
|
6547
|
+
case "ArrowRight":
|
|
6548
|
+
next = current + step;
|
|
6549
|
+
break;
|
|
6550
|
+
case "Home":
|
|
6551
|
+
next = min;
|
|
6552
|
+
break;
|
|
6553
|
+
// 这里没有真正的"最大值"(列宽不受限),因此用 Enter 代表"恢复声明宽度"
|
|
6554
|
+
case "Enter":
|
|
6555
|
+
next = typeof c.width === "number" ? c.width : current;
|
|
6556
|
+
break;
|
|
6557
|
+
default:
|
|
6558
|
+
return;
|
|
6559
|
+
}
|
|
6560
|
+
e.preventDefault();
|
|
6561
|
+
e.stopPropagation();
|
|
6562
|
+
const applied = setColumnWidth(c, next);
|
|
6563
|
+
setResizerW((m) => ({ ...m, [c.key]: applied }));
|
|
6564
|
+
};
|
|
5855
6565
|
return /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
5856
6566
|
dragCol ? /* @__PURE__ */ jsx("th", { className: "klun-table__th klun-table__th--util" }) : null,
|
|
5857
6567
|
expandCol ? /* @__PURE__ */ jsx(
|
|
@@ -5914,8 +6624,21 @@ function TableHead({
|
|
|
5914
6624
|
justifyContent: c.align === "right" ? "flex-end" : c.align === "center" ? "center" : "flex-start"
|
|
5915
6625
|
},
|
|
5916
6626
|
children: [
|
|
5917
|
-
/* @__PURE__ */
|
|
5918
|
-
|
|
6627
|
+
isSort ? /* @__PURE__ */ jsxs(
|
|
6628
|
+
"button",
|
|
6629
|
+
{
|
|
6630
|
+
type: "button",
|
|
6631
|
+
className: "klun-table__sort",
|
|
6632
|
+
onClick: (e) => {
|
|
6633
|
+
e.stopPropagation();
|
|
6634
|
+
setSort(c.key);
|
|
6635
|
+
},
|
|
6636
|
+
children: [
|
|
6637
|
+
/* @__PURE__ */ jsx("span", { className: c.ellipsis ? "klun-table__ellipsis" : void 0, children: c.headerRender ? c.headerRender() : c.header }),
|
|
6638
|
+
/* @__PURE__ */ jsx(SortIcon, { dir })
|
|
6639
|
+
]
|
|
6640
|
+
}
|
|
6641
|
+
) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("span", { className: c.ellipsis ? "klun-table__ellipsis" : void 0, children: c.headerRender ? c.headerRender() : c.header }) }),
|
|
5919
6642
|
hasFilter ? /* @__PURE__ */ jsx(
|
|
5920
6643
|
FilterMenu,
|
|
5921
6644
|
{
|
|
@@ -5933,7 +6656,19 @@ function TableHead({
|
|
|
5933
6656
|
{
|
|
5934
6657
|
role: "separator",
|
|
5935
6658
|
"aria-orientation": "vertical",
|
|
6659
|
+
tabIndex: 0,
|
|
6660
|
+
"aria-label": `${table.dragToResize}: ${typeof c.header === "string" ? c.header : c.key}`,
|
|
6661
|
+
"aria-valuemin": c.minWidth || 64,
|
|
6662
|
+
"aria-valuenow": widthForA11y(c),
|
|
6663
|
+
"aria-valuetext": `${widthForA11y(c)}px`,
|
|
5936
6664
|
title: table.dragToResize,
|
|
6665
|
+
onFocus: (e) => {
|
|
6666
|
+
const th = e.currentTarget.closest("th");
|
|
6667
|
+
if (!th) return;
|
|
6668
|
+
const measured = Math.round(th.getBoundingClientRect().width);
|
|
6669
|
+
if (measured > 0) setResizerW((m) => ({ ...m, [c.key]: measured }));
|
|
6670
|
+
},
|
|
6671
|
+
onKeyDown: (e) => onResizerKeyDown(e, c),
|
|
5937
6672
|
onMouseDown: (e) => startResize(e, c),
|
|
5938
6673
|
onClick: (e) => e.stopPropagation(),
|
|
5939
6674
|
className: "klun-table__resizer",
|
|
@@ -5947,6 +6682,14 @@ function TableHead({
|
|
|
5947
6682
|
})
|
|
5948
6683
|
] }) });
|
|
5949
6684
|
}
|
|
6685
|
+
function isCoarsePointer() {
|
|
6686
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
6687
|
+
try {
|
|
6688
|
+
return window.matchMedia("(pointer: coarse)").matches;
|
|
6689
|
+
} catch {
|
|
6690
|
+
return false;
|
|
6691
|
+
}
|
|
6692
|
+
}
|
|
5950
6693
|
function TableRow(props) {
|
|
5951
6694
|
if (!props.dragCol) return /* @__PURE__ */ jsx(RowBase, { ...props });
|
|
5952
6695
|
return /* @__PURE__ */ jsx(SortableRow, { ...props });
|
|
@@ -5971,7 +6714,7 @@ function SortableRow(props) {
|
|
|
5971
6714
|
setNodeRef,
|
|
5972
6715
|
setActivatorNodeRef,
|
|
5973
6716
|
isDragging,
|
|
5974
|
-
style: { transform: CSS.Transform.toString(transform), transition }
|
|
6717
|
+
style: { transform: CSS$1.Transform.toString(transform), transition }
|
|
5975
6718
|
}
|
|
5976
6719
|
}
|
|
5977
6720
|
);
|
|
@@ -6050,7 +6793,15 @@ function RowBase({
|
|
|
6050
6793
|
clickable && "klun-table__row--clickable",
|
|
6051
6794
|
sortable?.isDragging && "klun-table__row--dragging"
|
|
6052
6795
|
),
|
|
6053
|
-
onClick: clickable ? () =>
|
|
6796
|
+
onClick: clickable ? (e) => {
|
|
6797
|
+
if (rowHref) {
|
|
6798
|
+
const target = e.target;
|
|
6799
|
+
if (target?.closest?.("a[href]")) return;
|
|
6800
|
+
window.location.href = rowHref(row);
|
|
6801
|
+
return;
|
|
6802
|
+
}
|
|
6803
|
+
onRowClick?.(row);
|
|
6804
|
+
} : void 0,
|
|
6054
6805
|
onContextMenu: contextMenu || copyable ? (e) => {
|
|
6055
6806
|
const custom = contextMenu ? contextMenu(row, { copyRow, copyText }) : null;
|
|
6056
6807
|
const items2 = custom && custom.length ? custom : [
|
|
@@ -6225,6 +6976,8 @@ function RowBase({
|
|
|
6225
6976
|
style: { textAlign: c.align || "left" }
|
|
6226
6977
|
}
|
|
6227
6978
|
) : null;
|
|
6979
|
+
const linkHref = rowHref && ci === 0 && !c.render && !c.editable ? rowHref(row) : null;
|
|
6980
|
+
const body = linkHref ? /* @__PURE__ */ jsx("a", { className: "klun-table__rowlink", href: linkHref, children: inner }) : inner;
|
|
6228
6981
|
return /* @__PURE__ */ jsx(
|
|
6229
6982
|
"td",
|
|
6230
6983
|
{
|
|
@@ -6232,6 +6985,18 @@ function RowBase({
|
|
|
6232
6985
|
e.stopPropagation();
|
|
6233
6986
|
startEdit(id, c, row);
|
|
6234
6987
|
} : void 0,
|
|
6988
|
+
onClick: c.editable && !isEditing && isCoarsePointer() ? (e) => {
|
|
6989
|
+
e.stopPropagation();
|
|
6990
|
+
startEdit(id, c, row);
|
|
6991
|
+
} : void 0,
|
|
6992
|
+
tabIndex: c.editable && !isEditing ? 0 : void 0,
|
|
6993
|
+
onKeyDown: c.editable && !isEditing ? (e) => {
|
|
6994
|
+
if (e.key === "Enter" || e.key === "F2") {
|
|
6995
|
+
e.preventDefault();
|
|
6996
|
+
e.stopPropagation();
|
|
6997
|
+
startEdit(id, c, row);
|
|
6998
|
+
}
|
|
6999
|
+
} : void 0,
|
|
6235
7000
|
className: cx(
|
|
6236
7001
|
"klun-table__td",
|
|
6237
7002
|
tdBorder,
|
|
@@ -6279,8 +7044,8 @@ function RowBase({
|
|
|
6279
7044
|
)
|
|
6280
7045
|
}
|
|
6281
7046
|
) : /* @__PURE__ */ jsx("span", { className: "klun-table__tree-spacer" }),
|
|
6282
|
-
|
|
6283
|
-
] }) :
|
|
7047
|
+
body
|
|
7048
|
+
] }) : body
|
|
6284
7049
|
},
|
|
6285
7050
|
c.key
|
|
6286
7051
|
);
|
|
@@ -6374,6 +7139,11 @@ function useColumnResize(columns) {
|
|
|
6374
7139
|
const [colW, setColW] = useState({});
|
|
6375
7140
|
const resizeRef = useRef(null);
|
|
6376
7141
|
const widthOf = (c) => colW[c.key] ?? (typeof c.width === "number" ? c.width : void 0);
|
|
7142
|
+
const setColumnWidth = (c, next) => {
|
|
7143
|
+
const w = Math.max(c.minWidth || 64, Math.round(next));
|
|
7144
|
+
setColW((m) => ({ ...m, [c.key]: w }));
|
|
7145
|
+
return w;
|
|
7146
|
+
};
|
|
6377
7147
|
const startResize = (e, c) => {
|
|
6378
7148
|
e.preventDefault();
|
|
6379
7149
|
e.stopPropagation();
|
|
@@ -6385,7 +7155,7 @@ function useColumnResize(columns) {
|
|
|
6385
7155
|
const r = resizeRef.current;
|
|
6386
7156
|
if (!r) return;
|
|
6387
7157
|
const w = Math.max(c.minWidth || 64, r.startW + (ev.clientX - r.startX));
|
|
6388
|
-
setColW((m) => ({ ...m, [r.key]: w }));
|
|
7158
|
+
setColW((m) => ({ ...m, [r.key]: Math.round(w) }));
|
|
6389
7159
|
};
|
|
6390
7160
|
const up = () => {
|
|
6391
7161
|
resizeRef.current = null;
|
|
@@ -6399,7 +7169,7 @@ function useColumnResize(columns) {
|
|
|
6399
7169
|
document.body.style.cursor = "col-resize";
|
|
6400
7170
|
document.body.style.userSelect = "none";
|
|
6401
7171
|
};
|
|
6402
|
-
return { colW, widthOf, startResize };
|
|
7172
|
+
return { colW, widthOf, startResize, setColumnWidth };
|
|
6403
7173
|
}
|
|
6404
7174
|
function useColumnVisibility(columns) {
|
|
6405
7175
|
const [hiddenCols, setHiddenCols] = useState(
|
|
@@ -6603,7 +7373,7 @@ function Table({
|
|
|
6603
7373
|
onFiltersChange,
|
|
6604
7374
|
pagination = false,
|
|
6605
7375
|
expandable,
|
|
6606
|
-
density
|
|
7376
|
+
density: densityProp,
|
|
6607
7377
|
zebra = false,
|
|
6608
7378
|
stickyHeader = false,
|
|
6609
7379
|
hover = true,
|
|
@@ -6638,9 +7408,11 @@ function Table({
|
|
|
6638
7408
|
style,
|
|
6639
7409
|
...props
|
|
6640
7410
|
}) {
|
|
7411
|
+
const providerDensity = useDensity();
|
|
7412
|
+
const density = densityProp ?? (providerDensity === "compact" ? "compact" : "comfortable");
|
|
6641
7413
|
const densityClass = DENSITY[density] || DENSITY.comfortable;
|
|
6642
7414
|
const { menu, setMenu } = useTableContextMenu();
|
|
6643
|
-
const { colW, widthOf, startResize } = useColumnResize();
|
|
7415
|
+
const { colW, widthOf, startResize, setColumnWidth } = useColumnResize();
|
|
6644
7416
|
const { hiddenCols, visibleColumns, toggleColumn } = useColumnVisibility(columns);
|
|
6645
7417
|
const dragCol = rowDraggable && !tree;
|
|
6646
7418
|
const rowToText = (row) => columns.map((c) => {
|
|
@@ -6832,7 +7604,8 @@ function Table({
|
|
|
6832
7604
|
setSort,
|
|
6833
7605
|
activeFilters,
|
|
6834
7606
|
setFilter,
|
|
6835
|
-
startResize
|
|
7607
|
+
startResize,
|
|
7608
|
+
setColumnWidth
|
|
6836
7609
|
}
|
|
6837
7610
|
),
|
|
6838
7611
|
/* @__PURE__ */ jsx(
|
|
@@ -7015,6 +7788,7 @@ var Tree = forwardRef(function Tree2({
|
|
|
7015
7788
|
showLine = false,
|
|
7016
7789
|
blockNode = true,
|
|
7017
7790
|
className,
|
|
7791
|
+
onKeyDown: onKeyDownProp,
|
|
7018
7792
|
...props
|
|
7019
7793
|
}, ref) {
|
|
7020
7794
|
const [innerExpanded, setInnerExpanded] = useState(defaultExpandedKeys);
|
|
@@ -7042,14 +7816,105 @@ var Tree = forwardRef(function Tree2({
|
|
|
7042
7816
|
else next = Array.from(/* @__PURE__ */ new Set([...checkedKeys, ...all]));
|
|
7043
7817
|
onCheck(next);
|
|
7044
7818
|
};
|
|
7819
|
+
const visible = rows.filter((r) => !r.hidden);
|
|
7820
|
+
const rootRef = useRef(null);
|
|
7821
|
+
const setRoots = (node) => {
|
|
7822
|
+
rootRef.current = node;
|
|
7823
|
+
if (typeof ref === "function") ref(node);
|
|
7824
|
+
else if (ref && "current" in ref) ref.current = node;
|
|
7825
|
+
};
|
|
7826
|
+
const firstEnabledKey = () => {
|
|
7827
|
+
const hit = visible.find((r) => !r.node.disabled) ?? visible[0];
|
|
7828
|
+
return hit?.node.key ?? null;
|
|
7829
|
+
};
|
|
7830
|
+
const [focusedKey, setFocusedKey] = useState(null);
|
|
7831
|
+
const rovingKey = (() => {
|
|
7832
|
+
if (focusedKey && visible.some((r) => r.node.key === focusedKey)) return focusedKey;
|
|
7833
|
+
if (selectedKey && visible.some((r) => r.node.key === selectedKey)) return selectedKey;
|
|
7834
|
+
return firstEnabledKey();
|
|
7835
|
+
})();
|
|
7836
|
+
const focusKey = useCallback((key) => {
|
|
7837
|
+
if (!key) return;
|
|
7838
|
+
setFocusedKey(key);
|
|
7839
|
+
const el = rootRef.current?.querySelector(`[data-tree-key="${CSS.escape(key)}"]`);
|
|
7840
|
+
el?.focus?.();
|
|
7841
|
+
}, []);
|
|
7842
|
+
const onKeyDown = (e) => {
|
|
7843
|
+
if (visible.length === 0) return;
|
|
7844
|
+
const activeKey = rootRef.current?.ownerDocument?.activeElement?.getAttribute?.(
|
|
7845
|
+
"data-tree-key"
|
|
7846
|
+
) ?? null;
|
|
7847
|
+
const currentKey = activeKey ?? rovingKey;
|
|
7848
|
+
const idx = Math.max(0, visible.findIndex((r) => r.node.key === currentKey));
|
|
7849
|
+
const cur = visible[idx];
|
|
7850
|
+
if (!cur) return;
|
|
7851
|
+
const hasChildren2 = !!(cur.node.children && cur.node.children.length);
|
|
7852
|
+
const isExpanded = exp.includes(cur.node.key);
|
|
7853
|
+
const parentKey = (() => {
|
|
7854
|
+
for (let i = idx - 1; i >= 0; i--) {
|
|
7855
|
+
if (visible[i].level < cur.level) return visible[i].node.key;
|
|
7856
|
+
}
|
|
7857
|
+
return null;
|
|
7858
|
+
})();
|
|
7859
|
+
switch (e.key) {
|
|
7860
|
+
case "ArrowDown":
|
|
7861
|
+
e.preventDefault();
|
|
7862
|
+
focusKey(visible[Math.min(idx + 1, visible.length - 1)]?.node.key ?? null);
|
|
7863
|
+
return;
|
|
7864
|
+
case "ArrowUp":
|
|
7865
|
+
e.preventDefault();
|
|
7866
|
+
focusKey(visible[Math.max(idx - 1, 0)]?.node.key ?? null);
|
|
7867
|
+
return;
|
|
7868
|
+
case "Home":
|
|
7869
|
+
e.preventDefault();
|
|
7870
|
+
focusKey(visible[0]?.node.key ?? null);
|
|
7871
|
+
return;
|
|
7872
|
+
case "End":
|
|
7873
|
+
e.preventDefault();
|
|
7874
|
+
focusKey(visible[visible.length - 1]?.node.key ?? null);
|
|
7875
|
+
return;
|
|
7876
|
+
case "ArrowRight":
|
|
7877
|
+
e.preventDefault();
|
|
7878
|
+
if (cur.node.disabled) return;
|
|
7879
|
+
if (hasChildren2 && !isExpanded) toggle(cur.node.key);
|
|
7880
|
+
else if (hasChildren2 && isExpanded) focusKey(visible[idx + 1]?.node.key ?? null);
|
|
7881
|
+
return;
|
|
7882
|
+
case "ArrowLeft":
|
|
7883
|
+
e.preventDefault();
|
|
7884
|
+
if (hasChildren2 && isExpanded) toggle(cur.node.key);
|
|
7885
|
+
else if (parentKey) focusKey(parentKey);
|
|
7886
|
+
return;
|
|
7887
|
+
case "Enter":
|
|
7888
|
+
e.preventDefault();
|
|
7889
|
+
if (cur.node.disabled) return;
|
|
7890
|
+
if (checkable) onCheckNode(cur.node);
|
|
7891
|
+
else onSelect?.(cur.node.key, cur.node);
|
|
7892
|
+
return;
|
|
7893
|
+
case " ":
|
|
7894
|
+
e.preventDefault();
|
|
7895
|
+
if (cur.node.disabled) return;
|
|
7896
|
+
if (checkable) onCheckNode(cur.node);
|
|
7897
|
+
else onSelect?.(cur.node.key, cur.node);
|
|
7898
|
+
return;
|
|
7899
|
+
default:
|
|
7900
|
+
return;
|
|
7901
|
+
}
|
|
7902
|
+
};
|
|
7903
|
+
const onKeyDownComposed = (e) => {
|
|
7904
|
+
onKeyDownProp?.(e);
|
|
7905
|
+
if (e.defaultPrevented) return;
|
|
7906
|
+
onKeyDown(e);
|
|
7907
|
+
};
|
|
7045
7908
|
return /* @__PURE__ */ jsx(
|
|
7046
7909
|
"div",
|
|
7047
7910
|
{
|
|
7048
|
-
ref,
|
|
7911
|
+
ref: setRoots,
|
|
7049
7912
|
role: "tree",
|
|
7913
|
+
"aria-multiselectable": checkable || void 0,
|
|
7050
7914
|
className: cx("klun-tree", showLine && "klun-tree--line", className),
|
|
7915
|
+
onKeyDown: onKeyDownComposed,
|
|
7051
7916
|
...props,
|
|
7052
|
-
children:
|
|
7917
|
+
children: visible.map(({ node, level }) => {
|
|
7053
7918
|
const hasChildren2 = !!(node.children && node.children.length);
|
|
7054
7919
|
const isExpanded = exp.includes(node.key);
|
|
7055
7920
|
const selected = selectedKey === node.key;
|
|
@@ -7058,17 +7923,24 @@ var Tree = forwardRef(function Tree2({
|
|
|
7058
7923
|
"div",
|
|
7059
7924
|
{
|
|
7060
7925
|
role: "treeitem",
|
|
7926
|
+
"data-tree-key": node.key,
|
|
7927
|
+
tabIndex: rovingKey === node.key ? 0 : -1,
|
|
7928
|
+
"aria-level": level + 1,
|
|
7061
7929
|
"aria-expanded": hasChildren2 ? isExpanded : void 0,
|
|
7062
7930
|
"aria-selected": selected,
|
|
7931
|
+
"aria-disabled": node.disabled || void 0,
|
|
7932
|
+
"aria-checked": checkable ? cs === "all" ? true : cs === "some" ? "mixed" : false : void 0,
|
|
7063
7933
|
className: cx(
|
|
7064
7934
|
"klun-tree__item",
|
|
7065
7935
|
selected && "klun-tree__item--selected",
|
|
7066
7936
|
node.disabled && "klun-tree__item--disabled",
|
|
7067
|
-
blockNode && "klun-tree__item--block"
|
|
7937
|
+
blockNode && "klun-tree__item--block",
|
|
7938
|
+
rovingKey === node.key && "klun-tree__item--focused"
|
|
7068
7939
|
),
|
|
7069
7940
|
style: { ["--klun-tree-indent"]: `${6 + level * 20}px` },
|
|
7070
7941
|
onClick: () => {
|
|
7071
7942
|
if (node.disabled) return;
|
|
7943
|
+
setFocusedKey(node.key);
|
|
7072
7944
|
if (!checkable) onSelect && onSelect(node.key, node);
|
|
7073
7945
|
},
|
|
7074
7946
|
children: [
|
|
@@ -7080,6 +7952,7 @@ var Tree = forwardRef(function Tree2({
|
|
|
7080
7952
|
hasChildren2 && isExpanded && "klun-tree__caret--expanded"
|
|
7081
7953
|
),
|
|
7082
7954
|
"data-leaf": hasChildren2 ? void 0 : "",
|
|
7955
|
+
"aria-hidden": "true",
|
|
7083
7956
|
onClick: (e) => {
|
|
7084
7957
|
e.stopPropagation();
|
|
7085
7958
|
if (hasChildren2) toggle(node.key);
|
|
@@ -7091,6 +7964,7 @@ var Tree = forwardRef(function Tree2({
|
|
|
7091
7964
|
"span",
|
|
7092
7965
|
{
|
|
7093
7966
|
className: cx("klun-tree__checkbox", `klun-tree__checkbox--${cs}`),
|
|
7967
|
+
"aria-hidden": "true",
|
|
7094
7968
|
onClick: (e) => {
|
|
7095
7969
|
e.stopPropagation();
|
|
7096
7970
|
if (!node.disabled) onCheckNode(node);
|
|
@@ -7696,12 +8570,13 @@ var GaugeBar = forwardRef(function GaugeBar2({
|
|
|
7696
8570
|
label,
|
|
7697
8571
|
caption,
|
|
7698
8572
|
color = "blue",
|
|
7699
|
-
size
|
|
8573
|
+
size: sizeProp,
|
|
7700
8574
|
showValue = true,
|
|
7701
8575
|
className,
|
|
7702
8576
|
style,
|
|
7703
8577
|
...props
|
|
7704
8578
|
}, ref) {
|
|
8579
|
+
const size = useScaleSize("GaugeBar", sizeProp);
|
|
7705
8580
|
const pct2 = Math.max(0, Math.min(100, max ? value / max * 100 : 0));
|
|
7706
8581
|
const showHeader = label || showValue && caption !== false;
|
|
7707
8582
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8333,7 +9208,14 @@ var AutoComplete = forwardRef(
|
|
|
8333
9208
|
leadingIcon,
|
|
8334
9209
|
emptyText: emptyTextProp,
|
|
8335
9210
|
maxVisible = 6,
|
|
9211
|
+
error = false,
|
|
8336
9212
|
className,
|
|
9213
|
+
inputProps,
|
|
9214
|
+
// 下面这些属性属于**真实输入框**,不能落在 wrapper 上:
|
|
9215
|
+
// 落在 wrapper 上时 `<label for={id}>` 指不到控件、`aria-label` 对输入框无效。
|
|
9216
|
+
// 其余属性仍然透传给根节点,保持既有行为。
|
|
9217
|
+
id,
|
|
9218
|
+
inputMode,
|
|
8337
9219
|
...props
|
|
8338
9220
|
}, ref) {
|
|
8339
9221
|
const size = useSize(sizeProp);
|
|
@@ -8342,6 +9224,17 @@ var AutoComplete = forwardRef(
|
|
|
8342
9224
|
const [open, setOpen] = useState(false);
|
|
8343
9225
|
const [hi, setHi] = useState(-1);
|
|
8344
9226
|
const rootRef = useRef(null);
|
|
9227
|
+
const generatedId = useId();
|
|
9228
|
+
const listboxId = `${generatedId}listbox`;
|
|
9229
|
+
const optionId = (index) => `${listboxId}-option-${index}`;
|
|
9230
|
+
const {
|
|
9231
|
+
"aria-label": ariaLabel,
|
|
9232
|
+
"aria-labelledby": ariaLabelledBy,
|
|
9233
|
+
"aria-describedby": ariaDescribedBy,
|
|
9234
|
+
"aria-invalid": ariaInvalid,
|
|
9235
|
+
"aria-required": ariaRequired,
|
|
9236
|
+
...rootProps
|
|
9237
|
+
} = props;
|
|
8345
9238
|
const norm2 = options.map(
|
|
8346
9239
|
(o) => typeof o === "string" ? { value: o, label: o } : o
|
|
8347
9240
|
);
|
|
@@ -8386,13 +9279,14 @@ var AutoComplete = forwardRef(
|
|
|
8386
9279
|
{
|
|
8387
9280
|
ref: rootRef,
|
|
8388
9281
|
className: cx("klun-autocomplete", `klun-autocomplete--${size}`, className),
|
|
8389
|
-
...
|
|
9282
|
+
...rootProps,
|
|
8390
9283
|
children: [
|
|
8391
9284
|
/* @__PURE__ */ jsxs(
|
|
8392
9285
|
"div",
|
|
8393
9286
|
{
|
|
8394
9287
|
className: cx(
|
|
8395
9288
|
"klun-autocomplete__field",
|
|
9289
|
+
error && "klun-autocomplete__field--error",
|
|
8396
9290
|
disabled && "klun-autocomplete__field--disabled"
|
|
8397
9291
|
),
|
|
8398
9292
|
"data-open": open ? "" : void 0,
|
|
@@ -8401,11 +9295,25 @@ var AutoComplete = forwardRef(
|
|
|
8401
9295
|
/* @__PURE__ */ jsx(
|
|
8402
9296
|
"input",
|
|
8403
9297
|
{
|
|
9298
|
+
...inputProps,
|
|
8404
9299
|
ref,
|
|
8405
|
-
|
|
9300
|
+
id: id ?? inputProps?.id,
|
|
9301
|
+
autoComplete: inputProps?.autoComplete,
|
|
9302
|
+
inputMode: inputMode ?? inputProps?.inputMode,
|
|
9303
|
+
className: cx("klun-autocomplete__input", inputProps?.className),
|
|
8406
9304
|
value,
|
|
8407
9305
|
disabled,
|
|
8408
9306
|
placeholder,
|
|
9307
|
+
role: "combobox",
|
|
9308
|
+
"aria-expanded": open,
|
|
9309
|
+
"aria-controls": open ? listboxId : void 0,
|
|
9310
|
+
"aria-activedescendant": open && hi >= 0 ? optionId(hi) : void 0,
|
|
9311
|
+
"aria-autocomplete": "list",
|
|
9312
|
+
"aria-label": ariaLabel,
|
|
9313
|
+
"aria-labelledby": ariaLabelledBy,
|
|
9314
|
+
"aria-describedby": ariaDescribedBy,
|
|
9315
|
+
"aria-invalid": ariaInvalid,
|
|
9316
|
+
"aria-required": ariaRequired,
|
|
8409
9317
|
onChange: (e) => {
|
|
8410
9318
|
onChange?.(e.target.value);
|
|
8411
9319
|
setOpen(true);
|
|
@@ -8418,9 +9326,10 @@ var AutoComplete = forwardRef(
|
|
|
8418
9326
|
]
|
|
8419
9327
|
}
|
|
8420
9328
|
),
|
|
8421
|
-
open ? /* @__PURE__ */ jsx("div", { className: "klun-autocomplete__list", role: "listbox", children: shown.length === 0 ? /* @__PURE__ */ jsx("div", { className: "klun-autocomplete__empty", children: emptyText }) : shown.map((o, i) => /* @__PURE__ */ jsxs(
|
|
9329
|
+
open ? /* @__PURE__ */ jsx("div", { className: "klun-autocomplete__list", id: listboxId, role: "listbox", children: shown.length === 0 ? /* @__PURE__ */ jsx("div", { className: "klun-autocomplete__empty", children: emptyText }) : shown.map((o, i) => /* @__PURE__ */ jsxs(
|
|
8422
9330
|
"button",
|
|
8423
9331
|
{
|
|
9332
|
+
id: optionId(i),
|
|
8424
9333
|
type: "button",
|
|
8425
9334
|
role: "option",
|
|
8426
9335
|
"aria-selected": i === hi,
|
|
@@ -8470,6 +9379,8 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8470
9379
|
const [open, setOpen] = useState(false);
|
|
8471
9380
|
const [active, setActive] = useState(current);
|
|
8472
9381
|
const rootRef = useRef(null);
|
|
9382
|
+
const triggerRef = useRef(null);
|
|
9383
|
+
const panelRef = useRef(null);
|
|
8473
9384
|
useEffect(() => {
|
|
8474
9385
|
setActive(current);
|
|
8475
9386
|
}, [open]);
|
|
@@ -8479,7 +9390,11 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8479
9390
|
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
|
|
8480
9391
|
};
|
|
8481
9392
|
const k2 = (e) => {
|
|
8482
|
-
if (e.key
|
|
9393
|
+
if (e.key !== "Escape") return;
|
|
9394
|
+
setOpen(false);
|
|
9395
|
+
if (rootRef.current && rootRef.current.contains(document.activeElement)) {
|
|
9396
|
+
triggerRef.current?.focus();
|
|
9397
|
+
}
|
|
8483
9398
|
};
|
|
8484
9399
|
document.addEventListener("mousedown", h);
|
|
8485
9400
|
document.addEventListener("keydown", k2);
|
|
@@ -8488,6 +9403,15 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8488
9403
|
document.removeEventListener("keydown", k2);
|
|
8489
9404
|
};
|
|
8490
9405
|
}, [open]);
|
|
9406
|
+
useEffect(() => {
|
|
9407
|
+
if (!open) return;
|
|
9408
|
+
const id = requestAnimationFrame(() => {
|
|
9409
|
+
const cols = panelRef.current?.querySelectorAll(".klun-cascader__column");
|
|
9410
|
+
const last = cols && cols.length ? cols[cols.length - 1] : null;
|
|
9411
|
+
last?.querySelector(".klun-cascader__option:not([disabled])")?.focus();
|
|
9412
|
+
});
|
|
9413
|
+
return () => cancelAnimationFrame(id);
|
|
9414
|
+
}, [open]);
|
|
8491
9415
|
const columns = [];
|
|
8492
9416
|
let level = options;
|
|
8493
9417
|
columns.push(level);
|
|
@@ -8517,6 +9441,62 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8517
9441
|
if (leaf) setOpen(false);
|
|
8518
9442
|
}
|
|
8519
9443
|
};
|
|
9444
|
+
const onPanelKeyDown = (e) => {
|
|
9445
|
+
const target = e.target;
|
|
9446
|
+
const option = target.closest(".klun-cascader__option");
|
|
9447
|
+
if (!option) return;
|
|
9448
|
+
const column = option.closest(".klun-cascader__column");
|
|
9449
|
+
if (!column) return;
|
|
9450
|
+
const all = Array.from(column.querySelectorAll(".klun-cascader__option"));
|
|
9451
|
+
const enabled = all.filter((el) => !el.disabled);
|
|
9452
|
+
const i = enabled.indexOf(option);
|
|
9453
|
+
const colIdx = Array.from(
|
|
9454
|
+
panelRef.current?.querySelectorAll(".klun-cascader__column") ?? []
|
|
9455
|
+
).indexOf(column);
|
|
9456
|
+
const focusIntoColumn = (n) => {
|
|
9457
|
+
const cols = panelRef.current?.querySelectorAll(".klun-cascader__column");
|
|
9458
|
+
cols?.[n]?.querySelector(".klun-cascader__option:not([disabled])")?.focus();
|
|
9459
|
+
};
|
|
9460
|
+
switch (e.key) {
|
|
9461
|
+
case "ArrowDown":
|
|
9462
|
+
e.preventDefault();
|
|
9463
|
+
enabled[(i + 1) % enabled.length]?.focus();
|
|
9464
|
+
break;
|
|
9465
|
+
case "ArrowUp":
|
|
9466
|
+
e.preventDefault();
|
|
9467
|
+
enabled[(i - 1 + enabled.length) % enabled.length]?.focus();
|
|
9468
|
+
break;
|
|
9469
|
+
case "Home":
|
|
9470
|
+
e.preventDefault();
|
|
9471
|
+
enabled[0]?.focus();
|
|
9472
|
+
break;
|
|
9473
|
+
case "End":
|
|
9474
|
+
e.preventDefault();
|
|
9475
|
+
enabled[enabled.length - 1]?.focus();
|
|
9476
|
+
break;
|
|
9477
|
+
case "ArrowRight": {
|
|
9478
|
+
e.preventDefault();
|
|
9479
|
+
const opt = columns[colIdx]?.[all.indexOf(option)];
|
|
9480
|
+
if (opt && opt.children && opt.children.length) {
|
|
9481
|
+
pick(colIdx, opt);
|
|
9482
|
+
requestAnimationFrame(() => focusIntoColumn(colIdx + 1));
|
|
9483
|
+
}
|
|
9484
|
+
break;
|
|
9485
|
+
}
|
|
9486
|
+
case "ArrowLeft":
|
|
9487
|
+
e.preventDefault();
|
|
9488
|
+
if (colIdx > 0) focusIntoColumn(colIdx - 1);
|
|
9489
|
+
break;
|
|
9490
|
+
case "Escape":
|
|
9491
|
+
e.preventDefault();
|
|
9492
|
+
setOpen(false);
|
|
9493
|
+
triggerRef.current?.focus();
|
|
9494
|
+
break;
|
|
9495
|
+
case "Tab":
|
|
9496
|
+
setOpen(false);
|
|
9497
|
+
break;
|
|
9498
|
+
}
|
|
9499
|
+
};
|
|
8520
9500
|
const clear = () => {
|
|
8521
9501
|
if (value === void 0) setInner([]);
|
|
8522
9502
|
setActive([]);
|
|
@@ -8539,11 +9519,12 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8539
9519
|
/* @__PURE__ */ jsxs(
|
|
8540
9520
|
"button",
|
|
8541
9521
|
{
|
|
9522
|
+
ref: triggerRef,
|
|
8542
9523
|
type: "button",
|
|
8543
9524
|
className: "klun-cascader__trigger",
|
|
8544
9525
|
disabled,
|
|
8545
9526
|
onClick: () => setOpen((o) => !o),
|
|
8546
|
-
"aria-haspopup": "
|
|
9527
|
+
"aria-haspopup": "menu",
|
|
8547
9528
|
"aria-expanded": open,
|
|
8548
9529
|
"data-empty": labelPath.length ? void 0 : "",
|
|
8549
9530
|
children: [
|
|
@@ -8589,9 +9570,11 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8589
9570
|
]
|
|
8590
9571
|
}
|
|
8591
9572
|
),
|
|
8592
|
-
open ? /* @__PURE__ */ jsx("div", { className: "klun-cascader__panel", role: "menu", children: columns.map((col, ci) => /* @__PURE__ */ jsx(
|
|
9573
|
+
open ? /* @__PURE__ */ jsx("div", { ref: panelRef, className: "klun-cascader__panel", role: "menu", onKeyDown: onPanelKeyDown, children: columns.map((col, ci) => /* @__PURE__ */ jsx(
|
|
8593
9574
|
"div",
|
|
8594
9575
|
{
|
|
9576
|
+
role: "group",
|
|
9577
|
+
"aria-label": ci === 0 ? cascader.placeholder : String(active[ci - 1] ?? ""),
|
|
8595
9578
|
className: cx(
|
|
8596
9579
|
"klun-cascader__column",
|
|
8597
9580
|
ci < columns.length - 1 && "klun-cascader__column--divided"
|
|
@@ -8603,11 +9586,11 @@ var Cascader = forwardRef(function Cascader2({
|
|
|
8603
9586
|
"button",
|
|
8604
9587
|
{
|
|
8605
9588
|
type: "button",
|
|
8606
|
-
role: "
|
|
9589
|
+
role: "menuitemradio",
|
|
8607
9590
|
className: "klun-cascader__option",
|
|
8608
9591
|
disabled: opt.disabled,
|
|
8609
9592
|
onClick: () => pick(ci, opt),
|
|
8610
|
-
"aria-
|
|
9593
|
+
"aria-checked": selected,
|
|
8611
9594
|
"data-selected": selected || void 0,
|
|
8612
9595
|
children: [
|
|
8613
9596
|
/* @__PURE__ */ jsx("span", { className: "klun-cascader__option-label", children: renderOption ? renderOption(opt, ci) : opt.label }),
|
|
@@ -9112,7 +10095,9 @@ function SelectListbox({
|
|
|
9112
10095
|
onActivate,
|
|
9113
10096
|
onPick,
|
|
9114
10097
|
className,
|
|
9115
|
-
anchorRef
|
|
10098
|
+
anchorRef,
|
|
10099
|
+
id,
|
|
10100
|
+
optionId
|
|
9116
10101
|
}) {
|
|
9117
10102
|
const portal = !!anchorRef && typeof document !== "undefined";
|
|
9118
10103
|
const panelRef = useRef(null);
|
|
@@ -9160,12 +10145,14 @@ function SelectListbox({
|
|
|
9160
10145
|
"div",
|
|
9161
10146
|
{
|
|
9162
10147
|
ref: panelRef,
|
|
10148
|
+
id,
|
|
9163
10149
|
role: "listbox",
|
|
9164
10150
|
className: className ? `klun-select-listbox ${className}` : "klun-select-listbox",
|
|
9165
10151
|
style: portalStyle,
|
|
9166
10152
|
children: options.map((o, i) => /* @__PURE__ */ jsxs(
|
|
9167
10153
|
"button",
|
|
9168
10154
|
{
|
|
10155
|
+
id: optionId?.(i),
|
|
9169
10156
|
type: "button",
|
|
9170
10157
|
role: "option",
|
|
9171
10158
|
"aria-selected": o.value === current,
|
|
@@ -9713,7 +10700,7 @@ var DEFAULT_FORMAT = {
|
|
|
9713
10700
|
day: "numeric"
|
|
9714
10701
|
};
|
|
9715
10702
|
var Calendar = forwardRef(function Calendar2({ value, onPick, className, style }, ref) {
|
|
9716
|
-
const { datePicker } = useLocale();
|
|
10703
|
+
const { datePicker, pagination, locale } = useLocale();
|
|
9717
10704
|
const initial = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
9718
10705
|
const [view, setView] = useState(new Date(initial.getFullYear(), initial.getMonth(), 1));
|
|
9719
10706
|
const sel = value ? new Date(value) : null;
|
|
@@ -9726,34 +10713,69 @@ var Calendar = forwardRef(function Calendar2({ value, onPick, className, style }
|
|
|
9726
10713
|
const cells = [];
|
|
9727
10714
|
for (let i = 0; i < firstDay; i++) cells.push(null);
|
|
9728
10715
|
for (let d = 1; d <= daysInMonth; d++) cells.push(new Date(y, m, d));
|
|
9729
|
-
return /* @__PURE__ */ jsxs(
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
datePicker.
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
10716
|
+
return /* @__PURE__ */ jsxs(
|
|
10717
|
+
"div",
|
|
10718
|
+
{
|
|
10719
|
+
ref,
|
|
10720
|
+
className: cx("klun-date-picker", className),
|
|
10721
|
+
style,
|
|
10722
|
+
role: "group",
|
|
10723
|
+
"aria-label": fmt(datePicker.title, { month: datePicker.months[m], year: y }),
|
|
10724
|
+
children: [
|
|
10725
|
+
/* @__PURE__ */ jsxs("div", { className: "klun-date-picker__header", children: [
|
|
10726
|
+
/* @__PURE__ */ jsx(
|
|
10727
|
+
"button",
|
|
10728
|
+
{
|
|
10729
|
+
type: "button",
|
|
10730
|
+
className: "klun-date-picker__nav",
|
|
10731
|
+
"aria-label": pagination.previous,
|
|
10732
|
+
onClick: () => setView(new Date(y, m - 1, 1)),
|
|
10733
|
+
children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M12 6l-4 4 4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
10734
|
+
}
|
|
10735
|
+
),
|
|
10736
|
+
/* @__PURE__ */ jsx("span", { className: "klun-date-picker__title", children: fmt(datePicker.title, { month: datePicker.months[m], year: y }) }),
|
|
10737
|
+
/* @__PURE__ */ jsx(
|
|
10738
|
+
"button",
|
|
10739
|
+
{
|
|
10740
|
+
type: "button",
|
|
10741
|
+
className: "klun-date-picker__nav",
|
|
10742
|
+
"aria-label": pagination.next,
|
|
10743
|
+
onClick: () => setView(new Date(y, m + 1, 1)),
|
|
10744
|
+
children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M8 6l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
10745
|
+
}
|
|
10746
|
+
)
|
|
10747
|
+
] }),
|
|
10748
|
+
/* @__PURE__ */ jsxs("div", { className: "klun-date-picker__grid", children: [
|
|
10749
|
+
datePicker.weekdaysShort.map((d, i) => /* @__PURE__ */ jsx("div", { className: "klun-date-picker__weekday", children: d }, i)),
|
|
10750
|
+
cells.map((date, i) => {
|
|
10751
|
+
if (!date) return /* @__PURE__ */ jsx("span", {}, i);
|
|
10752
|
+
return /* @__PURE__ */ jsx(
|
|
10753
|
+
"button",
|
|
10754
|
+
{
|
|
10755
|
+
type: "button",
|
|
10756
|
+
className: "klun-date-picker__day",
|
|
10757
|
+
"data-selected": same(date, sel) || void 0,
|
|
10758
|
+
"data-today": same(date, today) || void 0,
|
|
10759
|
+
"aria-label": date.toLocaleDateString(locale, {
|
|
10760
|
+
weekday: "long",
|
|
10761
|
+
year: "numeric",
|
|
10762
|
+
month: "long",
|
|
10763
|
+
day: "numeric"
|
|
10764
|
+
}),
|
|
10765
|
+
"aria-current": same(date, today) ? "date" : void 0,
|
|
10766
|
+
onClick: () => onPick(date),
|
|
10767
|
+
children: date.getDate()
|
|
10768
|
+
},
|
|
10769
|
+
i
|
|
10770
|
+
);
|
|
10771
|
+
})
|
|
10772
|
+
] })
|
|
10773
|
+
]
|
|
10774
|
+
}
|
|
10775
|
+
);
|
|
9754
10776
|
});
|
|
9755
10777
|
var DatePicker = forwardRef(
|
|
9756
|
-
function DatePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT, align = "
|
|
10778
|
+
function DatePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT, align = "start", disabled, className, style, ...props }, ref) {
|
|
9757
10779
|
if (inline2) {
|
|
9758
10780
|
return /* @__PURE__ */ jsx(Calendar, { ref, value, onPick: (d) => onChange?.(d), className, style });
|
|
9759
10781
|
}
|
|
@@ -9767,6 +10789,7 @@ var DatePicker = forwardRef(
|
|
|
9767
10789
|
Input,
|
|
9768
10790
|
{
|
|
9769
10791
|
readOnly: true,
|
|
10792
|
+
className: "klun-input--trigger",
|
|
9770
10793
|
disabled,
|
|
9771
10794
|
value: label,
|
|
9772
10795
|
placeholder: placeholder ?? "Select date",
|
|
@@ -9851,7 +10874,7 @@ var RangeCalendar = forwardRef(function RangeCalendar2({ start, end, onPick, cla
|
|
|
9851
10874
|
] });
|
|
9852
10875
|
});
|
|
9853
10876
|
var DateRangePicker = forwardRef(
|
|
9854
|
-
function DateRangePicker2({ start, end, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT2, align = "
|
|
10877
|
+
function DateRangePicker2({ start, end, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT2, align = "start", disabled, className, style, ...props }, ref) {
|
|
9855
10878
|
if (inline2) {
|
|
9856
10879
|
return /* @__PURE__ */ jsx(
|
|
9857
10880
|
RangeCalendar,
|
|
@@ -9876,6 +10899,7 @@ var DateRangePicker = forwardRef(
|
|
|
9876
10899
|
Input,
|
|
9877
10900
|
{
|
|
9878
10901
|
readOnly: true,
|
|
10902
|
+
className: "klun-input--trigger",
|
|
9879
10903
|
disabled,
|
|
9880
10904
|
value: label,
|
|
9881
10905
|
placeholder: placeholder ?? "Select range",
|
|
@@ -10129,7 +11153,7 @@ function DateTimePanel({ value, onChange }) {
|
|
|
10129
11153
|
] });
|
|
10130
11154
|
}
|
|
10131
11155
|
var DateTimePicker = forwardRef(
|
|
10132
|
-
function DateTimePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT3, align = "
|
|
11156
|
+
function DateTimePicker2({ value, onChange, inline: inline2, placeholder, format = DEFAULT_FORMAT3, align = "start", disabled, className, style, ...props }, ref) {
|
|
10133
11157
|
const date = value ? new Date(value) : null;
|
|
10134
11158
|
if (inline2) {
|
|
10135
11159
|
return /* @__PURE__ */ jsx("div", { ref, className: cx("klun-date-time-picker", className), style, ...props, children: /* @__PURE__ */ jsx(DateTimePanel, { value: date, onChange: (d) => onChange?.(d) }) });
|
|
@@ -10144,6 +11168,7 @@ var DateTimePicker = forwardRef(
|
|
|
10144
11168
|
Input,
|
|
10145
11169
|
{
|
|
10146
11170
|
readOnly: true,
|
|
11171
|
+
className: "klun-input--trigger",
|
|
10147
11172
|
disabled,
|
|
10148
11173
|
value: label,
|
|
10149
11174
|
placeholder: placeholder ?? "Select date & time",
|
|
@@ -10260,13 +11285,24 @@ var FileUpload = forwardRef(function FileUpload2({ onFiles, hint = "SVG, PNG, JP
|
|
|
10260
11285
|
const { fileUpload } = useLocale();
|
|
10261
11286
|
const [over, setOver] = useState(false);
|
|
10262
11287
|
const inputRef = useRef(null);
|
|
11288
|
+
const openPicker = () => inputRef.current?.click();
|
|
11289
|
+
const dropzoneLabel = `${fileUpload.clickToUpload} ${fileUpload.orDragAndDrop}`;
|
|
10263
11290
|
return /* @__PURE__ */ jsxs(
|
|
10264
11291
|
"div",
|
|
10265
11292
|
{
|
|
10266
11293
|
ref,
|
|
10267
11294
|
className: cx("klun-file-upload", className),
|
|
11295
|
+
role: "button",
|
|
11296
|
+
tabIndex: 0,
|
|
11297
|
+
"aria-label": dropzoneLabel,
|
|
10268
11298
|
"data-dragover": over || void 0,
|
|
10269
|
-
onClick:
|
|
11299
|
+
onClick: openPicker,
|
|
11300
|
+
onKeyDown: (e) => {
|
|
11301
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
11302
|
+
e.preventDefault();
|
|
11303
|
+
openPicker();
|
|
11304
|
+
}
|
|
11305
|
+
},
|
|
10270
11306
|
onDragOver: (e) => {
|
|
10271
11307
|
e.preventDefault();
|
|
10272
11308
|
setOver(true);
|
|
@@ -10286,6 +11322,7 @@ var FileUpload = forwardRef(function FileUpload2({ onFiles, hint = "SVG, PNG, JP
|
|
|
10286
11322
|
type: "file",
|
|
10287
11323
|
multiple: true,
|
|
10288
11324
|
hidden: true,
|
|
11325
|
+
tabIndex: -1,
|
|
10289
11326
|
onChange: (e) => onFiles?.([...e.target.files ?? []])
|
|
10290
11327
|
}
|
|
10291
11328
|
),
|
|
@@ -10383,9 +11420,6 @@ function useForm(opts = {}) {
|
|
|
10383
11420
|
const unregisterField = useCallback((key) => {
|
|
10384
11421
|
delete fields.current[key];
|
|
10385
11422
|
}, []);
|
|
10386
|
-
const registerRules = useCallback((name, rules) => {
|
|
10387
|
-
fields.current[pathKey(name)] = { name, rules: rules || [] };
|
|
10388
|
-
}, []);
|
|
10389
11423
|
const getFieldValue = useCallback((name) => getIn(valuesRef.current, name), []);
|
|
10390
11424
|
const getFieldsValue = useCallback(() => valuesRef.current, []);
|
|
10391
11425
|
const validateField = useCallback(async (name) => {
|
|
@@ -10504,7 +11538,6 @@ function useForm(opts = {}) {
|
|
|
10504
11538
|
setValues,
|
|
10505
11539
|
getFieldValue,
|
|
10506
11540
|
getFieldsValue,
|
|
10507
|
-
registerRules,
|
|
10508
11541
|
registerField,
|
|
10509
11542
|
unregisterField,
|
|
10510
11543
|
validate,
|
|
@@ -10577,22 +11610,35 @@ function FormItem({
|
|
|
10577
11610
|
const error = form && key ? form.touched[key] && form.errors[key] : null;
|
|
10578
11611
|
const ruleArr = typeof rules === "function" ? [] : rules || [];
|
|
10579
11612
|
const isRequired = required || ruleArr.some((r) => r.required);
|
|
11613
|
+
const autoId = useId();
|
|
11614
|
+
const childIsElement = isValidElement(children);
|
|
11615
|
+
const childProps = childIsElement ? children.props : {};
|
|
11616
|
+
const controlId = childIsElement ? childProps.id ?? `${autoId}control` : void 0;
|
|
11617
|
+
const errorId = controlId ? `${controlId}-error` : void 0;
|
|
11618
|
+
const helpId = controlId ? `${controlId}-help` : void 0;
|
|
11619
|
+
const hasError = Boolean(error);
|
|
11620
|
+
const descriptionId = hasError ? errorId : help ? helpId : void 0;
|
|
10580
11621
|
let control = children;
|
|
10581
|
-
if (
|
|
10582
|
-
const
|
|
10583
|
-
|
|
10584
|
-
value
|
|
10585
|
-
error:
|
|
10586
|
-
onChange
|
|
11622
|
+
if (childIsElement) {
|
|
11623
|
+
const merged = { id: controlId };
|
|
11624
|
+
if (form && fullName != null) {
|
|
11625
|
+
merged.value = form._getIn(form.values, fullName) ?? childProps.value ?? "";
|
|
11626
|
+
merged.error = hasError ? true : void 0;
|
|
11627
|
+
merged.onChange = (e) => {
|
|
10587
11628
|
const v = e && e.target ? childProps.type === "checkbox" ? e.target.checked : e.target.value : e;
|
|
10588
11629
|
form.setFieldValue(fullName, v);
|
|
10589
11630
|
childProps.onChange?.(e);
|
|
10590
|
-
}
|
|
10591
|
-
onBlur
|
|
11631
|
+
};
|
|
11632
|
+
merged.onBlur = (e) => {
|
|
10592
11633
|
form.setFieldTouched(fullName);
|
|
10593
11634
|
childProps.onBlur?.(e);
|
|
10594
|
-
}
|
|
10595
|
-
}
|
|
11635
|
+
};
|
|
11636
|
+
}
|
|
11637
|
+
if (hasError) merged["aria-invalid"] = true;
|
|
11638
|
+
if (isRequired) merged["aria-required"] = true;
|
|
11639
|
+
const describedBy = [childProps["aria-describedby"], descriptionId].filter(Boolean).join(" ");
|
|
11640
|
+
if (describedBy) merged["aria-describedby"] = describedBy;
|
|
11641
|
+
control = cloneElement(children, merged);
|
|
10596
11642
|
}
|
|
10597
11643
|
return /* @__PURE__ */ jsxs(
|
|
10598
11644
|
"div",
|
|
@@ -10601,13 +11647,13 @@ function FormItem({
|
|
|
10601
11647
|
className: cx("klun-form-item", horizontal && "klun-form-item--horizontal", className),
|
|
10602
11648
|
...props,
|
|
10603
11649
|
children: [
|
|
10604
|
-
label ? /* @__PURE__ */ jsxs("label", { className: "klun-form-item__label", children: [
|
|
11650
|
+
label ? /* @__PURE__ */ jsxs("label", { className: "klun-form-item__label", htmlFor: controlId, children: [
|
|
10605
11651
|
label,
|
|
10606
|
-
isRequired ? /* @__PURE__ */ jsx("span", { className: "klun-form-item__required", children: "*" }) : null
|
|
11652
|
+
isRequired ? /* @__PURE__ */ jsx("span", { className: "klun-form-item__required", "aria-hidden": "true", children: "*" }) : null
|
|
10607
11653
|
] }) : null,
|
|
10608
11654
|
/* @__PURE__ */ jsxs("div", { className: "klun-form-item__control", children: [
|
|
10609
11655
|
control,
|
|
10610
|
-
|
|
11656
|
+
hasError ? /* @__PURE__ */ jsx("span", { id: errorId, className: "klun-form-item__error", children: error }) : help ? /* @__PURE__ */ jsx("span", { id: helpId, className: "klun-form-item__help", children: help }) : null
|
|
10611
11657
|
] })
|
|
10612
11658
|
]
|
|
10613
11659
|
}
|
|
@@ -10668,6 +11714,241 @@ var Hint = forwardRef(function Hint2({ children, error = false, icon, className,
|
|
|
10668
11714
|
);
|
|
10669
11715
|
});
|
|
10670
11716
|
Hint.displayName = "Hint";
|
|
11717
|
+
|
|
11718
|
+
// src/components/overlays/overlayStack.ts
|
|
11719
|
+
var OVERLAY_LAYER = {
|
|
11720
|
+
pagePopup: 100,
|
|
11721
|
+
modalRoot: 1e3,
|
|
11722
|
+
modalStep: 100,
|
|
11723
|
+
popupOffset: 20,
|
|
11724
|
+
tooltipOffset: 30
|
|
11725
|
+
};
|
|
11726
|
+
var stack = [];
|
|
11727
|
+
var scopeRoots = /* @__PURE__ */ new Map();
|
|
11728
|
+
var scrollLockCount = 0;
|
|
11729
|
+
var savedOverflow = null;
|
|
11730
|
+
var canUseDOM = () => typeof document !== "undefined";
|
|
11731
|
+
function pushOverlay() {
|
|
11732
|
+
const id = /* @__PURE__ */ Symbol("klun-overlay");
|
|
11733
|
+
stack.push(id);
|
|
11734
|
+
scopeRoots.set(id, /* @__PURE__ */ new Set());
|
|
11735
|
+
lockScroll();
|
|
11736
|
+
return id;
|
|
11737
|
+
}
|
|
11738
|
+
function popOverlay(id) {
|
|
11739
|
+
const i = stack.indexOf(id);
|
|
11740
|
+
if (i === -1) return;
|
|
11741
|
+
stack.splice(i, 1);
|
|
11742
|
+
scopeRoots.delete(id);
|
|
11743
|
+
unlockScroll();
|
|
11744
|
+
}
|
|
11745
|
+
function isTopOverlay(id) {
|
|
11746
|
+
return stack.length > 0 && stack[stack.length - 1] === id;
|
|
11747
|
+
}
|
|
11748
|
+
function overlayDepth(id) {
|
|
11749
|
+
return stack.indexOf(id);
|
|
11750
|
+
}
|
|
11751
|
+
function layerBaseFor(id) {
|
|
11752
|
+
const depth = Math.max(0, overlayDepth(id));
|
|
11753
|
+
return OVERLAY_LAYER.modalRoot + depth * OVERLAY_LAYER.modalStep;
|
|
11754
|
+
}
|
|
11755
|
+
function registerScopeRoot(id, el) {
|
|
11756
|
+
const set = scopeRoots.get(id);
|
|
11757
|
+
if (!set || !el) return;
|
|
11758
|
+
set.add(el);
|
|
11759
|
+
}
|
|
11760
|
+
function unregisterScopeRoot(id, el) {
|
|
11761
|
+
if (!el) return;
|
|
11762
|
+
scopeRoots.get(id)?.delete(el);
|
|
11763
|
+
}
|
|
11764
|
+
function getScopeRoots(id) {
|
|
11765
|
+
const set = scopeRoots.get(id);
|
|
11766
|
+
if (!set) return [];
|
|
11767
|
+
return [...set].filter((el) => el.isConnected);
|
|
11768
|
+
}
|
|
11769
|
+
function lockScroll() {
|
|
11770
|
+
if (!canUseDOM()) return;
|
|
11771
|
+
if (scrollLockCount === 0) {
|
|
11772
|
+
savedOverflow = document.body.style.overflow;
|
|
11773
|
+
document.body.style.overflow = "hidden";
|
|
11774
|
+
}
|
|
11775
|
+
scrollLockCount += 1;
|
|
11776
|
+
}
|
|
11777
|
+
function unlockScroll() {
|
|
11778
|
+
if (!canUseDOM()) return;
|
|
11779
|
+
scrollLockCount = Math.max(0, scrollLockCount - 1);
|
|
11780
|
+
if (scrollLockCount === 0) {
|
|
11781
|
+
document.body.style.overflow = savedOverflow ?? "";
|
|
11782
|
+
savedOverflow = null;
|
|
11783
|
+
}
|
|
11784
|
+
}
|
|
11785
|
+
var inertedByUs = /* @__PURE__ */ new WeakMap();
|
|
11786
|
+
function applyBackgroundInert(roots) {
|
|
11787
|
+
if (!canUseDOM() || roots.length === 0) return;
|
|
11788
|
+
for (const root of roots) {
|
|
11789
|
+
let node = root;
|
|
11790
|
+
while (node && node.parentElement) {
|
|
11791
|
+
const parent = node.parentElement;
|
|
11792
|
+
for (const sibling of Array.from(parent.children)) {
|
|
11793
|
+
if (sibling === node) continue;
|
|
11794
|
+
if (!(sibling instanceof HTMLElement)) continue;
|
|
11795
|
+
if (roots.some((r) => sibling.contains(r))) continue;
|
|
11796
|
+
if (!sibling.hasAttribute("inert") && !inertedByUs.has(sibling)) {
|
|
11797
|
+
sibling.setAttribute("inert", "");
|
|
11798
|
+
inertedByUs.set(sibling, true);
|
|
11799
|
+
}
|
|
11800
|
+
}
|
|
11801
|
+
node = parent;
|
|
11802
|
+
if (node === document.body) break;
|
|
11803
|
+
}
|
|
11804
|
+
}
|
|
11805
|
+
}
|
|
11806
|
+
function releaseBackgroundInert() {
|
|
11807
|
+
if (!canUseDOM()) return;
|
|
11808
|
+
for (const el of document.querySelectorAll("[inert]")) {
|
|
11809
|
+
if (inertedByUs.get(el)) {
|
|
11810
|
+
el.removeAttribute("inert");
|
|
11811
|
+
inertedByUs.delete(el);
|
|
11812
|
+
}
|
|
11813
|
+
}
|
|
11814
|
+
}
|
|
11815
|
+
function isFocusable(el) {
|
|
11816
|
+
if (el.hasAttribute("disabled")) return false;
|
|
11817
|
+
if (el.getAttribute("aria-hidden") === "true") return false;
|
|
11818
|
+
if (el.hasAttribute("hidden")) return false;
|
|
11819
|
+
if (typeof getComputedStyle === "function") {
|
|
11820
|
+
const cs = getComputedStyle(el);
|
|
11821
|
+
if (cs.display === "none" || cs.visibility === "hidden") return false;
|
|
11822
|
+
}
|
|
11823
|
+
if (el.getAttribute("tabindex") === "-1") return false;
|
|
11824
|
+
return true;
|
|
11825
|
+
}
|
|
11826
|
+
var FOCUSABLE_SELECTOR = [
|
|
11827
|
+
"a[href]",
|
|
11828
|
+
"button",
|
|
11829
|
+
"input:not([type='hidden'])",
|
|
11830
|
+
"select",
|
|
11831
|
+
"textarea",
|
|
11832
|
+
"[tabindex]",
|
|
11833
|
+
"audio[controls]",
|
|
11834
|
+
"video[controls]",
|
|
11835
|
+
"[contenteditable]:not([contenteditable='false'])"
|
|
11836
|
+
].join(",");
|
|
11837
|
+
function focusablesIn(roots) {
|
|
11838
|
+
const out = [];
|
|
11839
|
+
for (const root of roots) {
|
|
11840
|
+
for (const el of Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR))) {
|
|
11841
|
+
if (isFocusable(el)) out.push(el);
|
|
11842
|
+
}
|
|
11843
|
+
}
|
|
11844
|
+
return out;
|
|
11845
|
+
}
|
|
11846
|
+
function useOverlayScope({
|
|
11847
|
+
active,
|
|
11848
|
+
onEscape,
|
|
11849
|
+
escapeEnabled = true,
|
|
11850
|
+
autoFocus = true,
|
|
11851
|
+
restoreFocus = true,
|
|
11852
|
+
inertBackground = true
|
|
11853
|
+
}) {
|
|
11854
|
+
const [scopeId, setScopeId] = useState(null);
|
|
11855
|
+
const nodeRef = useRef(null);
|
|
11856
|
+
const restoreTo = useRef(null);
|
|
11857
|
+
const onEscapeRef = useRef(onEscape);
|
|
11858
|
+
onEscapeRef.current = onEscape;
|
|
11859
|
+
useEffect(() => {
|
|
11860
|
+
if (!active) {
|
|
11861
|
+
setScopeId(null);
|
|
11862
|
+
return;
|
|
11863
|
+
}
|
|
11864
|
+
const id = pushOverlay();
|
|
11865
|
+
setScopeId(id);
|
|
11866
|
+
return () => {
|
|
11867
|
+
popOverlay(id);
|
|
11868
|
+
};
|
|
11869
|
+
}, [active]);
|
|
11870
|
+
useEffect(() => {
|
|
11871
|
+
if (!active || !scopeId) return;
|
|
11872
|
+
const container = nodeRef.current;
|
|
11873
|
+
registerScopeRoot(scopeId, container);
|
|
11874
|
+
if (restoreFocus) {
|
|
11875
|
+
restoreTo.current = document.activeElement ?? null;
|
|
11876
|
+
}
|
|
11877
|
+
if (autoFocus) {
|
|
11878
|
+
const items2 = focusablesIn(getScopeRoots(scopeId));
|
|
11879
|
+
const target = items2[0] ?? container;
|
|
11880
|
+
target?.focus?.();
|
|
11881
|
+
}
|
|
11882
|
+
if (inertBackground) applyBackgroundInert(getScopeRoots(scopeId));
|
|
11883
|
+
return () => {
|
|
11884
|
+
unregisterScopeRoot(scopeId, container);
|
|
11885
|
+
if (inertBackground) releaseBackgroundInert();
|
|
11886
|
+
if (restoreFocus) {
|
|
11887
|
+
const to = restoreTo.current;
|
|
11888
|
+
restoreTo.current = null;
|
|
11889
|
+
if (to && to.isConnected) to.focus?.();
|
|
11890
|
+
}
|
|
11891
|
+
};
|
|
11892
|
+
}, [active, scopeId]);
|
|
11893
|
+
useEffect(() => {
|
|
11894
|
+
if (!active || !scopeId) return;
|
|
11895
|
+
const onKeyDown = (e) => {
|
|
11896
|
+
if (e.key === "Escape") {
|
|
11897
|
+
if (!escapeEnabled) return;
|
|
11898
|
+
if (!isTopOverlay(scopeId)) {
|
|
11899
|
+
e.stopPropagation();
|
|
11900
|
+
return;
|
|
11901
|
+
}
|
|
11902
|
+
onEscapeRef.current?.();
|
|
11903
|
+
return;
|
|
11904
|
+
}
|
|
11905
|
+
if (e.key !== "Tab") return;
|
|
11906
|
+
if (!isTopOverlay(scopeId)) {
|
|
11907
|
+
e.preventDefault();
|
|
11908
|
+
return;
|
|
11909
|
+
}
|
|
11910
|
+
const items2 = focusablesIn(getScopeRoots(scopeId));
|
|
11911
|
+
if (items2.length === 0) {
|
|
11912
|
+
e.preventDefault();
|
|
11913
|
+
nodeRef.current?.focus?.();
|
|
11914
|
+
return;
|
|
11915
|
+
}
|
|
11916
|
+
const first = items2[0];
|
|
11917
|
+
const last = items2[items2.length - 1];
|
|
11918
|
+
const current = document.activeElement;
|
|
11919
|
+
const inside = current ? items2.includes(current) : false;
|
|
11920
|
+
if (e.shiftKey) {
|
|
11921
|
+
if (!inside || current === first) {
|
|
11922
|
+
e.preventDefault();
|
|
11923
|
+
last.focus();
|
|
11924
|
+
}
|
|
11925
|
+
} else if (!inside || current === last) {
|
|
11926
|
+
e.preventDefault();
|
|
11927
|
+
first.focus();
|
|
11928
|
+
}
|
|
11929
|
+
};
|
|
11930
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
11931
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
11932
|
+
}, [active, scopeId, escapeEnabled]);
|
|
11933
|
+
const setNode = useCallback((el) => {
|
|
11934
|
+
nodeRef.current = el;
|
|
11935
|
+
}, []);
|
|
11936
|
+
return {
|
|
11937
|
+
ref: setNode,
|
|
11938
|
+
scopeId,
|
|
11939
|
+
layerBase: scopeId ? layerBaseFor(scopeId) : OVERLAY_LAYER.modalRoot
|
|
11940
|
+
};
|
|
11941
|
+
}
|
|
11942
|
+
var OverlayLayerContext = createContext(null);
|
|
11943
|
+
function OverlayLayerProvider({ layerBase, children }) {
|
|
11944
|
+
return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: { layerBase }, children });
|
|
11945
|
+
}
|
|
11946
|
+
function useOverlayLayer(kind = "popup") {
|
|
11947
|
+
const ctx = useContext(OverlayLayerContext);
|
|
11948
|
+
const offset = kind === "tooltip" ? OVERLAY_LAYER.tooltipOffset : OVERLAY_LAYER.popupOffset;
|
|
11949
|
+
if (ctx) return ctx.layerBase + offset;
|
|
11950
|
+
return kind === "tooltip" ? OVERLAY_LAYER.modalRoot + OVERLAY_LAYER.tooltipOffset : OVERLAY_LAYER.pagePopup;
|
|
11951
|
+
}
|
|
10671
11952
|
var Modal = forwardRef(function Modal2({
|
|
10672
11953
|
open,
|
|
10673
11954
|
onClose,
|
|
@@ -10708,19 +11989,21 @@ var Modal = forwardRef(function Modal2({
|
|
|
10708
11989
|
const [maximized, setMaximized] = useState(defaultMaximized);
|
|
10709
11990
|
const drag = useRef(null);
|
|
10710
11991
|
const prevOpen = useRef(open);
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
11992
|
+
const scope = useOverlayScope({
|
|
11993
|
+
active: open,
|
|
11994
|
+
escapeEnabled: keyboard && closable,
|
|
11995
|
+
onEscape: cancel
|
|
11996
|
+
});
|
|
11997
|
+
const scopeRef = scope.ref;
|
|
11998
|
+
const titleId = `${useId()}title`;
|
|
11999
|
+
const attachDialogRef = useCallback(
|
|
12000
|
+
(el) => {
|
|
12001
|
+
scopeRef(el);
|
|
12002
|
+
if (typeof ref === "function") ref(el);
|
|
12003
|
+
else if (ref) ref.current = el;
|
|
12004
|
+
},
|
|
12005
|
+
[ref, scopeRef]
|
|
12006
|
+
);
|
|
10724
12007
|
useEffect(() => {
|
|
10725
12008
|
if (open) {
|
|
10726
12009
|
setPos({ x: 0, y: 0 });
|
|
@@ -10771,9 +12054,11 @@ var Modal = forwardRef(function Modal2({
|
|
|
10771
12054
|
children: /* @__PURE__ */ jsxs(
|
|
10772
12055
|
"div",
|
|
10773
12056
|
{
|
|
10774
|
-
ref,
|
|
12057
|
+
ref: attachDialogRef,
|
|
10775
12058
|
role: "dialog",
|
|
10776
12059
|
"aria-modal": "true",
|
|
12060
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
12061
|
+
tabIndex: -1,
|
|
10777
12062
|
onClick: (e) => e.stopPropagation(),
|
|
10778
12063
|
className: cx("klun-modal__dialog", maximized && "klun-modal__dialog--maximized", className),
|
|
10779
12064
|
style: dialogStyle,
|
|
@@ -10787,7 +12072,7 @@ var Modal = forwardRef(function Modal2({
|
|
|
10787
12072
|
children: [
|
|
10788
12073
|
icon ? /* @__PURE__ */ jsx("div", { className: "klun-modal__icon", children: icon }) : null,
|
|
10789
12074
|
/* @__PURE__ */ jsxs("div", { className: "klun-modal__heading", children: [
|
|
10790
|
-
title ? /* @__PURE__ */ jsx("div", { className: "klun-modal__title", children: title }) : null,
|
|
12075
|
+
title ? /* @__PURE__ */ jsx("div", { className: "klun-modal__title", id: titleId, children: title }) : null,
|
|
10791
12076
|
description ? /* @__PURE__ */ jsx("div", { className: "klun-modal__description", children: description }) : null
|
|
10792
12077
|
] }),
|
|
10793
12078
|
maximizable || closable ? /* @__PURE__ */ jsxs("div", { className: "klun-modal__actions", children: [
|
|
@@ -11055,7 +12340,7 @@ var ImageUpload = forwardRef(function ImageUpload2({
|
|
|
11055
12340
|
shape = "circle",
|
|
11056
12341
|
size = 96,
|
|
11057
12342
|
label,
|
|
11058
|
-
hint
|
|
12343
|
+
hint: hintProp,
|
|
11059
12344
|
onPick,
|
|
11060
12345
|
onRemove,
|
|
11061
12346
|
disabled = false,
|
|
@@ -11064,6 +12349,7 @@ var ImageUpload = forwardRef(function ImageUpload2({
|
|
|
11064
12349
|
...props
|
|
11065
12350
|
}, ref) {
|
|
11066
12351
|
const { imageUpload } = useLocale();
|
|
12352
|
+
const hint = hintProp ?? imageUpload.hint;
|
|
11067
12353
|
const [over, setOver] = useState(false);
|
|
11068
12354
|
const inputRef = useRef(null);
|
|
11069
12355
|
return /* @__PURE__ */ jsxs("div", { ref, className: cx("klun-image-upload", className), style, ...props, children: [
|
|
@@ -11671,17 +12957,20 @@ var RichEditor = forwardRef(function RichEditor2({
|
|
|
11671
12957
|
value,
|
|
11672
12958
|
defaultValue = "",
|
|
11673
12959
|
onChange,
|
|
11674
|
-
placeholder
|
|
12960
|
+
placeholder: placeholderProp,
|
|
11675
12961
|
disabled = false,
|
|
11676
12962
|
hideToolbar = false,
|
|
11677
12963
|
minHeight = 160,
|
|
11678
12964
|
maxHeight,
|
|
11679
12965
|
allowSource = true,
|
|
11680
|
-
editorLabel
|
|
12966
|
+
editorLabel: editorLabelProp,
|
|
11681
12967
|
className,
|
|
11682
12968
|
style,
|
|
11683
12969
|
...props
|
|
11684
12970
|
}, ref) {
|
|
12971
|
+
const { richEditor: localeRich } = useLocale();
|
|
12972
|
+
const placeholder = placeholderProp ?? localeRich.placeholder;
|
|
12973
|
+
const editorLabel = editorLabelProp ?? localeRich.editorLabel;
|
|
11685
12974
|
const editorRef = useRef(null);
|
|
11686
12975
|
const [active, setActive] = useState([]);
|
|
11687
12976
|
const [source, setSource] = useState(false);
|
|
@@ -11802,7 +13091,10 @@ var Select = forwardRef(function Select2({
|
|
|
11802
13091
|
const rootRef = useRef(null);
|
|
11803
13092
|
const s = useSelect({ children, value, defaultValue, disabled: disabled || loading, rootRef });
|
|
11804
13093
|
const { select: selectLocale } = useLocale();
|
|
11805
|
-
const
|
|
13094
|
+
const generatedId = useId();
|
|
13095
|
+
const listboxId = `${generatedId}listbox`;
|
|
13096
|
+
const optionId = (index) => `${listboxId}-option-${index}`;
|
|
13097
|
+
const fallbackLabel = !ariaLabel && !ariaLabelledBy ? placeholder || selectLocale?.placeholder || "Select" : void 0;
|
|
11806
13098
|
return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: cx("klun-select", `klun-select--${size}`, className), style, children: [
|
|
11807
13099
|
/* @__PURE__ */ jsxs(
|
|
11808
13100
|
"button",
|
|
@@ -11812,8 +13104,11 @@ var Select = forwardRef(function Select2({
|
|
|
11812
13104
|
disabled,
|
|
11813
13105
|
onClick: s.toggle,
|
|
11814
13106
|
onKeyDown: s.triggerKeyDown,
|
|
13107
|
+
role: "combobox",
|
|
11815
13108
|
"aria-haspopup": "listbox",
|
|
11816
13109
|
"aria-expanded": s.open,
|
|
13110
|
+
"aria-controls": s.open ? listboxId : void 0,
|
|
13111
|
+
"aria-activedescendant": s.open && s.active >= 0 ? optionId(s.active) : void 0,
|
|
11817
13112
|
"aria-label": ariaLabel ?? fallbackLabel,
|
|
11818
13113
|
"aria-labelledby": ariaLabelledBy,
|
|
11819
13114
|
"data-open": s.open || void 0,
|
|
@@ -11853,6 +13148,8 @@ var Select = forwardRef(function Select2({
|
|
|
11853
13148
|
s.open ? /* @__PURE__ */ jsx(
|
|
11854
13149
|
SelectListbox,
|
|
11855
13150
|
{
|
|
13151
|
+
id: listboxId,
|
|
13152
|
+
optionId,
|
|
11856
13153
|
anchorRef: s.triggerRef,
|
|
11857
13154
|
options: s.options,
|
|
11858
13155
|
current: s.current,
|
|
@@ -11874,7 +13171,7 @@ var SelectMenu = forwardRef(
|
|
|
11874
13171
|
leadingIcon,
|
|
11875
13172
|
error = false,
|
|
11876
13173
|
disabled = false,
|
|
11877
|
-
align = "
|
|
13174
|
+
align = "start",
|
|
11878
13175
|
className,
|
|
11879
13176
|
style,
|
|
11880
13177
|
...props
|
|
@@ -12554,6 +13851,7 @@ function computeSizes(panels, containerPx) {
|
|
|
12554
13851
|
return sizes;
|
|
12555
13852
|
}
|
|
12556
13853
|
var SplitterRoot = forwardRef(function Splitter({ layout = "horizontal", onResize, onResizeEnd, className, children, ...props }, forwardedRef) {
|
|
13854
|
+
const { a11y } = useLocale();
|
|
12557
13855
|
const containerRef = useRef(null);
|
|
12558
13856
|
const setRefs = useCallback(
|
|
12559
13857
|
(node) => {
|
|
@@ -12772,7 +14070,7 @@ var SplitterRoot = forwardRef(function Splitter({ layout = "horizontal", onResiz
|
|
|
12772
14070
|
{
|
|
12773
14071
|
type: "button",
|
|
12774
14072
|
className: "klun-splitter__collapse klun-splitter__collapse--start",
|
|
12775
|
-
"aria-label":
|
|
14073
|
+
"aria-label": a11y.collapseStart,
|
|
12776
14074
|
tabIndex: -1,
|
|
12777
14075
|
onPointerDown: (e) => e.stopPropagation(),
|
|
12778
14076
|
onClick: () => collapseToggle(i, i),
|
|
@@ -12784,7 +14082,7 @@ var SplitterRoot = forwardRef(function Splitter({ layout = "horizontal", onResiz
|
|
|
12784
14082
|
{
|
|
12785
14083
|
type: "button",
|
|
12786
14084
|
className: "klun-splitter__collapse klun-splitter__collapse--end",
|
|
12787
|
-
"aria-label":
|
|
14085
|
+
"aria-label": a11y.collapseEnd,
|
|
12788
14086
|
tabIndex: -1,
|
|
12789
14087
|
onPointerDown: (e) => e.stopPropagation(),
|
|
12790
14088
|
onClick: () => collapseToggle(i, i + 1),
|
|
@@ -13016,6 +14314,7 @@ var PageHeader = forwardRef(function PageHeader2({
|
|
|
13016
14314
|
children,
|
|
13017
14315
|
...props
|
|
13018
14316
|
}, ref) {
|
|
14317
|
+
const { a11y } = useLocale();
|
|
13019
14318
|
return /* @__PURE__ */ jsxs(
|
|
13020
14319
|
"header",
|
|
13021
14320
|
{
|
|
@@ -13037,7 +14336,7 @@ var PageHeader = forwardRef(function PageHeader2({
|
|
|
13037
14336
|
appearance: "ghost",
|
|
13038
14337
|
variant: "neutral",
|
|
13039
14338
|
size: "small",
|
|
13040
|
-
"aria-label":
|
|
14339
|
+
"aria-label": a11y.back,
|
|
13041
14340
|
className: "klun-page-header__back",
|
|
13042
14341
|
icon: /* @__PURE__ */ jsx("i", { className: "ri-arrow-left-line", "aria-hidden": true }),
|
|
13043
14342
|
onClick: onBack
|
|
@@ -13229,7 +14528,7 @@ var Sidebar = forwardRef(function Sidebar2({
|
|
|
13229
14528
|
onSelect,
|
|
13230
14529
|
defaultExpandedKeys = [],
|
|
13231
14530
|
searchable = false,
|
|
13232
|
-
searchPlaceholder
|
|
14531
|
+
searchPlaceholder: searchPlaceholderProp,
|
|
13233
14532
|
onSearch,
|
|
13234
14533
|
collapsed: collapsedProp,
|
|
13235
14534
|
defaultCollapsed = false,
|
|
@@ -13237,6 +14536,8 @@ var Sidebar = forwardRef(function Sidebar2({
|
|
|
13237
14536
|
className,
|
|
13238
14537
|
...props
|
|
13239
14538
|
}, ref) {
|
|
14539
|
+
const { sidebar: localeSidebar } = useLocale();
|
|
14540
|
+
const searchPlaceholder = searchPlaceholderProp ?? localeSidebar.searchPlaceholder;
|
|
13240
14541
|
const [internalNav, setInternalNav] = useState(defaultNavKey);
|
|
13241
14542
|
const [internalCollapsed, setInternalCollapsed] = useState(defaultCollapsed);
|
|
13242
14543
|
const [expandedKeys, setExpandedKeys] = useState(
|
|
@@ -13272,7 +14573,7 @@ var Sidebar = forwardRef(function Sidebar2({
|
|
|
13272
14573
|
"data-collapsed": collapsed ? "" : void 0,
|
|
13273
14574
|
...props,
|
|
13274
14575
|
children: [
|
|
13275
|
-
/* @__PURE__ */ jsxs("nav", { className: "klun-sidebar__rail", "aria-label":
|
|
14576
|
+
/* @__PURE__ */ jsxs("nav", { className: "klun-sidebar__rail", "aria-label": localeSidebar.primary, children: [
|
|
13276
14577
|
brand != null && /* @__PURE__ */ jsx("div", { className: "klun-sidebar__brand", children: brand }),
|
|
13277
14578
|
/* @__PURE__ */ jsx("div", { className: "klun-sidebar__nav", children: navItems.map((item) => /* @__PURE__ */ jsx(
|
|
13278
14579
|
RailButton,
|
|
@@ -13319,6 +14620,7 @@ var Sidebar = forwardRef(function Sidebar2({
|
|
|
13319
14620
|
type: "text",
|
|
13320
14621
|
className: "klun-sidebar__search-input",
|
|
13321
14622
|
placeholder: searchPlaceholder,
|
|
14623
|
+
"aria-label": searchPlaceholder,
|
|
13322
14624
|
value: query,
|
|
13323
14625
|
tabIndex: collapsed ? -1 : 0,
|
|
13324
14626
|
onChange: (e) => {
|
|
@@ -13688,6 +14990,7 @@ var Wizard = forwardRef(function Wizard2({
|
|
|
13688
14990
|
className,
|
|
13689
14991
|
...props
|
|
13690
14992
|
}, ref) {
|
|
14993
|
+
const { wizard } = useLocale();
|
|
13691
14994
|
const isControlled = current !== void 0;
|
|
13692
14995
|
const [internal, setInternal] = useState(defaultCurrent);
|
|
13693
14996
|
const idx = isControlled ? current : internal;
|
|
@@ -13732,7 +15035,7 @@ var Wizard = forwardRef(function Wizard2({
|
|
|
13732
15035
|
className: "klun-wizard__nav",
|
|
13733
15036
|
onClick: () => go(idx - 1),
|
|
13734
15037
|
disabled: idx === 0,
|
|
13735
|
-
children:
|
|
15038
|
+
children: wizard.back
|
|
13736
15039
|
}
|
|
13737
15040
|
),
|
|
13738
15041
|
!isLast ? /* @__PURE__ */ jsx(
|
|
@@ -13741,7 +15044,7 @@ var Wizard = forwardRef(function Wizard2({
|
|
|
13741
15044
|
type: "button",
|
|
13742
15045
|
className: "klun-wizard__nav klun-wizard__nav--primary",
|
|
13743
15046
|
onClick: () => go(idx + 1),
|
|
13744
|
-
children:
|
|
15047
|
+
children: wizard.next
|
|
13745
15048
|
}
|
|
13746
15049
|
) : /* @__PURE__ */ jsx(
|
|
13747
15050
|
"button",
|
|
@@ -13749,7 +15052,7 @@ var Wizard = forwardRef(function Wizard2({
|
|
|
13749
15052
|
type: "button",
|
|
13750
15053
|
className: "klun-wizard__nav klun-wizard__nav--primary",
|
|
13751
15054
|
onClick: () => onFinish?.(),
|
|
13752
|
-
children:
|
|
15055
|
+
children: wizard.finish
|
|
13753
15056
|
}
|
|
13754
15057
|
)
|
|
13755
15058
|
] })
|
|
@@ -13836,13 +15139,14 @@ var INTENT_ICON = {
|
|
|
13836
15139
|
warning: "ri-alert-line"
|
|
13837
15140
|
};
|
|
13838
15141
|
function ConfirmDialog({ opts, onClose }) {
|
|
15142
|
+
const { popconfirm } = useLocale();
|
|
13839
15143
|
const {
|
|
13840
|
-
title =
|
|
15144
|
+
title = popconfirm.title,
|
|
13841
15145
|
description,
|
|
13842
15146
|
icon,
|
|
13843
15147
|
intent = "primary",
|
|
13844
|
-
confirmText =
|
|
13845
|
-
cancelText =
|
|
15148
|
+
confirmText = popconfirm.confirm,
|
|
15149
|
+
cancelText = popconfirm.cancel,
|
|
13846
15150
|
requireInput,
|
|
13847
15151
|
onConfirm
|
|
13848
15152
|
} = opts;
|
|
@@ -13982,7 +15286,11 @@ function place(w, h, opts) {
|
|
|
13982
15286
|
let top;
|
|
13983
15287
|
if (opts.rect) {
|
|
13984
15288
|
const r = opts.rect;
|
|
13985
|
-
|
|
15289
|
+
if (opts.rtl) {
|
|
15290
|
+
left = r.left - w + 4 < GAP3 ? r.right - 4 : r.left - w + 4;
|
|
15291
|
+
} else {
|
|
15292
|
+
left = r.right - 4 + w > vw - GAP3 ? r.left - w + 4 : r.right - 4;
|
|
15293
|
+
}
|
|
13986
15294
|
top = r.top - 4;
|
|
13987
15295
|
} else {
|
|
13988
15296
|
const p = opts.point ?? { x: 0, y: 0 };
|
|
@@ -14004,7 +15312,9 @@ function MenuPanel({ items: items2, width, className, point, anchorEl, autoActiv
|
|
|
14004
15312
|
const el = ref.current;
|
|
14005
15313
|
const w = el?.offsetWidth ?? width;
|
|
14006
15314
|
const h = el?.offsetHeight ?? 0;
|
|
14007
|
-
|
|
15315
|
+
const dirHost = anchorEl ?? ref.current ?? document.body;
|
|
15316
|
+
const rtl = getComputedStyle(dirHost).direction === "rtl";
|
|
15317
|
+
setPos(place(w, h, anchorEl ? { rect: anchorEl.getBoundingClientRect(), rtl } : { point }));
|
|
14008
15318
|
}, [width, point?.x, point?.y, anchorEl, items2]);
|
|
14009
15319
|
const move = useCallback(
|
|
14010
15320
|
(dir) => {
|
|
@@ -14174,7 +15484,6 @@ var Drawer = forwardRef(function Drawer2({
|
|
|
14174
15484
|
onClose,
|
|
14175
15485
|
title,
|
|
14176
15486
|
placement,
|
|
14177
|
-
side,
|
|
14178
15487
|
width = "50%",
|
|
14179
15488
|
height = "50%",
|
|
14180
15489
|
size = "default",
|
|
@@ -14192,22 +15501,24 @@ var Drawer = forwardRef(function Drawer2({
|
|
|
14192
15501
|
...props
|
|
14193
15502
|
}, ref) {
|
|
14194
15503
|
const { drawer } = useLocale();
|
|
14195
|
-
const place2 = placement ??
|
|
15504
|
+
const place2 = placement ?? "right";
|
|
14196
15505
|
const horizontal = place2 === "left" || place2 === "right";
|
|
14197
15506
|
const prevOpen = useRef(open);
|
|
14198
|
-
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
15507
|
+
const scope = useOverlayScope({
|
|
15508
|
+
active: open,
|
|
15509
|
+
escapeEnabled: keyboard && closable,
|
|
15510
|
+
onEscape: onClose
|
|
15511
|
+
});
|
|
15512
|
+
const scopeRef = scope.ref;
|
|
15513
|
+
const titleId = `${useId()}title`;
|
|
15514
|
+
const attachPanelRef = useCallback(
|
|
15515
|
+
(el) => {
|
|
15516
|
+
scopeRef(el);
|
|
15517
|
+
if (typeof ref === "function") ref(el);
|
|
15518
|
+
else if (ref) ref.current = el;
|
|
15519
|
+
},
|
|
15520
|
+
[ref, scopeRef]
|
|
15521
|
+
);
|
|
14211
15522
|
useEffect(() => {
|
|
14212
15523
|
if (prevOpen.current !== open) {
|
|
14213
15524
|
afterOpenChange?.(open);
|
|
@@ -14226,16 +15537,18 @@ var Drawer = forwardRef(function Drawer2({
|
|
|
14226
15537
|
children: /* @__PURE__ */ jsxs(
|
|
14227
15538
|
"div",
|
|
14228
15539
|
{
|
|
14229
|
-
ref,
|
|
15540
|
+
ref: attachPanelRef,
|
|
14230
15541
|
role: "dialog",
|
|
14231
15542
|
"aria-modal": "true",
|
|
15543
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
15544
|
+
tabIndex: -1,
|
|
14232
15545
|
onClick: (e) => e.stopPropagation(),
|
|
14233
15546
|
className: cx("klun-drawer__panel", className),
|
|
14234
15547
|
style: panelStyle,
|
|
14235
15548
|
...props,
|
|
14236
15549
|
children: [
|
|
14237
15550
|
/* @__PURE__ */ jsxs("div", { className: "klun-drawer__header", children: [
|
|
14238
|
-
/* @__PURE__ */ jsx("div", { className: "klun-drawer__title", children: title }),
|
|
15551
|
+
/* @__PURE__ */ jsx("div", { className: "klun-drawer__title", id: title ? titleId : void 0, children: title }),
|
|
14239
15552
|
extra ? /* @__PURE__ */ jsx("div", { className: "klun-drawer__extra", children: extra }) : null,
|
|
14240
15553
|
closable ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onClose, "aria-label": drawer.close, className: "klun-drawer__close", children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) }) : null
|
|
14241
15554
|
] }),
|
|
@@ -14248,7 +15561,7 @@ var Drawer = forwardRef(function Drawer2({
|
|
|
14248
15561
|
);
|
|
14249
15562
|
});
|
|
14250
15563
|
Drawer.displayName = "Drawer";
|
|
14251
|
-
var Dropdown = forwardRef(function Dropdown2({ trigger, items: items2 = [], align = "
|
|
15564
|
+
var Dropdown = forwardRef(function Dropdown2({ trigger, items: items2 = [], align = "start", width = 220, className, ...props }, ref) {
|
|
14252
15565
|
const [open, setOpen] = useState(false);
|
|
14253
15566
|
const innerRef = useRef(null);
|
|
14254
15567
|
useEffect(() => {
|
|
@@ -14523,6 +15836,7 @@ function ImageViewer({
|
|
|
14523
15836
|
closeOnBackdrop = true,
|
|
14524
15837
|
className
|
|
14525
15838
|
}) {
|
|
15839
|
+
const { a11y, imageViewer, modal, pagination } = useLocale();
|
|
14526
15840
|
const gallery = items2 && items2.length > 0 ? items2 : src != null ? [{ src, alt }] : [];
|
|
14527
15841
|
const [innerIndex, setInnerIndex] = useState(0);
|
|
14528
15842
|
const idx = index ?? innerIndex;
|
|
@@ -14611,20 +15925,20 @@ function ImageViewer({
|
|
|
14611
15925
|
] }),
|
|
14612
15926
|
/* @__PURE__ */ jsxs("div", { className: "klun-image-viewer__tools", children: [
|
|
14613
15927
|
zoomable ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14614
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
15928
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": a11y.zoomOut, onClick: () => setScale((s) => clampScale(s - 0.25)), children: /* @__PURE__ */ jsx("i", { className: "ri-zoom-out-line" }) }),
|
|
14615
15929
|
/* @__PURE__ */ jsxs("span", { className: "klun-image-viewer__zoom", children: [
|
|
14616
15930
|
Math.round(scale * 100),
|
|
14617
15931
|
"%"
|
|
14618
15932
|
] }),
|
|
14619
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
15933
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": a11y.zoomIn, onClick: () => setScale((s) => clampScale(s + 0.25)), children: /* @__PURE__ */ jsx("i", { className: "ri-zoom-in-line" }) })
|
|
14620
15934
|
] }) : null,
|
|
14621
|
-
rotatable ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
14622
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
14623
|
-
onDownload ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
14624
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label":
|
|
15935
|
+
rotatable ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": a11y.rotate, onClick: () => setRot((r) => (r + 90) % 360), children: /* @__PURE__ */ jsx("i", { className: "ri-anticlockwise-line" }) }) : null,
|
|
15936
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": imageViewer.reset, onClick: reset, children: /* @__PURE__ */ jsx("i", { className: "ri-aspect-ratio-line" }) }),
|
|
15937
|
+
onDownload ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": imageViewer.download, onClick: () => onDownload(current, safeIdx), children: /* @__PURE__ */ jsx("i", { className: "ri-download-2-line" }) }) : null,
|
|
15938
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__btn", "aria-label": modal.close, onClick: onClose, children: /* @__PURE__ */ jsx("i", { className: "ri-close-line" }) })
|
|
14625
15939
|
] })
|
|
14626
15940
|
] }),
|
|
14627
|
-
gallery.length > 1 ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__nav klun-image-viewer__nav--prev", "aria-label":
|
|
15941
|
+
gallery.length > 1 ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__nav klun-image-viewer__nav--prev", "aria-label": pagination.previous, onMouseDown: (e) => e.stopPropagation(), onClick: () => goTo(safeIdx - 1), children: /* @__PURE__ */ jsx("i", { className: "ri-arrow-left-s-line" }) }) : null,
|
|
14628
15942
|
/* @__PURE__ */ jsx("div", { className: "klun-image-viewer__stage", onMouseDown: (e) => e.stopPropagation(), onWheel, children: /* @__PURE__ */ jsx(
|
|
14629
15943
|
"img",
|
|
14630
15944
|
{
|
|
@@ -14637,7 +15951,7 @@ function ImageViewer({
|
|
|
14637
15951
|
style: { transform: `translate(${pan.x}px, ${pan.y}px) scale(${scale}) rotate(${rot}deg)` }
|
|
14638
15952
|
}
|
|
14639
15953
|
) }),
|
|
14640
|
-
gallery.length > 1 ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__nav klun-image-viewer__nav--next", "aria-label":
|
|
15954
|
+
gallery.length > 1 ? /* @__PURE__ */ jsx("button", { type: "button", className: "klun-image-viewer__nav klun-image-viewer__nav--next", "aria-label": pagination.next, onMouseDown: (e) => e.stopPropagation(), onClick: () => goTo(safeIdx + 1), children: /* @__PURE__ */ jsx("i", { className: "ri-arrow-right-s-line" }) }) : null
|
|
14641
15955
|
]
|
|
14642
15956
|
}
|
|
14643
15957
|
),
|
|
@@ -14819,6 +16133,6 @@ var Popconfirm = forwardRef(function Popconfirm2({
|
|
|
14819
16133
|
});
|
|
14820
16134
|
Popconfirm.displayName = "Popconfirm";
|
|
14821
16135
|
|
|
14822
|
-
export { Accordion, ActivityHeatmap, ActorAvatar, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, BorderBeam, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, CRON_PRESETS, CapabilityBanner, CappedNumberFlow, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, CheckboxGroup, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactNumberFlow, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu2 as ContextMenu, CopyButton, CounterInput, CronEditor, CrossRefBadge, CurrencyNumberFlow, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DiffViewer, DigitInput, Divider, DotSphere, Drawer, Dropdown, EmojiPicker, EmptyState, ExpiryCountdown, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldTitle, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, HoverCard, HoverCardContent, HoverCardTrigger, ICON_GROUPS, IconPicker, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kanban, Kbd, KeyIcon, LIST_GRID_BOTTOM_CLEARANCE, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListGrid, ListGridBody, ListGridCell, ListGridHeader, ListGridHeaderCell, ListGridRow, ListItem, LiveDot, LogViewer, Markdown, Masonry, Menu, Message, Modal, Money, NavigationProgress, Notification, NumberFlow, PageHeader, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, QUICK_EMOJIS, QuickEmojiPicker, Radio, RadioCard, RangeSlider, Rating, ReactionBar, RelativeTime, Result, RichEditor, RichEditorToolbar, Row, SegmentedControl, SegmentedProgress, Select, SelectMenu, ShimmerText, Sidebar, Skeleton, Slider, Space, Spinner2 as Spinner, Splitter2 as Splitter, SplitterPanel, StatCard, Statistic, StatusBadge, StatusDot, StepIndicator, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperNav, StepperPanel, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Toggle, Tooltip, Tree, UnicodeSpinner, VirtualTable, Wizard, arSA, buildHeatmapGrid, deDE, describeCron, enUS, esES, fmt, formatAvatarEmoji, frFR, groupReactions, idID, itIT, jaJP, koKR, localTodayIso, locales, nlNL, parseAvatarEmoji, parsePatch, plPL, primaryColorVars, ptBR, renderMarkdown, reorderRows, resolveMove, ruRU, summarizeHeatmap, toast, trTR, useBreakpoint, useConfig, useContextMenu, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, useStepItem, useStepper, viVN, zhCN, zhTW };
|
|
14823
|
-
//# sourceMappingURL=chunk-
|
|
14824
|
-
//# sourceMappingURL=chunk-
|
|
16136
|
+
export { Accordion, ActivityHeatmap, ActorAvatar, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, BorderBeam, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, CRON_PRESETS, CapabilityBanner, CappedNumberFlow, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, CheckboxGroup, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactNumberFlow, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu2 as ContextMenu, CopyButton, CounterInput, CronEditor, CrossRefBadge, CurrencyNumberFlow, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DiffViewer, DigitInput, Divider, DotSphere, Drawer, Dropdown, EmojiPicker, EmptyState, ExpiryCountdown, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldTitle, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, HoverCard, HoverCardContent, HoverCardTrigger, ICON_GROUPS, IconPicker, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kanban, Kbd, KeyIcon, LIST_GRID_BOTTOM_CLEARANCE, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListGrid, ListGridBody, ListGridCell, ListGridHeader, ListGridHeaderCell, ListGridRow, ListItem, LiveDot, LogViewer, Markdown, Masonry, Menu, Message, Modal, Money, NavigationProgress, Notification, NumberFlow, OverlayLayerProvider, PageHeader, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, QUICK_EMOJIS, QuickEmojiPicker, Radio, RadioCard, RangeSlider, Rating, ReactionBar, RelativeTime, Result, RichEditor, RichEditorToolbar, Row, SIZE_CONTRACTS, SegmentedControl, SegmentedProgress, Select, SelectMenu, ShimmerText, Sidebar, Skeleton, Slider, Space, Spinner2 as Spinner, Splitter2 as Splitter, SplitterPanel, StatCard, Statistic, StatusBadge, StatusDot, StepIndicator, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperNav, StepperPanel, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Toggle, Tooltip, Tree, UnicodeSpinner, VirtualTable, Wizard, arSA, buildHeatmapGrid, deDE, describeCron, enUS, esES, fmt, formatAvatarEmoji, frFR, groupReactions, idID, itIT, jaJP, koKR, localTodayIso, locales, nlNL, parseAvatarEmoji, parsePatch, plPL, primaryColorVars, ptBR, renderMarkdown, reorderRows, resolveMove, resolveSize, ruRU, summarizeHeatmap, tierOf, toast, trTR, useBreakpoint, useConfig, useContextMenu, useDensity, useForm, useLocale, useMappedSize, useMessage, useNotification, useOverlayLayer, useOverlayScope, useScaleSize, useSize, useStepItem, useStepper, viVN, zhCN, zhTW };
|
|
16137
|
+
//# sourceMappingURL=chunk-2S6ZRGPW.js.map
|
|
16138
|
+
//# sourceMappingURL=chunk-2S6ZRGPW.js.map
|