@sia.soul/sia-react-ui 0.1.17 → 0.1.18
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-MUTJVDM6.js → chunk-I3EF5SF2.js} +1 -1
- package/dist/{chunk-KJYKC5IV.js → chunk-JX53ZBIW.js} +2 -2
- package/dist/{chunk-VXSG4EAO.js → chunk-LPRFOSRZ.js} +1 -1
- package/dist/{chunk-ALWHRV4L.js → chunk-SUMXP2SF.js} +10 -5
- package/dist/{chunk-G47MREYI.js → chunk-UCQZZ2YC.js} +2 -2
- package/dist/core.cjs +10 -5
- package/dist/core.css +34 -5
- package/dist/core.js +3 -3
- package/dist/index.cjs +10 -5
- package/dist/index.css +34 -5
- package/dist/index.js +5 -5
- package/dist/rich-text-editor.cjs +10 -5
- package/dist/rich-text-editor.js +2 -2
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
Popover,
|
|
6
6
|
Tooltip,
|
|
7
7
|
useOverlayLifecycle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LPRFOSRZ.js";
|
|
9
9
|
import {
|
|
10
10
|
Dropdown,
|
|
11
11
|
Icon
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SUMXP2SF.js";
|
|
13
13
|
import {
|
|
14
14
|
Button
|
|
15
15
|
} from "./chunk-TZGUBGA4.js";
|
|
@@ -974,7 +974,8 @@ function MenuEntry({
|
|
|
974
974
|
item,
|
|
975
975
|
level,
|
|
976
976
|
parents,
|
|
977
|
-
props
|
|
977
|
+
props,
|
|
978
|
+
reserveIcon
|
|
978
979
|
}) {
|
|
979
980
|
const anchorRef = useRef2(null);
|
|
980
981
|
const closeTimerRef = useRef2(void 0);
|
|
@@ -1023,7 +1024,7 @@ function MenuEntry({
|
|
|
1023
1024
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
1024
1025
|
onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
|
|
1025
1026
|
children: [
|
|
1026
|
-
|
|
1027
|
+
reserveIcon ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
|
|
1027
1028
|
!collapsed ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__label", children: item.label }) : null,
|
|
1028
1029
|
!collapsed && item.extra ? /* @__PURE__ */ jsx4("span", { className: "sia-menu__extra", children: item.extra }) : null,
|
|
1029
1030
|
!collapsed && hasChildren ? /* @__PURE__ */ jsx4(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
|
|
@@ -1047,19 +1048,23 @@ function MenuEntry({
|
|
|
1047
1048
|
}
|
|
1048
1049
|
);
|
|
1049
1050
|
}
|
|
1051
|
+
function hasMenuIcon(items) {
|
|
1052
|
+
return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
|
|
1053
|
+
}
|
|
1050
1054
|
function MenuLevel({
|
|
1051
1055
|
items,
|
|
1052
1056
|
level,
|
|
1053
1057
|
parents,
|
|
1054
|
-
props
|
|
1058
|
+
props,
|
|
1059
|
+
reserveIcon = hasMenuIcon(items)
|
|
1055
1060
|
}) {
|
|
1056
1061
|
return /* @__PURE__ */ jsx4(Fragment3, { children: items.map((item, index) => {
|
|
1057
1062
|
if (item.type === "divider") return /* @__PURE__ */ jsx4("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
|
|
1058
1063
|
if (item.type === "group") return /* @__PURE__ */ jsxs3("li", { className: "sia-menu__group", children: [
|
|
1059
1064
|
/* @__PURE__ */ jsx4("div", { className: "sia-menu__group-title", children: item.label }),
|
|
1060
|
-
/* @__PURE__ */ jsx4("ul", { role: "group", children: /* @__PURE__ */ jsx4(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props }) })
|
|
1065
|
+
/* @__PURE__ */ jsx4("ul", { role: "group", children: /* @__PURE__ */ jsx4(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
|
|
1061
1066
|
] }, item.key);
|
|
1062
|
-
return /* @__PURE__ */ jsx4(MenuEntry, { item, level, parents, props }, item.key);
|
|
1067
|
+
return /* @__PURE__ */ jsx4(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
1063
1068
|
}) });
|
|
1064
1069
|
}
|
|
1065
1070
|
function Menu({
|
package/dist/core.cjs
CHANGED
|
@@ -1188,7 +1188,8 @@ function MenuEntry({
|
|
|
1188
1188
|
item,
|
|
1189
1189
|
level,
|
|
1190
1190
|
parents,
|
|
1191
|
-
props
|
|
1191
|
+
props,
|
|
1192
|
+
reserveIcon
|
|
1192
1193
|
}) {
|
|
1193
1194
|
const anchorRef = (0, import_react6.useRef)(null);
|
|
1194
1195
|
const closeTimerRef = (0, import_react6.useRef)(void 0);
|
|
@@ -1237,7 +1238,7 @@ function MenuEntry({
|
|
|
1237
1238
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
1238
1239
|
onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
|
|
1239
1240
|
children: [
|
|
1240
|
-
|
|
1241
|
+
reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
|
|
1241
1242
|
!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
|
|
1242
1243
|
!collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
|
|
1243
1244
|
!collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
|
|
@@ -1261,19 +1262,23 @@ function MenuEntry({
|
|
|
1261
1262
|
}
|
|
1262
1263
|
);
|
|
1263
1264
|
}
|
|
1265
|
+
function hasMenuIcon(items) {
|
|
1266
|
+
return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
|
|
1267
|
+
}
|
|
1264
1268
|
function MenuLevel({
|
|
1265
1269
|
items,
|
|
1266
1270
|
level,
|
|
1267
1271
|
parents,
|
|
1268
|
-
props
|
|
1272
|
+
props,
|
|
1273
|
+
reserveIcon = hasMenuIcon(items)
|
|
1269
1274
|
}) {
|
|
1270
1275
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: items.map((item, index) => {
|
|
1271
1276
|
if (item.type === "divider") return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
|
|
1272
1277
|
if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { className: "sia-menu__group", children: [
|
|
1273
1278
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "sia-menu__group-title", children: item.label }),
|
|
1274
|
-
/* @__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 }) })
|
|
1279
|
+
/* @__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 }) })
|
|
1275
1280
|
] }, item.key);
|
|
1276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuEntry, { item, level, parents, props }, item.key);
|
|
1281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
1277
1282
|
}) });
|
|
1278
1283
|
}
|
|
1279
1284
|
function Menu({
|
package/dist/core.css
CHANGED
|
@@ -484,27 +484,47 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
484
484
|
position: absolute;
|
|
485
485
|
box-sizing: border-box;
|
|
486
486
|
cursor: default;
|
|
487
|
+
touch-action: none;
|
|
488
|
+
}
|
|
489
|
+
.sia-floating-scrollbar__thumb::before {
|
|
490
|
+
content: none;
|
|
491
|
+
}
|
|
492
|
+
.sia-floating-scrollbar__thumb::after {
|
|
493
|
+
content: "";
|
|
494
|
+
position: absolute;
|
|
495
|
+
right: 0;
|
|
496
|
+
bottom: 0;
|
|
497
|
+
box-sizing: border-box;
|
|
498
|
+
pointer-events: none;
|
|
487
499
|
background: var(--sia-scrollbar-thumb);
|
|
488
500
|
border: 1px solid rgb(255 255 255 / 24%);
|
|
489
501
|
border-radius: 999px;
|
|
490
502
|
box-shadow: 0 1px 1px rgb(0 0 0 / 24%);
|
|
491
|
-
|
|
492
|
-
|
|
503
|
+
transition:
|
|
504
|
+
background-color 120ms ease,
|
|
505
|
+
width 150ms ease,
|
|
506
|
+
height 150ms ease;
|
|
493
507
|
}
|
|
494
|
-
.sia-floating-scrollbar__thumb:hover {
|
|
508
|
+
.sia-floating-scrollbar__thumb:hover::after {
|
|
495
509
|
background: var(--sia-scrollbar-thumb-hover);
|
|
496
510
|
}
|
|
497
511
|
.sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb {
|
|
498
512
|
bottom: 0;
|
|
499
513
|
left: 0;
|
|
514
|
+
height: 100%;
|
|
515
|
+
}
|
|
516
|
+
.sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb::after {
|
|
517
|
+
width: 100%;
|
|
500
518
|
height: var(--sia-scrollbar-size);
|
|
501
|
-
transition: background-color 120ms ease, height 150ms ease;
|
|
502
519
|
}
|
|
503
520
|
.sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb {
|
|
504
521
|
top: 0;
|
|
505
522
|
right: 0;
|
|
523
|
+
width: 100%;
|
|
524
|
+
}
|
|
525
|
+
.sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb::after {
|
|
506
526
|
width: var(--sia-scrollbar-size);
|
|
507
|
-
|
|
527
|
+
height: 100%;
|
|
508
528
|
}
|
|
509
529
|
.sia-button,
|
|
510
530
|
.sia-input,
|
|
@@ -7133,6 +7153,15 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
7133
7153
|
display: inline-flex;
|
|
7134
7154
|
flex: 0 0 auto;
|
|
7135
7155
|
}
|
|
7156
|
+
.sia-menu__icon {
|
|
7157
|
+
justify-content: center;
|
|
7158
|
+
align-items: center;
|
|
7159
|
+
width: var(--sia-menu-icon-size, 16px);
|
|
7160
|
+
flex-basis: var(--sia-menu-icon-size, 16px);
|
|
7161
|
+
}
|
|
7162
|
+
.sia-menu__icon > * {
|
|
7163
|
+
max-width: 100%;
|
|
7164
|
+
}
|
|
7136
7165
|
.sia-menu__extra {
|
|
7137
7166
|
color: var(--sia-color-text-secondary);
|
|
7138
7167
|
font-size: 12px;
|
package/dist/core.js
CHANGED
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
Typography,
|
|
10
10
|
Upload,
|
|
11
11
|
message
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JX53ZBIW.js";
|
|
13
13
|
import "./chunk-YT6E3X2K.js";
|
|
14
14
|
import {
|
|
15
15
|
Modal,
|
|
16
16
|
Select
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LPRFOSRZ.js";
|
|
18
18
|
import {
|
|
19
19
|
Icon,
|
|
20
20
|
Input,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SUMXP2SF.js";
|
|
23
23
|
import {
|
|
24
24
|
Button
|
|
25
25
|
} from "./chunk-TZGUBGA4.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1222,7 +1222,8 @@ function MenuEntry({
|
|
|
1222
1222
|
item,
|
|
1223
1223
|
level,
|
|
1224
1224
|
parents,
|
|
1225
|
-
props
|
|
1225
|
+
props,
|
|
1226
|
+
reserveIcon
|
|
1226
1227
|
}) {
|
|
1227
1228
|
const anchorRef = (0, import_react5.useRef)(null);
|
|
1228
1229
|
const closeTimerRef = (0, import_react5.useRef)(void 0);
|
|
@@ -1271,7 +1272,7 @@ function MenuEntry({
|
|
|
1271
1272
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
1272
1273
|
onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
|
|
1273
1274
|
children: [
|
|
1274
|
-
|
|
1275
|
+
reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
|
|
1275
1276
|
!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
|
|
1276
1277
|
!collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
|
|
1277
1278
|
!collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
|
|
@@ -1295,19 +1296,23 @@ function MenuEntry({
|
|
|
1295
1296
|
}
|
|
1296
1297
|
);
|
|
1297
1298
|
}
|
|
1299
|
+
function hasMenuIcon(items) {
|
|
1300
|
+
return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
|
|
1301
|
+
}
|
|
1298
1302
|
function MenuLevel({
|
|
1299
1303
|
items,
|
|
1300
1304
|
level,
|
|
1301
1305
|
parents,
|
|
1302
|
-
props
|
|
1306
|
+
props,
|
|
1307
|
+
reserveIcon = hasMenuIcon(items)
|
|
1303
1308
|
}) {
|
|
1304
1309
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: items.map((item, index) => {
|
|
1305
1310
|
if (item.type === "divider") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
|
|
1306
1311
|
if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "sia-menu__group", children: [
|
|
1307
1312
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "sia-menu__group-title", children: item.label }),
|
|
1308
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props }) })
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
|
|
1309
1314
|
] }, item.key);
|
|
1310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MenuEntry, { item, level, parents, props }, item.key);
|
|
1315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
1311
1316
|
}) });
|
|
1312
1317
|
}
|
|
1313
1318
|
function Menu({
|
package/dist/index.css
CHANGED
|
@@ -484,27 +484,47 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
484
484
|
position: absolute;
|
|
485
485
|
box-sizing: border-box;
|
|
486
486
|
cursor: default;
|
|
487
|
+
touch-action: none;
|
|
488
|
+
}
|
|
489
|
+
.sia-floating-scrollbar__thumb::before {
|
|
490
|
+
content: none;
|
|
491
|
+
}
|
|
492
|
+
.sia-floating-scrollbar__thumb::after {
|
|
493
|
+
content: "";
|
|
494
|
+
position: absolute;
|
|
495
|
+
right: 0;
|
|
496
|
+
bottom: 0;
|
|
497
|
+
box-sizing: border-box;
|
|
498
|
+
pointer-events: none;
|
|
487
499
|
background: var(--sia-scrollbar-thumb);
|
|
488
500
|
border: 1px solid rgb(255 255 255 / 24%);
|
|
489
501
|
border-radius: 999px;
|
|
490
502
|
box-shadow: 0 1px 1px rgb(0 0 0 / 24%);
|
|
491
|
-
|
|
492
|
-
|
|
503
|
+
transition:
|
|
504
|
+
background-color 120ms ease,
|
|
505
|
+
width 150ms ease,
|
|
506
|
+
height 150ms ease;
|
|
493
507
|
}
|
|
494
|
-
.sia-floating-scrollbar__thumb:hover {
|
|
508
|
+
.sia-floating-scrollbar__thumb:hover::after {
|
|
495
509
|
background: var(--sia-scrollbar-thumb-hover);
|
|
496
510
|
}
|
|
497
511
|
.sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb {
|
|
498
512
|
bottom: 0;
|
|
499
513
|
left: 0;
|
|
514
|
+
height: 100%;
|
|
515
|
+
}
|
|
516
|
+
.sia-floating-scrollbar--horizontal .sia-floating-scrollbar__thumb::after {
|
|
517
|
+
width: 100%;
|
|
500
518
|
height: var(--sia-scrollbar-size);
|
|
501
|
-
transition: background-color 120ms ease, height 150ms ease;
|
|
502
519
|
}
|
|
503
520
|
.sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb {
|
|
504
521
|
top: 0;
|
|
505
522
|
right: 0;
|
|
523
|
+
width: 100%;
|
|
524
|
+
}
|
|
525
|
+
.sia-floating-scrollbar--vertical .sia-floating-scrollbar__thumb::after {
|
|
506
526
|
width: var(--sia-scrollbar-size);
|
|
507
|
-
|
|
527
|
+
height: 100%;
|
|
508
528
|
}
|
|
509
529
|
.sia-button,
|
|
510
530
|
.sia-input,
|
|
@@ -7133,6 +7153,15 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
7133
7153
|
display: inline-flex;
|
|
7134
7154
|
flex: 0 0 auto;
|
|
7135
7155
|
}
|
|
7156
|
+
.sia-menu__icon {
|
|
7157
|
+
justify-content: center;
|
|
7158
|
+
align-items: center;
|
|
7159
|
+
width: var(--sia-menu-icon-size, 16px);
|
|
7160
|
+
flex-basis: var(--sia-menu-icon-size, 16px);
|
|
7161
|
+
}
|
|
7162
|
+
.sia-menu__icon > * {
|
|
7163
|
+
max-width: 100%;
|
|
7164
|
+
}
|
|
7136
7165
|
.sia-menu__extra {
|
|
7137
7166
|
color: var(--sia-color-text-secondary);
|
|
7138
7167
|
font-size: 12px;
|
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
Watermark,
|
|
80
80
|
message,
|
|
81
81
|
notification
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-JX53ZBIW.js";
|
|
83
83
|
import {
|
|
84
84
|
TextArea
|
|
85
85
|
} from "./chunk-YT6E3X2K.js";
|
|
@@ -89,12 +89,12 @@ import {
|
|
|
89
89
|
import {
|
|
90
90
|
RichTextContent,
|
|
91
91
|
RichTextEditor
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-I3EF5SF2.js";
|
|
93
93
|
import {
|
|
94
94
|
DatePicker,
|
|
95
95
|
SelectDateRange,
|
|
96
96
|
TimePanel
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-UCQZZ2YC.js";
|
|
98
98
|
import {
|
|
99
99
|
Checkbox,
|
|
100
100
|
FloatingScrollbarProvider,
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
Tree,
|
|
110
110
|
useOverlayLifecycle,
|
|
111
111
|
useScrollbarProximity
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-LPRFOSRZ.js";
|
|
113
113
|
import {
|
|
114
114
|
Dropdown,
|
|
115
115
|
FILLED_ICON_NAMES,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
PopupPortal,
|
|
121
121
|
Segmented,
|
|
122
122
|
Steps
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-SUMXP2SF.js";
|
|
124
124
|
import {
|
|
125
125
|
Button
|
|
126
126
|
} from "./chunk-TZGUBGA4.js";
|
|
@@ -1112,7 +1112,8 @@ function MenuEntry({
|
|
|
1112
1112
|
item,
|
|
1113
1113
|
level,
|
|
1114
1114
|
parents,
|
|
1115
|
-
props
|
|
1115
|
+
props,
|
|
1116
|
+
reserveIcon
|
|
1116
1117
|
}) {
|
|
1117
1118
|
const anchorRef = (0, import_react5.useRef)(null);
|
|
1118
1119
|
const closeTimerRef = (0, import_react5.useRef)(void 0);
|
|
@@ -1161,7 +1162,7 @@ function MenuEntry({
|
|
|
1161
1162
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
1162
1163
|
onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
|
|
1163
1164
|
children: [
|
|
1164
|
-
|
|
1165
|
+
reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
|
|
1165
1166
|
!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
|
|
1166
1167
|
!collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
|
|
1167
1168
|
!collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
|
|
@@ -1185,19 +1186,23 @@ function MenuEntry({
|
|
|
1185
1186
|
}
|
|
1186
1187
|
);
|
|
1187
1188
|
}
|
|
1189
|
+
function hasMenuIcon(items) {
|
|
1190
|
+
return items.some((item) => item.type === "group" ? hasMenuIcon(item.children ?? []) : item.type !== "divider" && Boolean(item.icon));
|
|
1191
|
+
}
|
|
1188
1192
|
function MenuLevel({
|
|
1189
1193
|
items,
|
|
1190
1194
|
level,
|
|
1191
1195
|
parents,
|
|
1192
|
-
props
|
|
1196
|
+
props,
|
|
1197
|
+
reserveIcon = hasMenuIcon(items)
|
|
1193
1198
|
}) {
|
|
1194
1199
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: items.map((item, index) => {
|
|
1195
1200
|
if (item.type === "divider") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { className: "sia-menu__divider", role: "separator" }, item.key || `divider-${index}`);
|
|
1196
1201
|
if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "sia-menu__group", children: [
|
|
1197
1202
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sia-menu__group-title", children: item.label }),
|
|
1198
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props }) })
|
|
1203
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { role: "group", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [...parents, item.key], props, reserveIcon }) })
|
|
1199
1204
|
] }, item.key);
|
|
1200
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuEntry, { item, level, parents, props }, item.key);
|
|
1205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
1201
1206
|
}) });
|
|
1202
1207
|
}
|
|
1203
1208
|
function Menu({
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-UCQZZ2YC.js";
|
|
4
|
+
import "./chunk-LPRFOSRZ.js";
|
|
5
|
+
import "./chunk-SUMXP2SF.js";
|
|
6
6
|
import "./chunk-TZGUBGA4.js";
|
|
7
7
|
import "./chunk-3VJ4CZDQ.js";
|
|
8
8
|
export {
|