@vtx/components 4.0.0-beta.9 → 4.0.0-beta.90
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 +6 -6
- 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-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -140
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/index.js +2 -1
- package/es/vtx-datagrid/ToolBar/style.js +6 -3
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +134 -37
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +108 -18
- 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 +2 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -38
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +18 -8
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/style/index.js +6 -4
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +143 -42
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +29 -19
- package/es/vtx-import2/style/index.js +59 -8
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -2
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +33 -31
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_GB.js +1 -1
- package/es/vtx-provider/locale/en_US.js +58 -4
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +30 -12
- package/es/vtx-search/style/index.js +6 -3
- package/es/vtx-select/index.js +123 -40
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +42 -34
- 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 +27 -9
- package/es/vtx-tree-select/index.js +81 -110
- 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 +41 -32
- package/es/vtx-wang-editor/style/index.less +12 -12
- 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 +6 -6
- 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-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +112 -142
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/index.js +2 -1
- package/lib/vtx-datagrid/ToolBar/style.js +6 -3
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +134 -37
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +108 -18
- 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 +2 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -39
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +18 -8
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/style/index.js +6 -4
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +141 -43
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -19
- package/lib/vtx-import2/style/index.js +59 -8
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -2
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +33 -31
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_GB.js +1 -1
- package/lib/vtx-provider/locale/en_US.js +58 -4
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +32 -12
- package/lib/vtx-search/style/index.js +6 -3
- package/lib/vtx-select/index.js +125 -42
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +40 -31
- 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 +27 -9
- package/lib/vtx-tree-select/index.js +81 -112
- 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 +39 -30
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +239 -238
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/es/vtx-select/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["value", "mode", "size", "onChange", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "showAll", "selectStyle", "selectAll", "selectSearchAll", "defaultBindBodyToPopupContainer", "customEnumText", "showSearch", "optionFilterProp", "onSearch"],
|
|
2
|
+
_excluded2 = ["key", "value", "children"],
|
|
3
|
+
_excluded3 = ["onSearch", "optionFilterProp"];
|
|
1
4
|
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
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -9,6 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
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; }
|
|
10
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
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; }
|
|
12
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
18
|
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."); }
|
|
14
19
|
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); }
|
|
@@ -26,6 +31,7 @@ import { VtxProvider, useIntl } from "../vtx-provider";
|
|
|
26
31
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
32
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
33
|
var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
+
var _props$options;
|
|
29
35
|
var intl = useIntl();
|
|
30
36
|
var _useState = useState(0),
|
|
31
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -58,16 +64,25 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
64
|
_props$defaultBindBod = props.defaultBindBodyToPopupContainer,
|
|
59
65
|
defaultBindBodyToPopupContainer = _props$defaultBindBod === void 0 ? true : _props$defaultBindBod,
|
|
60
66
|
_props$customEnumText = props.customEnumText,
|
|
61
|
-
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText
|
|
67
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
68
|
+
showSearch = props.showSearch,
|
|
69
|
+
optionFilterProp = props.optionFilterProp,
|
|
70
|
+
_onSearch = props.onSearch,
|
|
71
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
62
72
|
var TextEnum = _objectSpread({
|
|
63
73
|
selectAllText: intl.getMessage('select.selectAll', '全选'),
|
|
64
74
|
defaultPlaceholderText: intl.getMessage('tableForm.selectPlaceholder', '请选择'),
|
|
65
75
|
emptyDescriptionText: intl.getMessage('select.empty', '暂无数据')
|
|
66
76
|
}, customEnumText);
|
|
77
|
+
var _useContext = useContext(VtxProvider),
|
|
78
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
79
|
+
var prefixCls = getPrefixCls('select', props.prefixCls);
|
|
80
|
+
var _useStyle = useStyle(prefixCls),
|
|
81
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
82
|
+
hashId = _useStyle.hashId;
|
|
67
83
|
useEffect(function () {
|
|
68
84
|
if ((mode === 'multiple' || mode === 'tags') && elRef.current) {
|
|
69
85
|
var element = elRef.current;
|
|
70
|
-
|
|
71
86
|
// 立即设置一次
|
|
72
87
|
setPopWidth(element.clientWidth);
|
|
73
88
|
|
|
@@ -92,21 +107,67 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
92
107
|
};
|
|
93
108
|
}
|
|
94
109
|
}, [mode]);
|
|
95
|
-
var
|
|
110
|
+
var mergedChildren = Array.isArray(props.children) ? props.children : React.Children.toArray(props.children);
|
|
111
|
+
var optionsAsElements = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.map(function (v) {
|
|
112
|
+
var _v$key;
|
|
113
|
+
return /*#__PURE__*/React.isValidElement(v) ? v : /*#__PURE__*/React.createElement(Select.Option, {
|
|
114
|
+
key: (_v$key = v.key) !== null && _v$key !== void 0 ? _v$key : v.value,
|
|
115
|
+
value: v.value,
|
|
116
|
+
label: v.label
|
|
117
|
+
});
|
|
118
|
+
})) || [];
|
|
119
|
+
var normalizeChild = function normalizeChild(child) {
|
|
120
|
+
var _ref;
|
|
121
|
+
if (! /*#__PURE__*/React.isValidElement(child)) return child;
|
|
122
|
+
var _child$props = child.props,
|
|
123
|
+
key = _child$props.key,
|
|
124
|
+
value = _child$props.value,
|
|
125
|
+
label = _child$props.children,
|
|
126
|
+
rest = _objectWithoutProperties(_child$props, _excluded2);
|
|
127
|
+
var optionValue = (_ref = value !== null && value !== void 0 ? value : key) !== null && _ref !== void 0 ? _ref : child.key;
|
|
128
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, rest), {}, {
|
|
129
|
+
key: key,
|
|
130
|
+
value: optionValue
|
|
131
|
+
}));
|
|
132
|
+
};
|
|
133
|
+
var finalChildren = [].concat(_toConsumableArray(optionsAsElements), _toConsumableArray(mergedChildren.map(normalizeChild)));
|
|
134
|
+
var getOptionValue = function getOptionValue(item) {
|
|
135
|
+
var _ref2, _itemProps$value;
|
|
136
|
+
var itemProps = (item === null || item === void 0 ? void 0 : item.props) || {};
|
|
137
|
+
return (_ref2 = (_itemProps$value = itemProps.value) !== null && _itemProps$value !== void 0 ? _itemProps$value : item.value) !== null && _ref2 !== void 0 ? _ref2 : item.key;
|
|
138
|
+
};
|
|
139
|
+
var getOptionLabel = function getOptionLabel(item) {
|
|
140
|
+
var _ref3, _itemProps$children;
|
|
141
|
+
var itemProps = (item === null || item === void 0 ? void 0 : item.props) || {};
|
|
142
|
+
return (_ref3 = (_itemProps$children = itemProps.children) !== null && _itemProps$children !== void 0 ? _itemProps$children : itemProps.label) !== null && _ref3 !== void 0 ? _ref3 : item.label;
|
|
143
|
+
};
|
|
144
|
+
var getSelectedValue = function getSelectedValue(item) {
|
|
145
|
+
if (isObject(item)) {
|
|
146
|
+
var _item$value;
|
|
147
|
+
return (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.key;
|
|
148
|
+
}
|
|
149
|
+
return item;
|
|
150
|
+
};
|
|
151
|
+
var normalizedOptions = finalChildren.filter(React.isValidElement).map(function (item) {
|
|
152
|
+
return {
|
|
153
|
+
value: getOptionValue(item),
|
|
154
|
+
label: getOptionLabel(item),
|
|
155
|
+
raw: item
|
|
156
|
+
};
|
|
157
|
+
});
|
|
96
158
|
var getContent = function getContent() {
|
|
97
159
|
var child = {};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
child[item.key] = item === null || item === void 0 || (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.children;
|
|
160
|
+
normalizedOptions.forEach(function (item) {
|
|
161
|
+
child[item.value] = item.label;
|
|
101
162
|
});
|
|
102
163
|
var getChildren = function getChildren() {
|
|
103
164
|
var child = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
104
165
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
|
105
|
-
var key =
|
|
166
|
+
var key = getSelectedValue(value);
|
|
106
167
|
return child[key] || '';
|
|
107
168
|
};
|
|
108
169
|
return /*#__PURE__*/_jsx("div", {
|
|
109
|
-
className: "
|
|
170
|
+
className: classnames("".concat(prefixCls, "-all-list"), hashId),
|
|
110
171
|
children: Array.isArray(value) && value.length ? value.map(function (item, index) {
|
|
111
172
|
var name = getChildren(child, item);
|
|
112
173
|
return /*#__PURE__*/_jsx(Tag, {
|
|
@@ -118,10 +179,13 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
118
179
|
e.preventDefault();
|
|
119
180
|
var valueClone = _toConsumableArray(value);
|
|
120
181
|
valueClone.splice(index, 1);
|
|
121
|
-
var
|
|
122
|
-
|
|
182
|
+
var selectedValueSet = new Set(valueClone.map(getSelectedValue));
|
|
183
|
+
var options = normalizedOptions.filter(function (ite) {
|
|
184
|
+
return selectedValueSet.has(ite.value);
|
|
185
|
+
}).map(function (ite) {
|
|
186
|
+
return ite.raw;
|
|
123
187
|
});
|
|
124
|
-
_onChange(valueClone, options);
|
|
188
|
+
_onChange && _onChange(valueClone, options);
|
|
125
189
|
},
|
|
126
190
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
127
191
|
title: name,
|
|
@@ -134,16 +198,45 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
134
198
|
})
|
|
135
199
|
});
|
|
136
200
|
};
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
201
|
+
var defaultOptionFilterProp = ['label', 'children'];
|
|
202
|
+
var handleSearch = function handleSearch(value) {
|
|
203
|
+
setSearchValue(value ? String(value).toLowerCase() : '');
|
|
204
|
+
_onSearch && _onSearch(value);
|
|
205
|
+
};
|
|
206
|
+
var getSearchProps = function getSearchProps() {
|
|
207
|
+
if (showSearch && _typeof(showSearch) === 'object') {
|
|
208
|
+
var showSearchOnSearch = showSearch.onSearch,
|
|
209
|
+
showSearchOptionFilterProp = showSearch.optionFilterProp,
|
|
210
|
+
searchConfig = _objectWithoutProperties(showSearch, _excluded3);
|
|
211
|
+
return {
|
|
212
|
+
showSearch: _objectSpread(_objectSpread({}, searchConfig), {}, {
|
|
213
|
+
optionFilterProp: showSearchOptionFilterProp || optionFilterProp || defaultOptionFilterProp,
|
|
214
|
+
onSearch: function onSearch(value) {
|
|
215
|
+
setSearchValue(value ? String(value).toLowerCase() : '');
|
|
216
|
+
showSearchOnSearch && showSearchOnSearch(value);
|
|
217
|
+
_onSearch && _onSearch(value);
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
showSearch: showSearch === undefined ? true : showSearch,
|
|
224
|
+
optionFilterProp: optionFilterProp || defaultOptionFilterProp
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
var newProps = _objectSpread(_objectSpread(_objectSpread({}, getSearchProps()), {}, {
|
|
140
228
|
placeholder: TextEnum.defaultPlaceholderText,
|
|
141
|
-
allowClear: true
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
229
|
+
allowClear: true,
|
|
230
|
+
value: value,
|
|
231
|
+
mode: mode,
|
|
232
|
+
size: size,
|
|
233
|
+
//同步button大小
|
|
234
|
+
onChange: _onChange,
|
|
235
|
+
maxTagCount: maxTagCount,
|
|
236
|
+
maxTagTextLength: maxTagTextLength,
|
|
237
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
238
|
+
}, rest), {}, {
|
|
239
|
+
onSearch: handleSearch,
|
|
147
240
|
onBlur: function onBlur(e) {
|
|
148
241
|
setSearchValue('');
|
|
149
242
|
props.onBlur && props.onBlur(e);
|
|
@@ -166,13 +259,13 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
166
259
|
return e.preventDefault();
|
|
167
260
|
},
|
|
168
261
|
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
169
|
-
indeterminate: valueLength && valueLength <
|
|
170
|
-
checked: valueLength && valueLength ===
|
|
262
|
+
indeterminate: valueLength && valueLength < finalChildren.length,
|
|
263
|
+
checked: valueLength && valueLength === finalChildren.length,
|
|
171
264
|
onChange: function onChange(e) {
|
|
172
265
|
if (e.target.checked) {
|
|
173
|
-
var tempChildren =
|
|
266
|
+
var tempChildren = finalChildren.filter(function (item) {
|
|
174
267
|
if (selectSearchAll && searchValue) {
|
|
175
|
-
return String(item
|
|
268
|
+
return String(getOptionLabel(item)).toLowerCase().indexOf(searchValue) > -1;
|
|
176
269
|
}
|
|
177
270
|
return true;
|
|
178
271
|
});
|
|
@@ -180,13 +273,13 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
180
273
|
if (props.labelInValue) {
|
|
181
274
|
keys = tempChildren.map(function (item) {
|
|
182
275
|
return {
|
|
183
|
-
label: item
|
|
184
|
-
value: item
|
|
276
|
+
label: getOptionLabel(item),
|
|
277
|
+
value: getOptionValue(item)
|
|
185
278
|
};
|
|
186
279
|
});
|
|
187
280
|
} else {
|
|
188
281
|
keys = tempChildren.map(function (item) {
|
|
189
|
-
return item
|
|
282
|
+
return getOptionValue(item);
|
|
190
283
|
});
|
|
191
284
|
}
|
|
192
285
|
_onChange && _onChange(keys, tempChildren);
|
|
@@ -206,21 +299,11 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
206
299
|
});
|
|
207
300
|
}
|
|
208
301
|
}
|
|
209
|
-
var _useContext = useContext(VtxProvider),
|
|
210
|
-
getPrefixCls = _useContext.getPrefixCls;
|
|
211
|
-
var prefixCls = getPrefixCls('select', props.prefixCls);
|
|
212
|
-
var _useStyle = useStyle(prefixCls),
|
|
213
|
-
wrapSSR = _useStyle.wrapSSR,
|
|
214
|
-
hashId = _useStyle.hashId;
|
|
215
302
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
216
|
-
className: classnames(prefixCls, hashId, {
|
|
217
|
-
'vtx-multi-select': mode == 'multiple' || mode == 'tags'
|
|
218
|
-
}),
|
|
303
|
+
className: classnames(prefixCls, hashId, _defineProperty({}, "".concat(prefixCls, "-multi"), mode == 'multiple' || mode == 'tags')),
|
|
219
304
|
id: elId.current,
|
|
220
305
|
ref: elRef,
|
|
221
|
-
style: _objectSpread(
|
|
222
|
-
paddingRight: (mode == 'multiple' || mode == 'tags') && showAll ? 32 : 0
|
|
223
|
-
}),
|
|
306
|
+
style: _objectSpread({}, props.style),
|
|
224
307
|
children: /*#__PURE__*/_jsxs(Space.Compact, {
|
|
225
308
|
style: {
|
|
226
309
|
width: '100%'
|
|
@@ -238,7 +321,7 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
238
321
|
style: _objectSpread({
|
|
239
322
|
width: '100%'
|
|
240
323
|
}, selectStyle),
|
|
241
|
-
children:
|
|
324
|
+
children: finalChildren
|
|
242
325
|
})), (mode == 'multiple' || mode == 'tags') && showAll ? /*#__PURE__*/_jsx(Popover, {
|
|
243
326
|
content: getContent(),
|
|
244
327
|
placement: "bottomRight",
|
|
@@ -7,66 +7,21 @@ 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 genVtxSelectStyle = function genVtxSelectStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
|
-
return _defineProperty(_defineProperty({}, componentCls, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
top: '0',
|
|
18
|
-
verticalAlign: 'top'
|
|
19
|
-
},
|
|
20
|
-
'.vtx-all-list': {
|
|
21
|
-
position: 'absolute',
|
|
22
|
-
zIndex: 999,
|
|
23
|
-
boxSizing: 'border-box',
|
|
24
|
-
width: '100%',
|
|
25
|
-
padding: '5px',
|
|
26
|
-
boxShadow: '0 2px 8px #d9d9d9',
|
|
27
|
-
backgroundColor: 'red !important'
|
|
28
|
-
},
|
|
29
|
-
'.ant-select-selection--multiple': {
|
|
30
|
-
maxHeight: '32px',
|
|
31
|
-
overflow: 'hidden'
|
|
32
|
-
}
|
|
33
|
-
}), '.vtx-multi-select', {
|
|
34
|
-
position: 'relative',
|
|
35
|
-
display: 'inline-block',
|
|
36
|
-
width: '100%',
|
|
37
|
-
maxHeight: '32px !important',
|
|
38
|
-
boxSizing: 'border-box',
|
|
39
|
-
'.vtx-select-count': {
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
top: 0,
|
|
42
|
-
right: 0,
|
|
43
|
-
verticalAlign: 'top',
|
|
44
|
-
borderLeft: 'none',
|
|
45
|
-
borderTopLeftRadius: 0,
|
|
46
|
-
'border-bottom-left-radius': 0
|
|
47
|
-
},
|
|
48
|
-
'.vtx-all-list': {
|
|
49
|
-
position: 'absolute',
|
|
50
|
-
zIndex: 999,
|
|
51
|
-
boxSizing: 'border-box',
|
|
52
|
-
width: '100%',
|
|
53
|
-
padding: '5px',
|
|
54
|
-
boxShadow: '0 2px 8px #d9d9d9'
|
|
55
|
-
},
|
|
56
|
-
'.ant-select-selector': {
|
|
57
|
-
'border-top-right-radius': 0,
|
|
58
|
-
'border-bottom-right-radius': 0,
|
|
59
|
-
maxHeight: '32px !important',
|
|
60
|
-
overflow: 'hidden'
|
|
61
|
-
},
|
|
62
|
-
'.ant-select-selection--multiple': {
|
|
63
|
-
maxHeight: '32px',
|
|
64
|
-
overflow: 'hidden'
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty({
|
|
11
|
+
width: "100%"
|
|
12
|
+
}, '.ant-select', {
|
|
13
|
+
overflow: "hidden"
|
|
14
|
+
})), "".concat(componentCls, "-multi"), {
|
|
15
|
+
".ant-select-content": {
|
|
16
|
+
flexWrap: "nowrap"
|
|
65
17
|
}
|
|
18
|
+
}), "".concat(componentCls, "-all-list"), {
|
|
19
|
+
maxHeight: 300,
|
|
20
|
+
overflowY: "auto"
|
|
66
21
|
});
|
|
67
22
|
};
|
|
68
23
|
export function useStyle(prefixCls) {
|
|
69
|
-
return useAntdStyle('
|
|
24
|
+
return useAntdStyle('', function (token) {
|
|
70
25
|
var vtxSelectToken = _objectSpread(_objectSpread({}, token), {}, {
|
|
71
26
|
componentCls: ".".concat(prefixCls)
|
|
72
27
|
});
|
|
@@ -1,12 +1,18 @@
|
|
|
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 = ["children", "defaultSize", "minSize", "maxSize", "style", "direction", "orientation", "handle", "draggerIcon"];
|
|
3
|
+
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
|
+
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
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import { Splitter } from 'antd';
|
|
1
11
|
import classnames from 'classnames';
|
|
2
|
-
import React, { cloneElement,
|
|
3
|
-
import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
|
|
4
|
-
import Resizer from "./Resizer";
|
|
5
|
-
import { useStyle } from "./style";
|
|
12
|
+
import React, { cloneElement, Fragment, useContext } from 'react';
|
|
6
13
|
import { VtxProvider } from "../vtx-provider";
|
|
14
|
+
import { useStyle } from "./style";
|
|
7
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
16
|
function removeNullChildren(children) {
|
|
11
17
|
return React.Children.toArray(children).filter(function (c) {
|
|
12
18
|
return c;
|
|
@@ -19,42 +25,44 @@ function VtxSplitPane(props) {
|
|
|
19
25
|
var _useStyle = useStyle(prefixCls),
|
|
20
26
|
wrapSSR = _useStyle.wrapSSR,
|
|
21
27
|
hashId = _useStyle.hashId;
|
|
22
|
-
var splitPane = useRef();
|
|
23
28
|
var children = props.children,
|
|
29
|
+
defaultSize = props.defaultSize,
|
|
30
|
+
minSize = props.minSize,
|
|
31
|
+
maxSize = props.maxSize,
|
|
24
32
|
style = props.style,
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
direction = props.direction,
|
|
34
|
+
orientation = props.orientation,
|
|
35
|
+
handle = props.handle,
|
|
36
|
+
draggerIcon = props.draggerIcon,
|
|
37
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
27
38
|
var notNullChildren = removeNullChildren(children);
|
|
28
|
-
var
|
|
39
|
+
var mergedOrientation = orientation || direction;
|
|
40
|
+
var mergedDraggerIcon = draggerIcon !== null && draggerIcon !== void 0 ? draggerIcon : handle;
|
|
29
41
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
30
|
-
className: classnames("".concat(prefixCls
|
|
31
|
-
ref: splitPane,
|
|
42
|
+
className: classnames("".concat(prefixCls), hashId),
|
|
32
43
|
style: style,
|
|
33
|
-
children: /*#__PURE__*/_jsx(
|
|
34
|
-
|
|
44
|
+
children: /*#__PURE__*/_jsx(Splitter, _objectSpread(_objectSpread({}, rest), {}, {
|
|
45
|
+
orientation: mergedOrientation,
|
|
46
|
+
draggerIcon: mergedDraggerIcon,
|
|
35
47
|
children: notNullChildren === null || notNullChildren === void 0 ? void 0 : notNullChildren.map(function (v, index) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
51
|
-
})]
|
|
52
|
-
});
|
|
48
|
+
var _v$props;
|
|
49
|
+
return /*#__PURE__*/_jsx(Fragment, {
|
|
50
|
+
children: /*#__PURE__*/cloneElement(notNullChildren[index], _objectSpread(_objectSpread(_objectSpread({}, index === 0 ? {
|
|
51
|
+
max: maxSize,
|
|
52
|
+
min: minSize,
|
|
53
|
+
defaultSize: defaultSize
|
|
54
|
+
} : {}), v.props), {}, {
|
|
55
|
+
collapsible: _objectSpread({
|
|
56
|
+
start: true,
|
|
57
|
+
end: true,
|
|
58
|
+
showCollapsibleIcon: 'auto'
|
|
59
|
+
}, (_v$props = v.props) === null || _v$props === void 0 ? void 0 : _v$props.collapsible)
|
|
60
|
+
}))
|
|
61
|
+
}, v.key || index);
|
|
53
62
|
})
|
|
54
|
-
})
|
|
63
|
+
}))
|
|
55
64
|
}));
|
|
56
65
|
}
|
|
57
66
|
VtxSplitPane.propTypes = {};
|
|
58
|
-
VtxSplitPane.
|
|
59
|
-
VtxSplitPane.Pane = Panel;
|
|
67
|
+
VtxSplitPane.Pane = Splitter.Panel;
|
|
60
68
|
export default VtxSplitPane;
|
|
@@ -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 = {
|