@vtx/components 2.5.13 → 2.5.15
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/CHANGELOG.md +842 -0
- package/lib/_util/filterSpecialCharacters.js +43 -54
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +3 -0
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getUrlParam.js +6 -0
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +1 -0
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +1 -0
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useInterval.js +3 -0
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +32 -14
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +21 -5
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +2 -0
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +2 -0
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +73 -33
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +45 -20
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +7 -0
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +7 -0
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-combogrid/style/index.less +29 -29
- package/lib/vtx-datagrid/Alert.js +11 -3
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +44 -19
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +13 -2
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +137 -77
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +35 -5
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +10 -0
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +10 -0
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/style/index.less +131 -131
- package/lib/vtx-date-picker/QdatePicker.js +46 -16
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/YearPicker.js +30 -7
- package/lib/vtx-date-picker/YearPicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +46 -5
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +8 -2
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +1 -0
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +1 -0
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +38 -38
- package/lib/vtx-editor/index.js +23 -5
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +2 -0
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +2 -0
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +6 -6
- package/lib/vtx-export/index.js +55 -23
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +6 -0
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +6 -0
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +26 -5
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +5 -0
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +34 -9
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +7 -2
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +6 -0
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +2 -0
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +41 -41
- package/lib/vtx-form-layout/index.js +22 -8
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +8 -0
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +8 -0
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +148 -148
- package/lib/vtx-image/Image.js +92 -56
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +51 -20
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +40 -11
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +6 -0
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +1 -0
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +1 -0
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-image/style/index.less +46 -46
- package/lib/vtx-import/index.js +72 -37
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +24 -7
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +2 -0
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +2 -0
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-input/TextArea.js +22 -6
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +37 -11
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +1 -0
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +1 -0
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +20 -20
- package/lib/vtx-input/useLength.js +16 -4
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +6 -1
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +70 -32
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +2 -0
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +2 -0
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-modal/style/index.less +83 -83
- package/lib/vtx-page-layout/Basic.js +6 -2
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +19 -7
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +10 -2
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +52 -22
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +15 -3
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +34 -4
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +8 -0
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +139 -139
- package/lib/vtx-rps-frame/index.js +44 -21
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +55 -19
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js +1 -0
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js +1 -0
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +111 -111
- package/lib/vtx-search/VtxCol.js +21 -0
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +12 -6
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +87 -36
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +5 -0
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +5 -0
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search/style/index.less +81 -81
- package/lib/vtx-search-map-input/index.js +68 -39
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +2 -0
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +2 -0
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +64 -20
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +8 -0
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +8 -0
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +66 -66
- package/lib/vtx-signature/index.js +28 -14
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +2 -0
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +2 -0
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +32 -32
- package/lib/vtx-split-pane/Pane.js +14 -2
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +30 -10
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +104 -52
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +4 -0
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +3 -0
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +3 -0
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +59 -59
- package/lib/vtx-statistics-column/Back.js +7 -1
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +22 -5
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +22 -5
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +2 -0
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +16 -0
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +61 -61
- package/lib/vtx-time-picker/index.js +16 -3
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-time-picker/style/css.js.map +1 -1
- package/lib/vtx-time-picker/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +28 -9
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +136 -67
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +6 -0
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +6 -0
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +59 -59
- package/lib/vtx-ztree/index.js +103 -51
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +1 -0
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +1 -0
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +30 -30
- package/lib/vtx-ztree-select/index.js +97 -38
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +4 -0
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +4 -0
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +76 -76
- package/package.json +1 -1
|
@@ -4,42 +4,66 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
11
|
+
|
|
9
12
|
var _dropdown = _interopRequireDefault(require("antd/es/dropdown"));
|
|
13
|
+
|
|
10
14
|
var _menu = _interopRequireDefault(require("antd/es/menu"));
|
|
15
|
+
|
|
11
16
|
var _icon = _interopRequireDefault(require("antd/es/icon"));
|
|
17
|
+
|
|
12
18
|
var _divider = _interopRequireDefault(require("antd/es/divider"));
|
|
19
|
+
|
|
13
20
|
var _excluded = ["confirm"];
|
|
21
|
+
|
|
14
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
15
24
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
16
26
|
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; }
|
|
27
|
+
|
|
17
28
|
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; }
|
|
29
|
+
|
|
18
30
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
31
|
+
|
|
19
32
|
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."); }
|
|
33
|
+
|
|
20
34
|
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); }
|
|
35
|
+
|
|
21
36
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
37
|
+
|
|
22
38
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
39
|
+
|
|
23
40
|
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; }
|
|
41
|
+
|
|
24
42
|
var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
25
43
|
var _renderButtons;
|
|
44
|
+
|
|
26
45
|
var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
27
46
|
var text = arguments.length > 2 ? arguments[2] : undefined;
|
|
28
47
|
var record = arguments.length > 3 ? arguments[3] : undefined;
|
|
29
48
|
var index = arguments.length > 4 ? arguments[4] : undefined;
|
|
30
49
|
var actions = (_renderButtons = renderButtons(text, record, index)) === null || _renderButtons === void 0 ? void 0 : _renderButtons.filter(function (item) {
|
|
31
50
|
var _item$visible;
|
|
51
|
+
|
|
32
52
|
return item && ((_item$visible = item.visible) !== null && _item$visible !== void 0 ? _item$visible : true);
|
|
33
53
|
});
|
|
54
|
+
|
|
34
55
|
if (!Array.isArray(actions)) {
|
|
35
56
|
return;
|
|
36
57
|
}
|
|
37
|
-
|
|
38
|
-
// 更多
|
|
58
|
+
|
|
59
|
+
var actionsLen = actions.length; // 更多
|
|
60
|
+
|
|
39
61
|
var moreRender;
|
|
62
|
+
|
|
40
63
|
if (actionsLen > visible) {
|
|
41
64
|
var moreActions = actions.slice(visible);
|
|
42
65
|
/* eslint-disable */
|
|
66
|
+
|
|
43
67
|
moreRender = /*#__PURE__*/_react["default"].createElement(_dropdown["default"], {
|
|
44
68
|
key: "more",
|
|
45
69
|
overlay: /*#__PURE__*/_react["default"].createElement(_menu["default"], {
|
|
@@ -55,19 +79,23 @@ var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
|
55
79
|
type: "down"
|
|
56
80
|
})));
|
|
57
81
|
}
|
|
82
|
+
|
|
58
83
|
return [].concat(_toConsumableArray(actions.slice(0, visible).map(function (item, i) {
|
|
59
84
|
var name = item.name,
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
onClick = item.onClick,
|
|
86
|
+
popconfirm = item.popconfirm;
|
|
87
|
+
|
|
62
88
|
var btnNode = /*#__PURE__*/_react["default"].createElement("a", {
|
|
63
89
|
key: name,
|
|
64
90
|
onClick: onClick && !popconfirm ? function () {
|
|
65
91
|
return onClick(record, index);
|
|
66
92
|
} : undefined
|
|
67
93
|
}, name);
|
|
94
|
+
|
|
68
95
|
if (popconfirm) {
|
|
69
96
|
var confirm = popconfirm.confirm,
|
|
70
|
-
|
|
97
|
+
rest = _objectWithoutProperties(popconfirm, _excluded);
|
|
98
|
+
|
|
71
99
|
btnNode = /*#__PURE__*/_react["default"].createElement(_popconfirm["default"], _extends({}, rest, {
|
|
72
100
|
onConfirm: confirm ? function () {
|
|
73
101
|
return confirm(record, index);
|
|
@@ -75,12 +103,14 @@ var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
|
75
103
|
key: name
|
|
76
104
|
}), btnNode);
|
|
77
105
|
}
|
|
106
|
+
|
|
78
107
|
return [btnNode, i != actionsLen - 1 && /*#__PURE__*/_react["default"].createElement(_divider["default"], {
|
|
79
108
|
key: i,
|
|
80
109
|
type: "vertical"
|
|
81
110
|
})];
|
|
82
111
|
})), [moreRender]);
|
|
83
112
|
};
|
|
113
|
+
|
|
84
114
|
var _default = renderColumnButtons;
|
|
85
115
|
exports["default"] = _default;
|
|
86
116
|
//# sourceMappingURL=renderColumnButtons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderColumnButtons.js","names":["renderColumnButtons","renderButtons","visible","text","record","index","actions","filter","item","Array","isArray","actionsLen","length","moreRender","moreActions","slice","e","key","onClick","map","i","name","popconfirm","btnNode","undefined","confirm","rest"],"sources":["vtx-datagrid/renderColumnButtons.jsx"],"sourcesContent":["import React from 'react';\nimport Popconfirm from 'antd/es/popconfirm';\nimport Dropdown from 'antd/es/dropdown';\nimport Menu from 'antd/es/menu';\nimport Icon from 'antd/es/icon';\nimport Divider from 'antd/es/divider';\n\nconst renderColumnButtons = (renderButtons, visible = 3, text, record, index) => {\n const actions = renderButtons(text, record, index)?.filter(\n item => item && (item.visible ?? true),\n );\n if (!Array.isArray(actions)) {\n return;\n }\n const actionsLen = actions.length;\n // 更多\n let moreRender;\n if (actionsLen > visible) {\n const moreActions = actions.slice(visible);\n /* eslint-disable */\n moreRender = (\n <Dropdown\n key=\"more\"\n overlay={\n <Menu onClick={e => moreActions[e.key].onClick(record, index)}>\n {moreActions.map((item, i) => (\n <Menu.Item key={i}>{item.name}</Menu.Item>\n ))}\n </Menu>\n }\n >\n <a>\n 更多\n <Icon type=\"down\" />\n </a>\n </Dropdown>\n );\n }\n\n return [\n ...actions.slice(0, visible).map((item, i) => {\n const { name, onClick, popconfirm } = item;\n let btnNode = (\n <a\n key={name}\n onClick={onClick && !popconfirm ? () => onClick(record, index) : undefined}\n >\n {name}\n </a>\n );\n\n if (popconfirm) {\n const { confirm, ...rest } = popconfirm;\n btnNode = (\n <Popconfirm\n {...rest}\n onConfirm={confirm ? () => confirm(record, index) : undefined}\n key={name}\n >\n {btnNode}\n </Popconfirm>\n );\n }\n\n return [btnNode, i != actionsLen - 1 && <Divider key={i} type=\"vertical\" />];\n }),\n moreRender,\n ];\n};\n\nexport default renderColumnButtons;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderColumnButtons.js","names":["renderColumnButtons","renderButtons","visible","text","record","index","actions","filter","item","Array","isArray","actionsLen","length","moreRender","moreActions","slice","e","key","onClick","map","i","name","popconfirm","btnNode","undefined","confirm","rest"],"sources":["vtx-datagrid/renderColumnButtons.jsx"],"sourcesContent":["import React from 'react';\r\nimport Popconfirm from 'antd/es/popconfirm';\r\nimport Dropdown from 'antd/es/dropdown';\r\nimport Menu from 'antd/es/menu';\r\nimport Icon from 'antd/es/icon';\r\nimport Divider from 'antd/es/divider';\r\n\r\nconst renderColumnButtons = (renderButtons, visible = 3, text, record, index) => {\r\n const actions = renderButtons(text, record, index)?.filter(\r\n item => item && (item.visible ?? true),\r\n );\r\n if (!Array.isArray(actions)) {\r\n return;\r\n }\r\n const actionsLen = actions.length;\r\n // 更多\r\n let moreRender;\r\n if (actionsLen > visible) {\r\n const moreActions = actions.slice(visible);\r\n /* eslint-disable */\r\n moreRender = (\r\n <Dropdown\r\n key=\"more\"\r\n overlay={\r\n <Menu onClick={e => moreActions[e.key].onClick(record, index)}>\r\n {moreActions.map((item, i) => (\r\n <Menu.Item key={i}>{item.name}</Menu.Item>\r\n ))}\r\n </Menu>\r\n }\r\n >\r\n <a>\r\n 更多\r\n <Icon type=\"down\" />\r\n </a>\r\n </Dropdown>\r\n );\r\n }\r\n\r\n return [\r\n ...actions.slice(0, visible).map((item, i) => {\r\n const { name, onClick, popconfirm } = item;\r\n let btnNode = (\r\n <a\r\n key={name}\r\n onClick={onClick && !popconfirm ? () => onClick(record, index) : undefined}\r\n >\r\n {name}\r\n </a>\r\n );\r\n\r\n if (popconfirm) {\r\n const { confirm, ...rest } = popconfirm;\r\n btnNode = (\r\n <Popconfirm\r\n {...rest}\r\n onConfirm={confirm ? () => confirm(record, index) : undefined}\r\n key={name}\r\n >\r\n {btnNode}\r\n </Popconfirm>\r\n );\r\n }\r\n\r\n return [btnNode, i != actionsLen - 1 && <Divider key={i} type=\"vertical\" />];\r\n }),\r\n moreRender,\r\n ];\r\n};\r\n\r\nexport default renderColumnButtons;\r\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,aAAD,EAAqD;EAAA;;EAAA,IAArCC,OAAqC,uEAA3B,CAA2B;EAAA,IAAxBC,IAAwB;EAAA,IAAlBC,MAAkB;EAAA,IAAVC,KAAU;EAC7E,IAAMC,OAAO,qBAAGL,aAAa,CAACE,IAAD,EAAOC,MAAP,EAAeC,KAAf,CAAhB,mDAAG,eAAoCE,MAApC,CACZ,UAAAC,IAAI;IAAA;;IAAA,OAAIA,IAAI,sBAAKA,IAAI,CAACN,OAAV,yDAAqB,IAArB,CAAR;EAAA,CADQ,CAAhB;;EAGA,IAAI,CAACO,KAAK,CAACC,OAAN,CAAcJ,OAAd,CAAL,EAA6B;IACzB;EACH;;EACD,IAAMK,UAAU,GAAGL,OAAO,CAACM,MAA3B,CAP6E,CAQ7E;;EACA,IAAIC,UAAJ;;EACA,IAAIF,UAAU,GAAGT,OAAjB,EAA0B;IACtB,IAAMY,WAAW,GAAGR,OAAO,CAACS,KAAR,CAAcb,OAAd,CAApB;IACA;;IACAW,UAAU,gBACN,gCAAC,oBAAD;MACI,GAAG,EAAC,MADR;MAEI,OAAO,eACH,gCAAC,gBAAD;QAAM,OAAO,EAAE,iBAAAG,CAAC;UAAA,OAAIF,WAAW,CAACE,CAAC,CAACC,GAAH,CAAX,CAAmBC,OAAnB,CAA2Bd,MAA3B,EAAmCC,KAAnC,CAAJ;QAAA;MAAhB,GACKS,WAAW,CAACK,GAAZ,CAAgB,UAACX,IAAD,EAAOY,CAAP;QAAA,oBACb,gCAAC,gBAAD,CAAM,IAAN;UAAW,GAAG,EAAEA;QAAhB,GAAoBZ,IAAI,CAACa,IAAzB,CADa;MAAA,CAAhB,CADL;IAHR,gBAUI,wEAEI,gCAAC,gBAAD;MAAM,IAAI,EAAC;IAAX,EAFJ,CAVJ,CADJ;EAiBH;;EAED,oCACOf,OAAO,CAACS,KAAR,CAAc,CAAd,EAAiBb,OAAjB,EAA0BiB,GAA1B,CAA8B,UAACX,IAAD,EAAOY,CAAP,EAAa;IAC1C,IAAQC,IAAR,GAAsCb,IAAtC,CAAQa,IAAR;IAAA,IAAcH,OAAd,GAAsCV,IAAtC,CAAcU,OAAd;IAAA,IAAuBI,UAAvB,GAAsCd,IAAtC,CAAuBc,UAAvB;;IACA,IAAIC,OAAO,gBACP;MACI,GAAG,EAAEF,IADT;MAEI,OAAO,EAAEH,OAAO,IAAI,CAACI,UAAZ,GAAyB;QAAA,OAAMJ,OAAO,CAACd,MAAD,EAASC,KAAT,CAAb;MAAA,CAAzB,GAAwDmB;IAFrE,GAIKH,IAJL,CADJ;;IASA,IAAIC,UAAJ,EAAgB;MACZ,IAAQG,OAAR,GAA6BH,UAA7B,CAAQG,OAAR;MAAA,IAAoBC,IAApB,4BAA6BJ,UAA7B;;MACAC,OAAO,gBACH,gCAAC,sBAAD,eACQG,IADR;QAEI,SAAS,EAAED,OAAO,GAAG;UAAA,OAAMA,OAAO,CAACrB,MAAD,EAASC,KAAT,CAAb;QAAA,CAAH,GAAkCmB,SAFxD;QAGI,GAAG,EAAEH;MAHT,IAKKE,OALL,CADJ;IASH;;IAED,OAAO,CAACA,OAAD,EAAUH,CAAC,IAAIT,UAAU,GAAG,CAAlB,iBAAuB,gCAAC,mBAAD;MAAS,GAAG,EAAES,CAAd;MAAiB,IAAI,EAAC;IAAtB,EAAjC,CAAP;EACH,CAzBE,CADP,IA2BIP,UA3BJ;AA6BH,CA7DD;;eA+Deb,mB"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("antd/es/table/style/css");
|
|
4
|
+
|
|
4
5
|
require("antd/es/tooltip/style/css");
|
|
6
|
+
|
|
5
7
|
require("antd/es/popover/style/css");
|
|
8
|
+
|
|
6
9
|
require("antd/es/checkbox/style/css");
|
|
10
|
+
|
|
7
11
|
require("antd/es/popconfirm/style/css");
|
|
12
|
+
|
|
8
13
|
require("antd/es/dropdown/style/css");
|
|
14
|
+
|
|
9
15
|
require("antd/es/menu/style/css");
|
|
16
|
+
|
|
10
17
|
require("antd/es/divider/style/css");
|
|
18
|
+
|
|
11
19
|
require("antd/es/empty/style/css");
|
|
20
|
+
|
|
12
21
|
require("antd/es/alert/style/css");
|
|
22
|
+
|
|
13
23
|
require("./index.css");
|
|
14
24
|
//# sourceMappingURL=css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-datagrid/style/index.js"],"sourcesContent":["import 'antd/es/table/style/css';\nimport 'antd/es/tooltip/style/css';\nimport 'antd/es/popover/style/css';\nimport 'antd/es/checkbox/style/css';\nimport 'antd/es/popconfirm/style/css';\nimport 'antd/es/dropdown/style/css';\nimport 'antd/es/menu/style/css';\nimport 'antd/es/divider/style/css';\nimport 'antd/es/empty/style/css';\nimport 'antd/es/alert/style/css';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["vtx-datagrid/style/index.js"],"sourcesContent":["import 'antd/es/table/style/css';\r\nimport 'antd/es/tooltip/style/css';\r\nimport 'antd/es/popover/style/css';\r\nimport 'antd/es/checkbox/style/css';\r\nimport 'antd/es/popconfirm/style/css';\r\nimport 'antd/es/dropdown/style/css';\r\nimport 'antd/es/menu/style/css';\r\nimport 'antd/es/divider/style/css';\r\nimport 'antd/es/empty/style/css';\r\nimport 'antd/es/alert/style/css';\r\nimport './index.less';\r\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("antd/es/table/style/css");
|
|
4
|
+
|
|
4
5
|
require("antd/es/tooltip/style/css");
|
|
6
|
+
|
|
5
7
|
require("antd/es/popover/style/css");
|
|
8
|
+
|
|
6
9
|
require("antd/es/checkbox/style/css");
|
|
10
|
+
|
|
7
11
|
require("antd/es/popconfirm/style/css");
|
|
12
|
+
|
|
8
13
|
require("antd/es/dropdown/style/css");
|
|
14
|
+
|
|
9
15
|
require("antd/es/menu/style/css");
|
|
16
|
+
|
|
10
17
|
require("antd/es/divider/style/css");
|
|
18
|
+
|
|
11
19
|
require("antd/es/empty/style/css");
|
|
20
|
+
|
|
12
21
|
require("antd/es/alert/style/css");
|
|
22
|
+
|
|
13
23
|
require("./index.less");
|
|
14
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-datagrid/style/index.js"],"sourcesContent":["import 'antd/es/table/style/css';\nimport 'antd/es/tooltip/style/css';\nimport 'antd/es/popover/style/css';\nimport 'antd/es/checkbox/style/css';\nimport 'antd/es/popconfirm/style/css';\nimport 'antd/es/dropdown/style/css';\nimport 'antd/es/menu/style/css';\nimport 'antd/es/divider/style/css';\nimport 'antd/es/empty/style/css';\nimport 'antd/es/alert/style/css';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["vtx-datagrid/style/index.js"],"sourcesContent":["import 'antd/es/table/style/css';\r\nimport 'antd/es/tooltip/style/css';\r\nimport 'antd/es/popover/style/css';\r\nimport 'antd/es/checkbox/style/css';\r\nimport 'antd/es/popconfirm/style/css';\r\nimport 'antd/es/dropdown/style/css';\r\nimport 'antd/es/menu/style/css';\r\nimport 'antd/es/divider/style/css';\r\nimport 'antd/es/empty/style/css';\r\nimport 'antd/es/alert/style/css';\r\nimport './index.less';\r\n"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
@prefix-cls: vtx-datagrid;
|
|
2
|
-
|
|
3
|
-
.@{prefix-cls} {
|
|
4
|
-
position: relative;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
&-fit {
|
|
7
|
-
height: 100%;
|
|
8
|
-
.ant-table-header,
|
|
9
|
-
.ant-table-body {
|
|
10
|
-
&::-webkit-scrollbar {
|
|
11
|
-
width: 5px;
|
|
12
|
-
background-color: hsla(0, 0%, 80%, 0.08);
|
|
13
|
-
}
|
|
14
|
-
&::-webkit-scrollbar-thumb {
|
|
15
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
16
|
-
border-radius: 3px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ant-table-fixed-header .ant-table-scroll .ant-table-header {
|
|
21
|
-
min-width: 5px !important;
|
|
22
|
-
}
|
|
23
|
-
.ant-table-pagination {
|
|
24
|
-
position: absolute;
|
|
25
|
-
right: 0;
|
|
26
|
-
bottom: 0;
|
|
27
|
-
}
|
|
28
|
-
.ant-spin-nested-loading {
|
|
29
|
-
height: 100%;
|
|
30
|
-
.ant-spin-container {
|
|
31
|
-
position: relative;
|
|
32
|
-
height: 100%;
|
|
33
|
-
.ant-table {
|
|
34
|
-
height: 100%;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
.ant-table-placeholder {
|
|
39
|
-
position: absolute;
|
|
40
|
-
right: 0;
|
|
41
|
-
bottom: 0;
|
|
42
|
-
left: 0;
|
|
43
|
-
border-top: none;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
.ant-table-thead > tr > th {
|
|
47
|
-
background-color: fade(#1890ff, 8);
|
|
48
|
-
}
|
|
49
|
-
.ant-table-tbody > tr {
|
|
50
|
-
&:nth-child(even) {
|
|
51
|
-
background: #f6f6f6;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
.ant-table-tbody > tr.ant-table-row-selected td {
|
|
55
|
-
background: transparent;
|
|
56
|
-
}
|
|
57
|
-
&-alert {
|
|
58
|
-
margin-bottom: 8px;
|
|
59
|
-
&-message {
|
|
60
|
-
color: fade(#000, 65);
|
|
61
|
-
}
|
|
62
|
-
&-info-content > strong {
|
|
63
|
-
margin: 0 4px;
|
|
64
|
-
color: #13c2c2;
|
|
65
|
-
}
|
|
66
|
-
&-info-option {
|
|
67
|
-
margin-left: 10px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
&-nodata {
|
|
71
|
-
.ant-table-scroll {
|
|
72
|
-
overflow-y: hidden;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
&-toolbar {
|
|
76
|
-
display: table;
|
|
77
|
-
width: 100%;
|
|
78
|
-
margin: 16px 0;
|
|
79
|
-
}
|
|
80
|
-
&-toolbar-left,
|
|
81
|
-
&-toolbar-right {
|
|
82
|
-
display: inline-block;
|
|
83
|
-
display: table-cell;
|
|
84
|
-
vertical-align: middle;
|
|
85
|
-
}
|
|
86
|
-
&-toolbar-left {
|
|
87
|
-
color: rgba(0, 0, 0, 0.85);
|
|
88
|
-
font-size: 16px;
|
|
89
|
-
}
|
|
90
|
-
&-toolbar-right {
|
|
91
|
-
float: right;
|
|
92
|
-
}
|
|
93
|
-
&-toolbar-setting-item {
|
|
94
|
-
display: inline-block;
|
|
95
|
-
margin-left: 16px;
|
|
96
|
-
color: rgba(0, 0, 0, 0.75);
|
|
97
|
-
font-size: 16px;
|
|
98
|
-
vertical-align: middle;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
}
|
|
101
|
-
&-column-setting-title {
|
|
102
|
-
height: 32px;
|
|
103
|
-
line-height: 32px;
|
|
104
|
-
a {
|
|
105
|
-
display: inline-block;
|
|
106
|
-
float: right;
|
|
107
|
-
vertical-align: middle;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
&-column-setting-checkbox-wrapper {
|
|
111
|
-
color: rgba(0, 0, 0, 0.85);
|
|
112
|
-
vertical-align: middle;
|
|
113
|
-
}
|
|
114
|
-
&-space-item {
|
|
115
|
-
display: inline-block;
|
|
116
|
-
vertical-align: middle;
|
|
117
|
-
}
|
|
118
|
-
.react-resizable {
|
|
119
|
-
position: relative;
|
|
120
|
-
background-clip: padding-box;
|
|
121
|
-
}
|
|
122
|
-
.react-resizable-handle {
|
|
123
|
-
position: absolute;
|
|
124
|
-
right: -5px;
|
|
125
|
-
bottom: 0;
|
|
126
|
-
z-index: 1;
|
|
127
|
-
width: 10px;
|
|
128
|
-
height: 100%;
|
|
129
|
-
cursor: col-resize;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
@prefix-cls: vtx-datagrid;
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls} {
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
&-fit {
|
|
7
|
+
height: 100%;
|
|
8
|
+
.ant-table-header,
|
|
9
|
+
.ant-table-body {
|
|
10
|
+
&::-webkit-scrollbar {
|
|
11
|
+
width: 5px;
|
|
12
|
+
background-color: hsla(0, 0%, 80%, 0.08);
|
|
13
|
+
}
|
|
14
|
+
&::-webkit-scrollbar-thumb {
|
|
15
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
16
|
+
border-radius: 3px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ant-table-fixed-header .ant-table-scroll .ant-table-header {
|
|
21
|
+
min-width: 5px !important;
|
|
22
|
+
}
|
|
23
|
+
.ant-table-pagination {
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
}
|
|
28
|
+
.ant-spin-nested-loading {
|
|
29
|
+
height: 100%;
|
|
30
|
+
.ant-spin-container {
|
|
31
|
+
position: relative;
|
|
32
|
+
height: 100%;
|
|
33
|
+
.ant-table {
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.ant-table-placeholder {
|
|
39
|
+
position: absolute;
|
|
40
|
+
right: 0;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
border-top: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.ant-table-thead > tr > th {
|
|
47
|
+
background-color: fade(#1890ff, 8);
|
|
48
|
+
}
|
|
49
|
+
.ant-table-tbody > tr {
|
|
50
|
+
&:nth-child(even) {
|
|
51
|
+
background: #f6f6f6;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
.ant-table-tbody > tr.ant-table-row-selected td {
|
|
55
|
+
background: transparent;
|
|
56
|
+
}
|
|
57
|
+
&-alert {
|
|
58
|
+
margin-bottom: 8px;
|
|
59
|
+
&-message {
|
|
60
|
+
color: fade(#000, 65);
|
|
61
|
+
}
|
|
62
|
+
&-info-content > strong {
|
|
63
|
+
margin: 0 4px;
|
|
64
|
+
color: #13c2c2;
|
|
65
|
+
}
|
|
66
|
+
&-info-option {
|
|
67
|
+
margin-left: 10px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
&-nodata {
|
|
71
|
+
.ant-table-scroll {
|
|
72
|
+
overflow-y: hidden;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
&-toolbar {
|
|
76
|
+
display: table;
|
|
77
|
+
width: 100%;
|
|
78
|
+
margin: 16px 0;
|
|
79
|
+
}
|
|
80
|
+
&-toolbar-left,
|
|
81
|
+
&-toolbar-right {
|
|
82
|
+
display: inline-block;
|
|
83
|
+
display: table-cell;
|
|
84
|
+
vertical-align: middle;
|
|
85
|
+
}
|
|
86
|
+
&-toolbar-left {
|
|
87
|
+
color: rgba(0, 0, 0, 0.85);
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
}
|
|
90
|
+
&-toolbar-right {
|
|
91
|
+
float: right;
|
|
92
|
+
}
|
|
93
|
+
&-toolbar-setting-item {
|
|
94
|
+
display: inline-block;
|
|
95
|
+
margin-left: 16px;
|
|
96
|
+
color: rgba(0, 0, 0, 0.75);
|
|
97
|
+
font-size: 16px;
|
|
98
|
+
vertical-align: middle;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
}
|
|
101
|
+
&-column-setting-title {
|
|
102
|
+
height: 32px;
|
|
103
|
+
line-height: 32px;
|
|
104
|
+
a {
|
|
105
|
+
display: inline-block;
|
|
106
|
+
float: right;
|
|
107
|
+
vertical-align: middle;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
&-column-setting-checkbox-wrapper {
|
|
111
|
+
color: rgba(0, 0, 0, 0.85);
|
|
112
|
+
vertical-align: middle;
|
|
113
|
+
}
|
|
114
|
+
&-space-item {
|
|
115
|
+
display: inline-block;
|
|
116
|
+
vertical-align: middle;
|
|
117
|
+
}
|
|
118
|
+
.react-resizable {
|
|
119
|
+
position: relative;
|
|
120
|
+
background-clip: padding-box;
|
|
121
|
+
}
|
|
122
|
+
.react-resizable-handle {
|
|
123
|
+
position: absolute;
|
|
124
|
+
right: -5px;
|
|
125
|
+
bottom: 0;
|
|
126
|
+
z-index: 1;
|
|
127
|
+
width: 10px;
|
|
128
|
+
height: 100%;
|
|
129
|
+
cursor: col-resize;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -1,54 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = VtxQtimePicker;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _datePicker = _interopRequireDefault(require("antd/es/date-picker"));
|
|
13
|
+
|
|
10
14
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
15
|
+
|
|
11
16
|
var _moment = _interopRequireDefault(require("moment"));
|
|
17
|
+
|
|
12
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
13
20
|
var _excluded = ["value", "format", "showTime", "onChange", "onOpenChange", "onPanelChange", "timeTemplete"];
|
|
21
|
+
|
|
14
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
15
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
16
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
17
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
+
|
|
18
30
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
19
32
|
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."); }
|
|
33
|
+
|
|
20
34
|
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); }
|
|
35
|
+
|
|
21
36
|
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; }
|
|
37
|
+
|
|
22
38
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
23
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
24
42
|
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; }
|
|
43
|
+
|
|
25
44
|
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; }
|
|
45
|
+
|
|
26
46
|
function VtxQtimePicker(props) {
|
|
27
47
|
var _format$split;
|
|
48
|
+
|
|
28
49
|
var value = props.value,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
_props$format = props.format,
|
|
51
|
+
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
52
|
+
_props$showTime = props.showTime,
|
|
53
|
+
showTime = _props$showTime === void 0 ? false : _props$showTime,
|
|
54
|
+
_onChange = props.onChange,
|
|
55
|
+
_onOpenChange = props.onOpenChange,
|
|
56
|
+
_onPanelChange = props.onPanelChange,
|
|
57
|
+
_props$timeTemplete = props.timeTemplete,
|
|
58
|
+
timeTemplete = _props$timeTemplete === void 0 ? ['06:00', '12:00', '18:00'] : _props$timeTemplete,
|
|
59
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
60
|
+
|
|
39
61
|
var _useState = (0, _react.useState)(false),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
63
|
+
open = _useState2[0],
|
|
64
|
+
setOpen = _useState2[1];
|
|
65
|
+
|
|
43
66
|
var _useState3 = (0, _react.useState)('date'),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
+
mode = _useState4[0],
|
|
69
|
+
setMode = _useState4[1];
|
|
70
|
+
|
|
47
71
|
var timeFormat = (_format$split = format.split(' ')) === null || _format$split === void 0 ? void 0 : _format$split[1];
|
|
72
|
+
|
|
48
73
|
var changeMode = function changeMode(mode) {
|
|
49
74
|
setMode(mode);
|
|
50
75
|
setOpen(true);
|
|
51
76
|
};
|
|
77
|
+
|
|
52
78
|
var extraFooter = function extraFooter(mode) {
|
|
53
79
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
80
|
className: "vtx-qdate-extra-footer"
|
|
@@ -56,6 +82,7 @@ function VtxQtimePicker(props) {
|
|
|
56
82
|
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
57
83
|
onClick: function onClick() {
|
|
58
84
|
var time = value.format("".concat(format.split(' ')[0], " ").concat(item, ":00"));
|
|
85
|
+
|
|
59
86
|
_onChange((0, _moment["default"])(time), (0, _moment["default"])(time).format(format));
|
|
60
87
|
},
|
|
61
88
|
key: "t".concat(index),
|
|
@@ -63,6 +90,7 @@ function VtxQtimePicker(props) {
|
|
|
63
90
|
}, item);
|
|
64
91
|
})));
|
|
65
92
|
};
|
|
93
|
+
|
|
66
94
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
67
95
|
className: "vtx-qdate-wrap"
|
|
68
96
|
}, /*#__PURE__*/_react["default"].createElement(_datePicker["default"], _extends({}, rest, {
|
|
@@ -91,6 +119,7 @@ function VtxQtimePicker(props) {
|
|
|
91
119
|
if (showTime) {
|
|
92
120
|
changeMode('time');
|
|
93
121
|
}
|
|
122
|
+
|
|
94
123
|
if (!date) {
|
|
95
124
|
_onChange && _onChange(null, null);
|
|
96
125
|
setMode('date');
|
|
@@ -124,6 +153,7 @@ function VtxQtimePicker(props) {
|
|
|
124
153
|
}
|
|
125
154
|
}, value.format(format.split(' ')[1])))));
|
|
126
155
|
}
|
|
156
|
+
|
|
127
157
|
VtxQtimePicker.propTypes = {
|
|
128
158
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].instanceOf(_moment["default"])]),
|
|
129
159
|
format: _propTypes["default"].string,
|