hzzt-plus 0.0.1-dev-08 → 0.0.2-dev-01

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 (67) hide show
  1. package/dist/index.full.js +5788 -52
  2. package/dist/index.full.min.js +18 -18
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +18 -18
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +5788 -54
  7. package/es/component.mjs +3 -1
  8. package/es/component.mjs.map +1 -1
  9. package/es/components/icon/index.d.ts +5 -0
  10. package/es/components/icon/index.mjs +17 -0
  11. package/es/components/icon/index.mjs.map +1 -0
  12. package/es/components/icon/src/index.mjs +34 -0
  13. package/es/components/icon/src/index.mjs.map +1 -0
  14. package/es/components/icon/src/index.vue.d.ts +102 -0
  15. package/es/components/icon/style/css.d.ts +2 -0
  16. package/es/components/icon/style/css.mjs +3 -0
  17. package/es/components/icon/style/css.mjs.map +1 -0
  18. package/es/components/icon/style/index.d.ts +2 -0
  19. package/es/components/icon/style/index.mjs +3 -0
  20. package/es/components/icon/style/index.mjs.map +1 -0
  21. package/es/components/index.d.ts +1 -0
  22. package/es/components/index.mjs +1 -0
  23. package/es/components/index.mjs.map +1 -1
  24. package/es/directives/height/index.mjs +14 -16
  25. package/es/directives/height/index.mjs.map +1 -1
  26. package/es/directives/highlight/index.d.ts +3 -0
  27. package/es/directives/highlight/index.mjs +30 -0
  28. package/es/directives/highlight/index.mjs.map +1 -0
  29. package/es/directives/index.d.ts +1 -0
  30. package/es/directives/index.mjs +1 -0
  31. package/es/directives/index.mjs.map +1 -1
  32. package/es/index.mjs +2 -0
  33. package/es/index.mjs.map +1 -1
  34. package/global.d.ts +1 -0
  35. package/lib/component.js +3 -1
  36. package/lib/component.js.map +1 -1
  37. package/lib/components/icon/index.d.ts +5 -0
  38. package/lib/components/icon/index.js +42 -0
  39. package/lib/components/icon/index.js.map +1 -0
  40. package/lib/components/icon/src/index.js +38 -0
  41. package/lib/components/icon/src/index.js.map +1 -0
  42. package/lib/components/icon/src/index.vue.d.ts +102 -0
  43. package/lib/components/icon/style/css.d.ts +2 -0
  44. package/lib/components/icon/style/css.js +6 -0
  45. package/lib/components/icon/style/css.js.map +1 -0
  46. package/lib/components/icon/style/index.d.ts +2 -0
  47. package/lib/components/icon/style/index.js +6 -0
  48. package/lib/components/icon/style/index.js.map +1 -0
  49. package/lib/components/index.d.ts +1 -0
  50. package/lib/components/index.js +2 -0
  51. package/lib/components/index.js.map +1 -1
  52. package/lib/directives/height/index.js +14 -16
  53. package/lib/directives/height/index.js.map +1 -1
  54. package/lib/directives/highlight/index.d.ts +3 -0
  55. package/lib/directives/highlight/index.js +34 -0
  56. package/lib/directives/highlight/index.js.map +1 -0
  57. package/lib/directives/index.d.ts +1 -0
  58. package/lib/directives/index.js +2 -0
  59. package/lib/directives/index.js.map +1 -1
  60. package/lib/index.js +21 -17
  61. package/lib/index.js.map +1 -1
  62. package/lib/utils/vue/icon.js +14 -14
  63. package/lib/utils/vue/icon.js.map +1 -1
  64. package/package.json +1 -1
  65. package/theme/hzzt-icon.css +0 -0
  66. package/theme/src/icon.scss +0 -0
  67. package/theme/src/index.scss +1 -0
package/es/component.mjs CHANGED
@@ -3,13 +3,15 @@ import { HzztDropdown } from './components/dropdown/index.mjs';
3
3
  import { HzztCollapse } from './components/collapse/index.mjs';
4
4
  import { HzztConfigProvider } from './components/config-provider/index.mjs';
5
5
  import { HzztTab } from './components/tab/index.mjs';
6
+ import { HzztIcon } from './components/icon/index.mjs';
6
7
 
7
8
  var Components = [
8
9
  HzztConfigProvider,
9
10
  HzztTitle,
10
11
  HzztDropdown,
11
12
  HzztCollapse,
12
- HzztTab
13
+ HzztTab,
14
+ HzztIcon
13
15
  ];
14
16
 
15
17
  export { Components as default };
