@ceed/ads 1.2.8-next.1 → 1.2.8-next.3
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/index.cjs +132 -92
- package/dist/index.js +134 -93
- package/framer/index.js +30 -30
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3029,51 +3029,73 @@ var HeadCell = (props) => {
|
|
|
3029
3029
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3030
3030
|
[tableId, headerName, field]
|
|
3031
3031
|
);
|
|
3032
|
-
const resizer =
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3032
|
+
const resizer = (0, import_react25.useMemo)(
|
|
3033
|
+
() => resizable ?? true ? Resizer(ref) : null,
|
|
3034
|
+
[resizable, ref]
|
|
3035
|
+
);
|
|
3036
|
+
const style = (0, import_react25.useMemo)(
|
|
3037
|
+
() => ({
|
|
3038
|
+
width,
|
|
3039
|
+
minWidth: minWidth ?? "50px",
|
|
3040
|
+
maxWidth,
|
|
3041
|
+
position: isPinned ? "sticky" : stickyHeader ? void 0 : "relative",
|
|
3042
|
+
// 조건식 더 복잡해지면 IIFE로 정리
|
|
3043
|
+
left: isPinned ? pinnedStartPosition : void 0,
|
|
3044
|
+
right: isPinned ? pinnedEndPosition : void 0,
|
|
3045
|
+
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + 2)` : void 0,
|
|
3046
|
+
cursor: sortable ? "pointer" : "default",
|
|
3047
|
+
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3048
|
+
userSelect: "none"
|
|
3049
|
+
}),
|
|
3050
|
+
[
|
|
3051
|
+
isPinned,
|
|
3052
|
+
maxWidth,
|
|
3053
|
+
minWidth,
|
|
3054
|
+
pinnedEndPosition,
|
|
3055
|
+
pinnedStartPosition,
|
|
3056
|
+
sortable,
|
|
3057
|
+
stickyHeader,
|
|
3058
|
+
theme,
|
|
3059
|
+
width
|
|
3060
|
+
]
|
|
3061
|
+
);
|
|
3046
3062
|
const textAlign = getTextAlign(props);
|
|
3047
3063
|
const initialSort = sortOrder[0];
|
|
3048
|
-
const sortIcon =
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3064
|
+
const sortIcon = (0, import_react25.useMemo)(
|
|
3065
|
+
() => sortable && /* @__PURE__ */ import_react25.default.createElement(
|
|
3066
|
+
MotionSortIcon,
|
|
3067
|
+
{
|
|
3068
|
+
style: {
|
|
3069
|
+
width: "16px",
|
|
3070
|
+
height: "16px"
|
|
3071
|
+
},
|
|
3072
|
+
role: "img",
|
|
3073
|
+
"aria-labelledby": headId,
|
|
3074
|
+
"aria-description": (sort ?? initialSort) === "desc" ? "descending" : "ascending",
|
|
3075
|
+
"data-testid": void 0,
|
|
3076
|
+
variants: {
|
|
3077
|
+
hover: { opacity: 1 },
|
|
3078
|
+
initial: { opacity: 0 }
|
|
3079
|
+
},
|
|
3080
|
+
animate: {
|
|
3081
|
+
color: !!sort ? "var(--ceed-palette-text-secondary)" : "var(--ceed-palette-primary-solidDisabledColor)",
|
|
3082
|
+
rotate: (sort ?? initialSort) === "desc" ? 180 : 0,
|
|
3083
|
+
opacity: !!sort ? 1 : 0
|
|
3084
|
+
},
|
|
3085
|
+
transition: {
|
|
3086
|
+
duration: 0,
|
|
3087
|
+
rotate: { duration: 0.2, ease: "easeOut" },
|
|
3088
|
+
color: { duration: 0.2, ease: "easeInOut" },
|
|
3089
|
+
opacity: { duration: 0.2, ease: "easeInOut" }
|
|
3090
|
+
}
|
|
3073
3091
|
}
|
|
3074
|
-
|
|
3092
|
+
),
|
|
3093
|
+
[headId, initialSort, sort, sortable]
|
|
3094
|
+
);
|
|
3095
|
+
const infoSign = (0, import_react25.useMemo)(
|
|
3096
|
+
() => description ? /* @__PURE__ */ import_react25.default.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null,
|
|
3097
|
+
[description]
|
|
3075
3098
|
);
|
|
3076
|
-
const infoSign = description ? /* @__PURE__ */ import_react25.default.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null;
|
|
3077
3099
|
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3078
3100
|
StyledTh,
|
|
3079
3101
|
{
|
|
@@ -3083,7 +3105,10 @@ var HeadCell = (props) => {
|
|
|
3083
3105
|
ref,
|
|
3084
3106
|
key: field,
|
|
3085
3107
|
style,
|
|
3086
|
-
onClick: (
|
|
3108
|
+
onClick: (0, import_react25.useCallback)(
|
|
3109
|
+
(e) => sortable && onSortChange?.({ field, currentSort: sort, multiple: e.shiftKey }),
|
|
3110
|
+
[field, onSortChange, sort, sortable]
|
|
3111
|
+
),
|
|
3087
3112
|
whileHover: "hover",
|
|
3088
3113
|
initial: "initial"
|
|
3089
3114
|
},
|
|
@@ -3141,7 +3166,7 @@ var BodyCell = (props) => {
|
|
|
3141
3166
|
...typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {},
|
|
3142
3167
|
size: "sm"
|
|
3143
3168
|
}),
|
|
3144
|
-
[props, params]
|
|
3169
|
+
[props.componentProps, params]
|
|
3145
3170
|
);
|
|
3146
3171
|
const editModeComponentProps = (0, import_react25.useMemo)(
|
|
3147
3172
|
() => ({
|
|
@@ -3203,11 +3228,20 @@ var BodyCell = (props) => {
|
|
|
3203
3228
|
}
|
|
3204
3229
|
}
|
|
3205
3230
|
}),
|
|
3206
|
-
[
|
|
3231
|
+
[
|
|
3232
|
+
params,
|
|
3233
|
+
row,
|
|
3234
|
+
field,
|
|
3235
|
+
value,
|
|
3236
|
+
componentProps,
|
|
3237
|
+
type,
|
|
3238
|
+
props.onCellEditStop,
|
|
3239
|
+
props.onCellEditStart
|
|
3240
|
+
]
|
|
3207
3241
|
);
|
|
3208
3242
|
const EditModeComponent = (0, import_react25.useMemo)(() => {
|
|
3209
3243
|
if (renderEditCell) {
|
|
3210
|
-
return (0, import_react25.createElement)(renderEditCell, params);
|
|
3244
|
+
return (0, import_react25.createElement)((0, import_react25.memo)(renderEditCell), params);
|
|
3211
3245
|
}
|
|
3212
3246
|
return {
|
|
3213
3247
|
date: /* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -3267,7 +3301,7 @@ var BodyCell = (props) => {
|
|
|
3267
3301
|
}, [value, editModeComponentProps, type]);
|
|
3268
3302
|
const ReadModeComponent = (0, import_react25.useMemo)(() => {
|
|
3269
3303
|
if (renderCell) {
|
|
3270
|
-
return (0, import_react25.createElement)(renderCell, params);
|
|
3304
|
+
return (0, import_react25.createElement)((0, import_react25.memo)(renderCell), params);
|
|
3271
3305
|
}
|
|
3272
3306
|
const innerText = value;
|
|
3273
3307
|
const typedComponent = {
|
|
@@ -3280,14 +3314,14 @@ var BodyCell = (props) => {
|
|
|
3280
3314
|
)
|
|
3281
3315
|
}[type || "text"];
|
|
3282
3316
|
return typedComponent || innerText;
|
|
3283
|
-
}, [value, renderCell, params, type, componentProps
|
|
3317
|
+
}, [value, renderCell, params, type, componentProps]);
|
|
3284
3318
|
const CellComponent = (0, import_react25.useMemo)(
|
|
3285
3319
|
() => editMode && EditModeComponent ? EditModeComponent : ReadModeComponent,
|
|
3286
3320
|
[editMode, EditModeComponent, ReadModeComponent]
|
|
3287
3321
|
);
|
|
3288
3322
|
const showTooltip = (0, import_react25.useMemo)(
|
|
3289
|
-
() => noWrap &&
|
|
3290
|
-
[noWrap,
|
|
3323
|
+
() => noWrap && type === "longText",
|
|
3324
|
+
[noWrap, type]
|
|
3291
3325
|
);
|
|
3292
3326
|
(0, import_react25.useEffect)(() => {
|
|
3293
3327
|
setValue(row[field]);
|
|
@@ -3298,55 +3332,59 @@ var BodyCell = (props) => {
|
|
|
3298
3332
|
ref: cellRef,
|
|
3299
3333
|
key: field,
|
|
3300
3334
|
headers: `${tableId}_header_${props.headerName ?? field}`,
|
|
3301
|
-
|
|
3335
|
+
sx: {
|
|
3302
3336
|
textAlign: getTextAlign({ type }),
|
|
3303
3337
|
verticalAlign: editMode ? "top" : "middle",
|
|
3304
3338
|
position: isPinned ? "sticky" : void 0,
|
|
3305
3339
|
left: isPinned ? pinnedStartPosition : void 0,
|
|
3306
3340
|
right: isPinned ? pinnedEndPosition : void 0,
|
|
3307
3341
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + 2)` : void 0,
|
|
3308
|
-
// @ts-expect-error: react CSSProperties에는 --var를 지원하지 않는다.
|
|
3309
3342
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3310
3343
|
},
|
|
3311
3344
|
className: isLastStartPinnedColumn && "is-last-left" || isLastEndPinnedColumn && "is-last-right" || ""
|
|
3312
3345
|
},
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
title: value,
|
|
3317
|
-
placement: "bottom",
|
|
3318
|
-
style: { maxWidth: "100%" },
|
|
3319
|
-
enterDelay: 1500,
|
|
3320
|
-
enterNextDelay: 1500
|
|
3321
|
-
},
|
|
3322
|
-
/* @__PURE__ */ import_react25.default.createElement(
|
|
3323
|
-
"div",
|
|
3346
|
+
(0, import_react25.useMemo)(
|
|
3347
|
+
() => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(
|
|
3348
|
+
Tooltip_default,
|
|
3324
3349
|
{
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3350
|
+
title: value,
|
|
3351
|
+
placement: "bottom",
|
|
3352
|
+
style: { maxWidth: "100%" },
|
|
3353
|
+
enterDelay: 1500,
|
|
3354
|
+
enterNextDelay: 1500
|
|
3329
3355
|
},
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3356
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3357
|
+
"div",
|
|
3358
|
+
{
|
|
3359
|
+
style: {
|
|
3360
|
+
overflow: "hidden",
|
|
3361
|
+
textOverflow: "ellipsis"
|
|
3362
|
+
}
|
|
3363
|
+
},
|
|
3364
|
+
CellComponent
|
|
3365
|
+
)
|
|
3366
|
+
) : CellComponent,
|
|
3367
|
+
[CellComponent, showTooltip, value]
|
|
3368
|
+
)
|
|
3333
3369
|
);
|
|
3334
3370
|
};
|
|
3335
|
-
var BodyRow = (
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3371
|
+
var BodyRow = (0, import_react25.memo)(
|
|
3372
|
+
(props) => {
|
|
3373
|
+
const { tableId, columns, rowId, editMode, noWrap, row } = props;
|
|
3374
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, columns.map((column, i) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3375
|
+
BodyCell,
|
|
3376
|
+
{
|
|
3377
|
+
...column,
|
|
3378
|
+
tableId,
|
|
3379
|
+
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3380
|
+
row,
|
|
3381
|
+
rowId,
|
|
3382
|
+
editMode,
|
|
3383
|
+
noWrap
|
|
3384
|
+
}
|
|
3385
|
+
)));
|
|
3386
|
+
}
|
|
3387
|
+
);
|
|
3350
3388
|
function useDataTableRenderer({
|
|
3351
3389
|
rows: _rows,
|
|
3352
3390
|
columns: columnsProp,
|
|
@@ -3358,8 +3396,8 @@ function useDataTableRenderer({
|
|
|
3358
3396
|
paginationModel,
|
|
3359
3397
|
onPaginationModelChange,
|
|
3360
3398
|
sortModel: controlledSortModel,
|
|
3361
|
-
sortOrder: _sortOrder
|
|
3362
|
-
selectionModel
|
|
3399
|
+
sortOrder: _sortOrder,
|
|
3400
|
+
selectionModel,
|
|
3363
3401
|
onSortModelChange,
|
|
3364
3402
|
onSelectionModelChange,
|
|
3365
3403
|
editMode,
|
|
@@ -3421,7 +3459,8 @@ function useDataTableRenderer({
|
|
|
3421
3459
|
[_rows, sortModel, sortComparator]
|
|
3422
3460
|
);
|
|
3423
3461
|
const sortOrder = (0, import_react25.useMemo)(
|
|
3424
|
-
|
|
3462
|
+
// NOTE: default value를 props destructuring에서 할당하면 렌더링 시점에 초기화가 되어버린다.
|
|
3463
|
+
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
3425
3464
|
[_sortOrder]
|
|
3426
3465
|
);
|
|
3427
3466
|
const [page, setPage] = (0, import_react25.useState)(paginationModel?.page || 1);
|
|
@@ -3431,7 +3470,8 @@ function useDataTableRenderer({
|
|
|
3431
3470
|
[_getId, page, pageSize]
|
|
3432
3471
|
);
|
|
3433
3472
|
const selectedModelSet = (0, import_react25.useMemo)(
|
|
3434
|
-
|
|
3473
|
+
// NOTE: default value를 props destructuring에서 할당하면 렌더링 시점에 초기화가 되어버린다.
|
|
3474
|
+
() => new Set(selectionModel || []),
|
|
3435
3475
|
[selectionModel]
|
|
3436
3476
|
);
|
|
3437
3477
|
const dataInPage = (0, import_react25.useMemo)(
|
|
@@ -3444,7 +3484,7 @@ function useDataTableRenderer({
|
|
|
3444
3484
|
);
|
|
3445
3485
|
const rowCount = totalRowsProp || rows.length;
|
|
3446
3486
|
const isTotalSelected = (0, import_react25.useMemo)(
|
|
3447
|
-
() => _isTotalSelected ?? (rowCount > 0 && selectionModel
|
|
3487
|
+
() => _isTotalSelected ?? (rowCount > 0 && (selectionModel?.length || 0) === rowCount),
|
|
3448
3488
|
[_isTotalSelected, selectionModel, rowCount]
|
|
3449
3489
|
);
|
|
3450
3490
|
const columns = (0, import_react25.useMemo)(() => {
|
|
@@ -3568,12 +3608,12 @@ function useDataTableRenderer({
|
|
|
3568
3608
|
onCheckboxChange: (0, import_react25.useCallback)(
|
|
3569
3609
|
(event, selectedModel) => {
|
|
3570
3610
|
if (selectedModelSet.has(selectedModel)) {
|
|
3571
|
-
const newSelectionModel = selectionModel.filter(
|
|
3611
|
+
const newSelectionModel = (selectionModel || []).filter(
|
|
3572
3612
|
(model) => model !== selectedModel
|
|
3573
3613
|
);
|
|
3574
3614
|
onSelectionModelChange?.(newSelectionModel);
|
|
3575
3615
|
} else {
|
|
3576
|
-
const newSelectionModel = [...selectionModel, selectedModel];
|
|
3616
|
+
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
3577
3617
|
onSelectionModelChange?.(newSelectionModel);
|
|
3578
3618
|
}
|
|
3579
3619
|
},
|
|
@@ -3661,7 +3701,7 @@ function Component(props, apiRef) {
|
|
|
3661
3701
|
getScrollElement: () => parentRef.current,
|
|
3662
3702
|
estimateSize: () => 32,
|
|
3663
3703
|
measureElement: (element) => element.clientHeight,
|
|
3664
|
-
overscan:
|
|
3704
|
+
overscan: 10
|
|
3665
3705
|
});
|
|
3666
3706
|
const paginationModel = (0, import_react25.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
|
|
3667
3707
|
const totalSize = virtualizer.getTotalSize();
|