hzzt-plus 1.0.6 → 1.0.7

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 (40) hide show
  1. package/dist/index.full.js +3 -3
  2. package/dist/index.full.min.js +3 -3
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +3 -3
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +3 -3
  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/click-input/src/click-input2.mjs +1 -1
  16. package/es/components/click-input/src/click-input2.mjs.map +1 -1
  17. package/es/components/index.mjs +1 -1
  18. package/es/components/select-input/index.mjs +2 -2
  19. package/es/components/select-input/src/select-input.mjs +124 -45
  20. package/es/components/select-input/src/select-input.mjs.map +1 -1
  21. package/es/components/select-input/src/select-input2.mjs +45 -124
  22. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  23. package/es/index.mjs +1 -1
  24. package/es/version.d.ts +1 -1
  25. package/es/version.mjs +1 -1
  26. package/es/version.mjs.map +1 -1
  27. package/lib/components/click-input/src/click-input2.js +1 -1
  28. package/lib/components/click-input/src/click-input2.js.map +1 -1
  29. package/lib/components/index.js +1 -1
  30. package/lib/components/select-input/index.js +2 -2
  31. package/lib/components/select-input/src/select-input.js +124 -46
  32. package/lib/components/select-input/src/select-input.js.map +1 -1
  33. package/lib/components/select-input/src/select-input2.js +46 -124
  34. package/lib/components/select-input/src/select-input2.js.map +1 -1
  35. package/lib/index.js +1 -1
  36. package/lib/version.d.ts +1 -1
  37. package/lib/version.js +1 -1
  38. package/lib/version.js.map +1 -1
  39. package/package.json +1 -1
  40. package/web-types.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Hzzt Plus v1.0.6 */
1
+ /*! Hzzt Plus v1.0.7 */
2
2
 
3
3
  import { unref, readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, ref, computed, watch, defineComponent, openBlock, createElementBlock, createElementVNode, warn, isRef, inject, provide, renderSlot, useSlots, createCommentVNode, createTextVNode, toDisplayString, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, normalizeStyle, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, toRaw, vModelCheckbox, toRefs, vModelRadio, h, resolveComponent, renderList, onBeforeUpdate, withKeys, vModelText, createSlots, resolveDirective, toHandlerKey, normalizeProps, guardReactiveProps } from 'vue';
4
4
 
@@ -12961,7 +12961,7 @@ var ConfigProvider$1 = ConfigProvider;
12961
12961
 
12962
12962
  const HzztConfigProvider = withInstall$1(ConfigProvider$1);
12963
12963
 
12964
- const version$1 = "1.0.6";
12964
+ const version$1 = "1.0.7";
12965
12965
 
12966
12966
  const makeInstaller = (components = []) => {
12967
12967
  const install = (app, options) => {
@@ -27911,7 +27911,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27911
27911
  "flex width-100% align-items-center"
27912
27912
  ]);
27913
27913
  const spanClass = computed(() => [
27914
- nsInput.em("span"),
27914
+ nsInput.e("span"),
27915
27915
  "flex width-100% align-items-center"
27916
27916
  ]);
27917
27917
  watch(() => props.modelValue, (v) => {
package/dist/locale/en.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Hzzt Plus v1.0.6 */
1
+ /*! Hzzt Plus v1.0.7 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,2 +1,2 @@
1
- /*! Hzzt Plus v1.0.6 */(function(e,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis!="undefined"?globalThis:e||self,e.HzztPlusLocaleEn=r())})(this,function(){"use strict";var e={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};return e});
1
+ /*! Hzzt Plus v1.0.7 */(function(e,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis!="undefined"?globalThis:e||self,e.HzztPlusLocaleEn=r())})(this,function(){"use strict";var e={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};return e});
2
2
  //# sourceMappingURL=en.min.js.map
@@ -1,2 +1,2 @@
1
- /*! Hzzt Plus v1.0.6 */var r={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};export{r as default};
1
+ /*! Hzzt Plus v1.0.7 */var r={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};export{r as default};
2
2
  //# sourceMappingURL=en.min.mjs.map
@@ -1,4 +1,4 @@
1
- /*! Hzzt Plus v1.0.6 */
1
+ /*! Hzzt Plus v1.0.7 */
2
2
 
