hzzt-plus 2.0.6 → 2.0.8

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 (104) hide show
  1. package/dist/index.full.js +74 -67
  2. package/dist/index.full.min.js +10 -10
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +10 -10
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +74 -67
  7. package/dist/locale/en.js +1 -1
  8. package/dist/locale/en.min.js +1 -1
  9. package/dist/locale/en.min.mjs +1 -1
  10. package/dist/locale/en.mjs +1 -1
  11. package/dist/locale/zh-cn.js +1 -1
  12. package/dist/locale/zh-cn.min.js +1 -1
  13. package/dist/locale/zh-cn.min.mjs +1 -1
  14. package/dist/locale/zh-cn.mjs +1 -1
  15. package/es/components/collapse/index.d.ts +6 -0
  16. package/es/components/collapse/index.mjs +2 -2
  17. package/es/components/collapse/src/collapse.mjs +0 -88
  18. package/es/components/collapse/src/collapse.mjs.map +1 -1
  19. package/es/components/collapse/src/collapse.vue.d.ts +6 -0
  20. package/es/components/collapse/src/collapse2.mjs +88 -0
  21. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  22. package/es/components/icon/index.d.ts +438 -3
  23. package/es/components/icon/index.mjs +12 -11
  24. package/es/components/icon/index.mjs.map +1 -1
  25. package/es/components/icon/src/index.mjs +13 -5
  26. package/es/components/icon/src/index.mjs.map +1 -1
  27. package/es/components/icon/src/index.vue.d.ts +6 -0
  28. package/es/components/index.mjs +3 -3
  29. package/es/components/lazy-list/index.mjs +2 -2
  30. package/es/components/lazy-list/src/lazy-list.mjs +80 -22
  31. package/es/components/lazy-list/src/lazy-list.mjs.map +1 -1
  32. package/es/components/lazy-list/src/lazy-list2.mjs +22 -80
  33. package/es/components/lazy-list/src/lazy-list2.mjs.map +1 -1
  34. package/es/components/page-size/index.d.ts +6 -0
  35. package/es/components/page-size/src/index.vue.d.ts +6 -0
  36. package/es/components/pagination/index.d.ts +6 -0
  37. package/es/components/pagination/src/index.vue.d.ts +6 -0
  38. package/es/components/quarter-picker/index.d.ts +6 -0
  39. package/es/components/quarter-picker/src/index.vue.d.ts +6 -0
  40. package/es/components/scroll/src/scroll.vue.d.ts +6 -0
  41. package/es/components/select/src/select.vue.d.ts +6 -0
  42. package/es/components/select-input/index.mjs +2 -2
  43. package/es/components/select-input/src/select-input.mjs +45 -124
  44. package/es/components/select-input/src/select-input.mjs.map +1 -1
  45. package/es/components/select-input/src/select-input2.mjs +124 -45
  46. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  47. package/es/components/select-textarea/src/select-textarea2.mjs +1 -1
  48. package/es/components/tab/index.d.ts +6 -0
  49. package/es/components/tab/src/index.vue.d.ts +6 -0
  50. package/es/components/title/index.mjs +2 -2
  51. package/es/components/title/src/title.mjs +11 -54
  52. package/es/components/title/src/title.mjs.map +1 -1
  53. package/es/components/title/src/title2.mjs +54 -11
  54. package/es/components/title/src/title2.mjs.map +1 -1
  55. package/es/index.mjs +3 -3
  56. package/es/version.d.ts +1 -1
  57. package/es/version.mjs +1 -1
  58. package/es/version.mjs.map +1 -1
  59. package/lib/components/collapse/index.d.ts +6 -0
  60. package/lib/components/collapse/index.js +2 -2
  61. package/lib/components/collapse/src/collapse.js +0 -91
  62. package/lib/components/collapse/src/collapse.js.map +1 -1
  63. package/lib/components/collapse/src/collapse.vue.d.ts +6 -0
  64. package/lib/components/collapse/src/collapse2.js +91 -0
  65. package/lib/components/collapse/src/collapse2.js.map +1 -1
  66. package/lib/components/icon/index.d.ts +438 -3
  67. package/lib/components/icon/index.js +14 -13
  68. package/lib/components/icon/index.js.map +1 -1
  69. package/lib/components/icon/src/index.js +12 -4
  70. package/lib/components/icon/src/index.js.map +1 -1
  71. package/lib/components/icon/src/index.vue.d.ts +6 -0
  72. package/lib/components/index.js +3 -3
  73. package/lib/components/lazy-list/index.js +2 -2
  74. package/lib/components/lazy-list/src/lazy-list.js +80 -23
  75. package/lib/components/lazy-list/src/lazy-list.js.map +1 -1
  76. package/lib/components/lazy-list/src/lazy-list2.js +23 -80
  77. package/lib/components/lazy-list/src/lazy-list2.js.map +1 -1
  78. package/lib/components/page-size/index.d.ts +6 -0
  79. package/lib/components/page-size/src/index.vue.d.ts +6 -0
  80. package/lib/components/pagination/index.d.ts +6 -0
  81. package/lib/components/pagination/src/index.vue.d.ts +6 -0
  82. package/lib/components/quarter-picker/index.d.ts +6 -0
  83. package/lib/components/quarter-picker/src/index.vue.d.ts +6 -0
  84. package/lib/components/scroll/src/scroll.vue.d.ts +6 -0
  85. package/lib/components/select/src/select.vue.d.ts +6 -0
  86. package/lib/components/select-input/index.js +2 -2
  87. package/lib/components/select-input/src/select-input.js +46 -124
  88. package/lib/components/select-input/src/select-input.js.map +1 -1
  89. package/lib/components/select-input/src/select-input2.js +124 -46
  90. package/lib/components/select-input/src/select-input2.js.map +1 -1
  91. package/lib/components/select-textarea/src/select-textarea2.js +1 -1
  92. package/lib/components/tab/index.d.ts +6 -0
  93. package/lib/components/tab/src/index.vue.d.ts +6 -0
  94. package/lib/components/title/index.js +2 -2
  95. package/lib/components/title/src/title.js +11 -54
  96. package/lib/components/title/src/title.js.map +1 -1
  97. package/lib/components/title/src/title2.js +54 -11
  98. package/lib/components/title/src/title2.js.map +1 -1
  99. package/lib/index.js +3 -3
  100. package/lib/version.d.ts +1 -1
  101. package/lib/version.js +1 -1
  102. package/lib/version.js.map +1 -1
  103. package/package.json +1 -1
  104. package/web-types.json +1 -1
