rez-table-listing-mui 1.2.12 → 1.2.14

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.
Files changed (127) hide show
  1. package/dist/index.d.ts +116 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +1 -1
  7. package/src/App.tsx +47 -405
  8. package/src/assets/Satoshi/Satoshi-Black.ttf +0 -0
  9. package/src/assets/Satoshi/Satoshi-BlackItalic.ttf +0 -0
  10. package/src/assets/Satoshi/Satoshi-Bold.ttf +0 -0
  11. package/src/assets/Satoshi/Satoshi-BoldItalic.ttf +0 -0
  12. package/src/assets/Satoshi/Satoshi-Italic.ttf +0 -0
  13. package/src/assets/Satoshi/Satoshi-Light.ttf +0 -0
  14. package/src/assets/Satoshi/Satoshi-LightItalic.ttf +0 -0
  15. package/src/assets/Satoshi/Satoshi-Medium.ttf +0 -0
  16. package/src/assets/Satoshi/Satoshi-MediumItalic.ttf +0 -0
  17. package/src/assets/Satoshi/Satoshi-Regular.ttf +0 -0
  18. package/src/assets/Satoshi/Satoshi-Variable.ttf +0 -0
  19. package/src/assets/Satoshi/Satoshi-VariableItalic.ttf +0 -0
  20. package/src/assets/global.css +88 -0
  21. package/src/assets/variable.ts +15 -0
  22. package/src/index.ts +10 -9
  23. package/src/kanban/components/LeadCard.tsx +130 -0
  24. package/src/kanban/constants/kanban-constants.ts +249 -0
  25. package/src/kanban/hooks/hooks.ts +16 -0
  26. package/src/kanban/index.tsx +331 -0
  27. package/src/kanban/services/service.ts +11 -0
  28. package/src/kanban/styles/styles.tsx +256 -0
  29. package/src/kanban/types/types.ts +132 -0
  30. package/src/{components → listing/components}/column-visibility-modal/column-list-item.tsx +1 -1
  31. package/src/{components → listing/components}/column-visibility-modal/index.tsx +1 -1
  32. package/src/{components → listing/components}/common/index.scss +2 -1
  33. package/src/{components → listing/components}/filter/components/forms/components/Filter-criteria.tsx +1 -1
  34. package/src/{components → listing/components}/filter/components/forms/index.tsx +1 -1
  35. package/src/{components → listing/components}/filter/components/saved-filter.tsx +2 -2
  36. package/src/{components → listing/components}/filter/components/search/index.tsx +1 -1
  37. package/src/{components → listing/components}/filter/components/tabs/index.tsx +1 -1
  38. package/src/{components → listing/components}/index-table.tsx +1 -1
  39. package/src/{components → listing/components}/index.scss +1 -2
  40. package/src/{components → listing/components}/pagination/default/index.tsx +1 -1
  41. package/src/{components → listing/components}/search/index.tsx +1 -1
  42. package/src/{components → listing/components}/sorting-modal.tsx/index.tsx +1 -1
  43. package/src/{components → listing/components}/sorting-modal.tsx/sorting-item.tsx +1 -1
  44. package/src/{components → listing/components}/table-change-layout.tsx +1 -1
  45. package/src/{components → listing/components}/table-head-dnd-cell.tsx +1 -1
  46. package/src/{components → listing/components}/table-head-pin.tsx +1 -1
  47. package/src/{components → listing/components}/table-head-popover.tsx +1 -1
  48. package/src/{components → listing/components}/table-head.tsx +1 -1
  49. package/src/{components → listing/components}/table-settings/common/listing-values.tsx +1 -1
  50. package/src/{components → listing/components}/table-settings/components/sorting.tsx +1 -1
  51. package/src/{components → listing/components}/tabs/index.scss +2 -1
  52. package/src/{components → listing/components}/tabs/index.tsx +1 -1
  53. package/src/{components → listing/components}/topbar/index.tsx +7 -7
  54. package/src/{components → listing/components}/viewmore/index.tsx +1 -1
  55. package/src/{libs → listing/libs}/utils/common.ts +2 -2
  56. package/src/main.tsx +1 -0
  57. package/src/view/KanbanView.tsx +16 -0
  58. package/src/view/ListingView.tsx +423 -0
  59. /package/src/{components → listing/components}/column-visibility-modal/index.scss +0 -0
  60. /package/src/{components → listing/components}/common/confirm-modal/index.tsx +0 -0
  61. /package/src/{components → listing/components}/common/index.tsx +0 -0
  62. /package/src/{components → listing/components}/common/loader/loader.tsx +0 -0
  63. /package/src/{components → listing/components}/dropdown/index.scss +0 -0
  64. /package/src/{components → listing/components}/dropdown/index.tsx +0 -0
  65. /package/src/{components → listing/components}/filter/components/attributes-filter.tsx +0 -0
  66. /package/src/{components → listing/components}/filter/components/forms/components/Date.tsx +0 -0
  67. /package/src/{components → listing/components}/filter/components/forms/components/Dropdown.tsx +0 -0
  68. /package/src/{components → listing/components}/filter/components/forms/components/Multi-Select.tsx +0 -0
  69. /package/src/{components → listing/components}/filter/components/forms/components/Select.tsx +0 -0
  70. /package/src/{components → listing/components}/filter/components/forms/components/Textfield.tsx +0 -0
  71. /package/src/{components → listing/components}/filter/components/forms/components/styles.tsx +0 -0
  72. /package/src/{components → listing/components}/filter/components/main-filter.tsx +0 -0
  73. /package/src/{components → listing/components}/filter/components/saved-edit-filter.tsx +0 -0
  74. /package/src/{components → listing/components}/filter/components/tabs/custom-tab-panel.tsx +0 -0
  75. /package/src/{components → listing/components}/filter/index.tsx +0 -0
  76. /package/src/{components → listing/components}/filter/style.ts +0 -0
  77. /package/src/{components → listing/components}/inputs/checkbox/index.tsx +0 -0
  78. /package/src/{components → listing/components}/inputs/index.scss +0 -0
  79. /package/src/{components → listing/components}/inputs/switch.tsx +0 -0
  80. /package/src/{components → listing/components}/login/index.tsx +0 -0
  81. /package/src/{components → listing/components}/nestedcomponent/index.scss +0 -0
  82. /package/src/{components → listing/components}/nestedcomponent/index.tsx +0 -0
  83. /package/src/{components → listing/components}/pagination/default/index.scss +0 -0
  84. /package/src/{components → listing/components}/search/style.ts +0 -0
  85. /package/src/{components → listing/components}/table-body-dnd-cell.tsx +0 -0
  86. /package/src/{components → listing/components}/table-body.tsx +0 -0
  87. /package/src/{components → listing/components}/table-dnd.tsx +0 -0
  88. /package/src/{components → listing/components}/table-settings/common/draggable-listitem.tsx +0 -0
  89. /package/src/{components → listing/components}/table-settings/common/info-alert.tsx +0 -0
  90. /package/src/{components → listing/components}/table-settings/components/column.tsx +0 -0
  91. /package/src/{components → listing/components}/table-settings/components/custom-button.tsx +0 -0
  92. /package/src/{components → listing/components}/table-settings/components/custom-dialog.tsx +0 -0
  93. /package/src/{components → listing/components}/table-settings/components/quick-tab.tsx +0 -0
  94. /package/src/{components → listing/components}/table-settings/components/toggle-button-switch.tsx +0 -0
  95. /package/src/{components → listing/components}/table-settings/constants.ts +0 -0
  96. /package/src/{components → listing/components}/table-settings/index.tsx +0 -0
  97. /package/src/{components → listing/components}/table-settings/style.ts +0 -0
  98. /package/src/{components → listing/components}/table-settings/tabs/horizontal/index.tsx +0 -0
  99. /package/src/{components → listing/components}/table-settings/tabs/styles.ts +0 -0
  100. /package/src/{components → listing/components}/table-settings/tabs/vertical/custom-tab-panel.tsx +0 -0
  101. /package/src/{components → listing/components}/table-settings/tabs/vertical/index.tsx +0 -0
  102. /package/src/{components → listing/components}/table.tsx +0 -0
  103. /package/src/{components → listing/components}/tabs/styles.ts +0 -0
  104. /package/src/{components → listing/components}/topbar/index.scss +0 -0
  105. /package/src/{components → listing/components}/viewmore/index.scss +0 -0
  106. /package/src/{libs → listing/libs}/hooks/useCraftTable.tsx +0 -0
  107. /package/src/{libs → listing/libs}/hooks/useCraftTableFilterSettings.tsx +0 -0
  108. /package/src/{libs → listing/libs}/hooks/useDefaultColumns.tsx +0 -0
  109. /package/src/{libs → listing/libs}/hooks/useElementWidth.tsx +0 -0
  110. /package/src/{libs → listing/libs}/hooks/useEntityTableAPI.tsx +0 -0
  111. /package/src/{libs → listing/libs}/hooks/useEntityTableHooks.ts +0 -0
  112. /package/src/{libs → listing/libs}/hooks/useFullScreen.tsx +0 -0
  113. /package/src/{libs → listing/libs}/hooks/useOutsideClick.tsx +0 -0
  114. /package/src/{libs → listing/libs}/utils/Data-format.ts +0 -0
  115. /package/src/{libs → listing/libs}/utils/amount-format.ts +0 -0
  116. /package/src/{libs → listing/libs}/utils/apiColumn.ts +0 -0
  117. /package/src/{libs → listing/libs}/utils/date-format.ts +0 -0
  118. /package/src/{libs → listing/libs}/utils/debounce.ts +0 -0
  119. /package/src/{libs → listing/libs}/utils/make-data.ts +0 -0
  120. /package/src/{libs → listing/libs}/utils/make-hierar-data.ts +0 -0
  121. /package/src/{libs → listing/libs}/utils/make-nested-data.ts +0 -0
  122. /package/src/{libs → listing/libs}/utils/rows-data.ts +0 -0
  123. /package/src/{types → listing/types}/common.ts +0 -0
  124. /package/src/{types → listing/types}/filter-settings.ts +0 -0
  125. /package/src/{types → listing/types}/filter.ts +0 -0
  126. /package/src/{types → listing/types}/table-options.ts +0 -0
  127. /package/src/{types → listing/types}/table.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez-table-listing-mui",