3
3
  var en = {
4
4
  name: "en",
@@ -1,4 +1,4 @@
1
- /*! Hzzt Plus v1.0.6 */
1
+ /*! Hzzt Plus v1.0.7 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,2 +1,2 @@
1
- /*! Hzzt Plus v1.0.6 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.HzztPlusLocaleZhCn=e())})(this,function(){"use strict";var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};return u});
1
+ /*! Hzzt Plus v1.0.7 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.HzztPlusLocaleZhCn=e())})(this,function(){"use strict";var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};return u});
2
2
  //# sourceMappingURL=zh-cn.min.js.map
@@ -1,2 +1,2 @@
1
- /*! Hzzt Plus v1.0.6 */var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};export{u as default};
1
+ /*! Hzzt Plus v1.0.7 */var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};export{u as default};
2
2
  //# sourceMappingURL=zh-cn.min.mjs.map
@@ -1,4 +1,4 @@
1
- /*! Hzzt Plus v1.0.6 */
1
+ /*! Hzzt Plus v1.0.7 */
2
2
 
3
3
  var zhCn = {
4
4
  name: "zh-cn",
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  "flex width-100% align-items-center"
32
32
  ]);
33
33
  const spanClass = computed(() => [
34
- nsInput.em("span"),
34
+ nsInput.e("span"),
35
35
  "flex width-100% align-items-center"
36
36
  ]);
