hzzt-plus 2.0.6 → 2.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 (78) hide show
  1. package/dist/index.full.js +66 -64
  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 +66 -64
  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/index.mjs +2 -2
  16. package/es/components/click-input/src/click-input.mjs +84 -21
  17. package/es/components/click-input/src/click-input.mjs.map +1 -1
  18. package/es/components/click-input/src/click-input2.mjs +21 -84
  19. package/es/components/click-input/src/click-input2.mjs.map +1 -1
  20. package/es/components/collapse/index.mjs +2 -2
  21. package/es/components/collapse/src/collapse.mjs +0 -88
  22. package/es/components/collapse/src/collapse.mjs.map +1 -1
  23. package/es/components/collapse/src/collapse2.mjs +88 -0
  24. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  25. package/es/components/icon/index.d.ts +432 -3
  26. package/es/components/icon/index.mjs +12 -11
  27. package/es/components/icon/index.mjs.map +1 -1
  28. package/es/components/icon/src/index.mjs +4 -1
  29. package/es/components/icon/src/index.mjs.map +1 -1
  30. package/es/components/index.mjs +3 -3
  31. package/es/components/select-input/index.mjs +2 -2
  32. package/es/components/select-input/src/select-input.mjs +45 -124
  33. package/es/components/select-input/src/select-input.mjs.map +1 -1
  34. package/es/components/select-input/src/select-input2.mjs +124 -45
  35. package/es/components/select-input/src/select-input2.mjs.map +1 -1
  36. package/es/components/select-textarea/src/select-textarea2.mjs +1 -1
  37. package/es/components/title/index.mjs +2 -2
  38. package/es/components/title/src/title.mjs +11 -54
  39. package/es/components/title/src/title.mjs.map +1 -1
  40. package/es/components/title/src/title2.mjs +54 -11
  41. package/es/components/title/src/title2.mjs.map +1 -1
  42. package/es/index.mjs +3 -3
  43. package/es/version.d.ts +1 -1
  44. package/es/version.mjs +1 -1
  45. package/es/version.mjs.map +1 -1
  46. package/lib/components/click-input/index.js +2 -2
  47. package/lib/components/click-input/src/click-input.js +84 -22
  48. package/lib/components/click-input/src/click-input.js.map +1 -1
  49. package/lib/components/click-input/src/click-input2.js +22 -84
  50. package/lib/components/click-input/src/click-input2.js.map +1 -1
  51. package/lib/components/collapse/index.js +2 -2
  52. package/lib/components/collapse/src/collapse.js +0 -91
  53. package/lib/components/collapse/src/collapse.js.map +1 -1
  54. package/lib/components/collapse/src/collapse2.js +91 -0
  55. package/lib/components/collapse/src/collapse2.js.map +1 -1
  56. package/lib/components/icon/index.d.ts +432 -3
  57. package/lib/components/icon/index.js +14 -13
  58. package/lib/components/icon/index.js.map +1 -1
  59. package/lib/components/icon/src/index.js +4 -1
  60. package/lib/components/icon/src/index.js.map +1 -1
  61. package/lib/components/index.js +3 -3
  62. package/lib/components/select-input/index.js +2 -2
  63. package/lib/components/select-input/src/select-input.js +46 -124
  64. package/lib/components/select-input/src/select-input.js.map +1 -1
  65. package/lib/components/select-input/src/select-input2.js +124 -46
  66. package/lib/components/select-input/src/select-input2.js.map +1 -1
  67. package/lib/components/select-textarea/src/select-textarea2.js +1 -1
  68. package/lib/components/title/index.js +2 -2
  69. package/lib/components/title/src/title.js +11 -54
  70. package/lib/components/title/src/title.js.map +1 -1
  71. package/lib/components/title/src/title2.js +54 -11
  72. package/lib/components/title/src/title2.js.map +1 -1
  73. package/lib/index.js +3 -3
  74. package/lib/version.d.ts +1 -1
  75. package/lib/version.js +1 -1
  76. package/lib/version.js.map +1 -1
  77. package/package.json +1 -1
  78. package/web-types.json +1 -1
package/es/index.mjs CHANGED
@@ -5,7 +5,7 @@ import './constants/index.mjs';
5
5
  import './directives/index.mjs';
6
6
  import './hooks/index.mjs';
7
7
  export { makeInstaller } from './make-installer.mjs';
