hzzt-plus 0.0.8 → 1.0.0
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.css +1 -1
- package/dist/index.full.js +438 -246
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +433 -248
- package/es/component.mjs +3 -1
- package/es/component.mjs.map +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +3 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/scan/index.d.ts +5 -0
- package/es/components/scan/index.mjs +9 -0
- package/es/components/scan/index.mjs.map +1 -0
- package/es/components/scan/src/scan.d.ts +15 -0
- package/es/components/scan/src/scan.mjs +28 -0
- package/es/components/scan/src/scan.mjs.map +1 -0
- package/es/components/scan/src/scan.vue.d.ts +572 -0
- package/es/components/scan/src/scan2.mjs +149 -0
- package/es/components/scan/src/scan2.mjs.map +1 -0
- package/es/components/scan/style/css.d.ts +2 -0
- package/es/components/scan/style/css.mjs +3 -0
- package/es/components/scan/style/css.mjs.map +1 -0
- package/es/components/scan/style/index.d.ts +2 -0
- package/es/components/scan/style/index.mjs +3 -0
- package/es/components/scan/style/index.mjs.map +1 -0
- package/es/components/tab/index.d.ts +161 -3
- package/es/components/tab/src/index.mjs +19 -4
- package/es/components/tab/src/index.mjs.map +1 -1
- package/es/components/tab/src/index.vue.d.ts +162 -3
- package/es/components/title/index.d.ts +4 -29
- package/es/components/title/index.mjs +2 -1
- package/es/components/title/index.mjs.map +1 -1
- package/es/components/title/src/title.d.ts +8 -0
- package/es/components/title/src/title.mjs +8 -43
- package/es/components/title/src/title.mjs.map +1 -1
- package/es/components/title/src/title.vue.d.ts +7 -16
- package/es/components/title/src/title2.mjs +44 -0
- package/es/components/title/src/title2.mjs.map +1 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.mjs +1 -0
- package/es/constants/index.mjs.map +1 -1
- package/es/index.mjs +4 -0
- package/es/index.mjs.map +1 -1
- package/global.d.ts +1 -0
- package/lib/component.js +3 -1
- package/lib/component.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +7 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/scan/index.d.ts +5 -0
- package/lib/components/scan/index.js +16 -0
- package/lib/components/scan/index.js.map +1 -0
- package/lib/components/scan/src/scan.d.ts +15 -0
- package/lib/components/scan/src/scan.js +33 -0
- package/lib/components/scan/src/scan.js.map +1 -0
- package/lib/components/scan/src/scan.vue.d.ts +572 -0
- package/lib/components/scan/src/scan2.js +153 -0
- package/lib/components/scan/src/scan2.js.map +1 -0
- package/lib/components/scan/style/css.d.ts +2 -0
- package/lib/components/scan/style/css.js +6 -0
- package/lib/components/scan/style/css.js.map +1 -0
- package/lib/components/scan/style/index.d.ts +2 -0
- package/lib/components/scan/style/index.js +6 -0
- package/lib/components/scan/style/index.js.map +1 -0
- package/lib/components/tab/index.d.ts +161 -3
- package/lib/components/tab/src/index.js +18 -3
- package/lib/components/tab/src/index.js.map +1 -1
- package/lib/components/tab/src/index.vue.d.ts +162 -3
- package/lib/components/title/index.d.ts +4 -29
- package/lib/components/title/index.js +3 -1
- package/lib/components/title/index.js.map +1 -1
- package/lib/components/title/src/title.d.ts +8 -0
- package/lib/components/title/src/title.js +8 -43
- package/lib/components/title/src/title.js.map +1 -1
- package/lib/components/title/src/title.vue.d.ts +7 -16
- package/lib/components/title/src/title2.js +48 -0
- package/lib/components/title/src/title2.js.map +1 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +4 -0
- package/lib/constants/index.js.map +1 -1
- package/lib/index.js +37 -26
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/theme/hzzt-collapse.css +1 -1
- package/theme/hzzt-scan.css +1 -0
- package/theme/hzzt-tab.css +1 -1
- package/theme/index.css +1 -1
- package/theme/src/collapse.scss +1 -0
- package/theme/src/index.scss +1 -0
- package/theme/src/scan.scss +80 -0
- package/theme/src/tab.scss +24 -6
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { createElementVNode, defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, toDisplayString } from 'vue';
|
|
2
|
+
import { ElInput } from 'element-plus';
|
|
3
|
+
import { scanProps, scanEmits } from './scan.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
|
|
6
|
+
const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { style: { "width": "0", "height": "0", "overflow": "hidden" } }, [
|
|
7
|
+
/* @__PURE__ */ createElementVNode("input", {
|
|
8
|
+
readonly: "",
|
|
9
|
+
style: { "width": "0", "height": "0", "overflow": "hidden" }
|
|
10
|
+
}),
|
|
11
|
+
/* @__PURE__ */ createElementVNode("input", {
|
|
12
|
+
readonly: "",
|
|
13
|
+
type: "password",
|
|
14
|
+
autocomplete: "off",
|
|
15
|
+
style: { "width": "0", "height": "0", "overflow": "hidden" }
|
|
16
|
+
})
|
|
17
|
+
], -1);
|
|
18
|
+
const _hoisted_2 = {
|
|
19
|
+
class: "width-100%",
|
|
20
|
+
style: { "overflow": "hidden" }
|
|
21
|
+
};
|
|
22
|
+
const __default__ = defineComponent({
|
|
23
|
+
inheritAttrs: false,
|
|
24
|
+
name: "HzztScan"
|
|
25
|
+
});
|
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
|
+
...__default__,
|
|
28
|
+
props: scanProps,
|
|
29
|
+
emits: scanEmits,
|
|
30
|
+
setup(__props, { expose, emit }) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const readonly = ref(true);
|
|
33
|
+
const innerValue = ref(" ");
|
|
34
|
+
const inputRef = ref();
|
|
35
|
+
const showValue = computed(() => {
|
|
36
|
+
if (innerValue.value === " ") {
|
|
37
|
+
return ` ${props.placeholder}`;
|
|
38
|
+
} else {
|
|
39
|
+
return innerValue.value;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const inputType = computed(() => {
|
|
43
|
+
if (innerValue.value && !readonly.value) {
|
|
44
|
+
return "password";
|
|
45
|
+
} else {
|
|
46
|
+
return "text";
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
watch(() => props.modelValue, (v) => {
|
|
50
|
+
if (!v) {
|
|
51
|
+
innerValue.value = " ";
|
|
52
|
+
} else {
|
|
53
|
+
innerValue.value = ` ${changeLetter(v)}`;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
watch(() => innerValue.value, (v) => {
|
|
57
|
+
if (!v) {
|
|
58
|
+
innerValue.value = " ";
|
|
59
|
+
}
|
|
60
|
+
const str = innerValue.value[0] === " " ? innerValue.value.slice(1) : innerValue.value;
|
|
61
|
+
const final = changeLetter(str != null ? str : "");
|
|
62
|
+
emit("update:modelValue", final);
|
|
63
|
+
emit("input", final);
|
|
64
|
+
});
|
|
65
|
+
function changeLetter(v) {
|
|
66
|
+
if (props.letter === "upper") {
|
|
67
|
+
return v.toLocaleUpperCase();
|
|
68
|
+
} else if (props.letter === "lower") {
|
|
69
|
+
return v.toLocaleLowerCase();
|
|
70
|
+
} else {
|
|
71
|
+
return v;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function inputFocus() {
|
|
75
|
+
readonly.value = false;
|
|
76
|
+
}
|
|
77
|
+
function inputBlur() {
|
|
78
|
+
readonly.value = true;
|
|
79
|
+
}
|
|
80
|
+
function inputChange() {
|
|
81
|
+
emit("change", props.modelValue);
|
|
82
|
+
}
|
|
83
|
+
function focus() {
|
|
84
|
+
readonly.value = false;
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
inputRef.value.focus();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function blur() {
|
|
90
|
+
readonly.value = true;
|
|
91
|
+
inputRef.value.blur();
|
|
92
|
+
}
|
|
93
|
+
function clear() {
|
|
94
|
+
inputRef.value.clear();
|
|
95
|
+
}
|
|
96
|
+
expose({
|
|
97
|
+
focus,
|
|
98
|
+
blur,
|
|
99
|
+
clear
|
|
100
|
+
});
|
|
101
|
+
return (_ctx, _cache) => {
|
|
102
|
+
return openBlock(), createElementBlock("div", {
|
|
103
|
+
class: normalizeClass(["hzzt-scan", _ctx.$attrs.class]),
|
|
104
|
+
style: normalizeStyle([{ "position": "relative" }, _ctx.$attrs.style])
|
|
105
|
+
}, [
|
|
106
|
+
_hoisted_1,
|
|
107
|
+
createVNode(unref(ElInput), mergeProps({
|
|
108
|
+
ref_key: "inputRef",
|
|
109
|
+
ref: inputRef,
|
|
110
|
+
modelValue: innerValue.value,
|
|
111
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event)
|
|
112
|
+
}, {
|
|
113
|
+
..._ctx.$attrs,
|
|
114
|
+
class: "",
|
|
115
|
+
style: "",
|
|
116
|
+
onChange: ""
|
|
117
|
+
}, {
|
|
118
|
+
readonly: readonly.value,
|
|
119
|
+
type: unref(inputType),
|
|
120
|
+
class: "hzzt-scan-input-original",
|
|
121
|
+
autocomplete: "off",
|
|
122
|
+
onFocus: inputFocus,
|
|
123
|
+
onBlur: inputBlur,
|
|
124
|
+
onChange: inputChange
|
|
125
|
+
}), createSlots({
|
|
126
|
+
_: 2
|
|
127
|
+
}, [
|
|
128
|
+
renderList(_ctx.$slots, (_, key, index) => {
|
|
129
|
+
return {
|
|
130
|
+
name: key,
|
|
131
|
+
fn: withCtx(() => [
|
|
132
|
+
renderSlot(_ctx.$slots, key)
|
|
133
|
+
])
|
|
134
|
+
};
|
|
135
|
+
})
|
|
136
|
+
]), 1040, ["modelValue", "readonly", "type"]),
|
|
137
|
+
createElementVNode("div", {
|
|
138
|
+
class: normalizeClass(["hzzt-scan-input-backup", { "placeholder-color": innerValue.value === " " }])
|
|
139
|
+
}, [
|
|
140
|
+
createElementVNode("div", _hoisted_2, toDisplayString(unref(showValue)), 1)
|
|
141
|
+
], 2)
|
|
142
|
+
], 6);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
var Scan = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "scan.vue"]]);
|
|
147
|
+
|
|
148
|
+
export { Scan as default };
|
|
149
|
+
//# sourceMappingURL=scan2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan2.mjs","sources":["../../../../../../packages/components/scan/src/scan.vue"],"sourcesContent":["<template>\n <div\n class=\"hzzt-scan\"\n style=\"position: relative\"\n :class=\"$attrs.class\"\n :style=\"$attrs.style\"\n >\n <div style=\"width: 0; height: 0; overflow: hidden\">\n <input readonly style=\"width: 0; height: 0; overflow: hidden\" />\n <input\n readonly\n type=\"password\"\n autocomplete=\"off\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n\n <el-input\n ref=\"inputRef\"\n v-model=\"innerValue\"\n v-bind=\"{\n ...$attrs,\n class: '',\n style: '',\n onChange: '',\n }\"\n :readonly=\"readonly\"\n :type=\"inputType\"\n class=\"hzzt-scan-input-original\"\n autocomplete=\"off\"\n @focus=\"inputFocus\"\n @blur=\"inputBlur\"\n @change=\"inputChange\"\n >\n <template v-for=\"(_, key, index) in $slots\" :key=\"index\" #[key]>\n <slot :name=\"key\" />\n </template>\n </el-input>\n <div\n class=\"hzzt-scan-input-backup\"\n :class=\"{ 'placeholder-color': innerValue === ' ' }\"\n >\n <div class=\"width-100%\" style=\"overflow: hidden\">\n {{ showValue }}\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElInput } from 'element-plus'\nimport { scanEmits, scanProps } from '@hzzt-plus/components/scan/src/scan'\n\ndefineOptions({\n inheritAttrs: false,\n name: 'HzztScan',\n})\n\nconst props = defineProps(scanProps)\n\nconst emit = defineEmits(scanEmits)\n\nconst readonly = ref(true)\nconst innerValue = ref(' ')\nconst inputRef = ref()\n\nconst showValue = computed(() => {\n if (innerValue.value === ' ') {\n return ` ${props.placeholder}`\n } else {\n return innerValue.value\n }\n})\n\nconst inputType = computed(() => {\n if (innerValue.value && !readonly.value) {\n return 'password'\n } else {\n return 'text'\n }\n})\n\nwatch(\n () => props.modelValue,\n (v) => {\n if (!v) {\n innerValue.value = ' '\n } else {\n innerValue.value = ` ${changeLetter(v)}`\n }\n }\n)\n\nwatch(\n () => innerValue.value,\n (v) => {\n if (!v) {\n innerValue.value = ' '\n }\n const str =\n innerValue.value[0] === ' ' ? innerValue.value.slice(1) : innerValue.value\n const final = changeLetter(str ?? '')\n emit('update:modelValue', final)\n emit('input', final)\n }\n)\n\nfunction changeLetter(v: string) {\n if (props.letter === 'upper') {\n return v.toLocaleUpperCase()\n } else if (props.letter === 'lower') {\n return v.toLocaleLowerCase()\n } else {\n return v\n }\n}\n\nfunction inputFocus() {\n readonly.value = false\n}\n\nfunction inputBlur() {\n readonly.value = true\n}\n\nfunction inputChange() {\n emit('change', props.modelValue)\n}\n\nfunction focus() {\n readonly.value = false\n setTimeout(() => {\n inputRef.value.focus()\n })\n}\n\nfunction blur() {\n readonly.value = true\n inputRef.value.blur()\n}\n\nfunction clear() {\n inputRef.value.clear()\n}\n\ndefineExpose({\n focus,\n blur,\n clear,\n})\n</script>\n"],"names":["_defineComponent","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createVNode","_unref","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkDA,EAAS,IAAA,EAAA,UAAA;AACT,CAAA,CAAA,CAAA;AACA,MAAA,4BAAqCA,eAAA,CAAA;;;AAEvB,EACZ,KAAc,EAAA,SAAA;AAAA,EACd,KAAM,CAAA,OAAA,EAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA;AACR,IAAA,MAAA,KAAA,GAAA,OAAA,CAAA;;;;;;;AAMA,OAAM,MAAA;AACN,QAAM,OAAA,gBAAoB,CAAA;A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,CAAA,EAAA,UAAA,EAAA,UAAA,EAAA,EAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA,CAAA;AAEA,OAAA,EAAA;AACE,QAAA;AAAqB,QACvBC,WAAA,CAAAC,KAAA,CAAA,OAAA,CAAA,EAAAC,UAAA,CAAA;AAEA,UAAa,OAAA,EAAA,UAAA;AAAA,UACX,GAAA,EAAA,QAAA;AAAA,UACA,UAAA,EAAA,UAAA,CAAA,KAAA;AAAA,UACA,qBAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,MAAA,KAAA,UAAA,CAAA,KAAA,GAAA,MAAA,CAAA;AAAA,SACD,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -6,6 +6,10 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
|
|
|
6
6
|
modelValue: {
|
|
7
7
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
8
8
|
};
|
|
9
|
+
closable: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: () => boolean;
|
|
12
|
+
};
|
|
9
13
|
}, {
|
|
10
14
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
tabList: {
|
|
@@ -15,11 +19,16 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
|
|
|
15
19
|
modelValue: {
|
|
16
20
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
17
21
|
};
|
|
22
|
+
closable: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: () => boolean;
|
|
25
|
+
};
|
|
18
26
|
}>> & {
|
|
19
27
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
20
28
|
"onTab-click"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
"onTab-close"?: ((...args: any[]) => any) | undefined;
|
|
21
30
|
}>>;
|
|
22
|
-
emit: (event: "update:modelValue" | "tab-click", ...args: any[]) => void;
|
|
31
|
+
emit: (event: "update:modelValue" | "tab-click" | "tab-close", ...args: any[]) => void;
|
|
23
32
|
customTabList: import("vue").ComputedRef<{
|
|
24
33
|
number: number;
|
|
25
34
|
hide: boolean;
|
|
@@ -27,8 +36,151 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
|
|
|
27
36
|
label: string;
|
|
28
37
|
key: string;
|
|
29
38
|
}[]>;
|
|
30
|
-
tabClick: (tab:
|
|
31
|
-
|
|
39
|
+
tabClick: (tab: {
|
|
40
|
+
name: string;
|
|
41
|
+
label: string;
|
|
42
|
+
number: number;
|
|
43
|
+
hide: boolean;
|
|
44
|
+
}, event: Event) => void;
|
|
45
|
+
close: (index: number, event: Event) => void;
|
|
46
|
+
HzztIcon: import("vue").DefineComponent<{
|
|
47
|
+
name: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
type: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
name: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
type: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
67
|
+
}>>;
|
|
68
|
+
attrs: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
componentName: import("vue").ComputedRef<string>;
|
|
72
|
+
ElIcon: import("element-plus/es/utils").SFCWithInstall<{
|
|
73
|
+
new (...args: any[]): {
|
|
74
|
+
$: import("vue").ComponentInternalInstance;
|
|
75
|
+
$data: {};
|
|
76
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
readonly size: {
|
|
78
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
79
|
+
readonly required: false;
|
|
80
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
81
|
+
__epPropKey: true;
|
|
82
|
+
};
|
|
83
|
+
readonly color: {
|
|
84
|
+
readonly type: import("vue").PropType<string>;
|
|
85
|
+
readonly required: false;
|
|
86
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
87
|
+
__epPropKey: true;
|
|
88
|
+
};
|
|
89
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
90
|
+
$attrs: {
|
|
91
|
+
[x: string]: unknown;
|
|
92
|
+
};
|
|
93
|
+
$refs: {
|
|
94
|
+
[x: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
$slots: Readonly<{
|
|
97
|
+
[name: string]: import("vue").Slot | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
100
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
101
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
102
|
+
$el: any;
|
|
103
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
104
|
+
readonly size: {
|
|
105
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
106
|
+
readonly required: false;
|
|
107
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
108
|
+
__epPropKey: true;
|
|
109
|
+
};
|
|
110
|
+
readonly color: {
|
|
111
|
+
readonly type: import("vue").PropType<string>;
|
|
112
|
+
readonly required: false;
|
|
113
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
114
|
+
__epPropKey: true;
|
|
115
|
+
};
|
|
116
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
117
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
118
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
119
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
120
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
121
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
122
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
123
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
124
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
125
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
126
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
127
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
128
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
129
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
130
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
131
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
132
|
+
};
|
|
133
|
+
$forceUpdate: () => void;
|
|
134
|
+
$nextTick: typeof import("vue").nextTick;
|
|
135
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
136
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
|
137
|
+
readonly size: {
|
|
138
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
139
|
+
readonly required: false;
|
|
140
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
141
|
+
__epPropKey: true;
|
|
142
|
+
};
|
|
143
|
+
readonly color: {
|
|
144
|
+
readonly type: import("vue").PropType<string>;
|
|
145
|
+
readonly required: false;
|
|
146
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
147
|
+
__epPropKey: true;
|
|
148
|
+
};
|
|
149
|
+
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
150
|
+
__isFragment?: undefined;
|
|
151
|
+
__isTeleport?: undefined;
|
|
152
|
+
__isSuspense?: undefined;
|
|
153
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
154
|
+
readonly size: {
|
|
155
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
156
|
+
readonly required: false;
|
|
157
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
158
|
+
__epPropKey: true;
|
|
159
|
+
};
|
|
160
|
+
readonly color: {
|
|
161
|
+
readonly type: import("vue").PropType<string>;
|
|
162
|
+
readonly required: false;
|
|
163
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
164
|
+
__epPropKey: true;
|
|
165
|
+
};
|
|
166
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
167
|
+
$slots: {
|
|
168
|
+
default?(_: {}): any;
|
|
169
|
+
};
|
|
170
|
+
})>;
|
|
171
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
172
|
+
name: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
required: true;
|
|
175
|
+
};
|
|
176
|
+
type: {
|
|
177
|
+
type: StringConstructor;
|
|
178
|
+
default: string;
|
|
179
|
+
};
|
|
180
|
+
}>>, {
|
|
181
|
+
type: string;
|
|
182
|
+
}>;
|
|
183
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "tab-click" | "tab-close")[], "update:modelValue" | "tab-click" | "tab-close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
184
|
tabList: {
|
|
33
185
|
type: ArrayConstructor;
|
|
34
186
|
default: () => never[];
|
|
@@ -36,10 +188,16 @@ export declare const HzztTab: import("hzzt-plus/es/utils").SFCWithInstall<import
|
|
|
36
188
|
modelValue: {
|
|
37
189
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
38
190
|
};
|
|
191
|
+
closable: {
|
|
192
|
+
type: BooleanConstructor;
|
|
193
|
+
default: () => boolean;
|
|
194
|
+
};
|
|
39
195
|
}>> & {
|
|
40
196
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
41
197
|
"onTab-click"?: ((...args: any[]) => any) | undefined;
|
|
198
|
+
"onTab-close"?: ((...args: any[]) => any) | undefined;
|
|
42
199
|
}, {
|
|
43
200
|
tabList: unknown[];
|
|
201
|
+
closable: boolean;
|
|
44
202
|
}>> & Record<string, any>;
|
|
45
203
|
export default HzztTab;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, unref, normalizeClass, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, unref, normalizeClass, toDisplayString, createCommentVNode, createBlock, renderSlot } from 'vue';
|
|
2
|
+
import HzztIcon from '../../icon/src/index.mjs';
|
|
2
3
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
4
|
|
|
4
5
|
const _hoisted_1 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
@@ -23,9 +24,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
24
|
},
|
|
24
25
|
modelValue: {
|
|
25
26
|
type: [Number, String, Array]
|
|
27
|
+
},
|
|
28
|
+
closable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: () => false
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
|
-
emits: ["update:modelValue", "tab-click"],
|
|
33
|
+
emits: ["update:modelValue", "tab-click", "tab-close"],
|
|
29
34
|
setup(__props, { emit }) {
|
|
30
35
|
const props = __props;
|
|
31
36
|
const customTabList = computed(() => props.tabList.map((value) => {
|
|
@@ -43,11 +48,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
48
|
emit("update:modelValue", tab.name);
|
|
44
49
|
emit("tab-click", tab, event);
|
|
45
50
|
}
|
|
51
|
+
function close(index, event) {
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
emit("tab-close", index);
|
|
54
|
+
}
|
|
46
55
|
return (_ctx, _cache) => {
|
|
47
56
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
48
57
|
createElementVNode("div", _hoisted_2, [
|
|
49
58
|
createElementVNode("div", _hoisted_3, [
|
|
50
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab) => {
|
|
59
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab, index) => {
|
|
51
60
|
return openBlock(), createElementBlock("div", {
|
|
52
61
|
key: tab.key,
|
|
53
62
|
class: "hzzt-tab-pane",
|
|
@@ -57,7 +66,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
66
|
createElementVNode("p", {
|
|
58
67
|
class: normalizeClass([{ active: __props.modelValue === tab.name }, "hzzt-tab-badge-text"])
|
|
59
68
|
}, toDisplayString(tab.label), 3),
|
|
60
|
-
tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true)
|
|
69
|
+
tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true),
|
|
70
|
+
__props.closable ? (openBlock(), createBlock(HzztIcon, {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: "is-icon-close",
|
|
73
|
+
name: "close",
|
|
74
|
+
onClick: ($event) => close(index, $event)
|
|
75
|
+
}, null, 8, ["onClick"])) : createCommentVNode("v-if", true)
|
|
61
76
|
])
|
|
62
77
|
], 8, _hoisted_4);
|
|
63
78
|
}), 128))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/tab/src/index.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-tab flex align-items-center justify-content-between wrap\">\n <div class=\"flex align-items-center\">\n <div class=\"flex\">\n <div\n v-for=\"tab in customTabList\"\n :key=\"tab.key\"\n class=\"hzzt-tab-pane\"\n @click=\"tabClick(tab, $event)\"\n >\n <div class=\"hzzt-tab-badge\">\n <p\n :class=\"{ active: modelValue === tab.name }\"\n class=\"hzzt-tab-badge-text\"\n >\n {{ tab.label }}\n </p>\n <p\n v-if=\"tab.number && tab.number !== 0\"\n class=\"hzzt-tab-badge-count\"\n >\n {{ tab.number > 999 ? '999+' : tab.number }}\n </p>\n </div>\n </div>\n </div>\n <slot name=\"filter\" />\n <slot name=\"extra\" />\n </div>\n <div class=\"flex wrap\">\n <slot name=\"right\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\n\ndefineOptions({\n name: 'HzztTab',\n})\n\ndeclare type Tab = {\n name: string\n label: string\n number: number\n hide: boolean\n}\n\nconst props = defineProps({\n tabList: {\n type: Array,\n default: () => [],\n },\n modelValue: {\n type: [Number, String, Array],\n },\n})\n\nconst emit = defineEmits(['update:modelValue', 'tab-click'])\n\nconst customTabList = computed(() =>\n props.tabList\n .map((value) => {\n const tab = value as Tab\n return {\n key: `${tab.name}-${tab.number}` as string,\n ...tab,\n number: Number(tab.number || 0),\n hide: tab.hide,\n }\n })\n .filter((tab) => !tab.hide)\n)\n\nfunction tabClick(tab, event) {\n if (tab.name === props.modelValue) return\n emit('update:modelValue', tab.name)\n emit('tab-click', tab, event)\n}\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/tab/src/index.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-tab flex align-items-center justify-content-between wrap\">\n <div class=\"flex align-items-center\">\n <div class=\"flex\">\n <div\n v-for=\"(tab, index) in customTabList\"\n :key=\"tab.key\"\n class=\"hzzt-tab-pane\"\n @click=\"tabClick(tab, $event)\"\n >\n <div class=\"hzzt-tab-badge\">\n <p\n :class=\"{ active: modelValue === tab.name }\"\n class=\"hzzt-tab-badge-text\"\n >\n {{ tab.label }}\n </p>\n <p\n v-if=\"tab.number && tab.number !== 0\"\n class=\"hzzt-tab-badge-count\"\n >\n {{ tab.number > 999 ? '999+' : tab.number }}\n </p>\n <hzzt-icon\n v-if=\"closable\"\n class=\"is-icon-close\"\n name=\"close\"\n @click=\"close(index, $event)\"\n />\n </div>\n </div>\n </div>\n <slot name=\"filter\" />\n <slot name=\"extra\" />\n </div>\n <div class=\"flex wrap\">\n <slot name=\"right\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n\ndefineOptions({\n name: 'HzztTab',\n})\n\ndeclare type Tab = {\n name: string\n label: string\n number: number\n hide: boolean\n}\n\nconst props = defineProps({\n tabList: {\n type: Array,\n default: () => [],\n },\n modelValue: {\n type: [Number, String, Array],\n },\n closable: {\n type: Boolean,\n default: () => false,\n },\n})\n\nconst emit = defineEmits(['update:modelValue', 'tab-click', 'tab-close'])\n\nconst customTabList = computed(() =>\n props.tabList\n .map((value) => {\n const tab = value as Tab\n return {\n key: `${tab.name}-${tab.number}` as string,\n ...tab,\n number: Number(tab.number || 0),\n hide: tab.hide,\n }\n })\n .filter((tab) => !tab.hide)\n)\n\nfunction tabClick(tab: Tab, event: Event) {\n if (tab.name === props.modelValue) return\n emit('update:modelValue', tab.name)\n emit('tab-click', tab, event)\n}\n\nfunction close(index: number, event: Event) {\n event.stopPropagation()\n emit('tab-close', index)\n}\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;;;mCA6Cc,CAAA;AAAA,EACZ,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