sellmate-design-system-react 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +78 -2
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +78 -2
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +78 -2
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +78 -2
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +78 -2
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +78 -2
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +78 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +78 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SField/SField.cjs +78 -2
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.js +78 -2
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +78 -2
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.js +78 -2
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SGnb/SGnb.cjs +58 -16
- package/dist/components/SGnb/SGnb.cjs.map +1 -1
- package/dist/components/SGnb/SGnb.d.ts +15 -0
- package/dist/components/SGnb/SGnb.js +58 -16
- package/dist/components/SGnb/SGnb.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +78 -2
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +78 -2
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +224 -118
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +224 -118
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +78 -2
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.js +78 -2
- package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +155 -49
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +155 -49
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/SSelect/select.config.d.ts +7 -0
- package/dist/components/STable/STable.cjs +155 -49
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +155 -49
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +78 -2
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +78 -2
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/STimePicker/STimePicker.cjs +78 -2
- package/dist/components/STimePicker/STimePicker.cjs.map +1 -1
- package/dist/components/STimePicker/STimePicker.js +78 -2
- package/dist/components/STimePicker/STimePicker.js.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs +78 -2
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js +78 -2
- package/dist/components/STimeRangePicker/STimeRangePicker.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +78 -2
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.d.ts +1 -1
- package/dist/components/STooltip/STooltip.js +78 -2
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +209 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -65
- package/dist/index.js.map +1 -1
- package/dist/styles.css +35 -8
- package/package.json +1 -1
|
@@ -18,6 +18,13 @@ export interface FlatOption {
|
|
|
18
18
|
export declare function flattenOptions(options: SSelectOption[], depth?: number): FlatOption[];
|
|
19
19
|
/** 선택 가능한(비그룹) 옵션만 */
|
|
20
20
|
export declare const selectableOptions: (flat: FlatOption[]) => FlatOption[];
|
|
21
|
+
/**
|
|
22
|
+
* flat 배열에서 groupIndex 위치 그룹의 하위(자손) 리프 중 '토글 가능한'(비활성 아님)
|
|
23
|
+
* 것들의 정규화 value 목록. flat 은 DFS 순서라 그룹 뒤로 depth 가 더 깊은 연속 구간이
|
|
24
|
+
* 그 그룹의 자손이며, 중첩 그룹의 리프까지 재귀 없이 모두 포함된다.
|
|
25
|
+
* (multi_depth 부모 체크박스의 상태/카운트/토글 계산에 사용)
|
|
26
|
+
*/
|
|
27
|
+
export declare function collectGroupLeafValues(flat: FlatOption[], groupIndex: number): string[];
|
|
21
28
|
/** 라벨에 HTML 태그가 있는지 (원본 isHtmlLabel) */
|
|
22
29
|
export declare const isHtmlLabel: (label: string) => boolean;
|
|
23
30
|
/** HTML 라벨에서 태그를 제거한 텍스트 (검색 매칭용, 원본 extractText) */
|
|
@@ -3466,7 +3466,14 @@ function useBody(content, message = []) {
|
|
|
3466
3466
|
if (content != null) return content;
|
|
3467
3467
|
if (message.length === 0) return null;
|
|
3468
3468
|
const singleLine = message.length === 1;
|
|
3469
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3469
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3470
|
+
"div",
|
|
3471
|
+
{
|
|
3472
|
+
className: singleLine ? "leading-[24px]" : void 0,
|
|
3473
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(line) }
|
|
3474
|
+
},
|
|
3475
|
+
i
|
|
3476
|
+
)) });
|
|
3470
3477
|
}
|
|
3471
3478
|
var STooltip = react.forwardRef(function STooltip2({
|
|
3472
3479
|
content,
|
|
@@ -3524,7 +3531,7 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3524
3531
|
if (disabled || body == null) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: triggerNode });
|
|
3525
3532
|
const isHover = trigger === "hover";
|
|
3526
3533
|
const contentClass = cn(
|
|
3527
|
-
"z-50
|
|
3534
|
+
"z-50 w-fit whitespace-nowrap rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3528
3535
|
FLOATING_SLIDE_ANIM,
|
|
3529
3536
|
className
|
|
3530
3537
|
);
|
|
@@ -3875,6 +3882,16 @@ function flattenOptions(options, depth = 1) {
|
|
|
3875
3882
|
return out;
|
|
3876
3883
|
}
|
|
3877
3884
|
var selectableOptions = (flat) => flat.filter((o) => !o.isGroup && !o.disabled);
|
|
3885
|
+
function collectGroupLeafValues(flat, groupIndex) {
|
|
3886
|
+
const group = flat[groupIndex];
|
|
3887
|
+
if (group == null || !group.isGroup) return [];
|
|
3888
|
+
const values = [];
|
|
3889
|
+
for (let i = groupIndex + 1; i < flat.length; i++) {
|
|
3890
|
+
if (flat[i].depth <= group.depth) break;
|
|
3891
|
+
if (!flat[i].isGroup && !flat[i].disabled) values.push(flat[i].value);
|
|
3892
|
+
}
|
|
3893
|
+
return values;
|
|
3894
|
+
}
|
|
3878
3895
|
var isHtmlLabel = (label) => /<[a-z][\s\S]*>/i.test(label);
|
|
3879
3896
|
var extractText = (html) => html.replace(/<[^>]*>/g, "");
|
|
3880
3897
|
var SEARCH_THRESHOLD = 11;
|
|
@@ -4000,16 +4017,31 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
4000
4017
|
const allValues = selectable.map((o) => o.value);
|
|
4001
4018
|
const allSelected = allValues.length > 0 && allValues.every((v) => selected.includes(v));
|
|
4002
4019
|
const hasItems = filtered.some((o) => !o.isGroup);
|
|
4020
|
+
const groupLeafValues = react.useMemo(() => {
|
|
4021
|
+
const map = /* @__PURE__ */ new Map();
|
|
4022
|
+
filtered.forEach((o, i) => {
|
|
4023
|
+
if (o.isGroup) map.set(i, collectGroupLeafValues(filtered, i));
|
|
4024
|
+
});
|
|
4025
|
+
return map;
|
|
4026
|
+
}, [filtered]);
|
|
4003
4027
|
const navigableItems = react.useMemo(() => {
|
|
4004
4028
|
const items = [];
|
|
4005
4029
|
if (multi && useSelectAll && allValues.length > 0) {
|
|
4006
|
-
items.push({
|
|
4030
|
+
items.push({ key: "__select_all__", isSelectAll: true });
|
|
4007
4031
|
}
|
|
4008
|
-
filtered.forEach((o) => {
|
|
4009
|
-
if (
|
|
4032
|
+
filtered.forEach((o, i) => {
|
|
4033
|
+
if (o.disabled) return;
|
|
4034
|
+
if (o.isGroup) {
|
|
4035
|
+
if (!multi) return;
|
|
4036
|
+
const leafValues = groupLeafValues.get(i) ?? [];
|
|
4037
|
+
if (leafValues.length === 0) return;
|
|
4038
|
+
items.push({ key: `__group_${i}__`, isGroup: true, leafValues });
|
|
4039
|
+
} else {
|
|
4040
|
+
items.push({ key: o.value, value: o.value });
|
|
4041
|
+
}
|
|
4010
4042
|
});
|
|
4011
4043
|
return items;
|
|
4012
|
-
}, [allValues.length, filtered, multi, useSelectAll]);
|
|
4044
|
+
}, [allValues.length, filtered, groupLeafValues, multi, useSelectAll]);
|
|
4013
4045
|
const triggerText = (() => {
|
|
4014
4046
|
if (selected.length === 0) return placeholder;
|
|
4015
4047
|
if (multi) {
|
|
@@ -4031,6 +4063,17 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
4031
4063
|
const handleSelectAll = () => {
|
|
4032
4064
|
emit(allSelected ? [] : allValues);
|
|
4033
4065
|
};
|
|
4066
|
+
const handleToggleGroup = (leafValues) => {
|
|
4067
|
+
if (leafValues.length === 0) return;
|
|
4068
|
+
const selectedSet = new Set(selected);
|
|
4069
|
+
const allSelectedInGroup = leafValues.every((v) => selectedSet.has(v));
|
|
4070
|
+
if (allSelectedInGroup) {
|
|
4071
|
+
const remove = new Set(leafValues);
|
|
4072
|
+
emit(selected.filter((v) => !remove.has(v)));
|
|
4073
|
+
} else {
|
|
4074
|
+
emit([...selected, ...leafValues.filter((v) => !selectedSet.has(v))]);
|
|
4075
|
+
}
|
|
4076
|
+
};
|
|
4034
4077
|
react.useEffect(() => {
|
|
4035
4078
|
if (!open) {
|
|
4036
4079
|
setFocusedIndex(-1);
|
|
@@ -4071,6 +4114,10 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
4071
4114
|
handleSelectAll();
|
|
4072
4115
|
return;
|
|
4073
4116
|
}
|
|
4117
|
+
if (focused.isGroup) {
|
|
4118
|
+
handleToggleGroup(focused.leafValues ?? []);
|
|
4119
|
+
return;
|
|
4120
|
+
}
|
|
4074
4121
|
handleSelect(focused.value);
|
|
4075
4122
|
};
|
|
4076
4123
|
const handleKeyDown = (event) => {
|
|
@@ -4234,20 +4281,20 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
4234
4281
|
items: filtered,
|
|
4235
4282
|
multi,
|
|
4236
4283
|
selected,
|
|
4237
|
-
|
|
4284
|
+
groupLeafValues,
|
|
4285
|
+
focusedValue: navigableItems[focusedIndex]?.key,
|
|
4238
4286
|
showSelectAll: multi && useSelectAll && allValues.length > 0,
|
|
4239
4287
|
selectAllLabel: allSelectedLabel,
|
|
4240
4288
|
selectAllSelected: allSelected,
|
|
4241
4289
|
onSelectAll: handleSelectAll,
|
|
4242
4290
|
onSelect: handleSelect,
|
|
4243
|
-
|
|
4244
|
-
|
|
4291
|
+
onToggleGroup: handleToggleGroup,
|
|
4292
|
+
onHoverValue: (key) => {
|
|
4293
|
+
if (key == null) {
|
|
4245
4294
|
setFocusedIndex(-1);
|
|
4246
4295
|
return;
|
|
4247
4296
|
}
|
|
4248
|
-
const index = navigableItems.findIndex(
|
|
4249
|
-
(item) => item.isSelectAll ? value2 === "__select_all__" : item.value === value2
|
|
4250
|
-
);
|
|
4297
|
+
const index = navigableItems.findIndex((item) => item.key === key);
|
|
4251
4298
|
if (index >= 0) setFocusedIndex(index);
|
|
4252
4299
|
}
|
|
4253
4300
|
}
|
|
@@ -4266,20 +4313,23 @@ function ItemList({
|
|
|
4266
4313
|
items,
|
|
4267
4314
|
multi,
|
|
4268
4315
|
selected,
|
|
4316
|
+
groupLeafValues,
|
|
4269
4317
|
focusedValue,
|
|
4270
4318
|
showSelectAll,
|
|
4271
4319
|
selectAllLabel,
|
|
4272
4320
|
selectAllSelected,
|
|
4273
4321
|
onSelectAll,
|
|
4274
4322
|
onSelect,
|
|
4323
|
+
onToggleGroup,
|
|
4275
4324
|
onHoverValue
|
|
4276
4325
|
}) {
|
|
4326
|
+
const selectedSet = react.useMemo(() => new Set(selected), [selected]);
|
|
4277
4327
|
const itemBase = cn(
|
|
4278
4328
|
"group flex w-full cursor-pointer select-none items-center gap-[8px] border-none bg-transparent text-left text-[12px] leading-[20px] outline-none",
|
|
4279
4329
|
"text-[color:var(--cmp-listItem-content-default)]",
|
|
4280
4330
|
"disabled:cursor-not-allowed disabled:text-[color:var(--cmp-listItem-content-disabled)]"
|
|
4281
4331
|
);
|
|
4282
|
-
const activeClass = "hover:bg-[var(--cmp-listItem-bg-hover)] hover:text-[color:var(--cmp-listItem-content-hover)] focus:bg-[var(--cmp-listItem-bg-hover)] focus:text-[color:var(--cmp-listItem-content-hover)]";
|
|
4332
|
+
const activeClass = "hover:bg-[var(--cmp-listItem-bg-hover)] hover:text-[color:var(--cmp-listItem-content-hover)] focus-visible:bg-[var(--cmp-listItem-bg-hover)] focus-visible:text-[color:var(--cmp-listItem-content-hover)]";
|
|
4283
4333
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
4284
4334
|
showSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4285
4335
|
"button",
|
|
@@ -4296,23 +4346,7 @@ function ItemList({
|
|
|
4296
4346
|
onMouseLeave: () => onHoverValue(null),
|
|
4297
4347
|
onClick: onSelectAll,
|
|
4298
4348
|
children: [
|
|
4299
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4300
|
-
"span",
|
|
4301
|
-
{
|
|
4302
|
-
className: cn(
|
|
4303
|
-
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4304
|
-
selectAllSelected ? focusedValue === "__select_all__" ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4305
|
-
),
|
|
4306
|
-
children: selectAllSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4307
|
-
SIcon,
|
|
4308
|
-
{
|
|
4309
|
-
name: "checkboxCheck",
|
|
4310
|
-
size: 12,
|
|
4311
|
-
color: "var(--cmp-checkbox-checked-icon-default)"
|
|
4312
|
-
}
|
|
4313
|
-
)
|
|
4314
|
-
}
|
|
4315
|
-
),
|
|
4349
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxBox, { state: selectAllSelected, focused: focusedValue === "__select_all__" }),
|
|
4316
4350
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: selectAllLabel })
|
|
4317
4351
|
]
|
|
4318
4352
|
}
|
|
@@ -4322,12 +4356,71 @@ function ItemList({
|
|
|
4322
4356
|
const rowKey = `${o.value}-${idx}`;
|
|
4323
4357
|
if (o.isGroup) {
|
|
4324
4358
|
const isDepth1 = o.depth === 1;
|
|
4359
|
+
const groupTone = isDepth1 ? "border-t border-solid border-[color:var(--cmp-listItem-depth1-border-color)] bg-[var(--cmp-listItem-depth1-bg-default)] font-bold" : "bg-[var(--cmp-listItem-depth2-middle-bg)] font-medium";
|
|
4360
|
+
if (multi) {
|
|
4361
|
+
const leafValues = groupLeafValues.get(idx) ?? [];
|
|
4362
|
+
const total = leafValues.length;
|
|
4363
|
+
const selectedCount = leafValues.reduce((n, v) => selectedSet.has(v) ? n + 1 : n, 0);
|
|
4364
|
+
const groupState = total === 0 || selectedCount === 0 ? false : selectedCount === total ? true : null;
|
|
4365
|
+
const groupDisabled = o.disabled || total === 0;
|
|
4366
|
+
const groupFocused = focusedValue === `__group_${idx}__`;
|
|
4367
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4368
|
+
"button",
|
|
4369
|
+
{
|
|
4370
|
+
type: "button",
|
|
4371
|
+
role: "option",
|
|
4372
|
+
"aria-selected": groupState === true,
|
|
4373
|
+
disabled: groupDisabled,
|
|
4374
|
+
"data-select-focused": groupFocused ? "true" : void 0,
|
|
4375
|
+
"data-select-active": groupFocused ? "true" : void 0,
|
|
4376
|
+
className: cn(
|
|
4377
|
+
"flex w-full select-none items-center gap-[8px] border-none py-[4px] pr-[12px] text-left text-[12px] leading-[20px] text-[color:var(--cmp-listItem-content-default)]",
|
|
4378
|
+
groupTone,
|
|
4379
|
+
groupDisabled ? "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]" : "cursor-pointer",
|
|
4380
|
+
groupDisabled && isDepth1 && "bg-[var(--cmp-listItem-depth1-bg-disabled)]",
|
|
4381
|
+
// 포커스 하이라이트는 depth 배경보다 뒤에 둬 tailwind-merge 로 이기게 한다.
|
|
4382
|
+
groupFocused && !groupDisabled && "bg-[var(--cmp-listItem-bg-hover)] text-[color:var(--cmp-listItem-content-hover)]"
|
|
4383
|
+
),
|
|
4384
|
+
style: { paddingLeft: padLeft },
|
|
4385
|
+
onMouseEnter: () => onHoverValue(`__group_${idx}__`),
|
|
4386
|
+
onMouseLeave: () => onHoverValue(null),
|
|
4387
|
+
onClick: () => onToggleGroup(leafValues),
|
|
4388
|
+
children: [
|
|
4389
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxBox, { state: groupState, disabled: groupDisabled, focused: groupFocused }),
|
|
4390
|
+
isHtmlLabel(o.label) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4391
|
+
"span",
|
|
4392
|
+
{
|
|
4393
|
+
className: "min-w-0 truncate",
|
|
4394
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(o.label) }
|
|
4395
|
+
}
|
|
4396
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: o.label }),
|
|
4397
|
+
total > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4398
|
+
"span",
|
|
4399
|
+
{
|
|
4400
|
+
className: cn(
|
|
4401
|
+
"shrink-0 font-medium",
|
|
4402
|
+
groupFocused ? "text-white" : "text-[color:var(--cmp-listItem-content-disabled)]"
|
|
4403
|
+
),
|
|
4404
|
+
children: [
|
|
4405
|
+
"(",
|
|
4406
|
+
selectedCount,
|
|
4407
|
+
"/",
|
|
4408
|
+
total,
|
|
4409
|
+
")"
|
|
4410
|
+
]
|
|
4411
|
+
}
|
|
4412
|
+
)
|
|
4413
|
+
]
|
|
4414
|
+
},
|
|
4415
|
+
rowKey
|
|
4416
|
+
);
|
|
4417
|
+
}
|
|
4325
4418
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4326
4419
|
"div",
|
|
4327
4420
|
{
|
|
4328
4421
|
className: cn(
|
|
4329
4422
|
"select-none py-[4px] pr-[12px] text-[12px] leading-[20px] text-[color:var(--cmp-listItem-content-default)]",
|
|
4330
|
-
|
|
4423
|
+
groupTone,
|
|
4331
4424
|
// 하위가 전부 비활성이면(select.config 에서 bubble-up) 어미 그룹도 비활성 처리:
|
|
4332
4425
|
// 텍스트는 회색(#888), depth1 그룹은 파란 배경 대신 회색(#EEE)으로 (depth2 는 #F6F6F6 유지)
|
|
4333
4426
|
o.disabled && "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]",
|
|
@@ -4363,25 +4456,11 @@ function ItemList({
|
|
|
4363
4456
|
onClick: () => onSelect(o.value),
|
|
4364
4457
|
children: [
|
|
4365
4458
|
multi && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4366
|
-
|
|
4459
|
+
CheckboxBox,
|
|
4367
4460
|
{
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4372
|
-
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4373
|
-
) : cn(
|
|
4374
|
-
isSelected ? focusedValue === o.value ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4375
|
-
)
|
|
4376
|
-
),
|
|
4377
|
-
children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4378
|
-
SIcon,
|
|
4379
|
-
{
|
|
4380
|
-
name: "checkboxCheck",
|
|
4381
|
-
size: 12,
|
|
4382
|
-
color: o.disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4383
|
-
}
|
|
4384
|
-
)
|
|
4461
|
+
state: isSelected,
|
|
4462
|
+
disabled: o.disabled,
|
|
4463
|
+
focused: focusedValue === o.value
|
|
4385
4464
|
}
|
|
4386
4465
|
),
|
|
4387
4466
|
isHtmlLabel(o.label) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4398,6 +4477,33 @@ function ItemList({
|
|
|
4398
4477
|
})
|
|
4399
4478
|
] });
|
|
4400
4479
|
}
|
|
4480
|
+
function CheckboxBox({
|
|
4481
|
+
state,
|
|
4482
|
+
disabled = false,
|
|
4483
|
+
focused = false
|
|
4484
|
+
}) {
|
|
4485
|
+
const filled = state === true || state === null;
|
|
4486
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4487
|
+
"span",
|
|
4488
|
+
{
|
|
4489
|
+
className: cn(
|
|
4490
|
+
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4491
|
+
disabled ? (
|
|
4492
|
+
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4493
|
+
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4494
|
+
) : filled ? focused ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4495
|
+
),
|
|
4496
|
+
children: filled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4497
|
+
SIcon,
|
|
4498
|
+
{
|
|
4499
|
+
name: state === null ? "checkboxIndeterminate" : "checkboxCheck",
|
|
4500
|
+
size: 12,
|
|
4501
|
+
color: disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4502
|
+
}
|
|
4503
|
+
)
|
|
4504
|
+
}
|
|
4505
|
+
);
|
|
4506
|
+
}
|
|
4401
4507
|
var DEFAULT_ROW_HEIGHT = 44;
|
|
4402
4508
|
var DENSE_ROW_HEIGHT = 32;
|
|
4403
4509
|
var SELECTABLE_COLUMN_WIDTH = 48;
|