hzzt-plus 1.0.7 → 2.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 (170) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +575 -366
  4. package/dist/index.full.min.js +10 -10
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +14 -14
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +576 -368
  9. package/dist/locale/en.js +1 -1
  10. package/dist/locale/en.min.js +1 -1
  11. package/dist/locale/en.min.mjs +1 -1
  12. package/dist/locale/en.mjs +1 -1
  13. package/dist/locale/zh-cn.js +1 -1
  14. package/dist/locale/zh-cn.min.js +1 -1
  15. package/dist/locale/zh-cn.min.mjs +1 -1
  16. package/dist/locale/zh-cn.mjs +1 -1
  17. package/es/component.mjs +3 -1
  18. package/es/component.mjs.map +1 -1
  19. package/es/components/collapse/index.d.ts +161 -8
  20. package/es/components/collapse/src/collapse.vue.d.ts +161 -8
  21. package/es/components/collapse/src/collapse2.mjs +50 -29
  22. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  23. package/es/components/icon/index.mjs +4 -0
  24. package/es/components/icon/index.mjs.map +1 -1
  25. package/es/components/icon/src/components/index.d.ts +2 -0
  26. package/es/components/icon/src/components/index.mjs +3 -0
  27. package/es/components/icon/src/components/index.mjs.map +1 -0
  28. package/es/components/icon/src/components/minus-square-outline.mjs +29 -0
  29. package/es/components/icon/src/components/minus-square-outline.mjs.map +1 -0
  30. package/es/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
  31. package/es/components/icon/src/components/plus-square-outline.mjs +29 -0
  32. package/es/components/icon/src/components/plus-square-outline.mjs.map +1 -0
  33. package/es/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
  34. package/es/components/index.d.ts +1 -0
  35. package/es/components/index.mjs +3 -2
  36. package/es/components/index.mjs.map +1 -1
  37. package/es/components/input-range/index.mjs +2 -2
  38. package/es/components/input-range/src/input-range.mjs +76 -26
  39. package/es/components/input-range/src/input-range.mjs.map +1 -1
  40. package/es/components/input-range/src/input-range2.mjs +26 -76
  41. package/es/components/input-range/src/input-range2.mjs.map +1 -1
  42. package/es/components/pagination/index.d.ts +2 -2
  43. package/es/components/pagination/src/index.mjs +49 -21
  44. package/es/components/pagination/src/index.mjs.map +1 -1
  45. package/es/components/pagination/src/index.vue.d.ts +2 -2
  46. package/es/components/scroll/index.d.ts +5 -0
  47. package/es/components/scroll/index.mjs +9 -0
  48. package/es/components/scroll/index.mjs.map +1 -0
  49. package/es/components/scroll/src/scroll.d.ts +2 -0
  50. package/es/components/scroll/src/scroll.mjs +88 -0
  51. package/es/components/scroll/src/scroll.mjs.map +1 -0
  52. package/es/components/scroll/src/scroll.vue.d.ts +147 -0
  53. package/es/components/scroll/src/scroll2.mjs +2 -0
  54. package/es/components/scroll/src/scroll2.mjs.map +1 -0
  55. package/es/components/scroll/style/css.d.ts +2 -0
  56. package/es/components/scroll/style/css.mjs +3 -0
  57. package/es/components/scroll/style/css.mjs.map +1 -0
  58. package/es/components/scroll/style/index.d.ts +2 -0
  59. package/es/components/scroll/style/index.mjs +3 -0
  60. package/es/components/scroll/style/index.mjs.map +1 -0
  61. package/es/components/select-input/index.d.ts +43 -4
  62. package/es/components/select-input/index.mjs +2 -2
  63. package/es/components/select-input/src/select-input.d.ts +1 -1
  64. package/es/components/select-input/src/select-input.mjs +45 -124
  65. package/es/components/select-input/src/select-input.mjs.map +1 -1
  66. package/es/components/select-input/src/select-input.vue.d.ts +43 -4
  67. package/es/components/select-input/src/select-input2.mjs +124 -45
  68. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  69. package/es/components/select-textarea/src/select-textarea.d.ts +2 -1
  70. package/es/components/select-textarea/src/select-textarea.mjs +2 -1
  71. package/es/components/select-textarea/src/select-textarea.mjs.map +1 -1
  72. package/es/components/select-textarea/src/select-textarea.vue.d.ts +53 -4
  73. package/es/components/select-textarea/src/select-textarea2.mjs +14 -9
  74. package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -1
  75. package/es/components/title/src/title.d.ts +6 -0
  76. package/es/components/title/src/title.mjs +4 -1
  77. package/es/components/title/src/title.mjs.map +1 -1
  78. package/es/components/title/src/title.vue.d.ts +39 -0
  79. package/es/components/title/src/title2.mjs +28 -12
  80. package/es/components/title/src/title2.mjs.map +1 -1
  81. package/es/index.mjs +3 -2
  82. package/es/index.mjs.map +1 -1
  83. package/es/version.d.ts +1 -1
  84. package/es/version.mjs +1 -1
  85. package/es/version.mjs.map +1 -1
  86. package/global.d.ts +1 -0
  87. package/lib/component.js +3 -1
  88. package/lib/component.js.map +1 -1
  89. package/lib/components/collapse/index.d.ts +161 -8
  90. package/lib/components/collapse/src/collapse.vue.d.ts +161 -8
  91. package/lib/components/collapse/src/collapse2.js +49 -28
  92. package/lib/components/collapse/src/collapse2.js.map +1 -1
  93. package/lib/components/icon/index.js +4 -0
  94. package/lib/components/icon/index.js.map +1 -1
  95. package/lib/components/icon/src/components/index.d.ts +2 -0
  96. package/lib/components/icon/src/components/index.js +12 -0
  97. package/lib/components/icon/src/components/index.js.map +1 -0
  98. package/lib/components/icon/src/components/minus-square-outline.js +33 -0
  99. package/lib/components/icon/src/components/minus-square-outline.js.map +1 -0
  100. package/lib/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
  101. package/lib/components/icon/src/components/plus-square-outline.js +33 -0
  102. package/lib/components/icon/src/components/plus-square-outline.js.map +1 -0
  103. package/lib/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
  104. package/lib/components/index.d.ts +1 -0
  105. package/lib/components/index.js +4 -2
  106. package/lib/components/index.js.map +1 -1
  107. package/lib/components/input-range/index.js +2 -2
  108. package/lib/components/input-range/src/input-range.js +76 -27
  109. package/lib/components/input-range/src/input-range.js.map +1 -1
  110. package/lib/components/input-range/src/input-range2.js +27 -76
  111. package/lib/components/input-range/src/input-range2.js.map +1 -1
  112. package/lib/components/pagination/index.d.ts +2 -2
  113. package/lib/components/pagination/src/index.js +48 -20
  114. package/lib/components/pagination/src/index.js.map +1 -1
  115. package/lib/components/pagination/src/index.vue.d.ts +2 -2
  116. package/lib/components/scroll/index.d.ts +5 -0
  117. package/lib/components/scroll/index.js +14 -0
  118. package/lib/components/scroll/index.js.map +1 -0
  119. package/lib/components/scroll/src/scroll.d.ts +2 -0
  120. package/lib/components/scroll/src/scroll.js +92 -0
  121. package/lib/components/scroll/src/scroll.js.map +1 -0
  122. package/lib/components/scroll/src/scroll.vue.d.ts +147 -0
  123. package/lib/components/scroll/src/scroll2.js +3 -0
  124. package/lib/components/scroll/src/scroll2.js.map +1 -0
  125. package/lib/components/scroll/style/css.d.ts +2 -0
  126. package/lib/components/scroll/style/css.js +6 -0
  127. package/lib/components/scroll/style/css.js.map +1 -0
  128. package/lib/components/scroll/style/index.d.ts +2 -0
  129. package/lib/components/scroll/style/index.js +6 -0
  130. package/lib/components/scroll/style/index.js.map +1 -0
  131. package/lib/components/select-input/index.d.ts +43 -4
  132. package/lib/components/select-input/index.js +2 -2
  133. package/lib/components/select-input/src/select-input.d.ts +1 -1
  134. package/lib/components/select-input/src/select-input.js +46 -124
  135. package/lib/components/select-input/src/select-input.js.map +1 -1
  136. package/lib/components/select-input/src/select-input.vue.d.ts +43 -4
  137. package/lib/components/select-input/src/select-input2.js +124 -46
  138. package/lib/components/select-input/src/select-input2.js.map +1 -1
  139. package/lib/components/select-textarea/src/select-textarea.d.ts +2 -1
  140. package/lib/components/select-textarea/src/select-textarea.js +2 -1
  141. package/lib/components/select-textarea/src/select-textarea.js.map +1 -1
  142. package/lib/components/select-textarea/src/select-textarea.vue.d.ts +53 -4
  143. package/lib/components/select-textarea/src/select-textarea2.js +13 -8
  144. package/lib/components/select-textarea/src/select-textarea2.js.map +1 -1
  145. package/lib/components/title/src/title.d.ts +6 -0
  146. package/lib/components/title/src/title.js +4 -1
  147. package/lib/components/title/src/title.js.map +1 -1
  148. package/lib/components/title/src/title.vue.d.ts +39 -0
  149. package/lib/components/title/src/title2.js +27 -11
  150. package/lib/components/title/src/title2.js.map +1 -1
  151. package/lib/index.js +34 -32
  152. package/lib/index.js.map +1 -1
  153. package/lib/version.d.ts +1 -1
  154. package/lib/version.js +1 -1
  155. package/lib/version.js.map +1 -1
  156. package/package.json +1 -1
  157. package/tags.json +1 -1
  158. package/theme/hzzt-collapse.css +1 -1
  159. package/theme/hzzt-pagination.css +1 -1
  160. package/theme/hzzt-scan.css +1 -1
  161. package/theme/hzzt-scroll.css +1 -0
  162. package/theme/hzzt-title.css +1 -1
  163. package/theme/index.css +1 -1
  164. package/theme/src/collapse.scss +45 -39
  165. package/theme/src/index.scss +1 -0
  166. package/theme/src/pagination.scss +24 -6
  167. package/theme/src/scan.scss +3 -3
  168. package/theme/src/scroll.scss +42 -0
  169. package/theme/src/title.scss +14 -5
  170. package/web-types.json +1 -1
