@noah-libjs/components 0.0.9 → 0.0.23
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/package.json +4 -4
- package/dist/ArrayInput/DispalyInner.d.ts +0 -4
- package/dist/ArrayInput/Inner.d.ts +0 -4
- package/dist/ArrayInput/components.d.ts +0 -201
- package/dist/ArrayInput/index.d.ts +0 -4
- package/dist/ArrayInput/types.d.ts +0 -77
- package/dist/ArrayInput/utils.d.ts +0 -3
- package/dist/ArraySingle/DispalyInner.d.ts +0 -4
- package/dist/ArraySingle/Inner.d.ts +0 -4
- package/dist/ArraySingle/index.d.ts +0 -4
- package/dist/ArraySingle/types.d.ts +0 -16
- package/dist/ContainerDimensions/index.d.ts +0 -9
- package/dist/GlobalModal/index.d.ts +0 -8
- package/dist/GlobalModal/utils.d.ts +0 -65
- package/dist/LazyAntd/AutoComplete/Inner.d.ts +0 -3
- package/dist/LazyAntd/AutoComplete/index.d.ts +0 -9
- package/dist/LazyAntd/Checkbox/GroupInner.d.ts +0 -3
- package/dist/LazyAntd/Checkbox/Inner.d.ts +0 -2
- package/dist/LazyAntd/Checkbox/index.d.ts +0 -9
- package/dist/LazyAntd/ColorPicker/Inner.d.ts +0 -3
- package/dist/LazyAntd/ColorPicker/index.d.ts +0 -42
- package/dist/LazyAntd/DatePicker/Base/Calendar.d.ts +0 -3
- package/dist/LazyAntd/DatePicker/Base/DatePicker.d.ts +0 -37
- package/dist/LazyAntd/DatePicker/Base/index.d.ts +0 -62
- package/dist/LazyAntd/DatePicker/Calendar.d.ts +0 -5
- package/dist/LazyAntd/DatePicker/DatePicker.d.ts +0 -12
- package/dist/LazyAntd/DatePicker/MonthPicker.d.ts +0 -11
- package/dist/LazyAntd/DatePicker/RangePicker.d.ts +0 -19
- package/dist/LazyAntd/DatePicker/TimePicker.d.ts +0 -12
- package/dist/LazyAntd/DatePicker/index.d.ts +0 -5
- package/dist/LazyAntd/Dropdown/Button.d.ts +0 -2
- package/dist/LazyAntd/Dropdown/Inner.d.ts +0 -2
- package/dist/LazyAntd/Dropdown/index.d.ts +0 -10
- package/dist/LazyAntd/Form/FormItemInner.d.ts +0 -2
- package/dist/LazyAntd/Form/Inner.d.ts +0 -2
- package/dist/LazyAntd/Form/index.d.ts +0 -9
- package/dist/LazyAntd/Modal/Inner.d.ts +0 -3
- package/dist/LazyAntd/Modal/index.d.ts +0 -3
- package/dist/LazyAntd/Pagination/Inner.d.ts +0 -2
- package/dist/LazyAntd/Pagination/index.d.ts +0 -3
- package/dist/LazyAntd/QRCode/Inner.d.ts +0 -3
- package/dist/LazyAntd/QRCode/index.d.ts +0 -2
- package/dist/LazyAntd/Select/Inner.d.ts +0 -2
- package/dist/LazyAntd/Select/OptionInner.d.ts +0 -1
- package/dist/LazyAntd/Select/index.d.ts +0 -9
- package/dist/LazyAntd/Switch/index.d.ts +0 -1
- package/dist/LazyAntd/Table/Inner.d.ts +0 -2
- package/dist/LazyAntd/Table/index.d.ts +0 -3
- package/dist/LazyAntd/Tree/DirectoryTreeInner.d.ts +0 -2
- package/dist/LazyAntd/Tree/Inner.d.ts +0 -3
- package/dist/LazyAntd/Tree/TreeNodeInner.d.ts +0 -3
- package/dist/LazyAntd/Tree/index.d.ts +0 -14
- package/dist/LazyAntd/TreeSelect/Inner.d.ts +0 -2
- package/dist/LazyAntd/TreeSelect/index.d.ts +0 -3
- package/dist/LazyAntd/index.d.ts +0 -14
- package/dist/Monaco/Inner.d.ts +0 -4
- package/dist/Monaco/index.d.ts +0 -6
- package/dist/Monaco/types.d.ts +0 -9
- package/dist/MyAutoComplete/Inner.d.ts +0 -3
- package/dist/MyAutoComplete/index.d.ts +0 -5
- package/dist/MyAutoComplete/types.d.ts +0 -25
- package/dist/MyAutoComplete/useConfig.d.ts +0 -11
- package/dist/MyButton/index.d.ts +0 -10
- package/dist/MyCheckbox/Display.d.ts +0 -6
- package/dist/MyCheckbox/Inner.d.ts +0 -5
- package/dist/MyCheckbox/components.d.ts +0 -201
- package/dist/MyCheckbox/index.d.ts +0 -6
- package/dist/MyCheckbox/types.d.ts +0 -65
- package/dist/MyCheckbox/utils.d.ts +0 -3
- package/dist/MyColor/index.d.ts +0 -4
- package/dist/MyColor/types.d.ts +0 -6
- package/dist/MyDatePicker/Display.d.ts +0 -3
- package/dist/MyDatePicker/Inner.d.ts +0 -5
- package/dist/MyDatePicker/index.d.ts +0 -8
- package/dist/MyDatePicker/utils.d.ts +0 -26
- package/dist/MyIconSelect/MyIcon.d.ts +0 -2
- package/dist/MyIconSelect/MyIconSelect.d.ts +0 -5
- package/dist/MyIconSelect/index.d.ts +0 -6
- package/dist/MyIconSelect/types.d.ts +0 -16
- package/dist/MyIconSelect/utils.d.ts +0 -7
- package/dist/MyInput/index.d.ts +0 -5
- package/dist/MyInput/types.d.ts +0 -7
- package/dist/MyInputNumber/index.d.ts +0 -5
- package/dist/MyInputNumber/types.d.ts +0 -9
- package/dist/MyLazyComponent/index.d.ts +0 -6
- package/dist/MyRangeDate/Display.d.ts +0 -2
- package/dist/MyRangeDate/Inner.d.ts +0 -6
- package/dist/MyRangeDate/index.d.ts +0 -7
- package/dist/MyRangeDate/utils.d.ts +0 -40
- package/dist/MySelect/Display.d.ts +0 -3
- package/dist/MySelect/Inner.d.ts +0 -4
- package/dist/MySelect/components.d.ts +0 -201
- package/dist/MySelect/index.d.ts +0 -8
- package/dist/MySelect/types.d.ts +0 -29
- package/dist/MySelect/utils.d.ts +0 -1
- package/dist/MySwitch/index.d.ts +0 -4
- package/dist/MySwitch/types.d.ts +0 -10
- package/dist/a_chunks/components.js +0 -7
- package/dist/a_chunks/index.js +0 -1403
- package/dist/a_chunks/index.module.js +0 -10
- package/dist/a_chunks/root..js +0 -37
- package/dist/a_chunks/root.10.js +0 -9
- package/dist/a_chunks/root.11.js +0 -19
- package/dist/a_chunks/root.12.js +0 -9
- package/dist/a_chunks/root.13.js +0 -9
- package/dist/a_chunks/root.14.js +0 -9
- package/dist/a_chunks/root.15.js +0 -9
- package/dist/a_chunks/root.16.js +0 -9
- package/dist/a_chunks/root.17.js +0 -172
- package/dist/a_chunks/root.18.js +0 -237
- package/dist/a_chunks/root.19.js +0 -18
- package/dist/a_chunks/root.2.js +0 -9
- package/dist/a_chunks/root.20.js +0 -129
- package/dist/a_chunks/root.21.js +0 -78
- package/dist/a_chunks/root.22.js +0 -166
- package/dist/a_chunks/root.23.js +0 -15
- package/dist/a_chunks/root.24.js +0 -66
- package/dist/a_chunks/root.25.js +0 -8
- package/dist/a_chunks/root.26.js +0 -68
- package/dist/a_chunks/root.27.js +0 -212
- package/dist/a_chunks/root.28.js +0 -117
- package/dist/a_chunks/root.29.js +0 -5
- package/dist/a_chunks/root.3.js +0 -9
- package/dist/a_chunks/root.30.js +0 -4
- package/dist/a_chunks/root.4.js +0 -9
- package/dist/a_chunks/root.5.js +0 -9
- package/dist/a_chunks/root.6.js +0 -9
- package/dist/a_chunks/root.7.js +0 -9
- package/dist/a_chunks/root.8.js +0 -11
- package/dist/a_chunks/root.9.js +0 -9
- package/dist/a_chunks/utils.js +0 -59
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/packs.d.ts +0 -215
- package/dist/util-types/comp.d.ts +0 -12
- package/dist/util-types/fd/FormItemLayout.d.ts +0 -5
- package/dist/util-types/fd/InputType.d.ts +0 -1
- package/dist/util-types/fd/Rules.d.ts +0 -4
- package/dist/util-types/fd/SpecialConfig.d.ts +0 -33
- package/dist/util-types/fd/TranferRules.d.ts +0 -9
- package/dist/util-types/fd/index.d.ts +0 -230
- package/dist/util-types/index.d.ts +0 -2
- package/dist/utils/getInputStyle.d.ts +0 -14
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/msmc.d.ts +0 -50
- package/dist/utils/new.d.ts +0 -18
- package/dist/utils/other.d.ts +0 -4
- package/dist/utils/use_array_marshal.d.ts +0 -5
package/dist/a_chunks/root.20.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
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 };
|
package/dist/a_chunks/root.21.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
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, { 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
|
-
var DisplayFC = function DisplayFC(props) {
|
|
14
|
-
var value = props.value,
|
|
15
|
-
_props$separator = props.separator,
|
|
16
|
-
separator = _props$separator === void 0 ? ',' : _props$separator,
|
|
17
|
-
_props$marshal = props.marshal,
|
|
18
|
-
marshal = _props$marshal === void 0 ? 1 : _props$marshal;
|
|
19
|
-
// const _options = parse_MC_option(props)
|
|
20
|
-
// const [_value, set_value] = useState<any[]>([])
|
|
21
|
-
var _use_options = use_options(props),
|
|
22
|
-
_options = _use_options.options,
|
|
23
|
-
loading = _use_options.loading,
|
|
24
|
-
_value = _use_options.data,
|
|
25
|
-
setData = _use_options.setData;
|
|
26
|
-
useEffect(function () {
|
|
27
|
-
// const arr = nMarshal == 0 ? value?.split(',') : (nMarshal === 1 ? safe_json_parse_arr(value) : value)
|
|
28
|
-
// const v = Array.isArray(arr) ? arr : []
|
|
29
|
-
// set_value(v)
|
|
30
|
-
return function () {};
|
|
31
|
-
}, [value]);
|
|
32
|
-
var isEmpty = _value.every(function (_) {
|
|
33
|
-
return !_;
|
|
34
|
-
});
|
|
35
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
36
|
-
style: {
|
|
37
|
-
display: 'inline-block'
|
|
38
|
-
}
|
|
39
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
40
|
-
style: {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center'
|
|
43
|
-
}
|
|
44
|
-
}, isEmpty ? '--' : _options.map(function (o, idx) {
|
|
45
|
-
var _componentMap$o$input, _o$props, _ref;
|
|
46
|
-
var C = componentMap[o.inputType];
|
|
47
|
-
var _DisplayFC = (_componentMap$o$input = componentMap[o.inputType]) === null || _componentMap$o$input === void 0 ? void 0 : _componentMap$o$input.DisplayFC;
|
|
48
|
-
var props = (_o$props = o.props) !== null && _o$props !== void 0 ? _o$props : {};
|
|
49
|
-
var DisplayFC = (_ref = _DisplayFC !== null && _DisplayFC !== void 0 ? _DisplayFC : C === null || C === void 0 ? void 0 : C.DisplayFC) !== null && _ref !== void 0 ? _ref : function (_ref2) {
|
|
50
|
-
var value = _ref2.value;
|
|
51
|
-
return /*#__PURE__*/React__default.createElement("span", null, value !== null && value !== void 0 ? value : '--');
|
|
52
|
-
};
|
|
53
|
-
return /*#__PURE__*/React__default.createElement("span", {
|
|
54
|
-
key: o.value,
|
|
55
|
-
style: {
|
|
56
|
-
display: 'flex',
|
|
57
|
-
alignItems: 'center'
|
|
58
|
-
}
|
|
59
|
-
}, o.prefix ? /*#__PURE__*/React__default.createElement("span", {
|
|
60
|
-
style: {
|
|
61
|
-
margin: '0 2px',
|
|
62
|
-
whiteSpace: 'nowrap'
|
|
63
|
-
}
|
|
64
|
-
}, o.prefix) : null, /*#__PURE__*/React__default.createElement(DisplayFC, _objectSpread({
|
|
65
|
-
value: _value[idx]
|
|
66
|
-
}, props)), o.suffix ? /*#__PURE__*/React__default.createElement("span", {
|
|
67
|
-
style: {
|
|
68
|
-
margin: '0 2px',
|
|
69
|
-
whiteSpace: 'nowrap'
|
|
70
|
-
}
|
|
71
|
-
}, o.suffix) : null, idx === _options.length - 1 ? null : /*#__PURE__*/React__default.createElement("span", {
|
|
72
|
-
style: {
|
|
73
|
-
margin: '0 2px'
|
|
74
|
-
}
|
|
75
|
-
}, separator));
|
|
76
|
-
})));
|
|
77
|
-
};
|
|
78
|
-
export { DisplayFC as default };
|
package/dist/a_chunks/root.22.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
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 };
|
package/dist/a_chunks/root.23.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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 };
|
package/dist/a_chunks/root.24.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["value", "onChange", "marshal", "minDate", "maxDate", "validDate", "getPopupContainer", "showUnknown", "format", "style"];
|
|
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
|
-
import dayjs from 'dayjs';
|
|
7
|
-
import React__default, { useCallback } from 'react';
|
|
8
|
-
import { f as format_range_props, g as getInputStyle, R as RangePicker_L, h as handleChangeValue } from './index.js';
|
|
9
|
-
import '@noah-libjs/utils';
|
|
10
|
-
import '@noah-libjs/request';
|
|
11
|
-
import 'antd';
|
|
12
|
-
import 'rc-select';
|
|
13
|
-
import 'rc-tree';
|
|
14
|
-
function MyRangePickerInner(_props) {
|
|
15
|
-
var props = format_range_props(_props);
|
|
16
|
-
var _props$value = props.value,
|
|
17
|
-
value = _props$value === void 0 ? undefined : _props$value,
|
|
18
|
-
onChange = props.onChange,
|
|
19
|
-
marshal = props.marshal,
|
|
20
|
-
minDate = props.minDate,
|
|
21
|
-
maxDate = props.maxDate,
|
|
22
|
-
validDate = props.validDate,
|
|
23
|
-
getPopupContainer = props.getPopupContainer,
|
|
24
|
-
showUnknown = props.showUnknown,
|
|
25
|
-
format = props.format,
|
|
26
|
-
style = props.style,
|
|
27
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
28
|
-
var _style = getInputStyle(props);
|
|
29
|
-
var handleChange = function handleChange(date, dateString) {
|
|
30
|
-
date = date !== null && date !== void 0 ? date : [];
|
|
31
|
-
var _value = handleChangeValue(props, date);
|
|
32
|
-
onChange === null || onChange === void 0 || onChange(_value);
|
|
33
|
-
};
|
|
34
|
-
var disabledDate = useCallback(function (current) {
|
|
35
|
-
var dateStr = dayjs(current).format(format);
|
|
36
|
-
if (validDate) {
|
|
37
|
-
return dateStr.includes(validDate);
|
|
38
|
-
}
|
|
39
|
-
if (minDate) {
|
|
40
|
-
if (minDate === 'now') {
|
|
41
|
-
return current < dayjs().endOf('day');
|
|
42
|
-
}
|
|
43
|
-
return current < dayjs(minDate).endOf('day');
|
|
44
|
-
}
|
|
45
|
-
if (maxDate) {
|
|
46
|
-
if (maxDate === 'now') {
|
|
47
|
-
return current > dayjs().endOf('day');
|
|
48
|
-
}
|
|
49
|
-
return current > dayjs(maxDate).endOf('day');
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
}, [validDate, maxDate, minDate, format]);
|
|
53
|
-
return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(RangePicker_L, _objectSpread(_objectSpread({
|
|
54
|
-
style: _style,
|
|
55
|
-
getPopupContainer: getPopupContainer,
|
|
56
|
-
value: value,
|
|
57
|
-
onChange: handleChange,
|
|
58
|
-
disabledDate: disabledDate,
|
|
59
|
-
format: format
|
|
60
|
-
}, rest), {}, {
|
|
61
|
-
placeholder: ['开始', '结束']
|
|
62
|
-
})));
|
|
63
|
-
}
|
|
64
|
-
// const RangePicker_ = memo<IMyRangePickerProps>(MyRangePickerInner, areEqual)
|
|
65
|
-
var RangePicker_ = MyRangePickerInner;
|
|
66
|
-
export { RangePicker_ as default };
|
package/dist/a_chunks/root.25.js
DELETED
package/dist/a_chunks/root.26.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Card, List } from 'antd';
|
|
2
|
-
import React__default, { forwardRef } from 'react';
|
|
3
|
-
import { D as Dropdown_L, e as MyInput } from './index.js';
|
|
4
|
-
import { u as use_icon } from './utils.js';
|
|
5
|
-
import '@noah-libjs/utils';
|
|
6
|
-
import 'dayjs';
|
|
7
|
-
import 'rc-select';
|
|
8
|
-
import 'rc-tree';
|
|
9
|
-
import '@noah-libjs/request';
|
|
10
|
-
var MyIconSelect = /*#__PURE__*/forwardRef(function (props, myRef) {
|
|
11
|
-
var value = props.value,
|
|
12
|
-
onChange = props.onChange;
|
|
13
|
-
var _use_icon = use_icon(props),
|
|
14
|
-
all_keys = _use_icon.all_keys,
|
|
15
|
-
render_Icon = _use_icon.render_Icon;
|
|
16
|
-
return /*#__PURE__*/React__default.createElement(Dropdown_L, {
|
|
17
|
-
arrow: true,
|
|
18
|
-
trigger: ['click'],
|
|
19
|
-
popupRender: function popupRender(node) {
|
|
20
|
-
return /*#__PURE__*/React__default.createElement(Card, {
|
|
21
|
-
size: 'small',
|
|
22
|
-
styles: {
|
|
23
|
-
body: {
|
|
24
|
-
width: 580,
|
|
25
|
-
height: 360,
|
|
26
|
-
overflowY: 'auto'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, /*#__PURE__*/React__default.createElement(List, {
|
|
30
|
-
style: {},
|
|
31
|
-
grid: {
|
|
32
|
-
column: 12
|
|
33
|
-
},
|
|
34
|
-
dataSource: all_keys,
|
|
35
|
-
renderItem: function renderItem(key) {
|
|
36
|
-
return /*#__PURE__*/React__default.createElement(List.Item, {
|
|
37
|
-
style: {
|
|
38
|
-
cursor: 'pointer',
|
|
39
|
-
background: key === value ? '#aaa' : '',
|
|
40
|
-
padding: 12,
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
justifyContent: 'center'
|
|
44
|
-
},
|
|
45
|
-
key: key,
|
|
46
|
-
onClick: function onClick() {
|
|
47
|
-
return onChange === null || onChange === void 0 ? void 0 : onChange(key);
|
|
48
|
-
}
|
|
49
|
-
}, render_Icon(key, {
|
|
50
|
-
style: {
|
|
51
|
-
fontSize: 20
|
|
52
|
-
}
|
|
53
|
-
}), node);
|
|
54
|
-
}
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
}, /*#__PURE__*/React__default.createElement(MyInput, {
|
|
58
|
-
addonBefore: render_Icon(value),
|
|
59
|
-
placeholder: '请选择',
|
|
60
|
-
value: value,
|
|
61
|
-
allowClear: true,
|
|
62
|
-
onChange: onChange,
|
|
63
|
-
onClear: function onClear() {
|
|
64
|
-
return onChange === null || onChange === void 0 ? void 0 : onChange('');
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
export { MyIconSelect as default };
|