@noah-libjs/components 0.0.8 → 0.0.9
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/dist/ArrayInput/components.d.ts +26 -649
- package/dist/ArrayInput/types.d.ts +2 -1
- 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/MyCheckbox/components.d.ts +26 -649
- package/dist/MyCheckbox/types.d.ts +3 -2
- package/dist/MyIconSelect/MyIcon.d.ts +2 -0
- package/dist/MyIconSelect/MyIconSelect.d.ts +5 -0
- package/dist/MyIconSelect/index.d.ts +2 -3
- package/dist/MyIconSelect/utils.d.ts +7 -0
- package/dist/MyInput/index.d.ts +3 -3
- package/dist/MyRangeDate/Inner.d.ts +2 -1
- package/dist/MyRangeDate/utils.d.ts +11 -376
- package/dist/MySelect/components.d.ts +26 -649
- package/dist/MySelect/types.d.ts +2 -0
- package/dist/a_chunks/index.js +111 -188
- package/dist/a_chunks/root.17.js +10 -4
- package/dist/a_chunks/root.18.js +0 -1
- package/dist/a_chunks/root.19.js +0 -1
- package/dist/a_chunks/root.20.js +0 -1
- package/dist/a_chunks/root.21.js +0 -1
- package/dist/a_chunks/root.22.js +155 -55
- package/dist/a_chunks/root.23.js +14 -211
- package/dist/a_chunks/root.24.js +23 -75
- package/dist/a_chunks/root.25.js +8 -5
- package/dist/a_chunks/root.26.js +68 -4
- package/dist/a_chunks/root.27.js +212 -0
- package/dist/a_chunks/root.28.js +117 -0
- package/dist/a_chunks/root.29.js +5 -0
- package/dist/a_chunks/root.30.js +4 -0
- package/dist/a_chunks/utils.js +59 -0
- package/dist/index.js +1 -2
- package/dist/packs.d.ts +28 -649
- package/dist/util-types/fd/InputType.d.ts +1 -1
- package/dist/util-types/fd/index.d.ts +9 -2
- package/dist/utils/msmc.d.ts +6 -3
- package/dist/utils/use_array_marshal.d.ts +5 -0
- package/package.json +4 -4
package/dist/a_chunks/root.22.js
CHANGED
|
@@ -1,66 +1,166 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
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"];
|
|
4
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; }
|
|
5
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; }
|
|
6
|
-
import
|
|
7
|
-
import React__default, {
|
|
8
|
-
import {
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
12
|
-
import 'antd';
|
|
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';
|
|
13
14
|
import 'rc-select';
|
|
14
15
|
import 'rc-tree';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
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,
|
|
19
76
|
onChange = props.onChange,
|
|
20
|
-
marshal = props.marshal,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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;
|
|
34
107
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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'
|
|
43
116
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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);
|
|
49
133
|
}
|
|
50
|
-
|
|
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()]));
|
|
51
163
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
style: _style,
|
|
56
|
-
getPopupContainer: getPopupContainer,
|
|
57
|
-
value: value,
|
|
58
|
-
onChange: handleChange,
|
|
59
|
-
disabledDate: disabledDate,
|
|
60
|
-
format: format
|
|
61
|
-
}, rest), {}, {
|
|
62
|
-
placeholder: ['开始', '结束']
|
|
63
|
-
})));
|
|
64
|
-
}
|
|
65
|
-
var RangePicker_ = /*#__PURE__*/memo(MyRangePickerInner, areEqual);
|
|
66
|
-
export { RangePicker_ as default };
|
|
164
|
+
}), "\u65B0\u589E", tip));
|
|
165
|
+
};
|
|
166
|
+
export { ArraySingleInner as default };
|
package/dist/a_chunks/root.23.js
CHANGED
|
@@ -1,212 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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 { CloseOutlined } from '@ant-design/icons';
|
|
9
|
-
import { AutoComplete, Button } from 'antd';
|
|
10
|
-
import React__default, { useState, useEffect } from 'react';
|
|
11
|
-
import { i as parse_MC_option, g as getInputStyle, j as get_status_cls } from './index.js';
|
|
12
|
-
import { getSearchParamsValue } from '@noah-libjs/utils';
|
|
13
|
-
import { safe_fetch_options, request } from '@noah-libjs/request';
|
|
14
|
-
import 'dayjs';
|
|
15
|
-
import 'rc-select';
|
|
16
|
-
import 'rc-tree';
|
|
1
|
+
import { safe_json_parse_arr, isPrimitive, isString } from '@noah-libjs/utils';
|
|
2
|
+
import React__default from 'react';
|
|
17
3
|
|
|
18
|
-
// import
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
_props$
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_props$formName = props.formName,
|
|
31
|
-
formName = _props$formName === void 0 ? 'unsetFormName' : _props$formName,
|
|
32
|
-
name = props.name,
|
|
33
|
-
fetch_options = props.fetch_options,
|
|
34
|
-
onChange = props.onChange,
|
|
35
|
-
onBlur = props.onBlur;
|
|
36
|
-
var _useState = useState([]),
|
|
37
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
-
__options = _useState2[0],
|
|
39
|
-
set__options = _useState2[1];
|
|
40
|
-
var _useState3 = useState(),
|
|
41
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
-
init_value = _useState4[0],
|
|
43
|
-
setInit_value = _useState4[1];
|
|
44
|
-
var _memorieskey = memorieskey !== null && memorieskey !== void 0 ? memorieskey : "".concat(formName, ".").concat(name);
|
|
45
|
-
// const _memoriesname = memoriesname ?? SLocal_State.getUserData()?.login
|
|
46
|
-
var _memoriesname = memoriesname !== null && memoriesname !== void 0 ? memoriesname : 'unset';
|
|
47
|
-
var _memorable = memorable || !!memorieskey;
|
|
48
|
-
useEffect(function () {
|
|
49
|
-
if (!fetch_options) init();
|
|
50
|
-
return function () {};
|
|
51
|
-
}, [optionKey, options, searchKey]);
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
if (fetch_options) {
|
|
54
|
-
safe_fetch_options(fetch_options, form).then(set__options);
|
|
55
|
-
}
|
|
56
|
-
return function () {};
|
|
57
|
-
}, []);
|
|
58
|
-
useEffect(function () {
|
|
59
|
-
// if (!init_value && value) {
|
|
60
|
-
// setInit_value(value)
|
|
61
|
-
// }
|
|
62
|
-
setInit_value(value);
|
|
63
|
-
return function () {};
|
|
64
|
-
}, [value]);
|
|
65
|
-
function safeOnChange(str) {
|
|
66
|
-
setInit_value(str);
|
|
67
|
-
onChange === null || onChange === void 0 || onChange(str);
|
|
68
|
-
}
|
|
69
|
-
function init() {
|
|
70
|
-
var searchValue = searchKey ? getSearchParamsValue(searchKey) : null;
|
|
71
|
-
var _options = parse_MC_option(_objectSpread(_objectSpread({}, props), {}, {
|
|
72
|
-
useString: true
|
|
73
|
-
}));
|
|
74
|
-
if (searchValue) {
|
|
75
|
-
_options.push({
|
|
76
|
-
value: searchValue,
|
|
77
|
-
label: searchValue
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
if (_memorable) {
|
|
81
|
-
request.get("/api/text-memories", {
|
|
82
|
-
ignore_usr: true,
|
|
83
|
-
params: {
|
|
84
|
-
'key.equals': _memorieskey,
|
|
85
|
-
size: 9999
|
|
86
|
-
}
|
|
87
|
-
}).then(function (r) {
|
|
88
|
-
var _r$data;
|
|
89
|
-
var arr = (_r$data = r.data) !== null && _r$data !== void 0 ? _r$data : [];
|
|
90
|
-
_options.push.apply(_options, _toConsumableArray(arr.map(function (_) {
|
|
91
|
-
return {
|
|
92
|
-
label: _.value,
|
|
93
|
-
value: _.value,
|
|
94
|
-
id: _.id
|
|
95
|
-
};
|
|
96
|
-
})));
|
|
97
|
-
set__options(_options);
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
set__options(_options);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function _OnBlur(e) {
|
|
104
|
-
onBlur === null || onBlur === void 0 || onBlur(e);
|
|
105
|
-
setTimeout(function () {
|
|
106
|
-
var thisValue = value;
|
|
107
|
-
if (!_memorable || !thisValue || __options.some(function (_) {
|
|
108
|
-
return _.value === thisValue;
|
|
109
|
-
})) return;
|
|
110
|
-
var data = {
|
|
111
|
-
key: _memorieskey,
|
|
112
|
-
name: _memoriesname,
|
|
113
|
-
value: thisValue
|
|
114
|
-
};
|
|
115
|
-
request.post("/api/text-memories", data, {
|
|
116
|
-
ignore_usr: true
|
|
117
|
-
}).then(init);
|
|
118
|
-
}, 10);
|
|
119
|
-
}
|
|
120
|
-
function remove(item) {
|
|
121
|
-
request["delete"]("/api/text-memories/".concat(item.id), {
|
|
122
|
-
params: {},
|
|
123
|
-
ignore_usr: true
|
|
124
|
-
}).then(function (r) {
|
|
125
|
-
init();
|
|
126
|
-
if (value === item.label) {
|
|
127
|
-
safeOnChange('');
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
safeOnChange: safeOnChange,
|
|
133
|
-
onBlur: _OnBlur,
|
|
134
|
-
init: init,
|
|
135
|
-
options: __options,
|
|
136
|
-
remove: remove,
|
|
137
|
-
init_value: init_value
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
function MyAutoCompleteInner(props) {
|
|
141
|
-
var _props$popupMatchSele = props.popupMatchSelectWidth,
|
|
142
|
-
popupMatchSelectWidth = _props$popupMatchSele === void 0 ? 140 : _props$popupMatchSele,
|
|
143
|
-
_props$getPopupContai = props.getPopupContainer,
|
|
144
|
-
getPopupContainer = _props$getPopupContai === void 0 ? function () {
|
|
145
|
-
return document.body;
|
|
146
|
-
} : _props$getPopupContai,
|
|
147
|
-
_options = props.options,
|
|
148
|
-
_props$style = props.style,
|
|
149
|
-
style = _props$style === void 0 ? {} : _props$style,
|
|
150
|
-
defaultValue = props.defaultValue,
|
|
151
|
-
value = props.value,
|
|
152
|
-
placeholder = props.placeholder,
|
|
153
|
-
width = props.width,
|
|
154
|
-
onChange = props.onChange,
|
|
155
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
156
|
-
var _style = getInputStyle(_objectSpread({}, props));
|
|
157
|
-
var _useConfig_MyAutoComp = useConfig_MyAutoComplete(props),
|
|
158
|
-
safeOnChange = _useConfig_MyAutoComp.safeOnChange,
|
|
159
|
-
onBlur = _useConfig_MyAutoComp.onBlur,
|
|
160
|
-
options = _useConfig_MyAutoComp.options,
|
|
161
|
-
remove = _useConfig_MyAutoComp.remove,
|
|
162
|
-
init_value = _useConfig_MyAutoComp.init_value;
|
|
163
|
-
return /*#__PURE__*/React__default.createElement(AutoComplete
|
|
164
|
-
// dropdownStyle={{ minWidth: 180 }}
|
|
165
|
-
, _objectSpread(_objectSpread({
|
|
166
|
-
// dropdownStyle={{ minWidth: 180 }}
|
|
167
|
-
classNames: {
|
|
168
|
-
root: get_status_cls(props.status)
|
|
169
|
-
},
|
|
170
|
-
popupMatchSelectWidth: popupMatchSelectWidth,
|
|
171
|
-
style: _style,
|
|
172
|
-
// bordered={false}
|
|
173
|
-
allowClear: true
|
|
174
|
-
}, rest), {}, {
|
|
175
|
-
value: init_value !== null && init_value !== void 0 ? init_value : defaultValue,
|
|
176
|
-
onBlur: onBlur,
|
|
177
|
-
onChange: safeOnChange,
|
|
178
|
-
// options={options}
|
|
179
|
-
getPopupContainer: getPopupContainer,
|
|
180
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "请选择或输入"
|
|
181
|
-
}), options.map(function (item) {
|
|
182
|
-
return /*#__PURE__*/React__default.createElement(AutoComplete.Option, {
|
|
183
|
-
key: item.value,
|
|
184
|
-
value: item.value
|
|
185
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
186
|
-
style: {
|
|
187
|
-
display: 'flex',
|
|
188
|
-
justifyContent: 'space-between'
|
|
189
|
-
}
|
|
190
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
191
|
-
title: item.label,
|
|
192
|
-
style: {
|
|
193
|
-
flex: 1,
|
|
194
|
-
textOverflow: 'ellipsis',
|
|
195
|
-
overflow: 'hidden',
|
|
196
|
-
whiteSpace: 'nowrap',
|
|
197
|
-
color: item.warning ? 'red' : ''
|
|
198
|
-
}
|
|
199
|
-
}, item.label), item.id ? /*#__PURE__*/React__default.createElement(Button, {
|
|
200
|
-
title: "\u5220\u9664",
|
|
201
|
-
size: 'small',
|
|
202
|
-
type: 'dashed',
|
|
203
|
-
icon: /*#__PURE__*/React__default.createElement(CloseOutlined, null),
|
|
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 };
|
|
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
CHANGED
|
@@ -1,53 +1,38 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["value", "
|
|
3
|
+
var _excluded = ["value", "onChange", "marshal", "minDate", "maxDate", "validDate", "getPopupContainer", "showUnknown", "format", "style"];
|
|
4
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
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 { presets_date } from '@noah-libjs/utils';
|
|
7
|
-
import { Checkbox } from 'antd';
|
|
8
6
|
import dayjs from 'dayjs';
|
|
9
7
|
import React__default, { useCallback } from 'react';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import '@
|
|
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';
|
|
13
12
|
import 'rc-select';
|
|
14
13
|
import 'rc-tree';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var props = formatDatePickerProps(_props);
|
|
14
|
+
function MyRangePickerInner(_props) {
|
|
15
|
+
var props = format_range_props(_props);
|
|
18
16
|
var _props$value = props.value,
|
|
19
17
|
value = _props$value === void 0 ? undefined : _props$value,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
valueType = props.valueType,
|
|
18
|
+
onChange = props.onChange,
|
|
19
|
+
marshal = props.marshal,
|
|
23
20
|
minDate = props.minDate,
|
|
24
21
|
maxDate = props.maxDate,
|
|
25
22
|
validDate = props.validDate,
|
|
26
23
|
getPopupContainer = props.getPopupContainer,
|
|
27
|
-
|
|
24
|
+
showUnknown = props.showUnknown,
|
|
28
25
|
format = props.format,
|
|
29
26
|
style = props.style,
|
|
30
27
|
rest = _objectWithoutProperties(props, _excluded);
|
|
31
|
-
var isUnknown = getIsUnknown(props);
|
|
32
28
|
var _style = getInputStyle(props);
|
|
33
|
-
var transValue = useCallback(function (date) {
|
|
34
|
-
var result = undefined;
|
|
35
|
-
if (!!date) {
|
|
36
|
-
result = dayjs(date, format);
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
}, []);
|
|
40
29
|
var handleChange = function handleChange(date, dateString) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onBlur === null || onBlur === void 0 || onBlur({}, {
|
|
45
|
-
range: 'end'
|
|
46
|
-
});
|
|
47
|
-
}, 10);
|
|
30
|
+
date = date !== null && date !== void 0 ? date : [];
|
|
31
|
+
var _value = handleChangeValue(props, date);
|
|
32
|
+
onChange === null || onChange === void 0 || onChange(_value);
|
|
48
33
|
};
|
|
49
34
|
var disabledDate = useCallback(function (current) {
|
|
50
|
-
var dateStr = dayjs(current).format(
|
|
35
|
+
var dateStr = dayjs(current).format(format);
|
|
51
36
|
if (validDate) {
|
|
52
37
|
return dateStr.includes(validDate);
|
|
53
38
|
}
|
|
@@ -64,55 +49,18 @@ function CusDatePicker(_props) {
|
|
|
64
49
|
return current > dayjs(maxDate).endOf('day');
|
|
65
50
|
}
|
|
66
51
|
return false;
|
|
67
|
-
}, [validDate, maxDate, minDate]);
|
|
68
|
-
|
|
69
|
-
getPopupContainer: getPopupContainer,
|
|
70
|
-
value: isUnknown ? null : transValue(value),
|
|
71
|
-
onChange: handleChange,
|
|
72
|
-
disabledDate: disabledDate,
|
|
73
|
-
format: format
|
|
74
|
-
}, rest), {}, {
|
|
75
|
-
// onBlur={undefined}
|
|
76
|
-
// onBlurCapture={undefined}
|
|
52
|
+
}, [validDate, maxDate, minDate, format]);
|
|
53
|
+
return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(RangePicker_L, _objectSpread(_objectSpread({
|
|
77
54
|
style: _style,
|
|
78
|
-
placeholder: '请选择'
|
|
79
|
-
})) : /*#__PURE__*/React__default.createElement(DatePicker_L, _objectSpread(_objectSpread({
|
|
80
55
|
getPopupContainer: getPopupContainer,
|
|
81
|
-
value:
|
|
56
|
+
value: value,
|
|
82
57
|
onChange: handleChange,
|
|
83
58
|
disabledDate: disabledDate,
|
|
84
|
-
format: format
|
|
85
|
-
presets: presets_date()
|
|
59
|
+
format: format
|
|
86
60
|
}, rest), {}, {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}));
|
|
90
|
-
return get_unknown_conf(props) ? /*#__PURE__*/React__default.createElement("span", {
|
|
91
|
-
style: {
|
|
92
|
-
display: 'flex',
|
|
93
|
-
alignItems: 'center'
|
|
94
|
-
}
|
|
95
|
-
}, node, /*#__PURE__*/React__default.createElement("span", {
|
|
96
|
-
style: {
|
|
97
|
-
marginLeft: 6,
|
|
98
|
-
flex: 1
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
101
|
-
checked: isUnknown,
|
|
102
|
-
skipGroup: true,
|
|
103
|
-
onChange: function onChange(e) {
|
|
104
|
-
var _value = e.target.checked ? UNKNOWN_TIME_SYMBOL : null;
|
|
105
|
-
var value = handleChangeValue(props, _value);
|
|
106
|
-
_onChange === null || _onChange === void 0 || _onChange(value);
|
|
107
|
-
}
|
|
108
|
-
}), /*#__PURE__*/React__default.createElement("span", {
|
|
109
|
-
style: {
|
|
110
|
-
marginLeft: 6
|
|
111
|
-
}
|
|
112
|
-
}, "\u4E0D\u8BE6"))) : node;
|
|
61
|
+
placeholder: ['开始', '结束']
|
|
62
|
+
})));
|
|
113
63
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var MyDatePickerInner = df;
|
|
118
|
-
export { MyDatePickerInner as default };
|
|
64
|
+
// const RangePicker_ = memo<IMyRangePickerProps>(MyRangePickerInner, areEqual)
|
|
65
|
+
var RangePicker_ = MyRangePickerInner;
|
|
66
|
+
export { RangePicker_ as default };
|
package/dist/a_chunks/root.25.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
import { u as use_icon } from './utils.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
function MyIcon(props) {
|
|
4
|
+
var _use_icon = use_icon(props),
|
|
5
|
+
render_Icon = _use_icon.render_Icon;
|
|
6
|
+
return render_Icon(props.value);
|
|
7
|
+
}
|
|
8
|
+
export { MyIcon as default };
|