8
- export { titleProps } from './components/title/src/title2.mjs';
8
+ export { titleProps } from './components/title/src/title.mjs';
9
9
  export { HzztTitle } from './components/title/index.mjs';
10
10
  export { HzztDropdown } from './components/dropdown/index.mjs';
11
11
  export { HzztCollapse } from './components/collapse/index.mjs';
@@ -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-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
28
  export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea.mjs';
29
29
  export { HzztSelectTextarea } from './components/select-textarea/index.mjs';
@@ -33,7 +33,7 @@ export { cascaderEmits, cascaderProps } from './components/cascader/src/cascader
33
33
  export { HzztCascader } from './components/cascader/index.mjs';
34
34
  export { selectEmits, selectProps } from './components/select/src/select.mjs';
35
35
  export { HzztSelect } from './components/select/index.mjs';
36
- export { clickInputEmits, clickInputProps } from './components/click-input/src/click-input.mjs';
36
+ export { clickInputEmits, clickInputProps } from './components/click-input/src/click-input2.mjs';
37
37
  export { HzztClickInput } from './components/click-input/index.mjs';
38
38
  export { HzztScroll } from './components/scroll/index.mjs';
39
39
  export { lazyListEmits, lazyListProps } from './components/lazy-list/src/lazy-list.mjs';
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.0.6";
1
+ export declare const version = "2.0.7";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "2.0.6";
1
+ const version = "2.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 = '2.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 = '2.0.7'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var clickInput$1 = require('./src/click-input2.js');
7
- var clickInput = require('./src/click-input.js');
6
+ var clickInput$1 = require('./src/click-input.js');
7
+ var clickInput = require('./src/click-input2.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const HzztClickInput = install.withInstall(clickInput$1["default"]);
@@ -2,30 +2,92 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
5
+ var vue = require('vue');
6
+ var clickInput = require('./click-input2.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 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');
12
12
 
13
- const clickInputProps = runtime.buildProps({
14
- modelValue: {
15
- type: String,
16
- default: ""
17
- },
18
- disabled: Boolean,
19
- readonly: Boolean,
20
- inputProps: Object,
21
- size: index.useSizeProp
13
+ const __default__ = vue.defineComponent({
14
+ name: "HzztClickInput"
22
15
  });
23
- const clickInputEmits = {
24
- [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
25
- input: (value) => shared.isString(value),
26
- change: (value) => shared.isString(value)
27
- };
16
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
+ ...__default__,
18
+ props: clickInput.clickInputProps,
19
+ emits: clickInput.clickInputEmits,
20
+ setup(__props, { emit }) {
21
+ const props = __props;
22
+ const _inputVal = vue.ref(props.modelValue || "");
23
+ const inputVal = vue.ref(props.modelValue || "");
24
+ const inputRef = vue.ref();
25
+ const editable = vue.ref(false);
26
+ const nsInput = index.useNamespace("click-input");
27
+ const formSize = elementPlus.useFormSize();
28
+ const formDisabled = elementPlus.useFormDisabled();
29
+ const trueSize = vue.computed(() => props.size || formSize.value || index$1.useGlobalSize().value);
30
+ const trueDisabled = vue.computed(() => props.disabled || formDisabled.value);
31
+ const trueReadonly = vue.computed(() => trueDisabled.value || props.readonly || !editable.value);
32
+ const containerCls = vue.computed(() => [
33
+ nsInput.b(),
34
+ nsInput.m(trueSize.value),
35
+ "flex width-100% align-items-center"
36
+ ]);
37
+ const spanClass = vue.computed(() => [
38
+ nsInput.e("span"),
39
+ "flex width-100% align-items-center"
40
+ ]);
41
+ vue.watch(() => props.modelValue, (v) => {
42
+ inputVal.value = v || "";
43
+ _inputVal.value = v || "";
44
+ });
45
+ function input(val) {
46
+ emit("update:modelValue", val);
47
+ emit("input", val);
48
+ }
49
+ function change() {
50
+ editable.value = false;
51
+ if (_inputVal.value === inputVal.value) {
52
+ return;
53
+ }
54
+ input(inputVal.value);
55
+ emit("change", inputVal.value);
56
+ }
57
+ function edit() {
58
+ if (trueDisabled.value || props.readonly) {
59
+ return;
60
+ }
61
+ editable.value = true;
62
+ vue.nextTick(() => {
63
+ inputRef.value.focus();
64
+ });
65
+ }
66
+ return (_ctx, _cache) => {
67
+ return vue.openBlock(), vue.createElementBlock("div", {
68
+ class: vue.normalizeClass(vue.unref(containerCls))
69
+ }, [
70
+ !vue.unref(trueReadonly) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElInput), vue.mergeProps({
71
+ key: 0,
72
+ ref_key: "inputRef",
73
+ ref: inputRef,
74
+ modelValue: inputVal.value,
75
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
76
+ }, _ctx.inputProps, {
77
+ clearable: "",
78
+ size: vue.unref(trueSize),
79
+ onKeyup: vue.withKeys(change, ["enter"]),
80
+ onBlur: change
81
+ }), null, 16, ["modelValue", "size", "onKeyup"])) : (vue.openBlock(), vue.createElementBlock("div", {
82
+ key: 1,
83
+ class: vue.normalizeClass(["width-100%", vue.unref(spanClass)]),
84
+ onClick: edit
85
+ }, vue.toDisplayString(inputVal.value || " "), 3))
86
+ ], 2);
87
+ };
88
+ }
89
+ });
90
+ var ClickInput = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "click-input.vue"]]);
28
91
 
