@ceed/ads 1.41.3-next.5 → 1.41.3-next.6

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.
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import type { ObjectLike, ColumnDef, Sort } from './types';
2
+ import type { ObjectLike, RenderedColumnDef, Sort } from './types';
3
3
  export declare const TextEllipsis: ({ children, lineClamp, ...rest }: {
4
4
  children: ReactNode;
5
5
  lineClamp?: number | undefined;
@@ -7,7 +7,7 @@ export declare const TextEllipsis: ({ children, lineClamp, ...rest }: {
7
7
  export declare const CellTextEllipsis: ({ children }: {
8
8
  children: ReactNode;
9
9
  }) => React.JSX.Element;
10
- export declare const HeadCell: <T extends ObjectLike, GetId>(props: ColumnDef<T, GetId> & {
10
+ export declare const HeadCell: <T extends ObjectLike, GetId>(props: RenderedColumnDef<T, GetId> & {
11
11
  tableId: string;
12
12
  stickyHeader?: boolean | undefined;
13
13
  editMode?: boolean | undefined;
@@ -26,14 +26,14 @@ export declare const BodyCell: <T extends Record<string, any>, ID>(props: {
26
26
  rowId: ID;
27
27
  editMode?: boolean | undefined;
28
28
  noWrap?: boolean | undefined;
29
- } & ColumnDef<T, any>) => React.JSX.Element;
29
+ } & RenderedColumnDef<T, any>) => React.JSX.Element;
30
30
  export declare const BodyRow: <T extends Record<string, any>, ID>(props: {
31
31
  tableId: string;
32
32
  row: T;
33
33
  rowId: ID;
34
34
  editMode?: boolean;
35
35
  noWrap?: boolean;
36
- columns: ColumnDef<T, any>[];
36
+ columns: RenderedColumnDef<T, any>[];
37
37
  }) => JSX.Element;
38
38
  export declare const VirtualizedTableRow: React.NamedExoticComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme> & {
39
39
  striped?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { ObjectLike, ColumnDef, DataTableProps, Sort, InferredIdType } from './types';
2
+ import type { ObjectLike, RenderedColumnDef, DataTableProps, Sort, InferredIdType } from './types';
3
3
  export declare function useColumnWidths(columnsById: Record<string, {
4
4
  field: PropertyKey;
5
5
  headerRef: React.RefObject<HTMLTableCellElement>;
@@ -11,7 +11,7 @@ export declare function useDataTableRenderer<T extends Record<PropertyKey, unkno
11
11
  pageSize: number;
12
12
  onPaginationModelChange: (newPage: number) => void;
13
13
  getId: (row: T, index?: number) => InferredIdType<T, GetId>;
14
- HeadCell: <T_1 extends ObjectLike, GetId_1>(props: ColumnDef<T_1, GetId_1> & {
14
+ HeadCell: <T_1 extends ObjectLike, GetId_1>(props: RenderedColumnDef<T_1, GetId_1> & {
15
15
  tableId: string;
16
16
  stickyHeader?: boolean | undefined;
17
17
  editMode?: boolean | undefined;
@@ -30,7 +30,7 @@ export declare function useDataTableRenderer<T extends Record<PropertyKey, unkno
30
30
  rowId: ID;
31
31
  editMode?: boolean | undefined;
32
32
  noWrap?: boolean | undefined;
33
- columns: ColumnDef<T_2, any>[];
33
+ columns: RenderedColumnDef<T_2, any>[];
34
34
  }) => JSX.Element;
35
35
  dataInPage: T[];
36
36
  handleSortChange: (props: {
@@ -47,7 +47,7 @@ export declare function useDataTableRenderer<T extends Record<PropertyKey, unkno
47
47
  onRowFocus: (rowId: InferredIdType<T, GetId>) => void;
48
48
  onAllCheckboxChange: () => void;
49
49
  onCheckboxChange: (event: React.MouseEvent | React.ChangeEvent | React.KeyboardEvent, selectedModel: InferredIdType<T, GetId>) => void;
50
- columns: ColumnDef<T, InferredIdType<T, GetId>>[];
50
+ columns: RenderedColumnDef<T, InferredIdType<T, GetId>>[];
51
51
  tableMinWidth: number;
52
52
  processedColumnGroups: {
53
53
  groups: import("./types").ProcessedColumnGroup[][];
@@ -73,13 +73,6 @@ export type FlattenedColumn<T extends Record<PropertyKey, any>, ID> = ColumnDef<
73
73
  export type BaseColumnDef<T extends Record<PropertyKey, V>, V, ID> = {
74
74
  [K in keyof T]: {
75
75
  field: K;
76
- /**
77
- * DataTable이 내부에서 자동으로 붙이는 컬럼 식별자. `field`를 그대로 쓰고, 같은 `field`가 여러 번
78
- * 정의된 경우에만 두 번째부터 `__2`, `__3` 접미사를 붙인다(이미 쓰인 이름은 건너뛴다).
79
- * 숨긴 컬럼까지 포함한 전체 컬럼 기준으로 매기므로 컬럼을 숨겨도 값이 바뀌지 않는다.
80
- * <col> key와 헤더 ref 매칭에만 쓰는 내부값이다. 소비자가 지정해도 무시되고, 외부에서 의존할 값이 아니다.
81
- */
82
- columnId?: string;
83
76
  headerName?: string;
84
77
  headerRef?: React.RefObject<HTMLTableCellElement>;
85
78
  tableColRef?: React.RefObject<HTMLTableColElement>;
@@ -155,6 +148,15 @@ export type ActionsColumnDef<T extends Record<PropertyKey, string>, ID> = BaseCo
155
148
  }) => ReactNode[];
156
149
  };
157
150
  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>;
151
+ /**
152
+ * 내부 렌더러가 `columnId`를 붙인 컬럼. `columnId`는 `field`를 그대로 쓰고, 같은 `field`가 여러 번
153
+ * 정의된 경우에만 두 번째부터 `__2`, `__3` 접미사를 붙인다(이미 쓰인 이름은 건너뛴다).
154
+ * 숨긴 컬럼까지 포함한 전체 컬럼 기준으로 매기므로 컬럼을 숨겨도 값이 바뀌지 않는다.
155
+ * <col> key와 헤더 ref 매칭에만 쓰는 내부값이라 소비자 `ColumnDef`에는 없다.
156
+ */
157
+ export type RenderedColumnDef<T extends Record<PropertyKey, any>, ID = unknown> = ColumnDef<T, ID> & {
158
+ columnId: string;
159
+ };
158
160
  export type ColumnVisibilityModel = Record<string, boolean>;
159
161
  export type Sort = 'asc' | 'desc' | null;
160
162
  export type SortModel<T extends Record<PropertyKey, any>> = {
@@ -0,0 +1,5 @@
1
+ import type { IconMenuButtonProps } from './IconMenuButton';
2
+ type Assert<T extends true> = T;
3
+ export type ButtonComponentPropsAcceptsSx = Assert<'sx' extends keyof NonNullable<IconMenuButtonProps['buttonComponentProps']> ? true : false>;
4
+ export type ItemComponentPropsAcceptsDisabled = Assert<'disabled' extends keyof NonNullable<NonNullable<IconMenuButtonProps['items']>[number]['componentProps']> ? true : false>;
5
+ export {};
@@ -46,6 +46,10 @@ export interface SelectProps<OptionValue extends OptionType, Multiple extends bo
46
46
  }, newValue: InferOptionValue<OptionValue>) => void;
47
47
  multiple?: Multiple;
48
48
  }
49
+ /**
50
+ * @visibleName Select
51
+ */
52
+ export declare function SelectInner<OptionValue extends OptionType, Multiple extends boolean = false>(props: SelectProps<OptionValue, Multiple>, ref: React.Ref<HTMLButtonElement>): React.JSX.Element;
49
53
  declare const Select: <OptionValue extends OptionType, Multiple extends boolean = false>(props: SelectProps<OptionValue, Multiple> & {
50
54
  ref?: React.Ref<HTMLButtonElement>;
51
55
  }) => React.ReactElement;
@@ -1,3 +1,4 @@
1
1
  import { Select } from './Select';
2
- export * from './Select';
2
+ export { Select, Option } from './Select';
3
+ export type { SelectProps, OptionType, InferOptionValue, OptionProps, JoySelectProps } from './Select';
3
4
  export default Select;
@@ -2426,7 +2426,7 @@ interface DataTableApi {
2426
2426
  - `pinnedColumns` and `columnGroupingModel` cannot be used simultaneously.
2427
2427
  - Two columns may share the same `field`. DataTable derives an internal per-column id so each duplicate keeps its own header/`<col>` element, measured width, and header `id`. The first column with a given `field` uses the `field` itself; each later duplicate gets a `__2`, `__3`, … suffix, skipping any name that is already a real `field`. The id is deliberately field-derived rather than positional: a positional id renumbers when a column is hidden, which would move a resized column's inline `<col>` width onto its neighbour. `sortModel` and `columnVisibilityModel` still match by `field`, so they apply to every column sharing it.
2428
2428
  - The header cell `id` (`<th id>`, referenced by each `<td headers>`) is built from that internal column id. It is stable across visibility changes, but it is an implementation detail — do not target it from external selectors, CSS, or `aria-labelledby`. The same applies to `data-hds-column-id` on the header cell, which carries the raw internal id.
2429
- - `data-field` on the header cell still holds the column's `field`, so selectors like `th[data-field="dessert"]` keep working. It is not unique when two columns share a `field`.
2429
+ - `data-field` on the header cell holds the column's `field`. Like the ids above it is an implementation detail for debugging — do not target it from external selectors or CSS. It is not unique when two columns share a `field`.
2430
2430
  - Do not pin a duplicated `field`. `pinnedColumns` matches by `field` and cannot address one of the duplicates, so every column sharing it resolves to the same offset and they render stacked on top of each other.
2431
2431
  - `editMode` must be `true` for editing-related UI to be active.
2432
2432
  - When `paginationMode="server"`, `rowCount` must be specified.
@@ -303,23 +303,23 @@ const shouldDisableDate = useCallback(
303
303
 
304
304
  ### Key Props
305
305
 
306
- | Prop | Type | Default | Description |
307
- | ------------------- | ------------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
308
- | `value` | `[Date, Date \| undefined]` | - | Selected date(s) for controlled mode. Single date: `[date, undefined]` |
309
- | `defaultValue` | `[Date, Date \| undefined]` | - | Initial date(s) for uncontrolled mode |
310
- | `onChange` | `(date: [Date, Date \| undefined]) => void` | - | Callback when date selection changes |
311
- | `view` | `'month' \| 'day'` | `'day'` | Active calendar view |
312
- | `views` | `('month' \| 'day')[]` | `['month', 'day']` | Available views for navigation |
313
- | `onViewChange` | `(view: 'month' \| 'day') => void` | - | Callback when view changes |
314
- | `onMonthChange` | `(newMonth: Date) => void` | - | Callback when the displayed month changes |
315
- | `rangeSelection` | `boolean` | `false` | Enable date range selection (two dates) |
316
- | `locale` | `string` | `'default'` | Locale for month/day names (BCP 47 format) |
317
- | `minDate` | `Date` | - | Minimum selectable date |
318
- | `maxDate` | `Date` | - | Maximum selectable date |
319
- | `disableFuture` | `boolean` | `false` | Disable all future dates |
320
- | `disablePast` | `boolean` | `false` | Disable all past dates |
321
- | `shouldDisableDate` | `(date: Date) => boolean` | - | Custom function to disable specific dates |
322
- | `slots` | `{ day?, monthButton?, yearButton? }` | - | Custom component slots for calendar elements |
306
+ | Prop | Type | Default | Description |
307
+ | ------------------- | -------------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
308
+ | `value` | `[Date, Date \| undefined]` | - | Selected date(s) for controlled mode. Single date: `[date, undefined]` |
309
+ | `defaultValue` | `[Date, Date \| undefined]` | - | Initial date(s) for uncontrolled mode |
310
+ | `onChange` | `(date: [Date, Date \| undefined]) => void` | - | Callback when date selection changes |
311
+ | `view` | `'month' \| 'day'` | `'day'` | Active calendar view |
312
+ | `views` | `('month' \| 'day')[]` | `['month', 'day']` | Available views for navigation |
313
+ | `onViewChange` | `(view: 'month' \| 'day') => void` | - | Callback when view changes |
314
+ | `onMonthChange` | `(newMonth: Date) => void` | - | Callback when the displayed month changes |
315
+ | `rangeSelection` | `boolean` | `false` | Enable date range selection (two dates) |
316
+ | `locale` | `string` | `'default'` | Locale for month/day names (BCP 47 format) |
317
+ | `minDate` | `Date` | - | Minimum selectable date |
318
+ | `maxDate` | `Date` | - | Maximum selectable date |
319
+ | `disableFuture` | `boolean` | `false` | Disable all future dates |
320
+ | `disablePast` | `boolean` | `false` | Disable all past dates |
321
+ | `shouldDisableDate` | `(date: Date) => boolean` | - | Custom function to disable specific dates |
322
+ | `slots` | `Partial<Record<CalendarSlot, ElementType>>` | - | Not implemented. The prop is accepted but no slot is overridable yet |
323
323
 
324
324
  ## Accessibility
325
325
 
@@ -242,6 +242,11 @@ function EditorToolbar({ onAction }) {
242
242
  | `buttonComponent` | `ElementType` | - | Custom trigger element |
243
243
  | `buttonComponentProps` | `object` | - | Props passed to the trigger. Reaches Joy `IconButton`, so `sx` works |
244
244
 
245
+ > **Note**: `buttonComponentProps` is typed as `ComponentProps<buttonComponent> & AriaAttributes` plus an explicit
246
+ > allow-list of Joy `IconButton` props — currently only `sx`. `items[].componentProps` works the same way against Joy
247
+ > `MenuItem` — currently only `disabled`. Every other Joy prop still reaches the underlying Joy component at runtime,
248
+ > but it does not type-check: extend the `Pick<...>` in `IconMenuButton.tsx` when you need one.
249
+
245
250
  ## Best Practices
246
251
 
247
252
  - **Always provide `aria-label`.** Since IconMenuButton has no visible text, screen readers rely entirely on the `aria-label` to announce the button's purpose. Include context when possible.