@aplus-frontend/ui 7.18.1 → 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.
Files changed (137) hide show
  1. package/es/src/ag-grid/context.mjs +1 -1
  2. package/es/src/ag-grid/editable/form-item.vue.d.ts +4 -2
  3. package/es/src/ag-grid/editable/index.vue.d.ts +4 -2
  4. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  5. package/es/src/ag-grid/index.vue.d.ts +4 -2
  6. package/es/src/ap-field/cascader/use-options.d.ts +4 -4
  7. package/es/src/ap-field/date/index.vue.d.ts +1 -0
  8. package/es/src/ap-field/date-range/index.vue.d.ts +1 -0
  9. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  10. package/es/src/ap-field/text/password.vue.d.ts +4 -4
  11. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  12. package/es/src/ap-form/ap-form.vue.d.ts +2 -1
  13. package/es/src/ap-form/context.mjs +1 -1
  14. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -3
  15. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  16. package/es/src/ap-form/item-group/helper.mjs +2 -2
  17. package/es/src/ap-form/items/date/index.vue.d.ts +11 -9
  18. package/es/src/ap-form/items/date-range/index.vue.d.ts +15 -13
  19. package/es/src/ap-form/items/number/index.vue.d.ts +3 -2
  20. package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
  21. package/es/src/ap-form/modal-form/index.vue.d.ts +4 -3
  22. package/es/src/ap-form/provider/context.mjs +1 -1
  23. package/es/src/ap-form/search-form/index.vue.d.ts +4 -3
  24. package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
  25. package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
  26. package/es/src/ap-grid/index.vue.d.ts +4 -2
  27. package/es/src/ap-grid/utils/table.mjs +2 -2
  28. package/es/src/ap-list/index.vue.d.ts +4 -2
  29. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  30. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  31. package/es/src/ap-table/ap-table.vue.d.ts +4 -2
  32. package/es/src/ap-table/components/setting/context.mjs +1 -1
  33. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  34. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
  35. package/es/src/ap-table/constants.d.ts +22 -20
  36. package/es/src/ap-table/context.mjs +1 -1
  37. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  38. package/es/src/ap-table/utils.mjs +1 -1
  39. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  40. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  41. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  42. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  43. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +3 -1
  44. package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
  45. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
  46. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  47. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  48. package/es/src/business/ap-select-layout/index.d.ts +4 -2
  49. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
  50. package/es/src/business/ap-table-modal/index.d.ts +5 -17
  51. package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  52. package/es/src/business/ap-value-select-card/index.vue.d.ts +4 -2
  53. package/es/src/business/ap-view/ap-view.vue.d.ts +5 -0
  54. package/es/src/business/ap-view/ap-view.vue2.mjs +142 -122
  55. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
  56. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
  57. package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
  58. package/es/src/business/ap-view/hooks/use-send-to-url.mjs +38 -0
  59. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  60. package/es/src/business/ap-view/index.d.ts +13 -0
  61. package/es/src/business/ap-view/interface.d.ts +10 -0
  62. package/es/src/business/ap-view/utils/query.d.ts +4 -0
  63. package/es/src/business/ap-view/utils/query.mjs +26 -0
  64. package/es/src/check-card/context.mjs +1 -1
  65. package/es/src/config-provider/constants.mjs +1 -1
  66. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  67. package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
  68. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  69. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  70. package/es/src/editable-table/form-item.vue.d.ts +4 -2
  71. package/es/src/editable-table/index.vue.d.ts +4 -2
  72. package/es/src/editable-table/utils.mjs +1 -1
  73. package/es/src/scroll-view/index.vue.d.ts +5 -5
  74. package/es/src/tests/wrapper.d.ts +4 -4
  75. package/es/src/text/context.mjs +1 -1
  76. package/es/src/time-ago/useTimeAgo.mjs +1 -1
  77. package/es/src/utils/slot.mjs +1 -1
  78. package/es/src/version.d.ts +1 -1
  79. package/es/src/version.mjs +1 -1
  80. package/lib/src/ag-grid/editable/form-item.vue.d.ts +4 -2
  81. package/lib/src/ag-grid/editable/index.vue.d.ts +4 -2
  82. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  83. package/lib/src/ag-grid/index.vue.d.ts +4 -2
  84. package/lib/src/ap-field/cascader/use-options.d.ts +4 -4
  85. package/lib/src/ap-field/date/index.vue.d.ts +1 -0
  86. package/lib/src/ap-field/date-range/index.vue.d.ts +1 -0
  87. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  88. package/lib/src/ap-field/text/password.vue.d.ts +4 -4
  89. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  90. package/lib/src/ap-form/ap-form.vue.d.ts +2 -1
  91. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -3
  92. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  93. package/lib/src/ap-form/items/date/index.vue.d.ts +11 -9
  94. package/lib/src/ap-form/items/date-range/index.vue.d.ts +15 -13
  95. package/lib/src/ap-form/items/number/index.vue.d.ts +3 -2
  96. package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
  97. package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -3
  98. package/lib/src/ap-form/search-form/index.vue.d.ts +4 -3
  99. package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
  100. package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
  101. package/lib/src/ap-grid/index.vue.d.ts +4 -2
  102. package/lib/src/ap-grid/utils/table.js +1 -1
  103. package/lib/src/ap-list/index.vue.d.ts +4 -2
  104. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  105. package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
  106. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
  107. package/lib/src/ap-table/constants.d.ts +22 -20
  108. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  109. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  110. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  111. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  112. package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
  113. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
  114. package/lib/src/business/ap-select-layout/index.d.ts +4 -2
  115. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
  116. package/lib/src/business/ap-table-modal/index.d.ts +5 -17
  117. package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  118. package/lib/src/business/ap-value-select-card/index.vue.d.ts +4 -2
  119. package/lib/src/business/ap-view/ap-view.vue.d.ts +5 -0
  120. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  121. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
  122. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
  123. package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
  124. package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -0
  125. package/lib/src/business/ap-view/index.d.ts +13 -0
  126. package/lib/src/business/ap-view/interface.d.ts +10 -0
  127. package/lib/src/business/ap-view/utils/query.d.ts +4 -0
  128. package/lib/src/business/ap-view/utils/query.js +1 -0
  129. package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
  130. package/lib/src/editable-table/form-item.vue.d.ts +4 -2
  131. package/lib/src/editable-table/index.vue.d.ts +4 -2
  132. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  133. package/lib/src/tests/wrapper.d.ts +4 -4
  134. package/lib/src/time-ago/useTimeAgo.js +1 -1
  135. package/lib/src/version.d.ts +1 -1
  136. package/lib/src/version.js +1 -1
  137. package/package.json +3 -3
