qy-better-lib 0.0.1

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 (185) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/LICENSE +24 -0
  3. package/README.md +2 -0
  4. package/index.html +13 -0
  5. package/package.json +37 -0
  6. package/packages/core/DOCUMENTATION.md +2681 -0
  7. package/packages/core/LICENSE +24 -0
  8. package/packages/core/package.json +67 -0
  9. package/packages/core/types/index.d.ts +39 -0
  10. package/packages/core/types/json.d.ts +4 -0
  11. package/packages/core/types/vue.shim.d.ts +5 -0
  12. package/packages/core/vitest.config.ts +15 -0
  13. package/packages/core/yarn.lock +1233 -0
  14. package/packages/hooks/DOCUMENTATION.md +634 -0
  15. package/packages/hooks/LICENSE +24 -0
  16. package/packages/hooks/__tests__/use-chart/index.test.ts +287 -0
  17. package/packages/hooks/__tests__/use-emit/index.test.ts +248 -0
  18. package/packages/hooks/__tests__/use-fullscreen/index.test.ts +162 -0
  19. package/packages/hooks/__tests__/use-image/index.test.ts +230 -0
  20. package/packages/hooks/__tests__/use-layout-flow/index.test.ts +382 -0
  21. package/packages/hooks/__tests__/use-mqtt/index.test.ts +392 -0
  22. package/packages/hooks/__tests__/use-print/index.test.ts +378 -0
  23. package/packages/hooks/__tests__/use-watermark/index.test.ts +277 -0
  24. package/packages/hooks/__tests__/use-websocket/index.test.ts +402 -0
  25. package/packages/hooks/package.json +104 -0
  26. package/packages/hooks/types/index.d.ts +1 -0
  27. package/packages/hooks/types/json.d.ts +4 -0
  28. package/packages/hooks/types/vue.shim.d.ts +5 -0
  29. package/packages/hooks/yarn.lock +1832 -0
  30. package/packages/lowcode/core/package.json +60 -0
  31. package/packages/lowcode/core/types/index.d.ts +1 -0
  32. package/packages/lowcode/core/types/json.d.ts +4 -0
  33. package/packages/lowcode/core/types/vue.shim.d.ts +5 -0
  34. package/packages/lowcode/core/vite.dist.min.config.js +40 -0
  35. package/packages/lowcode/core/vite.dist.min.config.js.map +1 -0
  36. package/packages/lowcode/core/vite.lib.config.js +74 -0
  37. package/packages/lowcode/core/vite.lib.config.js.map +1 -0
  38. package/packages/lowcode/core/yarn.lock +1132 -0
  39. package/packages/lowcode/mobile/package.json +63 -0
  40. package/packages/lowcode/mobile/types/index.d.ts +1 -0
  41. package/packages/lowcode/mobile/types/json.d.ts +4 -0
  42. package/packages/lowcode/mobile/types/vue.shim.d.ts +77 -0
  43. package/packages/lowcode/mobile/vite.config.js +11 -0
  44. package/packages/lowcode/mobile/vite.config.js.map +1 -0
  45. package/packages/lowcode/mobile/vite.dist.min.config.js +71 -0
  46. package/packages/lowcode/mobile/vite.dist.min.config.js.map +1 -0
  47. package/packages/lowcode/mobile/vite.lib.config.js +137 -0
  48. package/packages/lowcode/mobile/vite.lib.config.js.map +1 -0
  49. package/packages/lowcode/mobile/yarn.lock +3888 -0
  50. package/packages/lowcode/pc/package.json +64 -0
  51. package/packages/lowcode/pc/vite.config.js +11 -0
  52. package/packages/lowcode/pc/vite.config.js.map +1 -0
  53. package/packages/lowcode/pc/vite.dist.min.config.js +71 -0
  54. package/packages/lowcode/pc/vite.dist.min.config.js.map +1 -0
  55. package/packages/lowcode/pc/vite.lib.config.js +137 -0
  56. package/packages/lowcode/pc/vite.lib.config.js.map +1 -0
  57. package/packages/lowcode/pc/yarn.lock +4026 -0
  58. package/packages/pc_components/DOCUMENTATION.md +566 -0
  59. package/packages/pc_components/LICENSE +24 -0
  60. package/packages/pc_components/lib/commDialog/index.d.ts +3 -0
  61. package/packages/pc_components/lib/commDialog/index.js +8 -0
  62. package/packages/pc_components/lib/commDialog/src/index.vue.d.ts +102 -0
  63. package/packages/pc_components/lib/commDialog/src/index.vue.js +43 -0
  64. package/packages/pc_components/lib/commDialog/src/index.vue2.js +4 -0
  65. package/packages/pc_components/lib/commDialog/src/props.d.ts +49 -0
  66. package/packages/pc_components/lib/commDialog/src/props.js +48 -0
  67. package/packages/pc_components/lib/commDialog/src/type.d.ts +39 -0
  68. package/packages/pc_components/lib/commForm/index.d.ts +3 -0
  69. package/packages/pc_components/lib/commForm/index.js +8 -0
  70. package/packages/pc_components/lib/commForm/src/index.vue.d.ts +95 -0
  71. package/packages/pc_components/lib/commForm/src/index.vue.js +50 -0
  72. package/packages/pc_components/lib/commForm/src/index.vue2.js +4 -0
  73. package/packages/pc_components/lib/commForm/src/props.d.ts +49 -0
  74. package/packages/pc_components/lib/commForm/src/props.js +47 -0
  75. package/packages/pc_components/lib/commForm/src/type.d.ts +8 -0
  76. package/packages/pc_components/lib/contextMenu/index.d.ts +5 -0
  77. package/packages/pc_components/lib/contextMenu/index.js +8 -0
  78. package/packages/pc_components/lib/contextMenu/src/index.vue.d.ts +91 -0
  79. package/packages/pc_components/lib/contextMenu/src/index.vue.js +153 -0
  80. package/packages/pc_components/lib/contextMenu/src/index.vue2.js +4 -0
  81. package/packages/pc_components/lib/contextMenu/src/props.d.ts +32 -0
  82. package/packages/pc_components/lib/contextMenu/src/props.js +27 -0
  83. package/packages/pc_components/lib/contextMenu/src/type.d.ts +11 -0
  84. package/packages/pc_components/lib/describeView/index.d.ts +2 -0
  85. package/packages/pc_components/lib/describeView/index.js +7 -0
  86. package/packages/pc_components/lib/describeView/src/index.vue.d.ts +61 -0
  87. package/packages/pc_components/lib/describeView/src/index.vue.js +84 -0
  88. package/packages/pc_components/lib/describeView/src/index.vue2.js +4 -0
  89. package/packages/pc_components/lib/describeView/src/props.d.ts +35 -0
  90. package/packages/pc_components/lib/describeView/src/props.js +33 -0
  91. package/packages/pc_components/lib/describeView/src/type.d.ts +10 -0
  92. package/packages/pc_components/lib/index.d.ts +18 -0
  93. package/packages/pc_components/lib/index.js +40 -0
  94. package/packages/pc_components/lib/simpleVirtualList/index.d.ts +2 -0
  95. package/packages/pc_components/lib/simpleVirtualList/index.js +7 -0
  96. package/packages/pc_components/lib/simpleVirtualList/src/index.vue.d.ts +28 -0
  97. package/packages/pc_components/lib/simpleVirtualList/src/index.vue.js +101 -0
  98. package/packages/pc_components/lib/simpleVirtualList/src/index.vue2.js +4 -0
  99. package/packages/pc_components/lib/simpleVirtualList/src/type.d.ts +12 -0
  100. package/packages/pc_components/lib/styles/comm-form.scss +4 -0
  101. package/packages/pc_components/lib/styles/context-menu.scss +47 -0
  102. package/packages/pc_components/lib/styles/describe-view.scss +25 -0
  103. package/packages/pc_components/lib/styles/index.scss +6 -0
  104. package/packages/pc_components/lib/styles/simple-virtual-list.scss +25 -0
  105. package/packages/pc_components/lib/styles/table-extend.scss +100 -0
  106. package/packages/pc_components/lib/styles/text-button.scss +71 -0
  107. package/packages/pc_components/lib/tableExtend/index.d.ts +3 -0
  108. package/packages/pc_components/lib/tableExtend/index.js +7 -0
  109. package/packages/pc_components/lib/tableExtend/props.d.ts +130 -0
  110. package/packages/pc_components/lib/tableExtend/props.js +128 -0
  111. package/packages/pc_components/lib/tableExtend/src/colVisible.vue.d.ts +3 -0
  112. package/packages/pc_components/lib/tableExtend/src/colVisible.vue.js +128 -0
  113. package/packages/pc_components/lib/tableExtend/src/colVisible.vue2.js +4 -0
  114. package/packages/pc_components/lib/tableExtend/src/index.vue.d.ts +186 -0
  115. package/packages/pc_components/lib/tableExtend/src/index.vue.js +234 -0
  116. package/packages/pc_components/lib/tableExtend/src/index.vue2.js +4 -0
  117. package/packages/pc_components/lib/tableExtend/src/valueCol.vue.d.ts +24 -0
  118. package/packages/pc_components/lib/tableExtend/src/valueCol.vue.js +29 -0
  119. package/packages/pc_components/lib/tableExtend/src/valueCol.vue2.js +4 -0
  120. package/packages/pc_components/lib/tableExtend/type.d.ts +165 -0
  121. package/packages/pc_components/lib/tableExtend/type.js +9 -0
  122. package/packages/pc_components/lib/tableExtend/useTable.d.ts +27 -0
  123. package/packages/pc_components/lib/tableExtend/useTable.js +115 -0
  124. package/packages/pc_components/lib/textButton/index.d.ts +2 -0
  125. package/packages/pc_components/lib/textButton/index.js +7 -0
  126. package/packages/pc_components/lib/textButton/src/index.vue.d.ts +42 -0
  127. package/packages/pc_components/lib/textButton/src/index.vue.js +44 -0
  128. package/packages/pc_components/lib/textButton/src/index.vue2.js +4 -0
  129. package/packages/pc_components/lib/textButton/src/props.d.ts +23 -0
  130. package/packages/pc_components/lib/textButton/src/props.js +30 -0
  131. package/packages/pc_components/lib/textButton/src/type.d.ts +30 -0
  132. package/packages/pc_components/lib/utils/index.d.ts +77 -0
  133. package/packages/pc_components/lib/utils/index.js +124 -0
  134. package/packages/pc_components/package.json +73 -0
  135. package/packages/pc_components/types/index.d.ts +9 -0
  136. package/packages/pc_components/types/json.d.ts +4 -0
  137. package/packages/pc_components/types/vue.shim.d.ts +5 -0
  138. package/packages/pc_components/yarn.lock +1641 -0
  139. package/postcss.config.js +19 -0
  140. package/public/vite.svg +1 -0
  141. package/src/App.vue +37 -0
  142. package/src/api/index.ts +42 -0
  143. package/src/assets/vue.svg +1 -0
  144. package/src/document/core.md +2680 -0
  145. package/src/document/hooks.md +632 -0
  146. package/src/document/pc_components.md +566 -0
  147. package/src/locales/en.json +1 -0
  148. package/src/locales/zh-cn.json +1 -0
  149. package/src/main.ts +13 -0
  150. package/src/plugins/element-plus.ts +16 -0
  151. package/src/plugins/i18n.ts +17 -0
  152. package/src/plugins/index.ts +13 -0
  153. package/src/plugins/store.ts +12 -0
  154. package/src/router/index.ts +20 -0
  155. package/src/shared/chartType.ts +279 -0
  156. package/src/shared/const.ts +160 -0
  157. package/src/shared/lib.ts +129 -0
  158. package/src/shared/request.ts +255 -0
  159. package/src/shared/type.ts +48 -0
  160. package/src/shared/utils/date.ts +83 -0
  161. package/src/shared/utils/utils.ts +85 -0
  162. package/src/store/index.ts +22 -0
  163. package/src/store/modules/app.ts +17 -0
  164. package/src/store/modules/shared.ts +21 -0
  165. package/src/styles/index.scss +169 -0
  166. package/src/types/app.d.ts +23 -0
  167. package/src/types/echarts.d.ts +5 -0
  168. package/src/types/index.d.ts +1 -0
  169. package/src/types/json.d.ts +4 -0
  170. package/src/types/scss.d.ts +9 -0
  171. package/src/types/vue.shim.d.ts +5 -0
  172. package/src/views/docs/docs-content.vue +379 -0
  173. package/src/views/docs/docs-header.vue +130 -0
  174. package/src/views/docs/docs-sidebar.vue +76 -0
  175. package/src/views/docs/hooks.ts +600 -0
  176. package/src/views/docs/index.vue +30 -0
  177. package/src/views/docs/styles/docs-content.scss +106 -0
  178. package/src/views/docs/styles/docs-header.scss +20 -0
  179. package/src/views/docs/styles/docs-sidebar.scss +182 -0
  180. package/src/views/docs/styles/index.scss +14 -0
  181. package/src/views/docs/type.ts +101 -0
  182. package/src/views/index.vue +34 -0
  183. package/tsconfig.json +37 -0
  184. package/tsconfig.node.json +8 -0
  185. package/vite.config.ts +54 -0
