amis-core 3.1.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.d.ts +1 -1
- package/esm/RootRenderer.js +3 -3
- package/esm/SchemaRenderer.js +6 -2
- package/esm/Scoped.d.ts +4 -1
- package/esm/Scoped.js +9 -5
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.d.ts +4 -24
- package/esm/WithRootStore.js +12 -4
- package/esm/WithStore.js +23 -16
- package/esm/actions/Action.d.ts +1 -0
- package/esm/actions/Action.js +70 -45
- package/esm/actions/AjaxAction.d.ts +6 -8
- package/esm/actions/AjaxAction.js +20 -18
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.d.ts +1 -2
- package/esm/actions/CmptAction.js +47 -32
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +3 -2
- package/esm/actions/DialogAction.d.ts +2 -0
- package/esm/actions/DialogAction.js +39 -23
- package/esm/actions/DrawerAction.js +4 -4
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/StatusAction.d.ts +15 -0
- package/esm/actions/StatusAction.js +49 -0
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/index.d.ts +1 -0
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +3 -2
- package/esm/components/PopOver.js +3 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +3 -1
- package/esm/index.js +16 -14
- package/esm/locale.js +1 -1
- package/esm/polyfills.d.ts +3 -0
- package/esm/polyfills.js +18 -0
- package/esm/renderers/Form.d.ts +7 -7
- package/esm/renderers/Form.js +182 -128
- package/esm/renderers/Item.d.ts +82 -77
- package/esm/renderers/Item.js +90 -74
- package/esm/renderers/Options.js +1 -2
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.d.ts +4 -24
- package/esm/renderers/wrapControl.js +140 -88
- package/esm/store/app.js +42 -4
- package/esm/store/combo.d.ts +564 -1892
- package/esm/store/combo.js +9 -2
- package/esm/store/crud.d.ts +4 -2
- package/esm/store/crud.js +17 -4
- package/esm/store/form.d.ts +182 -882
- package/esm/store/form.js +83 -81
- package/esm/store/formItem.d.ts +6 -2
- package/esm/store/formItem.js +19 -3
- package/esm/store/iRenderer.js +3 -2
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -0
- package/esm/store/list.js +8 -2
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +3 -2
- package/esm/store/service.js +17 -12
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +604 -2020
- package/esm/store/table.js +86 -56
- package/esm/store/table2.d.ts +49 -0
- package/esm/store/table2.js +37 -4
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +22 -5
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.d.ts +3 -2
- package/esm/utils/DataSchema.js +27 -7
- package/esm/utils/DataScope.d.ts +10 -3
- package/esm/utils/DataScope.js +50 -12
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.d.ts +2 -2
- package/esm/utils/api.js +152 -112
- package/esm/utils/arraySlice.d.ts +1 -0
- package/esm/utils/arraySlice.js +76 -0
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/dataMapping.js +29 -19
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.d.ts +2 -0
- package/esm/utils/debug.js +34 -7
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.js +4 -1
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.d.ts +0 -1
- package/esm/utils/formula.js +6 -9
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +19 -2
- package/esm/utils/helper.js +69 -10
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +4 -2
- package/esm/utils/icon.js +3 -2
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.d.ts +3 -0
- package/esm/utils/math.js +52 -0
- package/esm/utils/memoryParse.js +1 -1
- package/esm/utils/normalizeLink.js +18 -9
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.d.ts +7 -0
- package/esm/utils/object.js +13 -2
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +2 -2
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.d.ts +1 -1
- package/esm/utils/renderer-event.js +14 -6
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/lib/Root.js +10 -7
- package/lib/RootRenderer.d.ts +1 -1
- package/lib/RootRenderer.js +11 -8
- package/lib/SchemaRenderer.js +13 -6
- package/lib/Scoped.d.ts +4 -1
- package/lib/Scoped.js +19 -13
- package/lib/StatusScoped.js +5 -2
- package/lib/WithRootStore.d.ts +4 -24
- package/lib/WithRootStore.js +15 -4
- package/lib/WithStore.js +27 -17
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +70 -45
- package/lib/actions/AjaxAction.d.ts +6 -8
- package/lib/actions/AjaxAction.js +20 -18
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.d.ts +1 -2
- package/lib/actions/CmptAction.js +47 -32
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +9 -5
- package/lib/actions/DialogAction.d.ts +2 -0
- package/lib/actions/DialogAction.js +39 -23
- package/lib/actions/DrawerAction.js +4 -4
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/StatusAction.d.ts +15 -0
- package/lib/actions/StatusAction.js +53 -0
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/index.d.ts +1 -0
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/LazyComponent.js +12 -14
- package/lib/components/Overlay.js +15 -14
- package/lib/components/PopOver.js +12 -10
- package/lib/env.js +4 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +11 -9
- package/lib/index.d.ts +3 -1
- package/lib/index.js +26 -19
- package/lib/locale.js +6 -3
- package/lib/polyfills.d.ts +3 -0
- package/lib/polyfills.js +20 -0
- package/lib/renderers/Form.d.ts +7 -7
- package/lib/renderers/Form.js +194 -135
- package/lib/renderers/Item.d.ts +82 -77
- package/lib/renderers/Item.js +126 -104
- package/lib/renderers/Options.js +10 -5
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.d.ts +4 -24
- package/lib/renderers/wrapControl.js +143 -88
- package/lib/store/app.js +44 -3
- package/lib/store/combo.d.ts +564 -1892
- package/lib/store/combo.js +9 -2
- package/lib/store/crud.d.ts +4 -2
- package/lib/store/crud.js +17 -4
- package/lib/store/form.d.ts +182 -882
- package/lib/store/form.js +81 -79
- package/lib/store/formItem.d.ts +6 -2
- package/lib/store/formItem.js +19 -3
- package/lib/store/iRenderer.js +9 -5
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -0
- package/lib/store/list.js +8 -2
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +9 -5
- package/lib/store/service.js +17 -12
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +604 -2020
- package/lib/store/table.js +85 -55
- package/lib/store/table2.d.ts +49 -0
- package/lib/store/table2.js +36 -3
- package/lib/theme.js +6 -3
- package/lib/types.d.ts +22 -5
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.d.ts +3 -2
- package/lib/utils/DataSchema.js +27 -7
- package/lib/utils/DataScope.d.ts +10 -3
- package/lib/utils/DataScope.js +50 -11
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.d.ts +2 -2
- package/lib/utils/api.js +151 -111
- package/lib/utils/arraySlice.d.ts +1 -0
- package/lib/utils/arraySlice.js +80 -0
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +8 -6
- package/lib/utils/dataMapping.js +29 -19
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.d.ts +2 -0
- package/lib/utils/debug.js +61 -33
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +10 -5
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.d.ts +0 -1
- package/lib/utils/formula.js +6 -10
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +19 -2
- package/lib/utils/helper.js +70 -9
- package/lib/utils/highlight.js +8 -9
- package/lib/utils/icon.d.ts +4 -2
- package/lib/utils/icon.js +12 -10
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.d.ts +3 -0
- package/lib/utils/math.js +58 -0
- package/lib/utils/memoryParse.js +1 -1
- package/lib/utils/normalizeLink.js +18 -9
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.d.ts +7 -0
- package/lib/utils/object.js +13 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +7 -3
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.d.ts +1 -1
- package/lib/utils/renderer-event.js +13 -5
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/package.json +9 -4
package/lib/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ var debounce = require('lodash/debounce');
|
|
|
21
21
|
var api = require('../utils/api.js');
|
|
22
22
|
var ReactDOM = require('react-dom');
|
|
23
23
|
require('../utils/ColorScale.js');
|
|
24
|
-
require('
|
|
24
|
+
require('../utils/columnsSplit.js');
|
|
25
25
|
var dataMapping = require('../utils/dataMapping.js');
|
|
26
26
|
require('../utils/DataSchema.js');
|
|
27
27
|
require('../utils/DataScope.js');
|
|
@@ -29,6 +29,7 @@ require('moment');
|
|
|
29
29
|
var object = require('../utils/object.js');
|
|
30
30
|
require('amis-formula');
|
|
31
31
|
require('../utils/debug.js');
|
|
32
|
+
require('../utils/dom.js');
|
|
32
33
|
require('../utils/errors.js');
|
|
33
34
|
require('lodash/isPlainObject');
|
|
34
35
|
require('classnames');
|
|
@@ -37,8 +38,10 @@ require('lodash/isObject');
|
|
|
37
38
|
require('lodash/isString');
|
|
38
39
|
require('lodash/isBoolean');
|
|
39
40
|
var getVariable = require('../utils/getVariable.js');
|
|
40
|
-
require('
|
|
41
|
+
require('../utils/highlight.js');
|
|
42
|
+
require('../utils/icon.js');
|
|
41
43
|
require('../utils/image.js');
|
|
44
|
+
require('lodash/isEqual');
|
|
42
45
|
require('../actions/Action.js');
|
|
43
46
|
require('lodash/cloneDeep');
|
|
44
47
|
require('../utils/resize-sensor.js');
|
|
@@ -60,6 +63,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
60
63
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
61
64
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
62
65
|
|
|
66
|
+
var __react_jsx__ = require('react');
|
|
67
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
68
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
63
69
|
var getItemLabelClassName = function (props) {
|
|
64
70
|
var staticLabelClassName = props.staticLabelClassName, labelClassName = props.labelClassName;
|
|
65
71
|
return props.static && staticLabelClassName
|
|
@@ -279,11 +285,12 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
279
285
|
]
|
|
280
286
|
};
|
|
281
287
|
if (mode === 'popOver') {
|
|
282
|
-
return (
|
|
283
|
-
|
|
288
|
+
return (_J$X_(Overlay["default"], { container: popOverContainer || this.target, target: function () { return _this.target; }, placement: position || 'left-bottom-left-top', show: true },
|
|
289
|
+
_J$X_(PopOver["default"], { classPrefix: ns, className: cx("".concat(ns, "auto-fill-popOver"), popOverClassName), style: {
|
|
284
290
|
minWidth: this.target ? this.target.offsetWidth : undefined
|
|
285
|
-
}, offset: offset, onHide: this.
|
|
286
|
-
|
|
291
|
+
}, offset: offset, onHide: this.handleClose, overlay: true }, render('popOver-auto-fill-form', form, {
|
|
292
|
+
onAction: this.handleAction,
|
|
293
|
+
onSubmit: this.handleSubmit
|
|
287
294
|
}))));
|
|
288
295
|
}
|
|
289
296
|
else {
|
|
@@ -291,15 +298,20 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
291
298
|
}
|
|
292
299
|
};
|
|
293
300
|
// 参照录入popOver提交
|
|
294
|
-
FormItemWrap.prototype.
|
|
301
|
+
FormItemWrap.prototype.handleSubmit = function (values) {
|
|
295
302
|
var _a = this.props; _a.onBulkChange; var autoFill = _a.autoFill;
|
|
296
303
|
if (!autoFill || (autoFill && !(autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')))) {
|
|
297
304
|
return;
|
|
298
305
|
}
|
|
299
306
|
this.updateAutoFillData(values.selectedItems);
|
|
300
|
-
this.
|
|
307
|
+
this.handleClose();
|
|
301
308
|
};
|
|
302
|
-
FormItemWrap.prototype.
|
|
309
|
+
FormItemWrap.prototype.handleAction = function (e, action, data) {
|
|
310
|
+
if (action.actionType === 'cancel') {
|
|
311
|
+
this.handleClose();
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
FormItemWrap.prototype.handleClose = function () {
|
|
303
315
|
this.setState({
|
|
304
316
|
isOpened: false
|
|
305
317
|
});
|
|
@@ -363,7 +375,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
363
375
|
}
|
|
364
376
|
var renderLayout = FormItemWrap.layoutRenderers[mode] ||
|
|
365
377
|
FormItemWrap.layoutRenderers['normal'];
|
|
366
|
-
return (
|
|
378
|
+
return (_J$X_(React__default["default"].Fragment, null,
|
|
367
379
|
renderLayout(this.props, this.renderControl.bind(this)),
|
|
368
380
|
model
|
|
369
381
|
? render('modal', tslib.__assign({ type: 'dialog' }, model.dialogSchema), {
|
|
@@ -374,7 +386,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
374
386
|
formStore: undefined
|
|
375
387
|
})
|
|
376
388
|
: null,
|
|
377
|
-
|
|
389
|
+
_J$X_(CustomStyle["default"], { config: {
|
|
378
390
|
themeCss: themeCss || css,
|
|
379
391
|
classNames: [
|
|
380
392
|
{
|
|
@@ -384,7 +396,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
384
396
|
],
|
|
385
397
|
id: id + '-label'
|
|
386
398
|
}, env: env }),
|
|
387
|
-
|
|
399
|
+
_J$X_(CustomStyle["default"], { config: {
|
|
388
400
|
themeCss: themeCss || css,
|
|
389
401
|
classNames: [
|
|
390
402
|
{
|
|
@@ -412,24 +424,24 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
412
424
|
var right = helper.getWidthRate(horizontal.right);
|
|
413
425
|
var labelAlign = props.labelAlign || props.formLabelAlign;
|
|
414
426
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
415
|
-
return (
|
|
427
|
+
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--horizontal", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
416
428
|
'Form-item--horizontal-justify': horizontal.justify
|
|
417
429
|
},
|
|
418
430
|
_a["is-error"] = model && !model.valid,
|
|
419
431
|
_a["is-required"] = required,
|
|
420
432
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames), style: style },
|
|
421
|
-
label !== false ? (
|
|
433
|
+
label !== false ? (_J$X_("label", { className: cx("Form-label", (_b = {},
|
|
422
434
|
_b["Form-itemColumn--".concat(typeof horizontal.leftFixed === 'string'
|
|
423
435
|
? horizontal.leftFixed
|
|
424
436
|
: 'normal')] = horizontal.leftFixed,
|
|
425
437
|
_b["Form-itemColumn--".concat(left)] = !horizontal.leftFixed,
|
|
426
438
|
_b['Form-label--left'] = labelAlign === 'left',
|
|
427
439
|
_b), getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
428
|
-
|
|
440
|
+
_J$X_("span", null,
|
|
429
441
|
label
|
|
430
442
|
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
431
443
|
: null,
|
|
432
|
-
required && (label || labelRemark) ? (
|
|
444
|
+
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
433
445
|
labelRemark
|
|
434
446
|
? render('label-remark', {
|
|
435
447
|
type: 'remark',
|
|
@@ -437,14 +449,10 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
437
449
|
tooltip: labelRemark,
|
|
438
450
|
useMobileUI: useMobileUI,
|
|
439
451
|
className: cx("Form-labelRemark"),
|
|
440
|
-
container: props.popOverContainer
|
|
441
|
-
? props.popOverContainer
|
|
442
|
-
: env && env.getModalContainer
|
|
443
|
-
? env.getModalContainer
|
|
444
|
-
: undefined
|
|
452
|
+
container: props.popOverContainer || env.getModalContainer
|
|
445
453
|
})
|
|
446
454
|
: null))) : null,
|
|
447
|
-
|
|
455
|
+
_J$X_("div", { className: cx("Form-value", (_c = {},
|
|
448
456
|
// [`Form-itemColumn--offset${getWidthRate(horizontal.offset)}`]: !label && label !== false,
|
|
449
457
|
_c["Form-itemColumn--".concat(right)] = !horizontal.leftFixed && !!right && right !== 12 - left,
|
|
450
458
|
_c)) },
|
|
@@ -461,11 +469,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
461
469
|
tooltip: remark,
|
|
462
470
|
className: cx("Form-remark"),
|
|
463
471
|
useMobileUI: useMobileUI,
|
|
464
|
-
container: props.popOverContainer
|
|
465
|
-
? props.popOverContainer
|
|
466
|
-
: env && env.getModalContainer
|
|
467
|
-
? env.getModalContainer
|
|
468
|
-
: undefined
|
|
472
|
+
container: props.popOverContainer || env.getModalContainer
|
|
469
473
|
})
|
|
470
474
|
: null,
|
|
471
475
|
hint && model && model.isFocused
|
|
@@ -476,7 +480,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
476
480
|
model &&
|
|
477
481
|
!model.valid &&
|
|
478
482
|
showErrorMsg !== false &&
|
|
479
|
-
Array.isArray(model.errors) ? (
|
|
483
|
+
Array.isArray(model.errors) ? (_J$X_("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (_J$X_("li", { key: key }, msg)); }))) : null,
|
|
480
484
|
renderDescription !== false && description
|
|
481
485
|
? render('description', description, {
|
|
482
486
|
className: cx("Form-description", descriptionClassName)
|
|
@@ -486,18 +490,19 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
486
490
|
normal: function (props, renderControl) {
|
|
487
491
|
var _a;
|
|
488
492
|
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName;
|
|
493
|
+
var mobileUI = useMobileUI && helper.isMobile();
|
|
489
494
|
description = description || desc;
|
|
490
|
-
return (
|
|
495
|
+
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--normal", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
491
496
|
'is-error': model && !model.valid
|
|
492
497
|
},
|
|
493
498
|
_a["is-required"] = required,
|
|
494
499
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames), style: style },
|
|
495
|
-
label && renderLabel !== false ? (
|
|
496
|
-
|
|
500
|
+
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)) },
|
|
501
|
+
_J$X_("span", null,
|
|
497
502
|
label
|
|
498
503
|
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
499
504
|
: null,
|
|
500
|
-
required && (label || labelRemark) ? (
|
|
505
|
+
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
501
506
|
labelRemark
|
|
502
507
|
? render('label-remark', {
|
|
503
508
|
type: 'remark',
|
|
@@ -505,62 +510,87 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
505
510
|
tooltip: labelRemark,
|
|
506
511
|
className: cx("Form-lableRemark"),
|
|
507
512
|
useMobileUI: useMobileUI,
|
|
508
|
-
container: props.popOverContainer
|
|
509
|
-
? props.popOverContainer
|
|
510
|
-
: env && env.getModalContainer
|
|
511
|
-
? env.getModalContainer
|
|
512
|
-
: undefined
|
|
513
|
+
container: props.popOverContainer || env.getModalContainer
|
|
513
514
|
})
|
|
514
515
|
: null))) : null,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
516
|
+
mobileUI ? (_J$X_("div", { className: cx('Form-item-controlBox') },
|
|
517
|
+
renderControl(),
|
|
518
|
+
caption
|
|
519
|
+
? render('caption', caption, {
|
|
520
|
+
className: cx("Form-caption", captionClassName)
|
|
521
|
+
})
|
|
522
|
+
: null,
|
|
523
|
+
remark
|
|
524
|
+
? render('remark', {
|
|
525
|
+
type: 'remark',
|
|
526
|
+
icon: remark.icon || 'warning-mark',
|
|
527
|
+
className: cx("Form-remark"),
|
|
528
|
+
tooltip: remark,
|
|
529
|
+
useMobileUI: useMobileUI,
|
|
530
|
+
container: props.popOverContainer || env.getModalContainer
|
|
531
|
+
})
|
|
532
|
+
: null,
|
|
533
|
+
hint && model && model.isFocused
|
|
534
|
+
? render('hint', hint, {
|
|
535
|
+
className: cx("Form-hint")
|
|
536
|
+
})
|
|
537
|
+
: null,
|
|
538
|
+
model &&
|
|
539
|
+
!model.valid &&
|
|
540
|
+
showErrorMsg !== false &&
|
|
541
|
+
Array.isArray(model.errors) ? (_J$X_("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (_J$X_("li", { key: key }, msg)); }))) : null,
|
|
542
|
+
renderDescription !== false && description
|
|
543
|
+
? render('description', description, {
|
|
544
|
+
className: cx("Form-description", descriptionClassName)
|
|
545
|
+
})
|
|
546
|
+
: null)) : (_J$X_(React__default["default"].Fragment, null,
|
|
547
|
+
renderControl(),
|
|
548
|
+
caption
|
|
549
|
+
? render('caption', caption, {
|
|
550
|
+
className: cx("Form-caption", captionClassName)
|
|
551
|
+
})
|
|
552
|
+
: null,
|
|
553
|
+
remark
|
|
554
|
+
? render('remark', {
|
|
555
|
+
type: 'remark',
|
|
556
|
+
icon: remark.icon || 'warning-mark',
|
|
557
|
+
className: cx("Form-remark"),
|
|
558
|
+
tooltip: remark,
|
|
559
|
+
useMobileUI: useMobileUI,
|
|
560
|
+
container: props.popOverContainer || env.getModalContainer
|
|
561
|
+
})
|
|
562
|
+
: null,
|
|
563
|
+
hint && model && model.isFocused
|
|
564
|
+
? render('hint', hint, {
|
|
565
|
+
className: cx("Form-hint")
|
|
566
|
+
})
|
|
567
|
+
: null,
|
|
568
|
+
model &&
|
|
569
|
+
!model.valid &&
|
|
570
|
+
showErrorMsg !== false &&
|
|
571
|
+
Array.isArray(model.errors) ? (_J$X_("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (_J$X_("li", { key: key }, msg)); }))) : null,
|
|
572
|
+
renderDescription !== false && description
|
|
573
|
+
? render('description', description, {
|
|
574
|
+
className: cx("Form-description", descriptionClassName)
|
|
575
|
+
})
|
|
576
|
+
: null))));
|
|
547
577
|
},
|
|
548
578
|
inline: function (props, renderControl) {
|
|
549
579
|
var _a;
|
|
550
580
|
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, remark = props.remark, labelRemark = props.labelRemark, env = props.env, hint = props.hint, renderLabel = props.renderLabel, renderDescription = props.renderDescription, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName;
|
|
551
581
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
552
582
|
description = description || desc;
|
|
553
|
-
return (
|
|
583
|
+
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--inline", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
554
584
|
'is-error': model && !model.valid
|
|
555
585
|
},
|
|
556
586
|
_a["is-required"] = required,
|
|
557
587
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames), style: style },
|
|
558
|
-
label && renderLabel !== false ? (
|
|
559
|
-
|
|
588
|
+
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
589
|
+
_J$X_("span", null,
|
|
560
590
|
label
|
|
561
591
|
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
562
592
|
: label,
|
|
563
|
-
required && (label || labelRemark) ? (
|
|
593
|
+
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
564
594
|
labelRemark
|
|
565
595
|
? render('label-remark', {
|
|
566
596
|
type: 'remark',
|
|
@@ -568,14 +598,10 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
568
598
|
tooltip: labelRemark,
|
|
569
599
|
className: cx("Form-lableRemark"),
|
|
570
600
|
useMobileUI: useMobileUI,
|
|
571
|
-
container: props.popOverContainer
|
|
572
|
-
? props.popOverContainer
|
|
573
|
-
: env && env.getModalContainer
|
|
574
|
-
? env.getModalContainer
|
|
575
|
-
: undefined
|
|
601
|
+
container: props.popOverContainer || env.getModalContainer
|
|
576
602
|
})
|
|
577
603
|
: null))) : null,
|
|
578
|
-
|
|
604
|
+
_J$X_("div", { className: cx("Form-value") },
|
|
579
605
|
renderControl(),
|
|
580
606
|
caption
|
|
581
607
|
? render('caption', caption, {
|
|
@@ -589,11 +615,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
589
615
|
className: cx("Form-remark"),
|
|
590
616
|
tooltip: remark,
|
|
591
617
|
useMobileUI: useMobileUI,
|
|
592
|
-
container: props.popOverContainer
|
|
593
|
-
? props.popOverContainer
|
|
594
|
-
: env && env.getModalContainer
|
|
595
|
-
? env.getModalContainer
|
|
596
|
-
: undefined
|
|
618
|
+
container: props.popOverContainer || env.getModalContainer
|
|
597
619
|
})
|
|
598
620
|
: null,
|
|
599
621
|
hint && model && model.isFocused
|
|
@@ -604,7 +626,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
604
626
|
model &&
|
|
605
627
|
!model.valid &&
|
|
606
628
|
showErrorMsg !== false &&
|
|
607
|
-
Array.isArray(model.errors) ? (
|
|
629
|
+
Array.isArray(model.errors) ? (_J$X_("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (_J$X_("li", { key: key }, msg)); }))) : null,
|
|
608
630
|
renderDescription !== false && description
|
|
609
631
|
? render('description', description, {
|
|
610
632
|
className: cx("Form-description", descriptionClassName)
|
|
@@ -616,16 +638,16 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
616
638
|
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName;
|
|
617
639
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
618
640
|
description = description || desc;
|
|
619
|
-
return (
|
|
641
|
+
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--row", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
620
642
|
'is-error': model && !model.valid
|
|
621
643
|
},
|
|
622
644
|
_a["is-required"] = required,
|
|
623
645
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames), style: style },
|
|
624
|
-
|
|
625
|
-
label && renderLabel !== false ? (
|
|
626
|
-
|
|
646
|
+
_J$X_("div", { className: cx('Form-rowInner') },
|
|
647
|
+
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
648
|
+
_J$X_("span", null,
|
|
627
649
|
render('label', typeof label === 'string' ? tpl.filter(label, data) : label),
|
|
628
|
-
required && (label || labelRemark) ? (
|
|
650
|
+
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
629
651
|
labelRemark
|
|
630
652
|
? render('label-remark', {
|
|
631
653
|
type: 'remark',
|
|
@@ -633,11 +655,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
633
655
|
tooltip: labelRemark,
|
|
634
656
|
className: cx("Form-lableRemark"),
|
|
635
657
|
useMobileUI: useMobileUI,
|
|
636
|
-
container: props.popOverContainer
|
|
637
|
-
? props.popOverContainer
|
|
638
|
-
: env && env.getModalContainer
|
|
639
|
-
? env.getModalContainer
|
|
640
|
-
: undefined
|
|
658
|
+
container: props.popOverContainer || env.getModalContainer
|
|
641
659
|
})
|
|
642
660
|
: null))) : null,
|
|
643
661
|
renderControl(),
|
|
@@ -652,9 +670,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
652
670
|
icon: remark.icon || 'warning-mark',
|
|
653
671
|
className: cx("Form-remark"),
|
|
654
672
|
tooltip: remark,
|
|
655
|
-
container:
|
|
656
|
-
? env.getModalContainer
|
|
657
|
-
: undefined
|
|
673
|
+
container: props.popOverContainer || env.getModalContainer
|
|
658
674
|
})
|
|
659
675
|
: null),
|
|
660
676
|
hint && model && model.isFocused
|
|
@@ -665,7 +681,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
665
681
|
model &&
|
|
666
682
|
!model.valid &&
|
|
667
683
|
showErrorMsg !== false &&
|
|
668
|
-
Array.isArray(model.errors) ? (
|
|
684
|
+
Array.isArray(model.errors) ? (_J$X_("ul", { className: cx('Form-feedback') }, model.errors.map(function (msg, key) { return (_J$X_("li", { key: key }, msg)); }))) : null,
|
|
669
685
|
description && renderDescription !== false
|
|
670
686
|
? render('description', description, {
|
|
671
687
|
className: cx("Form-description", descriptionClassName)
|
|
@@ -690,13 +706,19 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
690
706
|
tslib.__metadata("design:type", Function),
|
|
691
707
|
tslib.__metadata("design:paramtypes", [Object]),
|
|
692
708
|
tslib.__metadata("design:returntype", void 0)
|
|
693
|
-
], FormItemWrap.prototype, "
|
|
709
|
+
], FormItemWrap.prototype, "handleSubmit", null);
|
|
710
|
+
tslib.__decorate([
|
|
711
|
+
helper.autobind,
|
|
712
|
+
tslib.__metadata("design:type", Function),
|
|
713
|
+
tslib.__metadata("design:paramtypes", [Object, Object, Object]),
|
|
714
|
+
tslib.__metadata("design:returntype", void 0)
|
|
715
|
+
], FormItemWrap.prototype, "handleAction", null);
|
|
694
716
|
tslib.__decorate([
|
|
695
717
|
helper.autobind,
|
|
696
718
|
tslib.__metadata("design:type", Function),
|
|
697
719
|
tslib.__metadata("design:paramtypes", []),
|
|
698
720
|
tslib.__metadata("design:returntype", void 0)
|
|
699
|
-
], FormItemWrap.prototype, "
|
|
721
|
+
], FormItemWrap.prototype, "handleClose", null);
|
|
700
722
|
tslib.__decorate([
|
|
701
723
|
helper.autobind,
|
|
702
724
|
tslib.__metadata("design:type", Function),
|
|
@@ -855,8 +877,8 @@ function asFormItem(config) {
|
|
|
855
877
|
var mobileUI = useMobileUI && helper.isMobile();
|
|
856
878
|
//@ts-ignore
|
|
857
879
|
var isOpened = this.state.isOpened;
|
|
858
|
-
return (
|
|
859
|
-
|
|
880
|
+
return (_J$X_(React__default["default"].Fragment, null,
|
|
881
|
+
_J$X_(Control, tslib.__assign({}, rest, { useMobileUI: useMobileUI, onOpenDialog: this.handleOpenDialog, size: config.sizeMutable !== false ? undefined : size, onFocus: this.handleFocus, onBlur: this.handleBlur, type: type, classnames: cx, ref: isSFC ? undefined : this.refFn, forwardedRef: isSFC ? this.refFn : undefined, formItem: model, className: cx("Form-control", (_a = {
|
|
860
882
|
'is-inline': !!rest.inline && !mobileUI,
|
|
861
883
|
'is-error': model && !model.valid,
|
|
862
884
|
'is-full': size === 'full'
|
package/lib/renderers/Options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -28,23 +28,25 @@ var isPlainObject = require('lodash/isPlainObject');
|
|
|
28
28
|
var normalizeOptions = require('../utils/normalizeOptions.js');
|
|
29
29
|
var optionValueCompare = require('../utils/optionValueCompare.js');
|
|
30
30
|
require('../utils/ColorScale.js');
|
|
31
|
-
require('
|
|
31
|
+
require('../utils/columnsSplit.js');
|
|
32
32
|
require('../utils/DataSchema.js');
|
|
33
33
|
require('../utils/DataScope.js');
|
|
34
34
|
require('../utils/debug.js');
|
|
35
|
-
require('
|
|
35
|
+
require('../utils/dom.js');
|
|
36
36
|
require('../utils/errors.js');
|
|
37
37
|
require('classnames');
|
|
38
38
|
require('lodash/isObject');
|
|
39
39
|
require('lodash/isString');
|
|
40
40
|
require('lodash/isBoolean');
|
|
41
|
-
require('
|
|
41
|
+
require('../utils/highlight.js');
|
|
42
|
+
require('../utils/icon.js');
|
|
42
43
|
require('../utils/image.js');
|
|
43
44
|
var keyToPath = require('../utils/keyToPath.js');
|
|
44
45
|
var rendererEvent = require('../utils/renderer-event.js');
|
|
45
46
|
require('lodash/cloneDeep');
|
|
46
47
|
require('../utils/resize-sensor.js');
|
|
47
48
|
require('react-overlays/useRootClose');
|
|
49
|
+
require('react-dom');
|
|
48
50
|
require('../utils/SimpleMap.js');
|
|
49
51
|
require('lodash/mapValues');
|
|
50
52
|
require('lodash/camelCase');
|
|
@@ -60,6 +62,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
60
62
|
var findIndex__default = /*#__PURE__*/_interopDefaultLegacy(findIndex);
|
|
61
63
|
var isPlainObject__default = /*#__PURE__*/_interopDefaultLegacy(isPlainObject);
|
|
62
64
|
|
|
65
|
+
var __react_jsx__ = require('react');
|
|
66
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
67
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
63
68
|
var detectProps = Item.detectProps.concat([
|
|
64
69
|
'value',
|
|
65
70
|
'options',
|
|
@@ -807,7 +812,7 @@ function registerOptionsControl(config) {
|
|
|
807
812
|
FormOptionsItem.prototype.render = function () {
|
|
808
813
|
var _a = this.props, value = _a.value, formItem = _a.formItem, addApi = _a.addApi, editApi = _a.editApi, deleteApi = _a.deleteApi, creatable = _a.creatable, editable = _a.editable, removable = _a.removable, enableNodePath = _a.enableNodePath, pathSeparator = _a.pathSeparator, _b = _a.delimiter, delimiter = _b === void 0 ? ',' : _b, _c = _a.labelField, labelField = _c === void 0 ? 'label' : _c, _d = _a.valueField, valueField = _d === void 0 ? 'value' : _d, __ = _a.translate;
|
|
809
814
|
var _e = helper.normalizeNodePath(value, enableNodePath, labelField, valueField, pathSeparator, delimiter), nodePathArray = _e.nodePathArray, nodeValueArray = _e.nodeValueArray;
|
|
810
|
-
return (
|
|
815
|
+
return (_J$X_(Control, tslib.__assign({}, this.props, { placeholder: __(this.props.placeholder), ref: this.inputRef, options: formItem ? formItem.filteredOptions : [], onToggle: this.handleToggle, onToggleAll: this.handleToggleAll, selectedOptions: formItem
|
|
811
816
|
? formItem.getSelectedOptions(value, enableNodePath ? nodeValueArray : undefined)
|
|
812
817
|
: [], nodePath: nodePathArray, loading: formItem ? formItem.loading : false, setLoading: this.setLoading, setOptions: this.setOptions, syncOptions: this.syncOptions, reloadOptions: this.reload, deferLoad: this.deferLoad, leftDeferLoad: this.leftDeferLoad, expandTreeOptions: this.expandTreeOptions, creatable: creatable !== false && api.isEffectiveApi(addApi) ? true : creatable, editable: editable || (editable !== false && api.isEffectiveApi(editApi)), removable: removable || (removable !== false && api.isEffectiveApi(deleteApi)), onAdd: this.handleOptionAdd, onEdit: this.handleOptionEdit, onDelete: this.handleOptionDelete })));
|
|
813
818
|
};
|
package/lib/renderers/builtin.js
CHANGED
|
@@ -49,30 +49,10 @@ export interface ControlProps {
|
|
|
49
49
|
store: IIRendererStore;
|
|
50
50
|
}
|
|
51
51
|
export declare function wrapControl<T extends React.ComponentType<React.ComponentProps<T> & ControlProps>>(ComposedComponent: T): {
|
|
52
|
-
new (props: Omit<any, "rootStore">
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
57
|
-
readonly props: Readonly<Omit<any, "rootStore">>;
|
|
58
|
-
state: Readonly<{}>;
|
|
59
|
-
refs: {
|
|
60
|
-
[key: string]: React.ReactInstance;
|
|
61
|
-
};
|
|
62
|
-
componentDidMount?(): void;
|
|
63
|
-
shouldComponentUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
64
|
-
componentWillUnmount?(): void;
|
|
65
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
66
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>): any;
|
|
67
|
-
componentDidUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
68
|
-
componentWillMount?(): void;
|
|
69
|
-
UNSAFE_componentWillMount?(): void;
|
|
70
|
-
componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
71
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
72
|
-
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
73
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
74
|
-
};
|
|
75
|
-
new (props: Omit<any, "rootStore">, context: any): {
|
|
52
|
+
new (props: Omit<any, "rootStore">): {
|
|
53
|
+
ref: any;
|
|
54
|
+
getWrappedInstance(): any;
|
|
55
|
+
refFn(ref: any): void;
|
|
76
56
|
render(): React.JSX.Element;
|
|
77
57
|
context: unknown;
|
|
78
58
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|