@darajs/ui-components 0.4.8
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/LICENSE +201 -0
- package/dist/accordion/accordion-item.d.ts +24 -0
- package/dist/accordion/accordion-item.d.ts.map +1 -0
- package/dist/accordion/accordion-item.js +92 -0
- package/dist/accordion/accordion-item.js.map +1 -0
- package/dist/accordion/accordion.d.ts +32 -0
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +87 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/badge/badge.d.ts +20 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/badge.js +42 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/button/button.d.ts +35 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +169 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button-bar/button-bar.d.ts +19 -0
- package/dist/button-bar/button-bar.d.ts.map +1 -0
- package/dist/button-bar/button-bar.js +124 -0
- package/dist/button-bar/button-bar.js.map +1 -0
- package/dist/carousel/carousel.d.ts +23 -0
- package/dist/carousel/carousel.d.ts.map +1 -0
- package/dist/carousel/carousel.js +178 -0
- package/dist/carousel/carousel.js.map +1 -0
- package/dist/chat/chat.d.ts +28 -0
- package/dist/chat/chat.d.ts.map +1 -0
- package/dist/chat/chat.js +182 -0
- package/dist/chat/chat.js.map +1 -0
- package/dist/chat/message.d.ts +28 -0
- package/dist/chat/message.d.ts.map +1 -0
- package/dist/chat/message.js +220 -0
- package/dist/chat/message.js.map +1 -0
- package/dist/checkbox/checkbox-group.d.ts +35 -0
- package/dist/checkbox/checkbox-group.d.ts.map +1 -0
- package/dist/checkbox/checkbox-group.js +116 -0
- package/dist/checkbox/checkbox-group.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +27 -0
- package/dist/checkbox/checkbox.d.ts.map +1 -0
- package/dist/checkbox/checkbox.js +164 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox/tri-state-checkbox.d.ts +22 -0
- package/dist/checkbox/tri-state-checkbox.d.ts.map +1 -0
- package/dist/checkbox/tri-state-checkbox.js +87 -0
- package/dist/checkbox/tri-state-checkbox.js.map +1 -0
- package/dist/code-viewer/code-viewer.d.ts +31 -0
- package/dist/code-viewer/code-viewer.d.ts.map +1 -0
- package/dist/code-viewer/code-viewer.js +115 -0
- package/dist/code-viewer/code-viewer.js.map +1 -0
- package/dist/combo-box/combo-box.d.ts +39 -0
- package/dist/combo-box/combo-box.d.ts.map +1 -0
- package/dist/combo-box/combo-box.js +176 -0
- package/dist/combo-box/combo-box.js.map +1 -0
- package/dist/component-select-list/component-select-list.d.ts +27 -0
- package/dist/component-select-list/component-select-list.d.ts.map +1 -0
- package/dist/component-select-list/component-select-list.js +131 -0
- package/dist/component-select-list/component-select-list.js.map +1 -0
- package/dist/constants.d.ts +33 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +47 -0
- package/dist/constants.js.map +1 -0
- package/dist/context-menu/context-menu.d.ts +24 -0
- package/dist/context-menu/context-menu.d.ts.map +1 -0
- package/dist/context-menu/context-menu.js +116 -0
- package/dist/context-menu/context-menu.js.map +1 -0
- package/dist/datepicker/datepicker-select.d.ts +48 -0
- package/dist/datepicker/datepicker-select.d.ts.map +1 -0
- package/dist/datepicker/datepicker-select.js +219 -0
- package/dist/datepicker/datepicker-select.js.map +1 -0
- package/dist/datepicker/datepicker.d.ts +56 -0
- package/dist/datepicker/datepicker.d.ts.map +1 -0
- package/dist/datepicker/datepicker.js +669 -0
- package/dist/datepicker/datepicker.js.map +1 -0
- package/dist/dropzone/dropzone.d.ts +21 -0
- package/dist/dropzone/dropzone.d.ts.map +1 -0
- package/dist/dropzone/dropzone.js +80 -0
- package/dist/dropzone/dropzone.js.map +1 -0
- package/dist/error-boundary/error-boundary.d.ts +33 -0
- package/dist/error-boundary/error-boundary.d.ts.map +1 -0
- package/dist/error-boundary/error-boundary.js +72 -0
- package/dist/error-boundary/error-boundary.js.map +1 -0
- package/dist/filter/categorical-filter.d.ts +26 -0
- package/dist/filter/categorical-filter.d.ts.map +1 -0
- package/dist/filter/categorical-filter.js +153 -0
- package/dist/filter/categorical-filter.js.map +1 -0
- package/dist/filter/datetime-filter.d.ts +28 -0
- package/dist/filter/datetime-filter.d.ts.map +1 -0
- package/dist/filter/datetime-filter.js +174 -0
- package/dist/filter/datetime-filter.js.map +1 -0
- package/dist/filter/numeric-filter.d.ts +24 -0
- package/dist/filter/numeric-filter.d.ts.map +1 -0
- package/dist/filter/numeric-filter.js +148 -0
- package/dist/filter/numeric-filter.js.map +1 -0
- package/dist/hierarchy-selector/hierarchy-selector.d.ts +31 -0
- package/dist/hierarchy-selector/hierarchy-selector.d.ts.map +1 -0
- package/dist/hierarchy-selector/hierarchy-selector.js +65 -0
- package/dist/hierarchy-selector/hierarchy-selector.js.map +1 -0
- package/dist/hierarchy-selector/node/branch.d.ts +47 -0
- package/dist/hierarchy-selector/node/branch.d.ts.map +1 -0
- package/dist/hierarchy-selector/node/branch.js +132 -0
- package/dist/hierarchy-selector/node/branch.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/input/input.d.ts +44 -0
- package/dist/input/input.d.ts.map +1 -0
- package/dist/input/input.js +91 -0
- package/dist/input/input.js.map +1 -0
- package/dist/jest-setup.d.ts +18 -0
- package/dist/jest-setup.d.ts.map +1 -0
- package/dist/jest-setup.js +18 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/markdown/markdown.d.ts +18 -0
- package/dist/markdown/markdown.d.ts.map +1 -0
- package/dist/markdown/markdown.js +356 -0
- package/dist/markdown/markdown.js.map +1 -0
- package/dist/modal/modal.d.ts +37 -0
- package/dist/modal/modal.d.ts.map +1 -0
- package/dist/modal/modal.js +121 -0
- package/dist/modal/modal.js.map +1 -0
- package/dist/multiselect/multiselect.d.ts +31 -0
- package/dist/multiselect/multiselect.d.ts.map +1 -0
- package/dist/multiselect/multiselect.js +231 -0
- package/dist/multiselect/multiselect.js.map +1 -0
- package/dist/numeric-input/input-stepper.d.ts +33 -0
- package/dist/numeric-input/input-stepper.d.ts.map +1 -0
- package/dist/numeric-input/input-stepper.js +54 -0
- package/dist/numeric-input/input-stepper.js.map +1 -0
- package/dist/numeric-input/numeric-input.d.ts +42 -0
- package/dist/numeric-input/numeric-input.d.ts.map +1 -0
- package/dist/numeric-input/numeric-input.js +234 -0
- package/dist/numeric-input/numeric-input.js.map +1 -0
- package/dist/progress-bar/progress-bar.d.ts +23 -0
- package/dist/progress-bar/progress-bar.d.ts.map +1 -0
- package/dist/progress-bar/progress-bar.js +90 -0
- package/dist/progress-bar/progress-bar.js.map +1 -0
- package/dist/radio/radio-group.d.ts +19 -0
- package/dist/radio/radio-group.d.ts.map +1 -0
- package/dist/radio/radio-group.js +160 -0
- package/dist/radio/radio-group.js.map +1 -0
- package/dist/search-bar/search-bar.d.ts +34 -0
- package/dist/search-bar/search-bar.d.ts.map +1 -0
- package/dist/search-bar/search-bar.js +39 -0
- package/dist/search-bar/search-bar.js.map +1 -0
- package/dist/sectioned-list/sectioned-list.d.ts +29 -0
- package/dist/sectioned-list/sectioned-list.d.ts.map +1 -0
- package/dist/sectioned-list/sectioned-list.js +205 -0
- package/dist/sectioned-list/sectioned-list.js.map +1 -0
- package/dist/select/select.d.ts +54 -0
- package/dist/select/select.d.ts.map +1 -0
- package/dist/select/select.js +143 -0
- package/dist/select/select.js.map +1 -0
- package/dist/shared/chevron-button.d.ts +13 -0
- package/dist/shared/chevron-button.d.ts.map +1 -0
- package/dist/shared/chevron-button.js +35 -0
- package/dist/shared/chevron-button.js.map +1 -0
- package/dist/shared/dropdown-list.d.ts +34 -0
- package/dist/shared/dropdown-list.d.ts.map +1 -0
- package/dist/shared/dropdown-list.js +33 -0
- package/dist/shared/dropdown-list.js.map +1 -0
- package/dist/shared/list-item.d.ts +35 -0
- package/dist/shared/list-item.d.ts.map +1 -0
- package/dist/shared/list-item.js +69 -0
- package/dist/shared/list-item.js.map +1 -0
- package/dist/slider/slider-inputs.d.ts +36 -0
- package/dist/slider/slider-inputs.d.ts.map +1 -0
- package/dist/slider/slider-inputs.js +88 -0
- package/dist/slider/slider-inputs.js.map +1 -0
- package/dist/slider/slider.d.ts +53 -0
- package/dist/slider/slider.d.ts.map +1 -0
- package/dist/slider/slider.js +273 -0
- package/dist/slider/slider.js.map +1 -0
- package/dist/spinner/spinner.d.ts +19 -0
- package/dist/spinner/spinner.d.ts.map +1 -0
- package/dist/spinner/spinner.js +144 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/switch/sun-icon.d.ts +3 -0
- package/dist/switch/sun-icon.d.ts.map +1 -0
- package/dist/switch/sun-icon.js +24 -0
- package/dist/switch/sun-icon.js.map +1 -0
- package/dist/switch/switch.d.ts +16 -0
- package/dist/switch/switch.d.ts.map +1 -0
- package/dist/switch/switch.js +92 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/table/cells/action-cell.d.ts +34 -0
- package/dist/table/cells/action-cell.d.ts.map +1 -0
- package/dist/table/cells/action-cell.js +68 -0
- package/dist/table/cells/action-cell.js.map +1 -0
- package/dist/table/cells/datetime-cell.d.ts +12 -0
- package/dist/table/cells/datetime-cell.d.ts.map +1 -0
- package/dist/table/cells/datetime-cell.js +36 -0
- package/dist/table/cells/datetime-cell.js.map +1 -0
- package/dist/table/cells/edit-cell-utils.d.ts +32 -0
- package/dist/table/cells/edit-cell-utils.d.ts.map +1 -0
- package/dist/table/cells/edit-cell-utils.js +2 -0
- package/dist/table/cells/edit-cell-utils.js.map +1 -0
- package/dist/table/cells/edit-input-cell.d.ts +10 -0
- package/dist/table/cells/edit-input-cell.d.ts.map +1 -0
- package/dist/table/cells/edit-input-cell.js +61 -0
- package/dist/table/cells/edit-input-cell.js.map +1 -0
- package/dist/table/cells/edit-select-cell.d.ts +12 -0
- package/dist/table/cells/edit-select-cell.d.ts.map +1 -0
- package/dist/table/cells/edit-select-cell.js +55 -0
- package/dist/table/cells/edit-select-cell.js.map +1 -0
- package/dist/table/filters.d.ts +46 -0
- package/dist/table/filters.d.ts.map +1 -0
- package/dist/table/filters.js +226 -0
- package/dist/table/filters.js.map +1 -0
- package/dist/table/headers/select-header.d.ts +14 -0
- package/dist/table/headers/select-header.d.ts.map +1 -0
- package/dist/table/headers/select-header.js +41 -0
- package/dist/table/headers/select-header.js.map +1 -0
- package/dist/table/options-menu.d.ts +25 -0
- package/dist/table/options-menu.d.ts.map +1 -0
- package/dist/table/options-menu.js +123 -0
- package/dist/table/options-menu.js.map +1 -0
- package/dist/table/render-row.d.ts +25 -0
- package/dist/table/render-row.d.ts.map +1 -0
- package/dist/table/render-row.js +163 -0
- package/dist/table/render-row.js.map +1 -0
- package/dist/table/table.d.ts +95 -0
- package/dist/table/table.d.ts.map +1 -0
- package/dist/table/table.js +422 -0
- package/dist/table/table.js.map +1 -0
- package/dist/table/types.d.ts +30 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/table/types.js +2 -0
- package/dist/table/types.js.map +1 -0
- package/dist/tabs/tabs.d.ts +22 -0
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +91 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/textarea/textarea.d.ts +47 -0
- package/dist/textarea/textarea.d.ts.map +1 -0
- package/dist/textarea/textarea.js +121 -0
- package/dist/textarea/textarea.js.map +1 -0
- package/dist/tooltip/tooltip.d.ts +48 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +116 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/chevron.d.ts +34 -0
- package/dist/utils/chevron.d.ts.map +1 -0
- package/dist/utils/chevron.js +38 -0
- package/dist/utils/chevron.js.map +1 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +22 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/label.d.ts +3 -0
- package/dist/utils/label.d.ts.map +1 -0
- package/dist/utils/label.js +24 -0
- package/dist/utils/label.js.map +1 -0
- package/dist/utils/list-styles.d.ts +8 -0
- package/dist/utils/list-styles.d.ts.map +1 -0
- package/dist/utils/list-styles.js +43 -0
- package/dist/utils/list-styles.js.map +1 -0
- package/dist/utils/match-width-to-reference.d.ts +24 -0
- package/dist/utils/match-width-to-reference.d.ts.map +1 -0
- package/dist/utils/match-width-to-reference.js +30 -0
- package/dist/utils/match-width-to-reference.js.map +1 -0
- package/dist/utils/syncKbdHighlightIdx.d.ts +23 -0
- package/dist/utils/syncKbdHighlightIdx.d.ts.map +1 -0
- package/dist/utils/syncKbdHighlightIdx.js +41 -0
- package/dist/utils/syncKbdHighlightIdx.js.map +1 -0
- package/dist/utils/use-infinite-loader.d.ts +32 -0
- package/dist/utils/use-infinite-loader.d.ts.map +1 -0
- package/dist/utils/use-infinite-loader.js +119 -0
- package/dist/utils/use-infinite-loader.js.map +1 -0
- package/dist/utils/use-on-click-outside.d.ts +3 -0
- package/dist/utils/use-on-click-outside.d.ts.map +1 -0
- package/dist/utils/use-on-click-outside.js +36 -0
- package/dist/utils/use-on-click-outside.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-row.js","sourceRoot":"","sources":["../../src/table/render-row.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAQ/C,iFAAiF;AACjF,MAAM,EAAE,QAAQ,EAAE,GAAG,M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,SAAS,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Filters, SortingRule } from 'react-table';
|
|
3
|
+
import { ItemsRenderedPayload } from '../utils/use-infinite-loader';
|
|
4
|
+
import { Action, ActionCol, Actions } from './cells/action-cell';
|
|
5
|
+
import DatetimeCell from './cells/datetime-cell';
|
|
6
|
+
import EditInputCell from './cells/edit-input-cell';
|
|
7
|
+
import EditSelectCell from './cells/edit-select-cell';
|
|
8
|
+
import { TableColumn } from './types';
|
|
9
|
+
/** Predefined cells */
|
|
10
|
+
declare const cells: {
|
|
11
|
+
readonly DATETIME: typeof DatetimeCell;
|
|
12
|
+
readonly EDIT_INPUT: typeof EditInputCell;
|
|
13
|
+
readonly EDIT_SELECT: typeof EditSelectCell;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Handle exposed if attaching a `ref` to the Table
|
|
17
|
+
*/
|
|
18
|
+
export interface TableHandle {
|
|
19
|
+
resetFilters(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Extra properties available on the Table function itself
|
|
23
|
+
*/
|
|
24
|
+
interface TableProperties {
|
|
25
|
+
ActionColumn?: (actions: Array<ActionCol>, accessor?: string, sticky?: string, disableSelectAll?: boolean) => TableColumn;
|
|
26
|
+
Actions?: typeof Actions;
|
|
27
|
+
cells?: typeof cells;
|
|
28
|
+
}
|
|
29
|
+
export interface Props<T extends {
|
|
30
|
+
[k: string]: any;
|
|
31
|
+
}> {
|
|
32
|
+
/** Optional flag to enable or disable column hiding functionality */
|
|
33
|
+
allowHiding?: boolean;
|
|
34
|
+
/** An optional argument to specify the background color of the table either in hex or rgba format */
|
|
35
|
+
backgroundColor?: string;
|
|
36
|
+
/** Standard react className property */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** An array of column definitions, see react-table docs for all options */
|
|
39
|
+
columns: Array<TableColumn>;
|
|
40
|
+
/** An array of data objects, each object should contain the keys defined as accessors in the column defs */
|
|
41
|
+
data?: Array<T>;
|
|
42
|
+
/** An optional function to retrieve an item from a virtualized dataset, use in conjunction with onItemsRendered */
|
|
43
|
+
getItem?: (index: number) => T;
|
|
44
|
+
/** An optional initial sort for the table */
|
|
45
|
+
initialSort?: Array<SortingRule<string>>;
|
|
46
|
+
/** The total number of items in the table, required when using the infinite loader */
|
|
47
|
+
itemCount?: number;
|
|
48
|
+
/** The maximum number of rows to display, useful when table is not in a flexed container */
|
|
49
|
+
maxRows?: number;
|
|
50
|
+
/** An optional handler for listening to any action buttons */
|
|
51
|
+
onAction?: (actionId: string, input: any) => void | Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* An optional onChange handler for listening to any changes from edit cells, the handler is called with the new
|
|
54
|
+
* value, the rowIdx and the column id passed in as accessor. The Table component will not try and update the data
|
|
55
|
+
* it has, it's up to the consuming component to apply the update and pass data in again.
|
|
56
|
+
*/
|
|
57
|
+
onChange?: (value: any, rowIdx: number, colId: string) => void | Promise<void>;
|
|
58
|
+
/** An optional handler for listening to a click on a row, will pass the callback the row that was clicked */
|
|
59
|
+
onClickRow?: (row: T) => void | Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* An optional onFilter handler, can be used to draw filtering logic up into the parent component, rather than being
|
|
62
|
+
* done in the table itself
|
|
63
|
+
*/
|
|
64
|
+
onFilter?: (filters: Filters<any>) => Promise<void>;
|
|
65
|
+
/** An optional handler for triggering the infinite loader to fetch more data, use alongside getItem */
|
|
66
|
+
onItemsRendered?: (payload: ItemsRenderedPayload) => Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* An optional onSort handler, can be used to draw sorting logic up into the parent component, rather than being
|
|
69
|
+
* done in the table itself
|
|
70
|
+
*/
|
|
71
|
+
onSort?: (sort: Array<SortingRule<string>>) => void | Promise<void>;
|
|
72
|
+
/** Optional flag to control whether or not to show additional table options */
|
|
73
|
+
showTableOptions?: boolean;
|
|
74
|
+
/** Pass through of the style prop to the root component */
|
|
75
|
+
style?: React.CSSProperties;
|
|
76
|
+
/** Pass through of the style prop to the table options Dropdown */
|
|
77
|
+
tableOptionsStyle?: React.CSSProperties;
|
|
78
|
+
}
|
|
79
|
+
type TableType = React.ForwardRefExoticComponent<Props<{
|
|
80
|
+
[k: string]: any;
|
|
81
|
+
}> & React.RefAttributes<TableHandle>> & TableProperties;
|
|
82
|
+
/**
|
|
83
|
+
* The Table component builds on top of the thirdparty react-table library and aims to provide a simple outward facing
|
|
84
|
+
* api. A table can be completely defined by passing in an array of columns and an array of data. The columns
|
|
85
|
+
* definitions are the same as that of ReactTable and the data can be any JSON like data. For more info on column
|
|
86
|
+
* definitions check the react table docs and examples:
|
|
87
|
+
*
|
|
88
|
+
* https://react-table.tanstack.com/docs/quick-start
|
|
89
|
+
*
|
|
90
|
+
* @param props - the component props
|
|
91
|
+
*/
|
|
92
|
+
declare const Table: TableType;
|
|
93
|
+
export { Action as TableAction };
|
|
94
|
+
export default Table;
|
|
95
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEH,OAAO,EAEP,WAAW,EAMd,MAAM,aAAa,CAAC;AAYrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAc,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AAKtD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiOtC,uBAAuB;AACvB,QAAA,MAAM,KAAK;;;;CAID,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,YAAY,IAAI,IA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OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,6GAA6G;IAC7G,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,uGAAuG;IACvG,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3C;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,GAC5G,eAAe,CAAC;AAoCpB;;;;;;;;;GASG;AACH,QAAA,MAAM,KAAK,EA0SN,SAAS,CAAC;AAoCf,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,CAAC;AACjC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { createElement as _createElement } from "react";
|
|
14
|
+
/**
|
|
15
|
+
* Copyright 2023 Impulse Innovations Limited
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this file except in compliance with the License.
|
|
20
|
+
* You may obtain a copy of the License at
|
|
21
|
+
*
|
|
22
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
25
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
|
+
* See the License for the specific language governing permissions and
|
|
28
|
+
* limitations under the License.
|
|
29
|
+
*/
|
|
30
|
+
import { faCircleQuestion } from '@fortawesome/free-regular-svg-icons';
|
|
31
|
+
import { faArrowDown, faArrowUp } from '@fortawesome/free-solid-svg-icons';
|
|
32
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
33
|
+
import memoize from 'memoize-one';
|
|
34
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
35
|
+
import { useFilters, useFlexLayout, useResizeColumns, useSortBy, useTable, } from 'react-table';
|
|
36
|
+
import { useSticky } from 'react-table-sticky';
|
|
37
|
+
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
38
|
+
import { FixedSizeList } from 'react-window';
|
|
39
|
+
import styled from '@darajs/styled-components';
|
|
40
|
+
import { useDeepCompare, useThrottle, useThrottledState } from '@darajs/ui-utils';
|
|
41
|
+
import CategoricalFilter from '../filter/categorical-filter';
|
|
42
|
+
import DatetimeFilter from '../filter/datetime-filter';
|
|
43
|
+
import NumericFilter from '../filter/numeric-filter';
|
|
44
|
+
import Tooltip from '../tooltip/tooltip';
|
|
45
|
+
import { Action, ActionCell, Actions } from './cells/action-cell';
|
|
46
|
+
import DatetimeCell from './cells/datetime-cell';
|
|
47
|
+
import EditInputCell from './cells/edit-input-cell';
|
|
48
|
+
import EditSelectCell from './cells/edit-select-cell';
|
|
49
|
+
import { FilterContainer, HeaderIconWrapper, TextFilter, categorical, datetime, numeric } from './filters';
|
|
50
|
+
import SelectHeader from './headers/select-header';
|
|
51
|
+
import OptionsMenu from './options-menu';
|
|
52
|
+
import RenderRow, { ROW_HEIGHT, shouldForwardProp } from './render-row';
|
|
53
|
+
const Wrapper = styled.div `
|
|
54
|
+
display: inline-block;
|
|
55
|
+
width: 100%;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
padding: 1rem;
|
|
58
|
+
|
|
59
|
+
${(props) => !props.$hasMaxRows && `flex: 1 1 auto;`}
|
|
60
|
+
&.sticky {
|
|
61
|
+
[data-sticky-td] {
|
|
62
|
+
position: sticky;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-sticky-last-left-td] {
|
|
66
|
+
box-shadow: 4px 0 4px -3px ${(props) => props.theme.colors.shadowMedium};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-sticky-first-right-td] {
|
|
70
|
+
box-shadow: -4px 0 4px -3px ${(props) => props.theme.colors.shadowMedium};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
const StyledFixedSizeList = styled(FixedSizeList) `
|
|
75
|
+
/* this adds a fixed box shadow underneath the header */
|
|
76
|
+
::before {
|
|
77
|
+
content: '';
|
|
78
|
+
|
|
79
|
+
position: sticky;
|
|
80
|
+
z-index: 5;
|
|
81
|
+
inset: calc(2.5rem - 2px) 0 0 0;
|
|
82
|
+
|
|
83
|
+
display: block;
|
|
84
|
+
|
|
85
|
+
height: 1px;
|
|
86
|
+
|
|
87
|
+
box-shadow: 0 3px 3px ${(props) => props.theme.colors.shadowLight};
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
const Header = styled.div `
|
|
91
|
+
position: sticky;
|
|
92
|
+
z-index: 4;
|
|
93
|
+
top: 0;
|
|
94
|
+
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
|
|
97
|
+
width: fit-content;
|
|
98
|
+
min-width: 80px;
|
|
99
|
+
|
|
100
|
+
/* needed as before box shadow pushes this dows by 1px */
|
|
101
|
+
margin-top: -1px;
|
|
102
|
+
`;
|
|
103
|
+
const HeaderRow = styled.div `
|
|
104
|
+
display: flex;
|
|
105
|
+
`;
|
|
106
|
+
const HeaderCell = styled.div `
|
|
107
|
+
user-select: none;
|
|
108
|
+
|
|
109
|
+
display: flex !important;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
|
|
113
|
+
min-width: 80px;
|
|
114
|
+
height: ${ROW_HEIGHT}px;
|
|
115
|
+
|
|
116
|
+
color: ${(props) => props.theme.colors.text};
|
|
117
|
+
|
|
118
|
+
background-color: ${(props) => props.theme.colors.blue3};
|
|
119
|
+
|
|
120
|
+
:not(:last-child) {
|
|
121
|
+
border-right: 1px solid ${(props) => props.theme.colors.background};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:hover {
|
|
125
|
+
/* stylelint-disable-next-line -- hard-coded classname */
|
|
126
|
+
.tableSortArrow {
|
|
127
|
+
color: ${(props) => props.theme.colors.grey3};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
const HeaderContentWrapper = styled.span `
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
flex: 1 1 auto;
|
|
134
|
+
|
|
135
|
+
padding-left: ${(props) => (props.isPrimitiveHeader ? '1rem' : undefined)};
|
|
136
|
+
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
`;
|
|
140
|
+
const HeaderTooltipContainer = styled.div `
|
|
141
|
+
display: flex;
|
|
142
|
+
gap: 0.5rem;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
|
|
146
|
+
width: ${(props) => (props.isPrimitiveHeader ? undefined : '100%')};
|
|
147
|
+
max-width: ${(props) => (props.isPrimitiveHeader ? 'calc(100% - 3rem)' : undefined)};
|
|
148
|
+
`;
|
|
149
|
+
const HeaderCellButtonContainer = styled.div `
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: row;
|
|
152
|
+
height: 100%;
|
|
153
|
+
`;
|
|
154
|
+
const HeaderIconsWrapper = styled.div `
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: space-between;
|
|
158
|
+
justify-self: flex-end;
|
|
159
|
+
`;
|
|
160
|
+
const ResizeBorder = styled.div `
|
|
161
|
+
/* prevents from scrolling while dragging on touch devices */
|
|
162
|
+
touch-action: none;
|
|
163
|
+
width: 10px;
|
|
164
|
+
height: 100%;
|
|
165
|
+
`;
|
|
166
|
+
const SortIcon = styled(FontAwesomeIcon).withConfig({ shouldForwardProp }) `
|
|
167
|
+
color: ${(props) => (props.isSorted ? props.theme.colors.grey3 : props.theme.colors.blue3)};
|
|
168
|
+
`;
|
|
169
|
+
const TooltipIcon = styled(FontAwesomeIcon) `
|
|
170
|
+
color: ${(props) => props.theme.colors.grey4};
|
|
171
|
+
`;
|
|
172
|
+
/**
|
|
173
|
+
* A helper function to get the correct icon for the current column sort
|
|
174
|
+
*
|
|
175
|
+
* @param isSorted - whether the column is sorted or not
|
|
176
|
+
* @param isSortedDesc - whether it is sorted in descending order
|
|
177
|
+
*/
|
|
178
|
+
const getSortIcon = (isSorted, isSortedDesc) => {
|
|
179
|
+
if (!isSorted) {
|
|
180
|
+
return faArrowUp;
|
|
181
|
+
}
|
|
182
|
+
return isSortedDesc ? faArrowDown : faArrowUp;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Quick helper for remapping the sortId of a column to what the backend is expecting. Useful when the parser has
|
|
186
|
+
* remapped they keys or structure of the object
|
|
187
|
+
*
|
|
188
|
+
* @param sortBy the sortBy from the react table state
|
|
189
|
+
* @param columns the tables passed to the column
|
|
190
|
+
*/
|
|
191
|
+
const getSortKey = (sortBy, columns) => {
|
|
192
|
+
return sortBy.map((sort) => {
|
|
193
|
+
var _a;
|
|
194
|
+
return (Object.assign(Object.assign({}, sort), { id: ((_a = columns.find((col) => col.accessor === sort.id)) === null || _a === void 0 ? void 0 : _a.sortKey) || sort.id }));
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Quick helper for reordering the columns to have the left sticky columns first and the right sticky columns
|
|
199
|
+
* in the end.
|
|
200
|
+
*
|
|
201
|
+
* @param columns the columns from the component props
|
|
202
|
+
*/
|
|
203
|
+
const orderStickyCols = (columns) => {
|
|
204
|
+
const leftStickyCols = [];
|
|
205
|
+
const nonStickyCols = [];
|
|
206
|
+
const rightStickyCols = [];
|
|
207
|
+
columns.forEach((col) => {
|
|
208
|
+
if (col.sticky === 'left') {
|
|
209
|
+
leftStickyCols.push(col);
|
|
210
|
+
}
|
|
211
|
+
else if (col.sticky === 'right') {
|
|
212
|
+
rightStickyCols.push(col);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
nonStickyCols.push(col);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return [...leftStickyCols, ...nonStickyCols, ...rightStickyCols];
|
|
219
|
+
};
|
|
220
|
+
// Map of filter name -> filter component
|
|
221
|
+
const filterComponentMap = {
|
|
222
|
+
categorical: CategoricalFilter,
|
|
223
|
+
datetime: DatetimeFilter,
|
|
224
|
+
numeric: NumericFilter,
|
|
225
|
+
text: TextFilter,
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Helper to append correct filter components to columns based on the filter function chosen
|
|
229
|
+
*
|
|
230
|
+
* @param columns columns to append components to;
|
|
231
|
+
*/
|
|
232
|
+
const appendFilterComponents = (columns) => {
|
|
233
|
+
return columns.map((col) => {
|
|
234
|
+
if (!col.filter) {
|
|
235
|
+
return col;
|
|
236
|
+
}
|
|
237
|
+
if (!(col.filter in filterComponentMap)) {
|
|
238
|
+
throw new Error(`Invalid filter ${col.filter} encountered in column ${col.id}, only ${Object.keys(filterComponentMap).join(',')} are supported`);
|
|
239
|
+
}
|
|
240
|
+
return Object.assign(Object.assign({}, col), { Filter: filterComponentMap[col.filter] });
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
/** Predefined cells */
|
|
244
|
+
const cells = {
|
|
245
|
+
DATETIME: DatetimeCell,
|
|
246
|
+
EDIT_INPUT: EditInputCell,
|
|
247
|
+
EDIT_SELECT: EditSelectCell,
|
|
248
|
+
};
|
|
249
|
+
// This helper function memoizes incoming props,
|
|
250
|
+
// To avoid causing unnecessary re-renders pure Row components.
|
|
251
|
+
const createItemData = memoize((width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns) => ({
|
|
252
|
+
backgroundColor,
|
|
253
|
+
currentEditCell,
|
|
254
|
+
getItem,
|
|
255
|
+
headerGroups,
|
|
256
|
+
mappedColumns,
|
|
257
|
+
onClickRow,
|
|
258
|
+
prepareRow,
|
|
259
|
+
rows,
|
|
260
|
+
throttledClickRow,
|
|
261
|
+
totalColumnsWidth,
|
|
262
|
+
width,
|
|
263
|
+
}));
|
|
264
|
+
/**
|
|
265
|
+
* The Table component builds on top of the thirdparty react-table library and aims to provide a simple outward facing
|
|
266
|
+
* api. A table can be completely defined by passing in an array of columns and an array of data. The columns
|
|
267
|
+
* definitions are the same as that of ReactTable and the data can be any JSON like data. For more info on column
|
|
268
|
+
* definitions check the react table docs and examples:
|
|
269
|
+
*
|
|
270
|
+
* https://react-table.tanstack.com/docs/quick-start
|
|
271
|
+
*
|
|
272
|
+
* @param props - the component props
|
|
273
|
+
*/
|
|
274
|
+
const Table = forwardRef(({ allowHiding, backgroundColor, className, columns, data, getItem, initialSort = [], itemCount, maxRows, onAction, onChange, onClickRow, onItemsRendered, onFilter, onSort, showTableOptions, style, tableOptionsStyle, }, ref) => {
|
|
275
|
+
// This state helps in retaining the current sorted column even if the data gets updated
|
|
276
|
+
const [currentSortBy, setCurrentSortBy] = useState(initialSort);
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
setCurrentSortBy(initialSort);
|
|
279
|
+
},
|
|
280
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
+
useDeepCompare([initialSort]));
|
|
282
|
+
if (!data && !getItem) {
|
|
283
|
+
throw new Error('One of data and getItem must be passed to the table component');
|
|
284
|
+
}
|
|
285
|
+
if (getItem && (!onItemsRendered || !Number.isFinite(itemCount))) {
|
|
286
|
+
throw new Error('itemCount and onItemsRendered must also be passed when using the table in infinite mode');
|
|
287
|
+
}
|
|
288
|
+
const [currentEditCell, throttledSetEditCell, immediateSetEditCell] = useThrottledState(undefined, 500);
|
|
289
|
+
// ClickRow is throttled so multiple or double clicks don't fire multiple events
|
|
290
|
+
const throttledClickRow = useThrottle(onClickRow, 500);
|
|
291
|
+
const onStopEdit = () => {
|
|
292
|
+
throttledSetEditCell(undefined);
|
|
293
|
+
};
|
|
294
|
+
const onStartEdit = (e) => {
|
|
295
|
+
var _a, _b;
|
|
296
|
+
const cell = (_b = (_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.getAttribute('data-cell')) === null || _b === void 0 ? void 0 : _b.split(',');
|
|
297
|
+
if (!cell || (cell === null || cell === void 0 ? void 0 : cell.length) !== 2) {
|
|
298
|
+
throttledSetEditCell(undefined);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
// This pattern lets clicking on a new cell be instant, but then calls the throttled version as well to
|
|
302
|
+
// overwrite any blur calls that are pending. This allows the blur throttle to be longer without making the UI
|
|
303
|
+
// feel sluggish, which makes the blur much less likely to overwrite the current edit cell.
|
|
304
|
+
immediateSetEditCell([Number(cell[0]), cell[1]]);
|
|
305
|
+
throttledSetEditCell([Number(cell[0]), cell[1]]);
|
|
306
|
+
};
|
|
307
|
+
// If the component is in infinite mode, then the table needs an array of data to work with
|
|
308
|
+
const infiniteData = useMemo(() => Array(itemCount).fill(0), [itemCount]);
|
|
309
|
+
/**
|
|
310
|
+
* Columns with transformations applied:
|
|
311
|
+
* - re-ordered using sticky - to have left sticky columns first and right sticky columns in the end
|
|
312
|
+
* - filter components appended based on filter chosen
|
|
313
|
+
*/
|
|
314
|
+
const mappedColumns = useMemo(() => appendFilterComponents(orderStickyCols(columns)), [columns]);
|
|
315
|
+
// Check if the table has fixed columns, then only apply sticky hooks and classes based on this
|
|
316
|
+
const hasFixedColumns = useMemo(() => mappedColumns.some((column) => 'sticky' in column), [mappedColumns]);
|
|
317
|
+
// Calculate table column manually here in case it's passed in with px, useTable version goes to NaN
|
|
318
|
+
const totalColumnsWidth = useMemo(() => mappedColumns.reduce((acc, column) => acc + (parseInt(column.width) || 150), 0), [mappedColumns]);
|
|
319
|
+
// Available filters (in addition to the default 'text' filter)
|
|
320
|
+
const filterTypes = useMemo(() => ({
|
|
321
|
+
categorical,
|
|
322
|
+
datetime,
|
|
323
|
+
numeric,
|
|
324
|
+
}), []);
|
|
325
|
+
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, state: { sortBy, filters }, setAllFilters, resetResizing, allColumns, } = useTable({
|
|
326
|
+
columns: mappedColumns,
|
|
327
|
+
data: data || infiniteData,
|
|
328
|
+
filterTypes,
|
|
329
|
+
initialState: {
|
|
330
|
+
sortBy: currentSortBy.map((sort) => (Object.assign(Object.assign({}, sort), { id: mappedColumns.find((col) => [col.sortKey, col.accessor].includes(sort.id)).accessor }))),
|
|
331
|
+
},
|
|
332
|
+
// In infinite mode, don't filter client-side
|
|
333
|
+
manualFilters: !data,
|
|
334
|
+
manualSortBy: !!onSort,
|
|
335
|
+
onAction,
|
|
336
|
+
onChange,
|
|
337
|
+
onStartEdit,
|
|
338
|
+
onStopEdit,
|
|
339
|
+
}, useFilters, useFlexLayout, useSortBy, useResizeColumns, ...(hasFixedColumns ? [useSticky] : []));
|
|
340
|
+
useImperativeHandle(ref, () => ({
|
|
341
|
+
resetFilters() {
|
|
342
|
+
setAllFilters([]);
|
|
343
|
+
},
|
|
344
|
+
}));
|
|
345
|
+
// If onSort is passed then delegate sorting to parent component
|
|
346
|
+
useEffect(() => {
|
|
347
|
+
if (onSort) {
|
|
348
|
+
onSort(getSortKey(sortBy, mappedColumns));
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
setCurrentSortBy(sortBy);
|
|
352
|
+
}
|
|
353
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
354
|
+
}, [onSort, sortBy]);
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
if (onFilter) {
|
|
357
|
+
onFilter(filters);
|
|
358
|
+
}
|
|
359
|
+
}, [onFilter, filters]);
|
|
360
|
+
const tableProps = getTableBodyProps();
|
|
361
|
+
const renderTable = useCallback((_a) => {
|
|
362
|
+
var { children, style: tableStyle } = _a, rest = __rest(_a, ["children", "style"]);
|
|
363
|
+
return (_jsxs("div", { children: [_jsx(Header, { style: { width: `max(${totalColumnsWidth}px, 100%)` }, children: headerGroups.map((headerGroup, gidx) => (_createElement(HeaderRow, Object.assign({}, headerGroup.getHeaderGroupProps(), { key: `group-${gidx}` }), headerGroup.headers.map((col, cidx) => {
|
|
364
|
+
const headerProps = col.getHeaderProps();
|
|
365
|
+
const sortProps = col.getSortByToggleProps();
|
|
366
|
+
const headerContent = col.render('Header');
|
|
367
|
+
const resizerProps = col.getResizerProps();
|
|
368
|
+
const numVisibleColumns = allColumns.filter((column) => column.isVisible).length;
|
|
369
|
+
const showSort = !col.disableSortBy;
|
|
370
|
+
const showFilter = col.canFilter && col.filter;
|
|
371
|
+
const showOptions = cidx === numVisibleColumns - 1 && showTableOptions;
|
|
372
|
+
const showHeaderCellButtonContainer = showSort || showFilter || showOptions;
|
|
373
|
+
return (_createElement(HeaderCell, Object.assign({}, headerProps, { key: `col-${gidx}-${cidx}`, style: Object.assign(Object.assign({}, headerProps.style), { maxWidth: col.maxWidth,
|
|
374
|
+
// If width calc has messed up then use the raw width from the column
|
|
375
|
+
width: headerProps.style.width === 'NaNpx' ?
|
|
376
|
+
mappedColumns[cidx].width
|
|
377
|
+
: headerProps.style.width }) }),
|
|
378
|
+
_jsxs(HeaderTooltipContainer, { isPrimitiveHeader: typeof headerContent === 'string', children: [_jsx(HeaderContentWrapper, Object.assign({}, sortProps, { isPrimitiveHeader: typeof headerContent === 'string', title: typeof headerContent === 'string' ? headerContent : '', children: headerContent })), col.tooltip && (_jsx(Tooltip, { content: col.tooltip, children: _jsx(TooltipIcon, { icon: faCircleQuestion }) }))] }),
|
|
379
|
+
showHeaderCellButtonContainer && (_jsxs(HeaderCellButtonContainer, { children: [_jsxs(HeaderIconsWrapper, { children: [showSort && (_jsx(HeaderIconWrapper, { children: _jsx(SortIcon, Object.assign({}, sortProps, { className: "tableSortArrow", icon: getSortIcon(col.isSorted, col.isSortedDesc), isSorted: col.isSorted })) })), showFilter ?
|
|
380
|
+
_jsx(FilterContainer, { col: col })
|
|
381
|
+
: null, showOptions && (_jsx(OptionsMenu, { allColumns: allColumns, allowColumnHiding: allowHiding, numVisibleColumns: numVisibleColumns, resetResizing: resetResizing, setAllFilters: setAllFilters, style: tableOptionsStyle }))] }), _jsx(ResizeBorder, Object.assign({}, resizerProps))] }))));
|
|
382
|
+
})))) }), _createElement("div", Object.assign({}, tableProps, rest, { key: "table-body-inner", style: tableStyle }), children)] }, "table-inner"));
|
|
383
|
+
},
|
|
384
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
385
|
+
useDeepCompare([tableProps, totalColumnsWidth, headerGroups]));
|
|
386
|
+
return (_jsx(Wrapper, Object.assign({}, getTableProps(), { "$hasMaxRows": !!maxRows, className: `${className} ${hasFixedColumns ? 'sticky' : ''}`, style: Object.assign({ height: maxRows ? (Math.min(rows.length, maxRows) + 1) * ROW_HEIGHT : '100%' }, style), children: _jsx(AutoSizer, { children: ({ height, width }) => {
|
|
387
|
+
return (_jsx(StyledFixedSizeList, { height: height, innerElementType: renderTable, itemCount: itemCount || rows.length, itemData: createItemData(width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns), itemSize: ROW_HEIGHT, onItemsRendered: onItemsRendered, style: {
|
|
388
|
+
overflowX: width < totalColumnsWidth ? 'auto' : 'hidden',
|
|
389
|
+
overflowY: height < (rows.length + 1) * ROW_HEIGHT ? 'auto' : 'hidden',
|
|
390
|
+
}, width: width, children: RenderRow }, "table-list"));
|
|
391
|
+
} }) })));
|
|
392
|
+
});
|
|
393
|
+
Table.displayName = 'Table';
|
|
394
|
+
/**
|
|
395
|
+
* A pre-made action column, just pass a list of actions to add them as a column, optional accessor property if you want
|
|
396
|
+
* multiple action columns on a single table
|
|
397
|
+
*
|
|
398
|
+
* @param actions: An array of actions to be added to this column
|
|
399
|
+
* @param accessor: Optional parameter to define a unique accessor property if you have multiple action columns
|
|
400
|
+
* @param sticky: Optional param to sticky the action column to left or right
|
|
401
|
+
* @param disableSelectAll: optional parameter to exclude the select-all header even if SELECT action is added
|
|
402
|
+
*/
|
|
403
|
+
Table.ActionColumn = (actions, accessor, sticky, disableSelectAll = false) => {
|
|
404
|
+
// 24 for width of each action and 12 padding either side
|
|
405
|
+
const width = actions.includes(Actions.SELECT) ? 52 : actions.length * 24 + 24;
|
|
406
|
+
return {
|
|
407
|
+
Cell: ActionCell,
|
|
408
|
+
Header: actions.includes(Actions.SELECT) && !disableSelectAll ? SelectHeader : '',
|
|
409
|
+
accessor: accessor || 'actions',
|
|
410
|
+
actions,
|
|
411
|
+
disableSortBy: true,
|
|
412
|
+
maxWidth: width,
|
|
413
|
+
minWidth: actions.includes(Actions.SELECT) ? 52 : 48,
|
|
414
|
+
sticky: sticky || null,
|
|
415
|
+
width,
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
Table.Actions = Actions;
|
|
419
|
+
Table.cells = cells;
|
|
420
|
+
export { Action as TableAction };
|
|
421
|
+
export default Table;
|
|
422
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table/table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,EAKH,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,QAAQ,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,SAAS,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAElF,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,OAAO,MAAM,oBAAoB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C,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/E,OAAO;QACH,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;QACjF,QAAQ,EAAE,QAAQ,IAAI,SAAS;QAC/B,OAAO;QACP,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACpD,MAAM,EAAE,MAAM,IAAI,IAAI;QACtB,KAAK;KACR,CAAC;AACN,CAAC,CAAC;AACF,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;AAEpB,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,CAAC;AACjC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { ColumnInterface, Renderer } from 'react-table';
|
|
18
|
+
import { ActionCol } from './cells/action-cell';
|
|
19
|
+
export interface TableColumn extends ColumnInterface<object> {
|
|
20
|
+
Cell?: Renderer<any>;
|
|
21
|
+
Header?: Renderer<any>;
|
|
22
|
+
accessor: string;
|
|
23
|
+
actions?: Array<ActionCol>;
|
|
24
|
+
align?: string;
|
|
25
|
+
filter?: 'text' | 'categorical' | 'numeric' | 'datetime';
|
|
26
|
+
sortKey?: string;
|
|
27
|
+
sticky?: string;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/table/types.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,MAAM,WAAW,WAAY,SAAQ,eAAe,CAAC,MAAM,CAAC;IAGxD,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/table/types.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TabInterface {
|
|
2
|
+
title: any;
|
|
3
|
+
}
|
|
4
|
+
export interface TabsProps<T> {
|
|
5
|
+
/** Standard react className property */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** An optional handler to notify the parent when the selected tab changes */
|
|
8
|
+
onSelectTab?: (tab: T | TabInterface | string) => void | Promise<void>;
|
|
9
|
+
/** The selected tab, defaults to the first one */
|
|
10
|
+
selectedTab?: T;
|
|
11
|
+
/** A list of tab strings to display */
|
|
12
|
+
tabs: Array<T>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A simple Tabs component that renders a set of tabs and manages which one is currently selected. Accepts an
|
|
16
|
+
* onSelectTab handler to notify the parent component when the selected tab changes
|
|
17
|
+
*
|
|
18
|
+
* @param {TabsProps} props - the component props
|
|
19
|
+
*/
|
|
20
|
+
declare function Tabs<T>({ className, onSelectTab, selectedTab, tabs }: TabsProps<T>): JSX.Element;
|
|
21
|
+
export default Tabs;
|
|
22
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/tabs/tabs.tsx"],"names":[],"mappings":"AA+EA,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,GAAG,CAAC;CACd;AAMD,MAAM,WAAW,SAAS,CAAC,CAAC;IACxB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,YAAY,GAAG,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,kDAAkD;IAClD,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CAClB;AAED;;;;;GAKG;AACH,iBAAS,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAqBzF;AAED,eAAe,IAAI,CAAC"}
|