@@ -0,0 +1,43 @@
1
+ import { defineComponent, useAttrs, useSlots, openBlock, createBlock, createCommentVNode, createVNode, mergeProps } from "vue";
2
+ import { ElDialog, ElDrawer } from "element-plus";
3
+ import { props } from "./props.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "index",
6
+ props: props(),
7
+ setup(__props) {
8
+ const props2 = __props;
9
+ const attrs = useAttrs();
10
+ const slots = useSlots();
11
+ const dialog_component = () => createVNode(ElDialog, mergeProps(attrs, {
12
+ "width": props2.size,
13
+ "showClose": props2.showClose,
14
+ "draggable": props2.draggable,
15
+ "modal": props2.modal,
16
+ "modalStyle": props2.modalStyle
17
+ }), {
18
+ header: () => slots.header?.(),
19
+ default: () => slots.default?.(),
20
+ footer: () => slots.footer?.()
21
+ });
22
+ const drawer_component = () => createVNode(ElDrawer, mergeProps(attrs, {
23
+ "size": props2.size,
24
+ "showClose": props2.showClose,
25
+ "modal": props2.modal,
26
+ "modalStyle": props2.modalStyle
27
+ }), {
28
+ header: () => slots.header?.(),
29
+ default: () => slots.default?.(),
30
+ footer: () => slots.footer?.()
31
+ });
32
+ return (_ctx, _cache) => {
33
+ return _ctx.type === "dialog" ? (openBlock(), createBlock(dialog_component, {
34
+ key: 0
35
+ })) : _ctx.type === "drawer" ? (openBlock(), createBlock(drawer_component, {
36
+ key: 1
37
+ })) : createCommentVNode("", true);
38
+ };
39
+ }
40
+ });
41
+ export {
42
+ _sfc_main as default
43
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./index.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,49 @@
1
+ import { DialogType } from './type';
2
+ /**
3
+ * 通用弹窗组件属性定义
4
+ */
5
+ export declare const props: () => {
6
+ /**
7
+ * 弹窗类型
8
+ */
9
+ type: {
10
+ type: () => DialogType;
11
+ default: string;
12
+ validator: (value: string) => boolean;
13
+ };
14
+ /**
15
+ * 弹窗大小
16
+ */
17
+ size: {
18
+ type: (StringConstructor | NumberConstructor)[];
19
+ default: string;
20
+ };
21
+ /**
22
+ * 是否显示关闭按钮
23
+ */
24
+ showClose: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ /**
29
+ * 是否可拖动
30
+ */
31
+ draggable: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ /**
36
+ * 是否模态
37
+ */
38
+ modal: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ /**
43
+ * 遮罩层样式
44
+ */
45
+ modalStyle: {
46
+ type: ObjectConstructor;
47
+ default: () => {};
48
+ };
49
+ };
@@ -0,0 +1,48 @@
1
+ const props = () => ({
2
+ /**
3
+ * 弹窗类型
4
+ */
5
+ type: {
6
+ type: String,
7
+ default: "dialog",
8
+ validator: (value) => ["dialog", "drawer"].includes(value)
9
+ },
10
+ /**
11
+ * 弹窗大小
12
+ */
13
+ size: {
14
+ type: [String, Number],
15
+ default: "50%"
16
+ },
17
+ /**
18
+ * 是否显示关闭按钮
19
+ */
20
+ showClose: {
21
+ type: Boolean,
22
+ default: true
23
+ },
24
+ /**
25
+ * 是否可拖动
26
+ */
27
+ draggable: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ /**
32
+ * 是否模态
33
+ */
34
+ modal: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ /**
39
+ * 遮罩层样式
40
+ */
41
+ modalStyle: {
42
+ type: Object,
43
+ default: () => ({})
44
+ }
45
+ });
46
+ export {
47
+ props
48
+ };
@@ -0,0 +1,39 @@
1
+ import { DialogProps, DrawerProps } from 'element-plus';
2
+ /**
3
+ * 弹窗类型
4
+ */
5
+ export type DialogType = 'dialog' | 'drawer';
6
+ /**
7
+ * 通用弹窗组件属性
8
+ */
9
+ export interface CommonDialogProps {
10
+ /**
11
+ * 弹窗类型
12
+ */
13
+ type: DialogType;
14
+ /**
15
+ * 弹窗大小
16
+ */
17
+ size: string | number;
18
+ }
19
+ /**
20
+ * 弹窗组件插槽
21
+ */
22
+ export interface CommonDialogSlots {
23
+ /**
24
+ * 头部插槽
25
+ */
26
+ header?: () => any;
27
+ /**
28
+ * 默认插槽
29
+ */
30
+ default?: () => any;
31
+ /**
32
+ * 底部插槽
33
+ */
34
+ footer?: () => any;
35
+ }
36
+ /**
37
+ * 合并的弹窗属性(包含Element Plus的属性)
38
+ */
39
+ export type MergedDialogProps = CommonDialogProps & Partial<DialogProps> & Partial<DrawerProps>;
@@ -0,0 +1,3 @@
1
+ import { default as CommForm } from './src/index.vue';
2
+ export { CommForm };
3
+ export default CommForm;
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./src/index.vue.js";
2
+ _sfc_main.install = (app) => {
3
+ app.component("CommForm", _sfc_main);
4
+ };
5
+ export {
6
+ _sfc_main as CommForm,
7
+ _sfc_main as default
8
+ };
@@ -0,0 +1,95 @@
1
+ import { LabelPosition } from './type';
2
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ /**
4
+ * 表单验证
5
+ */
6
+ declare function validate(): Promise<boolean>;
7
+ /**
8
+ * 表单重置
9
+ */
10
+ declare function reset(): void;
11
+ declare function __VLS_template(): {
12
+ attrs: Partial<{}>;
13
+ slots: Readonly<{
14
+ /**默认插槽 */
15
+ default: () => any[];
16
+ /**底部插槽 */
17
+ footer: () => any[];
18
+ }> & {
19
+ /**默认插槽 */
20
+ default: () => any[];
21
+ /**底部插槽 */
22
+ footer: () => any[];
23
+ };
24
+ refs: {};
25
+ rootEl: any;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
29
+ labelWidth: {
30
+ type: NumberConstructor;
31
+ default: number;
32
+ };
33
+ labelPosition: {
34
+ type: PropType<LabelPosition>;
35
+ default: string;
36
+ };
37
+ model: {
38
+ type: PropType<Record<string, any>>;
39
+ default: () => {};
40
+ };
41
+ formRules: {
42
+ type: PropType<Record<string, any>>;
43
+ default: () => {};
44
+ };
45
+ column: {
46
+ type: NumberConstructor;
47
+ default: number;
48
+ };
49
+ options: {
50
+ type: PropType<Record<string, any>>;
51
+ default: () => {};
52
+ };
53
+ }>, {
54
+ validate: typeof validate;
55
+ reset: typeof reset;
56
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
57
+ labelWidth: {
58
+ type: NumberConstructor;
59
+ default: number;
60
+ };
61
+ labelPosition: {
62
+ type: PropType<LabelPosition>;
63
+ default: string;
64
+ };
65
+ model: {
66
+ type: PropType<Record<string, any>>;
67
+ default: () => {};
68
+ };
69
+ formRules: {
70
+ type: PropType<Record<string, any>>;
71
+ default: () => {};
72
+ };
73
+ column: {
74
+ type: NumberConstructor;
75
+ default: number;
76
+ };
77
+ options: {
78
+ type: PropType<Record<string, any>>;
79
+ default: () => {};
80
+ };
81
+ }>> & Readonly<{}>, {
82
+ column: number;
83
+ options: Record<string, any>;
84
+ labelWidth: number;
85
+ labelPosition: LabelPosition;
86
+ model: Record<string, any>;
87
+ formRules: Record<string, any>;
88
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
89
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
90
+ export default _default;
91
+ type __VLS_WithTemplateSlots<T, S> = T & {
92
+ new (): {
93
+ $slots: S;
94
+ };
95
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent, ref, computed, useSlots, openBlock, createBlock, createVNode, resolveComponent, mergeProps } from "vue";
2
+ import { validateForm } from "../../utils/index.js";
3
+ import { props } from "./props.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "index",
6
+ props: props(),
7
+ setup(__props, {
8
+ expose: __expose
9
+ }) {
10
+ const props2 = __props;
11
+ const form_ref = ref(null);
12
+ const form_style = computed(() => {
13
+ return {
14
+ "grid-template-columns": `repeat(${props2.column}, minmax(1px, 1fr))`
15
+ };
16
+ });
17
+ const form_attr = computed(() => ({
18
+ labelWidth: props2.labelWidth,
19
+ labelPosition: props2.labelPosition,
20
+ ...props2.options
21
+ }));
22
+ __expose({
23
+ validate,
24
+ reset
25
+ });
26
+ const slots = useSlots();
27
+ async function validate() {
28
+ return await validateForm(form_ref);
29
+ }
30
+ function reset() {
31
+ form_ref.value?.resetFields();
32
+ }
33
+ const common_form = () => createVNode(resolveComponent("el-form"), mergeProps({
34
+ "class": "comm-form",
35
+ "model": props2.model,
36
+ "rules": props2.formRules,
37
+ "ref": form_ref
38
+ }, form_attr.value, {
39
+ "style": form_style.value
40
+ }), {
41
+ default: () => [slots.default?.(), slots.footer?.()]
42
+ });
43
+ return (_ctx, _cache) => {
44
+ return openBlock(), createBlock(common_form);
45
+ };
46
+ }
47
+ });
48
+ export {
49
+ _sfc_main as default
50
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./index.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,49 @@
1
+ import { PropType } from 'vue';
2
+ import { LabelPosition } from './type';
3
+ /**
4
+ * 通用表单组件属性定义
5
+ */
6
+ export declare const props: () => {
7
+ /**
8
+ * 标题宽度
9
+ */
10
+ labelWidth: {
11
+ type: NumberConstructor;
12
+ default: number;
13
+ };
14
+ /**
15
+ * 标签位置
16
+ */
17
+ labelPosition: {
18
+ type: PropType<LabelPosition>;
19
+ default: string;
20
+ };
21
+ /**
22
+ * 表单数据
23
+ */
24
+ model: {
25
+ type: PropType<Record<string, any>>;
26
+ default: () => {};
27
+ };
28
+ /**
29
+ * 验证规则
30
+ */
31
+ formRules: {
32
+ type: PropType<Record<string, any>>;
33
+ default: () => {};
34
+ };
35
+ /**
36
+ * 表单列数,默认1列
37
+ */
38
+ column: {
39
+ type: NumberConstructor;
40
+ default: number;
41
+ };
42
+ /**
43
+ * UI组件属性
44
+ */
45
+ options: {
46
+ type: PropType<Record<string, any>>;
47
+ default: () => {};
48
+ };
49
+ };
@@ -0,0 +1,47 @@
1
+ const props = () => ({
2
+ /**
3
+ * 标题宽度
4
+ */
5
+ labelWidth: {
6
+ type: Number,
7
+ default: 100
8
+ },
9
+ /**
10
+ * 标签位置
11
+ */
12
+ labelPosition: {
13
+ type: String,
14
+ default: "left"
15
+ },
16
+ /**
17
+ * 表单数据
18
+ */
19
+ model: {
20
+ type: Object,
21
+ default: () => ({})
22
+ },
23
+ /**
24
+ * 验证规则
25
+ */
26
+ formRules: {
27
+ type: Object,
28
+ default: () => ({})
29
+ },
30
+ /**
31
+ * 表单列数,默认1列
32
+ */
33
+ column: {
34
+ type: Number,
35
+ default: 1
36
+ },
37
+ /**
38
+ * UI组件属性
39
+ */
40
+ options: {
41
+ type: Object,
42
+ default: () => ({})
43
+ }
44
+ });
45
+ export {
46
+ props
47
+ };
@@ -0,0 +1,8 @@
1
+ /**组件导出结构 */
2
+ export type Expose = {
3
+ /**表单验证 */
4
+ validate: () => Promise<boolean>;
5
+ /**表单重置 */
6
+ reset: () => void;
7
+ };
8
+ export type LabelPosition = 'left' | 'right' | 'top';
@@ -0,0 +1,5 @@
1
+ import { default as ContextMenu } from './src/index.vue';
2
+ import { ContextMenuItem, MenuPosition } from './src/type';
3
+ export { ContextMenu };
4
+ export type { ContextMenuItem, MenuPosition };
5
+ export default ContextMenu;
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./src/index.vue.js";
2
+ _sfc_main.install = (app) => {
3
+ app.component("ContextMenu", _sfc_main);
4
+ };
5
+ export {
6
+ _sfc_main as ContextMenu,
7
+ _sfc_main as default
8
+ };
@@ -0,0 +1,91 @@
1
+ import { ContextMenuItem, MenuPosition } from './type';
2
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ /**
4
+ * 显示菜单
5
+ * @param event 鼠标事件或位置对象
6
+ */
7
+ declare function show(event: MouseEvent | MenuPosition): Promise<void>;
8
+ /**
9
+ * 隐藏菜单
10
+ */
11
+ declare function hide(): void;
12
+ declare function __VLS_template(): {
13
+ attrs: Partial<{}>;
14
+ slots: {
15
+ item?(_: {
16
+ data: ContextMenuItem;
17
+ }): any;
18
+ };
19
+ refs: {
20
+ context_menu_ref: HTMLDivElement;
21
+ };
22
+ rootEl: any;
23
+ };
24
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
25
+ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
26
+ position: {
27
+ type: PropType<MenuPosition>;
28
+ default: () => {
29
+ x: number;
30
+ y: number;
31
+ };
32
+ };
33
+ options: {
34
+ type: PropType<ContextMenuItem[]>;
35
+ default: () => never[];
36
+ required: boolean;
37
+ };
38
+ disabled: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ visible: {
43
+ type: PropType<boolean>;
44
+ };
45
+ }>, {
46
+ hide: typeof hide;
47
+ show: typeof show;
48
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
49
+ show: () => any;
50
+ menu_click: (item: ContextMenuItem) => any;
51
+ hide: () => any;
52
+ "update:visible": (value: boolean) => any;
53
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
54
+ position: {
55
+ type: PropType<MenuPosition>;
56
+ default: () => {
57
+ x: number;
58
+ y: number;
59
+ };
60
+ };
61
+ options: {
62
+ type: PropType<ContextMenuItem[]>;
63
+ default: () => never[];
64
+ required: boolean;
65
+ };
66
+ disabled: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ visible: {
71
+ type: PropType<boolean>;
72
+ };
73
+ }>> & Readonly<{
74
+ onShow?: (() => any) | undefined;
75
+ onMenu_click?: ((item: ContextMenuItem) => any) | undefined;
76
+ onHide?: (() => any) | undefined;
77
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
78
+ }>, {
79
+ disabled: boolean;
80
+ options: ContextMenuItem[];
81
+ position: MenuPosition;
82
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
83
+ context_menu_ref: HTMLDivElement;
84
+ }, any>;
85
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
86
+ export default _default;
87
+ type __VLS_WithTemplateSlots<T, S> = T & {
88
+ new (): {
89
+ $slots: S;
90
+ };
91
+ };