@@ -2,132 +2,54 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var selectInput = require('./select-input2.js');
5
+ require('../../../utils/index.js');
7
6
  require('../../../hooks/index.js');
8
- var elementPlus = require('element-plus');
9
- var title = require('../../title/src/title.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
- var index = require('../../../hooks/use-namespace/index.js');
12
- var index$1 = require('../../../hooks/use-size/index.js');
13
- var index$2 = require('../../../hooks/use-letter/index.js');
7
+ require('../../../constants/index.js');
8
+ var runtime = require('../../../utils/vue/props/runtime.js');
9
+ var index = require('../../../hooks/use-size/index.js');
10
+ var event = require('../../../constants/event.js');
11
+ var shared = require('@vue/shared');
14
12
 
15
- const _hoisted_1 = { slot: "append" };
16
- const _hoisted_2 = { key: 0 };
17
- const __default__ = vue.defineComponent({
18
- name: "HzztSelectInput"
13
+ const selectInputProps = runtime.buildProps({
14
+ modelValue: {
15
+ type: runtime.definePropType([
16
+ String,
17
+ Number
18
+ ]),
19
+ default: ""
20
+ },
21
+ indexType: {
22
+ type: String,
23
+ default: "number"
24
+ },
25
+ disabled: Boolean,
26
+ replace: Boolean,
27
+ label: String,
28
+ options: {
29
+ type: runtime.definePropType(Array),
30
+ default: () => []
31
+ },
32
+ inputProps: Object,
33
+ customProps: Object,
34
+ position: {
35
+ type: String,
36
+ default: "left"
37
+ },
38
+ formatLabel: {
39
+ type: Function
40
+ },
41
+ split: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ size: index.useSizeProp
19
46
  });
20
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
- ...__default__,
22
- props: selectInput.selectInputProps,
23
- emits: selectInput.selectInputEmits,
24
- setup(__props, { emit }) {
25
- const props = __props;
26
- const inputVal = vue.ref(props.modelValue);
27
- const nsInput = index.useNamespace("select-input");
28
- const formSize = elementPlus.useFormSize();
29
- const formDisabled = elementPlus.useFormDisabled();
30
- const trueSize = vue.computed(() => props.size || formSize.value || index$1.useGlobalSize().value);
31
- const trueDisabled = vue.computed(() => props.disabled || formDisabled.value);
32
- const containerCls = vue.computed(() => [
33
- nsInput.b(),
34
- nsInput.m(trueSize.value)
35
- ]);
36
- const inputContainerCls = vue.computed(() => [
37
- "flex",
38
- props.position === "top" ? "column" : "row align-items-center"
39
- ]);
40
- const inputCls = vue.computed(() => [
41
- "flex-1",
42
- props.label ? props.position === "top" ? "margin-b-1" : "margin-l-1" : ""
43
- ]);
44
- const _inputProps = vue.computed(() => ({
45
- disabled: trueDisabled.value,
46
- clearable: true,
47
- ...props.inputProps
48
- }));
49
- vue.watch(() => props.modelValue, (v) => {
50
- inputVal.value = v;
51
- });
52
- function input(val) {
53
- emit("update:modelValue", val);
54
- emit("input", val);
55
- }
56
- function change(val) {
57
- emit("change", val);
58
- }
59
- function getLinkName(item, index) {
60
- let prefix = "";
61
- if (props.indexType == "number") {
62
- prefix = `\uFF08${index + 1}\uFF09`;
63
- } else if (props.indexType == "letter") {
64
- prefix = `\uFF08${index$2.numberToLetter(index)}\uFF09`;
65
- }
66
- return prefix + (item.label || item.value);
67
- }
68
- function select(item) {
69
- const value = item.value || item.label;
70
- let content = "";
71
- if (!inputVal.value)
72
- inputVal.value = "";
73
- if (props.formatLabel) {
74
- content = props.formatLabel(value);
75
- } else if (props.replace) {
76
- content = value;
77
- } else {
78
- content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;
79
- }
80
- inputVal.value = content;
81
- input(content);
82
- change(content);
83
- }
84
- return (_ctx, _cache) => {
85
- return vue.openBlock(), vue.createElementBlock("div", {
86
- class: vue.normalizeClass(vue.unref(containerCls))
87
- }, [
88
- vue.createElementVNode("div", {
89
- class: vue.normalizeClass(vue.unref(inputContainerCls))
90
- }, [
91
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
92
- vue.createVNode(title["default"], { label: _ctx.label }, null, 8, ["label"])
93
- ]),
94
- vue.createVNode(vue.unref(elementPlus.ElInput), vue.mergeProps({
95
- ref: "inputRef",
96
- class: vue.unref(inputCls),
97
- modelValue: inputVal.value,
98
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
99
- }, vue.unref(_inputProps), {
100
- onInput: input,
101
- onChange: change
102
- }), {
103
- default: vue.withCtx(() => [
104
- vue.createElementVNode("template", _hoisted_1, [
105
- vue.renderSlot(_ctx.$slots, "append")
106
- ])
107
- ]),
108
- _: 3
109
- }, 16, ["class", "modelValue"])
110
- ], 2),
111
- _ctx.options.length && !vue.unref(trueDisabled) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
112
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (item, index) => {
113
- return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElLink), vue.mergeProps({
114
- key: index,
115
- class: "margin-r-4"
116
- }, _ctx.customProps, {
117
- onClick: ($event) => select(item)
118
- }), {
119
- default: vue.withCtx(() => [
120
- vue.createTextVNode(vue.toDisplayString(getLinkName(item, index)), 1)
121
- ]),
122
- _: 2
123
- }, 1040, ["onClick"]);
124
- }), 128))
125
- ])) : vue.createCommentVNode("v-if", true)
126
- ], 2);
127
- };
128
- }
129
- });
130
- var SelectInput = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "select-input.vue"]]);
47
+ const selectInputEmits = {
48
+ [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
49
+ input: (value) => shared.isString(value),
50
+ change: (value) => shared.isString(value)
51
+ };
131
52
 
132
- exports["default"] = SelectInput;
53
+ exports.selectInputEmits = selectInputEmits;
54
+ exports.selectInputProps = selectInputProps;
133
55
  //# sourceMappingURL=select-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input.js","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=\"options.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in options\" :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":["ref","useNamespace","useFormSize","useFormDisabled","computed","useGlobalSize","watch","numberToLetter","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;;;;;uCAmCgB,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,QAAA,GAAWA,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAErC,IAAM,MAAA,OAAA,GAAUC,mBAAa,cAAc,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAWC,uBAAY,EAAA,CAAA;AAC7B,IAAA,MAAM,eAAeC,2BAAgB,EAAA,CAAA;AAErC,IAAA,MAAM,QAAW,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAAC,qBAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,kBACH,GAAAD,YAAiB,CAAA,MAAA,kBAAuB,YAAE,CAAA,KAAA,CAAA,CAAA;AAAA,IACxD,MAAA,YAAA,GAAAA,YAAA,CAAA,MAAA;AAEA,MAAA;AAEA,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,KAAA,CAClC;AAAU,IACV,MAAA,iBAAwB,GAAAA,YAAA,CAAA,MAAA;AAAA,MACzB,MAAA;AAED,MAAM,KAAA,CAAA,QAAA,KAAA,KAAoB,WAAe,GAAA,wBAAA;AAAA,KACvC,CAAA,CAAA;AAAA,IACA,MAAA,QAAmB,GAAAA,YAAA,CAAA,MAAmB;AAAA,MACvC,QAAA;AAED,MAAM,KAAA,CAAA,KAAA,GAAA,cAA0B,KAAA,KAAA,GAAA,YAAA,GAAA,YAAA,GAAA,EAAA;AAAA,KAC9B,CAAA,CAAA;AAAA,IAAA,iBACc,GAAAA,YAAmB,CAAA,OAAA;AAAsC,MACxE,QAAA,EAAA,YAAA,CAAA,KAAA;AAED,MAAM,SAAA,EAAA,IAAA;AAA8B,MAClC,mBAAuB;AAAA,KAAA,CACvB,CAAW,CAAA;AAAA,IAAAE,SACR,CAAM,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACT,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,oBAAkB,CAAA,IAAA,EAAA,KAAA,EAAA;AAAA,MACpB,IAAA,MAAA,GAAA,EAAA,CAAA;AAEA,MAAS,IAAA,KAAA,CAAA,SAAY,YAAiC,EAAA;AACpD,QAAA,MAAa,GAAA,CAAA,MAAA,EAAA,KAAA,GAAA,CAAA,CAAA,MAAA,CAAA,CAAA;AACb,OAAI,MAAA,mBAA6B,IAAA,QAAA,EAAA;AAC/B,QAAS,MAAA,GAAA,CAAA,MAAA,EAAIC,sBAAS,CAAA,KAAA,CAAA,CAAA,MAAA,CAAA,CAAA;AAAA,OACxB;AACE,MAAS,OAAA,MAAA,IAAA,IAAmB,CAAA,KAAA,IAAA,IAAA,CAAA,KAAM,CAAA,CAAA;AAAA,KACpC;AACA,IAAO,SAAA,MAAA,CAAA,IAAe,EAAA;AAAc,MACtC,MAAA,KAAA,GAAA,IAAA,CAAA,KAAA,IAAA,IAAA,CAAA,KAAA,CAAA;AAEA,MAAA,IAAA,UAAgB,EAAkB,CAAA;AAChC,MAAM,IAAA,CAAA,QAAA,CAAQ,KAAK;AACnB,QAAA,QAAc,CAAA,KAAA,GAAA,EAAA,CAAA;AACd,MAAA,IAAI,KAAU,CAAA,WAAA,EAAA;AAAO,QAAA,OAAA,GAAiB,KAAA,CAAA,WAAA,CAAA,KAAA,CAAA,CAAA;AACtC,OAAA,UAAuB,KAAA,CAAA,OAAA,EAAA;AACrB,QAAU,OAAA,GAAA,KAAA,CAAM;AAAiB,OACnC,MAAA;AACE,QAAU,OAAA,GAAA,QAAA,CAAA,KAAA,GAAA,CAAA,EAAA,QAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,CAAA,GAAA,KAAA,CAAA;AAAA,OACL;AACL,MAAU,QAAA,CAAA,KAAA,GAAA,OAAiB,CAAA;AAA4C,MACzE,KAAA,CAAA,OAAA,CAAA,CAAA;AACA,MAAA,MAAA,CAAA,OAAiB,CAAA,CAAA;AACjB,KAAA;AACA,IAAA,OAAA,CAAA,IAAc,EAAA,MAAA,KAAA;AAAA,MAChB,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"select-input.js","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":["buildProps","definePropType","useSizeProp","UPDATE_MODEL_EVENT","isString"],"mappings":";;;;;;;;;;;;AAGY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,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,EAAEA,sBAAc,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,EAAEC,iBAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAACC,wBAAkB,GAAG,CAAC,KAAK,KAAKC,eAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AACpC;;;;;"}
@@ -2,54 +2,132 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
5
+ var vue = require('vue');
6
+ var selectInput = require('./select-input.js');
6
7
  require('../../../hooks/index.js');
7
- require('../../../constants/index.js');
8
- var runtime = require('../../../utils/vue/props/runtime.js');
9
- var index = require('../../../hooks/use-size/index.js');
10
- var event = require('../../../constants/event.js');
11
- var shared = require('@vue/shared');
8
+ var elementPlus = require('element-plus');
9
+ var title = require('../../title/src/title2.js');
10
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
+ var index = require('../../../hooks/use-namespace/index.js');
12
+ var index$1 = require('../../../hooks/use-size/index.js');
13
+ var index$2 = require('../../../hooks/use-letter/index.js');
12
14
 
13
- const selectInputProps = runtime.buildProps({
14
- modelValue: {
15
- type: runtime.definePropType([
16
- String,
17
- Number
18
- ]),
19
- default: ""
20
- },
21
- indexType: {
22
- type: String,
23
- default: "number"
24
- },
25
- disabled: Boolean,
26
- replace: Boolean,
27
- label: String,
28
- options: {
29
- type: runtime.definePropType(Array),
30
- default: () => []
31
- },
32
- inputProps: Object,
33
- customProps: Object,
34
- position: {
35
- type: String,
36
- default: "left"
37
- },
38
- formatLabel: {
39
- type: Function
40
- },
41
- split: {
42
- type: String,
43
- default: ""
44
- },
45
- size: index.useSizeProp
15
+ const _hoisted_1 = { slot: "append" };
16
+ const _hoisted_2 = { key: 0 };
17
+ const __default__ = vue.defineComponent({
18
+ name: "HzztSelectInput"
46
19
  });
47
- const selectInputEmits = {
48
- [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
49
- input: (value) => shared.isString(value),
50
- change: (value) => shared.isString(value)
51
- };
20
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
+ ...__default__,
22
+ props: selectInput.selectInputProps,
23
+ emits: selectInput.selectInputEmits,
24
+ setup(__props, { emit }) {
25
+ const props = __props;
26
+ const inputVal = vue.ref(props.modelValue);
27
+ const nsInput = index.useNamespace("select-input");
28
+ const formSize = elementPlus.useFormSize();
29
+ const formDisabled = elementPlus.useFormDisabled();
30
+ const trueSize = vue.computed(() => props.size || formSize.value || index$1.useGlobalSize().value);
31
+ const trueDisabled = vue.computed(() => props.disabled || formDisabled.value);
32
+ const containerCls = vue.computed(() => [
33
+ nsInput.b(),
34
+ nsInput.m(trueSize.value)
35
+ ]);
36
+ const inputContainerCls = vue.computed(() => [
37
+ "flex",
38
+ props.position === "top" ? "column" : "row align-items-center"
39
+ ]);
40
+ const inputCls = vue.computed(() => [
41
+ "flex-1",
42
+ props.label ? props.position === "top" ? "margin-b-1" : "margin-l-1" : ""
43
+ ]);
44
+ const _inputProps = vue.computed(() => ({
45
+ disabled: trueDisabled.value,
46
+ clearable: true,
47
+ ...props.inputProps
48
+ }));
49
+ vue.watch(() => props.modelValue, (v) => {
50
+ inputVal.value = v;
51
+ });
52
+ function input(val) {
53
+ emit("update:modelValue", val);
54
+ emit("input", val);
55
+ }
56
+ function change(val) {
57
+ emit("change", val);
58
+ }
59
+ function getLinkName(item, index) {
60
+ let prefix = "";
61
+ if (props.indexType == "number") {
62
+ prefix = `\uFF08${index + 1}\uFF09`;
63
+ } else if (props.indexType == "letter") {
64
+ prefix = `\uFF08${index$2.numberToLetter(index)}\uFF09`;
65
+ }
66
+ return prefix + (item.label || item.value);
67
+ }
68
+ function select(item) {
69
+ const value = item.value || item.label;
70
+ let content = "";
71
+ if (!inputVal.value)
72
+ inputVal.value = "";
73
+ if (props.formatLabel) {
74
+ content = props.formatLabel(value);
75
+ } else if (props.replace) {
76
+ content = value;
77
+ } else {
78
+ content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;
79
+ }
80
+ inputVal.value = content;
81
+ input(content);
82
+ change(content);
83
+ }
84
+ return (_ctx, _cache) => {
85
+ return vue.openBlock(), vue.createElementBlock("div", {
86
+ class: vue.normalizeClass(vue.unref(containerCls))
87
+ }, [
88
+ vue.createElementVNode("div", {
89
+ class: vue.normalizeClass(vue.unref(inputContainerCls))
90
+ }, [
91
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
92
+ vue.createVNode(title["default"], { label: _ctx.label }, null, 8, ["label"])
93
+ ]),
94
+ vue.createVNode(vue.unref(elementPlus.ElInput), vue.mergeProps({
95
+ ref: "inputRef",
96
+ class: vue.unref(inputCls),
97
+ modelValue: inputVal.value,
98
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
99
+ }, vue.unref(_inputProps), {
100
+ onInput: input,
101
+ onChange: change
102
+ }), {
103
+ default: vue.withCtx(() => [
104
+ vue.createElementVNode("template", _hoisted_1, [
105
+ vue.renderSlot(_ctx.$slots, "append")
106
+ ])
107
+ ]),
108
+ _: 3
109
+ }, 16, ["class", "modelValue"])
110
+ ], 2),
111
+ _ctx.options.length && !vue.unref(trueDisabled) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
112
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (item, index) => {
113
+ return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElLink), vue.mergeProps({
114
+ key: index,
115
+ class: "margin-r-4"
116
+ }, _ctx.customProps, {
117
+ onClick: ($event) => select(item)
118
+ }), {
119
+ default: vue.withCtx(() => [
120
+ vue.createTextVNode(vue.toDisplayString(getLinkName(item, index)), 1)
121
+ ]),
122
+ _: 2
123
+ }, 1040, ["onClick"]);
124
+ }), 128))
125
+ ])) : vue.createCommentVNode("v-if", true)
126
+ ], 2);
127
+ };
128
+ }
129
+ });
130
+ var SelectInput = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "select-input.vue"]]);
52
131
 