@@ -1 +1 @@
1
- {"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import {HzztTitle} from '@hzzt-plus/components/title'\nimport {HzztDropdown} from '@hzzt-plus/components/dropdown'\nimport {HzztCollapse} from '@hzzt-plus/components/collapse'\nimport {HzztConfigProvider} from '@hzzt-plus/components/config-provider'\nimport {HzztTab} from '@hzzt-plus/components/tab'\n\nimport type {Plugin} from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n] as Plugin[]\n"],"names":[],"mappings":";;;;;;AAKA,iBAAe;AACf,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,OAAO;AACT,CAAC;;;;"}
1
+ {"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import {HzztTitle} from '@hzzt-plus/components/title'\nimport {HzztDropdown} from '@hzzt-plus/components/dropdown'\nimport {HzztCollapse} from '@hzzt-plus/components/collapse'\nimport {HzztConfigProvider} from '@hzzt-plus/components/config-provider'\nimport {HzztTab} from '@hzzt-plus/components/tab'\nimport {HzztIcon} from '@hzzt-plus/components/icon'\n\nimport type {Plugin} from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n] as Plugin[]\n"],"names":[],"mappings":";;;;;;;AAMA,iBAAe;AACf,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,CAAC;;;;"}
@@ -0,0 +1,5 @@
1
+ import type { App } from '@vue/runtime-core';
2
+ export declare const HzztIcon: {
3
+ install(app: App): void;
4
+ };
5
+ export default HzztIcon;
@@ -0,0 +1,17 @@
1
+ import * as Icons from '@element-plus/icons-vue';
2
+ import Icon from './src/index.mjs';
3
+
4
+ const HzztIcon = {
5
+ install(app) {
6
+ app.component("HzztIcon", Icon);
7
+ for (const key in Icons) {
8
+ app.component(tarnsElIconName(key), Icons[key]);
9
+ }
10
+ }
11
+ };
12
+ function tarnsElIconName(name) {
13
+ return "hzzt-el" + name.replace(/[A-Z]/g, (match) => "-" + match.toLocaleLowerCase());
14
+ }
15
+
16
+ export { HzztIcon, HzztIcon as default };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/icon/index.ts"],"sourcesContent":["import * as Icons from '@element-plus/icons-vue';\nimport Icon from './src/index.vue';\nimport type { App } from '@vue/runtime-core'\n\nexport const HzztIcon = {\n install(app: App) {\n app.component('HzztIcon', Icon);\n for (const key in Icons) {\n app.component(tarnsElIconName(key), Icons[key]);\n }\n },\n}\n\nexport default HzztIcon;\n\nfunction tarnsElIconName(name) {\n return 'hzzt-el' +\n name.replace(/[A-Z]/g, (match) => '-' + match.toLocaleLowerCase());\n}\n\n"],"names":[],"mappings":";;;AAEY,MAAC,QAAQ,GAAG;AACxB,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACpC,IAAI,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AAC7B,MAAM,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE;AAEF,SAAS,eAAe,CAAC,IAAI,EAAE;AAC/B,EAAE,OAAO,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK,GAAG,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACxF;;;;"}
@@ -0,0 +1,34 @@
1
+ import { defineComponent, useAttrs, computed, openBlock, createBlock, unref, normalizeProps, guardReactiveProps, withCtx, resolveDynamicComponent } from 'vue';
2
+ import { ElIcon } from 'element-plus';
3
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
4
+
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "index",
7
+ props: {
8
+ name: {
9
+ type: String,
10
+ required: true
11
+ },
12
+ type: {
13
+ type: String,
14
+ default: "el"
15
+ }
16
+ },
17
+ setup(__props) {
18
+ const props = __props;
19
+ const attrs = useAttrs();
20
+ const componentName = computed(() => `hzzt-${props.type}-${props.name}`);
21
+ return (_ctx, _cache) => {
22
+ return openBlock(), createBlock(unref(ElIcon), normalizeProps(guardReactiveProps(unref(attrs))), {
23
+ default: withCtx(() => [
24
+ (openBlock(), createBlock(resolveDynamicComponent(unref(componentName))))
25
+ ]),
26
+ _: 1
27
+ }, 16);
28
+ };
29
+ }
30
+ });
31
+ var Icon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "index.vue"]]);
32
+
33
+ export { Icon as default };
34
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/icon/src/index.vue"],"sourcesContent":["<template>\n <ElIcon v-bind=\"attrs\">\n <component :is=\"componentName\" />\n </ElIcon>\n</template>\n\n<script setup lang=\"ts\">\n import {ElIcon} from 'element-plus';\n import {computed, useAttrs} from 'vue';\n\n const props = defineProps({\n name: {\n type: String,\n required: true,\n },\n type: {\n type: String,\n default: 'el',\n },\n });\n\n const attrs = useAttrs();\n\n const componentName = computed(() => `hzzt-${props.type}-${props.name}`);\n\n</script>\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqBE,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,gBAAgB,QAAS,CAAA,MAAM,QAAQ,KAAM,CAAA,IAAA,CAAA,CAAA,EAAQ,MAAM,IAAM,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;"}
@@ -0,0 +1,102 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ name: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ type: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ }, {
11
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
+ name: {
13
+ type: StringConstructor;
14
+ required: true;
15
+ };
16
+ type: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ }>> & {
21
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
22
+ }>>;
23
+ attrs: {
24
+ [x: string]: unknown;
25
+ };
26
+ componentName: import("vue").ComputedRef<string>;
27
+ ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
28
+ readonly size: {
29
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
30
+ readonly required: false;
31
+ readonly validator: ((val: unknown) => boolean) | undefined;
32
+ __epPropKey: true;
33
+ };
34
+ readonly color: {
35
+ readonly type: import("vue").PropType<string>;
36
+ readonly required: false;
37
+ readonly validator: ((val: unknown) => boolean) | undefined;
38
+ __epPropKey: true;
39
+ };
40
+ }, {
41
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
42
+ readonly size: {
43
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
44
+ readonly required: false;
45
+ readonly validator: ((val: unknown) => boolean) | undefined;
46
+ __epPropKey: true;
47
+ };
48
+ readonly color: {
49
+ readonly type: import("vue").PropType<string>;
50
+ readonly required: false;
51
+ readonly validator: ((val: unknown) => boolean) | undefined;
52
+ __epPropKey: true;
53
+ };
54
+ }>> & {
55
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
56
+ }>>;
57
+ ns: {
58
+ namespace: import("vue").ComputedRef<string>;
59
+ b: (blockSuffix?: string | undefined) => string;
60
+ e: (element?: string | undefined) => string;
61
+ m: (modifier?: string | undefined) => string;
62
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
63
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
64
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
65
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
66
+ is: {
67
+ (name: string, state: boolean | undefined): string;
68
+ (name: string): string;
69
+ };
70
+ cssVar: (object: Record<string, string>) => Record<string, string>;
71
+ cssVarName: (name: string) => string;
72
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
73
+ cssVarBlockName: (name: string) => string;
74
+ };
75
+ style: import("vue").ComputedRef<import("vue").CSSProperties>;
76
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
77
+ readonly size: {
78
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
79
+ readonly required: false;
80
+ readonly validator: ((val: unknown) => boolean) | undefined;
81
+ __epPropKey: true;
82
+ };
83
+ readonly color: {
84
+ readonly type: import("vue").PropType<string>;
85
+ readonly required: false;
86
+ readonly validator: ((val: unknown) => boolean) | undefined;
87
+ __epPropKey: true;
88
+ };
89
+ }>>, {}>> & Record<string, any>;
90
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
91
+ name: {
92
+ type: StringConstructor;
93
+ required: true;
94
+ };
95
+ type: {
96
+ type: StringConstructor;
97
+ default: string;
98
+ };
99
+ }>>, {
100
+ type: string;
101
+ }>;
102
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import 'hzzt-plus/es/components/base/style/css';
2
+ import 'hzzt-plus/theme/hzzt-icon.css';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/css.mjs';
2
+ import 'hzzt-plus/theme/hzzt-icon.css';
3
+ //# sourceMappingURL=css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ import 'hzzt-plus/es/components/base/style';
2
+ import 'hzzt-plus/theme/src/icon.scss';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/index.mjs';
2
+ import 'hzzt-plus/theme/src/icon.scss';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -3,3 +3,4 @@ export * from './dropdown';
3
3
  export * from './collapse';
