amis-core 2.3.0 → 2.3.2-beta.1
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 +1 -1
- package/esm/Scoped.d.ts +1 -1
- package/esm/Scoped.js +1 -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.d.ts +2 -1
- package/esm/actions/Action.js +8 -13
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +6 -5
- package/esm/actions/CmptAction.js +5 -4
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.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/actions/index.d.ts +0 -2
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -1
- package/esm/index.js +2 -3
- package/esm/locale.js +1 -1
- 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 +5 -5
- package/esm/renderers/Form.js +10 -10
- package/esm/renderers/Item.js +1 -1
- package/esm/renderers/Options.js +35 -12
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.js +1 -1
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +1 -1
- 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 +1 -1
- package/esm/store/table.d.ts +6 -6
- package/esm/store/table.js +3 -11
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- 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 +1 -1
- 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.js +1 -1
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- 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.d.ts +7 -0
- package/esm/utils/renderer-event.js +15 -3
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- 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 +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 +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +1 -1
- package/lib/Scoped.d.ts +1 -1
- package/lib/Scoped.js +1 -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.d.ts +2 -1
- package/lib/actions/Action.js +8 -13
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +6 -5
- package/lib/actions/CmptAction.js +5 -4
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.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/actions/index.d.ts +0 -2
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -1
- package/lib/index.js +2 -4
- package/lib/locale.js +1 -1
- 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 +5 -5
- package/lib/renderers/Form.js +10 -10
- package/lib/renderers/Item.js +1 -1
- package/lib/renderers/Options.js +37 -14
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +1 -1
- 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 +1 -1
- package/lib/store/table.d.ts +6 -6
- package/lib/store/table.js +3 -11
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- 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 +1 -1
- 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.js +1 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- 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.d.ts +7 -0
- package/lib/utils/renderer-event.js +14 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- 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 +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 +3 -3
- package/esm/actions/Decorators.d.ts +0 -25
- package/esm/actions/Decorators.js +0 -83
- package/lib/actions/Decorators.d.ts +0 -25
- package/lib/actions/Decorators.js +0 -88
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.3.
|
|
2
|
+
* amis-core v2.3.2-beta.1
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -84,7 +84,6 @@ require('./actions/EmailAction.js');
|
|
|
84
84
|
require('./actions/LinkAction.js');
|
|
85
85
|
require('./actions/ToastAction.js');
|
|
86
86
|
require('./actions/PageAction.js');
|
|
87
|
-
var Decorators = require('./actions/Decorators.js');
|
|
88
87
|
var Action = require('./actions/Action.js');
|
|
89
88
|
var Item = require('./renderers/Item.js');
|
|
90
89
|
var Options = require('./renderers/Options.js');
|
|
@@ -335,6 +334,7 @@ exports.bindEvent = rendererEvent.bindEvent;
|
|
|
335
334
|
exports.createRendererEvent = rendererEvent.createRendererEvent;
|
|
336
335
|
exports.dispatchEvent = rendererEvent.dispatchEvent;
|
|
337
336
|
exports.getRendererEventListeners = rendererEvent.getRendererEventListeners;
|
|
337
|
+
exports.resolveEventData = rendererEvent.resolveEventData;
|
|
338
338
|
exports.replaceText = replaceText.replaceText;
|
|
339
339
|
exports.getComputedStyle = resizeSensor.getComputedStyle;
|
|
340
340
|
exports.resizeSensor = resizeSensor.resizeSensor;
|
|
@@ -379,8 +379,6 @@ exports.makeClassnames = theme.makeClassnames;
|
|
|
379
379
|
exports.setDefaultTheme = theme.setDefaultTheme;
|
|
380
380
|
exports.theme = theme.theme;
|
|
381
381
|
exports.themeable = theme.themeable;
|
|
382
|
-
exports.bindRendererEvent = Decorators.bindRendererEvent;
|
|
383
|
-
exports.rendererEventDispatcher = Decorators.rendererEventDispatcher;
|
|
384
382
|
Object.defineProperty(exports, 'LoopStatus', {
|
|
385
383
|
enumerable: true,
|
|
386
384
|
get: function () { return Action.LoopStatus; }
|
package/lib/locale.js
CHANGED
package/lib/renderers/Form.d.ts
CHANGED
|
@@ -320,14 +320,14 @@ export default class Form extends React.Component<FormProps, object> {
|
|
|
320
320
|
beforePageUnload(e: any): any;
|
|
321
321
|
onInit(): Promise<void>;
|
|
322
322
|
reload(subPath?: string, query?: any, ctx?: any, silent?: boolean): void;
|
|
323
|
-
receive(values: object): void;
|
|
323
|
+
receive(values: object, name?: string, replace?: boolean): void;
|
|
324
324
|
silentReload(target?: string, query?: any): void;
|
|
325
325
|
initInterval(value: any): any;
|
|
326
326
|
isValidated(): boolean;
|
|
327
327
|
validate(forceValidate?: boolean): Promise<boolean>;
|
|
328
328
|
clearErrors(): void;
|
|
329
329
|
getValues(): any;
|
|
330
|
-
setValues(value: any): void;
|
|
330
|
+
setValues(value: any, replace?: boolean): void;
|
|
331
331
|
submit(fn?: (values: object) => Promise<any>): Promise<any>;
|
|
332
332
|
flush(): void;
|
|
333
333
|
reset(): void;
|
|
@@ -369,7 +369,7 @@ export declare class FormRenderer extends Form {
|
|
|
369
369
|
submitToTarget(target: string, values: object): void;
|
|
370
370
|
reloadTarget(target: string, data: any): void;
|
|
371
371
|
closeTarget(target: string): void;
|
|
372
|
-
reload(target?: string, query?: any, ctx?: any, silent?: boolean): void;
|
|
373
|
-
receive(values: object, name?: string): void;
|
|
374
|
-
setData(values: object): void;
|
|
372
|
+
reload(target?: string, query?: any, ctx?: any, silent?: boolean, replace?: boolean): void;
|
|
373
|
+
receive(values: object, name?: string, replace?: boolean): void;
|
|
374
|
+
setData(values: object, replace?: boolean): void;
|
|
375
375
|
}
|
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.3.
|
|
2
|
+
* amis-core v2.3.2-beta.1
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -275,9 +275,9 @@ var Form = /** @class */ (function (_super) {
|
|
|
275
275
|
})
|
|
276
276
|
: store.reset(undefined, false);
|
|
277
277
|
};
|
|
278
|
-
Form.prototype.receive = function (values) {
|
|
278
|
+
Form.prototype.receive = function (values, name, replace) {
|
|
279
279
|
var store = this.props.store;
|
|
280
|
-
store.updateData(values);
|
|
280
|
+
store.updateData(values, undefined, replace);
|
|
281
281
|
this.reload();
|
|
282
282
|
};
|
|
283
283
|
Form.prototype.silentReload = function (target, query) {
|
|
@@ -319,10 +319,10 @@ var Form = /** @class */ (function (_super) {
|
|
|
319
319
|
this.flush();
|
|
320
320
|
return store.data;
|
|
321
321
|
};
|
|
322
|
-
Form.prototype.setValues = function (value) {
|
|
322
|
+
Form.prototype.setValues = function (value, replace) {
|
|
323
323
|
var store = this.props.store;
|
|
324
324
|
this.flush();
|
|
325
|
-
store.setValues(value);
|
|
325
|
+
store.setValues(value, undefined, replace);
|
|
326
326
|
};
|
|
327
327
|
Form.prototype.submit = function (fn) {
|
|
328
328
|
var _a = this.props, store = _a.store, messages = _a.messages, __ = _a.translate, dispatchEvent = _a.dispatchEvent, data = _a.data;
|
|
@@ -1117,9 +1117,9 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1117
1117
|
var scoped = this.context;
|
|
1118
1118
|
scoped.close(target);
|
|
1119
1119
|
};
|
|
1120
|
-
FormRenderer.prototype.reload = function (target, query, ctx, silent) {
|
|
1120
|
+
FormRenderer.prototype.reload = function (target, query, ctx, silent, replace) {
|
|
1121
1121
|
if (query) {
|
|
1122
|
-
return this.receive(query);
|
|
1122
|
+
return this.receive(query, undefined, replace);
|
|
1123
1123
|
}
|
|
1124
1124
|
var scoped = this.context;
|
|
1125
1125
|
var subPath = '';
|
|
@@ -1151,7 +1151,7 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1151
1151
|
_super.prototype.reload.call(this, target, query, ctx, silent);
|
|
1152
1152
|
}
|
|
1153
1153
|
};
|
|
1154
|
-
FormRenderer.prototype.receive = function (values, name) {
|
|
1154
|
+
FormRenderer.prototype.receive = function (values, name, replace) {
|
|
1155
1155
|
if (name) {
|
|
1156
1156
|
var scoped = this.context;
|
|
1157
1157
|
var idx = name.indexOf('.');
|
|
@@ -1164,9 +1164,9 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1164
1164
|
component && component.receive && component.receive(values, subPath);
|
|
1165
1165
|
return;
|
|
1166
1166
|
}
|
|
1167
|
-
return _super.prototype.receive.call(this, values);
|
|
1167
|
+
return _super.prototype.receive.call(this, values, undefined, replace);
|
|
1168
1168
|
};
|
|
1169
|
-
FormRenderer.prototype.setData = function (values) {
|
|
1169
|
+
FormRenderer.prototype.setData = function (values, replace) {
|
|
1170
1170
|
return _super.prototype.setValues.call(this, values);
|
|
1171
1171
|
};
|
|
1172
1172
|
FormRenderer.contextType = Scoped.ScopedContext;
|
package/lib/renderers/Item.js
CHANGED
package/lib/renderers/Options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.3.
|
|
2
|
+
* amis-core v2.3.2-beta.1
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -27,7 +27,30 @@ 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
|
+
require('../utils/ColorScale.js');
|
|
31
|
+
require('lodash/chunk');
|
|
32
|
+
require('../utils/DataSchema.js');
|
|
33
|
+
require('../utils/DataScope.js');
|
|
34
|
+
require('../utils/debug.js');
|
|
35
|
+
require('react-dom');
|
|
36
|
+
require('../utils/errors.js');
|
|
37
|
+
require('classnames');
|
|
38
|
+
require('lodash/isObject');
|
|
39
|
+
require('lodash/isString');
|
|
40
|
+
require('lodash/isBoolean');
|
|
41
|
+
require('../utils/image.js');
|
|
30
42
|
var keyToPath = require('../utils/keyToPath.js');
|
|
43
|
+
var rendererEvent = require('../utils/renderer-event.js');
|
|
44
|
+
require('../utils/resize-sensor.js');
|
|
45
|
+
require('../node_modules/dom-helpers/esm/addEventListener.js');
|
|
46
|
+
require('../node_modules/warning/warning.js');
|
|
47
|
+
require('../utils/SimpleMap.js');
|
|
48
|
+
require('lodash/mapValues');
|
|
49
|
+
require('lodash/camelCase');
|
|
50
|
+
require('uncontrollable');
|
|
51
|
+
require('hoist-non-react-statics');
|
|
52
|
+
require('../utils/validations.js');
|
|
53
|
+
require('../utils/Animation.js');
|
|
31
54
|
|
|
32
55
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
33
56
|
|
|
@@ -160,19 +183,17 @@ function registerOptionsControl(config) {
|
|
|
160
183
|
FormOptionsItem.prototype.dispatchOptionEvent = function (eventName, eventData) {
|
|
161
184
|
if (eventData === void 0) { eventData = ''; }
|
|
162
185
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var _a, dispatchEvent, options,
|
|
186
|
+
var _a, dispatchEvent, options, rendererEvent$1;
|
|
164
187
|
return tslib.__generator(this, function (_b) {
|
|
165
188
|
switch (_b.label) {
|
|
166
189
|
case 0:
|
|
167
|
-
_a = this.props, dispatchEvent = _a.dispatchEvent, options = _a.options
|
|
168
|
-
return [4 /*yield*/, dispatchEvent(eventName,
|
|
169
|
-
|
|
170
|
-
options: options
|
|
171
|
-
}))];
|
|
190
|
+
_a = this.props, dispatchEvent = _a.dispatchEvent, options = _a.options;
|
|
191
|
+
return [4 /*yield*/, dispatchEvent(eventName, rendererEvent.resolveEventData(this.props, { value: eventData, options: options, items: options }, // 为了保持名字统一
|
|
192
|
+
'value'))];
|
|
172
193
|
case 1:
|
|
173
|
-
rendererEvent = _b.sent();
|
|
194
|
+
rendererEvent$1 = _b.sent();
|
|
174
195
|
// 返回阻塞标识
|
|
175
|
-
return [2 /*return*/, !!(rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented)];
|
|
196
|
+
return [2 /*return*/, !!(rendererEvent$1 === null || rendererEvent$1 === void 0 ? void 0 : rendererEvent$1.prevented)];
|
|
176
197
|
}
|
|
177
198
|
});
|
|
178
199
|
});
|
|
@@ -205,19 +226,21 @@ function registerOptionsControl(config) {
|
|
|
205
226
|
})
|
|
206
227
|
}
|
|
207
228
|
: object.createObject(tslib.__assign(tslib.__assign({}, data), { ancestors: helper.getTreeAncestors(formItem.filteredOptions, selectedOptions[0], true) }), selectedOptions[0]));
|
|
229
|
+
var tmpData_1 = tslib.__assign({}, data);
|
|
230
|
+
var result_1 = tslib.__assign({}, toSync_1);
|
|
208
231
|
Object.keys(autoFill).forEach(function (key) {
|
|
209
232
|
var keys = keyToPath.keyToPath(key);
|
|
210
233
|
// 如果左边的 key 是一个路径
|
|
211
234
|
// 这里不希望直接把原始对象都给覆盖没了
|
|
212
235
|
// 而是保留原始的对象,只修改指定的属性
|
|
213
|
-
if (keys.length > 1 && isPlainObject__default["default"](
|
|
214
|
-
var obj = tslib.__assign({}, data[keys[0]]);
|
|
236
|
+
if (keys.length > 1 && isPlainObject__default["default"](tmpData_1[keys[0]])) {
|
|
215
237
|
var value = getVariable.getVariable(toSync_1, key);
|
|
216
|
-
|
|
217
|
-
object.setVariable(
|
|
238
|
+
// 存在情况:依次更新同一子路径的多个key,eg: a.b.c1 和 a.b.c2,所以需要同步更新data
|
|
239
|
+
object.setVariable(tmpData_1, key, value);
|
|
240
|
+
result_1[keys[0]] = tmpData_1[keys[0]];
|
|
218
241
|
}
|
|
219
242
|
});
|
|
220
|
-
onBulkChange(
|
|
243
|
+
onBulkChange(result_1);
|
|
221
244
|
}
|
|
222
245
|
};
|
|
223
246
|
// 当前值,跟设置预期的值格式不一致时自动转换。
|
package/lib/renderers/builtin.js
CHANGED
package/lib/store/app.js
CHANGED
package/lib/store/combo.js
CHANGED
package/lib/store/crud.js
CHANGED
package/lib/store/form.js
CHANGED
package/lib/store/formItem.js
CHANGED
package/lib/store/iRenderer.js
CHANGED
package/lib/store/index.js
CHANGED
package/lib/store/list.js
CHANGED
package/lib/store/manager.js
CHANGED
package/lib/store/modal.js
CHANGED
package/lib/store/node.js
CHANGED
package/lib/store/pagination.js
CHANGED
package/lib/store/root.js
CHANGED
package/lib/store/service.js
CHANGED
package/lib/store/table.d.ts
CHANGED
|
@@ -344,14 +344,14 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
344
344
|
} & {
|
|
345
345
|
readonly loading: boolean;
|
|
346
346
|
} & {
|
|
347
|
-
markFetching: (fetching?: boolean) => void;
|
|
347
|
+
markFetching: (fetching?: boolean) => void; /** Group单元格显示名称,从1开始 */
|
|
348
348
|
markSaving: (saving?: boolean) => void;
|
|
349
349
|
markBusying: (busying?: boolean) => void;
|
|
350
|
-
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
350
|
+
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>; /** Group单元格包含的首列的索引值,范围[1, columns.length] */
|
|
351
351
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
352
352
|
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
353
353
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
354
|
-
clearMessage: () => void;
|
|
354
|
+
clearMessage: () => void; /** Group单元格包含列数 */
|
|
355
355
|
setHasRemoteData: () => void;
|
|
356
356
|
saveRemote: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
357
357
|
fetchSchema: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
@@ -4585,14 +4585,14 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
4585
4585
|
} & {
|
|
4586
4586
|
readonly loading: boolean;
|
|
4587
4587
|
} & {
|
|
4588
|
-
markFetching: (fetching?: boolean) => void;
|
|
4588
|
+
markFetching: (fetching?: boolean) => void; /** Group单元格显示名称,从1开始 */
|
|
4589
4589
|
markSaving: (saving?: boolean) => void;
|
|
4590
4590
|
markBusying: (busying?: boolean) => void;
|
|
4591
|
-
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
4591
|
+
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>; /** Group单元格包含的首列的索引值,范围[1, columns.length] */
|
|
4592
4592
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
4593
4593
|
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
4594
4594
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
4595
|
-
clearMessage: () => void;
|
|
4595
|
+
clearMessage: () => void; /** Group单元格包含列数 */
|
|
4596
4596
|
setHasRemoteData: () => void;
|
|
4597
4597
|
saveRemote: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
4598
4598
|
fetchSchema: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
package/lib/store/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.3.
|
|
2
|
+
* amis-core v2.3.2-beta.1
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -256,16 +256,8 @@ var TableStore = iRenderer.iRendererStore
|
|
|
256
256
|
return self.columns.filter(function (item) {
|
|
257
257
|
return (item &&
|
|
258
258
|
helper.isVisible(item.pristine, helper.hasVisibleExpression(item.pristine) ? self.data : {}) &&
|
|
259
|
-
(item.
|
|
260
|
-
|
|
261
|
-
!self.dragging &&
|
|
262
|
-
!self.hideCheckToggler &&
|
|
263
|
-
self.rows.length
|
|
264
|
-
: item.type === '__dragme'
|
|
265
|
-
? self.dragging
|
|
266
|
-
: item.type === '__expandme'
|
|
267
|
-
? (getFootableColumns().length || self.isNested) && !self.dragging
|
|
268
|
-
: item.toggled || !item.toggable));
|
|
259
|
+
(item.toggled || !item.toggable) &&
|
|
260
|
+
!/^__/.test(item.type));
|
|
269
261
|
});
|
|
270
262
|
}
|
|
271
263
|
function getFilteredColumns() {
|
package/lib/store/table2.js
CHANGED
package/lib/theme.js
CHANGED