@aplus-frontend/ui 7.19.0-beta.1 → 7.19.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 +2 -4
- package/es/src/ag-grid/editable/form-item.vue.mjs +88 -77
- package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ag-grid/editable/index.vue.mjs +9 -8
- package/es/src/ag-grid/editable/interface.d.ts +15 -1
- package/es/src/ag-grid/hooks/use-columns.mjs +31 -23
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.d.ts +2 -4
- package/es/src/ag-grid/index.vue.mjs +353 -335
- package/es/src/ag-grid/interface.d.ts +40 -1
- package/es/src/ag-grid/utils.d.ts +18 -0
- package/es/src/ag-grid/utils.mjs +39 -18
- package/es/src/ap-field/cascader/use-options.d.ts +4 -4
- package/es/src/ap-field/date/index.vue.d.ts +0 -1
- package/es/src/ap-field/date-range/index.vue.d.ts +0 -1
- 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 +1 -2
- package/es/src/ap-form/ap-form.vue2.mjs +63 -61
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/interface.d.ts +4 -0
- 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 +9 -11
- package/es/src/ap-form/items/date-range/index.vue.d.ts +13 -15
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -3
- package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ap-grid/index.vue.d.ts +2 -4
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-list/index.vue.d.ts +2 -4
- 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 +2 -4
- package/es/src/ap-table/components/setting/context.d.ts +1 -1
- package/es/src/ap-table/components/setting/context.mjs +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +127 -117
- 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 +2 -3
- package/es/src/ap-table/constants.d.ts +20 -22
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +9 -9
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +102 -95
- 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 +1 -3
- package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- 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 +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/es/src/business/ap-table-modal/index.d.ts +17 -5
- package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -112
- package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/es/src/business/ap-view/ap-view.vue.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +87 -81
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
- package/es/src/business/ap-view/hooks/use-send-to-url.mjs +46 -30
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/index.d.ts +3 -3
- package/es/src/business/ap-view/interface.d.ts +7 -1
- 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 +5 -1
- 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 +2 -4
- package/es/src/editable-table/index.vue.d.ts +2 -4
- 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/type.d.ts +1 -0
- 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 +2 -4
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +15 -1
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +2 -4
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +40 -1
- package/lib/src/ag-grid/utils.d.ts +18 -0
- package/lib/src/ag-grid/utils.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 +0 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +0 -1
- 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 +1 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/item/index.vue.d.ts +6 -6
- package/lib/src/ap-form/items/date/index.vue.d.ts +9 -11
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +13 -15
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -3
- package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +2 -4
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
- package/lib/src/ap-table/components/setting/context.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +2 -3
- package/lib/src/ap-table/constants.d.ts +20 -22
- 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/ap-table/hooks/use-table-template-storage.js +1 -1
- 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 +2 -4
- package/lib/src/business/ap-select-layout/index.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/lib/src/business/ap-table-modal/index.d.ts +17 -5
- package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/lib/src/business/ap-view/ap-view.vue.d.ts +1 -1
- 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 +2 -3
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +2 -0
- package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -1
- package/lib/src/business/ap-view/index.d.ts +3 -3
- package/lib/src/business/ap-view/interface.d.ts +7 -1
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -4
- package/lib/src/editable-table/index.vue.d.ts +2 -4
- 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/type.d.ts +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -11,21 +11,19 @@ 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, CustomFormat, DisabledTimes, DisabledTime, PickerMode, EventValue } 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';
|
|
19
18
|
import { ZoneAlias } from '@aplus-frontend/utils';
|
|
20
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
21
19
|
import { OnCleanup } from '@vue/reactivity';
|
|
22
20
|
import { ApFormItemSlots, ApFormItemTextPassword, ApActionGroupProps, GroupActionTypes } from '..';
|
|
23
21
|
import { RangeDateRender, RangeType, RangeInfo } from '@aplus-frontend/antdv/es/vc-picker/RangePicker';
|
|
24
|
-
import { RangePickerProps } from '@aplus-frontend/antdv/es/date-picker';
|
|
25
22
|
import { ValueType } from '@aplus-frontend/antdv/es/input-number/src/utils/MiniDecimal';
|
|
26
23
|
import { VueTypeValidableDef, VueTypeDef } from '../../node_modules/vue-types';
|
|
27
24
|
import { RadioGroupChildOption } from '@aplus-frontend/antdv/es/radio/Group';
|
|
28
25
|
import { RadioGroupButtonStyle, RadioGroupOptionType } from '@aplus-frontend/antdv/es/radio/interface';
|
|
26
|
+
import { RadioChangeEvent, CheckboxOptionType, TreeSelectProps, CascaderProps } from '@aplus-frontend/antdv';
|
|
29
27
|
import { SelectValue, DefaultOptionType, LabeledValue, BaseOptionType } from '@aplus-frontend/antdv/es/select';
|
|
30
28
|
import { SelectHandler, FieldNames, FilterFunc } from '@aplus-frontend/antdv/es/vc-select/Select';
|
|
31
29
|
import { RenderDOMFunc, CustomTagProps, DropdownRender, DisplayValueType, Placement } from '@aplus-frontend/antdv/es/vc-select/BaseSelect';
|
|
@@ -83,7 +81,7 @@ export declare const apTableFormItemMap: {
|
|
|
83
81
|
readonly onSelect?: ((value: Dayjs) => void) | undefined;
|
|
84
82
|
readonly open?: boolean | undefined;
|
|
85
83
|
readonly disabled?: boolean | undefined;
|
|
86
|
-
readonly direction?:
|
|
84
|
+
readonly direction?: "ltr" | "rtl" | undefined;
|
|
87
85
|
readonly placeholder?: string | undefined;
|
|
88
86
|
readonly id?: string | undefined;
|
|
89
87
|
readonly getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
@@ -120,19 +118,19 @@ export declare const apTableFormItemMap: {
|
|
|
120
118
|
readonly showToday?: boolean | undefined;
|
|
121
119
|
readonly showTime?: boolean | SharedTimeProps<Dayjs> | undefined;
|
|
122
120
|
readonly valueFormat?: string | undefined;
|
|
123
|
-
readonly value?:
|
|
121
|
+
readonly value?: number | null | undefined;
|
|
124
122
|
readonly defaultValue?: number | undefined;
|
|
125
123
|
readonly 'onUpdate:value'?: (((ts: number | null) => void) & ((...args: any[]) => any)) | undefined;
|
|
126
124
|
readonly onChange?: ((ts: number | null, dayStr: string) => void) | undefined;
|
|
127
125
|
readonly onOk?: ((ts: number | null) => void) | undefined;
|
|
128
126
|
readonly format?: LiteralUnion<ApFormatPresetType, string> | undefined;
|
|
129
|
-
readonly shownFormat?:
|
|
127
|
+
readonly shownFormat?: string | CustomFormat<Dayjs> | (string | CustomFormat<Dayjs>)[] | undefined;
|
|
130
128
|
readonly formatBegins?: boolean | undefined;
|
|
131
129
|
readonly timezone?: ( ZoneAlias | {
|
|
132
130
|
label?: string;
|
|
133
131
|
value: ZoneAlias;
|
|
134
132
|
}[]) | undefined;
|
|
135
|
-
readonly disabledTime?:
|
|
133
|
+
readonly disabledTime?: ((date: Dayjs) => DisabledTimes) | undefined;
|
|
136
134
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
137
135
|
$attrs: {
|
|
138
136
|
[x: string]: unknown;
|
|
@@ -892,8 +890,8 @@ export declare const apTableFormItemMap: {
|
|
|
892
890
|
readonly onMouseup?: MouseEventHandler | undefined;
|
|
893
891
|
readonly open?: boolean | undefined;
|
|
894
892
|
readonly separator?: VueNode;
|
|
895
|
-
readonly disabled?:
|
|
896
|
-
readonly direction?:
|
|
893
|
+
readonly disabled?: boolean | [boolean, boolean] | undefined;
|
|
894
|
+
readonly direction?: "ltr" | "rtl" | undefined;
|
|
897
895
|
readonly placeholder?: [string, string] | undefined;
|
|
898
896
|
readonly id?: string | undefined;
|
|
899
897
|
readonly getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
@@ -928,7 +926,7 @@ export declare const apTableFormItemMap: {
|
|
|
928
926
|
readonly ranges?: Record<string, [ EventValue<Dayjs>, EventValue<Dayjs>] | (() => [ EventValue<Dayjs>, EventValue<Dayjs>])> | undefined;
|
|
929
927
|
readonly allowEmpty?: [boolean, boolean] | undefined;
|
|
930
928
|
readonly onCalendarChange?: ((values: RangeValue<Dayjs>, formatString: [string, string], info: RangeInfo) => void) | undefined;
|
|
931
|
-
readonly activePickerIndex?:
|
|
929
|
+
readonly activePickerIndex?: 0 | 1 | undefined;
|
|
932
930
|
readonly valueFormat?: string | undefined;
|
|
933
931
|
readonly value?: ( RangeValue<number> | null) | undefined;
|
|
934
932
|
readonly defaultValue?: RangeValue<number> | undefined;
|
|
@@ -936,13 +934,13 @@ export declare const apTableFormItemMap: {
|
|
|
936
934
|
readonly onChange?: ((ts: RangeValue<number> | null, dayStr: [string, string]) => void) | undefined;
|
|
937
935
|
readonly onOk?: ((ts: RangeValue<number>) => void) | undefined;
|
|
938
936
|
readonly format?: LiteralUnion<ApFormatPresetType, string> | undefined;
|
|
939
|
-
readonly shownFormat?:
|
|
937
|
+
readonly shownFormat?: string | CustomFormat<Dayjs> | (string | CustomFormat<Dayjs>)[] | undefined;
|
|
940
938
|
readonly timezone?: ( ZoneAlias | {
|
|
941
939
|
label?: string;
|
|
942
940
|
value: ZoneAlias;
|
|
943
941
|
}[]) | undefined;
|
|
944
942
|
readonly readModeSeparator?: any;
|
|
945
|
-
readonly presets?:
|
|
943
|
+
readonly presets?: true | PresetDate<RangeValue<Dayjs>>[] | {
|
|
946
944
|
thisWeek?: boolean;
|
|
947
945
|
lastWeek?: boolean;
|
|
948
946
|
last7Days?: boolean;
|
|
@@ -954,7 +952,7 @@ export declare const apTableFormItemMap: {
|
|
|
954
952
|
lastQuarter?: boolean;
|
|
955
953
|
thisYear?: boolean;
|
|
956
954
|
lastYear?: boolean;
|
|
957
|
-
};
|
|
955
|
+
} | undefined;
|
|
958
956
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
959
957
|
$attrs: {
|
|
960
958
|
[x: string]: unknown;
|
|
@@ -1788,7 +1786,7 @@ export declare const apTableFormItemMap: {
|
|
|
1788
1786
|
offset: ValueType;
|
|
1789
1787
|
type: "up" | "down";
|
|
1790
1788
|
}) => void) | undefined;
|
|
1791
|
-
readonly inputMode?:
|
|
1789
|
+
readonly inputMode?: "input" | "spinner" | undefined;
|
|
1792
1790
|
readonly thousands?: boolean | undefined;
|
|
1793
1791
|
readonly limitDecimalsRetain?: boolean | undefined;
|
|
1794
1792
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -2578,16 +2576,16 @@ export declare const apTableFormItemMap: {
|
|
|
2578
2576
|
readonly showAction?: ("click" | "focus")[] | undefined;
|
|
2579
2577
|
readonly onPopupScroll?: ((e: UIEvent) => void) | undefined;
|
|
2580
2578
|
readonly onInputKeyDown?: ((e: KeyboardEvent) => void) | undefined;
|
|
2581
|
-
readonly request?: ((value?: string, extraParams?: Recordable) => Promise<
|
|
2579
|
+
readonly request?: ((value?: string, extraParams?: Recordable) => Promise< DefaultOptionType[] | undefined>) | undefined;
|
|
2582
2580
|
readonly multiple?: boolean | undefined;
|
|
2583
|
-
readonly value?:
|
|
2581
|
+
readonly value?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
|
|
2584
2582
|
readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
|
|
2585
|
-
readonly searchMode?:
|
|
2583
|
+
readonly searchMode?: "filter" | "request" | undefined;
|
|
2586
2584
|
readonly refetchOnFocus?: boolean | undefined;
|
|
2587
2585
|
readonly fetchOnFocus?: boolean | undefined;
|
|
2588
2586
|
readonly fetchOnOpen?: boolean | undefined;
|
|
2589
|
-
readonly lazy?:
|
|
2590
|
-
readonly addAll?:
|
|
2587
|
+
readonly lazy?: boolean | "first-focus" | "first-open" | undefined;
|
|
2588
|
+
readonly addAll?: boolean | number | undefined;
|
|
2591
2589
|
readonly params?: Recordable | undefined;
|
|
2592
2590
|
readonly searchDelay?: number | undefined;
|
|
2593
2591
|
readonly allowOnlySelect?: boolean | undefined;
|
|
@@ -3246,7 +3244,7 @@ export declare const apTableFormItemMap: {
|
|
|
3246
3244
|
readonly unCheckedValue?: string | number | boolean | undefined;
|
|
3247
3245
|
readonly 'onUpdate:checked'?: (((checked: string | number | boolean) => void) & ((...args: any[]) => any)) | undefined;
|
|
3248
3246
|
readonly onAction?: ((checked: string | boolean | number, e?: Event) => boolean | Promise<boolean>) | undefined;
|
|
3249
|
-
readonly confirm?:
|
|
3247
|
+
readonly confirm?: ((checked: string | number | boolean) => ApFieldSwitchConfirmConfig) | ApFieldSwitchConfirmConfig;
|
|
3250
3248
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
3251
3249
|
$attrs: {
|
|
3252
3250
|
[x: string]: unknown;
|
|
@@ -4326,7 +4324,7 @@ export declare const apTableFormItemMap: {
|
|
|
4326
4324
|
readonly id?: string | undefined;
|
|
4327
4325
|
readonly prefixCls?: string | undefined;
|
|
4328
4326
|
readonly name?: string | undefined;
|
|
4329
|
-
readonly request?: (() => Promise<
|
|
4327
|
+
readonly request?: (() => Promise<(string | number | CheckboxOptionType)[] | undefined>) | undefined;
|
|
4330
4328
|
readonly vertical?: boolean | undefined;
|
|
4331
4329
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
4332
4330
|
$attrs: {
|
|
@@ -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:
|
|
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:M=[],formatParams:R,paramsValueTypeMap:U,resetFieldsIgnores:V,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=>R?R(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:M.length,records:M,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,U&&r){const o=U[n];o&&(t[n]=N.parseFieldValue(o,r))}}),t},ne=async e=>{const t=T(),n={};Object.entries(t).forEach(([r,o])=>{V&&V.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.max(Math.ceil(e.length/s.pageSize),1);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?:
|
|
9
|
+
fixed?: "left" | "right" | undefined;
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
label?: any;
|
|
12
|
-
children?: any[] | undefined;
|
|
12
|
+
children?: /*elided*/ any[] | undefined;
|
|
13
13
|
order?: number | undefined;
|
|
14
14
|
}[];
|
|
15
15
|
label: string;
|
|
16
16
|
key: string;
|
|
17
|
-
size?:
|
|
17
|
+
size?: "middle" | "small" | undefined;
|
|
18
18
|
}[], ApColumnTemplate[] | {
|
|
19
19
|
columnState: {
|
|
20
20
|
key: string | number;
|
|
21
21
|
show?: boolean | undefined;
|
|
22
|
-
fixed?:
|
|
22
|
+
fixed?: "left" | "right" | undefined;
|
|
23
23
|
disabled?: boolean | undefined;
|
|
24
24
|
label?: any;
|
|
25
|
-
children?: any[] | undefined;
|
|
25
|
+
children?: /*elided*/ any[] | undefined;
|
|
26
26
|
order?: number | undefined;
|
|
27
27
|
}[];
|
|
28
28
|
label: string;
|
|
29
29
|
key: string;
|
|
30
|
-
size?:
|
|
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?:
|
|
39
|
+
fixed?: "left" | "right" | undefined;
|
|
40
40
|
disabled?: boolean | undefined;
|
|
41
41
|
label?: any;
|
|
42
|
-
children?: any[] | undefined;
|
|
42
|
+
children?: /*elided*/ any[] | undefined;
|
|
43
43
|
order?: number | undefined;
|
|
44
44
|
}[];
|
|
45
45
|
label: string;
|
|
46
46
|
key: string;
|
|
47
|
-
size?:
|
|
47
|
+
size?: "middle" | "small" | undefined;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("@aplus-frontend/antdv/es/theme/internal"),c=require("lodash-unified"),s=require("vue");require("../../config-provider/index.js");const q=require("../../utils/index.js"),F=require("../components/setting/utils.js"),M=require("../context.js"),J=require("../utils.js"),P=require("../../config-provider/hooks/use-locale.js"),U=require("../../config-provider/hooks/use-namespace.js");function W(r,e,n,a){return a?a.fixed:e?e.fixed:n&&"fixed"in n?n.fixed:c.isBoolean(r.fixed)?r.fixed?"left":void 0:r.fixed}const b=Number.MAX_SAFE_INTEGER,y=q.randomStr();function C(r,e){const n=c.isNumber(r.order)?r.order:b;let a=c.isNumber(e.order)?e.order:b;return r.fixed==="right"&&e.fixed!=="right"&&(a=n-1),e.fixed==="left"&&r.fixed!=="left"&&(a=n-1),n-a}function G(r,e){e&&r.removeItem(e)}function k(r,e){if(!e)return[];const n=r.getItem(e);if(!n)return[];const a=JSON.parse(n);return Array.isArray(a)?a:(G(r,e),[])}function A(r,e){if(c.isObject(r)&&c.isObject(e))return c.mergeWith({},r,e,A)}const R=(r,e,n)=>{const{columnsBackup:a,size:f}=M.useInjectApTable(),{t:N}=P.useLocale(),{be:I}=U.useNamespace("ap-table"),[X,z]=B.useToken(),m=s.ref(),u=s.ref([]);let T;T=s.watch(()=>a?.value,(t,i)=>{t?.length&&!i?.length&&(u.value=p(k(localStorage,s.unref(e))),T?.())},{immediate:!0}),s.watch([a,f],([t,i])=>{t&&(m.value={label:"basic_template",columnState:d(t),key:y,size:i})},{immediate:!0,deep:!0}),s.watch(()=>e.value,t=>{const i=p(k(localStorage,t));u.value=i,m.value={label:"basic_template",columnState:d(a?.value||[]),key:y,size:f?.value},n(i??[])});function p(t){return t.length?t.map(i=>({...i,columnState:d(a.value,i.columnState,!1)})):[{label:N("ap.apTable.setting.defaultTemplate"),key:r.getActiveKey?.("DEFAULT_TEMPLATE")??q.randomStr(),size:f?.value,columnState:d(a?.value||[])}]}function d(t,i={},l=!0){const v=c.mergeWith({},l?r.defaultValue||{}:{},i,A);function S(w,L,j){return w.map(o=>{const x=L?.[o.key]||{},g={key:o.key,label:c.isString(o.title)?J.getTableTitle(o,I("table-header","title"),void 0,z.value.colorTextTertiary):o.title,show:!0,fixed:W(o,i[o.key],l?r.defaultValue?.[o.key]:void 0,j),disabled:!1,...c.omit(x,["children","fixed"])};return g.children=o.children?.length?S(o.children,x.children,g):void 0,g}).sort(C)}return S(t||[],v)}function h(t){if(s.unref(e)){const i=t.map(l=>({...l,columnState:F.getColumnStateString(l.columnState)}));localStorage.setItem(s.unref(e),JSON.stringify(i))}}function E(t){u.value.push(t)}function O(t){const i=u.value.findIndex(l=>l.key===t);u.value.splice(i,1)}function _(t,i){const l=u.value.findIndex(v=>v.key===t);return u.value[l]={...u.value[l],...i},u.value[l]}return s.watch(()=>u.value,t=>{t.length&&h(t)},{deep:!0,immediate:!0}),{basicTemplate:m,customizeTemplateList:u,syncTemplateListToStorage:h,addTemplate:E,deleteTemplate:O,updateTemplate:_}};exports.useTableTemplateStorage=R;
|
|
@@ -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';
|
|
7
6
|
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?: ( ButtonType | undefined) | "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?: ( ButtonType | undefined) | "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()=>
|
|
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
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } 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,9 +24,7 @@ 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
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}> & {
|
|
27
|
+
}>) => VNode & {
|
|
30
28
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
31
29
|
};
|
|
32
30
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApSelectItem } from './interface';
|
|
2
|
-
import { PublicProps, ShallowUnwrapRef, VNode,
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode, 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,9 +38,7 @@ 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
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}> & {
|
|
41
|
+
}>) => VNode & {
|
|
44
42
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
45
43
|
}) & ( Plugin & (new (...args: any[]) => {
|
|
46
44
|
$props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApSelectItem, ApSelectLayoutProps } from './interface';
|
|
2
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } 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,9 +19,7 @@ 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
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}> & {
|
|
22
|
+
}>) => VNode & {
|
|
25
23
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
26
24
|
};
|
|
27
25
|
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';
|
|
8
7
|
import { ApFormSearchFormPopoverSorterItem } from '../..';
|
|
9
8
|
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,8 +44,14 @@ declare const ApTableModal: {
|
|
|
44
44
|
};
|
|
45
45
|
y: undefined;
|
|
46
46
|
};
|
|
47
|
-
getPaging: () =>
|
|
48
|
-
|
|
47
|
+
getPaging: () => Partial<{
|
|
48
|
+
current: number;
|
|
49
|
+
pageSize: number;
|
|
50
|
+
}>;
|
|
51
|
+
setPaging: (nextPaging: Partial<{
|
|
52
|
+
current: number;
|
|
53
|
+
pageSize: number;
|
|
54
|
+
}>, refreshImmediately?: boolean) => void;
|
|
49
55
|
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
50
56
|
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
51
57
|
resetSearchFormSorterItems: () => void;
|
|
@@ -150,8 +156,14 @@ declare const ApTableModal: {
|
|
|
150
156
|
};
|
|
151
157
|
y: undefined;
|
|
152
158
|
};
|
|
153
|
-
getPaging: () =>
|
|
154
|
-
|
|
159
|
+
getPaging: () => Partial<{
|
|
160
|
+
current: number;
|
|
161
|
+
pageSize: number;
|
|
162
|
+
}>;
|
|
163
|
+
setPaging: (nextPaging: Partial<{
|
|
164
|
+
current: number;
|
|
165
|
+
pageSize: number;
|
|
166
|
+
}>, refreshImmediately?: boolean) => void;
|
|
155
167
|
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
156
168
|
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
157
169
|
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,
|
|
3
|
+
import { UploadType, UploadFile, FileType, HttpRequestHeader, ShowUploadListInterface, 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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Q=require("@ant-design/icons-vue"),c=require("@aplus-frontend/antdv"),X=require("@aplus-frontend/icon"),Y=require("../../ap-file-preview/index.js");require("../../../config-provider/index.js");const Z=require("../../../utils/index.js"),C=require("../hooks/useOss.js"),ee=require("../style/index.js"),A=require("../utils/accept.js"),x=require("../utils/returnData.js"),te=require("../../../config-provider/hooks/use-global-config.js"),oe=require("../../../config-provider/hooks/use-locale.js"),ne=require("../../../config-provider/hooks/use-namespace.js"),se={class:"multiple-file-context"},ae={key:0},re={key:1},ie=e.defineComponent({__name:"MultipleFile",setup(ce,{expose:D}){const N=te.useGlobalConfig("downloadCenterTriggerConfig"),{t:a}=oe.useLocale(),{b:P}=ne.useNamespace("ap-upload-multiple-file"),S=ee.default("ap-upload"),{put:I}=C.useOss(),R=e.inject("dirName"),B=e.inject("baseDirName"),k=e.inject("accept")||"*",b=e.inject("maxSize")??500,M=e.inject("title")||a("ap.apUpload.uploadFile"),f=e.inject("subTitle"),i=e.inject("maxCount")??10,d=e.inject("uploadingCount"),j=e.inject("beforeUpload"),_=e.inject("customRequest"),g=e.inject("getOssAccess"),L=e.inject("maxSizeErrorMsg"),V=e.inject("maxCountErrorMsg"),O=e.inject("acceptErrorMsg"),E=e.inject("onRemove"),y=e.inject("showUploadErrorMsg"),U=e.inject("bucket"),z=e.inject("showDownload")??!0,l=e.inject("showPreview")??!0,r=e.inject("value"),u=[],w=e.inject("needName"),m=e.ref(null);e.watch(()=>r?.value,function(t){!m?.value?.fileList?.length&&t&&q(t)},{immediate:!0});function q(t){if(!t){p=[],m.value.fileList=[],r.value=void 0,u.splice(0,u.length);return}e.nextTick(()=>{const o=t.map(n=>{const s=x.getPath(w,n),F=x.getName(w,n),v=new File([n],F,{});return v.response=s,v.uid=Z.randomStr(18),v.status="done",v});if(i&&o.length>i){c.message.warning(a("ap.apUpload.fileInitializationException",{maxCount:i}));return}o.forEach(n=>{p.push(n),u.push({uid:n.uid,path:n.response})}),m.value.fileList=o,r.value=t})}D({setValue:q});let p=[],T;function h(t){setTimeout(()=>{const o=m.value.fileList.findIndex(n=>n.uid===t.uid);o>=0&&m.value.fileList.splice(o,1)})}async function $(t){if(i&&i>1&&p.length>=i)return clearTimeout(T),T=setTimeout(()=>{c.message.warning(V||a("ap.apUpload.maxUploadFiles",{maxCount:i}))}),h(t),!1;if(t.size>b*1024*1024)return c.message.warning(L||a("ap.apUpload.maxUploadFileSize",{maxSize:b})),h(t),!1;if(!A.fileMatchesAccept(t,k))return c.message.warning(O||a("ap.apUpload.fileFormatNotSupported")),h(t),!1;if(typeof j=="function"&&await j(t)===!1)return h(t),!1;i&&i===1&&(p=[],r.value=void 0),p.push(t)}async function G(t){if(d.value++,typeof _=="function"){_({onProgress:o=>{setTimeout(()=>{t.onProgress({percent:o})})},onError:o=>{y&&c.message.warning(o||a("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:o,message:o})}),d.value--},onSuccess:o=>{setTimeout(()=>{t.onSuccess(o)}),r.value=[...r.value||[],x.getReturnData(w,o,t.file.name)],u.push({uid:t.file.uid,path:o}),d.value--},file:t.file});return}try{const o=await(U?g(U):g()),n=await C.getOssInstance(async()=>o);t.file.oss=n,I({file:t.file,dirName:R,oss:n,successCallBack(s){t.onSuccess(s),r.value=[...r.value||[],x.getReturnData(w,s,t.file.name)],u.push({uid:t.file.uid,path:s}),d.value--},errorCallBack(s){y&&c.message.warning(s||a("ap.apUpload.networkAnomaly")),t.onError({name:s,message:s}),d.value--},progressCallBack(s){t.onProgress({percent:s})},baseDirName:B,bucket:o?.bucket})}catch(o){y&&c.message.warning(typeof o?.message=="string"?o.message:a("ap.apUpload.networkAnomaly")),t.onError({name:o?.message||a("ap.apUpload.networkAnomaly"),message:o?.message||a("ap.apUpload.networkAnomaly")}),d.value--}}function W(t){if(E&&E?.(t),t.response){if(Array.isArray(r.value)){const n=u.findIndex(s=>s.uid===t.uid);n>=0&&(r?.value.splice(n,1),u.splice(n,1)),r.value.length===0&&(r.value=void 0)}}else t?.oss?.pauseUpload();const o=p.findIndex(n=>n.uid===t.uid);return p.splice(o,1),Promise.resolve(!0)}const H=async t=>{if(N.value?.trigger){let o=[t].map(n=>({objectName:n.response,fileName:n.name}));N.value?.trigger?.(o)}else{const o=t.response?.match(/^([^:]+):(.*)$/),n=o?.[1],s=o?.[2]??t.response;(await C.getOssInstance(()=>n?g?.(n):g?.())).downloadFile([{path:s,fileName:t.name}])}},J=t=>{(typeof l=="function"?l(t):l)&&Y.ApFilePreview.createFilePreviewModal({src:t.response,fileName:t.name})},K=t=>(typeof l=="function"?l(t):l)?["done"].includes(t.status):!1;return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(P)()]:!0,[e.unref(S)??""]:!0})},[e.createVNode(e.unref(c.Upload),{ref_key:"uploadRef",ref:m,accept:e.unref(k),multiple:"","max-count":e.unref(i),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},"before-upload":$,"custom-request":G,"show-upload-list":{showDownloadIcon:e.unref(z),showRemoveIcon:!0,showPreviewIcon:e.unref(l)},onPreview:J,onRemove:W,onDownload:H},{downloadIcon:e.withCtx(()=>[e.createVNode(e.unref(X.IconApAdLineDownload),{class:"anticon anticon-vertical-align-bottom"})]),itemRender:e.withCtx(({originNode:n,file:s})=>[e.createVNode(e.unref(c.Tooltip),null,e.createSlots({default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n)))]),_:2},[K(s)?{name:"title",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("ap.apAppendix.previewFile")),1)]),key:"0"}:void 0]),1024)]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createVNode(e.unref(c.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(Q.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(f)=="string"?(e.openBlock(),e.createElementBlock("div",ae,e.toDisplayString(e.unref(f)||`${e.unref(a)("ap.apUpload.supportExtension")}:${e.unref(A.getAcceptText)(e.unref(k))}`),1)):e.unref(f)?(e.openBlock(),e.createElementBlock("div",re,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","max-count","show-upload-list"])],2))}});exports.default=ie;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApValueSelectCardProps, ApValueSelectCardOption } from './interface';
|
|
2
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, ComputedRef, VNode
|
|
2
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, Ref, ComputedRef, VNode } 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,9 +45,7 @@ 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
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}> & {
|
|
48
|
+
}>) => VNode & {
|
|
51
49
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
52
50
|
};
|
|
53
51
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
4
4
|
declare const _default: DefineComponent<ApViewProps, {
|
|
5
5
|
setFirstDefaultSystemView: (value: boolean) => void;
|
|
6
6
|
setInitToUrl: (value: boolean) => void;
|
|
7
|
-
|
|
7
|
+
getMountedData: () => Recordable;
|
|
8
8
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApViewProps> & Readonly<{}>, {
|
|
9
9
|
manual: boolean;
|
|
10
10
|
maxViewNum: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=require("@aplus-frontend/utils"),G=require("../../ap-form/context.js"),$=require("../../ap-table/context.js");require("../../config-provider/index.js");const z=require("../ap-batch-action-group/index.js");require("./components/main-button-content.vue.js");require("./components/menu-list-content.vue.js");const R=require("./hooks/use-send-to-url.js"),H=require("./hooks/use-view-provide.js"),J=require("./icons/line-down.vue.js"),Q=require("./style/index.js"),v=require("./utils/enum.js"),X=require("../../config-provider/hooks/use-global-config.js"),Z=require("../../config-provider/hooks/use-namespace.js"),ee=require("../../config-provider/hooks/use-locale.js"),te=require("./components/main-button-content.vue2.js"),ae=require("./components/menu-list-content.vue2.js"),se=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},extraUrlParams:{}},setup(F,{expose:C}){const s=F,E=X.useGlobalConfig("viewCacheOption"),{b:p}=Z.useNamespace("ap-view"),{t:q}=ee.useLocale(),K=Q.default("ap-view"),y=e.computed(()=>({viewKey:v.SYSTEM_VIEW_KEY,viewName:q("ap.apView.systemView")})),{getSearchFormValues:I,setSearchFormValues:U,submit:x,reset:N,submitWith:M,getSearchFormSorterItems:Y,setSearchFormSorterItems:P,resetSearchFormSorterItems:O}=$.useInjectApTable(),{model:B}=G.useInjectForm(),L=e.ref(!1),V=e.ref(!1),d=e.ref("");let l=!1,b=!1,S=!0;const W={dropdownType:"dropdown",content:e.createVNode(te.default,{maxViewNum:s.maxViewNum},null)},i=e.ref([y.value]),j=e.computed(()=>i.value.map(a=>({id:a.viewKey,content:e.createVNode(ae.default,{view:a},null)}))),o={getSearchFormValues:I,setSearchFormValues:U,submit:x,reset:N,submitWith:M,getSearchFormSorterItems:Y,setSearchFormSorterItems:P,resetSearchFormSorterItems:O,...s.saveDataSource},w={...E.value,...s.viewCacheOption},{mountedData:_,isValidMountedData:g}=R.useSendToUrl({saveDataSource:o,sendToUrl:e.computed(()=>s.sendToUrl),tableKey:e.computed(()=>s.tableKey),searchFormModel:e.computed(()=>s?.saveDataSource?.searchFormModel||B?.value),extraUrlParams:e.computed(()=>s.extraUrlParams)}),D=()=>s.isDefaultSystemView||(s.isFirstDefaultSystemView||b)&&l?v.SYSTEM_VIEW_KEY:i.value.find(r=>r.isDefault)?.viewKey??v.SYSTEM_VIEW_KEY,c=a=>{d.value=a;const r=i.value.find(t=>t.viewKey===d.value);r&&setTimeout(()=>{r.viewKey===v.SYSTEM_VIEW_KEY?l?s.manual||(s.sendToUrl&&S&&s.initToUrl&&g.value&&o?.setSearchFormValues?.(_.value),o?.submitWith?.()):s.manual||(o?.resetSearchFormSorterItems?.(),o?.reset?.()):(s.sendToUrl&&S&&s.initToUrl&&g.value&&l?o?.setSearchFormValues?.(_.value):o?.setSearchFormValues?.({...Object.fromEntries(Object.keys(o?.getSearchFormValues?.()??{}).map(t=>[t,void 0]))??{},...s?.emptyData??{},...[...o?.getSearchFormSorterItems?.()??[],...s?.extraParams?.map(t=>({name:t}))??[]].reduce((t,n)=>(r.viewConfig?.searchForm?.[n.name]&&(t[n.name]=r.viewConfig?.searchForm?.[n.name]),t),{})??{}}),o?.setSearchFormSorterItems?.(r.viewConfig?.sorterItems??[]),l?s.manual||o?.submitWith?.():o?.submit?.()),l=!1})},T={getViewList:async a=>{try{const{tableKey:r}=a,t=await w?.getViewList?.({tableKey:r});return i.value=[y.value,...t??[]],c(D()),i.value}catch{return i.value=[y.value],c(v.SYSTEM_VIEW_KEY),i.value}},addView:async a=>{const{tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await w?.addView?.({tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(i.value=i.value.map(m=>({...m,isDefault:!1}))),i.value=[...i.value,{viewKey:t,viewName:n,isDefault:u,viewConfig:f}],c(t)},changeView:async a=>{const{tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}=a;await w?.changeView?.({tableKey:r,viewKey:t,viewName:n,isDefault:u,viewConfig:f}),u&&(i.value=i.value.map(h=>({...h,isDefault:!1})));const m=i.value.find(h=>h.viewKey===t);m&&(m.viewName=n,m.isDefault=u,m.viewConfig=f),c(t)},removeView:async a=>{const{tableKey:r,viewKey:t}=a;await w?.removeView?.({tableKey:r,viewKey:t}),i.value=i.value.filter(n=>n.viewKey!==t),t===d.value&&c(D())}},k={tableKey:e.computed(()=>s.tableKey),currentViewKey:d,changeCurrentViewKey:c,popoverOpen:L,menuOpen:V,viewList:i,viewListCRUD:T,saveDataSource:o};return H.useViewProvide(k),e.watch(()=>s.tableKey,a=>{A.isValid(a)&&(l=!0,T?.getViewList?.({tableKey:a}))},{immediate:!0}),C({setFirstDefaultSystemView:a=>{b=a},setInitToUrl:a=>{S=a},getMountedData:()=>_.value}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(z.ApBatchActionGroup),e.mergeProps({...a.$attrs},{open:V.value,"onUpdate:open":r[0]||(r[0]=t=>V.value=t),class:[e.unref(p)(),e.unref(K)],"button-props":W,"menu-list":j.value,"overlay-class-name":[e.unref(p)("overlay"),e.unref(K)],trigger:"click",placement:"bottom"}),{icon:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(p)("icon")])},[e.createVNode(J.default)],2)]),_:1},16,["open","class","menu-list","overlay-class-name"]))}});exports.default=se;
|
|
@@ -1,13 +1,12 @@
|
|
|
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,
|
|
4
|
+
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, 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';
|
|
11
10
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { OnCleanup } from '@vue/reactivity';
|
|
@@ -110,7 +109,7 @@ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOp
|
|
|
110
109
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
111
110
|
readonly initialValues?: Recordable | undefined;
|
|
112
111
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
113
|
-
readonly syncToUrl?:
|
|
112
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
114
113
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
115
114
|
readonly autoFocusFirstInput?: boolean | undefined;
|
|
116
115
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|