hzzt-plus 0.0.7 → 0.0.9
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 +52 -38
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +5 -5
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +52 -38
- package/dist/locale/en.js +4 -4
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.js.map +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.min.mjs.map +1 -1
- package/dist/locale/en.mjs +4 -4
- package/es/components/page-size/src/index.mjs +1 -1
- package/es/components/page-size/src/index.mjs.map +1 -1
- 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/locale/lang/en.mjs +4 -4
- package/es/locale/lang/en.mjs.map +1 -1
- package/lib/components/page-size/src/index.js +1 -1
- package/lib/components/page-size/src/index.js.map +1 -1
- 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/locale/lang/en.js +4 -4
- package/lib/locale/lang/en.js.map +1 -1
- package/package.json +1 -1
- package/theme/hzzt-collapse.css +1 -1
- package/theme/hzzt-tab.css +1 -1
- package/theme/index.css +1 -1
- package/theme/src/collapse.scss +1 -0
- package/theme/src/common/var.scss +2 -1
- package/theme/src/mixins/function.scss +7 -5
- package/theme/src/mixins/mixins.scss +4 -4
- package/theme/src/tab.scss +24 -6
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
declare type Tab = {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
number: number;
|
|
5
|
+
hide: boolean;
|
|
6
|
+
};
|
|
1
7
|
declare const _default: import("vue").DefineComponent<{
|
|
2
8
|
tabList: {
|
|
3
9
|
type: ArrayConstructor;
|
|
@@ -6,6 +12,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
12
|
modelValue: {
|
|
7
13
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
8
14
|
};
|
|
15
|
+
closable: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: () => boolean;
|
|
18
|
+
};
|
|
9
19
|
}, {
|
|
10
20
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
11
21
|
tabList: {
|
|
@@ -15,11 +25,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
25
|
modelValue: {
|
|
16
26
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
17
27
|
};
|
|
28
|
+
closable: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: () => boolean;
|
|
31
|
+
};
|
|
18
32
|
}>> & {
|
|
19
33
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
20
34
|
"onTab-click"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
"onTab-close"?: ((...args: any[]) => any) | undefined;
|
|
21
36
|
}>>;
|
|
22
|
-
emit: (event: "update:modelValue" | "tab-click", ...args: any[]) => void;
|
|
37
|
+
emit: (event: "update:modelValue" | "tab-click" | "tab-close", ...args: any[]) => void;
|
|
23
38
|
customTabList: import("vue").ComputedRef<{
|
|
24
39
|
number: number;
|
|
25
40
|
hide: boolean;
|
|
@@ -27,8 +42,146 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
42
|
label: string;
|
|
28
43
|
key: string;
|
|
29
44
|
}[]>;
|
|
30
|
-
tabClick: (tab:
|
|
31
|
-
|
|
45
|
+
tabClick: (tab: Tab, event: Event) => void;
|
|
46
|
+
close: (index: number, event: Event) => void;
|
|
47
|
+
HzztIcon: import("vue").DefineComponent<{
|
|
48
|
+
name: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
type: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
}, {
|
|
57
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
name: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
62
|
+
type: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
}>> & {
|
|
67
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
68
|
+
}>>;
|
|
69
|
+
attrs: {
|
|
70
|
+
[x: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
componentName: import("vue").ComputedRef<string>;
|
|
73
|
+
ElIcon: import("element-plus/es/utils").SFCWithInstall<{
|
|
74
|
+
new (...args: any[]): {
|
|
75
|
+
$: import("vue").ComponentInternalInstance;
|
|
76
|
+
$data: {};
|
|
77
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
readonly size: {
|
|
79
|
+
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>>;
|
|
80
|
+
readonly required: false;
|
|
81
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
82
|
+
__epPropKey: true;
|
|
83
|
+
};
|
|
84
|
+
readonly color: {
|
|
85
|
+
readonly type: import("vue").PropType<string>;
|
|
86
|
+
readonly required: false;
|
|
87
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
88
|
+
__epPropKey: true;
|
|
89
|
+
};
|
|
90
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
91
|
+
$attrs: {
|
|
92
|
+
[x: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
$refs: {
|
|
95
|
+
[x: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
$slots: Readonly<{
|
|
98
|
+
[name: string]: import("vue").Slot | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
101
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
102
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
103
|
+
$el: any;
|
|
104
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
105
|
+
readonly size: {
|
|
106
|
+
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>>;
|
|
107
|
+
readonly required: false;
|
|
108
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
109
|
+
__epPropKey: true;
|
|
110
|
+
};
|
|
111
|
+
readonly color: {
|
|
112
|
+
readonly type: import("vue").PropType<string>;
|
|
113
|
+
readonly required: false;
|
|
114
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
115
|
+
__epPropKey: true;
|
|
116
|
+
};
|
|
117
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
118
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
119
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
120
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
121
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
122
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
123
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
124
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
125
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
126
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
127
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
128
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
129
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
130
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
131
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
132
|
+
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;
|
|
133
|
+
};
|
|
134
|
+
$forceUpdate: () => void;
|
|
135
|
+
$nextTick: typeof import("vue").nextTick;
|
|
136
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
137
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
|
138
|
+
readonly size: {
|
|
139
|
+
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>>;
|
|
140
|
+
readonly required: false;
|
|
141
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
142
|
+
__epPropKey: true;
|
|
143
|
+
};
|
|
144
|
+
readonly color: {
|
|
145
|
+
readonly type: import("vue").PropType<string>;
|
|
146
|
+
readonly required: false;
|
|
147
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
148
|
+
__epPropKey: true;
|
|
149
|
+
};
|
|
150
|
+
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
151
|
+
__isFragment?: undefined;
|
|
152
|
+
__isTeleport?: undefined;
|
|
153
|
+
__isSuspense?: undefined;
|
|
154
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
155
|
+
readonly size: {
|
|
156
|
+
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>>;
|
|
157
|
+
readonly required: false;
|
|
158
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
159
|
+
__epPropKey: true;
|
|
160
|
+
};
|
|
161
|
+
readonly color: {
|
|
162
|
+
readonly type: import("vue").PropType<string>;
|
|
163
|
+
readonly required: false;
|
|
164
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
165
|
+
__epPropKey: true;
|
|
166
|
+
};
|
|
167
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
168
|
+
$slots: {
|
|
169
|
+
default?(_: {}): any;
|
|
170
|
+
};
|
|
171
|
+
})>;
|
|
172
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
173
|
+
name: {
|
|
174
|
+
type: StringConstructor;
|
|
175
|
+
required: true;
|
|
176
|
+
};
|
|
177
|
+
type: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
}>>, {
|
|
182
|
+
type: string;
|
|
183
|
+
}>;
|
|
184
|
+
}, 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
185
|
tabList: {
|
|
33
186
|
type: ArrayConstructor;
|
|
34
187
|
default: () => never[];
|
|
@@ -36,10 +189,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
189
|
modelValue: {
|
|
37
190
|
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
38
191
|
};
|
|
192
|
+
closable: {
|
|
193
|
+
type: BooleanConstructor;
|
|
194
|
+
default: () => boolean;
|
|
195
|
+
};
|
|
39
196
|
}>> & {
|
|
40
197
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
41
198
|
"onTab-click"?: ((...args: any[]) => any) | undefined;
|
|
199
|
+
"onTab-close"?: ((...args: any[]) => any) | undefined;
|
|
42
200
|
}, {
|
|
43
201
|
tabList: unknown[];
|
|
202
|
+
closable: boolean;
|
|
44
203
|
}>;
|
|
45
204
|
export default _default;
|
package/es/locale/lang/en.mjs
CHANGED
|
@@ -6,12 +6,12 @@ var English = {
|
|
|
6
6
|
retract: "retract"
|
|
7
7
|
},
|
|
8
8
|
pagination: {
|
|
9
|
-
total: "
|
|
10
|
-
strip: "
|
|
9
|
+
total: "",
|
|
10
|
+
strip: ""
|
|
11
11
|
},
|
|
12
12
|
pageSize: {
|
|
13
|
-
total: "
|
|
14
|
-
strip: "
|
|
13
|
+
total: "Total ",
|
|
14
|
+
strip: "",
|
|
15
15
|
page: "page",
|
|
16
16
|
d: "",
|
|
17
17
|
per_page: "per page"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.mjs","sources":["../../../../../packages/locale/lang/en.ts"],"sourcesContent":["export default {\n name: 'en',\n hzzt: {\n collapse: {\n expand: 'expand',\n retract: 'retract',\n },\n pagination: {\n total: '
|
|
1
|
+
{"version":3,"file":"en.mjs","sources":["../../../../../packages/locale/lang/en.ts"],"sourcesContent":["export default {\n name: 'en',\n hzzt: {\n collapse: {\n expand: 'expand',\n retract: 'retract',\n },\n pagination: {\n total: '',\n strip: '',\n },\n pageSize: {\n total: 'Total ',\n strip: '',\n page: 'page',\n d: '',\n per_page: 'per page',\n },\n quarterpicker: {\n prevYear: 'Previous Year',\n nextYear: 'Next Year',\n year: '',\n firstQuarter: 'First quarter',\n secondQuarter: 'Second quarter',\n thirdQuarter: 'Third quarter',\n fourthQuarter: 'Fourth quarter',\n },\n },\n}\n"],"names":[],"mappings":"AAAA,cAAe;AACf,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE;AACR,IAAI,QAAQ,EAAE;AACd,MAAM,MAAM,EAAE,QAAQ;AACtB,MAAM,OAAO,EAAE,SAAS;AACxB,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,KAAK,EAAE,EAAE;AACf,MAAM,KAAK,EAAE,EAAE;AACf,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,MAAM,KAAK,EAAE,QAAQ;AACrB,MAAM,KAAK,EAAE,EAAE;AACf,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,CAAC,EAAE,EAAE;AACX,MAAM,QAAQ,EAAE,UAAU;AAC1B,KAAK;AACL,IAAI,aAAa,EAAE;AACnB,MAAM,QAAQ,EAAE,eAAe;AAC/B,MAAM,QAAQ,EAAE,WAAW;AAC3B,MAAM,IAAI,EAAE,EAAE;AACd,MAAM,YAAY,EAAE,eAAe;AACnC,MAAM,aAAa,EAAE,gBAAgB;AACrC,MAAM,YAAY,EAAE,eAAe;AACnC,MAAM,aAAa,EAAE,gBAAgB;AACrC,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
|
@@ -66,7 +66,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
66
66
|
const compKls = vue.computed(() => {
|
|
67
67
|
return [ns.b(), ns.m(trueSize.value)];
|
|
68
68
|
});
|
|
69
|
-
const page = vue.computed(() => Math.ceil(props.total / props.pageSize));
|
|
69
|
+
const page = vue.computed(() => Math.ceil(props.total / props.pageSize) || 1);
|
|
70
70
|
vue.watch(() => props.pageSize, (val) => {
|
|
71
71
|
sizeValue.value = val;
|
|
72
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/page-size/src/index.vue"],"sourcesContent":["<template>\n <main\n :class=\"compKls\"\n class=\"flex wrap align-items-center justify-content-end\"\n >\n <span v-if=\"total > 0 && !isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.total') }}{{ total\n }}{{ t('hzzt.pageSize.strip') }}</span\n >\n <span v-if=\"isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.d') }}{{ modelValue\n }}{{ t('hzzt.pageSize.page') }}</span\n >\n <div\n v-if=\"pageSizeOptions.length\"\n :class=\"ns.e('option')\"\n class=\"flex align-items-center\"\n >\n <span class=\"line-height-1\">{{ t('hzzt.pageSize.per_page') }}</span>\n <el-select\n v-model=\"sizeValue\"\n :disabled=\"disabled\"\n :size=\"trueSize\"\n :clearable=\"false\"\n @change=\"pageSizeChange\"\n >\n <el-option\n v-for=\"item in pageSizeOptions\"\n :key=\"item\"\n :label=\"`${item}${t('hzzt.pageSize.strip')}`\"\n :value=\"item\"\n />\n </el-select>\n </div>\n <div v-if=\"page > 1 || isManual\" :class=\"ns.e('pagination')\">\n <span v-if=\"!isManual\" class=\"margin-l-1 margin-r-2\"\n >{{ modelValue }}/{{ page }}</span\n >\n <el-button\n v-if=\"page > 2 && modelValue > 2\"\n type=\"primary\"\n style=\"margin-right: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(1)\"\n >\n <hzzt-icon name=\"d-arrow-left\" />\n </el-button>\n <el-input-number\n v-model=\"innerPage\"\n class=\"width-2\"\n :size=\"trueSize\"\n :min=\"1\"\n :max=\"page\"\n @change=\"currentChange\"\n />\n <el-button\n v-if=\"page > 2 && modelValue < page\"\n type=\"primary\"\n style=\"margin-left: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(page)\"\n >\n <hzzt-icon name=\"d-arrow-right\" />\n </el-button>\n </div>\n </main>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElButton, ElInputNumber, ElSelect } from 'element-plus'\nimport {\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from '@hzzt-plus/hooks'\nimport HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n\ndefineOptions({\n name: 'HzztPageSize',\n})\n\nconst props = defineProps({\n modelValue: {\n type: Number,\n default: 1,\n },\n pageSize: {\n type: Number,\n default: 20,\n },\n total: {\n type: Number,\n default: 0,\n },\n disabled: Boolean,\n isManual: Boolean,\n isLastPage: Boolean,\n pageSizeOptions: {\n type: Array,\n default: () => [20, 50, 100, 200, 500, 1000, 2000],\n },\n size: useSizeProp,\n})\n\nconst emit = defineEmits([\n 'page-size-change',\n 'update:modelValue',\n 'current-change',\n])\n\nconst sizeValue = ref(props.pageSize)\nconst innerPage = ref(props.modelValue || 0)\nconst { t } = useLocale()\nconst ns = useNamespace('page-size')\n\nconst trueSize = computed(() => props.size || useGlobalSize().value)\n\nconst compKls = computed(() => {\n return [ns.b(), ns.m(trueSize.value)]\n})\n\nconst page = computed(() => Math.ceil(props.total / props.pageSize))\n\nwatch(\n () => props.pageSize,\n (val) => {\n sizeValue.value = val\n }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n innerPage.value = val\n }\n)\n\nfunction pageSizeChange(size: number) {\n emit('page-size-change', size)\n}\n\nfunction currentChange(page: number) {\n emit('update:modelValue', page)\n emit('current-change', page)\n}\n</script>\n"],"names":["ref","useLocale","useNamespace","computed","useGlobalSize","watch","_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAYA,OAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,CAAC,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,iBAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,WAAWC,YAAS,CAAA,MAAM,MAAM,IAAQ,IAAAC,mBAAA,GAAgB,KAAK,CAAA,CAAA;AAEnE,IAAM,MAAA,OAAA,GAAUD,aAAS,MAAM;AAC7B,MAAO,OAAA,CAAC,GAAG,CAAE,EAAA,EAAG,GAAG,CAAE,CAAA,QAAA,CAAS,KAAK,CAAC,CAAA,CAAA;AAAA,KACrC,CAAA,CAAA;AAED,IAAM,MAAA,IAAA,GAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/page-size/src/index.vue"],"sourcesContent":["<template>\n <main\n :class=\"compKls\"\n class=\"flex wrap align-items-center justify-content-end\"\n >\n <span v-if=\"total > 0 && !isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.total') }}{{ total\n }}{{ t('hzzt.pageSize.strip') }}</span\n >\n <span v-if=\"isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.d') }}{{ modelValue\n }}{{ t('hzzt.pageSize.page') }}</span\n >\n <div\n v-if=\"pageSizeOptions.length\"\n :class=\"ns.e('option')\"\n class=\"flex align-items-center\"\n >\n <span class=\"line-height-1\">{{ t('hzzt.pageSize.per_page') }}</span>\n <el-select\n v-model=\"sizeValue\"\n :disabled=\"disabled\"\n :size=\"trueSize\"\n :clearable=\"false\"\n @change=\"pageSizeChange\"\n >\n <el-option\n v-for=\"item in pageSizeOptions\"\n :key=\"item\"\n :label=\"`${item}${t('hzzt.pageSize.strip')}`\"\n :value=\"item\"\n />\n </el-select>\n </div>\n <div v-if=\"page > 1 || isManual\" :class=\"ns.e('pagination')\">\n <span v-if=\"!isManual\" class=\"margin-l-1 margin-r-2\"\n >{{ modelValue }}/{{ page }}</span\n >\n <el-button\n v-if=\"page > 2 && modelValue > 2\"\n type=\"primary\"\n style=\"margin-right: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(1)\"\n >\n <hzzt-icon name=\"d-arrow-left\" />\n </el-button>\n <el-input-number\n v-model=\"innerPage\"\n class=\"width-2\"\n :size=\"trueSize\"\n :min=\"1\"\n :max=\"page\"\n @change=\"currentChange\"\n />\n <el-button\n v-if=\"page > 2 && modelValue < page\"\n type=\"primary\"\n style=\"margin-left: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(page)\"\n >\n <hzzt-icon name=\"d-arrow-right\" />\n </el-button>\n </div>\n </main>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElButton, ElInputNumber, ElSelect } from 'element-plus'\nimport {\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from '@hzzt-plus/hooks'\nimport HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n\ndefineOptions({\n name: 'HzztPageSize',\n})\n\nconst props = defineProps({\n modelValue: {\n type: Number,\n default: 1,\n },\n pageSize: {\n type: Number,\n default: 20,\n },\n total: {\n type: Number,\n default: 0,\n },\n disabled: Boolean,\n isManual: Boolean,\n isLastPage: Boolean,\n pageSizeOptions: {\n type: Array,\n default: () => [20, 50, 100, 200, 500, 1000, 2000],\n },\n size: useSizeProp,\n})\n\nconst emit = defineEmits([\n 'page-size-change',\n 'update:modelValue',\n 'current-change',\n])\n\nconst sizeValue = ref(props.pageSize)\nconst innerPage = ref(props.modelValue || 0)\nconst { t } = useLocale()\nconst ns = useNamespace('page-size')\n\nconst trueSize = computed(() => props.size || useGlobalSize().value)\n\nconst compKls = computed(() => {\n return [ns.b(), ns.m(trueSize.value)]\n})\n\nconst page = computed(() => Math.ceil(props.total / props.pageSize) || 1)\n\nwatch(\n () => props.pageSize,\n (val) => {\n sizeValue.value = val\n }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n innerPage.value = val\n }\n)\n\nfunction pageSizeChange(size: number) {\n emit('page-size-change', size)\n}\n\nfunction currentChange(page: number) {\n emit('update:modelValue', page)\n emit('current-change', page)\n}\n</script>\n"],"names":["ref","useLocale","useNamespace","computed","useGlobalSize","watch","_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAYA,OAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,CAAC,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,iBAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,WAAWC,YAAS,CAAA,MAAM,MAAM,IAAQ,IAAAC,mBAAA,GAAgB,KAAK,CAAA,CAAA;AAEnE,IAAM,MAAA,OAAA,GAAUD,aAAS,MAAM;AAC7B,MAAO,OAAA,CAAC,GAAG,CAAE,EAAA,EAAG,GAAG,CAAE,CAAA,QAAA,CAAS,KAAK,CAAC,CAAA,CAAA;AAAA,KACrC,CAAA,CAAA;AAED,IAAM,MAAA,IAAA,GAAOA,YAAS,CAAA,MAAM,IAAK,CAAA,IAAA,CAAK,MAAM,KAAQ,GAAA,KAAA,CAAM,QAAQ,CAAA,IAAK,CAAC,CAAA,CAAA;AAExE,IAAAE,SAAA,CAAA,MAAA,KAAA,CAAA,QAAA,EAAA,CAAA,GAAA,KAAA;AAAA,MACE,SAAY,CAAA,KAAA,GAAA,GAAA,CAAA;AAAA,KAAA,CACZ,CAAC;AACC,IAAAA,SAAA,CAAA,MAAA,KAAkB,CAAA,UAAA,EAAA,CAAA,GAAA,KAAA;AAAA,MACpB,SAAA,CAAA,KAAA,GAAA,GAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAEA,IAAA,SAAA,cAAA,CAAA,IAAA,EAAA;AAAA,MACE,uBAAY,EAAA,IAAA,CAAA,CAAA;AAAA,KAAA;AAEV,IAAA,SAAA,aAAkB,CAAA,KAAA,EAAA;AAAA,MACpB,IAAA,CAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;AAAA,MACF,IAAA,CAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;AAEA,KAAA;AACE,IAAA,OAAK;AAAwB,MAC/B,MAAA,oBAAA,GAAAC,oBAAA,CAAA,WAAA,CAAA,CAAA;AAEA,MAAA,OAASC,iBAAcC,sBAAc,CAAA,MAAA,EAAA;AACnC,QAAA,2BAA0BA,SAAI,CAAA,OAAA,CAAA,EAAA,kDAAA,CAAA,CAAA;AAC9B,OAAA,EAAA;AAA2B,QAC7B,OAAA,CAAA,KAAA,GAAA,CAAA,IAAA,CAAA,OAAA,CAAA,QAAA,IAAAD,aAAA,EAAA,EAAAE,sBAAA,CAAA,MAAA,EAAA,UAAA,EAAAC,mBAAA,CAAAC,SAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,GAAAD,mBAAA,CAAA,OAAA,CAAA,KAAA,CAAA,GAAAA,mBAAA,CAAAC,SAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAAC,sBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var index = require('../../icon/src/index.js');
|
|
6
7
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
7
8
|
|
|
8
9
|
const _hoisted_1 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
@@ -27,9 +28,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
27
28
|
},
|
|
28
29
|
modelValue: {
|
|
29
30
|
type: [Number, String, Array]
|
|
31
|
+
},
|
|
32
|
+
closable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: () => false
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
|
-
emits: ["update:modelValue", "tab-click"],
|
|
37
|
+
emits: ["update:modelValue", "tab-click", "tab-close"],
|
|
33
38
|
setup(__props, { emit }) {
|
|
34
39
|
const props = __props;
|
|
35
40
|
const customTabList = vue.computed(() => props.tabList.map((value) => {
|
|
@@ -47,11 +52,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
47
52
|
emit("update:modelValue", tab.name);
|
|
48
53
|
emit("tab-click", tab, event);
|
|
49
54
|
}
|
|
55
|
+
function close(index, event) {
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
emit("tab-close", index);
|
|
58
|
+
}
|
|
50
59
|
return (_ctx, _cache) => {
|
|
51
60
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
52
61
|
vue.createElementVNode("div", _hoisted_2, [
|
|
53
62
|
vue.createElementVNode("div", _hoisted_3, [
|
|
54
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(customTabList), (tab) => {
|
|
63
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(customTabList), (tab, index$1) => {
|
|
55
64
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
56
65
|
key: tab.key,
|
|
57
66
|
class: "hzzt-tab-pane",
|
|
@@ -61,7 +70,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
61
70
|
vue.createElementVNode("p", {
|
|
62
71
|
class: vue.normalizeClass([{ active: __props.modelValue === tab.name }, "hzzt-tab-badge-text"])
|
|
63
72
|
}, vue.toDisplayString(tab.label), 3),
|
|
64
|
-
tab.number && tab.number !== 0 ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6, vue.toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : vue.createCommentVNode("v-if", true)
|
|
73
|
+
tab.number && tab.number !== 0 ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6, vue.toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : vue.createCommentVNode("v-if", true),
|
|
74
|
+
__props.closable ? (vue.openBlock(), vue.createBlock(index["default"], {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "is-icon-close",
|
|
77
|
+
name: "close",
|
|
78
|
+
onClick: ($event) => close(index$1, $event)
|
|
79
|
+
}, null, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
|
|
65
80
|
])
|
|
66
81
|
], 8, _hoisted_4);
|
|
67
82
|
}), 128))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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":["computed","_openBlock","_createElementBlock"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","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":["computed","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;;;;;;;uCA6Cc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;AAyBA,IAAA,MAAM,aAAgB,GAAAA,YAAA,CAAA,MAAA,KAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,KAAA,KAAA;AAAA,MAAS,MAC7B,GAAA,GAAM,KACH,CAAA;AACC,MAAA,OAAA;AACA,QAAO,GAAA,EAAA,CAAA,EAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,GAAA,CAAA,MAAA,CAAA,CAAA;AAAA,QAAA;AACyB,QAAA,MAC3B,EAAA,MAAA,CAAA,GAAA,CAAA,MAAA,IAAA,CAAA,CAAA;AAAA,QAAA,IACK,EAAA,GAAA,CAAA,IAAA;AAAsB,OAAA,CAAA;AACpB,KACZ,CAAA,CAAA,MAAA,CAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AAAA,IAAA,SAED,QAAgB,CAAA,GAAA,OAAS,EAAA;AAAA,MAC9B,IAAA,GAAA,CAAA,IAAA,KAAA,KAAA,CAAA,UAAA;AAEA,QAAS,OAAA;AACP,MAAI,IAAA,CAAA,mBAAmB,EAAA,GAAA,CAAA,IAAA,CAAA,CAAA;AAAY,MAAA,IAAA,CAAA,WAAA,EAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACnC,KAAK;AACL,IAAK,SAAA,KAAA,CAAA,KAAa,OAAU,EAAA;AAAA,MAC9B,KAAA,CAAA,eAAA,EAAA,CAAA;AAEA,MAAS,IAAA,CAAA,kBAAmC,CAAA,CAAA;AAC1C,KAAA;AACA,IAAA,OAAK,aAAa,KAAK;AAAA,MACzB,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|