@sia.soul/sia-react-ui 0.1.89 → 0.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-IOJ4CNH7.js → chunk-7BJPQCRG.js} +1 -1
- package/dist/{chunk-ZCRCLHBJ.js → chunk-AG2VFAZR.js} +2 -2
- package/dist/{chunk-V2WADR72.js → chunk-G5K72R4O.js} +516 -242
- package/dist/{chunk-2V7IYAA2.js → chunk-GLXGN5SO.js} +2 -2
- package/dist/{chunk-W2F4KFPT.js → chunk-OPYA3PMD.js} +1 -1
- package/dist/{core-CD0Fr3cM.d.ts → core-BGA9VB0L.d.ts} +2 -2
- package/dist/{core-BW2GUYC2.d.cts → core-OIIkAeiG.d.cts} +2 -2
- package/dist/core.cjs +1133 -859
- package/dist/core.css +1 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +3 -3
- package/dist/index.cjs +3327 -3053
- package/dist/index.css +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/rich-text-editor.cjs +768 -494
- package/dist/rich-text-editor.js +2 -2
- package/dist/select-date-range.cjs +928 -654
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -41,7 +41,7 @@ __export(core_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(core_exports);
|
|
42
42
|
|
|
43
43
|
// src/components/Toolbar.tsx
|
|
44
|
-
var
|
|
44
|
+
var import_react9 = require("react");
|
|
45
45
|
|
|
46
46
|
// src/components/titleTooltip.tsx
|
|
47
47
|
var import_client = require("react-dom/client");
|
|
@@ -386,10 +386,10 @@ var Button = (0, import_react3.forwardRef)(function Button2({
|
|
|
386
386
|
});
|
|
387
387
|
|
|
388
388
|
// src/components/Dropdown.tsx
|
|
389
|
-
var
|
|
389
|
+
var import_react8 = require("react");
|
|
390
390
|
|
|
391
391
|
// src/components/Icon.tsx
|
|
392
|
-
var
|
|
392
|
+
var import_react5 = require("react");
|
|
393
393
|
|
|
394
394
|
// src/components/IconCatalog.tsx
|
|
395
395
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -874,328 +874,602 @@ var extendedIconPaths = {
|
|
|
874
874
|
] })
|
|
875
875
|
};
|
|
876
876
|
|
|
877
|
-
// src/components/
|
|
877
|
+
// src/components/iconBounds.ts
|
|
878
|
+
var outlineIconBounds = {
|
|
879
|
+
"activity": [3, 6, 18, 13],
|
|
880
|
+
"align-center": [4, 6, 16, 12],
|
|
881
|
+
"align-justify": [4, 6, 16, 12],
|
|
882
|
+
"align-left": [4, 6, 16, 12],
|
|
883
|
+
"align-right": [4, 6, 16, 12],
|
|
884
|
+
"appstore": [3, 3, 18, 18],
|
|
885
|
+
"area-chart": [3, 5, 18, 15],
|
|
886
|
+
"arrow-down": [5, 3, 14, 18],
|
|
887
|
+
"arrow-left": [3, 5, 18, 14],
|
|
888
|
+
"arrow-right": [3, 5, 18, 14],
|
|
889
|
+
"arrow-up": [5, 3, 14, 18],
|
|
890
|
+
"bank": [3, 3, 18, 18],
|
|
891
|
+
"bar-chart": [3, 4, 18, 17],
|
|
892
|
+
"barcode": [4, 5, 16, 14],
|
|
893
|
+
"bell": [3, 3, 18, 18],
|
|
894
|
+
"bold": [7, 4, 11, 16],
|
|
895
|
+
"book": [4, 3, 16, 19],
|
|
896
|
+
"branches": [4, 3, 16, 18],
|
|
897
|
+
"bug": [5, 5, 14, 15],
|
|
898
|
+
"bulb": [5.000001, 2.255438, 14.000001, 18.744562],
|
|
899
|
+
"calculator": [5, 2, 14, 20],
|
|
900
|
+
"calendar": [3, 3, 18, 18],
|
|
901
|
+
"camera": [3, 4, 18, 16],
|
|
902
|
+
"car": [3, 4, 18, 16],
|
|
903
|
+
"check": [4, 6.5, 16, 11],
|
|
904
|
+
"chevron-down": [5, 8.5, 14, 7],
|
|
905
|
+
"chevron-left": [8.5, 5, 7, 14],
|
|
906
|
+
"chevron-right": [8.5, 5, 7, 14],
|
|
907
|
+
"chevron-up": [5, 8.5, 14, 7],
|
|
908
|
+
"circle-check": [3, 3, 18, 18],
|
|
909
|
+
"circle-close": [3, 3, 18, 18],
|
|
910
|
+
"circle-minus": [3, 3, 18, 18],
|
|
911
|
+
"circle-plus": [3, 3, 18, 18],
|
|
912
|
+
"clipboard": [5, 3, 14, 18],
|
|
913
|
+
"clipboard-check": [5, 3, 14, 18],
|
|
914
|
+
"clock": [3, 3, 18, 18],
|
|
915
|
+
"close": [5, 5, 14, 14],
|
|
916
|
+
"cloud": [1.267807, 5.290112, 20.99, 13.79396],
|
|
917
|
+
"cloud-download": [1.100703, 5.621803, 21.657103, 15.378197],
|
|
918
|
+
"cloud-upload": [1.100703, 5.621803, 21.657103, 15.378197],
|
|
919
|
+
"code": [3, 6, 18, 12],
|
|
920
|
+
"coffee": [4, 3, 18, 17],
|
|
921
|
+
"columns": [3, 4, 18, 16],
|
|
922
|
+
"comments": [3, 4, 18, 17],
|
|
923
|
+
"compass": [3, 3, 18, 18],
|
|
924
|
+
"component": [4, 4, 16, 16],
|
|
925
|
+
"copy": [4, 4, 16, 16],
|
|
926
|
+
"corner-up-left": [4, 5, 16, 14],
|
|
927
|
+
"corner-up-right": [4, 5, 16, 14],
|
|
928
|
+
"database": [4, 2, 16, 20],
|
|
929
|
+
"desktop": [3, 3, 18, 18],
|
|
930
|
+
"double-left": [5, 5, 14, 14],
|
|
931
|
+
"double-right": [5, 5, 14, 14],
|
|
932
|
+
"download": [4, 3, 16, 17],
|
|
933
|
+
"edit": [4, 4.171572, 16, 15.828428],
|
|
934
|
+
"eraser": [4, 5, 17, 15],
|
|
935
|
+
"expand": [4, 4, 16, 16],
|
|
936
|
+
"experiment": [3.720577, 3, 16.558847, 19.019615],
|
|
937
|
+
"external-link": [3, 4, 17, 17],
|
|
938
|
+
"eye": [2.5, 6, 19, 12],
|
|
939
|
+
"eye-off": [2.5, 3, 19, 18],
|
|
940
|
+
"fast-backward": [4, 6, 16, 12],
|
|
941
|
+
"fast-forward": [4, 6, 16, 12],
|
|
942
|
+
"file": [6, 3, 12, 18],
|
|
943
|
+
"file-check": [6, 3, 12, 18],
|
|
944
|
+
"file-plus": [6, 3, 12, 18],
|
|
945
|
+
"file-spreadsheet": [6, 3, 12, 18],
|
|
946
|
+
"file-warning": [6, 3, 12, 18],
|
|
947
|
+
"filter": [3, 5, 18, 16],
|
|
948
|
+
"flip-horizontal": [3, 3, 18, 18],
|
|
949
|
+
"flip-vertical": [3, 3, 18, 18],
|
|
950
|
+
"folder": [3, 6, 18, 13],
|
|
951
|
+
"folder-plus": [3, 6, 18, 13],
|
|
952
|
+
"frown": [3, 3, 18, 18],
|
|
953
|
+
"fullscreen": [4, 4, 16, 16],
|
|
954
|
+
"fullscreen-exit": [4, 4, 16, 16],
|
|
955
|
+
"game-backpack": [4, 1.5, 16, 19.5],
|
|
956
|
+
"game-cultivator": [7, 2, 10, 19],
|
|
957
|
+
"game-elixir-jar": [5, 3, 14, 18],
|
|
958
|
+
"game-flame": [4.5, 2.5, 15.000168, 19.950167],
|
|
959
|
+
"game-gem": [4, 4, 16, 17],
|
|
960
|
+
"game-herb": [4, 5.488038, 16, 15.511962],
|
|
961
|
+
"game-ingot": [3, 6, 18, 13.5],
|
|
962
|
+
"game-meditate": [4, 3, 16, 18],
|
|
963
|
+
"game-necklace": [5, 4, 14, 16],
|
|
964
|
+
"game-pants": [6, 3, 12, 18],
|
|
965
|
+
"game-pendant": [5, 4, 14, 16.6],
|
|
966
|
+
"game-pill": [4.510922, 4.522434, 14.966641, 14.966642],
|
|
967
|
+
"game-potion": [4.370614, 3, 15.258771, 18.002394],
|
|
968
|
+
"game-qi": [3, 3, 18, 18],
|
|
969
|
+
"game-robe": [4.5, 4, 15, 17],
|
|
970
|
+
"game-soul-elixir": [2.5, 2.5, 19, 19],
|
|
971
|
+
"game-spirit-wolf": [4, 4.2, 16.025938, 16.5],
|
|
972
|
+
"game-sword": [4, 3.5, 15.5, 16.5],
|
|
973
|
+
"game-swordsman": [7, 2.5, 12.900002, 18.5],
|
|
974
|
+
"gift": [3, 3.17335, 18, 17.826651],
|
|
975
|
+
"github": [3.699682, 3.977686, 16.600634, 18.022314],
|
|
976
|
+
"heart": [1.584567, 4.178144, 20.83729, 16.821857],
|
|
977
|
+
"help-circle": [3, 3, 18, 18],
|
|
978
|
+
"highlighter": [3, 4, 16, 16],
|
|
979
|
+
"home": [3.5, 4, 17, 16],
|
|
980
|
+
"image": [3, 4, 18, 16],
|
|
981
|
+
"info": [3, 3, 18, 18],
|
|
982
|
+
"italic": [6, 4, 12, 16],
|
|
983
|
+
"key": [4, 4, 15, 15],
|
|
984
|
+
"laptop": [3, 5, 18, 14],
|
|
985
|
+
"line-chart": [3, 5, 18, 15],
|
|
986
|
+
"link": [-0.034671, 4.964466, 24.070208, 14.070206],
|
|
987
|
+
"list-ordered": [4, 5, 17, 15],
|
|
988
|
+
"list-unordered": [4, 5.5, 17, 13],
|
|
989
|
+
"loader": [3, 3, 18, 18],
|
|
990
|
+
"location": [5, 2, 14, 20],
|
|
991
|
+
"lock": [4, 3, 16, 18],
|
|
992
|
+
"login": [5, 5, 12, 14],
|
|
993
|
+
"logout": [7, 5, 12, 14],
|
|
994
|
+
"mail": [3, 5, 18, 14],
|
|
995
|
+
"meh": [3, 3, 18, 18],
|
|
996
|
+
"menu": [4, 6, 16, 12],
|
|
997
|
+
"menu-fold": [4, 6, 16, 12],
|
|
998
|
+
"menu-unfold": [4, 6, 16, 12],
|
|
999
|
+
"message": [4, 4, 16, 17],
|
|
1000
|
+
"microphone": [5, 3, 14, 18],
|
|
1001
|
+
"minus": [4, 12, 16, 0],
|
|
1002
|
+
"mobile": [7, 2, 10, 20],
|
|
1003
|
+
"moon": [3.717114, 4, 16.282887, 16.282888],
|
|
1004
|
+
"more-horizontal": [5, 12, 14.1, 0],
|
|
1005
|
+
"more-vertical": [12, 5, 0, 14.1],
|
|
1006
|
+
"move": [3, 3, 18, 18],
|
|
1007
|
+
"notepad-file": [3.375, 1.875, 17.25, 20.25],
|
|
1008
|
+
"notepad-folder": [1.875, 2.25, 20.2875, 19.5],
|
|
1009
|
+
"notepad-virtual-folder": [0.75, 0.75, 22.5, 22.5],
|
|
1010
|
+
"paperclip": [1.136039, 3, 21.106602, 18.86396],
|
|
1011
|
+
"partition": [4, 1, 16, 20],
|
|
1012
|
+
"pause": [3, 3, 18, 18],
|
|
1013
|
+
"phone": [4.161916, 3.5, 16.338085, 16.338085],
|
|
1014
|
+
"pie-chart": [2, 3, 18.5, 18],
|
|
1015
|
+
"pin": [6.5, 3, 11, 18],
|
|
1016
|
+
"pin-off": [3, 3, 18, 18],
|
|
1017
|
+
"play": [3, 3, 18, 18],
|
|
1018
|
+
"plus": [4, 4, 16, 16],
|
|
1019
|
+
"power": [4, 3, 16.000002, 16.744997],
|
|
1020
|
+
"printer": [4, 3, 16, 18],
|
|
1021
|
+
"puzzle": [3, 3, 18, 18],
|
|
1022
|
+
"qr-code": [3, 3, 18, 18],
|
|
1023
|
+
"question": [3, 3, 18, 18],
|
|
1024
|
+
"redo": [4, 7, 17, 12],
|
|
1025
|
+
"refresh": [3.999998, 3.999709, 16.000002, 16.000002],
|
|
1026
|
+
"rocket": [3, 3, 18, 18],
|
|
1027
|
+
"rotate-left": [4, 3, 15.416197, 17],
|
|
1028
|
+
"rotate-right": [4.583802, 3, 15.416199, 17],
|
|
1029
|
+
"rows": [3, 4, 18, 16],
|
|
1030
|
+
"save": [4, 3, 16, 18],
|
|
1031
|
+
"scan": [3, 3, 18, 18],
|
|
1032
|
+
"scissors": [3, 4, 17, 16],
|
|
1033
|
+
"search": [4, 4, 17, 17],
|
|
1034
|
+
"send": [3, 3, 18, 18],
|
|
1035
|
+
"server": [3, 4, 18, 16],
|
|
1036
|
+
"settings": [4, 4, 16, 16],
|
|
1037
|
+
"share": [3, 2, 18, 20],
|
|
1038
|
+
"shield": [4, 3, 16, 19],
|
|
1039
|
+
"shield-check": [4, 3, 16, 19],
|
|
1040
|
+
"shop": [3, 4, 18, 17],
|
|
1041
|
+
"shopping-bag": [4, 3, 16, 18],
|
|
1042
|
+
"shopping-cart": [3, 4, 17, 17],
|
|
1043
|
+
"shrink": [5, 4, 14, 16],
|
|
1044
|
+
"smile": [3, 3, 18, 18],
|
|
1045
|
+
"sort-ascending": [3.5, 5, 17.5, 14],
|
|
1046
|
+
"sort-descending": [3.5, 5, 17.5, 14],
|
|
1047
|
+
"speaker-muted": [4, 6.4, 16.5, 11.200001],
|
|
1048
|
+
"speaker-wave": [4, 6.4, 12.343426, 11.200001],
|
|
1049
|
+
"square-check": [3, 3, 18, 18],
|
|
1050
|
+
"square-close": [3, 3, 18, 18],
|
|
1051
|
+
"square-minus": [3, 3, 18, 18],
|
|
1052
|
+
"square-plus": [3, 3, 18, 18],
|
|
1053
|
+
"star": [3, 3, 18, 17.200001],
|
|
1054
|
+
"step-backward": [6, 5, 12, 14],
|
|
1055
|
+
"step-forward": [6, 5, 12, 14],
|
|
1056
|
+
"stop": [3, 3, 18, 18],
|
|
1057
|
+
"strikethrough": [5, 4, 14, 16],
|
|
1058
|
+
"sun": [2.5, 2.5, 19, 19],
|
|
1059
|
+
"swap-horizontal": [4, 4, 16, 16],
|
|
1060
|
+
"swap-vertical": [4, 4, 16, 16],
|
|
1061
|
+
"tab-plus": [3, 4, 18, 16],
|
|
1062
|
+
"table": [3, 4, 18, 16],
|
|
1063
|
+
"tablet": [5, 2, 14, 20],
|
|
1064
|
+
"tag": [3, 4, 18, 17],
|
|
1065
|
+
"tags": [3, 4, 18, 17],
|
|
1066
|
+
"target": [3, 3, 18, 18],
|
|
1067
|
+
"tilde": [3, 9.214088, 18, 4.785912],
|
|
1068
|
+
"token": [2.5, 2.5, 19, 19],
|
|
1069
|
+
"tool": [4.870828, 2.816625, 16.750492, 16.804695],
|
|
1070
|
+
"trash": [4, 3, 16, 18],
|
|
1071
|
+
"trending-down": [4, 7, 16, 9],
|
|
1072
|
+
"trending-up": [4, 8, 16, 9],
|
|
1073
|
+
"trophy": [3.997966, 4, 16.004068, 16],
|
|
1074
|
+
"truck": [3, 5, 18, 16],
|
|
1075
|
+
"underline": [5, 4, 14, 17],
|
|
1076
|
+
"undo": [3, 7, 17, 12],
|
|
1077
|
+
"unlock": [4, 2.935554, 16, 18.064445],
|
|
1078
|
+
"upload": [4, 4, 16, 16],
|
|
1079
|
+
"user": [4.5, 4, 15, 17],
|
|
1080
|
+
"user-minus": [3, 4, 19.5, 17],
|
|
1081
|
+
"user-plus": [3, 4, 19.5, 17],
|
|
1082
|
+
"users": [2.8, 4.5, 18.300001, 15.5],
|
|
1083
|
+
"vertical-align-bottom": [4, 4, 16, 16],
|
|
1084
|
+
"vertical-align-middle": [4, 4, 16, 16],
|
|
1085
|
+
"vertical-align-top": [4, 4, 16, 16],
|
|
1086
|
+
"video": [3, 5, 18, 14],
|
|
1087
|
+
"volume-off": [4, 6, 18, 12],
|
|
1088
|
+
"volume-up": [4, 6, 16.690525, 12],
|
|
1089
|
+
"wallet": [3, 5, 18, 15],
|
|
1090
|
+
"warning": [2.33137, 3.153565, 19.337257, 17.847614],
|
|
1091
|
+
"wifi": [3, 5.723805, 18, 15.376196],
|
|
1092
|
+
"zoom-in": [4, 4, 17, 17],
|
|
1093
|
+
"zoom-out": [4, 4, 17, 17]
|
|
1094
|
+
};
|
|
1095
|
+
var filledIconBounds = {
|
|
1096
|
+
"bell": [3, 2.499593, 18, 19.423376],
|
|
1097
|
+
"book": [3, 1, 18, 22],
|
|
1098
|
+
"calendar": [2.5, 2.5, 19, 19],
|
|
1099
|
+
"circle-check": [2, 2, 20, 20],
|
|
1100
|
+
"circle-close": [2, 2, 20, 20],
|
|
1101
|
+
"circle-minus": [2, 2, 20, 20],
|
|
1102
|
+
"circle-plus": [2, 2, 20, 20],
|
|
1103
|
+
"clock": [2, 2, 20, 20],
|
|
1104
|
+
"component": [3, 3, 18, 18],
|
|
1105
|
+
"file": [5, 2.5, 14, 19.5],
|
|
1106
|
+
"filter": [2, 4, 20, 18],
|
|
1107
|
+
"folder": [2.5, 5, 19, 15],
|
|
1108
|
+
"heart": [1.247845, 3.647845, 21.504313, 17.652155],
|
|
1109
|
+
"home": [2.157447, 2.8, 19.500002, 18.200001],
|
|
1110
|
+
"image": [2.5, 3.5, 19, 17],
|
|
1111
|
+
"info": [2, 2, 20, 20],
|
|
1112
|
+
"lock": [3, 2, 18, 20],
|
|
1113
|
+
"mail": [2.5, 4.5, 19, 15],
|
|
1114
|
+
"pause": [2, 2, 20, 20],
|
|
1115
|
+
"play": [2, 2, 20, 20],
|
|
1116
|
+
"question": [2, 2, 20, 20],
|
|
1117
|
+
"star": [2.4, 2.199999, 19.200001, 18.200001],
|
|
1118
|
+
"token": [1, 1, 22, 22],
|
|
1119
|
+
"trash": [3, 3, 18, 18],
|
|
1120
|
+
"unlock": [3, 1.979363, 18, 20.020638],
|
|
1121
|
+
"user": [3.5, 3, 17, 18],
|
|
1122
|
+
"users": [1.8, 4.2, 19.6, 16.799999],
|
|
1123
|
+
"warning": [1.53137, 2.553565, 20.937256, 19.447613]
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
// src/components/iconGeometry.tsx
|
|
1127
|
+
var import_react4 = require("react");
|
|
878
1128
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1129
|
+
function compensateStroke(node, scale) {
|
|
1130
|
+
return import_react4.Children.map(node, (child) => {
|
|
1131
|
+
if (!(0, import_react4.isValidElement)(child)) return child;
|
|
1132
|
+
const props = child.props;
|
|
1133
|
+
return (0, import_react4.cloneElement)(child, {
|
|
1134
|
+
...props.strokeWidth === void 0 ? {} : { strokeWidth: Number(props.strokeWidth) / scale },
|
|
1135
|
+
...props.children === void 0 ? {} : { children: compensateStroke(props.children, scale) }
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
function normalizeIconPaths(paths, bounds) {
|
|
1140
|
+
return Object.fromEntries(Object.entries(paths).map(([name, node]) => {
|
|
1141
|
+
const [x, y, width, height] = bounds[name];
|
|
1142
|
+
const scale = 18 / Math.max(width, height);
|
|
1143
|
+
const transform = `translate(${12 - (x + width / 2) * scale} ${12 - (y + height / 2) * scale}) scale(${scale})`;
|
|
1144
|
+
return [name, { scale, node: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("g", { transform, children: compensateStroke(node, scale) }) }];
|
|
1145
|
+
}));
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// src/components/Icon.tsx
|
|
1149
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
879
1150
|
var coreIconPaths = {
|
|
880
|
-
search: /* @__PURE__ */ (0,
|
|
881
|
-
/* @__PURE__ */ (0,
|
|
882
|
-
/* @__PURE__ */ (0,
|
|
1151
|
+
search: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "10.8", cy: "10.8", r: "6.8" }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m15.8 15.8 5.2 5.2" })
|
|
883
1154
|
] }),
|
|
884
|
-
plus: /* @__PURE__ */ (0,
|
|
1155
|
+
plus: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 4v16M4 12h16" }),
|
|
885
1156
|
// 数字区间用波浪线表达范围,避免箭头暗示跳转方向。
|
|
886
|
-
tilde: /* @__PURE__ */ (0,
|
|
887
|
-
minus: /* @__PURE__ */ (0,
|
|
888
|
-
close: /* @__PURE__ */ (0,
|
|
889
|
-
check: /* @__PURE__ */ (0,
|
|
890
|
-
info: /* @__PURE__ */ (0,
|
|
891
|
-
/* @__PURE__ */ (0,
|
|
892
|
-
/* @__PURE__ */ (0,
|
|
893
|
-
] }),
|
|
894
|
-
question: /* @__PURE__ */ (0,
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
896
|
-
/* @__PURE__ */ (0,
|
|
897
|
-
] }),
|
|
898
|
-
warning: /* @__PURE__ */ (0,
|
|
899
|
-
/* @__PURE__ */ (0,
|
|
900
|
-
/* @__PURE__ */ (0,
|
|
901
|
-
] }),
|
|
902
|
-
"circle-check": /* @__PURE__ */ (0,
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
904
|
-
/* @__PURE__ */ (0,
|
|
905
|
-
] }),
|
|
906
|
-
"circle-close": /* @__PURE__ */ (0,
|
|
907
|
-
/* @__PURE__ */ (0,
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
909
|
-
] }),
|
|
910
|
-
"circle-plus": /* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
913
|
-
] }),
|
|
914
|
-
"circle-minus": /* @__PURE__ */ (0,
|
|
915
|
-
/* @__PURE__ */ (0,
|
|
916
|
-
/* @__PURE__ */ (0,
|
|
917
|
-
] }),
|
|
918
|
-
"chevron-left": /* @__PURE__ */ (0,
|
|
919
|
-
"chevron-right": /* @__PURE__ */ (0,
|
|
920
|
-
"chevron-up": /* @__PURE__ */ (0,
|
|
921
|
-
"chevron-down": /* @__PURE__ */ (0,
|
|
922
|
-
"double-left": /* @__PURE__ */ (0,
|
|
923
|
-
/* @__PURE__ */ (0,
|
|
924
|
-
/* @__PURE__ */ (0,
|
|
925
|
-
] }),
|
|
926
|
-
"double-right": /* @__PURE__ */ (0,
|
|
927
|
-
/* @__PURE__ */ (0,
|
|
928
|
-
/* @__PURE__ */ (0,
|
|
929
|
-
] }),
|
|
930
|
-
"arrow-left": /* @__PURE__ */ (0,
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
932
|
-
/* @__PURE__ */ (0,
|
|
933
|
-
] }),
|
|
934
|
-
"arrow-right": /* @__PURE__ */ (0,
|
|
935
|
-
/* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
937
|
-
] }),
|
|
938
|
-
"arrow-up": /* @__PURE__ */ (0,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
941
|
-
] }),
|
|
942
|
-
"arrow-down": /* @__PURE__ */ (0,
|
|
943
|
-
/* @__PURE__ */ (0,
|
|
944
|
-
/* @__PURE__ */ (0,
|
|
945
|
-
] }),
|
|
946
|
-
menu: /* @__PURE__ */ (0,
|
|
947
|
-
"more-horizontal": /* @__PURE__ */ (0,
|
|
948
|
-
"more-vertical": /* @__PURE__ */ (0,
|
|
949
|
-
home: /* @__PURE__ */ (0,
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
952
|
-
] }),
|
|
953
|
-
user: /* @__PURE__ */ (0,
|
|
954
|
-
/* @__PURE__ */ (0,
|
|
955
|
-
/* @__PURE__ */ (0,
|
|
956
|
-
] }),
|
|
957
|
-
users: /* @__PURE__ */ (0,
|
|
958
|
-
/* @__PURE__ */ (0,
|
|
959
|
-
/* @__PURE__ */ (0,
|
|
960
|
-
/* @__PURE__ */ (0,
|
|
961
|
-
] }),
|
|
962
|
-
//
|
|
963
|
-
settings: /* @__PURE__ */ (0,
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
965
|
-
/* @__PURE__ */ (0,
|
|
966
|
-
] }),
|
|
967
|
-
edit: /* @__PURE__ */ (0,
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
969
|
-
/* @__PURE__ */ (0,
|
|
970
|
-
] }),
|
|
971
|
-
copy: /* @__PURE__ */ (0,
|
|
972
|
-
/* @__PURE__ */ (0,
|
|
973
|
-
/* @__PURE__ */ (0,
|
|
974
|
-
] }),
|
|
975
|
-
trash: /* @__PURE__ */ (0,
|
|
976
|
-
scissors: /* @__PURE__ */ (0,
|
|
977
|
-
/* @__PURE__ */ (0,
|
|
978
|
-
/* @__PURE__ */ (0,
|
|
979
|
-
/* @__PURE__ */ (0,
|
|
980
|
-
] }),
|
|
981
|
-
undo: /* @__PURE__ */ (0,
|
|
982
|
-
/* @__PURE__ */ (0,
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
984
|
-
] }),
|
|
985
|
-
redo: /* @__PURE__ */ (0,
|
|
986
|
-
/* @__PURE__ */ (0,
|
|
987
|
-
/* @__PURE__ */ (0,
|
|
988
|
-
] }),
|
|
989
|
-
"zoom-in": /* @__PURE__ */ (0,
|
|
990
|
-
/* @__PURE__ */ (0,
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
992
|
-
] }),
|
|
993
|
-
"zoom-out": /* @__PURE__ */ (0,
|
|
994
|
-
/* @__PURE__ */ (0,
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
1157
|
+
tilde: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 14c3-8 6-4 9-2s6 4 9-2" }),
|
|
1158
|
+
minus: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 12h16" }),
|
|
1159
|
+
close: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 5 14 14M19 5 5 19" }),
|
|
1160
|
+
check: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m4 12.5 5.2 5L20 6.5" }),
|
|
1161
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1163
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 11v6M12 7.2v.1" })
|
|
1164
|
+
] }),
|
|
1165
|
+
question: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M9.8 9a2.4 2.4 0 1 1 3.5 2.2c-.9.5-1.3 1.1-1.3 2.1M12 16.8v.1" })
|
|
1168
|
+
] }),
|
|
1169
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M10.3 4.1 2.6 18a2 2 0 0 0 1.8 3h15.2a2 2 0 0 0 1.8-3L13.7 4.1a2 2 0 0 0-3.4 0Z" }),
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 9v4M12 17v.1" })
|
|
1172
|
+
] }),
|
|
1173
|
+
"circle-check": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1174
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1175
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m8 12 2.7 2.7L16.5 9" })
|
|
1176
|
+
] }),
|
|
1177
|
+
"circle-close": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m9 9 6 6M15 9l-6 6" })
|
|
1180
|
+
] }),
|
|
1181
|
+
"circle-plus": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 8v8M8 12h8" })
|
|
1184
|
+
] }),
|
|
1185
|
+
"circle-minus": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1186
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 12h8" })
|
|
1188
|
+
] }),
|
|
1189
|
+
"chevron-left": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m15.5 5-7 7 7 7" }),
|
|
1190
|
+
"chevron-right": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m8.5 5 7 7-7 7" }),
|
|
1191
|
+
"chevron-up": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 15.5 7-7 7 7" }),
|
|
1192
|
+
"chevron-down": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 8.5 7 7 7-7" }),
|
|
1193
|
+
"double-left": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 5-7 7 7 7" }),
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m19 5-7 7 7 7" })
|
|
1196
|
+
] }),
|
|
1197
|
+
"double-right": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 5 7 7-7 7" }),
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 5 7 7-7 7" })
|
|
1200
|
+
] }),
|
|
1201
|
+
"arrow-left": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m10 5-7 7 7 7" }),
|
|
1203
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 12h18" })
|
|
1204
|
+
] }),
|
|
1205
|
+
"arrow-right": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m14 5 7 7-7 7" }),
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 12h18" })
|
|
1208
|
+
] }),
|
|
1209
|
+
"arrow-up": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 10 7-7 7 7" }),
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 3v18" })
|
|
1212
|
+
] }),
|
|
1213
|
+
"arrow-down": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m5 14 7 7 7-7" }),
|
|
1215
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 3v18" })
|
|
1216
|
+
] }),
|
|
1217
|
+
menu: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 6h16M4 12h16M4 18h16" }),
|
|
1218
|
+
"more-horizontal": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5 12h.1M12 12h.1M19 12h.1" }),
|
|
1219
|
+
"more-vertical": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 5v.1M12 12v.1M12 19v.1" }),
|
|
1220
|
+
home: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m3.5 11 8.5-7 8.5 7" }),
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5.5 9.5V20h13V9.5M9.5 20v-6h5v6" })
|
|
1223
|
+
] }),
|
|
1224
|
+
user: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "8", r: "4" }),
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4.5 21c.7-4.2 3.2-6.5 7.5-6.5s6.8 2.3 7.5 6.5" })
|
|
1227
|
+
] }),
|
|
1228
|
+
users: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "9", cy: "8", r: "3.5" }),
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.8 20c.6-3.8 2.7-5.8 6.2-5.8s5.6 2 6.2 5.8" }),
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M15 5.2a3.5 3.5 0 0 1 0 6.6M16.2 14.5c2.9.5 4.4 2.3 4.9 5.5" })
|
|
1232
|
+
] }),
|
|
1233
|
+
// 保留齿轮原始路径;与其余图标一起通过统一几何规则调整主体大小。
|
|
1234
|
+
settings: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "2.8" }),
|
|
1236
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M10.4 6.24 10.4 4 13.6 4 13.6 6.24 14.944 6.792 16.528 5.208 18.792 7.472 17.208 9.056 17.76 10.4 20 10.4 20 13.6 17.76 13.6 17.208 14.944 18.792 16.528 16.528 18.792 14.944 17.208 13.6 17.76 13.6 20 10.4 20 10.4 17.76 9.056 17.208 7.472 18.792 5.208 16.528 6.792 14.944 6.24 13.6 4 13.6 4 10.4 6.24 10.4 6.792 9.056 5.208 7.472 7.472 5.208 9.056 6.792Z" })
|
|
1237
|
+
] }),
|
|
1238
|
+
edit: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 20h4l11-11a2.8 2.8 0 0 0-4-4L4 16v4Z" }),
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m13.5 6.5 4 4M4 20h16" })
|
|
1241
|
+
] }),
|
|
1242
|
+
copy: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2.5" }),
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })
|
|
1245
|
+
] }),
|
|
1246
|
+
trash: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 7h16M9 3h6l1 4H8l1-4ZM6 7l1 14h10l1-14M10 11v6M14 11v6" }) }),
|
|
1247
|
+
scissors: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "6", cy: "7", r: "3" }),
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "6", cy: "17", r: "3" }),
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m8.7 8.3 11.3 6.2M8.7 15.7 20 9.5" })
|
|
1251
|
+
] }),
|
|
1252
|
+
undo: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1253
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m8 7-5 5 5 5" }),
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 12h10a7 7 0 0 1 7 7" })
|
|
1255
|
+
] }),
|
|
1256
|
+
redo: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m16 7 5 5-5 5" }),
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M21 12H11a7 7 0 0 0-7 7" })
|
|
1259
|
+
] }),
|
|
1260
|
+
"zoom-in": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "10.8", cy: "10.8", r: "6.8" }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m15.8 15.8 5.2 5.2M10.8 7.8v6M7.8 10.8h6" })
|
|
1263
|
+
] }),
|
|
1264
|
+
"zoom-out": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "10.8", cy: "10.8", r: "6.8" }),
|
|
1266
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m15.8 15.8 5.2 5.2M7.8 10.8h6" })
|
|
996
1267
|
] }),
|
|
997
1268
|
// 图片变换工具使用独立图标,便于在预览及其他编辑界面复用。
|
|
998
|
-
"flip-horizontal": /* @__PURE__ */ (0,
|
|
999
|
-
"flip-vertical": /* @__PURE__ */ (0,
|
|
1000
|
-
"rotate-left": /* @__PURE__ */ (0,
|
|
1001
|
-
/* @__PURE__ */ (0,
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
1003
|
-
] }),
|
|
1004
|
-
"rotate-right": /* @__PURE__ */ (0,
|
|
1005
|
-
/* @__PURE__ */ (0,
|
|
1006
|
-
/* @__PURE__ */ (0,
|
|
1007
|
-
] }),
|
|
1008
|
-
download: /* @__PURE__ */ (0,
|
|
1009
|
-
upload: /* @__PURE__ */ (0,
|
|
1010
|
-
refresh: /* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
] }),
|
|
1014
|
-
loader: /* @__PURE__ */ (0,
|
|
1015
|
-
calendar: /* @__PURE__ */ (0,
|
|
1016
|
-
/* @__PURE__ */ (0,
|
|
1017
|
-
/* @__PURE__ */ (0,
|
|
1018
|
-
] }),
|
|
1019
|
-
clock: /* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
] }),
|
|
1023
|
-
mail: /* @__PURE__ */ (0,
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1025
|
-
/* @__PURE__ */ (0,
|
|
1026
|
-
] }),
|
|
1027
|
-
phone: /* @__PURE__ */ (0,
|
|
1028
|
-
link: /* @__PURE__ */ (0,
|
|
1029
|
-
/* @__PURE__ */ (0,
|
|
1030
|
-
/* @__PURE__ */ (0,
|
|
1031
|
-
] }),
|
|
1032
|
-
"external-link": /* @__PURE__ */ (0,
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1035
|
-
] }),
|
|
1036
|
-
eye: /* @__PURE__ */ (0,
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1039
|
-
] }),
|
|
1040
|
-
"eye-off": /* @__PURE__ */ (0,
|
|
1041
|
-
lock: /* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1044
|
-
] }),
|
|
1045
|
-
unlock: /* @__PURE__ */ (0,
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1047
|
-
/* @__PURE__ */ (0,
|
|
1048
|
-
] }),
|
|
1049
|
-
bell: /* @__PURE__ */ (0,
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1051
|
-
/* @__PURE__ */ (0,
|
|
1052
|
-
] }),
|
|
1053
|
-
star: /* @__PURE__ */ (0,
|
|
1054
|
-
heart: /* @__PURE__ */ (0,
|
|
1055
|
-
file: /* @__PURE__ */ (0,
|
|
1056
|
-
/* @__PURE__ */ (0,
|
|
1057
|
-
/* @__PURE__ */ (0,
|
|
1058
|
-
] }),
|
|
1059
|
-
folder: /* @__PURE__ */ (0,
|
|
1060
|
-
image: /* @__PURE__ */ (0,
|
|
1061
|
-
/* @__PURE__ */ (0,
|
|
1062
|
-
/* @__PURE__ */ (0,
|
|
1063
|
-
/* @__PURE__ */ (0,
|
|
1064
|
-
] }),
|
|
1065
|
-
filter: /* @__PURE__ */ (0,
|
|
1066
|
-
"sort-ascending": /* @__PURE__ */ (0,
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1068
|
-
/* @__PURE__ */ (0,
|
|
1069
|
-
] }),
|
|
1070
|
-
"sort-descending": /* @__PURE__ */ (0,
|
|
1071
|
-
/* @__PURE__ */ (0,
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1073
|
-
] }),
|
|
1074
|
-
play: /* @__PURE__ */ (0,
|
|
1075
|
-
/* @__PURE__ */ (0,
|
|
1076
|
-
/* @__PURE__ */ (0,
|
|
1077
|
-
] }),
|
|
1078
|
-
pause: /* @__PURE__ */ (0,
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1081
|
-
] }),
|
|
1082
|
-
book: /* @__PURE__ */ (0,
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1084
|
-
/* @__PURE__ */ (0,
|
|
1085
|
-
] }),
|
|
1086
|
-
component: /* @__PURE__ */ (0,
|
|
1087
|
-
/* @__PURE__ */ (0,
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1089
|
-
/* @__PURE__ */ (0,
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1091
|
-
] }),
|
|
1092
|
-
token: /* @__PURE__ */ (0,
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1094
|
-
/* @__PURE__ */ (0,
|
|
1095
|
-
] }),
|
|
1096
|
-
sun: /* @__PURE__ */ (0,
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1099
|
-
] }),
|
|
1100
|
-
moon: /* @__PURE__ */ (0,
|
|
1101
|
-
code: /* @__PURE__ */ (0,
|
|
1102
|
-
github: /* @__PURE__ */ (0,
|
|
1269
|
+
"flip-horizontal": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 3v18M3 6h5v12H3zM16 6h5v12h-5z" }) }),
|
|
1270
|
+
"flip-vertical": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 12h18M6 3h12v5H6zM6 16h12v5H6z" }) }),
|
|
1271
|
+
"rotate-left": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1272
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 9a8 8 0 1 1 0 6M4 3v6h6" }),
|
|
1273
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "9", y: "9", width: "6", height: "6", rx: "1" })
|
|
1274
|
+
] }),
|
|
1275
|
+
"rotate-right": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 9a8 8 0 1 0 0 6M20 3v6h-6" }),
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "9", y: "9", width: "6", height: "6", rx: "1" })
|
|
1278
|
+
] }),
|
|
1279
|
+
download: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 3v12M7 10l5 5 5-5M4 20h16" }) }),
|
|
1280
|
+
upload: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 16V4M7 9l5-5 5 5M4 20h16" }) }),
|
|
1281
|
+
refresh: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 4v4.686h-4.686" }),
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 8.686 17.657 6.343A8 8 0 1 0 20 12" })
|
|
1284
|
+
] }),
|
|
1285
|
+
loader: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
|
|
1286
|
+
calendar: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2.5" }),
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 3v4M16 3v4M3 10h18M7 14h2M11 14h2M15 14h2M7 18h2M11 18h2" })
|
|
1289
|
+
] }),
|
|
1290
|
+
clock: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1292
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 7v5l3.5 2" })
|
|
1293
|
+
] }),
|
|
1294
|
+
mail: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1295
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5" }),
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m4 7 8 6 8-6" })
|
|
1297
|
+
] }),
|
|
1298
|
+
phone: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8.2 3.5 5.4 4.8c-1 .5-1.5 1.7-1.1 2.8 2.2 5.9 6.2 9.9 12.1 12.1 1.1.4 2.3-.1 2.8-1.1l1.3-2.8-4.2-2-1.4 2.1c-2.8-1.2-5.6-4-6.8-6.8l2.1-1.4-2-4.2Z" }),
|
|
1299
|
+
link: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m9.5 14.5 5-5" }),
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7.5 16.5 6 18a3.5 3.5 0 0 1-5-5l3-3a3.5 3.5 0 0 1 5 0M16.5 7.5 18 6a3.5 3.5 0 0 1 5 5l-3 3a3.5 3.5 0 0 1-5 0" })
|
|
1302
|
+
] }),
|
|
1303
|
+
"external-link": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M14 4h6v6M20 4 11 13" }),
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M19 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h6" })
|
|
1306
|
+
] }),
|
|
1307
|
+
eye: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1308
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z" }),
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
1310
|
+
] }),
|
|
1311
|
+
"eye-off": /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m3 3 18 18M10.6 6.1A10 10 0 0 1 12 6c6 0 9.5 6 9.5 6a14.5 14.5 0 0 1-2.2 3M6.4 6.4C3.9 8.2 2.5 12 2.5 12s3.5 6 9.5 6a9.7 9.7 0 0 0 3-.5M9.9 9.9a3 3 0 0 0 4.2 4.2" }) }),
|
|
1312
|
+
lock: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "4", y: "10", width: "16", height: "11", rx: "2.5" }),
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 10V7a4 4 0 0 1 8 0v3M12 14v3" })
|
|
1315
|
+
] }),
|
|
1316
|
+
unlock: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1317
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "4", y: "10", width: "16", height: "11", rx: "2.5" }),
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 10V7a4 4 0 0 1 7.5-2M12 14v3" })
|
|
1319
|
+
] }),
|
|
1320
|
+
bell: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M18 9a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9Z" }),
|
|
1322
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M10 21h4" })
|
|
1323
|
+
] }),
|
|
1324
|
+
star: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2-5.6-3-5.6 3 1.1-6.2L3 9.6l6.2-.9L12 3Z" }),
|
|
1325
|
+
heart: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20.8 5.8a5.5 5.5 0 0 0-7.8 0L12 6.9l-1-1.1a5.5 5.5 0 1 0-7.8 7.8L12 21l8.8-7.4a5.5 5.5 0 0 0 0-7.8Z" }),
|
|
1326
|
+
file: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6 3h8l4 4v14H6V3Z" }),
|
|
1328
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M14 3v5h4" })
|
|
1329
|
+
] }),
|
|
1330
|
+
folder: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 6h7l2 2h9v11H3V6Z" }),
|
|
1331
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1332
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2.5" }),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "9", cy: "9", r: "2" }),
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m4 17 4.5-4.5 3.5 3 2.5-2.5 5.5 5" })
|
|
1335
|
+
] }),
|
|
1336
|
+
filter: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 5h18l-7 8v6l-4 2v-8L3 5Z" }),
|
|
1337
|
+
"sort-ascending": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1338
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 19V5M3.5 8.5 7 5l3.5 3.5" }),
|
|
1339
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M13 7h8M13 12h6M13 17h4" })
|
|
1340
|
+
] }),
|
|
1341
|
+
"sort-descending": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1342
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 5v14M3.5 15.5 7 19l3.5-3.5" }),
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M13 7h4M13 12h6M13 17h8" })
|
|
1344
|
+
] }),
|
|
1345
|
+
play: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m10 8 6 4-6 4V8Z" })
|
|
1348
|
+
] }),
|
|
1349
|
+
pause: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M9.5 9v6M14.5 9v6" })
|
|
1352
|
+
] }),
|
|
1353
|
+
book: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3H11v17H6.5A2.5 2.5 0 0 0 4 22V5.5Z" }),
|
|
1355
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 5.5A2.5 2.5 0 0 0 17.5 3H13v17h4.5A2.5 2.5 0 0 1 20 22V5.5Z" })
|
|
1356
|
+
] }),
|
|
1357
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "4", y: "4", width: "6", height: "6", rx: "1.5" }),
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "14", y: "4", width: "6", height: "6", rx: "1.5" }),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "4", y: "14", width: "6", height: "6", rx: "1.5" }),
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "14", y: "14", width: "6", height: "6", rx: "1.5" })
|
|
1362
|
+
] }),
|
|
1363
|
+
token: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "4" }),
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 2.5v3M12 18.5v3M2.5 12h3M18.5 12h3M5.3 5.3l2.1 2.1M16.6 16.6l2.1 2.1M18.7 5.3l-2.1 2.1M7.4 16.6l-2.1 2.1" })
|
|
1366
|
+
] }),
|
|
1367
|
+
sun: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "3.6" }),
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M18.7 5.3l-1.4 1.4M6.7 17.3l-1.4 1.4" })
|
|
1370
|
+
] }),
|
|
1371
|
+
moon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M20 15.2A8 8 0 0 1 8.8 4 8.5 8.5 0 1 0 20 15.2Z" }),
|
|
1372
|
+
code: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m9 18-6-6 6-6M15 6l6 6-6 6" }),
|
|
1373
|
+
github: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M9 19c-4 1.2-4-2-5-2.5M14 22v-3.1c0-.9.3-1.5.8-1.9 2.7-.3 5.5-1.3 5.5-6A4.7 4.7 0 0 0 19 7.7 4.4 4.4 0 0 0 18.9 4S17.8 3.7 15 5.3a11.7 11.7 0 0 0-6 0C6.2 3.7 5.1 4 5.1 4A4.4 4.4 0 0 0 5 7.7 4.7 4.7 0 0 0 3.7 11c0 4.7 2.8 5.7 5.5 6 .5.4.8 1 .8 1.9V22" })
|
|
1103
1374
|
};
|
|
1104
1375
|
var iconPaths = { ...coreIconPaths, ...extendedIconPaths };
|
|
1105
1376
|
var ICON_NAMES = Object.freeze(Object.keys(iconPaths));
|
|
1106
1377
|
var filledIconPaths = {
|
|
1107
|
-
info: /* @__PURE__ */ (0,
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1109
|
-
/* @__PURE__ */ (0,
|
|
1110
|
-
] }),
|
|
1111
|
-
question: /* @__PURE__ */ (0,
|
|
1112
|
-
/* @__PURE__ */ (0,
|
|
1113
|
-
/* @__PURE__ */ (0,
|
|
1114
|
-
] }),
|
|
1115
|
-
warning: /* @__PURE__ */ (0,
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1117
|
-
/* @__PURE__ */ (0,
|
|
1118
|
-
] }),
|
|
1119
|
-
"circle-check": /* @__PURE__ */ (0,
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
] }),
|
|
1123
|
-
"circle-close": /* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1126
|
-
] }),
|
|
1127
|
-
"circle-plus": /* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1129
|
-
/* @__PURE__ */ (0,
|
|
1130
|
-
] }),
|
|
1131
|
-
"circle-minus": /* @__PURE__ */ (0,
|
|
1132
|
-
/* @__PURE__ */ (0,
|
|
1133
|
-
/* @__PURE__ */ (0,
|
|
1134
|
-
] }),
|
|
1135
|
-
home: /* @__PURE__ */ (0,
|
|
1136
|
-
user: /* @__PURE__ */ (0,
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1139
|
-
] }),
|
|
1140
|
-
users: /* @__PURE__ */ (0,
|
|
1141
|
-
/* @__PURE__ */ (0,
|
|
1142
|
-
/* @__PURE__ */ (0,
|
|
1143
|
-
/* @__PURE__ */ (0,
|
|
1144
|
-
] }),
|
|
1145
|
-
trash: /* @__PURE__ */ (0,
|
|
1146
|
-
bell: /* @__PURE__ */ (0,
|
|
1147
|
-
star: /* @__PURE__ */ (0,
|
|
1148
|
-
heart: /* @__PURE__ */ (0,
|
|
1149
|
-
mail: /* @__PURE__ */ (0,
|
|
1150
|
-
/* @__PURE__ */ (0,
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1152
|
-
] }),
|
|
1153
|
-
lock: /* @__PURE__ */ (0,
|
|
1154
|
-
unlock: /* @__PURE__ */ (0,
|
|
1155
|
-
calendar: /* @__PURE__ */ (0,
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1157
|
-
/* @__PURE__ */ (0,
|
|
1158
|
-
] }),
|
|
1159
|
-
clock: /* @__PURE__ */ (0,
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1162
|
-
] }),
|
|
1163
|
-
file: /* @__PURE__ */ (0,
|
|
1164
|
-
folder: /* @__PURE__ */ (0,
|
|
1165
|
-
image: /* @__PURE__ */ (0,
|
|
1166
|
-
/* @__PURE__ */ (0,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
] }),
|
|
1170
|
-
filter: /* @__PURE__ */ (0,
|
|
1171
|
-
play: /* @__PURE__ */ (0,
|
|
1172
|
-
/* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1174
|
-
] }),
|
|
1175
|
-
pause: /* @__PURE__ */ (0,
|
|
1176
|
-
/* @__PURE__ */ (0,
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1178
|
-
] }),
|
|
1179
|
-
book: /* @__PURE__ */ (0,
|
|
1180
|
-
component: /* @__PURE__ */ (0,
|
|
1181
|
-
/* @__PURE__ */ (0,
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1183
|
-
/* @__PURE__ */ (0,
|
|
1184
|
-
/* @__PURE__ */ (0,
|
|
1185
|
-
] }),
|
|
1186
|
-
token: /* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1378
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 10.5v6M12 7.2v.1", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1381
|
+
] }),
|
|
1382
|
+
question: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M9.6 9a2.5 2.5 0 1 1 3.6 2.3c-.8.5-1.2 1.1-1.2 2.1M12 16.8v.1", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1385
|
+
] }),
|
|
1386
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M10.3 3.5 1.8 19a2 2 0 0 0 1.8 3h16.8a2 2 0 0 0 1.8-3L13.7 3.5a2 2 0 0 0-3.4 0Z", fill: "currentColor", stroke: "none" }),
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 9v5M12 18v.1", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1389
|
+
] }),
|
|
1390
|
+
"circle-check": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m7.5 12 3 3 6-6", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1393
|
+
] }),
|
|
1394
|
+
"circle-close": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m8.8 8.8 6.4 6.4M15.2 8.8l-6.4 6.4", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1397
|
+
] }),
|
|
1398
|
+
"circle-plus": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 7.5v9M7.5 12h9", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1401
|
+
] }),
|
|
1402
|
+
"circle-minus": /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1403
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1404
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7.5 12h9", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1405
|
+
] }),
|
|
1406
|
+
home: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.6 10.8 12 2.8l9.4 8a1 1 0 0 1-1.3 1.5l-.6-.5V21h-5.2v-6.2H9.7V21H4.5v-9.2l-.6.5a1 1 0 1 1-1.3-1.5Z", fill: "currentColor", stroke: "none" }),
|
|
1407
|
+
user: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1408
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "7.5", r: "4.5", fill: "currentColor", stroke: "none" }),
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3.5 21c.7-5 3.6-7.5 8.5-7.5s7.8 2.5 8.5 7.5H3.5Z", fill: "currentColor", stroke: "none" })
|
|
1410
|
+
] }),
|
|
1411
|
+
users: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "8.5", cy: "8", r: "3.8", fill: "currentColor", stroke: "none" }),
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "17", cy: "8.5", r: "3", fill: "currentColor", stroke: "none", opacity: ".7" }),
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M1.8 21c.6-4.6 2.8-7 6.7-7s6.1 2.4 6.7 7H1.8ZM14.4 15.2c3.9-.2 6.4 1.7 7 5.8h-4.5a9.9 9.9 0 0 0-2.5-5.8Z", fill: "currentColor", stroke: "none" })
|
|
1415
|
+
] }),
|
|
1416
|
+
trash: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 3h8l1 3h4v2H3V6h4l1-3Zm-2.5 7h13l-1 11h-11l-1-11Z", fill: "currentColor", stroke: "none" }),
|
|
1417
|
+
bell: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 2.5a2 2 0 0 1 2 1.6c3 .9 5 3.6 5 6.9v4.3l2 3.2H3l2-3.2V11c0-3.3 2-6 5-6.9a2 2 0 0 1 2-1.6ZM9.2 20h5.6a3 3 0 0 1-5.6 0Z", fill: "currentColor", stroke: "none" }),
|
|
1418
|
+
star: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 2.2 3 6 6.6 1-4.8 4.6 1.1 6.6-5.9-3.1-5.9 3.1 1.1-6.6-4.8-4.6 6.6-1 3-6Z", fill: "currentColor", stroke: "none" }),
|
|
1419
|
+
heart: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 21.3 3.1 13.7A5.8 5.8 0 0 1 11 5.2l1 1 1-1a5.8 5.8 0 0 1 7.9 8.5L12 21.3Z", fill: "currentColor", stroke: "none" }),
|
|
1420
|
+
mail: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1421
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2.5", y: "4.5", width: "19", height: "15", rx: "2.5", fill: "currentColor", stroke: "none" }),
|
|
1422
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m4.5 7 7.5 5.8L19.5 7", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "1.8" })
|
|
1423
|
+
] }),
|
|
1424
|
+
lock: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 10V7a5 5 0 0 1 10 0v3h1.5a2.5 2.5 0 0 1 2.5 2.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-7A2.5 2.5 0 0 1 5.5 10H7Zm2.5 0h5V7a2.5 2.5 0 0 0-5 0v3Z", fill: "currentColor", stroke: "none" }),
|
|
1425
|
+
unlock: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 10V7a5 5 0 0 1 9.5-2.2l-2.2 1.1A2.5 2.5 0 0 0 9.5 7v3h9A2.5 2.5 0 0 1 21 12.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-7A2.5 2.5 0 0 1 5.5 10H7Z", fill: "currentColor", stroke: "none" }),
|
|
1426
|
+
calendar: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2.5", y: "4.5", width: "19", height: "17", rx: "2.5", fill: "currentColor", stroke: "none" }),
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 9.5h18M8 2.5v4M16 2.5v4", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "1.8" })
|
|
1429
|
+
] }),
|
|
1430
|
+
clock: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 6.5V12l4 2.3", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "2" })
|
|
1433
|
+
] }),
|
|
1434
|
+
file: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M5 2.5h10l4 4V22H5V2.5Zm9 1.8V8h3.7L14 4.3Z", fill: "currentColor", stroke: "none" }),
|
|
1435
|
+
folder: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2.5 5h7l2.2 2.5h9.8V20H2.5V5Z", fill: "currentColor", stroke: "none" }),
|
|
1436
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "2.5", y: "3.5", width: "19", height: "17", rx: "2.5", fill: "currentColor", stroke: "none" }),
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m4.5 18 4.3-4.6 3.4 3 2.5-2.6 4.8 4.2", stroke: "var(--sia-icon-contrast, #fff)", strokeWidth: "1.7" }),
|
|
1439
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "8", cy: "8.5", r: "1.7", fill: "var(--sia-icon-contrast, #fff)", stroke: "none" })
|
|
1440
|
+
] }),
|
|
1441
|
+
filter: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2 4h20l-7.8 9v6.2L9.8 22v-9L2 4Z", fill: "currentColor", stroke: "none" }),
|
|
1442
|
+
play: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m10 7.8 6.5 4.2-6.5 4.2V7.8Z", fill: "var(--sia-icon-contrast, #fff)", stroke: "none" })
|
|
1445
|
+
] }),
|
|
1446
|
+
pause: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1447
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor", stroke: "none" }),
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8.5 7.5h2.5v9H8.5v-9Zm4.5 0h2.5v9H13v-9Z", fill: "var(--sia-icon-contrast, #fff)", stroke: "none" })
|
|
1449
|
+
] }),
|
|
1450
|
+
book: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3 4.5A3.5 3.5 0 0 1 6.5 1H11v19H6.5A3.5 3.5 0 0 0 3 23V4.5ZM21 4.5A3.5 3.5 0 0 0 17.5 1H13v19h4.5A3.5 3.5 0 0 1 21 23V4.5Z", fill: "currentColor", stroke: "none" }),
|
|
1451
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3", y: "3", width: "8", height: "8", rx: "2", fill: "currentColor", stroke: "none" }),
|
|
1453
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "13", y: "3", width: "8", height: "8", rx: "2", fill: "currentColor", stroke: "none" }),
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "3", y: "13", width: "8", height: "8", rx: "2", fill: "currentColor", stroke: "none" }),
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { x: "13", y: "13", width: "8", height: "8", rx: "2", fill: "currentColor", stroke: "none" })
|
|
1456
|
+
] }),
|
|
1457
|
+
token: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { cx: "12", cy: "12", r: "5", fill: "currentColor", stroke: "none" }),
|
|
1459
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M12 1v4M12 19v4M1 12h4M19 12h4M4.2 4.2 7 7M17 17l2.8 2.8M19.8 4.2 17 7M7 17l-2.8 2.8", stroke: "currentColor", strokeWidth: "2.2" })
|
|
1189
1460
|
] })
|
|
1190
1461
|
};
|
|
1191
1462
|
var FILLED_ICON_NAMES = Object.freeze(Object.keys(filledIconPaths));
|
|
1192
|
-
var
|
|
1463
|
+
var normalizedOutlinePaths = normalizeIconPaths(iconPaths, outlineIconBounds);
|
|
1464
|
+
var normalizedFilledPaths = normalizeIconPaths(filledIconPaths, filledIconBounds);
|
|
1465
|
+
var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = "1em", strokeWidth = 1.8, rotate = 0, spin = false, pulse = false, label, variant = "outline", className = "", style, ...props }, ref) {
|
|
1193
1466
|
const resolvedSize = typeof size === "number" ? `${size}px` : size;
|
|
1194
1467
|
const mergedStyle = { "--sia-icon-size": resolvedSize, "--sia-icon-rotate": `${rotate}deg`, ...style };
|
|
1195
1468
|
const animationClass = spin ? " sia-icon--spin" : pulse ? " sia-icon--pulse" : "";
|
|
1196
1469
|
const filledPath = filledIconPaths[name];
|
|
1197
1470
|
const resolvedVariant = variant === "filled" && filledPath ? "filled" : "outline";
|
|
1198
|
-
|
|
1471
|
+
const geometry = resolvedVariant === "filled" ? normalizedFilledPaths[name] : normalizedOutlinePaths[name];
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1199
1473
|
"span",
|
|
1200
1474
|
{
|
|
1201
1475
|
ref,
|
|
@@ -1206,15 +1480,15 @@ var Icon = (0, import_react4.forwardRef)(function Icon2({ name, size = "1em", st
|
|
|
1206
1480
|
"aria-hidden": label ? void 0 : true,
|
|
1207
1481
|
style: mergedStyle,
|
|
1208
1482
|
...withTitleTooltip(props),
|
|
1209
|
-
children: /* @__PURE__ */ (0,
|
|
1483
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth / geometry.scale, strokeLinecap: "round", strokeLinejoin: "round", focusable: "false", children: geometry.node })
|
|
1210
1484
|
}
|
|
1211
1485
|
);
|
|
1212
1486
|
});
|
|
1213
1487
|
|
|
1214
1488
|
// src/components/Navigation.tsx
|
|
1215
|
-
var import_react5 = require("react");
|
|
1216
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1217
1489
|
var import_react6 = require("react");
|
|
1490
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1491
|
+
var import_react7 = require("react");
|
|
1218
1492
|
function MenuPopup({
|
|
1219
1493
|
anchorRef,
|
|
1220
1494
|
open,
|
|
@@ -1225,9 +1499,9 @@ function MenuPopup({
|
|
|
1225
1499
|
onMouseEnter,
|
|
1226
1500
|
onMouseLeave
|
|
1227
1501
|
}) {
|
|
1228
|
-
const [mounted, setMounted] = (0,
|
|
1229
|
-
const [fontSize, setFontSize] = (0,
|
|
1230
|
-
(0,
|
|
1502
|
+
const [mounted, setMounted] = (0, import_react6.useState)(open);
|
|
1503
|
+
const [fontSize, setFontSize] = (0, import_react6.useState)();
|
|
1504
|
+
(0, import_react6.useLayoutEffect)(() => {
|
|
1231
1505
|
const anchor = anchorRef.current;
|
|
1232
1506
|
if (!mounted || !anchor) return;
|
|
1233
1507
|
const syncFontSize = () => setFontSize(getComputedStyle(anchor).fontSize);
|
|
@@ -1236,7 +1510,7 @@ function MenuPopup({
|
|
|
1236
1510
|
observer.observe(anchor);
|
|
1237
1511
|
return () => observer.disconnect();
|
|
1238
1512
|
});
|
|
1239
|
-
(0,
|
|
1513
|
+
(0, import_react6.useEffect)(() => {
|
|
1240
1514
|
if (open) {
|
|
1241
1515
|
setMounted(true);
|
|
1242
1516
|
return void 0;
|
|
@@ -1244,7 +1518,7 @@ function MenuPopup({
|
|
|
1244
1518
|
const timer = window.setTimeout(() => setMounted(false), 160);
|
|
1245
1519
|
return () => window.clearTimeout(timer);
|
|
1246
1520
|
}, [open]);
|
|
1247
|
-
return /* @__PURE__ */ (0,
|
|
1521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1248
1522
|
PopupPortal,
|
|
1249
1523
|
{
|
|
1250
1524
|
anchorRef,
|
|
@@ -1256,7 +1530,7 @@ function MenuPopup({
|
|
|
1256
1530
|
"data-sia-menu-owner": menuId,
|
|
1257
1531
|
onMouseEnter,
|
|
1258
1532
|
onMouseLeave,
|
|
1259
|
-
children: /* @__PURE__ */ (0,
|
|
1533
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "sia-menu__popup-list", role: "menu", children })
|
|
1260
1534
|
}
|
|
1261
1535
|
);
|
|
1262
1536
|
}
|
|
@@ -1267,15 +1541,15 @@ function MenuEntry({
|
|
|
1267
1541
|
props,
|
|
1268
1542
|
reserveIcon
|
|
1269
1543
|
}) {
|
|
1270
|
-
const anchorRef = (0,
|
|
1271
|
-
const closeTimerRef = (0,
|
|
1544
|
+
const anchorRef = (0, import_react6.useRef)(null);
|
|
1545
|
+
const closeTimerRef = (0, import_react6.useRef)(void 0);
|
|
1272
1546
|
const hasChildren = Boolean(item.children?.length);
|
|
1273
1547
|
const isOpen = props.open.includes(item.key);
|
|
1274
1548
|
const isSelected = props.selected.includes(item.key);
|
|
1275
1549
|
const path = [item.key, ...parents];
|
|
1276
1550
|
const collapsed = props.inlineCollapsed && level === 0;
|
|
1277
1551
|
const inlineSubmenu = props.mode === "inline" && !collapsed;
|
|
1278
|
-
(0,
|
|
1552
|
+
(0, import_react6.useEffect)(() => () => {
|
|
1279
1553
|
if (closeTimerRef.current !== void 0) window.clearTimeout(closeTimerRef.current);
|
|
1280
1554
|
}, []);
|
|
1281
1555
|
function cancelClose() {
|
|
@@ -1289,9 +1563,9 @@ function MenuEntry({
|
|
|
1289
1563
|
closeTimerRef.current = window.setTimeout(() => props.toggle(item.key, false), 100);
|
|
1290
1564
|
}
|
|
1291
1565
|
const hover = props.triggerSubMenuAction === "hover" && hasChildren && !inlineSubmenu;
|
|
1292
|
-
const submenu = hasChildren ? /* @__PURE__ */ (0,
|
|
1566
|
+
const submenu = hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [item.key, ...parents], props }) : null;
|
|
1293
1567
|
const popupPlacement = props.mode === "horizontal" && level === 0 ? "bottom-start" : "right-start";
|
|
1294
|
-
return /* @__PURE__ */ (0,
|
|
1568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1295
1569
|
"li",
|
|
1296
1570
|
{
|
|
1297
1571
|
className: `sia-menu__entry${isOpen ? " is-open" : ""}${isSelected ? " is-selected" : ""}${item.disabled ? " is-disabled" : ""}${item.danger ? " is-danger" : ""}`,
|
|
@@ -1301,7 +1575,7 @@ function MenuEntry({
|
|
|
1301
1575
|
} : void 0,
|
|
1302
1576
|
onMouseLeave: hover ? scheduleClose : void 0,
|
|
1303
1577
|
children: [
|
|
1304
|
-
/* @__PURE__ */ (0,
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1305
1579
|
"button",
|
|
1306
1580
|
{
|
|
1307
1581
|
ref: anchorRef,
|
|
@@ -1314,14 +1588,14 @@ function MenuEntry({
|
|
|
1314
1588
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
1315
1589
|
onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
|
|
1316
1590
|
children: [
|
|
1317
|
-
reserveIcon ? /* @__PURE__ */ (0,
|
|
1318
|
-
!collapsed ? /* @__PURE__ */ (0,
|
|
1319
|
-
!collapsed && item.extra ? /* @__PURE__ */ (0,
|
|
1320
|
-
!collapsed && hasChildren ? /* @__PURE__ */ (0,
|
|
1591
|
+
reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
|
|
1592
|
+
!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
|
|
1593
|
+
!collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
|
|
1594
|
+
!collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
|
|
1321
1595
|
]
|
|
1322
1596
|
}
|
|
1323
1597
|
),
|
|
1324
|
-
hasChildren ? inlineSubmenu ? /* @__PURE__ */ (0,
|
|
1598
|
+
hasChildren ? inlineSubmenu ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "sia-menu__submenu", role: "menu", "aria-hidden": !isOpen, children: submenu }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1325
1599
|
MenuPopup,
|
|
1326
1600
|
{
|
|
1327
1601
|
anchorRef,
|
|
@@ -1348,13 +1622,13 @@ function MenuLevel({
|
|
|
1348
1622
|
props,
|
|
1349
1623
|
reserveIcon = hasMenuIcon(items)
|
|
1350
1624
|
}) {
|
|
1351
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
-
if (item.type === "divider") return /* @__PURE__ */ (0,
|
|
1353
|
-
if (item.type === "group") return /* @__PURE__ */ (0,
|
|
1354
|
-
/* @__PURE__ */ (0,
|
|
1355
|
-
/* @__PURE__ */ (0,
|
|
1625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: items.map((item, index) => {
|
|
1626
|
+
if (item.type === "divider") return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
|
|
1627
|
+
if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { className: "sia-menu__group", children: [
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "sia-menu__group-title", children: item.label }),
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
|
|
1356
1630
|
] }, item.key);
|
|
1357
|
-
return /* @__PURE__ */ (0,
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
1358
1632
|
}) });
|
|
1359
1633
|
}
|
|
1360
1634
|
function Menu({
|
|
@@ -1377,11 +1651,11 @@ function Menu({
|
|
|
1377
1651
|
className = "",
|
|
1378
1652
|
...rest
|
|
1379
1653
|
}) {
|
|
1380
|
-
const menuId = (0,
|
|
1381
|
-
const rootRef = (0,
|
|
1654
|
+
const menuId = (0, import_react6.useId)();
|
|
1655
|
+
const rootRef = (0, import_react6.useRef)(null);
|
|
1382
1656
|
const [selected, setSelected] = useControllableState({ value: selectedKeys, defaultValue: defaultSelectedKeys });
|
|
1383
1657
|
const [open, setOpen] = useControllableState({ value: openKeys, defaultValue: defaultOpenKeys, onChange: (next) => onOpenChange?.([...next]) });
|
|
1384
|
-
(0,
|
|
1658
|
+
(0, import_react6.useEffect)(() => {
|
|
1385
1659
|
if (mode === "inline" || !open.length) return void 0;
|
|
1386
1660
|
const closeOutside = (event) => {
|
|
1387
1661
|
const target = event.target;
|
|
@@ -1407,11 +1681,11 @@ function Menu({
|
|
|
1407
1681
|
else onSelect?.({ ...info, selectedKeys: [...next] });
|
|
1408
1682
|
if (mode !== "inline") setOpen([]);
|
|
1409
1683
|
}
|
|
1410
|
-
return /* @__PURE__ */ (0,
|
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1411
1685
|
}
|
|
1412
1686
|
function Segmented({ options, value, defaultValue, variant = "default", shape = "capsule", size: sizeProp, block = false, vertical = false, disabled = false, onChange, className = "", onKeyDown, ...props }) {
|
|
1413
1687
|
const size = useControlSize(sizeProp);
|
|
1414
|
-
const normalized = (0,
|
|
1688
|
+
const normalized = (0, import_react6.useMemo)(() => options.map((option) => typeof option === "object" ? option : { label: option, value: option }), [options]);
|
|
1415
1689
|
const [current, setCurrent] = useControllableState({ value, defaultValue: defaultValue ?? normalized[0]?.value, onChange: (next) => next !== void 0 && onChange?.(next) });
|
|
1416
1690
|
function keyboard(event) {
|
|
1417
1691
|
onKeyDown?.(event);
|
|
@@ -1422,11 +1696,11 @@ function Segmented({ options, value, defaultValue, variant = "default", shape =
|
|
|
1422
1696
|
const next = event.key === "ArrowRight" || event.key === "ArrowDown" ? enabled[(index + 1) % enabled.length] : enabled[(index - 1 + enabled.length) % enabled.length];
|
|
1423
1697
|
if (next) setCurrent(next.value);
|
|
1424
1698
|
}
|
|
1425
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `sia-segmented sia-segmented--${size}${variant === "zigzag" && !vertical && normalized.length === 2 ? ` sia-segmented--zigzag sia-segmented--shape-${shape}` : ""}${block ? " sia-segmented--block" : ""}${vertical ? " sia-segmented--vertical" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), role: "radiogroup", onKeyDown: keyboard, ...withTitleTooltip(props), children: normalized.map((option) => /* @__PURE__ */ (0, import_react7.createElement)("button", { type: "button", role: "radio", "aria-checked": option.value === current, ...withTitleTooltip({ title: option.title }), className: option.value === current ? "is-selected" : "", disabled: disabled || option.disabled, key: option.value, onClick: () => setCurrent(option.value) }, option.icon, /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: option.label ?? option.value }))) });
|
|
1426
1700
|
}
|
|
1427
1701
|
|
|
1428
1702
|
// src/components/Dropdown.tsx
|
|
1429
|
-
var
|
|
1703
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1430
1704
|
var placementMap = {
|
|
1431
1705
|
bottomLeft: "bottom-start",
|
|
1432
1706
|
bottomRight: "bottom-end",
|
|
@@ -1458,19 +1732,19 @@ function DropdownRoot({
|
|
|
1458
1732
|
onKeyDown,
|
|
1459
1733
|
...props
|
|
1460
1734
|
}) {
|
|
1461
|
-
const rootRef = (0,
|
|
1462
|
-
const contextAnchorRef = (0,
|
|
1463
|
-
const popupRef = (0,
|
|
1464
|
-
const openTimerRef = (0,
|
|
1465
|
-
const closeTimerRef = (0,
|
|
1466
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
1467
|
-
const [mounted, setMounted] = (0,
|
|
1468
|
-
const [contextPoint, setContextPoint] = (0,
|
|
1735
|
+
const rootRef = (0, import_react8.useRef)(null);
|
|
1736
|
+
const contextAnchorRef = (0, import_react8.useRef)(null);
|
|
1737
|
+
const popupRef = (0, import_react8.useRef)(null);
|
|
1738
|
+
const openTimerRef = (0, import_react8.useRef)(void 0);
|
|
1739
|
+
const closeTimerRef = (0, import_react8.useRef)(void 0);
|
|
1740
|
+
const [internalOpen, setInternalOpen] = (0, import_react8.useState)(defaultOpen);
|
|
1741
|
+
const [mounted, setMounted] = (0, import_react8.useState)(open ?? defaultOpen);
|
|
1742
|
+
const [contextPoint, setContextPoint] = (0, import_react8.useState)();
|
|
1469
1743
|
const visible = open ?? internalOpen;
|
|
1470
1744
|
const triggerSet = new Set(trigger);
|
|
1471
1745
|
const pointAtCenter = typeof arrow === "object" && arrow.pointAtCenter;
|
|
1472
|
-
const [triggerFontSize, setTriggerFontSize] = (0,
|
|
1473
|
-
(0,
|
|
1746
|
+
const [triggerFontSize, setTriggerFontSize] = (0, import_react8.useState)();
|
|
1747
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
1474
1748
|
if (!visible || !rootRef.current) return;
|
|
1475
1749
|
const root = rootRef.current;
|
|
1476
1750
|
const target = root.querySelector("button, [role='button'], a") ?? (root.firstElementChild !== contextAnchorRef.current ? root.firstElementChild : null) ?? root;
|
|
@@ -1505,7 +1779,7 @@ function DropdownRoot({
|
|
|
1505
1779
|
clearTimer(closeTimerRef);
|
|
1506
1780
|
closeTimerRef.current = window.setTimeout(() => updateOpen(false, "trigger"), Math.max(0, closeDelay));
|
|
1507
1781
|
}
|
|
1508
|
-
(0,
|
|
1782
|
+
(0, import_react8.useEffect)(() => {
|
|
1509
1783
|
if (visible) {
|
|
1510
1784
|
setMounted(true);
|
|
1511
1785
|
return void 0;
|
|
@@ -1513,11 +1787,11 @@ function DropdownRoot({
|
|
|
1513
1787
|
const timer = window.setTimeout(() => setMounted(false), 160);
|
|
1514
1788
|
return () => window.clearTimeout(timer);
|
|
1515
1789
|
}, [visible]);
|
|
1516
|
-
(0,
|
|
1790
|
+
(0, import_react8.useEffect)(() => {
|
|
1517
1791
|
if (!visible && !mounted) setContextPoint(void 0);
|
|
1518
1792
|
}, [mounted, visible]);
|
|
1519
|
-
(0,
|
|
1520
|
-
(0,
|
|
1793
|
+
(0, import_react8.useEffect)(() => () => clearTimers(), []);
|
|
1794
|
+
(0, import_react8.useEffect)(() => {
|
|
1521
1795
|
if (!visible) return void 0;
|
|
1522
1796
|
const contextMenuTrigger = triggerSet.has("contextMenu");
|
|
1523
1797
|
const closeOutside = (event) => {
|
|
@@ -1547,7 +1821,7 @@ function DropdownRoot({
|
|
|
1547
1821
|
document.removeEventListener("pointerover", keepOpenOverNestedMenu);
|
|
1548
1822
|
};
|
|
1549
1823
|
}, [visible]);
|
|
1550
|
-
(0,
|
|
1824
|
+
(0, import_react8.useEffect)(() => {
|
|
1551
1825
|
if (!visible || !mounted || !autoFocus) return void 0;
|
|
1552
1826
|
const frame = window.requestAnimationFrame(() => {
|
|
1553
1827
|
popupRef.current?.querySelector(
|
|
@@ -1596,7 +1870,7 @@ function DropdownRoot({
|
|
|
1596
1870
|
updateOpen(true, "trigger");
|
|
1597
1871
|
}
|
|
1598
1872
|
}
|
|
1599
|
-
const menuNode = /* @__PURE__ */ (0,
|
|
1873
|
+
const menuNode = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1600
1874
|
Menu,
|
|
1601
1875
|
{
|
|
1602
1876
|
mode: "vertical",
|
|
@@ -1613,11 +1887,11 @@ function DropdownRoot({
|
|
|
1613
1887
|
className: "sia-dropdown__menu"
|
|
1614
1888
|
}
|
|
1615
1889
|
);
|
|
1616
|
-
const triggerNode = showTriggerIcon && (0,
|
|
1890
|
+
const triggerNode = showTriggerIcon && (0, import_react8.isValidElement)(children) && children.type === Button && children.props.children !== void 0 && children.props.children !== null ? (0, import_react8.cloneElement)(children, {}, /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "sia-dropdown__trigger-content", children: [
|
|
1617
1891
|
children.props.children,
|
|
1618
|
-
/* @__PURE__ */ (0,
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chevron-down", size: 14, className: "sia-dropdown__trigger-icon" })
|
|
1619
1893
|
] })) : children;
|
|
1620
|
-
return /* @__PURE__ */ (0,
|
|
1894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1621
1895
|
"span",
|
|
1622
1896
|
{
|
|
1623
1897
|
ref: rootRef,
|
|
@@ -1633,7 +1907,7 @@ function DropdownRoot({
|
|
|
1633
1907
|
...withTitleTooltip(props),
|
|
1634
1908
|
children: [
|
|
1635
1909
|
triggerNode,
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1637
1911
|
"span",
|
|
1638
1912
|
{
|
|
1639
1913
|
ref: contextAnchorRef,
|
|
@@ -1642,7 +1916,7 @@ function DropdownRoot({
|
|
|
1642
1916
|
"aria-hidden": "true"
|
|
1643
1917
|
}
|
|
1644
1918
|
),
|
|
1645
|
-
/* @__PURE__ */ (0,
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1646
1920
|
PopupPortal,
|
|
1647
1921
|
{
|
|
1648
1922
|
ref: popupRef,
|
|
@@ -1679,15 +1953,15 @@ function DropdownButton({
|
|
|
1679
1953
|
trigger = ["click"],
|
|
1680
1954
|
...dropdownProps
|
|
1681
1955
|
}) {
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
1684
|
-
/* @__PURE__ */ (0,
|
|
1956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: `sia-dropdown-button ${className}`.trim(), children: [
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownRoot, { ...dropdownProps, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1685
1959
|
Button,
|
|
1686
1960
|
{
|
|
1687
1961
|
...buttonProps,
|
|
1688
1962
|
className: `sia-dropdown-button__arrow ${buttonProps?.className ?? ""}`.trim(),
|
|
1689
1963
|
disabled: disabled || dropdownDisabled,
|
|
1690
|
-
icon: /* @__PURE__ */ (0,
|
|
1964
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chevron-down", size: 14 }),
|
|
1691
1965
|
"aria-label": "\u5C55\u5F00\u4E0B\u62C9\u83DC\u5355"
|
|
1692
1966
|
}
|
|
1693
1967
|
) })
|
|
@@ -1699,12 +1973,12 @@ var Dropdown = Object.assign(DropdownRoot, {
|
|
|
1699
1973
|
});
|
|
1700
1974
|
|
|
1701
1975
|
// src/components/Toolbar.tsx
|
|
1702
|
-
var
|
|
1976
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1703
1977
|
function Toolbar({ items, onAction, disabled = false, size = "small", variant = "link", overflowLabel = "\u66F4\u591A\u64CD\u4F5C" }) {
|
|
1704
|
-
const root = (0,
|
|
1705
|
-
const [visibleCount, setVisibleCount] = (0,
|
|
1978
|
+
const root = (0, import_react9.useRef)(null);
|
|
1979
|
+
const [visibleCount, setVisibleCount] = (0, import_react9.useState)(Number.MAX_SAFE_INTEGER);
|
|
1706
1980
|
const visibleItems = items.filter((item) => !item.hidden);
|
|
1707
|
-
(0,
|
|
1981
|
+
(0, import_react9.useLayoutEffect)(() => {
|
|
1708
1982
|
const element = root.current;
|
|
1709
1983
|
if (!element) return;
|
|
1710
1984
|
const buttons = Array.from(element.querySelectorAll("[data-sia-toolbar-item]"));
|
|
@@ -1756,19 +2030,19 @@ function Toolbar({ items, onAction, disabled = false, size = "small", variant =
|
|
|
1756
2030
|
] : void 0
|
|
1757
2031
|
}));
|
|
1758
2032
|
const overflow = visibleItems.slice(visibleCount);
|
|
1759
|
-
return /* @__PURE__ */ (0,
|
|
2033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: root, className: "sia-toolbar", role: "toolbar", children: [
|
|
1760
2034
|
visibleItems.map((item, index) => {
|
|
1761
2035
|
const buttonProps = { size, variant, icon: item.icon, disabled: blocked(item), loading: item.loading, danger: item.danger };
|
|
1762
2036
|
const menu = { items: menuItems(item.children ?? []), onClick: ({ key }) => invoke(key) };
|
|
1763
|
-
return /* @__PURE__ */ (0,
|
|
2037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { "data-sia-toolbar-item": true, className: `sia-toolbar__item${index >= visibleCount ? " sia-toolbar__item--hidden" : ""}`, "aria-hidden": index >= visibleCount || void 0, children: item.children?.length ? item.split ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Dropdown.Button, { trigger: ["hover"], menu, disabled: blocked(item), buttonProps, onClick: () => invoke(item.key), children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Dropdown, { trigger: ["hover"], menu, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { ...buttonProps, children: item.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { ...buttonProps, onClick: () => invoke(item.key), children: item.label }) }, item.key);
|
|
1764
2038
|
}),
|
|
1765
|
-
/* @__PURE__ */ (0,
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { "data-sia-toolbar-more": true, className: `sia-toolbar__item${overflow.length ? "" : " sia-toolbar__item--hidden"}`, "aria-hidden": !overflow.length || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Dropdown, { trigger: ["hover"], menu: { items: menuItems(overflow), onClick: ({ key }) => invoke(key) }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { size, variant, disabled, "aria-label": overflowLabel, title: overflowLabel, icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "more-horizontal", size: 16 }) }) }) })
|
|
1766
2040
|
] });
|
|
1767
2041
|
}
|
|
1768
2042
|
|
|
1769
2043
|
// src/components/Card.tsx
|
|
1770
|
-
var
|
|
1771
|
-
var
|
|
2044
|
+
var import_react10 = require("react");
|
|
2045
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1772
2046
|
function Card({
|
|
1773
2047
|
bordered = true,
|
|
1774
2048
|
title,
|
|
@@ -1797,8 +2071,8 @@ function Card({
|
|
|
1797
2071
|
onKeyDown,
|
|
1798
2072
|
...props
|
|
1799
2073
|
}) {
|
|
1800
|
-
const [internalCollapsed, setInternalCollapsed] = (0,
|
|
1801
|
-
const [internalSelected, setInternalSelected] = (0,
|
|
2074
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react10.useState)(defaultCollapsed);
|
|
2075
|
+
const [internalSelected, setInternalSelected] = (0, import_react10.useState)(defaultSelected);
|
|
1802
2076
|
const isSelected = selected ?? internalSelected;
|
|
1803
2077
|
function toggleSelected() {
|
|
1804
2078
|
if (!selectable || disabled) return;
|
|
@@ -1815,11 +2089,11 @@ function Card({
|
|
|
1815
2089
|
if (collapsed === void 0) setInternalCollapsed(nextCollapsed);
|
|
1816
2090
|
onCollapsedChange?.(nextCollapsed);
|
|
1817
2091
|
}
|
|
1818
|
-
const heading = /* @__PURE__ */ (0,
|
|
1819
|
-
accent || accentColor ? /* @__PURE__ */ (0,
|
|
1820
|
-
title ? /* @__PURE__ */ (0,
|
|
2092
|
+
const heading = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "sia-card__heading", children: [
|
|
2093
|
+
accent || accentColor ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `sia-card__accent${accent ? ` sia-card__accent--${accent}` : ""}`, "aria-hidden": "true" }) : null,
|
|
2094
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "sia-card__title", children: title }) : null
|
|
1821
2095
|
] });
|
|
1822
|
-
return /* @__PURE__ */ (0,
|
|
2096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1823
2097
|
"section",
|
|
1824
2098
|
{
|
|
1825
2099
|
className: `sia-card${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
@@ -1843,18 +2117,18 @@ function Card({
|
|
|
1843
2117
|
}
|
|
1844
2118
|
},
|
|
1845
2119
|
children: [
|
|
1846
|
-
selectable && isSelected && showSelectedIndicator ? /* @__PURE__ */ (0,
|
|
1847
|
-
hasHeader ? /* @__PURE__ */ (0,
|
|
1848
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
2120
|
+
selectable && isSelected && showSelectedIndicator ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sia-card__selected-corner", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { name: "check", size: 16 }) }) : null,
|
|
2121
|
+
hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "sia-card__header", children: [
|
|
2122
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "sia-card__collapse-trigger", "aria-expanded": !isCollapsed, onClick: toggleCollapsed, children: [
|
|
1849
2123
|
heading,
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { name: isCollapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
1851
2125
|
] }) : heading,
|
|
1852
|
-
extra ? /* @__PURE__ */ (0,
|
|
2126
|
+
extra ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "sia-card__extra", children: extra }) : null
|
|
1853
2127
|
] }) : null,
|
|
1854
|
-
!isCollapsed ? /* @__PURE__ */ (0,
|
|
1855
|
-
description ? /* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
hoverActions ? /* @__PURE__ */ (0,
|
|
2128
|
+
!isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2129
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "sia-card__description", children: description }) : null,
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `sia-card__body ${bodyClassName}`.trim(), style: mergedBodyStyle, children }),
|
|
2131
|
+
hoverActions ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "sia-card__hover-actions", onClick: (event) => event.stopPropagation(), children: hoverActions }) : null
|
|
1858
2132
|
] }) : null
|
|
1859
2133
|
]
|
|
1860
2134
|
}
|
|
@@ -1862,7 +2136,7 @@ function Card({
|
|
|
1862
2136
|
}
|
|
1863
2137
|
|
|
1864
2138
|
// src/components/Tag.tsx
|
|
1865
|
-
var
|
|
2139
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1866
2140
|
function Tag({
|
|
1867
2141
|
size: sizeProp,
|
|
1868
2142
|
color,
|
|
@@ -1881,7 +2155,7 @@ function Tag({
|
|
|
1881
2155
|
}) {
|
|
1882
2156
|
const size = useControlSize(sizeProp ?? (compact ? "small" : void 0));
|
|
1883
2157
|
const customColor = color?.trim() ? variant === "outlined" ? { borderColor: color, color, backgroundColor: "transparent" } : variant === "filled" ? { backgroundColor: color, color: "#fff", borderColor: "transparent" } : { color, backgroundColor: `color-mix(in srgb, ${color} 10%, transparent)`, borderColor: `color-mix(in srgb, ${color} 35%, transparent)` } : void 0;
|
|
1884
|
-
return /* @__PURE__ */ (0,
|
|
2158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1885
2159
|
"span",
|
|
1886
2160
|
{
|
|
1887
2161
|
className: `sia-tag${closable && closeOnHover ? " sia-tag--close-on-hover" : ""} sia-tag--${status} sia-tag--${variant} sia-tag--${size}${compact && size === "small" ? " sia-tag--compact" : ""}${disabled ? " sia-tag--disabled" : ""} ${className}`.trim(),
|
|
@@ -1889,9 +2163,9 @@ function Tag({
|
|
|
1889
2163
|
style: customColor ? { ...customColor, ...style } : style,
|
|
1890
2164
|
...withTitleTooltip(props),
|
|
1891
2165
|
children: [
|
|
1892
|
-
icon ? /* @__PURE__ */ (0,
|
|
1893
|
-
/* @__PURE__ */ (0,
|
|
1894
|
-
closable ? /* @__PURE__ */ (0,
|
|
2166
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sia-tag__icon", children: icon }) : null,
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children }),
|
|
2168
|
+
closable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1895
2169
|
"button",
|
|
1896
2170
|
{
|
|
1897
2171
|
type: "button",
|
|
@@ -1902,7 +2176,7 @@ function Tag({
|
|
|
1902
2176
|
event.stopPropagation();
|
|
1903
2177
|
onClose?.(event);
|
|
1904
2178
|
},
|
|
1905
|
-
children: /* @__PURE__ */ (0,
|
|
2179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "close", size: size === "large" ? 14 : 12 })
|
|
1906
2180
|
}
|
|
1907
2181
|
) : null
|
|
1908
2182
|
]
|
|
@@ -1911,9 +2185,9 @@ function Tag({
|
|
|
1911
2185
|
}
|
|
1912
2186
|
|
|
1913
2187
|
// src/components/Tabs.tsx
|
|
1914
|
-
var import_react10 = require("react");
|
|
1915
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1916
2188
|
var import_react11 = require("react");
|
|
2189
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2190
|
+
var import_react12 = require("react");
|
|
1917
2191
|
function Tabs({
|
|
1918
2192
|
items,
|
|
1919
2193
|
activeKey,
|
|
@@ -1938,22 +2212,22 @@ function Tabs({
|
|
|
1938
2212
|
...props
|
|
1939
2213
|
}) {
|
|
1940
2214
|
const firstEnabledKey = items.find((item) => !item.disabled)?.key ?? "";
|
|
1941
|
-
const [internalActiveKey, setInternalActiveKey] = (0,
|
|
2215
|
+
const [internalActiveKey, setInternalActiveKey] = (0, import_react11.useState)(defaultActiveKey ?? firstEnabledKey);
|
|
1942
2216
|
const currentKey = activeKey ?? internalActiveKey;
|
|
1943
2217
|
const selectedKey = items.some((item) => item.key === currentKey && !item.disabled) ? currentKey : firstEnabledKey;
|
|
1944
|
-
const baseId = (0,
|
|
1945
|
-
const enabledItems = (0,
|
|
2218
|
+
const baseId = (0, import_react11.useId)().replace(/:/g, "");
|
|
2219
|
+
const enabledItems = (0, import_react11.useMemo)(() => items.filter((item) => !item.disabled), [items]);
|
|
1946
2220
|
const resolvedPosition = tabPosition ?? (orientation === "vertical" ? "left" : "top");
|
|
1947
2221
|
const resolvedOrientation = resolvedPosition === "left" || resolvedPosition === "right" ? "vertical" : "horizontal";
|
|
1948
2222
|
const sliding = ["capsule", "line", "underline", "tech", "tech-line"].includes(type);
|
|
1949
|
-
const listRef = (0,
|
|
1950
|
-
const indicatorRef = (0,
|
|
1951
|
-
const moreRef = (0,
|
|
1952
|
-
const [overflow, setOverflow] = (0,
|
|
1953
|
-
const [moreOpen, setMoreOpen] = (0,
|
|
2223
|
+
const listRef = (0, import_react11.useRef)(null);
|
|
2224
|
+
const indicatorRef = (0, import_react11.useRef)(null);
|
|
2225
|
+
const moreRef = (0, import_react11.useRef)(null);
|
|
2226
|
+
const [overflow, setOverflow] = (0, import_react11.useState)({ count: items.length, width: 0 });
|
|
2227
|
+
const [moreOpen, setMoreOpen] = (0, import_react11.useState)(false);
|
|
1954
2228
|
const visibleCount = resolvedOrientation === "horizontal" ? overflow.count : items.length;
|
|
1955
2229
|
const hiddenItems = items.slice(visibleCount);
|
|
1956
|
-
(0,
|
|
2230
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
1957
2231
|
const list = listRef.current;
|
|
1958
2232
|
if (!list || resolvedOrientation !== "horizontal") return;
|
|
1959
2233
|
const entries = Array.from(list.children).filter((node) => node instanceof HTMLElement && node.hasAttribute("data-tab-entry"));
|
|
@@ -1984,13 +2258,13 @@ function Tabs({
|
|
|
1984
2258
|
entries.forEach((entry) => observer.observe(entry));
|
|
1985
2259
|
return () => observer.disconnect();
|
|
1986
2260
|
}, [items, type, size, closable, resolvedOrientation, tabBarTitle, tabBarExtraContent]);
|
|
1987
|
-
const [contentState, setContentState] = (0,
|
|
1988
|
-
const settledKeyRef = (0,
|
|
1989
|
-
const afterChangeRef = (0,
|
|
1990
|
-
(0,
|
|
2261
|
+
const [contentState, setContentState] = (0, import_react11.useState)(() => ({ key: selectedKey, visited: /* @__PURE__ */ new Set([selectedKey]) }));
|
|
2262
|
+
const settledKeyRef = (0, import_react11.useRef)(selectedKey);
|
|
2263
|
+
const afterChangeRef = (0, import_react11.useRef)(onAfterChange);
|
|
2264
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
1991
2265
|
afterChangeRef.current = onAfterChange;
|
|
1992
2266
|
}, [onAfterChange]);
|
|
1993
|
-
(0,
|
|
2267
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
1994
2268
|
if (!sliding) return;
|
|
1995
2269
|
const list = listRef.current;
|
|
1996
2270
|
const indicator = indicatorRef.current;
|
|
@@ -2020,7 +2294,7 @@ function Tabs({
|
|
|
2020
2294
|
list.querySelectorAll('[role="tab"]').forEach((tab) => observer.observe(tab));
|
|
2021
2295
|
return () => observer.disconnect();
|
|
2022
2296
|
}, [sliding, type, selectedKey, items, size, resolvedPosition, centered, closable, visibleCount]);
|
|
2023
|
-
(0,
|
|
2297
|
+
(0, import_react11.useEffect)(() => {
|
|
2024
2298
|
let cancelled = false;
|
|
2025
2299
|
let frame = 0;
|
|
2026
2300
|
frame = requestAnimationFrame(() => {
|
|
@@ -2069,25 +2343,25 @@ function Tabs({
|
|
|
2069
2343
|
focusAndSelect(enabledItems[nextIndex].key);
|
|
2070
2344
|
}
|
|
2071
2345
|
const hasPanels = items.some((item) => item.children !== void 0);
|
|
2072
|
-
return /* @__PURE__ */ (0,
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2073
2347
|
"div",
|
|
2074
2348
|
{
|
|
2075
2349
|
className: `sia-tabs sia-tabs--${type}${type === "underline" ? " sia-tabs--line" : ""} sia-tabs--${size} sia-tabs--${resolvedOrientation} sia-tabs--${resolvedPosition}${centered ? " sia-tabs--centered" : ""} ${className}`.trim(),
|
|
2076
2350
|
...withTitleTooltip(props),
|
|
2077
2351
|
children: [
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2079
|
-
tabBarTitle ? /* @__PURE__ */ (0,
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "sia-tabs__header", children: [
|
|
2353
|
+
tabBarTitle ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "sia-tabs__title", children: [
|
|
2080
2354
|
tabBarTitle,
|
|
2081
|
-
type === "tech-line" ? /* @__PURE__ */ (0,
|
|
2355
|
+
type === "tech-line" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { className: "sia-tabs__title-connector", viewBox: "0 0 32 40", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M0 39.25 H5 Q8 39.25 10 35.25 L28 3.75 Q29 1.75 32 1.75", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }) }) : null
|
|
2082
2356
|
] }) : null,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2084
|
-
sliding ? /* @__PURE__ */ (0,
|
|
2357
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ref: listRef, style: resolvedOrientation === "horizontal" && overflow.width ? { width: overflow.width } : void 0, className: `sia-tabs__list${sliding ? " sia-tabs__list--sliding" : ""}`, role: "tablist", "aria-orientation": resolvedOrientation, children: [
|
|
2358
|
+
sliding ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { ref: indicatorRef, className: `sia-tabs__indicator${type === "capsule" ? " sia-tabs__capsule-indicator" : ""}`, "aria-hidden": "true", children: type === "tech-line" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sia-tabs__indicator-shape", "aria-hidden": "true" }) : null }, type) : null,
|
|
2085
2359
|
items.map((item, index) => {
|
|
2086
2360
|
const selected = item.key === selectedKey;
|
|
2087
2361
|
const canClose = item.closable ?? closable;
|
|
2088
2362
|
const contextMenuItems = typeof tabContextMenu === "function" ? tabContextMenu(item) : tabContextMenu;
|
|
2089
2363
|
const entryProps = { "data-tab-entry": "", "data-tab-hidden": index >= visibleCount, "aria-hidden": index >= visibleCount || void 0 };
|
|
2090
|
-
const tabNode = /* @__PURE__ */ (0,
|
|
2364
|
+
const tabNode = /* @__PURE__ */ (0, import_react12.createElement)("span", { ...!contextMenuItems?.length ? entryProps : {}, className: `sia-tabs__tab-wrap${canClose ? " is-closable" : ""}`, key: item.key }, /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2091
2365
|
"button",
|
|
2092
2366
|
{
|
|
2093
2367
|
id: `${baseId}-tab-${item.key}`,
|
|
@@ -2101,12 +2375,12 @@ function Tabs({
|
|
|
2101
2375
|
onClick: () => selectTab(item.key),
|
|
2102
2376
|
onKeyDown: (event) => handleKeyDown(event, item.key),
|
|
2103
2377
|
children: [
|
|
2104
|
-
type === "tech-line" ? /* @__PURE__ */ (0,
|
|
2105
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2378
|
+
type === "tech-line" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sia-tabs__tab-shape", "aria-hidden": "true" }) : null,
|
|
2379
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sia-tabs__icon", children: item.icon }) : null,
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.label })
|
|
2107
2381
|
]
|
|
2108
2382
|
}
|
|
2109
|
-
), canClose ? /* @__PURE__ */ (0,
|
|
2383
|
+
), canClose ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2110
2384
|
"button",
|
|
2111
2385
|
{
|
|
2112
2386
|
type: "button",
|
|
@@ -2114,11 +2388,11 @@ function Tabs({
|
|
|
2114
2388
|
"aria-label": `\u5173\u95ED${typeof item.label === "string" ? item.label : "\u6807\u7B7E\u9875"}`,
|
|
2115
2389
|
disabled: item.disabled,
|
|
2116
2390
|
onClick: () => onEdit?.(item.key, "remove"),
|
|
2117
|
-
children: /* @__PURE__ */ (0,
|
|
2391
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "close", size: 12 })
|
|
2118
2392
|
}
|
|
2119
2393
|
) : null);
|
|
2120
2394
|
if (!contextMenuItems?.length) return tabNode;
|
|
2121
|
-
return /* @__PURE__ */ (0,
|
|
2395
|
+
return /* @__PURE__ */ (0, import_react12.createElement)(
|
|
2122
2396
|
Dropdown,
|
|
2123
2397
|
{
|
|
2124
2398
|
...entryProps,
|
|
@@ -2136,7 +2410,7 @@ function Tabs({
|
|
|
2136
2410
|
tabNode
|
|
2137
2411
|
);
|
|
2138
2412
|
}),
|
|
2139
|
-
resolvedOrientation === "horizontal" ? /* @__PURE__ */ (0,
|
|
2413
|
+
resolvedOrientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2140
2414
|
Dropdown,
|
|
2141
2415
|
{
|
|
2142
2416
|
className: "sia-tabs__more",
|
|
@@ -2148,20 +2422,20 @@ function Tabs({
|
|
|
2148
2422
|
open: moreOpen && hiddenItems.length > 0,
|
|
2149
2423
|
onOpenChange: setMoreOpen,
|
|
2150
2424
|
menu: { items: hiddenItems.map((item) => ({ key: item.key, label: item.label, icon: item.icon, disabled: item.disabled })), selectedKeys: [selectedKey], onClick: (info) => selectTab(info.key) },
|
|
2151
|
-
children: /* @__PURE__ */ (0,
|
|
2425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { ref: moreRef, variant: "text", icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "more-horizontal" }), "aria-label": "\u66F4\u591A\u9009\u9879\u5361", onKeyDown: (event) => handleKeyDown(event, selectedKey), className: hiddenItems.some((item) => item.key === selectedKey) ? "is-active" : void 0 })
|
|
2152
2426
|
}
|
|
2153
2427
|
) : null
|
|
2154
2428
|
] }),
|
|
2155
|
-
tabBarExtraContent ? /* @__PURE__ */ (0,
|
|
2429
|
+
tabBarExtraContent ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "sia-tabs__extra", children: tabBarExtraContent }) : null
|
|
2156
2430
|
] }),
|
|
2157
|
-
hasPanels ? /* @__PURE__ */ (0,
|
|
2431
|
+
hasPanels ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "sia-tabs__panels", style: contentGap === void 0 ? void 0 : {
|
|
2158
2432
|
// 仅设置面板靠近导航的一侧,保留各方向布局原有的其余边界。
|
|
2159
2433
|
[resolvedPosition === "top" ? "paddingTop" : resolvedPosition === "bottom" ? "paddingBottom" : resolvedPosition === "left" ? "paddingLeft" : "paddingRight"]: contentGap
|
|
2160
2434
|
}, "aria-busy": deferContent && contentKey !== selectedKey || void 0, children: items.map((item) => {
|
|
2161
2435
|
const selected = item.key === contentKey;
|
|
2162
2436
|
if (destroyInactiveTabPane && !selected) return null;
|
|
2163
2437
|
if (deferContent && !selected && !contentState.visited.has(item.key)) return null;
|
|
2164
|
-
return /* @__PURE__ */ (0,
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2165
2439
|
"div",
|
|
2166
2440
|
{
|
|
2167
2441
|
id: `${baseId}-panel-${item.key}`,
|
|
@@ -2181,26 +2455,26 @@ function Tabs({
|
|
|
2181
2455
|
}
|
|
2182
2456
|
|
|
2183
2457
|
// src/components/Feedback.tsx
|
|
2184
|
-
var
|
|
2458
|
+
var import_react17 = require("react");
|
|
2185
2459
|
var import_react_dom3 = require("react-dom");
|
|
2186
2460
|
var import_client2 = require("react-dom/client");
|
|
2187
2461
|
|
|
2188
2462
|
// src/components/FloatingDisplay.tsx
|
|
2189
|
-
var
|
|
2463
|
+
var import_react16 = require("react");
|
|
2190
2464
|
var import_react_dom2 = require("react-dom");
|
|
2191
2465
|
|
|
2192
2466
|
// src/components/Checkbox.tsx
|
|
2193
|
-
var
|
|
2194
|
-
var
|
|
2195
|
-
var CheckboxGroupContext = (0,
|
|
2196
|
-
var CheckboxRoot = (0,
|
|
2467
|
+
var import_react13 = require("react");
|
|
2468
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2469
|
+
var CheckboxGroupContext = (0, import_react13.createContext)(null);
|
|
2470
|
+
var CheckboxRoot = (0, import_react13.forwardRef)(function Checkbox({ value, size: sizeProp, indeterminate = false, children, disabled, checked, defaultChecked, className = "", onChange, ...props }, forwardedRef) {
|
|
2197
2471
|
const size = useControlSize(sizeProp);
|
|
2198
|
-
const group = (0,
|
|
2199
|
-
const localRef = (0,
|
|
2200
|
-
const fallbackId = (0,
|
|
2472
|
+
const group = (0, import_react13.useContext)(CheckboxGroupContext);
|
|
2473
|
+
const localRef = (0, import_react13.useRef)(null);
|
|
2474
|
+
const fallbackId = (0, import_react13.useId)();
|
|
2201
2475
|
const grouped = group !== null && value !== void 0;
|
|
2202
2476
|
const currentChecked = grouped ? group.values.includes(value) : checked;
|
|
2203
|
-
(0,
|
|
2477
|
+
(0, import_react13.useEffect)(() => {
|
|
2204
2478
|
if (localRef.current) localRef.current.indeterminate = indeterminate;
|
|
2205
2479
|
}, [indeterminate]);
|
|
2206
2480
|
function setRef(node) {
|
|
@@ -2208,8 +2482,8 @@ var CheckboxRoot = (0, import_react12.forwardRef)(function Checkbox({ value, siz
|
|
|
2208
2482
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
2209
2483
|
else if (forwardedRef) forwardedRef.current = node;
|
|
2210
2484
|
}
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2212
|
-
/* @__PURE__ */ (0,
|
|
2485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: `sia-checkbox sia-checkbox--${size}${disabled || group?.disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2213
2487
|
"input",
|
|
2214
2488
|
{
|
|
2215
2489
|
...withTitleTooltip(props),
|
|
@@ -2228,8 +2502,8 @@ var CheckboxRoot = (0, import_react12.forwardRef)(function Checkbox({ value, siz
|
|
|
2228
2502
|
}
|
|
2229
2503
|
}
|
|
2230
2504
|
),
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2232
|
-
children !== void 0 ? /* @__PURE__ */ (0,
|
|
2505
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-checkbox__control", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}) }),
|
|
2506
|
+
children !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sia-checkbox__label", children }) : null
|
|
2233
2507
|
] });
|
|
2234
2508
|
});
|
|
2235
2509
|
function CheckboxGroup({
|
|
@@ -2253,7 +2527,7 @@ function CheckboxGroup({
|
|
|
2253
2527
|
gap: gap === void 0 ? void 0 : typeof gap === "number" ? Math.max(0, gap) : `${Math.max(0, gap[0])}px ${Math.max(0, gap[1])}px`
|
|
2254
2528
|
};
|
|
2255
2529
|
const [values, setValues] = useControllableState({ value, defaultValue, onChange });
|
|
2256
|
-
const context = (0,
|
|
2530
|
+
const context = (0, import_react13.useMemo)(() => ({
|
|
2257
2531
|
values,
|
|
2258
2532
|
disabled,
|
|
2259
2533
|
name,
|
|
@@ -2262,10 +2536,10 @@ function CheckboxGroup({
|
|
|
2262
2536
|
setValues(next);
|
|
2263
2537
|
}
|
|
2264
2538
|
}), [disabled, name, setValues, values]);
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `sia-checkbox-group${gridColumns ? " sia-checkbox-group--grid" : direction === "vertical" ? " sia-checkbox-group--vertical" : ""} ${className}`.trim(), style: layoutStyle, role: "group", children: [
|
|
2266
2540
|
options?.map((option) => {
|
|
2267
2541
|
const normalized = typeof option === "object" ? option : { label: String(option), value: option };
|
|
2268
|
-
return /* @__PURE__ */ (0,
|
|
2542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CheckboxRoot, { value: normalized.value, disabled: normalized.disabled, children: normalized.label }, normalized.value);
|
|
2269
2543
|
}),
|
|
2270
2544
|
children
|
|
2271
2545
|
] }) }) });
|
|
@@ -2276,14 +2550,14 @@ var Checkbox2 = Object.assign(CheckboxRoot, {
|
|
|
2276
2550
|
});
|
|
2277
2551
|
|
|
2278
2552
|
// src/components/FloatingScrollbarProvider.tsx
|
|
2279
|
-
var
|
|
2553
|
+
var import_react15 = require("react");
|
|
2280
2554
|
|
|
2281
2555
|
// src/components/useScrollbarProximity.ts
|
|
2282
|
-
var
|
|
2556
|
+
var import_react14 = require("react");
|
|
2283
2557
|
var users = 0;
|
|
2284
2558
|
var cleanup;
|
|
2285
2559
|
function useScrollbarProximity() {
|
|
2286
|
-
(0,
|
|
2560
|
+
(0, import_react14.useEffect)(() => {
|
|
2287
2561
|
if (users++ === 0) {
|
|
2288
2562
|
let frame = 0;
|
|
2289
2563
|
let x = -Infinity;
|
|
@@ -2404,7 +2678,7 @@ function createTrack(axis) {
|
|
|
2404
2678
|
}
|
|
2405
2679
|
function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
2406
2680
|
useScrollbarProximity();
|
|
2407
|
-
(0,
|
|
2681
|
+
(0, import_react15.useEffect)(() => {
|
|
2408
2682
|
if (disabled) return;
|
|
2409
2683
|
const layer = document.createElement("div");
|
|
2410
2684
|
layer.className = "sia-floating-scrollbar-layer";
|
|
@@ -2664,7 +2938,7 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
2664
2938
|
}
|
|
2665
2939
|
|
|
2666
2940
|
// src/components/FloatingDisplay.tsx
|
|
2667
|
-
var
|
|
2941
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2668
2942
|
var FLOATING_GAP = 9;
|
|
2669
2943
|
var FLOATING_VIEWPORT_PADDING = 8;
|
|
2670
2944
|
var FLOATING_ARROW_EDGE_OFFSET = 16;
|
|
@@ -2749,23 +3023,23 @@ function Floating({
|
|
|
2749
3023
|
role = "tooltip",
|
|
2750
3024
|
onOpenChange
|
|
2751
3025
|
}) {
|
|
2752
|
-
const rootRef = (0,
|
|
2753
|
-
const triggerElementRef = (0,
|
|
2754
|
-
const overlayRef = (0,
|
|
2755
|
-
const enterTimer = (0,
|
|
2756
|
-
const leaveTimer = (0,
|
|
2757
|
-
const contentId = (0,
|
|
3026
|
+
const rootRef = (0, import_react16.useRef)(null);
|
|
3027
|
+
const triggerElementRef = (0, import_react16.useRef)(null);
|
|
3028
|
+
const overlayRef = (0, import_react16.useRef)(null);
|
|
3029
|
+
const enterTimer = (0, import_react16.useRef)();
|
|
3030
|
+
const leaveTimer = (0, import_react16.useRef)();
|
|
3031
|
+
const contentId = (0, import_react16.useId)();
|
|
2758
3032
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
2759
3033
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
2760
|
-
const [position, setPosition] = (0,
|
|
2761
|
-
const [portalContainer, setPortalContainer] = (0,
|
|
2762
|
-
(0,
|
|
3034
|
+
const [position, setPosition] = (0, import_react16.useState)();
|
|
3035
|
+
const [portalContainer, setPortalContainer] = (0, import_react16.useState)(null);
|
|
3036
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
2763
3037
|
if (!visible) return;
|
|
2764
3038
|
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
2765
3039
|
});
|
|
2766
|
-
const setVisibleRef = (0,
|
|
3040
|
+
const setVisibleRef = (0, import_react16.useRef)(setVisible);
|
|
2767
3041
|
setVisibleRef.current = setVisible;
|
|
2768
|
-
const closeSelfRef = (0,
|
|
3042
|
+
const closeSelfRef = (0, import_react16.useRef)();
|
|
2769
3043
|
if (!closeSelfRef.current) closeSelfRef.current = () => setVisibleRef.current(false);
|
|
2770
3044
|
const exclusiveTooltip = role === "tooltip" && triggers.includes("hover");
|
|
2771
3045
|
function openNow() {
|
|
@@ -2793,7 +3067,7 @@ function Floating({
|
|
|
2793
3067
|
if (delay <= 0) closeNow();
|
|
2794
3068
|
else leaveTimer.current = window.setTimeout(closeNow, delay * 1e3);
|
|
2795
3069
|
}
|
|
2796
|
-
(0,
|
|
3070
|
+
(0, import_react16.useEffect)(() => {
|
|
2797
3071
|
if (!visible || !triggers.includes("click")) return;
|
|
2798
3072
|
const close = (event) => {
|
|
2799
3073
|
const target = event.target;
|
|
@@ -2802,7 +3076,7 @@ function Floating({
|
|
|
2802
3076
|
document.addEventListener("pointerdown", close);
|
|
2803
3077
|
return () => document.removeEventListener("pointerdown", close);
|
|
2804
3078
|
}, [triggers.join("|"), visible]);
|
|
2805
|
-
(0,
|
|
3079
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
2806
3080
|
if (!visible) {
|
|
2807
3081
|
setPosition(void 0);
|
|
2808
3082
|
return;
|
|
@@ -2840,11 +3114,11 @@ function Floating({
|
|
|
2840
3114
|
observer.disconnect();
|
|
2841
3115
|
};
|
|
2842
3116
|
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
2843
|
-
(0,
|
|
3117
|
+
(0, import_react16.useEffect)(() => () => {
|
|
2844
3118
|
clearTimers();
|
|
2845
3119
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
2846
3120
|
}, []);
|
|
2847
|
-
const child = (0,
|
|
3121
|
+
const child = (0, import_react16.cloneElement)(children, {
|
|
2848
3122
|
...triggers.includes("hover") ? { onMouseEnter: (event) => {
|
|
2849
3123
|
triggerElementRef.current = event.currentTarget;
|
|
2850
3124
|
children.props.onMouseEnter?.(event);
|
|
@@ -2870,7 +3144,7 @@ function Floating({
|
|
|
2870
3144
|
"aria-describedby": visible ? contentId : void 0
|
|
2871
3145
|
});
|
|
2872
3146
|
const overlay = visible && content !== null && content !== void 0 && typeof document !== "undefined" ? (0, import_react_dom2.createPortal)(
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
3147
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2874
3148
|
"span",
|
|
2875
3149
|
{
|
|
2876
3150
|
ref: overlayRef,
|
|
@@ -2890,23 +3164,23 @@ function Floating({
|
|
|
2890
3164
|
onMouseLeave: triggers.includes("hover") ? () => hide(mouseLeaveDelay) : void 0,
|
|
2891
3165
|
children: [
|
|
2892
3166
|
content,
|
|
2893
|
-
arrow ? /* @__PURE__ */ (0,
|
|
3167
|
+
arrow ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sia-floating__arrow" }) : null
|
|
2894
3168
|
]
|
|
2895
3169
|
}
|
|
2896
3170
|
),
|
|
2897
3171
|
portalContainer ?? document.body
|
|
2898
3172
|
) : null;
|
|
2899
|
-
return /* @__PURE__ */ (0,
|
|
2900
|
-
/* @__PURE__ */ (0,
|
|
3173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref: rootRef, className: `sia-floating ${className}`.trim(), children: child }),
|
|
2901
3175
|
overlay
|
|
2902
3176
|
] });
|
|
2903
3177
|
}
|
|
2904
3178
|
function Tooltip(props) {
|
|
2905
|
-
return /* @__PURE__ */ (0,
|
|
3179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Floating, { ...props, content: props.title });
|
|
2906
3180
|
}
|
|
2907
3181
|
|
|
2908
3182
|
// src/components/Feedback.tsx
|
|
2909
|
-
var
|
|
3183
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2910
3184
|
function Progress({
|
|
2911
3185
|
percent = 0,
|
|
2912
3186
|
type = "line",
|
|
@@ -2928,35 +3202,35 @@ function Progress({
|
|
|
2928
3202
|
const resolved = status ?? (safe >= 100 ? "success" : "normal");
|
|
2929
3203
|
const color = typeof strokeColor === "string" ? strokeColor : void 0;
|
|
2930
3204
|
const background = typeof strokeColor === "object" ? `linear-gradient(90deg, ${strokeColor.from}, ${strokeColor.to})` : color;
|
|
2931
|
-
const label = format?.(safe, success?.percent) ?? (resolved === "exception" ? /* @__PURE__ */ (0,
|
|
3205
|
+
const label = format?.(safe, success?.percent) ?? (resolved === "exception" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "close" }) : resolved === "success" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "check" }) : `${safe}%`);
|
|
2932
3206
|
if (type !== "line") {
|
|
2933
3207
|
const radius = 46;
|
|
2934
3208
|
const circumference = 2 * Math.PI * radius;
|
|
2935
3209
|
const dash = circumference * (safe / 100);
|
|
2936
|
-
return /* @__PURE__ */ (0,
|
|
2937
|
-
/* @__PURE__ */ (0,
|
|
2938
|
-
/* @__PURE__ */ (0,
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
3210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `sia-progress sia-progress--${type} sia-progress--${resolved} ${className}`.trim(), style: { width, height: width, ...style }, ...withTitleTooltip(props), children: [
|
|
3211
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { viewBox: "0 0 100 100", role: "progressbar", "aria-valuenow": safe, children: [
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { className: "sia-progress__trail", cx: "50", cy: "50", r: radius, style: { stroke: trailColor } }),
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { className: "sia-progress__circle", cx: "50", cy: "50", r: radius, style: { stroke: color, strokeDasharray: type === "dashboard" ? `${circumference * 0.75} ${circumference * 0.25}` : circumference, strokeDashoffset: (type === "dashboard" ? circumference * 0.75 : circumference) - dash * (type === "dashboard" ? 0.75 : 1), strokeWidth } })
|
|
2940
3214
|
] }),
|
|
2941
|
-
showInfo ? /* @__PURE__ */ (0,
|
|
3215
|
+
showInfo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sia-progress__text", children: label }) : null
|
|
2942
3216
|
] });
|
|
2943
3217
|
}
|
|
2944
3218
|
const height = Array.isArray(size) ? size[1] : typeof size === "number" ? size : size === "small" ? 6 : strokeWidth;
|
|
2945
|
-
return /* @__PURE__ */ (0,
|
|
2946
|
-
/* @__PURE__ */ (0,
|
|
2947
|
-
/* @__PURE__ */ (0,
|
|
2948
|
-
success?.percent ? /* @__PURE__ */ (0,
|
|
3219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `sia-progress sia-progress--line sia-progress--${resolved} ${className}`.trim(), style, ...withTitleTooltip(props), children: [
|
|
3220
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sia-progress__outer", style: { height, backgroundColor: trailColor }, children: steps ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sia-progress__steps", children: Array.from({ length: steps }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: index < Math.round(steps * safe / 100) ? "is-active" : "", style: { background: index < Math.round(steps * safe / 100) ? background : trailColor } }, index)) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
3221
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sia-progress__bar", style: { width: `${safe}%`, background } }),
|
|
3222
|
+
success?.percent ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sia-progress__success", style: { width: `${success.percent}%`, background: success.strokeColor } }) : null
|
|
2949
3223
|
] }) }),
|
|
2950
|
-
showInfo ? /* @__PURE__ */ (0,
|
|
3224
|
+
showInfo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sia-progress__info", children: label }) : null
|
|
2951
3225
|
] });
|
|
2952
3226
|
}
|
|
2953
3227
|
|
|
2954
3228
|
// src/components/DataDisplay.tsx
|
|
2955
|
-
var
|
|
3229
|
+
var import_react19 = require("react");
|
|
2956
3230
|
var import_react_dom5 = require("react-dom");
|
|
2957
3231
|
|
|
2958
3232
|
// src/components/Overlay.tsx
|
|
2959
|
-
var
|
|
3233
|
+
var import_react18 = require("react");
|
|
2960
3234
|
var import_react_dom4 = require("react-dom");
|
|
2961
3235
|
var bodyLockCount = 0;
|
|
2962
3236
|
var previousBodyOverflow = "";
|
|
@@ -2978,10 +3252,10 @@ function focusableElements(container) {
|
|
|
2978
3252
|
)].filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true");
|
|
2979
3253
|
}
|
|
2980
3254
|
function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
2981
|
-
const overlayIdRef = (0,
|
|
2982
|
-
const closeRef = (0,
|
|
3255
|
+
const overlayIdRef = (0, import_react18.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
|
|
3256
|
+
const closeRef = (0, import_react18.useRef)(onRequestClose);
|
|
2983
3257
|
closeRef.current = onRequestClose;
|
|
2984
|
-
(0,
|
|
3258
|
+
(0, import_react18.useEffect)(() => {
|
|
2985
3259
|
if (!open || typeof document === "undefined") return void 0;
|
|
2986
3260
|
const overlayId = overlayIdRef.current;
|
|
2987
3261
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
@@ -3035,26 +3309,26 @@ function OverlayPortal({ children, container }) {
|
|
|
3035
3309
|
}
|
|
3036
3310
|
|
|
3037
3311
|
// src/components/DataDisplay.tsx
|
|
3038
|
-
var
|
|
3312
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3039
3313
|
function BadgeRibbon({ text, color, placement = "end", className = "", children, ...props }) {
|
|
3040
|
-
return /* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: `sia-ribbon-wrap ${className}`.trim(), ...withTitleTooltip(props), children: [
|
|
3041
3315
|
children,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `sia-ribbon sia-ribbon--${placement}`, style: { backgroundColor: color }, children: text })
|
|
3043
3317
|
] });
|
|
3044
3318
|
}
|
|
3045
3319
|
function Badge({ count, showZero = false, overflowCount = 99, dot = false, status, text, color, offset = [0, 0], size = "default", className = "", children, style, ...props }) {
|
|
3046
3320
|
const numeric = typeof count === "number";
|
|
3047
3321
|
const hidden = !dot && !status && (count === void 0 || count === null || count === 0 && !showZero);
|
|
3048
3322
|
const display = numeric && count > overflowCount ? `${overflowCount}+` : count;
|
|
3049
|
-
const badge = !hidden ? /* @__PURE__ */ (0,
|
|
3050
|
-
if (status && !children) return /* @__PURE__ */ (0,
|
|
3323
|
+
const badge = !hidden ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("sup", { className: `sia-badge__count${dot || status ? " sia-badge__dot" : ""}${status ? ` sia-badge__dot--${status}` : ""} sia-badge__count--${size}`, style: { backgroundColor: color, transform: `translate(calc(50% + ${offset[0]}px), calc(-50% + ${offset[1]}px))` }, children: dot || status ? null : display }) : null;
|
|
3324
|
+
if (status && !children) return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: `sia-badge sia-badge--status ${className}`.trim(), style, ...withTitleTooltip(props), children: [
|
|
3051
3325
|
badge,
|
|
3052
|
-
text ? /* @__PURE__ */ (0,
|
|
3326
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-badge__text", children: text }) : null
|
|
3053
3327
|
] });
|
|
3054
|
-
return /* @__PURE__ */ (0,
|
|
3328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: `sia-badge ${className}`.trim(), style, ...withTitleTooltip(props), children: [
|
|
3055
3329
|
children,
|
|
3056
3330
|
badge,
|
|
3057
|
-
text && !status ? /* @__PURE__ */ (0,
|
|
3331
|
+
text && !status ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-badge__text", children: text }) : null
|
|
3058
3332
|
] });
|
|
3059
3333
|
}
|
|
3060
3334
|
Badge.Ribbon = BadgeRibbon;
|
|
@@ -3064,8 +3338,8 @@ function CollapsePanel({
|
|
|
3064
3338
|
destroyInactivePanel = false,
|
|
3065
3339
|
children
|
|
3066
3340
|
}) {
|
|
3067
|
-
const [keepChildren, setKeepChildren] = (0,
|
|
3068
|
-
(0,
|
|
3341
|
+
const [keepChildren, setKeepChildren] = (0, import_react19.useState)(open || forceRender || !destroyInactivePanel);
|
|
3342
|
+
(0, import_react19.useEffect)(() => {
|
|
3069
3343
|
if (open || forceRender || !destroyInactivePanel) {
|
|
3070
3344
|
setKeepChildren(true);
|
|
3071
3345
|
return void 0;
|
|
@@ -3074,12 +3348,12 @@ function CollapsePanel({
|
|
|
3074
3348
|
return () => window.clearTimeout(timer);
|
|
3075
3349
|
}, [destroyInactivePanel, forceRender, open]);
|
|
3076
3350
|
const renderChildren = open || forceRender || !destroyInactivePanel || keepChildren;
|
|
3077
|
-
return /* @__PURE__ */ (0,
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "sia-collapse__panel", "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "sia-collapse__panel-motion", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "sia-collapse__panel-body", children: renderChildren ? children : null }) }) });
|
|
3078
3352
|
}
|
|
3079
3353
|
function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false, bordered = true, ghost = false, destroyInactivePanel = false, expandIconPosition = "start", onChange, className = "", ...props }) {
|
|
3080
3354
|
const normalize = (key) => Array.isArray(key) ? [...key] : key === void 0 ? [] : [key];
|
|
3081
3355
|
const controlled = activeKey !== void 0;
|
|
3082
|
-
const [internal, setInternal] = (0,
|
|
3356
|
+
const [internal, setInternal] = (0, import_react19.useState)(normalize(defaultActiveKey));
|
|
3083
3357
|
const openKeys = controlled ? normalize(activeKey) : internal;
|
|
3084
3358
|
function toggle(item) {
|
|
3085
3359
|
if (item.disabled || item.collapsible === "disabled") return;
|
|
@@ -3089,36 +3363,36 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
|
|
|
3089
3363
|
onChange?.(accordion ? next[0] ?? "" : next);
|
|
3090
3364
|
}
|
|
3091
3365
|
const borderClassName = !bordered || ghost ? "sia-collapse--borderless" : "sia-collapse--bordered";
|
|
3092
|
-
return /* @__PURE__ */ (0,
|
|
3366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `sia-collapse ${borderClassName}${ghost ? " sia-collapse--ghost" : ""} sia-collapse--icon-${expandIconPosition} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item) => {
|
|
3093
3367
|
const open = openKeys.includes(item.key);
|
|
3094
|
-
const arrow = item.showArrow === false ? null : /* @__PURE__ */ (0,
|
|
3095
|
-
return /* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3368
|
+
const arrow = item.showArrow === false ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", className: "sia-collapse__arrow", "aria-label": open ? "\u6536\u8D77" : "\u5C55\u5F00", onClick: item.collapsible === "icon" ? () => toggle(item) : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron-right", size: 14 }) });
|
|
3369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { className: `sia-collapse__item${open ? " is-open" : ""}${item.disabled ? " is-disabled" : ""} ${item.className ?? ""}`.trim(), children: [
|
|
3370
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { className: "sia-collapse__header", role: "button", tabIndex: item.disabled ? -1 : 0, "aria-expanded": open, onClick: item.collapsible === "icon" ? void 0 : () => toggle(item), onKeyDown: (event) => {
|
|
3097
3371
|
if (event.key === "Enter" || event.key === " ") {
|
|
3098
3372
|
event.preventDefault();
|
|
3099
3373
|
toggle(item);
|
|
3100
3374
|
}
|
|
3101
3375
|
}, children: [
|
|
3102
3376
|
expandIconPosition === "start" ? arrow : null,
|
|
3103
|
-
/* @__PURE__ */ (0,
|
|
3104
|
-
item.extra ? /* @__PURE__ */ (0,
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-collapse__label", children: item.label }),
|
|
3378
|
+
item.extra ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-collapse__extra", onClick: (event) => event.stopPropagation(), children: item.extra }) : null,
|
|
3105
3379
|
expandIconPosition === "end" ? arrow : null
|
|
3106
3380
|
] }),
|
|
3107
|
-
/* @__PURE__ */ (0,
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CollapsePanel, { open, forceRender: item.forceRender, destroyInactivePanel, children: item.children })
|
|
3108
3382
|
] }, item.key);
|
|
3109
3383
|
}) });
|
|
3110
3384
|
}
|
|
3111
3385
|
function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
3112
|
-
const previewRef = (0,
|
|
3113
|
-
const stageRef = (0,
|
|
3114
|
-
const [natural, setNatural] = (0,
|
|
3115
|
-
const [area, setArea] = (0,
|
|
3116
|
-
const [zoom, setZoom] = (0,
|
|
3117
|
-
const [rotation, setRotation] = (0,
|
|
3118
|
-
const [flip, setFlip] = (0,
|
|
3119
|
-
const [pan, setPan] = (0,
|
|
3120
|
-
const [failed, setFailed] = (0,
|
|
3121
|
-
const drag = (0,
|
|
3386
|
+
const previewRef = (0, import_react19.useRef)(null);
|
|
3387
|
+
const stageRef = (0, import_react19.useRef)(null);
|
|
3388
|
+
const [natural, setNatural] = (0, import_react19.useState)({ src: "", width: 0, height: 0 });
|
|
3389
|
+
const [area, setArea] = (0, import_react19.useState)({ width: 0, height: 0 });
|
|
3390
|
+
const [zoom, setZoom] = (0, import_react19.useState)(1);
|
|
3391
|
+
const [rotation, setRotation] = (0, import_react19.useState)(0);
|
|
3392
|
+
const [flip, setFlip] = (0, import_react19.useState)({ x: 1, y: 1 });
|
|
3393
|
+
const [pan, setPan] = (0, import_react19.useState)({ x: 0, y: 0 });
|
|
3394
|
+
const [failed, setFailed] = (0, import_react19.useState)(false);
|
|
3395
|
+
const drag = (0, import_react19.useRef)();
|
|
3122
3396
|
useOverlayLifecycle(open, previewRef, () => onOpenChange(false));
|
|
3123
3397
|
const reset = () => {
|
|
3124
3398
|
setZoom(1);
|
|
@@ -3127,11 +3401,11 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3127
3401
|
setPan({ x: 0, y: 0 });
|
|
3128
3402
|
drag.current = void 0;
|
|
3129
3403
|
};
|
|
3130
|
-
(0,
|
|
3404
|
+
(0, import_react19.useEffect)(() => {
|
|
3131
3405
|
reset();
|
|
3132
3406
|
setFailed(false);
|
|
3133
3407
|
}, [open, src]);
|
|
3134
|
-
(0,
|
|
3408
|
+
(0, import_react19.useEffect)(() => {
|
|
3135
3409
|
const stage = stageRef.current;
|
|
3136
3410
|
if (!open || !stage) return;
|
|
3137
3411
|
const measure = () => {
|
|
@@ -3148,12 +3422,12 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3148
3422
|
const fit = ready ? Math.min(1, area.width / (sideways ? natural.height : natural.width), area.height / (sideways ? natural.width : natural.height)) : 0;
|
|
3149
3423
|
const changeZoom = (factor) => setZoom((value) => Math.max(0.25, Math.min(8, value * factor)));
|
|
3150
3424
|
if (!open || !src || typeof document === "undefined") return null;
|
|
3151
|
-
return (0, import_react_dom5.createPortal)(/* @__PURE__ */ (0,
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3425
|
+
return (0, import_react_dom5.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: previewRef, className: "sia-image-preview", role: "dialog", "aria-modal": "true", "aria-label": "\u56FE\u7247\u9884\u89C8", tabIndex: -1, onClick: () => onOpenChange(false), children: [
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", className: "sia-image-preview__close", "aria-label": "\u5173\u95ED\u9884\u89C8", onClick: (event) => {
|
|
3153
3427
|
event.stopPropagation();
|
|
3154
3428
|
onOpenChange(false);
|
|
3155
|
-
}, children: /* @__PURE__ */ (0,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3429
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "close" }) }),
|
|
3430
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ref: stageRef, className: "sia-image-preview__stage", children: failed ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sia-image-preview__error", children: "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3157
3431
|
"img",
|
|
3158
3432
|
{
|
|
3159
3433
|
src,
|
|
@@ -3186,53 +3460,53 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3186
3460
|
},
|
|
3187
3461
|
src
|
|
3188
3462
|
) }),
|
|
3189
|
-
/* @__PURE__ */ (0,
|
|
3190
|
-
/* @__PURE__ */ (0,
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3192
|
-
/* @__PURE__ */ (0,
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u6C34\u5E73\u7FFB\u8F6C", "aria-label": "\u6C34\u5E73\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, x: -value.x })), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "flip-horizontal", size: 20 }) }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5782\u76F4\u7FFB\u8F6C", "aria-label": "\u5782\u76F4\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, y: -value.y })), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "flip-vertical", size: 20 }) }),
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5411\u5DE6\u65CB\u8F6C", "aria-label": "\u5411\u5DE6\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
3193
3467
|
setRotation((value) => value - 90);
|
|
3194
3468
|
setPan({ x: 0, y: 0 });
|
|
3195
|
-
}, children: /* @__PURE__ */ (0,
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3469
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "rotate-left", size: 20 }) }),
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5411\u53F3\u65CB\u8F6C", "aria-label": "\u5411\u53F3\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
3197
3471
|
setRotation((value) => value + 90);
|
|
3198
3472
|
setPan({ x: 0, y: 0 });
|
|
3199
|
-
}, children: /* @__PURE__ */ (0,
|
|
3200
|
-
/* @__PURE__ */ (0,
|
|
3201
|
-
/* @__PURE__ */ (0,
|
|
3202
|
-
/* @__PURE__ */ (0,
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3473
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "rotate-right", size: 20 }) }),
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u7F29\u5C0F", "aria-label": "\u7F29\u5C0F", disabled: !ready || zoom <= 0.25, onClick: () => changeZoom(1 / 1.25), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "zoom-out", size: 20 }) }),
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("output", { className: "sia-image-preview__scale", "aria-label": "\u5F53\u524D\u7F29\u653E\u6BD4\u4F8B", "aria-live": "polite", children: ready ? `${Math.round(fit * zoom * 100)}%` : "\u2014" }),
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u653E\u5927", "aria-label": "\u653E\u5927", disabled: !ready || zoom >= 8, onClick: () => changeZoom(1.25), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "zoom-in", size: 20 }) }),
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "refresh", size: 20 }) })
|
|
3204
3478
|
] })
|
|
3205
3479
|
] }), document.body);
|
|
3206
3480
|
}
|
|
3207
3481
|
|
|
3208
3482
|
// src/components/FloatingPlaceholder.tsx
|
|
3209
|
-
var
|
|
3483
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3210
3484
|
function useFloatingPlaceholder({ mode, placeholder, filled, active = false }) {
|
|
3211
3485
|
const enabled = usePlaceholderMode(mode) === "floating" && Boolean(placeholder);
|
|
3212
3486
|
return {
|
|
3213
3487
|
enabled,
|
|
3214
3488
|
className: enabled ? ` sia-placeholder-floating${filled ? " sia-placeholder-floating--filled" : ""}${active ? " sia-placeholder-floating--active" : ""}` : "",
|
|
3215
|
-
label: enabled ? /* @__PURE__ */ (0,
|
|
3489
|
+
label: enabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sia-floating-placeholder", "aria-hidden": "true", children: placeholder }) : null
|
|
3216
3490
|
};
|
|
3217
3491
|
}
|
|
3218
3492
|
|
|
3219
3493
|
// src/components/Select.tsx
|
|
3220
|
-
var
|
|
3494
|
+
var import_react25 = require("react");
|
|
3221
3495
|
|
|
3222
3496
|
// src/components/Modal.tsx
|
|
3223
|
-
var
|
|
3497
|
+
var import_react20 = require("react");
|
|
3224
3498
|
var import_client3 = require("react-dom/client");
|
|
3225
|
-
var
|
|
3499
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3226
3500
|
var modalHandles = /* @__PURE__ */ new Set();
|
|
3227
3501
|
var MODAL_MOTION_DURATION = 220;
|
|
3228
3502
|
var typeIcons = {
|
|
3229
|
-
info: /* @__PURE__ */ (0,
|
|
3230
|
-
success: /* @__PURE__ */ (0,
|
|
3231
|
-
warning: /* @__PURE__ */ (0,
|
|
3232
|
-
error: /* @__PURE__ */ (0,
|
|
3233
|
-
confirm: /* @__PURE__ */ (0,
|
|
3503
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "info", size: 23 }),
|
|
3504
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "circle-check", size: 23 }),
|
|
3505
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "warning", size: 23 }),
|
|
3506
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "circle-close", size: 23 }),
|
|
3507
|
+
confirm: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "question", size: 23 })
|
|
3234
3508
|
};
|
|
3235
|
-
var ModalRoot = (0,
|
|
3509
|
+
var ModalRoot = (0, import_react20.forwardRef)(function Modal({
|
|
3236
3510
|
open,
|
|
3237
3511
|
title,
|
|
3238
3512
|
children,
|
|
@@ -3261,20 +3535,20 @@ var ModalRoot = (0, import_react19.forwardRef)(function Modal({
|
|
|
3261
3535
|
style,
|
|
3262
3536
|
...props
|
|
3263
3537
|
}, forwardedRef) {
|
|
3264
|
-
const localRef = (0,
|
|
3265
|
-
const titleId = (0,
|
|
3266
|
-
const [submitting, setSubmitting] = (0,
|
|
3267
|
-
const [rendered, setRendered] = (0,
|
|
3268
|
-
const [closing, setClosing] = (0,
|
|
3269
|
-
const afterOpenChangeRef = (0,
|
|
3538
|
+
const localRef = (0, import_react20.useRef)(null);
|
|
3539
|
+
const titleId = (0, import_react20.useId)();
|
|
3540
|
+
const [submitting, setSubmitting] = (0, import_react20.useState)(false);
|
|
3541
|
+
const [rendered, setRendered] = (0, import_react20.useState)(open);
|
|
3542
|
+
const [closing, setClosing] = (0, import_react20.useState)(false);
|
|
3543
|
+
const afterOpenChangeRef = (0, import_react20.useRef)(afterOpenChange);
|
|
3270
3544
|
afterOpenChangeRef.current = afterOpenChange;
|
|
3271
|
-
const submitLock = (0,
|
|
3272
|
-
(0,
|
|
3545
|
+
const submitLock = (0, import_react20.useRef)(false);
|
|
3546
|
+
(0, import_react20.useEffect)(() => {
|
|
3273
3547
|
if (!open || !rendered) return void 0;
|
|
3274
3548
|
const timer = window.setTimeout(() => afterOpenChangeRef.current?.(true), MODAL_MOTION_DURATION);
|
|
3275
3549
|
return () => window.clearTimeout(timer);
|
|
3276
3550
|
}, [open, rendered]);
|
|
3277
|
-
(0,
|
|
3551
|
+
(0, import_react20.useEffect)(() => {
|
|
3278
3552
|
if (open) {
|
|
3279
3553
|
setRendered(true);
|
|
3280
3554
|
setClosing(false);
|
|
@@ -3331,11 +3605,11 @@ var ModalRoot = (0, import_react19.forwardRef)(function Modal({
|
|
|
3331
3605
|
"--sia-modal-width": typeof width === "number" ? `${width}px` : width
|
|
3332
3606
|
};
|
|
3333
3607
|
const loading = submitting || confirmLoading;
|
|
3334
|
-
const defaultFooter = /* @__PURE__ */ (0,
|
|
3335
|
-
showCancel ? /* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
const defaultFooter = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
3609
|
+
showCancel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { ...cancelButtonProps, onClick: requestClose, disabled: loading || cancelButtonProps?.disabled, children: cancelText }) : null,
|
|
3610
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "primary", ...okButtonProps, onClick: handleOk, loading, children: okText })
|
|
3337
3611
|
] });
|
|
3338
|
-
return /* @__PURE__ */ (0,
|
|
3612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OverlayPortal, { container: getContainer, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3339
3613
|
"div",
|
|
3340
3614
|
{
|
|
3341
3615
|
className: `sia-modal-root${centered ? " sia-modal-root--centered" : ""}`,
|
|
@@ -3344,7 +3618,7 @@ var ModalRoot = (0, import_react19.forwardRef)(function Modal({
|
|
|
3344
3618
|
onMouseDown: (event) => {
|
|
3345
3619
|
if (event.target === event.currentTarget && maskClosable) requestClose();
|
|
3346
3620
|
},
|
|
3347
|
-
children: /* @__PURE__ */ (0,
|
|
3621
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3348
3622
|
"div",
|
|
3349
3623
|
{
|
|
3350
3624
|
ref: setRef,
|
|
@@ -3356,16 +3630,16 @@ var ModalRoot = (0, import_react19.forwardRef)(function Modal({
|
|
|
3356
3630
|
tabIndex: -1,
|
|
3357
3631
|
...withTitleTooltip(props),
|
|
3358
3632
|
children: [
|
|
3359
|
-
/* @__PURE__ */ (0,
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3361
|
-
typeIcons[type] ? /* @__PURE__ */ (0,
|
|
3362
|
-
title ? /* @__PURE__ */ (0,
|
|
3633
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "sia-modal__header", style: height !== void 0 ? { flexShrink: 0 } : void 0, children: [
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "sia-modal__heading", children: [
|
|
3635
|
+
typeIcons[type] ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sia-modal__type-icon", "aria-hidden": "true", children: typeIcons[type] }) : null,
|
|
3636
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { id: titleId, children: title }) : null
|
|
3363
3637
|
] }),
|
|
3364
|
-
closable ? /* @__PURE__ */ (0,
|
|
3638
|
+
closable ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "sia-modal__close", "aria-label": "\u5173\u95ED\u5BF9\u8BDD\u6846", onClick: requestClose, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: "close", size: 17 }) }) : null
|
|
3365
3639
|
] }),
|
|
3366
|
-
children !== void 0 ? /* @__PURE__ */ (0,
|
|
3367
|
-
footer !== null ? /* @__PURE__ */ (0,
|
|
3368
|
-
footer === void 0 && footerExtra != null ? /* @__PURE__ */ (0,
|
|
3640
|
+
children !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "sia-modal__body", style: height !== void 0 ? { flex: 1, minHeight: 0, overflow: "auto" } : void 0, children }) : null,
|
|
3641
|
+
footer !== null ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "sia-modal__footer", style: height !== void 0 ? { flexShrink: 0 } : void 0, children: [
|
|
3642
|
+
footer === void 0 && footerExtra != null ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginRight: "auto" }, children: footerExtra }) : null,
|
|
3369
3643
|
footer ?? defaultFooter
|
|
3370
3644
|
] }) : null
|
|
3371
3645
|
]
|
|
@@ -3399,11 +3673,11 @@ function openModal(config) {
|
|
|
3399
3673
|
render();
|
|
3400
3674
|
}
|
|
3401
3675
|
function ModalInstance() {
|
|
3402
|
-
(0,
|
|
3676
|
+
(0, import_react20.useEffect)(() => {
|
|
3403
3677
|
mounted = true;
|
|
3404
3678
|
if (!currentOpen) render();
|
|
3405
3679
|
}, []);
|
|
3406
|
-
return /* @__PURE__ */ (0,
|
|
3680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ModalRoot, { ...currentConfig, open: !mounted || currentOpen, onOpenChange: (nextOpen) => {
|
|
3407
3681
|
currentConfig.onOpenChange?.(nextOpen);
|
|
3408
3682
|
if (!nextOpen) closeWithMotion();
|
|
3409
3683
|
}, afterOpenChange: (nextOpen) => {
|
|
@@ -3415,7 +3689,7 @@ function openModal(config) {
|
|
|
3415
3689
|
} });
|
|
3416
3690
|
}
|
|
3417
3691
|
function render() {
|
|
3418
|
-
root.render(/* @__PURE__ */ (0,
|
|
3692
|
+
root.render(/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ModalInstance, {}));
|
|
3419
3693
|
}
|
|
3420
3694
|
const handle = {
|
|
3421
3695
|
destroy: closeWithMotion,
|
|
@@ -3460,12 +3734,12 @@ var Modal2 = Object.assign(ModalRoot, {
|
|
|
3460
3734
|
});
|
|
3461
3735
|
|
|
3462
3736
|
// src/components/Input.tsx
|
|
3463
|
-
var
|
|
3737
|
+
var import_react22 = require("react");
|
|
3464
3738
|
|
|
3465
3739
|
// src/components/TextArea.tsx
|
|
3466
|
-
var
|
|
3467
|
-
var
|
|
3468
|
-
var TextArea = (0,
|
|
3740
|
+
var import_react21 = require("react");
|
|
3741
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3742
|
+
var TextArea = (0, import_react21.forwardRef)(function TextArea2({
|
|
3469
3743
|
label,
|
|
3470
3744
|
hint,
|
|
3471
3745
|
status = "default",
|
|
@@ -3483,9 +3757,9 @@ var TextArea = (0, import_react20.forwardRef)(function TextArea2({
|
|
|
3483
3757
|
...props
|
|
3484
3758
|
}, ref) {
|
|
3485
3759
|
const size = useControlSize(sizeProp);
|
|
3486
|
-
const fallbackId = (0,
|
|
3760
|
+
const fallbackId = (0, import_react21.useId)();
|
|
3487
3761
|
const textAreaId = id ?? fallbackId;
|
|
3488
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
3762
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react21.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
|
|
3489
3763
|
const currentText = value !== void 0 ? String(value) : uncontrolledValue;
|
|
3490
3764
|
const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: currentText.length > 0 });
|
|
3491
3765
|
const hintId = `${textAreaId}-hint`;
|
|
@@ -3494,8 +3768,8 @@ var TextArea = (0, import_react20.forwardRef)(function TextArea2({
|
|
|
3494
3768
|
setUncontrolledValue(event.target.value);
|
|
3495
3769
|
onChange?.(event);
|
|
3496
3770
|
}
|
|
3497
|
-
const control = /* @__PURE__ */ (0,
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
3771
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: `sia-textarea-control sia-textarea-control--${size} sia-textarea-control--${status}${floating.className}${disabled ? " is-disabled" : ""}`, children: [
|
|
3772
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3499
3773
|
"textarea",
|
|
3500
3774
|
{
|
|
3501
3775
|
...withTitleTooltip(props),
|
|
@@ -3513,22 +3787,22 @@ var TextArea = (0, import_react20.forwardRef)(function TextArea2({
|
|
|
3513
3787
|
}
|
|
3514
3788
|
),
|
|
3515
3789
|
floating.label,
|
|
3516
|
-
showCount ? /* @__PURE__ */ (0,
|
|
3790
|
+
showCount ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: `sia-textarea-control__count${maxLength !== void 0 && currentText.length >= maxLength ? " is-limit" : ""}`, "aria-live": "polite", children: [
|
|
3517
3791
|
currentText.length,
|
|
3518
3792
|
maxLength !== void 0 ? `/${maxLength}` : null
|
|
3519
3793
|
] }) : null
|
|
3520
3794
|
] });
|
|
3521
|
-
if (!label && !hint) return /* @__PURE__ */ (0,
|
|
3522
|
-
return /* @__PURE__ */ (0,
|
|
3523
|
-
label ? /* @__PURE__ */ (0,
|
|
3795
|
+
if (!label && !hint) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: `sia-field ${className}`.trim(), children: control });
|
|
3796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: `sia-field ${className}`.trim(), children: [
|
|
3797
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { className: "sia-field__label", htmlFor: textAreaId, children: label }) : null,
|
|
3524
3798
|
control,
|
|
3525
|
-
hint ? /* @__PURE__ */ (0,
|
|
3799
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { id: hintId, className: `sia-field__hint sia-field__hint--${status}`, children: hint }) : null
|
|
3526
3800
|
] });
|
|
3527
3801
|
});
|
|
3528
3802
|
|
|
3529
3803
|
// src/components/Input.tsx
|
|
3530
|
-
var
|
|
3531
|
-
var Input = (0,
|
|
3804
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3805
|
+
var Input = (0, import_react22.forwardRef)(function Input2({
|
|
3532
3806
|
label,
|
|
3533
3807
|
hint,
|
|
3534
3808
|
status = "default",
|
|
@@ -3551,14 +3825,14 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3551
3825
|
...props
|
|
3552
3826
|
}, forwardedRef) {
|
|
3553
3827
|
const size = useControlSize(sizeProp);
|
|
3554
|
-
const fallbackId = (0,
|
|
3828
|
+
const fallbackId = (0, import_react22.useId)();
|
|
3555
3829
|
const inputId = id ?? fallbackId;
|
|
3556
|
-
const localRef = (0,
|
|
3557
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
3830
|
+
const localRef = (0, import_react22.useRef)(null);
|
|
3831
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react22.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
|
|
3558
3832
|
const currentText = value !== void 0 ? String(value) : uncontrolledValue;
|
|
3559
3833
|
const hasValue = currentText.length > 0;
|
|
3560
|
-
const [expanded, setExpanded] = (0,
|
|
3561
|
-
const [expandedDraft, setExpandedDraft] = (0,
|
|
3834
|
+
const [expanded, setExpanded] = (0, import_react22.useState)(false);
|
|
3835
|
+
const [expandedDraft, setExpandedDraft] = (0, import_react22.useState)("");
|
|
3562
3836
|
const floatingPlaceholder = usePlaceholderMode(placeholderMode) === "floating" && Boolean(placeholder);
|
|
3563
3837
|
const hintId = `${inputId}-hint`;
|
|
3564
3838
|
const describedBy = [props["aria-describedby"], hint ? hintId : null].filter(Boolean).join(" ") || void 0;
|
|
@@ -3594,7 +3868,7 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3594
3868
|
event.preventDefault();
|
|
3595
3869
|
localRef.current?.focus({ preventScroll: true });
|
|
3596
3870
|
}
|
|
3597
|
-
const input = /* @__PURE__ */ (0,
|
|
3871
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3598
3872
|
"input",
|
|
3599
3873
|
{
|
|
3600
3874
|
...withTitleTooltip(props),
|
|
@@ -3611,15 +3885,15 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3611
3885
|
onChange: handleChange
|
|
3612
3886
|
}
|
|
3613
3887
|
);
|
|
3614
|
-
const control = /* @__PURE__ */ (0,
|
|
3615
|
-
prefix ? /* @__PURE__ */ (0,
|
|
3616
|
-
floatingPlaceholder ? /* @__PURE__ */ (0,
|
|
3888
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { onMouseDown: handleControlMouseDown, className: `sia-input-control sia-input-control--${size} sia-input-control--${status}${floatingPlaceholder ? " sia-input-control--floating" : ""}${floatingPlaceholder && hasValue ? " is-filled" : ""}${disabled ? " is-disabled" : ""}`, children: [
|
|
3889
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sia-input-control__affix", children: prefix }) : null,
|
|
3890
|
+
floatingPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "sia-input-control__input-wrap", children: [
|
|
3617
3891
|
input,
|
|
3618
|
-
/* @__PURE__ */ (0,
|
|
3892
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sia-input-control__floating-placeholder", "aria-hidden": "true", children: placeholder })
|
|
3619
3893
|
] }) : input,
|
|
3620
|
-
allowClear && hasValue && !disabled ? /* @__PURE__ */ (0,
|
|
3621
|
-
suffix ? /* @__PURE__ */ (0,
|
|
3622
|
-
expandable && !disabled && !props.readOnly && (!props.type || props.type === "text") ? /* @__PURE__ */ (0,
|
|
3894
|
+
allowClear && hasValue && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "sia-input-control__clear", type: "button", "aria-label": "\u6E05\u7A7A\u8F93\u5165", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
3895
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sia-input-control__affix", children: suffix }) : null,
|
|
3896
|
+
expandable && !disabled && !props.readOnly && (!props.type || props.type === "text") ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3623
3897
|
"button",
|
|
3624
3898
|
{
|
|
3625
3899
|
type: "button",
|
|
@@ -3631,15 +3905,15 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3631
3905
|
setExpandedDraft(currentText);
|
|
3632
3906
|
setExpanded(true);
|
|
3633
3907
|
},
|
|
3634
|
-
children: /* @__PURE__ */ (0,
|
|
3908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "expand", size: 15 })
|
|
3635
3909
|
}
|
|
3636
3910
|
) : null,
|
|
3637
|
-
showCount ? /* @__PURE__ */ (0,
|
|
3911
|
+
showCount ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: `sia-input-control__count${maxLength !== void 0 && currentText.length >= maxLength ? " is-limit" : ""}`, "aria-live": "polite", children: [
|
|
3638
3912
|
currentText.length,
|
|
3639
3913
|
maxLength !== void 0 ? `/${maxLength}` : null
|
|
3640
3914
|
] }) : null
|
|
3641
3915
|
] });
|
|
3642
|
-
const editor = expandable ? /* @__PURE__ */ (0,
|
|
3916
|
+
const editor = expandable ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3643
3917
|
Modal2,
|
|
3644
3918
|
{
|
|
3645
3919
|
open: expanded,
|
|
@@ -3660,7 +3934,7 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3660
3934
|
setUncontrolledValue(next);
|
|
3661
3935
|
setExpanded(false);
|
|
3662
3936
|
},
|
|
3663
|
-
children: /* @__PURE__ */ (0,
|
|
3937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3664
3938
|
TextArea,
|
|
3665
3939
|
{
|
|
3666
3940
|
"aria-label": "\u5C55\u5F00\u7F16\u8F91\u5185\u5BB9",
|
|
@@ -3676,23 +3950,23 @@ var Input = (0, import_react21.forwardRef)(function Input2({
|
|
|
3676
3950
|
)
|
|
3677
3951
|
}
|
|
3678
3952
|
) : null;
|
|
3679
|
-
if (!label && !hint) return /* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3953
|
+
if (!label && !hint) return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
3954
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `sia-field ${className}`.trim(), children: control }),
|
|
3681
3955
|
editor
|
|
3682
3956
|
] });
|
|
3683
|
-
return /* @__PURE__ */ (0,
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
3685
|
-
label ? /* @__PURE__ */ (0,
|
|
3957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
3958
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: `sia-field ${className}`.trim(), children: [
|
|
3959
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { className: "sia-field__label", htmlFor: inputId, children: label }) : null,
|
|
3686
3960
|
control,
|
|
3687
|
-
hint ? /* @__PURE__ */ (0,
|
|
3961
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { id: hintId, className: `sia-field__hint sia-field__hint--${status}`, children: hint }) : null
|
|
3688
3962
|
] }),
|
|
3689
3963
|
editor
|
|
3690
3964
|
] });
|
|
3691
3965
|
});
|
|
3692
3966
|
|
|
3693
3967
|
// src/components/SelectionPanel.tsx
|
|
3694
|
-
var
|
|
3695
|
-
var
|
|
3968
|
+
var import_react23 = require("react");
|
|
3969
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3696
3970
|
function SelectionPanel({
|
|
3697
3971
|
options,
|
|
3698
3972
|
value,
|
|
@@ -3713,26 +3987,26 @@ function SelectionPanel({
|
|
|
3713
3987
|
maxHeight = 250,
|
|
3714
3988
|
autoFocusSearch = false
|
|
3715
3989
|
}) {
|
|
3716
|
-
const [localSearch, setLocalSearch] = (0,
|
|
3990
|
+
const [localSearch, setLocalSearch] = (0, import_react23.useState)("");
|
|
3717
3991
|
const search = searchValue ?? localSearch;
|
|
3718
|
-
const [scrollTop, setScrollTop] = (0,
|
|
3719
|
-
const [active, setActive] = (0,
|
|
3720
|
-
const [keyboardActive, setKeyboardActive] = (0,
|
|
3721
|
-
const [deselectedHover, setDeselectedHover] = (0,
|
|
3722
|
-
const listRef = (0,
|
|
3723
|
-
const id = (0,
|
|
3724
|
-
const selected = (0,
|
|
3992
|
+
const [scrollTop, setScrollTop] = (0, import_react23.useState)(0);
|
|
3993
|
+
const [active, setActive] = (0, import_react23.useState)();
|
|
3994
|
+
const [keyboardActive, setKeyboardActive] = (0, import_react23.useState)(false);
|
|
3995
|
+
const [deselectedHover, setDeselectedHover] = (0, import_react23.useState)();
|
|
3996
|
+
const listRef = (0, import_react23.useRef)(null);
|
|
3997
|
+
const id = (0, import_react23.useId)();
|
|
3998
|
+
const selected = (0, import_react23.useMemo)(() => new Set(value), [value]);
|
|
3725
3999
|
const count = Math.max(1, Math.floor(columns));
|
|
3726
|
-
const allOptions = (0,
|
|
4000
|
+
const allOptions = (0, import_react23.useMemo)(() => {
|
|
3727
4001
|
if (!includeUnknownValues) return [...options];
|
|
3728
4002
|
const known = new Set(options.filter((option) => option.optionType !== "divider").map((option) => option.value));
|
|
3729
4003
|
return [...value.filter((item) => !known.has(item)).map((item) => ({ value: item, label: String(item), group: "\u81EA\u5B9A\u4E49\u503C" })), ...options];
|
|
3730
4004
|
}, [options, value, includeUnknownValues]);
|
|
3731
|
-
const filtered = (0,
|
|
4005
|
+
const filtered = (0, import_react23.useMemo)(
|
|
3732
4006
|
() => allOptions.filter((option) => (!selectedOnly || selected.has(option.value)) && (!search || option.optionType !== "divider" && [option.label, option.value].some((text) => String(text ?? "").toLowerCase().includes(search.toLowerCase())))),
|
|
3733
4007
|
[allOptions, selectedOnly, selected, search]
|
|
3734
4008
|
);
|
|
3735
|
-
const rows = (0,
|
|
4009
|
+
const rows = (0, import_react23.useMemo)(() => {
|
|
3736
4010
|
const groups = /* @__PURE__ */ new Map();
|
|
3737
4011
|
filtered.forEach((option) => {
|
|
3738
4012
|
const items = groups.get(option.group) ?? [];
|
|
@@ -3758,7 +4032,7 @@ function SelectionPanel({
|
|
|
3758
4032
|
const virtual = filtered.length > 100;
|
|
3759
4033
|
const renderedRows = virtual ? rows.filter((row) => row.top + row.height >= scrollTop - 100 && row.top <= scrollTop + maxHeight + 100) : rows;
|
|
3760
4034
|
const enabled = filtered.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
3761
|
-
(0,
|
|
4035
|
+
(0, import_react23.useEffect)(() => {
|
|
3762
4036
|
setScrollTop(0);
|
|
3763
4037
|
if (listRef.current) listRef.current.scrollTop = 0;
|
|
3764
4038
|
setActive(void 0);
|
|
@@ -3781,9 +4055,9 @@ function SelectionPanel({
|
|
|
3781
4055
|
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
3782
4056
|
onChange([...retained, ...add]);
|
|
3783
4057
|
}
|
|
3784
|
-
return /* @__PURE__ */ (0,
|
|
3785
|
-
/* @__PURE__ */ (0,
|
|
3786
|
-
showSearch && /* @__PURE__ */ (0,
|
|
4058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "sia-selection-panel", children: [
|
|
4059
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
4060
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3787
4061
|
Input,
|
|
3788
4062
|
{
|
|
3789
4063
|
"aria-label": "\u641C\u7D22\u9009\u9879",
|
|
@@ -3797,17 +4071,17 @@ function SelectionPanel({
|
|
|
3797
4071
|
}
|
|
3798
4072
|
}
|
|
3799
4073
|
),
|
|
3800
|
-
multiple && showActions && /* @__PURE__ */ (0,
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3803
|
-
/* @__PURE__ */ (0,
|
|
3804
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
multiple && showActions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "sia-selection-panel__actions", children: [
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !enabled.length, onClick: () => batch("all"), children: "\u5168\u9009" }),
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !enabled.length, onClick: () => batch("invert"), children: "\u53CD\u9009" }),
|
|
4077
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "link", size: "small", disabled: disabled || loading || !value.length, onClick: () => batch("clear"), children: "\u6E05\u7A7A" }),
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
3805
4079
|
"\u5DF2\u9009 ",
|
|
3806
4080
|
value.length,
|
|
3807
4081
|
" \u9879"
|
|
3808
4082
|
] })
|
|
3809
4083
|
] }),
|
|
3810
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3811
4085
|
"div",
|
|
3812
4086
|
{
|
|
3813
4087
|
ref: listRef,
|
|
@@ -3844,12 +4118,12 @@ function SelectionPanel({
|
|
|
3844
4118
|
toggle(enabled[index], true);
|
|
3845
4119
|
}
|
|
3846
4120
|
},
|
|
3847
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
4121
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "status", children: "\u52A0\u8F7D\u4E2D\u2026" }) : !rows.length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "sia-selection-panel__empty", children: "\u6682\u65E0\u5339\u914D\u9009\u9879" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { height: totalHeight, position: "relative" }, children: renderedRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3848
4122
|
"div",
|
|
3849
4123
|
{
|
|
3850
4124
|
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
3851
4125
|
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
3852
|
-
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0,
|
|
4126
|
+
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3853
4127
|
"div",
|
|
3854
4128
|
{
|
|
3855
4129
|
role: "option",
|
|
@@ -3865,12 +4139,12 @@ function SelectionPanel({
|
|
|
3865
4139
|
onClick: (event) => {
|
|
3866
4140
|
if (!event.target.closest(".sia-checkbox")) toggle(option);
|
|
3867
4141
|
},
|
|
3868
|
-
children: multiple ? /* @__PURE__ */ (0,
|
|
3869
|
-
/* @__PURE__ */ (0,
|
|
3870
|
-
showValue && /* @__PURE__ */ (0,
|
|
3871
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
3872
|
-
/* @__PURE__ */ (0,
|
|
3873
|
-
showValue && /* @__PURE__ */ (0,
|
|
4142
|
+
children: multiple ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Checkbox2, { checked: selected.has(option.value), disabled: disabled || loading || option.disabled, tabIndex: -1, onChange: () => toggle(option), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sia-selection-panel__label", children: showValue || displayField === "label" ? option.label : String(option.value) }),
|
|
4144
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: String(option.value) })
|
|
4145
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sia-selection-panel__label", children: showValue || displayField === "label" ? option.label : String(option.value) }),
|
|
4147
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: String(option.value) })
|
|
3874
4148
|
] })
|
|
3875
4149
|
}
|
|
3876
4150
|
) }, `${typeof option.value}-${option.value}`))
|
|
@@ -3883,14 +4157,14 @@ function SelectionPanel({
|
|
|
3883
4157
|
}
|
|
3884
4158
|
|
|
3885
4159
|
// src/components/OverflowTags.tsx
|
|
3886
|
-
var
|
|
3887
|
-
var
|
|
4160
|
+
var import_react24 = require("react");
|
|
4161
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3888
4162
|
function OverflowTags({ items, maxCount: maxCount2, className = "", tagClassName, restClassName = "" }) {
|
|
3889
|
-
const rootRef = (0,
|
|
3890
|
-
const measureRef = (0,
|
|
4163
|
+
const rootRef = (0, import_react24.useRef)(null);
|
|
4164
|
+
const measureRef = (0, import_react24.useRef)(null);
|
|
3891
4165
|
const limit = Math.min(items.length, Math.max(0, Math.floor(maxCount2) || 0));
|
|
3892
|
-
const [visibleCount, setVisibleCount] = (0,
|
|
3893
|
-
(0,
|
|
4166
|
+
const [visibleCount, setVisibleCount] = (0, import_react24.useState)(0);
|
|
4167
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
3894
4168
|
const root = rootRef.current;
|
|
3895
4169
|
const measure = measureRef.current;
|
|
3896
4170
|
if (!root || !measure) return;
|
|
@@ -3913,15 +4187,15 @@ function OverflowTags({ items, maxCount: maxCount2, className = "", tagClassName
|
|
|
3913
4187
|
return () => observer.disconnect();
|
|
3914
4188
|
}, [items, limit]);
|
|
3915
4189
|
const count = Math.min(visibleCount, limit);
|
|
3916
|
-
return /* @__PURE__ */ (0,
|
|
3917
|
-
items.slice(0, count).map((item) => /* @__PURE__ */ (0,
|
|
3918
|
-
items.length > count ? /* @__PURE__ */ (0,
|
|
4190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { ref: rootRef, className: `sia-overflow-tags ${className}`.trim(), children: [
|
|
4191
|
+
items.slice(0, count).map((item) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: tagClassName, children: item.label }, item.key)),
|
|
4192
|
+
items.length > count ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: `${tagClassName} sia-overflow-tags__rest ${restClassName}`.trim(), children: [
|
|
3919
4193
|
"+",
|
|
3920
4194
|
items.length - count
|
|
3921
4195
|
] }) : null,
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3923
|
-
items.slice(0, limit).map((item) => /* @__PURE__ */ (0,
|
|
3924
|
-
Array.from({ length: limit + 1 }, (_, index) => /* @__PURE__ */ (0,
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { ref: measureRef, className: "sia-overflow-tags__measure", "aria-hidden": "true", children: [
|
|
4197
|
+
items.slice(0, limit).map((item) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: tagClassName, children: item.label }, item.key)),
|
|
4198
|
+
Array.from({ length: limit + 1 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: `${tagClassName} ${restClassName}`.trim(), children: [
|
|
3925
4199
|
"+",
|
|
3926
4200
|
items.length - index
|
|
3927
4201
|
] }, `rest-${index}`))
|
|
@@ -3930,12 +4204,12 @@ function OverflowTags({ items, maxCount: maxCount2, className = "", tagClassName
|
|
|
3930
4204
|
}
|
|
3931
4205
|
|
|
3932
4206
|
// src/components/Select.tsx
|
|
3933
|
-
var
|
|
4207
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3934
4208
|
function defaultFilterOption(query, option) {
|
|
3935
4209
|
const keyword = query.toLowerCase();
|
|
3936
4210
|
return [option.label, option.value].some((value) => String(value).toLowerCase().includes(keyword));
|
|
3937
4211
|
}
|
|
3938
|
-
var Select = (0,
|
|
4212
|
+
var Select = (0, import_react25.forwardRef)(function Select2({
|
|
3939
4213
|
options,
|
|
3940
4214
|
mode = "single",
|
|
3941
4215
|
popupMode: popupModeProp,
|
|
@@ -3974,27 +4248,27 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
3974
4248
|
}, forwardedRef) {
|
|
3975
4249
|
const showSearch = showSearchProp ?? options.length > 15;
|
|
3976
4250
|
const size = useControlSize(sizeProp);
|
|
3977
|
-
const fallbackId = (0,
|
|
4251
|
+
const fallbackId = (0, import_react25.useId)();
|
|
3978
4252
|
const selectId = id ?? fallbackId;
|
|
3979
4253
|
const listboxId = `${selectId}-listbox`;
|
|
3980
|
-
const rootRef = (0,
|
|
3981
|
-
const popupRef = (0,
|
|
3982
|
-
const searchRef = (0,
|
|
3983
|
-
const listRef = (0,
|
|
3984
|
-
const [open, setOpen] = (0,
|
|
4254
|
+
const rootRef = (0, import_react25.useRef)(null);
|
|
4255
|
+
const popupRef = (0, import_react25.useRef)(null);
|
|
4256
|
+
const searchRef = (0, import_react25.useRef)(null);
|
|
4257
|
+
const listRef = (0, import_react25.useRef)(null);
|
|
4258
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
3985
4259
|
const automaticMode = popupModeProp ?? (options.length > modalThreshold ? "modal" : "dropdown");
|
|
3986
|
-
const [openedMode, setOpenedMode] = (0,
|
|
4260
|
+
const [openedMode, setOpenedMode] = (0, import_react25.useState)(automaticMode);
|
|
3987
4261
|
const popupMode = open ? openedMode : automaticMode;
|
|
3988
|
-
const [modalValues, setModalValues] = (0,
|
|
3989
|
-
const [modalSubmitting, setModalSubmitting] = (0,
|
|
3990
|
-
const modalSubmitLock = (0,
|
|
3991
|
-
const [selectedOnly, setSelectedOnly] = (0,
|
|
3992
|
-
const [query, setQuery] = (0,
|
|
3993
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3994
|
-
const [scrollTop, setScrollTop] = (0,
|
|
3995
|
-
const [dropdownFontSize, setDropdownFontSize] = (0,
|
|
3996
|
-
const pendingSelectedScroll = (0,
|
|
3997
|
-
const deferredQuery = (0,
|
|
4262
|
+
const [modalValues, setModalValues] = (0, import_react25.useState)([]);
|
|
4263
|
+
const [modalSubmitting, setModalSubmitting] = (0, import_react25.useState)(false);
|
|
4264
|
+
const modalSubmitLock = (0, import_react25.useRef)(false);
|
|
4265
|
+
const [selectedOnly, setSelectedOnly] = (0, import_react25.useState)(false);
|
|
4266
|
+
const [query, setQuery] = (0, import_react25.useState)("");
|
|
4267
|
+
const [activeIndex, setActiveIndex] = (0, import_react25.useState)(-1);
|
|
4268
|
+
const [scrollTop, setScrollTop] = (0, import_react25.useState)(0);
|
|
4269
|
+
const [dropdownFontSize, setDropdownFontSize] = (0, import_react25.useState)();
|
|
4270
|
+
const pendingSelectedScroll = (0, import_react25.useRef)(false);
|
|
4271
|
+
const deferredQuery = (0, import_react25.useDeferredValue)(query.trim());
|
|
3998
4272
|
const initialValue = defaultValue === void 0 ? mode === "multiple" ? [] : null : defaultValue;
|
|
3999
4273
|
const [currentValue, setCurrentValue] = useControllableState({
|
|
4000
4274
|
value,
|
|
@@ -4009,20 +4283,20 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4009
4283
|
}
|
|
4010
4284
|
}
|
|
4011
4285
|
});
|
|
4012
|
-
const selectedValues = (0,
|
|
4286
|
+
const selectedValues = (0, import_react25.useMemo)(() => {
|
|
4013
4287
|
if (currentValue == null || currentValue === "" && !options.some((option) => option.value === "")) return [];
|
|
4014
4288
|
if (mode === "multiple") return Array.isArray(currentValue) ? currentValue : currentValue === null ? [] : [currentValue];
|
|
4015
4289
|
return Array.isArray(currentValue) ? currentValue.slice(0, 1) : currentValue === null ? [] : [currentValue];
|
|
4016
4290
|
}, [currentValue, mode, options]);
|
|
4017
|
-
const selectedValueSet = (0,
|
|
4018
|
-
const availableOptions = (0,
|
|
4291
|
+
const selectedValueSet = (0, import_react25.useMemo)(() => new Set(selectedValues), [selectedValues]);
|
|
4292
|
+
const availableOptions = (0, import_react25.useMemo)(() => {
|
|
4019
4293
|
if (!allowInput) return options;
|
|
4020
4294
|
const optionValueSet = new Set(options.map((option) => option.value));
|
|
4021
4295
|
const selectedCustomOptions = selectedValues.filter((selectedValue) => !optionValueSet.has(selectedValue)).map((selectedValue) => ({ label: String(selectedValue), value: selectedValue }));
|
|
4022
4296
|
return selectedCustomOptions.length ? [...selectedCustomOptions, ...options] : options;
|
|
4023
4297
|
}, [allowInput, options, selectedValues]);
|
|
4024
|
-
const selectedOptions = (0,
|
|
4025
|
-
const filteredOptions = (0,
|
|
4298
|
+
const selectedOptions = (0, import_react25.useMemo)(() => selectedValues.map((selectedValue) => availableOptions.find((option) => option.value === selectedValue)).filter((option) => option !== void 0), [availableOptions, selectedValues]);
|
|
4299
|
+
const filteredOptions = (0, import_react25.useMemo)(() => deferredQuery ? availableOptions.filter((option) => filterOption(deferredQuery, option)) : availableOptions, [availableOptions, deferredQuery, filterOption]);
|
|
4026
4300
|
const inputValue = query.trim();
|
|
4027
4301
|
const exactInputOption = inputValue ? availableOptions.find((option) => String(option.value).toLowerCase() === inputValue.toLowerCase() || typeof option.label === "string" && option.label.toLowerCase() === inputValue.toLowerCase()) : void 0;
|
|
4028
4302
|
const canSubmitInput = allowInput && Boolean(inputValue) && !exactInputOption;
|
|
@@ -4036,7 +4310,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4036
4310
|
const renderedOptions = virtualEnabled ? filteredOptions.slice(virtualStart, virtualEnd) : filteredOptions;
|
|
4037
4311
|
const enabledFilteredOptions = filteredOptions.filter((option) => !option.disabled);
|
|
4038
4312
|
const allFilteredSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => selectedValueSet.has(option.value));
|
|
4039
|
-
(0,
|
|
4313
|
+
(0, import_react25.useEffect)(() => {
|
|
4040
4314
|
if (!open || popupMode === "modal") return void 0;
|
|
4041
4315
|
function closeFromOutside(event) {
|
|
4042
4316
|
const target = event.target;
|
|
@@ -4045,13 +4319,13 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4045
4319
|
document.addEventListener("mousedown", closeFromOutside);
|
|
4046
4320
|
return () => document.removeEventListener("mousedown", closeFromOutside);
|
|
4047
4321
|
}, [open, popupMode]);
|
|
4048
|
-
(0,
|
|
4322
|
+
(0, import_react25.useEffect)(() => {
|
|
4049
4323
|
if (open && (showSearch || allowInput)) searchRef.current?.focus();
|
|
4050
4324
|
}, [allowInput, open, showSearch]);
|
|
4051
|
-
(0,
|
|
4325
|
+
(0, import_react25.useEffect)(() => {
|
|
4052
4326
|
if (disabled || loading) closeDropdown();
|
|
4053
4327
|
}, [disabled, loading]);
|
|
4054
|
-
(0,
|
|
4328
|
+
(0, import_react25.useEffect)(() => {
|
|
4055
4329
|
if (!open || popupMode !== "dropdown" || !pendingSelectedScroll.current || query) return;
|
|
4056
4330
|
const index = filteredOptions.findIndex((option) => selectedValueSet.has(option.value));
|
|
4057
4331
|
if (index < 0) return;
|
|
@@ -4066,7 +4340,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4066
4340
|
});
|
|
4067
4341
|
return () => cancelAnimationFrame(frame);
|
|
4068
4342
|
}, [open, popupMode, filteredOptions, selectedValueSet, virtualEnabled, optionHeight, query]);
|
|
4069
|
-
(0,
|
|
4343
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
4070
4344
|
if (!open || popupMode !== "dropdown") return;
|
|
4071
4345
|
const trigger = rootRef.current?.querySelector(".sia-select__trigger");
|
|
4072
4346
|
if (trigger) setDropdownFontSize(getComputedStyle(trigger).fontSize);
|
|
@@ -4217,7 +4491,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4217
4491
|
function renderOption(option, renderedIndex) {
|
|
4218
4492
|
const optionIndex = virtualEnabled ? virtualStart + renderedIndex : renderedIndex;
|
|
4219
4493
|
const selected = selectedValueSet.has(option.value);
|
|
4220
|
-
return /* @__PURE__ */ (0,
|
|
4494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4221
4495
|
"div",
|
|
4222
4496
|
{
|
|
4223
4497
|
id: `${listboxId}-${optionIndex}`,
|
|
@@ -4230,11 +4504,11 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4230
4504
|
onMouseDown: (event) => event.preventDefault(),
|
|
4231
4505
|
onClick: () => selectOption(option),
|
|
4232
4506
|
children: [
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
showValue ? /* @__PURE__ */ (0,
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "sia-select__option-content", children: [
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "sia-select__option-label", children: option.label }),
|
|
4509
|
+
showValue ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { className: "sia-select__option-value", children: String(option.value) }) : null
|
|
4236
4510
|
] }),
|
|
4237
|
-
selected ? /* @__PURE__ */ (0,
|
|
4511
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "check", size: 15 }) : null
|
|
4238
4512
|
]
|
|
4239
4513
|
},
|
|
4240
4514
|
`${typeof option.value}-${option.value}`
|
|
@@ -4248,8 +4522,8 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4248
4522
|
setModalValues([...modalValues.filter((value2) => !editable.has(value2)), ...modalEnabled.filter((option) => operation === "all" || operation === "invert" && !modalValues.includes(option.value)).map((option) => option.value)]);
|
|
4249
4523
|
}
|
|
4250
4524
|
const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: hasValue, active: open });
|
|
4251
|
-
return /* @__PURE__ */ (0,
|
|
4252
|
-
/* @__PURE__ */ (0,
|
|
4525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref: rootRef, className: `sia-select sia-select--${size} sia-select--${status}${open ? " is-open" : ""}${disabled ? " is-disabled" : ""}${multiple ? " sia-select--multiple" : ""} ${className}`.trim(), style, children: [
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4253
4527
|
"button",
|
|
4254
4528
|
{
|
|
4255
4529
|
...withTitleTooltip(props),
|
|
@@ -4267,29 +4541,29 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4267
4541
|
onClick: () => open ? closeDropdown() : openDropdown(),
|
|
4268
4542
|
onKeyDown: handleTriggerKeyDown,
|
|
4269
4543
|
children: [
|
|
4270
|
-
multiple && hasValue ? /* @__PURE__ */ (0,
|
|
4271
|
-
loading ? /* @__PURE__ */ (0,
|
|
4544
|
+
multiple && hasValue ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(OverflowTags, { className: "sia-select__tags", tagClassName: "sia-select__tag", restClassName: "sia-select__tag--rest", maxCount: maxTagCount, items: selectedOptions.map((option) => ({ key: `${typeof option.value}-${option.value}`, label: option.label })) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `sia-select__value${hasValue ? "" : " is-placeholder"}`, children: selectedOptions[0]?.label ?? placeholder }),
|
|
4545
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "sia-select__spinner", "aria-hidden": "true" }) : null,
|
|
4272
4546
|
floating.label,
|
|
4273
|
-
/* @__PURE__ */ (0,
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { className: "sia-select__arrow", name: "chevron-down", size: 15 })
|
|
4274
4548
|
]
|
|
4275
4549
|
}
|
|
4276
4550
|
),
|
|
4277
|
-
allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ (0,
|
|
4278
|
-
/* @__PURE__ */ (0,
|
|
4279
|
-
/* @__PURE__ */ (0,
|
|
4280
|
-
showSearch || allowInput ? /* @__PURE__ */ (0,
|
|
4281
|
-
/* @__PURE__ */ (0,
|
|
4282
|
-
/* @__PURE__ */ (0,
|
|
4551
|
+
allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "sia-select__clear", type: "button", "aria-label": "\u6E05\u7A7A\u9009\u62E9", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
4554
|
+
showSearch || allowInput ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: "sia-select__search", children: [
|
|
4555
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "search", size: 15 }),
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { ref: searchRef, value: query, maxLength: inputMaxLength, onChange: handleSearchChange, onKeyDown: (event) => handleInteractionKeyDown(event, true), placeholder: searchPlaceholder, "aria-label": searchPlaceholder })
|
|
4283
4557
|
] }) : null,
|
|
4284
|
-
canSubmitInput ? /* @__PURE__ */ (0,
|
|
4285
|
-
/* @__PURE__ */ (0,
|
|
4286
|
-
/* @__PURE__ */ (0,
|
|
4558
|
+
canSubmitInput ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("button", { type: "button", className: "sia-select__input-option", onMouseDown: (event) => event.preventDefault(), onClick: submitInputValue, children: [
|
|
4559
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "plus", size: 14 }),
|
|
4560
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { children: [
|
|
4287
4561
|
"\u4F7F\u7528\u201C",
|
|
4288
4562
|
inputValue,
|
|
4289
4563
|
"\u201D"
|
|
4290
4564
|
] })
|
|
4291
4565
|
] }) : null,
|
|
4292
|
-
/* @__PURE__ */ (0,
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4293
4567
|
"div",
|
|
4294
4568
|
{
|
|
4295
4569
|
ref: listRef,
|
|
@@ -4300,23 +4574,23 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4300
4574
|
"aria-multiselectable": multiple || void 0,
|
|
4301
4575
|
style: { maxHeight: listHeight },
|
|
4302
4576
|
onScroll: handleListScroll,
|
|
4303
|
-
children: filteredOptions.length > 0 ? virtualEnabled ? /* @__PURE__ */ (0,
|
|
4577
|
+
children: filteredOptions.length > 0 ? virtualEnabled ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "sia-select__virtual-space", style: { height: filteredOptions.length * optionHeight }, children: renderedOptions.map(renderOption) }) : renderedOptions.map(renderOption) : canSubmitInput ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "sia-select__empty", children: notFoundContent })
|
|
4304
4578
|
}
|
|
4305
4579
|
),
|
|
4306
|
-
showActions ? /* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4580
|
+
showActions ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "sia-select__actions", children: [
|
|
4581
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { children: [
|
|
4308
4582
|
"\u5171 ",
|
|
4309
4583
|
filteredOptions.length,
|
|
4310
4584
|
" \u6761"
|
|
4311
4585
|
] }),
|
|
4312
|
-
multiple && showSelectAll ? /* @__PURE__ */ (0,
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4586
|
+
multiple && showSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "link", size: "small", disabled: allFilteredSelected || !enabledFilteredOptions.length, onClick: selectAllFiltered, children: "\u5168\u9009" }),
|
|
4588
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "link", size: "small", disabled: !enabledFilteredOptions.length, onClick: invertFiltered, children: "\u53CD\u9009" })
|
|
4315
4589
|
] }) : null,
|
|
4316
|
-
multiple || allowClear ? /* @__PURE__ */ (0,
|
|
4590
|
+
multiple || allowClear ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "link", size: "small", danger: true, disabled: !hasValue, onClick: clearSelection, children: "\u6E05\u7A7A" }) : null
|
|
4317
4591
|
] }) : null
|
|
4318
4592
|
] }),
|
|
4319
|
-
popupMode === "modal" ? /* @__PURE__ */ (0,
|
|
4593
|
+
popupMode === "modal" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4320
4594
|
Modal2,
|
|
4321
4595
|
{
|
|
4322
4596
|
className: "sia-select-modal",
|
|
@@ -4328,30 +4602,30 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4328
4602
|
if (!next) closeDropdown();
|
|
4329
4603
|
},
|
|
4330
4604
|
onCancel: closeDropdown,
|
|
4331
|
-
footer: /* @__PURE__ */ (0,
|
|
4332
|
-
/* @__PURE__ */ (0,
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4334
|
-
/* @__PURE__ */ (0,
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4605
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "sia-select-modal__footer", children: [
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: modalConfig?.footerExtra }),
|
|
4607
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
4608
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { disabled: modalSubmitting, onClick: closeDropdown, children: "\u53D6\u6D88" }),
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "primary", loading: modalSubmitting, disabled: disabled || loading, onClick: confirmModalSelection, children: "\u786E\u5B9A" })
|
|
4336
4610
|
] })
|
|
4337
4611
|
] }),
|
|
4338
|
-
children: open ? /* @__PURE__ */ (0,
|
|
4339
|
-
modalConfig?.headerExtra != null && modalConfig.headerExtra !== false ? /* @__PURE__ */ (0,
|
|
4340
|
-
/* @__PURE__ */ (0,
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4342
|
-
/* @__PURE__ */ (0,
|
|
4343
|
-
/* @__PURE__ */ (0,
|
|
4612
|
+
children: open ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4613
|
+
modalConfig?.headerExtra != null && modalConfig.headerExtra !== false ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "sia-select-modal__header-extra", children: modalConfig.headerExtra }) : null,
|
|
4614
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "sia-select-modal__heading", children: [
|
|
4615
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
|
|
4616
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { role: "tab", "aria-selected": !selectedOnly, variant: "link", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Button, { role: "tab", "aria-selected": selectedOnly, variant: "link", onClick: () => setSelectedOnly(true), children: [
|
|
4344
4618
|
"\u5DF2\u9009\u9879(",
|
|
4345
4619
|
modalValues.length,
|
|
4346
4620
|
")"
|
|
4347
4621
|
] })
|
|
4348
4622
|
] }),
|
|
4349
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4350
4624
|
Input,
|
|
4351
4625
|
{
|
|
4352
4626
|
"aria-label": searchPlaceholder,
|
|
4353
4627
|
placeholder: searchPlaceholder,
|
|
4354
|
-
prefix: /* @__PURE__ */ (0,
|
|
4628
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "search", size: 14 }),
|
|
4355
4629
|
value: query,
|
|
4356
4630
|
allowClear: true,
|
|
4357
4631
|
onChange: (event) => {
|
|
@@ -4361,8 +4635,8 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4361
4635
|
}
|
|
4362
4636
|
)
|
|
4363
4637
|
] }),
|
|
4364
|
-
multiple && showSelectAll ? /* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
4638
|
+
multiple && showSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "sia-select-modal__actions", children: [
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4366
4640
|
Checkbox2,
|
|
4367
4641
|
{
|
|
4368
4642
|
checked: modalEnabled.length > 0 && modalEnabled.every((option) => modalValues.includes(option.value)),
|
|
@@ -4372,10 +4646,10 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4372
4646
|
children: "\u5168\u9009"
|
|
4373
4647
|
}
|
|
4374
4648
|
),
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4376
|
-
/* @__PURE__ */ (0,
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "link", size: "small", disabled: !modalEnabled.length, onClick: () => modalBatch("invert"), children: "\u53CD\u9009" }),
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "link", size: "small", danger: true, disabled: !modalValues.length, onClick: () => setModalValues([]), children: "\u6E05\u7A7A" })
|
|
4377
4651
|
] }) : null,
|
|
4378
|
-
allowInput && canSubmitInput ? /* @__PURE__ */ (0,
|
|
4652
|
+
allowInput && canSubmitInput ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Button, { variant: "link", onClick: () => {
|
|
4379
4653
|
setModalValues(multiple ? [.../* @__PURE__ */ new Set([...modalValues, inputValue])] : [inputValue]);
|
|
4380
4654
|
setQuery("");
|
|
4381
4655
|
}, children: [
|
|
@@ -4383,7 +4657,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4383
4657
|
inputValue,
|
|
4384
4658
|
"\u201D"
|
|
4385
4659
|
] }) : null,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4387
4661
|
SelectionPanel,
|
|
4388
4662
|
{
|
|
4389
4663
|
options: modalFiltered,
|
|
@@ -4407,7 +4681,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
4407
4681
|
});
|
|
4408
4682
|
|
|
4409
4683
|
// src/components/Upload.tsx
|
|
4410
|
-
var
|
|
4684
|
+
var import_react26 = require("react");
|
|
4411
4685
|
|
|
4412
4686
|
// src/components/uploadFiles.ts
|
|
4413
4687
|
function acceptsUploadFile(file, accept) {
|
|
@@ -4539,7 +4813,7 @@ function isUploadImage(file, accept) {
|
|
|
4539
4813
|
|
|
4540
4814
|
// src/components/Message.tsx
|
|
4541
4815
|
var import_client4 = require("react-dom/client");
|
|
4542
|
-
var
|
|
4816
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4543
4817
|
var messageSeed = 0;
|
|
4544
4818
|
var messageRoot = null;
|
|
4545
4819
|
var messageContainer = null;
|
|
@@ -4548,11 +4822,11 @@ var defaultDuration = 3;
|
|
|
4548
4822
|
var maxCount = 5;
|
|
4549
4823
|
var messageTimers = /* @__PURE__ */ new Map();
|
|
4550
4824
|
var messageIcons = {
|
|
4551
|
-
info: /* @__PURE__ */ (0,
|
|
4552
|
-
success: /* @__PURE__ */ (0,
|
|
4553
|
-
warning: /* @__PURE__ */ (0,
|
|
4554
|
-
error: /* @__PURE__ */ (0,
|
|
4555
|
-
loading: /* @__PURE__ */ (0,
|
|
4825
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "info", size: 18 }),
|
|
4826
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "circle-check", size: 18 }),
|
|
4827
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "warning", size: 18 }),
|
|
4828
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "circle-close", size: 18 }),
|
|
4829
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "loader", size: 18, spin: true })
|
|
4556
4830
|
};
|
|
4557
4831
|
function ensureMessageRoot() {
|
|
4558
4832
|
if (typeof document === "undefined") return false;
|
|
@@ -4566,10 +4840,10 @@ function ensureMessageRoot() {
|
|
|
4566
4840
|
}
|
|
4567
4841
|
function renderMessages() {
|
|
4568
4842
|
if (!ensureMessageRoot()) return;
|
|
4569
|
-
messageRoot.render(/* @__PURE__ */ (0,
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4571
|
-
/* @__PURE__ */ (0,
|
|
4572
|
-
item.closable ? /* @__PURE__ */ (0,
|
|
4843
|
+
messageRoot.render(/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "sia-message-list", "aria-live": "polite", children: messageItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `sia-message sia-message--${item.type}`, role: item.type === "loading" ? "status" : "alert", children: [
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sia-message__icon", "aria-hidden": "true", children: messageIcons[item.type] }),
|
|
4845
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sia-message__content", children: item.content }),
|
|
4846
|
+
item.closable ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "sia-message__close", "aria-label": "\u5173\u95ED\u63D0\u793A", onClick: () => closeMessage(item.key), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "close", size: 14 }) }) : null
|
|
4573
4847
|
] }, item.key)) }));
|
|
4574
4848
|
}
|
|
4575
4849
|
function closeMessage(key) {
|
|
@@ -4643,11 +4917,11 @@ var message = {
|
|
|
4643
4917
|
};
|
|
4644
4918
|
|
|
4645
4919
|
// src/components/Upload.tsx
|
|
4646
|
-
var
|
|
4920
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4647
4921
|
var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
|
|
4648
4922
|
function useThumbnail(file, accept) {
|
|
4649
|
-
const [local, setLocal] = (0,
|
|
4650
|
-
(0,
|
|
4923
|
+
const [local, setLocal] = (0, import_react26.useState)();
|
|
4924
|
+
(0, import_react26.useEffect)(() => {
|
|
4651
4925
|
if (!file?.thumbUrl && file?.originFileObj?.type.startsWith("image/")) {
|
|
4652
4926
|
const url = URL.createObjectURL(file.originFileObj);
|
|
4653
4927
|
setLocal(url);
|
|
@@ -4659,9 +4933,9 @@ function useThumbnail(file, accept) {
|
|
|
4659
4933
|
}
|
|
4660
4934
|
function UploadItem({ file, files, props, actions }) {
|
|
4661
4935
|
const source = useThumbnail(file, props.accept);
|
|
4662
|
-
const [failed, setFailed] = (0,
|
|
4663
|
-
const [downloading, setDownloading] = (0,
|
|
4664
|
-
const downloadingRef = (0,
|
|
4936
|
+
const [failed, setFailed] = (0, import_react26.useState)(false);
|
|
4937
|
+
const [downloading, setDownloading] = (0, import_react26.useState)(false);
|
|
4938
|
+
const downloadingRef = (0, import_react26.useRef)(false);
|
|
4665
4939
|
const canPreview = !!(source || file.url || file.originFileObj || props.onPreview);
|
|
4666
4940
|
const canDownload = !!(file.url || file.originFileObj || props.downloadRequest);
|
|
4667
4941
|
async function download() {
|
|
@@ -4677,29 +4951,29 @@ function UploadItem({ file, files, props, actions }) {
|
|
|
4677
4951
|
setDownloading(false);
|
|
4678
4952
|
}
|
|
4679
4953
|
}
|
|
4680
|
-
(0,
|
|
4681
|
-
const node = /* @__PURE__ */ (0,
|
|
4682
|
-
props.listType !== "text" ? /* @__PURE__ */ (0,
|
|
4683
|
-
/* @__PURE__ */ (0,
|
|
4684
|
-
/* @__PURE__ */ (0,
|
|
4685
|
-
/* @__PURE__ */ (0,
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4687
|
-
/* @__PURE__ */ (0,
|
|
4954
|
+
(0, import_react26.useEffect)(() => setFailed(false), [source]);
|
|
4955
|
+
const node = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: `sia-upload__item sia-upload__item--${file.status ?? "ready"}`, children: [
|
|
4956
|
+
props.listType !== "text" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "text", className: "sia-upload__thumbnail", "aria-label": `\u9884\u89C8\u7F29\u7565\u56FE ${file.name}`, onClick: actions.preview, disabled: !canPreview, children: source && !failed ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: source, alt: file.name, onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: file.type?.startsWith("image/") ? "image" : "file", size: 28 }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__file-icon", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: file.status === "done" ? "circle-check" : "file", size: 24 }) }),
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__name", ...withTitleTooltip({ title: file.relativePath || file.name }), children: file.url ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("a", { href: file.url, target: "_blank", rel: "noreferrer", children: file.name }) : file.name }),
|
|
4958
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "sia-upload__actions", children: [
|
|
4959
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "text", title: "\u9884\u89C8", "aria-label": `\u9884\u89C8 ${file.name}`, disabled: !canPreview, onClick: actions.preview, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "eye", size: 14 }) }),
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "text", title: "\u4E0B\u8F7D", "aria-label": `\u4E0B\u8F7D ${file.name}`, disabled: !canDownload, loading: downloading, onClick: () => void download(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "download", size: 14 }) }),
|
|
4961
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "text", title: "\u79FB\u9664", className: "sia-upload__remove", disabled: props.disabled, "aria-label": `\u79FB\u9664 ${file.name}`, onClick: () => void actions.remove(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "close", size: 14 }) })
|
|
4688
4962
|
] }),
|
|
4689
|
-
file.status === "uploading" && /* @__PURE__ */ (0,
|
|
4690
|
-
/* @__PURE__ */ (0,
|
|
4963
|
+
file.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sia-upload__uploading", children: [
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
|
|
4691
4965
|
"\u4E0A\u4F20\u4E2D ",
|
|
4692
4966
|
Math.round(file.percent ?? 0),
|
|
4693
4967
|
"%"
|
|
4694
4968
|
] }),
|
|
4695
|
-
/* @__PURE__ */ (0,
|
|
4969
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__progress", role: "progressbar", "aria-label": `${file.name} \u4E0A\u4F20\u8FDB\u5EA6`, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": file.percent ?? 0, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: { width: `${file.percent ?? 0}%` } }) })
|
|
4696
4970
|
] }),
|
|
4697
|
-
file.status === "error" && /* @__PURE__ */ (0,
|
|
4698
|
-
props.listType === "text" && (file.status === void 0 || file.status === "ready" || file.status === "done") && /* @__PURE__ */ (0,
|
|
4971
|
+
file.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__error", children: "\u4E0A\u4F20\u5931\u8D25" }),
|
|
4972
|
+
props.listType === "text" && (file.status === void 0 || file.status === "ready" || file.status === "done") && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__status", children: file.status === "done" ? "\u4E0A\u4F20\u5B8C\u6210" : "\u5DF2\u9009\u62E9" })
|
|
4699
4973
|
] });
|
|
4700
|
-
return /* @__PURE__ */ (0,
|
|
4974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: props.itemRender ? props.itemRender(node, file, files, actions) : node });
|
|
4701
4975
|
}
|
|
4702
|
-
var UploadRoot = (0,
|
|
4976
|
+
var UploadRoot = (0, import_react26.forwardRef)(function UploadRoot2({
|
|
4703
4977
|
accept,
|
|
4704
4978
|
multiple = false,
|
|
4705
4979
|
directory = false,
|
|
@@ -4738,19 +5012,19 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4738
5012
|
const cardWidth = cardDimension(typeof cardSize === "number" ? cardSize : cardSize?.width);
|
|
4739
5013
|
const cardHeight = cardDimension(typeof cardSize === "number" ? cardSize : cardSize?.height);
|
|
4740
5014
|
const compactCard = listType === "picture-card" && (cardWidth < 88 || cardHeight < 88);
|
|
4741
|
-
const inputRef = (0,
|
|
4742
|
-
const [internalFiles, setInternalFiles] = (0,
|
|
5015
|
+
const inputRef = (0, import_react26.useRef)(null);
|
|
5016
|
+
const [internalFiles, setInternalFiles] = (0, import_react26.useState)(defaultFileList);
|
|
4743
5017
|
const files = fileList ?? internalFiles;
|
|
4744
|
-
const filesRef = (0,
|
|
5018
|
+
const filesRef = (0, import_react26.useRef)(files);
|
|
4745
5019
|
filesRef.current = files;
|
|
4746
|
-
const tasks = (0,
|
|
4747
|
-
const mounted = (0,
|
|
4748
|
-
const [dragging, setDragging] = (0,
|
|
4749
|
-
const [preview, setPreview] = (0,
|
|
5020
|
+
const tasks = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
|
|
5021
|
+
const mounted = (0, import_react26.useRef)(true);
|
|
5022
|
+
const [dragging, setDragging] = (0, import_react26.useState)(false);
|
|
5023
|
+
const [preview, setPreview] = (0, import_react26.useState)();
|
|
4750
5024
|
const previewSource = useThumbnail(preview, accept);
|
|
4751
5025
|
const limit = maxCount2 === void 0 || !Number.isFinite(maxCount2) ? Infinity : Math.max(0, Math.floor(maxCount2));
|
|
4752
5026
|
const full = files.length >= limit;
|
|
4753
|
-
const current = (0,
|
|
5027
|
+
const current = (0, import_react26.useRef)({ disabled, directory, recursive });
|
|
4754
5028
|
current.current = { disabled, directory, recursive };
|
|
4755
5029
|
function cancel(uid) {
|
|
4756
5030
|
const task = tasks.current.get(uid);
|
|
@@ -4762,14 +5036,14 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4762
5036
|
}
|
|
4763
5037
|
task?.finish();
|
|
4764
5038
|
}
|
|
4765
|
-
(0,
|
|
5039
|
+
(0, import_react26.useEffect)(() => {
|
|
4766
5040
|
mounted.current = true;
|
|
4767
5041
|
return () => {
|
|
4768
5042
|
mounted.current = false;
|
|
4769
5043
|
[...tasks.current.keys()].forEach(cancel);
|
|
4770
5044
|
};
|
|
4771
5045
|
}, []);
|
|
4772
|
-
(0,
|
|
5046
|
+
(0, import_react26.useEffect)(() => {
|
|
4773
5047
|
for (const uid of tasks.current.keys()) if (!files.some((file) => file.uid === uid)) cancel(uid);
|
|
4774
5048
|
if (preview && !files.some((file) => file.uid === preview.uid)) setPreview(void 0);
|
|
4775
5049
|
}, [files, preview]);
|
|
@@ -4875,7 +5149,7 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4875
5149
|
} catch {
|
|
4876
5150
|
}
|
|
4877
5151
|
}
|
|
4878
|
-
(0,
|
|
5152
|
+
(0, import_react26.useImperativeHandle)(ref, () => ({
|
|
4879
5153
|
upload: async (uid) => {
|
|
4880
5154
|
await Promise.all(filesRef.current.filter((file) => (!uid || file.uid === uid) && file.status !== "done").map(start));
|
|
4881
5155
|
},
|
|
@@ -4927,16 +5201,16 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4927
5201
|
event.preventDefault();
|
|
4928
5202
|
ingest(selected.map((file) => ({ file, path: file.name })));
|
|
4929
5203
|
}
|
|
4930
|
-
const trigger = !full && /* @__PURE__ */ (0,
|
|
5204
|
+
const trigger = !full && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "sia-upload__trigger", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { className: "sia-upload__choose", "aria-label": compactCard ? directory ? "\u9009\u62E9\u6587\u4EF6\u5939" : "\u9009\u62E9\u6587\u4EF6" : void 0, disabled: disabled || full, onClick: () => {
|
|
4931
5205
|
if (!disabled && !full && onChoose?.() !== false) inputRef.current?.click();
|
|
4932
|
-
}, children: children ?? (listType === "picture-card" ? /* @__PURE__ */ (0,
|
|
4933
|
-
/* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
4935
|
-
] }) : /* @__PURE__ */ (0,
|
|
4936
|
-
/* @__PURE__ */ (0,
|
|
5206
|
+
}, children: children ?? (listType === "picture-card" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5207
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "plus", size: 24 }),
|
|
5208
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "\u4E0A\u4F20\u56FE\u7247" })
|
|
5209
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "upload", size: 16 }),
|
|
4937
5211
|
directory ? "\u9009\u62E9\u6587\u4EF6\u5939" : "\u9009\u62E9\u6587\u4EF6"
|
|
4938
5212
|
] })) }) });
|
|
4939
|
-
return /* @__PURE__ */ (0,
|
|
5213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4940
5214
|
"div",
|
|
4941
5215
|
{
|
|
4942
5216
|
...withTitleTooltip(props),
|
|
@@ -4957,7 +5231,7 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4957
5231
|
},
|
|
4958
5232
|
onDrop: (event) => void handleDrop(event),
|
|
4959
5233
|
children: [
|
|
4960
|
-
/* @__PURE__ */ (0,
|
|
5234
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4961
5235
|
"input",
|
|
4962
5236
|
{
|
|
4963
5237
|
ref: inputRef,
|
|
@@ -4974,12 +5248,12 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4974
5248
|
}
|
|
4975
5249
|
),
|
|
4976
5250
|
listType !== "picture-card" && trigger,
|
|
4977
|
-
showUploadList && listType === "text" && files.length > 0 && /* @__PURE__ */ (0,
|
|
5251
|
+
showUploadList && listType === "text" && files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sia-upload__list-heading", role: "status", children: [
|
|
4978
5252
|
"\u5DF2\u9009\u6587\u4EF6 ",
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
5253
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sia-upload__count", children: files.length })
|
|
4980
5254
|
] }),
|
|
4981
|
-
/* @__PURE__ */ (0,
|
|
4982
|
-
showUploadList && files.map((file) => /* @__PURE__ */ (0,
|
|
5255
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sia-upload__list", children: [
|
|
5256
|
+
showUploadList && files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest, accept }, actions: {
|
|
4983
5257
|
upload: () => start(file),
|
|
4984
5258
|
abort: () => abort(file.uid),
|
|
4985
5259
|
remove: () => remove(file.uid),
|
|
@@ -4996,23 +5270,23 @@ var UploadRoot = (0, import_react25.forwardRef)(function UploadRoot2({
|
|
|
4996
5270
|
} }, file.uid)),
|
|
4997
5271
|
listType === "picture-card" && trigger
|
|
4998
5272
|
] }),
|
|
4999
|
-
/* @__PURE__ */ (0,
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ImagePreview, { open: !!preview && !!(preview.url || previewSource), src: preview?.url || previewSource, alt: preview?.name, onOpenChange: (open) => {
|
|
5000
5274
|
if (!open) setPreview(void 0);
|
|
5001
5275
|
} })
|
|
5002
5276
|
]
|
|
5003
5277
|
}
|
|
5004
5278
|
);
|
|
5005
5279
|
});
|
|
5006
|
-
var UploadDragger = (0,
|
|
5007
|
-
return /* @__PURE__ */ (0,
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
5009
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
var UploadDragger = (0, import_react26.forwardRef)(function UploadDragger2({ hint = "\u652F\u6301\u5355\u4E2A\u6216\u6279\u91CF\u4E0A\u4F20", children, className = "", ...props }, ref) {
|
|
5281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UploadRoot, { ...props, ref, className: `sia-upload-dragger ${className}`.trim(), children: children ?? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "sia-upload-dragger__content", children: [
|
|
5282
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "upload", size: 32 }),
|
|
5283
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("strong", { children: [
|
|
5010
5284
|
"\u70B9\u51FB\u6216\u62D6\u62FD",
|
|
5011
5285
|
props.directory ? "\u6587\u4EF6\u5939" : "\u6587\u4EF6",
|
|
5012
5286
|
"\u5230\u6B64\u533A\u57DF\u4E0A\u4F20"
|
|
5013
5287
|
] }),
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5015
|
-
props.pastable && /* @__PURE__ */ (0,
|
|
5288
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: hint }),
|
|
5289
|
+
props.pastable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "\u805A\u7126\u6B64\u533A\u57DF\u540E\u6309 Ctrl / \u2318 + V \u7C98\u8D34\u6587\u4EF6\u6216\u622A\u56FE" })
|
|
5016
5290
|
] }) });
|
|
5017
5291
|
});
|
|
5018
5292
|
var Upload = Object.assign(UploadRoot, {
|
|
@@ -5023,29 +5297,29 @@ var Upload = Object.assign(UploadRoot, {
|
|
|
5023
5297
|
});
|
|
5024
5298
|
|
|
5025
5299
|
// src/components/Breadcrumb.tsx
|
|
5026
|
-
var
|
|
5300
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
5027
5301
|
function Breadcrumb({ items, separator = "/", itemRender, className = "", ...props }) {
|
|
5028
|
-
return /* @__PURE__ */ (0,
|
|
5302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("nav", { "aria-label": "\u9762\u5305\u5C51\u5BFC\u822A", ...withTitleTooltip(props), className: `sia-breadcrumb ${className}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ol", { className: "sia-breadcrumb__list", children: items.map((item, index) => {
|
|
5029
5303
|
const current = index === items.length - 1;
|
|
5030
|
-
const content = /* @__PURE__ */ (0,
|
|
5031
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
5032
|
-
/* @__PURE__ */ (0,
|
|
5304
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5305
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__icon", "aria-hidden": "true", children: item.icon }) : null,
|
|
5306
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__title", children: item.title })
|
|
5033
5307
|
] });
|
|
5034
5308
|
const custom = itemRender?.(item, index, items);
|
|
5035
|
-
const label = item.disabled ? /* @__PURE__ */ (0,
|
|
5036
|
-
return /* @__PURE__ */ (0,
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5309
|
+
const label = item.disabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__label", "aria-disabled": "true", children: content }) : custom !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__label", children: custom }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { className: "sia-breadcrumb__label", href: item.href, target: item.target, rel: item.target === "_blank" ? "noopener noreferrer" : void 0, onClick: item.onClick, children: content }) : item.onClick ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { className: "sia-breadcrumb__label", variant: "text", onClick: item.onClick, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__label", children: content });
|
|
5310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("li", { className: `sia-breadcrumb__item${current ? " is-current" : ""}${item.disabled ? " is-disabled" : ""}`, children: [
|
|
5311
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "sia-breadcrumb__entry", "aria-current": current ? "page" : void 0, children: [
|
|
5038
5312
|
label,
|
|
5039
|
-
item.menu?.items.length ? /* @__PURE__ */ (0,
|
|
5313
|
+
item.menu?.items.length ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Dropdown, { menu: item.menu, trigger: ["click"], disabled: item.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { className: "sia-breadcrumb__menu-trigger", variant: "text", size: "small", disabled: item.disabled, "aria-label": `\u5C55\u5F00${typeof item.title === "string" ? item.title : "\u5C42\u7EA7"}\u83DC\u5355`, icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "chevron-down", size: 12 }) }) }) : null
|
|
5040
5314
|
] }),
|
|
5041
|
-
!current ? /* @__PURE__ */ (0,
|
|
5315
|
+
!current ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sia-breadcrumb__separator", "aria-hidden": "true", children: item.separator === void 0 ? separator : item.separator }) : null
|
|
5042
5316
|
] }, item.key ?? index);
|
|
5043
5317
|
}) }) });
|
|
5044
5318
|
}
|
|
5045
5319
|
|
|
5046
5320
|
// src/components/Typography.tsx
|
|
5047
|
-
var
|
|
5048
|
-
var
|
|
5321
|
+
var import_react27 = require("react");
|
|
5322
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5049
5323
|
function TypographyContent({
|
|
5050
5324
|
as: Tag2 = "span",
|
|
5051
5325
|
type,
|
|
@@ -5064,26 +5338,26 @@ function TypographyContent({
|
|
|
5064
5338
|
className = "",
|
|
5065
5339
|
...props
|
|
5066
5340
|
}) {
|
|
5067
|
-
const contentRef = (0,
|
|
5068
|
-
const editRef = (0,
|
|
5069
|
-
const timer = (0,
|
|
5070
|
-
const [localText, setLocalText] = (0,
|
|
5071
|
-
const [draft, setDraft] = (0,
|
|
5072
|
-
const [editing, setEditing] = (0,
|
|
5073
|
-
const [copied, setCopied] = (0,
|
|
5074
|
-
const [copyError, setCopyError] = (0,
|
|
5075
|
-
const [expanded, setExpanded] = (0,
|
|
5076
|
-
const [overflow, setOverflow] = (0,
|
|
5341
|
+
const contentRef = (0, import_react27.useRef)(null);
|
|
5342
|
+
const editRef = (0, import_react27.useRef)(null);
|
|
5343
|
+
const timer = (0, import_react27.useRef)();
|
|
5344
|
+
const [localText, setLocalText] = (0, import_react27.useState)();
|
|
5345
|
+
const [draft, setDraft] = (0, import_react27.useState)("");
|
|
5346
|
+
const [editing, setEditing] = (0, import_react27.useState)(false);
|
|
5347
|
+
const [copied, setCopied] = (0, import_react27.useState)(false);
|
|
5348
|
+
const [copyError, setCopyError] = (0, import_react27.useState)(false);
|
|
5349
|
+
const [expanded, setExpanded] = (0, import_react27.useState)(false);
|
|
5350
|
+
const [overflow, setOverflow] = (0, import_react27.useState)(false);
|
|
5077
5351
|
const editConfig = typeof editable === "object" ? editable : void 0;
|
|
5078
5352
|
const content = editConfig?.text ?? localText ?? children;
|
|
5079
5353
|
const requestedRows = typeof ellipsis === "object" ? ellipsis.rows ?? 1 : 1;
|
|
5080
5354
|
const rows = Number.isFinite(requestedRows) ? Math.max(1, Math.floor(requestedRows)) : 1;
|
|
5081
5355
|
const expandable = typeof ellipsis === "object" && ellipsis.expandable;
|
|
5082
|
-
(0,
|
|
5356
|
+
(0, import_react27.useEffect)(() => {
|
|
5083
5357
|
setLocalText(void 0);
|
|
5084
5358
|
}, [children]);
|
|
5085
|
-
(0,
|
|
5086
|
-
(0,
|
|
5359
|
+
(0, import_react27.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
5360
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
5087
5361
|
const element = contentRef.current;
|
|
5088
5362
|
if (!element || !ellipsis || !expandable || editing || expanded) return;
|
|
5089
5363
|
const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
|
|
@@ -5114,15 +5388,15 @@ function TypographyContent({
|
|
|
5114
5388
|
requestAnimationFrame(() => editRef.current?.focus());
|
|
5115
5389
|
}
|
|
5116
5390
|
let formatted = content;
|
|
5117
|
-
if (strong) formatted = /* @__PURE__ */ (0,
|
|
5118
|
-
if (italic) formatted = /* @__PURE__ */ (0,
|
|
5119
|
-
if (underline) formatted = /* @__PURE__ */ (0,
|
|
5120
|
-
if (deleted) formatted = /* @__PURE__ */ (0,
|
|
5121
|
-
if (mark) formatted = /* @__PURE__ */ (0,
|
|
5122
|
-
if (code) formatted = /* @__PURE__ */ (0,
|
|
5123
|
-
if (keyboard) formatted = /* @__PURE__ */ (0,
|
|
5124
|
-
return /* @__PURE__ */ (0,
|
|
5125
|
-
/* @__PURE__ */ (0,
|
|
5391
|
+
if (strong) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("strong", { children: formatted });
|
|
5392
|
+
if (italic) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("em", { children: formatted });
|
|
5393
|
+
if (underline) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("u", { children: formatted });
|
|
5394
|
+
if (deleted) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("del", { children: formatted });
|
|
5395
|
+
if (mark) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("mark", { children: formatted });
|
|
5396
|
+
if (code) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { children: formatted });
|
|
5397
|
+
if (keyboard) formatted = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("kbd", { children: formatted });
|
|
5398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Tag2, { ...withTitleTooltip(props), "aria-disabled": disabled || void 0, className: `sia-typography sia-typography--${Tag2}${type ? ` sia-typography--${type}` : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), children: editing ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "sia-typography__editor", children: [
|
|
5399
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5126
5400
|
TextArea,
|
|
5127
5401
|
{
|
|
5128
5402
|
autoFocus: true,
|
|
@@ -5144,32 +5418,32 @@ function TypographyContent({
|
|
|
5144
5418
|
}
|
|
5145
5419
|
}
|
|
5146
5420
|
),
|
|
5147
|
-
/* @__PURE__ */ (0,
|
|
5148
|
-
/* @__PURE__ */ (0,
|
|
5149
|
-
/* @__PURE__ */ (0,
|
|
5421
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "sia-typography__edit-actions", children: [
|
|
5422
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "small", onClick: () => finish(false), children: "\u53D6\u6D88" }),
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { size: "small", variant: "primary", onClick: () => finish(true), children: "\u4FDD\u5B58" })
|
|
5150
5424
|
] })
|
|
5151
|
-
] }) : /* @__PURE__ */ (0,
|
|
5152
|
-
/* @__PURE__ */ (0,
|
|
5153
|
-
expandable && (overflow || expanded) ? /* @__PURE__ */ (0,
|
|
5154
|
-
editable ? /* @__PURE__ */ (0,
|
|
5425
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { ref: contentRef, className: ellipsis && !expanded ? "sia-typography__ellipsis" : void 0, style: ellipsis && !expanded ? { "--sia-typography-rows": rows } : void 0, children: formatted }),
|
|
5427
|
+
expandable && (overflow || expanded) ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "link", size: "small", className: "sia-typography__action", "aria-expanded": expanded, disabled, onClick: () => setExpanded(!expanded), children: expanded ? "\u6536\u8D77" : "\u5C55\u5F00" }) : null,
|
|
5428
|
+
editable ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { ref: editRef, variant: "text", size: "small", className: "sia-typography__action", "aria-label": "\u7F16\u8F91\u6587\u672C", title: "\u7F16\u8F91", disabled, icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: "edit", size: 14 }), onClick: () => {
|
|
5155
5429
|
setDraft(contentRef.current?.textContent ?? "");
|
|
5156
5430
|
setEditing(true);
|
|
5157
5431
|
} }) : null,
|
|
5158
|
-
copyable ? /* @__PURE__ */ (0,
|
|
5159
|
-
copyError ? /* @__PURE__ */ (0,
|
|
5432
|
+
copyable ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "text", size: "small", className: "sia-typography__action", "aria-label": copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236\u6587\u672C", title: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236", disabled, icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: copied ? "check" : "copy", size: 14 }), onClick: () => void copy() }) : null,
|
|
5433
|
+
copyError ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { role: "status", className: "sia-typography--danger", children: "\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u6587\u672C\u590D\u5236\u3002" }) : null
|
|
5160
5434
|
] }) });
|
|
5161
5435
|
}
|
|
5162
5436
|
function Title({ level = 1, ...props }) {
|
|
5163
|
-
return /* @__PURE__ */ (0,
|
|
5437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TypographyContent, { ...props, as: `h${level}` });
|
|
5164
5438
|
}
|
|
5165
5439
|
function Text(props) {
|
|
5166
|
-
return /* @__PURE__ */ (0,
|
|
5440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TypographyContent, { ...props });
|
|
5167
5441
|
}
|
|
5168
5442
|
function Paragraph(props) {
|
|
5169
|
-
return /* @__PURE__ */ (0,
|
|
5443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TypographyContent, { ...props, as: "p" });
|
|
5170
5444
|
}
|
|
5171
5445
|
function Link({ disabled, className = "", onClick, href, target, rel, ...props }) {
|
|
5172
|
-
return /* @__PURE__ */ (0,
|
|
5446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5173
5447
|
"a",
|
|
5174
5448
|
{
|
|
5175
5449
|
...withTitleTooltip(props),
|
|
@@ -5187,7 +5461,7 @@ function Link({ disabled, className = "", onClick, href, target, rel, ...props }
|
|
|
5187
5461
|
);
|
|
5188
5462
|
}
|
|
5189
5463
|
function TypographyRoot({ className = "", ...props }) {
|
|
5190
|
-
return /* @__PURE__ */ (0,
|
|
5464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ...withTitleTooltip(props), className: `sia-typography ${className}`.trim() });
|
|
5191
5465
|
}
|
|
5192
5466
|
var Typography = Object.assign(TypographyRoot, {
|
|
5193
5467
|
/** 语义化标题,支持标题级别、复制和编辑。 */
|
|
@@ -5201,10 +5475,10 @@ var Typography = Object.assign(TypographyRoot, {
|
|
|
5201
5475
|
});
|
|
5202
5476
|
|
|
5203
5477
|
// src/components/FloatButton.tsx
|
|
5204
|
-
var
|
|
5205
|
-
var
|
|
5206
|
-
var GroupShape = (0,
|
|
5207
|
-
var FloatButtonRoot = (0,
|
|
5478
|
+
var import_react28 = require("react");
|
|
5479
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5480
|
+
var GroupShape = (0, import_react28.createContext)(void 0);
|
|
5481
|
+
var FloatButtonRoot = (0, import_react28.forwardRef)(function FloatButton({
|
|
5208
5482
|
icon,
|
|
5209
5483
|
description,
|
|
5210
5484
|
tooltip,
|
|
@@ -5217,9 +5491,9 @@ var FloatButtonRoot = (0, import_react27.forwardRef)(function FloatButton({
|
|
|
5217
5491
|
children,
|
|
5218
5492
|
...props
|
|
5219
5493
|
}, ref) {
|
|
5220
|
-
const groupShape = (0,
|
|
5494
|
+
const groupShape = (0, import_react28.useContext)(GroupShape);
|
|
5221
5495
|
const label = props["aria-label"] ?? (typeof tooltip === "string" ? tooltip : typeof description === "string" ? description : "\u60AC\u6D6E\u64CD\u4F5C");
|
|
5222
|
-
const button = /* @__PURE__ */ (0,
|
|
5496
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5223
5497
|
"button",
|
|
5224
5498
|
{
|
|
5225
5499
|
...withTitleTooltip(props),
|
|
@@ -5227,13 +5501,13 @@ var FloatButtonRoot = (0, import_react27.forwardRef)(function FloatButton({
|
|
|
5227
5501
|
type: htmlType,
|
|
5228
5502
|
"aria-label": label,
|
|
5229
5503
|
className: `sia-float-button sia-float-button--${groupShape ?? shape} sia-float-button--${type} ${className}`.trim(),
|
|
5230
|
-
children: /* @__PURE__ */ (0,
|
|
5231
|
-
icon !== null ? /* @__PURE__ */ (0,
|
|
5232
|
-
description != null || children != null ? /* @__PURE__ */ (0,
|
|
5504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge, { ...badge, className: "sia-float-button__badge", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "sia-float-button__body", children: [
|
|
5505
|
+
icon !== null ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sia-float-button__icon", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "question", size: 20 }) }) : null,
|
|
5506
|
+
description != null || children != null ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sia-float-button__description", children: description ?? children }) : null
|
|
5233
5507
|
] }) })
|
|
5234
5508
|
}
|
|
5235
5509
|
);
|
|
5236
|
-
return /* @__PURE__ */ (0,
|
|
5510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sia-float-button-root", style, children: tooltip ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Tooltip, { title: tooltip, placement: "left", children: button }) : button });
|
|
5237
5511
|
});
|
|
5238
5512
|
function FloatButtonGroup({
|
|
5239
5513
|
shape = "circle",
|
|
@@ -5255,10 +5529,10 @@ function FloatButtonGroup({
|
|
|
5255
5529
|
...props
|
|
5256
5530
|
}) {
|
|
5257
5531
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
5258
|
-
const rootRef = (0,
|
|
5259
|
-
const triggerRef = (0,
|
|
5260
|
-
const id = (0,
|
|
5261
|
-
(0,
|
|
5532
|
+
const rootRef = (0, import_react28.useRef)(null);
|
|
5533
|
+
const triggerRef = (0, import_react28.useRef)(null);
|
|
5534
|
+
const id = (0, import_react28.useId)();
|
|
5535
|
+
(0, import_react28.useEffect)(() => {
|
|
5262
5536
|
if (!trigger || !visible) return;
|
|
5263
5537
|
const close = (event) => {
|
|
5264
5538
|
if (!rootRef.current?.contains(event.target)) setVisible(false);
|
|
@@ -5266,7 +5540,7 @@ function FloatButtonGroup({
|
|
|
5266
5540
|
document.addEventListener("pointerdown", close);
|
|
5267
5541
|
return () => document.removeEventListener("pointerdown", close);
|
|
5268
5542
|
}, [trigger, visible, setVisible]);
|
|
5269
|
-
return /* @__PURE__ */ (0,
|
|
5543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GroupShape.Provider, { value: shape, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5270
5544
|
"div",
|
|
5271
5545
|
{
|
|
5272
5546
|
...withTitleTooltip(props),
|
|
@@ -5293,13 +5567,13 @@ function FloatButtonGroup({
|
|
|
5293
5567
|
}
|
|
5294
5568
|
},
|
|
5295
5569
|
children: [
|
|
5296
|
-
!trigger || visible ? /* @__PURE__ */ (0,
|
|
5297
|
-
trigger ? /* @__PURE__ */ (0,
|
|
5570
|
+
!trigger || visible ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { id, className: "sia-float-button-group__list", children }) : null,
|
|
5571
|
+
trigger ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5298
5572
|
FloatButtonRoot,
|
|
5299
5573
|
{
|
|
5300
5574
|
ref: triggerRef,
|
|
5301
5575
|
type,
|
|
5302
|
-
icon: visible ? closeIcon ?? /* @__PURE__ */ (0,
|
|
5576
|
+
icon: visible ? closeIcon ?? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "close", size: 20 }) : icon ?? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "plus", size: 20 }),
|
|
5303
5577
|
tooltip,
|
|
5304
5578
|
"aria-label": visible ? "\u6536\u8D77\u60AC\u6D6E\u83DC\u5355" : "\u5C55\u5F00\u60AC\u6D6E\u83DC\u5355",
|
|
5305
5579
|
"aria-expanded": visible,
|
|
@@ -5312,8 +5586,8 @@ function FloatButtonGroup({
|
|
|
5312
5586
|
) });
|
|
5313
5587
|
}
|
|
5314
5588
|
function FloatButtonBackTop({ target, visibilityHeight = 400, behavior = "smooth", onClick, icon, tooltip = "\u8FD4\u56DE\u9876\u90E8", ...props }) {
|
|
5315
|
-
const [visible, setVisible] = (0,
|
|
5316
|
-
(0,
|
|
5589
|
+
const [visible, setVisible] = (0, import_react28.useState)(false);
|
|
5590
|
+
(0, import_react28.useEffect)(() => {
|
|
5317
5591
|
const element = target ? target() : window;
|
|
5318
5592
|
if (!element) return;
|
|
5319
5593
|
const update = () => setVisible((element === window ? window.scrollY : element.scrollTop) >= visibilityHeight);
|
|
@@ -5322,7 +5596,7 @@ function FloatButtonBackTop({ target, visibilityHeight = 400, behavior = "smooth
|
|
|
5322
5596
|
return () => element.removeEventListener("scroll", update);
|
|
5323
5597
|
}, [target, visibilityHeight]);
|
|
5324
5598
|
if (!visible) return null;
|
|
5325
|
-
return /* @__PURE__ */ (0,
|
|
5599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FloatButtonRoot, { ...props, tooltip, icon: icon ?? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "arrow-up", size: 20 }), onClick: (event) => {
|
|
5326
5600
|
onClick?.(event);
|
|
5327
5601
|
if (event.defaultPrevented) return;
|
|
5328
5602
|
const element = target ? target() : window;
|