@aplus-frontend/ui 0.4.10 → 0.4.12

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 (106) hide show
  1. package/es/index.mjs +42 -36
  2. package/es/src/ap-field/date/index.vue.mjs +98 -65
  3. package/es/src/ap-field/date-range/index.vue.mjs +107 -71
  4. package/es/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
  5. package/es/src/ap-field/hooks/use-date-timezone.mjs +10 -0
  6. package/es/src/ap-field/hooks/use-default-presets.d.ts +10 -6
  7. package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
  8. package/es/src/ap-field/interface.d.ts +8 -2
  9. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +8 -2
  10. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +95 -90
  11. package/es/src/business/ap-ladder/index.d.ts +4 -1
  12. package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  13. package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
  14. package/es/src/config-provider/hooks/use-locale.mjs +7 -7
  15. package/es/src/full-screen/index.d.ts +3 -0
  16. package/es/src/full-screen/index.mjs +2 -0
  17. package/es/src/full-screen/index.vue.d.ts +43 -0
  18. package/es/src/full-screen/index.vue.mjs +85 -0
  19. package/es/src/full-screen/index.vue2.mjs +4 -0
  20. package/es/src/full-screen/interface.d.ts +50 -0
  21. package/es/src/full-screen/interface.mjs +1 -0
  22. package/es/src/full-screen/style/css.d.ts +0 -0
  23. package/es/src/full-screen/style/css.js +1 -0
  24. package/es/src/full-screen/style/index.d.ts +0 -0
  25. package/es/src/full-screen/style/index.js +1 -0
  26. package/es/src/hooks/index.d.ts +1 -0
  27. package/es/src/hooks/index.mjs +6 -4
  28. package/es/src/hooks/useFullScreen.d.ts +8 -0
  29. package/es/src/hooks/useFullScreen.mjs +51 -0
  30. package/es/src/index.d.ts +2 -0
  31. package/es/src/index.mjs +243 -237
  32. package/es/src/path-map.mjs +3 -1
  33. package/es/src/portal/index.d.ts +3 -0
  34. package/es/src/portal/index.mjs +2 -0
  35. package/es/src/portal/index.vue.d.ts +18 -0
  36. package/es/src/portal/index.vue.mjs +21 -0
  37. package/es/src/portal/index.vue2.mjs +4 -0
  38. package/es/src/portal/interface.d.ts +2 -0
  39. package/es/src/portal/interface.mjs +1 -0
  40. package/es/src/portal/style/css.d.ts +1 -0
  41. package/es/src/portal/style/css.js +1 -0
  42. package/es/src/portal/style/index.d.ts +1 -0
  43. package/es/src/portal/style/index.js +1 -0
  44. package/es/src/utils/data-range-persets.d.ts +23 -40
  45. package/es/src/utils/data-range-persets.mjs +95 -102
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-field/date/index.vue.js +1 -1
  48. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  49. package/lib/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
  50. package/lib/src/ap-field/hooks/use-date-timezone.js +1 -0
  51. package/lib/src/ap-field/hooks/use-default-presets.d.ts +10 -6
  52. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  53. package/lib/src/ap-field/interface.d.ts +8 -2
  54. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +8 -2
  55. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  56. package/lib/src/business/ap-ladder/index.d.ts +4 -1
  57. package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  58. package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
  59. package/lib/src/config-provider/hooks/use-locale.js +1 -1
  60. package/lib/src/full-screen/index.d.ts +3 -0
  61. package/lib/src/full-screen/index.js +1 -0
  62. package/lib/src/full-screen/index.vue.d.ts +43 -0
  63. package/lib/src/full-screen/index.vue.js +1 -0
  64. package/lib/src/full-screen/index.vue2.js +1 -0
  65. package/lib/src/full-screen/interface.d.ts +50 -0
  66. package/lib/src/full-screen/interface.js +1 -0
  67. package/lib/src/full-screen/style/css.cjs +1 -0
  68. package/lib/src/full-screen/style/css.d.ts +0 -0
  69. package/lib/src/full-screen/style/index.cjs +1 -0
  70. package/lib/src/full-screen/style/index.d.ts +0 -0
  71. package/lib/src/hooks/index.d.ts +1 -0
  72. package/lib/src/hooks/index.js +1 -1
  73. package/lib/src/hooks/useFullScreen.d.ts +8 -0
  74. package/lib/src/hooks/useFullScreen.js +1 -0
  75. package/lib/src/index.d.ts +2 -0
  76. package/lib/src/index.js +1 -1
  77. package/lib/src/path-map.js +1 -1
  78. package/lib/src/portal/index.d.ts +3 -0
  79. package/lib/src/portal/index.js +1 -0
  80. package/lib/src/portal/index.vue.d.ts +18 -0
  81. package/lib/src/portal/index.vue.js +1 -0
  82. package/lib/src/portal/index.vue2.js +1 -0
  83. package/lib/src/portal/interface.d.ts +2 -0
  84. package/lib/src/portal/interface.js +1 -0
  85. package/lib/src/portal/style/css.cjs +1 -0
  86. package/lib/src/portal/style/css.d.ts +1 -0
  87. package/lib/src/portal/style/index.cjs +1 -0
  88. package/lib/src/portal/style/index.d.ts +1 -0
  89. package/lib/src/utils/data-range-persets.d.ts +23 -40
  90. package/lib/src/utils/data-range-persets.js +1 -1
  91. package/package.json +3 -3
  92. package/theme/ap-form/ap-form-item.css +5 -1
  93. package/theme/ap-form/ap-form-item.less +8 -1
  94. package/theme/ap-form/index.css +22 -1
  95. package/theme/ap-form/item-text-group.css +14 -0
  96. package/theme/ap-form/item-text-group.less +11 -1
  97. package/theme/ap-form/item-text.css +14 -0
  98. package/theme/ap-form/search-form.css +8 -1
  99. package/theme/ap-form/search-form.less +5 -0
  100. package/theme/ap-table/ap-table.css +22 -1
  101. package/theme/ap-table-modal/index.css +22 -1
  102. package/theme/editable-table/index.css +22 -1
  103. package/theme/full-screen/index.css +6 -0
  104. package/theme/full-screen/index.less +12 -0
  105. package/theme/index.css +28 -1
  106. package/theme/index.less +1 -0
