@aplus-frontend/ui 7.18.0 → 7.19.0-beta.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/es/src/ag-grid/context.mjs +1 -1
- package/es/src/ag-grid/editable/form-item.vue.d.ts +4 -2
- package/es/src/ag-grid/editable/index.vue.d.ts +4 -2
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.d.ts +4 -2
- package/es/src/ag-grid/index.vue.mjs +1 -1
- package/es/src/ap-field/cascader/use-options.d.ts +4 -4
- package/es/src/ap-field/date/index.vue.d.ts +1 -0
- package/es/src/ap-field/date-range/index.vue.d.ts +1 -0
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/text/password.vue.d.ts +4 -4
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +2 -1
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -3
- package/es/src/ap-form/item/index.vue.d.ts +6 -6
- package/es/src/ap-form/item-group/helper.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.d.ts +11 -9
- package/es/src/ap-form/items/date-range/index.vue.d.ts +15 -13
- package/es/src/ap-form/items/number/index.vue.d.ts +3 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/es/src/ap-form/modal-form/index.vue.d.ts +4 -3
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.d.ts +4 -3
- package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/es/src/ap-grid/index.vue.d.ts +4 -2
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-list/index.vue.d.ts +4 -2
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
- package/es/src/ap-table/ap-table.vue.d.ts +4 -2
- package/es/src/ap-table/components/setting/context.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
- package/es/src/ap-table/constants.d.ts +22 -20
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +7 -7
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-download/hooks/index.mjs +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +3 -1
- package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/es/src/business/ap-keep-alive/hook.mjs +1 -1
- package/es/src/business/ap-keep-alive/utils.mjs +1 -1
- package/es/src/business/ap-select-layout/index.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/es/src/business/ap-table-modal/index.d.ts +5 -17
- package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/business/ap-value-select-card/index.vue.d.ts +4 -2
- package/es/src/business/ap-view/ap-view.vue.d.ts +5 -0
- package/es/src/business/ap-view/ap-view.vue2.mjs +142 -122
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
- package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
- package/es/src/business/ap-view/hooks/use-send-to-url.mjs +38 -0
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/index.d.ts +13 -0
- package/es/src/business/ap-view/interface.d.ts +10 -0
- package/es/src/business/ap-view/utils/query.d.ts +4 -0
- package/es/src/business/ap-view/utils/query.mjs +26 -0
- package/es/src/check-card/context.mjs +1 -1
- package/es/src/config-provider/constants.mjs +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +1 -1
- package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
- package/es/src/config-provider/hooks/use-token.mjs +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +4 -2
- package/es/src/editable-table/index.vue.d.ts +4 -2
- package/es/src/editable-table/utils.mjs +1 -1
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/text/context.mjs +1 -1
- package/es/src/time-ago/useTimeAgo.mjs +1 -1
- package/es/src/utils/slot.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.d.ts +4 -2
- package/lib/src/ag-grid/editable/index.vue.d.ts +4 -2
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +4 -2
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/use-options.d.ts +4 -4
- package/lib/src/ap-field/date/index.vue.d.ts +1 -0
- package/lib/src/ap-field/date-range/index.vue.d.ts +1 -0
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/text/password.vue.d.ts +4 -4
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -3
- package/lib/src/ap-form/item/index.vue.d.ts +6 -6
- package/lib/src/ap-form/items/date/index.vue.d.ts +11 -9
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +15 -13
- package/lib/src/ap-form/items/number/index.vue.d.ts +3 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -3
- package/lib/src/ap-form/search-form/index.vue.d.ts +4 -3
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +4 -2
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
- package/lib/src/ap-table/constants.d.ts +22 -20
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/lib/src/business/ap-select-layout/index.d.ts +4 -2
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/lib/src/business/ap-table-modal/index.d.ts +5 -17
- package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/business/ap-value-select-card/index.vue.d.ts +4 -2
- package/lib/src/business/ap-view/ap-view.vue.d.ts +5 -0
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
- package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
- package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -0
- package/lib/src/business/ap-view/index.d.ts +13 -0
- package/lib/src/business/ap-view/interface.d.ts +10 -0
- package/lib/src/business/ap-view/utils/query.d.ts +4 -0
- package/lib/src/business/ap-view/utils/query.js +1 -0
- package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/lib/src/editable-table/form-item.vue.d.ts +4 -2
- package/lib/src/editable-table/index.vue.d.ts +4 -2
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -11,19 +11,21 @@ import { VueNode, CustomSlotsType } from '@aplus-frontend/antdv/es/_util/type';
|
|
|
11
11
|
import { AlignType } from '@aplus-frontend/antdv/es/vc-align/interface';
|
|
12
12
|
import { DateRender } from '@aplus-frontend/antdv/es/vc-picker/panels/DatePanel/DateBody';
|
|
13
13
|
import { MonthCellRender } from '@aplus-frontend/antdv/es/vc-picker/panels/MonthPanel/MonthBody';
|
|
14
|
-
import { PanelMode, RangeValue, OnPanelChange, PresetDate,
|
|
14
|
+
import { PanelMode, RangeValue, OnPanelChange, PresetDate, DisabledTime, CustomFormat, PickerMode, EventValue, DisabledTimes } from '@aplus-frontend/antdv/es/vc-picker/interface';
|
|
15
15
|
import { SharedTimeProps } from '@aplus-frontend/antdv/es/vc-picker/panels/TimePanel';
|
|
16
16
|
import { LiteralUnion, Recordable } from '../type';
|
|
17
17
|
import { ApFormatPresetType } from '../ap-field/date/interface';
|
|
18
|
+
import { DatePickerProps, InputNumberProps, RadioChangeEvent, SelectProps, CheckboxOptionType, CheckboxGroupProps, TreeSelectProps, CascaderProps } from '@aplus-frontend/antdv';
|
|
18
19
|
import { ZoneAlias } from '@aplus-frontend/utils';
|
|
20
|
+
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
19
21
|
import { OnCleanup } from '@vue/reactivity';
|
|
20
22
|
import { ApFormItemSlots, ApFormItemTextPassword, ApActionGroupProps, GroupActionTypes } from '..';
|
|
21
23
|
import { RangeDateRender, RangeType, RangeInfo } from '@aplus-frontend/antdv/es/vc-picker/RangePicker';
|
|
24
|
+
import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker';
|
|
22
25
|
import { ValueType } from '@aplus-frontend/antdv/es/input-number/src/utils/MiniDecimal';
|
|
23
26
|
import { VueTypeValidableDef, VueTypeDef } from '../../node_modules/vue-types';
|
|
24
27
|
import { RadioGroupChildOption } from '@aplus-frontend/antdv/es/radio/Group';
|
|
25
28
|
import { RadioGroupButtonStyle, RadioGroupOptionType } from '@aplus-frontend/antdv/es/radio/interface';
|
|
26
|
-
import { RadioChangeEvent, CheckboxOptionType, TreeSelectProps, CascaderProps } from '@aplus-frontend/antdv';
|
|
27
29
|
import { SelectValue, DefaultOptionType, LabeledValue, BaseOptionType } from '@aplus-frontend/antdv/es/select';
|
|
28
30
|
import { SelectHandler, FieldNames, FilterFunc } from '@aplus-frontend/antdv/es/vc-select/Select';
|
|
29
31
|
import { RenderDOMFunc, CustomTagProps, DropdownRender, DisplayValueType, Placement } from '@aplus-frontend/antdv/es/vc-select/BaseSelect';
|
|
@@ -81,7 +83,7 @@ export declare const apTableFormItemMap: {
|
|
|
81
83
|
readonly onSelect?: ((value: Dayjs) => void) | undefined;
|
|
82
84
|
readonly open?: boolean | undefined;
|
|
83
85
|
readonly disabled?: boolean | undefined;
|
|
84
|
-
readonly direction?: "ltr" | "rtl" | undefined;
|
|
86
|
+
readonly direction?: ("ltr" | "rtl") | undefined;
|
|
85
87
|
readonly placeholder?: string | undefined;
|
|
86
88
|
readonly id?: string | undefined;
|
|
87
89
|
readonly getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
@@ -118,19 +120,19 @@ export declare const apTableFormItemMap: {
|
|
|
118
120
|
readonly showToday?: boolean | undefined;
|
|
119
121
|
readonly showTime?: boolean | SharedTimeProps<Dayjs> | undefined;
|
|
120
122
|
readonly valueFormat?: string | undefined;
|
|
121
|
-
readonly value?: number | null | undefined;
|
|
123
|
+
readonly value?: (number | null) | undefined;
|
|
122
124
|
readonly defaultValue?: number | undefined;
|
|
123
125
|
readonly 'onUpdate:value'?: (((ts: number | null) => void) & ((...args: any[]) => any)) | undefined;
|
|
124
126
|
readonly onChange?: ((ts: number | null, dayStr: string) => void) | undefined;
|
|
125
127
|
readonly onOk?: ((ts: number | null) => void) | undefined;
|
|
126
128
|
readonly format?: LiteralUnion<ApFormatPresetType, string> | undefined;
|
|
127
|
-
readonly shownFormat?:
|
|
129
|
+
readonly shownFormat?: DatePickerProps["format"];
|
|
128
130
|
readonly formatBegins?: boolean | undefined;
|
|
129
131
|
readonly timezone?: ( ZoneAlias | {
|
|
130
132
|
label?: string;
|
|
131
133
|
value: ZoneAlias;
|
|
132
134
|
}[]) | undefined;
|
|
133
|
-
readonly disabledTime?:
|
|
135
|
+
readonly disabledTime?: SharedTimeProps<Dayjs>["disabledTime"];
|
|
134
136
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
135
137
|
$attrs: {
|
|
136
138
|
[x: string]: unknown;
|
|
@@ -890,8 +892,8 @@ export declare const apTableFormItemMap: {
|
|
|
890
892
|
readonly onMouseup?: MouseEventHandler | undefined;
|
|
891
893
|
readonly open?: boolean | undefined;
|
|
892
894
|
readonly separator?: VueNode;
|
|
893
|
-
readonly disabled?: boolean | [boolean, boolean] | undefined;
|
|
894
|
-
readonly direction?: "ltr" | "rtl" | undefined;
|
|
895
|
+
readonly disabled?: (boolean | [boolean, boolean]) | undefined;
|
|
896
|
+
readonly direction?: ("ltr" | "rtl") | undefined;
|
|
895
897
|
readonly placeholder?: [string, string] | undefined;
|
|
896
898
|
readonly id?: string | undefined;
|
|
897
899
|
readonly getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
@@ -926,7 +928,7 @@ export declare const apTableFormItemMap: {
|
|
|
926
928
|
readonly ranges?: Record<string, [ EventValue<Dayjs>, EventValue<Dayjs>] | (() => [ EventValue<Dayjs>, EventValue<Dayjs>])> | undefined;
|
|
927
929
|
readonly allowEmpty?: [boolean, boolean] | undefined;
|
|
928
930
|
readonly onCalendarChange?: ((values: RangeValue<Dayjs>, formatString: [string, string], info: RangeInfo) => void) | undefined;
|
|
929
|
-
readonly activePickerIndex?: 0 | 1 | undefined;
|
|
931
|
+
readonly activePickerIndex?: (0 | 1) | undefined;
|
|
930
932
|
readonly valueFormat?: string | undefined;
|
|
931
933
|
readonly value?: ( RangeValue<number> | null) | undefined;
|
|
932
934
|
readonly defaultValue?: RangeValue<number> | undefined;
|
|
@@ -934,13 +936,13 @@ export declare const apTableFormItemMap: {
|
|
|
934
936
|
readonly onChange?: ((ts: RangeValue<number> | null, dayStr: [string, string]) => void) | undefined;
|
|
935
937
|
readonly onOk?: ((ts: RangeValue<number>) => void) | undefined;
|
|
936
938
|
readonly format?: LiteralUnion<ApFormatPresetType, string> | undefined;
|
|
937
|
-
readonly shownFormat?:
|
|
939
|
+
readonly shownFormat?: RangePickerProps["format"];
|
|
938
940
|
readonly timezone?: ( ZoneAlias | {
|
|
939
941
|
label?: string;
|
|
940
942
|
value: ZoneAlias;
|
|
941
943
|
}[]) | undefined;
|
|
942
944
|
readonly readModeSeparator?: any;
|
|
943
|
-
readonly presets?:
|
|
945
|
+
readonly presets?: RangePickerProps["presets"] | true | {
|
|
944
946
|
thisWeek?: boolean;
|
|
945
947
|
lastWeek?: boolean;
|
|
946
948
|
last7Days?: boolean;
|
|
@@ -952,7 +954,7 @@ export declare const apTableFormItemMap: {
|
|
|
952
954
|
lastQuarter?: boolean;
|
|
953
955
|
thisYear?: boolean;
|
|
954
956
|
lastYear?: boolean;
|
|
955
|
-
}
|
|
957
|
+
};
|
|
956
958
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
957
959
|
$attrs: {
|
|
958
960
|
[x: string]: unknown;
|
|
@@ -1786,7 +1788,7 @@ export declare const apTableFormItemMap: {
|
|
|
1786
1788
|
offset: ValueType;
|
|
1787
1789
|
type: "up" | "down";
|
|
1788
1790
|
}) => void) | undefined;
|
|
1789
|
-
readonly inputMode?: "
|
|
1791
|
+
readonly inputMode?: InputNumberProps["mode"];
|
|
1790
1792
|
readonly thousands?: boolean | undefined;
|
|
1791
1793
|
readonly limitDecimalsRetain?: boolean | undefined;
|
|
1792
1794
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -2576,16 +2578,16 @@ export declare const apTableFormItemMap: {
|
|
|
2576
2578
|
readonly showAction?: ("click" | "focus")[] | undefined;
|
|
2577
2579
|
readonly onPopupScroll?: ((e: UIEvent) => void) | undefined;
|
|
2578
2580
|
readonly onInputKeyDown?: ((e: KeyboardEvent) => void) | undefined;
|
|
2579
|
-
readonly request?: ((value?: string, extraParams?: Recordable) => Promise<
|
|
2581
|
+
readonly request?: ((value?: string, extraParams?: Recordable) => Promise< SelectProps["options"]>) | undefined;
|
|
2580
2582
|
readonly multiple?: boolean | undefined;
|
|
2581
|
-
readonly value?:
|
|
2583
|
+
readonly value?: SelectProps["value"];
|
|
2582
2584
|
readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
|
|
2583
|
-
readonly searchMode?: "filter" | "request" | undefined;
|
|
2585
|
+
readonly searchMode?: ("filter" | "request") | undefined;
|
|
2584
2586
|
readonly refetchOnFocus?: boolean | undefined;
|
|
2585
2587
|
readonly fetchOnFocus?: boolean | undefined;
|
|
2586
2588
|
readonly fetchOnOpen?: boolean | undefined;
|
|
2587
|
-
readonly lazy?: boolean | "first-focus" | "first-open" | undefined;
|
|
2588
|
-
readonly addAll?: boolean | number | undefined;
|
|
2589
|
+
readonly lazy?: (boolean | "first-focus" | "first-open") | undefined;
|
|
2590
|
+
readonly addAll?: (boolean | number) | undefined;
|
|
2589
2591
|
readonly params?: Recordable | undefined;
|
|
2590
2592
|
readonly searchDelay?: number | undefined;
|
|
2591
2593
|
readonly allowOnlySelect?: boolean | undefined;
|
|
@@ -3244,7 +3246,7 @@ export declare const apTableFormItemMap: {
|
|
|
3244
3246
|
readonly unCheckedValue?: string | number | boolean | undefined;
|
|
3245
3247
|
readonly 'onUpdate:checked'?: (((checked: string | number | boolean) => void) & ((...args: any[]) => any)) | undefined;
|
|
3246
3248
|
readonly onAction?: ((checked: string | boolean | number, e?: Event) => boolean | Promise<boolean>) | undefined;
|
|
3247
|
-
readonly confirm?: ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig) |
|
|
3249
|
+
readonly confirm?: ApFieldSwitchConfirmConfig | ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig) | undefined;
|
|
3248
3250
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
3249
3251
|
$attrs: {
|
|
3250
3252
|
[x: string]: unknown;
|
|
@@ -4324,7 +4326,7 @@ export declare const apTableFormItemMap: {
|
|
|
4324
4326
|
readonly id?: string | undefined;
|
|
4325
4327
|
readonly prefixCls?: string | undefined;
|
|
4326
4328
|
readonly name?: string | undefined;
|
|
4327
|
-
readonly request?: (() => Promise<
|
|
4329
|
+
readonly request?: (() => Promise< CheckboxGroupProps["options"]>) | undefined;
|
|
4328
4330
|
readonly vertical?: boolean | undefined;
|
|
4329
4331
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
4330
4332
|
$attrs: {
|
|
@@ -117,7 +117,7 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
|
|
|
117
117
|
dataSource: DataType[];
|
|
118
118
|
}>;
|
|
119
119
|
dataSource: ComputedRef<DataType[]>;
|
|
120
|
-
setDataSource: (dataSource?: DataType[]) => void;
|
|
120
|
+
setDataSource: (dataSource?: DataType[], isAgGrid?: boolean) => void;
|
|
121
121
|
getColumnSFConfig: (column: ApColumnType, append?: boolean) => Recordable;
|
|
122
122
|
sortedInfo: Ref<{
|
|
123
123
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),h=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");const N=require("../utils.js"),pe=require("./use-sorted-filtered.js"),he=require("../../config-provider/hooks/use-locale.js"),Se=require("../../config-provider/hooks/use-namespace.js"),G=require("../../utils/is.js"),d=1,x=20,J={defaultCurrent:d,defaultPageSize:x,showLessItems:!1,showTotal:!0};function me(u){return u===!1?{}:u==null||u===!0?J:{...J,...u}}function ze(u){const g={};return u===!1||(u===!0||u==null?(g.current=d,g.pageSize=x):(g.current=u.defaultCurrent||d,g.pageSize=u.defaultPageSize||x)),g}const Pe=({manual:u=!1,request:g,params:y={},defaultData:R=[],formatParams:U,paramsValueTypeMap:V,resetFieldsIgnores:M,filterFields:K,sortFields:Q,namespace:W="ap-table",pagination:p,onClickReset:Z,onAfterRequest:$,defaultSortOrder:S})=>{let w=0,i={};const H=me(p),X=e=>U?U(e):e,m=c.ref(),s=c.reactive(ze(p)),{getColumnSFConfig:Y,setSF:ee,clearAll:te,sortedInfo:I,filteredInfo:O}=pe.useTableSortedAndFiltered(S),{t:z}=he.useLocale(),{b:P}=Se.useNamespace(W),a=c.reactive({total:R.length,records:R,loading:!1}),T=()=>m.value?.apForm?.getFieldsValueTransformed(!0)||{},E=async(e,t)=>{const n=X(e),r=Date.now(),o=t?.cache;w=r,a.loading=!0;try{const l=await g({...c.unref(y),...n});if(w===r){a.total=l.total||l.data?.length||0,o?a.records.push(...l.data||[]):a.records=[...l.data||[]];const F=a.records.length<a.total;t?.onSuccess?.(e,F),a.loading=!1}}catch{w===r&&!o&&(a.records=[],a.total=0),a.loading=!1}finally{$?.(a.records)}},D=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,V&&r){const o=V[n];o&&(t[n]=N.parseFieldValue(o,r))}}),t},ne=async e=>{const t=T(),n={};Object.entries(t).forEach(([r,o])=>{M&&M.indexOf(r)>-1&&(n[r]=o)}),await m.value?.apForm?.resetFields(),m.value?.apForm?.setFieldsValue?.(n),c.nextTick(()=>{e?.()})},b=e=>{i=e;const t=D(e);E(t)},re=e=>{b({...i,...e})};let C,q=!0;function _(){C=void 0,q=!0}const ae=()=>{if(!q)return;const e=C?C+1:2,t={...i,current:e};i=t;const n=D(t);E(n,{cache:!0,onSuccess(r,o){C=r.current,q=o}})},se=()=>h.cloneDeep(i),A=()=>{j(!0),_()},j=(e=!1)=>{const t=T(),n=p!==!1;n&&e&&(s.current=d),b({...t,filter:i.filter,sort:i.sort,current:n?e?d:i.current||s.current:void 0,pageSize:n?i.pageSize||s.pageSize:void 0})},oe=()=>{te(),i.sort={},i.filter={},Z?.(),ne(A),_()},v=()=>{b(i)},ce=e=>{if(p===!1)v();else{const{current:t,pageSize:n}=s,r=a.total-e,o=Math.ceil(r/n),l=t>o?o:t;re({current:l>0?l:1})}},L=(e,t,n)=>{const r=T();s.current=e.current,s.pageSize=e.pageSize,ee(t,n);const o=h.isArray(n)?[...n]:[n],l={};for(const f of o)c.unref(Q)?.includes(f.columnKey||f.field)&&f.order&&(l[N.dataIndexToStr(f.columnKey||f.field)]=f.order);const F={};for(const f of Object.keys(t))c.unref(K)?.includes(f)&&t[f]&&(F[f]=t[f]);const B={...r,filter:F,sort:l,current:e.current,pageSize:e.pageSize};h.isEqualWith(i,B,N.isEqualCustom)||b(B)},k=(e,t=O.value||{},n=I.value||{})=>{const r=e?.current??s.current,o=e?.pageSize??s.pageSize;L({current:r,pageSize:o},t,n,{action:"sort",currentDataSource:[]})};function ie(){return S?{[S.field]:S.order}:{}}c.onMounted(()=>{const e=T(),{current:t,pageSize:n}=s;if(i={current:t,pageSize:n,filter:{},sort:ie(),...e},!u){const r=D(i);E(r)}}),c.watch(()=>c.unref(y),()=>{A()},{deep:!0});const ue=c.computed(()=>{if(a.total===0)return"-";const{current:e,pageSize:t}=s;return`${e}/${Math.ceil(a.total/t)}`});function le(e){if(h.isArray(e)){if(p!==!1){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),h=require("lodash-unified");require("../../config-provider/index.js");require("../../utils/index.js");const N=require("../utils.js"),pe=require("./use-sorted-filtered.js"),he=require("../../config-provider/hooks/use-locale.js"),Se=require("../../config-provider/hooks/use-namespace.js"),G=require("../../utils/is.js"),d=1,x=20,J={defaultCurrent:d,defaultPageSize:x,showLessItems:!1,showTotal:!0};function me(u){return u===!1?{}:u==null||u===!0?J:{...J,...u}}function ze(u){const g={};return u===!1||(u===!0||u==null?(g.current=d,g.pageSize=x):(g.current=u.defaultCurrent||d,g.pageSize=u.defaultPageSize||x)),g}const Pe=({manual:u=!1,request:g,params:y={},defaultData:R=[],formatParams:U,paramsValueTypeMap:V,resetFieldsIgnores:M,filterFields:K,sortFields:Q,namespace:W="ap-table",pagination:p,onClickReset:Z,onAfterRequest:$,defaultSortOrder:S})=>{let w=0,i={};const H=me(p),X=e=>U?U(e):e,m=c.ref(),s=c.reactive(ze(p)),{getColumnSFConfig:Y,setSF:ee,clearAll:te,sortedInfo:I,filteredInfo:O}=pe.useTableSortedAndFiltered(S),{t:z}=he.useLocale(),{b:P}=Se.useNamespace(W),a=c.reactive({total:R.length,records:R,loading:!1}),T=()=>m.value?.apForm?.getFieldsValueTransformed(!0)||{},E=async(e,t)=>{const n=X(e),r=Date.now(),o=t?.cache;w=r,a.loading=!0;try{const l=await g({...c.unref(y),...n});if(w===r){a.total=l.total||l.data?.length||0,o?a.records.push(...l.data||[]):a.records=[...l.data||[]];const F=a.records.length<a.total;t?.onSuccess?.(e,F),a.loading=!1}}catch{w===r&&!o&&(a.records=[],a.total=0),a.loading=!1}finally{$?.(a.records)}},D=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,V&&r){const o=V[n];o&&(t[n]=N.parseFieldValue(o,r))}}),t},ne=async e=>{const t=T(),n={};Object.entries(t).forEach(([r,o])=>{M&&M.indexOf(r)>-1&&(n[r]=o)}),await m.value?.apForm?.resetFields(),m.value?.apForm?.setFieldsValue?.(n),c.nextTick(()=>{e?.()})},b=e=>{i=e;const t=D(e);E(t)},re=e=>{b({...i,...e})};let C,q=!0;function _(){C=void 0,q=!0}const ae=()=>{if(!q)return;const e=C?C+1:2,t={...i,current:e};i=t;const n=D(t);E(n,{cache:!0,onSuccess(r,o){C=r.current,q=o}})},se=()=>h.cloneDeep(i),A=()=>{j(!0),_()},j=(e=!1)=>{const t=T(),n=p!==!1;n&&e&&(s.current=d),b({...t,filter:i.filter,sort:i.sort,current:n?e?d:i.current||s.current:void 0,pageSize:n?i.pageSize||s.pageSize:void 0})},oe=()=>{te(),i.sort={},i.filter={},Z?.(),ne(A),_()},v=()=>{b(i)},ce=e=>{if(p===!1)v();else{const{current:t,pageSize:n}=s,r=a.total-e,o=Math.ceil(r/n),l=t>o?o:t;re({current:l>0?l:1})}},L=(e,t,n)=>{const r=T();s.current=e.current,s.pageSize=e.pageSize,ee(t,n);const o=h.isArray(n)?[...n]:[n],l={};for(const f of o)c.unref(Q)?.includes(f.columnKey||f.field)&&f.order&&(l[N.dataIndexToStr(f.columnKey||f.field)]=f.order);const F={};for(const f of Object.keys(t))c.unref(K)?.includes(f)&&t[f]&&(F[f]=t[f]);const B={...r,filter:F,sort:l,current:e.current,pageSize:e.pageSize};h.isEqualWith(i,B,N.isEqualCustom)||b(B)},k=(e,t=O.value||{},n=I.value||{})=>{const r=e?.current??s.current,o=e?.pageSize??s.pageSize;L({current:r,pageSize:o},t,n,{action:"sort",currentDataSource:[]})};function ie(){return S?{[S.field]:S.order}:{}}c.onMounted(()=>{const e=T(),{current:t,pageSize:n}=s;if(i={current:t,pageSize:n,filter:{},sort:ie(),...e},!u){const r=D(i);E(r)}}),c.watch(()=>c.unref(y),()=>{A()},{deep:!0});const ue=c.computed(()=>{if(a.total===0)return"-";const{current:e,pageSize:t}=s;return`${e}/${Math.ceil(a.total/t)}`});function le(e,t=!1){if(h.isArray(e)){if(p!==!1&&t){const n=s.pageSize*(s.current-1);a.records=e.slice(n,n+s.pageSize)||[];const r=Math.ceil(e.length/s.pageSize);r<s.current&&k({current:r})}else a.records=e;a.total=e.length}}const fe=c.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:n,showSizeChanger:r,pageSizeOptions:o}=H;return{loading:a.loading,pagination:{current:s.current,pageSize:s.pageSize,total:a.total,showSizeChanger:G.isDef(r)?r:!e,showQuickJumper:G.isDef(n)?n:!e,showLessItems:e,size:"default",pageSizeOptions:h.isUndefined(o)?["10","20","50","100"]:o,showTotal:t?l=>c.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",c.createVNode("span",{class:P("pagination-count-text")},[l])," ",z("ap.apTable.pagination.totalLeftSuffix"),c.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",c.createVNode("span",{class:P("pagination-count-text")},[c.unref(ue)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:L,dataSource:a.records}});function ge(e,t=!0){Object.assign(s,e),i.current=e.current,i.pageSize=e.pageSize,t&&v()}function de(){return{...s}}return{formRef:m,submit:A,reset:oe,refresh:v,refreshByDelete:ce,data:a,handleTableChange:L,handleTableChangeOptional:k,tableProps:fe,dataSource:c.computed(()=>a.records),setDataSource:le,getColumnSFConfig:Y,sortedInfo:I,filteredInfo:O,getPaging:de,setPaging:ge,submitWith:j,fetchNextPageAndCache:ae,getLastParams:se}};exports.DEFAULT_CURRENT=d;exports.DEFAULT_PAGE_SIZE=x;exports.useTablePaging=Pe;
|
|
@@ -6,28 +6,28 @@ export declare const useTableTemplateStorage: (columnSetting: ApTableSettingType
|
|
|
6
6
|
columnState: {
|
|
7
7
|
key: string | number;
|
|
8
8
|
show?: boolean | undefined;
|
|
9
|
-
fixed?: "left" | "right" | undefined;
|
|
9
|
+
fixed?: ("left" | "right") | undefined;
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
label?: any;
|
|
12
|
-
children?:
|
|
12
|
+
children?: any[] | undefined;
|
|
13
13
|
order?: number | undefined;
|
|
14
14
|
}[];
|
|
15
15
|
label: string;
|
|
16
16
|
key: string;
|
|
17
|
-
size?: "middle" | "small" | undefined;
|
|
17
|
+
size?: ("middle" | "small") | undefined;
|
|
18
18
|
}[], ApColumnTemplate[] | {
|
|
19
19
|
columnState: {
|
|
20
20
|
key: string | number;
|
|
21
21
|
show?: boolean | undefined;
|
|
22
|
-
fixed?: "left" | "right" | undefined;
|
|
22
|
+
fixed?: ("left" | "right") | undefined;
|
|
23
23
|
disabled?: boolean | undefined;
|
|
24
24
|
label?: any;
|
|
25
|
-
children?:
|
|
25
|
+
children?: any[] | undefined;
|
|
26
26
|
order?: number | undefined;
|
|
27
27
|
}[];
|
|
28
28
|
label: string;
|
|
29
29
|
key: string;
|
|
30
|
-
size?: "middle" | "small" | undefined;
|
|
30
|
+
size?: ("middle" | "small") | undefined;
|
|
31
31
|
}[]>;
|
|
32
32
|
syncTemplateListToStorage: (nextTemplateList: ApColumnTemplate[]) => void;
|
|
33
33
|
addTemplate: (template: ApColumnTemplate) => void;
|
|
@@ -36,14 +36,14 @@ export declare const useTableTemplateStorage: (columnSetting: ApTableSettingType
|
|
|
36
36
|
columnState: {
|
|
37
37
|
key: string | number;
|
|
38
38
|
show?: boolean | undefined;
|
|
39
|
-
fixed?: "left" | "right" | undefined;
|
|
39
|
+
fixed?: ("left" | "right") | undefined;
|
|
40
40
|
disabled?: boolean | undefined;
|
|
41
41
|
label?: any;
|
|
42
|
-
children?:
|
|
42
|
+
children?: any[] | undefined;
|
|
43
43
|
order?: number | undefined;
|
|
44
44
|
}[];
|
|
45
45
|
label: string;
|
|
46
46
|
key: string;
|
|
47
|
-
size?: "middle" | "small" | undefined;
|
|
47
|
+
size?: ("middle" | "small") | undefined;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
@@ -3,8 +3,8 @@ import { ButtonType, ButtonShape, ButtonSize } from '@aplus-frontend/antdv/es/bu
|
|
|
3
3
|
import { ButtonHTMLType, ButtonIconPosition, ButtonVariantType } from '@aplus-frontend/antdv/es/button/buttonTypes';
|
|
4
4
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
5
5
|
import { MouseEventHandler, FocusEventHandler } from '@aplus-frontend/antdv/es/_util/EventInterface';
|
|
6
|
+
import { ButtonProps, ItemType, MenuTheme, MenuMode, TableColumnsType } from '@aplus-frontend/antdv';
|
|
6
7
|
import { DropdownArrowOptions, Trigger, Align } from '@aplus-frontend/antdv/es/dropdown/props';
|
|
7
|
-
import { ItemType, MenuTheme, MenuMode, TableColumnsType, ButtonProps } from '@aplus-frontend/antdv';
|
|
8
8
|
import { Key } from '@aplus-frontend/antdv/es/_util/type';
|
|
9
9
|
import { CSSMotionProps } from '@aplus-frontend/antdv/es/_util/transition';
|
|
10
10
|
import { BuiltinPlacements, TriggerSubMenuAction, SelectEventHandler, MenuClickEventHandler, PopupRender } from '@aplus-frontend/antdv/es/menu/src/interface';
|
|
@@ -72,7 +72,7 @@ declare const ApBatchActionGroup: {
|
|
|
72
72
|
color: PropType<"default" | "blue" | "cyan" | "gold" | "green" | "lime" | "magenta" | "orange" | "pink" | "purple" | "red" | "yellow" | "volcano" | "geekblue" | "danger" | "primary">;
|
|
73
73
|
variant: PropType<ButtonVariantType>;
|
|
74
74
|
}>>, "type" | "onClick"> & {
|
|
75
|
-
type?:
|
|
75
|
+
type?: ButtonProps["type"] | "borderLink";
|
|
76
76
|
borderLinkColor?: string;
|
|
77
77
|
minWidth?: boolean | number | string;
|
|
78
78
|
lazy?: boolean | number;
|
|
@@ -394,7 +394,7 @@ declare const ApBatchActionGroup: {
|
|
|
394
394
|
color: PropType<"default" | "blue" | "cyan" | "gold" | "green" | "lime" | "magenta" | "orange" | "pink" | "purple" | "red" | "yellow" | "volcano" | "geekblue" | "danger" | "primary">;
|
|
395
395
|
variant: PropType<ButtonVariantType>;
|
|
396
396
|
}>>, "type" | "onClick"> & {
|
|
397
|
-
type?:
|
|
397
|
+
type?: ButtonProps["type"] | "borderLink";
|
|
398
398
|
borderLinkColor?: string;
|
|
399
399
|
minWidth?: boolean | number | string;
|
|
400
400
|
lazy?: boolean | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),ee=require("@aplus-frontend/antdv"),w=require("../../utils/warning.js");require("../../config-provider/index.js");const re=require("./constans.js"),te=require("./style/index.js"),E=require("./utils/sortItemsByRowAndCol.js"),oe=require("../../config-provider/hooks/use-namespace.js"),ae=["data-span","data-index","data-row","data-col","data-height","data-module","draggable"],ne=t.defineComponent({__name:"ApDraggableGrid",props:re.ApDraggableGridProps(),emits:["onGridListChange"],setup(_,{expose:J,emit:z}){const c=_,{b:q,e:T,m:j}=oe.useNamespace("ap-draggable-grid"),U=te.default("ap-draggable-grid"),L=t.ref(!1),x=t.ref(!1),M=t.computed(()=>T("item")),H=t.computed(()=>T("dragging")),G=t.computed(()=>T("overlay")),V=t.computed(()=>c.customWrapper?`.${c.customWrapper} .${M.value}:not(.${H.value})`:`.${M.value}:not(.${H.value})`),K=z,g=t.useTemplateRef("gridContainer"),$=t.ref([]);t.watch(()=>c.gridList,e=>{Array.isArray(e)&&i(e)},{deep:!0,immediate:!0});function i(e){const a=[...e].sort((r,u)=>r.row-u.row);$.value=a.map(r=>({...r})),K("onGridListChange",JSON.parse(JSON.stringify($.value)))}const Q=e=>({gridColumn:`${e.col} / span ${e.span}`,gridRow:e.row,minHeight:e.showHeight?e.showHeight+"px":`${c.gridItemHeight}px`,height:e.showHeight?e.showHeight+"px":`${c.gridItemHeight}px`,boxShadow:c.gridItemShadow?c.gridItemShadow:"none"});async function k(){if(i([]),typeof c.request=="function")try{L.value=!0;const e=await c.request();Array.isArray(e)&&i(e),w.warning(Array.isArray(e),"ApDraggableGrid: 请求函数必须返回一个符合 ApDraggableGridItemBase 数组的格式")}catch(e){w.warning(!1,`ApDraggableGrid: 请求错误: ${e}`)}finally{L.value=!1}}let A=t.ref(null),C=t.ref(null),h=null,R=!1,b=null;const F=e=>{if(!R&&(R=!0,e.dataTransfer&&e.target instanceof HTMLElement)){const a=e.target.dataset;e.dataTransfer.setData("text/plain",a.module),e.dataTransfer.effectAllowed="move",A.value={span:Number(a.span),col:Number(a.col),row:Number(a.row),module:a.module,height:Number(a.height),index:Number(a.index)},h=e.target,h.style.opacity="0"}},O=e=>{if(e.preventDefault(),b&&clearTimeout(b),b=window.setTimeout(()=>{R=!1,b=null},300),e.dataTransfer&&e.target instanceof HTMLElement){const a=e.target.closest(V.value);if(!a)return;const r=a.dataset;document.querySelectorAll(`.${c.customWrapper} div[data-row="${r.row}"]`).forEach(l=>{l.classList.add(G.value)}),C.value={span:Number(r.span),col:Number(r.col),row:Number(r.row),module:r.module,height:Number(r.height),index:Number(r.index)}}},P=e=>{e.preventDefault(),h&&(h.style.opacity="1",h=null),X(A,C)&&Y(A,C),document.querySelectorAll(`.${G.value}`).forEach(a=>{a.classList.remove(G.value)}),A.value=null,C.value=null,x.value=!1},W=()=>{h&&(h.style.opacity="1",h=null),A.value=null,C.value=null,x.value=!1},X=(e,a)=>{const{span:r,module:u}=e.value,{span:l,module:f}=a.value;return!(u===f&&r===l)},Y=(e,a)=>{if(!e.value||!a.value)return;const{span:r,col:u,row:l,module:f,height:D,index:d}=e.value,{span:S,col:y,row:p,module:Z,height:B,index:m}=a.value;if(l===p&&u===y&&r===S&&D===B&&f===Z)return;let o=[...t.toRaw($.value)];const N=JSON.parse(JSON.stringify(o));if(l===p)if(d>m){d-m===1?(o[m].col=r+y,o[d].col=y):(o.forEach((v,n)=>{n<d&&n>=m&&(v.col+=S)}),o[d].col=y);const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局");return}i(s);return}else{m-d===1?(o[d].col=S+1,o[m].col=u):(o.forEach((v,n)=>{n>d&&n<=m&&(v.col-=S)}),o[d].col=y);const s=E.sortItemsByRowAndCol(o);if(!I(s)){i(N);return}i(s);return}else if(p<l){if(r===24){const s=[];for(let n=p;n<l;n++)s.push(n);o.forEach(n=>{s.includes(n.row)&&(n.row+=1)}),o[d].row=p;const v=E.sortItemsByRowAndCol(o);if(!I(v)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(v);return}if(r===S&&D===B){o[d].row=p,o[d].col=y,o[m].row=l,o[m].col=u;const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(s);return}}else{if(r===24){const s=[];for(let n=l+1;n<=p;n++)s.push(n);o.forEach(n=>{s.includes(n.row)&&(n.row-=1)}),o[d].row=p;const v=E.sortItemsByRowAndCol(o);if(!I(v)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(v);return}if(r===S&&D===B){o[d].row=p,o[d].col=y,o[m].row=l,o[m].col=u;const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(s);return}}},I=e=>{const a={};e.forEach(r=>{a[r.row]||(a[r.row]=[]),a[r.row].push(r)});for(const r in a){const u=a[r].sort((f,D)=>f.col-D.col);let l=1;for(const f of u){if(f.col<l)return w.note(!1,`行 ${r} 中的元素重叠: 元素 ${f.module} 在列 ${f.col}, 但当前列已经是 ${l}`),!1;if(l=f.col+f.span,l>25)return w.note(!1,`行 ${r} 中的元素超出界限: 元素 ${f.module} 在列 ${f.col} 跨度 ${f.span}`),!1}}return!0};return t.onMounted(async()=>{await k(),!c.disableDrag&&g.value&&(g.value.addEventListener("dragstart",F),g.value.addEventListener("dragover",O),g.value.addEventListener("drop",P),g.value.addEventListener("dragend",W))}),t.onUnmounted(()=>{g.value&&(g.value.removeEventListener("dragstart",F),g.value.removeEventListener("dragover",O),g.value.removeEventListener("drop",P),g.value.removeEventListener("dragend",W),b&&clearTimeout(b))}),J({setGridItems:e=>{i(e)},getGridItems:()=>JSON.parse(JSON.stringify($.value)),refreshGrid:()=>{(async()=>await k())()}}),(e,a)=>(t.openBlock(),t.createBlock(t.unref(ee.Spin),{spinning:L.value},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"gridContainer",ref:g,class:t.normalizeClass([L.value?t.unref(q)("loading"):t.unref(q)(),c.customWrapper,t.unref(U)]),style:t.normalizeStyle({width:typeof e.gridWidth=="number"?`${e.gridWidth}px`:e.gridWidth,gap:`${e.gapWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(r,u)=>(t.openBlock(),t.createElementBlock("div",{key:u,class:t.normalizeClass([t.unref(T)("item"),c.disableDrag?"":t.unref(j)("canDrag")]),"data-span":r.span,"data-index":u,"data-row":r.row,"data-col":r.col,"data-height":r.height,"data-module":r.module,style:t.normalizeStyle([Q(r)]),draggable:!c.disableDrag},[t.renderSlot(e.$slots,"item",{item:r,index:u})],14,ae))),128))],6)]),_:3},8,["spinning"]))}});exports.default=ne;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),ee=require("@aplus-frontend/antdv"),w=require("../../utils/warning.js");require("../../config-provider/index.js");const re=require("./constans.js"),te=require("./style/index.js"),E=require("./utils/sortItemsByRowAndCol.js"),oe=require("../../config-provider/hooks/use-namespace.js"),ae=["data-span","data-index","data-row","data-col","data-height","data-module","draggable"],ne=t.defineComponent({__name:"ApDraggableGrid",props:re.ApDraggableGridProps(),emits:["onGridListChange"],setup(_,{expose:J,emit:z}){const c=_,{b:q,e:T,m:j}=oe.useNamespace("ap-draggable-grid"),U=te.default("ap-draggable-grid"),L=t.ref(!1),x=t.ref(!1),M=t.computed(()=>T("item")),H=t.computed(()=>T("dragging")),G=t.computed(()=>T("overlay")),V=t.computed(()=>c.customWrapper?`.${c.customWrapper} .${M.value}:not(.${H.value})`:`.${M.value}:not(.${H.value})`),K=z,g=t.useTemplateRef("gridContainer"),$=t.ref([]);t.watch(()=>c.gridList,e=>{Array.isArray(e)&&i(e)},{deep:!0,immediate:!0});function i(e){const a=[...e].sort((r,u)=>r.row-u.row);$.value=a.map(r=>({...r})),K("onGridListChange",JSON.parse(JSON.stringify($.value)))}const Q=e=>({gridColumn:`${e.col} / span ${e.span}`,gridRow:e.row,minHeight:e.showHeight?e.showHeight+"px":`${c.gridItemHeight}px`,height:e.showHeight?e.showHeight+"px":`${c.gridItemHeight}px`,boxShadow:c.gridItemShadow?c.gridItemShadow:"none"});async function k(){if(i([]),typeof c.request=="function")try{L.value=!0;const e=await c.request();Array.isArray(e)&&i(e),w.warning(Array.isArray(e),"ApDraggableGrid: 请求函数必须返回一个符合 ApDraggableGridItemBase 数组的格式")}catch(e){w.warning(!1,`ApDraggableGrid: 请求错误: ${e}`)}finally{L.value=!1}}let A=t.ref(null),C=t.ref(null),h=null,R=!1,b=null;const F=e=>{if(!R&&(R=!0,e.dataTransfer&&e.target instanceof HTMLElement)){const a=e.target.dataset;e.dataTransfer.setData("text/plain",a.module),e.dataTransfer.effectAllowed="move",A.value={span:Number(a.span),col:Number(a.col),row:Number(a.row),module:a.module,height:Number(a.height),index:Number(a.index)},h=e.target,h.style.opacity="0"}},O=e=>{if(e.preventDefault(),b&&clearTimeout(b),b=window.setTimeout(()=>{R=!1,b=null},300),e.dataTransfer&&e.target instanceof HTMLElement){const a=e.target.closest(V.value);if(!a)return;const r=a.dataset;document.querySelectorAll(`.${c.customWrapper} div[data-row="${r.row}"]`).forEach(l=>{l.classList.add(G.value)}),C.value={span:Number(r.span),col:Number(r.col),row:Number(r.row),module:r.module,height:Number(r.height),index:Number(r.index)}}},P=e=>{e.preventDefault(),h&&(h.style.opacity="1",h=null),X(A,C)&&Y(A,C),document.querySelectorAll(`.${G.value}`).forEach(a=>{a.classList.remove(G.value)}),A.value=null,C.value=null,x.value=!1},W=()=>{h&&(h.style.opacity="1",h=null),A.value=null,C.value=null,x.value=!1},X=(e,a)=>{const{span:r,module:u}=e.value,{span:l,module:f}=a.value;return!(u===f&&r===l)},Y=(e,a)=>{if(!e.value||!a.value)return;const{span:r,col:u,row:l,module:f,height:D,index:d}=e.value,{span:S,col:y,row:p,module:Z,height:B,index:m}=a.value;if(l===p&&u===y&&r===S&&D===B&&f===Z)return;let o=[...t.toRaw($.value)];const N=JSON.parse(JSON.stringify(o));if(l===p)if(d>m){d-m===1?(o[m].col=r+y,o[d].col=y):(o.forEach((v,n)=>{n<d&&n>=m&&(v.col+=S)}),o[d].col=y);const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局");return}i(s);return}else{m-d===1?(o[d].col=S+1,o[m].col=u):(o.forEach((v,n)=>{n>d&&n<=m&&(v.col-=S)}),o[d].col=y);const s=E.sortItemsByRowAndCol(o);if(!I(s)){i(N);return}i(s);return}else if(p<l){if(r===24){const s=[];for(let n=p;n<l;n++)s.push(n);o.forEach(n=>{s.includes(n.row)&&(n.row+=1)}),o[d].row=p;const v=E.sortItemsByRowAndCol(o);if(!I(v)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(v);return}if(r===S&&D===B){o[d].row=p,o[d].col=y,o[m].row=l,o[m].col=u;const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(s);return}}else{if(r===24){const s=[];for(let n=l+1;n<=p;n++)s.push(n);o.forEach(n=>{s.includes(n.row)&&(n.row-=1)}),o[d].row=p;const v=E.sortItemsByRowAndCol(o);if(!I(v)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(v);return}if(r===S&&D===B){o[d].row=p,o[d].col=y,o[m].row=l,o[m].col=u;const s=E.sortItemsByRowAndCol(o);if(!I(s)){w.note(!1,"交换后的布局无效,恢复原始布局"),i(N);return}i(s);return}}},I=e=>{const a={};e.forEach(r=>{a[r.row]||(a[r.row]=[]),a[r.row].push(r)});for(const r in a){const u=a[r].sort((f,D)=>f.col-D.col);let l=1;for(const f of u){if(f.col<l)return w.note(!1,`行 ${r} 中的元素重叠: 元素 ${f.module} 在列 ${f.col}, 但当前列已经是 ${l}`),!1;if(l=f.col+f.span,l>25)return w.note(!1,`行 ${r} 中的元素超出界限: 元素 ${f.module} 在列 ${f.col} 跨度 ${f.span}`),!1}}return!0};return t.onMounted(async()=>{await k(),!c.disableDrag&&g.value&&(g.value.addEventListener("dragstart",F),g.value.addEventListener("dragover",O),g.value.addEventListener("drop",P),g.value.addEventListener("dragend",W))}),t.onUnmounted(()=>{g.value&&(g.value.removeEventListener("dragstart",F),g.value.removeEventListener("dragover",O),g.value.removeEventListener("drop",P),g.value.removeEventListener("dragend",W),b&&clearTimeout(b))}),J({setGridItems:e=>{i(e)},getGridItems:()=>JSON.parse(JSON.stringify($.value)),refreshGrid:()=>{(async()=>{await k()})()}}),(e,a)=>(t.openBlock(),t.createBlock(t.unref(ee.Spin),{spinning:L.value},{default:t.withCtx(()=>[t.createElementVNode("div",{ref_key:"gridContainer",ref:g,class:t.normalizeClass([L.value?t.unref(q)("loading"):t.unref(q)(),c.customWrapper,t.unref(U)]),style:t.normalizeStyle({width:typeof e.gridWidth=="number"?`${e.gridWidth}px`:e.gridWidth,gap:`${e.gapWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(r,u)=>(t.openBlock(),t.createElementBlock("div",{key:u,class:t.normalizeClass([t.unref(T)("item"),c.disableDrag?"":t.unref(j)("canDrag")]),"data-span":r.span,"data-index":u,"data-row":r.row,"data-col":r.col,"data-height":r.height,"data-module":r.module,style:t.normalizeStyle([Q(r)]),draggable:!c.disableDrag},[t.renderSlot(e.$slots,"item",{item:r,index:u})],14,ae))),128))],6)]),_:3},8,["spinning"]))}});exports.default=ne;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApExpandAlertProps } from './interface';
|
|
2
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
3
3
|
declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
5
|
readonly onClose?: ((args_0: MouseEvent) => any) | undefined;
|
|
@@ -24,7 +24,9 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
|
|
|
24
24
|
}): any;
|
|
25
25
|
};
|
|
26
26
|
emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
|
|
27
|
-
}>) => VNode
|
|
27
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}> & {
|
|
28
30
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
31
|
};
|
|
30
32
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApSelectItem } from './interface';
|
|
2
|
-
import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement, Plugin } from 'vue';
|
|
3
3
|
export * from './interface';
|
|
4
4
|
declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
5
5
|
attrs: any;
|
|
@@ -38,7 +38,9 @@ declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonNullable
|
|
|
38
38
|
(event: "afterEnter", el: Element): void;
|
|
39
39
|
(event: "afterLeave", el: Element): void;
|
|
40
40
|
};
|
|
41
|
-
}>) => VNode
|
|
41
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}> & {
|
|
42
44
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
43
45
|
}) & ( Plugin & (new (...args: any[]) => {
|
|
44
46
|
$props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApSelectItem, ApSelectLayoutProps } from './interface';
|
|
2
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
3
3
|
declare const _default: <T extends ApSelectItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
5
|
readonly onOnSelect?: ((value: T) => any) | undefined;
|
|
@@ -19,7 +19,9 @@ declare const _default: <T extends ApSelectItem>(__VLS_props: NonNullable<Awaite
|
|
|
19
19
|
(event: "afterEnter", el: Element): void;
|
|
20
20
|
(event: "afterLeave", el: Element): void;
|
|
21
21
|
};
|
|
22
|
-
}>) => VNode
|
|
22
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}> & {
|
|
23
25
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
24
26
|
};
|
|
25
27
|
export default _default;
|
|
@@ -4,9 +4,9 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
|
|
|
4
4
|
import { ApTableModalProps, OpenOptions, OpenReturnType } from './interface';
|
|
5
5
|
import { Recordable } from '../../type';
|
|
6
6
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
7
|
+
import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
|
|
7
8
|
import { ApFormSearchFormPopoverSorterItem } from '../..';
|
|
8
9
|
import { MaskType } from '@aplus-frontend/antdv/es/_util/hooks/useMergedMask';
|
|
9
|
-
import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
@@ -44,14 +44,8 @@ declare const ApTableModal: {
|
|
|
44
44
|
};
|
|
45
45
|
y: undefined;
|
|
46
46
|
};
|
|
47
|
-
getPaging: () =>
|
|
48
|
-
|
|
49
|
-
pageSize: number;
|
|
50
|
-
}>;
|
|
51
|
-
setPaging: (nextPaging: Partial<{
|
|
52
|
-
current: number;
|
|
53
|
-
pageSize: number;
|
|
54
|
-
}>, refreshImmediately?: boolean) => void;
|
|
47
|
+
getPaging: () => InternalPagingType;
|
|
48
|
+
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
55
49
|
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
56
50
|
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
57
51
|
resetSearchFormSorterItems: () => void;
|
|
@@ -156,14 +150,8 @@ declare const ApTableModal: {
|
|
|
156
150
|
};
|
|
157
151
|
y: undefined;
|
|
158
152
|
};
|
|
159
|
-
getPaging: () =>
|
|
160
|
-
|
|
161
|
-
pageSize: number;
|
|
162
|
-
}>;
|
|
163
|
-
setPaging: (nextPaging: Partial<{
|
|
164
|
-
current: number;
|
|
165
|
-
pageSize: number;
|
|
166
|
-
}>, refreshImmediately?: boolean) => void;
|
|
153
|
+
getPaging: () => InternalPagingType;
|
|
154
|
+
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
167
155
|
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
168
156
|
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
169
157
|
resetSearchFormSorterItems: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadFile, UploadChangeParam } from '@aplus-frontend/antdv';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, GlobalComponents, GlobalDirectives } from 'vue';
|
|
3
|
-
import { UploadType, UploadFile, FileType, HttpRequestHeader, ShowUploadListInterface, UploadListType, UploadLocale, UploadListProgressProps, ItemRender } from '@aplus-frontend/antdv/es/upload/interface';
|
|
3
|
+
import { UploadType, UploadFile, FileType, HttpRequestHeader, ShowUploadListInterface, UploadChangeParam, UploadListType, UploadLocale, UploadListProgressProps, ItemRender } from '@aplus-frontend/antdv/es/upload/interface';
|
|
4
4
|
import { AcceptConfig, UploadRequestOption } from '@aplus-frontend/antdv/es/vc-upload/interface';
|
|
5
5
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
6
6
|
declare function setValue(val: (string | Record<string, any>)[]): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApValueSelectCardProps, ApValueSelectCardOption } from './interface';
|
|
2
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, ComputedRef, VNode } from 'vue';
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, ComputedRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
3
3
|
declare const _default: <T extends Record<string, any> = Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
5
|
readonly onChange?: ((keys: (string | number)[]) => any) | undefined;
|
|
@@ -45,7 +45,9 @@ declare const _default: <T extends Record<string, any> = Record<string, any>>(__
|
|
|
45
45
|
(e: "remove", key: string | number): void;
|
|
46
46
|
(e: "highlight", keys: (string | number)[]): void;
|
|
47
47
|
};
|
|
48
|
-
}>) => VNode
|
|
48
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}> & {
|
|
49
51
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
50
52
|
};
|
|
51
53
|
export default _default;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { Recordable } from '../../type';
|
|
1
2
|
import { ApViewProps } from './interface';
|
|
2
3
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
4
|
declare const _default: DefineComponent<ApViewProps, {
|
|
4
5
|
setFirstDefaultSystemView: (value: boolean) => void;
|
|
6
|
+
setInitToUrl: (value: boolean) => void;
|
|
7
|
+
mountedData: Recordable;
|
|
5
8
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApViewProps> & Readonly<{}>, {
|
|
6
9
|
manual: boolean;
|
|
7
10
|
maxViewNum: number;
|
|
11
|
+
sendToUrl: boolean;
|
|
8
12
|
isDefaultSystemView: boolean;
|
|
9
13
|
isFirstDefaultSystemView: boolean;
|
|
14
|
+
initToUrl: boolean;
|
|
10
15
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
11
16
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@aplus-frontend/utils"),A=require("../../ap-table/context.js");require("../../config-provider/index.js");const G=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const $=require("./hooks/use-send-to-url.js"),z=require("./hooks/use-view-provide.js"),R=require("./icons/line-down.vue.js"),H=require("./style/index.js"),v=require("./utils/enum.js"),J=require("../../config-provider/hooks/use-global-config.js"),Q=require("../../config-provider/hooks/use-namespace.js"),X=require("../../config-provider/hooks/use-locale.js"),Z=require("./components/main-button-content.vue2.js"),ee=require("./components/menu-list-content.vue2.js"),te=e.defineComponent({name:"ApView",__name:"ap-view",props:{tableKey:{},saveDataSource:{},viewCacheOption:{},maxViewNum:{default:20},isDefaultSystemView:{type:Boolean,default:!1},isFirstDefaultSystemView:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},emptyData:{},extraParams:{},sendToUrl:{type:Boolean,default:!0},initToUrl:{type:Boolean,default:!0}},setup(C,{expose:E}){const i=C,F=J.useGlobalConfig("viewCacheOption"),{b:p}=Q.useNamespace("ap-view"),{t:q}=X.useLocale(),h=H.default("ap-view"),y=e.computed(()=>({viewKey:v.SYSTEM_VIEW_KEY,viewName:q("ap.apView.systemView")})),{getSearchFormValues:I,setSearchFormValues:U,submit:N,reset:Y,submitWith:x,getSearchFormSorterItems:O,setSearchFormSorterItems:B,resetSearchFormSorterItems:L}=A.useInjectApTable(),M=e.ref(!1),V=e.ref(!1),w=e.ref("");let l=!1,b=!1,S=!0;const W={dropdownType:"dropdown",content:e.createVNode(Z.default,{maxViewNum:i.maxViewNum},null)},r=e.ref([y.value]),P=e.computed(()=>r.value.map(a=>({id:a.viewKey,content:e.createVNode(ee.default,{view:a},null)}))),o={getSearchFormValues:I,setSearchFormValues:U,submit:N,reset:Y,submitWith:x,getSearchFormSorterItems:O,setSearchFormSorterItems:B,resetSearchFormSorterItems:L,...i.saveDataSource},d={...F.value,...i.viewCacheOption},{mountedData:_,isValidMountedData:g}=$.useSendToUrl({saveDataSource:o,sendToUrl:e.computed(()=>i.sendToUrl),tableKey:e.computed(()=>i.tableKey)}),D=()=>i.isDefaultSystemView||(i.isFirstDefaultSystemView||b)&&l?v.SYSTEM_VIEW_KEY:r.value.find(s=>s.isDefault)?.viewKey??v.SYSTEM_VIEW_KEY,c=a=>{w.value=a;const s=r.value.find(t=>t.viewKey===w.value);s&&setTimeout(()=>{s.viewKey===v.SYSTEM_VIEW_KEY?l?i.manual||(i.sendToUrl&&S&&i.initToUrl&&g.value&&o?.setSearchFormValues?.(_.value),o?.submitWith?.()):i.manual||(o?.resetSearchFormSorterItems?.(),o?.reset?.()):(i.sendToUrl&&S&&i.initToUrl&&g.value&&l?o?.setSearchFormValues?.(_.value):o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(t=>[t,void 0]))??{},...i?.emptyData??{},...[...o?.getSearchFormSorterItems?.()??[],...i?.extraParams?.map(t=>({name:t}))??[]].reduce((t,n)=>(s.viewConfig?.searchForm?.[n.name]&&(t[n.name]=s.viewConfig?.searchForm?.[n.name]),t),{})??{}}),o?.setSearchFormSorterItems?.(s.viewConfig?.sorterItems??[]),l?i.manual||o?.submitWith?.():o?.submit?.()),l=!1})},T={getViewList:async a=>{try{const{tableKey:s}=a,t=await d?.getViewList?.({tableKey:s});return r.value=[y.value,...t??[]],c(D()),r.value}catch{return r.value=[y.value],c(v.SYSTEM_VIEW_KEY),r.value}},addView:async a=>{const{tableKey:s,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await d?.addView?.({tableKey:s,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(r.value=r.value.map(m=>({...m,isDefault:!1}))),r.value=[...r.value,{viewKey:t,viewName:n,isDefault:u,viewConfig:f}],c(t)},changeView:async a=>{const{tableKey:s,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await d?.changeView?.({tableKey:s,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(r.value=r.value.map(K=>({...K,isDefault:!1})));const m=r.value.find(K=>K.viewKey===t);m&&(m.viewName=n,m.isDefault=u,m.viewConfig=f),c(t)},removeView:async a=>{const{tableKey:s,viewKey:t}=a;await d?.removeView?.({tableKey:s,viewKey:t}),r.value=r.value.filter(n=>n.viewKey!==t),t===w.value&&c(D())}},j={tableKey:e.computed(()=>i.tableKey),currentViewKey:w,changeCurrentViewKey:c,popoverOpen:M,menuOpen:V,viewList:r,viewListCRUD:T,saveDataSource:o};return z.useViewProvide(j),e.watch(()=>i.tableKey,a=>{k.isValid(a)&&(l=!0,T?.getViewList?.({tableKey:a}))},{immediate:!0}),E({setFirstDefaultSystemView:a=>{b=a},setInitToUrl:a=>{S=a},mountedData:e.computed(()=>_.value)}),(a,s)=>(e.openBlock(),e.createBlock(e.unref(G.ApBatchActionGroup),e.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":s[0]||(s[0]=t=>V.value=t),class:[e.unref(p)(),e.unref(h)],"button-props":W,"menu-list":P.value,"overlay-class-name":[e.unref(p)("overlay"),e.unref(h)],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(p)("icon")])},[e.createVNode(R.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=te;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc } from '../../../ap-form';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
|
|
3
3
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
4
|
-
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
|
+
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, RuleObject, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
7
7
|
import { Options } from '../../../../node_modules/scroll-into-view-if-needed';
|
|
8
8
|
import { Recordable } from '../../../type';
|
|
9
9
|
import { VueTypeDef, VueTypeValidableDef } from '../../../../node_modules/vue-types';
|
|
10
|
+
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
10
11
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
11
12
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
13
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -109,7 +110,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
109
110
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
110
111
|
readonly initialValues?: Recordable | undefined;
|
|
111
112
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
112
|
-
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
113
|
+
readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
|
|
113
114
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
114
115
|
readonly autoFocusFirstInput?: boolean | undefined;
|
|
115
116
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ViewListModel } from '../interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
|
|
3
3
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
4
|
-
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
|
+
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, RuleObject, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
7
7
|
import { Options } from '../../../../node_modules/scroll-into-view-if-needed';
|
|
8
8
|
import { Recordable } from '../../../type';
|
|
9
9
|
import { VueTypeDef, VueTypeValidableDef } from '../../../../node_modules/vue-types';
|
|
10
|
+
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
10
11
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
11
12
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
13
|
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc } from '../../../ap-form';
|
|
@@ -110,7 +111,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
110
111
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
111
112
|
readonly initialValues?: Recordable | undefined;
|
|
112
113
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
113
|
-
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
114
|
+
readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
|
|
114
115
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
115
116
|
readonly autoFocusFirstInput?: boolean | undefined;
|
|
116
117
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { Recordable } from '../../../type';
|
|
3
|
+
import { SaveDataSource } from '../interface';
|
|
4
|
+
export declare const useSendToUrl: (option: {
|
|
5
|
+
saveDataSource: SaveDataSource;
|
|
6
|
+
sendToUrl: ComputedRef<boolean>;
|
|
7
|
+
tableKey: ComputedRef<string>;
|
|
8
|
+
}) => {
|
|
9
|
+
mountedData: ComputedRef<Recordable>;
|
|
10
|
+
isValidMountedData: ComputedRef<boolean>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@aplus-frontend/utils"),e=require("vue"),l=require("../utils/query.js"),v=s=>{const{saveDataSource:c,sendToUrl:i,tableKey:n}=s;let r,t,u=!1;const a=e.ref({});return e.onMounted(()=>{if(i?.value){try{a.value=JSON.parse(atob(l.getUrlQuery()[n.value]??""))}catch{a.value={}}r=setInterval(()=>{try{const o=btoa(JSON.stringify(c?.getSearchFormValues?.()??{}));o!==t&&(t=o,u=!0)}catch{t=""}u&&(l.setUrlQuery({[n.value]:t}),u=!1)},500)}}),e.onUnmounted(()=>{r&&clearInterval(r)}),{mountedData:e.computed(()=>a.value),isValidMountedData:e.computed(()=>d.isObjectWithContent(a.value))}};exports.useSendToUrl=v;
|