@gx-design-vue/pro-layout-components 0.1.0-alpha.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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/AppsLogoComponents/AppLogoList.d.ts +24 -0
  4. package/dist/AppsLogoComponents/AppLogoList.js +43 -0
  5. package/dist/AppsLogoComponents/AppsLogo.d.ts +10 -0
  6. package/dist/AppsLogoComponents/AppsLogo.js +12 -0
  7. package/dist/AppsLogoComponents/DefaultContent.d.ts +27 -0
  8. package/dist/AppsLogoComponents/DefaultContent.js +43 -0
  9. package/dist/AppsLogoComponents/SimpleContent.d.ts +38 -0
  10. package/dist/AppsLogoComponents/SimpleContent.js +63 -0
  11. package/dist/AppsLogoComponents/index.d.ts +32 -0
  12. package/dist/AppsLogoComponents/index.js +71 -0
  13. package/dist/AppsLogoComponents/props.d.ts +26 -0
  14. package/dist/AppsLogoComponents/props.js +12 -0
  15. package/dist/AppsLogoComponents/style/default.d.ts +6 -0
  16. package/dist/AppsLogoComponents/style/default.js +70 -0
  17. package/dist/AppsLogoComponents/style/index.d.ts +7 -0
  18. package/dist/AppsLogoComponents/style/index.js +60 -0
  19. package/dist/AppsLogoComponents/style/simple.d.ts +6 -0
  20. package/dist/AppsLogoComponents/style/simple.js +83 -0
  21. package/dist/Icon/components/Paintbrush.d.ts +6 -0
  22. package/dist/Icon/components/Paintbrush.js +21 -0
  23. package/dist/Icon/components/Palette.d.ts +6 -0
  24. package/dist/Icon/components/Palette.js +20 -0
  25. package/dist/Icon/components/index.d.ts +10 -0
  26. package/dist/Icon/components/index.js +11 -0
  27. package/dist/Icon/index.d.ts +37 -0
  28. package/dist/Icon/index.js +24 -0
  29. package/dist/PageLock/Popup.d.ts +43 -0
  30. package/dist/PageLock/Popup.js +68 -0
  31. package/dist/PageLock/UserForm.d.ts +42 -0
  32. package/dist/PageLock/UserForm.js +68 -0
  33. package/dist/PageLock/index.d.ts +52 -0
  34. package/dist/PageLock/index.js +92 -0
  35. package/dist/PageLock/props.d.ts +51 -0
  36. package/dist/PageLock/props.js +29 -0
  37. package/dist/PageLock/style.d.ts +7 -0
  38. package/dist/PageLock/style.js +108 -0
  39. package/dist/PageLock/useFormState.d.ts +16 -0
  40. package/dist/PageLock/useFormState.js +19 -0
  41. package/dist/Paintbrush-EfUpNqey.js +14 -0
  42. package/dist/Palette-B5wq9KtV.js +13 -0
  43. package/dist/RightContent/Search/Panel.d.ts +42 -0
  44. package/dist/RightContent/Search/Panel.js +146 -0
  45. package/dist/RightContent/Search/index.d.ts +50 -0
  46. package/dist/RightContent/Search/index.js +118 -0
  47. package/dist/RightContent/Search/props.d.ts +17 -0
  48. package/dist/RightContent/Search/props.js +15 -0
  49. package/dist/RightContent/Search/style.d.ts +10 -0
  50. package/dist/RightContent/Search/style.js +96 -0
  51. package/dist/RightContent/index.d.ts +407 -0
  52. package/dist/RightContent/index.js +152 -0
  53. package/dist/RightContent/props.d.ts +64 -0
  54. package/dist/RightContent/props.js +63 -0
  55. package/dist/RightContent/style.d.ts +10 -0
  56. package/dist/RightContent/style.js +73 -0
  57. package/dist/ThemeEditor/components/BlockCheckbox.d.ts +39 -0
  58. package/dist/ThemeEditor/components/BlockCheckbox.js +42 -0
  59. package/dist/ThemeEditor/components/RegionalChange.d.ts +21 -0
  60. package/dist/ThemeEditor/components/RegionalChange.js +43 -0
  61. package/dist/ThemeEditor/components/Setting/index.d.ts +52 -0
  62. package/dist/ThemeEditor/components/Setting/index.js +125 -0
  63. package/dist/ThemeEditor/components/SwitchTab/index.d.ts +51 -0
  64. package/dist/ThemeEditor/components/SwitchTab/index.js +52 -0
  65. package/dist/ThemeEditor/components/SwitchTab/style.d.ts +6 -0
  66. package/dist/ThemeEditor/components/SwitchTab/style.js +54 -0
  67. package/dist/ThemeEditor/components/Tokens/Colors/ColorSvg.d.ts +7 -0
  68. package/dist/ThemeEditor/components/Tokens/Colors/ColorSvg.js +453 -0
  69. package/dist/ThemeEditor/components/Tokens/Colors/Primary.d.ts +7 -0
  70. package/dist/ThemeEditor/components/Tokens/Colors/Primary.js +58 -0
  71. package/dist/ThemeEditor/components/Tokens/Colors/Side.d.ts +7 -0
  72. package/dist/ThemeEditor/components/Tokens/Colors/Side.js +18 -0
  73. package/dist/ThemeEditor/components/Tokens/Colors/index.d.ts +7 -0
  74. package/dist/ThemeEditor/components/Tokens/Colors/index.js +15 -0
  75. package/dist/ThemeEditor/components/Tokens/context.d.ts +9 -0
  76. package/dist/ThemeEditor/components/Tokens/context.js +7 -0
  77. package/dist/ThemeEditor/components/Tokens/index.d.ts +45 -0
  78. package/dist/ThemeEditor/components/Tokens/index.js +69 -0
  79. package/dist/ThemeEditor/components/Tokens/utils/config.d.ts +10 -0
  80. package/dist/ThemeEditor/components/Tokens/utils/config.js +8 -0
  81. package/dist/ThemeEditor/components/Trigger.d.ts +21 -0
  82. package/dist/ThemeEditor/components/Trigger.js +46 -0
  83. package/dist/ThemeEditor/context.d.ts +14 -0
  84. package/dist/ThemeEditor/context.js +7 -0
  85. package/dist/ThemeEditor/index.d.ts +841 -0
  86. package/dist/ThemeEditor/index.js +165 -0
  87. package/dist/ThemeEditor/props.d.ts +57 -0
  88. package/dist/ThemeEditor/props.js +40 -0
  89. package/dist/ThemeEditor/style/animate.d.ts +9 -0
  90. package/dist/ThemeEditor/style/animate.js +38 -0
  91. package/dist/ThemeEditor/style/index.d.ts +10 -0
  92. package/dist/ThemeEditor/style/index.js +318 -0
  93. package/dist/ThemeEditor/style/theme.d.ts +6 -0
  94. package/dist/ThemeEditor/style/theme.js +71 -0
  95. package/dist/ThemeEditor/utils/config.d.ts +37 -0
  96. package/dist/ThemeEditor/utils/config.js +132 -0
  97. package/dist/ThemeEditor/utils/index.d.ts +9 -0
  98. package/dist/ThemeEditor/utils/index.js +64 -0
  99. package/dist/hooks/useClockTime/index.d.ts +11 -0
  100. package/dist/hooks/useClockTime/index.js +28 -0
  101. package/dist/index.d.ts +7 -0
  102. package/dist/index.js +5 -0
  103. package/dist/pro-layout-components.esm.js +6258 -0
  104. package/dist/pro-layout-components.js +5 -0
  105. package/dist/utils/index.d.ts +2 -0
  106. package/dist/utils/index.js +3 -0
  107. package/dist/utils/util.d.ts +10 -0
  108. package/dist/utils/util.js +17 -0
  109. package/global.d.ts +10 -0
  110. package/package.json +77 -0
