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
package/dist/index.full.mjs
CHANGED
|
@@ -12668,12 +12668,12 @@ var English$1 = {
|
|
|
12668
12668
|
retract: "retract"
|
|
12669
12669
|
},
|
|
12670
12670
|
pagination: {
|
|
12671
|
-
total: "
|
|
12672
|
-
strip: "
|
|
12671
|
+
total: "",
|
|
12672
|
+
strip: ""
|
|
12673
12673
|
},
|
|
12674
12674
|
pageSize: {
|
|
12675
|
-
total: "
|
|
12676
|
-
strip: "
|
|
12675
|
+
total: "Total ",
|
|
12676
|
+
strip: "",
|
|
12677
12677
|
page: "page",
|
|
12678
12678
|
d: "",
|
|
12679
12679
|
per_page: "per page"
|
|
@@ -20537,6 +20537,34 @@ var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "collapse.
|
|
|
20537
20537
|
|
|
20538
20538
|
const HzztCollapse = withInstall$1(Collapse);
|
|
20539
20539
|
|
|
20540
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
20541
|
+
__name: "index",
|
|
20542
|
+
props: {
|
|
20543
|
+
name: {
|
|
20544
|
+
type: String,
|
|
20545
|
+
required: true
|
|
20546
|
+
},
|
|
20547
|
+
type: {
|
|
20548
|
+
type: String,
|
|
20549
|
+
default: "el"
|
|
20550
|
+
}
|
|
20551
|
+
},
|
|
20552
|
+
setup(__props) {
|
|
20553
|
+
const props = __props;
|
|
20554
|
+
const attrs = useAttrs$1();
|
|
20555
|
+
const componentName = computed(() => `hzzt-${props.type}-${props.name}`);
|
|
20556
|
+
return (_ctx, _cache) => {
|
|
20557
|
+
return openBlock(), createBlock(unref(ElIcon), normalizeProps(guardReactiveProps(unref(attrs))), {
|
|
20558
|
+
default: withCtx(() => [
|
|
20559
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(componentName))))
|
|
20560
|
+
]),
|
|
20561
|
+
_: 1
|
|
20562
|
+
}, 16);
|
|
20563
|
+
};
|
|
20564
|
+
}
|
|
20565
|
+
});
|
|
20566
|
+
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__file", "index.vue"]]);
|
|
20567
|
+
|
|
20540
20568
|
const _hoisted_1$5 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
20541
20569
|
const _hoisted_2$4 = { class: "flex align-items-center" };
|
|
20542
20570
|
const _hoisted_3$4 = { class: "flex" };
|
|
@@ -20550,7 +20578,7 @@ const _hoisted_7$1 = { class: "flex wrap" };
|
|
|
20550
20578
|
const __default__$6 = defineComponent({
|
|
20551
20579
|
name: "HzztTab"
|
|
20552
20580
|
});
|
|
20553
|
-
const _sfc_main$
|
|
20581
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
20554
20582
|
...__default__$6,
|
|
20555
20583
|
props: {
|
|
20556
20584
|
tabList: {
|
|
@@ -20559,9 +20587,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20559
20587
|
},
|
|
20560
20588
|
modelValue: {
|
|
20561
20589
|
type: [Number, String, Array]
|
|
20590
|
+
},
|
|
20591
|
+
closable: {
|
|
20592
|
+
type: Boolean,
|
|
20593
|
+
default: () => false
|
|
20562
20594
|
}
|
|
20563
20595
|
},
|
|
20564
|
-
emits: ["update:modelValue", "tab-click"],
|
|
20596
|
+
emits: ["update:modelValue", "tab-click", "tab-close"],
|
|
20565
20597
|
setup(__props, { emit }) {
|
|
20566
20598
|
const props = __props;
|
|
20567
20599
|
const customTabList = computed(() => props.tabList.map((value) => {
|
|
@@ -20579,11 +20611,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20579
20611
|
emit("update:modelValue", tab.name);
|
|
20580
20612
|
emit("tab-click", tab, event);
|
|
20581
20613
|
}
|
|
20614
|
+
function close(index, event) {
|
|
20615
|
+
event.stopPropagation();
|
|
20616
|
+
emit("tab-close", index);
|
|
20617
|
+
}
|
|
20582
20618
|
return (_ctx, _cache) => {
|
|
20583
20619
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
20584
20620
|
createElementVNode("div", _hoisted_2$4, [
|
|
20585
20621
|
createElementVNode("div", _hoisted_3$4, [
|
|
20586
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab) => {
|
|
20622
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab, index) => {
|
|
20587
20623
|
return openBlock(), createElementBlock("div", {
|
|
20588
20624
|
key: tab.key,
|
|
20589
20625
|
class: "hzzt-tab-pane",
|
|
@@ -20593,7 +20629,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20593
20629
|
createElementVNode("p", {
|
|
20594
20630
|
class: normalizeClass([{ active: __props.modelValue === tab.name }, "hzzt-tab-badge-text"])
|
|
20595
20631
|
}, toDisplayString(tab.label), 3),
|
|
20596
|
-
tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6$1, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true)
|
|
20632
|
+
tab.number && tab.number !== 0 ? (openBlock(), createElementBlock("p", _hoisted_6$1, toDisplayString(tab.number > 999 ? "999+" : tab.number), 1)) : createCommentVNode("v-if", true),
|
|
20633
|
+
__props.closable ? (openBlock(), createBlock(HzztIcon$1, {
|
|
20634
|
+
key: 1,
|
|
20635
|
+
class: "is-icon-close",
|
|
20636
|
+
name: "close",
|
|
20637
|
+
onClick: ($event) => close(index, $event)
|
|
20638
|
+
}, null, 8, ["onClick"])) : createCommentVNode("v-if", true)
|
|
20597
20639
|
])
|
|
20598
20640
|
], 8, _hoisted_4$3);
|
|
20599
20641
|
}), 128))
|
|
@@ -20608,38 +20650,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20608
20650
|
};
|
|
20609
20651
|
}
|
|
20610
20652
|
});
|
|
20611
|
-
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
20653
|
+
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__file", "index.vue"]]);
|
|
20612
20654
|
|
|
20613
20655
|
const HzztTab = withInstall$1(Tab);
|
|
20614
20656
|
|
|
20615
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
20616
|
-
__name: "index",
|
|
20617
|
-
props: {
|
|
20618
|
-
name: {
|
|
20619
|
-
type: String,
|
|
20620
|
-
required: true
|
|
20621
|
-
},
|
|
20622
|
-
type: {
|
|
20623
|
-
type: String,
|
|
20624
|
-
default: "el"
|
|
20625
|
-
}
|
|
20626
|
-
},
|
|
20627
|
-
setup(__props) {
|
|
20628
|
-
const props = __props;
|
|
20629
|
-
const attrs = useAttrs$1();
|
|
20630
|
-
const componentName = computed(() => `hzzt-${props.type}-${props.name}`);
|
|
20631
|
-
return (_ctx, _cache) => {
|
|
20632
|
-
return openBlock(), createBlock(unref(ElIcon), normalizeProps(guardReactiveProps(unref(attrs))), {
|
|
20633
|
-
default: withCtx(() => [
|
|
20634
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(componentName))))
|
|
20635
|
-
]),
|
|
20636
|
-
_: 1
|
|
20637
|
-
}, 16);
|
|
20638
|
-
};
|
|
20639
|
-
}
|
|
20640
|
-
});
|
|
20641
|
-
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__file", "index.vue"]]);
|
|
20642
|
-
|
|
20643
20657
|
const HzztIcon = {
|
|
20644
20658
|
install(app) {
|
|
20645
20659
|
app.component("HzztIcon", HzztIcon$1);
|
|
@@ -20814,7 +20828,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
20814
20828
|
const compKls = computed(() => {
|
|
20815
20829
|
return [ns.b(), ns.m(trueSize.value)];
|
|
20816
20830
|
});
|
|
20817
|
-
const page = computed(() => Math.ceil(props.total / props.pageSize));
|
|
20831
|
+
const page = computed(() => Math.ceil(props.total / props.pageSize) || 1);
|
|
20818
20832
|
watch(() => props.pageSize, (val) => {
|
|
20819
20833
|
sizeValue.value = val;
|
|
20820
20834
|
});
|
package/dist/locale/en.js
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
retract: "retract"
|
|
15
15
|
},
|
|
16
16
|
pagination: {
|
|
17
|
-
total: "
|
|
18
|
-
strip: "
|
|
17
|
+
total: "",
|
|
18
|
+
strip: ""
|
|
19
19
|
},
|
|
20
20
|
pageSize: {
|
|
21
|
-
total: "
|
|
22
|
-
strip: "
|
|
21
|
+
total: "Total ",
|
|
22
|
+
strip: "",
|
|
23
23
|
page: "page",
|
|
24
24
|
d: "",
|
|
25
25
|
per_page: "per page"
|
package/dist/locale/en.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v0.0.1 */(function(e,
|
|
1
|
+
/*! Hzzt Plus v0.0.1 */(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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.min.js","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.min.js","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,WAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,gBAAgB,CAAC,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;;;;;;;;"}
|
package/dist/locale/en.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v0.0.1 */var r={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"
|
|
1
|
+
/*! Hzzt Plus v0.0.1 */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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.min.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.min.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,SAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,gBAAgB,CAAC,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;;;;"}
|
package/dist/locale/en.mjs
CHANGED
|
@@ -8,12 +8,12 @@ var en = {
|
|
|
8
8
|
retract: "retract"
|
|
9
9
|
},
|
|
10
10
|
pagination: {
|
|
11
|
-
total: "
|
|
12
|
-
strip: "
|
|
11
|
+
total: "",
|
|
12
|
+
strip: ""
|
|
13
13
|
},
|
|
14
14
|
pageSize: {
|
|
15
|
-
total: "
|
|
16
|
-
strip: "
|
|
15
|
+
total: "Total ",
|
|
16
|
+
strip: "",
|
|
17
17
|
page: "page",
|
|
18
18
|
d: "",
|
|
19
19
|
per_page: "per page"
|
|
@@ -62,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
const compKls = computed(() => {
|
|
63
63
|
return [ns.b(), ns.m(trueSize.value)];
|
|
64
64
|
});
|
|
65
|
-
const page = computed(() => Math.ceil(props.total / props.pageSize));
|
|
65
|
+
const page = computed(() => Math.ceil(props.total / props.pageSize) || 1);
|
|
66
66
|
watch(() => props.pageSize, (val) => {
|
|
67
67
|
sizeValue.value = val;
|
|
68
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","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":["_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;mCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,CAAC,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,MAAM,IAAQ,IAAA,aAAA,GAAgB,KAAK,CAAA,CAAA;AAEnE,IAAM,MAAA,OAAA,GAAU,SAAS,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,GAAO,
|
|
1
|
+
{"version":3,"file":"index.mjs","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":["_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;mCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,CAAC,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,MAAM,IAAQ,IAAA,aAAA,GAAgB,KAAK,CAAA,CAAA;AAEnE,IAAM,MAAA,OAAA,GAAU,SAAS,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,GAAO,QAAS,CAAA,MAAM,IAAK,CAAA,IAAA,CAAK,MAAM,KAAQ,GAAA,KAAA,CAAM,QAAQ,CAAA,IAAK,CAAC,CAAA,CAAA;AAExE,IAAA,KAAA,CAAA,MAAA,KAAA,CAAA,QAAA,EAAA,CAAA,GAAA,KAAA;AAAA,MACE,SAAY,CAAA,KAAA,GAAA,GAAA,CAAA;AAAA,KAAA,CACZ,CAAC;AACC,IAAA,KAAA,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,GAAAA,gBAAA,CAAA,WAAA,CAAA,CAAA;AAEA,MAAA,OAASC,aAAcC,kBAAc,CAAA,MAAA,EAAA;AACnC,QAAA,uBAA0BA,KAAI,CAAA,OAAA,CAAA,EAAA,kDAAA,CAAA,CAAA;AAC9B,OAAA,EAAA;AAA2B,QAC7B,OAAA,CAAA,KAAA,GAAA,CAAA,IAAA,CAAA,OAAA,CAAA,QAAA,IAAAD,SAAA,EAAA,EAAAE,kBAAA,CAAA,MAAA,EAAA,UAAA,EAAAC,eAAA,CAAAC,KAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,GAAAD,eAAA,CAAA,OAAA,CAAA,KAAA,CAAA,GAAAA,eAAA,CAAAC,KAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAAC,kBAAA,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;
|
|
@@ -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,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;AAyBA,IAAA,MAAM,aAAgB,GAAA,QAAA,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,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|