amis-core 6.11.0-beta.1 → 6.11.0-beta.2
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.d.ts +3 -0
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +14 -8
- package/esm/SchemaRenderer.d.ts +2 -0
- package/esm/SchemaRenderer.js +32 -9
- package/esm/Scoped.js +1 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.js +1 -1
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +6 -2
- 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/EventAction.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/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/WaitAction.js +1 -1
- package/esm/components/Animations.js +1 -1
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.js +1 -1
- 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.d.ts +1 -0
- package/esm/factory.js +1 -1
- package/esm/globalVar.d.ts +173 -0
- package/esm/globalVar.js +122 -0
- package/esm/globalVarClientHandler.d.ts +1 -0
- package/esm/globalVarClientHandler.js +65 -0
- package/esm/globalVarDefaultValueHandler.d.ts +1 -0
- package/esm/globalVarDefaultValueHandler.js +28 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +8 -5
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +3 -1
- package/esm/renderers/Form.js +39 -24
- package/esm/renderers/Item.d.ts +11 -19
- package/esm/renderers/Item.js +17 -2
- package/esm/renderers/Options.js +1 -1
- 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.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +8 -0
- package/esm/store/crud.js +24 -17
- package/esm/store/form.js +14 -5
- 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.d.ts +14 -1
- package/esm/store/list.js +45 -17
- 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.d.ts +14 -0
- package/esm/store/root.js +483 -12
- package/esm/store/service.js +1 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +16 -2
- package/esm/store/table.js +83 -26
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +3 -2
- 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/animations.js +1 -1
- package/esm/utils/api.d.ts +1 -0
- package/esm/utils/api.js +18 -6
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.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/decodeEntity.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 +5 -0
- package/esm/utils/helper.js +3 -2
- 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/labelToString.js +1 -1
- package/esm/utils/loopTooMuch.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/memoryParse.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/printElement.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/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/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.d.ts +3 -0
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +13 -7
- package/lib/SchemaRenderer.d.ts +2 -0
- package/lib/SchemaRenderer.js +32 -9
- package/lib/Scoped.js +1 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/actions/Action.js +1 -1
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +6 -2
- 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/EventAction.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/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/WaitAction.js +1 -1
- package/lib/components/Animations.js +1 -1
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.js +1 -1
- 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.d.ts +1 -0
- package/lib/factory.js +1 -1
- package/lib/globalVar.d.ts +173 -0
- package/lib/globalVar.js +130 -0
- package/lib/globalVarClientHandler.d.ts +1 -0
- package/lib/globalVarClientHandler.js +67 -0
- package/lib/globalVarDefaultValueHandler.d.ts +1 -0
- package/lib/globalVarDefaultValueHandler.js +30 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +13 -4
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +3 -1
- package/lib/renderers/Form.js +37 -21
- package/lib/renderers/Item.d.ts +11 -19
- package/lib/renderers/Item.js +17 -2
- package/lib/renderers/Options.js +1 -1
- 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.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +24 -24
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +8 -0
- package/lib/store/crud.js +23 -16
- package/lib/store/form.d.ts +10 -10
- package/lib/store/form.js +14 -5
- 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.d.ts +14 -1
- package/lib/store/list.js +44 -16
- 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.d.ts +13 -0
- package/lib/store/root.js +487 -11
- package/lib/store/service.js +1 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +36 -22
- package/lib/store/table.js +82 -25
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +3 -2
- 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/animations.js +1 -1
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/api.js +18 -5
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.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/decodeEntity.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 +5 -0
- package/lib/utils/helper.js +3 -2
- 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/labelToString.js +1 -1
- package/lib/utils/loopTooMuch.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- package/lib/utils/memoryParse.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/printElement.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/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/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +2 -2
package/lib/store/table.d.ts
CHANGED
|
@@ -224,6 +224,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
224
224
|
resetDefered(): void;
|
|
225
225
|
updateData({ children, ...rest }: any): void;
|
|
226
226
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
227
|
+
fullItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
228
|
+
fullSelectedItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
227
229
|
selectedRows: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IModelType<{
|
|
228
230
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
229
231
|
id: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -294,6 +296,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
294
296
|
draggable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
295
297
|
dragging: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
296
298
|
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
299
|
+
showIndex: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
297
300
|
multiple: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
298
301
|
footable: import("mobx-state-tree").IType<any, any, any>;
|
|
299
302
|
expandConfig: import("mobx-state-tree").IType<any, any, any>;
|
|
@@ -664,7 +667,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
664
667
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
665
668
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
666
669
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
667
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
670
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
668
671
|
changeEmitedValue: (value: any) => void;
|
|
669
672
|
addSubFormItem: (item: {
|
|
670
673
|
id: string;
|
|
@@ -1199,7 +1202,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
1199
1202
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
1200
1203
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
1201
1204
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
1202
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
1205
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1203
1206
|
changeEmitedValue: (value: any) => void;
|
|
1204
1207
|
addSubFormItem: (item: {
|
|
1205
1208
|
id: string;
|
|
@@ -1738,7 +1741,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
1738
1741
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
1739
1742
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
1740
1743
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
1741
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
1744
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1742
1745
|
changeEmitedValue: (value: any) => void;
|
|
1743
1746
|
addSubFormItem: (item: {
|
|
1744
1747
|
id: string;
|
|
@@ -2273,7 +2276,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
2273
2276
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
2274
2277
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
2275
2278
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
2276
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
2279
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2277
2280
|
changeEmitedValue: (value: any) => void;
|
|
2278
2281
|
addSubFormItem: (item: {
|
|
2279
2282
|
id: string;
|
|
@@ -2817,7 +2820,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
2817
2820
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
2818
2821
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
2819
2822
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
2820
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
2823
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2821
2824
|
changeEmitedValue: (value: any) => void;
|
|
2822
2825
|
addSubFormItem: (item: {
|
|
2823
2826
|
id: string;
|
|
@@ -3352,7 +3355,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
3352
3355
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
3353
3356
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
3354
3357
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
3355
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
3358
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3356
3359
|
changeEmitedValue: (value: any) => void;
|
|
3357
3360
|
addSubFormItem: (item: {
|
|
3358
3361
|
id: string;
|
|
@@ -3891,7 +3894,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
3891
3894
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
3892
3895
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
3893
3896
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
3894
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
3897
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3895
3898
|
changeEmitedValue: (value: any) => void;
|
|
3896
3899
|
addSubFormItem: (item: {
|
|
3897
3900
|
id: string;
|
|
@@ -4426,7 +4429,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
4426
4429
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
4427
4430
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
4428
4431
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
4429
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
4432
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4430
4433
|
changeEmitedValue: (value: any) => void;
|
|
4431
4434
|
addSubFormItem: (item: {
|
|
4432
4435
|
id: string;
|
|
@@ -4965,7 +4968,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
4965
4968
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
4966
4969
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
4967
4970
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
4968
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
4971
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4969
4972
|
changeEmitedValue: (value: any) => void;
|
|
4970
4973
|
addSubFormItem: (item: {
|
|
4971
4974
|
id: string;
|
|
@@ -5500,7 +5503,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5500
5503
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
5501
5504
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
5502
5505
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
5503
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
5506
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
5504
5507
|
changeEmitedValue: (value: any) => void;
|
|
5505
5508
|
addSubFormItem: (item: {
|
|
5506
5509
|
id: string;
|
|
@@ -6162,7 +6165,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
6162
6165
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
6163
6166
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
6164
6167
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
6165
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
6168
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
6166
6169
|
changeEmitedValue: (value: any) => void;
|
|
6167
6170
|
addSubFormItem: (item: {
|
|
6168
6171
|
id: string;
|
|
@@ -6697,7 +6700,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
6697
6700
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
6698
6701
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
6699
6702
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
6700
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
6703
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
6701
6704
|
changeEmitedValue: (value: any) => void;
|
|
6702
6705
|
addSubFormItem: (item: {
|
|
6703
6706
|
id: string;
|
|
@@ -7236,7 +7239,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
7236
7239
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
7237
7240
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
7238
7241
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
7239
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
7242
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
7240
7243
|
changeEmitedValue: (value: any) => void;
|
|
7241
7244
|
addSubFormItem: (item: {
|
|
7242
7245
|
id: string;
|
|
@@ -7771,7 +7774,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
7771
7774
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
7772
7775
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
7773
7776
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
7774
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
7777
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
7775
7778
|
changeEmitedValue: (value: any) => void;
|
|
7776
7779
|
addSubFormItem: (item: {
|
|
7777
7780
|
id: string;
|
|
@@ -8315,7 +8318,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
8315
8318
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
8316
8319
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
8317
8320
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
8318
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
8321
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
8319
8322
|
changeEmitedValue: (value: any) => void;
|
|
8320
8323
|
addSubFormItem: (item: {
|
|
8321
8324
|
id: string;
|
|
@@ -8850,7 +8853,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
8850
8853
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
8851
8854
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
8852
8855
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
8853
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
8856
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
8854
8857
|
changeEmitedValue: (value: any) => void;
|
|
8855
8858
|
addSubFormItem: (item: {
|
|
8856
8859
|
id: string;
|
|
@@ -9389,7 +9392,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
9389
9392
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
9390
9393
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
9391
9394
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
9392
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
9395
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
9393
9396
|
changeEmitedValue: (value: any) => void;
|
|
9394
9397
|
addSubFormItem: (item: {
|
|
9395
9398
|
id: string;
|
|
@@ -9924,7 +9927,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
9924
9927
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
9925
9928
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
9926
9929
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
9927
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
9930
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
9928
9931
|
changeEmitedValue: (value: any) => void;
|
|
9929
9932
|
addSubFormItem: (item: {
|
|
9930
9933
|
id: string;
|
|
@@ -10463,7 +10466,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
10463
10466
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
10464
10467
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
10465
10468
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
10466
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
10469
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
10467
10470
|
changeEmitedValue: (value: any) => void;
|
|
10468
10471
|
addSubFormItem: (item: {
|
|
10469
10472
|
id: string;
|
|
@@ -10998,7 +11001,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
10998
11001
|
closeDialog: (confirmed?: any, result?: any) => void;
|
|
10999
11002
|
openPopOver: (schema: any, ctx: any, callback?: ((confirmed?: any, value?: any) => void) | undefined) => void;
|
|
11000
11003
|
closePopOver: (confirmed?: any, result?: any) => void;
|
|
11001
|
-
changeTmpValue: (value: any, changeReason?: "input" | "
|
|
11004
|
+
changeTmpValue: (value: any, changeReason?: "input" | "formInited" | "defaultValue" | "initialValue" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
11002
11005
|
changeEmitedValue: (value: any) => void;
|
|
11003
11006
|
addSubFormItem: (item: {
|
|
11004
11007
|
id: string;
|
|
@@ -12810,7 +12813,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
12810
12813
|
/** 已选择item是否达到数量上限 */
|
|
12811
12814
|
readonly isSelectionThresholdReached: boolean;
|
|
12812
12815
|
readonly firstToggledColumnIndex: number | null;
|
|
12813
|
-
getData
|
|
12816
|
+
getData(superData: any): any;
|
|
12814
12817
|
readonly columnGroup: {
|
|
12815
12818
|
rowSpan: number;
|
|
12816
12819
|
label: any;
|
|
@@ -13233,6 +13236,17 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
13233
13236
|
updateData({ children, ...rest }: any): void;
|
|
13234
13237
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
13235
13238
|
buildStyles(style: any): any;
|
|
13239
|
+
/**
|
|
13240
|
+
* 构建事件的上下文数据
|
|
13241
|
+
* @param buildChain
|
|
13242
|
+
* @returns
|
|
13243
|
+
*/
|
|
13244
|
+
readonly eventContext: {
|
|
13245
|
+
selectedItems: any[];
|
|
13246
|
+
selectedIndexes: string[];
|
|
13247
|
+
items: any[];
|
|
13248
|
+
unSelectedItems: any[];
|
|
13249
|
+
};
|
|
13236
13250
|
} & {
|
|
13237
13251
|
setTable: (ref: HTMLElement | null) => void;
|
|
13238
13252
|
getTable: () => HTMLElement | null;
|
|
@@ -13242,7 +13256,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
13242
13256
|
updateColumns: (columns: Array<SColumn>) => void;
|
|
13243
13257
|
initTableWidth: () => void;
|
|
13244
13258
|
syncTableWidth: () => void;
|
|
13245
|
-
initRows: (rows: Array<any>, getEntryId?: ((entry: any, index: number) => string) | undefined, reUseRow?: boolean | 'match') => void;
|
|
13259
|
+
initRows: (rows: Array<any>, getEntryId?: ((entry: any, index: number) => string) | undefined, reUseRow?: boolean | 'match', fullItems?: Array<any>, fullSelectedItems?: Array<any>) => void;
|
|
13246
13260
|
updateSelected: (selected: Array<any>, valueField?: string) => void;
|
|
13247
13261
|
toggleAll: () => void;
|
|
13248
13262
|
getSelectedRows: () => ({
|
package/lib/store/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -239,14 +239,9 @@ var Row = mobxStateTree.types
|
|
|
239
239
|
}
|
|
240
240
|
var table = mobxStateTree.getParent(self, self.depth * 2);
|
|
241
241
|
var parent = mobxStateTree.getParent(self, 2);
|
|
242
|
-
return object.createObject(object.extendObject(mobxStateTree.getParent(self, self.depth * 2).data, {
|
|
243
|
-
index: self.index,
|
|
242
|
+
return object.createObject(object.extendObject(mobxStateTree.getParent(self, self.depth * 2).data, tslib.__assign({ index: self.index, path: self.path,
|
|
244
243
|
// todo 以后再支持多层,目前先一层
|
|
245
|
-
parent: parent.storeType === Row.name ? parent.data : undefined,
|
|
246
|
-
// 只有table时,也可以获取选中行
|
|
247
|
-
selectedItems: table.selectedRows.map(function (item) { return item.data; }),
|
|
248
|
-
unSelectedItems: table.unSelectedRows.map(function (item) { return item.data; })
|
|
249
|
-
}), children
|
|
244
|
+
parent: parent.storeType === Row.name ? parent.data : undefined }, table.eventContext)), children
|
|
250
245
|
? tslib.__assign(tslib.__assign({}, self.data), { children: children }) : self.data);
|
|
251
246
|
},
|
|
252
247
|
get checkable() {
|
|
@@ -296,8 +291,12 @@ var Row = mobxStateTree.types
|
|
|
296
291
|
var table = self.table;
|
|
297
292
|
var row = self;
|
|
298
293
|
table.toggle(row, checked);
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
// 多选才需要处理祖先和后代
|
|
295
|
+
// 单选只处理自己就行了
|
|
296
|
+
if (table.multiple) {
|
|
297
|
+
table.toggleAncestors(row);
|
|
298
|
+
table.toggleDescendants(row, checked);
|
|
299
|
+
}
|
|
301
300
|
},
|
|
302
301
|
toggleExpanded: function () {
|
|
303
302
|
mobxStateTree.getParent(self, self.depth * 2).toggleExpanded(self);
|
|
@@ -306,8 +305,16 @@ var Row = mobxStateTree.types
|
|
|
306
305
|
mobxStateTree.getParent(self, self.depth * 2).setExpanded(self, expanded);
|
|
307
306
|
},
|
|
308
307
|
change: function (values, savePristine) {
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
var data = helper.immutableExtends(self.data, values);
|
|
309
|
+
Object.isExtensible(data) &&
|
|
310
|
+
Object.defineProperty(data, '__pristine', {
|
|
311
|
+
value: savePristine ? data : self.pristine,
|
|
312
|
+
enumerable: false,
|
|
313
|
+
configurable: false,
|
|
314
|
+
writable: false
|
|
315
|
+
});
|
|
316
|
+
self.data = data;
|
|
317
|
+
savePristine && (self.pristine = data);
|
|
311
318
|
},
|
|
312
319
|
reset: function () {
|
|
313
320
|
self.newIndex = self.index;
|
|
@@ -369,9 +376,17 @@ var Row = mobxStateTree.types
|
|
|
369
376
|
},
|
|
370
377
|
updateData: function (_a) {
|
|
371
378
|
var children = _a.children, rest = tslib.__rest(_a, ["children"]);
|
|
372
|
-
|
|
379
|
+
var data = tslib.__assign(tslib.__assign({}, self.data), rest);
|
|
380
|
+
Object.isExtensible(data) &&
|
|
381
|
+
Object.defineProperty(data, '__pristine', {
|
|
382
|
+
value: self.data.__pristine || self.pristine,
|
|
383
|
+
enumerable: false,
|
|
384
|
+
configurable: false,
|
|
385
|
+
writable: false
|
|
386
|
+
});
|
|
387
|
+
self.data = data;
|
|
373
388
|
if (Array.isArray(children)) {
|
|
374
|
-
this.replaceChildren(initChildren(children, self.depth, self.index, self.id, self.path));
|
|
389
|
+
this.replaceChildren(initChildren(children, self.depth, self.index, self.id, "".concat(self.path, ".")));
|
|
375
390
|
}
|
|
376
391
|
}
|
|
377
392
|
}); });
|
|
@@ -380,6 +395,11 @@ var TableStore = iRenderer.iRendererStore
|
|
|
380
395
|
.props({
|
|
381
396
|
columns: mobxStateTree.types.array(Column),
|
|
382
397
|
rows: mobxStateTree.types.array(Row),
|
|
398
|
+
// 记录原始列表和原始选中的列表
|
|
399
|
+
// 因为如果是前端分页,上层 crud 或者 input-table 下发到这层的
|
|
400
|
+
// 是某个页区间的数据,这个时候 items 和 selectedItems 会少很多条
|
|
401
|
+
fullItems: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), []),
|
|
402
|
+
fullSelectedItems: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), []),
|
|
383
403
|
selectedRows: mobxStateTree.types.array(mobxStateTree.types.reference(Row)),
|
|
384
404
|
expandedRows: mobxStateTree.types.array(mobxStateTree.types.string),
|
|
385
405
|
primaryField: 'id',
|
|
@@ -390,6 +410,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
390
410
|
draggable: false,
|
|
391
411
|
dragging: false,
|
|
392
412
|
selectable: false,
|
|
413
|
+
showIndex: false,
|
|
393
414
|
multiple: true,
|
|
394
415
|
footable: mobxStateTree.types.frozen(),
|
|
395
416
|
expandConfig: mobxStateTree.types.frozen(),
|
|
@@ -513,13 +534,6 @@ var TableStore = iRenderer.iRendererStore
|
|
|
513
534
|
function getUnSelectedRows() {
|
|
514
535
|
return helper.flattenTree(self.rows).filter(function (item) { return !item.checked; });
|
|
515
536
|
}
|
|
516
|
-
function getData(superData) {
|
|
517
|
-
return object.createObject(superData, {
|
|
518
|
-
items: self.rows.map(function (item) { return item.data; }),
|
|
519
|
-
selectedItems: self.selectedRows.map(function (item) { return item.data; }),
|
|
520
|
-
unSelectedItems: getUnSelectedRows().map(function (item) { return item.data; })
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
537
|
function hasColumnHidden() {
|
|
524
538
|
return self.columns.findIndex(function (column) { return !column.toggled; }) !== -1;
|
|
525
539
|
}
|
|
@@ -693,7 +707,9 @@ var TableStore = iRenderer.iRendererStore
|
|
|
693
707
|
get firstToggledColumnIndex() {
|
|
694
708
|
return getFirstToggledColumnIndex();
|
|
695
709
|
},
|
|
696
|
-
getData:
|
|
710
|
+
getData: function (superData) {
|
|
711
|
+
return object.createObject(superData, this.eventContext);
|
|
712
|
+
},
|
|
697
713
|
get columnGroup() {
|
|
698
714
|
return getColumnGroup();
|
|
699
715
|
},
|
|
@@ -786,6 +802,37 @@ var TableStore = iRenderer.iRendererStore
|
|
|
786
802
|
column.realWidth + 'px';
|
|
787
803
|
});
|
|
788
804
|
return style;
|
|
805
|
+
},
|
|
806
|
+
/**
|
|
807
|
+
* 构建事件的上下文数据
|
|
808
|
+
* @param buildChain
|
|
809
|
+
* @returns
|
|
810
|
+
*/
|
|
811
|
+
get eventContext() {
|
|
812
|
+
var context = {
|
|
813
|
+
selectedItems: self.selectedRows.map(function (item) { return item.data; }),
|
|
814
|
+
selectedIndexes: self.selectedRows.map(function (item) { return item.path; }),
|
|
815
|
+
items: self.rows.map(function (item) { return item.data; }),
|
|
816
|
+
unSelectedItems: this.unSelectedRows.map(function (item) { return item.data; })
|
|
817
|
+
};
|
|
818
|
+
// 如果是前端分页情况,需要根据全量数据计算
|
|
819
|
+
// 如果不是前端分页,数据都没有返回,那种就没办法支持全量数据信息了
|
|
820
|
+
if (self.fullItems.length > self.rows.length) {
|
|
821
|
+
// todo 这里的选择顺序会一直变,这个有影响吗?
|
|
822
|
+
var selectedItems_1 = self.fullSelectedItems
|
|
823
|
+
.filter(function (item) {
|
|
824
|
+
return !self.rows.find(function (row) { return row.pristine === (item.__pristine || item); });
|
|
825
|
+
})
|
|
826
|
+
.concat(context.selectedItems);
|
|
827
|
+
context.selectedItems = selectedItems_1;
|
|
828
|
+
context.items = self.fullItems.concat();
|
|
829
|
+
context.unSelectedItems = self.fullItems.filter(function (item) { return !selectedItems_1.includes(item); });
|
|
830
|
+
context.selectedIndexes = selectedItems_1.map(function (item) {
|
|
831
|
+
var _a;
|
|
832
|
+
return ((_a = helper.findTreeIndex(self.fullItems, function (i) { return (item.__pristine || item) === (i.__pristine || i); })) === null || _a === void 0 ? void 0 : _a.join('.')) || '-1';
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
return context;
|
|
789
836
|
}
|
|
790
837
|
};
|
|
791
838
|
})
|
|
@@ -844,6 +891,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
844
891
|
(self.lazyRenderAfter = config.lazyRenderAfter);
|
|
845
892
|
typeof config.tableLayout === 'string' &&
|
|
846
893
|
(self.tableLayout = config.tableLayout);
|
|
894
|
+
config.showIndex !== undefined && (self.showIndex = config.showIndex);
|
|
847
895
|
if (config.columns && Array.isArray(config.columns)) {
|
|
848
896
|
var columns = config.columns
|
|
849
897
|
.map(function (column) {
|
|
@@ -885,6 +933,12 @@ var TableStore = iRenderer.iRendererStore
|
|
|
885
933
|
label: '空'
|
|
886
934
|
});
|
|
887
935
|
}
|
|
936
|
+
if (self.showIndex) {
|
|
937
|
+
columns.unshift({
|
|
938
|
+
type: '__index',
|
|
939
|
+
width: 50
|
|
940
|
+
});
|
|
941
|
+
}
|
|
888
942
|
columns.unshift({
|
|
889
943
|
type: '__expandme',
|
|
890
944
|
toggable: false,
|
|
@@ -1061,7 +1115,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1061
1115
|
}
|
|
1062
1116
|
return combineCell(arr, keys);
|
|
1063
1117
|
}
|
|
1064
|
-
function initRows(rows, getEntryId, reUseRow) {
|
|
1118
|
+
function initRows(rows, getEntryId, reUseRow, fullItems, fullSelectedItems) {
|
|
1065
1119
|
self.selectedRows.clear();
|
|
1066
1120
|
// self.expandedRows.clear();
|
|
1067
1121
|
/* 避免输入内容为非数组挂掉 */
|
|
@@ -1081,7 +1135,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1081
1135
|
depth: 1,
|
|
1082
1136
|
index: index,
|
|
1083
1137
|
newIndex: index,
|
|
1084
|
-
pristine: item,
|
|
1138
|
+
pristine: item.__pristine || item,
|
|
1085
1139
|
path: "".concat(index),
|
|
1086
1140
|
data: item,
|
|
1087
1141
|
rowSpans: {},
|
|
@@ -1120,6 +1174,9 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1120
1174
|
}
|
|
1121
1175
|
}
|
|
1122
1176
|
self.dragging = false;
|
|
1177
|
+
Array.isArray(fullItems) && self.fullItems.replace(fullItems);
|
|
1178
|
+
Array.isArray(fullSelectedItems) &&
|
|
1179
|
+
self.fullSelectedItems.replace(fullSelectedItems);
|
|
1123
1180
|
}
|
|
1124
1181
|
// 获取所有层级的子节点id
|
|
1125
1182
|
function getExpandAllRows(arr) {
|
|
@@ -1315,7 +1372,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1315
1372
|
return;
|
|
1316
1373
|
}
|
|
1317
1374
|
var maxLength = self.getSelectionUpperLimit();
|
|
1318
|
-
var selectedItems = self.data
|
|
1375
|
+
var selectedItems = self.selectedRows.map(function (item) { return item.data; });
|
|
1319
1376
|
self.selectedRows.map(function (item) { return item.setCheckdisable(false); });
|
|
1320
1377
|
if (maxLength !== Infinity && maxLength <= selectedItems.length) {
|
|
1321
1378
|
self.unSelectedRows.map(function (item) { return !item.checked && item.setCheckdisable(true); });
|
package/lib/store/table2.js
CHANGED
package/lib/theme.js
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { JSONSchema7 } from 'json-schema';
|
|
3
3
|
import { ListenerAction } from './actions/Action';
|
|
4
4
|
import { debounceConfig, trackConfig } from './utils/renderer-event';
|
|
5
|
-
import type { TestIdBuilder } from './utils/helper';
|
|
5
|
+
import type { TestIdBuilder, ValidateError } from './utils/helper';
|
|
6
6
|
import { AnimationsProps } from './utils/animations';
|
|
7
7
|
export interface Option {
|
|
8
8
|
/**
|
|
@@ -281,7 +281,7 @@ export interface Definitions {
|
|
|
281
281
|
[propName: string]: SchemaNode;
|
|
282
282
|
}
|
|
283
283
|
export interface ActionObject extends ButtonObject {
|
|
284
|
-
actionType?: 'submit' | 'copy' | 'reload' | 'ajax' | 'saveAs' | 'dialog' | 'drawer' | 'confirmDialog' | 'jump' | 'link' | 'url' | 'email' | 'close' | 'confirm' | 'add' | 'remove' | 'delete' | 'edit' | 'cancel' | 'next' | 'prev' | 'reset' | 'validate' | 'reset-and-submit' | 'clear' | 'clear-and-submit' | 'toast' | 'goto-step' | 'goto-image' | 'expand' | 'collapse' | 'step-submit' | 'select' | 'selectAll' | 'clearAll' | 'changeTabKey' | 'clearSearch' | 'submitQuickEdit' | 'initDrag' | 'cancelDrag' | 'toggleExpanded' | 'setExpanded';
|
|
284
|
+
actionType?: 'submit' | 'copy' | 'reload' | 'ajax' | 'saveAs' | 'dialog' | 'drawer' | 'confirmDialog' | 'jump' | 'link' | 'url' | 'email' | 'close' | 'confirm' | 'add' | 'remove' | 'delete' | 'edit' | 'cancel' | 'next' | 'prev' | 'reset' | 'validate' | 'reset-and-submit' | 'clear' | 'clear-and-submit' | 'toast' | 'goto-step' | 'goto-image' | 'expand' | 'collapse' | 'step-submit' | 'select' | 'selectAll' | 'clearAll' | 'changeTabKey' | 'clearSearch' | 'submitQuickEdit' | 'initDrag' | 'cancelDrag' | 'toggleExpanded' | 'setExpanded' | 'clearError';
|
|
285
285
|
api?: BaseApiObject | string;
|
|
286
286
|
asyncApi?: BaseApiObject | string;
|
|
287
287
|
payload?: any;
|
|
@@ -390,6 +390,7 @@ export type ToastConf = {
|
|
|
390
390
|
className?: string;
|
|
391
391
|
items?: Array<any>;
|
|
392
392
|
useMobileUI?: boolean;
|
|
393
|
+
validateError?: ValidateError;
|
|
393
394
|
};
|
|
394
395
|
export interface OptionProps {
|
|
395
396
|
className?: string;
|
package/lib/utils/Animation.js
CHANGED
package/lib/utils/ColorScale.js
CHANGED
package/lib/utils/DataSchema.js
CHANGED
package/lib/utils/DataScope.js
CHANGED
package/lib/utils/RootClose.js
CHANGED
package/lib/utils/SimpleMap.js
CHANGED
package/lib/utils/animations.js
CHANGED
package/lib/utils/api.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare function isApiOutdatedWithData(prevApi: Api | undefined, nextApi:
|
|
|
48
48
|
export declare function isApiOutdated(prevApi: Api | undefined, nextApi: Api | undefined, prevData: any, nextData: any): nextApi is Api;
|
|
49
49
|
export declare function isValidApi(api: string): boolean;
|
|
50
50
|
export declare function isEffectiveApi(api?: Api, data?: any, initFetch?: boolean, initFetchOn?: string): api is Api;
|
|
51
|
+
export declare function shouldBlockedBySendOnApi(api?: Api, data?: any): boolean;
|
|
51
52
|
export declare function isSameApi(apiA: ApiObject | ApiCacheConfig, apiB: ApiObject | ApiCacheConfig): boolean;
|
|
52
53
|
export declare function getApiCache(api: ApiObject): ApiCacheConfig | undefined;
|
|
53
54
|
export declare function setApiCache(api: ApiObject, promise: Promise<any>): Promise<any>;
|
package/lib/utils/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -169,9 +169,13 @@ function buildApi(api, data, options) {
|
|
|
169
169
|
}
|
|
170
170
|
return apiObject;
|
|
171
171
|
};
|
|
172
|
+
var queryMapped = false;
|
|
172
173
|
if (~idx) {
|
|
173
174
|
var hashIdx = url.indexOf('#');
|
|
174
175
|
var params = helper.qsparse(url.substring(idx + 1, ~hashIdx && hashIdx > idx ? hashIdx : undefined));
|
|
176
|
+
// 合并 api.query 的配置
|
|
177
|
+
params = dataMapping.dataMapping(Object.assign(params, api.query), data, undefined, api.convertKeyToPath);
|
|
178
|
+
queryMapped = true;
|
|
175
179
|
// 将里面的表达式运算完
|
|
176
180
|
helper.JSONTraverse(params, function (value, key, host) {
|
|
177
181
|
var _a;
|
|
@@ -183,13 +187,12 @@ function buildApi(api, data, options) {
|
|
|
183
187
|
host[key] = replaceExpression(host[key], 'raw', '');
|
|
184
188
|
}
|
|
185
189
|
});
|
|
190
|
+
api.query = params;
|
|
186
191
|
var left = replaceExpression(url.substring(0, idx), 'raw', '');
|
|
187
|
-
// 追加
|
|
188
|
-
Object.assign(params, api.query);
|
|
189
192
|
api.url =
|
|
190
193
|
left +
|
|
191
194
|
(~left.indexOf('?') ? '&' : '?') +
|
|
192
|
-
queryStringify(
|
|
195
|
+
queryStringify(api.query) +
|
|
193
196
|
(~hashIdx && hashIdx > idx
|
|
194
197
|
? replaceExpression(url.substring(hashIdx))
|
|
195
198
|
: '');
|
|
@@ -210,7 +213,7 @@ function buildApi(api, data, options) {
|
|
|
210
213
|
api.body = api.data = data;
|
|
211
214
|
}
|
|
212
215
|
// 给 query 做数据映射
|
|
213
|
-
if (api.query) {
|
|
216
|
+
if (api.query && !queryMapped) {
|
|
214
217
|
api.query = dataMapping.dataMapping(api.query, data, undefined, api.convertKeyToPath);
|
|
215
218
|
}
|
|
216
219
|
// get 类请求,把 data 附带到 url 上。
|
|
@@ -778,6 +781,15 @@ function isEffectiveApi(api, data, initFetch, initFetchOn) {
|
|
|
778
781
|
}
|
|
779
782
|
return false;
|
|
780
783
|
}
|
|
784
|
+
// 判断api是否存在,且SendOn为不发送
|
|
785
|
+
function shouldBlockedBySendOnApi(api, data) {
|
|
786
|
+
if (object.isObject(api) && api.url) {
|
|
787
|
+
if (api.sendOn && data) {
|
|
788
|
+
return !tpl.evalExpression(api.sendOn, data);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
781
793
|
function isSameApi(apiA, apiB) {
|
|
782
794
|
return (apiA.method === apiB.method &&
|
|
783
795
|
apiA.url === apiB.url &&
|
|
@@ -843,6 +855,7 @@ exports.removeApiRequestAdaptor = removeApiRequestAdaptor;
|
|
|
843
855
|
exports.removeApiResponseAdaptor = removeApiResponseAdaptor;
|
|
844
856
|
exports.responseAdaptor = responseAdaptor;
|
|
845
857
|
exports.setApiCache = setApiCache;
|
|
858
|
+
exports.shouldBlockedBySendOnApi = shouldBlockedBySendOnApi;
|
|
846
859
|
exports.str2AsyncFunction = str2AsyncFunction;
|
|
847
860
|
exports.str2function = str2function;
|
|
848
861
|
exports.wrapAdaptor = wrapAdaptor;
|
package/lib/utils/arraySlice.js
CHANGED