@noah-libjs/components 0.0.23 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/ArrayInput/DispalyInner.d.ts +4 -0
- package/dist/ArrayInput/Inner.d.ts +4 -0
- package/dist/ArrayInput/components.d.ts +201 -0
- package/dist/ArrayInput/index.d.ts +4 -0
- package/dist/ArrayInput/types.d.ts +77 -0
- package/dist/ArrayInput/utils.d.ts +3 -0
- package/dist/ArraySingle/DispalyInner.d.ts +4 -0
- package/dist/ArraySingle/Inner.d.ts +4 -0
- package/dist/ArraySingle/index.d.ts +4 -0
- package/dist/ArraySingle/types.d.ts +16 -0
- package/dist/ContainerDimensions/index.d.ts +9 -0
- package/dist/GlobalModal/index.d.ts +8 -0
- package/dist/GlobalModal/utils.d.ts +65 -0
- package/dist/LazyAntd/AutoComplete/Inner.d.ts +3 -0
- package/dist/LazyAntd/AutoComplete/index.d.ts +9 -0
- package/dist/LazyAntd/Checkbox/GroupInner.d.ts +3 -0
- package/dist/LazyAntd/Checkbox/Inner.d.ts +2 -0
- package/dist/LazyAntd/Checkbox/index.d.ts +9 -0
- package/dist/LazyAntd/ColorPicker/Inner.d.ts +3 -0
- package/dist/LazyAntd/ColorPicker/index.d.ts +42 -0
- package/dist/LazyAntd/DatePicker/Base/Calendar.d.ts +3 -0
- package/dist/LazyAntd/DatePicker/Base/DatePicker.d.ts +37 -0
- package/dist/LazyAntd/DatePicker/Base/index.d.ts +62 -0
- package/dist/LazyAntd/DatePicker/Calendar.d.ts +5 -0
- package/dist/LazyAntd/DatePicker/DatePicker.d.ts +12 -0
- package/dist/LazyAntd/DatePicker/MonthPicker.d.ts +11 -0
- package/dist/LazyAntd/DatePicker/RangePicker.d.ts +19 -0
- package/dist/LazyAntd/DatePicker/TimePicker.d.ts +12 -0
- package/dist/LazyAntd/DatePicker/index.d.ts +5 -0
- package/dist/LazyAntd/Dropdown/Button.d.ts +2 -0
- package/dist/LazyAntd/Dropdown/Inner.d.ts +2 -0
- package/dist/LazyAntd/Dropdown/index.d.ts +10 -0
- package/dist/LazyAntd/Form/FormItemInner.d.ts +2 -0
- package/dist/LazyAntd/Form/Inner.d.ts +2 -0
- package/dist/LazyAntd/Form/index.d.ts +9 -0
- package/dist/LazyAntd/Modal/Inner.d.ts +3 -0
- package/dist/LazyAntd/Modal/index.d.ts +3 -0
- package/dist/LazyAntd/Pagination/Inner.d.ts +2 -0
- package/dist/LazyAntd/Pagination/index.d.ts +3 -0
- package/dist/LazyAntd/QRCode/Inner.d.ts +3 -0
- package/dist/LazyAntd/QRCode/index.d.ts +2 -0
- package/dist/LazyAntd/Select/Inner.d.ts +2 -0
- package/dist/LazyAntd/Select/OptionInner.d.ts +1 -0
- package/dist/LazyAntd/Select/index.d.ts +9 -0
- package/dist/LazyAntd/Switch/index.d.ts +1 -0
- package/dist/LazyAntd/Table/Inner.d.ts +2 -0
- package/dist/LazyAntd/Table/index.d.ts +3 -0
- package/dist/LazyAntd/Tree/DirectoryTreeInner.d.ts +2 -0
- package/dist/LazyAntd/Tree/Inner.d.ts +3 -0
- package/dist/LazyAntd/Tree/TreeNodeInner.d.ts +3 -0
- package/dist/LazyAntd/Tree/index.d.ts +14 -0
- package/dist/LazyAntd/TreeSelect/Inner.d.ts +2 -0
- package/dist/LazyAntd/TreeSelect/index.d.ts +3 -0
- package/dist/LazyAntd/index.d.ts +14 -0
- package/dist/Monaco/Inner.d.ts +4 -0
- package/dist/Monaco/index.d.ts +6 -0
- package/dist/Monaco/types.d.ts +9 -0
- package/dist/MyAutoComplete/Inner.d.ts +3 -0
- package/dist/MyAutoComplete/index.d.ts +5 -0
- package/dist/MyAutoComplete/types.d.ts +25 -0
- package/dist/MyAutoComplete/useConfig.d.ts +11 -0
- package/dist/MyButton/index.d.ts +10 -0
- package/dist/MyCheckbox/Display.d.ts +6 -0
- package/dist/MyCheckbox/Inner.d.ts +5 -0
- package/dist/MyCheckbox/components.d.ts +201 -0
- package/dist/MyCheckbox/index.d.ts +6 -0
- package/dist/MyCheckbox/types.d.ts +65 -0
- package/dist/MyCheckbox/utils.d.ts +3 -0
- package/dist/MyColor/index.d.ts +4 -0
- package/dist/MyColor/types.d.ts +6 -0
- package/dist/MyDatePicker/Display.d.ts +3 -0
- package/dist/MyDatePicker/Inner.d.ts +5 -0
- package/dist/MyDatePicker/index.d.ts +8 -0
- package/dist/MyDatePicker/utils.d.ts +26 -0
- package/dist/MyIconSelect/MyIcon.d.ts +2 -0
- package/dist/MyIconSelect/MyIconSelect.d.ts +5 -0
- package/dist/MyIconSelect/index.d.ts +6 -0
- package/dist/MyIconSelect/types.d.ts +16 -0
- package/dist/MyIconSelect/utils.d.ts +7 -0
- package/dist/MyInput/index.d.ts +5 -0
- package/dist/MyInput/types.d.ts +7 -0
- package/dist/MyInputNumber/index.d.ts +5 -0
- package/dist/MyInputNumber/types.d.ts +9 -0
- package/dist/MyLazyComponent/index.d.ts +6 -0
- package/dist/MyRangeDate/Display.d.ts +2 -0
- package/dist/MyRangeDate/Inner.d.ts +6 -0
- package/dist/MyRangeDate/index.d.ts +7 -0
- package/dist/MyRangeDate/utils.d.ts +40 -0
- package/dist/MySelect/Display.d.ts +3 -0
- package/dist/MySelect/Inner.d.ts +4 -0
- package/dist/MySelect/components.d.ts +201 -0
- package/dist/MySelect/index.d.ts +8 -0
- package/dist/MySelect/types.d.ts +29 -0
- package/dist/MySelect/utils.d.ts +1 -0
- package/dist/MySwitch/index.d.ts +4 -0
- package/dist/MySwitch/types.d.ts +10 -0
- package/dist/a_chunks/ArrayInput.DispalyInner.js +78 -0
- package/dist/a_chunks/ArrayInput.Inner.js +129 -0
- package/dist/a_chunks/ArraySingle.DispalyInner.js +15 -0
- package/dist/a_chunks/ArraySingle.Inner.js +166 -0
- package/dist/a_chunks/Base.Calendar.js +4 -0
- package/dist/a_chunks/Base.DatePicker.js +5 -0
- package/dist/a_chunks/Checkbox.GroupInner.js +9 -0
- package/dist/a_chunks/Checkbox.Inner.js +9 -0
- package/dist/a_chunks/ColorPicker.Inner.js +9 -0
- package/dist/a_chunks/Dropdown.Button.js +9 -0
- package/dist/a_chunks/Dropdown.Inner.js +9 -0
- package/dist/a_chunks/Form.FormItemInner.js +9 -0
- package/dist/a_chunks/Form.Inner.js +9 -0
- package/dist/a_chunks/Modal.Inner.js +9 -0
- package/dist/a_chunks/Monaco.Inner.js +37 -0
- package/dist/a_chunks/MyAutoComplete.Inner.js +212 -0
- package/dist/a_chunks/MyCheckbox.Display.js +18 -0
- package/dist/a_chunks/MyCheckbox.Inner.js +245 -0
- package/dist/a_chunks/MyDatePicker.Inner.js +117 -0
- package/dist/a_chunks/MyIconSelect.MyIcon.js +8 -0
- package/dist/a_chunks/MyIconSelect.MyIconSelect.js +68 -0
- package/dist/a_chunks/MyRangeDate.Inner.js +66 -0
- package/dist/a_chunks/MySelect.Inner.js +172 -0
- package/dist/a_chunks/Pagination.Inner.js +19 -0
- package/dist/a_chunks/QRCode.Inner.js +9 -0
- package/dist/a_chunks/Select.Inner.js +9 -0
- package/dist/a_chunks/Table.Inner.js +9 -0
- package/dist/a_chunks/Tree.DirectoryTreeInner.js +9 -0
- package/dist/a_chunks/Tree.Inner.js +11 -0
- package/dist/a_chunks/TreeSelect.Inner.js +9 -0
- package/dist/a_chunks/components.js +7 -0
- package/dist/a_chunks/index.js +1414 -0
- package/dist/a_chunks/index.module.js +10 -0
- package/dist/a_chunks/utils.js +59 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/packs.d.ts +215 -0
- package/dist/util-types/comp.d.ts +12 -0
- package/dist/util-types/fd/FormItemLayout.d.ts +5 -0
- package/dist/util-types/fd/InputType.d.ts +1 -0
- package/dist/util-types/fd/Rules.d.ts +4 -0
- package/dist/util-types/fd/SpecialConfig.d.ts +33 -0
- package/dist/util-types/fd/TranferRules.d.ts +9 -0
- package/dist/util-types/fd/index.d.ts +230 -0
- package/dist/util-types/index.d.ts +2 -0
- package/dist/utils/getInputStyle.d.ts +14 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/msmc.d.ts +50 -0
- package/dist/utils/new.d.ts +18 -0
- package/dist/utils/other.d.ts +4 -0
- package/dist/utils/use_array_marshal.d.ts +5 -0
- package/package.json +4 -4
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React__default, { useRef, useEffect } from 'react';
|
|
5
|
+
import { c as componentMap } from './components.js';
|
|
6
|
+
import { u as use_options } from './index.js';
|
|
7
|
+
import '@noah-libjs/utils';
|
|
8
|
+
import 'antd';
|
|
9
|
+
import 'dayjs';
|
|
10
|
+
import 'rc-select';
|
|
11
|
+
import 'rc-tree';
|
|
12
|
+
import '@noah-libjs/request';
|
|
13
|
+
function ArrayInputInner(props) {
|
|
14
|
+
var value = props.value,
|
|
15
|
+
onChange = props.onChange,
|
|
16
|
+
_props$separator = props.separator,
|
|
17
|
+
separator = _props$separator === void 0 ? ',' : _props$separator,
|
|
18
|
+
_props$inputWidth = props.inputWidth,
|
|
19
|
+
inputWidth = _props$inputWidth === void 0 ? 64 : _props$inputWidth,
|
|
20
|
+
_props$marshal = props.marshal,
|
|
21
|
+
marshal = _props$marshal === void 0 ? 1 : _props$marshal,
|
|
22
|
+
autoFocus = props.autoFocus,
|
|
23
|
+
_onBlur = props.onBlur,
|
|
24
|
+
disabled = props.disabled;
|
|
25
|
+
var nMarshal = Number(marshal);
|
|
26
|
+
// const _options = getOption(props)
|
|
27
|
+
// const [_value, set_value] = useState<any[]>([])
|
|
28
|
+
var _value_ref = useRef([]);
|
|
29
|
+
var forcusInfo = useRef(autoFocus ? {
|
|
30
|
+
index: 0,
|
|
31
|
+
type: 'self'
|
|
32
|
+
} : {});
|
|
33
|
+
var _use_options = use_options(props),
|
|
34
|
+
_options = _use_options.options,
|
|
35
|
+
loading = _use_options.loading,
|
|
36
|
+
_value = _use_options.data,
|
|
37
|
+
setData = _use_options.setData;
|
|
38
|
+
_value_ref.current = _value;
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
// const arr = nMarshal === 0 ? value?.split(',') : (nMarshal === 1 ? safe_json_parse_arr(value) : value)
|
|
41
|
+
// const v = Array.isArray(arr) ? arr : []
|
|
42
|
+
// set_value(v)
|
|
43
|
+
// _value_ref.current = _value
|
|
44
|
+
return function () {};
|
|
45
|
+
}, [value]);
|
|
46
|
+
function handleChange(v, idx) {
|
|
47
|
+
_value_ref.current[idx] = v;
|
|
48
|
+
onChange === null || onChange === void 0 || onChange(nMarshal === 0 ? _value_ref.current.join(',') : nMarshal === 1 ? JSON.stringify(_value_ref.current) : _value_ref.current);
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
51
|
+
style: {
|
|
52
|
+
display: 'inline-block'
|
|
53
|
+
}
|
|
54
|
+
}, " ", /*#__PURE__*/React__default.createElement("span", {
|
|
55
|
+
style: {
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center'
|
|
58
|
+
}
|
|
59
|
+
}, _options.map(function (opt, index) {
|
|
60
|
+
var _opt$props, _props$style;
|
|
61
|
+
var C = componentMap[opt.inputType];
|
|
62
|
+
var props = (_opt$props = opt.props) !== null && _opt$props !== void 0 ? _opt$props : {};
|
|
63
|
+
var style = (_props$style = props.style) !== null && _props$style !== void 0 ? _props$style : {};
|
|
64
|
+
if (['MyInput', 'Input', 'MA', 'MyAutoComplete', 'input'].includes(opt.inputType)) {
|
|
65
|
+
style = _objectSpread({
|
|
66
|
+
width: inputWidth
|
|
67
|
+
}, style);
|
|
68
|
+
}
|
|
69
|
+
if (['Select', 'MS', 'MySelect'].includes(opt.inputType)) {
|
|
70
|
+
style = _objectSpread({
|
|
71
|
+
minWidth: inputWidth
|
|
72
|
+
}, style);
|
|
73
|
+
}
|
|
74
|
+
return /*#__PURE__*/React__default.createElement("span", {
|
|
75
|
+
key: opt.value,
|
|
76
|
+
style: {
|
|
77
|
+
display: 'flex',
|
|
78
|
+
alignItems: 'center'
|
|
79
|
+
}
|
|
80
|
+
}, opt.prefix ? /*#__PURE__*/React__default.createElement("span", {
|
|
81
|
+
style: {
|
|
82
|
+
margin: '0 2px',
|
|
83
|
+
whiteSpace: 'nowrap'
|
|
84
|
+
}
|
|
85
|
+
}, opt.prefix) : null, opt.label ? /*#__PURE__*/React__default.createElement("span", {
|
|
86
|
+
style: {
|
|
87
|
+
margin: '0 2px',
|
|
88
|
+
whiteSpace: 'nowrap'
|
|
89
|
+
}
|
|
90
|
+
}, opt.label, ":") : null, C ? /*#__PURE__*/React__default.createElement(C, _objectSpread(_objectSpread({
|
|
91
|
+
size: 'small',
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
autoFocus: index === 0 ? autoFocus : undefined
|
|
94
|
+
}, props), {}, {
|
|
95
|
+
onFocus: function onFocus(e) {
|
|
96
|
+
forcusInfo.current = {
|
|
97
|
+
index: index
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
onBlur: function onBlur(e) {
|
|
101
|
+
setTimeout(function () {
|
|
102
|
+
if (forcusInfo.current.index !== index) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
forcusInfo.current = {
|
|
106
|
+
index: undefined,
|
|
107
|
+
type: undefined
|
|
108
|
+
};
|
|
109
|
+
_onBlur === null || _onBlur === void 0 || _onBlur(e);
|
|
110
|
+
}, 100);
|
|
111
|
+
},
|
|
112
|
+
style: style,
|
|
113
|
+
value: _value[index],
|
|
114
|
+
onChange: function onChange(e) {
|
|
115
|
+
return handleChange(e, index);
|
|
116
|
+
}
|
|
117
|
+
})) : '未知组件', opt.suffix ? /*#__PURE__*/React__default.createElement("span", {
|
|
118
|
+
style: {
|
|
119
|
+
margin: '0 2px',
|
|
120
|
+
whiteSpace: 'nowrap'
|
|
121
|
+
}
|
|
122
|
+
}, opt.suffix) : null, index === _options.length - 1 ? null : /*#__PURE__*/React__default.createElement("span", {
|
|
123
|
+
style: {
|
|
124
|
+
margin: '0 2px'
|
|
125
|
+
}
|
|
126
|
+
}, separator));
|
|
127
|
+
})));
|
|
128
|
+
}
|
|
129
|
+
export { ArrayInputInner as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { safe_json_parse_arr, isPrimitive, isString } from '@noah-libjs/utils';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
// import FormSection, { IFormSectionProps } from '../../BaseModalForm/FormSection';
|
|
5
|
+
// import { RenderEditItemStandalone, formatFormConfig } from '../../BaseModalForm/utils';
|
|
6
|
+
var DisplayFC = function DisplayFC(props) {
|
|
7
|
+
var value = props.value,
|
|
8
|
+
_props$linker = props.linker,
|
|
9
|
+
linker = _props$linker === void 0 ? ',' : _props$linker;
|
|
10
|
+
var safe_value = safe_json_parse_arr(value);
|
|
11
|
+
if (safe_value.length && isPrimitive(safe_value[0])) return safe_value.join(linker);
|
|
12
|
+
if (isString(value)) return value;
|
|
13
|
+
return /*#__PURE__*/React__default.createElement("div", null, safe_value.length, "\u9879");
|
|
14
|
+
};
|
|
15
|
+
export { DisplayFC as default };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
var _excluded = ["inputType", "linker", "component_map", "tip", "disabled", "value", "form", "onChange", "marshal", "addBtnStyle", "on_row_value_change", "genRowData"];
|
|
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
|
+
import { Divider, Button } from 'antd';
|
|
9
|
+
import React__default, { useState, useEffect, useRef } from 'react';
|
|
10
|
+
import { isNil, isArray, safe_json_parse_arr, safe_json_parse, safe_json_stringify, isObjectLike, get } from '@noah-libjs/utils';
|
|
11
|
+
import { M as MyIcon, p as packs } from './index.js';
|
|
12
|
+
import { isString } from 'antd/es/button';
|
|
13
|
+
import 'dayjs';
|
|
14
|
+
import 'rc-select';
|
|
15
|
+
import 'rc-tree';
|
|
16
|
+
import '@noah-libjs/request';
|
|
17
|
+
function use_array_marshal(marshal, _value, _onChange) {
|
|
18
|
+
var linker = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
19
|
+
var _useState = useState([]),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
safe_value = _useState2[0],
|
|
22
|
+
set_safe_value = _useState2[1];
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
if (isNil(_value)) return set_safe_value === null || set_safe_value === void 0 ? void 0 : set_safe_value([]);
|
|
25
|
+
if (isArray(_value)) return set_safe_value === null || set_safe_value === void 0 ? void 0 : set_safe_value(_value);
|
|
26
|
+
switch (marshal) {
|
|
27
|
+
case 0:
|
|
28
|
+
if (!isString(_value)) return set_safe_value === null || set_safe_value === void 0 ? void 0 : set_safe_value([]);
|
|
29
|
+
var arr = _value.split(linker);
|
|
30
|
+
set_safe_value === null || set_safe_value === void 0 || set_safe_value(arr.map(function (_) {
|
|
31
|
+
return safe_json_parse(_, _);
|
|
32
|
+
}));
|
|
33
|
+
break;
|
|
34
|
+
case 1:
|
|
35
|
+
set_safe_value === null || set_safe_value === void 0 || set_safe_value(safe_json_parse_arr(_value));
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
set_safe_value === null || set_safe_value === void 0 || set_safe_value(isArray(_value) ? _value : []);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}, [_value, marshal]);
|
|
42
|
+
function onChangeSafeValue(_v) {
|
|
43
|
+
if (!isArray(_v) || !_v.length) return _onChange === null || _onChange === void 0 ? void 0 : _onChange([]);
|
|
44
|
+
switch (marshal) {
|
|
45
|
+
case 0:
|
|
46
|
+
var is_obj = isObjectLike(_v[0]);
|
|
47
|
+
var arr = is_obj ? _v.map(function (_) {
|
|
48
|
+
return safe_json_stringify(_);
|
|
49
|
+
}) : _v;
|
|
50
|
+
_onChange === null || _onChange === void 0 || _onChange(arr.join(linker));
|
|
51
|
+
break;
|
|
52
|
+
case 1:
|
|
53
|
+
_onChange === null || _onChange === void 0 || _onChange(safe_json_stringify(_v));
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
_onChange === null || _onChange === void 0 || _onChange(_v);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
safe_value: safe_value,
|
|
62
|
+
set_safe_value: set_safe_value,
|
|
63
|
+
onChangeSafeValue: onChangeSafeValue
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
var ArraySingleInner = function ArraySingleInner(props) {
|
|
67
|
+
var _props$inputType = props.inputType,
|
|
68
|
+
inputType = _props$inputType === void 0 ? 'input' : _props$inputType,
|
|
69
|
+
linker = props.linker,
|
|
70
|
+
_props$component_map = props.component_map,
|
|
71
|
+
component_map = _props$component_map === void 0 ? packs : _props$component_map,
|
|
72
|
+
tip = props.tip,
|
|
73
|
+
disabled = props.disabled,
|
|
74
|
+
value = props.value,
|
|
75
|
+
form = props.form,
|
|
76
|
+
onChange = props.onChange,
|
|
77
|
+
_props$marshal = props.marshal,
|
|
78
|
+
marshal = _props$marshal === void 0 ? 1 : _props$marshal,
|
|
79
|
+
_props$addBtnStyle = props.addBtnStyle,
|
|
80
|
+
addBtnStyle = _props$addBtnStyle === void 0 ? {} : _props$addBtnStyle,
|
|
81
|
+
on_row_value_change = props.on_row_value_change,
|
|
82
|
+
genRowData = props.genRowData,
|
|
83
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
84
|
+
var defaultValue = useRef([]);
|
|
85
|
+
var _use_array_marshal = use_array_marshal(marshal, value !== null && value !== void 0 ? value : defaultValue.current, onChange, linker),
|
|
86
|
+
_use_array_marshal$sa = _use_array_marshal.safe_value,
|
|
87
|
+
safe_value = _use_array_marshal$sa === void 0 ? [] : _use_array_marshal$sa,
|
|
88
|
+
onChangeSafeValue = _use_array_marshal.onChangeSafeValue;
|
|
89
|
+
useEffect(function () {}, []);
|
|
90
|
+
function genDefaultData() {
|
|
91
|
+
var _genRowData;
|
|
92
|
+
var userData = (_genRowData = genRowData === null || genRowData === void 0 ? void 0 : genRowData(safe_value)) !== null && _genRowData !== void 0 ? _genRowData : '';
|
|
93
|
+
return userData;
|
|
94
|
+
}
|
|
95
|
+
function onDel(idx) {
|
|
96
|
+
safe_value.splice(idx, 1);
|
|
97
|
+
onChangeSafeValue === null || onChangeSafeValue === void 0 || onChangeSafeValue(_toConsumableArray(safe_value));
|
|
98
|
+
}
|
|
99
|
+
function onChangeValue(idx, _value) {
|
|
100
|
+
safe_value.splice(idx, 1, _value);
|
|
101
|
+
var new_data = _toConsumableArray(safe_value);
|
|
102
|
+
onChangeSafeValue === null || onChangeSafeValue === void 0 || onChangeSafeValue(new_data);
|
|
103
|
+
on_row_value_change === null || on_row_value_change === void 0 || on_row_value_change(new_data, idx, _value, form);
|
|
104
|
+
}
|
|
105
|
+
var C = get(component_map, inputType) || function () {
|
|
106
|
+
return null;
|
|
107
|
+
};
|
|
108
|
+
return /*#__PURE__*/React__default.createElement("div", null, safe_value.map(function (item, idx) {
|
|
109
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
110
|
+
key: idx
|
|
111
|
+
}, tip ? /*#__PURE__*/React__default.createElement(Divider, {
|
|
112
|
+
style: {
|
|
113
|
+
margin: '4px 0',
|
|
114
|
+
fontSize: 12,
|
|
115
|
+
color: '#ccc'
|
|
116
|
+
}
|
|
117
|
+
}, " ", tip, idx + 1) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
118
|
+
style: {
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
marginTop: tip ? 0 : 2
|
|
122
|
+
}
|
|
123
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
124
|
+
style: {
|
|
125
|
+
flex: 1
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/React__default.createElement(C, _objectSpread(_objectSpread({
|
|
128
|
+
disabled: disabled
|
|
129
|
+
}, others), {}, {
|
|
130
|
+
value: item,
|
|
131
|
+
onChange: function onChange(v) {
|
|
132
|
+
onChangeValue(idx, v);
|
|
133
|
+
}
|
|
134
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
135
|
+
style: {
|
|
136
|
+
width: 32,
|
|
137
|
+
display: 'flex',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
justifyContent: 'flex-end'
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React__default.createElement(MyIcon, {
|
|
142
|
+
value: 'MinusCircleOutlined',
|
|
143
|
+
style: {
|
|
144
|
+
color: 'red'
|
|
145
|
+
},
|
|
146
|
+
onClick: function onClick() {
|
|
147
|
+
return onDel(idx);
|
|
148
|
+
}
|
|
149
|
+
}))));
|
|
150
|
+
}), /*#__PURE__*/React__default.createElement(Button, _objectSpread(_objectSpread({
|
|
151
|
+
disabled: disabled,
|
|
152
|
+
style: {
|
|
153
|
+
marginTop: 6
|
|
154
|
+
},
|
|
155
|
+
type: "dashed",
|
|
156
|
+
block: true,
|
|
157
|
+
icon: /*#__PURE__*/React__default.createElement(MyIcon, {
|
|
158
|
+
value: 'PlusOutlined'
|
|
159
|
+
})
|
|
160
|
+
}, addBtnStyle), {}, {
|
|
161
|
+
onClick: function onClick() {
|
|
162
|
+
return onChangeSafeValue([].concat(_toConsumableArray(safe_value), [genDefaultData()]));
|
|
163
|
+
}
|
|
164
|
+
}), "\u65B0\u589E", tip));
|
|
165
|
+
};
|
|
166
|
+
export { ArraySingleInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Checkbox from 'antd/es/checkbox';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function GroupInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Checkbox.Group, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { GroupInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Checkbox from 'antd/es/checkbox';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function CheckboxInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Checkbox, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { CheckboxInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Comp from 'antd/es/color-picker';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Comp, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Dropdown from 'antd/es/dropdown';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Dropdown.Button, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Dropdown from 'antd/es/dropdown';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Dropdown, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Form from 'antd/es/form';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Form.Item, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Form from 'antd/es/form';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Form, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import Modal from 'antd/es/modal';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
function LazyInner(props) {
|
|
7
|
+
return /*#__PURE__*/React__default.createElement(Modal, _objectSpread({}, props));
|
|
8
|
+
}
|
|
9
|
+
export { LazyInner as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import Editor from '@monaco-editor/react/dist/index';
|
|
3
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
// loader.config({ paths: { vs: getMonacoLoaderPath() } });
|
|
6
|
+
function MonacoInner(props) {
|
|
7
|
+
var value = props.value,
|
|
8
|
+
onChange = props.onChange,
|
|
9
|
+
language = props.language,
|
|
10
|
+
defaultValue = props.defaultValue,
|
|
11
|
+
_props$height = props.height,
|
|
12
|
+
height = _props$height === void 0 ? '400px' : _props$height,
|
|
13
|
+
_props$theme = props.theme,
|
|
14
|
+
theme = _props$theme === void 0 ? "vs-dark" : _props$theme;
|
|
15
|
+
var _useState = useState(value),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
inner_value = _useState2[0],
|
|
18
|
+
set_inner_value = _useState2[1];
|
|
19
|
+
var inited = useRef(false);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
if (value) {
|
|
22
|
+
if (inited.current) return;
|
|
23
|
+
inited.current = true;
|
|
24
|
+
set_inner_value(value);
|
|
25
|
+
}
|
|
26
|
+
return function () {};
|
|
27
|
+
}, [value]);
|
|
28
|
+
return /*#__PURE__*/React__default.createElement(Editor, {
|
|
29
|
+
theme: theme,
|
|
30
|
+
onChange: onChange,
|
|
31
|
+
height: height,
|
|
32
|
+
defaultLanguage: language,
|
|
33
|
+
defaultValue: defaultValue,
|
|
34
|
+
value: inner_value
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export { MonacoInner as default };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
var _excluded = ["popupMatchSelectWidth", "getPopupContainer", "options", "style", "defaultValue", "value", "placeholder", "width", "onChange"];
|
|
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
|
+
import { i as parse_MC_option, g as getInputStyle, j as get_status_cls, M as MyIcon } from './index.js';
|
|
9
|
+
import { AutoComplete, Button } from 'antd';
|
|
10
|
+
import React__default, { useState, useEffect } from 'react';
|
|
11
|
+
import { getSearchParamsValue } from '@noah-libjs/utils';
|
|
12
|
+
import { safe_fetch_options, request } from '@noah-libjs/request';
|
|
13
|
+
import 'dayjs';
|
|
14
|
+
import 'rc-select';
|
|
15
|
+
import 'rc-tree';
|
|
16
|
+
|
|
17
|
+
// import { ICommonOption, getPresetOptions, getSameOptions } from '@lm_fe/env';
|
|
18
|
+
var defaultOptions = [];
|
|
19
|
+
function useConfig_MyAutoComplete(props) {
|
|
20
|
+
var form = props.form,
|
|
21
|
+
optionKey = props.optionKey,
|
|
22
|
+
_props$options = props.options,
|
|
23
|
+
options = _props$options === void 0 ? defaultOptions : _props$options,
|
|
24
|
+
searchKey = props.searchKey,
|
|
25
|
+
value = props.value,
|
|
26
|
+
memorable = props.memorable,
|
|
27
|
+
memorieskey = props.memorieskey,
|
|
28
|
+
memoriesname = props.memoriesname,
|
|
29
|
+
_props$formName = props.formName,
|
|
30
|
+
formName = _props$formName === void 0 ? 'unsetFormName' : _props$formName,
|
|
31
|
+
name = props.name,
|
|
32
|
+
fetch_options = props.fetch_options,
|
|
33
|
+
onChange = props.onChange,
|
|
34
|
+
onBlur = props.onBlur;
|
|
35
|
+
var _useState = useState([]),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
__options = _useState2[0],
|
|
38
|
+
set__options = _useState2[1];
|
|
39
|
+
var _useState3 = useState(),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
init_value = _useState4[0],
|
|
42
|
+
setInit_value = _useState4[1];
|
|
43
|
+
var _memorieskey = memorieskey !== null && memorieskey !== void 0 ? memorieskey : "".concat(formName, ".").concat(name);
|
|
44
|
+
// const _memoriesname = memoriesname ?? SLocal_State.getUserData()?.login
|
|
45
|
+
var _memoriesname = memoriesname !== null && memoriesname !== void 0 ? memoriesname : 'unset';
|
|
46
|
+
var _memorable = memorable || !!memorieskey;
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (!fetch_options) init();
|
|
49
|
+
return function () {};
|
|
50
|
+
}, [optionKey, options, searchKey]);
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
if (fetch_options) {
|
|
53
|
+
safe_fetch_options(fetch_options, form).then(set__options);
|
|
54
|
+
}
|
|
55
|
+
return function () {};
|
|
56
|
+
}, []);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
// if (!init_value && value) {
|
|
59
|
+
// setInit_value(value)
|
|
60
|
+
// }
|
|
61
|
+
setInit_value(value);
|
|
62
|
+
return function () {};
|
|
63
|
+
}, [value]);
|
|
64
|
+
function safeOnChange(str) {
|
|
65
|
+
setInit_value(str);
|
|
66
|
+
onChange === null || onChange === void 0 || onChange(str);
|
|
67
|
+
}
|
|
68
|
+
function init() {
|
|
69
|
+
var searchValue = searchKey ? getSearchParamsValue(searchKey) : null;
|
|
70
|
+
var _options = parse_MC_option(_objectSpread(_objectSpread({}, props), {}, {
|
|
71
|
+
useString: true
|
|
72
|
+
}));
|
|
73
|
+
if (searchValue) {
|
|
74
|
+
_options.push({
|
|
75
|
+
value: searchValue,
|
|
76
|
+
label: searchValue
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (_memorable) {
|
|
80
|
+
request.get("/api/text-memories", {
|
|
81
|
+
ignore_usr: true,
|
|
82
|
+
params: {
|
|
83
|
+
'key.equals': _memorieskey,
|
|
84
|
+
size: 9999
|
|
85
|
+
}
|
|
86
|
+
}).then(function (r) {
|
|
87
|
+
var _r$data;
|
|
88
|
+
var arr = (_r$data = r.data) !== null && _r$data !== void 0 ? _r$data : [];
|
|
89
|
+
_options.push.apply(_options, _toConsumableArray(arr.map(function (_) {
|
|
90
|
+
return {
|
|
91
|
+
label: _.value,
|
|
92
|
+
value: _.value,
|
|
93
|
+
id: _.id
|
|
94
|
+
};
|
|
95
|
+
})));
|
|
96
|
+
set__options(_options);
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
set__options(_options);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function _OnBlur(e) {
|
|
103
|
+
onBlur === null || onBlur === void 0 || onBlur(e);
|
|
104
|
+
setTimeout(function () {
|
|
105
|
+
var thisValue = value;
|
|
106
|
+
if (!_memorable || !thisValue || __options.some(function (_) {
|
|
107
|
+
return _.value === thisValue;
|
|
108
|
+
})) return;
|
|
109
|
+
var data = {
|
|
110
|
+
key: _memorieskey,
|
|
111
|
+
name: _memoriesname,
|
|
112
|
+
value: thisValue
|
|
113
|
+
};
|
|
114
|
+
request.post("/api/text-memories", data, {
|
|
115
|
+
ignore_usr: true
|
|
116
|
+
}).then(init);
|
|
117
|
+
}, 10);
|
|
118
|
+
}
|
|
119
|
+
function remove(item) {
|
|
120
|
+
request["delete"]("/api/text-memories/".concat(item.id), {
|
|
121
|
+
params: {},
|
|
122
|
+
ignore_usr: true
|
|
123
|
+
}).then(function (r) {
|
|
124
|
+
init();
|
|
125
|
+
if (value === item.label) {
|
|
126
|
+
safeOnChange('');
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
safeOnChange: safeOnChange,
|
|
132
|
+
onBlur: _OnBlur,
|
|
133
|
+
init: init,
|
|
134
|
+
options: __options,
|
|
135
|
+
remove: remove,
|
|
136
|
+
init_value: init_value
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function MyAutoCompleteInner(props) {
|
|
140
|
+
var _props$popupMatchSele = props.popupMatchSelectWidth,
|
|
141
|
+
popupMatchSelectWidth = _props$popupMatchSele === void 0 ? 140 : _props$popupMatchSele,
|
|
142
|
+
_props$getPopupContai = props.getPopupContainer,
|
|
143
|
+
getPopupContainer = _props$getPopupContai === void 0 ? function () {
|
|
144
|
+
return document.body;
|
|
145
|
+
} : _props$getPopupContai,
|
|
146
|
+
_options = props.options,
|
|
147
|
+
_props$style = props.style,
|
|
148
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
149
|
+
defaultValue = props.defaultValue,
|
|
150
|
+
value = props.value,
|
|
151
|
+
placeholder = props.placeholder,
|
|
152
|
+
width = props.width,
|
|
153
|
+
onChange = props.onChange,
|
|
154
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
155
|
+
var _style = getInputStyle(_objectSpread({}, props));
|
|
156
|
+
var _useConfig_MyAutoComp = useConfig_MyAutoComplete(props),
|
|
157
|
+
safeOnChange = _useConfig_MyAutoComp.safeOnChange,
|
|
158
|
+
onBlur = _useConfig_MyAutoComp.onBlur,
|
|
159
|
+
options = _useConfig_MyAutoComp.options,
|
|
160
|
+
remove = _useConfig_MyAutoComp.remove,
|
|
161
|
+
init_value = _useConfig_MyAutoComp.init_value;
|
|
162
|
+
return /*#__PURE__*/React__default.createElement(AutoComplete, _objectSpread(_objectSpread({
|
|
163
|
+
title: value,
|
|
164
|
+
// dropdownStyle={{ minWidth: 180 }}
|
|
165
|
+
classNames: {
|
|
166
|
+
root: get_status_cls(props.status)
|
|
167
|
+
},
|
|
168
|
+
popupMatchSelectWidth: popupMatchSelectWidth,
|
|
169
|
+
style: _style,
|
|
170
|
+
// bordered={false}
|
|
171
|
+
allowClear: true
|
|
172
|
+
}, rest), {}, {
|
|
173
|
+
value: init_value !== null && init_value !== void 0 ? init_value : defaultValue,
|
|
174
|
+
onBlur: onBlur,
|
|
175
|
+
onChange: safeOnChange,
|
|
176
|
+
// options={options}
|
|
177
|
+
getPopupContainer: getPopupContainer,
|
|
178
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '请选择或输入'
|
|
179
|
+
}), options.map(function (item) {
|
|
180
|
+
return /*#__PURE__*/React__default.createElement(AutoComplete.Option, {
|
|
181
|
+
key: item.value,
|
|
182
|
+
value: item.value
|
|
183
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
184
|
+
style: {
|
|
185
|
+
display: 'flex',
|
|
186
|
+
justifyContent: 'space-between'
|
|
187
|
+
}
|
|
188
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
189
|
+
title: item.label,
|
|
190
|
+
style: {
|
|
191
|
+
flex: 1,
|
|
192
|
+
textOverflow: 'ellipsis',
|
|
193
|
+
overflow: 'hidden',
|
|
194
|
+
whiteSpace: 'nowrap',
|
|
195
|
+
color: item.warning ? 'red' : ''
|
|
196
|
+
}
|
|
197
|
+
}, item.label), item.id ? (/*#__PURE__*/React__default.createElement(Button, {
|
|
198
|
+
title: "\u5220\u9664",
|
|
199
|
+
size: "small",
|
|
200
|
+
type: "dashed",
|
|
201
|
+
icon: /*#__PURE__*/React__default.createElement(MyIcon, {
|
|
202
|
+
value: "CloseOutlined"
|
|
203
|
+
}),
|
|
204
|
+
onClick: function onClick(e) {
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
var ok = confirm('确定删除吗?');
|
|
207
|
+
ok && remove(item);
|
|
208
|
+
}
|
|
209
|
+
})) : null));
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
export { MyAutoCompleteInner as default };
|