@aplus-frontend/ui 7.18.0 → 7.19.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) 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/ag-grid/index.vue.mjs +1 -1
  7. package/es/src/ap-field/cascader/use-options.d.ts +4 -4
  8. package/es/src/ap-field/date/index.vue.d.ts +1 -0
  9. package/es/src/ap-field/date-range/index.vue.d.ts +1 -0
  10. package/es/src/ap-field/select/use-select-options.d.ts +2 -2
  11. package/es/src/ap-field/text/password.vue.d.ts +4 -4
  12. package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
  13. package/es/src/ap-form/ap-form.vue.d.ts +2 -1
  14. package/es/src/ap-form/context.mjs +1 -1
  15. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -3
  16. package/es/src/ap-form/item/index.vue.d.ts +6 -6
  17. package/es/src/ap-form/item-group/helper.mjs +2 -2
  18. package/es/src/ap-form/items/date/index.vue.d.ts +11 -9
  19. package/es/src/ap-form/items/date-range/index.vue.d.ts +15 -13
  20. package/es/src/ap-form/items/number/index.vue.d.ts +3 -2
  21. package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
  22. package/es/src/ap-form/modal-form/index.vue.d.ts +4 -3
  23. package/es/src/ap-form/provider/context.mjs +1 -1
  24. package/es/src/ap-form/search-form/index.vue.d.ts +4 -3
  25. package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
  26. package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
  27. package/es/src/ap-grid/index.vue.d.ts +4 -2
  28. package/es/src/ap-grid/utils/table.mjs +2 -2
  29. package/es/src/ap-list/index.vue.d.ts +4 -2
  30. package/es/src/ap-modal/utils/confirm.d.ts +1 -1
  31. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  32. package/es/src/ap-table/ap-table.vue.d.ts +4 -2
  33. package/es/src/ap-table/components/setting/context.mjs +1 -1
  34. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  35. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
  36. package/es/src/ap-table/constants.d.ts +22 -20
  37. package/es/src/ap-table/context.mjs +1 -1
  38. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  39. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +7 -7
  40. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  41. package/es/src/ap-table/utils.mjs +1 -1
  42. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  43. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  44. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  45. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  46. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +3 -1
  47. package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
  48. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
  49. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  50. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  51. package/es/src/business/ap-select-layout/index.d.ts +4 -2
  52. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
  53. package/es/src/business/ap-table-modal/index.d.ts +5 -17
  54. package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  55. package/es/src/business/ap-value-select-card/index.vue.d.ts +4 -2
  56. package/es/src/business/ap-view/ap-view.vue.d.ts +5 -0
  57. package/es/src/business/ap-view/ap-view.vue2.mjs +142 -122
  58. package/es/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
  59. package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
  60. package/es/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
  61. package/es/src/business/ap-view/hooks/use-send-to-url.mjs +38 -0
  62. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  63. package/es/src/business/ap-view/index.d.ts +13 -0
  64. package/es/src/business/ap-view/interface.d.ts +10 -0
  65. package/es/src/business/ap-view/utils/query.d.ts +4 -0
  66. package/es/src/business/ap-view/utils/query.mjs +26 -0
  67. package/es/src/check-card/context.mjs +1 -1
  68. package/es/src/config-provider/constants.mjs +1 -1
  69. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  70. package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
  71. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  72. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  73. package/es/src/editable-table/form-item.vue.d.ts +4 -2
  74. package/es/src/editable-table/index.vue.d.ts +4 -2
  75. package/es/src/editable-table/utils.mjs +1 -1
  76. package/es/src/scroll-view/index.vue.d.ts +5 -5
  77. package/es/src/tests/wrapper.d.ts +4 -4
  78. package/es/src/text/context.mjs +1 -1
  79. package/es/src/time-ago/useTimeAgo.mjs +1 -1
  80. package/es/src/utils/slot.mjs +1 -1
  81. package/es/src/version.d.ts +1 -1
  82. package/es/src/version.mjs +1 -1
  83. package/lib/src/ag-grid/editable/form-item.vue.d.ts +4 -2
  84. package/lib/src/ag-grid/editable/index.vue.d.ts +4 -2
  85. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  86. package/lib/src/ag-grid/index.vue.d.ts +4 -2
  87. package/lib/src/ag-grid/index.vue.js +1 -1
  88. package/lib/src/ap-field/cascader/use-options.d.ts +4 -4
  89. package/lib/src/ap-field/date/index.vue.d.ts +1 -0
  90. package/lib/src/ap-field/date-range/index.vue.d.ts +1 -0
  91. package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
  92. package/lib/src/ap-field/text/password.vue.d.ts +4 -4
  93. package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
  94. package/lib/src/ap-form/ap-form.vue.d.ts +2 -1
  95. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -3
  96. package/lib/src/ap-form/item/index.vue.d.ts +6 -6
  97. package/lib/src/ap-form/items/date/index.vue.d.ts +11 -9
  98. package/lib/src/ap-form/items/date-range/index.vue.d.ts +15 -13
  99. package/lib/src/ap-form/items/number/index.vue.d.ts +3 -2
  100. package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
  101. package/lib/src/ap-form/modal-form/index.vue.d.ts +4 -3
  102. package/lib/src/ap-form/search-form/index.vue.d.ts +4 -3
  103. package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
  104. package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
  105. package/lib/src/ap-grid/index.vue.d.ts +4 -2
  106. package/lib/src/ap-grid/utils/table.js +1 -1
  107. package/lib/src/ap-list/index.vue.d.ts +4 -2
  108. package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
  109. package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
  110. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +3 -2
  111. package/lib/src/ap-table/constants.d.ts +22 -20
  112. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  113. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  114. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +9 -9
  115. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  116. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
  117. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  118. package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
  119. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
  120. package/lib/src/business/ap-select-layout/index.d.ts +4 -2
  121. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
  122. package/lib/src/business/ap-table-modal/index.d.ts +5 -17
  123. package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  124. package/lib/src/business/ap-value-select-card/index.vue.d.ts +4 -2
  125. package/lib/src/business/ap-view/ap-view.vue.d.ts +5 -0
  126. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  127. package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +3 -2
  128. package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +3 -2
  129. package/lib/src/business/ap-view/hooks/use-send-to-url.d.ts +11 -0
  130. package/lib/src/business/ap-view/hooks/use-send-to-url.js +1 -0
  131. package/lib/src/business/ap-view/index.d.ts +13 -0
  132. package/lib/src/business/ap-view/interface.d.ts +10 -0
  133. package/lib/src/business/ap-view/utils/query.d.ts +4 -0
  134. package/lib/src/business/ap-view/utils/query.js +1 -0
  135. package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
  136. package/lib/src/editable-table/form-item.vue.d.ts +4 -2
  137. package/lib/src/editable-table/index.vue.d.ts +4 -2
  138. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  139. package/lib/src/tests/wrapper.d.ts +4 -4
  140. package/lib/src/time-ago/useTimeAgo.js +1 -1
  141. package/lib/src/version.d.ts +1 -1
  142. package/lib/src/version.js +1 -1
  143. package/package.json +1 -1
