@ceed/ads 1.7.0 → 1.7.1-next.1

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.
@@ -104,7 +104,15 @@ export type LinkColumnDef<T extends Record<PropertyKey, string>, ID, C extends R
104
104
  component?: C;
105
105
  componentProps?: ComponentProperties<C, T, ID, string>;
106
106
  };
107
- export type ColumnDef<T extends Record<PropertyKey, any>, ID = unknown> = AutocompleteColumnDef<T, ID> | CurrencyColumnDef<T, ID> | DateColumnDef<T, ID> | NumberColumnDef<T, ID> | TextColumnDef<T, ID> | LongTextColumnDef<T, ID> | LinkColumnDef<T, ID> | SelectColumnDef<T, ID>;
107
+ export type ActionsColumnDef<T extends Record<PropertyKey, string>, ID> = BaseColumnDef<T, string, ID> & {
108
+ type: "actions";
109
+ getActions: (params: {
110
+ row: T;
111
+ value?: any;
112
+ id: ID;
113
+ }) => ReactNode[];
114
+ };
115
+ export type ColumnDef<T extends Record<PropertyKey, any>, ID = unknown> = AutocompleteColumnDef<T, ID> | CurrencyColumnDef<T, ID> | DateColumnDef<T, ID> | NumberColumnDef<T, ID> | TextColumnDef<T, ID> | LongTextColumnDef<T, ID> | LinkColumnDef<T, ID> | SelectColumnDef<T, ID> | ActionsColumnDef<T, ID>;
108
116
  export type Sort = "asc" | "desc" | null;