29
- exports.clickInputEmits = clickInputEmits;
30
- exports.clickInputProps = clickInputProps;
92
+ exports["default"] = ClickInput;
31
93
  //# sourceMappingURL=click-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-input.js","sources":["../../../../../../packages/components/click-input/src/click-input.ts"],"sourcesContent":["import {buildProps, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type ClickInput from './click-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const clickInputProps = buildProps({\n modelValue: {\n type: String,\n default: '',\n },\n disabled: Boolean,\n readonly: Boolean,\n inputProps: Object,\n size: useSizeProp,\n})\n\nexport type ClickInputProps = ExtractPropTypes<typeof clickInputProps>\n\nexport const clickInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string) => isString(value),\n}\nexport type ClickInputEmits = typeof clickInputEmits\n\nexport type ClickInputInstance = InstanceType<typeof ClickInput>\n"],"names":["buildProps","useSizeProp","UPDATE_MODEL_EVENT","isString"],"mappings":";;;;;;;;;;;;AAGY,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,IAAI,EAAEC,iBAAW;AACnB,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,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":"click-input.js","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":["ref","useNamespace","useFormSize","useFormDisabled","computed","useGlobalSize","watch","nextTick","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;uCAyBgB,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC5C,IAAA,MAAM,QAAW,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAWA,OAAI,EAAA,CAAA;AACrB,IAAM,MAAA,QAAA,GAAWA,QAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,OAAA,GAAUC,mBAAa,aAAa,CAAA,CAAA;AAC1C,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,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAM,eAAeA,YAAS,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,SAAA,GAAAA,YAAA,CAAA,MAAA;AAAA,MACD,OAAA,CAAA,CAAA,CAAA,MAAA,CAAA;AAED,MAAM,oCAA2B;AAAA,KAC/B,CAAA,CAAA;AAAgB,IAChBE,SAAA,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACD,QAAA,CAAA,KAAA,GAAA,CAAA,IAAA,EAAA,CAAA;AAED,MAAA,SAAY,CAAA,KAAA,GAAkB,CAAA,IAAA,EAAA,CAAA;AAC5B,KAAA,CAAA,CAAA;AACA,IAAA,SAAA,WAAkB;AAAK,MACxB,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAED,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,kBAAiB;AAAA,MACnB,QAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAEA,MAAA,IAAA,SAAkB,CAAA,KAAA,KAAA,QAAA,CAAA,KAAA,EAAA;AAChB,QAAA,OAAS;AACT,OAAI;AACF,MAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAAA,MACF,IAAA,CAAA,QAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAK,SAAA,IAAA,GAAA;AAAwB,MAC/B,IAAA,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,EAAA;AAEA,QAAA,OAAgB;AACd,OAAI;AACF,MAAA,QAAA,CAAA,KAAA,GAAA,IAAA,CAAA;AAAA,MACFC,YAAA,CAAA,MAAA;AACA,QAAA,QAAiB,CAAA,KAAA,CAAA,KAAA,EAAA,CAAA;AACjB,OAAA,CAAA,CAAA;AACE,KAAA;AAAqB,IAAA,OACtB,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACH,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,92 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var clickInput = require('./click-input.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