@@ -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: () => Partial<{
48
- current: number;
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: () => Partial<{
160
- current: number;
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,20 +1,21 @@
1
- import { defineComponent as U, computed as K, ref as y, createVNode as b, watch as Y, createBlock as z, openBlock as M, unref as u, mergeProps as R, withCtx as q, createElementVNode as H, normalizeClass as J } from "vue";
2
- import { isValid as Q } from "@aplus-frontend/utils";
3
- import { useInjectApTable as X } from "../../ap-table/context.mjs";
1
+ import { defineComponent as z, computed as c, ref as d, createVNode as g, watch as R, createBlock as q, openBlock as H, unref as f, mergeProps as J, withCtx as Q, createElementVNode as X, normalizeClass as Z } from "vue";
2
+ import { isValid as ee } from "@aplus-frontend/utils";
3
+ import { useInjectApTable as te } from "../../ap-table/context.mjs";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApBatchActionGroup as Z } from "../ap-batch-action-group/index.mjs";
5
+ import { ApBatchActionGroup as ae } from "../ap-batch-action-group/index.mjs";
6
6
  import "./components/main-button-content.vue.mjs";
7
7
  import "./components/menu-list-content.vue.mjs";
8
- import { useViewProvide as ee } from "./hooks/use-view-provide.mjs";
9
- import te from "./icons/line-down.vue.mjs";
10
- import ae from "./style/index.mjs";
11
- import { SYSTEM_VIEW_KEY as c } from "./utils/enum.mjs";
12
- import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
13
- import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
15
- import re from "./components/main-button-content.vue2.mjs";
16
- import ne from "./components/menu-list-content.vue2.mjs";
17
- const De = /* @__PURE__ */ U({
8
+ import { useSendToUrl as ie } from "./hooks/use-send-to-url.mjs";
9
+ import { useViewProvide as oe } from "./hooks/use-view-provide.mjs";
10
+ import se from "./icons/line-down.vue.mjs";
11
+ import re from "./style/index.mjs";
12
+ import { SYSTEM_VIEW_KEY as v } from "./utils/enum.mjs";
13
+ import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
14
+ import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
15
+ import { useLocale as me } from "../../config-provider/hooks/use-locale.mjs";
16
+ import ue from "./components/main-button-content.vue2.mjs";
17
+ import ce from "./components/menu-list-content.vue2.mjs";
18
+ const Ie = /* @__PURE__ */ z({
18
19
  name: "ApView",
19
20
  __name: "ap-view",
20
21
  props: {
@@ -37,171 +38,190 @@ const De = /* @__PURE__ */ U({
37
38
  default: !1
38
39
  },
39
40
  emptyData: {},
40
- extraParams: {}
41
+ extraParams: {},
42
+ sendToUrl: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ initToUrl: {
47
+ type: Boolean,
48
+ default: !0
49
+ }
41
50
  },
42
- setup(I, {
43
- expose: N
51
+ setup(N, {
52
+ expose: _
44
53
  }) {
45
- const s = I, _ = ie("viewCacheOption"), {
46
- b: d
47
- } = se("ap-view"), {
48
- t: O
49
- } = oe(), g = ae("ap-view"), V = K(() => ({
50
- viewKey: c,
51
- viewName: O("ap.apView.systemView")
54
+ const a = N, O = le("viewCacheOption"), {
55
+ b: V
56
+ } = ne("ap-view"), {
57
+ t: x
58
+ } = me(), F = re("ap-view"), S = c(() => ({
59
+ viewKey: v,
60
+ viewName: x("ap.apView.systemView")
52
61
  })), {
53
- getSearchFormValues: x,
62
+ getSearchFormValues: B,
54
63
  setSearchFormValues: L,
55
- submit: B,
56
- reset: P,
57
- submitWith: E,
58
- getSearchFormSorterItems: k,
59
- setSearchFormSorterItems: A,
60
- resetSearchFormSorterItems: T
61
- } = X(), W = y(!1), S = y(!1), p = y("");
62
- let f = !1, D = !1;
63
- const j = {
64
+ submit: P,
65
+ reset: E,
66
+ submitWith: k,
67
+ getSearchFormSorterItems: A,
68
+ setSearchFormSorterItems: W,
69
+ resetSearchFormSorterItems: j
70
+ } = te(), G = d(!1), h = d(!1), w = d("");
71
+ let n = !1, C = !1, K = !0;
72
+ const $ = {
64
73
  dropdownType: "dropdown",
65
- content: b(re, {
66
- maxViewNum: s.maxViewNum
74
+ content: g(ue, {
75
+ maxViewNum: a.maxViewNum
67
76
  }, null)
68
- }, i = y([V.value]), G = K(() => i.value.map((t) => ({
77
+ }, o = d([S.value]), M = c(() => o.value.map((t) => ({
69
78
  id: t.viewKey,
70
- content: b(ne, {
79
+ content: g(ce, {
71
80
  view: t
72
81
  }, null)
73
- }))), r = {
74
- getSearchFormValues: x,
82
+ }))), s = {
83
+ getSearchFormValues: B,
75
84
  setSearchFormValues: L,
76
- submit: B,
77
- reset: P,
78
- submitWith: E,
79
- getSearchFormSorterItems: k,
80
- setSearchFormSorterItems: A,
81
- resetSearchFormSorterItems: T,
82
- ...s.saveDataSource
83
- }, v = {
84
- ..._.value,
85
- ...s.viewCacheOption
86
- }, C = () => s.isDefaultSystemView ? c : (s.isFirstDefaultSystemView || D) && f ? c : i.value.find((a) => a.isDefault)?.viewKey ?? c, m = (t) => {
87
- p.value = t;
88
- const a = i.value.find((e) => e.viewKey === p.value);
89
- a && setTimeout(() => {
90
- a.viewKey === c ? f ? s.manual || r?.submitWith?.() : s.manual || (r?.resetSearchFormSorterItems?.(), r?.reset?.()) : (r?.setSearchFormValues?.({
91
- ...Object.fromEntries(Object.keys(r?.getSearchFormValues?.() ?? {}).map((e) => [e, void 0])) ?? {},
92
- ...s?.emptyData ?? {},
93
- ...[...r?.getSearchFormSorterItems?.() ?? [], ...s?.extraParams?.map((e) => ({
85
+ submit: P,
86
+ reset: E,
87
+ submitWith: k,
88
+ getSearchFormSorterItems: A,
89
+ setSearchFormSorterItems: W,
90
+ resetSearchFormSorterItems: j,
91
+ ...a.saveDataSource
92
+ }, y = {
93
+ ...O.value,
94
+ ...a.viewCacheOption
95
+ }, {
96
+ mountedData: b,
97
+ isValidMountedData: T
98
+ } = ie({
99
+ saveDataSource: s,
100
+ sendToUrl: c(() => a.sendToUrl),
101
+ tableKey: c(() => a.tableKey)
102
+ }), U = () => a.isDefaultSystemView ? v : (a.isFirstDefaultSystemView || C) && n ? v : o.value.find((i) => i.isDefault)?.viewKey ?? v, m = (t) => {
103
+ w.value = t;
104
+ const i = o.value.find((e) => e.viewKey === w.value);
105
+ i && setTimeout(() => {
106
+ i.viewKey === v ? n ? a.manual || (a.sendToUrl && K && a.initToUrl && T.value && s?.setSearchFormValues?.(b.value), s?.submitWith?.()) : a.manual || (s?.resetSearchFormSorterItems?.(), s?.reset?.()) : (a.sendToUrl && K && a.initToUrl && T.value && n ? s?.setSearchFormValues?.(b.value) : s?.setSearchFormValues?.({
107
+ ...Object.fromEntries(Object.keys(s?.getSearchFormValues?.() ?? {}).map((e) => [e, void 0])) ?? {},
108
+ ...a?.emptyData ?? {},
109
+ ...[...s?.getSearchFormSorterItems?.() ?? [], ...a?.extraParams?.map((e) => ({
94
110
  name: e
95
- })) ?? []].reduce((e, o) => (a.viewConfig?.searchForm?.[o.name] && (e[o.name] = a.viewConfig?.searchForm?.[o.name]), e), {}) ?? {}
96
- }), r?.setSearchFormSorterItems?.(a.viewConfig?.sorterItems ?? []), f ? s.manual || r?.submitWith?.() : r?.submit?.()), f = !1;
111
+ })) ?? []].reduce((e, r) => (i.viewConfig?.searchForm?.[r.name] && (e[r.name] = i.viewConfig?.searchForm?.[r.name]), e), {}) ?? {}
112
+ }), s?.setSearchFormSorterItems?.(i.viewConfig?.sorterItems ?? []), n ? a.manual || s?.submitWith?.() : s?.submit?.()), n = !1;
97
113
  });
98
- }, F = {
114
+ }, I = {
99
115
  getViewList: async (t) => {
100
116
  try {
101
117
  const {
102
- tableKey: a
103
- } = t, e = await v?.getViewList?.({
104
- tableKey: a
118
+ tableKey: i
119
+ } = t, e = await y?.getViewList?.({
120
+ tableKey: i
105
121
  });
106
- return i.value = [V.value, ...e ?? []], m(C()), i.value;
122
+ return o.value = [S.value, ...e ?? []], m(U()), o.value;
107
123
  } catch {
108
- return i.value = [V.value], m(c), i.value;
124
+ return o.value = [S.value], m(v), o.value;
109
125
  }
110
126
  },
111
127
  addView: async (t) => {
112
128
  const {
113
- tableKey: a,
129
+ tableKey: i,
114
130
  viewKey: e,
115
- viewName: o,
116
- isDefault: n,
117
- viewConfig: w
131
+ viewName: r,
132
+ isDefault: l,
133
+ viewConfig: p
118
134
  } = t;
119
- await v?.addView?.({
120
- tableKey: a,
135
+ await y?.addView?.({
136
+ tableKey: i,
121
137
  viewKey: e,
122
- viewName: o,
123
- isDefault: n,
124
- viewConfig: w
125
- }), n && (i.value = i.value.map((l) => ({
126
- ...l,
138
+ viewName: r,
139
+ isDefault: l,
140
+ viewConfig: p
141
+ }), l && (o.value = o.value.map((u) => ({
142
+ ...u,
127
143
  isDefault: !1
128
- }))), i.value = [...i.value, {
144
+ }))), o.value = [...o.value, {
129
145
  viewKey: e,
130
- viewName: o,
131
- isDefault: n,
132
- viewConfig: w
146
+ viewName: r,
147
+ isDefault: l,
148
+ viewConfig: p
133
149
  }], m(e);
134
150
  },
135
151
  changeView: async (t) => {
136
152
  const {
137
- tableKey: a,
153
+ tableKey: i,
138
154
  viewKey: e,
139
- viewName: o,
140
- isDefault: n,
141
- viewConfig: w
155
+ viewName: r,
156
+ isDefault: l,
157
+ viewConfig: p
142
158
  } = t;
143
- await v?.changeView?.({
144
- tableKey: a,
159
+ await y?.changeView?.({
160
+ tableKey: i,
145
161
  viewKey: e,
146
- viewName: o,
147
- isDefault: n,
148
- viewConfig: w
149
- }), n && (i.value = i.value.map((h) => ({
150
- ...h,
162
+ viewName: r,
163
+ isDefault: l,
164
+ viewConfig: p
165
+ }), l && (o.value = o.value.map((D) => ({
166
+ ...D,
151
167
  isDefault: !1
152
168
  })));
153
- const l = i.value.find((h) => h.viewKey === e);
154
- l && (l.viewName = o, l.isDefault = n, l.viewConfig = w), m(e);
169
+ const u = o.value.find((D) => D.viewKey === e);
170
+ u && (u.viewName = r, u.isDefault = l, u.viewConfig = p), m(e);
155
171
  },
156
172
  removeView: async (t) => {
157
173
  const {
158
- tableKey: a,
174
+ tableKey: i,
159
175
  viewKey: e
160
176
  } = t;
161
- await v?.removeView?.({
162
- tableKey: a,
177
+ await y?.removeView?.({
178
+ tableKey: i,
163
179
  viewKey: e
164
- }), i.value = i.value.filter((o) => o.viewKey !== e), e === p.value && m(C());
180
+ }), o.value = o.value.filter((r) => r.viewKey !== e), e === w.value && m(U());
165
181
  }
166
- }, $ = {
167
- tableKey: K(() => s.tableKey),
168
- currentViewKey: p,
182
+ }, Y = {
183
+ tableKey: c(() => a.tableKey),
184
+ currentViewKey: w,
169
185
  changeCurrentViewKey: m,
170
- popoverOpen: W,
171
- menuOpen: S,
172
- viewList: i,
173
- viewListCRUD: F,
174
- saveDataSource: r
186
+ popoverOpen: G,
187
+ menuOpen: h,
188
+ viewList: o,
189
+ viewListCRUD: I,
190
+ saveDataSource: s
175
191
  };
176
- return ee($), Y(() => s.tableKey, (t) => {
177
- Q(t) && (f = !0, F?.getViewList?.({
192
+ return oe(Y), R(() => a.tableKey, (t) => {
193
+ ee(t) && (n = !0, I?.getViewList?.({
178
194
  tableKey: t
179
195
  }));
180
196
  }, {
181
197
  immediate: !0
182
- }), N({
198
+ }), _({
183
199
  setFirstDefaultSystemView: (t) => {
184
- D = t;
185
- }
186
- }), (t, a) => (M(), z(u(Z), R({
200
+ C = t;
201
+ },
202
+ setInitToUrl: (t) => {
203
+ K = t;
204
+ },
205
+ mountedData: c(() => b.value)
206
+ }), (t, i) => (H(), q(f(ae), J({
187
207
  ...t.$attrs
188
208
  }, {
189
- open: S.value,
190
- "onUpdate:open": a[0] || (a[0] = (e) => S.value = e),
191
- class: [u(d)(), u(g)],
192
- "button-props": j,
193
- "menu-list": G.value,
194
- "overlay-class-name": [u(d)("overlay"), u(g)],
209
+ open: h.value,
210
+ "onUpdate:open": i[0] || (i[0] = (e) => h.value = e),
211
+ class: [f(V)(), f(F)],
212
+ "button-props": $,
213
+ "menu-list": M.value,
214
+ "overlay-class-name": [f(V)("overlay"), f(F)],
195
215
  trigger: "click",
196
216
  placement: "bottom"
197
217
  }), {
198
- icon: q(() => [H("div", {
199
- class: J([u(d)("icon")])
200
- }, [b(te)], 2)]),
218
+ icon: Q(() => [X("div", {
219
+ class: Z([f(V)("icon")])
220
+ }, [g(se)], 2)]),
201
221
  _: 1
202
222
  }, 16, ["open", "class", "menu-list", "overlay-class-name"]));
203
223
  }
204
224
  });
205
225
  export {
206
- De as default
226
+ Ie as default
207
227
  };
@@ -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,38 @@
1
+ import { isObjectWithContent as c } from "@aplus-frontend/utils";
2
+ import { ref as d, onMounted as m, onUnmounted as f, computed as n } from "vue";
3
+ import { getUrlQuery as v, setUrlQuery as p } from "../utils/query.mjs";
4
+ const U = (u) => {
5
+ const { saveDataSource: s, sendToUrl: i, tableKey: o } = u;
6
+ let a, e, r = !1;
7
+ const t = d({});
8
+ return m(() => {
9
+ if (i?.value) {
10
+ try {
11
+ t.value = JSON.parse(
12
+ atob(v()[o.value] ?? "")
13
+ );
14
+ } catch {
15
+ t.value = {};
16
+ }
17
+ a = setInterval(() => {
18
+ try {
19
+ const l = btoa(
20
+ JSON.stringify(s?.getSearchFormValues?.() ?? {})
21
+ );
22
+ l !== e && (e = l, r = !0);
23
+ } catch {
24
+ e = "";
25
+ }
26
+ r && (p({ [o.value]: e }), r = !1);
27
+ }, 500);
28
+ }
29
+ }), f(() => {
30
+ a && clearInterval(a);
31
+ }), {
32
+ mountedData: n(() => t.value),
33
+ isValidMountedData: n(() => c(t.value))
34
+ };
35
+ };
36
+ export {
37
+ U as useSendToUrl
38
+ };
@@ -1,5 +1,5 @@
1
1
  import { provide as t, inject as r } from "vue";
2
- const o = /* @__PURE__ */ Symbol("provideKey"), n = (e) => {
2
+ const o = Symbol("provideKey"), n = (e) => {
3
3
  t(o, e);
4
4
  }, c = () => r(o);
5
5
  export {
@@ -1,14 +1,19 @@
1
1
  import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps, Plugin } from 'vue';
2
2
  import { ApViewProps } from './interface';
3
+ import { Recordable } from '../../type';
3
4
  export * from './interface';
4
5
  declare const ApView: {
5
6
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApViewProps> & Readonly<{}>, {
6
7
  setFirstDefaultSystemView: (value: boolean) => void;
8
+ setInitToUrl: (value: boolean) => void;
9
+ mountedData: Recordable;
7
10
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
8
11
  manual: boolean;
9
12
  maxViewNum: number;
13
+ sendToUrl: boolean;
10
14
  isDefaultSystemView: boolean;
11
15
  isFirstDefaultSystemView: boolean;
16
+ initToUrl: boolean;
12
17
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
13
18
  P: {};
14
19
  B: {};
@@ -18,22 +23,30 @@ declare const ApView: {
18
23
  Defaults: {};
19
24
  }, Readonly< ApViewProps> & Readonly<{}>, {
20
25
  setFirstDefaultSystemView: (value: boolean) => void;
26
+ setInitToUrl: (value: boolean) => void;
27
+ mountedData: Recordable;
21
28
  }, {}, {}, {}, {
22
29
  manual: boolean;
23
30
  maxViewNum: number;
31
+ sendToUrl: boolean;
24
32
  isDefaultSystemView: boolean;
25
33
  isFirstDefaultSystemView: boolean;
34
+ initToUrl: boolean;
26
35
  }>;
27
36
  __isFragment?: never;
28
37
  __isTeleport?: never;
29
38
  __isSuspense?: never;
30
39
  } & ComponentOptionsBase<Readonly< ApViewProps> & Readonly<{}>, {
31
40
  setFirstDefaultSystemView: (value: boolean) => void;
41
+ setInitToUrl: (value: boolean) => void;
42
+ mountedData: Recordable;
32
43
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
33
44
  manual: boolean;
34
45
  maxViewNum: number;
46
+ sendToUrl: boolean;
35
47
  isDefaultSystemView: boolean;
36
48
  isFirstDefaultSystemView: boolean;
49
+ initToUrl: boolean;
37
50
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
38
51
  $props: {
39
52
  onClick?: () => void;
@@ -90,7 +90,17 @@ export interface ApViewProps {
90
90
  * 视图额外需要被设置的参数Key
91
91
  */
92
92
  extraParams?: string[];
93
+ /**
94
+ * 是否将参数保存在url,默认为 true,设置为 false 后,searchForm 将不会将参数保存在url上
95
+ */
96
+ sendToUrl?: boolean;
97
+ /**
98
+ * 是否在第一次进入页面时将参数保存在url回显在 searchForm,默认为 true,设置为 false 后,第一次进入页面时 searchForm 将不会将参数保存在url上
99
+ */
100
+ initToUrl?: boolean;
93
101
  }
94
102
  export interface ApViewExpose {
95
103
  setFirstDefaultSystemView: (value: boolean) => void;
104
+ setInitToUrl: (value: boolean) => void;
105
+ mountedData: Recordable;
96
106
  }
@@ -0,0 +1,4 @@
1
+ export declare function setUrlQuery(params: Record<string, string>): void;
2
+ export declare function getUrlQuery(): {
3
+ [k: string]: string;
4
+ };
@@ -0,0 +1,26 @@
1
+ function i(t) {
2
+ const e = new URL(window.location.href);
3
+ if (window.location.hash.startsWith("#/")) {
4
+ const [n, r = ""] = window.location.hash.split("?"), s = new URLSearchParams(r);
5
+ Object.entries(t).forEach(([o, c]) => {
6
+ s.set(o, c);
7
+ });
8
+ const a = `${n}?${s.toString()}`;
9
+ window.history.replaceState(null, "", a);
10
+ } else
11
+ Object.entries(t).forEach(([n, r]) => {
12
+ e.searchParams.set(n, r);
13
+ }), window.history.replaceState(null, "", e.toString());
14
+ }
15
+ function h() {
16
+ const t = window.location.hash;
17
+ if (t.includes("?")) {
18
+ const e = t.split("?")[1];
19
+ return Object.fromEntries(new URLSearchParams(e));
20
+ }
21
+ return Object.fromEntries(new URLSearchParams(window.location.search));
22
+ }
23
+ export {
24
+ h as getUrlQuery,
25
+ i as setUrlQuery
26
+ };