@@ -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 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e){const t=new URL(window.location.href);if(window.location.hash.startsWith("#/")){const[r,n=""]=window.location.hash.split("?"),s=new URLSearchParams(n);Object.entries(e).forEach(([a,c])=>{s.set(a,c)});const o=`${r}?${s.toString()}`;window.history.replaceState(null,"",o)}else Object.entries(e).forEach(([r,n])=>{t.searchParams.set(r,n)}),window.history.replaceState(null,"",t.toString())}function h(){const e=window.location.hash;if(e.includes("?")){const t=e.split("?")[1];return Object.fromEntries(new URLSearchParams(t))}return Object.fromEntries(new URLSearchParams(window.location.search))}exports.getUrlQuery=h;exports.setUrlQuery=i;
@@ -2,11 +2,7 @@ import { InjectionKey, Ref, ComputedRef } from 'vue';
2
2
  export declare const defaultNamespace = "aplus";
3
3
  export declare const namespaceContextKey: InjectionKey<Ref<string | undefined>>;
4
4
  export declare const useGetDerivedNamespace: (namespaceOverrides?: Ref<string | undefined>) => ComputedRef<string>;
5
- export declare const useNamespace: (
6
- /**
7
- * 块 一般是指组件名
8
- */
9
- block: string, namespaceOverrides?: Ref<string | undefined>) => {
5
+ export declare const useNamespace: (block: string, namespaceOverrides?: Ref<string | undefined>) => {
10
6
  namespace: ComputedRef<string>;
11
7
  b: (blockSuffix?: string) => string;
12
8
  e: (element?: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { EditableColumnType, EditableTableFormItemExpose, EditableTableFormItemProps } from './interface';
2
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
2
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
3
  declare const _default: <RecordType = 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<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableTableFormItemProps<RecordType> & Partial<{}>> & PublicProps;
5
5
  expose(exposed: ShallowUnwrapRef<EditableTableFormItemExpose>): void;
@@ -36,7 +36,9 @@ declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<type
36
36
  }) => void;
37
37
  };