@@ -0,0 +1,88 @@
1
+ import { defineComponent, ref, onUpdated, openBlock, createElementBlock, normalizeClass, createVNode, createCommentVNode, createElementVNode, normalizeStyle, renderSlot } from 'vue';
2
+ import { useResizeObserver } from '@vueuse/core';
3
+ import HzztIcon from '../../icon/src/index.mjs';
4
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
5
+
6
+ const __default__ = defineComponent({
7
+ name: "HzztScroll"
8
+ });
9
+ const _sfc_main = /* @__PURE__ */ defineComponent({
10
+ ...__default__,
11
+ setup(__props) {
12
+ const navTranslateX = ref(0);
13
+ const scrollRef = ref(null);
14
+ const scrollContentRef = ref(null);
15
+ const scrollable = ref(false);
16
+ function update() {
17
+ if (!scrollRef.value || !scrollContentRef.value)
18
+ return;
19
+ const scrollWidth = scrollRef.value ? scrollRef.value.offsetWidth : 0;
20
+ const contentWidth = scrollContentRef.value ? scrollContentRef.value.offsetWidth : 0;
21
+ if (scrollWidth >= contentWidth) {
22
+ scrollable.value = false;
23
+ navTranslateX.value = 0;
24
+ return;
25
+ }
26
+ scrollable.value = true;
27
+ }
28
+ useResizeObserver(scrollContentRef, update);
29
+ onUpdated(() => update());
30
+ function btnNavPrev() {
31
+ var _a;
32
+ const containerSize = ((_a = scrollRef.value) == null ? void 0 : _a.offsetWidth) || 0;
33
+ const currentOffset = navTranslateX.value;
34
+ if (!currentOffset)
35
+ return;
36
+ const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
37
+ navTranslateX.value = newOffset;
38
+ }
39
+ function btnNavNext() {
40
+ var _a, _b;
41
+ const navSize = ((_a = scrollContentRef.value) == null ? void 0 : _a.offsetWidth) || 0;
42
+ const currentOffset = navTranslateX.value;
43
+ const containerSize = ((_b = scrollRef.value) == null ? void 0 : _b.offsetWidth) || 0;
44
+ if (navSize - currentOffset < containerSize)
45
+ return;
46
+ const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
47
+ navTranslateX.value = newOffset;
48
+ }
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("div", {
51
+ class: normalizeClass([{ "is-scrollable": scrollable.value }, "relative hzzt-scroll"])
52
+ }, [
53
+ scrollable.value ? (openBlock(), createElementBlock("div", {
54
+ key: 0,
55
+ class: "hzzt-scroll__nav-prev",
56
+ onClick: btnNavPrev
57
+ }, [
58
+ createVNode(HzztIcon, { name: "arrow-left" })
59
+ ])) : createCommentVNode("v-if", true),
60
+ scrollable.value ? (openBlock(), createElementBlock("div", {
61
+ key: 1,
62
+ class: "hzzt-scroll__nav-next",
63
+ onClick: btnNavNext
64
+ }, [
65
+ createVNode(HzztIcon, { name: "arrow-right" })
66
+ ])) : createCommentVNode("v-if", true),
67
+ createElementVNode("div", {
68
+ ref_key: "scrollRef",
69
+ ref: scrollRef,
70
+ class: "overflow-hidden"
71
+ }, [
72
+ createElementVNode("div", {
73
+ ref_key: "scrollContentRef",
74
+ ref: scrollContentRef,
75
+ style: normalizeStyle({ transform: `translateX(${-navTranslateX.value}px)` }),
76
+ class: "hzzt-scroll__content"
77
+ }, [
78
+ renderSlot(_ctx.$slots, "default")
79
+ ], 4)
80
+ ], 512)
81
+ ], 2);
82
+ };
83
+ }
84
+ });
85
+ var Scroll = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "scroll.vue"]]);
86
+
87
+ export { Scroll as default };
88
+ //# sourceMappingURL=scroll.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll.mjs","sources":["../../../../../../packages/components/scroll/src/scroll.vue"],"sourcesContent":["<template>\n <div :class=\"{'is-scrollable':scrollable}\" class=\"relative hzzt-scroll\">\n <div v-if=\"scrollable\" class=\"hzzt-scroll__nav-prev\" @click=\"btnNavPrev\">\n <hzzt-icon name=\"arrow-left\" />\n </div>\n <div v-if=\"scrollable\" class=\"hzzt-scroll__nav-next\" @click=\"btnNavNext\">\n <hzzt-icon name=\"arrow-right\" />\n </div>\n <div ref=\"scrollRef\" class=\"overflow-hidden\">\n <div ref=\"scrollContentRef\" :style=\"{transform: `translateX(${-navTranslateX}px)`}\" class=\"hzzt-scroll__content\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {onUpdated, ref} from 'vue';\n import {useResizeObserver} from '@vueuse/core';\n import HzztIcon from \"@hzzt-plus/components/icon/src/index.vue\";\n\n defineOptions({\n name: 'HzztScroll',\n })\n\n const navTranslateX = ref(0);\n const scrollRef = ref<HTMLElement | null>(null);\n const scrollContentRef = ref<HTMLElement | null>(null);\n const scrollable = ref(false);\n\n function update() {\n if (!scrollRef.value || !scrollContentRef.value) return;\n const scrollWidth = scrollRef.value ? scrollRef.value.offsetWidth : 0;\n const contentWidth = scrollContentRef.value ? scrollContentRef.value.offsetWidth : 0;\n if (scrollWidth >= contentWidth) {\n scrollable.value = false;\n navTranslateX.value = 0;\n return;\n }\n scrollable.value = true;\n }\n\n useResizeObserver(scrollContentRef, update);\n\n onUpdated(() => update());\n\n function btnNavPrev() {\n const containerSize = scrollRef.value?.offsetWidth || 0;\n const currentOffset = navTranslateX.value;\n if (!currentOffset) return;\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;\n navTranslateX.value = newOffset;\n }\n\n function btnNavNext() {\n const navSize = scrollContentRef.value?.offsetWidth || 0;\n const currentOffset = navTranslateX.value;\n const containerSize = scrollRef.value?.offsetWidth || 0;\n if (navSize - currentOffset < containerSize) return;\n const newOffset = navSize - currentOffset > containerSize * 2 ?\n currentOffset + containerSize :\n navSize - containerSize;\n navTranslateX.value = newOffset;\n }\n</script>\n"],"names":[],"mappings":";;;;;mCAqBgB,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;AAEA,IAAM,MAAA,aAAA,GAAgB,IAAI,CAAC,CAAA,CAAA;AAC3B,IAAM,MAAA,SAAA,GAAY,IAAwB,IAAI,CAAA,CAAA;AAC9C,IAAM,MAAA,gBAAA,GAAmB,IAAwB,IAAI,CAAA,CAAA;AACrD,IAAM,MAAA,UAAA,GAAa,IAAI,KAAK,CAAA,CAAA;AAE5B,IAAA,SAAS,MAAS,GAAA;AAChB,MAAA,IAAI,CAAC,SAAA,CAAU,KAAS,IAAA,CAAC,gBAAiB,CAAA,KAAA;AAAO,QAAA,OAAA;AACjD,MAAA,MAAM,WAAc,GAAA,SAAA,CAAU,KAAQ,GAAA,SAAA,CAAU,MAAM,WAAc,GAAA,CAAA,CAAA;AACpE,MAAA,MAAM,YAAe,GAAA,gBAAA,CAAiB,KAAQ,GAAA,gBAAA,CAAiB,MAAM,WAAc,GAAA,CAAA,CAAA;AACnF,MAAA,IAAI,eAAe,YAAc,EAAA;AAC/B,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA;AACtB,QAAA,OAAA;AAAA,OACF;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB;AAEA,IAAA,iBAAA,CAAkB,kBAAkB,MAAM,CAAA,CAAA;AAE1C,IAAU,SAAA,CAAA,MAAM,QAAQ,CAAA,CAAA;AAExB,IAAA,SAAS,UAAa,GAAA;AACpB,MAAM,IAAA,EAAA,CAAA;AACN,MAAA,MAAM,gBAAgB,CAAc,CAAA,EAAA,GAAA,SAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AACpC,MAAA,MAAK,aAAA,GAAA,aAAA,CAAA,KAAA,CAAA;AAAe,MAAA,IAAA,CAAA,aAAA;AACpB,QAAA,OAAkB;AAClB,MAAA,MAAA,SAAsB,GAAA,aAAA,GAAA,aAAA,GAAA,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA;AAAA,MACxB,aAAA,CAAA,KAAA,GAAA,SAAA,CAAA;AAEA,KAAA;AACE,IAAM,SAAA,UAA2B,GAAA;AACjC,MAAA,IAAA,EAAM;AACN,MAAM,MAAA,OAAA,GAAA,CAAA,CAAA,EAAA,GAA0B,gBAAO,CAAe,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AACtD,MAAA,mBAA8B,GAAA,aAAA,CAAA,KAAA,CAAA;AAAe,MAAA,MAAA,aAAA,GAAA,CAAA,CAAA,EAAA,GAAA,SAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AAC7C,MAAA,IAAA,uBAA4B,GAAA,aAAA;AAG5B,QAAA,OAAA;AAAsB,MACxB,MAAA,SAAA,GAAA,OAAA,GAAA,aAAA,GAAA,aAAA,GAAA,CAAA,GAAA,aAAA,GAAA,aAAA,GAAA,OAAA,GAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,147 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ navTranslateX: import("vue").Ref<number>;
3
+ scrollRef: import("vue").Ref<HTMLElement | null>;
4
+ scrollContentRef: import("vue").Ref<HTMLElement | null>;
5
+ scrollable: import("vue").Ref<boolean>;
6
+ update: () => void;
7
+ btnNavPrev: () => void;
8
+ btnNavNext: () => void;
9
+ HzztIcon: import("vue").DefineComponent<{
10
+ name: {
11
+ type: StringConstructor;
12
+ required: true;
13
+ };
14
+ type: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ }, {
19
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
20
+ name: {
21
+ type: StringConstructor;
22
+ required: true;
23
+ };
24
+ type: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ }>> & {
29
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
30
+ }>>;
31
+ attrs: {
32
+ [x: string]: unknown;
33
+ };
34
+ componentName: import("vue").ComputedRef<string>;
35
+ ElIcon: import("element-plus/es/utils").SFCWithInstall<{
36
+ new (...args: any[]): {
37
+ $: import("vue").ComponentInternalInstance;
38
+ $data: {};
39
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
40
+ readonly size: {
41
+ 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>>;
42
+ readonly required: false;
43
+ readonly validator: ((val: unknown) => boolean) | undefined;
44
+ __epPropKey: true;
45
+ };
46
+ readonly color: {
47
+ readonly type: import("vue").PropType<string>;
48
+ readonly required: false;
49
+ readonly validator: ((val: unknown) => boolean) | undefined;
50
+ __epPropKey: true;
51
+ };
52
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
53
+ $attrs: {
54
+ [x: string]: unknown;
55
+ };
56
+ $refs: {
57
+ [x: string]: unknown;
58
+ };
59
+ $slots: Readonly<{
60
+ [name: string]: import("vue").Slot | undefined;
61
+ }>;
62
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
63
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
64
+ $emit: (event: string, ...args: any[]) => void;
65
+ $el: any;
66
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
67
+ readonly size: {
68
+ 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>>;
69
+ readonly required: false;
70
+ readonly validator: ((val: unknown) => boolean) | undefined;
71
+ __epPropKey: true;
72
+ };
73
+ readonly color: {
74
+ readonly type: import("vue").PropType<string>;
75
+ readonly required: false;
76
+ readonly validator: ((val: unknown) => boolean) | undefined;
77
+ __epPropKey: true;
78
+ };
79
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
80
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
81
+ created?: ((() => void) | (() => void)[]) | undefined;
82
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
83
+ mounted?: ((() => void) | (() => void)[]) | undefined;
84
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
85
+ updated?: ((() => void) | (() => void)[]) | undefined;
86
+ activated?: ((() => void) | (() => void)[]) | undefined;
87
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
88
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
89
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
90
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
91
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
92
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
93
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
94
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
95
+ };
96
+ $forceUpdate: () => void;
97
+ $nextTick: typeof import("vue").nextTick;
98
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
99
+ } & Readonly<import("vue").ExtractPropTypes<{
100
+ readonly size: {
101
+ 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>>;
102
+ readonly required: false;
103
+ readonly validator: ((val: unknown) => boolean) | undefined;
104
+ __epPropKey: true;
105
+ };
106
+ readonly color: {
107
+ readonly type: import("vue").PropType<string>;
108
+ readonly required: false;
109
+ readonly validator: ((val: unknown) => boolean) | undefined;
110
+ __epPropKey: true;
111
+ };
112
+ }>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
113
+ __isFragment?: undefined;
114
+ __isTeleport?: undefined;
115
+ __isSuspense?: undefined;
116
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
117
+ readonly size: {
118
+ 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>>;
119
+ readonly required: false;
120
+ readonly validator: ((val: unknown) => boolean) | undefined;
121
+ __epPropKey: true;
122
+ };
123
+ readonly color: {
124
+ readonly type: import("vue").PropType<string>;
125
+ readonly required: false;
126
+ readonly validator: ((val: unknown) => boolean) | undefined;
127
+ __epPropKey: true;
128
+ };
129
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
130
+ $slots: {
131
+ default?(_: {}): any;
132
+ };
133
+ })>;
134
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
135
+ name: {
136
+ type: StringConstructor;
137
+ required: true;
138
+ };
139
+ type: {
140
+ type: StringConstructor;
141
+ default: string;
142
+ };
143
+ }>>, {
144
+ type: string;
145
+ }>;
146
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
147
+ export default _default;
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=scroll2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import 'hzzt-plus/es/components/base/style/css';
2
+ import 'hzzt-plus/theme/hzzt-scroll.css';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/css.mjs';
2
+ import 'hzzt-plus/theme/hzzt-scroll.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/scroll.scss';
@@ -0,0 +1,3 @@
1
+ import '../../base/style/index.mjs';
2
+ import 'hzzt-plus/theme/src/scroll.scss';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -4,7 +4,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
4
4
  disabled: BooleanConstructor;
