cecomponent 2.0.12 → 2.0.13

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.
@@ -14,6 +14,7 @@ interface CEAutoCompleteSelectProps {
14
14
  id?: string;
15
15
  required?: boolean;
16
16
  showSelectionCountOnly?: boolean;
17
+ disabled?: boolean;
17
18
  }
18
19
  declare const CEAutoCompleteSelect: React.FC<CEAutoCompleteSelectProps>;
19
20
  export default CEAutoCompleteSelect;
@@ -0,0 +1,127 @@
1
+ import { default as React } from 'react';
2
+ export type ComponentType = "text-input" | "number-input" | "auto-suggest" | "date-picker" | "label-text" | "drop-down-input";
3
+ export interface ColumnConfig {
4
+ id: string;
5
+ label?: string;
6
+ tooltip?: string;
7
+ shouldDisplay?: boolean;
8
+ shouldVisible?: boolean;
9
+ width?: string;
10
+ elementType?: ComponentType;
11
+ required?: boolean;
12
+ }
13
+ interface CEDataGridDynamicTableProps {
14
+ title?: React.ReactNode;
15
+ jsonData: any[];
16
+ columnList?: ColumnConfig[];
17
+ ischeckBoxInGrid?: boolean;
18
+ isSingleSelectionMode?: boolean;
19
+ isRadioButtonInGrid?: boolean;
20
+ renderRadioInColumnId?: string | string[];
21
+ onRadioChange?: (info: {
22
+ rowIndex: number;
23
+ columnId: string;
24
+ rowData: any;
25
+ }) => void;
26
+ getSelectedRadioValue?: (rowIndex: number) => string;
27
+ isSearchBoxInGrid?: boolean;
28
+ isAddButtonRequired?: boolean;
29
+ isEditButtonRequired?: boolean;
30
+ isDeleteButtonRequired?: boolean;
31
+ isApproveButtonRequired?: boolean;
32
+ isReassignButtonRequired?: boolean;
33
+ isCancelButtonRequired?: boolean;
34
+ noOfPagesPerPage?: number;
35
+ handleEditClick?: (row: any, rowIndex: number) => void;
36
+ handleAddClick?: () => void;
37
+ handleDeleteClick?: (row: any, rowIndex: number) => void;
38
+ handleApproveClick?: (row: any, rowIndex: number) => void;
39
+ handleReassignClick?: () => void;
40
+ handleCancelClick?: (row: any, rowIndex: number) => void;
41
+ clickableColumns?: string[];
42
+ isExportAllToExcel?: boolean;
43
+ conditionalClickableColumns?: Record<string, string[]>;
44
+ /**
45
+ * Optional consumer predicate. Return true to make the specific cell (row + column) clickable.
46
+ * If omitted, existing clickableColumns / conditionalClickableColumns behavior is used.
47
+ */
48
+ clickableCellPredicate?: (rowData: any, columnId: string) => boolean;
49
+ handleCellClick?: (data: any, columnId?: any) => void;
50
+ onReload?: () => void;
51
+ showDownloadIcon?: boolean;
52
+ downloadOptions?: Array<{
53
+ label: string;
54
+ onClick: () => void;
55
+ /**
56
+ * If true, this downloadOptions entry's label will be used as the
57
+ * default download item label (which triggers the built-in export).
58
+ * The entry itself will not be rendered as a separate item in the
59
+ * dropdown (it's used only to provide the label).
60
+ */
61
+ usedefault?: boolean;
62
+ /** When true and usedefault is also true, the built-in export will force-export the full dataset (allData). */
63
+ forceAll?: boolean;
64
+ }>;
65
+ /**
66
+ * Label for the default download action included at the top of the
67
+ * download dropdown when `downloadOptions` is provided. Defaults to
68
+ * "Export to Excel".
69
+ */
70
+ showRefreshIcon?: boolean;
71
+ showFullViewIcon?: boolean;
72
+ showColumnVisibilityIcon?: boolean;
73
+ showSortIcon?: boolean;
74
+ showFilterIcon?: boolean;
75
+ defaultSortConfig?: {
76
+ column: string;
77
+ direction: "asc" | "desc";
78
+ };
79
+ onDataUpdate?: (updatedData: {
80
+ fullData: any[];
81
+ updatedRow: any;
82
+ }) => void;
83
+ isOverrideCSS?: any;
84
+ showPagination?: boolean;
85
+ shouldResetSearchOnDataChange?: boolean;
86
+ pageSizeOptions?: Array<number>;
87
+ handleSelectedRows?: ((rows: any[]) => void) | ((payload: {
88
+ ids: (string | number)[];
89
+ rows?: any[];
90
+ }) => void);
91
+ /** Field name OR extractor function to use as the stable selection key on each row. Defaults to `id`. */
92
+ selectionKey?: string | ((row: any) => string | number);
93
+ rowsSelected?: Set<number>;
94
+ /** Called when the current page changes; receives the new page index (0-based) */
95
+ onPageChange?: (page: number) => void;
96
+ /** Column name to check for disabled row values */
97
+ disabledRowColumn?: string;
98
+ /** Array of values in disabledRowColumn that should mark rows as disabled */
99
+ disabledRowValues?: string[];
100
+ /**
101
+ * Optional: right-click context menu items for each data row.
102
+ * If provided, a context menu will appear on row right-click.
103
+ */
104
+ rowContextMenuItems?: Array<{
105
+ label: string;
106
+ onClick: (row: any, rowIndex: number) => void;
107
+ /** Optional icon source (SVG/PNG) to display before label */
108
+ iconSrc?: string;
109
+ /** Optionally hide item based on row */
110
+ visible?: (row: any, rowIndex: number) => boolean;
111
+ /** Optionally disable item based on row */
112
+ disabled?: (row: any, rowIndex: number) => boolean;
113
+ }>;
114
+ /**
115
+ * Optional builder to compute row context menu items dynamically per row.
116
+ * If both builder and static items are provided, builder takes precedence.
117
+ */
118
+ rowContextMenuBuilder?: (row: any, rowIndex: number) => Array<{
119
+ label: string;
120
+ onClick: (row: any, rowIndex: number) => void;
121
+ iconSrc?: string;
122
+ visible?: (row: any, rowIndex: number) => boolean;
123
+ disabled?: (row: any, rowIndex: number) => boolean;
124
+ }>;
125
+ }
126
+ declare const CEDataGridDynamicTable: React.FC<CEDataGridDynamicTableProps>;
127
+ export default CEDataGridDynamicTable;
@@ -6,7 +6,6 @@ interface DatePickerProps {
6
6
  focused?: boolean;
7
7
  id?: string;
8
8
  name?: string;
9
- required?: boolean;
10
9
  }
11
10
  declare const CEDatePicker: FC<DatePickerProps>;
12
11
  export default CEDatePicker;
@@ -19,6 +19,11 @@ interface CEDateRangePickerProps {
19
19
  disabled?: boolean;
20
20
  minDate?: string;
21
21
  defaultFloat?: boolean;
22
+ /**
23
+ * If true, disables selection of past dates (minDate defaults to today if not set)
24
+ * If false, allows all dates unless minDate is set
25
+ */
26
+ disablePastDates?: boolean;
22
27
  }
23
28
  declare const CEDateRangePicker: React.FC<CEDateRangePickerProps>;
24
29
  export default CEDateRangePicker;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cecomponent",
3
3
  "description": "A React component library for building modern UIs for Cleanearth",
4
- "version": "2.0.12",
4
+ "version": "2.0.13",
5
5
  "main": "dist/ce-component-lib.js",
6
6
  "module": "dist/ce-component-lib.mjs",
7
7
  "types": "dist/idex.d.ts",