sellmate-design-system-react 9.0.0-beta.55 → 9.0.0-beta.57
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/AGENTS.md +125 -26
- package/dist/components/SIcon/icons.gen.d.ts +5 -0
- package/dist/components/STable/README.md +16 -0
- package/dist/components/STable/STable.d.ts +45 -0
- package/dist/components/STag/README.md +1 -0
- package/dist/components/STag/tag.config.d.ts +1 -1
- package/dist/index.cjs +591 -89
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +590 -88
- package/dist/index.js.map +1 -1
- package/dist/lib/date.d.ts +2 -1
- package/dist/lib/global-overlay.d.ts +5 -0
- package/dist/lib/inert.d.ts +11 -0
- package/dist/llms-full.txt +157 -26
- package/dist/llms.txt +140 -26
- package/dist/styles.css +59 -4
- package/dist/theme.css +41 -0
- package/eslint/scale.gen.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ var reactDom = require('react-dom');
|
|
|
10
10
|
var RCheckbox = require('@radix-ui/react-checkbox');
|
|
11
11
|
var client = require('react-dom/client');
|
|
12
12
|
var RTooltip = require('@radix-ui/react-tooltip');
|
|
13
|
-
var
|
|
13
|
+
var RDropdown3 = require('@radix-ui/react-dropdown-menu');
|
|
14
14
|
var RSwitch = require('@radix-ui/react-switch');
|
|
15
15
|
var RDialog = require('@radix-ui/react-dialog');
|
|
16
16
|
var Ariakit = require('@ariakit/react');
|
|
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
|
|
|
36
36
|
var RPopover12__namespace = /*#__PURE__*/_interopNamespace(RPopover12);
|
|
37
37
|
var RCheckbox__namespace = /*#__PURE__*/_interopNamespace(RCheckbox);
|
|
38
38
|
var RTooltip__namespace = /*#__PURE__*/_interopNamespace(RTooltip);
|
|
39
|
-
var
|
|
39
|
+
var RDropdown3__namespace = /*#__PURE__*/_interopNamespace(RDropdown3);
|
|
40
40
|
var RSwitch__namespace = /*#__PURE__*/_interopNamespace(RSwitch);
|
|
41
41
|
var RDialog__namespace = /*#__PURE__*/_interopNamespace(RDialog);
|
|
42
42
|
var Ariakit__namespace = /*#__PURE__*/_interopNamespace(Ariakit);
|
|
@@ -371,6 +371,43 @@ var Icon_alert = (p) => {
|
|
|
371
371
|
}
|
|
372
372
|
);
|
|
373
373
|
};
|
|
374
|
+
var Icon_alignCenter = (p) => {
|
|
375
|
+
const { size = 24, ...rest } = p;
|
|
376
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
377
|
+
"svg",
|
|
378
|
+
{
|
|
379
|
+
width: size,
|
|
380
|
+
height: size,
|
|
381
|
+
viewBox: "0 0 24 24",
|
|
382
|
+
fill: "none",
|
|
383
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
384
|
+
...rest,
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
387
|
+
"path",
|
|
388
|
+
{
|
|
389
|
+
d: "M20 16.25C20.4142 16.25 20.75 16.5858 20.75 17C20.75 17.4142 20.4142 17.75 20 17.75H4C3.58579 17.75 3.25 17.4142 3.25 17C3.25 16.5858 3.58579 16.25 4 16.25H20Z",
|
|
390
|
+
fill: "currentColor"
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
+
"path",
|
|
395
|
+
{
|
|
396
|
+
d: "M16 11.25C16.4142 11.25 16.75 11.5858 16.75 12C16.75 12.4142 16.4142 12.75 16 12.75H7C6.58579 12.75 6.25 12.4142 6.25 12C6.25 11.5858 6.58579 11.25 7 11.25H16Z",
|
|
397
|
+
fill: "currentColor"
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
401
|
+
"path",
|
|
402
|
+
{
|
|
403
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
404
|
+
fill: "currentColor"
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
};
|
|
374
411
|
var Icon_alignKorean = (p) => {
|
|
375
412
|
const { size = 24, ...rest } = p;
|
|
376
413
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -410,6 +447,147 @@ var Icon_alignKorean = (p) => {
|
|
|
410
447
|
}
|
|
411
448
|
);
|
|
412
449
|
};
|
|
450
|
+
var Icon_alignLeft = (p) => {
|
|
451
|
+
const { size = 24, ...rest } = p;
|
|
452
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
453
|
+
"svg",
|
|
454
|
+
{
|
|
455
|
+
width: size,
|
|
456
|
+
height: size,
|
|
457
|
+
viewBox: "0 0 24 24",
|
|
458
|
+
fill: "none",
|
|
459
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
460
|
+
...rest,
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
463
|
+
"path",
|
|
464
|
+
{
|
|
465
|
+
d: "M19 16.25C19.4142 16.25 19.75 16.5858 19.75 17C19.75 17.4142 19.4142 17.75 19 17.75H3C2.58579 17.75 2.25 17.4142 2.25 17C2.25 16.5858 2.58579 16.25 3 16.25H19Z",
|
|
466
|
+
fill: "currentColor"
|
|
467
|
+
}
|
|
468
|
+
),
|
|
469
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
470
|
+
"path",
|
|
471
|
+
{
|
|
472
|
+
d: "M12 11.25C12.4142 11.25 12.75 11.5858 12.75 12C12.75 12.4142 12.4142 12.75 12 12.75H3C2.58579 12.75 2.25 12.4142 2.25 12C2.25 11.5858 2.58579 11.25 3 11.25H12Z",
|
|
473
|
+
fill: "currentColor"
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
477
|
+
"path",
|
|
478
|
+
{
|
|
479
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
480
|
+
fill: "currentColor"
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
};
|
|
487
|
+
var Icon_alignMiddle = (p) => {
|
|
488
|
+
const { size = 24, ...rest } = p;
|
|
489
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
490
|
+
"svg",
|
|
491
|
+
{
|
|
492
|
+
width: size,
|
|
493
|
+
height: size,
|
|
494
|
+
viewBox: "0 0 24 24",
|
|
495
|
+
fill: "none",
|
|
496
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
497
|
+
...rest,
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M11.4844 13.9551C11.7735 13.6819 12.2265 13.6819 12.5156 13.9551L15.5156 16.79C15.8165 17.0746 15.8294 17.5496 15.5449 17.8506C15.2604 18.1515 14.7854 18.1653 14.4844 17.8809L12.75 16.2422V20.5C12.75 20.9142 12.4142 21.25 12 21.25C11.5858 21.25 11.25 20.9142 11.25 20.5V16.2422L9.51562 17.8809C9.21463 18.1653 8.73961 18.1515 8.45508 17.8506C8.17061 17.5496 8.18347 17.0746 8.48438 16.79L11.4844 13.9551Z",
|
|
503
|
+
fill: "currentColor"
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
507
|
+
"path",
|
|
508
|
+
{
|
|
509
|
+
d: "M21.2002 11.25C21.6142 11.2502 21.9502 11.5859 21.9502 12C21.9502 12.4141 21.6142 12.7498 21.2002 12.75H2.7998C2.38568 12.7499 2.0498 12.4142 2.0498 12C2.0498 11.5858 2.38568 11.2501 2.7998 11.25H21.2002Z",
|
|
510
|
+
fill: "currentColor"
|
|
511
|
+
}
|
|
512
|
+
),
|
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
514
|
+
"path",
|
|
515
|
+
{
|
|
516
|
+
d: "M12 2.75C12.4142 2.75 12.75 3.08579 12.75 3.5V7.75781L14.4844 6.11914C14.7854 5.83467 15.2604 5.8485 15.5449 6.14941C15.8294 6.45041 15.8165 6.92543 15.5156 7.20996L12.5156 10.0449C12.2265 10.3182 11.7735 10.3182 11.4844 10.0449L8.48438 7.20996C8.18347 6.92543 8.17061 6.45041 8.45508 6.14941C8.73961 5.8485 9.21463 5.83467 9.51562 6.11914L11.25 7.75781V3.5C11.25 3.08579 11.5858 2.75 12 2.75Z",
|
|
517
|
+
fill: "currentColor"
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
};
|
|
524
|
+
var Icon_alignRight = (p) => {
|
|
525
|
+
const { size = 24, ...rest } = p;
|
|
526
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
527
|
+
"svg",
|
|
528
|
+
{
|
|
529
|
+
width: size,
|
|
530
|
+
height: size,
|
|
531
|
+
viewBox: "0 0 24 24",
|
|
532
|
+
fill: "none",
|
|
533
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
534
|
+
...rest,
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
537
|
+
"path",
|
|
538
|
+
{
|
|
539
|
+
d: "M21 16.25C21.4142 16.25 21.75 16.5858 21.75 17C21.75 17.4142 21.4142 17.75 21 17.75H5C4.58579 17.75 4.25 17.4142 4.25 17C4.25 16.5858 4.58579 16.25 5 16.25H21Z",
|
|
540
|
+
fill: "currentColor"
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
544
|
+
"path",
|
|
545
|
+
{
|
|
546
|
+
d: "M21 11.25C21.4142 11.25 21.75 11.5858 21.75 12C21.75 12.4142 21.4142 12.75 21 12.75H12C11.5858 12.75 11.25 12.4142 11.25 12C11.25 11.5858 11.5858 11.25 12 11.25H21Z",
|
|
547
|
+
fill: "currentColor"
|
|
548
|
+
}
|
|
549
|
+
),
|
|
550
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
551
|
+
"path",
|
|
552
|
+
{
|
|
553
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
554
|
+
fill: "currentColor"
|
|
555
|
+
}
|
|
556
|
+
)
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
};
|
|
561
|
+
var Icon_alignTop = (p) => {
|
|
562
|
+
const { size = 24, ...rest } = p;
|
|
563
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
564
|
+
"svg",
|
|
565
|
+
{
|
|
566
|
+
width: size,
|
|
567
|
+
height: size,
|
|
568
|
+
viewBox: "0 0 24 24",
|
|
569
|
+
fill: "none",
|
|
570
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
571
|
+
...rest,
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
574
|
+
"path",
|
|
575
|
+
{
|
|
576
|
+
d: "M12 6.1499C12.2017 6.1499 12.3951 6.23132 12.5361 6.37549L18.5361 12.519C18.8254 12.8153 18.8204 13.2901 18.5244 13.5796C18.2281 13.869 17.7533 13.8631 17.4639 13.5669L12.75 8.7417V19.8999C12.75 20.3141 12.4142 20.6499 12 20.6499C11.5858 20.6499 11.25 20.3141 11.25 19.8999V8.7417L6.53613 13.5669C6.24671 13.8631 5.77189 13.869 5.47559 13.5796C5.1796 13.2901 5.17456 12.8153 5.46387 12.519L11.4639 6.37549C11.6049 6.23132 11.7983 6.1499 12 6.1499Z",
|
|
577
|
+
fill: "currentColor"
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
581
|
+
"path",
|
|
582
|
+
{
|
|
583
|
+
d: "M21.2002 3.24951C21.6142 3.24972 21.9502 3.58641 21.9502 4.00049C21.9499 4.41435 21.6141 4.75028 21.2002 4.75049H2.7998C2.38584 4.75039 2.05007 4.41442 2.0498 4.00049C2.0498 3.58634 2.38568 3.24961 2.7998 3.24951H21.2002Z",
|
|
584
|
+
fill: "currentColor"
|
|
585
|
+
}
|
|
586
|
+
)
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
};
|
|
413
591
|
var Icon_archive = (p) => {
|
|
414
592
|
const { size = 24, ...rest } = p;
|
|
415
593
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3428,7 +3606,12 @@ var ICONS = {
|
|
|
3428
3606
|
account: Icon_account,
|
|
3429
3607
|
add: Icon_add,
|
|
3430
3608
|
alert: Icon_alert,
|
|
3609
|
+
alignCenter: Icon_alignCenter,
|
|
3431
3610
|
alignKorean: Icon_alignKorean,
|
|
3611
|
+
alignLeft: Icon_alignLeft,
|
|
3612
|
+
alignMiddle: Icon_alignMiddle,
|
|
3613
|
+
alignRight: Icon_alignRight,
|
|
3614
|
+
alignTop: Icon_alignTop,
|
|
3432
3615
|
archive: Icon_archive,
|
|
3433
3616
|
arrowDown: Icon_arrowDown,
|
|
3434
3617
|
arrowLeft: Icon_arrowLeft,
|
|
@@ -4071,7 +4254,8 @@ var TAG_COLORS = [
|
|
|
4071
4254
|
"green",
|
|
4072
4255
|
"blue",
|
|
4073
4256
|
"darkblue",
|
|
4074
|
-
"indigo"
|
|
4257
|
+
"indigo",
|
|
4258
|
+
"purple"
|
|
4075
4259
|
];
|
|
4076
4260
|
var TAG_SIZE_CONFIG = {
|
|
4077
4261
|
xs: {
|
|
@@ -6193,6 +6377,13 @@ function SDraggableListInner({
|
|
|
6193
6377
|
);
|
|
6194
6378
|
}
|
|
6195
6379
|
var SDraggableList = /* @__PURE__ */ react.forwardRef(SDraggableListInner);
|
|
6380
|
+
function useInertRef(inert) {
|
|
6381
|
+
const ref = react.useRef(null);
|
|
6382
|
+
react.useEffect(() => {
|
|
6383
|
+
ref.current?.toggleAttribute("inert", inert);
|
|
6384
|
+
}, [inert]);
|
|
6385
|
+
return ref;
|
|
6386
|
+
}
|
|
6196
6387
|
var SExpansionItemDescendantContext = /* @__PURE__ */ react.createContext(
|
|
6197
6388
|
null
|
|
6198
6389
|
);
|
|
@@ -6224,6 +6415,7 @@ var SExpansionItem = /* @__PURE__ */ react.forwardRef(
|
|
|
6224
6415
|
const [hovered, setHovered] = react.useState(false);
|
|
6225
6416
|
const parentDescendantContext = react.useContext(SExpansionItemDescendantContext);
|
|
6226
6417
|
const isExpanded = expanded ?? internalExpanded;
|
|
6418
|
+
const bodyRef = useInertRef(!isExpanded);
|
|
6227
6419
|
const isSelected = isExpanded && (selected || expandedDescendantCount === 0);
|
|
6228
6420
|
const hasChevronInteraction = interaction === "chevron";
|
|
6229
6421
|
const showInteractionChevron = hasChevronInteraction && !disabled && (isSelected || hovered);
|
|
@@ -6347,6 +6539,7 @@ var SExpansionItem = /* @__PURE__ */ react.forwardRef(
|
|
|
6347
6539
|
"div",
|
|
6348
6540
|
{
|
|
6349
6541
|
id,
|
|
6542
|
+
ref: bodyRef,
|
|
6350
6543
|
"aria-hidden": !isExpanded,
|
|
6351
6544
|
className: cn(
|
|
6352
6545
|
"grid overflow-hidden bg-(--cmp-listExpansionItem-body-bg) transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
@@ -6792,11 +6985,29 @@ function TreeConnector({
|
|
|
6792
6985
|
] })
|
|
6793
6986
|
] });
|
|
6794
6987
|
}
|
|
6988
|
+
function TreeBranch({ expanded, children }) {
|
|
6989
|
+
const branchRef = useInertRef(!expanded);
|
|
6990
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6991
|
+
"div",
|
|
6992
|
+
{
|
|
6993
|
+
ref: branchRef,
|
|
6994
|
+
"aria-hidden": !expanded,
|
|
6995
|
+
className: cn(
|
|
6996
|
+
"grid w-full overflow-hidden transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
6997
|
+
expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
6998
|
+
),
|
|
6999
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 overflow-hidden", children })
|
|
7000
|
+
}
|
|
7001
|
+
);
|
|
7002
|
+
}
|
|
6795
7003
|
function STreeAllItem({
|
|
6796
7004
|
selected,
|
|
6797
7005
|
indeterminate,
|
|
6798
7006
|
border,
|
|
6799
7007
|
size,
|
|
7008
|
+
rowId,
|
|
7009
|
+
tabIndex,
|
|
7010
|
+
onKeyDown,
|
|
6800
7011
|
onSelect
|
|
6801
7012
|
}) {
|
|
6802
7013
|
const checkboxValue = indeterminate ? null : selected;
|
|
@@ -6808,6 +7019,9 @@ function STreeAllItem({
|
|
|
6808
7019
|
role: "treeitem",
|
|
6809
7020
|
"aria-level": 1,
|
|
6810
7021
|
"aria-selected": selected,
|
|
7022
|
+
"data-tree-row": rowId,
|
|
7023
|
+
tabIndex,
|
|
7024
|
+
onKeyDown,
|
|
6811
7025
|
onClick: onSelect,
|
|
6812
7026
|
className: cn(
|
|
6813
7027
|
"group/tree-item box-border flex w-full cursor-pointer items-center overflow-hidden bg-(--cmp-tree-item-bg-default) px-(--cmp-tree-item-paddingX) text-left hover:bg-(--cmp-tree-item-bg-hover)",
|
|
@@ -6993,6 +7207,34 @@ var STreeImpl = /* @__PURE__ */ react.forwardRef(function STree({
|
|
|
6993
7207
|
const someSelected = selectableIds.some((id) => selectedSet.has(id));
|
|
6994
7208
|
const allIndeterminate = someSelected && !allSelected;
|
|
6995
7209
|
const showAllItem = selectable && showSelectAll;
|
|
7210
|
+
const visibleRows = react.useMemo(() => {
|
|
7211
|
+
const rows = [];
|
|
7212
|
+
if (showAllItem) {
|
|
7213
|
+
rows.push({ id: TREE_ALL_NODE.id, node: TREE_ALL_NODE, parentId: null, expanded: false });
|
|
7214
|
+
}
|
|
7215
|
+
const walk = (nodes, parentId) => {
|
|
7216
|
+
nodes.forEach((node) => {
|
|
7217
|
+
const expanded = !!node.children?.length && expandedSet.has(node.id);
|
|
7218
|
+
rows.push({ id: node.id, node, parentId, expanded });
|
|
7219
|
+
if (expanded) walk(node.children, node.id);
|
|
7220
|
+
});
|
|
7221
|
+
};
|
|
7222
|
+
walk(items, null);
|
|
7223
|
+
return rows;
|
|
7224
|
+
}, [items, expandedSet, showAllItem]);
|
|
7225
|
+
const [focusedId, setFocusedId] = react.useState(null);
|
|
7226
|
+
const activeRowId = focusedId != null && visibleRows.some((row) => row.id === focusedId) ? focusedId : visibleRows[0]?.id ?? null;
|
|
7227
|
+
const treeRef = react.useRef(null);
|
|
7228
|
+
const focusRow = (id) => {
|
|
7229
|
+
setFocusedId(id);
|
|
7230
|
+
const rows = treeRef.current?.querySelectorAll("[data-tree-row]") ?? [];
|
|
7231
|
+
for (const row of rows) {
|
|
7232
|
+
if (row.dataset.treeRow === id) {
|
|
7233
|
+
row.focus();
|
|
7234
|
+
return;
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7237
|
+
};
|
|
6996
7238
|
const updateExpanded = (node) => {
|
|
6997
7239
|
const next = new Set(currentExpandedIds);
|
|
6998
7240
|
if (next.has(node.id)) next.delete(node.id);
|
|
@@ -7026,6 +7268,59 @@ var STreeImpl = /* @__PURE__ */ react.forwardRef(function STree({
|
|
|
7026
7268
|
if (value === void 0) setInternalValue(orderedIds);
|
|
7027
7269
|
onValueChange?.(orderedIds, TREE_ALL_NODE);
|
|
7028
7270
|
};
|
|
7271
|
+
const handleTreeKeyDown = (event) => {
|
|
7272
|
+
const target = event.target;
|
|
7273
|
+
const rowId = target.dataset?.treeRow;
|
|
7274
|
+
if (rowId == null) return;
|
|
7275
|
+
const index = visibleRows.findIndex((row2) => row2.id === rowId);
|
|
7276
|
+
if (index < 0) return;
|
|
7277
|
+
const row = visibleRows[index];
|
|
7278
|
+
const hasChildren = !!row.node.children?.length;
|
|
7279
|
+
switch (event.key) {
|
|
7280
|
+
case "ArrowDown": {
|
|
7281
|
+
const next = visibleRows[index + 1];
|
|
7282
|
+
if (next) focusRow(next.id);
|
|
7283
|
+
break;
|
|
7284
|
+
}
|
|
7285
|
+
case "ArrowUp": {
|
|
7286
|
+
const prev = visibleRows[index - 1];
|
|
7287
|
+
if (prev) focusRow(prev.id);
|
|
7288
|
+
break;
|
|
7289
|
+
}
|
|
7290
|
+
case "ArrowRight": {
|
|
7291
|
+
if (!hasChildren || row.node.disabled) return;
|
|
7292
|
+
if (!row.expanded) updateExpanded(row.node);
|
|
7293
|
+
else if (visibleRows[index + 1]) focusRow(visibleRows[index + 1].id);
|
|
7294
|
+
break;
|
|
7295
|
+
}
|
|
7296
|
+
case "ArrowLeft": {
|
|
7297
|
+
if (hasChildren && row.expanded && !row.node.disabled) updateExpanded(row.node);
|
|
7298
|
+
else if (row.parentId != null) focusRow(row.parentId);
|
|
7299
|
+
else return;
|
|
7300
|
+
break;
|
|
7301
|
+
}
|
|
7302
|
+
case "Home": {
|
|
7303
|
+
if (visibleRows[0]) focusRow(visibleRows[0].id);
|
|
7304
|
+
break;
|
|
7305
|
+
}
|
|
7306
|
+
case "End": {
|
|
7307
|
+
const last = visibleRows[visibleRows.length - 1];
|
|
7308
|
+
if (last) focusRow(last.id);
|
|
7309
|
+
break;
|
|
7310
|
+
}
|
|
7311
|
+
case "Enter":
|
|
7312
|
+
case " ": {
|
|
7313
|
+
if (row.id === TREE_ALL_NODE.id) updateAllSelected();
|
|
7314
|
+
else if (selectable) updateSelected(row.node);
|
|
7315
|
+
else if (hasChildren && !row.node.disabled) updateExpanded(row.node);
|
|
7316
|
+
else return;
|
|
7317
|
+
break;
|
|
7318
|
+
}
|
|
7319
|
+
default:
|
|
7320
|
+
return;
|
|
7321
|
+
}
|
|
7322
|
+
event.preventDefault();
|
|
7323
|
+
};
|
|
7029
7324
|
const renderNodes = (nodes, depth = 1, ancestorLast = []) => nodes.map((node, index) => {
|
|
7030
7325
|
const isLast = index === nodes.length - 1;
|
|
7031
7326
|
const isExpanded = expandedSet.has(node.id);
|
|
@@ -7034,6 +7329,9 @@ var STreeImpl = /* @__PURE__ */ react.forwardRef(function STree({
|
|
|
7034
7329
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7035
7330
|
STreeItem2,
|
|
7036
7331
|
{
|
|
7332
|
+
"data-tree-row": node.id,
|
|
7333
|
+
tabIndex: activeRowId === node.id ? 0 : -1,
|
|
7334
|
+
onKeyDown: handleTreeKeyDown,
|
|
7037
7335
|
node,
|
|
7038
7336
|
depth,
|
|
7039
7337
|
last: isLast,
|
|
@@ -7051,30 +7349,31 @@ var STreeImpl = /* @__PURE__ */ react.forwardRef(function STree({
|
|
|
7051
7349
|
onTreeSelect: updateSelected
|
|
7052
7350
|
}
|
|
7053
7351
|
),
|
|
7054
|
-
node.children?.length ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7055
|
-
"div",
|
|
7056
|
-
{
|
|
7057
|
-
"aria-hidden": !isExpanded,
|
|
7058
|
-
className: cn(
|
|
7059
|
-
"grid w-full overflow-hidden transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
7060
|
-
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
7061
|
-
),
|
|
7062
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 overflow-hidden", children: renderNodes(node.children, depth + 1, [...ancestorLast, isLast]) })
|
|
7063
|
-
}
|
|
7064
|
-
) : null
|
|
7352
|
+
node.children?.length ? /* @__PURE__ */ jsxRuntime.jsx(TreeBranch, { expanded: isExpanded, children: renderNodes(node.children, depth + 1, [...ancestorLast, isLast]) }) : null
|
|
7065
7353
|
] }, node.id);
|
|
7066
7354
|
});
|
|
7067
7355
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7068
7356
|
"div",
|
|
7069
7357
|
{
|
|
7070
|
-
ref
|
|
7358
|
+
ref: (node) => {
|
|
7359
|
+
treeRef.current = node;
|
|
7360
|
+
if (typeof ref === "function") ref(node);
|
|
7361
|
+
else if (ref) ref.current = node;
|
|
7362
|
+
},
|
|
7071
7363
|
role: "tree",
|
|
7072
7364
|
className: cn("flex w-full flex-col items-start bg-(--cmp-tree-item-bg-default)", className),
|
|
7365
|
+
onFocus: (event) => {
|
|
7366
|
+
const rowId = event.target.closest?.("[data-tree-row]")?.getAttribute("data-tree-row");
|
|
7367
|
+
if (rowId != null) setFocusedId(rowId);
|
|
7368
|
+
},
|
|
7073
7369
|
...rest,
|
|
7074
7370
|
children: [
|
|
7075
7371
|
showAllItem && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7076
7372
|
STreeAllItem,
|
|
7077
7373
|
{
|
|
7374
|
+
rowId: TREE_ALL_NODE.id,
|
|
7375
|
+
tabIndex: activeRowId === TREE_ALL_NODE.id ? 0 : -1,
|
|
7376
|
+
onKeyDown: handleTreeKeyDown,
|
|
7078
7377
|
selected: allSelected,
|
|
7079
7378
|
indeterminate: allIndeterminate,
|
|
7080
7379
|
border,
|
|
@@ -7844,10 +8143,11 @@ var SLinearProgress = /* @__PURE__ */ react.forwardRef(
|
|
|
7844
8143
|
// src/lib/global-overlay.ts
|
|
7845
8144
|
var GLOBAL_OVERLAY_ATTR = "data-s-global-overlay";
|
|
7846
8145
|
var globalOverlayProps = { [GLOBAL_OVERLAY_ATTR]: "" };
|
|
8146
|
+
var ELEMENT_NODE = 1;
|
|
7847
8147
|
function isFromGlobalOverlay(event) {
|
|
7848
8148
|
const detail = event.detail;
|
|
7849
8149
|
const target = detail?.originalEvent?.target ?? event.target;
|
|
7850
|
-
const element = target
|
|
8150
|
+
const element = target == null ? null : target.nodeType === ELEMENT_NODE ? target : target.parentElement ?? null;
|
|
7851
8151
|
return !!element?.closest(`[${GLOBAL_OVERLAY_ATTR}]`);
|
|
7852
8152
|
}
|
|
7853
8153
|
var SLoadingContainer = /* @__PURE__ */ react.forwardRef(
|
|
@@ -8196,8 +8496,8 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
|
|
|
8196
8496
|
"border-[color:var(--dd-border)] bg-[var(--dd-bg)] text-[color:var(--dd-text)]",
|
|
8197
8497
|
disabled ? "cursor-not-allowed" : "cursor-pointer hover:bg-[var(--dd-bg-hover)]"
|
|
8198
8498
|
);
|
|
8199
|
-
const menu = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8200
|
-
|
|
8499
|
+
const menu = /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8500
|
+
RDropdown3__namespace.Content,
|
|
8201
8501
|
{
|
|
8202
8502
|
sideOffset: 4,
|
|
8203
8503
|
align: "start",
|
|
@@ -8213,7 +8513,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
|
|
|
8213
8513
|
),
|
|
8214
8514
|
style: split ? { minWidth: clampToAvailableWidth(splitWidth, DROPDOWN_AVAILABLE_WIDTH) } : void 0,
|
|
8215
8515
|
children: items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8216
|
-
|
|
8516
|
+
RDropdown3__namespace.Item,
|
|
8217
8517
|
{
|
|
8218
8518
|
disabled: it.disabled,
|
|
8219
8519
|
onSelect: () => onItemClick?.(it.value),
|
|
@@ -8234,7 +8534,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
|
|
|
8234
8534
|
}
|
|
8235
8535
|
) });
|
|
8236
8536
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8237
|
-
|
|
8537
|
+
RDropdown3__namespace.Root,
|
|
8238
8538
|
{
|
|
8239
8539
|
modal: !insideModal,
|
|
8240
8540
|
open,
|
|
@@ -8266,7 +8566,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
|
|
|
8266
8566
|
children: label
|
|
8267
8567
|
}
|
|
8268
8568
|
),
|
|
8269
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8569
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8270
8570
|
"button",
|
|
8271
8571
|
{
|
|
8272
8572
|
ref: splitToggleRef,
|
|
@@ -8285,7 +8585,7 @@ var SDropdownButtonImpl = /* @__PURE__ */ react.forwardRef(
|
|
|
8285
8585
|
) })
|
|
8286
8586
|
]
|
|
8287
8587
|
}
|
|
8288
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8588
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8289
8589
|
"button",
|
|
8290
8590
|
{
|
|
8291
8591
|
type: "button",
|
|
@@ -13286,10 +13586,9 @@ function todayStr() {
|
|
|
13286
13586
|
function formatDate(year, month, day) {
|
|
13287
13587
|
return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
|
13288
13588
|
}
|
|
13289
|
-
function calcYearMonth(year, month, dir) {
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
return month === 12 ? { year: year + 1, month: 1 } : { year, month: month + 1 };
|
|
13589
|
+
function calcYearMonth(year, month, dir, step = 1) {
|
|
13590
|
+
const index = year * 12 + (month - 1) + (dir === "prev" ? -step : step);
|
|
13591
|
+
return { year: Math.floor(index / 12), month: index % 12 + 1 };
|
|
13293
13592
|
}
|
|
13294
13593
|
function monthCells(year, month) {
|
|
13295
13594
|
const firstDayIndex = new Date(year, month - 1, 1).getDay();
|
|
@@ -14274,6 +14573,9 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14274
14573
|
const [open, setOpen] = react.useState(false);
|
|
14275
14574
|
const [pendingOpen, setPendingOpen] = react.useState(false);
|
|
14276
14575
|
const [focusedIndex, setFocusedIndex] = react.useState(-1);
|
|
14576
|
+
const baseId = react.useId();
|
|
14577
|
+
const listboxId = `${baseId}-listbox`;
|
|
14578
|
+
const activeOptionId = `${baseId}-active-option`;
|
|
14277
14579
|
const [win, setWin] = react.useState({ start: 0, end: 0, top: 0, bottom: 0 });
|
|
14278
14580
|
const winRef = react.useRef(win);
|
|
14279
14581
|
winRef.current = win;
|
|
@@ -14359,13 +14661,15 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14359
14661
|
setPendingOpen(false);
|
|
14360
14662
|
commitOpen(true);
|
|
14361
14663
|
}, [insideModal, pendingOpen, portalContainer]);
|
|
14664
|
+
const requestOpenRef = react.useRef(requestOpen);
|
|
14665
|
+
requestOpenRef.current = requestOpen;
|
|
14362
14666
|
react.useImperativeHandle(
|
|
14363
14667
|
ref,
|
|
14364
14668
|
() => ({
|
|
14365
14669
|
focus: () => triggerRef.current?.focus(),
|
|
14366
|
-
open: () =>
|
|
14670
|
+
open: () => requestOpenRef.current(true)
|
|
14367
14671
|
}),
|
|
14368
|
-
[
|
|
14672
|
+
[]
|
|
14369
14673
|
);
|
|
14370
14674
|
useFormField({
|
|
14371
14675
|
name,
|
|
@@ -14703,6 +15007,8 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14703
15007
|
disabled: effectiveDisabled,
|
|
14704
15008
|
"aria-haspopup": "listbox",
|
|
14705
15009
|
"aria-expanded": open,
|
|
15010
|
+
"aria-controls": open ? listboxId : void 0,
|
|
15011
|
+
"aria-activedescendant": open && focusedIndex >= 0 ? activeOptionId : void 0,
|
|
14706
15012
|
onClick: () => requestOpen(!open),
|
|
14707
15013
|
onKeyDown: handleKeyDown,
|
|
14708
15014
|
className: "flex h-full w-full cursor-pointer items-center justify-between gap-[8px] bg-transparent px-[12px] text-left text-[12px] leading-[20px] outline-none disabled:cursor-not-allowed",
|
|
@@ -14829,7 +15135,9 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14829
15135
|
onValueChange: setSearch,
|
|
14830
15136
|
onKeyDown: handleKeyDown,
|
|
14831
15137
|
placeholder: "\uAC80\uC0C9",
|
|
14832
|
-
clearable: true
|
|
15138
|
+
clearable: true,
|
|
15139
|
+
"aria-controls": listboxId,
|
|
15140
|
+
"aria-activedescendant": focusedIndex >= 0 ? activeOptionId : void 0
|
|
14833
15141
|
}
|
|
14834
15142
|
)
|
|
14835
15143
|
}
|
|
@@ -14837,6 +15145,8 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14837
15145
|
hasItems ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
14838
15146
|
ItemList,
|
|
14839
15147
|
{
|
|
15148
|
+
listboxId,
|
|
15149
|
+
activeOptionId,
|
|
14840
15150
|
items: visibleItems,
|
|
14841
15151
|
indexOffset: windowStart,
|
|
14842
15152
|
topSpacer: win.top,
|
|
@@ -14885,6 +15195,8 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
14885
15195
|
});
|
|
14886
15196
|
var SSelect2 = /* @__PURE__ */ withDisplayName(SSelectImpl, "SSelect");
|
|
14887
15197
|
function ItemList({
|
|
15198
|
+
listboxId,
|
|
15199
|
+
activeOptionId,
|
|
14888
15200
|
items,
|
|
14889
15201
|
indexOffset,
|
|
14890
15202
|
topSpacer,
|
|
@@ -14910,12 +15222,13 @@ function ItemList({
|
|
|
14910
15222
|
"disabled:cursor-not-allowed disabled:text-[color:var(--cmp-listBoxItem-content-disabled)]"
|
|
14911
15223
|
);
|
|
14912
15224
|
const activeClass = "hover:bg-[var(--cmp-listBoxItem-bg-hover)] hover:text-[color:var(--cmp-listBoxItem-content-hover)] focus-visible:bg-[var(--cmp-listBoxItem-bg-hover)] focus-visible:text-[color:var(--cmp-listBoxItem-content-hover)]";
|
|
14913
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
15225
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { id: listboxId, role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
14914
15226
|
showSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14915
15227
|
"button",
|
|
14916
15228
|
{
|
|
14917
15229
|
type: "button",
|
|
14918
15230
|
"data-select-all-row": true,
|
|
15231
|
+
id: focusedValue === "__select_all__" ? activeOptionId : void 0,
|
|
14919
15232
|
"data-select-focused": focusedValue === "__select_all__" ? "true" : void 0,
|
|
14920
15233
|
"data-select-active": focusedValue === "__select_all__" ? "true" : void 0,
|
|
14921
15234
|
className: cn(
|
|
@@ -14957,6 +15270,7 @@ function ItemList({
|
|
|
14957
15270
|
type: "button",
|
|
14958
15271
|
"data-select-row": true,
|
|
14959
15272
|
"data-index": idx,
|
|
15273
|
+
id: groupFocused ? activeOptionId : void 0,
|
|
14960
15274
|
role: "option",
|
|
14961
15275
|
"aria-selected": groupState === true,
|
|
14962
15276
|
disabled: groupDisabled,
|
|
@@ -15030,6 +15344,7 @@ function ItemList({
|
|
|
15030
15344
|
type: "button",
|
|
15031
15345
|
"data-select-row": true,
|
|
15032
15346
|
"data-index": idx,
|
|
15347
|
+
id: focusedValue === o.value ? activeOptionId : void 0,
|
|
15033
15348
|
disabled: o.disabled,
|
|
15034
15349
|
role: "option",
|
|
15035
15350
|
"aria-selected": isSelected,
|
|
@@ -15114,6 +15429,22 @@ var cellValue = (col, row) => {
|
|
|
15114
15429
|
return col.format ? col.format(raw, row) : raw;
|
|
15115
15430
|
};
|
|
15116
15431
|
var DEFAULT_COLUMN_WIDTH = 120;
|
|
15432
|
+
var LOCKED_BG = "var(--cmp-table-body-disabled-bg)";
|
|
15433
|
+
var LOCKED_CONTENT = "var(--cmp-table-body-disabled-content)";
|
|
15434
|
+
var DRAG_BG = "var(--cmp-table-dragSelectable-bg-color)";
|
|
15435
|
+
var DRAG_EDGE_W = "var(--cmp-table-dragSelectable-border-width)";
|
|
15436
|
+
var DRAG_EDGE_NEG_W = `calc(-1 * ${DRAG_EDGE_W})`;
|
|
15437
|
+
var DRAG_EDGE_C = "var(--cmp-table-dragSelectable-border-color)";
|
|
15438
|
+
var CONTEXT_MENU_VIEWPORT_PADDING = 12;
|
|
15439
|
+
var CONTEXT_MENU_CURSOR_GAP = 2;
|
|
15440
|
+
var CONTEXT_MENU_ARM_FALLBACK_MS = 500;
|
|
15441
|
+
var CONTEXT_MENU_ITEM_CLASS = cn(
|
|
15442
|
+
"flex min-h-[28px] cursor-pointer select-none items-center gap-[8px] rounded-[2px] px-[12px] py-[4px] text-[12px] leading-[20px] outline-none",
|
|
15443
|
+
"text-[color:var(--sys-color-fg-secondary)]",
|
|
15444
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-[color:var(--cmp-button-text-disabled)]",
|
|
15445
|
+
"data-[highlighted]:bg-[var(--sys-color-bg-accent)] data-[highlighted]:text-[color:var(--sys-color-fg-inverse)]"
|
|
15446
|
+
);
|
|
15447
|
+
var ROW_INTERACTIVE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [contenteditable="true"]';
|
|
15117
15448
|
var colWidthFromDef = (c) => {
|
|
15118
15449
|
if (c.autoWidth) return 0;
|
|
15119
15450
|
if (c.width == null) return DEFAULT_COLUMN_WIDTH;
|
|
@@ -15126,6 +15457,9 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15126
15457
|
rows = [],
|
|
15127
15458
|
rowKey = "id",
|
|
15128
15459
|
selectable = false,
|
|
15460
|
+
dragSelectable = false,
|
|
15461
|
+
contextMenuItems,
|
|
15462
|
+
onContextMenuItemClick,
|
|
15129
15463
|
isRowSelectable,
|
|
15130
15464
|
selected = [],
|
|
15131
15465
|
onSelectedChange,
|
|
@@ -15241,6 +15575,10 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15241
15575
|
(row) => isRowSelectable ? isRowSelectable(row) : true,
|
|
15242
15576
|
[isRowSelectable]
|
|
15243
15577
|
);
|
|
15578
|
+
const dragSelectOn = dragSelectable && !selectable;
|
|
15579
|
+
const portalContainer = usePortalContainer();
|
|
15580
|
+
const [dragPreviewKeys, setDragPreviewKeys] = react.useState(null);
|
|
15581
|
+
const dragRef = react.useRef(null);
|
|
15244
15582
|
const getIsAllChecked = react.useCallback(
|
|
15245
15583
|
(rws) => {
|
|
15246
15584
|
const targets = rws.filter(canSelectRow);
|
|
@@ -15582,6 +15920,76 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15582
15920
|
onSelectedChange?.(selected.filter((r) => r[rowKey] !== row[rowKey]));
|
|
15583
15921
|
else onSelectedChange?.([...selected, row]);
|
|
15584
15922
|
};
|
|
15923
|
+
const isViewSelected = (row) => row != null && (dragPreviewKeys ?? selectedKeys).has(row[rowKey]);
|
|
15924
|
+
const dragRangeRows = (from, to) => {
|
|
15925
|
+
const [a, b] = from <= to ? [from, to] : [to, from];
|
|
15926
|
+
return rows.slice(a, b + 1).filter(canSelectRow);
|
|
15927
|
+
};
|
|
15928
|
+
const dragPreviewOf = (base, anchor, to) => /* @__PURE__ */ new Set([...base, ...dragRangeRows(anchor, to).map((r) => r[rowKey])]);
|
|
15929
|
+
const startDragSelect = (index, event) => {
|
|
15930
|
+
if (event.button !== 0) return;
|
|
15931
|
+
const target = event.target;
|
|
15932
|
+
if (target?.closest?.(ROW_INTERACTIVE_SELECTOR)) return;
|
|
15933
|
+
event.preventDefault();
|
|
15934
|
+
const baseRows = event.ctrlKey || event.metaKey ? selected : [];
|
|
15935
|
+
const baseKeys = new Set(baseRows.map((r) => r[rowKey]));
|
|
15936
|
+
dragRef.current = { anchor: index, last: index, baseKeys, baseRows };
|
|
15937
|
+
setDragPreviewKeys(dragPreviewOf(baseKeys, index, index));
|
|
15938
|
+
};
|
|
15939
|
+
const extendDragSelect = (index) => {
|
|
15940
|
+
const d = dragRef.current;
|
|
15941
|
+
if (!d || d.last === index) return;
|
|
15942
|
+
d.last = index;
|
|
15943
|
+
setDragPreviewKeys(dragPreviewOf(d.baseKeys, d.anchor, index));
|
|
15944
|
+
};
|
|
15945
|
+
const finishDragSelectRef = react.useRef(() => {
|
|
15946
|
+
});
|
|
15947
|
+
finishDragSelectRef.current = () => {
|
|
15948
|
+
const d = dragRef.current;
|
|
15949
|
+
if (!d) return;
|
|
15950
|
+
dragRef.current = null;
|
|
15951
|
+
setDragPreviewKeys(null);
|
|
15952
|
+
const add = dragRangeRows(d.anchor, d.last).filter((r) => !d.baseKeys.has(r[rowKey]));
|
|
15953
|
+
onSelectedChange?.([...d.baseRows, ...add]);
|
|
15954
|
+
};
|
|
15955
|
+
react.useEffect(() => {
|
|
15956
|
+
if (!dragSelectOn) return;
|
|
15957
|
+
const onUp = () => finishDragSelectRef.current();
|
|
15958
|
+
window.addEventListener("mouseup", onUp);
|
|
15959
|
+
return () => {
|
|
15960
|
+
window.removeEventListener("mouseup", onUp);
|
|
15961
|
+
dragRef.current = null;
|
|
15962
|
+
};
|
|
15963
|
+
}, [dragSelectOn]);
|
|
15964
|
+
const contextMenuOn = dragSelectOn && (contextMenuItems?.length ?? 0) > 0;
|
|
15965
|
+
const [contextMenu, setContextMenu] = react.useState(null);
|
|
15966
|
+
const contextMenuOpen = contextMenu?.open === true;
|
|
15967
|
+
const [contextMenuArmed, setContextMenuArmed] = react.useState(false);
|
|
15968
|
+
react.useEffect(() => {
|
|
15969
|
+
if (!contextMenuOpen || contextMenuArmed) return;
|
|
15970
|
+
const arm = () => setContextMenuArmed(true);
|
|
15971
|
+
window.addEventListener("pointerup", arm, { once: true, capture: true });
|
|
15972
|
+
const timer = window.setTimeout(arm, CONTEXT_MENU_ARM_FALLBACK_MS);
|
|
15973
|
+
return () => {
|
|
15974
|
+
window.removeEventListener("pointerup", arm, { capture: true });
|
|
15975
|
+
window.clearTimeout(timer);
|
|
15976
|
+
};
|
|
15977
|
+
}, [contextMenuOpen, contextMenuArmed]);
|
|
15978
|
+
react.useEffect(() => {
|
|
15979
|
+
if (!contextMenuOpen) return;
|
|
15980
|
+
const close = () => setContextMenu((m) => m == null ? null : { ...m, open: false });
|
|
15981
|
+
window.addEventListener("scroll", close, { capture: true, passive: true });
|
|
15982
|
+
return () => window.removeEventListener("scroll", close, { capture: true });
|
|
15983
|
+
}, [contextMenuOpen]);
|
|
15984
|
+
const openContextMenu = (row, event) => {
|
|
15985
|
+
if (!canSelectRow(row)) return;
|
|
15986
|
+
event.preventDefault();
|
|
15987
|
+
const alreadySelected = selectedKeys.has(row[rowKey]);
|
|
15988
|
+
const rows2 = alreadySelected ? selected : [row];
|
|
15989
|
+
if (!alreadySelected) onSelectedChange?.(rows2);
|
|
15990
|
+
setContextMenuArmed(false);
|
|
15991
|
+
setContextMenu({ x: event.clientX, y: event.clientY, rows: rows2, open: true });
|
|
15992
|
+
};
|
|
15585
15993
|
const radiusClass = radius === "full" ? "rounded-none" : radius === "useTop" ? "rounded-b-[var(--cmp-table-radius)] rounded-t-none" : "rounded-[var(--cmp-table-radius)]";
|
|
15586
15994
|
const cellPadY = innerDense ? "var(--cmp-table-body-paddingY-dense)" : "var(--cmp-table-body-paddingY-default)";
|
|
15587
15995
|
const cellPadXOf = (col) => col.contentType === "control" ? "var(--cmp-table-body-paddingX-default)" : "var(--cmp-table-body-paddingX-wide)";
|
|
@@ -15604,14 +16012,13 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15604
16012
|
zIndex: 6
|
|
15605
16013
|
};
|
|
15606
16014
|
};
|
|
15607
|
-
const
|
|
16015
|
+
const stickyShadowValue = (i) => {
|
|
15608
16016
|
const { isLeft, isRight } = stickyInfo(i);
|
|
15609
16017
|
const isLeftEdge = isLeft && i === stickyLeft - 1;
|
|
15610
16018
|
const isRightEdge = isRight && i === visibleCols.length - stickyRight;
|
|
15611
|
-
return
|
|
15612
|
-
|
|
15613
|
-
|
|
15614
|
-
);
|
|
16019
|
+
if (isLeftEdge && scrolledLeft) return "5px 0 8px 0 rgba(34,34,34,0.1)";
|
|
16020
|
+
if (isRightEdge && scrolledRight) return "-5px 0 8px 0 rgba(34,34,34,0.1)";
|
|
16021
|
+
return null;
|
|
15615
16022
|
};
|
|
15616
16023
|
const headerResizeHitArea = (i, key) => {
|
|
15617
16024
|
const col = visibleCols[i];
|
|
@@ -15805,10 +16212,14 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15805
16212
|
headerGroupInfo && i === visibleCols.length - 1 && "border-r-0",
|
|
15806
16213
|
"relative bg-[var(--cmp-table-header-bg)] px-[16px] text-[12px] font-medium leading-[0] text-[color:var(--sys-color-fg-primary)]",
|
|
15807
16214
|
stickyInfo(i).isSticky && "z-[6]",
|
|
15808
|
-
stickyShadowClass(i),
|
|
15809
16215
|
col.thClass
|
|
15810
16216
|
),
|
|
15811
|
-
style: {
|
|
16217
|
+
style: {
|
|
16218
|
+
textAlign: col.align ?? "left",
|
|
16219
|
+
boxShadow: stickyShadowValue(i) ?? void 0,
|
|
16220
|
+
...cellStyle(i),
|
|
16221
|
+
...col.thStyle
|
|
16222
|
+
},
|
|
15812
16223
|
"aria-sort": isSortable ? sortDir === "asc" ? "ascending" : sortDir === "desc" ? "descending" : "none" : void 0,
|
|
15813
16224
|
children: [
|
|
15814
16225
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15920,17 +16331,27 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15920
16331
|
/* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
|
|
15921
16332
|
virtualScroll && topSpacer > 0 && /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-hidden": true, style: { height: topSpacer }, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: totalColSpan, className: "p-0" }) }),
|
|
15922
16333
|
rowCount === 0 ? null : bodyRows.map((row, ri) => {
|
|
15923
|
-
const
|
|
16334
|
+
const rowIndex = rowOffset + ri;
|
|
16335
|
+
const isSel = isViewSelected(row);
|
|
16336
|
+
const dragSel = dragSelectOn && isSel;
|
|
16337
|
+
const dragTop = dragSel && !isViewSelected(rows[rowIndex - 1]);
|
|
16338
|
+
const dragBottom = dragSel && !isViewSelected(rows[rowIndex + 1]);
|
|
16339
|
+
const rowLocked = (selectable || dragSelectable) && !canSelectRow(row);
|
|
15924
16340
|
const rowBg = "bg-white";
|
|
16341
|
+
const rowHover = hoverable && !rowLocked;
|
|
15925
16342
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15926
16343
|
"tr",
|
|
15927
16344
|
{
|
|
15928
|
-
"data-row-index":
|
|
16345
|
+
"data-row-index": rowIndex,
|
|
15929
16346
|
onClick: () => onRowClick?.(row),
|
|
16347
|
+
onMouseDown: dragSelectOn ? (event) => startDragSelect(rowIndex, event) : void 0,
|
|
16348
|
+
onMouseEnter: dragSelectOn ? () => extendDragSelect(rowIndex) : void 0,
|
|
16349
|
+
onContextMenu: contextMenuOn ? (event) => openContextMenu(row, event) : void 0,
|
|
15930
16350
|
className: cn(
|
|
15931
16351
|
"group/table-row",
|
|
15932
|
-
|
|
15933
|
-
onRowClick && "cursor-pointer"
|
|
16352
|
+
rowHover && "hover:bg-[var(--color-grey-05)]",
|
|
16353
|
+
onRowClick && "cursor-pointer",
|
|
16354
|
+
dragSelectOn && "select-none"
|
|
15934
16355
|
),
|
|
15935
16356
|
style: { height: virtualScroll ? effectiveRowHeight : rowH },
|
|
15936
16357
|
children: [
|
|
@@ -15941,13 +16362,15 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15941
16362
|
// 원본 .td--selected: 48px 고정폭, 항상 left sticky, 체크박스 중앙정렬
|
|
15942
16363
|
"sticky left-0 z-[2] border-b border-solid border-[color:var(--cmp-table-border-color)] align-middle",
|
|
15943
16364
|
rowBg,
|
|
15944
|
-
|
|
16365
|
+
rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
15945
16366
|
stickyLeft === 0 && scrolledLeft && "shadow-[5px_0_8px_0_rgba(34,34,34,0.1)]"
|
|
15946
16367
|
),
|
|
15947
16368
|
style: {
|
|
15948
16369
|
width: SELECTABLE_COLUMN_WIDTH,
|
|
15949
16370
|
minWidth: SELECTABLE_COLUMN_WIDTH,
|
|
15950
|
-
maxWidth: SELECTABLE_COLUMN_WIDTH
|
|
16371
|
+
maxWidth: SELECTABLE_COLUMN_WIDTH,
|
|
16372
|
+
// 선택 열도 행의 일부다 — 여기만 희지 않으면 회색 줄이 끊긴다
|
|
16373
|
+
background: rowLocked ? LOCKED_BG : void 0
|
|
15951
16374
|
},
|
|
15952
16375
|
onClick: (e) => e.stopPropagation(),
|
|
15953
16376
|
onClickCapture: (e) => {
|
|
@@ -15970,17 +16393,29 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
15970
16393
|
// 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
|
|
15971
16394
|
"overflow-hidden text-ellipsis whitespace-nowrap border-b border-solid border-[color:var(--cmp-table-border-color)] text-[12px] leading-[20px] text-[color:var(--sys-color-fg-primary)]",
|
|
15972
16395
|
rowBg,
|
|
15973
|
-
|
|
15974
|
-
stickyShadowClass(i),
|
|
16396
|
+
rowHover && "group-hover/table-row:bg-[var(--color-grey-05)]",
|
|
15975
16397
|
typeof col.tdClass === "function" ? col.tdClass(row) : col.tdClass
|
|
15976
16398
|
);
|
|
15977
16399
|
const tdPadX = cellPadXOf(col);
|
|
16400
|
+
const dragEdges = dragSel ? [
|
|
16401
|
+
dragTop && `inset 0 ${DRAG_EDGE_W} 0 0 ${DRAG_EDGE_C}`,
|
|
16402
|
+
dragBottom && `inset 0 ${DRAG_EDGE_NEG_W} 0 0 ${DRAG_EDGE_C}`,
|
|
16403
|
+
i === 0 && `inset ${DRAG_EDGE_W} 0 0 0 ${DRAG_EDGE_C}`,
|
|
16404
|
+
i === visibleCols.length - 1 && `inset ${DRAG_EDGE_NEG_W} 0 0 0 ${DRAG_EDGE_C}`
|
|
16405
|
+
].filter(Boolean) : [];
|
|
16406
|
+
const shadows = [...dragEdges, stickyShadowValue(i)].filter(Boolean);
|
|
15978
16407
|
const tdStyle = {
|
|
15979
16408
|
paddingLeft: tdPadX,
|
|
15980
16409
|
paddingRight: tdPadX,
|
|
15981
16410
|
paddingTop: cellPadY,
|
|
15982
16411
|
paddingBottom: cellPadY,
|
|
15983
16412
|
textAlign: col.align ?? "left",
|
|
16413
|
+
// 인라인이라 hover 배경보다 세다 — 고른 행은 hover 로 흐려지지 않는다.
|
|
16414
|
+
background: dragSel ? DRAG_BG : rowLocked ? LOCKED_BG : void 0,
|
|
16415
|
+
// 클래스의 기본 글자색을 덮는다. 셀이 자기 색을 정한 내용(SIcon 의
|
|
16416
|
+
// color, STag 등)까지는 닿지 않는다 — 그건 소비 앱 몫이다.
|
|
16417
|
+
color: rowLocked ? LOCKED_CONTENT : void 0,
|
|
16418
|
+
boxShadow: shadows.length > 0 ? shadows.join(", ") : void 0,
|
|
15984
16419
|
...cellStyle(i)
|
|
15985
16420
|
};
|
|
15986
16421
|
if (col.renderCell) {
|
|
@@ -16068,6 +16503,59 @@ var STable = /* @__PURE__ */ react.forwardRef(function STable2({
|
|
|
16068
16503
|
] })
|
|
16069
16504
|
]
|
|
16070
16505
|
}
|
|
16506
|
+
),
|
|
16507
|
+
contextMenuOn && typeof document !== "undefined" && reactDom.createPortal(
|
|
16508
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16509
|
+
RDropdown3__namespace.Root,
|
|
16510
|
+
{
|
|
16511
|
+
modal: false,
|
|
16512
|
+
open: contextMenuOpen,
|
|
16513
|
+
onOpenChange: (open) => {
|
|
16514
|
+
if (!open) setContextMenu((m) => m == null ? null : { ...m, open: false });
|
|
16515
|
+
},
|
|
16516
|
+
children: [
|
|
16517
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16518
|
+
"span",
|
|
16519
|
+
{
|
|
16520
|
+
"aria-hidden": true,
|
|
16521
|
+
className: "pointer-events-none fixed block h-0 w-0",
|
|
16522
|
+
style: { left: contextMenu?.x ?? 0, top: contextMenu?.y ?? 0 }
|
|
16523
|
+
}
|
|
16524
|
+
) }),
|
|
16525
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16526
|
+
RDropdown3__namespace.Content,
|
|
16527
|
+
{
|
|
16528
|
+
align: "start",
|
|
16529
|
+
side: "bottom",
|
|
16530
|
+
sideOffset: CONTEXT_MENU_CURSOR_GAP,
|
|
16531
|
+
alignOffset: CONTEXT_MENU_CURSOR_GAP,
|
|
16532
|
+
collisionPadding: CONTEXT_MENU_VIEWPORT_PADDING,
|
|
16533
|
+
style: contextMenuArmed ? void 0 : { pointerEvents: "none" },
|
|
16534
|
+
className: cn(
|
|
16535
|
+
"z-50 overflow-hidden rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-normal-sm",
|
|
16536
|
+
"max-w-[var(--radix-dropdown-menu-content-available-width)]",
|
|
16537
|
+
FLOATING_SLIDE_ANIM
|
|
16538
|
+
),
|
|
16539
|
+
children: contextMenuItems?.map((item4) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16540
|
+
RDropdown3__namespace.Item,
|
|
16541
|
+
{
|
|
16542
|
+
disabled: item4.disabled,
|
|
16543
|
+
onSelect: () => onContextMenuItemClick?.(item4.value, contextMenu?.rows ?? []),
|
|
16544
|
+
className: CONTEXT_MENU_ITEM_CLASS,
|
|
16545
|
+
children: [
|
|
16546
|
+
item4.icon && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: item4.icon, size: 12 }),
|
|
16547
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 break-words", children: item4.label })
|
|
16548
|
+
]
|
|
16549
|
+
},
|
|
16550
|
+
item4.value
|
|
16551
|
+
))
|
|
16552
|
+
}
|
|
16553
|
+
)
|
|
16554
|
+
]
|
|
16555
|
+
},
|
|
16556
|
+
contextMenu == null ? "closed" : `${contextMenu.x},${contextMenu.y}`
|
|
16557
|
+
),
|
|
16558
|
+
portalContainer ?? document.body
|
|
16071
16559
|
)
|
|
16072
16560
|
]
|
|
16073
16561
|
}
|
|
@@ -17586,11 +18074,11 @@ function RangeCalendar({
|
|
|
17586
18074
|
const goPrevYear = () => setBase(y - 1, m);
|
|
17587
18075
|
const goNextYear = () => setBase(y + 1, m);
|
|
17588
18076
|
const goPrevMonth = () => {
|
|
17589
|
-
const n = calcYearMonth(y, m, "prev");
|
|
18077
|
+
const n = calcYearMonth(y, m, "prev", 2);
|
|
17590
18078
|
setBase(n.year, n.month);
|
|
17591
18079
|
};
|
|
17592
18080
|
const goNextMonth = () => {
|
|
17593
|
-
const n = calcYearMonth(y, m, "next");
|
|
18081
|
+
const n = calcYearMonth(y, m, "next", 2);
|
|
17594
18082
|
setBase(n.year, n.month);
|
|
17595
18083
|
};
|
|
17596
18084
|
const goToday = () => {
|
|
@@ -18935,20 +19423,24 @@ function ChartTooltip({
|
|
|
18935
19423
|
},
|
|
18936
19424
|
children: [
|
|
18937
19425
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-md-bold text-(--cmp-chart-chartTooltip-title-color)", children: title }),
|
|
18938
|
-
items.map((item4, index) => (
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
"
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
19426
|
+
items.map((item4, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19427
|
+
"span",
|
|
19428
|
+
{
|
|
19429
|
+
className: "flex items-center gap-(--cmp-chart-chartTooltipItem-gap)",
|
|
19430
|
+
children: [
|
|
19431
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19432
|
+
"span",
|
|
19433
|
+
{
|
|
19434
|
+
"aria-hidden": true,
|
|
19435
|
+
className: "shrink-0 rounded-full",
|
|
19436
|
+
style: { width: DOT_SIZE2, height: DOT_SIZE2, background: item4.color }
|
|
19437
|
+
}
|
|
19438
|
+
),
|
|
19439
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-default text-(--cmp-chart-chartTooltipItem-label-color)", children: item4.label }),
|
|
19440
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-body-sm-bold ml-auto text-(--cmp-chart-chartTooltipItem-dataValue-color)", children: item4.value })
|
|
19441
|
+
]
|
|
19442
|
+
},
|
|
19443
|
+
`${item4.label}-${index}`
|
|
18952
19444
|
))
|
|
18953
19445
|
]
|
|
18954
19446
|
}
|
|
@@ -20802,7 +21294,7 @@ var PaletteItem = ({
|
|
|
20802
21294
|
className,
|
|
20803
21295
|
onSelect,
|
|
20804
21296
|
children
|
|
20805
|
-
}) => asMenu ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
21297
|
+
}) => asMenu ? /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Item, { title: label, "aria-label": label, className, onSelect, children }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", title: label, "aria-label": label, className, onClick: onSelect, children });
|
|
20806
21298
|
var ColorPalette = ({
|
|
20807
21299
|
colors,
|
|
20808
21300
|
columns,
|
|
@@ -20934,7 +21426,7 @@ var TableMenuItem = ({
|
|
|
20934
21426
|
disabled,
|
|
20935
21427
|
onSelect
|
|
20936
21428
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
20937
|
-
|
|
21429
|
+
RDropdown3__namespace.Item,
|
|
20938
21430
|
{
|
|
20939
21431
|
className: cn(menuItemClass, menuItemDisabledClass),
|
|
20940
21432
|
disabled,
|
|
@@ -21101,8 +21593,8 @@ function EditorToolbarBar({
|
|
|
21101
21593
|
const node = (item4) => {
|
|
21102
21594
|
switch (item4) {
|
|
21103
21595
|
case "heading":
|
|
21104
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21596
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
|
|
21597
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21106
21598
|
ToolbarButton,
|
|
21107
21599
|
{
|
|
21108
21600
|
label: "\uC81C\uBAA9 \uB2E8\uACC4",
|
|
@@ -21115,9 +21607,9 @@ function EditorToolbarBar({
|
|
|
21115
21607
|
]
|
|
21116
21608
|
}
|
|
21117
21609
|
) }),
|
|
21118
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21610
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21119
21611
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21120
|
-
|
|
21612
|
+
RDropdown3__namespace.Item,
|
|
21121
21613
|
{
|
|
21122
21614
|
className: menuItemClass,
|
|
21123
21615
|
onSelect: () => chain()?.setParagraph().run(),
|
|
@@ -21125,7 +21617,7 @@ function EditorToolbarBar({
|
|
|
21125
21617
|
}
|
|
21126
21618
|
),
|
|
21127
21619
|
SEDITOR_HEADING_LEVELS.map((level) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21128
|
-
|
|
21620
|
+
RDropdown3__namespace.Item,
|
|
21129
21621
|
{
|
|
21130
21622
|
className: menuItemClass,
|
|
21131
21623
|
onSelect: () => chain()?.setHeading({ level }).run(),
|
|
@@ -21136,13 +21628,13 @@ function EditorToolbarBar({
|
|
|
21136
21628
|
] }) })
|
|
21137
21629
|
] }, item4);
|
|
21138
21630
|
case "fontSize":
|
|
21139
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21140
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21631
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
|
|
21632
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uAE00\uC790 \uD06C\uAE30", disabled: off, className: "px-[6px]", children: [
|
|
21141
21633
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] leading-[20px]", children: activeFontSize ?? FONT_SIZE_DEFAULT_LABEL }),
|
|
21142
21634
|
/* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: 12 })
|
|
21143
21635
|
] }) }),
|
|
21144
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21145
|
-
|
|
21636
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21637
|
+
RDropdown3__namespace.Content,
|
|
21146
21638
|
{
|
|
21147
21639
|
sideOffset: 4,
|
|
21148
21640
|
align: "start",
|
|
@@ -21150,7 +21642,7 @@ function EditorToolbarBar({
|
|
|
21150
21642
|
style: { maxHeight: FONT_SIZE_MENU_MAX_HEIGHT },
|
|
21151
21643
|
children: [
|
|
21152
21644
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21153
|
-
|
|
21645
|
+
RDropdown3__namespace.Item,
|
|
21154
21646
|
{
|
|
21155
21647
|
className: cn(menuItemClass, activeFontSize === null && menuItemSelectedClass),
|
|
21156
21648
|
title: `${FONT_SIZE_DEFAULT_LABEL} (\uBCF8\uBB38 ${SEDITOR_DEFAULT_FONT_SIZE}px)`,
|
|
@@ -21159,7 +21651,7 @@ function EditorToolbarBar({
|
|
|
21159
21651
|
}
|
|
21160
21652
|
),
|
|
21161
21653
|
SEDITOR_FONT_SIZES.map((size) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21162
|
-
|
|
21654
|
+
RDropdown3__namespace.Item,
|
|
21163
21655
|
{
|
|
21164
21656
|
ref: activeFontSize === size ? (el) => {
|
|
21165
21657
|
el?.scrollIntoView({ block: "nearest" });
|
|
@@ -21251,9 +21743,9 @@ function EditorToolbarBar({
|
|
|
21251
21743
|
},
|
|
21252
21744
|
item4
|
|
21253
21745
|
);
|
|
21254
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21255
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21256
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21746
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
|
|
21747
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { label: "\uAE00\uC790\uC0C9", disabled: off, children: /* @__PURE__ */ jsxRuntime.jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsxRuntime.jsx(IconTextColor, { size: ICON_SIZE }) }) }) }),
|
|
21748
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21257
21749
|
ColorPalette,
|
|
21258
21750
|
{
|
|
21259
21751
|
asMenu: true,
|
|
@@ -21359,14 +21851,14 @@ function EditorToolbarBar({
|
|
|
21359
21851
|
case "list": {
|
|
21360
21852
|
const ListIcon = state2.orderedList ? IconOrderedList : state2.taskList ? IconTaskList : IconBulletList;
|
|
21361
21853
|
const listActive = state2.bulletList || state2.orderedList || state2.taskList;
|
|
21362
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21363
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21854
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Root, { modal: !insideModal, children: [
|
|
21855
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uBAA9\uB85D", active: listActive, disabled: off, className: "px-[4px]", children: [
|
|
21364
21856
|
/* @__PURE__ */ jsxRuntime.jsx(ListIcon, { size: ICON_SIZE }),
|
|
21365
21857
|
/* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
|
|
21366
21858
|
] }) }),
|
|
21367
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21859
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21368
21860
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21369
|
-
|
|
21861
|
+
RDropdown3__namespace.Item,
|
|
21370
21862
|
{
|
|
21371
21863
|
className: menuItemClass,
|
|
21372
21864
|
onSelect: () => chain()?.toggleBulletList().run(),
|
|
@@ -21377,7 +21869,7 @@ function EditorToolbarBar({
|
|
|
21377
21869
|
}
|
|
21378
21870
|
),
|
|
21379
21871
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21380
|
-
|
|
21872
|
+
RDropdown3__namespace.Item,
|
|
21381
21873
|
{
|
|
21382
21874
|
className: menuItemClass,
|
|
21383
21875
|
onSelect: () => chain()?.toggleOrderedList().run(),
|
|
@@ -21388,7 +21880,7 @@ function EditorToolbarBar({
|
|
|
21388
21880
|
}
|
|
21389
21881
|
),
|
|
21390
21882
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21391
|
-
|
|
21883
|
+
RDropdown3__namespace.Item,
|
|
21392
21884
|
{
|
|
21393
21885
|
className: menuItemClass,
|
|
21394
21886
|
onSelect: () => chain()?.toggleTaskList().run(),
|
|
@@ -21492,17 +21984,17 @@ function EditorToolbarBar({
|
|
|
21492
21984
|
);
|
|
21493
21985
|
case "table":
|
|
21494
21986
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21495
|
-
|
|
21987
|
+
RDropdown3__namespace.Root,
|
|
21496
21988
|
{
|
|
21497
21989
|
open: tableOpen,
|
|
21498
21990
|
onOpenChange: setTableOpen,
|
|
21499
21991
|
modal: !insideModal,
|
|
21500
21992
|
children: [
|
|
21501
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21993
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, { label: "\uD45C", active: state2.inTable, disabled: off, className: "px-[6px]", children: [
|
|
21502
21994
|
/* @__PURE__ */ jsxRuntime.jsx(IconTable, { size: ICON_SIZE }),
|
|
21503
21995
|
/* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "caretDown", size: CARET_SIZE })
|
|
21504
21996
|
] }) }),
|
|
21505
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21997
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(RDropdown3__namespace.Content, { sideOffset: 4, align: "start", className: menuClass, children: [
|
|
21506
21998
|
!state2.inTable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
21507
21999
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21508
22000
|
TableSizePicker,
|
|
@@ -21514,7 +22006,7 @@ function EditorToolbarBar({
|
|
|
21514
22006
|
}
|
|
21515
22007
|
}
|
|
21516
22008
|
),
|
|
21517
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22009
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass })
|
|
21518
22010
|
] }),
|
|
21519
22011
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21520
22012
|
TableMenuItem,
|
|
@@ -21548,7 +22040,7 @@ function EditorToolbarBar({
|
|
|
21548
22040
|
onSelect: () => chain()?.addColumnAfter().run()
|
|
21549
22041
|
}
|
|
21550
22042
|
),
|
|
21551
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22043
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass }),
|
|
21552
22044
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21553
22045
|
TableMenuItem,
|
|
21554
22046
|
{
|
|
@@ -21581,7 +22073,7 @@ function EditorToolbarBar({
|
|
|
21581
22073
|
onSelect: () => chain()?.toggleHeaderColumn().run()
|
|
21582
22074
|
}
|
|
21583
22075
|
),
|
|
21584
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22076
|
+
/* @__PURE__ */ jsxRuntime.jsx(RDropdown3__namespace.Separator, { className: menuSeparatorClass }),
|
|
21585
22077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21586
22078
|
TableMenuItem,
|
|
21587
22079
|
{
|
|
@@ -24055,6 +24547,8 @@ var SChipInput = /* @__PURE__ */ react.forwardRef(function SChipInput2({
|
|
|
24055
24547
|
}, ref) {
|
|
24056
24548
|
const autoId = react.useId();
|
|
24057
24549
|
const resolvedName = name ?? autoId;
|
|
24550
|
+
const listboxId = `${autoId}-listbox`;
|
|
24551
|
+
const activeOptionId = `${autoId}-active-option`;
|
|
24058
24552
|
const [inputValue, setInputValue] = react.useState("");
|
|
24059
24553
|
const [focused, setFocused] = react.useState(false);
|
|
24060
24554
|
const [hovered, setHovered] = react.useState(false);
|
|
@@ -24277,6 +24771,11 @@ var SChipInput = /* @__PURE__ */ react.forwardRef(function SChipInput2({
|
|
|
24277
24771
|
ref: inputRef,
|
|
24278
24772
|
name: resolvedName,
|
|
24279
24773
|
size: 1,
|
|
24774
|
+
role: "combobox",
|
|
24775
|
+
"aria-expanded": showDropdown,
|
|
24776
|
+
"aria-controls": showDropdown ? listboxId : void 0,
|
|
24777
|
+
"aria-activedescendant": showDropdown && activeIndex >= 0 ? activeOptionId : void 0,
|
|
24778
|
+
"aria-autocomplete": "list",
|
|
24280
24779
|
className: cn(
|
|
24281
24780
|
"s-chip-input__input col-start-1 row-start-1 w-full border-0 bg-transparent p-0 font-normal text-(--cmp-chip-content-focus) outline-none placeholder:text-(--cmp-chipInput-text-placeholder) disabled:cursor-not-allowed",
|
|
24282
24781
|
AUTOFILL_RESET_CLASS,
|
|
@@ -24390,6 +24889,7 @@ var SChipInput = /* @__PURE__ */ react.forwardRef(function SChipInput2({
|
|
|
24390
24889
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24391
24890
|
"div",
|
|
24392
24891
|
{
|
|
24892
|
+
id: listboxId,
|
|
24393
24893
|
role: "listbox",
|
|
24394
24894
|
className: "s-chip-input__suggestions flex w-full flex-col outline-none",
|
|
24395
24895
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -24401,6 +24901,7 @@ var SChipInput = /* @__PURE__ */ react.forwardRef(function SChipInput2({
|
|
|
24401
24901
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24402
24902
|
"div",
|
|
24403
24903
|
{
|
|
24904
|
+
id: active ? activeOptionId : void 0,
|
|
24404
24905
|
role: "option",
|
|
24405
24906
|
"aria-selected": selected || active,
|
|
24406
24907
|
className: "rounded-full",
|
|
@@ -24419,6 +24920,7 @@ var SChipInput = /* @__PURE__ */ react.forwardRef(function SChipInput2({
|
|
|
24419
24920
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24420
24921
|
"div",
|
|
24421
24922
|
{
|
|
24923
|
+
id: active ? activeOptionId : void 0,
|
|
24422
24924
|
role: "option",
|
|
24423
24925
|
"aria-selected": selected || active,
|
|
24424
24926
|
className: cn(
|