@boarteam/boar-pack-common-frontend 3.4.0 → 4.1.0
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/dist/components/ChangesModal/ChangesModal.d.ts +37 -0
- package/dist/components/ChangesModal/ChangesModal.js +143 -0
- package/dist/components/ChangesModal/ChangesModal.js.map +1 -0
- package/dist/components/ChangesModal/ChangesTab.d.ts +7 -0
- package/dist/components/ChangesModal/ChangesTab.js +29 -0
- package/dist/components/ChangesModal/ChangesTab.js.map +1 -0
- package/dist/components/ChangesModal/ConflictsTab.d.ts +10 -0
- package/dist/components/ChangesModal/ConflictsTab.js +105 -0
- package/dist/components/ChangesModal/ConflictsTab.js.map +1 -0
- package/dist/components/ChangesModal/ErrorsTab.d.ts +5 -0
- package/dist/components/ChangesModal/ErrorsTab.js +27 -0
- package/dist/components/ChangesModal/ErrorsTab.js.map +1 -0
- package/dist/components/ChangesModal/NewRecordsTab.d.ts +12 -0
- package/dist/components/ChangesModal/NewRecordsTab.js +24 -0
- package/dist/components/ChangesModal/NewRecordsTab.js.map +1 -0
- package/dist/components/ChangesModal/ResultsTab.d.ts +8 -0
- package/dist/components/ChangesModal/ResultsTab.js +12 -0
- package/dist/components/ChangesModal/ResultsTab.js.map +1 -0
- package/dist/components/ChangesModal/index.d.ts +1 -0
- package/dist/components/ChangesModal/index.js +5 -0
- package/dist/components/ChangesModal/index.js.map +1 -0
- package/dist/components/Comment/Comment.d.ts +12 -0
- package/dist/components/Comment/Comment.js +25 -0
- package/dist/components/Comment/Comment.js.map +1 -0
- package/dist/components/Comment/CommentAvatar.d.ts +7 -0
- package/dist/components/Comment/CommentAvatar.js +22 -0
- package/dist/components/Comment/CommentAvatar.js.map +1 -0
- package/dist/components/Comment/CommentForm.d.ts +6 -0
- package/dist/components/Comment/CommentForm.js +17 -0
- package/dist/components/Comment/CommentForm.js.map +1 -0
- package/dist/components/Comment/CommentFormModal.d.ts +10 -0
- package/dist/components/Comment/CommentFormModal.js +13 -0
- package/dist/components/Comment/CommentFormModal.js.map +1 -0
- package/dist/components/Comment/index.js +11 -0
- package/dist/components/Comment/index.js.map +1 -0
- package/dist/components/Descriptions/Descriptions.d.ts +4 -0
- package/dist/components/Descriptions/Descriptions.js +218 -0
- package/dist/components/Descriptions/Descriptions.js.map +1 -0
- package/dist/components/Descriptions/DescriptionsCreateModal.d.ts +3 -0
- package/dist/components/Descriptions/DescriptionsCreateModal.js +30 -0
- package/dist/components/Descriptions/DescriptionsCreateModal.js.map +1 -0
- package/dist/components/Descriptions/descriptionTypes.d.ts +68 -0
- package/dist/components/Descriptions/descriptionTypes.js +9 -0
- package/dist/components/Descriptions/descriptionTypes.js.map +1 -0
- package/dist/components/Descriptions/index.js +11 -0
- package/dist/components/Descriptions/index.js.map +1 -0
- package/dist/components/Descriptions/useContentViewMode.d.ts +10 -0
- package/dist/components/Descriptions/useContentViewMode.js +19 -0
- package/dist/components/Descriptions/useContentViewMode.js.map +1 -0
- package/dist/components/Descriptions/useDescriptionColumns.d.ts +8 -0
- package/dist/components/Descriptions/useDescriptionColumns.js +27 -0
- package/dist/components/Descriptions/useDescriptionColumns.js.map +1 -0
- package/dist/components/Inputs/DateRange.d.ts +8 -0
- package/dist/components/Inputs/DateRange.js +61 -0
- package/dist/components/Inputs/DateRange.js.map +1 -0
- package/dist/components/Inputs/MultiStringSelect.d.ts +5 -0
- package/dist/components/Inputs/MultiStringSelect.js +10 -0
- package/dist/components/Inputs/MultiStringSelect.js.map +1 -0
- package/dist/components/Inputs/NumberInputHandlingNewRecord.d.ts +3 -0
- package/dist/components/Inputs/NumberInputHandlingNewRecord.js +11 -0
- package/dist/components/Inputs/NumberInputHandlingNewRecord.js.map +1 -0
- package/dist/components/Inputs/NumberSwitcher.d.ts +8 -0
- package/dist/components/Inputs/NumberSwitcher.js +13 -0
- package/dist/components/Inputs/NumberSwitcher.js.map +1 -0
- package/dist/components/Inputs/Password.d.ts +3 -0
- package/dist/components/Inputs/Password.js +18 -0
- package/dist/components/Inputs/Password.js.map +1 -0
- package/dist/components/Inputs/RelationSelect.d.ts +21 -0
- package/dist/components/Inputs/RelationSelect.js +58 -0
- package/dist/components/Inputs/RelationSelect.js.map +1 -0
- package/dist/components/Inputs/SearchSelect.d.ts +12 -0
- package/dist/components/Inputs/SearchSelect.js +40 -0
- package/dist/components/Inputs/SearchSelect.js.map +1 -0
- package/dist/components/Inputs/filterDropdowns.d.ts +11 -0
- package/dist/components/Inputs/filterDropdowns.js +56 -0
- package/dist/components/Inputs/filterDropdowns.js.map +1 -0
- package/dist/components/Inputs/index.js +13 -0
- package/dist/components/Inputs/index.js.map +1 -0
- package/dist/components/Inputs/useCheckConnection.d.ts +13 -0
- package/dist/components/Inputs/useCheckConnection.js +53 -0
- package/dist/components/Inputs/useCheckConnection.js.map +1 -0
- package/dist/components/List/List.d.ts +3 -0
- package/dist/components/List/List.js +144 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/index.js +9 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/List/listTypes.d.ts +30 -0
- package/dist/components/List/listTypes.js +3 -0
- package/dist/components/List/listTypes.js.map +1 -0
- package/dist/components/QuestionMarkHint/QuestionMarkHint.d.ts +7 -0
- package/dist/components/QuestionMarkHint/QuestionMarkHint.js +16 -0
- package/dist/components/QuestionMarkHint/QuestionMarkHint.js.map +1 -0
- package/dist/components/QuestionMarkHint/index.js +5 -0
- package/dist/components/QuestionMarkHint/index.js.map +1 -0
- package/dist/components/Table/BulkDeleteButton.d.ts +8 -0
- package/dist/components/Table/BulkDeleteButton.js +27 -0
- package/dist/components/Table/BulkDeleteButton.js.map +1 -0
- package/dist/components/Table/BulkEditButton.d.ts +11 -0
- package/dist/components/Table/BulkEditButton.js +66 -0
- package/dist/components/Table/BulkEditButton.js.map +1 -0
- package/dist/components/Table/CreateEntityModal.d.ts +25 -0
- package/dist/components/Table/CreateEntityModal.js +23 -0
- package/dist/components/Table/CreateEntityModal.js.map +1 -0
- package/dist/components/Table/DeleteButton.d.ts +4 -0
- package/dist/components/Table/DeleteButton.js +28 -0
- package/dist/components/Table/DeleteButton.js.map +1 -0
- package/dist/components/Table/Table.d.ts +6 -0
- package/dist/components/Table/Table.js +154 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/getTableDataQueryParams.d.ts +15 -0
- package/dist/components/Table/getTableDataQueryParams.js +37 -0
- package/dist/components/Table/getTableDataQueryParams.js.map +1 -0
- package/{src/components/Table/index.ts → dist/components/Table/index.d.ts} +1 -1
- package/dist/components/Table/index.js +14 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Table/tableTools.d.ts +38 -0
- package/dist/components/Table/tableTools.js +185 -0
- package/dist/components/Table/tableTools.js.map +1 -0
- package/dist/components/Table/tableTypes.d.ts +145 -0
- package/dist/components/Table/tableTypes.js +3 -0
- package/dist/components/Table/tableTypes.js.map +1 -0
- package/dist/components/Table/useBulkEditing.d.ts +30 -0
- package/dist/components/Table/useBulkEditing.js +79 -0
- package/dist/components/Table/useBulkEditing.js.map +1 -0
- package/dist/components/Table/useColumnsSets.d.ts +22 -0
- package/dist/components/Table/useColumnsSets.js +82 -0
- package/dist/components/Table/useColumnsSets.js.map +1 -0
- package/dist/components/Table/useCreation.d.ts +21 -0
- package/dist/components/Table/useCreation.js +75 -0
- package/dist/components/Table/useCreation.js.map +1 -0
- package/dist/components/Table/useEditableTable.d.ts +7 -0
- package/dist/components/Table/useEditableTable.js +63 -0
- package/dist/components/Table/useEditableTable.js.map +1 -0
- package/dist/components/Table/useImportExport.d.ts +35 -0
- package/dist/components/Table/useImportExport.js +207 -0
- package/dist/components/Table/useImportExport.js.map +1 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/ApiError.d.ts +16 -0
- package/dist/tools/ApiError.js +13 -0
- package/dist/tools/ApiError.js.map +1 -0
- package/dist/tools/WebsocketClient.d.ts +38 -0
- package/dist/tools/WebsocketClient.js +114 -0
- package/dist/tools/WebsocketClient.js.map +1 -0
- package/{src/tools/index.ts → dist/tools/index.d.ts} +1 -1
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/numberTools.d.ts +1 -0
- package/dist/tools/numberTools.js +10 -0
- package/dist/tools/numberTools.js.map +1 -0
- package/dist/tools/safetyRun.d.ts +2 -0
- package/dist/tools/safetyRun.js +10 -0
- package/dist/tools/safetyRun.js.map +1 -0
- package/dist/tools/useFullscreen.d.ts +6 -0
- package/dist/tools/useFullscreen.js +56 -0
- package/dist/tools/useFullscreen.js.map +1 -0
- package/dist/tools/useTabs.d.ts +2 -0
- package/dist/tools/useTabs.js +18 -0
- package/dist/tools/useTabs.js.map +1 -0
- package/package.json +6 -4
- package/src/components/ChangesModal/ChangesModal.tsx +0 -262
- package/src/components/ChangesModal/ChangesTab.tsx +0 -51
- package/src/components/ChangesModal/ConflictsTab.tsx +0 -176
- package/src/components/ChangesModal/ErrorsTab.tsx +0 -49
- package/src/components/ChangesModal/NewRecordsTab.tsx +0 -48
- package/src/components/ChangesModal/ResultsTab.tsx +0 -28
- package/src/components/ChangesModal/index.ts +0 -1
- package/src/components/Comment/Comment.tsx +0 -53
- package/src/components/Comment/CommentAvatar.tsx +0 -34
- package/src/components/Comment/CommentForm.tsx +0 -36
- package/src/components/Comment/CommentFormModal.tsx +0 -31
- package/src/components/Descriptions/Descriptions.tsx +0 -351
- package/src/components/Descriptions/DescriptionsCreateModal.tsx +0 -65
- package/src/components/Descriptions/descriptionTypes.ts +0 -74
- package/src/components/Descriptions/useContentViewMode.tsx +0 -28
- package/src/components/Descriptions/useDescriptionColumns.ts +0 -42
- package/src/components/Inputs/DateRange.tsx +0 -75
- package/src/components/Inputs/MultiStringSelect.tsx +0 -20
- package/src/components/Inputs/NumberInputHandlingNewRecord.tsx +0 -11
- package/src/components/Inputs/NumberSwitcher.tsx +0 -27
- package/src/components/Inputs/Password.tsx +0 -33
- package/src/components/Inputs/RelationSelect.tsx +0 -108
- package/src/components/Inputs/SearchSelect.tsx +0 -93
- package/src/components/Inputs/filterDropdowns.tsx +0 -141
- package/src/components/Inputs/useCheckConnection.tsx +0 -79
- package/src/components/List/List.tsx +0 -266
- package/src/components/List/listTypes.ts +0 -31
- package/src/components/QuestionMarkHint/QuestionMarkHint.tsx +0 -33
- package/src/components/Table/BulkDeleteButton.tsx +0 -55
- package/src/components/Table/BulkEditButton.tsx +0 -160
- package/src/components/Table/CreateEntityModal.tsx +0 -85
- package/src/components/Table/DeleteButton.tsx +0 -44
- package/src/components/Table/Table.tsx +0 -316
- package/src/components/Table/getTableDataQueryParams.ts +0 -79
- package/src/components/Table/tableTools.ts +0 -244
- package/src/components/Table/tableTypes.ts +0 -152
- package/src/components/Table/useBulkEditing.tsx +0 -128
- package/src/components/Table/useColumnsSets.tsx +0 -142
- package/src/components/Table/useCreation.tsx +0 -114
- package/src/components/Table/useEditableTable.tsx +0 -86
- package/src/components/Table/useImportExport.tsx +0 -312
- package/src/tools/ApiError.ts +0 -18
- package/src/tools/WebsocketClient.ts +0 -138
- package/src/tools/numberTools.ts +0 -6
- package/src/tools/safetyRun.ts +0 -5
- package/src/tools/useFullscreen.tsx +0 -62
- package/src/tools/useTabs.ts +0 -17
- /package/{src/components/Comment/index.ts → dist/components/Comment/index.d.ts} +0 -0
- /package/{src/components/Descriptions/index.ts → dist/components/Descriptions/index.d.ts} +0 -0
- /package/{src/components/Inputs/index.ts → dist/components/Inputs/index.d.ts} +0 -0
- /package/{src/components/List/index.ts → dist/components/List/index.d.ts} +0 -0
- /package/{src/components/QuestionMarkHint/index.ts → dist/components/QuestionMarkHint/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from "react";
|
|
2
|
-
import { ActionType } from "@ant-design/pro-table";
|
|
3
|
-
import { RowEditableConfig } from "@ant-design/pro-utils";
|
|
4
|
-
import { QueryJoin } from "@nestjsx/crud-request";
|
|
5
|
-
import { ProColumns } from "@ant-design/pro-components";
|
|
6
|
-
import { ProDescriptionsProps } from "@ant-design/pro-descriptions";
|
|
7
|
-
import { FieldData } from "rc-field-form/lib/interface";
|
|
8
|
-
import { VIEW_MODE_TYPE } from "./useContentViewMode";
|
|
9
|
-
|
|
10
|
-
export type TGetOneParams = {
|
|
11
|
-
/**
|
|
12
|
-
* Selects resource fields. <a href="https://github.com/nestjsx/crud/wiki/Requests#select" target="_blank">Docs</a>
|
|
13
|
-
*/
|
|
14
|
-
fields?: Array<string>,
|
|
15
|
-
/**
|
|
16
|
-
* Adds relational resources. <a href="https://github.com/nestjsx/crud/wiki/Requests#join" target="_blank">Docs</a>
|
|
17
|
-
*/
|
|
18
|
-
join?: Array<string>,
|
|
19
|
-
/**
|
|
20
|
-
* Reset cache (if was enabled). <a href="https://github.com/nestjsx/crud/wiki/Requests#cache" target="_blank">Docs</a>
|
|
21
|
-
*/
|
|
22
|
-
cache?: number,
|
|
23
|
-
}
|
|
24
|
-
export type TDescriptionGetRequestParams = {
|
|
25
|
-
join?: QueryJoin | QueryJoin[];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type DescriptionsRefType<Entity> = {
|
|
29
|
-
reset: () => void;
|
|
30
|
-
submit: () => void;
|
|
31
|
-
update: () => Promise<any>;
|
|
32
|
-
setFieldErrors: (fields: FieldData<Entity>[]) => void;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export enum FieldsEdit {
|
|
36
|
-
Single = 'single',
|
|
37
|
-
All = 'all'
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export type TDescriptionsProps<Entity, CreateDto, UpdateDto, TPathParams = object> = {
|
|
41
|
-
mainTitle?: ProColumns<Entity>['title'] | null,
|
|
42
|
-
entity?: Partial<Entity>,
|
|
43
|
-
getOne?: ({}: TGetOneParams & TPathParams) => Promise<Entity | null>,
|
|
44
|
-
onUpdate?: ({}: Partial<Entity> & {
|
|
45
|
-
requestBody: UpdateDto,
|
|
46
|
-
index?: number,
|
|
47
|
-
} & TPathParams) => Promise<Entity>,
|
|
48
|
-
onCreate?: (data: Partial<Entity>) => Promise<void>;
|
|
49
|
-
onDelete?: ({}: Partial<Entity> & TPathParams) => Promise<void>,
|
|
50
|
-
pathParams?: TPathParams,
|
|
51
|
-
idColumnName?: string & keyof Entity,
|
|
52
|
-
entityToUpdateDto?: (entity: Entity) => UpdateDto,
|
|
53
|
-
createNewDefaultParams?: Partial<Entity>,
|
|
54
|
-
afterSave?: (record: Entity) => Promise<void>,
|
|
55
|
-
actionRef?: MutableRefObject<ActionType | undefined>,
|
|
56
|
-
editable?: RowEditableConfig<Entity>,
|
|
57
|
-
canEdit?: boolean,
|
|
58
|
-
fieldsEditType?: FieldsEdit,
|
|
59
|
-
params?: TDescriptionGetRequestParams,
|
|
60
|
-
columns: ProColumns<Entity>[],
|
|
61
|
-
onEntityChange?: (entity: Entity | null) => void;
|
|
62
|
-
contentViewMode?: VIEW_MODE_TYPE,
|
|
63
|
-
ref?: React.Ref<DescriptionsRefType<Entity>>,
|
|
64
|
-
} & Omit<ProDescriptionsProps<Entity>, 'columns'>;
|
|
65
|
-
|
|
66
|
-
export type TDescriptionsCreateModalProps<Entity> = Omit<ProDescriptionsProps<Entity>, 'columns'> & {
|
|
67
|
-
modalTitle?: string,
|
|
68
|
-
mainTitle?: ProColumns<Entity>['title'] | null,
|
|
69
|
-
idColumnName: string & keyof Entity | (string & keyof Entity)[],
|
|
70
|
-
columns: ProColumns<Entity>[],
|
|
71
|
-
data: Partial<Entity> | undefined,
|
|
72
|
-
onSubmit: (data: Entity) => Promise<void>,
|
|
73
|
-
onClose: () => void,
|
|
74
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Button, Tooltip } from "antd";
|
|
2
|
-
import { AppstoreOutlined, MenuOutlined } from "@ant-design/icons";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
|
|
5
|
-
export enum VIEW_MODE_TYPE {
|
|
6
|
-
TABS = 'tabs',
|
|
7
|
-
GENERAL = 'general'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default function useContentViewMode({
|
|
11
|
-
mode,
|
|
12
|
-
}: {
|
|
13
|
-
mode?: VIEW_MODE_TYPE;
|
|
14
|
-
} = {}) {
|
|
15
|
-
const [contentViewMode, setContentViewMode] = useState<VIEW_MODE_TYPE>(mode || VIEW_MODE_TYPE.GENERAL);
|
|
16
|
-
|
|
17
|
-
const contentViewModeButton = <Tooltip
|
|
18
|
-
title={contentViewMode === VIEW_MODE_TYPE.TABS ? 'Switch to general view' : 'Switch to tabs view'}
|
|
19
|
-
key="viewModeToggle">
|
|
20
|
-
<Button
|
|
21
|
-
type="text"
|
|
22
|
-
icon={contentViewMode === VIEW_MODE_TYPE.TABS ? <MenuOutlined /> : <AppstoreOutlined />}
|
|
23
|
-
onClick={() => setContentViewMode(contentViewMode === VIEW_MODE_TYPE.TABS ? VIEW_MODE_TYPE.GENERAL : VIEW_MODE_TYPE.TABS)}
|
|
24
|
-
/>
|
|
25
|
-
</Tooltip>;
|
|
26
|
-
|
|
27
|
-
return { contentViewMode, contentViewModeButton };
|
|
28
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ProColumns } from "@ant-design/pro-components";
|
|
2
|
-
import { ProDescriptionsItemProps } from "@ant-design/pro-descriptions";
|
|
3
|
-
|
|
4
|
-
export type TDescriptionSection<T> = {
|
|
5
|
-
title: ProColumns<T>['title'] | null;
|
|
6
|
-
// 'general' is a special value for the main section including only columns without children
|
|
7
|
-
key: string | 'general';
|
|
8
|
-
columns: ProDescriptionsItemProps<T>[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function columnsToDescriptionItemProps<T>(
|
|
12
|
-
columns: ProColumns<T>[],
|
|
13
|
-
mainTitle: ProColumns<T>['title'] | null = null,
|
|
14
|
-
key: string | 'general' = 'general'
|
|
15
|
-
): TDescriptionSection<T>[] {
|
|
16
|
-
const baseSection: TDescriptionSection<T> = {
|
|
17
|
-
title: mainTitle,
|
|
18
|
-
key,
|
|
19
|
-
columns: [],
|
|
20
|
-
}
|
|
21
|
-
const result: TDescriptionSection<T>[] = [baseSection];
|
|
22
|
-
|
|
23
|
-
columns.forEach((column) => {
|
|
24
|
-
if (column.valueType === 'option') {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (column.children) {
|
|
29
|
-
const dataIndex = String(Array.isArray(column.dataIndex) ? column.dataIndex[0] : column.dataIndex);
|
|
30
|
-
result.push(...columnsToDescriptionItemProps(column.children, column.title, dataIndex));
|
|
31
|
-
} else {
|
|
32
|
-
const {
|
|
33
|
-
children,
|
|
34
|
-
...rest
|
|
35
|
-
} = column;
|
|
36
|
-
// @ts-ignore-next-line
|
|
37
|
-
baseSection.columns.push(rest as ProDescriptionsItemProps<T>);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// antd switch but not for boolean, for numbers 0 and 1
|
|
2
|
-
import React from "react";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
import { DatePicker } from "antd";
|
|
5
|
-
|
|
6
|
-
interface RangePickerProps extends Omit<React.ComponentProps<typeof DatePicker.RangePicker>, 'value' | 'onChange'> {
|
|
7
|
-
value? : [string | null, string | null] | null;
|
|
8
|
-
onChange? : (value?: [string | null, string | null] | null) => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const DateRange: React.FC<RangePickerProps> = ({
|
|
12
|
-
value,
|
|
13
|
-
onChange,
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<DatePicker.RangePicker
|
|
18
|
-
showTime={{
|
|
19
|
-
showNow: true,
|
|
20
|
-
showHour: true,
|
|
21
|
-
showMinute: true,
|
|
22
|
-
showSecond: true,
|
|
23
|
-
showMillisecond: true,
|
|
24
|
-
}}
|
|
25
|
-
allowEmpty={[true, true]}
|
|
26
|
-
presets={[
|
|
27
|
-
{
|
|
28
|
-
label: 'Today',
|
|
29
|
-
value: [dayjs().startOf('day'), dayjs().endOf('day')],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'Yesterday',
|
|
33
|
-
value: [dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day')],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: 'Last 15 minutes',
|
|
37
|
-
value: [dayjs().subtract(15, 'minute'), dayjs()],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: 'Last 30 minutes',
|
|
41
|
-
value: [dayjs().subtract(30, 'minute'), dayjs()],
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: 'Last 1 hour',
|
|
45
|
-
value: [dayjs().subtract(1, 'hour'), dayjs()],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: 'Last 24 hours',
|
|
49
|
-
value: [dayjs().subtract(1, 'day'), dayjs()],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: 'Last 7 days',
|
|
53
|
-
value: [dayjs().subtract(7, 'day'), dayjs()],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
label: 'Last 30 days',
|
|
57
|
-
value: [dayjs().subtract(30, 'day'), dayjs()],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: 'This month',
|
|
61
|
-
value: [dayjs().startOf('month'), dayjs().endOf('month')],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: 'Last month',
|
|
65
|
-
value: [dayjs().subtract(1, 'month').startOf('month'), dayjs().subtract(1, 'month').endOf('month')],
|
|
66
|
-
},
|
|
67
|
-
]}
|
|
68
|
-
value={value?.map(date => dayjs(date)) as [dayjs.Dayjs, dayjs.Dayjs] | undefined}
|
|
69
|
-
onChange={(dates) => {
|
|
70
|
-
onChange?.(dates?.map(date => date?.toISOString() ?? null) as [string | null, string | null] | null);
|
|
71
|
-
}}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Select } from "antd";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
export const MultiStringSelect: React.FC<{
|
|
5
|
-
value?: string[];
|
|
6
|
-
onChange?: (value: string[]) => void;
|
|
7
|
-
}> = ({ value, onChange }) => {
|
|
8
|
-
return (
|
|
9
|
-
<Select<string[]>
|
|
10
|
-
dropdownStyle={{ minWidth: 200 }}
|
|
11
|
-
allowClear={true}
|
|
12
|
-
mode="tags"
|
|
13
|
-
style={{ minWidth: 200 }}
|
|
14
|
-
maxTagCount='responsive'
|
|
15
|
-
value={value}
|
|
16
|
-
onChange={onChange}
|
|
17
|
-
notFoundContent='Enter manually'
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { InputNumberProps } from "antd/es/input-number";
|
|
3
|
-
import { InputNumber } from "antd";
|
|
4
|
-
import { isRecordNew } from "../Table";
|
|
5
|
-
|
|
6
|
-
export const NumberInputHandlingNewRecord: React.FC<InputNumberProps> = ({ value, onChange }) => {
|
|
7
|
-
return <InputNumber
|
|
8
|
-
value={isRecordNew({ id: value }) ? '' : value}
|
|
9
|
-
onChange={onChange}
|
|
10
|
-
/>
|
|
11
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// antd switch but not for boolean, for numbers 0 and 1
|
|
2
|
-
import { Switch } from "antd";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { SwitchProps } from "antd/es/switch";
|
|
5
|
-
|
|
6
|
-
interface NumberSwitcherProps extends Omit<SwitchProps, 'value' | 'onChange'> {
|
|
7
|
-
value?: number;
|
|
8
|
-
onChange?: (value?: number) => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const NumberSwitch: React.FC<NumberSwitcherProps> = ({
|
|
12
|
-
value,
|
|
13
|
-
onChange,
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<Switch
|
|
18
|
-
checkedChildren="1"
|
|
19
|
-
unCheckedChildren="0"
|
|
20
|
-
checked={value === 1}
|
|
21
|
-
onChange={(checked) => {
|
|
22
|
-
onChange?.(checked ? 1 : 0);
|
|
23
|
-
}}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button, Input, Tooltip } from "antd";
|
|
3
|
-
import { ThunderboltOutlined } from "@ant-design/icons";
|
|
4
|
-
import { Typography } from "antd";
|
|
5
|
-
import { PasswordProps } from "antd/es/input/Password";
|
|
6
|
-
|
|
7
|
-
const { Paragraph } = Typography;
|
|
8
|
-
|
|
9
|
-
export const Password: React.FC<PasswordProps> = ({ value, onChange }) => {
|
|
10
|
-
return (
|
|
11
|
-
<Input.Group compact={true}>
|
|
12
|
-
<Input.Password
|
|
13
|
-
placeholder={'Enter password'}
|
|
14
|
-
onChange={onChange}
|
|
15
|
-
value={value}
|
|
16
|
-
style={{ width: 'calc(100% - 80px)' }}
|
|
17
|
-
autoComplete={'one-time-code'}
|
|
18
|
-
/>
|
|
19
|
-
<Tooltip title="Generate password">
|
|
20
|
-
<Button
|
|
21
|
-
onClick={(e) => {
|
|
22
|
-
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%&';
|
|
23
|
-
const pass = Array(10).fill('').map(x => chars[Math.floor(Math.random() * chars.length)]).join('');
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
onChange?.(pass);
|
|
26
|
-
}}
|
|
27
|
-
icon={<ThunderboltOutlined color={'var(--ant-primary)'} />}
|
|
28
|
-
/>
|
|
29
|
-
</Tooltip>
|
|
30
|
-
<Button icon={<Paragraph copyable={{ text: String(value) }} />} />
|
|
31
|
-
</Input.Group>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { ProFormSelect, ProFormSelectProps } from "@ant-design/pro-components";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useCreation } from "../Table";
|
|
4
|
-
import { Space } from "antd";
|
|
5
|
-
|
|
6
|
-
type RelationSelectProps<T, CreateDto = T> = ProFormSelectProps & {
|
|
7
|
-
selectedItem: T | null | undefined,
|
|
8
|
-
onChange?: (type: T | null) => void,
|
|
9
|
-
filter?: string[],
|
|
10
|
-
fetchItems: (filter: string[], keyword?: string) => Promise<{ data: T[] }>,
|
|
11
|
-
fieldNames?: {
|
|
12
|
-
value: string,
|
|
13
|
-
label: string,
|
|
14
|
-
},
|
|
15
|
-
onCreate?: ({}: { requestBody: CreateDto }) => Promise<T>,
|
|
16
|
-
creationColumns?: any[], // TODO: any specified in the createEntityModal. Need to fix it in the both places
|
|
17
|
-
idColumnName?: string & keyof T | (string & keyof T)[],
|
|
18
|
-
createPopupTitle?: string,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const RelationSelect = function <T, CreateDto>({
|
|
22
|
-
selectedItem,
|
|
23
|
-
onCreate,
|
|
24
|
-
creationColumns,
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
idColumnName = 'id',
|
|
27
|
-
createPopupTitle = 'Add new record',
|
|
28
|
-
onChange,
|
|
29
|
-
filter = [],
|
|
30
|
-
fetchItems,
|
|
31
|
-
fieldNames = {
|
|
32
|
-
value: 'id',
|
|
33
|
-
label: 'name',
|
|
34
|
-
},
|
|
35
|
-
...rest
|
|
36
|
-
}: RelationSelectProps<T, CreateDto>) {
|
|
37
|
-
const { value: valueKey, label: labelKey } = fieldNames;
|
|
38
|
-
const [value, setValue] = useState(selectedItem ? {
|
|
39
|
-
label: selectedItem[labelKey as keyof T],
|
|
40
|
-
value: selectedItem[valueKey as keyof T],
|
|
41
|
-
} : undefined);
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
creationModal,
|
|
45
|
-
createButton,
|
|
46
|
-
} = useCreation<T, CreateDto>({
|
|
47
|
-
onCreate,
|
|
48
|
-
columns: creationColumns,
|
|
49
|
-
popupCreation: !!onCreate,
|
|
50
|
-
createNewDefaultParams: {},
|
|
51
|
-
createButtonSize: 'small',
|
|
52
|
-
pathParams: {},
|
|
53
|
-
entityToCreateDto: (entity: T) => entity as unknown as CreateDto,
|
|
54
|
-
title: createPopupTitle,
|
|
55
|
-
idColumnName
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const request = async ({ keyWords: keyword }: { keyWords: string }) => {
|
|
59
|
-
const reqFilter = [...filter];
|
|
60
|
-
if (keyword) {
|
|
61
|
-
reqFilter.push(labelKey + '||$contL||' + keyword);
|
|
62
|
-
}
|
|
63
|
-
const resp = await fetchItems(reqFilter, keyword);
|
|
64
|
-
return resp.data;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 5 }}>
|
|
69
|
-
<ProFormSelect.SearchSelect
|
|
70
|
-
showSearch
|
|
71
|
-
mode={'single'}
|
|
72
|
-
request={request}
|
|
73
|
-
className='relational-select'
|
|
74
|
-
formItemProps={{
|
|
75
|
-
style: {
|
|
76
|
-
margin: 0,
|
|
77
|
-
display: 'inline-block',
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
80
|
-
style={{ minWidth: 160 }}
|
|
81
|
-
placeholder='Please choose'
|
|
82
|
-
fieldProps={{
|
|
83
|
-
fieldNames: {
|
|
84
|
-
value: valueKey,
|
|
85
|
-
label: labelKey,
|
|
86
|
-
},
|
|
87
|
-
value,
|
|
88
|
-
onChange(value, row) {
|
|
89
|
-
setValue(value);
|
|
90
|
-
onChange?.(row ? value : null);
|
|
91
|
-
},
|
|
92
|
-
dropdownRender: (menu) => (
|
|
93
|
-
<>
|
|
94
|
-
{menu}
|
|
95
|
-
{onCreate && (
|
|
96
|
-
<Space style={{ padding: '0 8px 4px', display: 'flex', justifyContent: 'center' }}>
|
|
97
|
-
{createButton}
|
|
98
|
-
</Space>
|
|
99
|
-
)}
|
|
100
|
-
</>
|
|
101
|
-
),
|
|
102
|
-
}}
|
|
103
|
-
{...rest}
|
|
104
|
-
/>
|
|
105
|
-
{creationModal}
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { SearchOutlined } from "@ant-design/icons";
|
|
3
|
-
import { Checkbox, Empty, Input, Menu } from "antd";
|
|
4
|
-
import { FilterDropdownProps } from "antd/es/table/interface";
|
|
5
|
-
|
|
6
|
-
export const SearchSelect = function<T>({
|
|
7
|
-
selectedKeys,
|
|
8
|
-
setSelectedKeys,
|
|
9
|
-
filter = [],
|
|
10
|
-
limit = 7,
|
|
11
|
-
fetchItems,
|
|
12
|
-
fieldNames = {
|
|
13
|
-
value: 'id',
|
|
14
|
-
label: 'name',
|
|
15
|
-
},
|
|
16
|
-
}: Pick<FilterDropdownProps, 'selectedKeys' | 'setSelectedKeys'> & {
|
|
17
|
-
filter?: string[],
|
|
18
|
-
limit?: number,
|
|
19
|
-
fetchItems: (filter: string[], limit?: number, keyword?: string) => Promise<{ data: T[] }>,
|
|
20
|
-
fieldNames?: {
|
|
21
|
-
value: string,
|
|
22
|
-
label: string,
|
|
23
|
-
},
|
|
24
|
-
}) {
|
|
25
|
-
const { value: valueKey, label: labelKey } = fieldNames;
|
|
26
|
-
|
|
27
|
-
const [availableItems, setAvailableItems] = useState<T[]>([]);
|
|
28
|
-
const request = async (keyword: string) => {
|
|
29
|
-
const reqFilter = [...filter];
|
|
30
|
-
if (keyword) {
|
|
31
|
-
reqFilter.push(labelKey + '||$contL||' + keyword);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const resp = await fetchItems(reqFilter, limit, keyword);
|
|
35
|
-
setAvailableItems(resp.data);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
request('');
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<>
|
|
44
|
-
<div className={`ant-table-filter-dropdown-search`}>
|
|
45
|
-
<Input
|
|
46
|
-
prefix={<SearchOutlined />}
|
|
47
|
-
placeholder={'Search in filters'}
|
|
48
|
-
onChange={e => request(e.target.value)}
|
|
49
|
-
className={`ant-table-filter-dropdown-search-input`}
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
{
|
|
53
|
-
availableItems.length === 0
|
|
54
|
-
? (
|
|
55
|
-
<Empty
|
|
56
|
-
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
|
57
|
-
description={'Not Found'}
|
|
58
|
-
imageStyle={{
|
|
59
|
-
height: 24,
|
|
60
|
-
}}
|
|
61
|
-
style={{
|
|
62
|
-
margin: 0,
|
|
63
|
-
padding: '16px 0',
|
|
64
|
-
}}
|
|
65
|
-
/>
|
|
66
|
-
)
|
|
67
|
-
: (
|
|
68
|
-
<Menu
|
|
69
|
-
selectable
|
|
70
|
-
multiple
|
|
71
|
-
prefixCls={`ant-dropdown-menu`}
|
|
72
|
-
className={'ant-dropdown-menu'}
|
|
73
|
-
onSelect={({ key }) => setSelectedKeys([...selectedKeys, key])}
|
|
74
|
-
onDeselect={({ key }) => setSelectedKeys(selectedKeys.filter(selectedKey => selectedKey !== key))}
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
selectedKeys={selectedKeys}
|
|
77
|
-
items={availableItems.map(item => (
|
|
78
|
-
{
|
|
79
|
-
key: String(item?.[valueKey as keyof T]),
|
|
80
|
-
label: (
|
|
81
|
-
<>
|
|
82
|
-
<Checkbox checked={selectedKeys?.includes(String(item?.[valueKey as keyof T]))} />
|
|
83
|
-
<span>{String(item?.[labelKey as keyof T])}</span>
|
|
84
|
-
</>
|
|
85
|
-
),
|
|
86
|
-
}
|
|
87
|
-
))}
|
|
88
|
-
/>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { Tag, Input, InputNumber, Space, Button, Switch, Descriptions, Checkbox, Typography } from "antd";
|
|
2
|
-
import { ColumnFilterItem, FilterDropdownProps } from "antd/es/table/interface";
|
|
3
|
-
import { ReactNode, useEffect, useState } from "react";
|
|
4
|
-
|
|
5
|
-
const { Text } = Typography;
|
|
6
|
-
|
|
7
|
-
export const booleanFilters: ColumnFilterItem[] = [
|
|
8
|
-
{ text: <Tag color='red'>Disabled</Tag>, value: 0 },
|
|
9
|
-
{ text: <Tag color='green'>Enabled</Tag>, value: 1 },
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export function NumberFilterDropdown({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }: FilterDropdownProps) {
|
|
13
|
-
return (
|
|
14
|
-
<DynamicOptionsFilterDropdown confirm={confirm} clearFilters={clearFilters}>
|
|
15
|
-
<InputNumber
|
|
16
|
-
value={selectedKeys.length ? Number(selectedKeys[0]) : undefined}
|
|
17
|
-
onChange={(value) => setSelectedKeys(value === undefined ? [] : [value])}
|
|
18
|
-
onPressEnter={() => confirm()}
|
|
19
|
-
step={1}
|
|
20
|
-
style={{ margin: 4, width: 250 }}
|
|
21
|
-
placeholder="Please Enter"
|
|
22
|
-
/>
|
|
23
|
-
</DynamicOptionsFilterDropdown>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function SwitchFilterDropdown({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }: FilterDropdownProps) {
|
|
28
|
-
return (
|
|
29
|
-
<DynamicOptionsFilterDropdown confirm={confirm} clearFilters={clearFilters}>
|
|
30
|
-
<Descriptions
|
|
31
|
-
style={{ margin: '8px 16px', width: 200 }}
|
|
32
|
-
items={[
|
|
33
|
-
{
|
|
34
|
-
label: 'Only filled values',
|
|
35
|
-
children: <Switch
|
|
36
|
-
checked={selectedKeys.length ? Boolean(selectedKeys[0]) : undefined}
|
|
37
|
-
onChange={(value) => setSelectedKeys([value as any])}
|
|
38
|
-
/>,
|
|
39
|
-
style: { padding: 0 },
|
|
40
|
-
contentStyle: { justifyContent: 'flex-end' },
|
|
41
|
-
}
|
|
42
|
-
]}
|
|
43
|
-
/>
|
|
44
|
-
</DynamicOptionsFilterDropdown>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function CheckboxFilterDropdown({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }: FilterDropdownProps) {
|
|
49
|
-
return (
|
|
50
|
-
<DynamicOptionsFilterDropdown confirm={confirm} clearFilters={clearFilters}>
|
|
51
|
-
<Checkbox
|
|
52
|
-
checked={selectedKeys.length ? Boolean(selectedKeys[0]) : undefined}
|
|
53
|
-
onChange={(event) => setSelectedKeys([event.target.checked as any])}
|
|
54
|
-
indeterminate={selectedKeys.length === 0}
|
|
55
|
-
style={{ margin: '8px 16px', width: 250 }}
|
|
56
|
-
>
|
|
57
|
-
{selectedKeys.length ? (selectedKeys[0] ? 'Will show only filled values' : 'Will show only empty values') : <Text type="secondary">Click to filter</Text>}
|
|
58
|
-
</Checkbox>
|
|
59
|
-
</DynamicOptionsFilterDropdown>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function NumberRangeFilterDropdown({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }: FilterDropdownProps) {
|
|
64
|
-
const [range, updateRange] = useState<[number, number] | undefined>(selectedKeys);
|
|
65
|
-
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
updateRange(selectedKeys);
|
|
68
|
-
}, [selectedKeys]);
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
setSelectedKeys(range);
|
|
72
|
-
}, [range]);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<DynamicOptionsFilterDropdown confirm={confirm} clearFilters={clearFilters}>
|
|
76
|
-
<InputNumber
|
|
77
|
-
value={range?.[0]}
|
|
78
|
-
onChange={value => updateRange(prev => ([value, prev[1]]))}
|
|
79
|
-
onPressEnter={() => confirm()}
|
|
80
|
-
step={1}
|
|
81
|
-
style={{ margin: 4, width: 250 }}
|
|
82
|
-
placeholder="From"
|
|
83
|
-
/>
|
|
84
|
-
<InputNumber
|
|
85
|
-
value={range?.[1]}
|
|
86
|
-
onChange={value => updateRange(prev => ([prev[0], value]))}
|
|
87
|
-
onPressEnter={() => confirm()}
|
|
88
|
-
step={1}
|
|
89
|
-
style={{ margin: 4, width: 250 }}
|
|
90
|
-
placeholder="To"
|
|
91
|
-
/>
|
|
92
|
-
</DynamicOptionsFilterDropdown>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function StringFilterDropdown({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }: FilterDropdownProps) {
|
|
97
|
-
return (
|
|
98
|
-
<DynamicOptionsFilterDropdown confirm={confirm} clearFilters={clearFilters}>
|
|
99
|
-
<Input
|
|
100
|
-
value={selectedKeys.length ? String(selectedKeys[0]) : undefined}
|
|
101
|
-
onChange={(event) => setSelectedKeys(event.target.value === undefined ? [] : [event.target.value])}
|
|
102
|
-
onPressEnter={() => confirm()}
|
|
103
|
-
style={{ margin: 4, width: 250 }}
|
|
104
|
-
placeholder="Please Enter"
|
|
105
|
-
/>
|
|
106
|
-
</DynamicOptionsFilterDropdown>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export const DynamicOptionsFilterDropdown = ({
|
|
111
|
-
children,
|
|
112
|
-
confirm,
|
|
113
|
-
clearFilters,
|
|
114
|
-
}: Partial<FilterDropdownProps> & { children: ReactNode}) => {
|
|
115
|
-
return (
|
|
116
|
-
<div style={{ display: 'flex', flexDirection: 'column' }} onKeyDown={(e) => e.stopPropagation()}>
|
|
117
|
-
{children}
|
|
118
|
-
<Space className="ant-table-filter-dropdown-btns">
|
|
119
|
-
<Button
|
|
120
|
-
type="link"
|
|
121
|
-
onClick={() => {
|
|
122
|
-
clearFilters();
|
|
123
|
-
confirm();
|
|
124
|
-
}}
|
|
125
|
-
size="small"
|
|
126
|
-
>
|
|
127
|
-
Reset
|
|
128
|
-
</Button>
|
|
129
|
-
<Button
|
|
130
|
-
type="primary"
|
|
131
|
-
size="small"
|
|
132
|
-
onClick={() => {
|
|
133
|
-
confirm();
|
|
134
|
-
}}
|
|
135
|
-
>
|
|
136
|
-
OK
|
|
137
|
-
</Button>
|
|
138
|
-
</Space>
|
|
139
|
-
</div>
|
|
140
|
-
)
|
|
141
|
-
};
|