53
- exports.selectInputEmits = selectInputEmits;
54
- exports.selectInputProps = selectInputProps;
132
+ exports["default"] = SelectInput;
55
133
  //# sourceMappingURL=select-input2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input2.js","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":["buildProps","definePropType","useSizeProp","UPDATE_MODEL_EVENT","isString"],"mappings":";;;;;;;;;;;;AAGY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,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,EAAEA,sBAAc,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,EAAEC,iBAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAACC,wBAAkB,GAAG,CAAC,KAAK,KAAKC,eAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AACpC;;;;;"}
1
+ {"version":3,"file":"select-input2.js","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=\"options.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in options\" :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":["ref","useNamespace","useFormSize","useFormDisabled","computed","useGlobalSize","watch","numberToLetter","_openBlock","_createElementBlock"],"mappings":"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"}
@@ -6,7 +6,7 @@ var vue = require('vue');
6
6
  var selectTextarea = require('./select-textarea.js');
7
7
  require('../../../hooks/index.js');
8
8
  var elementPlus = require('element-plus');
9
- var title = require('../../title/src/title.js');
9
+ var title = require('../../title/src/title2.js');
10
10
  var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
11
  var index = require('../../../hooks/use-namespace/index.js');
12
12
  var index$1 = require('../../../hooks/use-size/index.js');
