amis-core 3.5.3 → 3.6.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.d.ts +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.js +1 -1
- package/esm/Scoped.d.ts +2 -0
- package/esm/Scoped.js +48 -6
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +27 -12
- package/esm/actions/Action.js +30 -22
- package/esm/actions/AjaxAction.js +2 -2
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +3 -3
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +3 -3
- 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 +5 -5
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +3 -3
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.d.ts +20 -0
- package/esm/components/ErrorBoundary.js +41 -0
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.d.ts +4 -0
- package/esm/components/PopOver.js +66 -3
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +4 -3
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +1 -1
- package/esm/renderers/Form.js +16 -8
- package/esm/renderers/Item.d.ts +54 -0
- package/esm/renderers/Item.js +1 -1
- package/esm/renderers/Options.d.ts +4 -0
- package/esm/renderers/Options.js +5 -4
- 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 +4 -6
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +24 -24
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +9 -1
- package/esm/store/crud.js +29 -13
- package/esm/store/form.d.ts +10 -10
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.js +16 -7
- 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/status.js +1 -1
- package/esm/store/table.d.ts +21 -20
- package/esm/store/table.js +8 -12
- 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/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +3 -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/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.d.ts +2 -1
- package/esm/utils/filter-schema.js +14 -5
- 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/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/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 +5 -3
- 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 +2 -0
- package/lib/Scoped.js +47 -5
- package/lib/StatusScoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +26 -11
- package/lib/actions/Action.js +29 -21
- package/lib/actions/AjaxAction.js +2 -2
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +3 -3
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +3 -3
- 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 +5 -5
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +3 -3
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.d.ts +20 -0
- package/lib/components/ErrorBoundary.js +52 -0
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.d.ts +4 -0
- package/lib/components/PopOver.js +64 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +5 -2
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +1 -1
- package/lib/renderers/Form.js +16 -8
- package/lib/renderers/Item.d.ts +55 -1
- package/lib/renderers/Item.js +1 -1
- package/lib/renderers/Options.d.ts +4 -0
- package/lib/renderers/Options.js +5 -4
- 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 +4 -6
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +25 -24
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +9 -1
- package/lib/store/crud.js +29 -13
- package/lib/store/form.d.ts +11 -10
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.js +16 -7
- 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/status.js +1 -1
- package/lib/store/table.d.ts +22 -20
- package/lib/store/table.js +8 -12
- 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/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +3 -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/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.d.ts +2 -1
- package/lib/utils/filter-schema.js +14 -4
- 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/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/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 +5 -3
- 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/store/combo.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ export declare const UniqueGroup: import("mobx-state-tree").IModelType<{
|
|
|
165
165
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
166
166
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
167
167
|
closeDialog: (result?: any) => void;
|
|
168
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
168
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
169
169
|
changeEmitedValue: (value: any) => void;
|
|
170
170
|
addSubFormItem: (item: {
|
|
171
171
|
id: string;
|
|
@@ -674,7 +674,7 @@ export declare const UniqueGroup: import("mobx-state-tree").IModelType<{
|
|
|
674
674
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
675
675
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
676
676
|
closeDialog: (result?: any) => void;
|
|
677
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
677
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
678
678
|
changeEmitedValue: (value: any) => void;
|
|
679
679
|
addSubFormItem: (item: {
|
|
680
680
|
id: string;
|
|
@@ -1215,7 +1215,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
1215
1215
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
1216
1216
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
1217
1217
|
closeDialog: (result?: any) => void;
|
|
1218
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
1218
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1219
1219
|
changeEmitedValue: (value: any) => void;
|
|
1220
1220
|
addSubFormItem: (item: {
|
|
1221
1221
|
id: string;
|
|
@@ -1724,7 +1724,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
1724
1724
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
1725
1725
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
1726
1726
|
closeDialog: (result?: any) => void;
|
|
1727
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
1727
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1728
1728
|
changeEmitedValue: (value: any) => void;
|
|
1729
1729
|
addSubFormItem: (item: {
|
|
1730
1730
|
id: string;
|
|
@@ -2354,7 +2354,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2354
2354
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
2355
2355
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
2356
2356
|
closeDialog: (result?: any) => void;
|
|
2357
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
2357
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2358
2358
|
changeEmitedValue: (value: any) => void;
|
|
2359
2359
|
addSubFormItem: (item: {
|
|
2360
2360
|
id: string;
|
|
@@ -2863,7 +2863,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2863
2863
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
2864
2864
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
2865
2865
|
closeDialog: (result?: any) => void;
|
|
2866
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
2866
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2867
2867
|
changeEmitedValue: (value: any) => void;
|
|
2868
2868
|
addSubFormItem: (item: {
|
|
2869
2869
|
id: string;
|
|
@@ -3376,7 +3376,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
3376
3376
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
3377
3377
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
3378
3378
|
closeDialog: (result?: any) => void;
|
|
3379
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
3379
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3380
3380
|
changeEmitedValue: (value: any) => void;
|
|
3381
3381
|
addSubFormItem: (item: {
|
|
3382
3382
|
id: string;
|
|
@@ -3885,7 +3885,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
3885
3885
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
3886
3886
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
3887
3887
|
closeDialog: (result?: any) => void;
|
|
3888
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
3888
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3889
3889
|
changeEmitedValue: (value: any) => void;
|
|
3890
3890
|
addSubFormItem: (item: {
|
|
3891
3891
|
id: string;
|
|
@@ -4403,7 +4403,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
4403
4403
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
4404
4404
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
4405
4405
|
closeDialog: (result?: any) => void;
|
|
4406
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
4406
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4407
4407
|
changeEmitedValue: (value: any) => void;
|
|
4408
4408
|
addSubFormItem: (item: {
|
|
4409
4409
|
id: string;
|
|
@@ -4912,7 +4912,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
4912
4912
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
4913
4913
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
4914
4914
|
closeDialog: (result?: any) => void;
|
|
4915
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
4915
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4916
4916
|
changeEmitedValue: (value: any) => void;
|
|
4917
4917
|
addSubFormItem: (item: {
|
|
4918
4918
|
id: string;
|
|
@@ -5425,7 +5425,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
5425
5425
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
5426
5426
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
5427
5427
|
closeDialog: (result?: any) => void;
|
|
5428
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
5428
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
5429
5429
|
changeEmitedValue: (value: any) => void;
|
|
5430
5430
|
addSubFormItem: (item: {
|
|
5431
5431
|
id: string;
|
|
@@ -5934,7 +5934,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
5934
5934
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
5935
5935
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
5936
5936
|
closeDialog: (result?: any) => void;
|
|
5937
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
5937
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
5938
5938
|
changeEmitedValue: (value: any) => void;
|
|
5939
5939
|
addSubFormItem: (item: {
|
|
5940
5940
|
id: string;
|
|
@@ -6447,7 +6447,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
6447
6447
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
6448
6448
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
6449
6449
|
closeDialog: (result?: any) => void;
|
|
6450
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
6450
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
6451
6451
|
changeEmitedValue: (value: any) => void;
|
|
6452
6452
|
addSubFormItem: (item: {
|
|
6453
6453
|
id: string;
|
|
@@ -6956,7 +6956,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
6956
6956
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
6957
6957
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
6958
6958
|
closeDialog: (result?: any) => void;
|
|
6959
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
6959
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
6960
6960
|
changeEmitedValue: (value: any) => void;
|
|
6961
6961
|
addSubFormItem: (item: {
|
|
6962
6962
|
id: string;
|
|
@@ -7588,7 +7588,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
7588
7588
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
7589
7589
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
7590
7590
|
closeDialog: (result?: any) => void;
|
|
7591
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
7591
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
7592
7592
|
changeEmitedValue: (value: any) => void;
|
|
7593
7593
|
addSubFormItem: (item: {
|
|
7594
7594
|
id: string;
|
|
@@ -8097,7 +8097,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
8097
8097
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
8098
8098
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
8099
8099
|
closeDialog: (result?: any) => void;
|
|
8100
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
8100
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
8101
8101
|
changeEmitedValue: (value: any) => void;
|
|
8102
8102
|
addSubFormItem: (item: {
|
|
8103
8103
|
id: string;
|
|
@@ -8610,7 +8610,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
8610
8610
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
8611
8611
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
8612
8612
|
closeDialog: (result?: any) => void;
|
|
8613
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
8613
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
8614
8614
|
changeEmitedValue: (value: any) => void;
|
|
8615
8615
|
addSubFormItem: (item: {
|
|
8616
8616
|
id: string;
|
|
@@ -9119,7 +9119,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
9119
9119
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
9120
9120
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
9121
9121
|
closeDialog: (result?: any) => void;
|
|
9122
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
9122
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
9123
9123
|
changeEmitedValue: (value: any) => void;
|
|
9124
9124
|
addSubFormItem: (item: {
|
|
9125
9125
|
id: string;
|
|
@@ -9637,7 +9637,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
9637
9637
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
9638
9638
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
9639
9639
|
closeDialog: (result?: any) => void;
|
|
9640
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
9640
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
9641
9641
|
changeEmitedValue: (value: any) => void;
|
|
9642
9642
|
addSubFormItem: (item: {
|
|
9643
9643
|
id: string;
|
|
@@ -10146,7 +10146,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
10146
10146
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
10147
10147
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
10148
10148
|
closeDialog: (result?: any) => void;
|
|
10149
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
10149
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
10150
10150
|
changeEmitedValue: (value: any) => void;
|
|
10151
10151
|
addSubFormItem: (item: {
|
|
10152
10152
|
id: string;
|
|
@@ -10659,7 +10659,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
10659
10659
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
10660
10660
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
10661
10661
|
closeDialog: (result?: any) => void;
|
|
10662
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
10662
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
10663
10663
|
changeEmitedValue: (value: any) => void;
|
|
10664
10664
|
addSubFormItem: (item: {
|
|
10665
10665
|
id: string;
|
|
@@ -11168,7 +11168,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
11168
11168
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
11169
11169
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
11170
11170
|
closeDialog: (result?: any) => void;
|
|
11171
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
11171
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
11172
11172
|
changeEmitedValue: (value: any) => void;
|
|
11173
11173
|
addSubFormItem: (item: {
|
|
11174
11174
|
id: string;
|
|
@@ -11681,7 +11681,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
11681
11681
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
11682
11682
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
11683
11683
|
closeDialog: (result?: any) => void;
|
|
11684
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
11684
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
11685
11685
|
changeEmitedValue: (value: any) => void;
|
|
11686
11686
|
addSubFormItem: (item: {
|
|
11687
11687
|
id: string;
|
|
@@ -12190,7 +12190,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
12190
12190
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
12191
12191
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
12192
12192
|
closeDialog: (result?: any) => void;
|
|
12193
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
12193
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
12194
12194
|
changeEmitedValue: (value: any) => void;
|
|
12195
12195
|
addSubFormItem: (item: {
|
|
12196
12196
|
id: string;
|
package/esm/store/combo.js
CHANGED
package/esm/store/crud.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Instance } from 'mobx-state-tree';
|
|
2
2
|
import { Api, fetchOptions, ActionObject } from '../types';
|
|
3
|
+
import type { MatchSorterOptions } from 'match-sorter';
|
|
3
4
|
interface MatchFunc {
|
|
4
5
|
(items: any, itemsRaw: any,
|
|
5
6
|
/** 相关配置 */
|
|
6
7
|
options?: {
|
|
7
8
|
query: Record<string, any>;
|
|
8
9
|
columns: any;
|
|
10
|
+
/**
|
|
11
|
+
* match-sorter 匹配函数
|
|
12
|
+
* @doc https://github.com/kentcdodds/match-sorter
|
|
13
|
+
*/
|
|
14
|
+
matchSorter: (items: any[], value: string, options?: MatchSorterOptions<any>) => any[];
|
|
9
15
|
}): any;
|
|
10
16
|
}
|
|
11
17
|
export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
@@ -120,7 +126,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
120
126
|
columns?: Array<any>;
|
|
121
127
|
isTable2?: Boolean;
|
|
122
128
|
}) => Promise<any>;
|
|
123
|
-
changePage: (page: number, perPage?: number | string) => void;
|
|
129
|
+
changePage: (page: number | string, perPage?: number | string) => void;
|
|
124
130
|
changePerPage: (perPage: number | string) => void;
|
|
125
131
|
selectAction: (action: ActionObject) => void;
|
|
126
132
|
saveRemote: (api: Api, data?: object, options?: fetchOptions) => Promise<any>;
|
|
@@ -138,6 +144,8 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
138
144
|
api?: Api | undefined;
|
|
139
145
|
data?: any;
|
|
140
146
|
filename?: string | undefined;
|
|
147
|
+
pageField?: string | undefined;
|
|
148
|
+
perPageField?: string | undefined;
|
|
141
149
|
}) => Promise<void>;
|
|
142
150
|
updateColumns: (columns: Array<any>) => void;
|
|
143
151
|
updateTotal: (total: number) => void;
|
package/esm/store/crud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.6.1
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -140,7 +140,8 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
140
140
|
if (matchFunc && typeof matchFunc === 'function') {
|
|
141
141
|
items_1 = matchFunc(items_1, self.data.itemsRaw, {
|
|
142
142
|
query: self.query,
|
|
143
|
-
columns: options.columns
|
|
143
|
+
columns: options.columns,
|
|
144
|
+
matchSorter: matchSorter
|
|
144
145
|
});
|
|
145
146
|
}
|
|
146
147
|
else {
|
|
@@ -266,8 +267,11 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
266
267
|
}
|
|
267
268
|
data_2 = __assign(__assign(__assign({}, (api.replaceData ? {} : self.pristine)), { items: rowsData, count: count, total: total }), rest);
|
|
268
269
|
if (options.loadDataOnce) {
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
/**
|
|
271
|
+
* 1. 记录原始集合,后续可能基于原始数据做排序查找。
|
|
272
|
+
* 2. 接口返回中没有 items 和 rows 字段,则直接用查到的数据。
|
|
273
|
+
*/
|
|
274
|
+
data_2.itemsRaw = oItems || oRows || rowsData.concat();
|
|
271
275
|
filteredItems_1 = rowsData.concat();
|
|
272
276
|
if (Array.isArray(options.columns)) {
|
|
273
277
|
options.columns.forEach(function (column) {
|
|
@@ -351,11 +355,13 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
351
355
|
});
|
|
352
356
|
});
|
|
353
357
|
function changePage(page, perPage) {
|
|
354
|
-
|
|
358
|
+
var pageNum = typeof page !== 'number' ? parseInt(page, 10) : page;
|
|
359
|
+
self.page = isNaN(pageNum) ? 1 : pageNum;
|
|
355
360
|
perPage && changePerPage(perPage);
|
|
356
361
|
}
|
|
357
362
|
function changePerPage(perPage) {
|
|
358
|
-
|
|
363
|
+
var perPageNum = typeof perPage !== 'number' ? parseInt(perPage, 10) : perPage;
|
|
364
|
+
self.perPage = isNaN(perPageNum) ? 10 : perPageNum;
|
|
359
365
|
}
|
|
360
366
|
function selectAction(action) {
|
|
361
367
|
self.selectedAction = action;
|
|
@@ -453,7 +459,8 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
453
459
|
if (matchFunc && typeof matchFunc === 'function') {
|
|
454
460
|
items = matchFunc(items, items.concat(), {
|
|
455
461
|
query: self.query,
|
|
456
|
-
columns: options.columns
|
|
462
|
+
columns: options.columns,
|
|
463
|
+
matchSorter: matchSorter
|
|
457
464
|
});
|
|
458
465
|
}
|
|
459
466
|
else {
|
|
@@ -469,6 +476,7 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
469
476
|
if (value.length > 0) {
|
|
470
477
|
var arr_3 = __spreadArray([], __read(items), false);
|
|
471
478
|
var arrItems_3 = [];
|
|
479
|
+
/** 搜索 query 值为数组的情况 */
|
|
472
480
|
value.forEach(function (item) {
|
|
473
481
|
arrItems_3 = __spreadArray(__spreadArray([], __read(arrItems_3), false), __read(matchSorter(arr_3, item, {
|
|
474
482
|
keys: [key],
|
|
@@ -504,19 +512,27 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
504
512
|
var exportAsCSV = function (options) {
|
|
505
513
|
if (options === void 0) { options = {}; }
|
|
506
514
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
507
|
-
var items, filename, env, res;
|
|
508
|
-
|
|
509
|
-
|
|
515
|
+
var items, filename, pageField, perPageField, env, ctx, res;
|
|
516
|
+
var _a;
|
|
517
|
+
return __generator(this, function (_b) {
|
|
518
|
+
switch (_b.label) {
|
|
510
519
|
case 0:
|
|
511
520
|
items = options.loadDataOnce ? self.data.itemsRaw : self.data.items;
|
|
512
521
|
filename = options.filename
|
|
513
522
|
? filter(options.filename, options.data, '| raw')
|
|
514
523
|
: 'data';
|
|
515
524
|
if (!options.api) return [3 /*break*/, 2];
|
|
525
|
+
pageField = options.pageField || 'page';
|
|
526
|
+
perPageField = options.perPageField || 'perPage';
|
|
516
527
|
env = getEnv(self);
|
|
517
|
-
|
|
528
|
+
ctx = createObject(self.data, __assign(__assign(__assign({}, self.query), options.data), (_a = {}, _a[pageField] = self.page || 1, _a[perPageField] = self.perPage || 10, _a)));
|
|
529
|
+
return [4 /*yield*/, env.fetcher(options.api, ctx, {
|
|
530
|
+
autoAppend: true,
|
|
531
|
+
pageField: pageField,
|
|
532
|
+
perPageField: perPageField
|
|
533
|
+
})];
|
|
518
534
|
case 1:
|
|
519
|
-
res =
|
|
535
|
+
res = _b.sent();
|
|
520
536
|
if (!res.data) {
|
|
521
537
|
return [2 /*return*/];
|
|
522
538
|
}
|
|
@@ -526,7 +542,7 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
526
542
|
else {
|
|
527
543
|
items = res.data.rows || res.data.items;
|
|
528
544
|
}
|
|
529
|
-
|
|
545
|
+
_b.label = 2;
|
|
530
546
|
case 2:
|
|
531
547
|
import('papaparse').then(function (papaparse) {
|
|
532
548
|
var e_4, _a;
|
package/esm/store/form.d.ts
CHANGED
|
@@ -243,7 +243,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
243
243
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
244
244
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
245
245
|
closeDialog: (result?: any) => void;
|
|
246
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
246
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
247
247
|
changeEmitedValue: (value: any) => void;
|
|
248
248
|
addSubFormItem: (item: {
|
|
249
249
|
id: string;
|
|
@@ -752,7 +752,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
752
752
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
753
753
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
754
754
|
closeDialog: (result?: any) => void;
|
|
755
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
755
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
756
756
|
changeEmitedValue: (value: any) => void;
|
|
757
757
|
addSubFormItem: (item: {
|
|
758
758
|
id: string;
|
|
@@ -1266,7 +1266,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
1266
1266
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
1267
1267
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
1268
1268
|
closeDialog: (result?: any) => void;
|
|
1269
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
1269
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1270
1270
|
changeEmitedValue: (value: any) => void;
|
|
1271
1271
|
addSubFormItem: (item: {
|
|
1272
1272
|
id: string;
|
|
@@ -1775,7 +1775,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
1775
1775
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
1776
1776
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
1777
1777
|
closeDialog: (result?: any) => void;
|
|
1778
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
1778
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
1779
1779
|
changeEmitedValue: (value: any) => void;
|
|
1780
1780
|
addSubFormItem: (item: {
|
|
1781
1781
|
id: string;
|
|
@@ -2293,7 +2293,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
2293
2293
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
2294
2294
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
2295
2295
|
closeDialog: (result?: any) => void;
|
|
2296
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
2296
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2297
2297
|
changeEmitedValue: (value: any) => void;
|
|
2298
2298
|
addSubFormItem: (item: {
|
|
2299
2299
|
id: string;
|
|
@@ -2802,7 +2802,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
2802
2802
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
2803
2803
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
2804
2804
|
closeDialog: (result?: any) => void;
|
|
2805
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
2805
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
2806
2806
|
changeEmitedValue: (value: any) => void;
|
|
2807
2807
|
addSubFormItem: (item: {
|
|
2808
2808
|
id: string;
|
|
@@ -3315,7 +3315,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
3315
3315
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
3316
3316
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
3317
3317
|
closeDialog: (result?: any) => void;
|
|
3318
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
3318
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3319
3319
|
changeEmitedValue: (value: any) => void;
|
|
3320
3320
|
addSubFormItem: (item: {
|
|
3321
3321
|
id: string;
|
|
@@ -3824,7 +3824,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
3824
3824
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
3825
3825
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
3826
3826
|
closeDialog: (result?: any) => void;
|
|
3827
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
3827
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
3828
3828
|
changeEmitedValue: (value: any) => void;
|
|
3829
3829
|
addSubFormItem: (item: {
|
|
3830
3830
|
id: string;
|
|
@@ -4337,7 +4337,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
4337
4337
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
4338
4338
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
4339
4339
|
closeDialog: (result?: any) => void;
|
|
4340
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
4340
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4341
4341
|
changeEmitedValue: (value: any) => void;
|
|
4342
4342
|
addSubFormItem: (item: {
|
|
4343
4343
|
id: string;
|
|
@@ -4846,7 +4846,7 @@ export declare const FormStore: import("mobx-state-tree").IModelType<{
|
|
|
4846
4846
|
resetValidationStatus: (tag?: string | undefined) => void;
|
|
4847
4847
|
openDialog: (schema: any, ctx: any, callback?: ((ret?: any) => void) | undefined) => void;
|
|
4848
4848
|
closeDialog: (result?: any) => void;
|
|
4849
|
-
changeTmpValue: (value: any, changeReason?: "
|
|
4849
|
+
changeTmpValue: (value: any, changeReason?: "input" | "defaultValue" | "initialValue" | "formInited" | "dataChanged" | "formulaChanged" | "controlled" | undefined) => void;
|
|
4850
4850
|
changeEmitedValue: (value: any) => void;
|
|
4851
4851
|
addSubFormItem: (item: {
|
|
4852
4852
|
id: string;
|
package/esm/store/form.js
CHANGED
package/esm/store/formItem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.6.1
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -327,7 +327,7 @@ var FormItemStore = StoreNode.named('FormItemStore')
|
|
|
327
327
|
}
|
|
328
328
|
var validateCancel = null;
|
|
329
329
|
var validate$1 = flow(function validate$1(data, hook, customRules) {
|
|
330
|
-
var json, combo, group;
|
|
330
|
+
var json, err_1, combo, group;
|
|
331
331
|
var _a;
|
|
332
332
|
var _b, _c, _d, _e, _f;
|
|
333
333
|
return __generator(this, function (_g) {
|
|
@@ -345,24 +345,33 @@ var FormItemStore = StoreNode.named('FormItemStore')
|
|
|
345
345
|
_g.label = 2;
|
|
346
346
|
case 2:
|
|
347
347
|
addError(validate(self.tmpValue, data, customRules ? str2rules(customRules) : self.rules, self.messages, self.__));
|
|
348
|
-
if (!(!self.errors.length && isEffectiveApi(self.validateApi, data))) return [3 /*break*/,
|
|
348
|
+
if (!(!self.errors.length && isEffectiveApi(self.validateApi, data))) return [3 /*break*/, 6];
|
|
349
349
|
if (validateCancel) {
|
|
350
350
|
validateCancel();
|
|
351
351
|
validateCancel = null;
|
|
352
352
|
}
|
|
353
|
+
_g.label = 3;
|
|
354
|
+
case 3:
|
|
355
|
+
_g.trys.push([3, 5, , 6]);
|
|
353
356
|
return [4 /*yield*/, getEnv(self).fetcher(self.validateApi,
|
|
354
357
|
/** 如果配置validateApi,需要将用户最新输入同步到数据域内 */
|
|
355
358
|
createObject(data, (_a = {}, _a[self.name] = self.tmpValue, _a)), {
|
|
356
|
-
cancelExecutor: function (executor) {
|
|
359
|
+
cancelExecutor: function (executor) {
|
|
360
|
+
return (validateCancel = executor);
|
|
361
|
+
}
|
|
357
362
|
})];
|
|
358
|
-
case
|
|
363
|
+
case 4:
|
|
359
364
|
json = _g.sent();
|
|
360
365
|
validateCancel = null;
|
|
361
366
|
if (!json.ok && json.status === 422 && json.errors) {
|
|
362
367
|
addError(String((_d = (_c = (_b = self.validateApi) === null || _b === void 0 ? void 0 : _b.messages) === null || _c === void 0 ? void 0 : _c.failed) !== null && _d !== void 0 ? _d : (json.errors || json.msg || "\u8868\u5355\u9879\u300C".concat(self.name, "\u300D\u6821\u9A8C\u5931\u8D25"))));
|
|
363
368
|
}
|
|
364
|
-
|
|
365
|
-
case
|
|
369
|
+
return [3 /*break*/, 6];
|
|
370
|
+
case 5:
|
|
371
|
+
err_1 = _g.sent();
|
|
372
|
+
addError(String(err_1));
|
|
373
|
+
return [3 /*break*/, 6];
|
|
374
|
+
case 6:
|
|
366
375
|
self.validated = true;
|
|
367
376
|
if (self.unique && ((_f = (_e = self.form) === null || _e === void 0 ? void 0 : _e.parentStore) === null || _f === void 0 ? void 0 : _f.storeType) === 'ComboStore') {
|
|
368
377
|
combo = self.form.parentStore;
|
package/esm/store/iRenderer.js
CHANGED
package/esm/store/index.js
CHANGED
package/esm/store/list.js
CHANGED
package/esm/store/manager.js
CHANGED
package/esm/store/modal.js
CHANGED
package/esm/store/node.js
CHANGED
package/esm/store/pagination.js
CHANGED
package/esm/store/root.js
CHANGED
package/esm/store/service.js
CHANGED
package/esm/store/status.js
CHANGED