sellmate-design-system-react 9.0.0-beta.26 → 9.0.0-beta.27
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/SChipFilter/README.md +10 -5
- package/dist/components/SChipFilter/SChipFilter.d.ts +8 -3
- package/dist/components/SGhostButton/README.md +0 -2
- package/dist/components/SSearchInput/README.md +2 -0
- package/dist/components/SSelect/README.md +1 -1
- package/dist/components/SSelect/SSelect.d.ts +1 -1
- package/dist/index.cjs +141 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +141 -85
- package/dist/index.js.map +1 -1
- package/dist/lib/floating-height.d.ts +15 -0
- package/dist/llms-full.txt +11 -6
- package/dist/styles.css +0 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10416,6 +10416,14 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10416
10416
|
}
|
|
10417
10417
|
);
|
|
10418
10418
|
});
|
|
10419
|
+
|
|
10420
|
+
// src/lib/floating-height.ts
|
|
10421
|
+
var POPOVER_AVAILABLE_HEIGHT = "var(--radix-popover-content-available-height)";
|
|
10422
|
+
function clampToAvailableHeight(value, availableHeight) {
|
|
10423
|
+
if (value == null || value === "") return availableHeight;
|
|
10424
|
+
const css = typeof value === "number" ? `${value}px` : value;
|
|
10425
|
+
return `min(${css}, ${availableHeight})`;
|
|
10426
|
+
}
|
|
10419
10427
|
function runRules(value, rules) {
|
|
10420
10428
|
if (!rules || rules.length === 0) return "";
|
|
10421
10429
|
for (const rule of rules) {
|
|
@@ -10813,7 +10821,7 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
10813
10821
|
error = false,
|
|
10814
10822
|
rules,
|
|
10815
10823
|
labelTooltipProps,
|
|
10816
|
-
dropdownHeight = "
|
|
10824
|
+
dropdownHeight = "640px",
|
|
10817
10825
|
dropdownWidth,
|
|
10818
10826
|
maxDropdownWidth = "640px",
|
|
10819
10827
|
label,
|
|
@@ -11174,6 +11182,7 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
11174
11182
|
placement: "bottom",
|
|
11175
11183
|
align: "start",
|
|
11176
11184
|
offset: 4,
|
|
11185
|
+
viewportPadding: 24,
|
|
11177
11186
|
fit: !dropdownWidth,
|
|
11178
11187
|
onOpenAutoFocus: (event) => {
|
|
11179
11188
|
if (!showSearch) {
|
|
@@ -11206,7 +11215,7 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
11206
11215
|
SCROLLBAR_TRACK_BG_CLASS,
|
|
11207
11216
|
SCROLLBAR_TRACK_BORDER_CLASS
|
|
11208
11217
|
),
|
|
11209
|
-
style: { maxHeight: dropdownHeight },
|
|
11218
|
+
style: { maxHeight: clampToAvailableHeight(dropdownHeight, POPOVER_AVAILABLE_HEIGHT) },
|
|
11210
11219
|
onMouseLeave: () => setFocusedIndex(-1),
|
|
11211
11220
|
children: [
|
|
11212
11221
|
showSearch && /* @__PURE__ */ jsx(
|
|
@@ -17359,6 +17368,8 @@ var SEditor = /* @__PURE__ */ forwardRef(function SEditor2({
|
|
|
17359
17368
|
});
|
|
17360
17369
|
var CHIPFILTER_LISTBOX_WIDTH = 240;
|
|
17361
17370
|
var CHIPFILTER_DATE_PRESET_LISTBOX_WIDTH = 246;
|
|
17371
|
+
var EDITOR_LISTBOX_MAX_HEIGHT = "min(640px, var(--radix-popover-content-available-height))";
|
|
17372
|
+
var EDITOR_POPOVER_VIEWPORT_PADDING = 24;
|
|
17362
17373
|
var CHIPFILTER = {
|
|
17363
17374
|
barBg: "var(--cmp-chipFilter-bar-bg)",
|
|
17364
17375
|
barBorder: "var(--cmp-chipFilter-bar-border)",
|
|
@@ -17398,6 +17409,7 @@ var CHIPFILTER = {
|
|
|
17398
17409
|
itemTextDefault: "var(--cmp-chipFilter-item-text-default)",
|
|
17399
17410
|
itemTextSelected: "var(--cmp-chipFilter-item-text-selected)"
|
|
17400
17411
|
};
|
|
17412
|
+
var DEFAULT_CUSTOM_MAX_RANGE = 90;
|
|
17401
17413
|
var DEFAULT_PERIOD_PRESETS = [
|
|
17402
17414
|
{ value: "day", label: "\uC77C\uBCC4" },
|
|
17403
17415
|
{ value: "month", label: "\uC6D4\uBCC4" },
|
|
@@ -17406,6 +17418,20 @@ var DEFAULT_PERIOD_PRESETS = [
|
|
|
17406
17418
|
{ value: "year", label: "\uC5F0\uB3C4\uBCC4" },
|
|
17407
17419
|
{ value: "custom", label: "\uC0AC\uC6A9\uC790 \uC9C0\uC815", custom: true }
|
|
17408
17420
|
];
|
|
17421
|
+
var DEFAULT_DATE_RANGE_PRESETS = [
|
|
17422
|
+
{ value: "today", label: "\uC624\uB298", resolve: () => todayIso() },
|
|
17423
|
+
{
|
|
17424
|
+
value: "last7",
|
|
17425
|
+
label: "\uC9C0\uB09C 7\uC77C",
|
|
17426
|
+
resolve: () => [addDaysIso(todayIso(), -7), todayIso()]
|
|
17427
|
+
},
|
|
17428
|
+
{
|
|
17429
|
+
value: "last30",
|
|
17430
|
+
label: "\uC9C0\uB09C 30\uC77C",
|
|
17431
|
+
resolve: () => [addDaysIso(todayIso(), -30), todayIso()]
|
|
17432
|
+
},
|
|
17433
|
+
{ value: "custom", label: "\uC0AC\uC6A9\uC790 \uC9C0\uC815", custom: true }
|
|
17434
|
+
];
|
|
17409
17435
|
var isKeywordValue = (value) => typeof value === "object" && value != null && !Array.isArray(value) && "keywords" in value;
|
|
17410
17436
|
var isPeriodValue = (value) => typeof value === "object" && value != null && !Array.isArray(value) && "unit" in value;
|
|
17411
17437
|
var keywordEntries = (value) => {
|
|
@@ -17430,23 +17456,39 @@ var todayIso = () => {
|
|
|
17430
17456
|
const pad = (n) => String(n).padStart(2, "0");
|
|
17431
17457
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
17432
17458
|
};
|
|
17459
|
+
var addDaysIso = (iso, n) => {
|
|
17460
|
+
const d = /* @__PURE__ */ new Date(`${iso}T00:00:00`);
|
|
17461
|
+
d.setDate(d.getDate() + n);
|
|
17462
|
+
const pad = (v) => String(v).padStart(2, "0");
|
|
17463
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
17464
|
+
};
|
|
17433
17465
|
var isInlineDateField = (field) => field.type === "datepicker-range" && field.radioButton === true && (field.presets?.length ?? 0) > 0;
|
|
17434
17466
|
var getFieldPresets = (field) => {
|
|
17435
17467
|
if (field.type === "datepicker-statistics") return field.presets ?? DEFAULT_PERIOD_PRESETS;
|
|
17436
|
-
return field.presets ??
|
|
17468
|
+
return field.presets ?? DEFAULT_DATE_RANGE_PRESETS;
|
|
17437
17469
|
};
|
|
17438
|
-
var
|
|
17470
|
+
var getEffectiveMaxRange = (field) => {
|
|
17471
|
+
if (field.maxRange !== void 0) return field.maxRange;
|
|
17472
|
+
const hasCustomPreset = getFieldPresets(field).some((preset) => preset.custom);
|
|
17473
|
+
return hasCustomPreset ? DEFAULT_CUSTOM_MAX_RANGE : void 0;
|
|
17474
|
+
};
|
|
17475
|
+
var getPresetLabel = (preset, maxRange) => {
|
|
17476
|
+
if (!preset.custom || !maxRange || preset.label.includes("\uCD5C\uB300")) return preset.label;
|
|
17477
|
+
return `${preset.label} (\uCD5C\uB300 ${maxRange}\uC77C\uC529)`;
|
|
17478
|
+
};
|
|
17479
|
+
var getDefaultPeriodInputValue = (unit, maxRange) => {
|
|
17439
17480
|
const today = todayIso();
|
|
17440
17481
|
if (unit === "day") return today;
|
|
17441
17482
|
if (unit === "month") return today.slice(0, 7);
|
|
17442
17483
|
if (unit === "quarter") return 1;
|
|
17443
17484
|
if (unit === "half") return "first";
|
|
17444
17485
|
if (unit === "year") return today.slice(0, 4);
|
|
17445
|
-
|
|
17486
|
+
const days = maxRange && maxRange > 0 ? maxRange : DEFAULT_CUSTOM_MAX_RANGE;
|
|
17487
|
+
return [addDaysIso(today, -days), today];
|
|
17446
17488
|
};
|
|
17447
|
-
var createPeriodValue = (unit) => ({
|
|
17489
|
+
var createPeriodValue = (unit, maxRange) => ({
|
|
17448
17490
|
unit,
|
|
17449
|
-
value: getDefaultPeriodInputValue(unit)
|
|
17491
|
+
value: getDefaultPeriodInputValue(unit, maxRange)
|
|
17450
17492
|
});
|
|
17451
17493
|
var resolveFieldDefault = (field) => {
|
|
17452
17494
|
if (field.defaultValue !== void 0 && isFixedField(field)) return field.defaultValue;
|
|
@@ -17995,6 +18037,7 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
17995
18037
|
side: "bottom",
|
|
17996
18038
|
align: "start",
|
|
17997
18039
|
sideOffset: 4,
|
|
18040
|
+
collisionPadding: EDITOR_POPOVER_VIEWPORT_PADDING,
|
|
17998
18041
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
17999
18042
|
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
18000
18043
|
style: editorPopoverStyle,
|
|
@@ -18160,6 +18203,7 @@ function EditorPanel({
|
|
|
18160
18203
|
onClose
|
|
18161
18204
|
}) {
|
|
18162
18205
|
const wrapsInPaddedTop = field.type === "datepicker-day" || field.type === "datepicker-range" || field.type === "datepicker-statistics";
|
|
18206
|
+
const isScrollableListField = field.type === "select" || field.type === "select-multi" || field.type === "keyword";
|
|
18163
18207
|
const isMulti = field.type === "select-multi";
|
|
18164
18208
|
const selectableValues = isMulti ? (field.options ?? []).filter((option) => !option.disabled).map((option) => option.value) : [];
|
|
18165
18209
|
const selectedValues = isMulti ? toArrayValue(value) : [];
|
|
@@ -18169,7 +18213,7 @@ function EditorPanel({
|
|
|
18169
18213
|
allSelected ? selectedValues.filter((v) => !selectableValues.includes(v)) : [...selectedValues, ...selectableValues.filter((v) => !selectedValues.includes(v))]
|
|
18170
18214
|
);
|
|
18171
18215
|
};
|
|
18172
|
-
return /* @__PURE__ */ jsxs(ListBox, { children: [
|
|
18216
|
+
return /* @__PURE__ */ jsxs(ListBox, { maxHeight: isScrollableListField ? EDITOR_LISTBOX_MAX_HEIGHT : void 0, children: [
|
|
18173
18217
|
wrapsInPaddedTop ? /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[var(--cmp-chipFilter-listbox-top-gap)] px-[var(--cmp-chipFilter-listbox-top-paddingX)] py-[var(--cmp-chipFilter-listbox-top-paddingY)]", children: /* @__PURE__ */ jsx(
|
|
18174
18218
|
FilterEditor,
|
|
18175
18219
|
{
|
|
@@ -18192,7 +18236,7 @@ function EditorPanel({
|
|
|
18192
18236
|
/* @__PURE__ */ jsxs(
|
|
18193
18237
|
"div",
|
|
18194
18238
|
{
|
|
18195
|
-
className: "flex items-center justify-end gap-[var(--cmp-chipFilter-listbox-bottom-gap)] border-t border-solid px-[var(--cmp-chipFilter-listbox-bottom-paddingX)] py-[var(--cmp-chipFilter-listbox-bottom-paddingY)]",
|
|
18239
|
+
className: "flex shrink-0 items-center justify-end gap-[var(--cmp-chipFilter-listbox-bottom-gap)] border-t border-solid px-[var(--cmp-chipFilter-listbox-bottom-paddingX)] py-[var(--cmp-chipFilter-listbox-bottom-paddingY)]",
|
|
18196
18240
|
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18197
18241
|
children: [
|
|
18198
18242
|
isMulti && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -18307,6 +18351,7 @@ function DatePresetEditor({
|
|
|
18307
18351
|
onValueChange
|
|
18308
18352
|
}) {
|
|
18309
18353
|
const presets = getFieldPresets(field);
|
|
18354
|
+
const maxRange = getEffectiveMaxRange(field);
|
|
18310
18355
|
const [selectedId, setSelectedId] = useState(() => matchPresetId(presets, value));
|
|
18311
18356
|
const syncedInitialValueRef = useRef(!isEmptyValue(value));
|
|
18312
18357
|
useEffect(() => {
|
|
@@ -18317,7 +18362,13 @@ function DatePresetEditor({
|
|
|
18317
18362
|
const selectedPreset = presets.find((preset) => preset.value === selectedId);
|
|
18318
18363
|
const selectPreset = (preset) => {
|
|
18319
18364
|
setSelectedId(preset.value);
|
|
18320
|
-
if (!preset.custom)
|
|
18365
|
+
if (!preset.custom) {
|
|
18366
|
+
onValueChange(preset.resolve ? preset.resolve() : preset.value);
|
|
18367
|
+
return;
|
|
18368
|
+
}
|
|
18369
|
+
const today = todayIso();
|
|
18370
|
+
const days = maxRange && maxRange > 0 ? maxRange : DEFAULT_CUSTOM_MAX_RANGE;
|
|
18371
|
+
onValueChange([addDaysIso(today, -days), today]);
|
|
18321
18372
|
};
|
|
18322
18373
|
if (presets.length === 0) {
|
|
18323
18374
|
return /* @__PURE__ */ jsx(
|
|
@@ -18326,7 +18377,7 @@ function DatePresetEditor({
|
|
|
18326
18377
|
value: Array.isArray(value) && value.length === 2 ? value : null,
|
|
18327
18378
|
onValueChange,
|
|
18328
18379
|
selectable: field.selectable,
|
|
18329
|
-
maxRange
|
|
18380
|
+
maxRange,
|
|
18330
18381
|
disabled,
|
|
18331
18382
|
width: "100%"
|
|
18332
18383
|
}
|
|
@@ -18338,7 +18389,7 @@ function DatePresetEditor({
|
|
|
18338
18389
|
{
|
|
18339
18390
|
val: preset.value,
|
|
18340
18391
|
value: selectedId,
|
|
18341
|
-
label: preset
|
|
18392
|
+
label: getPresetLabel(preset, maxRange),
|
|
18342
18393
|
disabled,
|
|
18343
18394
|
onValueChange: () => selectPreset(preset)
|
|
18344
18395
|
},
|
|
@@ -18350,7 +18401,7 @@ function DatePresetEditor({
|
|
|
18350
18401
|
value: Array.isArray(value) && value.length === 2 ? value : null,
|
|
18351
18402
|
onValueChange,
|
|
18352
18403
|
selectable: field.selectable,
|
|
18353
|
-
maxRange
|
|
18404
|
+
maxRange,
|
|
18354
18405
|
disabled
|
|
18355
18406
|
}
|
|
18356
18407
|
)
|
|
@@ -18363,9 +18414,10 @@ function PeriodPresetEditor({
|
|
|
18363
18414
|
onValueChange
|
|
18364
18415
|
}) {
|
|
18365
18416
|
const presets = getFieldPresets(field);
|
|
18417
|
+
const maxRange = getEffectiveMaxRange(field);
|
|
18366
18418
|
const firstUnit = presets.find((preset) => !preset.custom)?.value ?? "day";
|
|
18367
18419
|
const [selectedId, setSelectedId] = useState(() => matchPresetId(presets, value) ?? firstUnit);
|
|
18368
|
-
const periodValue = isPeriodValue(value) ? value : createPeriodValue(selectedId ?? firstUnit);
|
|
18420
|
+
const periodValue = isPeriodValue(value) ? value : createPeriodValue(selectedId ?? firstUnit, maxRange);
|
|
18369
18421
|
const selectedUnit = selectedId ?? periodValue.unit;
|
|
18370
18422
|
useEffect(() => {
|
|
18371
18423
|
if (isEmptyValue(value)) return;
|
|
@@ -18374,7 +18426,7 @@ function PeriodPresetEditor({
|
|
|
18374
18426
|
const selectPreset = (preset) => {
|
|
18375
18427
|
const nextUnit = preset.value;
|
|
18376
18428
|
setSelectedId(nextUnit);
|
|
18377
|
-
onValueChange(createPeriodValue(nextUnit));
|
|
18429
|
+
onValueChange(createPeriodValue(nextUnit, maxRange));
|
|
18378
18430
|
};
|
|
18379
18431
|
const updateInputValue = (nextValue) => {
|
|
18380
18432
|
onValueChange({ unit: selectedUnit, value: nextValue });
|
|
@@ -18457,7 +18509,7 @@ function PeriodPresetEditor({
|
|
|
18457
18509
|
value: Array.isArray(periodValue.value) && periodValue.value.length === 2 ? periodValue.value : null,
|
|
18458
18510
|
onValueChange: updateInputValue,
|
|
18459
18511
|
selectable: field.selectable,
|
|
18460
|
-
maxRange
|
|
18512
|
+
maxRange,
|
|
18461
18513
|
disabled,
|
|
18462
18514
|
width: "100%"
|
|
18463
18515
|
}
|
|
@@ -18469,7 +18521,7 @@ function PeriodPresetEditor({
|
|
|
18469
18521
|
{
|
|
18470
18522
|
val: preset.value,
|
|
18471
18523
|
value: selectedId,
|
|
18472
|
-
label: preset
|
|
18524
|
+
label: getPresetLabel(preset, maxRange),
|
|
18473
18525
|
disabled,
|
|
18474
18526
|
onValueChange: () => selectPreset(preset)
|
|
18475
18527
|
},
|
|
@@ -18681,7 +18733,7 @@ function KeywordEditor({
|
|
|
18681
18733
|
}
|
|
18682
18734
|
};
|
|
18683
18735
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18684
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--cmp-chipFilter-listbox-top-gap)] px-[var(--cmp-chipFilter-listbox-top-paddingX)] py-[var(--cmp-chipFilter-listbox-top-paddingY)]", children: [
|
|
18736
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col gap-[var(--cmp-chipFilter-listbox-top-gap)] px-[var(--cmp-chipFilter-listbox-top-paddingX)] py-[var(--cmp-chipFilter-listbox-top-paddingY)]", children: [
|
|
18685
18737
|
field.matchModes && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
18686
18738
|
/* @__PURE__ */ jsx(
|
|
18687
18739
|
"span",
|
|
@@ -18723,7 +18775,7 @@ function KeywordEditor({
|
|
|
18723
18775
|
entries3.length > 0 && /* @__PURE__ */ jsx(
|
|
18724
18776
|
"div",
|
|
18725
18777
|
{
|
|
18726
|
-
className: "
|
|
18778
|
+
className: "min-h-0 flex-1 overflow-auto border-t border-solid py-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18727
18779
|
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18728
18780
|
children: entries3.map((entry) => /* @__PURE__ */ jsx(
|
|
18729
18781
|
KeywordEntryRow,
|
|
@@ -18781,6 +18833,7 @@ function OptionList({
|
|
|
18781
18833
|
const selected = multiple ? toArrayValue(value) : [];
|
|
18782
18834
|
const singleValue = !multiple && (typeof value === "string" || typeof value === "number") ? value : null;
|
|
18783
18835
|
const [search, setSearch] = useState("");
|
|
18836
|
+
const searchInputRef = useRef(null);
|
|
18784
18837
|
const options = field.options ?? [];
|
|
18785
18838
|
const showSearch = options.length >= OPTION_SEARCH_THRESHOLD;
|
|
18786
18839
|
const filteredOptions = useMemo(() => {
|
|
@@ -18788,74 +18841,70 @@ function OptionList({
|
|
|
18788
18841
|
const query = search.trim().toLowerCase();
|
|
18789
18842
|
return options.filter((option) => option.label.toLowerCase().includes(query));
|
|
18790
18843
|
}, [options, search, showSearch]);
|
|
18844
|
+
useEffect(() => {
|
|
18845
|
+
if (!showSearch || disabled) return;
|
|
18846
|
+
searchInputRef.current?.focus();
|
|
18847
|
+
}, [showSearch, disabled]);
|
|
18791
18848
|
if (options.length === 0) return /* @__PURE__ */ jsx(EmptyItem, { children: "\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4." });
|
|
18792
|
-
return /* @__PURE__ */ jsxs(
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18796
|
-
"
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
children: [
|
|
18801
|
-
showSearch && /* @__PURE__ */ jsx(
|
|
18802
|
-
"div",
|
|
18849
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
18850
|
+
showSearch && /* @__PURE__ */ jsx(
|
|
18851
|
+
"div",
|
|
18852
|
+
{
|
|
18853
|
+
className: "shrink-0 border-b border-solid px-[8px] pb-[4px] pt-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18854
|
+
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18855
|
+
children: /* @__PURE__ */ jsx(
|
|
18856
|
+
SSearchInput,
|
|
18803
18857
|
{
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
disabled,
|
|
18813
|
-
placeholder: "\uAC80\uC0C9",
|
|
18814
|
-
onChange: (event) => setSearch(event.target.value),
|
|
18815
|
-
className: "min-w-0 flex-1 border-none bg-transparent text-[12px] leading-[20px] text-[color:var(--sys-color-field-text-default)] outline-none placeholder:text-[color:var(--sys-color-field-text-placeholder)] disabled:cursor-not-allowed"
|
|
18816
|
-
}
|
|
18817
|
-
),
|
|
18818
|
-
search !== "" && !disabled && /* @__PURE__ */ jsx(
|
|
18819
|
-
SGhostButton,
|
|
18820
|
-
{
|
|
18821
|
-
icon: "close",
|
|
18822
|
-
size: "xxs",
|
|
18823
|
-
ariaLabel: "\uAC80\uC0C9\uC5B4 \uC9C0\uC6B0\uAE30",
|
|
18824
|
-
className: "flex-shrink-0",
|
|
18825
|
-
onClick: () => setSearch("")
|
|
18826
|
-
}
|
|
18827
|
-
)
|
|
18828
|
-
] })
|
|
18858
|
+
ref: searchInputRef,
|
|
18859
|
+
size: "sm",
|
|
18860
|
+
value: search,
|
|
18861
|
+
onValueChange: setSearch,
|
|
18862
|
+
disabled,
|
|
18863
|
+
placeholder: "\uAC80\uC0C9",
|
|
18864
|
+
clearable: true,
|
|
18865
|
+
width: "100%"
|
|
18829
18866
|
}
|
|
18867
|
+
)
|
|
18868
|
+
}
|
|
18869
|
+
),
|
|
18870
|
+
/* @__PURE__ */ jsxs(
|
|
18871
|
+
"div",
|
|
18872
|
+
{
|
|
18873
|
+
className: cn(
|
|
18874
|
+
"min-h-0 flex-1 overflow-auto",
|
|
18875
|
+
!showSearch && "pt-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18876
|
+
"pb-[var(--cmp-chipFilter-listbox-list-paddingY)]"
|
|
18830
18877
|
),
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
|
|
18840
|
-
|
|
18841
|
-
|
|
18842
|
-
|
|
18843
|
-
|
|
18844
|
-
|
|
18845
|
-
|
|
18846
|
-
|
|
18878
|
+
children: [
|
|
18879
|
+
showSearch && filteredOptions.length === 0 && /* @__PURE__ */ jsx(EmptyItem, { children: "\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." }),
|
|
18880
|
+
filteredOptions.map((option) => {
|
|
18881
|
+
const checked = multiple ? selected.includes(option.value) : singleValue === option.value;
|
|
18882
|
+
return /* @__PURE__ */ jsxs(
|
|
18883
|
+
MenuItem,
|
|
18884
|
+
{
|
|
18885
|
+
selected: checked,
|
|
18886
|
+
disabled: disabled || option.disabled,
|
|
18887
|
+
multi: multiple,
|
|
18888
|
+
onClick: () => {
|
|
18889
|
+
if (multiple) {
|
|
18890
|
+
const next = checked ? selected.filter((v) => v !== option.value) : [...selected, option.value];
|
|
18891
|
+
onValueChange(next);
|
|
18892
|
+
} else {
|
|
18893
|
+
onValueChange(option.value);
|
|
18894
|
+
}
|
|
18895
|
+
},
|
|
18896
|
+
children: [
|
|
18897
|
+
multiple && /* @__PURE__ */ jsx(OptionCheckbox, { checked }),
|
|
18898
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: option.label })
|
|
18899
|
+
]
|
|
18847
18900
|
},
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
})
|
|
18856
|
-
]
|
|
18857
|
-
}
|
|
18858
|
-
);
|
|
18901
|
+
String(option.value)
|
|
18902
|
+
);
|
|
18903
|
+
})
|
|
18904
|
+
]
|
|
18905
|
+
}
|
|
18906
|
+
)
|
|
18907
|
+
] });
|
|
18859
18908
|
}
|
|
18860
18909
|
function OptionCheckbox({ checked }) {
|
|
18861
18910
|
return /* @__PURE__ */ jsx(
|
|
@@ -18869,15 +18918,22 @@ function OptionCheckbox({ checked }) {
|
|
|
18869
18918
|
}
|
|
18870
18919
|
);
|
|
18871
18920
|
}
|
|
18872
|
-
function ListBox({
|
|
18921
|
+
function ListBox({
|
|
18922
|
+
children,
|
|
18923
|
+
maxHeight
|
|
18924
|
+
}) {
|
|
18873
18925
|
return /* @__PURE__ */ jsx(
|
|
18874
18926
|
"div",
|
|
18875
18927
|
{
|
|
18876
|
-
className:
|
|
18928
|
+
className: cn(
|
|
18929
|
+
"overflow-hidden border border-solid shadow-[var(--shadow-overlay)]",
|
|
18930
|
+
maxHeight && "flex flex-col"
|
|
18931
|
+
),
|
|
18877
18932
|
style: {
|
|
18878
18933
|
borderRadius: CHIPFILTER.listboxRadius,
|
|
18879
18934
|
background: CHIPFILTER.listboxBg,
|
|
18880
|
-
borderColor: CHIPFILTER.listboxBorder
|
|
18935
|
+
borderColor: CHIPFILTER.listboxBorder,
|
|
18936
|
+
maxHeight
|
|
18881
18937
|
},
|
|
18882
18938
|
children
|
|
18883
18939
|
}
|