@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.26.js
CHANGED
|
@@ -1,4 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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 };
|
|
@@ -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 };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["value", "onBlur", "onChange", "valueType", "minDate", "maxDate", "validDate", "getPopupContainer", "time_only", "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 { presets_date } from '@noah-libjs/utils';
|
|
7
|
+
import { Checkbox } from 'antd';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import React__default, { useCallback } from 'react';
|
|
10
|
+
import { k as MonthPicker_L, l as formatDatePickerProps, m as getIsUnknown, g as getInputStyle, T as TimePicker_L, n as DatePicker_L, o as get_unknown_conf, U as UNKNOWN_TIME_SYMBOL, q as handleChangeValue } from './index.js';
|
|
11
|
+
export { U as UNKNOWN_TIME_SYMBOL } from './index.js';
|
|
12
|
+
import 'rc-select';
|
|
13
|
+
import 'rc-tree';
|
|
14
|
+
import '@noah-libjs/request';
|
|
15
|
+
function MyDatePicker_Inner(_props) {
|
|
16
|
+
var props = formatDatePickerProps(_props);
|
|
17
|
+
var _props$value = props.value,
|
|
18
|
+
value = _props$value === void 0 ? undefined : _props$value,
|
|
19
|
+
onBlur = props.onBlur,
|
|
20
|
+
_onChange = props.onChange,
|
|
21
|
+
valueType = props.valueType,
|
|
22
|
+
minDate = props.minDate,
|
|
23
|
+
maxDate = props.maxDate,
|
|
24
|
+
validDate = props.validDate,
|
|
25
|
+
getPopupContainer = props.getPopupContainer,
|
|
26
|
+
time_only = props.time_only,
|
|
27
|
+
format = props.format,
|
|
28
|
+
style = props.style,
|
|
29
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
var isUnknown = getIsUnknown(props);
|
|
31
|
+
var _style = getInputStyle(props);
|
|
32
|
+
var transValue = useCallback(function (date) {
|
|
33
|
+
var result = undefined;
|
|
34
|
+
if (!!date) {
|
|
35
|
+
result = dayjs(date, format);
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}, []);
|
|
39
|
+
var handleChange = function handleChange(date, dateString) {
|
|
40
|
+
var newValue = handleChangeValue(props, date);
|
|
41
|
+
_onChange === null || _onChange === void 0 || _onChange(newValue);
|
|
42
|
+
setTimeout(function () {
|
|
43
|
+
onBlur === null || onBlur === void 0 || onBlur({}, {
|
|
44
|
+
range: 'end'
|
|
45
|
+
});
|
|
46
|
+
}, 10);
|
|
47
|
+
};
|
|
48
|
+
var disabledDate = useCallback(function (current) {
|
|
49
|
+
var dateStr = dayjs(current).format('YYYY-MM-DD');
|
|
50
|
+
if (validDate) {
|
|
51
|
+
return dateStr.includes(validDate);
|
|
52
|
+
}
|
|
53
|
+
if (minDate) {
|
|
54
|
+
if (minDate === 'now') {
|
|
55
|
+
return current < dayjs().endOf('day');
|
|
56
|
+
}
|
|
57
|
+
return current < dayjs(minDate).endOf('day');
|
|
58
|
+
}
|
|
59
|
+
if (maxDate) {
|
|
60
|
+
if (maxDate === 'now') {
|
|
61
|
+
return current > dayjs().endOf('day');
|
|
62
|
+
}
|
|
63
|
+
return current > dayjs(maxDate).endOf('day');
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}, [validDate, maxDate, minDate]);
|
|
67
|
+
var node = props.time_only ? /*#__PURE__*/React__default.createElement(TimePicker_L, _objectSpread(_objectSpread({
|
|
68
|
+
getPopupContainer: getPopupContainer,
|
|
69
|
+
value: isUnknown ? null : transValue(value),
|
|
70
|
+
onChange: handleChange,
|
|
71
|
+
disabledDate: disabledDate,
|
|
72
|
+
format: format
|
|
73
|
+
}, rest), {}, {
|
|
74
|
+
// onBlur={undefined}
|
|
75
|
+
// onBlurCapture={undefined}
|
|
76
|
+
style: _style,
|
|
77
|
+
placeholder: '请选择'
|
|
78
|
+
})) : /*#__PURE__*/React__default.createElement(DatePicker_L, _objectSpread(_objectSpread({
|
|
79
|
+
getPopupContainer: getPopupContainer,
|
|
80
|
+
value: isUnknown ? null : transValue(value),
|
|
81
|
+
onChange: handleChange,
|
|
82
|
+
disabledDate: disabledDate,
|
|
83
|
+
format: format,
|
|
84
|
+
presets: presets_date()
|
|
85
|
+
}, rest), {}, {
|
|
86
|
+
style: _style,
|
|
87
|
+
placeholder: '请选择'
|
|
88
|
+
}));
|
|
89
|
+
return get_unknown_conf(props) ? /*#__PURE__*/React__default.createElement("span", {
|
|
90
|
+
style: {
|
|
91
|
+
display: 'flex',
|
|
92
|
+
alignItems: 'center'
|
|
93
|
+
}
|
|
94
|
+
}, node, /*#__PURE__*/React__default.createElement("span", {
|
|
95
|
+
style: {
|
|
96
|
+
marginLeft: 6,
|
|
97
|
+
flex: 1
|
|
98
|
+
}
|
|
99
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
100
|
+
checked: isUnknown,
|
|
101
|
+
skipGroup: true,
|
|
102
|
+
onChange: function onChange(e) {
|
|
103
|
+
var _value = e.target.checked ? UNKNOWN_TIME_SYMBOL : null;
|
|
104
|
+
var value = handleChangeValue(props, _value);
|
|
105
|
+
_onChange === null || _onChange === void 0 || _onChange(value);
|
|
106
|
+
}
|
|
107
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
108
|
+
style: {
|
|
109
|
+
marginLeft: 6
|
|
110
|
+
}
|
|
111
|
+
}, "\u4E0D\u8BE6"))) : node;
|
|
112
|
+
}
|
|
113
|
+
var df = MyDatePicker_Inner;
|
|
114
|
+
// const df = memo<IMyDatePickerProps>(MyDatePicker_Inner, areEqual)
|
|
115
|
+
MyDatePicker_Inner.MonthPicker = MonthPicker_L;
|
|
116
|
+
var MyDatePickerInner = df;
|
|
117
|
+
export { MyDatePickerInner as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["icon_type", "value", "onChange", "form"];
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import React__default, { useState, useEffect } from 'react';
|
|
8
|
+
function use_icon(props) {
|
|
9
|
+
var _props$icon_type = props.icon_type,
|
|
10
|
+
icon_type = _props$icon_type === void 0 ? '' : _props$icon_type,
|
|
11
|
+
value = props.value,
|
|
12
|
+
onChange = props.onChange,
|
|
13
|
+
form = props.form,
|
|
14
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
var _useState = useState({}),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
all_icons = _useState2[0],
|
|
18
|
+
set_all_icons = _useState2[1];
|
|
19
|
+
var _useState3 = useState([]),
|
|
20
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
21
|
+
all_keys = _useState4[0],
|
|
22
|
+
set_all_keys = _useState4[1];
|
|
23
|
+
var QuestionOutlined = all_icons['QuestionOutlined'] || function () {
|
|
24
|
+
return /*#__PURE__*/React__default.createElement("span", null, "?");
|
|
25
|
+
};
|
|
26
|
+
function render_Icon(t) {
|
|
27
|
+
var _all_icons$default, _all_icons$default2;
|
|
28
|
+
var p = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
|
+
if (!((_all_icons$default = all_icons["default"]) !== null && _all_icons$default !== void 0 && _all_icons$default.render)) return null;
|
|
30
|
+
var R = (_all_icons$default2 = all_icons["default"]) === null || _all_icons$default2 === void 0 ? void 0 : _all_icons$default2.render;
|
|
31
|
+
if (!t) return null;
|
|
32
|
+
if (!all_keys.includes(t)) return /*#__PURE__*/React__default.createElement(R, _objectSpread(_objectSpread({
|
|
33
|
+
title: t,
|
|
34
|
+
component: QuestionOutlined
|
|
35
|
+
}, p), others));
|
|
36
|
+
var C = all_icons[t];
|
|
37
|
+
return /*#__PURE__*/React__default.createElement(R, _objectSpread(_objectSpread({
|
|
38
|
+
title: t,
|
|
39
|
+
component: C
|
|
40
|
+
}, p), others));
|
|
41
|
+
}
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
import('@ant-design/icons').then(function (mod) {
|
|
44
|
+
/*#__PURE__*/React__default.createElement(mod["default"], null);
|
|
45
|
+
set_all_icons(mod);
|
|
46
|
+
var keys = Object.keys(mod).filter(function (_) {
|
|
47
|
+
return ['Outlined'].some(function (limit) {
|
|
48
|
+
return _.includes(limit);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
set_all_keys(keys);
|
|
52
|
+
});
|
|
53
|
+
}, []);
|
|
54
|
+
return {
|
|
55
|
+
all_keys: all_keys,
|
|
56
|
+
render_Icon: render_Icon
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export { use_icon as u };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { A as ArrayInput,
|
|
1
|
+
export { A as ArrayInput, w as ArraySingle, a1 as AutoComplete_L, a0 as Calendar_L, C as Checkbox_L, a2 as ColorPicker_L, ac as ContainerDimensions, n as DatePicker_L, D as Dropdown_L, a3 as Form_L, K as GlobalModal, J as GlobalModal_, a6 as Modal_L, k as MonthPicker_L, I as MountGlobalModal, F as MyAutoComplete, G as MyButton, v as MyCheckbox, t as MyCheckbox_Display, B as MyColor, M as MyIcon, E as MyIconSelect, e as MyInput, N as MyLazyComponent, L as MyMonaco, y as MyRangeDate, z as MyRangeDateTime, x as MyRangePicker, r as MySelect, H as MySwitch, a7 as Pagination_L, aa as QRCode_L, R as RangePicker_L, a8 as SelectOption_L, S as Select_L, ab as Switch_L, a4 as Table_L, T as TimePicker_L, a9 as TreeSelect_L, a5 as Tree_L, U as UNKNOWN_TIME_SYMBOL, c as check_multiple, $ as displayValue, X as form_validate, l as formatDatePickerProps, Y as fuck_focus, P as getArray, Q as getFormat, g as getInputStyle, a as getMarshal, V as getParamByName, Z as get_check_invert_values, b as get_mode, j as get_status_cls, o as get_unknown_conf, W as handle_form_error, O as isUrl, p as packs, _ as parse_MC_dict_options, i as parse_MC_option, d as parse_MC_value, u as use_options } from './a_chunks/index.js';
|
|
2
2
|
export { Dayjs } from 'dayjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '@ant-design/icons';
|
|
5
4
|
import '@noah-libjs/utils';
|
|
6
5
|
import 'antd';
|
|
7
6
|
import 'rc-select';
|