sellmate-design-system-react 9.0.0-beta.26 → 9.0.0-beta.28
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/SLinearProgress/README.md +7 -0
- package/dist/components/SLinearProgress/SLinearProgress.d.ts +3 -0
- package/dist/components/SLinearProgress/index.d.ts +1 -1
- package/dist/components/SRadioButton/README.md +1 -1
- package/dist/components/SRadioButton/SRadioButton.d.ts +1 -1
- 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/components/STag/README.md +1 -0
- package/dist/components/STag/STag.d.ts +3 -1
- package/dist/index.cjs +294 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +294 -160
- package/dist/index.js.map +1 -1
- package/dist/lib/floating-height.d.ts +15 -0
- package/dist/llms-full.txt +21 -7
- package/dist/llms.txt +1 -0
- package/dist/styles.css +50 -94
- package/dist/theme.css +45 -9
- package/eslint/scale.gen.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3770,7 +3770,7 @@ var SDraggableItemView = /* @__PURE__ */ react.forwardRef(
|
|
|
3770
3770
|
"rounded-(--cmp-listDraggableItem-radius-bordered) border border-(--cmp-listDraggableItem-border-default)",
|
|
3771
3771
|
!disabled && !selected && !dragging && "hover:border-(--cmp-listDraggableItem-bordered-border-hover)",
|
|
3772
3772
|
!disabled && selected && !dragging && "border-(--cmp-listDraggableItem-bordered-border-selected) bg-(--cmp-listDraggableItem-bordered-bg-selected)",
|
|
3773
|
-
!disabled && selected && dragging && "border-
|
|
3773
|
+
!disabled && selected && dragging && "border-(--cmp-listDraggableItem-bordered-dragging-border-color) bg-(--cmp-listDraggableItem-bordered-dragging-bg)"
|
|
3774
3774
|
),
|
|
3775
3775
|
disabled && "cursor-not-allowed",
|
|
3776
3776
|
className
|
|
@@ -4150,10 +4150,12 @@ function SDraggableProviderInternal({
|
|
|
4150
4150
|
if (movedItem !== void 0) {
|
|
4151
4151
|
if (source === target) {
|
|
4152
4152
|
const toIndex = dropRef.current.index > dragging.index ? dropRef.current.index - 1 : dropRef.current.index;
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4153
|
+
if (toIndex !== dragging.index) {
|
|
4154
|
+
const nextItems = [...source.items];
|
|
4155
|
+
nextItems.splice(dragging.index, 1);
|
|
4156
|
+
nextItems.splice(toIndex, 0, movedItem);
|
|
4157
|
+
source.onChange?.(nextItems);
|
|
4158
|
+
}
|
|
4157
4159
|
} else {
|
|
4158
4160
|
const nextSourceItems = source.items.filter((_, index) => index !== dragging.index);
|
|
4159
4161
|
const nextTargetItems = [...target.items];
|
|
@@ -4214,6 +4216,13 @@ function reorder(items, fromIndex, toIndex) {
|
|
|
4214
4216
|
function clampDepth(depth, maxDepth) {
|
|
4215
4217
|
return Math.max(1, Math.min(maxDepth, Math.floor(depth)));
|
|
4216
4218
|
}
|
|
4219
|
+
function getDepthOffset(depth) {
|
|
4220
|
+
return (Math.max(1, Math.floor(depth)) - 1) * 20;
|
|
4221
|
+
}
|
|
4222
|
+
function getIndicatorOffset(depth) {
|
|
4223
|
+
const depthOffset = getDepthOffset(depth);
|
|
4224
|
+
return depthOffset === 0 ? 0 : `calc(var(--cmp-listDraggableItem-paddingX) + ${depthOffset}px)`;
|
|
4225
|
+
}
|
|
4217
4226
|
function getSubtreeEnd(items, startIndex, getDepth) {
|
|
4218
4227
|
const startDepth = getDepth(items[startIndex], startIndex);
|
|
4219
4228
|
let endIndex = startIndex + 1;
|
|
@@ -4281,6 +4290,7 @@ function SDraggableListInner({
|
|
|
4281
4290
|
const fromIndexRef = react.useRef(null);
|
|
4282
4291
|
const currentSelectedKey = selectedKey ?? internalSelectedKey;
|
|
4283
4292
|
const usesDepth = getDepth != null;
|
|
4293
|
+
const depthEnabled = usesDepth && !useGap;
|
|
4284
4294
|
const groupDragging = dragContext?.dragging;
|
|
4285
4295
|
const draggedSubtreeStart = dragContext ? groupDragging?.listId === listId ? groupDragging?.index ?? null : null : draggingIndex;
|
|
4286
4296
|
const startDrag = react.useCallback((event, index) => {
|
|
@@ -4301,19 +4311,14 @@ function SDraggableListInner({
|
|
|
4301
4311
|
);
|
|
4302
4312
|
if (!itemElements) return;
|
|
4303
4313
|
let nextDropTarget = items.length === 0 ? { index: 0, intent: "before" } : { index: items.length - 1, intent: "after" };
|
|
4304
|
-
const draggingEndIndex =
|
|
4305
|
-
let previousDropIndex = null;
|
|
4314
|
+
const draggingEndIndex = depthEnabled && draggingIndex != null ? getSubtreeEnd(items, draggingIndex, readDepth) : draggingIndex + 1;
|
|
4306
4315
|
for (let index = 0; index < itemElements.length; index += 1) {
|
|
4307
4316
|
const itemElement = itemElements[index];
|
|
4308
4317
|
const rect = itemElement.getBoundingClientRect();
|
|
4309
4318
|
if (index >= draggingIndex && index < draggingEndIndex) {
|
|
4310
|
-
if (event.clientY <= rect.bottom) {
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
} else {
|
|
4314
|
-
nextDropTarget = { index: draggingIndex, intent: "before" };
|
|
4315
|
-
}
|
|
4316
|
-
break;
|
|
4319
|
+
if (event.clientY >= rect.top && event.clientY <= rect.bottom) {
|
|
4320
|
+
setDropTarget(null);
|
|
4321
|
+
return;
|
|
4317
4322
|
}
|
|
4318
4323
|
continue;
|
|
4319
4324
|
}
|
|
@@ -4322,12 +4327,11 @@ function SDraggableListInner({
|
|
|
4322
4327
|
break;
|
|
4323
4328
|
}
|
|
4324
4329
|
if (event.clientY > rect.bottom) {
|
|
4325
|
-
previousDropIndex = index;
|
|
4326
4330
|
nextDropTarget = { index, intent: "after" };
|
|
4327
4331
|
continue;
|
|
4328
4332
|
}
|
|
4329
4333
|
const ratio = (event.clientY - rect.top) / rect.height;
|
|
4330
|
-
if (!
|
|
4334
|
+
if (!depthEnabled) {
|
|
4331
4335
|
nextDropTarget = ratio < 0.5 ? { index, intent: "before" } : { index, intent: "after" };
|
|
4332
4336
|
break;
|
|
4333
4337
|
}
|
|
@@ -4344,27 +4348,35 @@ function SDraggableListInner({
|
|
|
4344
4348
|
}
|
|
4345
4349
|
setDropTarget(nextDropTarget);
|
|
4346
4350
|
};
|
|
4351
|
+
const cancelDrag = () => {
|
|
4352
|
+
fromIndexRef.current = null;
|
|
4353
|
+
setDraggingIndex(null);
|
|
4354
|
+
setDropTarget(null);
|
|
4355
|
+
};
|
|
4347
4356
|
const handleMouseUp = () => {
|
|
4348
4357
|
const fromIndex = fromIndexRef.current;
|
|
4349
4358
|
const nextDropTarget = dropTarget;
|
|
4350
4359
|
if (fromIndex != null && nextDropTarget != null && items[nextDropTarget.index]) {
|
|
4351
4360
|
const insertionIndex = getInsertionIndex(items, nextDropTarget, () => 1);
|
|
4352
|
-
const nextItems =
|
|
4361
|
+
const nextItems = depthEnabled ? moveWithDepth(items, fromIndex, nextDropTarget, readDepth, setDepth, maxDepth) : reorder(
|
|
4353
4362
|
items,
|
|
4354
4363
|
fromIndex,
|
|
4355
4364
|
insertionIndex > fromIndex ? insertionIndex - 1 : insertionIndex
|
|
4356
4365
|
);
|
|
4357
4366
|
if (nextItems !== items) onChange?.(nextItems);
|
|
4358
4367
|
}
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4368
|
+
cancelDrag();
|
|
4369
|
+
};
|
|
4370
|
+
const handleKeyDown = (event) => {
|
|
4371
|
+
if (event.key === "Escape") cancelDrag();
|
|
4362
4372
|
};
|
|
4363
4373
|
window.addEventListener("mousemove", handleMouseMove);
|
|
4364
4374
|
window.addEventListener("mouseup", handleMouseUp);
|
|
4375
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
4365
4376
|
return () => {
|
|
4366
4377
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
4367
4378
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
4379
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
4368
4380
|
};
|
|
4369
4381
|
}, [
|
|
4370
4382
|
draggingIndex,
|
|
@@ -4373,7 +4385,7 @@ function SDraggableListInner({
|
|
|
4373
4385
|
onChange,
|
|
4374
4386
|
dragContext,
|
|
4375
4387
|
getDepth,
|
|
4376
|
-
|
|
4388
|
+
depthEnabled,
|
|
4377
4389
|
readDepth,
|
|
4378
4390
|
setDepth,
|
|
4379
4391
|
maxDepth,
|
|
@@ -4387,8 +4399,18 @@ function SDraggableListInner({
|
|
|
4387
4399
|
const currentDropIntent = dragContext ? void 0 : dropTarget?.intent;
|
|
4388
4400
|
const isDropTarget = dragContext ? groupDrop?.group === dragGroup && groupDrop?.listId === listId : draggingIndex != null;
|
|
4389
4401
|
const showEmptyDrop = Boolean(dragContext && isDropTarget && items.length === 0);
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4402
|
+
const beforeIndicatorStyle = (depth) => ({
|
|
4403
|
+
borderTop: "2px solid var(--sys-color-fg-accentLight)",
|
|
4404
|
+
left: getIndicatorOffset(depth),
|
|
4405
|
+
right: 0,
|
|
4406
|
+
top: useGap ? -5 : 0
|
|
4407
|
+
});
|
|
4408
|
+
const afterIndicatorStyle = (depth) => ({
|
|
4409
|
+
borderTop: "2px solid var(--sys-color-fg-accentLight)",
|
|
4410
|
+
bottom: useGap ? -5 : -1,
|
|
4411
|
+
left: getIndicatorOffset(depth),
|
|
4412
|
+
right: 0
|
|
4413
|
+
});
|
|
4392
4414
|
const setListRef = (node) => {
|
|
4393
4415
|
listRef.current = node;
|
|
4394
4416
|
if (dragContext && dragGroup && listId) {
|
|
@@ -4409,15 +4431,15 @@ function SDraggableListInner({
|
|
|
4409
4431
|
ref: setListRef,
|
|
4410
4432
|
...rest,
|
|
4411
4433
|
useGap,
|
|
4412
|
-
className: `${className ?? ""} ${dragContext ? "min-h-[40px]" : ""} ${showEmptyDrop ? "relative before:absolute before:left-0 before:right-0 before:top-0 before:z-10 before:h-[2px] before:bg-(--sys-color-
|
|
4434
|
+
className: `${className ?? ""} ${dragContext ? "min-h-[40px]" : ""} ${showEmptyDrop ? "relative before:absolute before:left-0 before:right-0 before:top-0 before:z-10 before:h-[2px] before:bg-(--sys-color-fg-accentLight) before:content-['']" : ""}`,
|
|
4413
4435
|
"data-draggable-group": dragContext ? dragGroup : void 0,
|
|
4414
4436
|
"data-draggable-list-id": dragContext ? listId : void 0,
|
|
4415
4437
|
children: items.map((item2, index) => {
|
|
4416
4438
|
const itemKey = getKey(item2, index);
|
|
4417
|
-
const disabled = (getDisabled?.(item2, index) ?? false) || isDescendant(items, index, draggedSubtreeStart,
|
|
4418
|
-
const depth = readDepth(item2, index);
|
|
4439
|
+
const disabled = (getDisabled?.(item2, index) ?? false) || isDescendant(items, index, draggedSubtreeStart, depthEnabled ? readDepth : void 0);
|
|
4440
|
+
const depth = depthEnabled ? readDepth(item2, index) : 1;
|
|
4419
4441
|
const showBefore = isDropTarget && currentDropIndex === index && (dragContext || currentDropIntent === "before");
|
|
4420
|
-
const showInside = isDropTarget && currentDropIndex === index && !dragContext &&
|
|
4442
|
+
const showInside = isDropTarget && currentDropIndex === index && !dragContext && depthEnabled && currentDropIntent === "inside";
|
|
4421
4443
|
const showAfter = isDropTarget && (dragContext ? currentDropIndex === items.length && index === items.length - 1 : currentDropIndex === index && currentDropIntent === "after");
|
|
4422
4444
|
const selectItem = () => {
|
|
4423
4445
|
if (disabled) return;
|
|
@@ -4429,7 +4451,7 @@ function SDraggableListInner({
|
|
|
4429
4451
|
event.preventDefault();
|
|
4430
4452
|
selectItem();
|
|
4431
4453
|
};
|
|
4432
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4454
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4433
4455
|
"div",
|
|
4434
4456
|
{
|
|
4435
4457
|
"data-draggable-list-item": true,
|
|
@@ -4438,18 +4460,49 @@ function SDraggableListInner({
|
|
|
4438
4460
|
"aria-disabled": disabled || void 0,
|
|
4439
4461
|
onClick: selectItem,
|
|
4440
4462
|
onKeyDown: handleItemKeyDown,
|
|
4441
|
-
className:
|
|
4442
|
-
children:
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4463
|
+
className: "relative",
|
|
4464
|
+
children: [
|
|
4465
|
+
showBefore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4466
|
+
"span",
|
|
4467
|
+
{
|
|
4468
|
+
"aria-hidden": "true",
|
|
4469
|
+
"data-draggable-drop-indicator": "before",
|
|
4470
|
+
className: "pointer-events-none absolute z-10",
|
|
4471
|
+
style: beforeIndicatorStyle(depth)
|
|
4472
|
+
}
|
|
4473
|
+
),
|
|
4474
|
+
showAfter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4475
|
+
"span",
|
|
4476
|
+
{
|
|
4477
|
+
"aria-hidden": "true",
|
|
4478
|
+
"data-draggable-drop-indicator": "after",
|
|
4479
|
+
className: "pointer-events-none absolute z-10",
|
|
4480
|
+
style: afterIndicatorStyle(depth)
|
|
4481
|
+
}
|
|
4482
|
+
),
|
|
4483
|
+
showInside && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4484
|
+
"span",
|
|
4485
|
+
{
|
|
4486
|
+
"aria-hidden": "true",
|
|
4487
|
+
"data-draggable-drop-indicator": "inside",
|
|
4488
|
+
className: "pointer-events-none absolute inset-0 z-10",
|
|
4489
|
+
style: {
|
|
4490
|
+
border: "2px solid var(--sys-color-fg-accentLight)"
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
),
|
|
4494
|
+
renderItem(item2, index, {
|
|
4495
|
+
onDragHandleMouseDown: (event) => {
|
|
4496
|
+
if (disabled) return;
|
|
4497
|
+
if (dragContext && dragGroup && listId) {
|
|
4498
|
+
dragContext.startDrag(event, dragGroup, listId, index, itemKey);
|
|
4499
|
+
} else startDrag(event, index);
|
|
4500
|
+
},
|
|
4501
|
+
selected: currentSelectedKey === itemKey,
|
|
4502
|
+
disabled,
|
|
4503
|
+
depth
|
|
4504
|
+
})
|
|
4505
|
+
]
|
|
4453
4506
|
},
|
|
4454
4507
|
itemKey
|
|
4455
4508
|
);
|
|
@@ -4922,6 +4975,7 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4922
4975
|
shape = "square",
|
|
4923
4976
|
size = "sm",
|
|
4924
4977
|
color = "grey",
|
|
4978
|
+
deep = false,
|
|
4925
4979
|
label = "",
|
|
4926
4980
|
icon,
|
|
4927
4981
|
iconLeft = true,
|
|
@@ -4931,7 +4985,8 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4931
4985
|
...rest
|
|
4932
4986
|
}, ref) {
|
|
4933
4987
|
const s = TAG_SIZE_CONFIG[size];
|
|
4934
|
-
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
4988
|
+
const contentColor = deep ? `var(--cmp-tag-${color}-deep-content, var(--cmp-tag-deep-content))` : `var(--cmp-tag-${color}-content)`;
|
|
4989
|
+
const bgColor = deep ? `var(--cmp-tag-${color}-deep-bg)` : `var(--cmp-tag-${color}-bg)`;
|
|
4935
4990
|
const iconNode = icon ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
4936
4991
|
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
4937
4992
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4951,7 +5006,7 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4951
5006
|
fontSize: s.fontSize,
|
|
4952
5007
|
fontWeight: s.fontWeight,
|
|
4953
5008
|
lineHeight: `${s.lineHeight}px`,
|
|
4954
|
-
background:
|
|
5009
|
+
background: bgColor,
|
|
4955
5010
|
color: contentColor,
|
|
4956
5011
|
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
4957
5012
|
...style
|
|
@@ -6202,11 +6257,12 @@ var FILL_COLOR = {
|
|
|
6202
6257
|
};
|
|
6203
6258
|
var clamp2 = (v) => Number.isFinite(v) ? Math.max(0, Math.min(100, v)) : 0;
|
|
6204
6259
|
var SLinearProgress = /* @__PURE__ */ react.forwardRef(
|
|
6205
|
-
function SLinearProgress2({ value = 0, type = "primary", indeterminate = false, label, className, style }, ref) {
|
|
6260
|
+
function SLinearProgress2({ value = 0, type = "primary", size = "sm", indeterminate = false, label, className, style }, ref) {
|
|
6206
6261
|
const v = clamp2(value);
|
|
6207
6262
|
const fill = FILL_COLOR[type];
|
|
6208
6263
|
const valueColor = v === 0 ? "var(--sys-color-fg-tertiary, #888888)" : fill;
|
|
6209
6264
|
const valueText = `${Math.round(v)}%`;
|
|
6265
|
+
const showValue = !indeterminate && size !== "xs";
|
|
6210
6266
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6211
6267
|
"div",
|
|
6212
6268
|
{
|
|
@@ -6214,36 +6270,43 @@ var SLinearProgress = /* @__PURE__ */ react.forwardRef(
|
|
|
6214
6270
|
className: cn("flex w-full flex-col gap-[12px]", className),
|
|
6215
6271
|
style,
|
|
6216
6272
|
children: [
|
|
6217
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6273
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6274
|
+
"div",
|
|
6275
|
+
{
|
|
6276
|
+
className: "relative w-full overflow-hidden rounded-full bg-[var(--cmp-progress-color-track)]",
|
|
6277
|
+
style: { height: `var(--cmp-progress-linear-height-${size})` },
|
|
6278
|
+
children: [
|
|
6279
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6280
|
+
"div",
|
|
6281
|
+
{
|
|
6282
|
+
className: cn(
|
|
6283
|
+
"absolute inset-y-0 left-0 h-full rounded-[inherit]",
|
|
6284
|
+
indeterminate ? "w-full origin-left animate-linear-indeterminate" : "transition-[width] duration-[400ms] ease-linear"
|
|
6285
|
+
),
|
|
6286
|
+
style: { background: fill, width: indeterminate ? void 0 : `${v}%` }
|
|
6287
|
+
}
|
|
6224
6288
|
),
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
] }),
|
|
6289
|
+
showValue && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6290
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6291
|
+
"span",
|
|
6292
|
+
{
|
|
6293
|
+
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 select-none text-center text-[12px] font-bold leading-[20px]",
|
|
6294
|
+
style: { color: valueColor },
|
|
6295
|
+
children: valueText
|
|
6296
|
+
}
|
|
6297
|
+
),
|
|
6298
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6299
|
+
"span",
|
|
6300
|
+
{
|
|
6301
|
+
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 select-none text-center text-[12px] font-bold leading-[20px] text-[color:var(--cmp-progress-bar-text)]",
|
|
6302
|
+
style: { clipPath: `inset(0 ${100 - v}% 0 0)` },
|
|
6303
|
+
children: valueText
|
|
6304
|
+
}
|
|
6305
|
+
)
|
|
6306
|
+
] })
|
|
6307
|
+
]
|
|
6308
|
+
}
|
|
6309
|
+
),
|
|
6247
6310
|
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center text-[12px] font-normal leading-[20px] text-[color:var(--cmp-progress-color-label)]", children: label })
|
|
6248
6311
|
]
|
|
6249
6312
|
}
|
|
@@ -10444,6 +10507,14 @@ var SStepper = /* @__PURE__ */ react.forwardRef(function SStepper2({
|
|
|
10444
10507
|
}
|
|
10445
10508
|
);
|
|
10446
10509
|
});
|
|
10510
|
+
|
|
10511
|
+
// src/lib/floating-height.ts
|
|
10512
|
+
var POPOVER_AVAILABLE_HEIGHT = "var(--radix-popover-content-available-height)";
|
|
10513
|
+
function clampToAvailableHeight(value, availableHeight) {
|
|
10514
|
+
if (value == null || value === "") return availableHeight;
|
|
10515
|
+
const css = typeof value === "number" ? `${value}px` : value;
|
|
10516
|
+
return `min(${css}, ${availableHeight})`;
|
|
10517
|
+
}
|
|
10447
10518
|
function runRules(value, rules) {
|
|
10448
10519
|
if (!rules || rules.length === 0) return "";
|
|
10449
10520
|
for (const rule of rules) {
|
|
@@ -10841,7 +10912,7 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
10841
10912
|
error = false,
|
|
10842
10913
|
rules,
|
|
10843
10914
|
labelTooltipProps,
|
|
10844
|
-
dropdownHeight = "
|
|
10915
|
+
dropdownHeight = "640px",
|
|
10845
10916
|
dropdownWidth,
|
|
10846
10917
|
maxDropdownWidth = "640px",
|
|
10847
10918
|
label,
|
|
@@ -11202,6 +11273,7 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
11202
11273
|
placement: "bottom",
|
|
11203
11274
|
align: "start",
|
|
11204
11275
|
offset: 4,
|
|
11276
|
+
viewportPadding: 24,
|
|
11205
11277
|
fit: !dropdownWidth,
|
|
11206
11278
|
onOpenAutoFocus: (event) => {
|
|
11207
11279
|
if (!showSearch) {
|
|
@@ -11234,7 +11306,7 @@ var SSelectImpl = /* @__PURE__ */ react.forwardRef(function SSelect({
|
|
|
11234
11306
|
SCROLLBAR_TRACK_BG_CLASS,
|
|
11235
11307
|
SCROLLBAR_TRACK_BORDER_CLASS
|
|
11236
11308
|
),
|
|
11237
|
-
style: { maxHeight: dropdownHeight },
|
|
11309
|
+
style: { maxHeight: clampToAvailableHeight(dropdownHeight, POPOVER_AVAILABLE_HEIGHT) },
|
|
11238
11310
|
onMouseLeave: () => setFocusedIndex(-1),
|
|
11239
11311
|
children: [
|
|
11240
11312
|
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15326,6 +15398,11 @@ var SForm = /* @__PURE__ */ react.forwardRef(function SForm2({ formClass, onSubm
|
|
|
15326
15398
|
}
|
|
15327
15399
|
) });
|
|
15328
15400
|
});
|
|
15401
|
+
var SIZE_CONFIG2 = {
|
|
15402
|
+
xs: { fontSize: 12, lineHeight: 20, radius: "var(--cmp-radioButton-radius-sm)" },
|
|
15403
|
+
sm: { fontSize: 12, lineHeight: 20, radius: "var(--cmp-radioButton-radius-sm)" },
|
|
15404
|
+
md: { fontSize: 16, lineHeight: 26, radius: "var(--cmp-radioButton-radius-md)" }
|
|
15405
|
+
};
|
|
15329
15406
|
function SRadioButton({
|
|
15330
15407
|
options = [],
|
|
15331
15408
|
value,
|
|
@@ -15336,6 +15413,7 @@ function SRadioButton({
|
|
|
15336
15413
|
className,
|
|
15337
15414
|
style
|
|
15338
15415
|
}) {
|
|
15416
|
+
const s = SIZE_CONFIG2[size];
|
|
15339
15417
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15340
15418
|
"div",
|
|
15341
15419
|
{
|
|
@@ -15346,6 +15424,8 @@ function SRadioButton({
|
|
|
15346
15424
|
children: options.map((o, i) => {
|
|
15347
15425
|
const selected = o.value === value;
|
|
15348
15426
|
const od = disabled || o.disabled;
|
|
15427
|
+
const first = i === 0;
|
|
15428
|
+
const last = i === options.length - 1;
|
|
15349
15429
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15350
15430
|
"button",
|
|
15351
15431
|
{
|
|
@@ -15356,9 +15436,8 @@ function SRadioButton({
|
|
|
15356
15436
|
disabled: od,
|
|
15357
15437
|
onClick: () => !od && !selected && onValueChange?.(o.value),
|
|
15358
15438
|
className: cn(
|
|
15359
|
-
"relative box-border grow inline-flex items-center justify-center whitespace-nowrap border border-solid
|
|
15360
|
-
|
|
15361
|
-
i === options.length - 1 ? "rounded-r-[var(--cmp-radioButton-radius)]" : "",
|
|
15439
|
+
"relative box-border grow inline-flex items-center justify-center whitespace-nowrap border border-solid font-medium transition-colors",
|
|
15440
|
+
first ? "" : "-ml-px",
|
|
15362
15441
|
selected ? "z-10" : "",
|
|
15363
15442
|
!od && !selected && "hover:!bg-[var(--cmp-radioButton-bg-hover)] hover:!text-[color:var(--cmp-radioButton-content-hover)] hover:!border-[color:var(--cmp-radioButton-bg-hover)] hover:z-10",
|
|
15364
15443
|
od ? "cursor-not-allowed" : "cursor-pointer"
|
|
@@ -15366,6 +15445,14 @@ function SRadioButton({
|
|
|
15366
15445
|
style: {
|
|
15367
15446
|
height: `var(--cmp-radioButton-${size}-height)`,
|
|
15368
15447
|
padding: `0 var(--cmp-radioButton-${size}-paddingX)`,
|
|
15448
|
+
fontSize: `${s.fontSize}px`,
|
|
15449
|
+
lineHeight: `${s.lineHeight}px`,
|
|
15450
|
+
borderRadius: [
|
|
15451
|
+
first ? s.radius : "0",
|
|
15452
|
+
last ? s.radius : "0",
|
|
15453
|
+
last ? s.radius : "0",
|
|
15454
|
+
first ? s.radius : "0"
|
|
15455
|
+
].join(" "),
|
|
15369
15456
|
background: od ? "var(--cmp-radioButton-bg-disabled)" : "var(--cmp-radioButton-bg-default)",
|
|
15370
15457
|
borderColor: od ? "var(--cmp-radioButton-border-disabled)" : selected ? "var(--cmp-radioButton-border-select)" : "var(--cmp-radioButton-border-default)",
|
|
15371
15458
|
color: od ? "var(--cmp-radioButton-content-disabled)" : selected ? "var(--cmp-radioButton-content-select)" : "var(--cmp-radioButton-content-default)"
|
|
@@ -17387,6 +17474,8 @@ var SEditor = /* @__PURE__ */ react.forwardRef(function SEditor2({
|
|
|
17387
17474
|
});
|
|
17388
17475
|
var CHIPFILTER_LISTBOX_WIDTH = 240;
|
|
17389
17476
|
var CHIPFILTER_DATE_PRESET_LISTBOX_WIDTH = 246;
|
|
17477
|
+
var EDITOR_LISTBOX_MAX_HEIGHT = "min(640px, var(--radix-popover-content-available-height))";
|
|
17478
|
+
var EDITOR_POPOVER_VIEWPORT_PADDING = 24;
|
|
17390
17479
|
var CHIPFILTER = {
|
|
17391
17480
|
barBg: "var(--cmp-chipFilter-bar-bg)",
|
|
17392
17481
|
barBorder: "var(--cmp-chipFilter-bar-border)",
|
|
@@ -17426,6 +17515,7 @@ var CHIPFILTER = {
|
|
|
17426
17515
|
itemTextDefault: "var(--cmp-chipFilter-item-text-default)",
|
|
17427
17516
|
itemTextSelected: "var(--cmp-chipFilter-item-text-selected)"
|
|
17428
17517
|
};
|
|
17518
|
+
var DEFAULT_CUSTOM_MAX_RANGE = 90;
|
|
17429
17519
|
var DEFAULT_PERIOD_PRESETS = [
|
|
17430
17520
|
{ value: "day", label: "\uC77C\uBCC4" },
|
|
17431
17521
|
{ value: "month", label: "\uC6D4\uBCC4" },
|
|
@@ -17434,6 +17524,20 @@ var DEFAULT_PERIOD_PRESETS = [
|
|
|
17434
17524
|
{ value: "year", label: "\uC5F0\uB3C4\uBCC4" },
|
|
17435
17525
|
{ value: "custom", label: "\uC0AC\uC6A9\uC790 \uC9C0\uC815", custom: true }
|
|
17436
17526
|
];
|
|
17527
|
+
var DEFAULT_DATE_RANGE_PRESETS = [
|
|
17528
|
+
{ value: "today", label: "\uC624\uB298", resolve: () => todayIso() },
|
|
17529
|
+
{
|
|
17530
|
+
value: "last7",
|
|
17531
|
+
label: "\uC9C0\uB09C 7\uC77C",
|
|
17532
|
+
resolve: () => [addDaysIso(todayIso(), -7), todayIso()]
|
|
17533
|
+
},
|
|
17534
|
+
{
|
|
17535
|
+
value: "last30",
|
|
17536
|
+
label: "\uC9C0\uB09C 30\uC77C",
|
|
17537
|
+
resolve: () => [addDaysIso(todayIso(), -30), todayIso()]
|
|
17538
|
+
},
|
|
17539
|
+
{ value: "custom", label: "\uC0AC\uC6A9\uC790 \uC9C0\uC815", custom: true }
|
|
17540
|
+
];
|
|
17437
17541
|
var isKeywordValue = (value) => typeof value === "object" && value != null && !Array.isArray(value) && "keywords" in value;
|
|
17438
17542
|
var isPeriodValue = (value) => typeof value === "object" && value != null && !Array.isArray(value) && "unit" in value;
|
|
17439
17543
|
var keywordEntries = (value) => {
|
|
@@ -17458,23 +17562,39 @@ var todayIso = () => {
|
|
|
17458
17562
|
const pad = (n) => String(n).padStart(2, "0");
|
|
17459
17563
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
17460
17564
|
};
|
|
17565
|
+
var addDaysIso = (iso, n) => {
|
|
17566
|
+
const d = /* @__PURE__ */ new Date(`${iso}T00:00:00`);
|
|
17567
|
+
d.setDate(d.getDate() + n);
|
|
17568
|
+
const pad = (v) => String(v).padStart(2, "0");
|
|
17569
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
17570
|
+
};
|
|
17461
17571
|
var isInlineDateField = (field) => field.type === "datepicker-range" && field.radioButton === true && (field.presets?.length ?? 0) > 0;
|
|
17462
17572
|
var getFieldPresets = (field) => {
|
|
17463
17573
|
if (field.type === "datepicker-statistics") return field.presets ?? DEFAULT_PERIOD_PRESETS;
|
|
17464
|
-
return field.presets ??
|
|
17574
|
+
return field.presets ?? DEFAULT_DATE_RANGE_PRESETS;
|
|
17575
|
+
};
|
|
17576
|
+
var getEffectiveMaxRange = (field) => {
|
|
17577
|
+
if (field.maxRange !== void 0) return field.maxRange;
|
|
17578
|
+
const hasCustomPreset = getFieldPresets(field).some((preset) => preset.custom);
|
|
17579
|
+
return hasCustomPreset ? DEFAULT_CUSTOM_MAX_RANGE : void 0;
|
|
17465
17580
|
};
|
|
17466
|
-
var
|
|
17581
|
+
var getPresetLabel = (preset, maxRange) => {
|
|
17582
|
+
if (!preset.custom || !maxRange || preset.label.includes("\uCD5C\uB300")) return preset.label;
|
|
17583
|
+
return `${preset.label} (\uCD5C\uB300 ${maxRange}\uC77C\uC529)`;
|
|
17584
|
+
};
|
|
17585
|
+
var getDefaultPeriodInputValue = (unit, maxRange) => {
|
|
17467
17586
|
const today = todayIso();
|
|
17468
17587
|
if (unit === "day") return today;
|
|
17469
17588
|
if (unit === "month") return today.slice(0, 7);
|
|
17470
17589
|
if (unit === "quarter") return 1;
|
|
17471
17590
|
if (unit === "half") return "first";
|
|
17472
17591
|
if (unit === "year") return today.slice(0, 4);
|
|
17473
|
-
|
|
17592
|
+
const days = maxRange && maxRange > 0 ? maxRange : DEFAULT_CUSTOM_MAX_RANGE;
|
|
17593
|
+
return [addDaysIso(today, -days), today];
|
|
17474
17594
|
};
|
|
17475
|
-
var createPeriodValue = (unit) => ({
|
|
17595
|
+
var createPeriodValue = (unit, maxRange) => ({
|
|
17476
17596
|
unit,
|
|
17477
|
-
value: getDefaultPeriodInputValue(unit)
|
|
17597
|
+
value: getDefaultPeriodInputValue(unit, maxRange)
|
|
17478
17598
|
});
|
|
17479
17599
|
var resolveFieldDefault = (field) => {
|
|
17480
17600
|
if (field.defaultValue !== void 0 && isFixedField(field)) return field.defaultValue;
|
|
@@ -18023,6 +18143,7 @@ var SChipFilter = /* @__PURE__ */ react.forwardRef(function SChipFilter2({
|
|
|
18023
18143
|
side: "bottom",
|
|
18024
18144
|
align: "start",
|
|
18025
18145
|
sideOffset: 4,
|
|
18146
|
+
collisionPadding: EDITOR_POPOVER_VIEWPORT_PADDING,
|
|
18026
18147
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
18027
18148
|
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
18028
18149
|
style: editorPopoverStyle,
|
|
@@ -18188,6 +18309,7 @@ function EditorPanel({
|
|
|
18188
18309
|
onClose
|
|
18189
18310
|
}) {
|
|
18190
18311
|
const wrapsInPaddedTop = field.type === "datepicker-day" || field.type === "datepicker-range" || field.type === "datepicker-statistics";
|
|
18312
|
+
const isScrollableListField = field.type === "select" || field.type === "select-multi" || field.type === "keyword";
|
|
18191
18313
|
const isMulti = field.type === "select-multi";
|
|
18192
18314
|
const selectableValues = isMulti ? (field.options ?? []).filter((option) => !option.disabled).map((option) => option.value) : [];
|
|
18193
18315
|
const selectedValues = isMulti ? toArrayValue(value) : [];
|
|
@@ -18197,7 +18319,7 @@ function EditorPanel({
|
|
|
18197
18319
|
allSelected ? selectedValues.filter((v) => !selectableValues.includes(v)) : [...selectedValues, ...selectableValues.filter((v) => !selectedValues.includes(v))]
|
|
18198
18320
|
);
|
|
18199
18321
|
};
|
|
18200
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ListBox, { children: [
|
|
18322
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ListBox, { maxHeight: isScrollableListField ? EDITOR_LISTBOX_MAX_HEIGHT : void 0, children: [
|
|
18201
18323
|
wrapsInPaddedTop ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
|
|
18202
18324
|
FilterEditor,
|
|
18203
18325
|
{
|
|
@@ -18220,7 +18342,7 @@ function EditorPanel({
|
|
|
18220
18342
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
18221
18343
|
"div",
|
|
18222
18344
|
{
|
|
18223
|
-
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)]",
|
|
18345
|
+
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)]",
|
|
18224
18346
|
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18225
18347
|
children: [
|
|
18226
18348
|
isMulti && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -18335,6 +18457,7 @@ function DatePresetEditor({
|
|
|
18335
18457
|
onValueChange
|
|
18336
18458
|
}) {
|
|
18337
18459
|
const presets = getFieldPresets(field);
|
|
18460
|
+
const maxRange = getEffectiveMaxRange(field);
|
|
18338
18461
|
const [selectedId, setSelectedId] = react.useState(() => matchPresetId(presets, value));
|
|
18339
18462
|
const syncedInitialValueRef = react.useRef(!isEmptyValue(value));
|
|
18340
18463
|
react.useEffect(() => {
|
|
@@ -18345,7 +18468,13 @@ function DatePresetEditor({
|
|
|
18345
18468
|
const selectedPreset = presets.find((preset) => preset.value === selectedId);
|
|
18346
18469
|
const selectPreset = (preset) => {
|
|
18347
18470
|
setSelectedId(preset.value);
|
|
18348
|
-
if (!preset.custom)
|
|
18471
|
+
if (!preset.custom) {
|
|
18472
|
+
onValueChange(preset.resolve ? preset.resolve() : preset.value);
|
|
18473
|
+
return;
|
|
18474
|
+
}
|
|
18475
|
+
const today = todayIso();
|
|
18476
|
+
const days = maxRange && maxRange > 0 ? maxRange : DEFAULT_CUSTOM_MAX_RANGE;
|
|
18477
|
+
onValueChange([addDaysIso(today, -days), today]);
|
|
18349
18478
|
};
|
|
18350
18479
|
if (presets.length === 0) {
|
|
18351
18480
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18354,7 +18483,7 @@ function DatePresetEditor({
|
|
|
18354
18483
|
value: Array.isArray(value) && value.length === 2 ? value : null,
|
|
18355
18484
|
onValueChange,
|
|
18356
18485
|
selectable: field.selectable,
|
|
18357
|
-
maxRange
|
|
18486
|
+
maxRange,
|
|
18358
18487
|
disabled,
|
|
18359
18488
|
width: "100%"
|
|
18360
18489
|
}
|
|
@@ -18366,7 +18495,7 @@ function DatePresetEditor({
|
|
|
18366
18495
|
{
|
|
18367
18496
|
val: preset.value,
|
|
18368
18497
|
value: selectedId,
|
|
18369
|
-
label: preset
|
|
18498
|
+
label: getPresetLabel(preset, maxRange),
|
|
18370
18499
|
disabled,
|
|
18371
18500
|
onValueChange: () => selectPreset(preset)
|
|
18372
18501
|
},
|
|
@@ -18378,7 +18507,7 @@ function DatePresetEditor({
|
|
|
18378
18507
|
value: Array.isArray(value) && value.length === 2 ? value : null,
|
|
18379
18508
|
onValueChange,
|
|
18380
18509
|
selectable: field.selectable,
|
|
18381
|
-
maxRange
|
|
18510
|
+
maxRange,
|
|
18382
18511
|
disabled
|
|
18383
18512
|
}
|
|
18384
18513
|
)
|
|
@@ -18391,9 +18520,10 @@ function PeriodPresetEditor({
|
|
|
18391
18520
|
onValueChange
|
|
18392
18521
|
}) {
|
|
18393
18522
|
const presets = getFieldPresets(field);
|
|
18523
|
+
const maxRange = getEffectiveMaxRange(field);
|
|
18394
18524
|
const firstUnit = presets.find((preset) => !preset.custom)?.value ?? "day";
|
|
18395
18525
|
const [selectedId, setSelectedId] = react.useState(() => matchPresetId(presets, value) ?? firstUnit);
|
|
18396
|
-
const periodValue = isPeriodValue(value) ? value : createPeriodValue(selectedId ?? firstUnit);
|
|
18526
|
+
const periodValue = isPeriodValue(value) ? value : createPeriodValue(selectedId ?? firstUnit, maxRange);
|
|
18397
18527
|
const selectedUnit = selectedId ?? periodValue.unit;
|
|
18398
18528
|
react.useEffect(() => {
|
|
18399
18529
|
if (isEmptyValue(value)) return;
|
|
@@ -18402,7 +18532,7 @@ function PeriodPresetEditor({
|
|
|
18402
18532
|
const selectPreset = (preset) => {
|
|
18403
18533
|
const nextUnit = preset.value;
|
|
18404
18534
|
setSelectedId(nextUnit);
|
|
18405
|
-
onValueChange(createPeriodValue(nextUnit));
|
|
18535
|
+
onValueChange(createPeriodValue(nextUnit, maxRange));
|
|
18406
18536
|
};
|
|
18407
18537
|
const updateInputValue = (nextValue) => {
|
|
18408
18538
|
onValueChange({ unit: selectedUnit, value: nextValue });
|
|
@@ -18485,7 +18615,7 @@ function PeriodPresetEditor({
|
|
|
18485
18615
|
value: Array.isArray(periodValue.value) && periodValue.value.length === 2 ? periodValue.value : null,
|
|
18486
18616
|
onValueChange: updateInputValue,
|
|
18487
18617
|
selectable: field.selectable,
|
|
18488
|
-
maxRange
|
|
18618
|
+
maxRange,
|
|
18489
18619
|
disabled,
|
|
18490
18620
|
width: "100%"
|
|
18491
18621
|
}
|
|
@@ -18497,7 +18627,7 @@ function PeriodPresetEditor({
|
|
|
18497
18627
|
{
|
|
18498
18628
|
val: preset.value,
|
|
18499
18629
|
value: selectedId,
|
|
18500
|
-
label: preset
|
|
18630
|
+
label: getPresetLabel(preset, maxRange),
|
|
18501
18631
|
disabled,
|
|
18502
18632
|
onValueChange: () => selectPreset(preset)
|
|
18503
18633
|
},
|
|
@@ -18709,7 +18839,7 @@ function KeywordEditor({
|
|
|
18709
18839
|
}
|
|
18710
18840
|
};
|
|
18711
18841
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18712
|
-
/* @__PURE__ */ jsxRuntime.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: [
|
|
18842
|
+
/* @__PURE__ */ jsxRuntime.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: [
|
|
18713
18843
|
field.matchModes && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
18714
18844
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18715
18845
|
"span",
|
|
@@ -18751,7 +18881,7 @@ function KeywordEditor({
|
|
|
18751
18881
|
entries3.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18752
18882
|
"div",
|
|
18753
18883
|
{
|
|
18754
|
-
className: "
|
|
18884
|
+
className: "min-h-0 flex-1 overflow-auto border-t border-solid py-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18755
18885
|
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18756
18886
|
children: entries3.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
18757
18887
|
KeywordEntryRow,
|
|
@@ -18809,6 +18939,7 @@ function OptionList({
|
|
|
18809
18939
|
const selected = multiple ? toArrayValue(value) : [];
|
|
18810
18940
|
const singleValue = !multiple && (typeof value === "string" || typeof value === "number") ? value : null;
|
|
18811
18941
|
const [search, setSearch] = react.useState("");
|
|
18942
|
+
const searchInputRef = react.useRef(null);
|
|
18812
18943
|
const options = field.options ?? [];
|
|
18813
18944
|
const showSearch = options.length >= OPTION_SEARCH_THRESHOLD;
|
|
18814
18945
|
const filteredOptions = react.useMemo(() => {
|
|
@@ -18816,74 +18947,70 @@ function OptionList({
|
|
|
18816
18947
|
const query = search.trim().toLowerCase();
|
|
18817
18948
|
return options.filter((option) => option.label.toLowerCase().includes(query));
|
|
18818
18949
|
}, [options, search, showSearch]);
|
|
18950
|
+
react.useEffect(() => {
|
|
18951
|
+
if (!showSearch || disabled) return;
|
|
18952
|
+
searchInputRef.current?.focus();
|
|
18953
|
+
}, [showSearch, disabled]);
|
|
18819
18954
|
if (options.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(EmptyItem, { children: "\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4." });
|
|
18820
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18821
|
-
|
|
18822
|
-
|
|
18823
|
-
|
|
18824
|
-
"
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
|
|
18828
|
-
children: [
|
|
18829
|
-
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18830
|
-
"div",
|
|
18955
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
18956
|
+
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18957
|
+
"div",
|
|
18958
|
+
{
|
|
18959
|
+
className: "shrink-0 border-b border-solid px-[8px] pb-[4px] pt-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18960
|
+
style: { borderColor: CHIPFILTER.listboxBorder },
|
|
18961
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18962
|
+
SSearchInput,
|
|
18831
18963
|
{
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
|
|
18840
|
-
disabled,
|
|
18841
|
-
placeholder: "\uAC80\uC0C9",
|
|
18842
|
-
onChange: (event) => setSearch(event.target.value),
|
|
18843
|
-
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"
|
|
18844
|
-
}
|
|
18845
|
-
),
|
|
18846
|
-
search !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18847
|
-
SGhostButton,
|
|
18848
|
-
{
|
|
18849
|
-
icon: "close",
|
|
18850
|
-
size: "xxs",
|
|
18851
|
-
ariaLabel: "\uAC80\uC0C9\uC5B4 \uC9C0\uC6B0\uAE30",
|
|
18852
|
-
className: "flex-shrink-0",
|
|
18853
|
-
onClick: () => setSearch("")
|
|
18854
|
-
}
|
|
18855
|
-
)
|
|
18856
|
-
] })
|
|
18964
|
+
ref: searchInputRef,
|
|
18965
|
+
size: "sm",
|
|
18966
|
+
value: search,
|
|
18967
|
+
onValueChange: setSearch,
|
|
18968
|
+
disabled,
|
|
18969
|
+
placeholder: "\uAC80\uC0C9",
|
|
18970
|
+
clearable: true,
|
|
18971
|
+
width: "100%"
|
|
18857
18972
|
}
|
|
18973
|
+
)
|
|
18974
|
+
}
|
|
18975
|
+
),
|
|
18976
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
18977
|
+
"div",
|
|
18978
|
+
{
|
|
18979
|
+
className: cn(
|
|
18980
|
+
"min-h-0 flex-1 overflow-auto",
|
|
18981
|
+
!showSearch && "pt-[var(--cmp-chipFilter-listbox-list-paddingY)]",
|
|
18982
|
+
"pb-[var(--cmp-chipFilter-listbox-list-paddingY)]"
|
|
18858
18983
|
),
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
|
|
18864
|
-
|
|
18865
|
-
|
|
18866
|
-
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
|
|
18984
|
+
children: [
|
|
18985
|
+
showSearch && filteredOptions.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyItem, { children: "\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." }),
|
|
18986
|
+
filteredOptions.map((option) => {
|
|
18987
|
+
const checked = multiple ? selected.includes(option.value) : singleValue === option.value;
|
|
18988
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18989
|
+
MenuItem,
|
|
18990
|
+
{
|
|
18991
|
+
selected: checked,
|
|
18992
|
+
disabled: disabled || option.disabled,
|
|
18993
|
+
multi: multiple,
|
|
18994
|
+
onClick: () => {
|
|
18995
|
+
if (multiple) {
|
|
18996
|
+
const next = checked ? selected.filter((v) => v !== option.value) : [...selected, option.value];
|
|
18997
|
+
onValueChange(next);
|
|
18998
|
+
} else {
|
|
18999
|
+
onValueChange(option.value);
|
|
19000
|
+
}
|
|
19001
|
+
},
|
|
19002
|
+
children: [
|
|
19003
|
+
multiple && /* @__PURE__ */ jsxRuntime.jsx(OptionCheckbox, { checked }),
|
|
19004
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: option.label })
|
|
19005
|
+
]
|
|
18875
19006
|
},
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
})
|
|
18884
|
-
]
|
|
18885
|
-
}
|
|
18886
|
-
);
|
|
19007
|
+
String(option.value)
|
|
19008
|
+
);
|
|
19009
|
+
})
|
|
19010
|
+
]
|
|
19011
|
+
}
|
|
19012
|
+
)
|
|
19013
|
+
] });
|
|
18887
19014
|
}
|
|
18888
19015
|
function OptionCheckbox({ checked }) {
|
|
18889
19016
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18897,15 +19024,22 @@ function OptionCheckbox({ checked }) {
|
|
|
18897
19024
|
}
|
|
18898
19025
|
);
|
|
18899
19026
|
}
|
|
18900
|
-
function ListBox({
|
|
19027
|
+
function ListBox({
|
|
19028
|
+
children,
|
|
19029
|
+
maxHeight
|
|
19030
|
+
}) {
|
|
18901
19031
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18902
19032
|
"div",
|
|
18903
19033
|
{
|
|
18904
|
-
className:
|
|
19034
|
+
className: cn(
|
|
19035
|
+
"overflow-hidden border border-solid shadow-[var(--shadow-overlay)]",
|
|
19036
|
+
maxHeight && "flex flex-col"
|
|
19037
|
+
),
|
|
18905
19038
|
style: {
|
|
18906
19039
|
borderRadius: CHIPFILTER.listboxRadius,
|
|
18907
19040
|
background: CHIPFILTER.listboxBg,
|
|
18908
|
-
borderColor: CHIPFILTER.listboxBorder
|
|
19041
|
+
borderColor: CHIPFILTER.listboxBorder,
|
|
19042
|
+
maxHeight
|
|
18909
19043
|
},
|
|
18910
19044
|
children
|
|
18911
19045
|
}
|