hzzt-plus 1.0.6 → 2.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 +558 -355
- package/dist/index.full.min.js +10 -10
- 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 +559 -357
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/component.mjs +3 -1
- package/es/component.mjs.map +1 -1
- package/es/components/click-input/src/click-input2.mjs +1 -1
- package/es/components/click-input/src/click-input2.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +161 -8
- package/es/components/collapse/src/collapse.vue.d.ts +161 -8
- package/es/components/collapse/src/collapse2.mjs +50 -29
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/icon/index.mjs +4 -0
- package/es/components/icon/index.mjs.map +1 -1
- package/es/components/icon/src/components/index.d.ts +2 -0
- package/es/components/icon/src/components/index.mjs +3 -0
- package/es/components/icon/src/components/index.mjs.map +1 -0
- package/es/components/icon/src/components/minus-square-outline.mjs +29 -0
- package/es/components/icon/src/components/minus-square-outline.mjs.map +1 -0
- package/es/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
- package/es/components/icon/src/components/plus-square-outline.mjs +29 -0
- package/es/components/icon/src/components/plus-square-outline.mjs.map +1 -0
- package/es/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -1
- package/es/components/index.mjs.map +1 -1
- package/es/components/pagination/index.d.ts +2 -2
- package/es/components/pagination/src/index.mjs +49 -21
- package/es/components/pagination/src/index.mjs.map +1 -1
- package/es/components/pagination/src/index.vue.d.ts +2 -2
- package/es/components/scroll/index.d.ts +5 -0
- package/es/components/scroll/index.mjs +9 -0
- package/es/components/scroll/index.mjs.map +1 -0
- package/es/components/scroll/src/scroll.d.ts +2 -0
- package/es/components/scroll/src/scroll.mjs +2 -0
- package/es/components/scroll/src/scroll.mjs.map +1 -0
- package/es/components/scroll/src/scroll.vue.d.ts +147 -0
- package/es/components/scroll/src/scroll2.mjs +88 -0
- package/es/components/scroll/src/scroll2.mjs.map +1 -0
- package/es/components/scroll/style/css.d.ts +2 -0
- package/es/components/scroll/style/css.mjs +3 -0
- package/es/components/scroll/style/css.mjs.map +1 -0
- package/es/components/scroll/style/index.d.ts +2 -0
- package/es/components/scroll/style/index.mjs +3 -0
- package/es/components/scroll/style/index.mjs.map +1 -0
- package/es/components/select-input/index.d.ts +39 -0
- package/es/components/select-input/src/select-input.vue.d.ts +39 -0
- package/es/components/select-textarea/index.mjs +2 -2
- package/es/components/select-textarea/src/select-textarea.mjs +100 -30
- package/es/components/select-textarea/src/select-textarea.mjs.map +1 -1
- package/es/components/select-textarea/src/select-textarea.vue.d.ts +39 -0
- package/es/components/select-textarea/src/select-textarea2.mjs +30 -100
- package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -1
- package/es/components/title/src/title.d.ts +6 -0
- package/es/components/title/src/title.mjs +4 -1
- package/es/components/title/src/title.mjs.map +1 -1
- package/es/components/title/src/title.vue.d.ts +39 -0
- package/es/components/title/src/title2.mjs +28 -12
- package/es/components/title/src/title2.mjs.map +1 -1
- package/es/index.mjs +2 -1
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.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/click-input/src/click-input2.js +1 -1
- package/lib/components/click-input/src/click-input2.js.map +1 -1
- package/lib/components/collapse/index.d.ts +161 -8
- package/lib/components/collapse/src/collapse.vue.d.ts +161 -8
- package/lib/components/collapse/src/collapse2.js +49 -28
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/icon/index.js +4 -0
- package/lib/components/icon/index.js.map +1 -1
- package/lib/components/icon/src/components/index.d.ts +2 -0
- package/lib/components/icon/src/components/index.js +12 -0
- package/lib/components/icon/src/components/index.js.map +1 -0
- package/lib/components/icon/src/components/minus-square-outline.js +33 -0
- package/lib/components/icon/src/components/minus-square-outline.js.map +1 -0
- package/lib/components/icon/src/components/minus-square-outline.vue.d.ts +2 -0
- package/lib/components/icon/src/components/plus-square-outline.js +33 -0
- package/lib/components/icon/src/components/plus-square-outline.js.map +1 -0
- package/lib/components/icon/src/components/plus-square-outline.vue.d.ts +2 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/pagination/index.d.ts +2 -2
- package/lib/components/pagination/src/index.js +48 -20
- package/lib/components/pagination/src/index.js.map +1 -1
- package/lib/components/pagination/src/index.vue.d.ts +2 -2
- package/lib/components/scroll/index.d.ts +5 -0
- package/lib/components/scroll/index.js +14 -0
- package/lib/components/scroll/index.js.map +1 -0
- package/lib/components/scroll/src/scroll.d.ts +2 -0
- package/lib/components/scroll/src/scroll.js +3 -0
- package/lib/components/scroll/src/scroll.js.map +1 -0
- package/lib/components/scroll/src/scroll.vue.d.ts +147 -0
- package/lib/components/scroll/src/scroll2.js +92 -0
- package/lib/components/scroll/src/scroll2.js.map +1 -0
- package/lib/components/scroll/style/css.d.ts +2 -0
- package/lib/components/scroll/style/css.js +6 -0
- package/lib/components/scroll/style/css.js.map +1 -0
- package/lib/components/scroll/style/index.d.ts +2 -0
- package/lib/components/scroll/style/index.js +6 -0
- package/lib/components/scroll/style/index.js.map +1 -0
- package/lib/components/select-input/index.d.ts +39 -0
- package/lib/components/select-input/src/select-input.vue.d.ts +39 -0
- package/lib/components/select-textarea/index.js +2 -2
- package/lib/components/select-textarea/src/select-textarea.js +100 -31
- package/lib/components/select-textarea/src/select-textarea.js.map +1 -1
- package/lib/components/select-textarea/src/select-textarea.vue.d.ts +39 -0
- package/lib/components/select-textarea/src/select-textarea2.js +31 -100
- package/lib/components/select-textarea/src/select-textarea2.js.map +1 -1
- package/lib/components/title/src/title.d.ts +6 -0
- package/lib/components/title/src/title.js +4 -1
- package/lib/components/title/src/title.js.map +1 -1
- package/lib/components/title/src/title.vue.d.ts +39 -0
- package/lib/components/title/src/title2.js +27 -11
- package/lib/components/title/src/title2.js.map +1 -1
- package/lib/index.js +33 -31
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/theme/hzzt-collapse.css +1 -1
- package/theme/hzzt-pagination.css +1 -1
- package/theme/hzzt-scan.css +1 -1
- package/theme/hzzt-scroll.css +1 -0
- package/theme/hzzt-title.css +1 -1
- package/theme/index.css +1 -1
- package/theme/src/collapse.scss +45 -39
- package/theme/src/index.scss +1 -0
- package/theme/src/pagination.scss +24 -6
- package/theme/src/scan.scss +3 -3
- package/theme/src/scroll.scss +42 -0
- package/theme/src/title.scss +14 -5
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse2.mjs","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse\">\n <div class=\"hzzt-
|
|
1
|
+
{"version":3,"file":"collapse2.mjs","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse flex column\">\n <div class=\"hzzt-collapse__top\">\n <div class=\"hzzt-collapse__title\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div v-if=\"showLine\" class=\"hzzt-collapse__line\" />\n <slot name=\"toggle-btn\">\n <div class=\"hzzt-collapse__btn\" @click=\"toggle\">\n <hzzt-icon :name=\"!expand ? 'hzzt-plus-square-outline' : 'hzzt-minus-square-outline'\"\n class=\"hzzt-collapse__icon\" size=\"14\" />\n <span>{{ expand ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand') }}</span>\n </div>\n </slot>\n </div>\n <div v-show=\"expand\" class=\"hzzt-collapse__content flex-1\">\n <slot />\n </div>\n\n <slot :active=\"expand\" name=\"active\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import {useLocale} from '@hzzt-plus/hooks'\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {ref, watch} from 'vue'\n\n defineOptions({\n name: 'HzztCollapse',\n })\n const {t} = useLocale()\n const props = defineProps({\n defaultActive: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n showLine: {\n type: Boolean,\n default: true,\n },\n modelValue: {\n type: Boolean,\n default: true,\n },\n })\n const emit = defineEmits(['update:modelValue'])\n\n const expand = ref(props.modelValue)\n\n if (!props.defaultActive) {\n emit('update:modelValue', false);\n expand.value = false;\n }\n\n watch(() => props.modelValue, (v) => {\n expand.value = v;\n })\n\n function toggle() {\n expand.value = !expand.value;\n emit('update:modelValue', expand.value);\n }\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;mCA8BgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAM,MAAA,EAAC,CAAC,EAAA,GAAI,SAAU,EAAA,CAAA;AAqBtB,IAAM,MAAA,MAAA,GAAS,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAEnC,IAAI,IAAA,CAAC,MAAM,aAAe,EAAA;AACxB,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,KAAA,CAAM,MAAM,KAAA,CAAM,UAAY,EAAA,CAAC,CAAM,KAAA;AACnC,MAAA,MAAA,CAAO,KAAQ,GAAA,CAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAS,MAAS,GAAA;AAChB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AACvB,MAAK,IAAA,CAAA,mBAAA,EAAqB,OAAO,KAAK,CAAA,CAAA;AAAA,KACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Icons from '@element-plus/icons-vue';
|
|
2
|
+
import * as index from './src/components/index.mjs';
|
|
2
3
|
import HzztIcon$1 from './src/index.mjs';
|
|
3
4
|
|
|
4
5
|
const HzztIcon = {
|
|
@@ -7,6 +8,9 @@ const HzztIcon = {
|
|
|
7
8
|
for (const key in Icons) {
|
|
8
9
|
app.component(tarnsElIconName(key), Icons[key]);
|
|
9
10
|
}
|
|
11
|
+
for (const key in index) {
|
|
12
|
+
app.component(tarnsElIconName(key), Icons[key]);
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
};
|
|
12
16
|
function tarnsElIconName(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/icon/index.ts"],"sourcesContent":["import * as Icons from '@element-plus/icons-vue'\nimport Icon from './src/index.vue'\nimport type {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/icon/index.ts"],"sourcesContent":["import * as Icons from '@element-plus/icons-vue'\nimport * as HzztIcons from './src/components/index'\nimport Icon from './src/index.vue'\nimport type {App} from '@vue/runtime-core'\n\nexport const HzztIcon = {\n install(app: App) {\n app.component('HzztIcon', Icon)\n for (const key in Icons) {\n app.component(tarnsElIconName(key), Icons[key])\n }\n for (const key in HzztIcons) {\n app.component(tarnsElIconName(key), Icons[key])\n }\n },\n}\n\nexport default HzztIcon\n\nfunction tarnsElIconName(name) {\n return `hzzt-el${name.replace(\n /[A-Z]/g,\n (match) => `-${match.toLocaleLowerCase()}`\n )}`\n}\n"],"names":["Icon","HzztIcons"],"mappings":";;;;AAGY,MAAC,QAAQ,GAAG;AACxB,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,GAAG,CAAC,SAAS,CAAC,UAAU,EAAEA,UAAI,CAAC,CAAC;AACpC,IAAI,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AAC7B,MAAM,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACtD,KAAK;AACL,IAAI,KAAK,MAAM,GAAG,IAAIC,KAAS,EAAE;AACjC,MAAM,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE;AAEF,SAAS,eAAe,CAAC,IAAI,EAAE;AAC/B,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, createElementVNode, openBlock, createElementBlock } from 'vue';
|
|
2
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
|
+
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "HzztMinusSquareOutline"
|
|
6
|
+
});
|
|
7
|
+
const _hoisted_1 = {
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
class: "",
|
|
10
|
+
"data-icon": "minus-square",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
focusable: "false",
|
|
13
|
+
height: "1em",
|
|
14
|
+
viewBox: "64 64 896 896",
|
|
15
|
+
width: "1em"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("path", { d: "M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" }, null, -1);
|
|
18
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" }, null, -1);
|
|
19
|
+
const _hoisted_4 = [
|
|
20
|
+
_hoisted_2,
|
|
21
|
+
_hoisted_3
|
|
22
|
+
];
|
|
23
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
24
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_4);
|
|
25
|
+
}
|
|
26
|
+
var minusSquareOutline = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "minus-square-outline.vue"]]);
|
|
27
|
+
|
|
28
|
+
export { minusSquareOutline as default };
|
|
29
|
+
//# sourceMappingURL=minus-square-outline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minus-square-outline.mjs","sources":["../../../../../../../packages/components/icon/src/components/minus-square-outline.vue"],"sourcesContent":["<template>\n <svg\n aria-hidden=\"true\"\n class=\"\"\n data-icon=\"minus-square\"\n fill=\"currentColor\"\n focusable=\"false\"\n height=\"1em\"\n viewBox=\"64 64 896 896\"\n width=\"1em\"\n ><path d=\"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z\" /><path d=\"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" /></svg>\n</template>\n\n<script lang=\"ts\" setup>\n\n defineOptions({\n name: 'HzztMinusSquareOutline',\n })\n</script>\n"],"names":["DO_defineComponent","_createElementVNode","_openBlock","_createElementBlock"],"mappings":";;;kCAegBA,eAAA,CAAA;AAAA,EACZ,IAAM,EAAA,wBAAA;AACR,CAAA,CAAA,CAAA;;EAfE,aAAY,EAAA,MAAA;AAAA,EACZ,KAAM,EAAA,EAAA;AAAA,EACN,WAAU,EAAA,cAAA;AAAA,EACV,IAAK,EAAA,cAAA;AAAA,EACL,SAAU,EAAA,OAAA;AAAA,EACV,MAAO,EAAA,KAAA;AAAA,EACP,OAAQ,EAAA,eAAA;AAAA,EACR,KAAM,EAAA,KAAA;;AACP,MAAA,UAAA,mBAAAC,kBAAA,CAAA,MAAA,EAAA,EAAA,CAAA,EAAA,2FAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,MAAsG,UAAA,mBAAAA,kBAAA,CAAA,MAAA,EAAA,EAAA,CAAA,EAAA,yIAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,gBAAH,GAAA;AAAA,EAAA,UAAA;AAAA,EAAA,UAAA;AAAA,CAAA,CAAA;AAAA,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AAAG,EAAA,OAAAC,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA,UAAA,CAAA,CAAA;AAAA,CAAoJ;AAAH,yBAAA,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,0BAAA,CAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, createElementVNode, openBlock, createElementBlock } from 'vue';
|
|
2
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
|
+
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "HzztPlusSquareOutline"
|
|
6
|
+
});
|
|
7
|
+
const _hoisted_1 = {
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
class: "",
|
|
10
|
+
"data-icon": "plus-square",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
focusable: "false",
|
|
13
|
+
height: "1em",
|
|
14
|
+
viewBox: "64 64 896 896",
|
|
15
|
+
width: "1em"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("path", { d: "M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" }, null, -1);
|
|
18
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" }, null, -1);
|
|
19
|
+
const _hoisted_4 = [
|
|
20
|
+
_hoisted_2,
|
|
21
|
+
_hoisted_3
|
|
22
|
+
];
|
|
23
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
24
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_4);
|
|
25
|
+
}
|
|
26
|
+
var plusSquareOutline = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "plus-square-outline.vue"]]);
|
|
27
|
+
|
|
28
|
+
export { plusSquareOutline as default };
|
|
29
|
+
//# sourceMappingURL=plus-square-outline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plus-square-outline.mjs","sources":["../../../../../../../packages/components/icon/src/components/plus-square-outline.vue"],"sourcesContent":["<template>\n <svg\n aria-hidden=\"true\"\n class=\"\"\n data-icon=\"plus-square\"\n fill=\"currentColor\"\n focusable=\"false\"\n height=\"1em\"\n viewBox=\"64 64 896 896\"\n width=\"1em\"\n ><path d=\"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z\" /><path d=\"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" /></svg>\n</template>\n\n<script lang=\"ts\" setup>\n\n defineOptions({\n name: 'HzztPlusSquareOutline',\n })\n</script>\n"],"names":["DO_defineComponent","_createElementVNode","_openBlock","_createElementBlock"],"mappings":";;;kCAegBA,eAAA,CAAA;AAAA,EACZ,IAAM,EAAA,uBAAA;AACR,CAAA,CAAA,CAAA;;EAfE,aAAY,EAAA,MAAA;AAAA,EACZ,KAAM,EAAA,EAAA;AAAA,EACN,WAAU,EAAA,aAAA;AAAA,EACV,IAAK,EAAA,cAAA;AAAA,EACL,SAAU,EAAA,OAAA;AAAA,EACV,MAAO,EAAA,KAAA;AAAA,EACP,OAAQ,EAAA,eAAA;AAAA,EACR,KAAM,EAAA,KAAA;;AACP,MAAA,UAAA,mBAAAC,kBAAA,CAAA,MAAA,EAAA,EAAA,CAAA,EAAA,2LAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,MAAsM,UAAA,mBAAAA,kBAAA,CAAA,MAAA,EAAA,EAAA,CAAA,EAAA,yIAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,gBAAH,GAAA;AAAA,EAAA,UAAA;AAAA,EAAA,UAAA;AAAA,CAAA,CAAA;AAAA,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AAAG,EAAA,OAAAC,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA,UAAA,CAAA,CAAA;AAAA,CAAoJ;AAAH,wBAAA,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,yBAAA,CAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
package/es/components/index.d.ts
CHANGED
package/es/components/index.mjs
CHANGED
|
@@ -17,13 +17,14 @@ export { HzztInputRange } from './input-range/index.mjs';
|
|
|
17
17
|
export { HzztCascader } from './cascader/index.mjs';
|
|
18
18
|
export { HzztSelect } from './select/index.mjs';
|
|
19
19
|
export { HzztClickInput } from './click-input/index.mjs';
|
|
20
|
+
export { HzztScroll } from './scroll/index.mjs';
|
|
20
21
|
export { titleProps } from './title/src/title.mjs';
|
|
21
22
|
export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
|
|
22
23
|
export { configProviderContextKey } from './config-provider/src/constants.mjs';
|
|
23
24
|
export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
|
|
24
25
|
export { scanEmits, scanProps } from './scan/src/scan.mjs';
|
|
25
26
|
export { selectInputEmits, selectInputProps } from './select-input/src/select-input.mjs';
|
|
26
|
-
export { selectTextareaEmits, selectTextareaProps } from './select-textarea/src/select-
|
|
27
|
+
export { selectTextareaEmits, selectTextareaProps } from './select-textarea/src/select-textarea2.mjs';
|
|
27
28
|
export { inputRangeEmits, inputRangeProps } from './input-range/src/input-range.mjs';
|
|
28
29
|
export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
|
|
29
30
|
export { selectEmits, selectProps } from './select/src/select.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,8 +23,8 @@ export declare const HzztPagination: import("hzzt-plus/es/utils").SFCWithInstall
|
|
|
23
23
|
}>>;
|
|
24
24
|
emit: (event: "prev" | "next", ...args: any[]) => void;
|
|
25
25
|
t: import("../..").Translator;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
pageChange: (type: string, page?: number | undefined) => void;
|
|
27
|
+
handleJumpPage: (val: string | number) => void;
|
|
28
28
|
HzztIcon: import("vue").DefineComponent<{
|
|
29
29
|
name: {
|
|
30
30
|
type: StringConstructor;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock,
|
|
1
|
+
import { createElementVNode, defineComponent, resolveComponent, openBlock, createElementBlock, createTextVNode, toDisplayString, unref, renderSlot, createVNode, normalizeClass } from 'vue';
|
|
2
2
|
import HzztIcon from '../../icon/src/index.mjs';
|
|
3
3
|
import '../../../hooks/index.mjs';
|
|
4
4
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
5
|
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
6
6
|
|
|
7
|
-
const _hoisted_1 = { class: "flex justify-content-between hzzt-pagination" };
|
|
8
|
-
const _hoisted_2 = { class: "flex
|
|
9
|
-
const _hoisted_3 = { class: "
|
|
10
|
-
const _hoisted_4 = { class: "
|
|
7
|
+
const _hoisted_1 = { class: "flex align-items-center justify-content-between hzzt-pagination" };
|
|
8
|
+
const _hoisted_2 = { class: "flex flex-1" };
|
|
9
|
+
const _hoisted_3 = { class: "font-14" };
|
|
10
|
+
const _hoisted_4 = { class: "hzzt-pagination__count" };
|
|
11
|
+
const _hoisted_5 = { class: "flex-1" };
|
|
12
|
+
const _hoisted_6 = { class: "font-14 flex align-items-center" };
|
|
13
|
+
const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", { class: "margin-h-2" }, "/", -1);
|
|
11
14
|
const __default__ = defineComponent({
|
|
12
15
|
name: "HzztPagination"
|
|
13
16
|
});
|
|
@@ -27,35 +30,60 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
30
|
setup(__props, { emit }) {
|
|
28
31
|
const props = __props;
|
|
29
32
|
const { t } = useLocale();
|
|
30
|
-
function
|
|
31
|
-
if (props.pagination.current_page
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
function pageChange(type, page) {
|
|
34
|
+
if (type === "next" && props.pagination.current_page >= props.pagination.total_pages || type === "prev" && props.pagination.current_page <= 1)
|
|
35
|
+
return;
|
|
36
|
+
if (type === "jump") {
|
|
37
|
+
emit("next", page);
|
|
38
|
+
return;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
function nextPage() {
|
|
38
|
-
if (props.pagination.current_page < props.pagination.total_pages) {
|
|
40
|
+
if (type === "next") {
|
|
39
41
|
emit("next", props.pagination.current_page + 1);
|
|
40
42
|
} else {
|
|
41
|
-
|
|
43
|
+
emit("prev", props.pagination.current_page - 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function handleJumpPage(val) {
|
|
47
|
+
val = Math.trunc(+val);
|
|
48
|
+
if (val > props.pagination.total_pages) {
|
|
49
|
+
val = props.pagination.total_pages;
|
|
50
|
+
} else if (val < 1) {
|
|
51
|
+
val = 1;
|
|
42
52
|
}
|
|
53
|
+
pageChange("jump", Number(val));
|
|
43
54
|
}
|
|
44
55
|
return (_ctx, _cache) => {
|
|
56
|
+
const _component_el_input = resolveComponent("el-input");
|
|
45
57
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
46
|
-
createElementVNode("
|
|
47
|
-
|
|
58
|
+
createElementVNode("div", _hoisted_2, [
|
|
59
|
+
createElementVNode("div", _hoisted_3, [
|
|
60
|
+
createTextVNode(toDisplayString(unref(t)("hzzt.pagination.total")) + " ", 1),
|
|
61
|
+
createElementVNode("span", _hoisted_4, toDisplayString(__props.pagination.total || 0), 1),
|
|
62
|
+
createTextVNode(" " + toDisplayString(unref(t)("hzzt.pagination.strip")), 1)
|
|
63
|
+
]),
|
|
64
|
+
createElementVNode("div", _hoisted_5, [
|
|
65
|
+
renderSlot(_ctx.$slots, "left")
|
|
66
|
+
])
|
|
67
|
+
]),
|
|
68
|
+
createElementVNode("div", _hoisted_6, [
|
|
48
69
|
renderSlot(_ctx.$slots, "right"),
|
|
49
70
|
createVNode(HzztIcon, {
|
|
50
|
-
class: normalizeClass(["
|
|
71
|
+
class: normalizeClass([{ "is-disabled": __props.pagination.current_page === 1 }, "margin-r-1 hzzt-pagination__icon"]),
|
|
51
72
|
name: "arrow-left",
|
|
52
|
-
onClick:
|
|
73
|
+
onClick: _cache[0] || (_cache[0] = ($event) => pageChange("prev"))
|
|
53
74
|
}, null, 8, ["class"]),
|
|
54
|
-
|
|
75
|
+
createVNode(_component_el_input, {
|
|
76
|
+
modelValue: __props.pagination.current_page,
|
|
77
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => __props.pagination.current_page = $event),
|
|
78
|
+
class: "hzzt-pagination__input",
|
|
79
|
+
onChange: handleJumpPage
|
|
80
|
+
}, null, 8, ["modelValue"]),
|
|
81
|
+
_hoisted_7,
|
|
82
|
+
createElementVNode("span", null, toDisplayString(__props.pagination.total_pages), 1),
|
|
55
83
|
createVNode(HzztIcon, {
|
|
56
|
-
class: normalizeClass(["
|
|
84
|
+
class: normalizeClass([{ "is-disabled": __props.pagination.current_page === __props.pagination.total_pages }, "margin-l-1 hzzt-pagination__icon"]),
|
|
57
85
|
name: "arrow-right",
|
|
58
|
-
onClick:
|
|
86
|
+
onClick: _cache[2] || (_cache[2] = ($event) => pageChange("next"))
|
|
59
87
|
}, null, 8, ["class"])
|
|
60
88
|
])
|
|
61
89
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/pagination/src/index.vue"],"sourcesContent":["<template>\n <div class=\"flex justify-content-between hzzt-pagination\">\n <
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/pagination/src/index.vue"],"sourcesContent":["<template>\n <div class=\"flex align-items-center justify-content-between hzzt-pagination\">\n <div class=\"flex flex-1\">\n <div class=\"font-14\">\n {{ t('hzzt.pagination.total') }}\n <span class=\"hzzt-pagination__count\">{{ pagination.total || 0 }}</span>\n {{ t('hzzt.pagination.strip') }}\n </div>\n <div class=\"flex-1\">\n <slot name=\"left\" />\n </div>\n </div>\n <div class=\"font-14 flex align-items-center\">\n <slot name=\"right\" />\n <hzzt-icon :class=\"{'is-disabled': pagination.current_page === 1}\" class=\"margin-r-1 hzzt-pagination__icon\"\n name=\"arrow-left\"\n @click=\"pageChange('prev')\" />\n <el-input v-model=\"pagination.current_page\" class=\"hzzt-pagination__input\" @change=\"handleJumpPage\" />\n <span class=\"margin-h-2\">/</span>\n <span>{{ pagination.total_pages }}</span>\n <hzzt-icon :class=\"{'is-disabled': pagination.current_page === pagination.total_pages}\"\n class=\"margin-l-1 hzzt-pagination__icon\"\n name=\"arrow-right\" @click=\"pageChange('next')\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n import {useLocale} from '@hzzt-plus/hooks'\n\n defineOptions({\n name: 'HzztPagination',\n })\n\n const props = defineProps({\n pagination: {\n type: Object,\n default: () => ({\n total: 0,\n current_page: 1,\n total_pages: 1,\n }),\n },\n })\n\n const emit = defineEmits(['prev', 'next'])\n const {t} = useLocale()\n\n function pageChange(type: string, page?: number) {\n if ((type === 'next' && props.pagination.current_page >= props.pagination.total_pages) ||\n (type === 'prev' && props.pagination.current_page <= 1)\n ) return;\n if (type === 'jump') {\n emit('next', page);\n return;\n }\n if (type === 'next') {\n emit('next', props.pagination.current_page + 1);\n } else {\n emit('prev', props.pagination.current_page - 1);\n }\n }\n\n function handleJumpPage(val: string | number) {\n val = Math.trunc(+val);\n if (val > props.pagination.total_pages) {\n val = props.pagination.total_pages;\n } else if (val < 1) {\n val = 1;\n }\n pageChange('jump', Number(val));\n }\n</script>\n"],"names":["_defineComponent","_resolveComponent","_openBlock","_createElementBlock","_createElementVNode","_createTextVNode","_toDisplayString","_unref"],"mappings":";;;;;;;;;;;;;;;;AA4BE,MAAA,SAAqB,mBAAAA,eAAA,CAAA;AACrB,EAAA,GAAA,WAAwB;;;AAEV,MACN,IAAA,EAAA,MAAA;AACR,MAAA,OAAA,EAAA,OAAA;;;;;;;;;;;;;;;;AAcA,QAAM,OAAE;AAER,OAAS;AACP,MAAA,IAAK,IAAS,KAAA,MAAA,EAAA;AAEZ,QAAA,IAAA,CAAA,MAAA,EAAA,KAAA,CAAA,UAAA,CAAA,YAAA,GAAA,CAAA,CAAA,CAAA;AACF,OAAA;AACE,QAAA,IAAA,CAAK,QAAQ,KAAI,CAAA,UAAA,CAAA,YAAA,GAAA,CAAA,CAAA,CAAA;AACjB,OAAA;AAAA,KACF;AACA,IAAA,uBAAqB,CAAA,GAAA,EAAA;AACnB,MAAA,GAAA,GAAA,IAAa,CAAA,KAAA,CAAA,CAAA,GAAM,CAAW,CAAA;AAAgB,MAChD,IAAO,GAAA,GAAA,KAAA,CAAA,UAAA,CAAA,WAAA,EAAA;AACL,QAAA,GAAA,GAAa,KAAA,CAAA,UAAiB,CAAA,WAAA,CAAA;AAAgB,OAChD,MAAA,IAAA,GAAA,GAAA,CAAA,EAAA;AAAA,QACF,GAAA,GAAA,CAAA,CAAA;AAEA,OAAA;AACE,MAAM,UAAA,CAAK,MAAM,EAAI,MAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACrB,KAAI;AACF,IAAA,OAAA,CAAA,YAAuB,KAAA;AAAA,MACzB,MAAA,mBAAoB,GAAAC,gBAAA,CAAA,UAAA,CAAA,CAAA;AAClB,MAAM,OAAAC,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,QACRC,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AACA,UAAWA,kBAAe,CAAA,KAAG,EAAC,UAAA,EAAA;AAAA,YAChCC,eAAA,CAAAC,eAAA,CAAAC,KAAA,CAAA,CAAA,CAAA,CAAA,uBAAA,CAAA,CAAA,GAAA,GAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,8 +23,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
}>>;
|
|
24
24
|
emit: (event: "prev" | "next", ...args: any[]) => void;
|
|
25
25
|
t: import("hzzt-plus/es/hooks").Translator;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
pageChange: (type: string, page?: number | undefined) => void;
|
|
27
|
+
handleJumpPage: (val: string | number) => void;
|
|
28
28
|
HzztIcon: import("vue").DefineComponent<{
|
|
29
29
|
name: {
|
|
30
30
|
type: StringConstructor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import '../../utils/index.mjs';
|
|
2
|
+
import Scroll from './src/scroll2.mjs';
|
|
3
|
+
import './src/scroll.mjs';
|
|
4
|
+
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
|
+
|
|
6
|
+
const HzztScroll = withInstall(Scroll);
|
|
7
|
+
|
|
8
|
+
export { HzztScroll, HzztScroll as default };
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/scroll/index.ts"],"sourcesContent":["import { withInstall } from '@hzzt-plus/utils'\nimport Scroll from './src/scroll.vue'\nimport type { SFCWithInstall } from '@hzzt-plus/utils'\n\nexport const HzztScroll: SFCWithInstall<typeof Scroll> = withInstall(Scroll)\nexport default HzztScroll\n\nexport * from './src/scroll'\n"],"names":[],"mappings":";;;;;AAEY,MAAC,UAAU,GAAG,WAAW,CAAC,MAAM;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
navTranslateX: import("vue").Ref<number>;
|
|
3
|
+
scrollRef: import("vue").Ref<HTMLElement | null>;
|
|
4
|
+
scrollContentRef: import("vue").Ref<HTMLElement | null>;
|
|
5
|
+
scrollable: import("vue").Ref<boolean>;
|
|
6
|
+
update: () => void;
|
|
7
|
+
btnNavPrev: () => void;
|
|
8
|
+
btnNavNext: () => void;
|
|
9
|
+
HzztIcon: import("vue").DefineComponent<{
|
|
10
|
+
name: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
type: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
name: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
type: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>> & {
|
|
29
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
30
|
+
}>>;
|
|
31
|
+
attrs: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
componentName: import("vue").ComputedRef<string>;
|
|
35
|
+
ElIcon: import("element-plus/es/utils").SFCWithInstall<{
|
|
36
|
+
new (...args: any[]): {
|
|
37
|
+
$: import("vue").ComponentInternalInstance;
|
|
38
|
+
$data: {};
|
|
39
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
readonly size: {
|
|
41
|
+
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>>;
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
44
|
+
__epPropKey: true;
|
|
45
|
+
};
|
|
46
|
+
readonly color: {
|
|
47
|
+
readonly type: import("vue").PropType<string>;
|
|
48
|
+
readonly required: false;
|
|
49
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
50
|
+
__epPropKey: true;
|
|
51
|
+
};
|
|
52
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
53
|
+
$attrs: {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
$refs: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
};
|
|
59
|
+
$slots: Readonly<{
|
|
60
|
+
[name: string]: import("vue").Slot | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
63
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
64
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
65
|
+
$el: any;
|
|
66
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
67
|
+
readonly size: {
|
|
68
|
+
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>>;
|
|
69
|
+
readonly required: false;
|
|
70
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
71
|
+
__epPropKey: true;
|
|
72
|
+
};
|
|
73
|
+
readonly color: {
|
|
74
|
+
readonly type: import("vue").PropType<string>;
|
|
75
|
+
readonly required: false;
|
|
76
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
77
|
+
__epPropKey: true;
|
|
78
|
+
};
|
|
79
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
80
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
81
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
82
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
83
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
84
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
85
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
86
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
87
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
88
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
89
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
90
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
91
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
92
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
93
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
94
|
+
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;
|
|
95
|
+
};
|
|
96
|
+
$forceUpdate: () => void;
|
|
97
|
+
$nextTick: typeof import("vue").nextTick;
|
|
98
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
99
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
|
100
|
+
readonly size: {
|
|
101
|
+
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>>;
|
|
102
|
+
readonly required: false;
|
|
103
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
104
|
+
__epPropKey: true;
|
|
105
|
+
};
|
|
106
|
+
readonly color: {
|
|
107
|
+
readonly type: import("vue").PropType<string>;
|
|
108
|
+
readonly required: false;
|
|
109
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
110
|
+
__epPropKey: true;
|
|
111
|
+
};
|
|
112
|
+
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
113
|
+
__isFragment?: undefined;
|
|
114
|
+
__isTeleport?: undefined;
|
|
115
|
+
__isSuspense?: undefined;
|
|
116
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
117
|
+
readonly size: {
|
|
118
|
+
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>>;
|
|
119
|
+
readonly required: false;
|
|
120
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
121
|
+
__epPropKey: true;
|
|
122
|
+
};
|
|
123
|
+
readonly color: {
|
|
124
|
+
readonly type: import("vue").PropType<string>;
|
|
125
|
+
readonly required: false;
|
|
126
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
127
|
+
__epPropKey: true;
|
|
128
|
+
};
|
|
129
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
130
|
+
$slots: {
|
|
131
|
+
default?(_: {}): any;
|
|
132
|
+
};
|
|
133
|
+
})>;
|
|
134
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
135
|
+
name: {
|
|
136
|
+
type: StringConstructor;
|
|
137
|
+
required: true;
|
|
138
|
+
};
|
|
139
|
+
type: {
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
default: string;
|
|
142
|
+
};
|
|
143
|
+
}>>, {
|
|
144
|
+
type: string;
|
|
145
|
+
}>;
|
|
146
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
147
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineComponent, ref, onUpdated, openBlock, createElementBlock, normalizeClass, createVNode, createCommentVNode, createElementVNode, normalizeStyle, renderSlot } from 'vue';
|
|
2
|
+
import { useResizeObserver } from '@vueuse/core';
|
|
3
|
+
import HzztIcon from '../../icon/src/index.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
|
|
6
|
+
const __default__ = defineComponent({
|
|
7
|
+
name: "HzztScroll"
|
|
8
|
+
});
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
...__default__,
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const navTranslateX = ref(0);
|
|
13
|
+
const scrollRef = ref(null);
|
|
14
|
+
const scrollContentRef = ref(null);
|
|
15
|
+
const scrollable = ref(false);
|
|
16
|
+
function update() {
|
|
17
|
+
if (!scrollRef.value || !scrollContentRef.value)
|
|
18
|
+
return;
|
|
19
|
+
const scrollWidth = scrollRef.value ? scrollRef.value.offsetWidth : 0;
|
|
20
|
+
const contentWidth = scrollContentRef.value ? scrollContentRef.value.offsetWidth : 0;
|
|
21
|
+
if (scrollWidth >= contentWidth) {
|
|
22
|
+
scrollable.value = false;
|
|
23
|
+
navTranslateX.value = 0;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
scrollable.value = true;
|
|
27
|
+
}
|
|
28
|
+
useResizeObserver(scrollContentRef, update);
|
|
29
|
+
onUpdated(() => update());
|
|
30
|
+
function btnNavPrev() {
|
|
31
|
+
var _a;
|
|
32
|
+
const containerSize = ((_a = scrollRef.value) == null ? void 0 : _a.offsetWidth) || 0;
|
|
33
|
+
const currentOffset = navTranslateX.value;
|
|
34
|
+
if (!currentOffset)
|
|
35
|
+
return;
|
|
36
|
+
const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
|
|
37
|
+
navTranslateX.value = newOffset;
|
|
38
|
+
}
|
|
39
|
+
function btnNavNext() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const navSize = ((_a = scrollContentRef.value) == null ? void 0 : _a.offsetWidth) || 0;
|
|
42
|
+
const currentOffset = navTranslateX.value;
|
|
43
|
+
const containerSize = ((_b = scrollRef.value) == null ? void 0 : _b.offsetWidth) || 0;
|
|
44
|
+
if (navSize - currentOffset < containerSize)
|
|
45
|
+
return;
|
|
46
|
+
const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
|
|
47
|
+
navTranslateX.value = newOffset;
|
|
48
|
+
}
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return openBlock(), createElementBlock("div", {
|
|
51
|
+
class: normalizeClass([{ "is-scrollable": scrollable.value }, "relative hzzt-scroll"])
|
|
52
|
+
}, [
|
|
53
|
+
scrollable.value ? (openBlock(), createElementBlock("div", {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "hzzt-scroll__nav-prev",
|
|
56
|
+
onClick: btnNavPrev
|
|
57
|
+
}, [
|
|
58
|
+
createVNode(HzztIcon, { name: "arrow-left" })
|
|
59
|
+
])) : createCommentVNode("v-if", true),
|
|
60
|
+
scrollable.value ? (openBlock(), createElementBlock("div", {
|
|
61
|
+
key: 1,
|
|
62
|
+
class: "hzzt-scroll__nav-next",
|
|
63
|
+
onClick: btnNavNext
|
|
64
|
+
}, [
|
|
65
|
+
createVNode(HzztIcon, { name: "arrow-right" })
|
|
66
|
+
])) : createCommentVNode("v-if", true),
|
|
67
|
+
createElementVNode("div", {
|
|
68
|
+
ref_key: "scrollRef",
|
|
69
|
+
ref: scrollRef,
|
|
70
|
+
class: "overflow-hidden"
|
|
71
|
+
}, [
|
|
72
|
+
createElementVNode("div", {
|
|
73
|
+
ref_key: "scrollContentRef",
|
|
74
|
+
ref: scrollContentRef,
|
|
75
|
+
style: normalizeStyle({ transform: `translateX(${-navTranslateX.value}px)` }),
|
|
76
|
+
class: "hzzt-scroll__content"
|
|
77
|
+
}, [
|
|
78
|
+
renderSlot(_ctx.$slots, "default")
|
|
79
|
+
], 4)
|
|
80
|
+
], 512)
|
|
81
|
+
], 2);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
var Scroll = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "scroll.vue"]]);
|
|
86
|
+
|
|
87
|
+
export { Scroll as default };
|
|
88
|
+
//# sourceMappingURL=scroll2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll2.mjs","sources":["../../../../../../packages/components/scroll/src/scroll.vue"],"sourcesContent":["<template>\n <div :class=\"{'is-scrollable':scrollable}\" class=\"relative hzzt-scroll\">\n <div v-if=\"scrollable\" class=\"hzzt-scroll__nav-prev\" @click=\"btnNavPrev\">\n <hzzt-icon name=\"arrow-left\" />\n </div>\n <div v-if=\"scrollable\" class=\"hzzt-scroll__nav-next\" @click=\"btnNavNext\">\n <hzzt-icon name=\"arrow-right\" />\n </div>\n <div ref=\"scrollRef\" class=\"overflow-hidden\">\n <div ref=\"scrollContentRef\" :style=\"{transform: `translateX(${-navTranslateX}px)`}\" class=\"hzzt-scroll__content\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {onUpdated, ref} from 'vue';\n import {useResizeObserver} from '@vueuse/core';\n import HzztIcon from \"@hzzt-plus/components/icon/src/index.vue\";\n\n defineOptions({\n name: 'HzztScroll',\n })\n\n const navTranslateX = ref(0);\n const scrollRef = ref<HTMLElement | null>(null);\n const scrollContentRef = ref<HTMLElement | null>(null);\n const scrollable = ref(false);\n\n function update() {\n if (!scrollRef.value || !scrollContentRef.value) return;\n const scrollWidth = scrollRef.value ? scrollRef.value.offsetWidth : 0;\n const contentWidth = scrollContentRef.value ? scrollContentRef.value.offsetWidth : 0;\n if (scrollWidth >= contentWidth) {\n scrollable.value = false;\n navTranslateX.value = 0;\n return;\n }\n scrollable.value = true;\n }\n\n useResizeObserver(scrollContentRef, update);\n\n onUpdated(() => update());\n\n function btnNavPrev() {\n const containerSize = scrollRef.value?.offsetWidth || 0;\n const currentOffset = navTranslateX.value;\n if (!currentOffset) return;\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;\n navTranslateX.value = newOffset;\n }\n\n function btnNavNext() {\n const navSize = scrollContentRef.value?.offsetWidth || 0;\n const currentOffset = navTranslateX.value;\n const containerSize = scrollRef.value?.offsetWidth || 0;\n if (navSize - currentOffset < containerSize) return;\n const newOffset = navSize - currentOffset > containerSize * 2 ?\n currentOffset + containerSize :\n navSize - containerSize;\n navTranslateX.value = newOffset;\n }\n</script>\n"],"names":[],"mappings":";;;;;mCAqBgB,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;AAEA,IAAM,MAAA,aAAA,GAAgB,IAAI,CAAC,CAAA,CAAA;AAC3B,IAAM,MAAA,SAAA,GAAY,IAAwB,IAAI,CAAA,CAAA;AAC9C,IAAM,MAAA,gBAAA,GAAmB,IAAwB,IAAI,CAAA,CAAA;AACrD,IAAM,MAAA,UAAA,GAAa,IAAI,KAAK,CAAA,CAAA;AAE5B,IAAA,SAAS,MAAS,GAAA;AAChB,MAAA,IAAI,CAAC,SAAA,CAAU,KAAS,IAAA,CAAC,gBAAiB,CAAA,KAAA;AAAO,QAAA,OAAA;AACjD,MAAA,MAAM,WAAc,GAAA,SAAA,CAAU,KAAQ,GAAA,SAAA,CAAU,MAAM,WAAc,GAAA,CAAA,CAAA;AACpE,MAAA,MAAM,YAAe,GAAA,gBAAA,CAAiB,KAAQ,GAAA,gBAAA,CAAiB,MAAM,WAAc,GAAA,CAAA,CAAA;AACnF,MAAA,IAAI,eAAe,YAAc,EAAA;AAC/B,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA;AACtB,QAAA,OAAA;AAAA,OACF;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB;AAEA,IAAA,iBAAA,CAAkB,kBAAkB,MAAM,CAAA,CAAA;AAE1C,IAAU,SAAA,CAAA,MAAM,QAAQ,CAAA,CAAA;AAExB,IAAA,SAAS,UAAa,GAAA;AACpB,MAAM,IAAA,EAAA,CAAA;AACN,MAAA,MAAM,gBAAgB,CAAc,CAAA,EAAA,GAAA,SAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AACpC,MAAA,MAAK,aAAA,GAAA,aAAA,CAAA,KAAA,CAAA;AAAe,MAAA,IAAA,CAAA,aAAA;AACpB,QAAA,OAAkB;AAClB,MAAA,MAAA,SAAsB,GAAA,aAAA,GAAA,aAAA,GAAA,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA;AAAA,MACxB,aAAA,CAAA,KAAA,GAAA,SAAA,CAAA;AAEA,KAAA;AACE,IAAM,SAAA,UAA2B,GAAA;AACjC,MAAA,IAAA,EAAM;AACN,MAAM,MAAA,OAAA,GAAA,CAAA,CAAA,EAAA,GAA0B,gBAAO,CAAe,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AACtD,MAAA,mBAA8B,GAAA,aAAA,CAAA,KAAA,CAAA;AAAe,MAAA,MAAA,aAAA,GAAA,CAAA,CAAA,EAAA,GAAA,SAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA,KAAA,CAAA,CAAA;AAC7C,MAAA,IAAA,uBAA4B,GAAA,aAAA;AAG5B,QAAA,OAAA;AAAsB,MACxB,MAAA,SAAA,GAAA,OAAA,GAAA,aAAA,GAAA,aAAA,GAAA,CAAA,GAAA,aAAA,GAAA,aAAA,GAAA,OAAA,GAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|