feffery_antd_components 0.2.10-rc15 → 0.2.10-rc17
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/DESCRIPTION +1 -1
- package/Project.toml +1 -1
- package/build/lib/feffery_antd_components/__init__.py +1 -1
- package/build/lib/feffery_antd_components/async-antd_table.js +1 -1
- package/build/lib/feffery_antd_components/async-antd_upload.js +1 -1
- package/build/lib/feffery_antd_components/async-data_entry.js +1 -0
- package/build/lib/feffery_antd_components/feffery_antd_components.min.js +1 -1
- package/build/lib/feffery_antd_components/package-info.json +1 -1
- package/feffery_antd_components/AntdMenu.py +6 -4
- package/feffery_antd_components/__init__.py +1 -1
- package/feffery_antd_components/async-antd_table.js +1 -1
- package/feffery_antd_components/async-antd_upload.js +1 -1
- package/feffery_antd_components/async-data_entry.js +1 -0
- package/feffery_antd_components/feffery_antd_components.min.js +1 -1
- package/feffery_antd_components/metadata.json +10 -0
- package/feffery_antd_components/package-info.json +1 -1
- package/package.json +1 -1
- package/src/jl/'feffery'_antdmenu.jl +2 -1
- package/src/lib/components/dataEntry/AntdCascader.react.js +9 -147
- package/src/lib/components/dataEntry/AntdCheckbox.react.js +9 -74
- package/src/lib/components/dataEntry/AntdCheckboxGroup.react.js +9 -71
- package/src/lib/components/dataEntry/AntdDatePicker.react.js +10 -425
- package/src/lib/components/dataEntry/AntdDateRangePicker.react.js +9 -446
- package/src/lib/components/dataEntry/AntdInput.react.js +11 -325
- package/src/lib/components/dataEntry/AntdInputNumber.react.js +9 -134
- package/src/lib/components/dataEntry/AntdMentions.react.js +9 -113
- package/src/lib/components/dataEntry/AntdRadioGroup.react.js +9 -135
- package/src/lib/components/dataEntry/AntdRate.react.js +9 -76
- package/src/lib/components/dataEntry/AntdSegmentedColoring.react.js +9 -206
- package/src/lib/components/dataEntry/AntdSelect.react.js +10 -288
- package/src/lib/components/dataEntry/AntdSlider.react.js +9 -123
- package/src/lib/components/dataEntry/AntdSwitch.react.js +9 -84
- package/src/lib/components/dataEntry/AntdTimePicker.react.js +9 -125
- package/src/lib/components/dataEntry/AntdTimeRangePicker.react.js +9 -141
- package/src/lib/components/dataEntry/AntdTransfer.react.js +9 -132
- package/src/lib/components/dataEntry/AntdTreeSelect.react.js +11 -207
- package/src/lib/components/dataEntry/check-card/AntdCheckCard.react.js +10 -66
- package/src/lib/components/dataEntry/check-card/AntdCheckCardGroup.react.js +10 -79
- package/src/lib/components/dataEntry/form/AntdForm.react.js +9 -42
- package/src/lib/components/dataEntry/form/AntdFormItem.react.js +9 -54
- package/src/lib/components/navigation/AntdMenu.react.js +14 -10
- package/src/lib/fragments/AntdTable.react.js +29 -12
- package/src/lib/fragments/dataEntry/AntdCascader.react.js +157 -0
- package/src/lib/fragments/dataEntry/AntdCheckbox.react.js +85 -0
- package/src/lib/fragments/dataEntry/AntdCheckboxGroup.react.js +82 -0
- package/src/lib/fragments/dataEntry/AntdDatePicker.react.js +436 -0
- package/src/lib/fragments/dataEntry/AntdDateRangePicker.react.js +458 -0
- package/src/lib/fragments/dataEntry/AntdInput.react.js +333 -0
- package/src/lib/fragments/dataEntry/AntdInputNumber.react.js +145 -0
- package/src/lib/fragments/dataEntry/AntdMentions.react.js +124 -0
- package/src/lib/fragments/dataEntry/AntdRadioGroup.react.js +146 -0
- package/src/lib/fragments/dataEntry/AntdRate.react.js +87 -0
- package/src/lib/fragments/dataEntry/AntdSegmentedColoring.react.js +219 -0
- package/src/lib/fragments/dataEntry/AntdSelect.react.js +298 -0
- package/src/lib/fragments/dataEntry/AntdSlider.react.js +134 -0
- package/src/lib/fragments/dataEntry/AntdSwitch.react.js +95 -0
- package/src/lib/fragments/dataEntry/AntdTimePicker.react.js +136 -0
- package/src/lib/fragments/dataEntry/AntdTimeRangePicker.react.js +152 -0
- package/src/lib/fragments/dataEntry/AntdTransfer.react.js +143 -0
- package/src/lib/fragments/dataEntry/AntdTreeSelect.react.js +216 -0
- package/src/lib/fragments/dataEntry/check-card/AntdCheckCard.react.js +77 -0
- package/src/lib/fragments/dataEntry/check-card/AntdCheckCardGroup.react.js +89 -0
- package/src/lib/fragments/dataEntry/form/AntdForm.react.js +53 -0
- package/src/lib/fragments/dataEntry/form/AntdFormItem.react.js +65 -0
- package/usage.py +45 -56
|
@@ -25098,6 +25098,16 @@
|
|
|
25098
25098
|
"required": false,
|
|
25099
25099
|
"description": ""
|
|
25100
25100
|
},
|
|
25101
|
+
"menuItemKeyToTitle": {
|
|
25102
|
+
"type": {
|
|
25103
|
+
"name": "objectOf",
|
|
25104
|
+
"value": {
|
|
25105
|
+
"name": "node"
|
|
25106
|
+
}
|
|
25107
|
+
},
|
|
25108
|
+
"required": false,
|
|
25109
|
+
"description": ""
|
|
25110
|
+
},
|
|
25101
25111
|
"mode": {
|
|
25102
25112
|
"type": {
|
|
25103
25113
|
"name": "enum",
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ Those elements have the following types:
|
|
|
20
20
|
- `is_loading` (Bool; optional): Determines if the component is loading or not
|
|
21
21
|
- `prop_name` (String; optional): Holds which property is loading
|
|
22
22
|
- `component_name` (String; optional): Holds the name of the component that is loading
|
|
23
|
+
- `menuItemKeyToTitle` (Dict with Strings as keys and values of type a list of or a singular dash component, string or number; optional)
|
|
23
24
|
- `menuItems` (Array; optional)
|
|
24
25
|
- `mode` (a value equal to: 'vertical', 'horizontal', 'inline'; optional)
|
|
25
26
|
- `openKeys` (Array of Strings; optional)
|
|
@@ -42,7 +43,7 @@ session: window.sessionStorage, data is cleared once the browser quit.
|
|
|
42
43
|
- `theme` (a value equal to: 'light', 'dark'; optional)
|
|
43
44
|
"""
|
|
44
45
|
function 'feffery'_antdmenu(; kwargs...)
|
|
45
|
-
available_props = Symbol[:id, :className, :currentKey, :defaultOpenKeys, :defaultSelectedKey, :inlineCollapsed, :key, :loading_state, :menuItems, :mode, :openKeys, :persisted_props, :persistence, :persistence_type, :popupContainer, :renderCollapsedButton, :style, :theme]
|
|
46
|
+
available_props = Symbol[:id, :className, :currentKey, :defaultOpenKeys, :defaultSelectedKey, :inlineCollapsed, :key, :loading_state, :menuItemKeyToTitle, :menuItems, :mode, :openKeys, :persisted_props, :persistence, :persistence_type, :popupContainer, :renderCollapsedButton, :style, :theme]
|
|
46
47
|
wild_props = Symbol[]
|
|
47
48
|
return Component("'feffery'_antdmenu", "AntdMenu", "feffery_antd_components", available_props, wild_props; kwargs...)
|
|
48
49
|
end
|
|
@@ -1,154 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Cascader, ConfigProvider } from 'antd';
|
|
4
|
-
import { str2Locale } from '../locales.react';
|
|
5
|
-
import { isUndefined, isString } from 'lodash';
|
|
6
|
-
import { flatToTree } from '../utils';
|
|
7
|
-
import useCss from '../../hooks/useCss';
|
|
8
|
-
import PropsContext from '../../contexts/PropsContext';
|
|
9
3
|
|
|
4
|
+
const LazyAntdCascader = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../fragments/dataEntry/AntdCascader.react'));
|
|
10
5
|
|
|
11
|
-
const { SHOW_CHILD, SHOW_PARENT } = Cascader;
|
|
12
|
-
|
|
13
|
-
const str2ShowCheckedStrategy = new Map([
|
|
14
|
-
['show-child', SHOW_CHILD],
|
|
15
|
-
['show-parent', SHOW_PARENT]
|
|
16
|
-
])
|
|
17
|
-
|
|
18
|
-
// 定义级联选择组件AntdCascader,api参数参考https://ant.design/components/cascader-cn/
|
|
19
6
|
const AntdCascader = (props) => {
|
|
20
|
-
// 取得必要属性或参数
|
|
21
|
-
let {
|
|
22
|
-
id,
|
|
23
|
-
style,
|
|
24
|
-
className,
|
|
25
|
-
key,
|
|
26
|
-
locale,
|
|
27
|
-
options,
|
|
28
|
-
optionsMode,
|
|
29
|
-
changeOnSelect,
|
|
30
|
-
size,
|
|
31
|
-
bordered,
|
|
32
|
-
disabled,
|
|
33
|
-
placeholder,
|
|
34
|
-
defaultValue,
|
|
35
|
-
value,
|
|
36
|
-
placement,
|
|
37
|
-
maxTagCount,
|
|
38
|
-
multiple,
|
|
39
|
-
expandTrigger,
|
|
40
|
-
status,
|
|
41
|
-
allowClear,
|
|
42
|
-
showCheckedStrategy,
|
|
43
|
-
popupContainer,
|
|
44
|
-
readOnly,
|
|
45
|
-
setProps,
|
|
46
|
-
persistence,
|
|
47
|
-
persisted_props,
|
|
48
|
-
persistence_type,
|
|
49
|
-
loading_state,
|
|
50
|
-
batchPropsNames
|
|
51
|
-
} = props;
|
|
52
|
-
|
|
53
|
-
// 批属性监听
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (batchPropsNames && batchPropsNames.length !== 0) {
|
|
56
|
-
let _batchPropsValues = {};
|
|
57
|
-
for (let propName of batchPropsNames) {
|
|
58
|
-
_batchPropsValues[propName] = props[propName];
|
|
59
|
-
}
|
|
60
|
-
setProps({
|
|
61
|
-
batchPropsValues: _batchPropsValues
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const context = useContext(PropsContext)
|
|
67
|
-
locale = (context && context.locale) || locale
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (defaultValue && !value) {
|
|
71
|
-
setProps({ value: defaultValue })
|
|
72
|
-
}
|
|
73
|
-
}, [])
|
|
74
|
-
|
|
75
|
-
const flatToTreeOptions = useMemo(() => {
|
|
76
|
-
return flatToTree(options);
|
|
77
|
-
}, [options])
|
|
78
|
-
|
|
79
|
-
// 根据optionsMode对options进行预处理
|
|
80
|
-
if (optionsMode === 'flat') {
|
|
81
|
-
options = flatToTreeOptions
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const filter = (inputValue, path) => {
|
|
85
|
-
return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const onSelect = (e) => {
|
|
89
|
-
setProps({ value: e })
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 返回定制化的前端组件
|
|
93
7
|
return (
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
className={
|
|
98
|
-
isString(className) ?
|
|
99
|
-
className :
|
|
100
|
-
(className ? useCss(className) : undefined)
|
|
101
|
-
}
|
|
102
|
-
style={style}
|
|
103
|
-
key={key}
|
|
104
|
-
options={options}
|
|
105
|
-
changeOnSelect={changeOnSelect}
|
|
106
|
-
size={
|
|
107
|
-
context && !isUndefined(context.componentSize) ?
|
|
108
|
-
context.componentSize :
|
|
109
|
-
size
|
|
110
|
-
}
|
|
111
|
-
bordered={bordered}
|
|
112
|
-
disabled={
|
|
113
|
-
context && !isUndefined(context.componentDisabled) ?
|
|
114
|
-
context.componentDisabled :
|
|
115
|
-
disabled
|
|
116
|
-
}
|
|
117
|
-
placeholder={placeholder}
|
|
118
|
-
defaultValue={defaultValue}
|
|
119
|
-
value={value}
|
|
120
|
-
placement={placement}
|
|
121
|
-
maxTagCount={maxTagCount}
|
|
122
|
-
multiple={multiple}
|
|
123
|
-
persistence={persistence}
|
|
124
|
-
persisted_props={persisted_props}
|
|
125
|
-
persistence_type={persistence_type}
|
|
126
|
-
expandTrigger={expandTrigger}
|
|
127
|
-
status={status}
|
|
128
|
-
allowClear={isUndefined(readOnly) ? allowClear : !readOnly}
|
|
129
|
-
showCheckedStrategy={str2ShowCheckedStrategy.get(showCheckedStrategy)}
|
|
130
|
-
displayRender={
|
|
131
|
-
multiple ?
|
|
132
|
-
undefined :
|
|
133
|
-
(
|
|
134
|
-
showCheckedStrategy === 'show-child' ?
|
|
135
|
-
(label) => label[label.length - 1] :
|
|
136
|
-
(label) => label[0]
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
showSearch={filter}
|
|
140
|
-
onChange={onSelect}
|
|
141
|
-
data-dash-is-loading={
|
|
142
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
143
|
-
}
|
|
144
|
-
getPopupContainer={
|
|
145
|
-
popupContainer === 'parent' ?
|
|
146
|
-
(triggerNode) => triggerNode.parentNode :
|
|
147
|
-
undefined
|
|
148
|
-
}
|
|
149
|
-
open={isUndefined(readOnly) || !readOnly ? undefined : false}
|
|
150
|
-
/>
|
|
151
|
-
</ConfigProvider>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdCascader {...props} />
|
|
10
|
+
</Suspense>
|
|
152
11
|
);
|
|
153
12
|
}
|
|
154
13
|
|
|
@@ -386,4 +245,7 @@ AntdCascader.defaultProps = {
|
|
|
386
245
|
batchPropsNames: []
|
|
387
246
|
}
|
|
388
247
|
|
|
389
|
-
export default AntdCascader;
|
|
248
|
+
export default AntdCascader;
|
|
249
|
+
|
|
250
|
+
export const propTypes = AntdCascader.propTypes;
|
|
251
|
+
export const defaultProps = AntdCascader.defaultProps;
|
|
@@ -1,81 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Checkbox } from 'antd';
|
|
4
|
-
import { isString, isUndefined } from 'lodash';
|
|
5
|
-
import useCss from '../../hooks/useCss';
|
|
6
|
-
import PropsContext from '../../contexts/PropsContext';
|
|
7
3
|
|
|
4
|
+
const LazyAntdCheckbox = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../fragments/dataEntry/AntdCheckbox.react'));
|
|
8
5
|
|
|
9
|
-
// 定义选择框组件AntdCheckbox,api参数参考https://ant.design/components/checkbox-cn/
|
|
10
6
|
const AntdCheckbox = (props) => {
|
|
11
|
-
// 取得必要属性或参数
|
|
12
|
-
let {
|
|
13
|
-
id,
|
|
14
|
-
style,
|
|
15
|
-
className,
|
|
16
|
-
key,
|
|
17
|
-
label,
|
|
18
|
-
disabled,
|
|
19
|
-
checked,
|
|
20
|
-
indeterminate,
|
|
21
|
-
readOnly,
|
|
22
|
-
setProps,
|
|
23
|
-
persistence,
|
|
24
|
-
persisted_props,
|
|
25
|
-
persistence_type,
|
|
26
|
-
loading_state,
|
|
27
|
-
batchPropsNames
|
|
28
|
-
} = props;
|
|
29
|
-
|
|
30
|
-
// 批属性监听
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (batchPropsNames && batchPropsNames.length !== 0) {
|
|
33
|
-
let _batchPropsValues = {};
|
|
34
|
-
for (let propName of batchPropsNames) {
|
|
35
|
-
_batchPropsValues[propName] = props[propName];
|
|
36
|
-
}
|
|
37
|
-
setProps({
|
|
38
|
-
batchPropsValues: _batchPropsValues
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const context = useContext(PropsContext)
|
|
44
|
-
|
|
45
|
-
const onChange = e => {
|
|
46
|
-
if (!readOnly) {
|
|
47
|
-
setProps({ checked: e.target.checked })
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 返回定制化的前端组件
|
|
52
7
|
return (
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
isString(className) ?
|
|
57
|
-
className :
|
|
58
|
-
(className ? useCss(className) : undefined)
|
|
59
|
-
}
|
|
60
|
-
style={style}
|
|
61
|
-
key={key}
|
|
62
|
-
onChange={onChange}
|
|
63
|
-
disabled={
|
|
64
|
-
context && !isUndefined(context.componentDisabled) ?
|
|
65
|
-
context.componentDisabled :
|
|
66
|
-
disabled
|
|
67
|
-
}
|
|
68
|
-
checked={checked}
|
|
69
|
-
indeterminate={indeterminate}
|
|
70
|
-
persistence={persistence}
|
|
71
|
-
persisted_props={persisted_props}
|
|
72
|
-
persistence_type={persistence_type}
|
|
73
|
-
data-dash-is-loading={
|
|
74
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
75
|
-
}
|
|
76
|
-
>
|
|
77
|
-
{label}
|
|
78
|
-
</Checkbox>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdCheckbox {...props} />
|
|
10
|
+
</Suspense>
|
|
79
11
|
);
|
|
80
12
|
}
|
|
81
13
|
|
|
@@ -180,4 +112,7 @@ AntdCheckbox.defaultProps = {
|
|
|
180
112
|
batchPropsNames: []
|
|
181
113
|
}
|
|
182
114
|
|
|
183
|
-
export default AntdCheckbox;
|
|
115
|
+
export default AntdCheckbox;
|
|
116
|
+
|
|
117
|
+
export const propTypes = AntdCheckbox.propTypes;
|
|
118
|
+
export const defaultProps = AntdCheckbox.defaultProps;
|
|
@@ -1,78 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Checkbox } from 'antd';
|
|
4
|
-
import { isString, isUndefined } from 'lodash';
|
|
5
|
-
import useCss from '../../hooks/useCss';
|
|
6
|
-
import PropsContext from '../../contexts/PropsContext';
|
|
7
3
|
|
|
4
|
+
const LazyAntdCheckboxGroup = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../fragments/dataEntry/AntdCheckboxGroup.react'));
|
|
8
5
|
|
|
9
|
-
// 定义组合选择框组件AntdCheckboxGroup,api参数参考https://ant.design/components/checkbox-cn/
|
|
10
6
|
const AntdCheckboxGroup = (props) => {
|
|
11
|
-
// 取得必要属性或参数
|
|
12
|
-
let {
|
|
13
|
-
id,
|
|
14
|
-
style,
|
|
15
|
-
className,
|
|
16
|
-
key,
|
|
17
|
-
options,
|
|
18
|
-
value,
|
|
19
|
-
disabled,
|
|
20
|
-
readOnly,
|
|
21
|
-
setProps,
|
|
22
|
-
persistence,
|
|
23
|
-
persisted_props,
|
|
24
|
-
persistence_type,
|
|
25
|
-
loading_state,
|
|
26
|
-
batchPropsNames
|
|
27
|
-
} = props;
|
|
28
|
-
|
|
29
|
-
// 批属性监听
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (batchPropsNames && batchPropsNames.length !== 0) {
|
|
32
|
-
let _batchPropsValues = {};
|
|
33
|
-
for (let propName of batchPropsNames) {
|
|
34
|
-
_batchPropsValues[propName] = props[propName];
|
|
35
|
-
}
|
|
36
|
-
setProps({
|
|
37
|
-
batchPropsValues: _batchPropsValues
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const context = useContext(PropsContext)
|
|
43
|
-
|
|
44
|
-
const onChange = e => {
|
|
45
|
-
if (!readOnly) {
|
|
46
|
-
setProps({ value: e })
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 返回定制化的前端组件
|
|
51
7
|
return (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
isString(className) ?
|
|
56
|
-
className :
|
|
57
|
-
(className ? useCss(className) : undefined)
|
|
58
|
-
}
|
|
59
|
-
style={style}
|
|
60
|
-
key={key}
|
|
61
|
-
options={options}
|
|
62
|
-
value={value}
|
|
63
|
-
disabled={
|
|
64
|
-
context && !isUndefined(context.componentDisabled) ?
|
|
65
|
-
context.componentDisabled :
|
|
66
|
-
disabled
|
|
67
|
-
}
|
|
68
|
-
onChange={onChange}
|
|
69
|
-
persistence={persistence}
|
|
70
|
-
persisted_props={persisted_props}
|
|
71
|
-
persistence_type={persistence_type}
|
|
72
|
-
data-dash-is-loading={
|
|
73
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
74
|
-
}
|
|
75
|
-
/>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdCheckboxGroup {...props} />
|
|
10
|
+
</Suspense>
|
|
76
11
|
);
|
|
77
12
|
}
|
|
78
13
|
|
|
@@ -190,4 +125,7 @@ AntdCheckboxGroup.defaultProps = {
|
|
|
190
125
|
batchPropsNames: []
|
|
191
126
|
}
|
|
192
127
|
|
|
193
|
-
export default AntdCheckboxGroup;
|
|
128
|
+
export default AntdCheckboxGroup;
|
|
129
|
+
|
|
130
|
+
export const propTypes = AntdCheckboxGroup.propTypes;
|
|
131
|
+
export const defaultProps = AntdCheckboxGroup.defaultProps;
|