@enableai-base/form 1.0.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/form.cjs.js +733 -0
- package/dist/form.cjs.prod.js +733 -0
- package/dist/form.css +70 -0
- package/dist/form.d.ts +144 -0
- package/dist/form.esm-bundler.mjs +710 -0
- package/index.js +7 -0
- package/package.json +45 -0
package/dist/form.css
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.date-panel-popover-root {
|
|
2
|
+
background: transparent !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.date-panel-popover-root .ant-popover-inner {
|
|
6
|
+
background: transparent !important;
|
|
7
|
+
box-shadow: none !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.date-panel-popover-root .ant-picker {
|
|
11
|
+
box-shadow: none !important;
|
|
12
|
+
border: none !important;
|
|
13
|
+
outline: none !important;
|
|
14
|
+
padding: 0 !important ;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.date-panel-popover-root .ant-picker-input {
|
|
18
|
+
display: none;
|
|
19
|
+
border: none !important;
|
|
20
|
+
outline: none !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.column-setting-form {
|
|
24
|
+
--cs-gap-8: 8px;
|
|
25
|
+
--cs-gap-14: 14px;
|
|
26
|
+
--cs-gap-24: 24px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.column-setting-form .custom-form-divider {
|
|
30
|
+
margin-top: -5px;
|
|
31
|
+
margin-bottom: var(--cs-gap-14);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.column-setting-form .custom-form-item {
|
|
35
|
+
margin: 0 0 var(--cs-gap-8);
|
|
36
|
+
height: 22px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.column-setting-form .custom-options-container {
|
|
40
|
+
background: var(--ant-color-bg-layout);
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
padding: var(--cs-gap-8);
|
|
43
|
+
margin: 0 0 var(--cs-gap-24);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.column-setting-form .custom-form-container {
|
|
47
|
+
margin: 0 0 var(--cs-gap-24);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.column-setting-form .form-button-container {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.column-setting-form .form-button-container .ant-btn > span {
|
|
55
|
+
padding: 4px 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.column-setting-modal .draggable-modal {
|
|
59
|
+
box-shadow:
|
|
60
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05),
|
|
61
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.05),
|
|
62
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.05);
|
|
63
|
+
}
|
|
64
|
+
.column-setting-modal .header {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
.column-setting-modal .field-form-container {
|
|
68
|
+
flex: 1;
|
|
69
|
+
padding: 12px;
|
|
70
|
+
}
|
package/dist/form.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
import { ToolConfig, FeatureValues, TableConfig, Feature, DateFormatType } from '@enableai-base/core';
|
|
4
|
+
import { Dayjs } from 'dayjs';
|
|
5
|
+
import { SetStateAction } from 'react';
|
|
6
|
+
|
|
7
|
+
export interface ColumnFieldFromRef {
|
|
8
|
+
checkChange: () => boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ColumnFieldFromProps = {
|
|
11
|
+
formRef: React.Ref<ColumnFieldFromRef>;
|
|
12
|
+
columnId: string;
|
|
13
|
+
tools: ToolConfig[];
|
|
14
|
+
initValues: FeatureValues;
|
|
15
|
+
onFinish: (values: FeatureValues) => Promise<boolean>;
|
|
16
|
+
onCancel?: () => void;
|
|
17
|
+
selectProps?: SelectProps;
|
|
18
|
+
freeze?: boolean;
|
|
19
|
+
bodyRef?: React.Ref<HTMLDivElement>;
|
|
20
|
+
};
|
|
21
|
+
export declare const ColumnFieldFrom: FC<ColumnFieldFromProps>;
|
|
22
|
+
|
|
23
|
+
type FeatureCustomOptionsProps = {
|
|
24
|
+
features: FeatureValues;
|
|
25
|
+
onChange: (changed: FeatureValues) => void;
|
|
26
|
+
freeze?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const FeatureCustomOptions: FC<FeatureCustomOptionsProps>;
|
|
29
|
+
|
|
30
|
+
type FeatureDateFormatProps = {
|
|
31
|
+
features: FeatureValues;
|
|
32
|
+
onChange: (changed: FeatureValues) => void;
|
|
33
|
+
};
|
|
34
|
+
export declare const FeatureDateFormat: FC<FeatureDateFormatProps>;
|
|
35
|
+
|
|
36
|
+
type FeatureDefaultFieldProps = {
|
|
37
|
+
tableConfig: TableConfig;
|
|
38
|
+
features: FeatureValues;
|
|
39
|
+
onChange: (changed: FeatureValues) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare const FeatureDefaultField: FC<FeatureDefaultFieldProps>;
|
|
42
|
+
|
|
43
|
+
export type FeatureFieldProps = {
|
|
44
|
+
features: FeatureValues;
|
|
45
|
+
tools?: ToolConfig[];
|
|
46
|
+
onChange: (changed: FeatureValues) => void;
|
|
47
|
+
selectProps?: SelectProps;
|
|
48
|
+
freeze?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare const FeatureField: FC<FeatureFieldProps>;
|
|
51
|
+
|
|
52
|
+
type FeatureFileFormatProps = {
|
|
53
|
+
features: FeatureValues;
|
|
54
|
+
onChange: (changed: FeatureValues) => void;
|
|
55
|
+
freeze?: boolean;
|
|
56
|
+
type?: 'update' | 'insert';
|
|
57
|
+
};
|
|
58
|
+
export declare const FeatureFileFormat: FC<FeatureFileFormatProps>;
|
|
59
|
+
|
|
60
|
+
type FeatureInputProps = {
|
|
61
|
+
feature: Feature<any>;
|
|
62
|
+
freeze?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export declare const FeatureInput: FC<FeatureInputProps>;
|
|
65
|
+
|
|
66
|
+
type FeatureNumberFormatProps = {
|
|
67
|
+
features: FeatureValues;
|
|
68
|
+
onChange: (changed: FeatureValues) => void;
|
|
69
|
+
};
|
|
70
|
+
export declare const FeatureNumberFormat: FC<FeatureNumberFormatProps>;
|
|
71
|
+
|
|
72
|
+
type FeaturePeopleProps = {
|
|
73
|
+
features: FeatureValues;
|
|
74
|
+
onChange: (changed: FeatureValues) => void;
|
|
75
|
+
};
|
|
76
|
+
export declare const FeaturePeople: FC<FeaturePeopleProps>;
|
|
77
|
+
|
|
78
|
+
type TFeatureTypeProps = {
|
|
79
|
+
feature: Feature<any>;
|
|
80
|
+
tools?: ToolConfig[];
|
|
81
|
+
selectProps?: SelectProps;
|
|
82
|
+
};
|
|
83
|
+
export declare const FeatureTypeSelect: FC<TFeatureTypeProps>;
|
|
84
|
+
|
|
85
|
+
type CustomDatePickerProps$1 = {
|
|
86
|
+
formatType?: DateFormatType;
|
|
87
|
+
onChangeDate: (date: string) => void;
|
|
88
|
+
};
|
|
89
|
+
export declare const CustomDatePicker: FC<CustomDatePickerProps$1>;
|
|
90
|
+
|
|
91
|
+
type CustomDatePickerProps = {
|
|
92
|
+
formatType?: string;
|
|
93
|
+
onChangeDate: (date: Dayjs) => void;
|
|
94
|
+
};
|
|
95
|
+
export declare const CustomDatePickerV2: FC<CustomDatePickerProps>;
|
|
96
|
+
|
|
97
|
+
export type FeatureDefaultValueProps = {
|
|
98
|
+
tableConfig: TableConfig;
|
|
99
|
+
features: FeatureValues;
|
|
100
|
+
onChange: (changed: FeatureValues) => void;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export declare const FeatureDefaultDate: FC<FeatureDefaultValueProps>;
|
|
104
|
+
|
|
105
|
+
export declare const FeatureDefaultDateV2: FC<FeatureDefaultValueProps>;
|
|
106
|
+
|
|
107
|
+
export declare const FeatureDefaultInput: FC<FeatureDefaultValueProps>;
|
|
108
|
+
|
|
109
|
+
export declare const FeatureDefaultJson: FC<FeatureDefaultValueProps>;
|
|
110
|
+
|
|
111
|
+
export declare const FeatureDefaultNumber: FC<FeatureDefaultValueProps>;
|
|
112
|
+
|
|
113
|
+
export declare const FeatureDefaultSelect: FC<FeatureDefaultValueProps>;
|
|
114
|
+
|
|
115
|
+
export declare const getCurrentGMTLabel: () => string;
|
|
116
|
+
|
|
117
|
+
type PointData = {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
};
|
|
121
|
+
export interface ColumnSettingModalRef {
|
|
122
|
+
formRef: ColumnFieldFromRef | null;
|
|
123
|
+
}
|
|
124
|
+
export type ColumnSettingModalProps = {
|
|
125
|
+
ref?: React.Ref<ColumnSettingModalRef>;
|
|
126
|
+
contentRef?: React.Ref<HTMLDivElement>;
|
|
127
|
+
bodyRef?: React.Ref<HTMLDivElement>;
|
|
128
|
+
selectProps?: SelectProps;
|
|
129
|
+
offsetParent: HTMLElement | null;
|
|
130
|
+
position: PointData;
|
|
131
|
+
columnId: string;
|
|
132
|
+
initValues: FeatureValues;
|
|
133
|
+
tools: ToolConfig[];
|
|
134
|
+
className?: string;
|
|
135
|
+
isOpen?: boolean;
|
|
136
|
+
width?: number;
|
|
137
|
+
freeze?: boolean;
|
|
138
|
+
onClose?: () => void;
|
|
139
|
+
onFinish: (values: FeatureValues) => Promise<boolean>;
|
|
140
|
+
onPositionChange: (data: SetStateAction<PointData>) => void;
|
|
141
|
+
};
|
|
142
|
+
export declare const ColumnSettingModal: FC<ColumnSettingModalProps>;
|
|
143
|
+
|
|
144
|
+
|