@gx-design-vue/pro-layout-components 0.1.0-alpha.0 → 0.1.0-alpha.2

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 (120) hide show
  1. package/dist/RightContent/Search/Panel.d.ts +16 -39
  2. package/dist/RightContent/Search/Panel.js +138 -134
  3. package/dist/RightContent/Search/index.d.ts +11 -47
  4. package/dist/RightContent/Search/index.js +117 -103
  5. package/dist/RightContent/Search/style.d.ts +4 -7
  6. package/dist/RightContent/Search/style.js +34 -30
  7. package/dist/RightContent/index.d.ts +4 -403
  8. package/dist/RightContent/index.js +162 -146
  9. package/dist/RightContent/interface.d.ts +84 -0
  10. package/dist/RightContent/interface.js +1 -0
  11. package/dist/RightContent/locale.d.ts +6 -0
  12. package/dist/RightContent/locale.js +18 -0
  13. package/dist/RightContent/style.d.ts +4 -7
  14. package/dist/RightContent/style.js +66 -65
  15. package/dist/RightContent/themeOptions.d.ts +6 -0
  16. package/dist/RightContent/themeOptions.js +34 -0
  17. package/dist/RightContent/utils.d.ts +24 -0
  18. package/dist/RightContent/utils.js +66 -0
  19. package/dist/index.d.ts +3 -7
  20. package/dist/index.js +2 -5
  21. package/dist/pro-layout-components.esm.js +897 -5867
  22. package/dist/pro-layout-components.js +1 -5
  23. package/dist/theme/augment.d.ts +10 -0
  24. package/dist/theme/augment.js +1 -0
  25. package/dist/theme/interface/components.d.ts +10 -0
  26. package/dist/theme/interface/components.js +1 -0
  27. package/global.d.ts +0 -1
  28. package/package.json +16 -18
  29. package/dist/AppsLogoComponents/AppLogoList.d.ts +0 -24
  30. package/dist/AppsLogoComponents/AppLogoList.js +0 -43
  31. package/dist/AppsLogoComponents/AppsLogo.d.ts +0 -10
  32. package/dist/AppsLogoComponents/AppsLogo.js +0 -12
  33. package/dist/AppsLogoComponents/DefaultContent.d.ts +0 -27
  34. package/dist/AppsLogoComponents/DefaultContent.js +0 -43
  35. package/dist/AppsLogoComponents/SimpleContent.d.ts +0 -38
  36. package/dist/AppsLogoComponents/SimpleContent.js +0 -63
  37. package/dist/AppsLogoComponents/index.d.ts +0 -32
  38. package/dist/AppsLogoComponents/index.js +0 -71
  39. package/dist/AppsLogoComponents/props.d.ts +0 -26
  40. package/dist/AppsLogoComponents/props.js +0 -12
  41. package/dist/AppsLogoComponents/style/default.d.ts +0 -6
  42. package/dist/AppsLogoComponents/style/default.js +0 -70
  43. package/dist/AppsLogoComponents/style/index.d.ts +0 -7
  44. package/dist/AppsLogoComponents/style/index.js +0 -60
  45. package/dist/AppsLogoComponents/style/simple.d.ts +0 -6
  46. package/dist/AppsLogoComponents/style/simple.js +0 -83
  47. package/dist/Icon/components/Paintbrush.d.ts +0 -6
  48. package/dist/Icon/components/Paintbrush.js +0 -21
  49. package/dist/Icon/components/Palette.d.ts +0 -6
  50. package/dist/Icon/components/Palette.js +0 -20
  51. package/dist/Icon/components/index.d.ts +0 -10
  52. package/dist/Icon/components/index.js +0 -11
  53. package/dist/Icon/index.d.ts +0 -37
  54. package/dist/Icon/index.js +0 -24
  55. package/dist/PageLock/Popup.d.ts +0 -43
  56. package/dist/PageLock/Popup.js +0 -68
  57. package/dist/PageLock/UserForm.d.ts +0 -42
  58. package/dist/PageLock/UserForm.js +0 -68
  59. package/dist/PageLock/index.d.ts +0 -52
  60. package/dist/PageLock/index.js +0 -92
  61. package/dist/PageLock/props.d.ts +0 -51
  62. package/dist/PageLock/props.js +0 -29
  63. package/dist/PageLock/style.d.ts +0 -7
  64. package/dist/PageLock/style.js +0 -108
  65. package/dist/PageLock/useFormState.d.ts +0 -16
  66. package/dist/PageLock/useFormState.js +0 -19
  67. package/dist/Paintbrush-EfUpNqey.js +0 -14
  68. package/dist/Palette-B5wq9KtV.js +0 -13
  69. package/dist/RightContent/Search/props.d.ts +0 -17
  70. package/dist/RightContent/Search/props.js +0 -15
  71. package/dist/RightContent/props.d.ts +0 -64
  72. package/dist/RightContent/props.js +0 -63
  73. package/dist/ThemeEditor/components/BlockCheckbox.d.ts +0 -39
  74. package/dist/ThemeEditor/components/BlockCheckbox.js +0 -42
  75. package/dist/ThemeEditor/components/RegionalChange.d.ts +0 -21
  76. package/dist/ThemeEditor/components/RegionalChange.js +0 -43
  77. package/dist/ThemeEditor/components/Setting/index.d.ts +0 -52
  78. package/dist/ThemeEditor/components/Setting/index.js +0 -125
  79. package/dist/ThemeEditor/components/SwitchTab/index.d.ts +0 -51
  80. package/dist/ThemeEditor/components/SwitchTab/index.js +0 -52
  81. package/dist/ThemeEditor/components/SwitchTab/style.d.ts +0 -6
  82. package/dist/ThemeEditor/components/SwitchTab/style.js +0 -54
  83. package/dist/ThemeEditor/components/Tokens/Colors/ColorSvg.d.ts +0 -7
  84. package/dist/ThemeEditor/components/Tokens/Colors/ColorSvg.js +0 -453
  85. package/dist/ThemeEditor/components/Tokens/Colors/Primary.d.ts +0 -7
  86. package/dist/ThemeEditor/components/Tokens/Colors/Primary.js +0 -58
  87. package/dist/ThemeEditor/components/Tokens/Colors/Side.d.ts +0 -7
  88. package/dist/ThemeEditor/components/Tokens/Colors/Side.js +0 -18
  89. package/dist/ThemeEditor/components/Tokens/Colors/index.d.ts +0 -7
  90. package/dist/ThemeEditor/components/Tokens/Colors/index.js +0 -15
  91. package/dist/ThemeEditor/components/Tokens/context.d.ts +0 -9
  92. package/dist/ThemeEditor/components/Tokens/context.js +0 -7
  93. package/dist/ThemeEditor/components/Tokens/index.d.ts +0 -45
  94. package/dist/ThemeEditor/components/Tokens/index.js +0 -69
  95. package/dist/ThemeEditor/components/Tokens/utils/config.d.ts +0 -10
  96. package/dist/ThemeEditor/components/Tokens/utils/config.js +0 -8
  97. package/dist/ThemeEditor/components/Trigger.d.ts +0 -21
  98. package/dist/ThemeEditor/components/Trigger.js +0 -46
  99. package/dist/ThemeEditor/context.d.ts +0 -14
  100. package/dist/ThemeEditor/context.js +0 -7
  101. package/dist/ThemeEditor/index.d.ts +0 -841
  102. package/dist/ThemeEditor/index.js +0 -165
  103. package/dist/ThemeEditor/props.d.ts +0 -57
  104. package/dist/ThemeEditor/props.js +0 -40
  105. package/dist/ThemeEditor/style/animate.d.ts +0 -9
  106. package/dist/ThemeEditor/style/animate.js +0 -38
  107. package/dist/ThemeEditor/style/index.d.ts +0 -10
  108. package/dist/ThemeEditor/style/index.js +0 -318
  109. package/dist/ThemeEditor/style/theme.d.ts +0 -6
  110. package/dist/ThemeEditor/style/theme.js +0 -71
  111. package/dist/ThemeEditor/utils/config.d.ts +0 -37
  112. package/dist/ThemeEditor/utils/config.js +0 -132
  113. package/dist/ThemeEditor/utils/index.d.ts +0 -9
  114. package/dist/ThemeEditor/utils/index.js +0 -64
  115. package/dist/hooks/useClockTime/index.d.ts +0 -11
  116. package/dist/hooks/useClockTime/index.js +0 -28
  117. package/dist/utils/index.d.ts +0 -2
  118. package/dist/utils/index.js +0 -3
  119. package/dist/utils/util.d.ts +0 -10
  120. package/dist/utils/util.js +0 -17