3
- "version": "1.2.12",
3
+ "version": "1.2.14",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
package/src/App.tsx CHANGED
@@ -1,424 +1,66 @@
1
- import { useEffect, useMemo, useState } from "react";
2
- import { useCraftTable } from "./libs/hooks/useCraftTable";
3
- import { TableTabs } from "./components/tabs";
4
- import { useDefaultColumns } from "./libs/hooks/useDefaultColumns";
5
- import TableWrapper from "./components/index-table";
6
- import { entityTableMetaMaster } from "./libs/utils/apiColumn";
7
- import {
8
- useCommonDropdownAPI,
9
- useDeleteFilterAPI,
10
- useEntityTableAPI,
11
- useSavedFilterAPI,
12
- useGetSettingsDataAPI,
13
- useSettingsDropDownAPI,
14
- useUpdateFilterAPI,
15
- useSaveSettingsDataAPI,
16
- } from "./libs/hooks/useEntityTableAPI";
17
- import {
18
- useDetailsQueryAPI,
19
- useFetchData,
20
- } from "./libs/hooks/useEntityTableHooks";
21
- import LoginButton from "./components/login";
22
- import { CraftTableFilter } from ".";
23
- import { useCraftTableFilterSettings } from "./libs/hooks/useCraftTableFilterSettings";
24
- import { QuickFilterSettings } from "./components/table-settings";
25
- import { SettingsDataProps } from "./types/filter-settings";
26
- import { FilterMasterStateProps } from "./types/filter";
27
- import { ColumnDef } from "@tanstack/react-table";
28
- import { ENTITY_TYPE } from "./libs/utils/common";
29
- import { makeData, Person } from "./libs/utils/make-hierar-data";
1
+ import { useState } from "react";
2
+ import LoginButton from "./listing/components/login";
3
+ import ListingView from "./view/ListingView";
4
+ import KanbanView from "./view/KanbanView";
30
5
 