@@ -0,0 +1,83 @@
1
+ //#region src/AppsLogoComponents/style/simple.ts
2
+ const genAppsLogoComponentsSimpleListStyle = (token) => {
3
+ return { "&-content": {
4
+ maxHeight: "calc(100vh - 48px)",
5
+ overflow: "auto",
6
+ "&-list": {
7
+ boxSizing: "border-box",
8
+ maxWidth: 376,
9
+ marginBlock: 0,
10
+ marginInline: 0,
11
+ paddingBlock: 0,
12
+ paddingInline: 0,
13
+ listStyle: "none",
14
+ "&-item": {
15
+ position: "relative",
16
+ display: "inline-block",
17
+ width: 104,
18
+ height: 104,
19
+ marginBlock: 8,
20
+ marginInline: 8,
21
+ paddingInline: 24,
22
+ paddingBlock: 24,
23
+ verticalAlign: "top",
24
+ listStyleType: "none",
25
+ transition: "transform 0.2s cubic-bezier(0.333, 0, 0, 1)",
26
+ borderRadius: token.borderRadius,
27
+ "&-group": {
28
+ marginBottom: 16,
29
+ "&-title": {
30
+ margin: "16px 0 8px 12px",
31
+ fontWeight: 600,
32
+ color: "rgba(0, 0, 0, 0.88)",
33
+ fontSize: 16,
34
+ opacity: .85,
35
+ lineHeight: 1.5,
36
+ "&:first-child": { marginTop: 12 }
37
+ }
38
+ },
39
+ "&:hover": { backgroundColor: token.colorBgTextHover },
40
+ a: {
41
+ display: "flex",
42
+ flexDirection: "column",
43
+ alignItems: "center",
44
+ height: "100%",
45
+ fontSize: 12,
46
+ textDecoration: "none",
47
+ "& > #avatarLogo": {
48
+ width: 40,
49
+ height: 40,
50
+ margin: "0 auto",
51
+ color: token.colorPrimary,
52
+ fontSize: 22,
53
+ lineHeight: "40px",
54
+ textAlign: "center",
55
+ backgroundImage: "linear-gradient(180deg, #E8F0FB 0%, #F6F8FC 100%)",
56
+ borderRadius: token.borderRadius
57
+ },
58
+ "& > img": {
59
+ width: 40,
60
+ height: 40
61
+ },
62
+ "& > div": {
63
+ marginBlockStart: 5,
64
+ marginInlineStart: 0,
65
+ color: token.colorTextHeading,
66
+ fontSize: 14,
67
+ lineHeight: "22px",
68
+ whiteSpace: "nowrap",
69
+ textOverflow: "ellipsis"
70
+ },
71
+ "& > div > span": {
72
+ color: token.colorTextSecondary,
73
+ fontSize: 12,
74
+ lineHeight: "20px"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ } };
80
+ };
81
+
82
+ //#endregion
83
+ export { genAppsLogoComponentsSimpleListStyle };
@@ -0,0 +1,6 @@
1
+ import { FunctionalComponent } from "vue";
2
+
3
+ //#region src/Icon/components/Paintbrush.d.ts
4
+ declare const PaintbrushIcon: FunctionalComponent<any>;
5
+ //#endregion
6
+ export { PaintbrushIcon as default };
@@ -0,0 +1,21 @@
1
+ import { createVNode, mergeProps } from "vue";
2
+
3
+ //#region src/Icon/components/Paintbrush.tsx
4
+ const PaintbrushIcon = (props = {}) => {
5
+ return createVNode("svg", mergeProps({
6
+ "xmlns": "http://www.w3.org/2000/svg",
7
+ "width": "1em",
8
+ "height": "1em",
9
+ "viewBox": "0 0 24 24"
10
+ }, props), [createVNode("g", {
11
+ "fill": "none",
12
+ "fill-rule": "evenodd"
13
+ }, [createVNode("path", { "d": "m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z" }, null), createVNode("path", {
14
+ "fill": "currentColor",
15
+ "d": "m8.464 4.222l12.021 12.02a1.01 1.01 0 0 1 0 1.415l-2.828 2.828a1 1 0 0 1-1.414 0L4.222 8.465a2 2 0 0 1 0-2.829l1.414-1.414a2 2 0 0 1 2.828 0M5 11.5c.444 0 .758.269.95.632l.053.112a3.87 3.87 0 0 0 1.385 1.672l.21.128c.358.202.62.525.62.955c0 .38-.203.68-.5.882l-.115.072a3.8 3.8 0 0 0-1.49 1.573l-.105.22c-.187.422-.512.754-1.008.754c-.452 0-.761-.274-.954-.641l-.054-.113a3.83 3.83 0 0 0-1.384-1.664l-.206-.126c-.359-.202-.621-.526-.621-.957c0-.383.208-.68.505-.883l.116-.072a3.76 3.76 0 0 0 1.482-1.565l.113-.236C4.18 11.826 4.51 11.5 5 11.5m5.586-2.328l-1.414 1.414l7.778 7.778l1.414-1.414zm6.845-1.77c.238-.481.8-.513 1.082-.097l.056.096c.216.435.574.804 1.043 1.04c.494.246.501.87.004 1.116a2.35 2.35 0 0 0-.954.872l-.09.164c-.24.486-.804.518-1.085.102l-.056-.096a2.3 2.3 0 0 0-.872-.945l-.17-.094c-.466-.232-.497-.79-.097-1.063l.092-.054a2.33 2.33 0 0 0 .957-.878l.09-.164ZM7.051 5.635L5.635 7.05l2.121 2.122l1.415-1.415L7.05 5.636ZM13.5 2c.294 0 .51.167.654.399l.06.11c.238.477.618.894 1.11 1.187l.196.107c.275.137.48.373.48.697c0 .283-.157.5-.38.64l-.105.06c-.52.26-.932.654-1.205 1.115l-.1.183c-.14.284-.374.502-.71.502c-.294 0-.51-.167-.654-.399l-.06-.11a2.9 2.9 0 0 0-1.11-1.187l-.196-.107c-.275-.137-.48-.374-.48-.698c0-.282.157-.499.38-.64l.105-.058c.52-.262.932-.654 1.205-1.116l.1-.183c.14-.284.374-.502.71-.502"
16
+ }, null)])]);
17
+ };
18
+ var Paintbrush_default = PaintbrushIcon;
19
+
20
+ //#endregion
21
+ export { Paintbrush_default as default };
@@ -0,0 +1,6 @@
1
+ import { FunctionalComponent } from "vue";
2
+
3
+ //#region src/Icon/components/Palette.d.ts
4
+ declare const PaletteIcon: FunctionalComponent<any>;
5
+ //#endregion
6
+ export { PaletteIcon as default };
@@ -0,0 +1,20 @@
1
+ import { createVNode, mergeProps } from "vue";
2
+
3
+ //#region src/Icon/components/Palette.tsx
4
+ const PaletteIcon = (props = {}) => {
5
+ return createVNode("svg", mergeProps({
6
+ "xmlns": "http://www.w3.org/2000/svg",
7
+ "width": "1em",
8
+ "height": "1em",
9
+ "viewBox": "0 0 16 16"
10
+ }, props), [createVNode("path", {
11
+ "fill": "currentColor",
12
+ "fill-rule": "evenodd",
13
+ "d": "m14.489 8.388l-.001.006a.1.1 0 0 1-.027.028a.43.43 0 0 1-.264.082h-3.186c-3.118 0-4.68 3.77-2.476 5.974a6.5 6.5 0 1 1 5.953-6.09Zm-.292 1.616c.913 0 1.736-.618 1.79-1.529a8 8 0 1 0-7.032 7.468c1.243-.147 1.527-1.639.641-2.525c-1.26-1.26-.367-3.414 1.415-3.414zM10 5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 2a1 1 0 1 1-2 0a1 1 0 0 1 2 0",
14
+ "clip-rule": "evenodd"
15
+ }, null)]);
16
+ };
17
+ var Palette_default = PaletteIcon;
18
+
19
+ //#endregion
20
+ export { Palette_default as default };
@@ -0,0 +1,10 @@
1
+ import * as vue269 from "vue";
2
+
3
+ //#region src/Icon/components/index.d.ts
4
+ declare const components: {
5
+ paintbrush: vue269.FunctionalComponent<any, {}, any, {}>;
6
+ palette: vue269.FunctionalComponent<any, {}, any, {}>;
7
+ };
8
+ type IconType = keyof typeof components;
9
+ //#endregion
10
+ export { IconType, components as default };
@@ -0,0 +1,11 @@
1
+ import { defineAsyncComponent } from "vue";
2
+
3
+ //#region src/Icon/components/index.ts
4
+ const components = {
5
+ paintbrush: defineAsyncComponent(() => import("./Paintbrush.js")),
6
+ palette: defineAsyncComponent(() => import("./Palette.js"))
7
+ };
8
+ var components_default = components;
9
+
10
+ //#endregion
11
+ export { components_default as default };
@@ -0,0 +1,37 @@
1
+ import { IconType } from "./components/index.js";
2
+ import * as vue55 from "vue";
3
+ import { PropType } from "vue";
4
+ import { IconBaseType } from "@gx-design-vue/icon";
5
+ import * as vue_jsx_runtime3 from "vue/jsx-runtime";
6
+
7
+ //#region src/Icon/index.d.ts
8
+ declare const _default: vue55.DefineComponent<vue55.ExtractPropTypes<{
9
+ type: {
10
+ type: PropType<IconType | IconBaseType>;
11
+ required: true;
12
+ };
13
+ class: PropType<string | string[]>;
14
+ onClick: PropType<any>;
15
+ spin: BooleanConstructor;
16
+ style: {
17
+ type: PropType<vue55.CSSProperties>;
18
+ default: () => {};
19
+ };
20
+ }>, () => vue_jsx_runtime3.JSX.Element, {}, {}, {}, vue55.ComponentOptionsMixin, vue55.ComponentOptionsMixin, {}, string, vue55.PublicProps, Readonly<vue55.ExtractPropTypes<{
21
+ type: {
22
+ type: PropType<IconType | IconBaseType>;
23
+ required: true;
24
+ };
25
+ class: PropType<string | string[]>;
26
+ onClick: PropType<any>;
27
+ spin: BooleanConstructor;
28
+ style: {
29
+ type: PropType<vue55.CSSProperties>;
30
+ default: () => {};
31
+ };
32
+ }>> & Readonly<{}>, {
33
+ spin: boolean;
34
+ style: vue55.CSSProperties;
35
+ }, {}, {}, {}, string, vue55.ComponentProvideOptions, true, {}, any>;
36
+ //#endregion
37
+ export { _default as default };
@@ -0,0 +1,24 @@
1
+ import components_default from "./components/index.js";
2
+ import { createVNode, defineComponent, mergeProps } from "vue";
3
+ import { GIcon, defaultIconProps } from "@gx-design-vue/icon";
4
+
5
+ //#region src/Icon/index.tsx
6
+ var Icon_default = /* @__PURE__ */ defineComponent({
7
+ inheritAttrs: false,
8
+ props: {
9
+ ...defaultIconProps,
10
+ type: {
11
+ type: String,
12
+ required: true
13
+ }
14
+ },
15
+ setup(props) {
16
+ return () => createVNode(GIcon, mergeProps(props, {
17
+ "type": props.type,
18
+ "components": components_default
19
+ }), null);
20
+ }
21
+ });
22
+
23
+ //#endregion
24
+ export { Icon_default as default };
@@ -0,0 +1,43 @@
1
+ import * as vue30 from "vue";
2
+ import { PropType } from "vue";
3
+ import * as vue_jsx_runtime1 from "vue/jsx-runtime";
4
+
5
+ //#region src/PageLock/Popup.d.ts
6
+ declare const _default: vue30.DefineComponent<vue30.ExtractPropTypes<{
7
+ password: PropType<string>;
8
+ name: {
9
+ type: PropType<string>;
10
+ default: any;
11
+ };
12
+ avatar: PropType<string>;
13
+ open: {
14
+ type: PropType<boolean>;
15
+ default: any;
16
+ };
17
+ onOpenChange: PropType<(open: boolean) => void>;
18
+ 'onUpdate:open': PropType<(open: boolean) => void>;
19
+ cryptoFn: PropType<(password: string) => string>;
20
+ hashId: PropType<string>;
21
+ className: PropType<string>;
22
+ }>, () => vue_jsx_runtime1.JSX.Element, {}, {}, {}, vue30.ComponentOptionsMixin, vue30.ComponentOptionsMixin, {}, string, vue30.PublicProps, Readonly<vue30.ExtractPropTypes<{
23
+ password: PropType<string>;
24
+ name: {
25
+ type: PropType<string>;
26
+ default: any;
27
+ };
28
+ avatar: PropType<string>;
29
+ open: {
30
+ type: PropType<boolean>;
31
+ default: any;
32
+ };
33
+ onOpenChange: PropType<(open: boolean) => void>;
34
+ 'onUpdate:open': PropType<(open: boolean) => void>;
35
+ cryptoFn: PropType<(password: string) => string>;
36
+ hashId: PropType<string>;
37
+ className: PropType<string>;
38
+ }>> & Readonly<{}>, {
39
+ name: string;
40
+ open: boolean;
41
+ }, {}, {}, {}, string, vue30.ComponentProvideOptions, true, {}, any>;
42
+ //#endregion
43
+ export { _default as default };
@@ -0,0 +1,68 @@
1
+ import useClockTime_default from "../hooks/useClockTime/index.js";
2
+ import { basicProps, publicPageLockProps } from "./props.js";
3
+ import UserForm_default from "./UserForm.js";
4
+ import { Fragment, Teleport, computed, createTextVNode, createVNode, defineComponent } from "vue";
5
+ import { useMergedState, useState } from "@gx-design-vue/pro-hooks";
6
+ import { classNames, isBoolean } from "@gx-design-vue/pro-utils";
7
+ import { Button } from "ant-design-vue";
8
+ import { LockOutlined } from "@ant-design/icons-vue";
9
+
10
+ //#region src/PageLock/Popup.tsx
11
+ var Popup_default = /* @__PURE__ */ defineComponent({
12
+ name: "PageLockPopup",
13
+ props: {
14
+ ...basicProps,
15
+ ...publicPageLockProps,
16
+ password: String
17
+ },
18
+ setup(props) {
19
+ const [open, setOpen] = useMergedState(false, {
20
+ value: computed(() => isBoolean(props.open) ? props.open : false),
21
+ onChange: props.onOpenChange
22
+ });
23
+ const [lock, changeLock] = useState(false);
24
+ const clockTime = useClockTime_default();
25
+ const getClassName = (prefix = "", className) => {
26
+ return classNames(prefix ? `${props.className}-popup-${prefix}` : `${props.className}-popup`, props.hashId, className || "");
27
+ };
28
+ return () => {
29
+ if (open.value) return createVNode(Teleport, { "to": "body" }, { default: () => [createVNode("div", { "class": getClassName() }, [lock.value ? createVNode("div", { "class": getClassName("form") }, [createVNode(UserForm_default, {
30
+ "avatarSize": 70,
31
+ "submitText": "进入系统",
32
+ "avatar": props.avatar,
33
+ "hashId": props.hashId,
34
+ "className": props.className,
35
+ "validator": (value) => props.cryptoFn?.(value) === props.password,
36
+ "onSubmit": () => setOpen(false)
37
+ }, { default: () => [createVNode(Button, {
38
+ "style": { marginBlockStart: "16px" },
39
+ "type": "text",
40
+ "block": true,
41
+ "onClick": () => changeLock(false)
42
+ }, { default: () => [createTextVNode("返回")] })] }), createVNode("div", { "class": getClassName("form-time") }, [createVNode("span", { "style": { fontSize: "26px" } }, [
43
+ `${clockTime.hh}:${clockTime.mm}`,
44
+ createTextVNode("\xA0\xA0"),
45
+ clockTime.a
46
+ ]), createVNode("span", { "style": { fontSize: "30px" } }, [
47
+ clockTime.day,
48
+ createTextVNode("\xA0\xA0"),
49
+ clockTime.dddd
50
+ ])])]) : createVNode(Fragment, null, [createVNode("div", { "class": getClassName("head") }, [createVNode("span", null, [
51
+ clockTime.day,
52
+ createTextVNode("\xA0\xA0"),
53
+ clockTime.dddd
54
+ ]), createVNode("span", {
55
+ "class": getClassName("lock-icon"),
56
+ "onClick": () => changeLock(true)
57
+ }, [createVNode(LockOutlined, { "style": {
58
+ position: "relative",
59
+ top: "1px",
60
+ marginInlineEnd: "4px"
61
+ } }, null), createTextVNode("点击解锁")])]), createVNode("div", { "class": getClassName("time", getClassName("enter", "fadeIn")) }, [createVNode("div", { "class": getClassName("time-card") }, [clockTime.hh, createVNode("span", { "class": getClassName("time-range") }, [clockTime.a])]), createVNode("div", { "class": getClassName("time-card") }, [clockTime.mm])])])])] });
62
+ return null;
63
+ };
64
+ }
65
+ });
66
+
67
+ //#endregion
68
+ export { Popup_default as default };
@@ -0,0 +1,42 @@
1
+ import { FromState } from "./useFormState.js";
2
+ import * as vue213 from "vue";
3
+ import { PropType } from "vue";
4
+ import * as vue_jsx_runtime7 from "vue/jsx-runtime";
5
+
6
+ //#region src/PageLock/UserForm.d.ts
7
+ declare const _default: vue213.DefineComponent<vue213.ExtractPropTypes<{
8
+ name: {
9
+ type: PropType<string>;
10
+ default: any;
11
+ };
12
+ avatar: PropType<string>;
13
+ avatarSize: {
14
+ type: PropType<number>;
15
+ default: number;
16
+ };
17
+ submitText: PropType<string>;
18
+ validator: PropType<(value: string) => boolean>;
19
+ onSubmit: PropType<(fields: FromState) => void>;
20
+ hashId: PropType<string>;
21
+ className: PropType<string>;
22
+ }>, () => vue_jsx_runtime7.JSX.Element, {}, {}, {}, vue213.ComponentOptionsMixin, vue213.ComponentOptionsMixin, {}, string, vue213.PublicProps, Readonly<vue213.ExtractPropTypes<{
23
+ name: {
24
+ type: PropType<string>;
25
+ default: any;
26
+ };
27
+ avatar: PropType<string>;
28
+ avatarSize: {
29
+ type: PropType<number>;
30
+ default: number;
31
+ };
32
+ submitText: PropType<string>;
33
+ validator: PropType<(value: string) => boolean>;
34
+ onSubmit: PropType<(fields: FromState) => void>;
35
+ hashId: PropType<string>;
36
+ className: PropType<string>;
37
+ }>> & Readonly<{}>, {
38
+ name: string;
39
+ avatarSize: number;
40
+ }, {}, {}, {}, string, vue213.ComponentProvideOptions, true, {}, any>;
41
+ //#endregion
42
+ export { _default as default };
@@ -0,0 +1,68 @@
1
+ import { basicProps } from "./props.js";
2
+ import useFormState_default from "./useFormState.js";
3
+ import { createVNode, defineComponent } from "vue";
4
+ import { classNames } from "@gx-design-vue/pro-utils";
5
+ import { Avatar, Button, Form, Input } from "ant-design-vue";
6
+ import { UserOutlined } from "@ant-design/icons-vue";
7
+
8
+ //#region src/PageLock/UserForm.tsx
9
+ var UserForm_default = /* @__PURE__ */ defineComponent({
10
+ props: {
11
+ ...basicProps,
12
+ name: {
13
+ type: [String],
14
+ default: void 0
15
+ },
16
+ avatar: String,
17
+ avatarSize: {
18
+ type: Number,
19
+ default: 60
20
+ },
21
+ submitText: String,
22
+ validator: Function,
23
+ onSubmit: Function
24
+ },
25
+ setup(props, { expose, slots }) {
26
+ const { formState, validate, validateInfos, resetFields } = useFormState_default(props.validator);
27
+ const merageFormState = (params) => {
28
+ Object.assign(formState, params);
29
+ };
30
+ const getClassName = (prefix = "", className) => {
31
+ return classNames(prefix ? `${props.className}-${prefix}` : props.className, props.hashId, className || "");
32
+ };
33
+ const submit = () => {
34
+ validate().then(() => {
35
+ props.onSubmit?.(formState);
36
+ }).catch(() => {});
37
+ };
38
+ expose({
39
+ formState,
40
+ resetFields,
41
+ merageFormState
42
+ });
43
+ return () => {
44
+ return createVNode("div", { "class": getClassName("user-form") }, [
45
+ createVNode("div", { "class": getClassName("user-info") }, [createVNode(Avatar, {
46
+ "size": props.avatarSize,
47
+ "icon": createVNode(UserOutlined, null, null),
48
+ "src": props.avatar
49
+ }, null), props.name && createVNode("div", { "class": getClassName("user-name") }, [props.name])]),
50
+ createVNode(Form, null, { default: () => [createVNode(Form.Item, validateInfos.password, { default: () => [createVNode(Input.Password, {
51
+ "value": formState.password,
52
+ "placeholder": "请输入锁屏密码",
53
+ "onChange": (e) => formState.password = e.target.value
54
+ }, null)] })] }),
55
+ createVNode(Button, {
56
+ "block": true,
57
+ "type": "primary",
58
+ "onClick": () => submit(),
59
+ "style": { marginBlockStart: "24px" }
60
+ }, { default: () => [props.submitText] }),
61
+ slots.default?.()
62
+ ]);
63
+ };
64
+ }
65
+ });
66
+
67
+ //#endregion
68
+ export { UserForm_default as default };
@@ -0,0 +1,52 @@
1
+ import { ShortcutKeyProps } from "./props.js";
2
+ import * as vue192 from "vue";
3
+ import * as ant_design_vue_es__util_type21 from "ant-design-vue/es/_util/type";
4
+
5
+ //#region src/PageLock/index.d.ts
6
+ declare const _default: vue192.DefineComponent<vue192.ExtractPropTypes<{
7
+ shortsKey: {
8
+ type: vue192.PropType<ShortcutKeyProps["lock"]>;
9
+ default: () => ShortcutKeyProps["lock"];
10
+ };
11
+ name: {
12
+ type: vue192.PropType<string>;
13
+ default: any;
14
+ };
15
+ avatar: vue192.PropType<string>;
16
+ open: {
17
+ type: vue192.PropType<boolean>;
18
+ default: any;
19
+ };
20
+ onOpenChange: vue192.PropType<(open: boolean) => void>;
21
+ 'onUpdate:open': vue192.PropType<(open: boolean) => void>;
22
+ cryptoFn: vue192.PropType<(password: string) => string>;
23
+ }>, () => ant_design_vue_es__util_type21.VueNode, {}, {}, {}, vue192.ComponentOptionsMixin, vue192.ComponentOptionsMixin, ("update:open" | "openChange")[], "update:open" | "openChange", vue192.PublicProps, Readonly<vue192.ExtractPropTypes<{
24
+ shortsKey: {
25
+ type: vue192.PropType<ShortcutKeyProps["lock"]>;
26
+ default: () => ShortcutKeyProps["lock"];
27
+ };
28
+ name: {
29
+ type: vue192.PropType<string>;
30
+ default: any;
31
+ };
32
+ avatar: vue192.PropType<string>;
33
+ open: {
34
+ type: vue192.PropType<boolean>;
35
+ default: any;
36
+ };
37
+ onOpenChange: vue192.PropType<(open: boolean) => void>;
38
+ 'onUpdate:open': vue192.PropType<(open: boolean) => void>;
39
+ cryptoFn: vue192.PropType<(password: string) => string>;
40
+ }>> & Readonly<{
41
+ onOpenChange?: (...args: any[]) => any;
42
+ "onUpdate:open"?: (...args: any[]) => any;
43
+ }>, {
44
+ name: string;
45
+ open: boolean;
46
+ shortsKey: {
47
+ keys?: string;
48
+ disabled?: boolean;
49
+ };
50
+ }, {}, {}, {}, string, vue192.ComponentProvideOptions, true, {}, any>;
51
+ //#endregion
52
+ export { _default as default };
@@ -0,0 +1,92 @@
1
+ import { pageLockProps } from "./props.js";
2
+ import UserForm_default from "./UserForm.js";
3
+ import Popup_default from "./Popup.js";
4
+ import { PageLockStyle } from "./style.js";
5
+ import { Fragment, computed, createVNode, defineComponent, mergeProps, onMounted, ref, watch } from "vue";
6
+ import { useMergedState, useState } from "@gx-design-vue/pro-hooks";
7
+ import { useProStyle } from "@gx-design-vue/pro-provider";
8
+ import { getPrefixCls } from "@gx-design-vue/pro-utils";
9
+ import { useLocalStorage, useMagicKeys, whenever } from "@vueuse/core";
10
+ import { GProModal } from "@gx-design-vue/pro-modal";
11
+ import { pick } from "es-toolkit";
12
+
13
+ //#region src/PageLock/index.tsx
14
+ var PageLock_default = /* @__PURE__ */ defineComponent({
15
+ name: "PageLock",
16
+ props: pageLockProps,
17
+ emits: ["update:open", "openChange"],
18
+ setup(props) {
19
+ const baseClassName = getPrefixCls({
20
+ suffixCls: "page-lock",
21
+ isPor: true
22
+ });
23
+ const { wrapSSR, hashId } = useProStyle("ProPageLock", [PageLockStyle], baseClassName);
24
+ const localLockState = useLocalStorage(baseClassName, {
25
+ open: false,
26
+ password: ""
27
+ });
28
+ const [open, setOpen] = useMergedState(false, {
29
+ value: computed(() => props.open),
30
+ onChange: (val) => {
31
+ props.onOpenChange?.(val);
32
+ props["onUpdate:open"]?.(val);
33
+ }
34
+ });
35
+ const [popupOpen, setPopupOpen] = useState(false);
36
+ const formRef = ref();
37
+ function signPassword(str) {
38
+ return props.cryptoFn ? props.cryptoFn(str) : str;
39
+ }
40
+ function syncLocalState(password) {
41
+ localLockState.value.open = popupOpen.value;
42
+ localLockState.value.password = signPassword(password);
43
+ }
44
+ const shortKeys = computed(() => props.shortsKey);
45
+ const lockHasOpen = computed(() => localLockState.value.open && !!localLockState.value.password);
46
+ whenever(useMagicKeys()["Alt+KeyL"], () => {
47
+ if (shortKeys.value?.disabled || open.value) return;
48
+ setOpen(true);
49
+ });
50
+ watch(popupOpen, (val) => {
51
+ syncLocalState(val ? formRef.value?.formState?.password || localLockState.value.password || "" : "");
52
+ });
53
+ onMounted(() => {
54
+ if (lockHasOpen.value) setPopupOpen(true);
55
+ else syncLocalState("");
56
+ });
57
+ const handleOk = () => {
58
+ setOpen(false);
59
+ setPopupOpen(true);
60
+ };
61
+ const handleCancel = () => {
62
+ setOpen(false);
63
+ syncLocalState("");
64
+ formRef.value?.resetFields();
65
+ };
66
+ return () => {
67
+ return wrapSSR(createVNode(Fragment, null, [popupOpen.value && createVNode(Popup_default, mergeProps(pick(props, ["name", "avatar"]), {
68
+ "open": popupOpen.value,
69
+ "hashId": hashId.value,
70
+ "className": baseClassName,
71
+ "password": localLockState.value.password,
72
+ "cryptoFn": signPassword,
73
+ "onOpenChange": setPopupOpen
74
+ }), null), createVNode(GProModal, {
75
+ "width": 400,
76
+ "type": "normal",
77
+ "title": "锁定屏幕",
78
+ "open": open.value,
79
+ "footer": false,
80
+ "onCancel": handleCancel
81
+ }, { default: () => [createVNode(UserForm_default, mergeProps({ "ref": formRef }, pick(props, ["name", "avatar"]), {
82
+ "submitText": "锁定",
83
+ "hashId": hashId.value,
84
+ "className": baseClassName,
85
+ "onSubmit": handleOk
86
+ }), null)] })]));
87
+ };
88
+ }
89
+ });
90
+
91
+ //#endregion
92
+ export { PageLock_default as default };
@@ -0,0 +1,51 @@
1
+ import { PropType } from "vue";
2
+
3
+ //#region src/PageLock/props.d.ts
4
+ interface ShortcutKeyProps {
5
+ search?: {
6
+ keys?: string;
7
+ disabled?: boolean;
8
+ };
9
+ lock?: {
10
+ keys?: string;
11
+ disabled?: boolean;
12
+ };
13
+ }
14
+ declare const basicProps: {
15
+ hashId: PropType<string>;
16
+ className: PropType<string>;
17
+ };
18
+ declare const publicPageLockProps: {
19
+ name: {
20
+ type: PropType<string>;
21
+ default: any;
22
+ };
23
+ avatar: PropType<string>;
24
+ open: {
25
+ type: PropType<boolean>;
26
+ default: any;
27
+ };
28
+ onOpenChange: PropType<(open: boolean) => void>;
29
+ 'onUpdate:open': PropType<(open: boolean) => void>;
30
+ cryptoFn: PropType<(password: string) => string>;
31
+ };
32
+ declare const pageLockProps: {
33
+ shortsKey: {
34
+ type: PropType<ShortcutKeyProps["lock"]>;
35
+ default: () => ShortcutKeyProps["lock"];
36
+ };
37
+ name: {
38
+ type: PropType<string>;
39
+ default: any;
40
+ };
41
+ avatar: PropType<string>;
42
+ open: {
43
+ type: PropType<boolean>;
44
+ default: any;
45
+ };
46
+ onOpenChange: PropType<(open: boolean) => void>;
47
+ 'onUpdate:open': PropType<(open: boolean) => void>;
48
+ cryptoFn: PropType<(password: string) => string>;
49
+ };
50
+ //#endregion
51
+ export { ShortcutKeyProps, basicProps, pageLockProps, publicPageLockProps };