4
4
  export * from './config-provider';
5
5
  export * from './tab';
6
+ export * from './icon';
@@ -3,6 +3,7 @@ export { HzztDropdown } from './dropdown/index.mjs';
3
3
  export { HzztCollapse } from './collapse/index.mjs';
4
4
  export { HzztConfigProvider } from './config-provider/index.mjs';
5
5
  export { HzztTab } from './tab/index.mjs';
6
+ export { HzztIcon } from './icon/index.mjs';
6
7
  export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
7
8
  export { configProviderContextKey } from './config-provider/src/constants.mjs';
8
9
  export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -17,24 +17,22 @@ function handler() {
17
17
  }
18
18
  const Height = {
19
19
  mounted(el, binding) {
20
- const { element, distY, type } = getEffectiveValue(el, binding.value);
21
- if (!nodeList.has(element)) {
22
- nodeList.set(element, []);
20
+ if (!nodeList.has(el)) {
21
+ nodeList.set(el, []);
23
22
  }
24
- nodeList.get(element).push({
25
- documentHandler: createDocumentHandler(element, distY, type),
23
+ nodeList.get(el).push({
24
+ documentHandler: createDocumentHandler(el, binding),
26
25
  bindingFn: binding.value
27
26
  });
28
27
  },
29
28
  updated(el, binding) {
30
- const { element, distY, type } = getEffectiveValue(el, binding.value);
31
- if (!nodeList.has(element)) {
32
- nodeList.set(element, []);
29
+ if (!nodeList.has(el)) {
30
+ nodeList.set(el, []);
33
31
  }
34
- const handlers = nodeList.get(element);
32
+ const handlers = nodeList.get(el);
35
33
  const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
36
34
  const newHandler = {
37
- documentHandler: createDocumentHandler(element, distY, type),
35
+ documentHandler: createDocumentHandler(el, binding),
38
36
  bindingFn: binding.value
39
37
  };
40
38
  if (oldHandlerIndex >= 0) {
@@ -43,16 +41,16 @@ const Height = {
43
41
  handlers.push(newHandler);
44
42
  }
45
43
  },
46
- unmounted(el, binding) {
47
- const { element } = getEffectiveValue(el, binding.value);
48
- nodeList.delete(element);
44
+ unmounted(el) {
45
+ nodeList.delete(el);
49
46
  }
50
47
  };
51
- function createDocumentHandler(el, distY, type) {
48
+ function createDocumentHandler(el, binding) {
49
+ const { element, distY, type } = getEffectiveValue(el, binding.value);
52
50
  const cssProp = type ? type + "Height" : "height";
53
- el.style[cssProp] = el.clientHeight + distY + "px";
51
+ el.style[cssProp] = element.clientHeight + distY + "px";
54
52
  return function() {
55
- el.style[cssProp] = el.clientHeight + distY + "px";
53
+ el.style[cssProp] = element.clientHeight + distY + "px";
56
54
  };
57
55
  }
58
56
  function getEffectiveValue(el, val) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/height/index.ts"],"sourcesContent":["import {isClient, isNumber, isObject} from '@hzzt-plus/utils'\n\nimport type {\n DirectiveBinding,\n ObjectDirective,\n} from 'vue'\n\ntype DocumentHandler = <T>() => void\ntype FlushList = Map<\n HTMLElement,\n {\n documentHandler: DocumentHandler\n bindingFn: (...args: unknown[]) => unknown\n }[]\n>\n\nconst nodeList: FlushList = new Map();\n\nif (isClient) {\n window.addEventListener('resize', handler);\n document.addEventListener('fullscreenchange', handler);\n}\n\nfunction handler() {\n for (const handlers of nodeList.values()) {\n for (const {documentHandler} of handlers) {\n documentHandler()\n }\n }\n}\n\n// v-height\n// 默认高度为当前元素的父元素高度\n\n// v-height = el\n// 当前元素的高度设置为el的高度\n\n// v-height = 60\n// 当前元素的高度设置为父元素高度+60px\n\n// v-height = {el: el, distY: 60}\n// 当前元素的高度设置为el的高度+60px\nconst Height: ObjectDirective = {\n // 当被绑定的元素插入到 DOM 中时……\n mounted(el: HTMLElement, binding: DirectiveBinding) {\n const {element, distY, type} = getEffectiveValue(el, binding.value);\n if (!nodeList.has(element)) {\n nodeList.set(element, []);\n }\n nodeList.get(element)!.push({\n documentHandler: createDocumentHandler(element, distY, type),\n bindingFn: binding.value,\n })\n },\n updated(el: HTMLElement, binding: DirectiveBinding) {\n const {element, distY, type} = getEffectiveValue(el, binding.value);\n if (!nodeList.has(element)) {\n nodeList.set(element, []);\n }\n const handlers = nodeList.get(element)!\n const oldHandlerIndex = handlers.findIndex(\n (item) => item.bindingFn === binding.oldValue\n )\n const newHandler = {\n documentHandler: createDocumentHandler(element, distY, type),\n bindingFn: binding.value,\n }\n\n if (oldHandlerIndex >= 0) {\n // replace the old handler to the new handler\n handlers.splice(oldHandlerIndex, 1, newHandler)\n } else {\n handlers.push(newHandler)\n }\n },\n // 只调用一次,指令与元素解绑时调用。\n unmounted(el: HTMLElement, binding: DirectiveBinding) {\n const {element} = getEffectiveValue(el, binding.value);\n nodeList.delete(element);\n },\n};\n\nfunction createDocumentHandler(el: HTMLElement, distY: number, type: string) {\n const cssProp = type ? (type + 'Height') : 'height';\n el.style[cssProp] = el.clientHeight + distY + 'px';\n return function () {\n el.style[cssProp] = el.clientHeight + distY + 'px';\n }\n}\n\nfunction getEffectiveValue(el, val) {\n let element = el.parentElement;\n let distY = 0;\n let type = '';\n if (!val) {\n element = el.parentElement;\n distY = 0;\n } else if (val instanceof HTMLElement) {\n element = val;\n distY = 0;\n } else if (isNumber(val)) {\n element = el.parentElement;\n distY = val;\n } else if (isObject(val)) {\n element = val?.el || el.parentElement;\n distY = val?.distY || 0;\n type = val?.type || '';\n }\n return {element, distY, type};\n}\n\nexport default Height;\n\n"],"names":[],"mappings":";;;;;AACA,MAAM,QAAQ,mBAAmB,IAAI,GAAG,EAAE,CAAC;AAC3C,IAAI,QAAQ,EAAE;AACd,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC7C,EAAE,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AACD,SAAS,OAAO,GAAG;AACnB,EAAE,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE;AAC5C,IAAI,KAAK,MAAM,EAAE,eAAe,EAAE,IAAI,QAAQ,EAAE;AAChD,MAAM,eAAe,EAAE,CAAC;AACxB,KAAK;AACL,GAAG;AACH,CAAC;AACI,MAAC,MAAM,GAAG;AACf,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1E,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;AAChC,MAAM,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;AAC/B,MAAM,eAAe,EAAE,qBAAqB,CAAC,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GAAG,CAAC,KAAK,KAAK,CAAC,CAAC;AACpD,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC;AACnD,GAAG;AACH,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAClC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/height/index.ts"],"sourcesContent":["import {isClient, isNumber, isObject} from '@hzzt-plus/utils'\n\nimport type {\n DirectiveBinding,\n ObjectDirective,\n} from 'vue'\n\ntype DocumentHandler = <T>() => void\ntype FlushList = Map<\n HTMLElement,\n {\n documentHandler: DocumentHandler\n bindingFn: (...args: unknown[]) => unknown\n }[]\n>\n\nconst nodeList: FlushList = new Map();\n\nif (isClient) {\n window.addEventListener('resize', handler);\n document.addEventListener('fullscreenchange', handler);\n}\n\nfunction handler() {\n for (const handlers of nodeList.values()) {\n for (const {documentHandler} of handlers) {\n documentHandler()\n }\n }\n}\n\n// v-height\n// 默认高度为当前元素的父元素高度\n\n// v-height = el\n// 当前元素的高度设置为el的高度\n\n// v-height = 60\n// 当前元素的高度设置为父元素高度+60px\n\n// v-height = {el: el, distY: 60}\n// 当前元素的高度设置为el的高度+60px\nconst Height: ObjectDirective = {\n // 当被绑定的元素插入到 DOM 中时……\n mounted(el: HTMLElement, binding: DirectiveBinding) {\n if (!nodeList.has(el)) {\n nodeList.set(el, []);\n }\n nodeList.get(el)!.push({\n documentHandler: createDocumentHandler(el, binding),\n bindingFn: binding.value,\n })\n },\n updated(el: HTMLElement, binding: DirectiveBinding) {\n if (!nodeList.has(el)) {\n nodeList.set(el, []);\n }\n const handlers = nodeList.get(el)!\n const oldHandlerIndex = handlers.findIndex(\n (item) => item.bindingFn === binding.oldValue\n )\n const newHandler = {\n documentHandler: createDocumentHandler(el, binding),\n bindingFn: binding.value,\n }\n\n if (oldHandlerIndex >= 0) {\n // replace the old handler to the new handler\n handlers.splice(oldHandlerIndex, 1, newHandler)\n } else {\n handlers.push(newHandler)\n }\n },\n // 只调用一次,指令与元素解绑时调用。\n unmounted(el: HTMLElement) {\n nodeList.delete(el);\n },\n};\n\nfunction createDocumentHandler(el: HTMLElement, binding: DirectiveBinding) {\n const {element, distY, type} = getEffectiveValue(el, binding.value);\n const cssProp = type ? (type + 'Height') : 'height';\n el.style[cssProp] = element.clientHeight + distY + 'px';\n return function () {\n el.style[cssProp] = element.clientHeight + distY + 'px';\n }\n}\n\nfunction getEffectiveValue(el, val) {\n let element = el.parentElement;\n let distY = 0;\n let type = '';\n if (!val) {\n element = el.parentElement;\n distY = 0;\n } else if (val instanceof HTMLElement) {\n element = val;\n distY = 0;\n } else if (isNumber(val)) {\n element = el.parentElement;\n distY = val;\n } else if (isObject(val)) {\n element = val?.el || el.parentElement;\n distY = val?.distY || 0;\n type = val?.type || '';\n }\n return {element, distY, type};\n}\n\nexport default Height;\n\n"],"names":[],"mappings":";;;;;AACA,MAAM,QAAQ,mBAAmB,IAAI,GAAG,EAAE,CAAC;AAC3C,IAAI,QAAQ,EAAE;AACd,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC7C,EAAE,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AACD,SAAS,OAAO,GAAG;AACnB,EAAE,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE;AAC5C,IAAI,KAAK,MAAM,EAAE,eAAe,EAAE,IAAI,QAAQ,EAAE;AAChD,MAAM,eAAe,EAAE,CAAC;AACxB,KAAK;AACL,GAAG;AACH,CAAC;AACI,MAAC,MAAM,GAAG;AACf,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;AAC3B,MAAM,QAAQ,CAAC,GAAG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AAC,GAAG,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC;AACpD,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC;AACnD,GAAG;AACH,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAClC;;;;"}
@@ -0,0 +1,3 @@
1
+ import type { ObjectDirective } from "vue";
2
+ declare const Highlight: ObjectDirective;
3
+ export default Highlight;
@@ -0,0 +1,30 @@
1
+ const Highlight = {
2
+ beforeMount: handle,
3
+ updated: handle
4
+ };
5
+ function handle(el, binding) {
6
+ const { form = false } = binding.modifiers;
7
+ const { color = "#ff0000", fontSize = "16px", show = true } = binding.value || {};
8
+ el.style.color = show ? color : "";
9
+ el.style.fontSize = show ? fontSize : "";
10
+ if (form) {
11
+ setCssText(el, show, "--el-text-color-regular", color);
12
+ setCssText(el, show, "--font-size", fontSize);
13
+ }
14
+ }
15
+ function setCssText(el, show, prop, value) {
16
+ let cssText = el.style.cssText;
17
+ if (show) {
18
+ let cssText2 = el.style.cssText;
19
+ if (!~cssText2.indexOf(prop)) {
20
+ cssText2 = `${cssText2};${prop}: ${value}`;
21
+ }
22
+ el.style.cssText = cssText2;
23
+ } else {
24
+ cssText = cssText.replace(`${prop}: ${value};`, "");
25
+ el.style.cssText = cssText;
26
+ }
27
+ }
28
+
29
+ export { Highlight as default };
30
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/directives/highlight/index.ts"],"sourcesContent":["import type {DirectiveBinding, ObjectDirective} from \"vue\";\n\nconst Highlight: ObjectDirective = {\n // 只调用一次,指令第一次绑定到元素时调用。在这里可以进行一次性的初始化设置。\n beforeMount: handle,\n updated: handle,\n};\n\nfunction handle(el: HTMLElement, binding: DirectiveBinding) {\n const {form = false} = binding.modifiers;\n const {color = '#ff0000', fontSize = '16px', show = true} = binding.value || {};\n el.style.color = show ? color : '';\n el.style.fontSize = show ? fontSize : '';\n if (form) {\n setCssText(el, show, '--el-text-color-regular', color);\n setCssText(el, show, '--font-size', fontSize);\n }\n}\n\nfunction setCssText(el: HTMLElement, show: boolean, prop: string, value: string) {\n let cssText = el.style.cssText;\n if (show) {\n let cssText = el.style.cssText;\n if (!~cssText.indexOf(prop)) {\n cssText = `${cssText};${prop}: ${value}`;\n }\n el.style.cssText = cssText;\n } else {\n cssText = cssText.replace(`${prop}: ${value};`, '');\n el.style.cssText = cssText;\n }\n}\n\nexport default Highlight;\n\n"],"names":[],"mappings":"AAAK,MAAC,SAAS,GAAG;AAClB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE;AACF,SAAS,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE;AAC7B,EAAE,MAAM,EAAE,IAAI,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;AAC7C,EAAE,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,QAAQ,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;AACpF,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;AACrC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;AAC3C,EAAE,IAAI,IAAI,EAAE;AACZ,IAAI,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAC3D,IAAI,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;AAClD,GAAG;AACH,CAAC;AACD,SAAS,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;AAC3C,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AACjC,EAAE,IAAI,IAAI,EAAE;AACZ,IAAI,IAAI,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AACpC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClC,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;AACjD,KAAK;AACL,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC;AAChC,GAAG,MAAM;AACT,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACxD,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,GAAG;AACH;;;;"}
@@ -1,3 +1,4 @@
1
1
  export { default as Download } from './download';
2
2
  export { default as Height } from './height';
3
3
  export { default as Blur } from './blur';
4
+ export { default as Highlight } from './highlight';
@@ -1,4 +1,5 @@
1
1
  export { default as Download } from './download/index.mjs';
2
2
  export { default as Height } from './height/index.mjs';
3
3
  export { default as Blur } from './blur/index.mjs';
4
+ export { default as Highlight } from './highlight/index.mjs';
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
package/es/index.mjs CHANGED
@@ -13,12 +13,14 @@ export { configProviderContextKey } from './components/config-provider/src/const
13
13
  export { provideGlobalConfig, useGlobalConfig } from './components/config-provider/src/hooks/use-global-config.mjs';
14
14
  export { HzztConfigProvider } from './components/config-provider/index.mjs';
15
15
  export { HzztTab } from './components/tab/index.mjs';
16
+ export { HzztIcon } from './components/icon/index.mjs';
16
17
  export { INSTALLED_KEY } from './constants/key.mjs';
17
18
  export { componentSizeMap, componentSizes } from './constants/size.mjs';
18
19
  export { WEEK_DAYS, datePickTypes } from './constants/date.mjs';
19
20
  export { default as Download } from './directives/download/index.mjs';
20
21
  export { default as Height } from './directives/height/index.mjs';
21
22
  export { default as Blur } from './directives/blur/index.mjs';
23
+ export { default as Highlight } from './directives/highlight/index.mjs';
22
24
  export { buildLocaleContext, buildTranslator, localeContextKey, translate, useLocale } from './hooks/use-locale/index.mjs';
23
25
  export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './hooks/use-size/index.mjs';
24
26
 
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
package/global.d.ts CHANGED
@@ -6,6 +6,7 @@ declare module 'vue' {
6
6
  HzztCollapse: typeof import('hzzt-plus')['HzztCollapse']
7
7
  HzztConfigProvider: typeof import('hzzt-plus')['HzztConfigProvider']
8
8
  HzztTab: typeof import('hzzt-plus')['HzztTab']
9
+ HzztIcon: typeof import('hzzt-plus')['HzztIcon']
9
10
  }
10
11
  }
11
12
 
package/lib/component.js CHANGED
@@ -7,13 +7,15 @@ var index$2 = require('./components/dropdown/index.js');
7
7
  var index$3 = require('./components/collapse/index.js');
8
8
  var index = require('./components/config-provider/index.js');
9
9
  var index$4 = require('./components/tab/index.js');
10
+ var index$5 = require('./components/icon/index.js');
10
11
 
11
12
  var Components = [
12
13
  index.HzztConfigProvider,
13
14
  index$1.HzztTitle,
14
15
  index$2.HzztDropdown,
15
16
  index$3.HzztCollapse,
16
- index$4.HzztTab
17
+ index$4.HzztTab,
18
+ index$5.HzztIcon
17
19
  ];
18
20
 
19
21
  exports["default"] = Components;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import {HzztTitle} from '@hzzt-plus/components/title'\nimport {HzztDropdown} from '@hzzt-plus/components/dropdown'\nimport {HzztCollapse} from '@hzzt-plus/components/collapse'\nimport {HzztConfigProvider} from '@hzzt-plus/components/config-provider'\nimport {HzztTab} from '@hzzt-plus/components/tab'\n\nimport type {Plugin} from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n] as Plugin[]\n"],"names":["HzztConfigProvider","HzztTitle","HzztDropdown","HzztCollapse","HzztTab"],"mappings":";;;;;;;;;;AAKA,iBAAe;AACf,EAAEA,wBAAkB;AACpB,EAAEC,iBAAS;AACX,EAAEC,oBAAY;AACd,EAAEC,oBAAY;AACd,EAAEC,eAAO;AACT,CAAC;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import {HzztTitle} from '@hzzt-plus/components/title'\nimport {HzztDropdown} from '@hzzt-plus/components/dropdown'\nimport {HzztCollapse} from '@hzzt-plus/components/collapse'\nimport {HzztConfigProvider} from '@hzzt-plus/components/config-provider'\nimport {HzztTab} from '@hzzt-plus/components/tab'\nimport {HzztIcon} from '@hzzt-plus/components/icon'\n\nimport type {Plugin} from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n] as Plugin[]\n"],"names":["HzztConfigProvider","HzztTitle","HzztDropdown","HzztCollapse","HzztTab","HzztIcon"],"mappings":";;;;;;;;;;;AAMA,iBAAe;AACf,EAAEA,wBAAkB;AACpB,EAAEC,iBAAS;AACX,EAAEC,oBAAY;AACd,EAAEC,oBAAY;AACd,EAAEC,eAAO;AACT,EAAEC,gBAAQ;AACV,CAAC;;;;"}
@@ -0,0 +1,5 @@
1
+ import type { App } from '@vue/runtime-core';
2
+ export declare const HzztIcon: {
3
+ install(app: App): void;
4
+ };
5
+ export default HzztIcon;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Icons = require('@element-plus/icons-vue');
6
+ var index = require('./src/index.js');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n["default"] = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var Icons__namespace = /*#__PURE__*/_interopNamespace(Icons);
27
+
28
+ const HzztIcon = {
29
+ install(app) {
30
+ app.component("HzztIcon", index["default"]);
31
+ for (const key in Icons__namespace) {
32
+ app.component(tarnsElIconName(key), Icons__namespace[key]);
33
+ }
34
+ }
35
+ };
36
+ function tarnsElIconName(name) {
37
+ return "hzzt-el" + name.replace(/[A-Z]/g, (match) => "-" + match.toLocaleLowerCase());
38
+ }
39
+
40
+ exports.HzztIcon = HzztIcon;
41
+ exports["default"] = HzztIcon;
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/components/icon/index.ts"],"sourcesContent":["import * as Icons from '@element-plus/icons-vue';\nimport Icon from './src/index.vue';\nimport type { App } from '@vue/runtime-core'\n\nexport const HzztIcon = {\n install(app: App) {\n app.component('HzztIcon', Icon);\n for (const key in Icons) {\n app.component(tarnsElIconName(key), Icons[key]);\n }\n },\n}\n\nexport default HzztIcon;\n\nfunction tarnsElIconName(name) {\n return 'hzzt-el' +\n name.replace(/[A-Z]/g, (match) => '-' + match.toLocaleLowerCase());\n}\n\n"],"names":["Icon","Icons"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEY,MAAC,QAAQ,GAAG;AACxB,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,GAAG,CAAC,SAAS,CAAC,UAAU,EAAEA,gBAAI,CAAC,CAAC;AACpC,IAAI,KAAK,MAAM,GAAG,IAAIC,gBAAK,EAAE;AAC7B,MAAM,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,EAAEA,gBAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE;AAEF,SAAS,eAAe,CAAC,IAAI,EAAE;AAC/B,EAAE,OAAO,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK,GAAG,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACxF;;;;;"}
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
8
+
9
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
+ __name: "index",
11
+ props: {
12
+ name: {
13
+ type: String,
14
+ required: true
15
+ },
16
+ type: {
17
+ type: String,
18
+ default: "el"
19
+ }
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ const attrs = vue.useAttrs();
24
+ const componentName = vue.computed(() => `hzzt-${props.type}-${props.name}`);
25
+ return (_ctx, _cache) => {
26
+ return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElIcon), vue.normalizeProps(vue.guardReactiveProps(vue.unref(attrs))), {
27
+ default: vue.withCtx(() => [
28
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(componentName))))
29
+ ]),
30
+ _: 1
31
+ }, 16);
32
+ };
33
+ }
34
+ });
35
+ var Icon = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "index.vue"]]);
36
+
37
+ exports["default"] = Icon;
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../packages/components/icon/src/index.vue"],"sourcesContent":["<template>\n <ElIcon v-bind=\"attrs\">\n <component :is=\"componentName\" />\n </ElIcon>\n</template>\n\n<script setup lang=\"ts\">\n import {ElIcon} from 'element-plus';\n import {computed, useAttrs} from 'vue';\n\n const props = defineProps({\n name: {\n type: String,\n required: true,\n },\n type: {\n type: String,\n default: 'el',\n },\n });\n\n const attrs = useAttrs();\n\n const componentName = computed(() => `hzzt-${props.type}-${props.name}`);\n\n</script>\n\n"],"names":["useAttrs","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBE,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,gBAAgBC,YAAS,CAAA,MAAM,QAAQ,KAAM,CAAA,IAAA,CAAA,CAAA,EAAQ,MAAM,IAAM,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;"}