37
37
  watch(() => props.modelValue, (v) => {
@@ -1 +1 @@
1
- {"version":3,"file":"click-input2.mjs","sources":["../../../../../../packages/components/click-input/src/click-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <el-input\n v-if=\"!trueReadonly\"\n ref=\"inputRef\"\n v-model=\"inputVal\"\n v-bind=\"inputProps\"\n clearable\n :size=\"trueSize\"\n @keyup.enter=\"change\"\n @blur=\"change\"\n />\n <div v-else class=\"width-100%\" :class=\"spanClass\" @click=\"edit\">\n {{ inputVal || ' ' }}\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch, nextTick} from 'vue'\n import {clickInputEmits, clickInputProps} from './click-input'\n import {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import {ElInput} from 'element-plus'\n\n defineOptions({\n name: 'HzztClickInput',\n })\n\n const props = defineProps(clickInputProps)\n const emit = defineEmits(clickInputEmits)\n\n const _inputVal = ref(props.modelValue || '');\n const inputVal = ref(props.modelValue || '');\n const inputRef = ref();\n const editable = ref(false);\n\n const nsInput = useNamespace('click-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 trueReadonly = computed(() => trueDisabled.value || props.readonly || !editable.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n 'flex width-100% align-items-center',\n ])\n\n const spanClass = computed(() => [\n nsInput.em('span'),\n 'flex width-100% align-items-center',\n ])\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = 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() {\n editable.value = false;\n if (_inputVal.value === inputVal.value) {\n return;\n }\n input(inputVal.value);\n emit('change', inputVal.value);\n }\n\n function edit() {\n if (trueDisabled.value || props.readonly) {\n return;\n }\n editable.value = true;\n nextTick(() => {\n inputRef.value.focus();\n });\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;mCAyBgB,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,SAAY,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC5C,IAAA,MAAM,QAAW,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AACrB,IAAM,MAAA,QAAA,GAAW,IAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,OAAA,GAAU,aAAa,aAAa,CAAA,CAAA;AAC1C,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,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAM,eAAe,QAAS,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AAA,OACtB,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACH,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"click-input2.mjs","sources":["../../../../../../packages/components/click-input/src/click-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <el-input\n v-if=\"!trueReadonly\"\n ref=\"inputRef\"\n v-model=\"inputVal\"\n v-bind=\"inputProps\"\n clearable\n :size=\"trueSize\"\n @keyup.enter=\"change\"\n @blur=\"change\"\n />\n <div v-else class=\"width-100%\" :class=\"spanClass\" @click=\"edit\">\n {{ inputVal || ' ' }}\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch, nextTick} from 'vue'\n import {clickInputEmits, clickInputProps} from './click-input'\n import {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import {ElInput} from 'element-plus'\n\n defineOptions({\n name: 'HzztClickInput',\n })\n\n const props = defineProps(clickInputProps)\n const emit = defineEmits(clickInputEmits)\n\n const _inputVal = ref(props.modelValue || '');\n const inputVal = ref(props.modelValue || '');\n const inputRef = ref();\n const editable = ref(false);\n\n const nsInput = useNamespace('click-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 trueReadonly = computed(() => trueDisabled.value || props.readonly || !editable.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n 'flex width-100% align-items-center',\n ])\n\n const spanClass = computed(() => [\n nsInput.e('span'),\n 'flex width-100% align-items-center',\n ])\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = 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() {\n editable.value = false;\n if (_inputVal.value === inputVal.value) {\n return;\n }\n input(inputVal.value);\n emit('change', inputVal.value);\n }\n\n function edit() {\n if (trueDisabled.value || props.readonly) {\n return;\n }\n editable.value = true;\n nextTick(() => {\n inputRef.value.focus();\n });\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;mCAyBgB,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,SAAY,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC5C,IAAA,MAAM,QAAW,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AACrB,IAAM,MAAA,QAAA,GAAW,IAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,OAAA,GAAU,aAAa,aAAa,CAAA,CAAA;AAC1C,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,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAM,eAAe,QAAS,CAAA,MAAM;AAEpC,MAAM,OAAA,CAAA,CAAA,EAAA;AAEN,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,MAClC,oCAAU;AAAA,KACV,CAAA,CAAA;AAAwB,IACxB,MAAA,SA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ProviderProps } from './config-provider/src/config-provider-props
22
22
  export { configProviderContextKey } from './config-provider/src/constants.mjs';
23
23
  export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
24
24
  export { scanEmits, scanProps } from './scan/src/scan.mjs';
25
- export { selectInputEmits, selectInputProps } from './select-input/src/select-input.mjs';
25
+ export { selectInputEmits, selectInputProps } from './select-input/src/select-input2.mjs';
26
26
  export { selectTextareaEmits, selectTextareaProps } from './select-textarea/src/select-textarea.mjs';
27
27
  export { inputRangeEmits, inputRangeProps } from './input-range/src/input-range.mjs';
28
28
  export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import SelectInput from './src/select-input2.mjs';
3
- export { selectInputEmits, selectInputProps } from './src/select-input.mjs';
2
+ import SelectInput from './src/select-input.mjs';
3
+ export { selectInputEmits, selectInputProps } from './src/select-input2.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const HzztSelectInput = withInstall(SelectInput);
@@ -1,50 +1,129 @@
1
- import '../../../utils/index.mjs';
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
2
+ import { selectInputProps, selectInputEmits } from './select-input2.mjs';
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 } from '../../../constants/event.mjs';
7
- import { isString } from '@vue/shared';
4
+ import { useFormSize, useFormDisabled, ElInput, ElLink } from 'element-plus';
5
+ import HzztTitle from '../../title/src/title2.mjs';
6
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
7
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
8
+ import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
9
+ import { numberToLetter } from '../../../hooks/use-letter/index.mjs';
8
10
 
9
- const selectInputProps = buildProps({
10
- modelValue: {
11
- type: definePropType([
12
- String,
13
- Number
14
- ]),
15
- default: ""
16
- },
17
- indexType: {
18
- type: String,
19
- default: "number"
20
- },
21
- disabled: Boolean,
22
- replace: Boolean,
23
- label: String,
24
- data: {
25
- type: definePropType(Array),
26
- default: () => []
27
- },
28
- inputProps: Object,
29
- customProps: Object,
30
- position: {
31
- type: String,
32
- default: "left"
33
- },
34
- formatLabel: {
35
- type: Function
36
- },
37
- split: {
38
- type: String,
39
- default: ""
40
- },
41
- size: useSizeProp
11
+ const _hoisted_1 = { slot: "append" };
12
+ const _hoisted_2 = { key: 0 };
13
+ const __default__ = defineComponent({
14
+ name: "HzztSelectInput"
42
15
  });
43
- const selectInputEmits = {
44
- [UPDATE_MODEL_EVENT]: (value) => isString(value),
45
- input: (value) => isString(value),
46
- change: (value) => isString(value)
47
- };
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ ...__default__,
18
+ props: selectInputProps,
19
+ emits: selectInputEmits,
20
+ setup(__props, { emit }) {
21
+ const props = __props;
22
+ const inputVal = ref(props.modelValue);
23
+ const nsInput = useNamespace("select-input");
24
+ const formSize = useFormSize();
25
+ const formDisabled = useFormDisabled();
26
+ const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
27
+ const trueDisabled = computed(() => props.disabled || formDisabled.value);
28
+ const containerCls = computed(() => [
29
+ nsInput.b(),
30
+ nsInput.m(trueSize.value)
31
+ ]);
32
+ const inputContainerCls = computed(() => [
33
+ "flex",
34
+ props.position === "top" ? "column" : "row align-items-center"
35
+ ]);
36
+ const inputCls = computed(() => [
37
+ "flex-1",
38
+ props.label ? props.position === "top" ? "margin-b-1" : "margin-l-1" : ""
39
+ ]);
40
+ const _inputProps = computed(() => ({
41
+ disabled: trueDisabled.value,
42
+ clearable: true,
43
+ ...props.inputProps
44
+ }));
45
+ watch(() => props.modelValue, (v) => {
46
+ inputVal.value = v;
47
+ });
48
+ function input(val) {
49
+ emit("update:modelValue", val);
50
+ emit("input", val);
51
+ }
52
+ function change(val) {
53
+ emit("change", val);
54
+ }
55
+ function getLinkName(item, index) {
56
+ let prefix = "";
57
+ if (props.indexType == "number") {
58
+ prefix = `\uFF08${index + 1}\uFF09`;
59
+ } else if (props.indexType == "letter") {
60
+ prefix = `\uFF08${numberToLetter(index)}\uFF09`;
61
+ }
62
+ return prefix + (item.label || item.value);
63
+ }
64
+ function select(item) {
65
+ const value = item.value || item.label;
66
+ let content = "";
67
+ if (!inputVal.value)
68
+ inputVal.value = "";
69
+ if (props.formatLabel) {
70
+ content = props.formatLabel(value);
71
+ } else if (props.replace) {
72
+ content = value;
73
+ } else {
74
+ content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;
75
+ }
76
+ inputVal.value = content;
77
+ input(content);
78
+ change(content);
79
+ }
80
+ return (_ctx, _cache) => {
81
+ return openBlock(), createElementBlock("div", {
82
+ class: normalizeClass(unref(containerCls))
83
+ }, [
84
+ createElementVNode("div", {
85
+ class: normalizeClass(unref(inputContainerCls))
86
+ }, [
87
+ renderSlot(_ctx.$slots, "title", {}, () => [
88
+ createVNode(HzztTitle, { label: _ctx.label }, null, 8, ["label"])
89
+ ]),
90
+ createVNode(unref(ElInput), mergeProps({
91
+ ref: "inputRef",
92
+ class: unref(inputCls),
93
+ modelValue: inputVal.value,
94
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
95
+ }, unref(_inputProps), {
96
+ onInput: input,
97
+ onChange: change
98
+ }), {
99
+ default: withCtx(() => [
100
+ createElementVNode("template", _hoisted_1, [
101
+ renderSlot(_ctx.$slots, "append")
102
+ ])
103
+ ]),
104
+ _: 3
105
+ }, 16, ["class", "modelValue"])
106
+ ], 2),
107
+ _ctx.data.length && !unref(trueDisabled) ? (openBlock(), createElementBlock("div", _hoisted_2, [
108
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item, index) => {
109
+ return openBlock(), createBlock(unref(ElLink), mergeProps({
110
+ key: index,
111
+ class: "margin-r-4"
112
+ }, _ctx.customProps, {
113
+ onClick: ($event) => select(item)
114
+ }), {
115
+ default: withCtx(() => [
116
+ createTextVNode(toDisplayString(getLinkName(item, index)), 1)
117
+ ]),
118
+ _: 2
119
+ }, 1040, ["onClick"]);
120
+ }), 128))
121
+ ])) : createCommentVNode("v-if", true)
122
+ ], 2);
123
+ };
124
+ }
125
+ });
126
+ var SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-input.vue"]]);
48
127
 