5
5
  replace: BooleanConstructor;
6
6
  label: StringConstructor;
7
- data: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
7
+ options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
8
8
  inputProps: ObjectConstructor;
9
9
  customProps: ObjectConstructor;
10
10
  position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
@@ -28,7 +28,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
28
28
  disabled: BooleanConstructor;
29
29
  replace: BooleanConstructor;
30
30
  label: StringConstructor;
31
- data: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
31
+ options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
32
32
  inputProps: ObjectConstructor;
33
33
  customProps: ObjectConstructor;
34
34
  position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
@@ -88,13 +88,46 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
88
88
  HzztTitle: import("vue").DefineComponent<{
89
89
  readonly label: StringConstructor;
90
90
  readonly sideline: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
91
+ readonly size: {
92
+ readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
93
+ readonly required: false;
94
+ readonly validator: ((val: unknown) => boolean) | undefined;
95
+ __epPropKey: true;
96
+ };
91
97
  }, {
92
98
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
93
99
  readonly label: StringConstructor;
94
100
  readonly sideline: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
101
+ readonly size: {
102
+ readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
103
+ readonly required: false;
104
+ readonly validator: ((val: unknown) => boolean) | undefined;
105
+ __epPropKey: true;
106
+ };
95
107
  }>> & {
96
108
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
97
109
  }>>;