@@ -54,6 +54,8 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
54
54
  type: StringConstructor;
55
55
  default: string;
56
56
  };
57
+ size: (NumberConstructor | StringConstructor)[];
58
+ color: StringConstructor;
57
59
  }, {
58
60
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
59
61
  name: {
@@ -64,6 +66,8 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
64
66
  type: StringConstructor;
65
67
  default: string;
66
68
  };
69
+ size: (NumberConstructor | StringConstructor)[];
70
+ color: StringConstructor;
67
71
  }>> & {
68
72
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
69
73
  }>>;
@@ -179,6 +183,8 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
179
183
  type: StringConstructor;
180
184
  default: string;
181
185
  };
186
+ size: (NumberConstructor | StringConstructor)[];
187
+ color: StringConstructor;
182
188
  }>>, {
183
189
  type: string;
184
190
  }>;
@@ -55,6 +55,8 @@ declare const _default: import("vue").DefineComponent<{
55
55
  type: StringConstructor;
56
56
  default: string;
57
57
  };
58
+ size: (NumberConstructor | StringConstructor)[];
59
+ color: StringConstructor;
58
60
  }, {
59
61
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
60
62
  name: {
@@ -65,6 +67,8 @@ declare const _default: import("vue").DefineComponent<{
65
67
  type: StringConstructor;
66
68
  default: string;
67
69
  };
70
+ size: (NumberConstructor | StringConstructor)[];
71
+ color: StringConstructor;
68
72
  }>> & {
69
73
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
70
74
  }>>;
@@ -180,6 +184,8 @@ declare const _default: import("vue").DefineComponent<{
180
184
  type: StringConstructor;
181
185
  default: string;
182
186
  };
187
+ size: (NumberConstructor | StringConstructor)[];
188
+ color: StringConstructor;
183
189
  }>>, {
184
190
  type: string;
185
191
  }>;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var title$1 = require('./src/title.js');
