hzzt-plus 2.0.3 → 2.0.5
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/attributes.json +1 -1
- package/dist/index.full.js +13 -4
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +13 -4
- 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 +122 -36
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +36 -122
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +88 -0
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +0 -88
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/input-range/index.mjs +2 -2
- package/es/components/input-range/src/input-range.mjs +76 -26
- package/es/components/input-range/src/input-range.mjs.map +1 -1
- package/es/components/input-range/src/input-range2.mjs +26 -76
- 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 +80 -22
- package/es/components/lazy-list/src/lazy-list.mjs.map +1 -1
- package/es/components/lazy-list/src/lazy-list2.mjs +22 -80
- package/es/components/lazy-list/src/lazy-list2.mjs.map +1 -1
- package/es/components/scroll/index.mjs +2 -2
- package/es/components/scroll/src/scroll.mjs +0 -90
- package/es/components/scroll/src/scroll.mjs.map +1 -1
- package/es/components/scroll/src/scroll2.mjs +90 -0
- package/es/components/scroll/src/scroll2.mjs.map +1 -1
- package/es/components/select/src/select.d.ts +1 -0
- package/es/components/select/src/select.mjs +4 -0
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +4 -0
- package/es/components/select/src/select2.mjs +8 -3
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/index.mjs +3 -3
- 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 +121 -36
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +36 -121
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +91 -0
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +0 -91
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/input-range/index.js +2 -2
- package/lib/components/input-range/src/input-range.js +76 -27
- package/lib/components/input-range/src/input-range.js.map +1 -1
- package/lib/components/input-range/src/input-range2.js +27 -76
- 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 +80 -23
- package/lib/components/lazy-list/src/lazy-list.js.map +1 -1
- package/lib/components/lazy-list/src/lazy-list2.js +23 -80
- package/lib/components/lazy-list/src/lazy-list2.js.map +1 -1
- package/lib/components/scroll/index.js +2 -2
- package/lib/components/scroll/src/scroll.js +0 -93
- package/lib/components/scroll/src/scroll.js.map +1 -1
- package/lib/components/scroll/src/scroll2.js +93 -0
- package/lib/components/scroll/src/scroll2.js.map +1 -1
- package/lib/components/select/src/select.d.ts +1 -0
- package/lib/components/select/src/select.js +4 -0
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +4 -0
- package/lib/components/select/src/select2.js +7 -2
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/index.js +3 -3
- 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/tags.json +1 -1
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.5 */
|
|
2
2
|
|
|
3
3
|
import { getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, readonly, shallowRef, watchEffect, watch, ref, computed, defineComponent, openBlock, createElementBlock, createElementVNode, warn, isRef, inject, provide, renderSlot, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeClass, normalizeStyle, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, toRaw, vModelCheckbox, createTextVNode, 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 = "2.0.
|
|
12964
|
+
const version$1 = "2.0.5";
|
|
12965
12965
|
|
|
12966
12966
|
const makeInstaller = (components = []) => {
|
|
12967
12967
|
const install = (app, options) => {
|
|
@@ -27806,6 +27806,10 @@ const selectProps = buildProps$1({
|
|
|
27806
27806
|
type: Boolean,
|
|
27807
27807
|
default: true
|
|
27808
27808
|
},
|
|
27809
|
+
autoPullDown: {
|
|
27810
|
+
type: Boolean,
|
|
27811
|
+
default: true
|
|
27812
|
+
},
|
|
27809
27813
|
placeholder: String,
|
|
27810
27814
|
size: useSizeProp$1
|
|
27811
27815
|
});
|
|
@@ -27900,7 +27904,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
27900
27904
|
emit("change", str);
|
|
27901
27905
|
}
|
|
27902
27906
|
function focus() {
|
|
27903
|
-
if (selectRef.value) {
|
|
27907
|
+
if (selectRef.value && props.autoPullDown) {
|
|
27904
27908
|
setTimeout(() => {
|
|
27905
27909
|
selectRef.value.dropdownMenuVisible = true;
|
|
27906
27910
|
}, 200);
|
|
@@ -27995,7 +27999,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
27995
27999
|
}, unref(_selectProps), {
|
|
27996
28000
|
onChange: selectChange,
|
|
27997
28001
|
onVisibleChange: selectVisibleChange
|
|
27998
|
-
}),
|
|
28002
|
+
}), {
|
|
28003
|
+
default: withCtx(({ item }) => [
|
|
28004
|
+
renderSlot(_ctx.$slots, "default", { item })
|
|
28005
|
+
]),
|
|
28006
|
+
_: 3
|
|
28007
|
+
}, 16, ["class", "modelValue"])) : createCommentVNode("v-if", true)
|
|
27999
28008
|
], 6);
|
|
28000
28009
|
};
|
|
28001
28010
|
}
|
package/dist/locale/en.js
CHANGED
package/dist/locale/en.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.5 */(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
|
package/dist/locale/en.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.5 */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
|
package/dist/locale/en.mjs
CHANGED
package/dist/locale/zh-cn.js
CHANGED
package/dist/locale/zh-cn.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.5 */(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 v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.5 */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
|
package/dist/locale/zh-cn.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Cascader from './src/
|
|
3
|
-
export { cascaderEmits, cascaderProps } from './src/
|
|
2
|
+
import Cascader from './src/cascader.mjs';
|
|
3
|
+
export { cascaderEmits, cascaderProps } from './src/cascader2.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztCascader = withInstall(Cascader);
|
|
@@ -1,42 +1,128 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, useAttrs, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { cascaderProps, cascaderEmits } from './cascader2.mjs';
|
|
3
|
+
import { useFormSize, useFormDisabled, ElInput, ElCascader } from 'element-plus';
|
|
2
4
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import '../../../utils/index.mjs';
|
|
6
|
+
import { getCascaderId } from './hooks/utils.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
|
|
10
|
+
import { isArray } from '@vue/shared';
|
|
8
11
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: "HzztCascader"
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: cascaderProps,
|
|
18
|
+
emits: cascaderEmits,
|
|
19
|
+
setup(__props, { emit }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const attrs = useAttrs();
|
|
22
|
+
const inputVal = ref(props.modelValue);
|
|
23
|
+
const cascaderVal = ref();
|
|
24
|
+
const inputRef = ref();
|
|
25
|
+
const cascaderRef = ref();
|
|
26
|
+
const nsCascader = useNamespace("cascader");
|
|
27
|
+
const formSize = useFormSize();
|
|
28
|
+
const formDisabled = useFormDisabled();
|
|
29
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
30
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
31
|
+
const containerCls = computed(() => [
|
|
32
|
+
"relative",
|
|
33
|
+
nsCascader.b(),
|
|
34
|
+
nsCascader.m(trueSize.value)
|
|
35
|
+
]);
|
|
36
|
+
const inputCls = computed(() => [
|
|
37
|
+
nsCascader.e("input")
|
|
38
|
+
]);
|
|
39
|
+
const cascaderCls = computed(() => [
|
|
40
|
+
nsCascader.e("cascader")
|
|
41
|
+
]);
|
|
42
|
+
const _inputProps = computed(() => ({
|
|
43
|
+
disabled: trueDisabled.value,
|
|
44
|
+
size: trueSize.value,
|
|
45
|
+
clearable: props.clearable,
|
|
46
|
+
placeholder: props.placeholder,
|
|
47
|
+
readonly: props.readonly,
|
|
48
|
+
...attrs
|
|
49
|
+
}));
|
|
50
|
+
const _cascaderProps = computed(() => ({
|
|
51
|
+
options: props.options,
|
|
52
|
+
disabled: trueDisabled.value,
|
|
53
|
+
size: trueSize.value,
|
|
54
|
+
clearable: props.clearable,
|
|
55
|
+
placeholder: props.placeholder,
|
|
56
|
+
props: { checkStrictly: true, expandTrigger: "hover" },
|
|
57
|
+
filterable: true,
|
|
58
|
+
separator: "/",
|
|
59
|
+
showAllLevels: true,
|
|
60
|
+
...props.cascaderProps
|
|
61
|
+
}));
|
|
62
|
+
watch(() => props.modelValue, (v) => {
|
|
63
|
+
inputVal.value = v;
|
|
64
|
+
getCascaderVal();
|
|
65
|
+
});
|
|
66
|
+
watch(() => props.options, (v) => {
|
|
67
|
+
if (!v)
|
|
68
|
+
return;
|
|
69
|
+
getCascaderVal();
|
|
70
|
+
});
|
|
71
|
+
getCascaderVal();
|
|
72
|
+
function input(str) {
|
|
73
|
+
emit("update:modelValue", str);
|
|
74
|
+
emit("input", str);
|
|
75
|
+
}
|
|
76
|
+
function change(str) {
|
|
77
|
+
emit("change", str);
|
|
78
|
+
}
|
|
79
|
+
function click(e) {
|
|
80
|
+
cascaderRef.value.togglePopperVisible();
|
|
81
|
+
const target = e.target;
|
|
82
|
+
target.focus();
|
|
83
|
+
}
|
|
84
|
+
function cascaderChange(val) {
|
|
85
|
+
const separator = _cascaderProps.value.separator || "/";
|
|
86
|
+
inputVal.value = val ? isArray(val) ? val.join(separator) : [val].join(separator) : "";
|
|
87
|
+
input(inputVal.value);
|
|
88
|
+
change(inputVal.value);
|
|
89
|
+
}
|
|
90
|
+
function getCascaderVal() {
|
|
91
|
+
const separator = _cascaderProps.value.separator || "/";
|
|
92
|
+
if (_cascaderProps.value.showAllLevels === false) {
|
|
93
|
+
const list = getCascaderId(props.modelValue, props.options);
|
|
94
|
+
cascaderVal.value = list.join(separator);
|
|
95
|
+
} else {
|
|
96
|
+
cascaderVal.value = (props.modelValue || "").split(separator);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return (_ctx, _cache) => {
|
|
100
|
+
return openBlock(), createElementBlock("div", {
|
|
101
|
+
class: normalizeClass(unref(containerCls))
|
|
102
|
+
}, [
|
|
103
|
+
createVNode(unref(ElInput), mergeProps({
|
|
104
|
+
class: unref(inputCls),
|
|
105
|
+
modelValue: inputVal.value,
|
|
106
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event),
|
|
107
|
+
ref_key: "inputRef",
|
|
108
|
+
ref: inputRef
|
|
109
|
+
}, unref(_inputProps), {
|
|
110
|
+
onInput: input,
|
|
111
|
+
onClick: click,
|
|
112
|
+
onChange: change
|
|
113
|
+
}), null, 16, ["class", "modelValue"]),
|
|
114
|
+
createVNode(unref(ElCascader), mergeProps({
|
|
115
|
+
class: unref(cascaderCls),
|
|
116
|
+
modelValue: cascaderVal.value,
|
|
117
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cascaderVal.value = $event),
|
|
118
|
+
ref_key: "cascaderRef",
|
|
119
|
+
ref: cascaderRef
|
|
120
|
+
}, unref(_cascaderProps), { onChange: cascaderChange }), null, 16, ["class", "modelValue"])
|
|
121
|
+
], 2);
|
|
122
|
+
};
|
|
33
123
|
}
|
|
34
124
|
});
|
|
35
|
-
|
|
36
|
-
[UPDATE_MODEL_EVENT]: (value) => isString(value),
|
|
37
|
-
input: (value) => isString(value),
|
|
38
|
-
change: (value) => isString(value)
|
|
39
|
-
};
|
|
125
|
+
var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "cascader.vue"]]);
|
|
40
126
|
|
|
41
|
-
export {
|
|
127
|
+
export { Cascader as default };
|
|
42
128
|
//# sourceMappingURL=cascader.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader.mjs","sources":["../../../../../../packages/components/cascader/src/cascader.
|
|
1
|
+
{"version":3,"file":"cascader.mjs","sources":["../../../../../../packages/components/cascader/src/cascader.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <el-input\n :class=\"inputCls\"\n v-model=\"inputVal\"\n ref=\"inputRef\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @click=\"click\"\n @change=\"change\"\n >\n </el-input>\n <el-cascader :class=\"cascaderCls\" v-model=\"cascaderVal\" ref=\"cascaderRef\" v-bind=\"_cascaderProps\"\n @change=\"cascaderChange\">\n </el-cascader>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {cascaderEmits, cascaderProps} from './cascader'\n import {computed, ref, useAttrs, watch} from \"vue\";\n import {CascaderProps, useFormDisabled, useFormSize, CascaderValue} from \"element-plus\";\n import {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\n import {isArray} from '@hzzt-plus/utils'\n import {ElInput, ElCascader} from 'element-plus'\n import {getCascaderId} from \"./hooks/utils\";\n\n defineOptions({\n name: 'HzztCascader',\n })\n\n const props = defineProps(cascaderProps)\n const emit = defineEmits(cascaderEmits)\n\n const attrs = useAttrs();\n\n const inputVal = ref(props.modelValue);\n const cascaderVal = ref();\n const inputRef = ref();\n const cascaderRef = ref();\n\n const nsCascader = useNamespace('cascader');\n\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 'relative',\n nsCascader.b(),\n nsCascader.m(trueSize.value),\n ])\n\n const inputCls = computed(() => [\n nsCascader.e('input'),\n ])\n\n const cascaderCls = computed(() => [\n nsCascader.e('cascader'),\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n size: trueSize.value,\n clearable: props.clearable,\n placeholder: props.placeholder,\n readonly: props.readonly,\n ...attrs,\n }))\n\n const _cascaderProps = computed(() => ({\n options: props.options,\n disabled: trueDisabled.value,\n size: trueSize.value,\n clearable: props.clearable,\n placeholder: props.placeholder,\n props: {checkStrictly: true, expandTrigger: 'hover'} as CascaderProps,\n filterable: true,\n separator: '/',\n showAllLevels: true,\n ...props.cascaderProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n getCascaderVal();\n })\n\n watch(() => props.options, (v) => {\n if (!v) return;\n getCascaderVal();\n })\n\n getCascaderVal();\n\n function input(str: string) {\n emit('update:modelValue', str)\n emit('input', str)\n }\n\n function change(str: string) {\n emit('change', str)\n }\n\n function click(e: MouseEvent) {\n cascaderRef.value.togglePopperVisible();\n const target = e.target as HTMLInputElement;\n target.focus();\n }\n\n function cascaderChange(val: CascaderValue) {\n const separator = _cascaderProps.value.separator || '/';\n inputVal.value = val ? isArray(val) ? val.join(separator) : [val].join(separator) : '';\n input(inputVal.value);\n change(inputVal.value);\n }\n\n function getCascaderVal() {\n const separator = _cascaderProps.value.separator || '/';\n if (_cascaderProps.value.showAllLevels === false) {\n const list = getCascaderId(props.modelValue, props.options);\n cascaderVal.value = list.join(separator);\n } else {\n cascaderVal.value = (props.modelValue || '').split(separator);\n }\n }\n\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;mCA2BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACrC,IAAA,MAAM,cAAc,GAAI,EAAA,CAAA;AACxB,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AACrB,IAAA,MAAM,cAAc,GAAI,EAAA,CAAA;AAExB,IAAM,MAAA,UAAA,GAAa,aAAa,UAAU,CAAA,CAAA;AAE1C,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,UAAA,CAAA,CAAA,EAAA;AAA8B,MAClC,UAAA,CAAA,CAAA,CAAA,QAAA,CAAA,KAAA,CAAA;AAAA,KAAA,CACA;AAAa,IACb,MAAA,QAAa,GAAA,QAAc,CAAA,MAAA;AAAA,MAC5B,UAAA,CAAA,CAAA,CAAA,OAAA,CAAA;AAED,KAAM,CAAA,CAAA;AAA0B,IAC9B,MAAA,WAAoB,GAAA,QAAA,CAAA,MAAA;AAAA,MACrB,UAAA,CAAA,CAAA,CAAA,UAAA,CAAA;AAED,KAAM,CAAA,CAAA;AAA6B,IACjC,MAAA,WAAuB,GAAA,QAAA,CAAA,OAAA;AAAA,MACxB,QAAA,EAAA,YAAA,CAAA,KAAA;AAED,MAAM,IAAA,EAAA,QAAA,CAAA;AAA8B,MAClC,WAAuB,KAAA,CAAA,SAAA;AAAA,MACvB,WAAe,EAAA,KAAA,CAAA,WAAA;AAAA,MACf,eAAiB,CAAA,QAAA;AAAA,MACjB;AAAmB,KAAA,CACnB;AAAgB,IAAA,MACb,cAAA,GAAA,QAAA,CAAA,OAAA;AAAA,MACH,OAAA,EAAA,KAAA,CAAA,OAAA;AAEF,MAAM,QAAA,EAAA;AAAiC,MACrC,cAAe,CAAA,KAAA;AAAA,MACf,WAAuB,KAAA,CAAA,SAAA;AAAA,MACvB,WAAe,EAAA,KAAA,CAAA,WAAA;AAAA,MACf,sBAAiB,EAAA,IAAA,EAAA,aAAA,EAAA,OAAA,EAAA;AAAA,MACjB,gBAAmB;AAAA,MACnB,SAAQ,EAAe,GAAA;AAA4B,MACnD,aAAY,EAAA,IAAA;AAAA,MACZ,GAAW,KAAA,CAAA,aAAA;AAAA,KAAA,CACX,CAAe,CAAA;AAAA,IAAA,KACZ,CAAM,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACT,QAAA,CAAA,KAAA,GAAA,CAAA,CAAA;AAEF,MAAA,cAAY,EAAM,CAAY;AAC5B,KAAA,CAAA,CAAA;AACA,IAAe,KAAA,CAAA,MAAA,KAAA,CAAA,OAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MAChB,IAAA,CAAA,CAAA;AAED,QAAA,OAAY;AACV,MAAA,cAAK,EAAA,CAAA;AAAG,KAAA,CAAA,CAAA;AACR,IAAe,cAAA,EAAA,CAAA;AAAA,IACjB,SAAC,KAAA,CAAA,GAAA,EAAA;AAED,MAAe,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAEf,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,gBAAc,GAAG,EAAA;AAAA,MACnB,IAAA,CAAA,QAAA,EAAA,GAAA,CAAA,CAAA;AAEA,KAAA;AACE,IAAA,kBAAkB;AAAA,MACpB,WAAA,CAAA,KAAA,CAAA,mBAAA,EAAA,CAAA;AAEA,MAAA,MAAA,SAA8B,CAAA,CAAA,MAAA,CAAA;AAC5B,MAAA,MAAA,CAAA,KAAY;AACZ,KAAA;AACA,IAAA,SAAO,cAAM,CAAA,GAAA,EAAA;AAAA,MACf,MAAA,SAAA,GAAA,cAAA,CAAA,KAAA,CAAA,SAAA,IAAA,GAAA,CAAA;AAEA,MAAA,uBAA4C,OAAA,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA,SAAA,CAAA,GAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,GAAA,EAAA,CAAA;AAC1C,MAAM,KAAA,CAAA,QAAA,CAAA,KAA2B,CAAA,CAAA;AACjC,MAAA,MAAA,CAAA,QAAiB,CAAA,KAAA,CAAA,CAAM;AACvB,KAAA;AACA,IAAA,SAAO,cAAc,GAAA;AAAA,MACvB,MAAA,SAAA,GAAA,cAAA,CAAA,KAAA,CAAA,SAAA,IAAA,GAAA,CAAA;AAEA,MAAA,IAAA,cAA0B,CAAA,KAAA,CAAA,aAAA,KAAA,KAAA,EAAA;AACxB,QAAM,MAAA,IAAA,GAAA,aAA2B,CAAA,KAAA,CAAA,UAAmB,EAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AACpD,QAAI,WAAA,CAAA,KAAe,GAAM,IAAA,CAAA,IAAA,CAAA,SAAA,CAAA,CAAkB;AACzC,OAAA,MAAA;AACA,QAAY,WAAA,CAAA,KAAA,GAAQ,CAAK,KAAA,CAAA,UAAc,IAAA,EAAA,EAAA,KAAA,CAAA,SAAA,CAAA,CAAA;AAAA,OAClC;AACL,KAAA;AAA4D,IAC9D,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACF,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,128 +1,42 @@
|
|
|
1
|
-
import { defineComponent, useAttrs, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createVNode, mergeProps } from 'vue';
|
|
2
|
-
import { cascaderProps, cascaderEmits } from './cascader.mjs';
|
|
3
|
-
import { useFormSize, useFormDisabled, ElInput, ElCascader } from 'element-plus';
|
|
4
|
-
import '../../../hooks/index.mjs';
|
|
5
1
|
import '../../../utils/index.mjs';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
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';
|
|
11
8
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const inputCls = computed(() => [
|
|
37
|
-
nsCascader.e("input")
|
|
38
|
-
]);
|
|
39
|
-
const cascaderCls = computed(() => [
|
|
40
|
-
nsCascader.e("cascader")
|
|
41
|
-
]);
|
|
42
|
-
const _inputProps = computed(() => ({
|
|
43
|
-
disabled: trueDisabled.value,
|
|
44
|
-
size: trueSize.value,
|
|
45
|
-
clearable: props.clearable,
|
|
46
|
-
placeholder: props.placeholder,
|
|
47
|
-
readonly: props.readonly,
|
|
48
|
-
...attrs
|
|
49
|
-
}));
|
|
50
|
-
const _cascaderProps = computed(() => ({
|
|
51
|
-
options: props.options,
|
|
52
|
-
disabled: trueDisabled.value,
|
|
53
|
-
size: trueSize.value,
|
|
54
|
-
clearable: props.clearable,
|
|
55
|
-
placeholder: props.placeholder,
|
|
56
|
-
props: { checkStrictly: true, expandTrigger: "hover" },
|
|
57
|
-
filterable: true,
|
|
58
|
-
separator: "/",
|
|
59
|
-
showAllLevels: true,
|
|
60
|
-
...props.cascaderProps
|
|
61
|
-
}));
|
|
62
|
-
watch(() => props.modelValue, (v) => {
|
|
63
|
-
inputVal.value = v;
|
|
64
|
-
getCascaderVal();
|
|
65
|
-
});
|
|
66
|
-
watch(() => props.options, (v) => {
|
|
67
|
-
if (!v)
|
|
68
|
-
return;
|
|
69
|
-
getCascaderVal();
|
|
70
|
-
});
|
|
71
|
-
getCascaderVal();
|
|
72
|
-
function input(str) {
|
|
73
|
-
emit("update:modelValue", str);
|
|
74
|
-
emit("input", str);
|
|
75
|
-
}
|
|
76
|
-
function change(str) {
|
|
77
|
-
emit("change", str);
|
|
78
|
-
}
|
|
79
|
-
function click(e) {
|
|
80
|
-
cascaderRef.value.togglePopperVisible();
|
|
81
|
-
const target = e.target;
|
|
82
|
-
target.focus();
|
|
83
|
-
}
|
|
84
|
-
function cascaderChange(val) {
|
|
85
|
-
const separator = _cascaderProps.value.separator || "/";
|
|
86
|
-
inputVal.value = val ? isArray(val) ? val.join(separator) : [val].join(separator) : "";
|
|
87
|
-
input(inputVal.value);
|
|
88
|
-
change(inputVal.value);
|
|
89
|
-
}
|
|
90
|
-
function getCascaderVal() {
|
|
91
|
-
const separator = _cascaderProps.value.separator || "/";
|
|
92
|
-
if (_cascaderProps.value.showAllLevels === false) {
|
|
93
|
-
const list = getCascaderId(props.modelValue, props.options);
|
|
94
|
-
cascaderVal.value = list.join(separator);
|
|
95
|
-
} else {
|
|
96
|
-
cascaderVal.value = (props.modelValue || "").split(separator);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return (_ctx, _cache) => {
|
|
100
|
-
return openBlock(), createElementBlock("div", {
|
|
101
|
-
class: normalizeClass(unref(containerCls))
|
|
102
|
-
}, [
|
|
103
|
-
createVNode(unref(ElInput), mergeProps({
|
|
104
|
-
class: unref(inputCls),
|
|
105
|
-
modelValue: inputVal.value,
|
|
106
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event),
|
|
107
|
-
ref_key: "inputRef",
|
|
108
|
-
ref: inputRef
|
|
109
|
-
}, unref(_inputProps), {
|
|
110
|
-
onInput: input,
|
|
111
|
-
onClick: click,
|
|
112
|
-
onChange: change
|
|
113
|
-
}), null, 16, ["class", "modelValue"]),
|
|
114
|
-
createVNode(unref(ElCascader), mergeProps({
|
|
115
|
-
class: unref(cascaderCls),
|
|
116
|
-
modelValue: cascaderVal.value,
|
|
117
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cascaderVal.value = $event),
|
|
118
|
-
ref_key: "cascaderRef",
|
|
119
|
-
ref: cascaderRef
|
|
120
|
-
}, unref(_cascaderProps), { onChange: cascaderChange }), null, 16, ["class", "modelValue"])
|
|
121
|
-
], 2);
|
|
122
|
-
};
|
|
9
|
+
const cascaderProps = buildProps({
|
|
10
|
+
cascaderProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({
|
|
13
|
+
showAllLevels: true
|
|
14
|
+
})
|
|
15
|
+
},
|
|
16
|
+
disabled: Boolean,
|
|
17
|
+
readonly: Boolean,
|
|
18
|
+
clearable: Boolean,
|
|
19
|
+
size: useSizeProp,
|
|
20
|
+
options: {
|
|
21
|
+
type: definePropType(Array),
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: definePropType([
|
|
30
|
+
String
|
|
31
|
+
]),
|
|
32
|
+
default: ""
|
|
123
33
|
}
|
|
124
34
|
});
|
|
125
|
-
|
|
35
|
+
const cascaderEmits = {
|
|
36
|
+
[UPDATE_MODEL_EVENT]: (value) => isString(value),
|
|
37
|
+
input: (value) => isString(value),
|
|
38
|
+
change: (value) => isString(value)
|
|
39
|
+
};
|
|
126
40
|
|
|
127
|
-
export {
|
|
41
|
+
export { cascaderEmits, cascaderProps };
|
|
128
42
|
//# sourceMappingURL=cascader2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader2.mjs","sources":["../../../../../../packages/components/cascader/src/cascader.
|
|
1
|
+
{"version":3,"file":"cascader2.mjs","sources":["../../../../../../packages/components/cascader/src/cascader.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\nimport type {ExtractPropTypes} from 'vue'\nimport type Cascader from './cascader.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport type CascaderNodeValue = string | number\n\nexport interface CascaderOption extends Record<string, unknown> {\n label?: string\n value?: CascaderNodeValue\n children?: CascaderOption[]\n disabled?: boolean\n leaf?: boolean\n}\n\nexport const cascaderProps = buildProps({\n cascaderProps: {\n type: Object,\n default: () => ({\n showAllLevels: true,\n }),\n },\n disabled: Boolean,\n readonly: Boolean,\n clearable: Boolean,\n size: useSizeProp,\n options: {\n type: definePropType<CascaderOption[]>(Array),\n default: () => [] as CascaderOption[],\n },\n placeholder: {\n type: String,\n default: '',\n },\n modelValue: {\n type: definePropType<string | undefined>([\n String,\n ]),\n default: '',\n },\n})\n\nexport type CascaderProps = ExtractPropTypes<typeof cascaderProps>\n\nexport const cascaderEmits = {\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 CascaderEmits = typeof cascaderEmits\n\n\nexport type CascaderInstance = InstanceType<typeof Cascader>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,MAAM,aAAa,EAAE,IAAI;AACzB,KAAK,CAAC;AACN,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,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/collapse.mjs';
|
|
3
|
+
import './src/collapse2.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztCollapse = withInstall(Collapse);
|
|
@@ -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=collapse.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"collapse.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|