hzzt-plus 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +557 -354
  3. package/dist/index.full.min.js +10 -10
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +13 -13
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +558 -356
  8. package/dist/locale/en.js +1 -1
  9. package/dist/locale/en.min.js +1 -1
  10. package/dist/locale/en.min.mjs +1 -1
  11. package/dist/locale/en.mjs +1 -1
  12. package/dist/locale/zh-cn.js +1 -1
  13. package/dist/locale/zh-cn.min.js +1 -1
  14. package/dist/locale/zh-cn.min.mjs +1 -1
  15. package/dist/locale/zh-cn.mjs +1 -1
  16. package/es/component.mjs +3 -1
  17. package/es/component.mjs.map +1 -1
  18. package/es/components/collapse/index.d.ts +161 -8
  19. package/es/components/collapse/src/collapse.vue.d.ts +161 -8
  20. package/es/components/collapse/src/collapse2.mjs +50 -29
  21. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  22. package/es/components/icon/index.mjs +4 -0
  23. package/es/components/icon/index.mjs.map +1 -1
  24. package/es/components/icon/src/components/index.d.ts +2 -0
  25. package/es/components/icon/src/components/index.mjs +3 -0
  26. package/es/components/icon/src/components/index.mjs.map +1 -0
  27. package/es/components/icon/src/components/minus-square-outline.mjs +29 -0
  28. package/es/components/icon/src/components/minus-square-outline.mjs.map +1 -0
  29. package/es/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
  30. package/es/components/icon/src/components/plus-square-outline.mjs +29 -0
  31. package/es/components/icon/src/components/plus-square-outline.mjs.map +1 -0
  32. package/es/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
  33. package/es/components/index.d.ts +1 -0
  34. package/es/components/index.mjs +3 -2
  35. package/es/components/index.mjs.map +1 -1
  36. package/es/components/pagination/index.d.ts +2 -2
  37. package/es/components/pagination/src/index.mjs +49 -21
  38. package/es/components/pagination/src/index.mjs.map +1 -1
  39. package/es/components/pagination/src/index.vue.d.ts +2 -2
  40. package/es/components/scroll/index.d.ts +5 -0
  41. package/es/components/scroll/index.mjs +9 -0
  42. package/es/components/scroll/index.mjs.map +1 -0
  43. package/es/components/scroll/src/scroll.d.ts +2 -0
  44. package/es/components/scroll/src/scroll.mjs +2 -0
  45. package/es/components/scroll/src/scroll.mjs.map +1 -0
  46. package/es/components/scroll/src/scroll.vue.d.ts +147 -0
  47. package/es/components/scroll/src/scroll2.mjs +88 -0
  48. package/es/components/scroll/src/scroll2.mjs.map +1 -0
  49. package/es/components/scroll/style/css.d.ts +2 -0
  50. package/es/components/scroll/style/css.mjs +3 -0
  51. package/es/components/scroll/style/css.mjs.map +1 -0
  52. package/es/components/scroll/style/index.d.ts +2 -0
  53. package/es/components/scroll/style/index.mjs +3 -0
  54. package/es/components/scroll/style/index.mjs.map +1 -0
  55. package/es/components/select-input/index.d.ts +39 -0
  56. package/es/components/select-input/index.mjs +2 -2
  57. package/es/components/select-input/src/select-input.mjs +45 -124
  58. package/es/components/select-input/src/select-input.mjs.map +1 -1
  59. package/es/components/select-input/src/select-input.vue.d.ts +39 -0
  60. package/es/components/select-input/src/select-input2.mjs +124 -45
  61. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  62. package/es/components/select-textarea/index.mjs +2 -2
  63. package/es/components/select-textarea/src/select-textarea.mjs +100 -30
  64. package/es/components/select-textarea/src/select-textarea.mjs.map +1 -1
  65. package/es/components/select-textarea/src/select-textarea.vue.d.ts +39 -0
  66. package/es/components/select-textarea/src/select-textarea2.mjs +30 -100
  67. package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -1
  68. package/es/components/title/src/title.d.ts +6 -0
  69. package/es/components/title/src/title.mjs +4 -1
  70. package/es/components/title/src/title.mjs.map +1 -1
  71. package/es/components/title/src/title.vue.d.ts +39 -0
  72. package/es/components/title/src/title2.mjs +28 -12
  73. package/es/components/title/src/title2.mjs.map +1 -1
  74. package/es/index.mjs +3 -2
  75. package/es/index.mjs.map +1 -1
  76. package/es/version.d.ts +1 -1
  77. package/es/version.mjs +1 -1
  78. package/es/version.mjs.map +1 -1
  79. package/global.d.ts +1 -0
  80. package/lib/component.js +3 -1
  81. package/lib/component.js.map +1 -1
  82. package/lib/components/collapse/index.d.ts +161 -8
  83. package/lib/components/collapse/src/collapse.vue.d.ts +161 -8
  84. package/lib/components/collapse/src/collapse2.js +49 -28
  85. package/lib/components/collapse/src/collapse2.js.map +1 -1
  86. package/lib/components/icon/index.js +4 -0
  87. package/lib/components/icon/index.js.map +1 -1
  88. package/lib/components/icon/src/components/index.d.ts +2 -0
  89. package/lib/components/icon/src/components/index.js +12 -0
  90. package/lib/components/icon/src/components/index.js.map +1 -0
  91. package/lib/components/icon/src/components/minus-square-outline.js +33 -0
  92. package/lib/components/icon/src/components/minus-square-outline.js.map +1 -0
  93. package/lib/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
  94. package/lib/components/icon/src/components/plus-square-outline.js +33 -0
  95. package/lib/components/icon/src/components/plus-square-outline.js.map +1 -0
  96. package/lib/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
  97. package/lib/components/index.d.ts +1 -0
  98. package/lib/components/index.js +4 -2
  99. package/lib/components/index.js.map +1 -1
  100. package/lib/components/pagination/index.d.ts +2 -2
  101. package/lib/components/pagination/src/index.js +48 -20
  102. package/lib/components/pagination/src/index.js.map +1 -1
  103. package/lib/components/pagination/src/index.vue.d.ts +2 -2
  104. package/lib/components/scroll/index.d.ts +5 -0
  105. package/lib/components/scroll/index.js +14 -0
  106. package/lib/components/scroll/index.js.map +1 -0
  107. package/lib/components/scroll/src/scroll.d.ts +2 -0
  108. package/lib/components/scroll/src/scroll.js +3 -0
  109. package/lib/components/scroll/src/scroll.js.map +1 -0
  110. package/lib/components/scroll/src/scroll.vue.d.ts +147 -0
  111. package/lib/components/scroll/src/scroll2.js +92 -0
  112. package/lib/components/scroll/src/scroll2.js.map +1 -0
  113. package/lib/components/scroll/style/css.d.ts +2 -0
  114. package/lib/components/scroll/style/css.js +6 -0
  115. package/lib/components/scroll/style/css.js.map +1 -0
  116. package/lib/components/scroll/style/index.d.ts +2 -0
  117. package/lib/components/scroll/style/index.js +6 -0
  118. package/lib/components/scroll/style/index.js.map +1 -0
  119. package/lib/components/select-input/index.d.ts +39 -0
  120. package/lib/components/select-input/index.js +2 -2
  121. package/lib/components/select-input/src/select-input.js +46 -124
  122. package/lib/components/select-input/src/select-input.js.map +1 -1
  123. package/lib/components/select-input/src/select-input.vue.d.ts +39 -0
  124. package/lib/components/select-input/src/select-input2.js +124 -46
  125. package/lib/components/select-input/src/select-input2.js.map +1 -1
  126. package/lib/components/select-textarea/index.js +2 -2
  127. package/lib/components/select-textarea/src/select-textarea.js +100 -31
  128. package/lib/components/select-textarea/src/select-textarea.js.map +1 -1
  129. package/lib/components/select-textarea/src/select-textarea.vue.d.ts +39 -0
  130. package/lib/components/select-textarea/src/select-textarea2.js +31 -100
  131. package/lib/components/select-textarea/src/select-textarea2.js.map +1 -1
  132. package/lib/components/title/src/title.d.ts +6 -0
  133. package/lib/components/title/src/title.js +4 -1
  134. package/lib/components/title/src/title.js.map +1 -1
  135. package/lib/components/title/src/title.vue.d.ts +39 -0
  136. package/lib/components/title/src/title2.js +27 -11
  137. package/lib/components/title/src/title2.js.map +1 -1
  138. package/lib/index.js +34 -32
  139. package/lib/index.js.map +1 -1
  140. package/lib/version.d.ts +1 -1
  141. package/lib/version.js +1 -1
  142. package/lib/version.js.map +1 -1
  143. package/package.json +1 -1
  144. package/theme/hzzt-collapse.css +1 -1
  145. package/theme/hzzt-pagination.css +1 -1
  146. package/theme/hzzt-scan.css +1 -1
  147. package/theme/hzzt-scroll.css +1 -0
  148. package/theme/hzzt-title.css +1 -1
  149. package/theme/index.css +1 -1
  150. package/theme/src/collapse.scss +45 -39
  151. package/theme/src/index.scss +1 -0
  152. package/theme/src/pagination.scss +24 -6
  153. package/theme/src/scan.scss +3 -3
  154. package/theme/src/scroll.scss +42 -0
  155. package/theme/src/title.scss +14 -5
  156. package/web-types.json +1 -1