110
+ formSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
111
+ ns: {
112
+ namespace: import("vue").ComputedRef<string>;
113
+ b: (blockSuffix?: string) => string;
114
+ e: (element?: string | undefined) => string;
115
+ m: (modifier?: string | undefined) => string;
116
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
117
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
118
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
119
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
120
+ is: {
121
+ (name: string, state: boolean | undefined): string;
122
+ (name: string): string;
123
+ };
124
+ cssVar: (object: Record<string, string>) => Record<string, string>;
125
+ cssVarName: (name: string) => string;
126
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
127
+ cssVarBlockName: (name: string) => string;
128
+ };
129
+ trueSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
130
+ nameKls: import("vue").ComputedRef<string[]>;
98
131
  slots: Readonly<{
99
132
  [name: string]: import("vue").Slot | undefined;
100
133
  }>;
@@ -102,6 +135,12 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
102
135
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
103
136
  readonly label: StringConstructor;
104
137
  readonly sideline: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
138
+ readonly size: {
139
+ readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
140
+ readonly required: false;
141
+ readonly validator: ((val: unknown) => boolean) | undefined;
142
+ __epPropKey: true;
143
+ };
105
144
  }>>, {
106
145
  readonly sideline: import("hzzt-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
107
146
  }>;
@@ -792,7 +831,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
792
831
  disabled: BooleanConstructor;
793
832
  replace: BooleanConstructor;
794
833
  label: StringConstructor;
795
- data: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
834
+ options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
796
835
  inputProps: ObjectConstructor;
797
836
  customProps: ObjectConstructor;
798
837
  position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
@@ -815,10 +854,10 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
815
854
  onInput?: ((value: string | undefined) => any) | undefined;
816
855
  }, {
817
856
  disabled: boolean;
857
+ options: import("..").OptionType[];
818
858
  modelValue: import("hzzt-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
819
859
  replace: boolean;
820
860
  split: string;
821
- data: import("..").OptionType[];
822
861
  position: string;
823
862
  indexType: string;
824
863
  }>> & Record<string, any>;
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import SelectInput from './src/select-input.mjs';
3
- export { selectInputEmits, selectInputProps } from './src/select-input2.mjs';
2
+ import SelectInput from './src/select-input2.mjs';
3
+ export { selectInputEmits, selectInputProps } from './src/select-input.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const HzztSelectInput = withInstall(SelectInput);
@@ -7,7 +7,7 @@ export declare const selectInputProps: {
7
7
  disabled: BooleanConstructor;
8
8
  replace: BooleanConstructor;
9
9
  label: StringConstructor;
10
- data: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
10
+ options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
11
11
  inputProps: ObjectConstructor;
12
12
  customProps: ObjectConstructor;
13
13
  position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
@@ -1,129 +1,50 @@
1
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
2
- import { selectInputProps, selectInputEmits } from './select-input2.mjs';
1
+ import '../../../utils/index.mjs';
3
2
  import '../../../hooks/index.mjs';
4
- import { useFormSize, useFormDisabled, ElInput, ElLink } from 'element-plus';
5
- import HzztTitle from '../../title/src/title2.mjs';
6
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
7
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
8
- import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
9
- import { numberToLetter } from '../../../hooks/use-letter/index.mjs';
3
+ import '../../../constants/index.mjs';
4
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
6
+ import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
7
+ import { isString } from '@vue/shared';
10
8
 
11
- const _hoisted_1 = { slot: "append" };
12
- const _hoisted_2 = { key: 0 };
13
- const __default__ = defineComponent({
14
- name: "HzztSelectInput"
9
+ const selectInputProps = buildProps({
10
+ modelValue: {
11
+ type: definePropType([
12
+ String,
13
+ Number
14
+ ]),
15
+ default: ""
16
+ },
17
+ indexType: {
18
+ type: String,
19
+ default: "number"
20
+ },
21
+ disabled: Boolean,
22
+ replace: Boolean,
23
+ label: String,
24
+ options: {
25
+ type: definePropType(Array),
26
+ default: () => []
27
+ },
28
+ inputProps: Object,
29
+ customProps: Object,
30
+ position: {
31
+ type: String,
32
+ default: "left"
33
+ },
34
+ formatLabel: {
35
+ type: Function
36
+ },
37
+ split: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ size: useSizeProp
15
42
  });
16
- const _sfc_main = /* @__PURE__ */ defineComponent({
17
- ...__default__,
18
- props: selectInputProps,
19
- emits: selectInputEmits,
20
- setup(__props, { emit }) {
21
- const props = __props;
22
- const inputVal = ref(props.modelValue);
23
- const nsInput = useNamespace("select-input");
24
- const formSize = useFormSize();
25
- const formDisabled = useFormDisabled();
26
- const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
27
- const trueDisabled = computed(() => props.disabled || formDisabled.value);
28
- const containerCls = computed(() => [
29
- nsInput.b(),
30
- nsInput.m(trueSize.value)
31
- ]);
32
- const inputContainerCls = computed(() => [
33
- "flex",
34
- props.position === "top" ? "column" : "row align-items-center"
35
- ]);
36
- const inputCls = computed(() => [
37
- "flex-1",
38
- props.label ? props.position === "top" ? "margin-b-1" : "margin-l-1" : ""
39
- ]);
40
- const _inputProps = computed(() => ({
41
- disabled: trueDisabled.value,
42
- clearable: true,
43
- ...props.inputProps
44
- }));
45
- watch(() => props.modelValue, (v) => {
46
- inputVal.value = v;
47
- });
48
- function input(val) {
49
- emit("update:modelValue", val);
50
- emit("input", val);
51
- }
52
- function change(val) {
53
- emit("change", val);
54
- }
55
- function getLinkName(item, index) {
56
- let prefix = "";
57
- if (props.indexType == "number") {
58
- prefix = `\uFF08${index + 1}\uFF09`;
59
- } else if (props.indexType == "letter") {
60
- prefix = `\uFF08${numberToLetter(index)}\uFF09`;
61
- }
62
- return prefix + (item.label || item.value);
63
- }
64
- function select(item) {
65
- const value = item.value || item.label;
66
- let content = "";
67
- if (!inputVal.value)
68
- inputVal.value = "";
69
- if (props.formatLabel) {
70
- content = props.formatLabel(value);
71
- } else if (props.replace) {
72
- content = value;
73
- } else {
74
- content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;
75
- }
76
- inputVal.value = content;
77
- input(content);
78
- change(content);
79
- }
80
- return (_ctx, _cache) => {
81
- return openBlock(), createElementBlock("div", {
82
- class: normalizeClass(unref(containerCls))
83
- }, [
84
- createElementVNode("div", {
85
- class: normalizeClass(unref(inputContainerCls))
86
- }, [
87
- renderSlot(_ctx.$slots, "title", {}, () => [
88
- createVNode(HzztTitle, { label: _ctx.label }, null, 8, ["label"])
89
- ]),
90
- createVNode(unref(ElInput), mergeProps({
91
- ref: "inputRef",
92
- class: unref(inputCls),
93
- modelValue: inputVal.value,
94
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
95
- }, unref(_inputProps), {
96
- onInput: input,
97
- onChange: change
98
- }), {
99
- default: withCtx(() => [
100
- createElementVNode("template", _hoisted_1, [
101
- renderSlot(_ctx.$slots, "append")
102
- ])
103
- ]),
104
- _: 3
105
- }, 16, ["class", "modelValue"])
106
- ], 2),
107
- _ctx.data.length && !unref(trueDisabled) ? (openBlock(), createElementBlock("div", _hoisted_2, [
108
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item, index) => {
109
- return openBlock(), createBlock(unref(ElLink), mergeProps({
110
- key: index,
111
- class: "margin-r-4"
112
- }, _ctx.customProps, {
113
- onClick: ($event) => select(item)
114
- }), {
115
- default: withCtx(() => [
116
- createTextVNode(toDisplayString(getLinkName(item, index)), 1)
117
- ]),
118
- _: 2
119
- }, 1040, ["onClick"]);
120
- }), 128))
121
- ])) : createCommentVNode("v-if", true)
122
- ], 2);
123
- };
124
- }
125
- });
126
- var SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-input.vue"]]);
43
+ const selectInputEmits = {
44
+ [UPDATE_MODEL_EVENT]: (value) => isString(value),
45
+ input: (value) => isString(value),
46
+ change: (value) => isString(value)
47
+ };
127
48
 
