@vtx/components 4.0.0-beta.7 → 4.0.0-beta.71
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/README.md +19 -19
- package/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +53 -52
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-color-picker/index.js +138 -33
- package/es/vtx-color-picker/style/index.js +36 -12
- package/es/vtx-combogrid/Combogrid.js +16 -10
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-combogrid/style/index.js +4 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -132
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -9
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/index.js +2 -2
- package/es/vtx-datagrid/columnState.js +64 -0
- package/es/vtx-datagrid/index.js +114 -35
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -33
- package/es/vtx-export-async/History.js +11 -3
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +18 -17
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +155 -43
- package/es/vtx-import/result.js +6 -2
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +31 -20
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-input/TextArea/index.js +11 -6
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +7 -13
- package/es/vtx-page-layout/TableLayout.js +24 -14
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +8 -14
- package/es/vtx-page-layout/container.js +8 -7
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +50 -40
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +65 -5
- package/es/vtx-provider/locale/zh_CN.js +75 -5
- package/es/vtx-provider/useStyle/index.js +25 -21
- package/es/vtx-scrollable-row/index.js +38 -28
- package/es/vtx-search/index.js +18 -13
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +132 -46
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +34 -25
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +104 -40
- package/es/vtx-tree-select/index.js +75 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +291 -113
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +54 -52
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-color-picker/index.js +139 -34
- package/lib/vtx-color-picker/style/index.js +36 -12
- package/lib/vtx-combogrid/Combogrid.js +16 -10
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-combogrid/style/index.js +4 -4
- package/lib/vtx-datagrid/Store/Provide.js +116 -138
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -10
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/index.js +2 -2
- package/lib/vtx-datagrid/columnState.js +73 -0
- package/lib/vtx-datagrid/index.js +115 -35
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -34
- package/lib/vtx-export-async/History.js +11 -3
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +18 -17
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +154 -42
- package/lib/vtx-import/result.js +6 -2
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +30 -19
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-input/TextArea/index.js +11 -6
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +8 -14
- package/lib/vtx-page-layout/TableLayout.js +24 -14
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +9 -15
- package/lib/vtx-page-layout/container.js +8 -7
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +49 -40
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +65 -5
- package/lib/vtx-provider/locale/zh_CN.js +75 -5
- package/lib/vtx-provider/useStyle/index.js +25 -21
- package/lib/vtx-scrollable-row/index.js +38 -28
- package/lib/vtx-search/index.js +18 -13
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +134 -48
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +32 -23
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +102 -38
- package/lib/vtx-tree-select/index.js +75 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +289 -113
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
- package/package.json +238 -222
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
|
@@ -7,121 +7,17 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
8
|
var genVtxSplitPaneStyle = function genVtxSplitPaneStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
|
-
return _defineProperty(
|
|
10
|
+
return _defineProperty({}, componentCls, {
|
|
11
11
|
height: '100%',
|
|
12
12
|
overflow: 'hidden',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
height: '100%',
|
|
20
|
-
width: 6,
|
|
21
|
-
zIndex: 1
|
|
22
|
-
}, '&-left,&-right', {
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
top: '50%',
|
|
25
|
-
zIndex: 1001,
|
|
26
|
-
opacity: 0,
|
|
27
|
-
width: '16px !important',
|
|
28
|
-
height: '24px !important',
|
|
29
|
-
backgroundColor: token.colorBorder,
|
|
30
|
-
color: token.colorTextSecondary,
|
|
31
|
-
borderColor: "transparent !important",
|
|
32
|
-
fontSize: 12,
|
|
33
|
-
'&:hover': {
|
|
34
|
-
color: token.colorTextSecondary,
|
|
35
|
-
backgroundColor: "".concat(token.colorPrimaryBg, " !important")
|
|
36
|
-
}
|
|
37
|
-
}), '&-left', {
|
|
38
|
-
transform: 'translate(-16px,-50%)'
|
|
39
|
-
}), '&-right', {
|
|
40
|
-
transform: 'translate(6px,-50%)'
|
|
41
|
-
}), '&::after', {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
content: "' '",
|
|
44
|
-
left: 0,
|
|
45
|
-
top: 0,
|
|
46
|
-
bottom: 0,
|
|
47
|
-
right: 4,
|
|
48
|
-
borderRadius: token.borderRadius
|
|
49
|
-
}), '&:hover', _defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
50
|
-
opacity: 1
|
|
51
|
-
})), '.ant-btn-icon', {
|
|
52
|
-
color: token.colorTextSecondary
|
|
53
|
-
})
|
|
54
|
-
}, "&[data-resize-handle-state='hover']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
55
|
-
opacity: 1
|
|
56
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
57
|
-
background: "linear-gradient(to bottom , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
58
|
-
})), "&[data-resize-handle-state='active']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
59
|
-
opacity: 1
|
|
60
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
61
|
-
background: "linear-gradient(to bottom , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
62
|
-
})), "&[data-resize-handle-state='drag']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
63
|
-
opacity: 1
|
|
64
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
65
|
-
background: "linear-gradient(to bottom , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
66
|
-
})), "&[data-resize-handle-state='inactive']", {
|
|
67
|
-
backgroundColor: 'transparent'
|
|
68
|
-
}),
|
|
69
|
-
'&-item': {
|
|
70
|
-
position: 'relative',
|
|
71
|
-
display: 'inline-block',
|
|
72
|
-
height: '100%',
|
|
73
|
-
verticalAlign: 'top'
|
|
13
|
+
backgroundColor: token.colorBgLayout,
|
|
14
|
+
'.ant-splitter-bar .ant-splitter-bar-dragger::before': {
|
|
15
|
+
background: 'transparent'
|
|
16
|
+
},
|
|
17
|
+
'.ant-splitter-bar .ant-splitter-bar-dragger-active::before': {
|
|
18
|
+
background: 'var(--ant-control-item-bg-active)'
|
|
74
19
|
}
|
|
75
|
-
}
|
|
76
|
-
borderRight: "1px solid ".concat(token.colorBorderSecondary),
|
|
77
|
-
'&:hover': {
|
|
78
|
-
borderRight: "1px solid ".concat(token.colorBorderSecondary),
|
|
79
|
-
transition: 'border-right 0.2s ease-in-out'
|
|
80
|
-
}
|
|
81
|
-
}), '&-resizer-right', {
|
|
82
|
-
borderLeft: "1px solid ".concat(token.colorBorderSecondary),
|
|
83
|
-
'&:hover': {
|
|
84
|
-
borderLeft: "1px solid ".concat(token.colorBorderSecondary),
|
|
85
|
-
transition: 'border-right 0.2s ease-in-out'
|
|
86
|
-
}
|
|
87
|
-
}), '&-resizer.disabled', {
|
|
88
|
-
cursor: 'not-allowed'
|
|
89
|
-
}), '&-resizer.disabled:hover', {
|
|
90
|
-
borderColor: 'transparent'
|
|
91
|
-
})), "".concat(componentCls, "-vertical"), _defineProperty({}, "".concat(componentCls, "-outer"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
92
|
-
'&-resizer': _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
93
|
-
width: '100%',
|
|
94
|
-
height: 6
|
|
95
|
-
}, '&-left,&-right', {
|
|
96
|
-
top: 'auto',
|
|
97
|
-
left: '50%',
|
|
98
|
-
height: '16px !important',
|
|
99
|
-
width: '24px !important'
|
|
100
|
-
}), '&-left', {
|
|
101
|
-
transform: 'translate(-50%,-16px)'
|
|
102
|
-
}), '&-right', {
|
|
103
|
-
transform: 'translate(-50%, 6px)'
|
|
104
|
-
}), '&::after', {
|
|
105
|
-
left: 0,
|
|
106
|
-
top: 0,
|
|
107
|
-
bottom: 4,
|
|
108
|
-
right: 0
|
|
109
|
-
})
|
|
110
|
-
}, "&[data-resize-handle-state='hover']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
111
|
-
opacity: 1
|
|
112
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
113
|
-
background: "linear-gradient(to right , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
114
|
-
})), "&[data-resize-handle-state='active']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
115
|
-
opacity: 1
|
|
116
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
117
|
-
background: "linear-gradient(to right , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
118
|
-
})), "&[data-resize-handle-state='drag']", _defineProperty(_defineProperty({}, '.vtx-split-pane-outer-resizer-left,.vtx-split-pane-outer-resizer-right', {
|
|
119
|
-
opacity: 1
|
|
120
|
-
}), '.vtx-split-pane-outer-resizer::after', {
|
|
121
|
-
background: "linear-gradient(to right , rgba(0,0,0,0), ".concat(token.colorSplit, ", rgba(0,0,0,0)) !important")
|
|
122
|
-
})), "&[data-resize-handle-state='inactive']", {
|
|
123
|
-
backgroundColor: 'transparent'
|
|
124
|
-
})));
|
|
20
|
+
});
|
|
125
21
|
};
|
|
126
22
|
export function useStyle(prefixCls) {
|
|
127
23
|
return useAntdStyle(prefixCls, function (token) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["value", "format"]
|
|
2
|
+
var _excluded = ["value", "format"],
|
|
3
|
+
_excluded2 = ["value", "format"];
|
|
3
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -12,6 +13,7 @@ import { TimePicker } from 'antd';
|
|
|
12
13
|
import dayjs from 'dayjs';
|
|
13
14
|
import PropTypes from 'prop-types';
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
var RangePicker = TimePicker.RangePicker;
|
|
15
17
|
var VtxTimePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
16
18
|
var value = props.value,
|
|
17
19
|
_props$format = props.format,
|
|
@@ -28,7 +30,31 @@ var VtxTimePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
28
30
|
}
|
|
29
31
|
}));
|
|
30
32
|
});
|
|
33
|
+
|
|
34
|
+
// 时间范围选择器
|
|
35
|
+
var VtxTimeRangePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
|
+
var value = props.value,
|
|
37
|
+
_props$format2 = props.format,
|
|
38
|
+
format = _props$format2 === void 0 ? 'HH:mm:ss' : _props$format2,
|
|
39
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
40
|
+
var newValue = value && Array.isArray(value) ? value.map(function (item) {
|
|
41
|
+
return item ? dayjs.isDayjs(item) ? item : dayjs(item, format) : null;
|
|
42
|
+
}) : null;
|
|
43
|
+
return /*#__PURE__*/_jsx(RangePicker, _objectSpread(_objectSpread({
|
|
44
|
+
value: newValue,
|
|
45
|
+
format: format
|
|
46
|
+
}, rest), {}, {
|
|
47
|
+
ref: ref,
|
|
48
|
+
style: {
|
|
49
|
+
width: '100%'
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
});
|
|
31
53
|
VtxTimePicker.displayName = 'VtxTimePicker';
|
|
54
|
+
VtxTimeRangePicker.displayName = 'VtxTimeRangePicker';
|
|
55
|
+
|
|
56
|
+
// 将范围选择器作为 VtxTimePicker 的属性
|
|
57
|
+
VtxTimePicker.VtxTimeRangePicker = VtxTimeRangePicker;
|
|
32
58
|
export { VtxTimePicker };
|
|
33
59
|
export default VtxTimePicker;
|
|
34
60
|
VtxTimePicker.propTypes = {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import React, { useContext } from 'react';
|
|
10
|
+
import { Transfer } from 'antd';
|
|
11
|
+
import { useStyle } from "./style";
|
|
12
|
+
import { VtxProvider } from "../vtx-provider";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
function VtxTransfer(props) {
|
|
15
|
+
var _useContext = useContext(VtxProvider),
|
|
16
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
17
|
+
var prefixCls = getPrefixCls('VtxTransfer', props.prefixCls);
|
|
18
|
+
var _useStyle = useStyle(prefixCls),
|
|
19
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
20
|
+
hashId = _useStyle.hashId;
|
|
21
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(props), props));
|
|
22
|
+
return wrapSSR( /*#__PURE__*/_jsx(Transfer, _objectSpread({
|
|
23
|
+
classNames: {
|
|
24
|
+
root: classnames(hashId, prefixCls)
|
|
25
|
+
}
|
|
26
|
+
}, rest)));
|
|
27
|
+
}
|
|
28
|
+
VtxTransfer.propTypes = {};
|
|
29
|
+
export default VtxTransfer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
|
+
var genStyle = function genStyle(token) {
|
|
9
|
+
var componentCls = token.componentCls;
|
|
10
|
+
return _defineProperty({}, componentCls, {});
|
|
11
|
+
};
|
|
12
|
+
export function useStyle(prefixCls) {
|
|
13
|
+
return useAntdStyle('', function (token) {
|
|
14
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
15
|
+
componentCls: ".".concat(prefixCls)
|
|
16
|
+
});
|
|
17
|
+
return [genStyle(_token)];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["leftColumns", "rightColumns"],
|
|
3
|
+
_excluded2 = ["popoverProps", "disabled", "leftColumns", "rightColumns", "styles"];
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
import React, { useState, useContext } from 'react';
|
|
19
|
+
import { Transfer } from 'antd';
|
|
20
|
+
import { useStyle } from "./style";
|
|
21
|
+
import { VtxProvider } from "../vtx-provider";
|
|
22
|
+
import { Select, Popover, Table } from 'antd';
|
|
23
|
+
import VtxIcon from "../vtx-icon";
|
|
24
|
+
import VtxDatagrid from "../vtx-datagrid";
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
var mockTags = ['cat', 'dog', 'bird'];
|
|
27
|
+
var mockData = Array.from({
|
|
28
|
+
length: 20
|
|
29
|
+
}).map(function (_, i) {
|
|
30
|
+
return {
|
|
31
|
+
key: i.toString(),
|
|
32
|
+
title: "content".concat(i + 1),
|
|
33
|
+
description: "description of content".concat(i + 1),
|
|
34
|
+
tag: mockTags[i % 3]
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
var TableTransfer = function TableTransfer(props) {
|
|
38
|
+
var leftColumns = props.leftColumns,
|
|
39
|
+
rightColumns = props.rightColumns,
|
|
40
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
41
|
+
return /*#__PURE__*/_jsx(Transfer, _objectSpread(_objectSpread({
|
|
42
|
+
style: {
|
|
43
|
+
width: '100%'
|
|
44
|
+
}
|
|
45
|
+
}, restProps), {}, {
|
|
46
|
+
children: function children(_ref) {
|
|
47
|
+
var direction = _ref.direction,
|
|
48
|
+
filteredItems = _ref.filteredItems,
|
|
49
|
+
onItemSelect = _ref.onItemSelect,
|
|
50
|
+
onItemSelectAll = _ref.onItemSelectAll,
|
|
51
|
+
listSelectedKeys = _ref.selectedKeys,
|
|
52
|
+
listDisabled = _ref.disabled;
|
|
53
|
+
var columns = direction === 'left' ? leftColumns : rightColumns;
|
|
54
|
+
var rowSelection = {
|
|
55
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
56
|
+
return {
|
|
57
|
+
disabled: listDisabled
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
onChange: function onChange(selectedRowKeys) {
|
|
61
|
+
onItemSelectAll(selectedRowKeys, 'replace');
|
|
62
|
+
},
|
|
63
|
+
selectedRowKeys: listSelectedKeys,
|
|
64
|
+
selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT, Table.SELECTION_NONE]
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/_jsx(Table, {
|
|
67
|
+
rowSelection: rowSelection,
|
|
68
|
+
columns: columns,
|
|
69
|
+
dataSource: filteredItems,
|
|
70
|
+
size: "small",
|
|
71
|
+
style: {
|
|
72
|
+
pointerEvents: listDisabled ? 'none' : undefined
|
|
73
|
+
},
|
|
74
|
+
onRow: function onRow(_ref2) {
|
|
75
|
+
var key = _ref2.key,
|
|
76
|
+
itemDisabled = _ref2.disabled;
|
|
77
|
+
return {
|
|
78
|
+
onClick: function onClick() {
|
|
79
|
+
if (itemDisabled || listDisabled) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
onItemSelect(key, !listSelectedKeys.includes(key));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
function TransferSelect(props) {
|
|
91
|
+
var _useState = useState(function () {
|
|
92
|
+
return [];
|
|
93
|
+
}),
|
|
94
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
95
|
+
selectedRowKeys = _useState2[0],
|
|
96
|
+
setSelectedRowKeys = _useState2[1];
|
|
97
|
+
var _useState3 = useState([]),
|
|
98
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
99
|
+
targetKeys = _useState4[0],
|
|
100
|
+
setTargetKeys = _useState4[1];
|
|
101
|
+
var onChange = function onChange(nextTargetKeys) {
|
|
102
|
+
setTargetKeys(nextTargetKeys);
|
|
103
|
+
};
|
|
104
|
+
var _useState5 = useState(false),
|
|
105
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
106
|
+
visible = _useState6[0],
|
|
107
|
+
setVisible = _useState6[1];
|
|
108
|
+
var _useContext = useContext(VtxProvider),
|
|
109
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
110
|
+
var prefixCls = getPrefixCls('VtxTransferSelect', props.prefixCls);
|
|
111
|
+
var _useStyle = useStyle(prefixCls),
|
|
112
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
113
|
+
hashId = _useStyle.hashId;
|
|
114
|
+
var _props$popoverProps = props.popoverProps,
|
|
115
|
+
popoverProps = _props$popoverProps === void 0 ? {} : _props$popoverProps,
|
|
116
|
+
_props$disabled = props.disabled,
|
|
117
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
118
|
+
leftColumns = props.leftColumns,
|
|
119
|
+
rightColumns = props.rightColumns,
|
|
120
|
+
styles = props.styles,
|
|
121
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
122
|
+
return wrapSSR( /*#__PURE__*/_jsx(Select, {
|
|
123
|
+
suffixIcon: /*#__PURE__*/_jsx(VtxIcon, {
|
|
124
|
+
type: "downOutlined",
|
|
125
|
+
fileType: "svg"
|
|
126
|
+
}),
|
|
127
|
+
styles: _objectSpread({}, styles),
|
|
128
|
+
popupRender: function popupRender(node) {
|
|
129
|
+
return /*#__PURE__*/_jsx(TableTransfer, {
|
|
130
|
+
classNames: {
|
|
131
|
+
root: classnames(hashId, prefixCls)
|
|
132
|
+
},
|
|
133
|
+
dataSource: mockData,
|
|
134
|
+
onChange: onChange,
|
|
135
|
+
leftColumns: leftColumns,
|
|
136
|
+
rightColumns: rightColumns,
|
|
137
|
+
targetKeys: targetKeys
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
TransferSelect.propTypes = {};
|
|
143
|
+
export default TransferSelect;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
|
+
var genStyle = function genStyle(token) {
|
|
9
|
+
var componentCls = token.componentCls;
|
|
10
|
+
return _defineProperty({}, componentCls, {});
|
|
11
|
+
};
|
|
12
|
+
export function useStyle(prefixCls) {
|
|
13
|
+
return useAntdStyle('', function (token) {
|
|
14
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
15
|
+
componentCls: ".".concat(prefixCls)
|
|
16
|
+
});
|
|
17
|
+
return [genStyle(_token)];
|
|
18
|
+
});
|
|
19
|
+
}
|