@@ -1,36 +1,106 @@
1
- import '../../../utils/index.mjs';
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, createBlock, createCommentVNode, mergeProps } from 'vue';
2
+ import { selectTextareaProps, selectTextareaEmits } from './select-textarea2.mjs';
2
3
  import '../../../hooks/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, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
7
- import { isString } from '@vue/shared';
8
- import { isNumber, isBoolean } from '../../../utils/types.mjs';
4
+ import { useFormSize, useFormDisabled, ElSelectV2, ElInput } 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 { insertCursorPosition } from '../../../hooks/use-cursor/index.mjs';
9
10
 
10
- const selectTextareaProps = buildProps({
11
- size: useSizeProp,
12
- disabled: Boolean,
13
- label: String,
14
- data: {
15
- type: definePropType(Array),
16
- default: () => []
17
- },
18
- inputProps: Object,
19
- replace: Boolean,
20
- modelValue: {
21
- type: definePropType([
22
- String,
23
- Number
24
- ]),
25
- default: ""
11
+ const _hoisted_1 = { class: "flex column" };
12
+ const _hoisted_2 = { class: "flex align-items-center" };
13
+ const __default__ = defineComponent({
14
+ name: "HzztSelectTextarea"
15
+ });
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ ...__default__,
18
+ props: selectTextareaProps,
19
+ emits: selectTextareaEmits,
20
+ setup(__props, { emit }) {
21
+ const props = __props;
22
+ const inputVal = ref(props.modelValue);
23
+ const selectValue = ref("");
24
+ const inputRef = ref();
25
+ const nsInput = useNamespace("select-textarea");
26
+ const formSize = useFormSize();
27
+ const formDisabled = useFormDisabled();
28
+ const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
29
+ const trueDisabled = computed(() => props.disabled || formDisabled.value);
30
+ const containerCls = computed(() => [
31
+ nsInput.b(),
32
+ nsInput.m(trueSize.value)
33
+ ]);
34
+ const _inputProps = computed(() => ({
35
+ disabled: trueDisabled.value,
36
+ clearable: true,
37
+ ...props.inputProps,
38
+ type: "textarea"
39
+ }));
40
+ watch(() => props.modelValue, (v) => {
41
+ inputVal.value = v;
42
+ });
43
+ function input(val) {
44
+ emit("update:modelValue", val);
45
+ emit("input", val);
46
+ }
47
+ function change(val) {
48
+ emit("change", val);
49
+ }
50
+ function selectChange(val) {
51
+ if (!inputVal.value && inputVal.value !== 0)
52
+ inputVal.value = "";
53
+ selectValue.value = "";
54
+ let content = val;
55
+ if (!props.replace) {
56
+ const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
57
+ content = insertCursorPosition(inputEl, val);
58
+ }
59
+ input(content);
60
+ change(content);
61
+ emit("select", val);
62
+ }
63
+ return (_ctx, _cache) => {
64
+ return openBlock(), createElementBlock("div", {
65
+ class: normalizeClass(unref(containerCls))
66
+ }, [
67
+ createElementVNode("div", _hoisted_1, [
68
+ createElementVNode("div", _hoisted_2, [
69
+ renderSlot(_ctx.$slots, "title", {}, () => [
70
+ createVNode(HzztTitle, {
71
+ class: "margin-l-1",
72
+ label: _ctx.label
73
+ }, null, 8, ["label"])
74
+ ]),
75
+ !unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), {
76
+ key: 0,
77
+ class: "flex-1",
78
+ modelValue: selectValue.value,
79
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
80
+ "allow-create": "",
81
+ filterable: "",
82
+ clearable: "",
83
+ onChange: selectChange,
84
+ options: _ctx.data
85
+ }, null, 8, ["modelValue", "options"])) : createCommentVNode("v-if", true),
86
+ renderSlot(_ctx.$slots, "right")
87
+ ]),
88
+ createVNode(unref(ElInput), mergeProps({
89
+ ref_key: "inputRef",
90
+ ref: inputRef,
91
+ class: "flex-1 margin-t-1",
92
+ modelValue: inputVal.value,
93
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
94
+ }, unref(_inputProps), {
95
+ onInput: input,
96
+ onChange: change
97
+ }), null, 16, ["modelValue"])
98
+ ])
99
+ ], 2);
100
+ };
26
101
  }