+ 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');
12
12
 
13
- const __default__ = vue.defineComponent({
14
- name: "HzztClickInput"
13
+ const clickInputProps = runtime.buildProps({
14
+ modelValue: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ disabled: Boolean,
19
+ readonly: Boolean,
20
+ inputProps: Object,
21
+ size: index.useSizeProp
15
22
  });
16
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
- ...__default__,
18
- props: clickInput.clickInputProps,
19
- emits: clickInput.clickInputEmits,
20
- setup(__props, { emit }) {
21
- const props = __props;
22
- const _inputVal = vue.ref(props.modelValue || "");
23
- const inputVal = vue.ref(props.modelValue || "");
24
- const inputRef = vue.ref();
25
- const editable = vue.ref(false);
26
- const nsInput = index.useNamespace("click-input");
27
- const formSize = elementPlus.useFormSize();
28
- const formDisabled = elementPlus.useFormDisabled();
29
- const trueSize = vue.computed(() => props.size || formSize.value || index$1.useGlobalSize().value);
30
- const trueDisabled = vue.computed(() => props.disabled || formDisabled.value);
31
- const trueReadonly = vue.computed(() => trueDisabled.value || props.readonly || !editable.value);
32
- const containerCls = vue.computed(() => [
33
- nsInput.b(),
34
- nsInput.m(trueSize.value),
35
- "flex width-100% align-items-center"
36
- ]);
37
- const spanClass = vue.computed(() => [
38
- nsInput.e("span"),
39
- "flex width-100% align-items-center"
40
- ]);
41
- vue.watch(() => props.modelValue, (v) => {
42
- inputVal.value = v || "";
43
- _inputVal.value = v || "";
44
- });
45
- function input(val) {
46
- emit("update:modelValue", val);
47
- emit("input", val);
48
- }
49
- function change() {
50
- editable.value = false;
51
- if (_inputVal.value === inputVal.value) {
52
- return;
53
- }
54
- input(inputVal.value);
55
- emit("change", inputVal.value);
56
- }
57
- function edit() {
58
- if (trueDisabled.value || props.readonly) {
59
- return;
60
- }
61
- editable.value = true;
62
- vue.nextTick(() => {
63
- inputRef.value.focus();
64
- });
65
- }
66
- return (_ctx, _cache) => {
67
- return vue.openBlock(), vue.createElementBlock("div", {
68
- class: vue.normalizeClass(vue.unref(containerCls))
69
- }, [
70
- !vue.unref(trueReadonly) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElInput), vue.mergeProps({
71
- key: 0,
72
- ref_key: "inputRef",
73
- ref: inputRef,
74
- modelValue: inputVal.value,
75
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
76
- }, _ctx.inputProps, {
77
- clearable: "",
78
- size: vue.unref(trueSize),
79
- onKeyup: vue.withKeys(change, ["enter"]),
80
- onBlur: change
81
- }), null, 16, ["modelValue", "size", "onKeyup"])) : (vue.openBlock(), vue.createElementBlock("div", {
82
- key: 1,
83
- class: vue.normalizeClass(["width-100%", vue.unref(spanClass)]),
84
- onClick: edit
85
- }, vue.toDisplayString(inputVal.value || " "), 3))
86
- ], 2);
87
- };
88
- }
89
- });
90
- var ClickInput = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "click-input.vue"]]);
23
+ const clickInputEmits = {
24
+ [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
25
+ input: (value) => shared.isString(value),
26
+ change: (value) => shared.isString(value)
27
+ };
91
28
 
92
- exports["default"] = ClickInput;
29
+ exports.clickInputEmits = clickInputEmits;
30
+ exports.clickInputProps = clickInputProps;
93
31
  //# sourceMappingURL=click-input2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-input2.js","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":["ref","useNamespace","useFormSize","useFormDisabled","computed","useGlobalSize","watch","nextTick","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;uCAyBgB,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC5C,IAAA,MAAM,QAAW,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAWA,OAAI,EAAA,CAAA;AACrB,IAAM,MAAA,QAAA,GAAWA,QAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,OAAA,GAAUC,mBAAa,aAAa,CAAA,CAAA;AAC1C,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,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAM,eAAeA,YAAS,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,SAAA,GAAAA,YAAA,CAAA,MAAA;AAAA,MACD,OAAA,CAAA,CAAA,CAAA,MAAA,CAAA;AAED,MAAM,oCAA2B;AAAA,KAC/B,CAAA,CAAA;AAAgB,IAChBE,SAAA,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACD,QAAA,CAAA,KAAA,GAAA,CAAA,IAAA,EAAA,CAAA;AAED,MAAA,SAAY,CAAA,KAAA,GAAkB,CAAA,IAAA,EAAA,CAAA;AAC5B,KAAA,CAAA,CAAA;AACA,IAAA,SAAA,WAAkB;AAAK,MACxB,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAED,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,kBAAiB;AAAA,MACnB,QAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAEA,MAAA,IAAA,SAAkB,CAAA,KAAA,KAAA,QAAA,CAAA,KAAA,EAAA;AAChB,QAAA,OAAS;AACT,OAAI;AACF,MAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAAA,MACF,IAAA,CAAA,QAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAK,SAAA,IAAA,GAAA;AAAwB,MAC/B,IAAA,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,EAAA;AAEA,QAAA,OAAgB;AACd,OAAI;AACF,MAAA,QAAA,CAAA,KAAA,GAAA,IAAA,CAAA;AAAA,MACFC,YAAA,CAAA,MAAA;AACA,QAAA,QAAiB,CAAA,KAAA,CAAA,KAAA,EAAA,CAAA;AACjB,OAAA,CAAA,CAAA;AACE,KAAA;AAAqB,IAAA,OACtB,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACH,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"click-input2.js","sources":["../../../../../../packages/components/click-input/src/click-input.ts"],"sourcesContent":["import {buildProps, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type ClickInput from './click-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const clickInputProps = buildProps({\n modelValue: {\n type: String,\n default: '',\n },\n disabled: Boolean,\n readonly: Boolean,\n inputProps: Object,\n size: useSizeProp,\n})\n\nexport type ClickInputProps = ExtractPropTypes<typeof clickInputProps>\n\nexport const clickInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string) => isString(value),\n}\nexport type ClickInputEmits = typeof clickInputEmits\n\nexport type ClickInputInstance = InstanceType<typeof ClickInput>\n"],"names":["buildProps","useSizeProp","UPDATE_MODEL_EVENT","isString"],"mappings":";;;;;;;;;;;;AAGY,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,IAAI,EAAEC,iBAAW;AACnB,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,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;;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var collapse = require('./src/collapse.js');
7
- require('./src/collapse2.js');
6
+ var collapse = require('./src/collapse2.js');
7
+ require('./src/collapse.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const HzztCollapse = install.withInstall(collapse["default"]);
@@ -1,94 +1,3 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
- require('../../../hooks/index.js');
7
- var index$1 = require('../../icon/src/index.js');
8
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
9
- var index = require('../../../hooks/use-locale/index.js');
10
-
11
- const _hoisted_1 = { class: "hzzt-collapse flex column" };
12
- const _hoisted_2 = { class: "hzzt-collapse__top" };
13
- const _hoisted_3 = { class: "hzzt-collapse__title" };
14
- const _hoisted_4 = {
15
- key: 0,
16
- class: "hzzt-collapse__line"
17
- };
18
- const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
19
- const __default__ = vue.defineComponent({
20
- name: "HzztCollapse"
21
- });
22
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
23
- ...__default__,
24
- props: {
25
- defaultActive: {
26
- type: Boolean,
27
- default: true
28
- },
29
- title: {
30
- type: String,
31
- default: ""
32
- },
33
- showLine: {
34
- type: Boolean,
35
- default: true
36
- },
37
- modelValue: {
38
- type: Boolean,
39
- default: true
40
- }
41
- },
42
- emits: ["update:modelValue"],
43
- setup(__props, { emit }) {
44
- const props = __props;
45
- const { t } = index.useLocale();
46
- const expand = vue.ref(props.modelValue);
47
- if (!props.defaultActive) {
48
- emit("update:modelValue", false);
49
- expand.value = false;
50
- }
51
- vue.watch(() => props.modelValue, (v) => {
52
- expand.value = v;
53
- });
54
- function toggle() {
55
- expand.value = !expand.value;
56
- emit("update:modelValue", expand.value);
57
- }
58
- return (_ctx, _cache) => {
59
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
60
- vue.createElementVNode("div", _hoisted_2, [
61
- vue.createElementVNode("div", _hoisted_3, [
62
- vue.renderSlot(_ctx.$slots, "title", {}, () => [
63
- vue.createTextVNode(vue.toDisplayString(__props.title), 1)
64
- ])
65
- ]),
66
- __props.showLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true),
67
- vue.renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
68
- vue.createElementVNode("div", {
69
- class: "hzzt-collapse__btn",
70
- onClick: toggle
71
- }, [
72
- vue.createVNode(index$1["default"], {
73
- name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
74
- class: "hzzt-collapse__icon",
75
- size: "14"
76
- }, null, 8, ["name"]),
77
- vue.createElementVNode("span", null, vue.toDisplayString(expand.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)
78
- ])
79
- ])
80
- ]),
81
- vue.withDirectives(vue.createElementVNode("div", _hoisted_5, [
82
- vue.renderSlot(_ctx.$slots, "default")
83
- ], 512), [
84
- [vue.vShow, expand.value]
85
- ]),
86
- vue.renderSlot(_ctx.$slots, "active", { active: expand.value })
87
- ]);
88
- };
89
- }
90
- });
91
- var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
92
-
93
- exports["default"] = Collapse;
94
3
  //# sourceMappingURL=collapse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse flex column\">\n <div class=\"hzzt-collapse__top\">\n <div class=\"hzzt-collapse__title\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div v-if=\"showLine\" class=\"hzzt-collapse__line\" />\n <slot name=\"toggle-btn\">\n <div class=\"hzzt-collapse__btn\" @click=\"toggle\">\n <hzzt-icon :name=\"!expand ? 'hzzt-plus-square-outline' : 'hzzt-minus-square-outline'\"\n class=\"hzzt-collapse__icon\" size=\"14\" />\n <span>{{ expand ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand') }}</span>\n </div>\n </slot>\n </div>\n <div v-show=\"expand\" class=\"hzzt-collapse__content flex-1\">\n <slot />\n </div>\n\n <slot :active=\"expand\" name=\"active\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import {useLocale} from '@hzzt-plus/hooks'\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {ref, watch} from 'vue'\n\n defineOptions({\n name: 'HzztCollapse',\n })\n const {t} = useLocale()\n const props = defineProps({\n defaultActive: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n showLine: {\n type: Boolean,\n default: true,\n },\n modelValue: {\n type: Boolean,\n default: true,\n },\n })\n const emit = defineEmits(['update:modelValue'])\n\n const expand = ref(props.modelValue)\n\n if (!props.defaultActive) {\n emit('update:modelValue', false);\n expand.value = false;\n }\n\n watch(() => props.modelValue, (v) => {\n expand.value = v;\n })\n\n function toggle() {\n expand.value = !expand.value;\n emit('update:modelValue', expand.value);\n }\n\n</script>\n"],"names":["useLocale","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;uCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAIA,eAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAASC,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAEnC,IAAI,IAAA,CAAC,MAAM,aAAe,EAAA;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAAC,SAAA,CAAM,MAAM,KAAA,CAAM,UAAY,EAAA,CAAC,CAAM,KAAA;AACnC,MAAA,MAAA,CAAO,KAAQ,GAAA,CAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAS,MAAS,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AACvB,MAAK,IAAA,CAAA,mBAAA,EAAqB,OAAO,KAAK,CAAA,CAAA;AAAA,KACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"collapse.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,3 +1,94 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ require('../../../hooks/index.js');