128
- export { SelectInput as default };
49
+ export { selectInputEmits, selectInputProps };
129
50
  //# sourceMappingURL=select-input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div :class=\"inputContainerCls\">\n <slot name=\"title\">\n <hzzt-title :label=\"label\"></hzzt-title>\n </slot>\n <el-input ref=\"inputRef\"\n :class=\"inputCls\"\n v-model=\"inputVal\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"\n >\n <template slot=\"append\">\n <slot name=\"append\"></slot>\n </template>\n </el-input>\n </div>\n <div v-if=\"data.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in data\" :key=\"index\" class=\"margin-r-4\" v-bind=\"customProps\" @click=\"select(item)\">\n {{ getLinkName(item, index) }}\n </el-link>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch} from 'vue'\n import {selectInputEmits, selectInputProps} from './select-input'\n import {useGlobalSize, useNamespace, numberToLetter} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElLink} from 'element-plus'\n import {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\n defineOptions({\n name: 'HzztSelectInput',\n })\n\n const props = defineProps(selectInputProps)\n const emit = defineEmits(selectInputEmits)\n\n const inputVal = ref(props.modelValue);\n\n const nsInput = useNamespace('select-input')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const inputContainerCls = computed(() => [\n 'flex',\n props.position === 'top' ? 'column' : 'row align-items-center'\n ])\n\n const inputCls = computed(() => [\n 'flex-1',\n props.label ? props.position === 'top' ? 'margin-b-1' : 'margin-l-1' : ''\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function getLinkName(item: OptionType, index: number) {\n let prefix = '';\n if (props.indexType == 'number') {\n prefix = `(${index + 1})`\n } else if (props.indexType == 'letter') {\n prefix = `(${numberToLetter(index)})`\n }\n return prefix + (item.label || item.value);\n }\n\n function select(item: OptionType) {\n const value = item.value||item.label;\n let content = '';\n if (!inputVal.value) inputVal.value = '';\n if (props.formatLabel) {\n content = props.formatLabel(value);\n } else if (props.replace) {\n content = value;\n } else {\n content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;\n }\n inputVal.value = content;\n input(content);\n change(content);\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":"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"}
1
+ {"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectInput from './select-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\nimport {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\nexport const selectInputProps = buildProps({\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n indexType: {\n type: String,\n default: 'number',\n },\n disabled: Boolean,\n replace: Boolean,\n label: String,\n options: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n customProps: Object,\n position: {\n type: String,\n default: 'left',\n },\n formatLabel: {\n type: Function,\n },\n split: {\n type: String,\n default: '',\n },\n size: useSizeProp,\n})\n\nexport type SelectInputProps = ExtractPropTypes<typeof selectInputProps>\n\nexport const selectInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string | undefined) => isString(value),\n input: (value: string | undefined) => isString(value),\n change: (value: string | undefined) => isString(value),\n}\nexport type SelectInputEmits = typeof selectInputEmits\n\nexport type SelectInputInstance = InstanceType<typeof SelectInput>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACpC;;;;"}