amis-core 3.6.4 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +3 -2
- package/esm/SchemaRenderer.js +4 -1
- package/esm/Scoped.d.ts +6 -0
- package/esm/Scoped.js +45 -7
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +3 -5
- package/esm/actions/Action.js +31 -27
- 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 +65 -26
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +4 -3
- 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 +9 -4
- 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 +1 -1
- package/esm/components/CustomStyle.d.ts +1 -2
- package/esm/components/CustomStyle.js +19 -6
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +12 -9
- package/esm/components/PopOver.js +8 -5
- package/esm/env.d.ts +4 -0
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +14 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +14 -7
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +4 -3
- package/esm/renderers/Form.js +216 -150
- package/esm/renderers/Item.d.ts +1 -0
- package/esm/renderers/Item.js +17 -17
- package/esm/renderers/Options.d.ts +5 -0
- package/esm/renderers/Options.js +188 -57
- 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 +39 -30
- package/esm/store/app.d.ts +2 -2
- package/esm/store/app.js +4 -3
- package/esm/store/combo.d.ts +79 -55
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +3 -2
- package/esm/store/crud.js +18 -4
- package/esm/store/form.d.ts +33 -23
- package/esm/store/form.js +5 -5
- package/esm/store/formItem.d.ts +2 -1
- package/esm/store/formItem.js +3 -2
- package/esm/store/iRenderer.d.ts +1 -1
- package/esm/store/iRenderer.js +10 -3
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -1
- package/esm/store/list.js +18 -13
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +2 -2
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +2 -1
- package/esm/store/pagination.js +3 -2
- package/esm/store/root.d.ts +2 -2
- package/esm/store/root.js +4 -3
- package/esm/store/service.d.ts +2 -2
- package/esm/store/service.js +11 -7
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +69 -47
- package/esm/store/table.js +54 -25
- package/esm/store/table2.d.ts +14 -3
- package/esm/store/table2.js +22 -9
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +7 -0
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.js +1 -1
- 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.d.ts +1 -0
- package/esm/utils/browser.js +11 -0
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.d.ts +8 -0
- package/esm/utils/concatData.js +39 -0
- 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 +14 -2
- package/esm/utils/helper.js +49 -14
- package/esm/utils/highlight.js +3 -2
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.d.ts +1 -0
- package/esm/utils/labelToString.js +38 -0
- 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 +19 -3
- package/esm/utils/replaceText.js +9 -11
- 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.d.ts +1 -1
- package/esm/utils/string2regExp.js +4 -3
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.d.ts +24 -5
- package/esm/utils/style-helper.js +49 -21
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.d.ts +1 -0
- package/esm/utils/tokenize.js +10 -3
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +6 -8
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.d.ts +16 -0
- package/esm/utils/validateId.js +154 -0
- package/esm/utils/validations.js +16 -8
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +3 -2
- package/lib/SchemaRenderer.js +4 -1
- package/lib/Scoped.d.ts +6 -0
- package/lib/Scoped.js +45 -6
- package/lib/StatusScoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +3 -5
- package/lib/actions/Action.js +31 -27
- 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 +65 -26
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +4 -3
- 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 +9 -4
- 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 +1 -1
- package/lib/components/CustomStyle.d.ts +1 -2
- package/lib/components/CustomStyle.js +19 -6
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +11 -8
- package/lib/components/PopOver.js +8 -5
- package/lib/env.d.ts +4 -0
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +14 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +19 -4
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +4 -3
- package/lib/renderers/Form.js +216 -150
- package/lib/renderers/Item.d.ts +1 -0
- package/lib/renderers/Item.js +17 -17
- package/lib/renderers/Options.d.ts +5 -0
- package/lib/renderers/Options.js +188 -57
- 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 +38 -29
- package/lib/store/app.d.ts +2 -2
- package/lib/store/app.js +4 -3
- package/lib/store/combo.d.ts +55 -31
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +3 -2
- package/lib/store/crud.js +18 -4
- package/lib/store/form.d.ts +23 -13
- package/lib/store/form.js +5 -5
- package/lib/store/formItem.d.ts +2 -1
- package/lib/store/formItem.js +3 -2
- package/lib/store/iRenderer.d.ts +1 -1
- package/lib/store/iRenderer.js +10 -3
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -1
- package/lib/store/list.js +18 -14
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +2 -2
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +2 -1
- package/lib/store/pagination.js +3 -2
- package/lib/store/root.d.ts +2 -2
- package/lib/store/root.js +4 -3
- package/lib/store/service.d.ts +2 -2
- package/lib/store/service.js +11 -7
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +49 -27
- package/lib/store/table.js +54 -26
- package/lib/store/table2.d.ts +14 -3
- package/lib/store/table2.js +22 -9
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +7 -0
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.js +1 -1
- 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.d.ts +1 -0
- package/lib/utils/browser.js +15 -0
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.d.ts +8 -0
- package/lib/utils/concatData.js +43 -0
- 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 +14 -2
- package/lib/utils/helper.js +50 -12
- package/lib/utils/highlight.js +3 -2
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.d.ts +1 -0
- package/lib/utils/labelToString.js +46 -0
- 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 +19 -3
- package/lib/utils/replaceText.js +8 -14
- 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.d.ts +1 -1
- package/lib/utils/string2regExp.js +4 -3
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.d.ts +24 -5
- package/lib/utils/style-helper.js +49 -21
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.d.ts +1 -0
- package/lib/utils/tokenize.js +10 -2
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +5 -7
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.d.ts +16 -0
- package/lib/utils/validateId.js +160 -0
- package/lib/utils/validations.js +16 -8
- package/package.json +4 -3
- package/LICENSE +0 -201
package/lib/store/table.d.ts
CHANGED
|
@@ -300,6 +300,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
300
300
|
formsRef: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
301
301
|
maxKeepItemSelectionLength: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
302
302
|
keepItemSelectionOnPageChange: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
303
|
+
maxItemSelectionLength: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
303
304
|
exportExcelLoading: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
304
305
|
searchFormExpanded: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
305
306
|
lazyRenderAfter: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
@@ -323,7 +324,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
323
324
|
setTopStore(value: any): void;
|
|
324
325
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
325
326
|
reset(): void;
|
|
326
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
327
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
327
328
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
328
329
|
setCurrentAction(action: object): void;
|
|
329
330
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -333,6 +334,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
333
334
|
getDialogScoped(): import("..").IScopedContext | null;
|
|
334
335
|
getDrawerScoped(): import("..").IScopedContext | null;
|
|
335
336
|
} & {
|
|
337
|
+
getSelectionUpperLimit: () => number;
|
|
336
338
|
readonly columnsData: ({
|
|
337
339
|
label: any;
|
|
338
340
|
type: string;
|
|
@@ -455,7 +457,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
455
457
|
setTopStore(value: any): void;
|
|
456
458
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
457
459
|
reset(): void;
|
|
458
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
460
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
459
461
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
460
462
|
setCurrentAction(action: object): void;
|
|
461
463
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -472,7 +474,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
472
474
|
markBusying: (busying?: boolean) => void;
|
|
473
475
|
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
474
476
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
475
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
477
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
476
478
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
477
479
|
clearMessage: () => void;
|
|
478
480
|
setHasRemoteData: () => void;
|
|
@@ -572,7 +574,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
572
574
|
} & {
|
|
573
575
|
focus: () => void;
|
|
574
576
|
blur: () => void;
|
|
575
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
577
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
578
|
+
name?: string | undefined;
|
|
576
579
|
extraName?: string | undefined;
|
|
577
580
|
required?: boolean | undefined;
|
|
578
581
|
unique?: boolean | undefined;
|
|
@@ -1081,7 +1084,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
1081
1084
|
} & {
|
|
1082
1085
|
focus: () => void;
|
|
1083
1086
|
blur: () => void;
|
|
1084
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1087
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1088
|
+
name?: string | undefined;
|
|
1085
1089
|
extraName?: string | undefined;
|
|
1086
1090
|
required?: boolean | undefined;
|
|
1087
1091
|
unique?: boolean | undefined;
|
|
@@ -1594,7 +1598,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
1594
1598
|
} & {
|
|
1595
1599
|
focus: () => void;
|
|
1596
1600
|
blur: () => void;
|
|
1597
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1601
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1602
|
+
name?: string | undefined;
|
|
1598
1603
|
extraName?: string | undefined;
|
|
1599
1604
|
required?: boolean | undefined;
|
|
1600
1605
|
unique?: boolean | undefined;
|
|
@@ -2103,7 +2108,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
2103
2108
|
} & {
|
|
2104
2109
|
focus: () => void;
|
|
2105
2110
|
blur: () => void;
|
|
2106
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2111
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2112
|
+
name?: string | undefined;
|
|
2107
2113
|
extraName?: string | undefined;
|
|
2108
2114
|
required?: boolean | undefined;
|
|
2109
2115
|
unique?: boolean | undefined;
|
|
@@ -2621,7 +2627,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
2621
2627
|
} & {
|
|
2622
2628
|
focus: () => void;
|
|
2623
2629
|
blur: () => void;
|
|
2624
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2630
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2631
|
+
name?: string | undefined;
|
|
2625
2632
|
extraName?: string | undefined;
|
|
2626
2633
|
required?: boolean | undefined;
|
|
2627
2634
|
unique?: boolean | undefined;
|
|
@@ -3130,7 +3137,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
3130
3137
|
} & {
|
|
3131
3138
|
focus: () => void;
|
|
3132
3139
|
blur: () => void;
|
|
3133
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3140
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3141
|
+
name?: string | undefined;
|
|
3134
3142
|
extraName?: string | undefined;
|
|
3135
3143
|
required?: boolean | undefined;
|
|
3136
3144
|
unique?: boolean | undefined;
|
|
@@ -3643,7 +3651,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
3643
3651
|
} & {
|
|
3644
3652
|
focus: () => void;
|
|
3645
3653
|
blur: () => void;
|
|
3646
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3654
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3655
|
+
name?: string | undefined;
|
|
3647
3656
|
extraName?: string | undefined;
|
|
3648
3657
|
required?: boolean | undefined;
|
|
3649
3658
|
unique?: boolean | undefined;
|
|
@@ -4152,7 +4161,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
4152
4161
|
} & {
|
|
4153
4162
|
focus: () => void;
|
|
4154
4163
|
blur: () => void;
|
|
4155
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4164
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4165
|
+
name?: string | undefined;
|
|
4156
4166
|
extraName?: string | undefined;
|
|
4157
4167
|
required?: boolean | undefined;
|
|
4158
4168
|
unique?: boolean | undefined;
|
|
@@ -4665,7 +4675,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
4665
4675
|
} & {
|
|
4666
4676
|
focus: () => void;
|
|
4667
4677
|
blur: () => void;
|
|
4668
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4678
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4679
|
+
name?: string | undefined;
|
|
4669
4680
|
extraName?: string | undefined;
|
|
4670
4681
|
required?: boolean | undefined;
|
|
4671
4682
|
unique?: boolean | undefined;
|
|
@@ -5174,7 +5185,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5174
5185
|
} & {
|
|
5175
5186
|
focus: () => void;
|
|
5176
5187
|
blur: () => void;
|
|
5177
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5188
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5189
|
+
name?: string | undefined;
|
|
5178
5190
|
extraName?: string | undefined;
|
|
5179
5191
|
required?: boolean | undefined;
|
|
5180
5192
|
unique?: boolean | undefined;
|
|
@@ -5603,7 +5615,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5603
5615
|
readonly persistKey: string;
|
|
5604
5616
|
} & {
|
|
5605
5617
|
setInited: (value: boolean) => void;
|
|
5606
|
-
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined) => void;
|
|
5618
|
+
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined) => void;
|
|
5607
5619
|
setValueByName: (name: string, value: any, isPristine?: boolean, force?: boolean) => void;
|
|
5608
5620
|
trimValues: () => void;
|
|
5609
5621
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined, throwErrors?: boolean | undefined) => Promise<any>;
|
|
@@ -5689,7 +5701,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5689
5701
|
setTopStore(value: any): void;
|
|
5690
5702
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
5691
5703
|
reset(): void;
|
|
5692
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
5704
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
5693
5705
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
5694
5706
|
setCurrentAction(action: object): void;
|
|
5695
5707
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -5706,7 +5718,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5706
5718
|
markBusying: (busying?: boolean) => void;
|
|
5707
5719
|
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
5708
5720
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
5709
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
5721
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
5710
5722
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
5711
5723
|
clearMessage: () => void;
|
|
5712
5724
|
setHasRemoteData: () => void;
|
|
@@ -5806,7 +5818,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
5806
5818
|
} & {
|
|
5807
5819
|
focus: () => void;
|
|
5808
5820
|
blur: () => void;
|
|
5809
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5821
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5822
|
+
name?: string | undefined;
|
|
5810
5823
|
extraName?: string | undefined;
|
|
5811
5824
|
required?: boolean | undefined;
|
|
5812
5825
|
unique?: boolean | undefined;
|
|
@@ -6315,7 +6328,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
6315
6328
|
} & {
|
|
6316
6329
|
focus: () => void;
|
|
6317
6330
|
blur: () => void;
|
|
6318
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6331
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6332
|
+
name?: string | undefined;
|
|
6319
6333
|
extraName?: string | undefined;
|
|
6320
6334
|
required?: boolean | undefined;
|
|
6321
6335
|
unique?: boolean | undefined;
|
|
@@ -6828,7 +6842,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
6828
6842
|
} & {
|
|
6829
6843
|
focus: () => void;
|
|
6830
6844
|
blur: () => void;
|
|
6831
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6845
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6846
|
+
name?: string | undefined;
|
|
6832
6847
|
extraName?: string | undefined;
|
|
6833
6848
|
required?: boolean | undefined;
|
|
6834
6849
|
unique?: boolean | undefined;
|
|
@@ -7337,7 +7352,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
7337
7352
|
} & {
|
|
7338
7353
|
focus: () => void;
|
|
7339
7354
|
blur: () => void;
|
|
7340
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7355
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7356
|
+
name?: string | undefined;
|
|
7341
7357
|
extraName?: string | undefined;
|
|
7342
7358
|
required?: boolean | undefined;
|
|
7343
7359
|
unique?: boolean | undefined;
|
|
@@ -7855,7 +7871,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
7855
7871
|
} & {
|
|
7856
7872
|
focus: () => void;
|
|
7857
7873
|
blur: () => void;
|
|
7858
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7874
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7875
|
+
name?: string | undefined;
|
|
7859
7876
|
extraName?: string | undefined;
|
|
7860
7877
|
required?: boolean | undefined;
|
|
7861
7878
|
unique?: boolean | undefined;
|
|
@@ -8364,7 +8381,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
8364
8381
|
} & {
|
|
8365
8382
|
focus: () => void;
|
|
8366
8383
|
blur: () => void;
|
|
8367
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8384
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8385
|
+
name?: string | undefined;
|
|
8368
8386
|
extraName?: string | undefined;
|
|
8369
8387
|
required?: boolean | undefined;
|
|
8370
8388
|
unique?: boolean | undefined;
|
|
@@ -8877,7 +8895,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
8877
8895
|
} & {
|
|
8878
8896
|
focus: () => void;
|
|
8879
8897
|
blur: () => void;
|
|
8880
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8898
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8899
|
+
name?: string | undefined;
|
|
8881
8900
|
extraName?: string | undefined;
|
|
8882
8901
|
required?: boolean | undefined;
|
|
8883
8902
|
unique?: boolean | undefined;
|
|
@@ -9386,7 +9405,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
9386
9405
|
} & {
|
|
9387
9406
|
focus: () => void;
|
|
9388
9407
|
blur: () => void;
|
|
9389
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9408
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9409
|
+
name?: string | undefined;
|
|
9390
9410
|
extraName?: string | undefined;
|
|
9391
9411
|
required?: boolean | undefined;
|
|
9392
9412
|
unique?: boolean | undefined;
|
|
@@ -9899,7 +9919,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
9899
9919
|
} & {
|
|
9900
9920
|
focus: () => void;
|
|
9901
9921
|
blur: () => void;
|
|
9902
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9922
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9923
|
+
name?: string | undefined;
|
|
9903
9924
|
extraName?: string | undefined;
|
|
9904
9925
|
required?: boolean | undefined;
|
|
9905
9926
|
unique?: boolean | undefined;
|
|
@@ -10408,7 +10429,8 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
10408
10429
|
} & {
|
|
10409
10430
|
focus: () => void;
|
|
10410
10431
|
blur: () => void;
|
|
10411
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10432
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10433
|
+
name?: string | undefined;
|
|
10412
10434
|
extraName?: string | undefined;
|
|
10413
10435
|
required?: boolean | undefined;
|
|
10414
10436
|
unique?: boolean | undefined;
|
|
@@ -10837,7 +10859,7 @@ export declare const TableStore: import("mobx-state-tree").IModelType<{
|
|
|
10837
10859
|
readonly persistKey: string;
|
|
10838
10860
|
} & {
|
|
10839
10861
|
setInited: (value: boolean) => void;
|
|
10840
|
-
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined) => void;
|
|
10862
|
+
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined) => void;
|
|
10841
10863
|
setValueByName: (name: string, value: any, isPristine?: boolean, force?: boolean) => void;
|
|
10842
10864
|
trimValues: () => void;
|
|
10843
10865
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined, throwErrors?: boolean | undefined) => Promise<any>;
|
package/lib/store/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v6.1.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -18,7 +18,6 @@ var resolveVariableAndFilter = require('../utils/resolveVariableAndFilter.js');
|
|
|
18
18
|
require('lodash/isPlainObject');
|
|
19
19
|
require('../utils/filter.js');
|
|
20
20
|
var isEqual = require('lodash/isEqual');
|
|
21
|
-
var find = require('lodash/find');
|
|
22
21
|
var sortBy = require('lodash/sortBy');
|
|
23
22
|
var helper = require('../utils/helper.js');
|
|
24
23
|
var tpl = require('../utils/tpl.js');
|
|
@@ -27,7 +26,6 @@ var manager = require('./manager.js');
|
|
|
27
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
27
|
|
|
29
28
|
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
30
|
-
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
31
29
|
var sortBy__default = /*#__PURE__*/_interopDefaultLegacy(sortBy);
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -264,11 +262,9 @@ var Row = mobxStateTree.types
|
|
|
264
262
|
get isCheckAvaiableOnClick() {
|
|
265
263
|
var _a;
|
|
266
264
|
var table = mobxStateTree.getParent(self, self.depth * 2);
|
|
267
|
-
var
|
|
268
|
-
var selectionUpperLimit = table === null || table === void 0 ? void 0 : table.maxKeepItemSelectionLength;
|
|
265
|
+
var selectionUpperLimit = table.getSelectionUpperLimit();
|
|
269
266
|
// 如果未做配置,或者配置不合法直接通过检查
|
|
270
|
-
if (!
|
|
271
|
-
!Number.isInteger(selectionUpperLimit) ||
|
|
267
|
+
if (!Number.isInteger(selectionUpperLimit) ||
|
|
272
268
|
selectionUpperLimit === Infinity) {
|
|
273
269
|
return true;
|
|
274
270
|
}
|
|
@@ -398,6 +394,7 @@ var TableStore = iRenderer.iRendererStore
|
|
|
398
394
|
formsRef: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), []),
|
|
399
395
|
maxKeepItemSelectionLength: Infinity,
|
|
400
396
|
keepItemSelectionOnPageChange: false,
|
|
397
|
+
maxItemSelectionLength: Infinity,
|
|
401
398
|
// 导出 Excel 按钮的 loading 状态
|
|
402
399
|
exportExcelLoading: false,
|
|
403
400
|
searchFormExpanded: false,
|
|
@@ -583,7 +580,17 @@ var TableStore = iRenderer.iRendererStore
|
|
|
583
580
|
function getSearchableColumns() {
|
|
584
581
|
return self.columns.filter(function (column) { return column.searchable; });
|
|
585
582
|
}
|
|
583
|
+
function getSelectionUpperLimit() {
|
|
584
|
+
var keep = self.keepItemSelectionOnPageChange;
|
|
585
|
+
var selectionUpperLimit = keep
|
|
586
|
+
? self.maxKeepItemSelectionLength !== Infinity
|
|
587
|
+
? self.maxKeepItemSelectionLength
|
|
588
|
+
: self.maxItemSelectionLength
|
|
589
|
+
: self.maxItemSelectionLength;
|
|
590
|
+
return selectionUpperLimit;
|
|
591
|
+
}
|
|
586
592
|
return {
|
|
593
|
+
getSelectionUpperLimit: getSelectionUpperLimit,
|
|
587
594
|
get columnsData() {
|
|
588
595
|
return getColumnsExceptBuiltinTypes();
|
|
589
596
|
},
|
|
@@ -616,6 +623,10 @@ var TableStore = iRenderer.iRendererStore
|
|
|
616
623
|
return !!self.selectedRows.length;
|
|
617
624
|
},
|
|
618
625
|
get allChecked() {
|
|
626
|
+
var selectionUpperLimit = getSelectionUpperLimit();
|
|
627
|
+
if (selectionUpperLimit !== Infinity) {
|
|
628
|
+
return self.isSelectionThresholdReached;
|
|
629
|
+
}
|
|
619
630
|
// 只要selectedRows中包含checkableRows中的全部数据,就认为是全选
|
|
620
631
|
return self.checkableRows.every(function (item) {
|
|
621
632
|
return self.selectedRows.includes(item);
|
|
@@ -661,8 +672,8 @@ var TableStore = iRenderer.iRendererStore
|
|
|
661
672
|
get isSelectionThresholdReached() {
|
|
662
673
|
var _a, _b;
|
|
663
674
|
var selectedLength = (_b = (_a = self.data) === null || _a === void 0 ? void 0 : _a.selectedItems) === null || _b === void 0 ? void 0 : _b.length;
|
|
664
|
-
var maxLength =
|
|
665
|
-
if (!self.data ||
|
|
675
|
+
var maxLength = getSelectionUpperLimit();
|
|
676
|
+
if (!self.data || maxLength === Infinity) {
|
|
666
677
|
return false;
|
|
667
678
|
}
|
|
668
679
|
return maxLength <= selectedLength;
|
|
@@ -809,6 +820,8 @@ var TableStore = iRenderer.iRendererStore
|
|
|
809
820
|
config.keepItemSelectionOnPageChange !== undefined &&
|
|
810
821
|
(self.keepItemSelectionOnPageChange =
|
|
811
822
|
config.keepItemSelectionOnPageChange);
|
|
823
|
+
config.maxItemSelectionLength !== undefined &&
|
|
824
|
+
(self.maxItemSelectionLength = config.maxItemSelectionLength);
|
|
812
825
|
config.exportExcelLoading !== undefined &&
|
|
813
826
|
(self.exportExcelLoading = config.exportExcelLoading);
|
|
814
827
|
config.loading !== undefined && (self.loading = config.loading);
|
|
@@ -874,11 +887,18 @@ var TableStore = iRenderer.iRendererStore
|
|
|
874
887
|
className: 'Table-dragCell'
|
|
875
888
|
});
|
|
876
889
|
var originColumns_1 = self.columns.concat();
|
|
890
|
+
var ids_1 = [];
|
|
877
891
|
columns = columns.map(function (item, index) {
|
|
878
892
|
var origin = item.id
|
|
879
893
|
? originColumns_1.find(function (column) { return column.pristine.id === item.id; })
|
|
880
894
|
: originColumns_1[index];
|
|
881
|
-
|
|
895
|
+
var id = (origin === null || origin === void 0 ? void 0 : origin.id) || helper.guid();
|
|
896
|
+
// 还不知道为何会出现这个,先用这种方式避免 id 重复
|
|
897
|
+
if (ids_1.includes(id)) {
|
|
898
|
+
id = helper.guid();
|
|
899
|
+
}
|
|
900
|
+
ids_1.push(id);
|
|
901
|
+
return tslib.__assign(tslib.__assign({}, item), { id: id, index: index, width: (origin === null || origin === void 0 ? void 0 : origin.width) || 0, minWidth: (origin === null || origin === void 0 ? void 0 : origin.minWidth) || 0, realWidth: (origin === null || origin === void 0 ? void 0 : origin.realWidth) || 0, rawIndex: index - PARTITION_INDEX, type: item.type || 'plain', pristine: item.pristine || item, toggled: item.toggled !== false, breakpoint: item.breakpoint, isPrimary: index === PARTITION_INDEX });
|
|
882
902
|
});
|
|
883
903
|
self.columns.replace(columns);
|
|
884
904
|
}
|
|
@@ -1121,26 +1141,33 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1121
1141
|
}
|
|
1122
1142
|
function updateSelected(selected, valueField) {
|
|
1123
1143
|
self.selectedRows.clear();
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1144
|
+
selected.forEach(function (item) {
|
|
1145
|
+
var resolved = helper.findTree(self.rows, function (a) { return a.pristine === item; });
|
|
1146
|
+
// 先严格比较,
|
|
1147
|
+
if (!resolved) {
|
|
1148
|
+
resolved = helper.findTree(self.rows, function (a) {
|
|
1149
|
+
var selectValue = item[valueField || 'value'];
|
|
1150
|
+
var itemValue = a.pristine[valueField || 'value'];
|
|
1151
|
+
return selectValue === itemValue;
|
|
1152
|
+
});
|
|
1127
1153
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1154
|
+
// 再宽松比较
|
|
1155
|
+
if (!resolved) {
|
|
1156
|
+
resolved = helper.findTree(self.rows, function (a) {
|
|
1157
|
+
var selectValue = item[valueField || 'value'];
|
|
1158
|
+
var itemValue = a.pristine[valueField || 'value'];
|
|
1159
|
+
return selectValue == itemValue;
|
|
1160
|
+
});
|
|
1133
1161
|
}
|
|
1162
|
+
resolved && self.selectedRows.push(resolved);
|
|
1134
1163
|
});
|
|
1135
1164
|
updateCheckDisable();
|
|
1136
1165
|
}
|
|
1137
1166
|
function getSelectedRows() {
|
|
1138
1167
|
var _a;
|
|
1139
|
-
var maxLength = self.
|
|
1140
|
-
var keep = self.keepItemSelectionOnPageChange;
|
|
1168
|
+
var maxLength = self.getSelectionUpperLimit();
|
|
1141
1169
|
var selectedItems = (_a = self.data) === null || _a === void 0 ? void 0 : _a.selectedItems;
|
|
1142
|
-
if (
|
|
1143
|
-
maxLength &&
|
|
1170
|
+
if (maxLength !== Infinity &&
|
|
1144
1171
|
selectedItems &&
|
|
1145
1172
|
maxLength >= selectedItems.length) {
|
|
1146
1173
|
var restCheckableRows = self.checkableRows.filter(function (item) { return !item.checked; });
|
|
@@ -1255,10 +1282,10 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1255
1282
|
if (!self.data) {
|
|
1256
1283
|
return;
|
|
1257
1284
|
}
|
|
1258
|
-
var maxLength = self.
|
|
1285
|
+
var maxLength = self.getSelectionUpperLimit();
|
|
1259
1286
|
var selectedItems = self.data.selectedItems;
|
|
1260
1287
|
self.selectedRows.map(function (item) { return item.setCheckdisable(false); });
|
|
1261
|
-
if (maxLength && maxLength <= selectedItems.length) {
|
|
1288
|
+
if (maxLength !== Infinity && maxLength <= selectedItems.length) {
|
|
1262
1289
|
self.unSelectedRows.map(function (item) { return !item.checked && item.setCheckdisable(true); });
|
|
1263
1290
|
}
|
|
1264
1291
|
else {
|
|
@@ -1397,10 +1424,11 @@ var TableStore = iRenderer.iRendererStore
|
|
|
1397
1424
|
}
|
|
1398
1425
|
function getPersistDataKey(columns) {
|
|
1399
1426
|
// 这里的columns使用除了__开头的所有列
|
|
1400
|
-
// sort保证存储和读取的key值保持一致
|
|
1401
1427
|
return (location.pathname +
|
|
1402
1428
|
self.path +
|
|
1403
|
-
|
|
1429
|
+
// 不能 sort 因为原始列的顺序设计器是可能改变的,此时如果缓存了打开会失效
|
|
1430
|
+
// 还是缓存的顺序,不符合用户调整列顺序的预期
|
|
1431
|
+
columns.map(function (item, index) { return item.name || item.label || index; }).join('-'));
|
|
1404
1432
|
}
|
|
1405
1433
|
function setSearchFormExpanded(value) {
|
|
1406
1434
|
self.searchFormExpanded = !!value;
|
package/lib/store/table2.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Api, fetchOptions } from '../types';
|
|
|
3
3
|
import { IFormStore } from './form';
|
|
4
4
|
export declare const Column: import("mobx-state-tree").IModelType<{
|
|
5
5
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
6
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
6
7
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
7
8
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
8
9
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -73,6 +74,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
73
74
|
} & {
|
|
74
75
|
columns: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
75
76
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
77
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
76
78
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
77
79
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
78
80
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -142,6 +144,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
142
144
|
dragging: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
143
145
|
rowSelectionKeyField: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
144
146
|
formsRef: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
147
|
+
canAccessSuperData: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
145
148
|
}, {
|
|
146
149
|
readonly parentStore: any;
|
|
147
150
|
readonly __: any;
|
|
@@ -160,7 +163,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
160
163
|
setTopStore(value: any): void;
|
|
161
164
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
162
165
|
reset(): void;
|
|
163
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
166
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
164
167
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
165
168
|
setCurrentAction(action: object): void;
|
|
166
169
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -177,7 +180,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
177
180
|
markBusying: (busying?: boolean) => void;
|
|
178
181
|
fetchInitData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
|
|
179
182
|
fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
|
|
180
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
183
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
181
184
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
182
185
|
clearMessage: () => void;
|
|
183
186
|
setHasRemoteData: () => void;
|
|
@@ -188,6 +191,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
188
191
|
readonly toggable: boolean;
|
|
189
192
|
readonly columnsData: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IModelType<{
|
|
190
193
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
194
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
191
195
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
192
196
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
193
197
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -201,6 +205,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
201
205
|
setToggled(value: boolean): void;
|
|
202
206
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
203
207
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
208
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
204
209
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
205
210
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
206
211
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -215,6 +220,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
215
220
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
216
221
|
readonly toggableColumns: ({
|
|
217
222
|
title: any;
|
|
223
|
+
label: any;
|
|
218
224
|
name: string;
|
|
219
225
|
toggled: boolean;
|
|
220
226
|
breakpoint: any;
|
|
@@ -228,6 +234,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
228
234
|
setToggled(value: boolean): void;
|
|
229
235
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
230
236
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
237
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
231
238
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
232
239
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
233
240
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -243,6 +250,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
243
250
|
readonly filteredColumns: any[];
|
|
244
251
|
readonly activeToggaleColumns: ({
|
|
245
252
|
title: any;
|
|
253
|
+
label: any;
|
|
246
254
|
name: string;
|
|
247
255
|
toggled: boolean;
|
|
248
256
|
breakpoint: any;
|
|
@@ -256,6 +264,7 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
256
264
|
setToggled(value: boolean): void;
|
|
257
265
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
258
266
|
title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
267
|
+
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
259
268
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
260
269
|
toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
261
270
|
breakpoint: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
@@ -507,7 +516,9 @@ export declare const TableStore2: import("mobx-state-tree").IModelType<{
|
|
|
507
516
|
reset(): void;
|
|
508
517
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
509
518
|
} & {
|
|
510
|
-
update: (config: Partial<STableStore2
|
|
519
|
+
update: (config: Partial<STableStore2>, options?: {
|
|
520
|
+
resolveDefinitions?: ((ref: string) => any) | undefined;
|
|
521
|
+
} | undefined) => void;
|
|
511
522
|
persistSaveToggledColumns: () => void;
|
|
512
523
|
setOrderByInfo: (key: string, direction: 'asc' | 'desc') => void;
|
|
513
524
|
updateQuery: (values: object, updater?: Function, pageNoField?: string, pageSizeField?: string, replace?: boolean) => void;
|