pixelize-design-library 2.3.1-beta.1 → 2.3.1-beta.2
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 +1 -1
- package/dist/App.d.ts +0 -4
- package/dist/App.js +0 -131
- package/dist/Components/Table/CompactSelect.d.ts +0 -15
- package/dist/Components/Table/CompactSelect.js +0 -69
- package/dist/Components/Table/Components/ActiveFilters.d.ts +0 -9
- package/dist/Components/Table/Components/ActiveFilters.js +0 -132
- package/dist/Components/Table/Components/TableFilters.d.ts +0 -7
- package/dist/Components/Table/Components/TableFilters.js +0 -89
- package/dist/Components/Table/Components/useDebounce.d.ts +0 -2
- package/dist/Components/Table/Components/useDebounce.js +0 -28
- package/dist/Components/Table/Components/useTable.d.ts +0 -47
- package/dist/Components/Table/Components/useTable.js +0 -219
- package/dist/Components/Table/LeftFilterPane.d.ts +0 -36
- package/dist/Components/Table/LeftFilterPane.js +0 -273
- package/dist/Components/Table/SelectOperationControls.d.ts +0 -8
- package/dist/Components/Table/SelectOperationControls.js +0 -15
- package/dist/Components/Table/TableSettings/ManageColumns.d.ts +0 -12
- package/dist/Components/Table/TableSettings/ManageColumns.js +0 -166
- package/dist/Components/Table/TableSettings/ManageColumns.test.d.ts +0 -1
- package/dist/Components/Table/TableSettings/ManageColumns.test.js +0 -146
- package/dist/Components/Table/TableSettings/TableFilters.d.ts +0 -10
- package/dist/Components/Table/TableSettings/TableFilters.js +0 -69
- package/dist/Components/Table/TableSettings/TableFilters.test.d.ts +0 -1
- package/dist/Components/Table/TableSettings/TableFilters.test.js +0 -109
- package/dist/Components/Table/TableSettings/TableSettings.d.ts +0 -8
- package/dist/Components/Table/TableSettings/TableSettings.js +0 -141
- package/dist/Components/Table/TableToDo.d.ts +0 -2
- package/dist/Components/Table/TableToDo.js +0 -291
- package/dist/Components/Table/TextOperationControls.d.ts +0 -12
- package/dist/Components/Table/TextOperationControls.js +0 -29
- package/dist/Layout.d.ts +0 -3
- package/dist/Layout.js +0 -292
- package/dist/Pages/TInput.d.ts +0 -3
- package/dist/Pages/TInput.js +0 -56
- package/dist/Pages/accordion.d.ts +0 -3
- package/dist/Pages/accordion.js +0 -42
- package/dist/Pages/alertdialog.d.ts +0 -3
- package/dist/Pages/alertdialog.js +0 -54
- package/dist/Pages/button.d.ts +0 -3
- package/dist/Pages/button.js +0 -46
- package/dist/Pages/card.d.ts +0 -3
- package/dist/Pages/card.js +0 -117
- package/dist/Pages/chart.d.ts +0 -4
- package/dist/Pages/chart.js +0 -40
- package/dist/Pages/checkbox.d.ts +0 -3
- package/dist/Pages/checkbox.js +0 -12
- package/dist/Pages/contactForm.d.ts +0 -3
- package/dist/Pages/contactForm.js +0 -16
- package/dist/Pages/datePick.d.ts +0 -3
- package/dist/Pages/datePick.js +0 -88
- package/dist/Pages/drawer.d.ts +0 -3
- package/dist/Pages/drawer.js +0 -58
- package/dist/Pages/dropdown.d.ts +0 -3
- package/dist/Pages/dropdown.js +0 -24
- package/dist/Pages/editor.d.ts +0 -3
- package/dist/Pages/editor.js +0 -14
- package/dist/Pages/feedback.d.ts +0 -2
- package/dist/Pages/feedback.js +0 -15
- package/dist/Pages/fileUpload.d.ts +0 -2
- package/dist/Pages/fileUpload.js +0 -82
- package/dist/Pages/input.d.ts +0 -3
- package/dist/Pages/input.js +0 -92
- package/dist/Pages/kanbanboard.d.ts +0 -3
- package/dist/Pages/kanbanboard.js +0 -224
- package/dist/Pages/modal.d.ts +0 -3
- package/dist/Pages/modal.js +0 -65
- package/dist/Pages/multiSelect.d.ts +0 -3
- package/dist/Pages/multiSelect.js +0 -55
- package/dist/Pages/noteArea.d.ts +0 -3
- package/dist/Pages/noteArea.js +0 -59
- package/dist/Pages/notification.d.ts +0 -3
- package/dist/Pages/notification.js +0 -25
- package/dist/Pages/numberInput.d.ts +0 -3
- package/dist/Pages/numberInput.js +0 -49
- package/dist/Pages/photoViewer.d.ts +0 -3
- package/dist/Pages/photoViewer.js +0 -12
- package/dist/Pages/pinInputs.d.ts +0 -3
- package/dist/Pages/pinInputs.js +0 -12
- package/dist/Pages/productCaard.d.ts +0 -3
- package/dist/Pages/productCaard.js +0 -311
- package/dist/Pages/productDetailCard.d.ts +0 -3
- package/dist/Pages/productDetailCard.js +0 -78
- package/dist/Pages/productFilter.d.ts +0 -3
- package/dist/Pages/productFilter.js +0 -202
- package/dist/Pages/progressbar.d.ts +0 -3
- package/dist/Pages/progressbar.js +0 -12
- package/dist/Pages/radioButton.d.ts +0 -3
- package/dist/Pages/radioButton.js +0 -54
- package/dist/Pages/search.d.ts +0 -3
- package/dist/Pages/search.js +0 -54
- package/dist/Pages/searchSelect.d.ts +0 -3
- package/dist/Pages/searchSelect.js +0 -133
- package/dist/Pages/select.d.ts +0 -3
- package/dist/Pages/select.js +0 -53
- package/dist/Pages/selectSearch.d.ts +0 -3
- package/dist/Pages/selectSearch.js +0 -103
- package/dist/Pages/skeleton.d.ts +0 -3
- package/dist/Pages/skeleton.js +0 -22
- package/dist/Pages/switch.d.ts +0 -3
- package/dist/Pages/switch.js +0 -50
- package/dist/Pages/table.d.ts +0 -3
- package/dist/Pages/table.js +0 -174
- package/dist/Pages/textArea.d.ts +0 -3
- package/dist/Pages/textArea.js +0 -15
- package/dist/Pages/timeline.d.ts +0 -3
- package/dist/Pages/timeline.js +0 -74
- package/dist/Pages/tooltip.d.ts +0 -3
- package/dist/Pages/tooltip.js +0 -12
- package/dist/Pages/toster.d.ts +0 -3
- package/dist/Pages/toster.js +0 -68
- package/dist/Pages/verifyEmail.d.ts +0 -3
- package/dist/Pages/verifyEmail.js +0 -18
- package/dist/Theme/Dark/palette.d.ts +0 -370
- package/dist/Theme/Dark/palette.js +0 -372
- package/dist/bootstrap.d.ts +0 -1
- package/dist/bootstrap.js +0 -14
- package/dist/components-v2/AlertDialog/AlertDialog.d.ts +0 -23
- package/dist/components-v2/AlertDialog/AlertDialog.js +0 -98
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +0 -14
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +0 -66
- package/dist/components-v2/Charts/AreaChart.d.ts +0 -23
- package/dist/components-v2/Charts/AreaChart.js +0 -63
- package/dist/components-v2/Charts/BarChart.d.ts +0 -25
- package/dist/components-v2/Charts/BarChart.js +0 -57
- package/dist/components-v2/Charts/LineChart.d.ts +0 -23
- package/dist/components-v2/Charts/LineChart.js +0 -55
- package/dist/components-v2/Charts/PieChart.d.ts +0 -15
- package/dist/components-v2/Charts/PieChart.js +0 -54
- package/dist/components-v2/Charts/PolarChart.d.ts +0 -14
- package/dist/components-v2/Charts/PolarChart.js +0 -54
- package/dist/components-v2/Charts/chartOptions.d.ts +0 -7
- package/dist/components-v2/Charts/chartOptions.js +0 -41
- package/dist/components-v2/Charts/useChartTheme.d.ts +0 -22
- package/dist/components-v2/Charts/useChartTheme.js +0 -106
- package/dist/components-v2/ContactForm/ContactForm.d.ts +0 -25
- package/dist/components-v2/ContactForm/ContactForm.js +0 -116
- package/dist/components-v2/DatePicker/Calendar.d.ts +0 -19
- package/dist/components-v2/DatePicker/Calendar.js +0 -212
- package/dist/components-v2/DatePicker/DatePicker.d.ts +0 -46
- package/dist/components-v2/DatePicker/DatePicker.js +0 -189
- package/dist/components-v2/DatePicker/TimePicker.d.ts +0 -12
- package/dist/components-v2/DatePicker/TimePicker.js +0 -105
- package/dist/components-v2/DatePicker/utils.d.ts +0 -31
- package/dist/components-v2/DatePicker/utils.js +0 -109
- package/dist/components-v2/Drawer/Drawer.d.ts +0 -27
- package/dist/components-v2/Drawer/Drawer.js +0 -132
- package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +0 -26
- package/dist/components-v2/FeedbackForm/FeedbackForm.js +0 -112
- package/dist/components-v2/FileUploader/FileUploader.d.ts +0 -28
- package/dist/components-v2/FileUploader/FileUploader.js +0 -127
- package/dist/components-v2/Input/TextInput.d.ts +0 -41
- package/dist/components-v2/Input/TextInput.js +0 -169
- package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +0 -39
- package/dist/components-v2/KanbanBoard/KanbanBoard.js +0 -101
- package/dist/components-v2/Layout/AppLayout.d.ts +0 -22
- package/dist/components-v2/Layout/AppLayout.js +0 -53
- package/dist/components-v2/Loading/Loading.d.ts +0 -19
- package/dist/components-v2/Loading/Loading.js +0 -55
- package/dist/components-v2/Modal/Modal.d.ts +0 -30
- package/dist/components-v2/Modal/Modal.js +0 -82
- package/dist/components-v2/NavigationBar/NavigationBar.d.ts +0 -47
- package/dist/components-v2/NavigationBar/NavigationBar.js +0 -148
- package/dist/components-v2/Notification/Notification.d.ts +0 -22
- package/dist/components-v2/Notification/Notification.js +0 -113
- package/dist/components-v2/NumberInput/NumberInput.d.ts +0 -37
- package/dist/components-v2/NumberInput/NumberInput.js +0 -210
- package/dist/components-v2/PinInput/PinInput.d.ts +0 -26
- package/dist/components-v2/PinInput/PinInput.js +0 -138
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +0 -18
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +0 -91
- package/dist/components-v2/Select/Select.d.ts +0 -41
- package/dist/components-v2/Select/Select.js +0 -284
- package/dist/components-v2/Sidebar/Sidebar.d.ts +0 -41
- package/dist/components-v2/Sidebar/Sidebar.js +0 -182
- package/dist/components-v2/Slider/Slider.d.ts +0 -18
- package/dist/components-v2/Slider/Slider.js +0 -101
- package/dist/components-v2/Table/Table.d.ts +0 -7
- package/dist/components-v2/Table/Table.js +0 -172
- package/dist/components-v2/Table/TableProps.d.ts +0 -139
- package/dist/components-v2/Table/TableProps.js +0 -9
- package/dist/components-v2/Table/components/ActiveFilters.d.ts +0 -10
- package/dist/components-v2/Table/components/ActiveFilters.js +0 -70
- package/dist/components-v2/Table/components/BulkActionBar.d.ts +0 -11
- package/dist/components-v2/Table/components/BulkActionBar.js +0 -92
- package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +0 -7
- package/dist/components-v2/Table/components/ColumnResizeHandle.js +0 -41
- package/dist/components-v2/Table/components/Pagination.d.ts +0 -11
- package/dist/components-v2/Table/components/Pagination.js +0 -92
- package/dist/components-v2/Table/components/TableBody.d.ts +0 -23
- package/dist/components-v2/Table/components/TableBody.js +0 -69
- package/dist/components-v2/Table/components/TableCell.d.ts +0 -14
- package/dist/components-v2/Table/components/TableCell.js +0 -63
- package/dist/components-v2/Table/components/TableEmptyState.d.ts +0 -12
- package/dist/components-v2/Table/components/TableEmptyState.js +0 -55
- package/dist/components-v2/Table/components/TableErrorState.d.ts +0 -6
- package/dist/components-v2/Table/components/TableErrorState.js +0 -52
- package/dist/components-v2/Table/components/TableHeader.d.ts +0 -21
- package/dist/components-v2/Table/components/TableHeader.js +0 -94
- package/dist/components-v2/Table/components/TableRow.d.ts +0 -20
- package/dist/components-v2/Table/components/TableRow.js +0 -64
- package/dist/components-v2/Table/components/TableSearch.d.ts +0 -8
- package/dist/components-v2/Table/components/TableSearch.js +0 -47
- package/dist/components-v2/Table/filters/FilterChips.d.ts +0 -6
- package/dist/components-v2/Table/filters/FilterChips.js +0 -9
- package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +0 -17
- package/dist/components-v2/Table/filters/LeftFilterPane.js +0 -105
- package/dist/components-v2/Table/filters/TableFilters.d.ts +0 -12
- package/dist/components-v2/Table/filters/TableFilters.js +0 -127
- package/dist/components-v2/Table/hooks/useColumnResize.d.ts +0 -15
- package/dist/components-v2/Table/hooks/useColumnResize.js +0 -104
- package/dist/components-v2/Table/hooks/useTable.d.ts +0 -58
- package/dist/components-v2/Table/hooks/useTable.js +0 -254
- package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +0 -25
- package/dist/components-v2/Table/hooks/useTableKeyboard.js +0 -112
- package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +0 -29
- package/dist/components-v2/Table/hooks/useVirtualScroll.js +0 -83
- package/dist/components-v2/Table/settings/ManageColumns.d.ts +0 -12
- package/dist/components-v2/Table/settings/ManageColumns.js +0 -59
- package/dist/components-v2/Table/settings/TableSettings.d.ts +0 -12
- package/dist/components-v2/Table/settings/TableSettings.js +0 -57
- package/dist/components-v2/Table/utils/filterUtils.d.ts +0 -7
- package/dist/components-v2/Table/utils/filterUtils.js +0 -149
- package/dist/components-v2/Table/utils/sortUtils.d.ts +0 -6
- package/dist/components-v2/Table/utils/sortUtils.js +0 -65
- package/dist/components-v2/Tag/Tag.d.ts +0 -15
- package/dist/components-v2/Tag/Tag.js +0 -87
- package/dist/components-v2/Timeline/Timeline.d.ts +0 -18
- package/dist/components-v2/Timeline/Timeline.js +0 -76
- package/dist/components-v2/Toaster/Toaster.d.ts +0 -61
- package/dist/components-v2/Toaster/Toaster.js +0 -63
- package/dist/components-v2/Toggle/Toggle.d.ts +0 -28
- package/dist/components-v2/Toggle/Toggle.js +0 -90
- package/dist/components-v2/ui/accordion.d.ts +0 -12
- package/dist/components-v2/ui/accordion.js +0 -104
- package/dist/components-v2/ui/alert.d.ts +0 -18
- package/dist/components-v2/ui/alert.js +0 -99
- package/dist/components-v2/ui/avatar.d.ts +0 -12
- package/dist/components-v2/ui/avatar.js +0 -80
- package/dist/components-v2/ui/badge.d.ts +0 -10
- package/dist/components-v2/ui/badge.js +0 -76
- package/dist/components-v2/ui/button.d.ts +0 -18
- package/dist/components-v2/ui/button.js +0 -97
- package/dist/components-v2/ui/checkbox.d.ts +0 -15
- package/dist/components-v2/ui/checkbox.js +0 -86
- package/dist/components-v2/ui/dialog.d.ts +0 -30
- package/dist/components-v2/ui/dialog.js +0 -115
- package/dist/components-v2/ui/dropdown-menu.d.ts +0 -26
- package/dist/components-v2/ui/dropdown-menu.js +0 -121
- package/dist/components-v2/ui/field.d.ts +0 -32
- package/dist/components-v2/ui/field.js +0 -62
- package/dist/components-v2/ui/form-field.d.ts +0 -25
- package/dist/components-v2/ui/form-field.js +0 -96
- package/dist/components-v2/ui/input.d.ts +0 -9
- package/dist/components-v2/ui/input.js +0 -73
- package/dist/components-v2/ui/label.d.ts +0 -10
- package/dist/components-v2/ui/label.js +0 -70
- package/dist/components-v2/ui/popover.d.ts +0 -9
- package/dist/components-v2/ui/popover.js +0 -60
- package/dist/components-v2/ui/progress.d.ts +0 -12
- package/dist/components-v2/ui/progress.js +0 -75
- package/dist/components-v2/ui/radio-group.d.ts +0 -17
- package/dist/components-v2/ui/radio-group.js +0 -91
- package/dist/components-v2/ui/select.d.ts +0 -24
- package/dist/components-v2/ui/select.js +0 -122
- package/dist/components-v2/ui/separator.d.ts +0 -5
- package/dist/components-v2/ui/separator.js +0 -55
- package/dist/components-v2/ui/skeleton.d.ts +0 -9
- package/dist/components-v2/ui/skeleton.js +0 -68
- package/dist/components-v2/ui/spinner.d.ts +0 -16
- package/dist/components-v2/ui/spinner.js +0 -64
- package/dist/components-v2/ui/switch.d.ts +0 -10
- package/dist/components-v2/ui/switch.js +0 -81
- package/dist/components-v2/ui/tabs.d.ts +0 -13
- package/dist/components-v2/ui/tabs.js +0 -95
- package/dist/components-v2/ui/textarea.d.ts +0 -10
- package/dist/components-v2/ui/textarea.js +0 -96
- package/dist/components-v2/ui/tooltip.d.ts +0 -17
- package/dist/components-v2/ui/tooltip.js +0 -75
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +0 -8
- package/dist/theme-v2/ThemeProvider.d.ts +0 -19
- package/dist/theme-v2/ThemeProvider.js +0 -149
- package/dist/theme-v2/dark.css +0 -47
- package/dist/theme-v2/tokens.css +0 -72
- /package/dist/Components/Table/{Components → components}/HeaderActions.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/HeaderActions.js +0 -0
- /package/dist/Components/Table/{Components → components}/Pagination.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/Pagination.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableActions.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableActions.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableGroupRow.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableGroupRow.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableHeader.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableHeader.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.js +0 -0
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
-
var ownKeys = function(o) {
|
|
31
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
-
var ar = [];
|
|
33
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
-
return ar;
|
|
35
|
-
};
|
|
36
|
-
return ownKeys(o);
|
|
37
|
-
};
|
|
38
|
-
return function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
})();
|
|
46
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
47
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
48
|
-
if (ar || !(i in from)) {
|
|
49
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
50
|
-
ar[i] = from[i];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
54
|
-
};
|
|
55
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
|
-
};
|
|
58
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
var react_1 = __importStar(require("react"));
|
|
60
|
-
var react_2 = require("@chakra-ui/react");
|
|
61
|
-
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
62
|
-
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
63
|
-
var lucide_react_1 = require("lucide-react");
|
|
64
|
-
var ManageColumns = function (_a) {
|
|
65
|
-
var columns = _a.columns, items = _a.items, setItems = _a.setItems, childInputMethodsRef = _a.childInputMethodsRef;
|
|
66
|
-
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
67
|
-
var _b = (0, react_1.useState)(""), searchTerm = _b[0], setSearchTerm = _b[1];
|
|
68
|
-
var _c = (0, react_1.useState)(null), draggedItemIndex = _c[0], setDraggedItemIndex = _c[1];
|
|
69
|
-
var _d = (0, react_1.useState)(null), error = _d[0], setError = _d[1];
|
|
70
|
-
var visibleCount = (0, react_1.useMemo)(function () { return items.filter(function (i) { return !i.isHidden; }).length; }, [items]);
|
|
71
|
-
(0, react_1.useEffect)(function () {
|
|
72
|
-
setItems(columns);
|
|
73
|
-
}, [columns]);
|
|
74
|
-
(0, react_1.useImperativeHandle)(childInputMethodsRef, function () { return ({ getManageColumnsData: function () { return items; } }); }, [items]);
|
|
75
|
-
var handleDragStart = function (index) { return setDraggedItemIndex(index); };
|
|
76
|
-
var handleDragOver = function (e, index) {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
if (draggedItemIndex === null || draggedItemIndex === index)
|
|
79
|
-
return;
|
|
80
|
-
var newItems = __spreadArray([], items, true);
|
|
81
|
-
var draggedItem = newItems[draggedItemIndex];
|
|
82
|
-
newItems.splice(draggedItemIndex, 1);
|
|
83
|
-
newItems.splice(index, 0, draggedItem);
|
|
84
|
-
setDraggedItemIndex(index);
|
|
85
|
-
setItems(newItems);
|
|
86
|
-
};
|
|
87
|
-
var handleDragEnd = function () { return setDraggedItemIndex(null); };
|
|
88
|
-
// Fix: use the item's actual index in `items`, not the filtered list index
|
|
89
|
-
var toggleCheckbox = function (itemId) {
|
|
90
|
-
var realIndex = items.findIndex(function (i) { return i.id === itemId; });
|
|
91
|
-
if (realIndex === -1)
|
|
92
|
-
return;
|
|
93
|
-
var currentVisibleCount = items.filter(function (i) { return !i.isHidden; }).length;
|
|
94
|
-
if (!items[realIndex].isHidden && currentVisibleCount === 2) {
|
|
95
|
-
setError("At least two columns must remain visible.");
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
var newItems = __spreadArray([], items, true);
|
|
99
|
-
newItems[realIndex] = __assign(__assign({}, newItems[realIndex]), { isHidden: !newItems[realIndex].isHidden });
|
|
100
|
-
setItems(newItems);
|
|
101
|
-
setError(null);
|
|
102
|
-
};
|
|
103
|
-
var filteredItems = items.filter(function (item) {
|
|
104
|
-
return item.label.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
105
|
-
});
|
|
106
|
-
var allChecked = items.every(function (item) { return !item.isHidden; });
|
|
107
|
-
var someChecked = items.some(function (item) { return !item.isHidden; }) && !allChecked;
|
|
108
|
-
var handleSelectAll = function () {
|
|
109
|
-
if (allChecked) {
|
|
110
|
-
setItems(items.map(function (item, i) { return (__assign(__assign({}, item), { isHidden: i >= 2 })); }));
|
|
111
|
-
setError("At least two columns must remain visible.");
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
setItems(items.map(function (item) { return (__assign(__assign({}, item), { isHidden: false })); }));
|
|
115
|
-
setError(null);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
return (react_1.default.createElement(react_2.Box, { mt: 2 },
|
|
119
|
-
error && (react_1.default.createElement(react_2.Box, { mb: 2, px: 3, py: 2, bg: theme.colors.red[50], borderRadius: "md", border: "1px solid", borderColor: theme.colors.red[200] },
|
|
120
|
-
react_1.default.createElement(react_2.Text, { color: theme.colors.red[600], fontSize: "xs", fontWeight: 500 }, error))),
|
|
121
|
-
react_1.default.createElement(react_2.Input, { placeholder: "Search columns...", mb: 2, value: searchTerm, onChange: function (e) { return setSearchTerm(e.target.value); }, size: "sm", borderRadius: "md" }),
|
|
122
|
-
!searchTerm.length && (react_1.default.createElement(react_2.Flex, { align: "center", mb: 1, bg: theme.colors.gray[100], px: 2, py: 1, borderRadius: "md" },
|
|
123
|
-
react_1.default.createElement(Checkbox_1.default, { label: "Show all columns", isChecked: allChecked, isIndeterminate: someChecked, onChange: handleSelectAll }))),
|
|
124
|
-
react_1.default.createElement(react_2.List, { spacing: 0, maxH: "300px", overflowY: "auto", sx: {
|
|
125
|
-
"&::-webkit-scrollbar": { width: "3px", height: "3px" },
|
|
126
|
-
"&::-webkit-scrollbar-track": {
|
|
127
|
-
background: theme.colors.gray[100],
|
|
128
|
-
borderRadius: "2px",
|
|
129
|
-
},
|
|
130
|
-
"&::-webkit-scrollbar-thumb": {
|
|
131
|
-
background: theme.colors.gray[400],
|
|
132
|
-
borderRadius: "2px",
|
|
133
|
-
},
|
|
134
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
135
|
-
background: theme.colors.gray[500],
|
|
136
|
-
},
|
|
137
|
-
scrollbarWidth: "thin",
|
|
138
|
-
scrollbarColor: "".concat(theme.colors.gray[400], " ").concat(theme.colors.gray[100]),
|
|
139
|
-
} }, filteredItems.length > 0 ? (filteredItems.map(function (item, index) {
|
|
140
|
-
var isDraggingThisItem = draggedItemIndex === index;
|
|
141
|
-
var isDropZone = draggedItemIndex !== null && draggedItemIndex !== index;
|
|
142
|
-
return (react_1.default.createElement(react_2.ListItem, { key: item.id, draggable: true, onDragStart: function () { return handleDragStart(index); }, onDragOver: function (e) { return handleDragOver(e, index); }, onDragEnd: handleDragEnd, bg: isDraggingThisItem
|
|
143
|
-
? theme.colors.primary[100]
|
|
144
|
-
: isDropZone
|
|
145
|
-
? theme.colors.primary[50]
|
|
146
|
-
: "transparent", display: "flex", alignItems: "center", borderRadius: "sm", border: "1px solid", borderColor: isDraggingThisItem
|
|
147
|
-
? theme.colors.primary[400]
|
|
148
|
-
: "transparent", cursor: "grab", fontSize: "13px", px: 2, py: "3px", mb: "3px", transition: "all 0.15s ease", _hover: {
|
|
149
|
-
bg: theme.colors.gray[50],
|
|
150
|
-
borderColor: theme.colors.border[200],
|
|
151
|
-
}, _active: { cursor: "grabbing" } },
|
|
152
|
-
react_1.default.createElement(react_2.IconButton, { "aria-label": "Drag", icon: react_1.default.createElement(lucide_react_1.GripVertical, { size: 14 }), variant: "ghost", size: "xs", cursor: "grab", mr: 1, minW: "auto", h: "auto", p: 0,
|
|
153
|
-
// color={theme.colors.gray[300]}
|
|
154
|
-
_hover: { color: theme.colors.gray[500], bg: "transparent" } }),
|
|
155
|
-
react_1.default.createElement(Checkbox_1.default, { isChecked: !item.isHidden, label: String(item.label), onChange: function () { return toggleCheckbox(item.id); }, size: "sm", labelSx: {
|
|
156
|
-
color: item.isHidden ? theme.colors.gray[500] : theme.colors.gray[700],
|
|
157
|
-
} }),
|
|
158
|
-
react_1.default.createElement(react_2.Text, { fontSize: "12px", color: theme.colors.gray[400], ml: 'auto' }, index + 1)));
|
|
159
|
-
})) : (react_1.default.createElement(react_2.Text, { color: "gray.400", textAlign: "center", fontSize: "sm", py: 6 }, "No columns found"))),
|
|
160
|
-
react_1.default.createElement(react_2.Text, { fontSize: "xs", color: theme.colors.gray[400], mt: 2, textAlign: "right" },
|
|
161
|
-
visibleCount,
|
|
162
|
-
" / ",
|
|
163
|
-
items.length,
|
|
164
|
-
" visible")));
|
|
165
|
-
};
|
|
166
|
-
exports.default = ManageColumns;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
-
function step(op) {
|
|
49
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
-
switch (op[0]) {
|
|
54
|
-
case 0: case 1: t = op; break;
|
|
55
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
-
default:
|
|
59
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
-
if (t[2]) _.ops.pop();
|
|
64
|
-
_.trys.pop(); continue;
|
|
65
|
-
}
|
|
66
|
-
op = body.call(thisArg, _);
|
|
67
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
72
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
73
|
-
};
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
var react_1 = __importStar(require("react"));
|
|
76
|
-
var react_2 = require("@testing-library/react");
|
|
77
|
-
require("@testing-library/jest-dom");
|
|
78
|
-
var react_3 = require("@chakra-ui/react");
|
|
79
|
-
var ManageColumns_1 = __importDefault(require("./ManageColumns"));
|
|
80
|
-
jest.mock("../../../Theme/useCustomTheme", function () { return ({
|
|
81
|
-
useCustomTheme: function () { return ({
|
|
82
|
-
colors: {
|
|
83
|
-
gray: {
|
|
84
|
-
50: "#fafafa",
|
|
85
|
-
100: "#f5f5f5",
|
|
86
|
-
200: "#eee",
|
|
87
|
-
400: "#ccc",
|
|
88
|
-
500: "#999",
|
|
89
|
-
600: "#666",
|
|
90
|
-
},
|
|
91
|
-
primary: {
|
|
92
|
-
50: "#eef",
|
|
93
|
-
100: "#ddf",
|
|
94
|
-
300: "#99c",
|
|
95
|
-
400: "#66a",
|
|
96
|
-
500: "#338",
|
|
97
|
-
},
|
|
98
|
-
red: { 50: "#fee", 200: "#fcc", 600: "#c00" },
|
|
99
|
-
border: { 200: "#e2e8f0" },
|
|
100
|
-
white: "#fff",
|
|
101
|
-
},
|
|
102
|
-
shadows: { sm: "0 1px 2px rgba(0,0,0,0.05)" },
|
|
103
|
-
}); },
|
|
104
|
-
}); });
|
|
105
|
-
var renderWithChakra = function (ui) {
|
|
106
|
-
return (0, react_2.render)(react_1.default.createElement(react_3.ChakraProvider, null, ui));
|
|
107
|
-
};
|
|
108
|
-
function ManageColumnsHarness(_a) {
|
|
109
|
-
var columns = _a.columns, childRef = _a.childRef;
|
|
110
|
-
var _b = (0, react_1.useState)(columns), items = _b[0], setItems = _b[1];
|
|
111
|
-
return (react_1.default.createElement(ManageColumns_1.default, { columns: columns, items: items, setItems: setItems, childInputMethodsRef: childRef }));
|
|
112
|
-
}
|
|
113
|
-
describe("ManageColumns", function () {
|
|
114
|
-
it("syncs local column state when the columns prop changes", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
-
var childRef, columnsA, columnsB, rerender;
|
|
116
|
-
var _a, _b;
|
|
117
|
-
return __generator(this, function (_c) {
|
|
118
|
-
switch (_c.label) {
|
|
119
|
-
case 0:
|
|
120
|
-
childRef = (0, react_1.createRef)();
|
|
121
|
-
columnsA = [
|
|
122
|
-
{ id: "a", label: "Alpha", isHidden: false },
|
|
123
|
-
{ id: "b", label: "Beta", isHidden: true },
|
|
124
|
-
];
|
|
125
|
-
columnsB = [
|
|
126
|
-
{ id: "a", label: "Alpha", isHidden: true },
|
|
127
|
-
{ id: "b", label: "Beta", isHidden: false },
|
|
128
|
-
];
|
|
129
|
-
rerender = renderWithChakra(react_1.default.createElement(ManageColumnsHarness, { columns: columnsA, childRef: childRef })).rerender;
|
|
130
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Alpha" })).toBeChecked();
|
|
131
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Beta" })).not.toBeChecked();
|
|
132
|
-
expect((_a = childRef.current) === null || _a === void 0 ? void 0 : _a.getManageColumnsData()).toEqual(columnsA);
|
|
133
|
-
rerender(react_1.default.createElement(react_3.ChakraProvider, null,
|
|
134
|
-
react_1.default.createElement(ManageColumnsHarness, { columns: columnsB, childRef: childRef })));
|
|
135
|
-
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
136
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Alpha" })).not.toBeChecked();
|
|
137
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Beta" })).toBeChecked();
|
|
138
|
-
})];
|
|
139
|
-
case 1:
|
|
140
|
-
_c.sent();
|
|
141
|
-
expect((_b = childRef.current) === null || _b === void 0 ? void 0 : _b.getManageColumnsData()).toEqual(columnsB);
|
|
142
|
-
return [2 /*return*/];
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}); });
|
|
146
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
type TableFiltersMethods = {
|
|
3
|
-
getSelectedFilters: () => string[];
|
|
4
|
-
};
|
|
5
|
-
declare const TableFilters: ({ filters, childFilterMethodsRef, filterSelected, }: {
|
|
6
|
-
filters?: string[];
|
|
7
|
-
childFilterMethodsRef?: React.Ref<TableFiltersMethods>;
|
|
8
|
-
filterSelected?: string[];
|
|
9
|
-
}) => React.JSX.Element | null;
|
|
10
|
-
export default TableFilters;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
36
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
37
|
-
if (ar || !(i in from)) {
|
|
38
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
39
|
-
ar[i] = from[i];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
43
|
-
};
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
var react_1 = require("@chakra-ui/react");
|
|
49
|
-
var react_2 = __importStar(require("react"));
|
|
50
|
-
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
51
|
-
var TableFilters = function (_a) {
|
|
52
|
-
var filters = _a.filters, childFilterMethodsRef = _a.childFilterMethodsRef, filterSelected = _a.filterSelected;
|
|
53
|
-
var _b = (0, react_2.useState)(filterSelected !== null && filterSelected !== void 0 ? filterSelected : []), selectedFilters = _b[0], setSelectedFilters = _b[1];
|
|
54
|
-
(0, react_2.useEffect)(function () {
|
|
55
|
-
setSelectedFilters(filterSelected !== null && filterSelected !== void 0 ? filterSelected : []);
|
|
56
|
-
}, [filterSelected]);
|
|
57
|
-
(0, react_2.useImperativeHandle)(childFilterMethodsRef, function () { return ({
|
|
58
|
-
getSelectedFilters: function () { return selectedFilters; },
|
|
59
|
-
}); }, [selectedFilters]);
|
|
60
|
-
if (!(filters === null || filters === void 0 ? void 0 : filters.length))
|
|
61
|
-
return null;
|
|
62
|
-
return (react_2.default.createElement(react_1.Box, { display: "flex", flexDirection: "column", gap: "0.375rem" }, filters.map(function (value) { return (react_2.default.createElement(Checkbox_1.default, { key: value, value: value, isChecked: selectedFilters.includes(value), onChange: function (e) {
|
|
63
|
-
setSelectedFilters(function (prev) {
|
|
64
|
-
return e.target.checked
|
|
65
|
-
? __spreadArray(__spreadArray([], prev, true), [value], false) : prev.filter(function (f) { return f !== value; });
|
|
66
|
-
});
|
|
67
|
-
}, label: value })); })));
|
|
68
|
-
};
|
|
69
|
-
exports.default = TableFilters;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
-
function step(op) {
|
|
49
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
-
switch (op[0]) {
|
|
54
|
-
case 0: case 1: t = op; break;
|
|
55
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
-
default:
|
|
59
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
-
if (t[2]) _.ops.pop();
|
|
64
|
-
_.trys.pop(); continue;
|
|
65
|
-
}
|
|
66
|
-
op = body.call(thisArg, _);
|
|
67
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
72
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
73
|
-
};
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
var react_1 = __importStar(require("react"));
|
|
76
|
-
var react_2 = require("@testing-library/react");
|
|
77
|
-
require("@testing-library/jest-dom");
|
|
78
|
-
var react_3 = require("@chakra-ui/react");
|
|
79
|
-
var TableFilters_1 = __importDefault(require("./TableFilters"));
|
|
80
|
-
var renderWithChakra = function (ui) {
|
|
81
|
-
return (0, react_2.render)(react_1.default.createElement(react_3.ChakraProvider, null, ui));
|
|
82
|
-
};
|
|
83
|
-
describe("TableFilters", function () {
|
|
84
|
-
it("syncs selected filters when filterSelected prop changes", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
-
var childRef, filters, rerender;
|
|
86
|
-
var _a, _b;
|
|
87
|
-
return __generator(this, function (_c) {
|
|
88
|
-
switch (_c.label) {
|
|
89
|
-
case 0:
|
|
90
|
-
childRef = (0, react_1.createRef)();
|
|
91
|
-
filters = ["Status: Open", "Status: Closed"];
|
|
92
|
-
rerender = renderWithChakra(react_1.default.createElement(TableFilters_1.default, { filters: filters, childFilterMethodsRef: childRef, filterSelected: ["Status: Open"] })).rerender;
|
|
93
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Status: Open" })).toBeChecked();
|
|
94
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Status: Closed" })).not.toBeChecked();
|
|
95
|
-
expect((_a = childRef.current) === null || _a === void 0 ? void 0 : _a.getSelectedFilters()).toEqual(["Status: Open"]);
|
|
96
|
-
rerender(react_1.default.createElement(react_3.ChakraProvider, null,
|
|
97
|
-
react_1.default.createElement(TableFilters_1.default, { filters: filters, childFilterMethodsRef: childRef, filterSelected: ["Status: Closed"] })));
|
|
98
|
-
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
99
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Status: Open" })).not.toBeChecked();
|
|
100
|
-
expect(react_2.screen.getByRole("checkbox", { name: "Status: Closed" })).toBeChecked();
|
|
101
|
-
})];
|
|
102
|
-
case 1:
|
|
103
|
-
_c.sent();
|
|
104
|
-
expect((_b = childRef.current) === null || _b === void 0 ? void 0 : _b.getSelectedFilters()).toEqual(["Status: Closed"]);
|
|
105
|
-
return [2 /*return*/];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}); });
|
|
109
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TableProps } from "../TableProps";
|
|
3
|
-
declare const TableSettings: ({ columns, onSave, tableSettings, }: {
|
|
4
|
-
columns: TableProps["columns"];
|
|
5
|
-
onSave: (updatedColumns: TableProps["columns"]) => void;
|
|
6
|
-
tableSettings?: TableProps["tableSettings"];
|
|
7
|
-
}) => React.JSX.Element;
|
|
8
|
-
export default TableSettings;
|