@ceed/cds 1.15.0-next.8 → 1.15.0-next.9
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/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +2 -0
- package/dist/index.cjs +249 -195
- package/dist/index.js +74 -20
- package/framer/index.js +38 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4528,11 +4528,52 @@ var InsetDrawer = styled20(JoyDrawer2)(({ theme }) => ({
|
|
|
4528
4528
|
|
|
4529
4529
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
4530
4530
|
import React31, { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef8, useState as useState10 } from "react";
|
|
4531
|
-
import { Input as Input2, Stack as Stack2 } from "@mui/joy";
|
|
4532
4531
|
import SearchIcon from "@mui/icons-material/Search";
|
|
4533
4532
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
4533
|
+
function LabelWithTooltip(props) {
|
|
4534
|
+
const { label, size } = props;
|
|
4535
|
+
const labelContentRef = useRef8(null);
|
|
4536
|
+
const [isOverflowing, setIsOverflowing] = useState10(false);
|
|
4537
|
+
const labelContent = /* @__PURE__ */ React31.createElement(
|
|
4538
|
+
"span",
|
|
4539
|
+
{
|
|
4540
|
+
ref: labelContentRef,
|
|
4541
|
+
style: {
|
|
4542
|
+
textOverflow: "ellipsis",
|
|
4543
|
+
overflow: "hidden",
|
|
4544
|
+
whiteSpace: "nowrap",
|
|
4545
|
+
display: "block",
|
|
4546
|
+
position: "relative",
|
|
4547
|
+
zIndex: 1,
|
|
4548
|
+
cursor: "pointer"
|
|
4549
|
+
}
|
|
4550
|
+
},
|
|
4551
|
+
label
|
|
4552
|
+
);
|
|
4553
|
+
useEffect8(() => {
|
|
4554
|
+
const element = labelContentRef.current;
|
|
4555
|
+
if (element) {
|
|
4556
|
+
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
4557
|
+
}
|
|
4558
|
+
}, [label]);
|
|
4559
|
+
if (isOverflowing) {
|
|
4560
|
+
return /* @__PURE__ */ React31.createElement(Tooltip_default, { variant: "solid", size, title: label, placement: "bottom-start" }, labelContent);
|
|
4561
|
+
}
|
|
4562
|
+
return labelContent;
|
|
4563
|
+
}
|
|
4534
4564
|
function FilterableCheckboxGroup(props) {
|
|
4535
|
-
const {
|
|
4565
|
+
const {
|
|
4566
|
+
value,
|
|
4567
|
+
options,
|
|
4568
|
+
label,
|
|
4569
|
+
placeholder,
|
|
4570
|
+
helperText,
|
|
4571
|
+
size = "md",
|
|
4572
|
+
required,
|
|
4573
|
+
onChange,
|
|
4574
|
+
maxHeight = 300,
|
|
4575
|
+
disabled
|
|
4576
|
+
} = props;
|
|
4536
4577
|
const [searchTerm, setSearchTerm] = useState10("");
|
|
4537
4578
|
const [sortedOptions, setSortedOptions] = useState10(options);
|
|
4538
4579
|
const [internalValue, setInternalValue] = useControlledState(
|
|
@@ -4610,37 +4651,47 @@ function FilterableCheckboxGroup(props) {
|
|
|
4610
4651
|
const handleSelectAll = useCallback13(
|
|
4611
4652
|
(event) => {
|
|
4612
4653
|
const checked = event.target.checked;
|
|
4654
|
+
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
4655
|
+
const disabledSelectedValues = internalValue.filter(
|
|
4656
|
+
(v) => filteredOptions.some((opt) => opt.value === v && opt.disabled)
|
|
4657
|
+
);
|
|
4613
4658
|
if (checked) {
|
|
4614
|
-
|
|
4659
|
+
const enabledValues = enabledOptions.map((option) => option.value);
|
|
4660
|
+
setInternalValue([...disabledSelectedValues, ...enabledValues]);
|
|
4615
4661
|
} else {
|
|
4616
|
-
setInternalValue(
|
|
4662
|
+
setInternalValue(disabledSelectedValues);
|
|
4617
4663
|
}
|
|
4618
4664
|
},
|
|
4619
|
-
[filteredOptions, setInternalValue]
|
|
4665
|
+
[filteredOptions, internalValue, setInternalValue]
|
|
4620
4666
|
);
|
|
4621
|
-
const
|
|
4622
|
-
const
|
|
4623
|
-
|
|
4624
|
-
|
|
4667
|
+
const enabledFilteredOptions = useMemo12(() => filteredOptions.filter((option) => !option.disabled), [filteredOptions]);
|
|
4668
|
+
const isAllSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => internalValue.includes(option.value));
|
|
4669
|
+
const isIndeterminate = !isAllSelected && enabledFilteredOptions.some((option) => internalValue.includes(option.value));
|
|
4670
|
+
return /* @__PURE__ */ React31.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ React31.createElement(
|
|
4671
|
+
Input_default,
|
|
4625
4672
|
{
|
|
4673
|
+
label,
|
|
4674
|
+
helperText,
|
|
4675
|
+
required,
|
|
4626
4676
|
variant: "outlined",
|
|
4627
4677
|
color: "neutral",
|
|
4628
4678
|
placeholder,
|
|
4629
4679
|
value: searchTerm,
|
|
4630
4680
|
onChange: handleSearchChange,
|
|
4631
4681
|
size,
|
|
4682
|
+
disabled,
|
|
4632
4683
|
endDecorator: /* @__PURE__ */ React31.createElement(SearchIcon, null)
|
|
4633
4684
|
}
|
|
4634
|
-
),
|
|
4635
|
-
|
|
4685
|
+
), filteredOptions.length === 0 ? /* @__PURE__ */ React31.createElement(
|
|
4686
|
+
Stack_default,
|
|
4636
4687
|
{
|
|
4637
|
-
sx: {
|
|
4688
|
+
sx: (theme) => ({
|
|
4638
4689
|
padding: "20px 12px",
|
|
4639
4690
|
justifyContent: "center",
|
|
4640
4691
|
alignItems: "center",
|
|
4641
4692
|
fontSize: noOptionsFontSize,
|
|
4642
|
-
color:
|
|
4643
|
-
}
|
|
4693
|
+
color: theme.palette.neutral.softDisabledColor
|
|
4694
|
+
})
|
|
4644
4695
|
},
|
|
4645
4696
|
"No options found."
|
|
4646
4697
|
) : /* @__PURE__ */ React31.createElement(
|
|
@@ -4662,6 +4713,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
4662
4713
|
indeterminate: isIndeterminate,
|
|
4663
4714
|
onChange: handleSelectAll,
|
|
4664
4715
|
size,
|
|
4716
|
+
disabled,
|
|
4665
4717
|
slotProps: {
|
|
4666
4718
|
action: {
|
|
4667
4719
|
sx: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
@@ -4671,7 +4723,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
4671
4723
|
}
|
|
4672
4724
|
),
|
|
4673
4725
|
/* @__PURE__ */ React31.createElement(
|
|
4674
|
-
|
|
4726
|
+
Stack_default,
|
|
4675
4727
|
{
|
|
4676
4728
|
sx: {
|
|
4677
4729
|
height: `${virtualizer.getTotalSize()}px`,
|
|
@@ -4684,13 +4736,15 @@ function FilterableCheckboxGroup(props) {
|
|
|
4684
4736
|
Checkbox_default,
|
|
4685
4737
|
{
|
|
4686
4738
|
key: virtualRow.key,
|
|
4687
|
-
label: option.label,
|
|
4739
|
+
label: /* @__PURE__ */ React31.createElement(LabelWithTooltip, { label: option.label, size }),
|
|
4688
4740
|
checked: internalValue.includes(option.value),
|
|
4689
4741
|
onChange: handleCheckboxChange(option.value),
|
|
4690
4742
|
size,
|
|
4743
|
+
disabled: disabled || option.disabled,
|
|
4691
4744
|
slotProps: {
|
|
4692
4745
|
action: {
|
|
4693
4746
|
sx: { top: 0, left: 0, bottom: 0, right: 0 }
|
|
4747
|
+
// NOTE: 불필요한 좌우 스크롤 방지
|
|
4694
4748
|
}
|
|
4695
4749
|
},
|
|
4696
4750
|
sx: {
|
|
@@ -5375,7 +5429,7 @@ import {
|
|
|
5375
5429
|
AccordionDetails as JoyAccordionDetails2,
|
|
5376
5430
|
styled as styled23,
|
|
5377
5431
|
accordionSummaryClasses,
|
|
5378
|
-
Stack as
|
|
5432
|
+
Stack as Stack2
|
|
5379
5433
|
} from "@mui/joy";
|
|
5380
5434
|
var AccordionSummary2 = styled23(JoyAccordionSummary2, {
|
|
5381
5435
|
name: "NavigationGroup",
|
|
@@ -5399,7 +5453,7 @@ var AccordionDetails2 = styled23(JoyAccordionDetails2, {
|
|
|
5399
5453
|
}));
|
|
5400
5454
|
function NavigationGroup(props) {
|
|
5401
5455
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
5402
|
-
return /* @__PURE__ */ React37.createElement(JoyAccordion2, { ...rest }, /* @__PURE__ */ React37.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ React37.createElement(
|
|
5456
|
+
return /* @__PURE__ */ React37.createElement(JoyAccordion2, { ...rest }, /* @__PURE__ */ React37.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ React37.createElement(Stack2, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ React37.createElement(AccordionDetails2, null, children));
|
|
5403
5457
|
}
|
|
5404
5458
|
|
|
5405
5459
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
@@ -6062,7 +6116,7 @@ ThemeProvider.displayName = "ThemeProvider";
|
|
|
6062
6116
|
|
|
6063
6117
|
// src/components/Uploader/Uploader.tsx
|
|
6064
6118
|
import React46, { useCallback as useCallback17, useEffect as useEffect12, useMemo as useMemo15, useRef as useRef11, useState as useState15 } from "react";
|
|
6065
|
-
import { styled as styled29, Input as
|
|
6119
|
+
import { styled as styled29, Input as Input2 } from "@mui/joy";
|
|
6066
6120
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
6067
6121
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
6068
6122
|
import MuiClearIcon from "@mui/icons-material/ClearRounded";
|
|
@@ -6084,7 +6138,7 @@ var esmFiles = {
|
|
|
6084
6138
|
"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js"
|
|
6085
6139
|
)
|
|
6086
6140
|
};
|
|
6087
|
-
var VisuallyHiddenInput = styled29(
|
|
6141
|
+
var VisuallyHiddenInput = styled29(Input2)({
|
|
6088
6142
|
width: "1px",
|
|
6089
6143
|
height: "1px",
|
|
6090
6144
|
overflow: "hidden",
|