amis-core 2.1.1-beta.2 → 2.2.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.js +1 -1
- package/esm/SchemaRenderer.js +2 -2
- package/esm/Scoped.js +1 -1
- package/esm/WithRootStore.d.ts +383 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/_virtual/index.js +1 -1
- package/esm/_virtual/index2.js +1 -1
- package/esm/_virtual/react-is.development.js +1 -1
- package/esm/_virtual/react-is.production.min.js +1 -1
- package/esm/actions/Action.js +1 -1
- package/esm/actions/AjaxAction.js +12 -12
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +1 -1
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +1 -1
- package/esm/actions/Decorators.js +1 -1
- package/esm/actions/DialogAction.js +1 -1
- package/esm/actions/DrawerAction.js +1 -1
- 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/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.d.ts +33 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +97 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +3 -0
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +3 -2
- package/esm/index.js +4 -3
- package/esm/locale.d.ts +63 -1
- package/esm/locale.js +3 -2
- package/esm/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/esm/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/esm/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/esm/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/esm/node_modules/dom-helpers/esm/contains.js +1 -1
- package/esm/node_modules/dom-helpers/esm/listen.js +1 -1
- package/esm/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/esm/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/esm/node_modules/object-assign/index.js +1 -1
- package/esm/node_modules/prop-types/checkPropTypes.js +1 -1
- package/esm/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
- package/esm/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
- package/esm/node_modules/prop-types/index.js +1 -1
- package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -1
- package/esm/node_modules/prop-types/lib/has.js +1 -1
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/esm/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/esm/node_modules/react-overlays/esm/Portal.js +1 -1
- package/esm/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/esm/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/esm/node_modules/react-overlays/esm/useRootClose.js +1 -1
- package/esm/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/esm/node_modules/warning/warning.js +1 -1
- package/esm/renderers/Form.d.ts +30 -1
- package/esm/renderers/Form.js +18 -6
- package/esm/renderers/Item.d.ts +511 -2
- package/esm/renderers/Item.js +6 -3
- package/esm/renderers/Options.d.ts +8 -0
- package/esm/renderers/Options.js +55 -35
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/wrapControl.d.ts +384 -2
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +24 -0
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +1 -1
- package/esm/store/crud.js +35 -20
- package/esm/store/form.d.ts +10 -0
- package/esm/store/form.js +48 -22
- package/esm/store/formItem.d.ts +1 -0
- package/esm/store/formItem.js +7 -2
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.d.ts +2 -2
- package/esm/store/index.js +4 -4
- package/esm/store/list.js +1 -1
- 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 +1 -1
- package/esm/store/service.js +11 -11
- package/esm/store/table.d.ts +27 -4
- package/esm/store/table.js +15 -4
- package/esm/store/{table-v2.d.ts → table2.d.ts} +32 -32
- package/esm/store/{table-v2.js → table2.js} +16 -16
- package/esm/theme.d.ts +33 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +1 -0
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.js +3 -2
- 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 +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/dom.js +1 -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.js +1 -1
- 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 +3 -3
- package/esm/utils/helper.js +24 -9
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +1 -0
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +1 -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/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveVariable.d.ts +1 -1
- package/esm/utils/resolveVariable.js +3 -3
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +2 -2
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.d.ts +7 -0
- package/esm/utils/toNumber.js +18 -0
- 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.d.ts +1 -1
- package/esm/utils/validations.js +60 -3
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +2 -2
- package/lib/Scoped.js +1 -1
- package/lib/WithRootStore.d.ts +383 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/_virtual/index.js +1 -1
- package/lib/_virtual/index2.js +1 -1
- package/lib/_virtual/react-is.development.js +1 -1
- package/lib/_virtual/react-is.production.min.js +1 -1
- package/lib/actions/Action.js +1 -1
- package/lib/actions/AjaxAction.js +12 -12
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +1 -1
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +1 -1
- package/lib/actions/Decorators.js +1 -1
- package/lib/actions/DialogAction.js +1 -1
- package/lib/actions/DrawerAction.js +1 -1
- 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/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.d.ts +33 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +97 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +3 -0
- package/lib/factory.js +2 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +6 -3
- package/lib/locale.d.ts +63 -1
- package/lib/locale.js +3 -2
- package/lib/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/lib/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/lib/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/lib/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/lib/node_modules/dom-helpers/esm/contains.js +1 -1
- package/lib/node_modules/dom-helpers/esm/listen.js +1 -1
- package/lib/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/lib/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/lib/node_modules/object-assign/index.js +1 -1
- package/lib/node_modules/prop-types/checkPropTypes.js +1 -1
- package/lib/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
- package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -1
- package/lib/node_modules/prop-types/lib/has.js +1 -1
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/lib/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/lib/node_modules/react-overlays/esm/Portal.js +1 -1
- package/lib/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/lib/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/lib/node_modules/react-overlays/esm/useRootClose.js +1 -1
- package/lib/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/lib/node_modules/warning/warning.js +1 -1
- package/lib/renderers/Form.d.ts +30 -1
- package/lib/renderers/Form.js +19 -6
- package/lib/renderers/Item.d.ts +511 -2
- package/lib/renderers/Item.js +5 -1
- package/lib/renderers/Options.d.ts +8 -0
- package/lib/renderers/Options.js +55 -35
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/wrapControl.d.ts +384 -2
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +24 -0
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +1 -1
- package/lib/store/crud.js +35 -20
- package/lib/store/form.d.ts +10 -0
- package/lib/store/form.js +49 -22
- package/lib/store/formItem.d.ts +1 -0
- package/lib/store/formItem.js +7 -2
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +4 -4
- package/lib/store/list.js +1 -1
- 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 +1 -1
- package/lib/store/service.js +11 -11
- package/lib/store/table.d.ts +27 -4
- package/lib/store/table.js +15 -4
- package/lib/store/{table-v2.d.ts → table2.d.ts} +32 -32
- package/lib/store/{table-v2.js → table2.js} +16 -16
- package/lib/theme.d.ts +33 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +1 -0
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.js +3 -2
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/dom.js +1 -1
- 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.js +1 -1
- 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 +3 -3
- package/lib/utils/helper.js +24 -9
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.d.ts +1 -0
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +1 -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/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.js +1 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveVariable.d.ts +1 -1
- package/lib/utils/resolveVariable.js +3 -3
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +2 -2
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.d.ts +7 -0
- package/lib/utils/toNumber.js +22 -0
- 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.d.ts +1 -1
- package/lib/utils/validations.js +61 -3
- package/package.json +5 -4
package/lib/renderers/Options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.2.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -27,6 +27,7 @@ var findIndex = require('lodash/findIndex');
|
|
|
27
27
|
var isPlainObject = require('lodash/isPlainObject');
|
|
28
28
|
var normalizeOptions = require('../utils/normalizeOptions.js');
|
|
29
29
|
var optionValueCompare = require('../utils/optionValueCompare.js');
|
|
30
|
+
var lodash = require('lodash');
|
|
30
31
|
var keyToPath = require('../utils/keyToPath.js');
|
|
31
32
|
|
|
32
33
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -147,6 +148,9 @@ function registerOptionsControl(config) {
|
|
|
147
148
|
.then(function () { return _this.normalizeValue(); });
|
|
148
149
|
}
|
|
149
150
|
}
|
|
151
|
+
else if (!lodash.isEqual(props.value, prevProps.value) && props.formInited) {
|
|
152
|
+
this.normalizeValue();
|
|
153
|
+
}
|
|
150
154
|
if (prevProps.value !== props.value || (formItem === null || formItem === void 0 ? void 0 : formItem.expressionsInOptions)) {
|
|
151
155
|
formItem === null || formItem === void 0 ? void 0 : formItem.syncOptions(undefined, props.data);
|
|
152
156
|
}
|
|
@@ -222,21 +226,40 @@ function registerOptionsControl(config) {
|
|
|
222
226
|
};
|
|
223
227
|
// 当前值,跟设置预期的值格式不一致时自动转换。
|
|
224
228
|
FormOptionsItem.prototype.normalizeValue = function () {
|
|
225
|
-
var _a = this.props, joinValues = _a.joinValues, extractValue = _a.extractValue, value = _a.value, multiple = _a.multiple, formItem = _a.formItem, valueField = _a.valueField; _a.enableNodePath; _a.pathSeparator; var onChange = _a.onChange;
|
|
226
|
-
if (!formItem ||
|
|
229
|
+
var _a = this.props, joinValues = _a.joinValues, extractValue = _a.extractValue, value = _a.value, multiple = _a.multiple, formItem = _a.formItem, valueField = _a.valueField, delimiter = _a.delimiter; _a.enableNodePath; _a.pathSeparator; var onChange = _a.onChange;
|
|
230
|
+
if (!formItem || !formItem.options.length) {
|
|
227
231
|
return;
|
|
228
232
|
}
|
|
229
|
-
if (
|
|
233
|
+
if (joinValues !== false) {
|
|
234
|
+
// 只处理多选且值为 array 的情况,因为理应为分隔符隔开的字符串
|
|
235
|
+
if (!(multiple && Array.isArray(value)))
|
|
236
|
+
return;
|
|
237
|
+
var selectedOptions = formItem.getSelectedOptions(value);
|
|
238
|
+
onChange === null || onChange === void 0 ? void 0 : onChange((multiple
|
|
239
|
+
? selectedOptions.concat()
|
|
240
|
+
: selectedOptions.length
|
|
241
|
+
? [selectedOptions[0]]
|
|
242
|
+
: [])
|
|
243
|
+
.map(function (selectedOption) {
|
|
244
|
+
return typeof selectedOption === 'string' ||
|
|
245
|
+
typeof selectedOption === 'number'
|
|
246
|
+
? selectedOption
|
|
247
|
+
: selectedOption[valueField || 'value'];
|
|
248
|
+
})
|
|
249
|
+
.join(delimiter || ','));
|
|
250
|
+
}
|
|
251
|
+
else if (extractValue === false &&
|
|
230
252
|
(typeof value === 'string' || typeof value === 'number')) {
|
|
231
253
|
var selectedOptions = formItem.getSelectedOptions(value);
|
|
232
254
|
onChange === null || onChange === void 0 ? void 0 : onChange(multiple ? selectedOptions.concat() : selectedOptions[0]);
|
|
233
255
|
}
|
|
234
256
|
else if (extractValue === true &&
|
|
235
257
|
value &&
|
|
236
|
-
!((
|
|
258
|
+
!((multiple &&
|
|
259
|
+
Array.isArray(value) &&
|
|
237
260
|
value.every(function (val) { return typeof val === 'string' || typeof val === 'number'; })) ||
|
|
238
|
-
|
|
239
|
-
|
|
261
|
+
(!multiple &&
|
|
262
|
+
(typeof value === 'string' || typeof value === 'number')))) {
|
|
240
263
|
var selectedOptions = formItem
|
|
241
264
|
.getSelectedOptions(value)
|
|
242
265
|
.map(function (selectedOption) { return selectedOption[valueField || 'value']; });
|
|
@@ -492,12 +515,12 @@ function registerOptionsControl(config) {
|
|
|
492
515
|
if (idx === void 0) { idx = -1; }
|
|
493
516
|
if (skipForm === void 0) { skipForm = false; }
|
|
494
517
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
495
|
-
var _a, addControls, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, model, createBtnLabel, env, __, parent, ctx, result, _b, payload, e_1, isPrevented, options;
|
|
518
|
+
var _a, addControls, addDialog, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, model, createBtnLabel, env, __, parent, ctx, result, _b, payload, e_1, isPrevented, options;
|
|
496
519
|
var _c;
|
|
497
520
|
return tslib.__generator(this, function (_d) {
|
|
498
521
|
switch (_d.label) {
|
|
499
522
|
case 0:
|
|
500
|
-
_a = this.props, addControls = _a.addControls, disabled = _a.disabled, labelField = _a.labelField, onOpenDialog = _a.onOpenDialog, optionLabel = _a.optionLabel, addApi = _a.addApi, source = _a.source, data = _a.data, valueField = _a.valueField, model = _a.formItem, createBtnLabel = _a.createBtnLabel, env = _a.env, __ = _a.translate;
|
|
523
|
+
_a = this.props, addControls = _a.addControls, addDialog = _a.addDialog, disabled = _a.disabled, labelField = _a.labelField, onOpenDialog = _a.onOpenDialog, optionLabel = _a.optionLabel, addApi = _a.addApi, source = _a.source, data = _a.data, valueField = _a.valueField, model = _a.formItem, createBtnLabel = _a.createBtnLabel, env = _a.env, __ = _a.translate;
|
|
501
524
|
// 禁用或者没有配置 name
|
|
502
525
|
if (disabled || !model) {
|
|
503
526
|
return [2 /*return*/];
|
|
@@ -522,10 +545,7 @@ function registerOptionsControl(config) {
|
|
|
522
545
|
if (!skipForm) return [3 /*break*/, 1];
|
|
523
546
|
_b = ctx;
|
|
524
547
|
return [3 /*break*/, 3];
|
|
525
|
-
case 1: return [4 /*yield*/, onOpenDialog({
|
|
526
|
-
type: 'dialog',
|
|
527
|
-
title: createBtnLabel || "\u65B0\u589E".concat(optionLabel || '选项'),
|
|
528
|
-
body: {
|
|
548
|
+
case 1: return [4 /*yield*/, onOpenDialog(tslib.__assign(tslib.__assign({ type: 'dialog', title: createBtnLabel || "\u65B0\u589E".concat(optionLabel || '选项') }, addDialog), { body: {
|
|
529
549
|
type: 'form',
|
|
530
550
|
api: addApi,
|
|
531
551
|
controls: tslib.__spreadArray([
|
|
@@ -540,8 +560,7 @@ function registerOptionsControl(config) {
|
|
|
540
560
|
value: parent
|
|
541
561
|
}
|
|
542
562
|
], (addControls || []), true)
|
|
543
|
-
}
|
|
544
|
-
}, ctx)];
|
|
563
|
+
} }), ctx)];
|
|
545
564
|
case 2:
|
|
546
565
|
_b = _d.sent();
|
|
547
566
|
_d.label = 3;
|
|
@@ -618,11 +637,11 @@ function registerOptionsControl(config) {
|
|
|
618
637
|
if (origin === void 0) { origin = value; }
|
|
619
638
|
if (skipForm === void 0) { skipForm = false; }
|
|
620
639
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
621
|
-
var _a, editControls, disabled, labelField, onOpenDialog, editApi, env, source, data, model, optionLabel, __, result, _b, payload, e_2, isPrevented, indexes;
|
|
640
|
+
var _a, editControls, editDialog, disabled, labelField, onOpenDialog, editApi, env, source, data, model, optionLabel, __, result, _b, payload, e_2, isPrevented, indexes;
|
|
622
641
|
return tslib.__generator(this, function (_c) {
|
|
623
642
|
switch (_c.label) {
|
|
624
643
|
case 0:
|
|
625
|
-
_a = this.props, editControls = _a.editControls, disabled = _a.disabled, labelField = _a.labelField, onOpenDialog = _a.onOpenDialog, editApi = _a.editApi, env = _a.env, source = _a.source, data = _a.data, model = _a.formItem, optionLabel = _a.optionLabel, __ = _a.translate;
|
|
644
|
+
_a = this.props, editControls = _a.editControls, editDialog = _a.editDialog, disabled = _a.disabled, labelField = _a.labelField, onOpenDialog = _a.onOpenDialog, editApi = _a.editApi, env = _a.env, source = _a.source, data = _a.data, model = _a.formItem, optionLabel = _a.optionLabel, __ = _a.translate;
|
|
626
645
|
if (disabled || !model) {
|
|
627
646
|
return [2 /*return*/];
|
|
628
647
|
}
|
|
@@ -639,17 +658,13 @@ function registerOptionsControl(config) {
|
|
|
639
658
|
if (!skipForm) return [3 /*break*/, 1];
|
|
640
659
|
_b = value;
|
|
641
660
|
return [3 /*break*/, 3];
|
|
642
|
-
case 1: return [4 /*yield*/, onOpenDialog({
|
|
643
|
-
type: 'dialog',
|
|
644
|
-
title: __('Options.editLabel', {
|
|
661
|
+
case 1: return [4 /*yield*/, onOpenDialog(tslib.__assign(tslib.__assign({ type: 'dialog', title: __('Options.editLabel', {
|
|
645
662
|
label: optionLabel || __('Options.label')
|
|
646
|
-
}),
|
|
647
|
-
body: {
|
|
663
|
+
}) }, editDialog), { body: {
|
|
648
664
|
type: 'form',
|
|
649
665
|
api: editApi,
|
|
650
666
|
controls: editControls
|
|
651
|
-
}
|
|
652
|
-
}, object.createObject(data, value))];
|
|
667
|
+
} }), object.createObject(data, value))];
|
|
653
668
|
case 2:
|
|
654
669
|
_b = _c.sent();
|
|
655
670
|
_c.label = 3;
|
|
@@ -705,11 +720,11 @@ function registerOptionsControl(config) {
|
|
|
705
720
|
};
|
|
706
721
|
FormOptionsItem.prototype.handleOptionDelete = function (value) {
|
|
707
722
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
708
|
-
var _a, deleteConfirmText, disabled, data, deleteApi, env, model, source, valueField, __, ctx, confirmed, _b, isPrevented, result, options, indexes, e_3;
|
|
723
|
+
var _a, deleteConfirmText, disabled, data, deleteApi, onDelete, env, model, source, valueField, __, ctx, confirmed, _b, isPrevented, result, options, indexes, e_3;
|
|
709
724
|
return tslib.__generator(this, function (_c) {
|
|
710
725
|
switch (_c.label) {
|
|
711
726
|
case 0:
|
|
712
|
-
_a = this.props, deleteConfirmText = _a.deleteConfirmText, disabled = _a.disabled, data = _a.data, deleteApi = _a.deleteApi, env = _a.env, model = _a.formItem, source = _a.source, valueField = _a.valueField, __ = _a.translate;
|
|
727
|
+
_a = this.props, deleteConfirmText = _a.deleteConfirmText, disabled = _a.disabled, data = _a.data, deleteApi = _a.deleteApi, onDelete = _a.onDelete, env = _a.env, model = _a.formItem, source = _a.source, valueField = _a.valueField, __ = _a.translate;
|
|
713
728
|
if (disabled || !model) {
|
|
714
729
|
return [2 /*return*/];
|
|
715
730
|
}
|
|
@@ -735,10 +750,8 @@ function registerOptionsControl(config) {
|
|
|
735
750
|
}
|
|
736
751
|
_c.label = 5;
|
|
737
752
|
case 5:
|
|
738
|
-
_c.trys.push([5,
|
|
739
|
-
if (!deleteApi)
|
|
740
|
-
throw new Error(__('Options.deleteAPI'));
|
|
741
|
-
}
|
|
753
|
+
_c.trys.push([5, 8, , 9]);
|
|
754
|
+
if (!deleteApi) return [3 /*break*/, 7];
|
|
742
755
|
return [4 /*yield*/, env.fetcher(deleteApi, ctx, {
|
|
743
756
|
method: 'delete'
|
|
744
757
|
})];
|
|
@@ -746,8 +759,15 @@ function registerOptionsControl(config) {
|
|
|
746
759
|
result = _c.sent();
|
|
747
760
|
if (!result.ok) {
|
|
748
761
|
env.notify('error', result.msg || __('deleteFailed'));
|
|
762
|
+
return [2 /*return*/];
|
|
763
|
+
}
|
|
764
|
+
_c.label = 7;
|
|
765
|
+
case 7:
|
|
766
|
+
// 由外部代码实现删除逻辑
|
|
767
|
+
if (onDelete) {
|
|
768
|
+
onDelete(ctx);
|
|
749
769
|
}
|
|
750
|
-
|
|
770
|
+
if (source) {
|
|
751
771
|
this.reload();
|
|
752
772
|
}
|
|
753
773
|
else {
|
|
@@ -757,13 +777,13 @@ function registerOptionsControl(config) {
|
|
|
757
777
|
model.setOptions(helper.spliceTree(options, indexes, 1), this.changeOptionValue, data);
|
|
758
778
|
}
|
|
759
779
|
}
|
|
760
|
-
return [3 /*break*/,
|
|
761
|
-
case
|
|
780
|
+
return [3 /*break*/, 9];
|
|
781
|
+
case 8:
|
|
762
782
|
e_3 = _c.sent();
|
|
763
783
|
console.error(e_3);
|
|
764
784
|
env.notify('error', e_3.message);
|
|
765
|
-
return [3 /*break*/,
|
|
766
|
-
case
|
|
785
|
+
return [3 /*break*/, 9];
|
|
786
|
+
case 9: return [2 /*return*/];
|
|
767
787
|
}
|
|
768
788
|
});
|
|
769
789
|
});
|
package/lib/renderers/builtin.js
CHANGED
|
@@ -48,8 +48,390 @@ export interface ControlProps {
|
|
|
48
48
|
onChange?: (value: any, name: string, submit: boolean) => void;
|
|
49
49
|
store: IIRendererStore;
|
|
50
50
|
}
|
|
51
|
-
export declare function wrapControl<T extends React.ComponentType<React.ComponentProps<T> & ControlProps>>(ComposedComponent: T):
|
|
51
|
+
export declare function wrapControl<T extends React.ComponentType<React.ComponentProps<T> & ControlProps>>(ComposedComponent: T): {
|
|
52
|
+
new (props: Omit<any, "rootStore"> | Readonly<Omit<any, "rootStore">>): {
|
|
53
|
+
render(): JSX.Element;
|
|
54
|
+
context: any;
|
|
55
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
56
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
57
|
+
readonly props: Readonly<Omit<any, "rootStore">> & Readonly<{
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
state: Readonly<{}>;
|
|
61
|
+
refs: {
|
|
62
|
+
[key: string]: React.ReactInstance;
|
|
63
|
+
};
|
|
64
|
+
componentDidMount?(): void;
|
|
65
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
66
|
+
componentWillUnmount?(): void;
|
|
67
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
68
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>): any;
|
|
69
|
+
componentDidUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
70
|
+
componentWillMount?(): void;
|
|
71
|
+
UNSAFE_componentWillMount?(): void;
|
|
72
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
73
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
74
|
+
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
75
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
76
|
+
};
|
|
77
|
+
new (props: Omit<any, "rootStore">, context: any): {
|
|
78
|
+
render(): JSX.Element;
|
|
79
|
+
context: any;
|
|
80
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
81
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
82
|
+
readonly props: Readonly<Omit<any, "rootStore">> & Readonly<{
|
|
83
|
+
children?: React.ReactNode;
|
|
84
|
+
}>;
|
|
85
|
+
state: Readonly<{}>;
|
|
86
|
+
refs: {
|
|
87
|
+
[key: string]: React.ReactInstance;
|
|
88
|
+
};
|
|
89
|
+
componentDidMount?(): void;
|
|
90
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
91
|
+
componentWillUnmount?(): void;
|
|
92
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
93
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>): any;
|
|
94
|
+
componentDidUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
95
|
+
componentWillMount?(): void;
|
|
96
|
+
UNSAFE_componentWillMount?(): void;
|
|
97
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
98
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
99
|
+
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
100
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
101
|
+
};
|
|
102
|
+
displayName: string;
|
|
103
|
+
contextType: React.Context<{
|
|
104
|
+
storeType: string;
|
|
105
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
106
|
+
readonly fetcher: any;
|
|
107
|
+
readonly notify: any;
|
|
108
|
+
readonly isCancel: (value: any) => boolean;
|
|
109
|
+
readonly __: import("..").TranslateFn<any>;
|
|
110
|
+
getStoreById(id: string): {
|
|
111
|
+
id: string;
|
|
112
|
+
path: string;
|
|
113
|
+
storeType: string;
|
|
114
|
+
disposed: boolean;
|
|
115
|
+
parentId: string;
|
|
116
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
117
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
118
|
+
readonly parentStore: any;
|
|
119
|
+
readonly __: any;
|
|
120
|
+
readonly hasChildren: boolean;
|
|
121
|
+
readonly children: any[];
|
|
122
|
+
} & {
|
|
123
|
+
onChildStoreDispose(child: any): void;
|
|
124
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
125
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
126
|
+
addChildId: (id: string) => void;
|
|
127
|
+
removeChildId: (id: string) => void;
|
|
128
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
129
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
130
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
131
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
132
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
133
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
134
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
135
|
+
}, {
|
|
136
|
+
readonly parentStore: any;
|
|
137
|
+
readonly __: any;
|
|
138
|
+
readonly hasChildren: boolean;
|
|
139
|
+
readonly children: any[];
|
|
140
|
+
} & {
|
|
141
|
+
onChildStoreDispose(child: any): void;
|
|
142
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
143
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
144
|
+
addChildId: (id: string) => void;
|
|
145
|
+
removeChildId: (id: string) => void;
|
|
146
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
147
|
+
readonly stores: {
|
|
148
|
+
[propName: string]: {
|
|
149
|
+
id: string;
|
|
150
|
+
path: string;
|
|
151
|
+
storeType: string;
|
|
152
|
+
disposed: boolean;
|
|
153
|
+
parentId: string;
|
|
154
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
155
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
156
|
+
readonly parentStore: any;
|
|
157
|
+
readonly __: any;
|
|
158
|
+
readonly hasChildren: boolean;
|
|
159
|
+
readonly children: any[];
|
|
160
|
+
} & {
|
|
161
|
+
onChildStoreDispose(child: any): void;
|
|
162
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
163
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
164
|
+
addChildId: (id: string) => void;
|
|
165
|
+
removeChildId: (id: string) => void;
|
|
166
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
167
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
168
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
169
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
170
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
171
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
172
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
173
|
+
}, {
|
|
174
|
+
readonly parentStore: any;
|
|
175
|
+
readonly __: any;
|
|
176
|
+
readonly hasChildren: boolean;
|
|
177
|
+
readonly children: any[];
|
|
178
|
+
} & {
|
|
179
|
+
onChildStoreDispose(child: any): void;
|
|
180
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
181
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
182
|
+
addChildId: (id: string) => void;
|
|
183
|
+
removeChildId: (id: string) => void;
|
|
184
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
185
|
+
};
|
|
186
|
+
} & {
|
|
187
|
+
addStore(store: {
|
|
188
|
+
[propName: string]: any;
|
|
189
|
+
storeType: string;
|
|
190
|
+
id: string;
|
|
191
|
+
path: string;
|
|
192
|
+
parentId?: string | undefined;
|
|
193
|
+
}): {
|
|
194
|
+
id: string;
|
|
195
|
+
path: string;
|
|
196
|
+
storeType: string;
|
|
197
|
+
disposed: boolean;
|
|
198
|
+
parentId: string;
|
|
199
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
200
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
201
|
+
readonly parentStore: any;
|
|
202
|
+
readonly __: any;
|
|
203
|
+
readonly hasChildren: boolean;
|
|
204
|
+
readonly children: any[];
|
|
205
|
+
} & {
|
|
206
|
+
onChildStoreDispose(child: any): void;
|
|
207
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
208
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
209
|
+
addChildId: (id: string) => void;
|
|
210
|
+
removeChildId: (id: string) => void;
|
|
211
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
212
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
213
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
214
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
215
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
216
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
217
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
218
|
+
}, {
|
|
219
|
+
readonly parentStore: any;
|
|
220
|
+
readonly __: any;
|
|
221
|
+
readonly hasChildren: boolean;
|
|
222
|
+
readonly children: any[];
|
|
223
|
+
} & {
|
|
224
|
+
onChildStoreDispose(child: any): void;
|
|
225
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
226
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
227
|
+
addChildId: (id: string) => void;
|
|
228
|
+
removeChildId: (id: string) => void;
|
|
229
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
230
|
+
removeStore(store: {
|
|
231
|
+
id: string;
|
|
232
|
+
path: string;
|
|
233
|
+
storeType: string;
|
|
234
|
+
disposed: boolean;
|
|
235
|
+
parentId: string;
|
|
236
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
237
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
238
|
+
readonly parentStore: any;
|
|
239
|
+
readonly __: any;
|
|
240
|
+
readonly hasChildren: boolean;
|
|
241
|
+
readonly children: any[];
|
|
242
|
+
} & {
|
|
243
|
+
onChildStoreDispose(child: any): void;
|
|
244
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
245
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
246
|
+
addChildId: (id: string) => void;
|
|
247
|
+
removeChildId: (id: string) => void;
|
|
248
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
249
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
250
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
251
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
252
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
253
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
254
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
255
|
+
}, {
|
|
256
|
+
readonly parentStore: any;
|
|
257
|
+
readonly __: any;
|
|
258
|
+
readonly hasChildren: boolean;
|
|
259
|
+
readonly children: any[];
|
|
260
|
+
} & {
|
|
261
|
+
onChildStoreDispose(child: any): void;
|
|
262
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
263
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
264
|
+
addChildId: (id: string) => void;
|
|
265
|
+
removeChildId: (id: string) => void;
|
|
266
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
267
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
268
|
+
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
269
|
+
}, {
|
|
270
|
+
readonly fetcher: any;
|
|
271
|
+
readonly notify: any;
|
|
272
|
+
readonly isCancel: (value: any) => boolean;
|
|
273
|
+
readonly __: import("..").TranslateFn<any>;
|
|
274
|
+
getStoreById(id: string): {
|
|
275
|
+
id: string;
|
|
276
|
+
path: string;
|
|
277
|
+
storeType: string;
|
|
278
|
+
disposed: boolean;
|
|
279
|
+
parentId: string;
|
|
280
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
281
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
282
|
+
readonly parentStore: any;
|
|
283
|
+
readonly __: any;
|
|
284
|
+
readonly hasChildren: boolean;
|
|
285
|
+
readonly children: any[];
|
|
286
|
+
} & {
|
|
287
|
+
onChildStoreDispose(child: any): void;
|
|
288
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
289
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
290
|
+
addChildId: (id: string) => void;
|
|
291
|
+
removeChildId: (id: string) => void;
|
|
292
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
293
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
294
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
295
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
296
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
297
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
298
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
299
|
+
}, {
|
|
300
|
+
readonly parentStore: any;
|
|
301
|
+
readonly __: any;
|
|
302
|
+
readonly hasChildren: boolean;
|
|
303
|
+
readonly children: any[];
|
|
304
|
+
} & {
|
|
305
|
+
onChildStoreDispose(child: any): void;
|
|
306
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
307
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
308
|
+
addChildId: (id: string) => void;
|
|
309
|
+
removeChildId: (id: string) => void;
|
|
310
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
311
|
+
readonly stores: {
|
|
312
|
+
[propName: string]: {
|
|
313
|
+
id: string;
|
|
314
|
+
path: string;
|
|
315
|
+
storeType: string;
|
|
316
|
+
disposed: boolean;
|
|
317
|
+
parentId: string;
|
|
318
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
319
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
320
|
+
readonly parentStore: any;
|
|
321
|
+
readonly __: any;
|
|
322
|
+
readonly hasChildren: boolean;
|
|
323
|
+
readonly children: any[];
|
|
324
|
+
} & {
|
|
325
|
+
onChildStoreDispose(child: any): void;
|
|
326
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
327
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
328
|
+
addChildId: (id: string) => void;
|
|
329
|
+
removeChildId: (id: string) => void;
|
|
330
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
331
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
332
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
333
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
334
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
335
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
336
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
337
|
+
}, {
|
|
338
|
+
readonly parentStore: any;
|
|
339
|
+
readonly __: any;
|
|
340
|
+
readonly hasChildren: boolean;
|
|
341
|
+
readonly children: any[];
|
|
342
|
+
} & {
|
|
343
|
+
onChildStoreDispose(child: any): void;
|
|
344
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
345
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
346
|
+
addChildId: (id: string) => void;
|
|
347
|
+
removeChildId: (id: string) => void;
|
|
348
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
349
|
+
};
|
|
350
|
+
} & {
|
|
351
|
+
addStore(store: {
|
|
352
|
+
[propName: string]: any;
|
|
353
|
+
storeType: string;
|
|
354
|
+
id: string;
|
|
355
|
+
path: string;
|
|
356
|
+
parentId?: string | undefined;
|
|
357
|
+
}): {
|
|
358
|
+
id: string;
|
|
359
|
+
path: string;
|
|
360
|
+
storeType: string;
|
|
361
|
+
disposed: boolean;
|
|
362
|
+
parentId: string;
|
|
363
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
364
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
365
|
+
readonly parentStore: any;
|
|
366
|
+
readonly __: any;
|
|
367
|
+
readonly hasChildren: boolean;
|
|
368
|
+
readonly children: any[];
|
|
369
|
+
} & {
|
|
370
|
+
onChildStoreDispose(child: any): void;
|
|
371
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
372
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
373
|
+
addChildId: (id: string) => void;
|
|
374
|
+
removeChildId: (id: string) => void;
|
|
375
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
376
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
377
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
378
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
379
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
380
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
381
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
382
|
+
}, {
|
|
383
|
+
readonly parentStore: any;
|
|
384
|
+
readonly __: any;
|
|
385
|
+
readonly hasChildren: boolean;
|
|
386
|
+
readonly children: any[];
|
|
387
|
+
} & {
|
|
388
|
+
onChildStoreDispose(child: any): void;
|
|
389
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
390
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
391
|
+
addChildId: (id: string) => void;
|
|
392
|
+
removeChildId: (id: string) => void;
|
|
393
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
394
|
+
removeStore(store: {
|
|
395
|
+
id: string;
|
|
396
|
+
path: string;
|
|
397
|
+
storeType: string;
|
|
398
|
+
disposed: boolean;
|
|
399
|
+
parentId: string;
|
|
400
|
+
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
401
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
402
|
+
readonly parentStore: any;
|
|
403
|
+
readonly __: any;
|
|
404
|
+
readonly hasChildren: boolean;
|
|
405
|
+
readonly children: any[];
|
|
406
|
+
} & {
|
|
407
|
+
onChildStoreDispose(child: any): void;
|
|
408
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
409
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
410
|
+
addChildId: (id: string) => void;
|
|
411
|
+
removeChildId: (id: string) => void;
|
|
412
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
413
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
414
|
+
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
415
|
+
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
416
|
+
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
417
|
+
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
418
|
+
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
419
|
+
}, {
|
|
420
|
+
readonly parentStore: any;
|
|
421
|
+
readonly __: any;
|
|
422
|
+
readonly hasChildren: boolean;
|
|
423
|
+
readonly children: any[];
|
|
424
|
+
} & {
|
|
425
|
+
onChildStoreDispose(child: any): void;
|
|
426
|
+
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
427
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
428
|
+
addChildId: (id: string) => void;
|
|
429
|
+
removeChildId: (id: string) => void;
|
|
430
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
431
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
432
|
+
ComposedComponent: React.ComponentType<any>;
|
|
433
|
+
} & hoistNonReactStatic.NonReactStatics<any, {}> & {
|
|
52
434
|
ComposedComponent: any;
|
|
53
|
-
}
|
|
435
|
+
} & hoistNonReactStatic.NonReactStatics<T, {}> & {
|
|
54
436
|
ComposedComponent: T;
|
|
55
437
|
};
|
package/lib/store/app.js
CHANGED