hzzt-plus 2.0.5 → 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.
- package/dist/index.full.js +77 -74
- package/dist/index.full.min.js +10 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +10 -10
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +77 -74
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +36 -122
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +122 -36
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/click-input/index.mjs +2 -2
- package/es/components/click-input/src/click-input.mjs +84 -21
- package/es/components/click-input/src/click-input.mjs.map +1 -1
- package/es/components/click-input/src/click-input2.mjs +21 -84
- package/es/components/click-input/src/click-input2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +0 -88
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +88 -0
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/icon/index.d.ts +432 -3
- package/es/components/icon/index.mjs +12 -11
- package/es/components/icon/index.mjs.map +1 -1
- package/es/components/icon/src/index.mjs +4 -1
- package/es/components/icon/src/index.mjs.map +1 -1
- package/es/components/index.mjs +5 -5
- package/es/components/input-range/index.mjs +2 -2
- package/es/components/input-range/src/input-range.mjs +26 -76
- package/es/components/input-range/src/input-range.mjs.map +1 -1
- package/es/components/input-range/src/input-range2.mjs +76 -26
- package/es/components/input-range/src/input-range2.mjs.map +1 -1
- package/es/components/lazy-list/index.mjs +2 -2
- package/es/components/lazy-list/src/lazy-list.mjs +22 -80
- package/es/components/lazy-list/src/lazy-list.mjs.map +1 -1
- package/es/components/lazy-list/src/lazy-list2.mjs +80 -22
- package/es/components/lazy-list/src/lazy-list2.mjs.map +1 -1
- package/es/components/select-input/index.mjs +2 -2
- package/es/components/select-input/src/select-input.mjs +45 -124
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input2.mjs +124 -45
- package/es/components/select-input/src/select-input2.mjs.map +1 -1
- package/es/components/tab/index.d.ts +2 -0
- package/es/components/tab/src/index.mjs +10 -9
- package/es/components/tab/src/index.mjs.map +1 -1
- package/es/components/tab/src/index.vue.d.ts +2 -0
- package/es/index.mjs +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +36 -121
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +121 -36
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/click-input/index.js +2 -2
- package/lib/components/click-input/src/click-input.js +84 -22
- package/lib/components/click-input/src/click-input.js.map +1 -1
- package/lib/components/click-input/src/click-input2.js +22 -84
- package/lib/components/click-input/src/click-input2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +0 -91
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +91 -0
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/icon/index.d.ts +432 -3
- package/lib/components/icon/index.js +14 -13
- package/lib/components/icon/index.js.map +1 -1
- package/lib/components/icon/src/index.js +4 -1
- package/lib/components/icon/src/index.js.map +1 -1
- package/lib/components/index.js +5 -5
- package/lib/components/input-range/index.js +2 -2
- package/lib/components/input-range/src/input-range.js +27 -76
- package/lib/components/input-range/src/input-range.js.map +1 -1
- package/lib/components/input-range/src/input-range2.js +76 -27
- package/lib/components/input-range/src/input-range2.js.map +1 -1
- package/lib/components/lazy-list/index.js +2 -2
- package/lib/components/lazy-list/src/lazy-list.js +23 -80
- package/lib/components/lazy-list/src/lazy-list.js.map +1 -1
- package/lib/components/lazy-list/src/lazy-list2.js +80 -23
- package/lib/components/lazy-list/src/lazy-list2.js.map +1 -1
- package/lib/components/select-input/index.js +2 -2
- package/lib/components/select-input/src/select-input.js +46 -124
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input2.js +124 -46
- package/lib/components/select-input/src/select-input2.js.map +1 -1
- package/lib/components/tab/index.d.ts +2 -0
- package/lib/components/tab/src/index.js +9 -8
- package/lib/components/tab/src/index.js.map +1 -1
- package/lib/components/tab/src/index.vue.d.ts +2 -0
- package/lib/index.js +5 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,89 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { clickInputProps, clickInputEmits } from './click-input.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
3
2
|
import '../../../hooks/index.mjs';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import '../../../constants/index.mjs';
|
|
4
|
+
import { buildProps } 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';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const clickInputProps = buildProps({
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
disabled: Boolean,
|
|
15
|
+
readonly: Boolean,
|
|
16
|
+
inputProps: Object,
|
|
17
|
+
size: useSizeProp
|
|
11
18
|
});
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const props = __props;
|
|
18
|
-
const _inputVal = ref(props.modelValue || "");
|
|
19
|
-
const inputVal = ref(props.modelValue || "");
|
|
20
|
-
const inputRef = ref();
|
|
21
|
-
const editable = ref(false);
|
|
22
|
-
const nsInput = useNamespace("click-input");
|
|
23
|
-
const formSize = useFormSize();
|
|
24
|
-
const formDisabled = useFormDisabled();
|
|
25
|
-
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
26
|
-
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
27
|
-
const trueReadonly = computed(() => trueDisabled.value || props.readonly || !editable.value);
|
|
28
|
-
const containerCls = computed(() => [
|
|
29
|
-
nsInput.b(),
|
|
30
|
-
nsInput.m(trueSize.value),
|
|
31
|
-
"flex width-100% align-items-center"
|
|
32
|
-
]);
|
|
33
|
-
const spanClass = computed(() => [
|
|
34
|
-
nsInput.e("span"),
|
|
35
|
-
"flex width-100% align-items-center"
|
|
36
|
-
]);
|
|
37
|
-
watch(() => props.modelValue, (v) => {
|
|
38
|
-
inputVal.value = v || "";
|
|
39
|
-
_inputVal.value = v || "";
|
|
40
|
-
});
|
|
41
|
-
function input(val) {
|
|
42
|
-
emit("update:modelValue", val);
|
|
43
|
-
emit("input", val);
|
|
44
|
-
}
|
|
45
|
-
function change() {
|
|
46
|
-
editable.value = false;
|
|
47
|
-
if (_inputVal.value === inputVal.value) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
input(inputVal.value);
|
|
51
|
-
emit("change", inputVal.value);
|
|
52
|
-
}
|
|
53
|
-
function edit() {
|
|
54
|
-
if (trueDisabled.value || props.readonly) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
editable.value = true;
|
|
58
|
-
nextTick(() => {
|
|
59
|
-
inputRef.value.focus();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return openBlock(), createElementBlock("div", {
|
|
64
|
-
class: normalizeClass(unref(containerCls))
|
|
65
|
-
}, [
|
|
66
|
-
!unref(trueReadonly) ? (openBlock(), createBlock(unref(ElInput), mergeProps({
|
|
67
|
-
key: 0,
|
|
68
|
-
ref_key: "inputRef",
|
|
69
|
-
ref: inputRef,
|
|
70
|
-
modelValue: inputVal.value,
|
|
71
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
|
|
72
|
-
}, _ctx.inputProps, {
|
|
73
|
-
clearable: "",
|
|
74
|
-
size: unref(trueSize),
|
|
75
|
-
onKeyup: withKeys(change, ["enter"]),
|
|
76
|
-
onBlur: change
|
|
77
|
-
}), null, 16, ["modelValue", "size", "onKeyup"])) : (openBlock(), createElementBlock("div", {
|
|
78
|
-
key: 1,
|
|
79
|
-
class: normalizeClass(["width-100%", unref(spanClass)]),
|
|
80
|
-
onClick: edit
|
|
81
|
-
}, toDisplayString(inputVal.value || " "), 3))
|
|
82
|
-
], 2);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
var ClickInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "click-input.vue"]]);
|
|
19
|
+
const clickInputEmits = {
|
|
20
|
+
[UPDATE_MODEL_EVENT]: (value) => isString(value),
|
|
21
|
+
input: (value) => isString(value),
|
|
22
|
+
change: (value) => isString(value)
|
|
23
|
+
};
|
|
87
24
|
|
|
88
|
-
export {
|
|
25
|
+
export { clickInputEmits, clickInputProps };
|
|
89
26
|
//# sourceMappingURL=click-input2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-input2.mjs","sources":["../../../../../../packages/components/click-input/src/click-input.
|
|
1
|
+
{"version":3,"file":"click-input2.mjs","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":[],"mappings":";;;;;;;;AAGY,MAAC,eAAe,GAAG,UAAU,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,EAAE,WAAW;AACnB,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,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,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Collapse from './src/
|
|
3
|
-
import './src/
|
|
2
|
+
import Collapse from './src/collapse2.mjs';
|
|
3
|
+
import './src/collapse.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztCollapse = withInstall(Collapse);
|
|
@@ -1,90 +1,2 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, openBlock, createElementBlock, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withDirectives, vShow } from 'vue';
|
|
2
|
-
import '../../../hooks/index.mjs';
|
|
3
|
-
import HzztIcon from '../../icon/src/index.mjs';
|
|
4
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
6
1
|
|
|
7
|
-
const _hoisted_1 = { class: "hzzt-collapse flex column" };
|
|
8
|
-
const _hoisted_2 = { class: "hzzt-collapse__top" };
|
|
9
|
-
const _hoisted_3 = { class: "hzzt-collapse__title" };
|
|
10
|
-
const _hoisted_4 = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "hzzt-collapse__line"
|
|
13
|
-
};
|
|
14
|
-
const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
|
|
15
|
-
const __default__ = defineComponent({
|
|
16
|
-
name: "HzztCollapse"
|
|
17
|
-
});
|
|
18
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
-
...__default__,
|
|
20
|
-
props: {
|
|
21
|
-
defaultActive: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: true
|
|
24
|
-
},
|
|
25
|
-
title: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: ""
|
|
28
|
-
},
|
|
29
|
-
showLine: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
modelValue: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: true
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
emits: ["update:modelValue"],
|
|
39
|
-
setup(__props, { emit }) {
|
|
40
|
-
const props = __props;
|
|
41
|
-
const { t } = useLocale();
|
|
42
|
-
const expand = ref(props.modelValue);
|
|
43
|
-
if (!props.defaultActive) {
|
|
44
|
-
emit("update:modelValue", false);
|
|
45
|
-
expand.value = false;
|
|
46
|
-
}
|
|
47
|
-
watch(() => props.modelValue, (v) => {
|
|
48
|
-
expand.value = v;
|
|
49
|
-
});
|
|
50
|
-
function toggle() {
|
|
51
|
-
expand.value = !expand.value;
|
|
52
|
-
emit("update:modelValue", expand.value);
|
|
53
|
-
}
|
|
54
|
-
return (_ctx, _cache) => {
|
|
55
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
|
-
createElementVNode("div", _hoisted_2, [
|
|
57
|
-
createElementVNode("div", _hoisted_3, [
|
|
58
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
59
|
-
createTextVNode(toDisplayString(__props.title), 1)
|
|
60
|
-
])
|
|
61
|
-
]),
|
|
62
|
-
__props.showLine ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true),
|
|
63
|
-
renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
|
|
64
|
-
createElementVNode("div", {
|
|
65
|
-
class: "hzzt-collapse__btn",
|
|
66
|
-
onClick: toggle
|
|
67
|
-
}, [
|
|
68
|
-
createVNode(HzztIcon, {
|
|
69
|
-
name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
|
|
70
|
-
class: "hzzt-collapse__icon",
|
|
71
|
-
size: "14"
|
|
72
|
-
}, null, 8, ["name"]),
|
|
73
|
-
createElementVNode("span", null, toDisplayString(expand.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)
|
|
74
|
-
])
|
|
75
|
-
])
|
|
76
|
-
]),
|
|
77
|
-
withDirectives(createElementVNode("div", _hoisted_5, [
|
|
78
|
-
renderSlot(_ctx.$slots, "default")
|
|
79
|
-
], 512), [
|
|
80
|
-
[vShow, expand.value]
|
|
81
|
-
]),
|
|
82
|
-
renderSlot(_ctx.$slots, "active", { active: expand.value })
|
|
83
|
-
]);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse.vue"]]);
|
|
88
|
-
|
|
89
|
-
export { Collapse as default };
|
|
90
2
|
//# sourceMappingURL=collapse.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"collapse.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,90 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, openBlock, createElementBlock, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withDirectives, vShow } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import HzztIcon from '../../icon/src/index.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
1
6
|
|
|
7
|
+
const _hoisted_1 = { class: "hzzt-collapse flex column" };
|
|
8
|
+
const _hoisted_2 = { class: "hzzt-collapse__top" };
|
|
9
|
+
const _hoisted_3 = { class: "hzzt-collapse__title" };
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "hzzt-collapse__line"
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_5 = { class: "hzzt-collapse__content flex-1" };
|
|
15
|
+
const __default__ = defineComponent({
|
|
16
|
+
name: "HzztCollapse"
|
|
17
|
+
});
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
+
...__default__,
|
|
20
|
+
props: {
|
|
21
|
+
defaultActive: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
showLine: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
32
|
+
},
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["update:modelValue"],
|
|
39
|
+
setup(__props, { emit }) {
|
|
40
|
+
const props = __props;
|
|
41
|
+
const { t } = useLocale();
|
|
42
|
+
const expand = ref(props.modelValue);
|
|
43
|
+
if (!props.defaultActive) {
|
|
44
|
+
emit("update:modelValue", false);
|
|
45
|
+
expand.value = false;
|
|
46
|
+
}
|
|
47
|
+
watch(() => props.modelValue, (v) => {
|
|
48
|
+
expand.value = v;
|
|
49
|
+
});
|
|
50
|
+
function toggle() {
|
|
51
|
+
expand.value = !expand.value;
|
|
52
|
+
emit("update:modelValue", expand.value);
|
|
53
|
+
}
|
|
54
|
+
return (_ctx, _cache) => {
|
|
55
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
|
+
createElementVNode("div", _hoisted_2, [
|
|
57
|
+
createElementVNode("div", _hoisted_3, [
|
|
58
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
59
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
60
|
+
])
|
|
61
|
+
]),
|
|
62
|
+
__props.showLine ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true),
|
|
63
|
+
renderSlot(_ctx.$slots, "toggle-btn", {}, () => [
|
|
64
|
+
createElementVNode("div", {
|
|
65
|
+
class: "hzzt-collapse__btn",
|
|
66
|
+
onClick: toggle
|
|
67
|
+
}, [
|
|
68
|
+
createVNode(HzztIcon, {
|
|
69
|
+
name: !expand.value ? "hzzt-plus-square-outline" : "hzzt-minus-square-outline",
|
|
70
|
+
class: "hzzt-collapse__icon",
|
|
71
|
+
size: "14"
|
|
72
|
+
}, null, 8, ["name"]),
|
|
73
|
+
createElementVNode("span", null, toDisplayString(expand.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)
|
|
74
|
+
])
|
|
75
|
+
])
|
|
76
|
+
]),
|
|
77
|
+
withDirectives(createElementVNode("div", _hoisted_5, [
|
|
78
|
+
renderSlot(_ctx.$slots, "default")
|
|
79
|
+
], 512), [
|
|
80
|
+
[vShow, expand.value]
|
|
81
|
+
]),
|
|
82
|
+
renderSlot(_ctx.$slots, "active", { active: expand.value })
|
|
83
|
+
]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse.vue"]]);
|
|
88
|
+
|
|
89
|
+
export { Collapse as default };
|
|
2
90
|
//# sourceMappingURL=collapse2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"collapse2.mjs","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":[],"mappings":";;;;;;;;;;;;;;mCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAI,SAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAAS,GAAI,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,IAAA,KAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|