109
117
  export type SortModel<T extends Record<PropertyKey, any>> = {
110
118
  [K in keyof T]: {
@@ -9,14 +9,11 @@ declare function IconMenuButton<T extends ElementType, P extends ElementType>(pr
9
9
  loading?: boolean;
10
10
  color?: MenuButtonProps<T, P>["color"];
11
11
  variant?: MenuButtonProps<T, P>["variant"];
12
- endDecorator?: MenuButtonProps<T, P>["endDecorator"];
13
- startDecorator?: MenuButtonProps<T, P>["startDecorator"];
14
12
  items?: {
15
13
  text: string;
16
14
  component?: P;
17
15
  componentProps?: ComponentProps<P>;
18
16
  }[];
19
- showIcon?: boolean;
20
17
  placement?: "bottom-start" | "bottom" | "bottom-end";
21
18
  }): React.JSX.Element;
22
19
  declare namespace IconMenuButton {
package/dist/index.cjs CHANGED
@@ -3003,13 +3003,17 @@ var VirtualizedTableBody = (0, import_joy33.styled)("tbody", {
3003
3003
  },
3004
3004
  // NOTE: 테이블 안에 버튼을 넣을 때 버튼의 높이가 테이블의 높이를 넘어가지 않도록 설정
3005
3005
  [`& .${import_joy33.buttonClasses.root}`]: {
3006
- "--Button-minHeight": "20px",
3006
+ "--Button-minHeight": "26px",
3007
3007
  "--Button-paddingBlock": "0.25rem",
3008
- lineHeight: 1
3008
+ lineHeight: 1,
3009
+ marginTop: "-2px",
3010
+ marginBottom: "-2px"
3009
3011
  },
3010
3012
  [`& .${import_joy33.iconButtonClasses.root}`]: {
3011
- "--IconButton-size": "21px",
3012
- verticalAlign: "middle"
3013
+ "--IconButton-size": "26px",
3014
+ verticalAlign: "middle",
3015
+ marginTop: "-2px",
3016
+ marginBottom: "-2px"
3013
3017
  }
3014
3018
  });
3015
3019
  var StyledTableRow = (0, import_joy33.styled)("tr", {
@@ -3073,13 +3077,14 @@ var HeadCell = (props) => {
3073
3077
  stickyHeader,
3074
3078
  resizable,
3075
3079
  field,
3080
+ type,
3076
3081
  tableId,
3077
3082
  headerName,
3078
3083
  required,
3079
3084
  editMode,
3080
3085
  sort,
3081
3086
  onSortChange,
3082
- sortable = true,
3087
+ sortable: _sortable = true,
3083
3088
  sortOrder,
3084
3089
  description,
3085
3090
  isPinned,
@@ -3089,6 +3094,7 @@ var HeadCell = (props) => {
3089
3094
  } = props;
3090
3095
  const theme = (0, import_joy33.useTheme)();
3091
3096
  const ref = headerRef;
3097
+ const sortable = type === "actions" ? false : _sortable;
3092
3098
  const headId = (0, import_react25.useMemo)(
3093
3099
  () => `${tableId}_header_${headerName ?? field}`.trim(),
3094
3100
  [tableId, headerName, field]
@@ -3227,10 +3233,10 @@ var BodyCell = (props) => {
3227
3233
  );
3228
3234
  const componentProps = (0, import_react25.useMemo)(
3229
3235
  () => ({
3230
- ...typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {},
3236
+ ..."componentProps" in props && (typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {}),
3231
3237
  size: "sm"
3232
3238
  }),
3233
- [props.componentProps, params]
3239
+ ["componentProps" in props ? props.componentProps : null, params]
3234
3240
  );
3235
3241
  const editModeComponentProps = (0, import_react25.useMemo)(
3236
3242
  () => ({
@@ -3379,10 +3385,27 @@ var BodyCell = (props) => {
3379
3385
  }[type || "text"];
3380
3386
  return typedComponent || innerText;
3381
3387
  }, [value, renderCell, params, type, componentProps]);
3382
- const CellComponent = (0, import_react25.useMemo)(
3383
- () => editMode && EditModeComponent ? EditModeComponent : ReadModeComponent,
3384
- [editMode, EditModeComponent, ReadModeComponent]
3385
- );
3388
+ const CellComponent = (0, import_react25.useMemo)(() => {
3389
+ if (type === "actions") {
3390
+ return /* @__PURE__ */ import_react25.default.createElement(
3391
+ Stack_default,
3392
+ {
3393
+ direction: "row",
3394
+ gap: 1,
3395
+ justifyContent: "center",
3396
+ alignItems: "center"
3397
+ },
3398
+ props.getActions?.(params)
3399
+ );
3400
+ }
3401
+ return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
3402
+ }, [
3403
+ type,
3404
+ props.getActions,
3405
+ editMode,
3406
+ EditModeComponent,
3407
+ ReadModeComponent
3408
+ ]);
3386
3409
  const showTooltip = (0, import_react25.useMemo)(
3387
3410
  () => noWrap && type === "longText",
3388
3411
  [noWrap, type]
package/dist/index.js CHANGED
@@ -2960,13 +2960,17 @@ var VirtualizedTableBody = styled12("tbody", {
2960
2960
  },
2961
2961
  // NOTE: 테이블 안에 버튼을 넣을 때 버튼의 높이가 테이블의 높이를 넘어가지 않도록 설정
2962
2962
  [`& .${buttonClasses.root}`]: {
2963
- "--Button-minHeight": "20px",
2963
+ "--Button-minHeight": "26px",
2964
2964
  "--Button-paddingBlock": "0.25rem",
2965
- lineHeight: 1
2965
+ lineHeight: 1,
2966
+ marginTop: "-2px",
2967
+ marginBottom: "-2px"
2966
2968
  },
2967
2969
  [`& .${iconButtonClasses.root}`]: {
2968
- "--IconButton-size": "21px",
2969
- verticalAlign: "middle"
2970
+ "--IconButton-size": "26px",
2971
+ verticalAlign: "middle",
2972
+ marginTop: "-2px",
2973
+ marginBottom: "-2px"
2970
2974
  }
2971
2975
  });
2972
2976
  var StyledTableRow = styled12("tr", {
@@ -3030,13 +3034,14 @@ var HeadCell = (props) => {
3030
3034
  stickyHeader,
3031
3035
  resizable,
3032
3036
  field,
3037
+ type,
3033
3038
  tableId,
3034
3039
  headerName,
3035
3040
  required,
3036
3041
  editMode,
3037
3042
  sort,
3038
3043
  onSortChange,
3039
- sortable = true,
3044
+ sortable: _sortable = true,
3040
3045
  sortOrder,
3041
3046
  description,
3042
3047
  isPinned,
@@ -3046,6 +3051,7 @@ var HeadCell = (props) => {
3046
3051
  } = props;
3047
3052
  const theme = useTheme();
3048
3053
  const ref = headerRef;
3054
+ const sortable = type === "actions" ? false : _sortable;
3049
3055
  const headId = useMemo8(
3050
3056
  () => `${tableId}_header_${headerName ?? field}`.trim(),
3051
3057
  [tableId, headerName, field]
@@ -3184,10 +3190,10 @@ var BodyCell = (props) => {
3184
3190
  );
3185
3191
  const componentProps = useMemo8(
3186
3192
  () => ({
3187
- ...typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {},
3193
+ ..."componentProps" in props && (typeof props.componentProps === "function" ? props.componentProps(params) : props.componentProps || {}),
3188
3194
  size: "sm"
3189
3195
  }),
3190
- [props.componentProps, params]
3196
+ ["componentProps" in props ? props.componentProps : null, params]
3191
3197
  );
3192
3198
  const editModeComponentProps = useMemo8(
3193
3199
  () => ({
@@ -3336,10 +3342,27 @@ var BodyCell = (props) => {
3336
3342
  }[type || "text"];
3337
3343
  return typedComponent || innerText;
3338
3344
  }, [value, renderCell, params, type, componentProps]);
3339
- const CellComponent = useMemo8(
3340
- () => editMode && EditModeComponent ? EditModeComponent : ReadModeComponent,
3341
- [editMode, EditModeComponent, ReadModeComponent]
3342
- );
3345
+ const CellComponent = useMemo8(() => {
3346
+ if (type === "actions") {
3347
+ return /* @__PURE__ */ React23.createElement(
3348
+ Stack_default,
3349
+ {
3350
+ direction: "row",
3351
+ gap: 1,
3352
+ justifyContent: "center",
3353
+ alignItems: "center"
3354
+ },
3355
+ props.getActions?.(params)
3356
+ );
3357
+ }
3358
+ return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
3359
+ }, [
3360
+ type,
3361
+ props.getActions,
3362
+ editMode,
3363
+ EditModeComponent,
3364
+ ReadModeComponent
3365
+ ]);
3343
3366
  const showTooltip = useMemo8(
3344
3367
  () => noWrap && type === "longText",
3345
3368
  [noWrap, type]