27
102
  });
28
- const selectTextareaEmits = {
29
- [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
30
- [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
31
- [INPUT_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
32
- select: (val) => isString(val) || isNumber(val) || isBoolean(val)
33
- };
103
+ var SelectTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-textarea.vue"]]);
34
104
 
35
- export { selectTextareaEmits, selectTextareaProps };
105
+ export { SelectTextarea as default };
36
106
  //# sourceMappingURL=select-textarea.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-textarea.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.ts"],"sourcesContent":["import {buildProps, definePropType, isString, isNumber, isBoolean} from '@hzzt-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectTextarea from './select-textarea.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\nimport {OptionType} from \"@hzzt-plus/components\";\nimport {CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const selectTextareaProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n label: String,\n data: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n replace: Boolean,\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n})\n\nexport type SelectTextareaProps = ExtractPropTypes<typeof selectTextareaProps>\n\nexport const selectTextareaEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [INPUT_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n select: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\nexport type SelectTextareaEmits = typeof selectTextareaEmits\n\nexport type SelectTextareaInstance = InstanceType<typeof SelectTextarea>\n"],"names":[],"mappings":";;;;;;;;;AAGY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,OAAO,EAAE,OAAO;AAClB,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,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG;AACnC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC1E,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
1
+ {"version":3,"file":"select-textarea.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div class=\"flex column\">\n <div class=\"flex align-items-center\">\n <slot name=\"title\">\n <hzzt-title class=\"margin-l-1\" :label=\"label\"></hzzt-title>\n </slot>\n <el-select-v2 class=\"flex-1\" v-model=\"selectValue\" allow-create filterable clearable @change=\"selectChange\"\n v-if=\"!trueDisabled\" :options=\"data\"></el-select-v2>\n <slot name=\"right\"></slot>\n </div>\n <el-input ref=\"inputRef\" class=\"flex-1 margin-t-1\" v-model=\"inputVal\" v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"></el-input>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {selectTextareaProps, selectTextareaEmits} from './select-textarea'\n import {computed, ref, watch} from \"vue\";\n import {useGlobalSize, useNamespace, insertCursorPosition} 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, ElSelectV2} from 'element-plus'\n\n defineOptions({\n name: 'HzztSelectTextarea',\n })\n\n const props = defineProps(selectTextareaProps)\n const emit = defineEmits(selectTextareaEmits)\n\n const inputVal = ref(props.modelValue);\n const selectValue = ref('');\n const inputRef = ref();\n\n const nsInput = useNamespace('select-textarea')\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 _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n type: 'textarea',\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 selectChange(val: string) {\n if (!inputVal.value && inputVal.value !== 0) inputVal.value = '';\n selectValue.value = '';\n let content = val;\n if (!props.replace) {\n const inputEl = inputRef.value.$el.getElementsByTagName('textarea')[0];\n content = insertCursorPosition(inputEl, val);\n }\n input(content);\n change(content);\n emit('select', val);\n }\n\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;mCA0BgB,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACrC,IAAM,MAAA,WAAA,GAAc,IAAI,EAAE,CAAA,CAAA;AAC1B,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,aAAa,iBAAiB,CAAA,CAAA;AAC9C,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAA,MAAM,eAAe,eAAgB,EAAA,CAAA;AAErC,IAAA,MAAM,QAAW,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAA,aAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,kBACH,GAAA,QAAiB,CAAA,MAAA,kBAAuB,YAAE,CAAA,KAAA,CAAA,CAAA;AAAA,IACxD,MAAA,YAAA,GAAA,QAAA,CAAA,MAAA;AAEA,MAAA;AAEA,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,KAAA,CAClC;AAAU,IACV,MAAA,WAAU,GAAA,QAAc,CAAA,OAAA;AAAA,MACzB,QAAA,EAAA,YAAA,CAAA,KAAA;AAED,MAAM,SAAA,EAAA,IAAA;AAA8B,MAClC,mBAAuB;AAAA,MACvB,IAAW,EAAA,UAAA;AAAA,KAAA,CACX;AAAS,IAAA,KACH,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACN,QAAA,CAAA,KAAA,GAAA,CAAA,CAAA;AAEF,KAAA,CAAA,CAAA;AACE,IAAA,SAAA,KAAiB,CAAA,GAAA,EAAA;AAAA,MAClB,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAED,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,gBAAc,GAAG,EAAA;AAAA,MACnB,IAAA,CAAA,QAAA,EAAA,GAAA,CAAA,CAAA;AAEA,KAAA;AACE,IAAA,qBAAkB,CAAA,GAAA,EAAA;AAAA,MACpB,IAAA,CAAA,QAAA,CAAA,KAAA,IAAA,QAAA,CAAA,KAAA,KAAA,CAAA;AAEA,QAAA,mBAAmC,CAAA;AACjC,MAAA,WAAK,CAAA,KAAkB,GAAA,EAAA,CAAA;AAAsB,MAAA,IAAA,OAAS,GAAQ,GAAA,CAAA;AAC9D,MAAA,IAAA,CAAA,KAAA,CAAA,OAAoB,EAAA;AACpB,QAAA,MAAc,OAAA,GAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACd,QAAI,UAAgB,oBAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA;AAClB,OAAA;AACA,MAAU,KAAA,CAAA,OAAA,CAAA,CAAA;AAAiC,MAC7C,MAAA,CAAA,OAAA,CAAA,CAAA;AACA,MAAA,IAAA,CAAA,QAAa,EAAA,GAAA,CAAA,CAAA;AACb,KAAA;AACA,IAAA,OAAK,aAAa,KAAA;AAAA,MACpB,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -69,13 +69,46 @@ declare const _default: import("vue").DefineComponent<{
69
69
  HzztTitle: import("vue").DefineComponent<{
70
70
  readonly label: StringConstructor;
71
71
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
72
+ readonly size: {
73
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
74
+ readonly required: false;
75
+ readonly validator: ((val: unknown) => boolean) | undefined;
76
+ __epPropKey: true;
77
+ };
72
78
  }, {
73
79
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
74
80
  readonly label: StringConstructor;
75
81
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
82
+ readonly size: {
83
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
84
+ readonly required: false;
85
+ readonly validator: ((val: unknown) => boolean) | undefined;
86
+ __epPropKey: true;
87
+ };
76
88
  }>> & {
77
89
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
78
90
  }>>;
91
+ formSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
92
+ ns: {
93
+ namespace: import("vue").ComputedRef<string>;
94
+ b: (blockSuffix?: string) => string;
95
+ e: (element?: string | undefined) => string;
96
+ m: (modifier?: string | undefined) => string;
97
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
98
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
99
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
100
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
101
+ is: {
102
+ (name: string, state: boolean | undefined): string;
103
+ (name: string): string;
104
+ };
105
+ cssVar: (object: Record<string, string>) => Record<string, string>;
106
+ cssVarName: (name: string) => string;
107
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
108
+ cssVarBlockName: (name: string) => string;
109
+ };
110
+ trueSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
111
+ nameKls: import("vue").ComputedRef<string[]>;
79
112
  slots: Readonly<{
80
113
  [name: string]: import("vue").Slot | undefined;
81
114
  }>;
@@ -83,6 +116,12 @@ declare const _default: import("vue").DefineComponent<{
83
116
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
84
117
  readonly label: StringConstructor;
85
118
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
119
+ readonly size: {
120
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
121
+ readonly required: false;
122
+ readonly validator: ((val: unknown) => boolean) | undefined;
123
+ __epPropKey: true;
124
+ };
86
125
  }>>, {
87
126
  readonly sideline: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
88
127
  }>;
@@ -1,106 +1,36 @@
1
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, createBlock, createCommentVNode, mergeProps } from 'vue';
2
- import { selectTextareaProps, selectTextareaEmits } from './select-textarea.mjs';
1
+ import '../../../utils/index.mjs';
3
2
  import '../../../hooks/index.mjs';
4
- import { useFormSize, useFormDisabled, ElSelectV2, ElInput } 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 { insertCursorPosition } from '../../../hooks/use-cursor/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, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
7
+ import { isString } from '@vue/shared';
8
+ import { isNumber, isBoolean } from '../../../utils/types.mjs';
10
9
 
11
- const _hoisted_1 = { class: "flex column" };
12
- const _hoisted_2 = { class: "flex align-items-center" };
13
- const __default__ = defineComponent({
14
- name: "HzztSelectTextarea"
15
- });
16
- const _sfc_main = /* @__PURE__ */ defineComponent({
17
- ...__default__,
18
- props: selectTextareaProps,
19
- emits: selectTextareaEmits,
20
- setup(__props, { emit }) {
21
- const props = __props;
22
- const inputVal = ref(props.modelValue);
23
- const selectValue = ref("");
24
- const inputRef = ref();
25
- const nsInput = useNamespace("select-textarea");
26
- const formSize = useFormSize();
27
- const formDisabled = useFormDisabled();
28
- const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
29
- const trueDisabled = computed(() => props.disabled || formDisabled.value);
30
- const containerCls = computed(() => [
31
- nsInput.b(),
32
- nsInput.m(trueSize.value)
33
- ]);
34
- const _inputProps = computed(() => ({
35
- disabled: trueDisabled.value,
36
- clearable: true,
37
- ...props.inputProps,
38
- type: "textarea"
39
- }));
40
- watch(() => props.modelValue, (v) => {
41
- inputVal.value = v;
42
- });
43
- function input(val) {
44
- emit("update:modelValue", val);
45
- emit("input", val);
46
- }
47
- function change(val) {
48
- emit("change", val);
49
- }
50
- function selectChange(val) {
51
- if (!inputVal.value && inputVal.value !== 0)
52
- inputVal.value = "";
53
- selectValue.value = "";
54
- let content = val;
55
- if (!props.replace) {
56
- const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
57
- content = insertCursorPosition(inputEl, val);
58
- }
59
- input(content);
60
- change(content);
61
- emit("select", val);
62
- }
63
- return (_ctx, _cache) => {
64
- return openBlock(), createElementBlock("div", {
65
- class: normalizeClass(unref(containerCls))
66
- }, [
67
- createElementVNode("div", _hoisted_1, [
68
- createElementVNode("div", _hoisted_2, [
69
- renderSlot(_ctx.$slots, "title", {}, () => [
70
- createVNode(HzztTitle, {
71
- class: "margin-l-1",
72
- label: _ctx.label
73
- }, null, 8, ["label"])
74
- ]),
75
- !unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), {
76
- key: 0,
77
- class: "flex-1",
78
- modelValue: selectValue.value,
79
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
80
- "allow-create": "",
81
- filterable: "",
82
- clearable: "",
83
- onChange: selectChange,
84
- options: _ctx.data
85
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("v-if", true),
86
- renderSlot(_ctx.$slots, "right")
87
- ]),
88
- createVNode(unref(ElInput), mergeProps({
89
- ref_key: "inputRef",
90
- ref: inputRef,
91
- class: "flex-1 margin-t-1",
92
- modelValue: inputVal.value,
93
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
94
- }, unref(_inputProps), {
95
- onInput: input,
96
- onChange: change
97
- }), null, 16, ["modelValue"])
98
- ])
99
- ], 2);
100
- };
10
+ const selectTextareaProps = buildProps({
11
+ size: useSizeProp,
12
+ disabled: Boolean,
13
+ label: String,
14
+ data: {
15
+ type: definePropType(Array),
16
+ default: () => []
17
+ },
18
+ inputProps: Object,
19
+ replace: Boolean,
20
+ modelValue: {
21
+ type: definePropType([
22
+ String,
23
+ Number
24
+ ]),
25
+ default: ""
101
26
  }
102
27
  });
103
- var SelectTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-textarea.vue"]]);
28
+ const selectTextareaEmits = {
29
+ [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
30
+ [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
31
+ [INPUT_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
32
+ select: (val) => isString(val) || isNumber(val) || isBoolean(val)
33
+ };
104
34
 
105
- export { SelectTextarea as default };
35
+ export { selectTextareaEmits, selectTextareaProps };
106
36
  //# sourceMappingURL=select-textarea2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-textarea2.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div class=\"flex column\">\n <div class=\"flex align-items-center\">\n <slot name=\"title\">\n <hzzt-title class=\"margin-l-1\" :label=\"label\"></hzzt-title>\n </slot>\n <el-select-v2 class=\"flex-1\" v-model=\"selectValue\" allow-create filterable clearable @change=\"selectChange\"\n v-if=\"!trueDisabled\" :options=\"data\"></el-select-v2>\n <slot name=\"right\"></slot>\n </div>\n <el-input ref=\"inputRef\" class=\"flex-1 margin-t-1\" v-model=\"inputVal\" v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"></el-input>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {selectTextareaProps, selectTextareaEmits} from './select-textarea'\n import {computed, ref, watch} from \"vue\";\n import {useGlobalSize, useNamespace, insertCursorPosition} 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, ElSelectV2} from 'element-plus'\n\n defineOptions({\n name: 'HzztSelectTextarea',\n })\n\n const props = defineProps(selectTextareaProps)\n const emit = defineEmits(selectTextareaEmits)\n\n const inputVal = ref(props.modelValue);\n const selectValue = ref('');\n const inputRef = ref();\n\n const nsInput = useNamespace('select-textarea')\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 _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n type: 'textarea',\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 selectChange(val: string) {\n if (!inputVal.value && inputVal.value !== 0) inputVal.value = '';\n selectValue.value = '';\n let content = val;\n if (!props.replace) {\n const inputEl = inputRef.value.$el.getElementsByTagName('textarea')[0];\n content = insertCursorPosition(inputEl, val);\n }\n input(content);\n change(content);\n emit('select', val);\n }\n\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;mCA0BgB,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACrC,IAAM,MAAA,WAAA,GAAc,IAAI,EAAE,CAAA,CAAA;AAC1B,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,aAAa,iBAAiB,CAAA,CAAA;AAC9C,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAA,MAAM,eAAe,eAAgB,EAAA,CAAA;AAErC,IAAA,MAAM,QAAW,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAA,aAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,kBACH,GAAA,QAAiB,CAAA,MAAA,kBAAuB,YAAE,CAAA,KAAA,CAAA,CAAA;AAAA,IACxD,MAAA,YAAA,GAAA,QAAA,CAAA,MAAA;AAEA,MAAA;AAEA,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,KAAA,CAClC;AAAU,IACV,MAAA,WAAU,GAAA,QAAc,CAAA,OAAA;AAAA,MACzB,QAAA,EAAA,YAAA,CAAA,KAAA;AAED,MAAM,SAAA,EAAA,IAAA;AAA8B,MAClC,mBAAuB;AAAA,MACvB,IAAW,EAAA,UAAA;AAAA,KAAA,CACX;AAAS,IAAA,KACH,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACN,QAAA,CAAA,KAAA,GAAA,CAAA,CAAA;AAEF,KAAA,CAAA,CAAA;AACE,IAAA,SAAA,KAAiB,CAAA,GAAA,EAAA;AAAA,MAClB,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAED,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,gBAAc,GAAG,EAAA;AAAA,MACnB,IAAA,CAAA,QAAA,EAAA,GAAA,CAAA,CAAA;AAEA,KAAA;AACE,IAAA,qBAAkB,CAAA,GAAA,EAAA;AAAA,MACpB,IAAA,CAAA,QAAA,CAAA,KAAA,IAAA,QAAA,CAAA,KAAA,KAAA,CAAA;AAEA,QAAA,mBAAmC,CAAA;AACjC,MAAA,WAAK,CAAA,KAAkB,GAAA,EAAA,CAAA;AAAsB,MAAA,IAAA,OAAS,GAAQ,GAAA,CAAA;AAC9D,MAAA,IAAA,CAAA,KAAA,CAAA,OAAoB,EAAA;AACpB,QAAA,MAAc,OAAA,GAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACd,QAAI,UAAgB,oBAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA;AAClB,OAAA;AACA,MAAU,KAAA,CAAA,OAAA,CAAA,CAAA;AAAiC,MAC7C,MAAA,CAAA,OAAA,CAAA,CAAA;AACA,MAAA,IAAA,CAAA,QAAa,EAAA,GAAA,CAAA,CAAA;AACb,KAAA;AACA,IAAA,OAAK,aAAa,KAAA;AAAA,MACpB,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"select-textarea2.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.ts"],"sourcesContent":["import {buildProps, definePropType, isString, isNumber, isBoolean} from '@hzzt-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectTextarea from './select-textarea.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\nimport {OptionType} from \"@hzzt-plus/components\";\nimport {CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const selectTextareaProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n label: String,\n data: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n replace: Boolean,\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n})\n\nexport type SelectTextareaProps = ExtractPropTypes<typeof selectTextareaProps>\n\nexport const selectTextareaEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [INPUT_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n select: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\nexport type SelectTextareaEmits = typeof selectTextareaEmits\n\nexport type SelectTextareaInstance = InstanceType<typeof SelectTextarea>\n"],"names":[],"mappings":";;;;;;;;;AAGY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,OAAO,EAAE,OAAO;AAClB,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,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG;AACnC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC1E,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
@@ -3,6 +3,12 @@ import type Title from './title.vue';
3
3
  export declare const titleProps: {
4
4
  readonly label: StringConstructor;
5
5
  readonly sideline: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
6
+ readonly size: {
7
+ readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
8
+ readonly required: false;
9
+ readonly validator: ((val: unknown) => boolean) | undefined;
10
+ __epPropKey: true;
11
+ };
6
12
  };
7
13
  export declare type TitleProps = ExtractPropTypes<typeof titleProps>;
8
14
  export declare type TitleInstance = InstanceType<typeof Title>;
@@ -1,12 +1,15 @@
1
1
  import '../../../utils/index.mjs';
2
+ import '../../../hooks/index.mjs';
2
3
  import { buildProps } from '../../../utils/vue/props/runtime.mjs';
4
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
3
5
 
4
6
  const titleProps = buildProps({
5
7
  label: String,
6
8
  sideline: {
7
9
  type: Boolean,
8
10
  default: true
9
- }
11
+ },
12
+ size: useSizeProp
10
13
  });
11
14
 
12
15
  export { titleProps };
@@ -1 +1 @@
1
- {"version":3,"file":"title.mjs","sources":["../../../../../../packages/components/title/src/title.ts"],"sourcesContent":["import { buildProps } from '@hzzt-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Title from './title.vue'\n\nexport const titleProps = buildProps({\n label: String,\n sideline: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TitleProps = ExtractPropTypes<typeof titleProps>\n\nexport type TitleInstance = InstanceType<typeof Title>\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"title.mjs","sources":["../../../../../../packages/components/title/src/title.ts"],"sourcesContent":["import { buildProps } from '@hzzt-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Title from './title.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nexport const titleProps = buildProps({\n label: String,\n sideline: {\n type: Boolean,\n default: true,\n },\n size: useSizeProp,\n} as const)\nexport type TitleProps = ExtractPropTypes<typeof titleProps>\n\nexport type TitleInstance = InstanceType<typeof Title>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC;;;;"}
@@ -1,13 +1,46 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  readonly label: StringConstructor;
3
3
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
4
+ readonly size: {
5
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
6
+ readonly required: false;
7
+ readonly validator: ((val: unknown) => boolean) | undefined;
8
+ __epPropKey: true;
9
+ };
4
10
  }, {
5
11
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
6
12
  readonly label: StringConstructor;
7
13
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
14
+ readonly size: {
15
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
16
+ readonly required: false;
17
+ readonly validator: ((val: unknown) => boolean) | undefined;
18
+ __epPropKey: true;
19
+ };
8
20
  }>> & {
9
21
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
10
22
  }>>;
23
+ formSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
24
+ ns: {
25
+ namespace: import("vue").ComputedRef<string>;
26
+ b: (blockSuffix?: string) => string;
27
+ e: (element?: string | undefined) => string;
28
+ m: (modifier?: string | undefined) => string;
29
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
30
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
31
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
32
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
33
+ is: {
34
+ (name: string, state: boolean | undefined): string;
35
+ (name: string): string;
36
+ };
37
+ cssVar: (object: Record<string, string>) => Record<string, string>;
38
+ cssVarName: (name: string) => string;
39
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
40
+ cssVarBlockName: (name: string) => string;
41
+ };
42
+ trueSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
43
+ nameKls: import("vue").ComputedRef<string[]>;
11
44
  slots: Readonly<{
12
45
  [name: string]: import("vue").Slot | undefined;
13
46
  }>;
@@ -15,6 +48,12 @@ declare const _default: import("vue").DefineComponent<{
15
48
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
49
  readonly label: StringConstructor;
17
50
  readonly sideline: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
51
+ readonly size: {
52
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
53
+ readonly required: false;
54
+ readonly validator: ((val: unknown) => boolean) | undefined;
55
+ __epPropKey: true;
56
+ };
18
57
  }>>, {
19
58
  readonly sideline: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
20
59
  }>;
@@ -1,16 +1,20 @@
1
- import { defineComponent, useSlots, computed, unref, openBlock, createElementBlock, createCommentVNode, renderSlot, createElementVNode, createTextVNode, toDisplayString } from 'vue';
1
+ import { defineComponent, computed, useSlots, unref, openBlock, createElementBlock, createElementVNode, createCommentVNode, renderSlot, normalizeClass, createTextVNode, toDisplayString } from 'vue';
2
2
  import { titleProps } from './title.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { useFormSize } from 'element-plus';
3
5
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
7
+ import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
4
8
 
5
9
  const _hoisted_1 = {
6
10
  key: 0,
7
- class: "hzzt-title flex align-items-center"
11
+ class: "hzzt-title flex align-items-center justify-content-between"
8
12
  };
9
- const _hoisted_2 = {
13
+ const _hoisted_2 = { class: "flex align-items-center" };
14
+ const _hoisted_3 = {
10
15
  key: 0,
11
- class: "decorative-line"
16
+ class: "hzzt-title__line"
12
17
  };
13
- const _hoisted_3 = { class: "label-name" };
14
18
  const __default__ = defineComponent({
15
19
  name: "HzztTitle"
16
20
  });
@@ -19,6 +23,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
23
  props: titleProps,
20
24
  setup(__props) {
21
25
  const props = __props;
26
+ const formSize = useFormSize();
27
+ const ns = useNamespace("title");
28
+ const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
29
+ const nameKls = computed(() => {
30
+ return [ns.e("name"), ns.em("name", trueSize.value)];
31
+ });
22
32
  const slots = useSlots();
23
33
  const showLabel = computed(() => {
24
34
  var _a, _b, _c;
@@ -26,13 +36,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
36
  });
27
37
  return (_ctx, _cache) => {
28
38
  return unref(showLabel) ? (openBlock(), createElementBlock("div", _hoisted_1, [
29
- _ctx.sideline ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("v-if", true),
30
- renderSlot(_ctx.$slots, "before"),
31
- createElementVNode("label", _hoisted_3, [
32
- renderSlot(_ctx.$slots, "default", {}, () => [
33
- createTextVNode(toDisplayString(_ctx.label), 1)
34
- ])
35
- ])
39
+ createElementVNode("div", _hoisted_2, [
40
+ _ctx.sideline ? (openBlock(), createElementBlock("span", _hoisted_3)) : createCommentVNode("v-if", true),
41
+ renderSlot(_ctx.$slots, "before"),
42
+ createElementVNode("label", {
43
+ class: normalizeClass(unref(nameKls))
44
+ }, [
45
+ renderSlot(_ctx.$slots, "default", {}, () => [
46
+ createTextVNode(toDisplayString(_ctx.label), 1)
47
+ ])
48
+ ], 2),
49
+ renderSlot(_ctx.$slots, "after")
50
+ ]),
51
+ renderSlot(_ctx.$slots, "right")
36
52
  ])) : createCommentVNode("v-if", true);
37
53
  };
38
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.vue"],"sourcesContent":["<template>\n <div v-if=\"showLabel\" class=\"hzzt-title flex align-items-center\">\n <span v-if=\"sideline\" class=\"decorative-line\" />\n <slot name=\"before\" />\n <label class=\"label-name\">\n <slot>{{ label }}</slot>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { titleProps } from './title'\n\ndefineOptions({\n name: 'HzztTitle',\n})\n\nconst props = defineProps(titleProps)\n\nconst slots = useSlots()\n\nconst showLabel = computed(\n () => props.label || slots?.default?.()?.[0]?.children\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;mCAcc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,SAAY,GAAA,QAAA,CAAA,MAAA;AAAA,MAChB,MAAM,EAAM,EAAA,EAAA,EAAA,CAAA;AAAkC,MAChD,OAAA,KAAA,CAAA,KAAA,KAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.vue"],"sourcesContent":["<template>\n <div v-if=\"showLabel\" class=\"hzzt-title flex align-items-center justify-content-between\">\n <div class=\"flex align-items-center\">\n <span v-if=\"sideline\" class=\"hzzt-title__line\" />\n <slot name=\"before\" />\n <label :class=\"nameKls\">\n <slot>{{ label }}</slot>\n </label>\n <slot name=\"after\" />\n </div>\n\n <slot name=\"right\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { titleProps } from './title'\nimport {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\nimport { useFormSize } from 'element-plus'\n\ndefineOptions({\n name: 'HzztTitle',\n})\n\nconst props = defineProps(titleProps)\n\nconst formSize = useFormSize()\n\nconst ns = useNamespace('title')\n\nconst trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n)\n\nconst nameKls = computed(() => {\n return [ns.e('name'), ns.em('name', trueSize.value)]\n})\n\nconst slots = useSlots()\n\nconst showLabel = computed(\n () => props.label || slots?.default?.()?.[0]?.children\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;mCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAE7B,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,QAAW,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAA,aAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,aACH,GAAA,QAAiB,CAAA,MAAA;AAAyB,MACxD,OAAA,CAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAEA,KAAM,CAAA,CAAA;AACJ,IAAO,MAAA,KAAI,GAAA,QAAQ,EAAG;AAA6B,IACrD,MAAC,SAAA,GAAA,QAAA,CAAA,MAAA;AAED,MAAA,IAAM,QAAQ,EAAS,CAAA;AAEvB,MAAA,OAAkB,KAAA,CAAA,KAAA,KAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;AAAA,KAAA,CAChB;AAA8C,IAChD,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;"}
package/es/index.mjs CHANGED
@@ -23,9 +23,9 @@ export { HzztCheckButton } from './components/check-button/index.mjs';
23
23
  export { HzztQuarterPicker } from './components/quarter-picker/index.mjs';
24
24
  export { scanEmits, scanProps } from './components/scan/src/scan.mjs';
25
25
  export { HzztScan } from './components/scan/index.mjs';
26
- export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input2.mjs';
26
+ export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input.mjs';
27
27
  export { HzztSelectInput } from './components/select-input/index.mjs';
28
- export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea.mjs';
28
+ export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea2.mjs';
29
29
  export { HzztSelectTextarea } from './components/select-textarea/index.mjs';
30
30
  export { inputRangeEmits, inputRangeProps } from './components/input-range/src/input-range.mjs';
31
31
  export { HzztInputRange } from './components/input-range/index.mjs';
@@ -35,6 +35,7 @@ export { selectEmits, selectProps } from './components/select/src/select.mjs';
35
35
  export { HzztSelect } from './components/select/index.mjs';
36
36
  export { clickInputEmits, clickInputProps } from './components/click-input/src/click-input.mjs';
37
37
  export { HzztClickInput } from './components/click-input/index.mjs';
38
+ export { HzztScroll } from './components/scroll/index.mjs';
38
39
  export { INSTALLED_KEY } from './constants/key.mjs';
39
40
  export { componentSizeMap, componentSizes } from './constants/size.mjs';
40
41
  export { WEEK_DAYS, datePickTypes } from './constants/date.mjs';
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/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.0.7";
1
+ export declare const version = "2.0.0";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "1.0.7";
1
+ const version = "2.0.0";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '1.0.7'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '2.0.0'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}