7
- var title = require('./src/title2.js');
6
+ var title$1 = require('./src/title2.js');
7
+ var title = require('./src/title.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const HzztTitle = install.withInstall(title$1["default"]);
@@ -2,62 +2,19 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var title = require('./title2.js');
5
+ require('../../../utils/index.js');
7
6
  require('../../../hooks/index.js');
8
- var elementPlus = require('element-plus');
9
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
- var index = require('../../../hooks/use-namespace/index.js');
11
- var index$1 = require('../../../hooks/use-size/index.js');
7
+ var runtime = require('../../../utils/vue/props/runtime.js');
8
+ var index = require('../../../hooks/use-size/index.js');
12
9
 
13
- const _hoisted_1 = {
14
- key: 0,
15
- class: "hzzt-title flex align-items-center justify-content-between"
16
- };
17
- const _hoisted_2 = { class: "flex align-items-center" };
18
- const _hoisted_3 = {
19
- key: 0,
20
- class: "hzzt-title__line"
21
- };
22
- const __default__ = vue.defineComponent({
23
- name: "HzztTitle"
10
+ const titleProps = runtime.buildProps({
11
+ label: String,
12
+ sideline: {
13
+ type: Boolean,
14
+ default: true
15
+ },
16
+ size: index.useSizeProp
24
17
  });
25
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
- ...__default__,
27
- props: title.titleProps,
28
- setup(__props) {
29
- const props = __props;
30
- const formSize = elementPlus.useFormSize();
31
- const ns = index.useNamespace("title");
32
- const trueSize = vue.computed(() => props.size || formSize.value || index$1.useGlobalSize().value);
33
- const nameKls = vue.computed(() => {
34
- return [ns.e("name"), ns.em("name", trueSize.value)];
35
- });
36
- const slots = vue.useSlots();
37
- const showLabel = vue.computed(() => {
38
- var _a, _b, _c;
39
- return props.label || ((_c = (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) == null ? void 0 : _b[0]) == null ? void 0 : _c.children);
40
- });
41
- return (_ctx, _cache) => {
42
- return vue.unref(showLabel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
43
- vue.createElementVNode("div", _hoisted_2, [
44
- _ctx.sideline ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3)) : vue.createCommentVNode("v-if", true),
45
- vue.renderSlot(_ctx.$slots, "before"),
46
- vue.createElementVNode("label", {
47
- class: vue.normalizeClass(vue.unref(nameKls))
48
- }, [
49
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
50
- vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
51
- ])
52
- ], 2),
53
- vue.renderSlot(_ctx.$slots, "after")
54
- ]),
55
- vue.renderSlot(_ctx.$slots, "right")
56
- ])) : vue.createCommentVNode("v-if", true);
57
- };
58
- }
59
- });
60
- var HzztTitle = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "title.vue"]]);
61
18
 
62
- exports["default"] = HzztTitle;
19
+ exports.titleProps = titleProps;
63
20
  //# sourceMappingURL=title.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"title.js","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":["useFormSize","useNamespace","computed","useGlobalSize","useSlots"],"mappings":";;;;;;;;;;;;;;;;;;;;;uCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,WAAWA,uBAAY,EAAA,CAAA;AAE7B,IAAM,MAAA,EAAA,GAAKC,mBAAa,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,QAAW,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAAC,qBAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,aACH,GAAAD,YAAiB,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,GAAAE,YAAQ,EAAG;AAA6B,IACrD,MAAC,SAAA,GAAAF,YAAA,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;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"title.js","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":["buildProps","useSizeProp"],"mappings":";;;;;;;;;AAEY,MAAC,UAAU,GAAGA,kBAAU,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,EAAEC,iBAAW;AACnB,CAAC;;;;"}