@@ -0,0 +1,85 @@
1
+ import { defineComponent as R, ref as i, watch as E, unref as a, computed as n, openBlock as m, createBlock as d, withCtx as v, resolveDynamicComponent as z, mergeProps as C, renderSlot as F, createElementVNode as N, normalizeClass as S } from "vue";
2
+ import "../hooks/index.mjs";
3
+ import "../portal/index.mjs";
4
+ import "../config-provider/index.mjs";
5
+ import { useScrollLock as h } from "@vueuse/core";
6
+ import { useFullScreen as I } from "../hooks/useFullScreen.mjs";
7
+ import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
8
+ import B from "../portal/index.vue.mjs";
9
+ const H = /* @__PURE__ */ R({
10
+ name: "FullScreen",
11
+ __name: "index",
12
+ props: {
13
+ wrapperElementName: { default: "div" },
14
+ zIndex: { default: 2147483647 }
15
+ },
16
+ setup(L, { expose: w }) {
17
+ const {
18
+ target: f,
19
+ full: b,
20
+ enter: y,
21
+ exit: _
22
+ } = I(), { b: x, bm: g, be: k } = $("full-screen"), t = i(!1), l = i(), p = h(document.body), u = i();
23
+ E(
24
+ () => a(b),
25
+ (e) => {
26
+ e || (t.value = !1, l.value = void 0);
27
+ }
28
+ );
29
+ async function o(e, r = !1) {
30
+ await s(), t.value = !0, l.value = e, e === "browser" ? y(r) : p.value = !0;
31
+ }
32
+ async function s(e = !1) {
33
+ t.value = !1, l.value === "browser" ? await _(e) : p.value = !1, l.value = void 0;
34
+ }
35
+ async function c(e, r = !1) {
36
+ t.value ? l.value !== e ? await o(e, r) : await s(r) : await o(e, r);
37
+ }
38
+ return w({
39
+ target: n(() => a(f)),
40
+ portalRoot: n(() => a(u)),
41
+ full: n(() => a(t)),
42
+ mode: n(() => a(l)),
43
+ enter: o,
44
+ exit: s,
45
+ toggle: c
46
+ }), (e, r) => (m(), d(a(B), {
47
+ to: "body",
48
+ disabled: l.value !== "window"
49
+ }, {
50
+ default: v(() => [
51
+ (m(), d(z(e.wrapperElementName), C({
52
+ ref_key: "target",
53
+ ref: f
54
+ }, e.$attrs, {
55
+ class: [
56
+ a(x)("wrapper"),
57
+ t.value && l.value === "window" ? a(g)("wrapper", "full") : null
58
+ ],
59
+ style: { zIndex: t.value && l.value === "window" ? e.zIndex : "unset" }
60
+ }), {
61
+ default: v(() => [
62
+ F(e.$slots, "default", {
63
+ full: t.value,
64
+ enter: o,
65
+ exit: s,
66
+ toggle: c,
67
+ mode: l.value,
68
+ portalRoot: u.value
69
+ }),
70
+ N("div", {
71
+ ref_key: "portalRootRef",
72
+ ref: u,
73
+ class: S(a(k)("wrapper", "portal-root"))
74
+ }, null, 2)
75
+ ]),
76
+ _: 3
77
+ }, 16, ["class", "style"]))
78
+ ]),
79
+ _: 3
80
+ }, 8, ["disabled"]));
81
+ }
82
+ });
83
+ export {
84
+ H as default
85
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,50 @@
1
+ import { ComputedRef } from 'vue';
2
+ export type FullScreenMode = 'browser' | 'window';
3
+ export type FullScreenProps = {
4
+ /**
5
+ * 容器元素标签名
6
+ */
7
+ wrapperElementName?: string;
8
+ /**
9
+ * 全屏状态下的css zIndex 默认为2^31 - 1
10
+ */
11
+ zIndex?: number;
12
+ };
13
+ export type FullScreenExpose = {
14
+ /**
15
+ * 全屏的目标元素
16
+ */
17
+ target: ComputedRef<HTMLElement>;
18
+ /**
19
+ * 目标元素内用于渲染全局组件的容器
20
+ */
21
+ portalRoot: ComputedRef<HTMLDivElement>;
22
+ /**
23
+ * 当前是否全屏
24
+ */
25
+ full: ComputedRef<boolean>;
26
+ /**
27
+ * 当前的全屏模式
28
+ */
29
+ mode: ComputedRef<FullScreenMode>;
30
+ /**
31
+ * 进入全屏
32
+ * @param mode 全屏模式 窗口全屏/浏览器全屏
33
+ * @param force
34
+ * @returns
35
+ */
36
+ enter: (mode: FullScreenMode, force?: boolean) => Promise<void>;
37
+ /**
38
+ * 退出全屏
39
+ * @param force
40
+ * @returns
41
+ */
42
+ exit: (force?: boolean) => Promise<void>;
43
+ /**
44
+ * 切换全屏状态
45
+ * @param mode 全屏模式
46
+ * @param force
47
+ * @returns
48
+ */
49
+ toggle: (mode: FullScreenMode, force?: boolean) => Promise<void>;
50
+ };
@@ -0,0 +1 @@
1
+
File without changes
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/full-screen/index.css';
File without changes
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/full-screen/index.less';
@@ -2,3 +2,4 @@ export { useMessage } from './useMessage';
2
2
  export { useControllableValue } from './useControllableValue';
3
3
  export { useManualRef } from './useManualRef';
4
4
  export { useThrottleRef } from './useThrottleRef';
5
+ export { useFullScreen } from './useFullScreen';
@@ -1,10 +1,12 @@
1
1
  import { useMessage as r } from "./useMessage.mjs";
2
- import { useControllableValue as f } from "./useControllableValue.mjs";
3
- import { useManualRef as s } from "./useManualRef.mjs";
2
+ import { useControllableValue as t } from "./useControllableValue.mjs";
3
+ import { useManualRef as f } from "./useManualRef.mjs";
4
4
  import { useThrottleRef as a } from "./useThrottleRef.mjs";
5
+ import { useFullScreen as p } from "./useFullScreen.mjs";
5
6
  export {
6
- f as useControllableValue,
7
- s as useManualRef,
7
+ t as useControllableValue,
8
+ p as useFullScreen,
9
+ f as useManualRef,
8
10
  r as useMessage,
9
11
  a as useThrottleRef
10
12
  };
@@ -0,0 +1,8 @@
1
+ import { Ref, WritableComputedRef, ComputedRef } from 'vue';
2
+ export declare const useFullScreen: (target?: Ref<HTMLElement | null | undefined>) => {
3
+ target: WritableComputedRef<HTMLElement | null | undefined, HTMLElement | null | undefined>;
4
+ full: ComputedRef<boolean>;
5
+ enter: (force?: boolean) => Promise<boolean>;
6
+ exit: (force?: boolean) => Promise<boolean>;
7
+ toggle: (force?: boolean) => Promise<boolean>;
8
+ };
@@ -0,0 +1,51 @@
1
+ import { isClient as d } from "@vueuse/core";
2
+ import { computed as c, unref as u, isRef as v, ref as f, watch as p } from "vue";
3
+ const a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new Set();
4
+ d && document.addEventListener("fullscreenchange", () => {
5
+ if (o.forEach((e) => e.value = !1), document.fullscreenElement) {
6
+ const e = a.get(
7
+ document.fullscreenElement
8
+ );
9
+ e && (e.value = !0);
10
+ }
11
+ });
12
+ const E = (e = f(null)) => {
13
+ const i = c({
14
+ get: () => u(e),
15
+ set: (t) => {
16
+ v(e) && (e.value = t);
17
+ }
18
+ }), l = f(!1);
19
+ o.add(l), p(
20
+ () => e.value,
21
+ (t, n) => {
22
+ t && a.set(t, l), n && a.delete(n);
23
+ },
24
+ {
25
+ immediate: !0,
26
+ flush: "post"
27
+ }
28
+ );
29
+ async function r(t = !1) {
30
+ await s();
31
+ const n = u(e);
32
+ return n && (t || !document.fullscreenElement) ? (await n.requestFullscreen(), l.value = !0, !0) : !1;
33
+ }
34
+ async function s(t = !1) {
35
+ const n = u(e);
36
+ return t || n && document.fullscreenElement === n ? (await document.exitFullscreen(), l.value = !1, !0) : !1;
37
+ }
38
+ async function m(t = !1) {
39
+ return await (u(l) ? s(t) : r(t));
40
+ }
41
+ return {
42
+ target: i,
43
+ full: c(() => u(l)),
44
+ enter: r,
45
+ exit: s,
46
+ toggle: m
47
+ };
48
+ };
49
+ export {
50
+ E as useFullScreen
51
+ };
package/es/src/index.d.ts CHANGED
@@ -19,3 +19,5 @@ export * from './editable-table';
19
19
  export * from './ap-descriptions';
20
20
  export * from './scroll-bar';
21
21
  export * from './scroll-view';
22
+ export * from './portal';
23
+ export * from './full-screen';