49
- export { selectInputEmits, selectInputProps };
128
+ export { SelectInput as default };
50
129
  //# sourceMappingURL=select-input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectInput from './select-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\nimport {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\nexport const selectInputProps = buildProps({\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n indexType: {\n type: String,\n default: 'number',\n },\n disabled: Boolean,\n replace: Boolean,\n label: String,\n data: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n customProps: Object,\n position: {\n type: String,\n default: 'left',\n },\n formatLabel: {\n type: Function,\n },\n split: {\n type: String,\n default: '',\n },\n size: useSizeProp,\n})\n\nexport type SelectInputProps = ExtractPropTypes<typeof selectInputProps>\n\nexport const selectInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string | undefined) => isString(value),\n input: (value: string | undefined) => isString(value),\n change: (value: string | undefined) => isString(value),\n}\nexport type SelectInputEmits = typeof selectInputEmits\n\nexport type SelectInputInstance = InstanceType<typeof SelectInput>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,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,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACpC;;;;"}
1
+ {"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div :class=\"inputContainerCls\">\n <slot name=\"title\">\n <hzzt-title :label=\"label\"></hzzt-title>\n </slot>\n <el-input ref=\"inputRef\"\n :class=\"inputCls\"\n v-model=\"inputVal\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"\n >\n <template slot=\"append\">\n <slot name=\"append\"></slot>\n </template>\n </el-input>\n </div>\n <div v-if=\"data.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in data\" :key=\"index\" class=\"margin-r-4\" v-bind=\"customProps\" @click=\"select(item)\">\n {{ getLinkName(item, index) }}\n </el-link>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch} from 'vue'\n import {selectInputEmits, selectInputProps} from './select-input'\n import {useGlobalSize, useNamespace, numberToLetter} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElLink} from 'element-plus'\n import {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\n defineOptions({\n name: 'HzztSelectInput',\n })\n\n const props = defineProps(selectInputProps)\n const emit = defineEmits(selectInputEmits)\n\n const inputVal = ref(props.modelValue);\n\n const nsInput = useNamespace('select-input')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const inputContainerCls = computed(() => [\n 'flex',\n props.position === 'top' ? 'column' : 'row align-items-center'\n ])\n\n const inputCls = computed(() => [\n 'flex-1',\n props.label ? props.position === 'top' ? 'margin-b-1' : 'margin-l-1' : ''\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function getLinkName(item: OptionType, index: number) {\n let prefix = '';\n if (props.indexType == 'number') {\n prefix = `(${index + 1})`\n } else if (props.indexType == 'letter') {\n prefix = `(${numberToLetter(index)})`\n }\n return prefix + (item.label || item.value);\n }\n\n function select(item: OptionType) {\n const value = item.value||item.label;\n let content = '';\n if (!inputVal.value) inputVal.value = '';\n if (props.formatLabel) {\n content = props.formatLabel(value);\n } else if (props.replace) {\n content = value;\n } else {\n content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;\n }\n inputVal.value = content;\n input(content);\n change(content);\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;mCAmCgB,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAErC,IAAM,MAAA,OAAA,GAAU,aAAa,cAAc,CAAA,CAAA;AAC3C,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,iBAAwB,GAAA,QAAA,CAAA,MAAA;AAAA,MACzB,MAAA;AAED,MAAM,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AA,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,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,129 +1,50 @@
1
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
2
- import { selectInputProps, selectInputEmits } from './select-input.mjs';
1
+ import '../../../utils/index.mjs';
3
2
  import '../../../hooks/index.mjs';
4
- import { useFormSize, useFormDisabled, ElInput, ElLink } from 'element-plus';
5
- import HzztTitle from '../../title/src/title2.mjs';
6
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
7
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
8
- import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
9
- import { numberToLetter } from '../../../hooks/use-letter/index.mjs';
3
+ import '../../../constants/index.mjs';
4
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
6
+ import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
7
+ import { isString } from '@vue/shared';
10
8
 
11
- const _hoisted_1 = { slot: "append" };
12
- const _hoisted_2 = { key: 0 };
13
- const __default__ = defineComponent({
14
- name: "HzztSelectInput"
9
+ const selectInputProps = buildProps({
10
+ modelValue: {
11
+ type: definePropType([
12
+ String,
13
+ Number
14
+ ]),
15
+ default: ""
16
+ },
17
+ indexType: {
18
+ type: String,
19
+ default: "number"
20
+ },
21
+ disabled: Boolean,
22
+ replace: Boolean,
23
+ label: String,
24
+ data: {
25
+ type: definePropType(Array),
26
+ default: () => []
27
+ },
28
+ inputProps: Object,
29
+ customProps: Object,
30
+ position: {
31
+ type: String,
32
+ default: "left"
33
+ },
34
+ formatLabel: {
35
+ type: Function
36
+ },
37
+ split: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ size: useSizeProp
15
42
  });
16
- const _sfc_main = /* @__PURE__ */ defineComponent({
17
- ...__default__,
18
- props: selectInputProps,
19
- emits: selectInputEmits,
20
- setup(__props, { emit }) {
21
- const props = __props;
22
- const inputVal = ref(props.modelValue);
23
- const nsInput = useNamespace("select-input");
24
- const formSize = useFormSize();
25
- const formDisabled = useFormDisabled();
26
- const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
27
- const trueDisabled = computed(() => props.disabled || formDisabled.value);
28
- const containerCls = computed(() => [
29
- nsInput.b(),
30
- nsInput.m(trueSize.value)
31
- ]);
32
- const inputContainerCls = computed(() => [
33
- "flex",
34
- props.position === "top" ? "column" : "row align-items-center"
35
- ]);
36
- const inputCls = computed(() => [
37
- "flex-1",
38
- props.label ? props.position === "top" ? "margin-b-1" : "margin-l-1" : ""
39
- ]);
40
- const _inputProps = computed(() => ({
41
- disabled: trueDisabled.value,
42
- clearable: true,
43
- ...props.inputProps
44
- }));
45
- watch(() => props.modelValue, (v) => {
46
- inputVal.value = v;
47
- });
48
- function input(val) {
49
- emit("update:modelValue", val);
50
- emit("input", val);
51
- }
52
- function change(val) {
53
- emit("change", val);
54
- }
55
- function getLinkName(item, index) {
56
- let prefix = "";
57
- if (props.indexType == "number") {
58
- prefix = `\uFF08${index + 1}\uFF09`;
59
- } else if (props.indexType == "letter") {
60
- prefix = `\uFF08${numberToLetter(index)}\uFF09`;
61
- }
62
- return prefix + (item.label || item.value);
63
- }
64
- function select(item) {
65
- const value = item.value || item.label;
66
- let content = "";
67
- if (!inputVal.value)
68
- inputVal.value = "";
69
- if (props.formatLabel) {
70
- content = props.formatLabel(value);
71
- } else if (props.replace) {
72
- content = value;
73
- } else {
74
- content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;
75
- }
76
- inputVal.value = content;
77
- input(content);
78
- change(content);
79
- }
80
- return (_ctx, _cache) => {
81
- return openBlock(), createElementBlock("div", {
82
- class: normalizeClass(unref(containerCls))
83
- }, [
84
- createElementVNode("div", {
85
- class: normalizeClass(unref(inputContainerCls))
86
- }, [
87
- renderSlot(_ctx.$slots, "title", {}, () => [
88
- createVNode(HzztTitle, { label: _ctx.label }, null, 8, ["label"])
89
- ]),
90
- createVNode(unref(ElInput), mergeProps({
91
- ref: "inputRef",
92
- class: unref(inputCls),
93
- modelValue: inputVal.value,
94
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
95
- }, unref(_inputProps), {
96
- onInput: input,
97
- onChange: change
98
- }), {
99
- default: withCtx(() => [
100
- createElementVNode("template", _hoisted_1, [
101
- renderSlot(_ctx.$slots, "append")
102
- ])
103
- ]),
104
- _: 3
105
- }, 16, ["class", "modelValue"])
106
- ], 2),
107
- _ctx.data.length && !unref(trueDisabled) ? (openBlock(), createElementBlock("div", _hoisted_2, [
108
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item, index) => {
109
- return openBlock(), createBlock(unref(ElLink), mergeProps({
110
- key: index,
111
- class: "margin-r-4"
112
- }, _ctx.customProps, {
113
- onClick: ($event) => select(item)
114
- }), {
115
- default: withCtx(() => [
116
- createTextVNode(toDisplayString(getLinkName(item, index)), 1)
117
- ]),
118
- _: 2
119
- }, 1040, ["onClick"]);
120
- }), 128))
121
- ])) : createCommentVNode("v-if", true)
122
- ], 2);
123
- };
124
- }
125
- });
126
- var SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-input.vue"]]);
43
+ const selectInputEmits = {
44
+ [UPDATE_MODEL_EVENT]: (value) => isString(value),
45
+ input: (value) => isString(value),
46
+ change: (value) => isString(value)
47
+ };
127
48
 