31
6
  function App() {
32
- // const [mockLoading, setMockLoading] = useState<boolean>(true);
33
- // const [jsonData] = useState<any[]>([]);
34
- const [columns, setColumns] = useState<any[]>([]);
35
- const [searchTerm, setSearchTerm] = useState("");
36
- const [data, setData] = useState<Person[]>(() => makeData(200, 3, 2));
37
-
38
- const [selectedTab, setSelectedTab] = useState("All");
39
-
40
- const tableStates = useCraftTable();
41
- const filterSettingStates = useCraftTableFilterSettings();
42
-
43
- const { filters, setFilters, filterMaster, setFilterMaster, filterToDelete } =
44
- tableStates;
45
-
46
- const { showListViewSettings, setShowListViewSettings, setSettingsData } =
47
- filterSettingStates;
48
-
49
- const { defaultColumns } = useDefaultColumns();
50
-
51
- const { metaQuery } = useFetchData(ENTITY_TYPE);
52
- const { detailsQuery } = useDetailsQueryAPI(
53
- filterMaster?.saved_filters?.selectedId
54
- ? filterMaster?.saved_filters?.selectedId
55
- : metaQuery?.data?.default_filter?.value
56
- );
57
-
58
- const { savedMutation } = useSavedFilterAPI(); //API CALL FOR SAVED FILTER
59
- const { deleteMutation } = useDeleteFilterAPI(); //API FOR DELETING FILTER
60
- const { updateMutation } = useUpdateFilterAPI(); //API FOR UPDATE FILTER
61
- const { saveSettingsDataMutation } = useSaveSettingsDataAPI(ENTITY_TYPE);
62
- const { dropdownData } = useCommonDropdownAPI(metaQuery.data);
63
- const { settingsTabDropdownData, settingsTabDropdownPending } =
64
- useSettingsDropDownAPI({
65
- entity_type: ENTITY_TYPE,
66
- column: filterSettingStates?.quickTabStates?.attribute,
67
- sort_by: filterSettingStates?.quickTabStates?.sorting,
68
- });
69
-
70
- const { getSettingsAPIData } = useGetSettingsDataAPI(ENTITY_TYPE);
71
-
72
- useEffect(() => {
73
- // setTimeout(() => {
74
- // setMockLoading(false);
75
- // }, 1000);
76
-
77
- const fetchMeta = async () => {
78
- try {
79
- const { res: allColumns } = await entityTableMetaMaster(ENTITY_TYPE);
80
-
81
- const savedColumnSettings = filterSettingStates.settingsData?.column;
82
-
83
- const getOrderedColumns = (
84
- showList: { value: string }[],
85
- filteredColumns: any[]
86
- ) => {
87
- // Build ordered columns using showList and filteredColumns
88
- return showList
89
- ?.map((showItem) => {
90
- return filteredColumns.find(
91
- (col) => col?.accessorKey === showItem?.value
92
- );
93
- })
94
- ?.filter((col): col is ColumnDef<any> => col !== undefined); // Ensure non-undefined columns are returned
95
- };
96
-
97
- if (
98
- savedColumnSettings &&
99
- !savedColumnSettings.isDefault &&
100
- savedColumnSettings.tabs
101
- ) {
102
- // Tab-wise view: find the active tab and use its show_list
103
- const activeTabSettings = savedColumnSettings.tabs.find(
104
- (tab) => tab.tab_name.toLowerCase() === selectedTab.toLowerCase()
105
- );
106
-
107
- if (activeTabSettings?.show_list) {
108
- const visibleColumns = new Set(
109
- activeTabSettings.show_list.map((c) => c.value)
110
- );
111
-
112
- // First, filter columns based on visibleColumns
113
- const filteredColumns = allColumns.filter((col: any) =>
114
- visibleColumns.has(col?.accessorKey)
115
- );
116
- setColumns(
117
- getOrderedColumns(activeTabSettings.show_list, filteredColumns)
118
- );
119
- } else {
120
- // Fallback if no specific settings for the active tab are found
121
- setColumns(allColumns);
122
- }
123
- } else if (savedColumnSettings && savedColumnSettings.show_list) {
124
- // Default view: use the main show_list
125
- const visibleColumns = new Set(
126
- savedColumnSettings.show_list.map((c) => c.value)
127
- );
128
- const filtered = allColumns.filter((col: any) =>
129
- visibleColumns.has(col?.accessorKey)
130
- );
131
-
132
- setColumns(
133
- getOrderedColumns(savedColumnSettings.show_list, filtered)
134
- );
135
- } else {
136
- // No settings found, use all columns
137
- setColumns(allColumns);
138
- }
139
- } catch (error) {
140
- console.error("Failed to fetch metadata:", error);
141
- }
142
- };
143
-
144
- fetchMeta();
145
- }, [selectedTab]);
146
-
147
- useEffect(() => {
148
- setFilters(detailsQuery.data ?? []);
149
- }, [detailsQuery.data]);
150
-
151
- useEffect(() => {
152
- setSettingsData(getSettingsAPIData?.layout_json);
153
- }, [getSettingsAPIData]);
154
-
155
- //For server side sorting
156
- const enableServerSideSorting = true;
157
-
158
- const { tableData } = useEntityTableAPI({
159
- page: 0,
160
- size: 50,
161
- entity_type: ENTITY_TYPE,
162
- tabs: {
163
- columnName:
164
- getSettingsAPIData?.layout_json?.quick_tab?.attribute || "status",
165
- sortBy: getSettingsAPIData?.layout_json?.quick_tab?.sorting || "ASC",
166
- value:
167
- selectedTab.toLowerCase() === "all" ? "" : selectedTab.toLowerCase(),
168
- },
169
- quickFilter: tableStates.filters,
170
- sortby: [
171
- {
172
- sortColum: "name",
173
- sortType: "ASC",
174
- },
175
- ],
176
- attributeFilter: [],
177
- });
178
-
179
- const newData = useMemo(
180
- () => tableData?.entity_list || [],
181
- [tableData?.entity_list]
7
+ const [currentView, setCurrentView] = useState<"listing" | "kanban">(
8
+ "listing"
182
9
  );
183
- const tabsData = tableData?.entity_tabs;
184
10
 
185
- // Auto-switch tab if the selected tab is removed
186
- useEffect(() => {
187
- if (
188
- tabsData &&
189
- tabsData.length > 0 &&
190
- !tabsData.some(
191
- (tab) => tab.tab_value?.toLowerCase() === selectedTab.toLowerCase()
192
- )
193
- ) {
194
- // Try to select 'ALL' if it exists
195
- const allTab = tabsData.find(
196
- (tab) => tab.tab_value?.toLowerCase() === "all"
197
- );
198
- if (allTab) {
199
- setSelectedTab(allTab.tab_value || "All");
200
- } else {
201
- setSelectedTab(tabsData[0].tab_value || "All");
202
- }
11
+ const renderView = () => {
12
+ switch (currentView) {
13
+ case "listing":
14
+ return <ListingView />;
15
+ case "kanban":
16
+ return <KanbanView />;
17
+ default:
18
+ return <ListingView />;
203
19
  }
204
- }, [tabsData, selectedTab]);
205
-
206
- const totalCount = useMemo(() => {
207
- return Number(
208
- tableData?.entity_tabs?.find((tab) => {
209
- const activeTab = selectedTab || "All";
210
- return (
211
- tab.tab_value?.toLocaleLowerCase() === activeTab.toLocaleLowerCase()
212
- );
213
- })?.tab_value_count || "0"
214
- );
215
- }, [tableData, selectedTab]);
216
-
217
- const handleRenderStatus = ({ value }: any) => {
218
- const statusValue = value?.toUpperCase();
219
- return (
220
- <div
221
- style={{
222
- backgroundColor: "#F0F0F0",
223
- color: "#757575",
224
- textTransform: "capitalize",
225
- fontSize: "0.75rem",
226
- fontWeight: 500,
227
- borderRadius: "4px",
228
- padding: "4px",
229
- width: "fit-content",
230
- }}
231
- >
232
- {statusValue}
233
- </div>
234
- );
235
20
  };
236
21
 
237
- const handleRenderAction = ({ row }: any) => {
238
- return <button onClick={() => alert(JSON.stringify(row))}>Edit</button>;
22
+ const containedBtn = {
23
+ padding: "6px 14px",
24
+ marginRight: "8px",
25
+ borderRadius: "4px",
26
+ border: "none",
27
+ backgroundColor: "#1976d2",
28
+ color: "#fff",
29
+ cursor: "pointer",
239
30
  };
240
31
 
241
- const filteredData = useMemo(() => {
242
- if (!searchTerm) return newData;
243
-
244
- return newData.filter((row: any) =>
245
- Object.values(row)
246
- .join(" ")
247
- .toLowerCase()
248
- .includes(searchTerm.toLowerCase())
249
- );
250
- }, [newData, searchTerm]);
251
-
252
- // API to handle saving a filter
253
- const handleSaveFilter = (name: string) => {
254
- const quickFilter = filters.map((f) => ({
255
- filter_attribute: f.filter_attribute,
256
- filter_operator: f.filter_operator,
257
- filter_value: f.filter_value,
258
- }));
259
-
260
- const payload = {
261
- name,
262
- is_default: false,
263
- mapped_entity_type: ENTITY_TYPE, // For that entity type
264
- status: "ACTIVE",
265
- entity_type: "SFM", // FIXED entity type
266
- filterDetails: quickFilter,
267
- };
268
- const entity_type = "SFM";
269
- savedMutation.mutate(
270
- { entity_type, payload },
271
- {
272
- onSuccess: (response) => {
273
- const newFilterId = response?.id;
274
- if (newFilterId) {
275
- setFilterMaster(
276
- (prev) =>
277
- ({
278
- ...prev,
279
- saved_filters: {
280
- ...prev?.saved_filters,
281
- selectedId: newFilterId.toString(),
282
- selectedName: name,
283
- },
284
- activeFilterTabIndex: 1,
285
- } as FilterMasterStateProps)
286
- );
287
- }
288
- },
289
- }
290
- );
291
- };
292
-
293
- // API to handle removing or deleting a filter
294
- const handleRemoveFilter = () => {
295
- const payload = {
296
- name: filterToDelete?.label,
297
- id: filterToDelete?.value,
298
- is_default: false,
299
- mapped_entity_type: ENTITY_TYPE,
300
- status: "INACTIVE",
301
- entity_type: "SFM",
302
- };
303
- const entity_type = "SFM";
304
- deleteMutation.mutate({ entity_type, payload });
305
- };
306
-
307
- //API to update the filter
308
- const handleUpdateFilter = () => {
309
- const quickFilter = filters.map((f) => ({
310
- filter_attribute: f.filter_attribute,
311
- filter_operator: f.filter_operator,
312
- filter_value: f.filter_value,
313
- }));
314
-
315
- const payload = {
316
- name: filterMaster?.saved_filters?.selectedName, // Name of the filter
317
- is_default: false,
318
- id: filterMaster?.saved_filters?.selectedId,
319
- mapped_entity_type: ENTITY_TYPE,
320
- status: "ACTIVE",
321
- entity_type: "SFM",
322
- filterDetails: quickFilter,
323
- };
324
- const entity_type = "SFM";
325
- updateMutation.mutate({ entity_type, payload });
326
- };
327
-
328
- const handleSaveSettingsData = (settingsData: SettingsDataProps) => {
329
- const payload = {
330
- entity_type: "LAP",
331
- mapped_entity_type: ENTITY_TYPE,
332
- layout_json: settingsData,
333
- };
334
-
335
- saveSettingsDataMutation.mutate({ payload });
32
+ const outlinedBtn = {
33
+ padding: "6px 14px",
34
+ marginRight: "8px",
35
+ borderRadius: "4px",
36
+ border: "1px solid #1976d2",
37
+ backgroundColor: "transparent",
38
+ color: "#1976d2",
39
+ cursor: "pointer",
336
40
  };
337
41
 
338
42
  return (
339
43
  <div className="app_wrapper">
340
44
  <LoginButton />
341
45
 
342
- <TableWrapper
343
- data={filteredData}
344
- // data={data}
345
- // columns={defaultColumns}
346
- columns={columns && columns.length > 0 ? columns : defaultColumns}
347
- tableStates={tableStates}
348
- featureOptions={{
349
- striped: true,
350
- compactTable: false,
351
- enableSorting: !enableServerSideSorting,
352
- enableColumnReordering: true,
353
- enableColumnResizing: true,
354
- enableRowSelection: false,
355
- enableServerSideSorting: enableServerSideSorting,
356
- }}
357
- // loadingOptions={{
358
- // isLoading: isTableDataPending || detailsQuery.isPending,
359
- // // loaderText: "Loading, Please wait...",
360
- // }}
361
- paginationOptions={{
362
- showPagination: true,
363
- paginationPosition: "top",
364
- paginationView: "compact",
365
- totalRows: totalCount,
366
- }}
367
- customRenderFn={{
368
- renderStatus: handleRenderStatus,
369
- renderAction: handleRenderAction,
370
- }}
371
- // emptyListComponent={<div>No data found</div>}
372
- filterOptions={{
373
- show: tableStates?.showTableFilter,
374
- component: (
375
- <CraftTableFilter
376
- tableStates={tableStates}
377
- onClose={() => tableStates.setShowTableFilter(false)}
378
- onUpdateFilter={handleUpdateFilter}
379
- columnsData={metaQuery.data || {}}
380
- dropdownData={dropdownData || []}
381
- onDeleteFilter={handleRemoveFilter}
382
- onSaveFilter={handleSaveFilter}
383
- />
384
- ),
385
- }}
386
- topbarOptions={{
387
- tableStates,
388
- leftSideComponent: (
389
- <>
390
- <TableTabs
391
- columns={columns}
392
- settingsOptions={{
393
- showIcon: true,
394
- onClick: () => setShowListViewSettings(!showListViewSettings),
395
- }}
396
- activeTab={selectedTab}
397
- tableStates={tableStates}
398
- tabsData={tabsData}
399
- onClick={(state) => {
400
- setSelectedTab(state);
401
- }}
402
- />
46
+ {/* View Switch Buttons */}
47
+ <div style={{ marginBottom: "1rem", marginTop: "4px" }}>
48
+ <button
49
+ style={currentView === "listing" ? containedBtn : outlinedBtn}
50
+ onClick={() => setCurrentView("listing")}
51
+ >
52
+ Listing View
53
+ </button>
54
+ <button
55
+ style={currentView === "kanban" ? containedBtn : outlinedBtn}
56
+ onClick={() => setCurrentView("kanban")}
57
+ >
58
+ Kanban View
59
+ </button>
60
+ </div>
403
61
 
404
- <QuickFilterSettings
405
- filterSettingStates={filterSettingStates}
406
- onClose={() => setShowListViewSettings(false)}
407
- columnsData={metaQuery.data || {}}
408
- columnsDataLoading={metaQuery.isPending}
409
- tabsApiData={settingsTabDropdownData || []}
410
- tabsApiDataLoading={settingsTabDropdownPending}
411
- onSaveSettingsData={handleSaveSettingsData}
412
- />
413
- </>
414
- ),
415
- searchValue: searchTerm,
416
- onSearchChange: (val) => setSearchTerm(val),
417
- showFilterToggle: true,
418
- onFilterButtonClick: () =>
419
- tableStates.setShowTableFilter(!tableStates.showTableFilter),
420
- }}
421
- />
62
+ {/* Conditional Content */}
63
+ {renderView()}
422
64
  </div>
423
65
  );
424
66
  }
@@ -0,0 +1,88 @@
1
+ /* Satoshi Font Family */
2
+ @font-face {
3
+ font-family: "Satoshi";
4
+ src: url("./Satoshi/Satoshi-Light.ttf") format("truetype");
5
+ font-weight: 300;
6
+ font-style: normal;
7
+ }
8
+
9
+ @font-face {
10
+ font-family: "Satoshi";
11
+ src: url("./Satoshi/Satoshi-LightItalic.ttf") format("truetype");
12
+ font-weight: 300;
13
+ font-style: italic;
14
+ }
15
+
16
+ @font-face {
17
+ font-family: "Satoshi";
18
+ src: url("./Satoshi/Satoshi-Regular.ttf") format("truetype");
19
+ font-weight: 400;
20
+ font-style: normal;
21
+ }
22
+
23
+ @font-face {
24
+ font-family: "Satoshi";
25
+ src: url("./Satoshi/Satoshi-Italic.ttf") format("truetype");
26
+ font-weight: 400;
27
+ font-style: italic;
28
+ }
29
+
30
+ @font-face {
31
+ font-family: "Satoshi";
32
+ src: url("./Satoshi/Satoshi-Medium.ttf") format("truetype");
33
+ font-weight: 500;
34
+ font-style: normal;
35
+ }
36
+
37
+ @font-face {
38
+ font-family: "Satoshi";
39
+ src: url("./Satoshi/Satoshi-MediumItalic.ttf") format("truetype");
40
+ font-weight: 500;
41
+ font-style: italic;
42
+ }
43
+
44
+ @font-face {
45
+ font-family: "Satoshi";
46
+ src: url("./Satoshi/Satoshi-Bold.ttf") format("truetype");
47
+ font-weight: 700;
48
+ font-style: normal;
49
+ }
50
+
51
+ @font-face {
52
+ font-family: "Satoshi";
53
+ src: url("./Satoshi/Satoshi-BoldItalic.ttf") format("truetype");
54
+ font-weight: 700;
55
+ font-style: italic;
56
+ }
57
+
58
+ @font-face {
59
+ font-family: "Satoshi";
60
+ src: url("./Satoshi/Satoshi-Black.ttf") format("truetype");
61
+ font-weight: 900;
62
+ font-style: normal;
63
+ }
64
+
65
+ @font-face {
66
+ font-family: "Satoshi";
67
+ src: url("./Satoshi/Satoshi-BlackItalic.ttf") format("truetype");
68
+ font-weight: 900;
69
+ font-style: italic;
70
+ }
71
+
72
+ /* Global font application */
73
+ * {
74
+ font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
75
+ }
76
+
77
+ body {
78
+ font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
79
+ font-weight: 400;
80
+ }
81
+
82
+ h1, h2, h3, h4, h5, h6 {
83
+ font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
84
+ }
85
+
86
+ input, textarea, select, button {
87
+ font-family: inherit;
88
+ }
@@ -0,0 +1,15 @@
1
+ export const headerHeight = "64px";
2
+ export const primarySidebarWidth = "64px";
3
+ export const totalSidebarWidth = "260px";
4
+ export const submenuSidebarWidth = "12.25rem";
5
+ export const primaryfontRegular = "Satoshi-regular";
6
+ export const primaryfontBlack = "Satoshi-Black";
7
+ export const primaryFontBlackItalic = "Satoshi-BlackItalic";
8
+ export const primaryFontBold = "Satoshi-Bold";
9
+ export const primaryFontBoldItalic = "Satoshi-BoldItalic";
10
+ export const primaryFontItalic = "Satoshi-Italic";
11
+ export const primaryLight = "Satoshi-Light";
12
+ export const primaryLightItalic = "Satoshi-LightItalic";
13
+ export const primaryRegular = "Satoshi-Regular";
14
+ export const primaryVariable = "Satoshi-Variable";
15
+ export const primaryVariableItalic = "Satoshi-VariableItalic";
package/src/index.ts CHANGED
@@ -1,10 +1,11 @@
1
- export { default as TableWrapper } from "./components/index-table";
2
- export { useCraftTable } from "./libs/hooks/useCraftTable";
3
- export { useCraftTableFilterSettings } from "./libs/hooks/useCraftTableFilterSettings";
4
- export { TableTabs as CraftTableTabs } from "./components/tabs";
5
- export { TableFilter as CraftTableFilter } from "./components/filter";
6
- export { QuickFilterSettings as CraftTableSettings } from "./components/table-settings";
7
- export { TableSearch as CraftTableSearch } from "./components/search";
1
+ export { default as TableWrapper } from "./listing/components/index-table";
2
+ export { useCraftTable } from "./listing/libs/hooks/useCraftTable";
3
+ export { useCraftTableFilterSettings } from "./listing/libs/hooks/useCraftTableFilterSettings";
4
+ export { TableTabs as CraftTableTabs } from "./listing/components/tabs";
5
+ export { TableFilter as CraftTableFilter } from "./listing/components/filter";
6
+ export { QuickFilterSettings as CraftTableSettings } from "./listing/components/table-settings";
7
+ export { TableSearch as CraftTableSearch } from "./listing/components/search";
8
+ export { default as KanbanWrapper } from "./kanban";
8
9
 
9
- export * from "./types/table";
10
- export * from "./types/table-options";
10
+ export * from "./listing/types/table";
11
+ export * from "./listing/types/table-options";