@@ -1,37 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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 };
@@ -1,43 +0,0 @@
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 };
@@ -1,68 +0,0 @@
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 };
@@ -1,42 +0,0 @@
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 };
@@ -1,68 +0,0 @@
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 };
@@ -1,52 +0,0 @@
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 };
@@ -1,92 +0,0 @@
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 };
@@ -1,51 +0,0 @@
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 };
@@ -1,29 +0,0 @@
1
- import { getRightContentProps } from "../RightContent/props.js";
2
- import { pick } from "es-toolkit";
3
-
4
- //#region src/PageLock/props.ts
5
- const rightContentProps = getRightContentProps();
6
- const basicProps = {
7
- hashId: String,
8
- className: String
9
- };
10
- const publicPageLockProps = {
11
- open: {
12
- type: Boolean,
13
- default: void 0
14
- },
15
- onOpenChange: Function,
16
- "onUpdate:open": Function,
17
- cryptoFn: Function,
18
- ...pick(rightContentProps, ["name", "avatar"])
19
- };
20
- const pageLockProps = {
21
- ...publicPageLockProps,
22
- shortsKey: {
23
- type: Object,
24
- default: () => ({ disabled: false })
25
- }
26
- };
27
-
28
- //#endregion
29
- export { basicProps, pageLockProps, publicPageLockProps };
@@ -1,7 +0,0 @@
1
- import { GenerateStyle, Keyframe } from "@gx-design-vue/pro-provider";
2
-
3
- //#region src/PageLock/style.d.ts
4
- declare const fadeIn: Keyframe;
5
- declare const PageLockStyle: GenerateStyle;
6
- //#endregion
7
- export { PageLockStyle, fadeIn };
@@ -1,108 +0,0 @@
1
- import { Keyframe } from "@gx-design-vue/pro-provider";
2
-
3
- //#region src/PageLock/style.ts
4
- const fadeIn = new Keyframe("fadeIn", {
5
- "from": { opacity: 0 },
6
- "to": { opacity: 1 }
7
- });
8
- const PageLockStyle = (token) => {
9
- return { [token.componentCls]: {
10
- "&-user-form": { [`${token.antCls}-form-item`]: { marginBlockEnd: 0 } },
11
- "&-user-info": {
12
- display: "flex",
13
- flexDirection: "column",
14
- justifyContent: "center",
15
- alignItems: "center",
16
- gap: 20,
17
- marginBlockEnd: token.marginLG
18
- },
19
- "&-user-name": {
20
- fontWeight: 500,
21
- fontSize: 18
22
- },
23
- "&-popup": {
24
- display: "flex",
25
- flexDirection: "column",
26
- background: token.colorBgContainer,
27
- position: "fixed",
28
- inset: 0,
29
- zIndex: 2200,
30
- width: "100vw",
31
- height: "100vh",
32
- "&-enter": {
33
- animationDuration: ".3s",
34
- animationFillMode: "both",
35
- animationName: fadeIn
36
- },
37
- "&-head": {
38
- display: "flex",
39
- alignItems: "center",
40
- justifyContent: "space-between",
41
- marginBlock: token.marginLG,
42
- color: token.colorTextSecondary,
43
- paddingInline: 20,
44
- fontSize: 20,
45
- lineHeight: "28px",
46
- fontWeight: 600
47
- },
48
- "&-lock-icon": {
49
- cursor: "pointer",
50
- transition: "all .3s",
51
- "&:hover": {
52
- transform: "scale(1.1)",
53
- color: token.colorText
54
- }
55
- },
56
- "&-time": {
57
- display: "flex",
58
- paddingInline: "10%",
59
- gap: "5rem",
60
- flex: 1,
61
- paddingBottom: "40px",
62
- [`${token.componentCls}-popup-time-card`]: {
63
- position: "relative",
64
- width: "40%",
65
- height: "100%",
66
- display: "flex",
67
- alignItems: "center",
68
- justifyContent: "center",
69
- flex: "1 1 auto",
70
- fontSize: 260,
71
- borderRadius: token.borderRadiusLG,
72
- background: token.colorFillContent
73
- },
74
- "&-range": {
75
- position: "absolute",
76
- left: "2%",
77
- top: "2%",
78
- fontSize: 16,
79
- fontWeight: 600,
80
- color: token.colorText
81
- }
82
- },
83
- "&-form": {
84
- position: "relative",
85
- display: "flex",
86
- flexDirection: "column",
87
- alignItems: "center",
88
- justifyContent: "center",
89
- gap: token.marginLG,
90
- height: "100%",
91
- [`${token.componentCls}-user-form`]: { width: 300 },
92
- [`${token.componentCls}-popup-form-time`]: {
93
- position: "absolute",
94
- bottom: token.marginLG,
95
- left: "50%",
96
- transform: "translateX(-50%)",
97
- display: "flex",
98
- flexDirection: "column",
99
- alignItems: "center",
100
- justifyContent: "center"
101
- }
102
- }
103
- }
104
- } };
105
- };
106
-
107
- //#endregion
108
- export { PageLockStyle, fadeIn };
@@ -1,16 +0,0 @@
1
- import * as ant_design_vue_es_form_useForm0 from "ant-design-vue/es/form/useForm";
2
-
3
- //#region src/PageLock/useFormState.d.ts
4
- interface FromState {
5
- password: string;
6
- }
7
- declare function export_default(validator?: (value: string) => boolean): {
8
- formState: {
9
- password: string;
10
- };
11
- validate: <T = any>(names?: "password" | "password"[], option?: ant_design_vue_es_form_useForm0.validateOptions) => Promise<T>;
12
- resetFields: (newValues?: ant_design_vue_es_form_useForm0.Props) => void;
13
- validateInfos: Partial<Record<"password", ant_design_vue_es_form_useForm0.ValidateInfo>>;
14
- };
15
- //#endregion
16
- export { FromState, export_default as default };
@@ -1,19 +0,0 @@
1
- import { reactive } from "vue";
2
- import { useProForm } from "@gx-design-vue/pro-provider";
3
-
4
- //#region src/PageLock/useFormState.ts
5
- function useFormState_default(validator) {
6
- const formState = reactive({ password: "" });
7
- const { validate, resetFields, validateInfos } = useProForm(formState, { password: [{ validator: (_, value) => {
8
- return (validator && value ? validator?.(value) : value) ? Promise.resolve() : Promise.reject(validator && value ? "密码错误" : "请输入锁屏密码");
9
- } }] });
10
- return {
11
- formState,
12
- validate,
13
- resetFields,
14
- validateInfos
15
- };
16
- }
17
-
18
- //#endregion
19
- export { useFormState_default as default };