ns-base-module 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/Button/AntdIconButton.d.ts +11 -0
- package/dist/Button/AntdIconButton.d.ts.map +1 -0
- package/dist/Button/AntdIconButton.js +22 -0
- package/dist/Button/ConfigButton.d.ts +18 -0
- package/dist/Button/ConfigButton.d.ts.map +1 -0
- package/dist/Button/ConfigButton.js +78 -0
- package/dist/Button/index.d.ts +8 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/Button/index.js +19 -0
- package/dist/ClassFilter/index.d.ts +11 -0
- package/dist/ClassFilter/index.d.ts.map +1 -0
- package/dist/ClassFilter/index.js +119 -0
- package/dist/ClassFilter/indexVertical.d.ts +10 -0
- package/dist/ClassFilter/indexVertical.d.ts.map +1 -0
- package/dist/ClassFilter/indexVertical.js +69 -0
- package/dist/ClassFilter/util.d.ts +17 -0
- package/dist/ClassFilter/util.d.ts.map +1 -0
- package/dist/ClassFilter/util.js +135 -0
- package/dist/CopyCol/index.d.ts +4 -0
- package/dist/CopyCol/index.d.ts.map +1 -0
- package/dist/CopyCol/index.js +57 -0
- package/dist/Entry/EntryCriteria.d.ts +17 -0
- package/dist/Entry/EntryCriteria.d.ts.map +1 -0
- package/dist/Entry/EntryCriteria.js +138 -0
- package/dist/Entry/EntryItem.d.ts +34 -0
- package/dist/Entry/EntryItem.d.ts.map +1 -0
- package/dist/Entry/EntryItem.js +757 -0
- package/dist/Entry/components/Checkbox.d.ts +12 -0
- package/dist/Entry/components/Checkbox.d.ts.map +1 -0
- package/dist/Entry/components/Checkbox.js +15 -0
- package/dist/Entry/components/ChooseModalTable.d.ts +15 -0
- package/dist/Entry/components/ChooseModalTable.d.ts.map +1 -0
- package/dist/Entry/components/ChooseModalTable.js +407 -0
- package/dist/Entry/components/Condition.d.ts +9 -0
- package/dist/Entry/components/Condition.d.ts.map +1 -0
- package/dist/Entry/components/Condition.js +30 -0
- package/dist/Entry/components/DatePicker.d.ts +12 -0
- package/dist/Entry/components/DatePicker.d.ts.map +1 -0
- package/dist/Entry/components/DatePicker.js +12 -0
- package/dist/Entry/components/Etable2Modal.d.ts +4 -0
- package/dist/Entry/components/Etable2Modal.d.ts.map +1 -0
- package/dist/Entry/components/Etable2Modal.js +122 -0
- package/dist/Entry/components/Express.d.ts +8 -0
- package/dist/Entry/components/Express.d.ts.map +1 -0
- package/dist/Entry/components/Express.js +30 -0
- package/dist/Entry/components/GroupInput.d.ts +13 -0
- package/dist/Entry/components/GroupInput.d.ts.map +1 -0
- package/dist/Entry/components/GroupInput.js +77 -0
- package/dist/Entry/components/ImageText.d.ts +13 -0
- package/dist/Entry/components/ImageText.d.ts.map +1 -0
- package/dist/Entry/components/ImageText.js +235 -0
- package/dist/Entry/components/Input.d.ts +27 -0
- package/dist/Entry/components/Input.d.ts.map +1 -0
- package/dist/Entry/components/Input.js +86 -0
- package/dist/Entry/components/InputNumber.d.ts +18 -0
- package/dist/Entry/components/InputNumber.d.ts.map +1 -0
- package/dist/Entry/components/InputNumber.js +111 -0
- package/dist/Entry/components/InputNumberRange.d.ts +10 -0
- package/dist/Entry/components/InputNumberRange.d.ts.map +1 -0
- package/dist/Entry/components/InputNumberRange.js +58 -0
- package/dist/Entry/components/ListSelect.d.ts +15 -0
- package/dist/Entry/components/ListSelect.d.ts.map +1 -0
- package/dist/Entry/components/ListSelect.js +110 -0
- package/dist/Entry/components/ObjectSelect.d.ts +14 -0
- package/dist/Entry/components/ObjectSelect.d.ts.map +1 -0
- package/dist/Entry/components/ObjectSelect.js +91 -0
- package/dist/Entry/components/Progress.d.ts +11 -0
- package/dist/Entry/components/Progress.d.ts.map +1 -0
- package/dist/Entry/components/Progress.js +63 -0
- package/dist/Entry/components/Radio.d.ts +15 -0
- package/dist/Entry/components/Radio.d.ts.map +1 -0
- package/dist/Entry/components/Radio.js +17 -0
- package/dist/Entry/components/Select.d.ts +29 -0
- package/dist/Entry/components/Select.d.ts.map +1 -0
- package/dist/Entry/components/Select.js +113 -0
- package/dist/Entry/components/Switch.d.ts +6 -0
- package/dist/Entry/components/Switch.d.ts.map +1 -0
- package/dist/Entry/components/Switch.js +19 -0
- package/dist/Entry/components/TagsDatePicker.d.ts +7 -0
- package/dist/Entry/components/TagsDatePicker.d.ts.map +1 -0
- package/dist/Entry/components/TagsDatePicker.js +229 -0
- package/dist/Entry/components/TimePicker.d.ts +6 -0
- package/dist/Entry/components/TimePicker.d.ts.map +1 -0
- package/dist/Entry/components/TimePicker.js +6 -0
- package/dist/Entry/components/TreeSelect.d.ts +6 -0
- package/dist/Entry/components/TreeSelect.d.ts.map +1 -0
- package/dist/Entry/components/TreeSelect.js +18 -0
- package/dist/Entry/components/index.scss +97 -0
- package/dist/Entry/components/utils.d.ts +1 -0
- package/dist/Entry/components/utils.d.ts.map +1 -0
- package/dist/Entry/components/utils.js +6 -0
- package/dist/Entry/data.d.ts +133 -0
- package/dist/Entry/index.d.ts +54 -0
- package/dist/Entry/index.d.ts.map +1 -0
- package/dist/Entry/index.js +45 -0
- package/dist/FilterPopover/Filter.d.ts +24 -0
- package/dist/FilterPopover/Filter.d.ts.map +1 -0
- package/dist/FilterPopover/Filter.js +370 -0
- package/dist/FilterPopover/FilterClearIcon.d.ts +8 -0
- package/dist/FilterPopover/FilterClearIcon.d.ts.map +1 -0
- package/dist/FilterPopover/FilterClearIcon.js +45 -0
- package/dist/FilterPopover/index.d.ts +20 -0
- package/dist/FilterPopover/index.d.ts.map +1 -0
- package/dist/FilterPopover/index.js +136 -0
- package/dist/Icon/IconCreate.d.ts +11 -0
- package/dist/Icon/IconCreate.d.ts.map +1 -0
- package/dist/Icon/IconCreate.js +22 -0
- package/dist/Icon/index.d.ts +6 -0
- package/dist/Icon/index.d.ts.map +1 -0
- package/dist/Icon/index.js +22 -0
- package/dist/WidgetConfig/index.d.ts +40 -0
- package/dist/WidgetConfig/index.d.ts.map +1 -0
- package/dist/WidgetConfig/index.js +129 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/test/index.d.ts +4 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +7 -0
- package/dist/umd/ns-base-module.min.js +1 -0
- package/dist/utils/cache.d.ts +17 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +127 -0
- package/dist/utils/enum.d.ts +22 -0
- package/dist/utils/enum.d.ts.map +1 -0
- package/dist/utils/enum.js +37 -0
- package/dist/utils/language.d.ts +241 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +247 -0
- package/dist/utils/request.d.ts +15 -0
- package/dist/utils/request.d.ts.map +1 -0
- package/dist/utils/request.js +180 -0
- package/dist/utils/utils.d.ts +113 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +462 -0
- package/package.json +97 -0
- package/style/basics.scss +671 -0
- package/style/components/ClassFilter.scss +69 -0
- package/style/components/FilterPopover.scss +34 -0
- package/style/components/index.scss +2 -0
- package/style/default.scss +1219 -0
- package/style/index.scss +1 -0
- package/style/mixins/index.scss +28 -0
- package/style/mixins/libs/tint.scss +23 -0
- package/style/variables.scss +684 -0
- package/types/Action.d.ts +43 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface InputNumberRangeProps {
|
|
3
|
+
desc1?: string;
|
|
4
|
+
desc2?: string;
|
|
5
|
+
value?: any[];
|
|
6
|
+
onChange?: (nextValue?: any[]) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const InputNumberRange: React.FC<InputNumberRangeProps>;
|
|
9
|
+
export default InputNumberRange;
|
|
10
|
+
//# sourceMappingURL=InputNumberRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNumberRange.d.ts","sourceRoot":"","sources":["InputNumberRange.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,qBAAqB;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Input } from 'antd';
|
|
9
|
+
import InputNumber from "./InputNumber";
|
|
10
|
+
var InputNumberRange = function InputNumberRange(_ref) {
|
|
11
|
+
var value = _ref.value,
|
|
12
|
+
desc1 = _ref.desc1,
|
|
13
|
+
desc2 = _ref.desc2,
|
|
14
|
+
onChange = _ref.onChange;
|
|
15
|
+
var handleChange = function handleChange(index, e) {
|
|
16
|
+
var nextValue = [];
|
|
17
|
+
if (value) {
|
|
18
|
+
nextValue = _toConsumableArray(value);
|
|
19
|
+
}
|
|
20
|
+
nextValue[index] = e;
|
|
21
|
+
onChange === null || onChange === void 0 || onChange(nextValue);
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/React.createElement(Input.Group, {
|
|
24
|
+
compact: true
|
|
25
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
26
|
+
style: {
|
|
27
|
+
width: 'calc(50% - 15px)'
|
|
28
|
+
},
|
|
29
|
+
title: value === null || value === void 0 ? void 0 : value[0],
|
|
30
|
+
value: value === null || value === void 0 ? void 0 : value[0],
|
|
31
|
+
placeholder: desc1,
|
|
32
|
+
onChange: function onChange(e) {
|
|
33
|
+
return handleChange(0, e);
|
|
34
|
+
}
|
|
35
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
36
|
+
className: "site-input-split",
|
|
37
|
+
style: {
|
|
38
|
+
width: 30,
|
|
39
|
+
borderLeft: 0,
|
|
40
|
+
borderRight: 0,
|
|
41
|
+
pointerEvents: 'none'
|
|
42
|
+
},
|
|
43
|
+
placeholder: "~",
|
|
44
|
+
disabled: true
|
|
45
|
+
}), /*#__PURE__*/React.createElement(InputNumber, {
|
|
46
|
+
className: "site-input-right",
|
|
47
|
+
style: {
|
|
48
|
+
width: 'calc(50% - 15px)'
|
|
49
|
+
},
|
|
50
|
+
title: value === null || value === void 0 ? void 0 : value[1],
|
|
51
|
+
value: value === null || value === void 0 ? void 0 : value[1],
|
|
52
|
+
placeholder: desc2,
|
|
53
|
+
onChange: function onChange(e) {
|
|
54
|
+
return handleChange(1, e);
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
export default InputNumberRange;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChooseModalProps } from '@/components/v2/Modal';
|
|
3
|
+
interface ListSelectProps extends ChooseModalProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
params?: Record<string, any>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
clearForm?: () => void;
|
|
11
|
+
templateName?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const ListSelect: React.FC<ListSelectProps>;
|
|
14
|
+
export default ListSelect;
|
|
15
|
+
//# sourceMappingURL=ListSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListSelect.d.ts","sourceRoot":"","sources":["ListSelect.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,UAAU,eAAgB,SAAQ,gBAAgB;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsGzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 = ["style", "className", "value", "onChange", "menuCode", "formTemplateCode", "onSelectSubmit", "clearForm", "params", "disabled", "templateName"];
|
|
3
|
+
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); }
|
|
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; }
|
|
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; }
|
|
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
/*
|
|
12
|
+
* @Date: 2023-05-08 13:49:29
|
|
13
|
+
* @description:
|
|
14
|
+
* @author chenchangfu
|
|
15
|
+
* Copyright (c) 2019, AUTHOR. All rights reserved.
|
|
16
|
+
* AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useRef } from 'react';
|
|
19
|
+
import Input from "./Input";
|
|
20
|
+
import { ChooseModal } from '@/components/v2/Modal';
|
|
21
|
+
var ListSelect = function ListSelect(_ref) {
|
|
22
|
+
var style = _ref.style,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
value = _ref.value,
|
|
25
|
+
onChange = _ref.onChange,
|
|
26
|
+
menuCode = _ref.menuCode,
|
|
27
|
+
formTemplateCode = _ref.formTemplateCode,
|
|
28
|
+
onSelectSubmit = _ref.onSelectSubmit,
|
|
29
|
+
clearForm = _ref.clearForm,
|
|
30
|
+
params = _ref.params,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
templateName = _ref.templateName,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
var chooseModalRef = useRef();
|
|
35
|
+
var handleInput = function handleInput() {
|
|
36
|
+
var _chooseModalRef$curre;
|
|
37
|
+
if (disabled) return;
|
|
38
|
+
(_chooseModalRef$curre = chooseModalRef.current) === null || _chooseModalRef$curre === void 0 || _chooseModalRef$curre.onShow();
|
|
39
|
+
};
|
|
40
|
+
var handleClear = function handleClear() {
|
|
41
|
+
clearForm === null || clearForm === void 0 || clearForm();
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
style: _objectSpread({
|
|
45
|
+
position: 'relative'
|
|
46
|
+
}, style),
|
|
47
|
+
className: className
|
|
48
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
title: templateName || value
|
|
50
|
+
// onClick={handleInput}
|
|
51
|
+
}, !disabled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
52
|
+
style: {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
left: 11,
|
|
55
|
+
top: '50%',
|
|
56
|
+
transform: 'translateY(-50%)',
|
|
57
|
+
width: 'calc(100% - 70px)',
|
|
58
|
+
wordWrap: 'normal',
|
|
59
|
+
display: 'inline-block',
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
whiteSpace: 'nowrap',
|
|
62
|
+
zIndex: 1
|
|
63
|
+
}
|
|
64
|
+
}, templateName || value), /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "ant-input-clear-icon",
|
|
66
|
+
style: {
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
right: '58px',
|
|
69
|
+
top: '50%',
|
|
70
|
+
transform: 'translateY(-50%)',
|
|
71
|
+
zIndex: 1,
|
|
72
|
+
background: '#fff'
|
|
73
|
+
},
|
|
74
|
+
onClick: function onClick(e) {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
78
|
+
className: "anticon anticon-close-circle",
|
|
79
|
+
onClick: handleClear
|
|
80
|
+
}, !!value && /*#__PURE__*/React.createElement("svg", {
|
|
81
|
+
fillRule: "evenodd",
|
|
82
|
+
viewBox: "64 64 896 896",
|
|
83
|
+
focusable: "false",
|
|
84
|
+
"data-icon": "close-circle",
|
|
85
|
+
width: "1em",
|
|
86
|
+
height: "1em",
|
|
87
|
+
fill: "currentColor",
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
90
|
+
d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"
|
|
91
|
+
}))))), /*#__PURE__*/React.createElement(Input, _extends({
|
|
92
|
+
style: !disabled ? {
|
|
93
|
+
width: 'calc(100% - 50px)',
|
|
94
|
+
marginRight: 5
|
|
95
|
+
} : {},
|
|
96
|
+
value: value,
|
|
97
|
+
onChange: onChange
|
|
98
|
+
}, props, {
|
|
99
|
+
className: "disabled-input ".concat(!disabled ? 'disabled-active-style' : '') // 不禁用下 加disabled-active-style 覆盖灰色背景样式
|
|
100
|
+
,
|
|
101
|
+
disabled: true
|
|
102
|
+
}))), !disabled && /*#__PURE__*/React.createElement(ChooseModal, {
|
|
103
|
+
ref: chooseModalRef,
|
|
104
|
+
menuCode: menuCode,
|
|
105
|
+
formTemplateCode: formTemplateCode,
|
|
106
|
+
onSelectSubmit: onSelectSubmit,
|
|
107
|
+
params: params
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
export default ListSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SelectValue } from './Select';
|
|
3
|
+
import type { ValueEnumType } from '../data.d';
|
|
4
|
+
interface ObjectSelectProps {
|
|
5
|
+
valueEnum?: ValueEnumType[];
|
|
6
|
+
value?: string[];
|
|
7
|
+
name?: any;
|
|
8
|
+
onChange?: (value: SelectValue) => void;
|
|
9
|
+
onSelectObject?: (values: Record<string, any>, otherKey: string[], name?: any) => void;
|
|
10
|
+
record?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
declare const ObjectSelect: React.FC<ObjectSelectProps>;
|
|
13
|
+
export default ObjectSelect;
|
|
14
|
+
//# sourceMappingURL=ObjectSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSelect.d.ts","sourceRoot":"","sources":["ObjectSelect.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4D7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 = ["valueEnum", "onChange", "onSelectObject"],
|
|
3
|
+
_excluded2 = ["label", "value"],
|
|
4
|
+
_excluded3 = ["label", "value"];
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
/*
|
|
14
|
+
* @description:
|
|
15
|
+
* @author chenchangfu
|
|
16
|
+
* Copyright (c) 2019, AUTHOR. All rights reserved.
|
|
17
|
+
* AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
18
|
+
*/
|
|
19
|
+
import React, { useEffect, useRef } from 'react';
|
|
20
|
+
import Select from "./Select";
|
|
21
|
+
var Option = Select.Option;
|
|
22
|
+
import { isArray } from 'lodash';
|
|
23
|
+
var ObjectSelect = function ObjectSelect(_ref) {
|
|
24
|
+
var _ref$valueEnum = _ref.valueEnum,
|
|
25
|
+
valueEnum = _ref$valueEnum === void 0 ? [] : _ref$valueEnum,
|
|
26
|
+
onChange = _ref.onChange,
|
|
27
|
+
onSelectObject = _ref.onSelectObject,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var filterOption = useRef(valueEnum);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
filterOption.current = valueEnum;
|
|
32
|
+
}, [valueEnum]);
|
|
33
|
+
var onChangeValue = function onChangeValue(nextValue) {
|
|
34
|
+
var _filterOption$current, _filterOption$current2;
|
|
35
|
+
onChange === null || onChange === void 0 || onChange(nextValue);
|
|
36
|
+
var findObject = ((_filterOption$current = filterOption.current) === null || _filterOption$current === void 0 ? void 0 : _filterOption$current.find(function (v) {
|
|
37
|
+
return v.value == nextValue;
|
|
38
|
+
})) || {};
|
|
39
|
+
// console.log(nextValue, 'nextValuenextValue');
|
|
40
|
+
// console.log(findObject, 'findObjectfindObject');
|
|
41
|
+
var otherKey = [];
|
|
42
|
+
if ((_filterOption$current2 = filterOption.current) !== null && _filterOption$current2 !== void 0 && _filterOption$current2[0]) {
|
|
43
|
+
var _filterOption$current3 = filterOption.current[0],
|
|
44
|
+
_label = _filterOption$current3.label,
|
|
45
|
+
_value = _filterOption$current3.value,
|
|
46
|
+
otherJson = _objectWithoutProperties(_filterOption$current3, _excluded2);
|
|
47
|
+
otherKey = otherJson && Object.keys(otherJson);
|
|
48
|
+
}
|
|
49
|
+
var _ref2 = findObject || {},
|
|
50
|
+
label = _ref2.label,
|
|
51
|
+
value = _ref2.value,
|
|
52
|
+
findObject_ = _objectWithoutProperties(_ref2, _excluded3);
|
|
53
|
+
|
|
54
|
+
// console.log('findObjectfindObjectfindObject:', findObject, nextValue);
|
|
55
|
+
onSelectObject === null || onSelectObject === void 0 || onSelectObject(_objectSpread(_objectSpread({}, findObject_), {}, _defineProperty({}, props.name, nextValue)), otherKey, props.name);
|
|
56
|
+
};
|
|
57
|
+
var optionJsx = function optionJsx() {
|
|
58
|
+
if (isArray(valueEnum)) {
|
|
59
|
+
return valueEnum.map(function (_ref3) {
|
|
60
|
+
var label = _ref3.label,
|
|
61
|
+
value = _ref3.value;
|
|
62
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
63
|
+
value: value,
|
|
64
|
+
key: value
|
|
65
|
+
}, label);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
var getOptionCallback = function getOptionCallback(value) {
|
|
71
|
+
filterOption.current = value;
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
74
|
+
showArrow: true,
|
|
75
|
+
allowClear: true,
|
|
76
|
+
showSearch: true,
|
|
77
|
+
optionFilterProp: "children",
|
|
78
|
+
filterOption: function filterOption(input, option) {
|
|
79
|
+
var _option$children;
|
|
80
|
+
return (option === null || option === void 0 || (_option$children = option.children) === null || _option$children === void 0 || (_option$children = _option$children.toLowerCase()) === null || _option$children === void 0 ? void 0 : _option$children.indexOf(input === null || input === void 0 ? void 0 : input.toLowerCase())) >= 0;
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
width: '100%'
|
|
84
|
+
},
|
|
85
|
+
onChange: onChangeValue,
|
|
86
|
+
getOptionCallback: getOptionCallback
|
|
87
|
+
}, props, {
|
|
88
|
+
valueEnum: valueEnum
|
|
89
|
+
}), optionJsx());
|
|
90
|
+
};
|
|
91
|
+
export default ObjectSelect;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressProps } from 'antd/es/progress';
|
|
3
|
+
interface Iprops extends ProgressProps {
|
|
4
|
+
progressType?: 'circle' | 'line' | 'dashboard';
|
|
5
|
+
text?: string;
|
|
6
|
+
iconText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Index: React.FC<Iprops>;
|
|
9
|
+
export default Index;
|
|
10
|
+
export type { ProgressProps };
|
|
11
|
+
//# sourceMappingURL=Progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,MAAO,SAAQ,aAAa;IACpC,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAuD3B,CAAC;AAEF,eAAe,KAAK,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var _excluded = ["progressType", "prefixCls", "className", "percent", "status", "strokeWidth", "strokeLinecap", "strokeColor", "trailColor", "width", "success", "style", "gapDegree", "gapPosition", "size", "steps", "text", "iconText"];
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Progress } from 'antd';
|
|
6
|
+
var Index = function Index(props) {
|
|
7
|
+
var _props$progressType = props.progressType,
|
|
8
|
+
progressType = _props$progressType === void 0 ? 'line' : _props$progressType,
|
|
9
|
+
prefixCls = props.prefixCls,
|
|
10
|
+
className = props.className,
|
|
11
|
+
_props$percent = props.percent,
|
|
12
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
13
|
+
status = props.status,
|
|
14
|
+
_props$strokeWidth = props.strokeWidth,
|
|
15
|
+
strokeWidth = _props$strokeWidth === void 0 ? 6 : _props$strokeWidth,
|
|
16
|
+
_props$strokeLinecap = props.strokeLinecap,
|
|
17
|
+
strokeLinecap = _props$strokeLinecap === void 0 ? 'round' : _props$strokeLinecap,
|
|
18
|
+
strokeColor = props.strokeColor,
|
|
19
|
+
trailColor = props.trailColor,
|
|
20
|
+
_props$width = props.width,
|
|
21
|
+
width = _props$width === void 0 ? 132 : _props$width,
|
|
22
|
+
success = props.success,
|
|
23
|
+
style = props.style,
|
|
24
|
+
_props$gapDegree = props.gapDegree,
|
|
25
|
+
gapDegree = _props$gapDegree === void 0 ? 0 : _props$gapDegree,
|
|
26
|
+
_props$gapPosition = props.gapPosition,
|
|
27
|
+
gapPosition = _props$gapPosition === void 0 ? 'bottom' : _props$gapPosition,
|
|
28
|
+
size = props.size,
|
|
29
|
+
steps = props.steps,
|
|
30
|
+
_props$text = props.text,
|
|
31
|
+
text = _props$text === void 0 ? '' : _props$text,
|
|
32
|
+
_props$iconText = props.iconText,
|
|
33
|
+
iconText = _props$iconText === void 0 ? '%' : _props$iconText,
|
|
34
|
+
arg = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
return /*#__PURE__*/React.createElement(Progress, {
|
|
36
|
+
type: progressType,
|
|
37
|
+
percent: percent || 0,
|
|
38
|
+
prefixCls: prefixCls,
|
|
39
|
+
className: className,
|
|
40
|
+
format: function format(val) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", null, percent || 0, iconText, text && /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: {
|
|
43
|
+
textAlign: 'center'
|
|
44
|
+
}
|
|
45
|
+
}, text));
|
|
46
|
+
}
|
|
47
|
+
// status={status}
|
|
48
|
+
// showInfo={showInfo}
|
|
49
|
+
,
|
|
50
|
+
strokeWidth: strokeWidth,
|
|
51
|
+
strokeLinecap: strokeLinecap,
|
|
52
|
+
strokeColor: strokeColor,
|
|
53
|
+
trailColor: trailColor,
|
|
54
|
+
width: width,
|
|
55
|
+
success: success,
|
|
56
|
+
style: style,
|
|
57
|
+
gapDegree: gapDegree,
|
|
58
|
+
gapPosition: gapPosition,
|
|
59
|
+
size: size,
|
|
60
|
+
steps: steps
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export default Index;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RadioProps } from 'antd';
|
|
3
|
+
import type { RadioGroupProps } from 'antd/lib/radio';
|
|
4
|
+
import type { RadioButtonProps } from 'antd/lib/radio/radioButton';
|
|
5
|
+
declare const RadioWrapper: {
|
|
6
|
+
(props: RadioProps): React.JSX.Element;
|
|
7
|
+
Group: (props: RadioGroupProps) => React.JSX.Element;
|
|
8
|
+
Button: (props: RadioButtonProps) => React.JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
declare const Group: (props: RadioGroupProps) => React.JSX.Element;
|
|
11
|
+
declare const Button: (props: RadioButtonProps) => React.JSX.Element;
|
|
12
|
+
export default RadioWrapper;
|
|
13
|
+
export { Group, Button };
|
|
14
|
+
export type { RadioProps, RadioGroupProps, RadioButtonProps };
|
|
15
|
+
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,QAAA,MAAM,YAAY;YAAW,UAAU;mBAIjB,eAAe;;CAFpC,CAAC;AAEF,QAAA,MAAM,KAAK,UAAW,eAAe,sBAEpC,CAAC;AAEF,QAAA,MAAM,MAAM,gDAEX,CAAC;AAKF,eAAe,YAAY,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Radio } from 'antd';
|
|
3
|
+
var RadioGroup = Radio.Group;
|
|
4
|
+
var RadioButton = Radio.Button;
|
|
5
|
+
var RadioWrapper = function RadioWrapper(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(Radio, props);
|
|
7
|
+
};
|
|
8
|
+
var Group = function Group(props) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(RadioGroup, props);
|
|
10
|
+
};
|
|
11
|
+
var Button = function Button(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement(RadioButton, props);
|
|
13
|
+
};
|
|
14
|
+
RadioWrapper.Group = Group;
|
|
15
|
+
RadioWrapper.Button = Button;
|
|
16
|
+
export default RadioWrapper;
|
|
17
|
+
export { Group, Button };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SelectProps } from 'antd';
|
|
3
|
+
import type { OptionProps } from 'antd/lib/select';
|
|
4
|
+
declare type RawValue = string | number;
|
|
5
|
+
export interface LabeledValue {
|
|
6
|
+
key?: string;
|
|
7
|
+
value: RawValue;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[];
|
|
11
|
+
declare type selectExtend = {
|
|
12
|
+
record?: Record<string, any>;
|
|
13
|
+
request?: {
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
getOptionCallback?: Function;
|
|
17
|
+
valueEnum?: Record<string, any>[];
|
|
18
|
+
};
|
|
19
|
+
declare const Option: (props: OptionProps) => React.JSX.Element;
|
|
20
|
+
declare const OptGroup: (props: OptionProps) => React.JSX.Element;
|
|
21
|
+
declare const SelectWrapper: {
|
|
22
|
+
(props: SelectProps<SelectValue> & selectExtend): React.JSX.Element;
|
|
23
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
24
|
+
OptGroup: (props: OptionProps) => React.JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export default SelectWrapper;
|
|
27
|
+
export { Option, OptGroup };
|
|
28
|
+
export type { SelectProps, OptionProps };
|
|
29
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAOnD,OAAO,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AACxC,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AACD,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,EAAE,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AACxF,aAAK,YAAY,GAAG;IAElB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAE1B,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAE7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACnC,CAAC;AAKF,QAAA,MAAM,MAAM,UAAW,WAAW,sBAEjC,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAW,WAAW,sBAEnC,CAAC;AAEF,QAAA,MAAM,aAAa;YAAW,YAAY,WAAW,CAAC,GAAG,YAAY;oBAR9C,WAAW;sBAIT,WAAW;CA2DnC,CAAC;AAKF,eAAe,aAAa,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAE5B,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
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 _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); }
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
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."); }
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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; } }
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
/*
|
|
13
|
+
* @description:
|
|
14
|
+
* @author chenchangfu
|
|
15
|
+
* Copyright (c) 2019, AUTHOR. All rights reserved.
|
|
16
|
+
* AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
19
|
+
import { Select } from 'antd';
|
|
20
|
+
import { default as requestFn } from '@/utils/request';
|
|
21
|
+
import { isFunction } from 'lodash';
|
|
22
|
+
|
|
23
|
+
// export async function pickingList(params: any) {
|
|
24
|
+
// return
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
var OptionWrapper = Select.Option;
|
|
28
|
+
var OptGroupWrapper = Select.OptGroup;
|
|
29
|
+
var Option = function Option(props) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(OptionWrapper, props);
|
|
31
|
+
};
|
|
32
|
+
var OptGroup = function OptGroup(props) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(OptGroupWrapper, props);
|
|
34
|
+
};
|
|
35
|
+
var SelectWrapper = function SelectWrapper(props) {
|
|
36
|
+
var request = props.request,
|
|
37
|
+
record = props.record,
|
|
38
|
+
getOptionCallback = props.getOptionCallback;
|
|
39
|
+
var _useState = useState(props.valueEnum),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
options = _useState2[0],
|
|
42
|
+
setOptions = _useState2[1];
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
setOptions(props.valueEnum);
|
|
45
|
+
}, [props.valueEnum]);
|
|
46
|
+
var optionJsx = useCallback(function () {
|
|
47
|
+
// debugger;
|
|
48
|
+
if (options) {
|
|
49
|
+
return options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
50
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
51
|
+
value: item.value,
|
|
52
|
+
key: item.value,
|
|
53
|
+
disabled: item.disabled
|
|
54
|
+
}, item.label);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}, [options]);
|
|
59
|
+
var getOption = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
60
|
+
var res;
|
|
61
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
if (!(request !== null && request !== void 0 && request.url)) {
|
|
65
|
+
_context.next = 5;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
_context.next = 3;
|
|
69
|
+
return requestFn(request === null || request === void 0 ? void 0 : request.url, {
|
|
70
|
+
data: record,
|
|
71
|
+
method: 'POST'
|
|
72
|
+
});
|
|
73
|
+
case 3:
|
|
74
|
+
res = _context.sent;
|
|
75
|
+
if ((res === null || res === void 0 ? void 0 : res.code) == 200) {
|
|
76
|
+
setOptions(res.data);
|
|
77
|
+
if (isFunction(getOptionCallback)) {
|
|
78
|
+
getOptionCallback(res.data);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
case 5:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context.stop();
|
|
84
|
+
}
|
|
85
|
+
}, _callee);
|
|
86
|
+
})), [request]);
|
|
87
|
+
// useEffect(() => {
|
|
88
|
+
// if (request) {
|
|
89
|
+
// getOption();
|
|
90
|
+
// }
|
|
91
|
+
// }, [request]);
|
|
92
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
93
|
+
allowClear: true,
|
|
94
|
+
showSearch: true,
|
|
95
|
+
onFocus: function onFocus() {
|
|
96
|
+
getOption();
|
|
97
|
+
},
|
|
98
|
+
onClick: function onClick() {
|
|
99
|
+
if (isFunction(getOptionCallback)) {
|
|
100
|
+
getOptionCallback(options);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
optionFilterProp: "children",
|
|
104
|
+
filterOption: function filterOption(input, option) {
|
|
105
|
+
var _option$children;
|
|
106
|
+
return (option === null || option === void 0 || (_option$children = option.children) === null || _option$children === void 0 || (_option$children = _option$children.toLowerCase()) === null || _option$children === void 0 ? void 0 : _option$children.indexOf(input === null || input === void 0 ? void 0 : input.toLowerCase())) >= 0;
|
|
107
|
+
}
|
|
108
|
+
}, props), optionJsx() || props.children);
|
|
109
|
+
};
|
|
110
|
+
SelectWrapper.Option = Option;
|
|
111
|
+
SelectWrapper.OptGroup = OptGroup;
|
|
112
|
+
export default SelectWrapper;
|
|
113
|
+
export { Option, OptGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAGxC,QAAA,MAAM,KAAK,kCAAmC,GAAG,sBAMhD,CAAC;AAEF,eAAe,KAAK,CAAC;AAErB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var _excluded = ["onChange", "value"];
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Switch } from 'antd';
|
|
7
|
+
var index = function index(_ref) {
|
|
8
|
+
var onChange = _ref.onChange,
|
|
9
|
+
value = _ref.value,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
var switchChange = function switchChange(e) {
|
|
12
|
+
onChange === null || onChange === void 0 || onChange(e);
|
|
13
|
+
};
|
|
14
|
+
return /*#__PURE__*/React.createElement(Switch, _extends({
|
|
15
|
+
onChange: switchChange,
|
|
16
|
+
checked: value
|
|
17
|
+
}, props));
|
|
18
|
+
};
|
|
19
|
+
export default index;
|