128
- export { SelectInput as default };
49
+ export { selectInputEmits, selectInputProps };
129
50
  //# sourceMappingURL=select-input2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input2.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div :class=\"inputContainerCls\">\n <slot name=\"title\">\n <hzzt-title :label=\"label\"></hzzt-title>\n </slot>\n <el-input ref=\"inputRef\"\n :class=\"inputCls\"\n v-model=\"inputVal\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"\n >\n <template slot=\"append\">\n <slot name=\"append\"></slot>\n </template>\n </el-input>\n </div>\n <div v-if=\"data.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in data\" :key=\"index\" class=\"margin-r-4\" v-bind=\"customProps\" @click=\"select(item)\">\n {{ getLinkName(item, index) }}\n </el-link>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch} from 'vue'\n import {selectInputEmits, selectInputProps} from './select-input'\n import {useGlobalSize, useNamespace, numberToLetter} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElLink} from 'element-plus'\n import {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\n defineOptions({\n name: 'HzztSelectInput',\n })\n\n const props = defineProps(selectInputProps)\n const emit = defineEmits(selectInputEmits)\n\n const inputVal = ref(props.modelValue);\n\n const nsInput = useNamespace('select-input')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const inputContainerCls = computed(() => [\n 'flex',\n props.position === 'top' ? 'column' : 'row align-items-center'\n ])\n\n const inputCls = computed(() => [\n 'flex-1',\n props.label ? props.position === 'top' ? 'margin-b-1' : 'margin-l-1' : ''\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function getLinkName(item: OptionType, index: number) {\n let prefix = '';\n if (props.indexType == 'number') {\n prefix = `(${index + 1})`\n } else if (props.indexType == 'letter') {\n prefix = `(${numberToLetter(index)})`\n }\n return prefix + (item.label || item.value);\n }\n\n function select(item: OptionType) {\n const value = item.value||item.label;\n let content = '';\n if (!inputVal.value) inputVal.value = '';\n if (props.formatLabel) {\n content = props.formatLabel(value);\n } else if (props.replace) {\n content = value;\n } else {\n content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;\n }\n inputVal.value = content;\n input(content);\n change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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,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"select-input2.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectInput from './select-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\nimport {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\nexport const selectInputProps = buildProps({\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n indexType: {\n type: String,\n default: 'number',\n },\n disabled: Boolean,\n replace: Boolean,\n label: String,\n data: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n customProps: Object,\n position: {\n type: String,\n default: 'left',\n },\n formatLabel: {\n type: Function,\n },\n split: {\n type: String,\n default: '',\n },\n size: useSizeProp,\n})\n\nexport type SelectInputProps = ExtractPropTypes<typeof selectInputProps>\n\nexport const selectInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string | undefined) => isString(value),\n input: (value: string | undefined) => isString(value),\n change: (value: string | undefined) => isString(value),\n}\nexport type SelectInputEmits = typeof selectInputEmits\n\nexport type SelectInputInstance = InstanceType<typeof SelectInput>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,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,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACpC;;;;"}
package/es/index.mjs CHANGED
@@ -23,7 +23,7 @@ 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-input.mjs';
26
+ export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input2.mjs';
27
27
  export { HzztSelectInput } from './components/select-input/index.mjs';
28
28
  export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea.mjs';
29
29
  export { HzztSelectTextarea } from './components/select-textarea/index.mjs';
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.0.6";
1
+ export declare const version = "1.0.7";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "1.0.6";
1
+ const version = "1.0.7";
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.6'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
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;;;;"}
@@ -35,7 +35,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
35
35
  "flex width-100% align-items-center"
36
36
  ]);
37
37
  const spanClass = vue.computed(() => [
38
- nsInput.em("span"),
38
+ nsInput.e("span"),
39
39
  "flex width-100% align-items-center"
40
40
  ]);
41
41
  vue.watch(() => props.modelValue, (v) => {