38
38
  emit: {};
39
- }>) => VNode & {
39
+ }>) => VNode<RendererNode, RendererElement, {
40
+ [key: string]: any;
41
+ }> & {
40
42
  __ctx?: Awaited<typeof __VLS_setup>;
41
43
  };
42
44
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { Recordable } from '../type';
2
2
  import { EditableTableProps, EditableColumnType, EditableTableExpose } from './interface';
3
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
4
4
  declare const _default: <RecordType extends Recordable = 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<{
5
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
6
  readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
@@ -39,7 +39,9 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
39
39
  }) => void;
40
40
  };
41
41
  emit: (event: "update:value", ...args: any[]) => void;
42
- }>) => VNode & {
42
+ }>) => VNode<RendererNode, RendererElement, {
43
+ [key: string]: any;
44
+ }> & {
43
45
  __ctx?: Awaited<typeof __VLS_setup>;
44
46
  };
45
47
  export default _default;
@@ -1,4 +1,4 @@
1
- import { ScrollBarDirection, InternalScrollBarProps } from '../scroll-bar';
1
+ import { ScrollBarDirection, InternalScrollBarProps, ColorType } from '../scroll-bar';
2
2
  import { ScrollOptions, ScrollViewProps } from './interface';
3
3
  import { CreateComponentPublicInstanceWithMixins, Ref, ShallowRef, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent, ComputedRef } from 'vue';
4
4
  declare function scroll(x?: number, y?: number): void;
@@ -106,8 +106,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
106
106
  onScroll?: ((percent: number) => void) | undefined;
107
107
  disabled?: boolean | undefined;
108
108
  trackSpeed?: number | undefined;
109
- barColor?: import("csstype").Property.BackgroundColor | undefined;
110
- trackColor?: import("csstype").Property.BackgroundColor | undefined;
109
+ barColor?: ColorType;
110
+ trackColor?: ColorType;
111
111
  trackWidth?: number | undefined;
112
112
  showTrack?: boolean | undefined;
113
113
  onScrollStart?: ((percent: number) => void) | undefined;
@@ -118,8 +118,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
118
118
  onScroll?: ((percent: number) => void) | undefined;
119
119
  disabled?: boolean | undefined;
120
120
  trackSpeed?: number | undefined;
121
- barColor?: import("csstype").Property.BackgroundColor | undefined;
122
- trackColor?: import("csstype").Property.BackgroundColor | undefined;
121
+ barColor?: ColorType;
122
+ trackColor?: ColorType;
123
123
  trackWidth?: number | undefined;
124
124
  showTrack?: boolean | undefined;
125
125
  onScrollStart?: ((percent: number) => void) | undefined;
@@ -1,8 +1,8 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  export declare const Wrapper: DefineComponent<{
3
- uiMode?: "admin" | "aplus" | undefined;
4
- lang?: "en" | "zh-cn" | undefined;
3
+ uiMode?: ("admin" | "aplus") | undefined;
4
+ lang?: ("en" | "zh-cn") | undefined;
5
5
  }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