7
+ var index$1 = require('../../icon/src/index.js');
8
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
9
+ var index = require('../../../hooks/use-locale/index.js');
10
+
11
+ const _hoisted_1 = { class: "hzzt-collapse flex column" };
12
+ const _hoisted_2 = { class: "hzzt-collapse__top" };
13
+ const _hoisted_3 = { class: "hzzt-collapse__title" };
14
+ const _hoisted_4 = {
15
+ key: 0,
16
+ class: "hzzt-collapse__line"
17
+ };
18
+ const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
19
+ const __default__ = vue.defineComponent({
20
+ name: "HzztCollapse"
21
+ });
22
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
23
+ ...__default__,
24
+ props: {
25
+ defaultActive: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ title: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ showLine: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ modelValue: {
38
+ type: Boolean,
39
+ default: true
40
+ }
41
+ },
42
+ emits: ["update:modelValue"],
43
+ setup(__props, { emit }) {
44
+ const props = __props;
45
+ const { t } = index.useLocale();
46
+ const expand = vue.ref(props.modelValue);
47
+ if (!props.defaultActive) {
48
+ emit("update:modelValue", false);
49
+ expand.value = false;
50
+ }
51
+ vue.watch(() => props.modelValue, (v) => {
52
+ expand.value = v;
53
+ });
54
+ function toggle() {
55
+ expand.value = !expand.value;
56
+ emit("update:modelValue", expand.value);
57
+ }
58
+ return (_ctx, _cache) => {
59
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
60
+ vue.createElementVNode("div", _hoisted_2, [
61
+ vue.createElementVNode("div", _hoisted_3, [
62
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
63
+ vue.createTextVNode(vue.toDisplayString(__props.title), 1)
64
+ ])
65
+ ]),
66
+ __props.showLine ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true),
67
+ vue.renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
68
+ vue.createElementVNode("div", {
69
+ class: "hzzt-collapse__btn",
70
+ onClick: toggle
71
+ }, [
72
+ vue.createVNode(index$1["default"], {
73
+ name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
74
+ class: "hzzt-collapse__icon",
75
+ size: "14"
76
+ }, null, 8, ["name"]),
77
+ vue.createElementVNode("span", null, vue.toDisplayString(expand.value ? vue.unref(t)("hzzt.collapse.retract") : vue.unref(t)("hzzt.collapse.expand")), 1)
78
+ ])
79
+ ])
80
+ ]),
81
+ vue.withDirectives(vue.createElementVNode("div", _hoisted_5, [
82
+ vue.renderSlot(_ctx.$slots, "default")
83
+ ], 512), [
84
+ [vue.vShow, expand.value]
85
+ ]),
86
+ vue.renderSlot(_ctx.$slots, "active", { active: expand.value })
87
+ ]);
88
+ };
89
+ }
90
+ });
91
+ var Collapse = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "collapse.vue"]]);
92
+
93
+ exports["default"] = Collapse;
3
94
  //# sourceMappingURL=collapse2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapse2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"collapse2.js","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse flex column\">\n <div class=\"hzzt-collapse__top\">\n <div class=\"hzzt-collapse__title\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div v-if=\"showLine\" class=\"hzzt-collapse__line\" />\n <slot name=\"toggle-btn\">\n <div class=\"hzzt-collapse__btn\" @click=\"toggle\">\n <hzzt-icon :name=\"!expand ? 'hzzt-plus-square-outline' : 'hzzt-minus-square-outline'\"\n class=\"hzzt-collapse__icon\" size=\"14\" />\n <span>{{ expand ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand') }}</span>\n </div>\n </slot>\n </div>\n <div v-show=\"expand\" class=\"hzzt-collapse__content flex-1\">\n <slot />\n </div>\n\n <slot :active=\"expand\" name=\"active\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import {useLocale} from '@hzzt-plus/hooks'\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {ref, watch} from 'vue'\n\n defineOptions({\n name: 'HzztCollapse',\n })\n const {t} = useLocale()\n const props = defineProps({\n defaultActive: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n showLine: {\n type: Boolean,\n default: true,\n },\n modelValue: {\n type: Boolean,\n default: true,\n },\n })\n const emit = defineEmits(['update:modelValue'])\n\n const expand = ref(props.modelValue)\n\n if (!props.defaultActive) {\n emit('update:modelValue', false);\n expand.value = false;\n }\n\n watch(() => props.modelValue, (v) => {\n expand.value = v;\n })\n\n function toggle() {\n expand.value = !expand.value;\n emit('update:modelValue', expand.value);\n }\n\n</script>\n"],"names":["useLocale","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;uCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAIA,eAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAASC,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAEnC,IAAI,IAAA,CAAC,MAAM,aAAe,EAAA;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAAC,SAAA,CAAM,MAAM,KAAA,CAAM,UAAY,EAAA,CAAC,CAAM,KAAA;AACnC,MAAA,MAAA,CAAO,KAAQ,GAAA,CAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAS,MAAS,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AACvB,MAAK,IAAA,CAAA,mBAAA,EAAqB,OAAO,KAAK,CAAA,CAAA;AAAA,KACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}