rez-table-listing-mui 1.3.0 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez-table-listing-mui",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -9,3 +9,4 @@ export { default as KanbanWrapper } from "./kanban";
9
9
 
10
10
  export * from "./listing/types/table";
11
11
  export * from "./listing/types/table-options";
12
+ export * from "./listing/types/filter";
@@ -40,7 +40,7 @@ const CustomSearch = ({
40
40
  startAdornment: (
41
41
  <InputAdornment position="start">
42
42
  <SearchIcon
43
- sx={{ color: "#888888", fontSize: "20px" }}
43
+ sx={{ color: "#888888", fontSize: "20px", paddingLeft: 1.5 }}
44
44
  className="search-icon-svg"
45
45
  />
46
46
  </InputAdornment>
@@ -50,7 +50,7 @@ const CustomSearch = ({
50
50
  <IconButton
51
51
  edge="end"
52
52
  onClick={handleClear}
53
- sx={{ color: "#888888", fontSize: "20px" }}
53
+ sx={{ color: "#888888", fontSize: "20px", paddingRight: 1.5 }}
54
54
  >
55
55
  <CloseIcon />
56
56
  </IconButton>
@@ -15,7 +15,7 @@ import {
15
15
  commonGetDropdownDataAPI,
16
16
  createSavedFilter,
17
17
  deleteSavedFilter,
18
- getFilteEntityList,
18
+ getFilterEntityList,
19
19
  getFilterCriteriaByEntity,
20
20
  getSettingsData,
21
21
  saveSettingsData,
@@ -310,7 +310,7 @@ export const useGetFilterEntityListAndCriteria = ({
310
310
  }) => {
311
311
  const filterEntityList = useQuery({
312
312
  queryKey: ["filterEntityList", entity_type],
313
- queryFn: () => getFilteEntityList(entity_type),
313
+ queryFn: () => getFilterEntityList(entity_type),
314
314
  enabled: !!entity_type,
315
315
  });
316
316
 
@@ -162,7 +162,7 @@ export const viewSettingsDropDown = async ({
162
162
  return response.data;
163
163
  };
164
164
 
165
- export const getFilteEntityList = async (entity_type: string) => {
165
+ export const getFilterEntityList = async (entity_type: string) => {
166
166
  const response = await api.get(`/entity-relation/${entity_type}`);
167
167
 
168
168
  return response.data;
package/dist/index.d.ts DELETED
@@ -1,423 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SortingState, PaginationState, RowSelectionState, ExpandedState, ColumnPinningState, ColumnDef, Row, Table, ColumnOrderState, Header } from '@tanstack/react-table';
3
- import React, { Dispatch, SetStateAction } from 'react';
4
-
5
- interface onFilterChangeFunctionProps {
6
- updatedFilters?: any;
7
- filterMaster?: any;
8
- filters?: any;
9
- }
10
-
11
- interface OperationProps {
12
- label: string;
13
- value: string;
14
- }
15
- type OperationMapProps = {
16
- [key in FilterInputDataTypes]?: OperationProps[];
17
- };
18
- interface FilterOperationListProps {
19
- label: string;
20
- value: string;
21
- }
22
- type FilterInputDataTypes = "text" | "select" | "multiselect" | "date" | "year" | "number";
23
- interface FilterColumnsListProps {
24
- created_date: string | null;
25
- entity_type: string;
26
- id: string;
27
- name: string;
28
- status: string | null;
29
- parent_type: string;
30
- parent_id: string;
31
- code: string | null;
32
- created_by: string | null;
33
- modified_by: string | null;
34
- modified_date: string | null;
35
- enterprise_id: string | null;
36
- organization_id: string | null;
37
- app_code: string | null;
38
- mapped_entity_type: string;
39
- menu_code: string | null;
40
- table_name: string | null;
41
- col_position: number;
42
- sortable: string | null;
43
- searchable: string | null;
44
- attribute_key: string;
45
- sort_type: string | null;
46
- data_type: FilterInputDataTypes;
47
- data_source_type: string | null;
48
- datasource_list: any | null;
49
- visible: string;
50
- }
51
- interface FilterColumnsDataProps {
52
- column_list: FilterColumnsListProps[];
53
- operation_list: OperationMapProps;
54
- saved_filter: FilterOperationListProps[];
55
- }
56
- interface FilterDropdownDataProps {
57
- [key: string]: FilterOperationListProps[];
58
- }
59
- interface FilterComponentOptionsMainFilterOptions {
60
- showSaveButton?: boolean;
61
- showClearAllButton?: boolean;
62
- }
63
- type FilterComponentOptions = {
64
- showMainHeader?: boolean;
65
- showTabs?: true;
66
- showMainFilter?: boolean;
67
- showSavedFilter?: boolean;
68
- showAttributesFilter?: boolean;
69
- tabOptions?: {
70
- mainFilter?: FilterComponentOptionsMainFilterOptions;
71
- };
72
- } | {
73
- showMainHeader?: boolean;
74
- showTabs?: false;
75
- tabOptions?: {
76
- mainFilter?: FilterComponentOptionsMainFilterOptions;
77
- };
78
- };
79
- interface FilterDrawerProps {
80
- tableStates: CraftTableOptionsProps;
81
- open?: boolean;
82
- onClose?: () => void;
83
- onDeleteFilter?: () => void;
84
- onSaveFilter?: (name: string) => void;
85
- onUpdateFilter?: (name: string) => void;
86
- columnsData: FilterColumnsDataProps;
87
- dropdownData: FilterDropdownDataProps;
88
- defaultFilters?: Array<{
89
- filter_attribute: string;
90
- filter_operator: string;
91
- filter_value: string;
92
- }>;
93
- savedFilters?: Array<{
94
- label: string;
95
- value: string;
96
- }>;
97
- tableData?: {
98
- entity_list: any[];
99
- };
100
- onChangeFunction: ({ updatedFilters, filterMaster, }: onFilterChangeFunctionProps) => void;
101
- filterComponentOptions?: FilterComponentOptions;
102
- }
103
- interface FilterStateProps {
104
- filter_attribute: string;
105
- filter_operator: string;
106
- filter_value: string | string[];
107
- id: string | number;
108
- name: string | undefined;
109
- data_type: FilterInputDataTypes | undefined;
110
- attribute_key?: string;
111
- dropdown_list?: {
112
- label?: string;
113
- value?: string;
114
- }[];
115
- optionList?: {
116
- label?: string | undefined;
117
- value?: string | undefined;
118
- };
119
- filter_entity_type?: string;
120
- filter_entity_name?: string;
121
- }
122
- interface FilterMasterStateProps {
123
- attributes: {
124
- selected: string;
125
- radio: string[];
126
- };
127
- saved_filters: {
128
- selectedId: string;
129
- selectedName: string;
130
- };
131
- activeFilterTabIndex: number;
132
- }
133
- interface FilterDataMainFilterEntityListProps {
134
- value: string;
135
- id: string | number;
136
- label: string;
137
- }
138
- interface FilterDataMainFilterEntityWiseCriteriaProps {
139
- id: string;
140
- name: string;
141
- attribute_key: string;
142
- element_type: FilterInputDataTypes;
143
- }
144
- interface FilterDataProps {
145
- mainFilter?: {
146
- entityList?: {
147
- data?: FilterDataMainFilterEntityListProps[];
148
- isPending?: boolean;
149
- };
150
- entityWiseCriteria?: {
151
- data?: FilterDataMainFilterEntityWiseCriteriaProps[];
152
- isPending?: boolean;
153
- };
154
- };
155
- }
156
-
157
- interface QuickFilterModalProps {
158
- view?: string;
159
- show?: boolean;
160
- filterSettingStates: craftTableFilterSettingsOptionsProps;
161
- onClose?: () => void;
162
- columnsData: FilterColumnsDataProps;
163
- columnsDataLoading: boolean;
164
- tabsApiData?: string[];
165
- tabsApiDataLoading?: boolean;
166
- onSaveSettingsData?: (data: any) => void;
167
- }
168
- type TabName = string;
169
- type SortingType = "asc" | "desc";
170
- type QuickTabSortingType = "asc" | "dsc" | "count_asc" | "count_dsc" | "custom";
171
- interface QuickTabConfigProps {
172
- attribute?: string;
173
- sorting?: QuickTabSortingType;
174
- hide_list?: string[];
175
- show_list?: string[];
176
- isAllSelected?: boolean;
177
- isCombineOther?: boolean;
178
- }
179
- interface ColumnItem {
180
- label: string;
181
- value: string;
182
- }
183
- interface ColumnTab {
184
- tab_name: TabName;
185
- show_list: ColumnItem[];
186
- hide_list: ColumnItem[];
187
- }
188
- interface SortingConfigSortByProps {
189
- column: string;
190
- order: SortingType;
191
- }
192
- interface SortingConfigTabProps {
193
- tab_name: TabName;
194
- sortby: SortingConfigSortByProps[];
195
- }
196
- interface SortingConfigProps {
197
- isDefault?: boolean;
198
- sortby?: SortingConfigSortByProps[];
199
- tabs?: SortingConfigTabProps[];
200
- }
201
- interface ColumnTabConfigProps {
202
- isDefault?: boolean;
203
- show_list?: ColumnItem[];
204
- hide_list?: ColumnItem[];
205
- tabs?: ColumnTab[];
206
- }
207
- interface SettingsDataProps {
208
- isDefault?: boolean;
209
- show_list?: ColumnItem[];
210
- hide_list?: ColumnItem[];
211
- tabs?: ColumnTab[];
212
- quick_tab?: QuickTabConfigProps;
213
- column?: ColumnTabConfigProps;
214
- sorting?: SortingConfigProps;
215
- }
216
- interface SavedButtonErrorProps {
217
- hasError: boolean;
218
- messages: {
219
- type: string;
220
- message: string;
221
- }[];
222
- }
223
-
224
- interface CraftTableOptionsProps {
225
- sorting: SortingState;
226
- setSorting: Dispatch<SetStateAction<SortingState>>;
227
- pagination: PaginationState;
228
- setPagination: Dispatch<SetStateAction<PaginationState>>;
229
- rowSelection: RowSelectionState;
230
- setRowSelection: Dispatch<SetStateAction<RowSelectionState>>;
231
- isCompactTable?: boolean;
232
- setIsCompactTable?: Dispatch<SetStateAction<boolean>>;
233
- expanded: ExpandedState;
234
- setExpanded: Dispatch<SetStateAction<ExpandedState>>;
235
- wrapColumns: Record<string, boolean>;
236
- setWrapColumns: Dispatch<SetStateAction<Record<string, boolean>>>;
237
- filters: FilterStateProps[];
238
- setFilters: Dispatch<SetStateAction<FilterStateProps[]>>;
239
- savedFilterEditValue: string | number;
240
- setSavedFilterEditValue: Dispatch<SetStateAction<string | number>>;
241
- filterToDelete: FilterOperationListProps | null;
242
- setFilterToDelete: Dispatch<SetStateAction<FilterOperationListProps | null>>;
243
- filterSelectedAttributeValue: string;
244
- setFilterSelectedAttributeValue: Dispatch<SetStateAction<string>>;
245
- filterMaster: FilterMasterStateProps | null;
246
- setFilterMaster: Dispatch<SetStateAction<FilterMasterStateProps | null>>;
247
- showTableFilter: boolean;
248
- setShowTableFilter: Dispatch<SetStateAction<boolean>>;
249
- showFilterOptions: boolean;
250
- setShowFilterOption: Dispatch<SetStateAction<boolean>>;
251
- columnPinning: ColumnPinningState;
252
- setColumnPinning: Dispatch<SetStateAction<ColumnPinningState>>;
253
- filterData: FilterDataProps | null;
254
- setFilterData: Dispatch<SetStateAction<FilterDataProps | null>>;
255
- selectedFilterEntity: FilterDataMainFilterEntityListProps | undefined;
256
- setSelectedFilterEntity: Dispatch<SetStateAction<FilterDataMainFilterEntityListProps | undefined>>;
257
- }
258
- interface craftTableFilterSettingsOptionsProps {
259
- settingsData: SettingsDataProps;
260
- setSettingsData: Dispatch<SetStateAction<SettingsDataProps>>;
261
- showListViewSettings: boolean;
262
- setShowListViewSettings: Dispatch<SetStateAction<boolean>>;
263
- quickTabStates: QuickTabConfigProps;
264
- setQuickTabStates: Dispatch<SetStateAction<QuickTabConfigProps>>;
265
- columnTabState: ColumnTabConfigProps;
266
- setColumnTabState: Dispatch<SetStateAction<ColumnTabConfigProps>>;
267
- sortingTabState: SortingConfigProps;
268
- setSortingTabState: Dispatch<SetStateAction<SortingConfigProps>>;
269
- saveButtonError: SavedButtonErrorProps;
270
- setSaveButtonError: Dispatch<SetStateAction<SavedButtonErrorProps>>;
271
- }
272
- interface CraftTableFeatureProps {
273
- enableSorting?: boolean;
274
- enableServerSidePagination?: boolean;
275
- enableServerSideSorting?: boolean;
276
- enableRowSelection?: boolean;
277
- enableColumnResizing?: boolean;
278
- enableColumnReordering?: boolean;
279
- enableColumnPinning?: boolean;
280
- enableMultiColumnSorting?: boolean;
281
- enableTopbar?: boolean;
282
- enableWordBreakAll?: boolean;
283
- stickyHeader?: boolean;
284
- compactTable?: boolean;
285
- striped?: boolean;
286
- }
287
-
288
- interface CraftTablePaginationProps {
289
- totalRows?: number;
290
- rowsPerPageArray?: number[];
291
- showPagination?: boolean;
292
- paginationPosition?: "top" | "bottom";
293
- paginationView?: "full" | "compact";
294
- }
295
- interface LoadingOptionsProps {
296
- isLoading: boolean;
297
- loaderText?: string;
298
- loadingComponent?: React.ReactNode;
299
- }
300
- interface TopbarOptionsProps {
301
- tableStates: CraftTableOptionsProps;
302
- leftSideComponent?: React.ReactNode;
303
- rightSideComponent?: React.ReactNode;
304
- showColumnToggle?: boolean;
305
- showCompactTableToggle?: boolean;
306
- showChangeLayoutToggle?: boolean;
307
- viewMoreToggle?: boolean;
308
- showSearch?: boolean;
309
- showSortingToggle?: boolean;
310
- showFilterToggle?: boolean;
311
- searchValue?: string;
312
- onSearchChange?: (val: string) => void;
313
- onFilterButtonClick?: () => void;
314
- }
315
- interface CustomRenderContext<T> {
316
- value: unknown;
317
- row: Row<T>;
318
- table: Row<T>[];
319
- }
320
- type CustomRenderFnMap<T> = {
321
- [key: string]: (ctx: CustomRenderContext<T>) => React.ReactNode;
322
- };
323
- type CustomColumnMeta = {
324
- type?: "custom";
325
- propName?: string;
326
- [key: string]: any;
327
- };
328
- type CustomColumnDef<T> = ColumnDef<T> & {
329
- meta?: CustomColumnMeta;
330
- };
331
- interface CraftTableStyleProps {
332
- wrapperStyle?: React.CSSProperties;
333
- }
334
- interface FilterOptionsProps {
335
- onClick?: () => void;
336
- show?: boolean;
337
- component: React.ReactNode;
338
- }
339
- interface settingsOptionsProps {
340
- showIcon?: boolean;
341
- onClick?: () => void;
342
- }
343
- interface CraftTableProps<T> {
344
- data: T[];
345
- columns: CustomColumnDef<T>[];
346
- tableStates: CraftTableOptionsProps;
347
- paginationOptions?: CraftTablePaginationProps;
348
- featureOptions?: CraftTableFeatureProps;
349
- nestedComponent?: React.ComponentType<{
350
- row: Row<T>;
351
- }>;
352
- loadingOptions?: LoadingOptionsProps;
353
- topbarOptions?: TopbarOptionsProps;
354
- customRenderFn?: CustomRenderFnMap<T>;
355
- shouldHideColumn?: (accessorKey?: string) => boolean;
356
- styleOptions?: CraftTableStyleProps;
357
- emptyListComponent?: React.ReactNode;
358
- filterOptions?: FilterOptionsProps;
359
- settingsOptions?: settingsOptionsProps;
360
- craftTableFilterSettingsOptions?: craftTableFilterSettingsOptionsProps;
361
- }
362
- interface CraftTableComponentProps<T> {
363
- table: Table<T>;
364
- featureOptions: CraftTableFeatureProps;
365
- NestedComponent?: React.ComponentType<{
366
- row: Row<T>;
367
- }>;
368
- columnOrder: ColumnOrderState;
369
- setColumnOrder: React.Dispatch<React.SetStateAction<ColumnOrderState>>;
370
- isCompactTable: boolean;
371
- tableStates: CraftTableOptionsProps;
372
- }
373
- interface TableHeaderProps<T> {
374
- header: Header<T, unknown>;
375
- featureOptions: CraftTableFeatureProps;
376
- tableStates: CraftTableOptionsProps;
377
- }
378
-
379
- declare function TableWrapper<T>({ data, columns, tableStates, paginationOptions, featureOptions, topbarOptions, nestedComponent, loadingOptions, customRenderFn, shouldHideColumn, emptyListComponent, filterOptions, }: CraftTableProps<T>): react_jsx_runtime.JSX.Element;
380
-
381
- declare function useCraftTable(paginationPageSize?: number): CraftTableOptionsProps;
382
-
383
- declare function useCraftTableFilterSettings(): craftTableFilterSettingsOptionsProps;
384
-
385
- interface TabDataProps {
386
- tab_value: string | null;
387
- tab_value_count: string | number;
388
- }
389
- interface TableTabsProps {
390
- loading?: boolean;
391
- tabsData?: TabDataProps[];
392
- activeTab?: string;
393
- tableStates: CraftTableOptionsProps;
394
- onClick: (state: string) => void;
395
- columns?: any[];
396
- settingsOptions?: settingsOptionsProps;
397
- }
398
- declare function TableTabs({ loading, tabsData, activeTab, onClick, tableStates, settingsOptions, }: TableTabsProps): react_jsx_runtime.JSX.Element;
399
-
400
- declare function TableFilter({ onClose, columnsData, tableStates, onDeleteFilter, onSaveFilter, onUpdateFilter, dropdownData, onChangeFunction, filterComponentOptions, }: FilterDrawerProps): react_jsx_runtime.JSX.Element;
401
-
402
- declare function QuickFilterSettings({ view, show, filterSettingStates, onClose, columnsData, columnsDataLoading, tabsApiData, tabsApiDataLoading, onSaveSettingsData, }: QuickFilterModalProps): react_jsx_runtime.JSX.Element;
403
-
404
- interface TableSearchProps {
405
- value: string;
406
- onChange: (value: string) => void;
407
- }
408
- declare const TableSearch: ({ value, onChange, }: TableSearchProps) => JSX.Element;
409
-
410
- declare const Kanban: ({ metaData, data, isLoading, KanbanCardComponent, showSettings, onOpenSettings, }: {
411
- metaData: any;
412
- data: any;
413
- isLoading?: boolean;
414
- KanbanCardComponent: React.ComponentType<{
415
- key: string | number;
416
- cardData: any;
417
- }>;
418
- showSettings: boolean;
419
- onOpenSettings?: () => void;
420
- }) => react_jsx_runtime.JSX.Element;
421
-
422
- export { TableFilter as CraftTableFilter, TableSearch as CraftTableSearch, QuickFilterSettings as CraftTableSettings, TableTabs as CraftTableTabs, Kanban as KanbanWrapper, TableWrapper, useCraftTable, useCraftTableFilterSettings };
423
- export type { CraftTableComponentProps, CraftTableFeatureProps, CraftTableOptionsProps, CraftTablePaginationProps, CraftTableProps, CustomRenderContext, CustomRenderFnMap, FilterOptionsProps, TableHeaderProps, TopbarOptionsProps, craftTableFilterSettingsOptionsProps, settingsOptionsProps };