6
- uiMode?: "admin" | "aplus" | undefined;
7
- lang?: "en" | "zh-cn" | undefined;
6
+ uiMode?: ("admin" | "aplus") | undefined;
7
+ lang?: ("en" | "zh-cn") | undefined;
8
8
  }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("dayjs"),r=require("vue"),b=require("./utils.js");function s(n,u){const t=Math.abs(n-u),e={diffMs:t,type:n<u?"ago":"late",diffFormatted:b.formatDuration(t)};return t<60*1e3?(e.unit="s",e.count=Math.round(t/1e3)):t<3600*1e3?(e.unit="m",e.count=Math.round(t/(60*1e3))):t<1440*60*1e3?(e.unit="h",e.count=Math.round(t/(3600*1e3))):t<720*60*60*1e3?(e.unit="d",e.count=Math.round(t/(1440*60*1e3))):t<365*24*60*60*1e3?(e.unit="M",e.count=Math.round(t/(720*60*60*1e3))):(e.unit="y",e.count=Math.round(t/365/(1440*60*1e3))),e}function i(n){return h(n).valueOf()}let p=1;function v(){return p++}const o=new Map;let l,c;function M(n,u){o.set(n,u),o.size&&!c&&(clearInterval(l),l=setInterval(()=>{c=!0;const t=Date.now();o.forEach(e=>{e.interval&&Math.abs(t-e.updated-e.interval)<50&&(e.timeAgo.value=s(e.ts,t),e.updated=t)})},5e3))}function m(n){o.delete(n),o.size||(clearInterval(l),c=!1)}const T=(n,u,t)=>{const e=v(),a=r.ref(s(i(n.value),i(u))),f={ts:i(n.value),timeAgo:a,interval:t.value,updated:Date.now()};return r.watch(()=>n.value,g=>{const d=i(g);f.ts=d,a.value=s(d,i(u))}),M(e,f),r.onBeforeUnmount(()=>{m(e)}),a};exports.default=T;exports.getId=v;exports.getTimeAgo=s;exports.subscribe=M;exports.unsubscribe=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("dayjs"),r=require("vue"),b=require("./utils.js");function s(n,u){const t=Math.abs(n-u),e={diffMs:t,type:n<u?"ago":"late",diffFormatted:b.formatDuration(t)};return t<60*1e3?(e.unit="s",e.count=Math.round(t/1e3)):t<60*60*1e3?(e.unit="m",e.count=Math.round(t/(60*1e3))):t<24*60*60*1e3?(e.unit="h",e.count=Math.round(t/(60*60*1e3))):t<30*24*60*60*1e3?(e.unit="d",e.count=Math.round(t/(24*60*60*1e3))):t<365*24*60*60*1e3?(e.unit="M",e.count=Math.round(t/(30*24*60*60*1e3))):(e.unit="y",e.count=Math.round(t/365/(24*60*60*1e3))),e}function i(n){return h(n).valueOf()}let p=1;function v(){return p++}const o=new Map;let l,c;function M(n,u){o.set(n,u),o.size&&!c&&(clearInterval(l),l=setInterval(()=>{c=!0;const t=Date.now();o.forEach(e=>{e.interval&&Math.abs(t-e.updated-e.interval)<50&&(e.timeAgo.value=s(e.ts,t),e.updated=t)})},5e3))}function m(n){o.delete(n),o.size||(clearInterval(l),c=!1)}const T=(n,u,t)=>{const e=v(),a=r.ref(s(i(n.value),i(u))),f={ts:i(n.value),timeAgo:a,interval:t.value,updated:Date.now()};return r.watch(()=>n.value,g=>{const d=i(g);f.ts=d,a.value=s(d,i(u))}),M(e,f),r.onBeforeUnmount(()=>{m(e)}),a};exports.default=T;exports.getId=v;exports.getTimeAgo=s;exports.subscribe=M;exports.unsubscribe=m;
@@ -1,2 +1,2 @@
1
- declare const _default: "7.18.0";
1
+ declare const _default: "7.19.0-beta.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.18.0";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.0-beta.0";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "7.18.0",
3
+ "version": "7.19.0-beta.0",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "typings": "./lib/index.d.ts",