hzzt-plus 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +355 -236
- package/dist/index.full.min.js +12 -12
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +15 -15
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +353 -237
- 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/index.d.ts +1 -0
- package/es/components/index.mjs +4 -2
- package/es/components/index.mjs.map +1 -1
- package/es/components/input-range/index.mjs +2 -2
- package/es/components/input-range/src/input-range.mjs +26 -76
- package/es/components/input-range/src/input-range.mjs.map +1 -1
- package/es/components/input-range/src/input-range2.mjs +76 -26
- package/es/components/input-range/src/input-range2.mjs.map +1 -1
- package/es/components/lazy-list/index.d.ts +5 -0
- package/es/components/lazy-list/index.mjs +9 -0
- package/es/components/lazy-list/index.mjs.map +1 -0
- package/es/components/lazy-list/src/lazy-list.d.ts +14 -0
- package/es/components/lazy-list/src/lazy-list.mjs +27 -0
- package/es/components/lazy-list/src/lazy-list.mjs.map +1 -0
- package/es/components/lazy-list/src/lazy-list.vue.d.ts +57 -0
- package/es/components/lazy-list/src/lazy-list2.mjs +85 -0
- package/es/components/lazy-list/src/lazy-list2.mjs.map +1 -0
- package/es/components/lazy-list/style/css.d.ts +2 -0
- package/es/components/lazy-list/style/css.mjs +3 -0
- package/es/components/lazy-list/style/css.mjs.map +1 -0
- package/es/components/lazy-list/style/index.d.ts +2 -0
- package/es/components/lazy-list/style/index.mjs +3 -0
- package/es/components/lazy-list/style/index.mjs.map +1 -0
- package/es/components/scroll/src/scroll.mjs +4 -0
- package/es/components/scroll/src/scroll.mjs.map +1 -1
- package/es/components/scroll/src/scroll.vue.d.ts +1 -0
- package/es/components/select/src/select.vue.d.ts +1 -0
- package/es/components/select/src/select2.mjs +11 -1
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select-input/index.mjs +2 -2
- package/es/components/select-input/src/select-input.mjs +124 -45
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input2.mjs +45 -124
- package/es/components/select-input/src/select-input2.mjs.map +1 -1
- package/es/index.mjs +4 -2
- 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/index.d.ts +1 -0
- package/lib/components/index.js +7 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/input-range/index.js +2 -2
- package/lib/components/input-range/src/input-range.js +27 -76
- package/lib/components/input-range/src/input-range.js.map +1 -1
- package/lib/components/input-range/src/input-range2.js +76 -27
- package/lib/components/input-range/src/input-range2.js.map +1 -1
- package/lib/components/lazy-list/index.d.ts +5 -0
- package/lib/components/lazy-list/index.js +16 -0
- package/lib/components/lazy-list/index.js.map +1 -0
- package/lib/components/lazy-list/src/lazy-list.d.ts +14 -0
- package/lib/components/lazy-list/src/lazy-list.js +32 -0
- package/lib/components/lazy-list/src/lazy-list.js.map +1 -0
- package/lib/components/lazy-list/src/lazy-list.vue.d.ts +57 -0
- package/lib/components/lazy-list/src/lazy-list2.js +89 -0
- package/lib/components/lazy-list/src/lazy-list2.js.map +1 -0
- package/lib/components/lazy-list/style/css.d.ts +2 -0
- package/lib/components/lazy-list/style/css.js +6 -0
- package/lib/components/lazy-list/style/css.js.map +1 -0
- package/lib/components/lazy-list/style/index.d.ts +2 -0
- package/lib/components/lazy-list/style/index.js +6 -0
- package/lib/components/lazy-list/style/index.js.map +1 -0
- package/lib/components/scroll/src/scroll.js +4 -0
- package/lib/components/scroll/src/scroll.js.map +1 -1
- package/lib/components/scroll/src/scroll.vue.d.ts +1 -0
- package/lib/components/select/src/select.vue.d.ts +1 -0
- package/lib/components/select/src/select2.js +11 -1
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select-input/index.js +2 -2
- package/lib/components/select-input/src/select-input.js +124 -46
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input2.js +46 -124
- package/lib/components/select-input/src/select-input2.js.map +1 -1
- package/lib/index.js +37 -32
- 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/tags.json +1 -1
- package/theme/hzzt-lazy-list.css +1 -0
- package/theme/index.css +1 -1
- package/theme/src/index.scss +1 -0
- package/theme/src/lazy-list.scss +21 -0
- package/web-types.json +1 -1
package/dist/locale/en.js
CHANGED
package/dist/locale/en.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.3 */(function(e,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis!="undefined"?globalThis:e||self,e.HzztPlusLocaleEn=r())})(this,function(){"use strict";var e={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};return e});
|
|
2
2
|
//# sourceMappingURL=en.min.js.map
|
package/dist/locale/en.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.3 */var r={name:"en",hzzt:{collapse:{expand:"expand",retract:"retract"},pagination:{total:"",strip:""},pageSize:{total:"Total ",strip:"",page:"page",d:"",per_page:"per page"},quarterpicker:{prevYear:"Previous Year",nextYear:"Next Year",year:"",firstQuarter:"First quarter",secondQuarter:"Second quarter",thirdQuarter:"Third quarter",fourthQuarter:"Fourth quarter"}}};export{r as default};
|
|
2
2
|
//# sourceMappingURL=en.min.mjs.map
|
package/dist/locale/en.mjs
CHANGED
package/dist/locale/zh-cn.js
CHANGED
package/dist/locale/zh-cn.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.3 */(function(u,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define(e):(u=typeof globalThis!="undefined"?globalThis:u||self,u.HzztPlusLocaleZhCn=e())})(this,function(){"use strict";var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};return u});
|
|
2
2
|
//# sourceMappingURL=zh-cn.min.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Hzzt Plus v2.0.
|
|
1
|
+
/*! Hzzt Plus v2.0.3 */var u={name:"zh-cn",hzzt:{collapse:{expand:"\u5C55\u5F00",retract:"\u6536\u8D77"},pagination:{total:"\u5171",strip:"\u6761"},pageSize:{total:"\u5171",strip:"\u6761",d:"\u7B2C",page:"\u9875",per_page:"\u6BCF\u9875"},quarterpicker:{prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",year:"\u5E74",firstQuarter:"\u7B2C\u4E00\u5B63\u5EA6",secondQuarter:"\u7B2C\u4E8C\u5B63\u5EA6",thirdQuarter:"\u7B2C\u4E09\u5B63\u5EA6",fourthQuarter:"\u7B2C\u56DB\u5B63\u5EA6"}}};export{u as default};
|
|
2
2
|
//# sourceMappingURL=zh-cn.min.mjs.map
|
package/dist/locale/zh-cn.mjs
CHANGED
package/es/component.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import { HzztCascader } from './components/cascader/index.mjs';
|
|
|
18
18
|
import { HzztSelect } from './components/select/index.mjs';
|
|
19
19
|
import { HzztClickInput } from './components/click-input/index.mjs';
|
|
20
20
|
import { HzztScroll } from './components/scroll/index.mjs';
|
|
21
|
+
import { HzztLazyList } from './components/lazy-list/index.mjs';
|
|
21
22
|
|
|
22
23
|
var Components = [
|
|
23
24
|
HzztConfigProvider,
|
|
@@ -39,7 +40,8 @@ var Components = [
|
|
|
39
40
|
HzztCascader,
|
|
40
41
|
HzztSelect,
|
|
41
42
|
HzztClickInput,
|
|
42
|
-
HzztScroll
|
|
43
|
+
HzztScroll,
|
|
44
|
+
HzztLazyList
|
|
43
45
|
];
|
|
44
46
|
|
|
45
47
|
export { Components as default };
|
package/es/component.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\nimport { HzztTab } from '@hzzt-plus/components/tab'\nimport { HzztIcon } from '@hzzt-plus/components/icon'\nimport { HzztPagination } from '@hzzt-plus/components/pagination'\nimport { HzztTooltip } from '@hzzt-plus/components/tooltip'\nimport { HzztPageSize } from '@hzzt-plus/components/page-size'\nimport { HzztConfirmPassword } from '@hzzt-plus/components/confirm-password'\nimport { HzztCheckButton } from '@hzzt-plus/components/check-button'\nimport { HzztQuarterPicker } from '@hzzt-plus/components/quarter-picker'\nimport { HzztScan } from '@hzzt-plus/components/scan'\nimport { HzztSelectInput } from '@hzzt-plus/components/select-input'\nimport { HzztSelectTextarea } from '@hzzt-plus/components/select-textarea'\nimport { HzztInputRange } from '@hzzt-plus/components/input-range'\nimport { HzztCascader } from '@hzzt-plus/components/cascader'\nimport { HzztSelect } from '@hzzt-plus/components/select'\nimport { HzztClickInput } from '@hzzt-plus/components/click-input'\nimport { HzztScroll } from '@hzzt-plus/components/scroll'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n HzztPagination,\n HzztTooltip,\n HzztPageSize,\n HzztConfirmPassword,\n HzztCheckButton,\n HzztQuarterPicker,\n HzztScan,\n HzztSelectInput,\n HzztSelectTextarea,\n HzztInputRange,\n HzztCascader,\n HzztSelect,\n HzztClickInput,\n HzztScroll,\n] as Plugin[]\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.mjs","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\nimport { HzztTab } from '@hzzt-plus/components/tab'\nimport { HzztIcon } from '@hzzt-plus/components/icon'\nimport { HzztPagination } from '@hzzt-plus/components/pagination'\nimport { HzztTooltip } from '@hzzt-plus/components/tooltip'\nimport { HzztPageSize } from '@hzzt-plus/components/page-size'\nimport { HzztConfirmPassword } from '@hzzt-plus/components/confirm-password'\nimport { HzztCheckButton } from '@hzzt-plus/components/check-button'\nimport { HzztQuarterPicker } from '@hzzt-plus/components/quarter-picker'\nimport { HzztScan } from '@hzzt-plus/components/scan'\nimport { HzztSelectInput } from '@hzzt-plus/components/select-input'\nimport { HzztSelectTextarea } from '@hzzt-plus/components/select-textarea'\nimport { HzztInputRange } from '@hzzt-plus/components/input-range'\nimport { HzztCascader } from '@hzzt-plus/components/cascader'\nimport { HzztSelect } from '@hzzt-plus/components/select'\nimport { HzztClickInput } from '@hzzt-plus/components/click-input'\nimport { HzztScroll } from '@hzzt-plus/components/scroll'\nimport { HzztLazyList } from '@hzzt-plus/components/lazy-list'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n HzztPagination,\n HzztTooltip,\n HzztPageSize,\n HzztConfirmPassword,\n HzztCheckButton,\n HzztQuarterPicker,\n HzztScan,\n HzztSelectInput,\n HzztSelectTextarea,\n HzztInputRange,\n HzztCascader,\n HzztSelect,\n HzztClickInput,\n HzztScroll,\n HzztLazyList,\n] as Plugin[]\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,iBAAe;AACf,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,YAAY;AACd,EAAE,mBAAmB;AACrB,EAAE,eAAe;AACjB,EAAE,iBAAiB;AACnB,EAAE,QAAQ;AACV,EAAE,eAAe;AACjB,EAAE,kBAAkB;AACpB,EAAE,cAAc;AAChB,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAE,UAAU;AACZ,EAAE,YAAY;AACd,CAAC;;;;"}
|
package/es/components/index.d.ts
CHANGED
package/es/components/index.mjs
CHANGED
|
@@ -18,15 +18,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
20
|
export { HzztScroll } from './scroll/index.mjs';
|
|
21
|
+
export { HzztLazyList } from './lazy-list/index.mjs';
|
|
21
22
|
export { titleProps } from './title/src/title.mjs';
|
|
22
23
|
export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
|
|
23
24
|
export { configProviderContextKey } from './config-provider/src/constants.mjs';
|
|
24
25
|
export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
|
|
25
26
|
export { scanEmits, scanProps } from './scan/src/scan.mjs';
|
|
26
|
-
export { selectInputEmits, selectInputProps } from './select-input/src/select-
|
|
27
|
+
export { selectInputEmits, selectInputProps } from './select-input/src/select-input2.mjs';
|
|
27
28
|
export { selectTextareaEmits, selectTextareaProps } from './select-textarea/src/select-textarea.mjs';
|
|
28
|
-
export { inputRangeEmits, inputRangeProps } from './input-range/src/input-
|
|
29
|
+
export { inputRangeEmits, inputRangeProps } from './input-range/src/input-range.mjs';
|
|
29
30
|
export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
|
|
30
31
|
export { selectEmits, selectProps } from './select/src/select.mjs';
|
|
31
32
|
export { clickInputEmits, clickInputProps } from './click-input/src/click-input.mjs';
|
|
33
|
+
export { lazyListEmits, lazyListProps } from './lazy-list/src/lazy-list.mjs';
|
|
32
34
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import InputRange from './src/input-
|
|
3
|
-
export { inputRangeEmits, inputRangeProps } from './src/input-
|
|
2
|
+
import InputRange from './src/input-range2.mjs';
|
|
3
|
+
export { inputRangeEmits, inputRangeProps } from './src/input-range.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztInputRange = withInstall(InputRange);
|
|
@@ -1,81 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { inputRangeProps, inputRangeEmits } from './input-range2.mjs';
|
|
3
|
-
import { useFormSize, useFormDisabled } from 'element-plus';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
4
2
|
import '../../../hooks/index.mjs';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import '../../../constants/index.mjs';
|
|
4
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
6
|
+
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
|
7
|
+
import { isArray } from '@vue/shared';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const inputRangeProps = buildProps({
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
size: useSizeProp,
|
|
15
|
+
disabled: Boolean,
|
|
16
|
+
clearable: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
startPlaceholder: String,
|
|
21
|
+
endPlaceholder: String,
|
|
22
|
+
startProps: Object,
|
|
23
|
+
endProps: Object
|
|
12
24
|
});
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setup(__props, { emit }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const startValue = ref(props.modelValue[0]);
|
|
20
|
-
const endValue = ref(props.modelValue[1]);
|
|
21
|
-
const nsInput = useNamespace("input-range");
|
|
22
|
-
const formSize = useFormSize();
|
|
23
|
-
const formDisabled = useFormDisabled();
|
|
24
|
-
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
25
|
-
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
26
|
-
const containerCls = computed(() => [
|
|
27
|
-
nsInput.b(),
|
|
28
|
-
nsInput.m(trueSize.value)
|
|
29
|
-
]);
|
|
30
|
-
watch(() => props.modelValue, (v) => {
|
|
31
|
-
startValue.value = v[0];
|
|
32
|
-
endValue.value = v[1];
|
|
33
|
-
}, {
|
|
34
|
-
deep: true
|
|
35
|
-
});
|
|
36
|
-
function change() {
|
|
37
|
-
if (startValue.value || endValue.value) {
|
|
38
|
-
const modelValue = [startValue.value, endValue.value];
|
|
39
|
-
emit("update:modelValue", modelValue);
|
|
40
|
-
emit("change", modelValue);
|
|
41
|
-
} else if (!startValue.value && !endValue.value) {
|
|
42
|
-
emit("update:modelValue", []);
|
|
43
|
-
emit("change", []);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return (_ctx, _cache) => {
|
|
47
|
-
const _component_el_input = resolveComponent("el-input");
|
|
48
|
-
return openBlock(), createElementBlock("div", {
|
|
49
|
-
class: normalizeClass(["flex align-items-center", unref(containerCls)])
|
|
50
|
-
}, [
|
|
51
|
-
createVNode(_component_el_input, mergeProps({
|
|
52
|
-
modelValue: startValue.value,
|
|
53
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => startValue.value = $event)
|
|
54
|
-
}, _ctx.startProps, {
|
|
55
|
-
clearable: _ctx.clearable,
|
|
56
|
-
placeholder: _ctx.startPlaceholder,
|
|
57
|
-
size: unref(trueSize),
|
|
58
|
-
disabled: unref(trueDisabled),
|
|
59
|
-
class: "flex-1",
|
|
60
|
-
onChange: change
|
|
61
|
-
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"]),
|
|
62
|
-
_hoisted_1,
|
|
63
|
-
createVNode(_component_el_input, mergeProps({
|
|
64
|
-
modelValue: endValue.value,
|
|
65
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => endValue.value = $event)
|
|
66
|
-
}, _ctx.endProps, {
|
|
67
|
-
clearable: _ctx.clearable,
|
|
68
|
-
placeholder: _ctx.endPlaceholder,
|
|
69
|
-
size: unref(trueSize),
|
|
70
|
-
disabled: unref(trueDisabled),
|
|
71
|
-
class: "flex-1",
|
|
72
|
-
onChange: change
|
|
73
|
-
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"])
|
|
74
|
-
], 2);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
var InputRange = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input-range.vue"]]);
|
|
25
|
+
const inputRangeEmits = {
|
|
26
|
+
[UPDATE_MODEL_EVENT]: (val) => isArray(val),
|
|
27
|
+
[CHANGE_EVENT]: (val) => isArray(val)
|
|
28
|
+
};
|
|
79
29
|
|
|
80
|
-
export {
|
|
30
|
+
export { inputRangeEmits, inputRangeProps };
|
|
81
31
|
//# sourceMappingURL=input-range.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-range.mjs","sources":["../../../../../../packages/components/input-range/src/input-range.
|
|
1
|
+
{"version":3,"file":"input-range.mjs","sources":["../../../../../../packages/components/input-range/src/input-range.ts"],"sourcesContent":["import {buildProps, isArray} from '@hzzt-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type InputRange from './input-range.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\nimport {CHANGE_EVENT, UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const inputRangeProps = buildProps({\n modelValue: {\n type: Array,\n default: () => [],\n },\n size: useSizeProp,\n disabled: Boolean,\n clearable: {\n type: Boolean,\n default: false,\n },\n startPlaceholder: String,\n endPlaceholder: String,\n startProps: Object,\n endProps: Object,\n})\n\nexport type InputRangeProps = ExtractPropTypes<typeof inputRangeProps>\n\nexport const inputRangeEmits = {\n [UPDATE_MODEL_EVENT]: (val: Array<string>) => isArray(val),\n [CHANGE_EVENT]: (val: Array<string>) => isArray(val),\n}\nexport type InputRangeEmits = typeof inputRangeEmits\n\nexport type InputRangeInstance = InstanceType<typeof InputRange>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,gBAAgB,EAAE,MAAM;AAC1B,EAAE,cAAc,EAAE,MAAM;AACxB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,QAAQ,EAAE,MAAM;AAClB,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AAC7C,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AACvC;;;;"}
|
|
@@ -1,31 +1,81 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { createElementVNode, defineComponent, ref, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { inputRangeProps, inputRangeEmits } from './input-range.mjs';
|
|
3
|
+
import { useFormSize, useFormDisabled } from 'element-plus';
|
|
2
4
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
|
7
|
-
import { isArray } from '@vue/shared';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
+
import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
default: () => []
|
|
13
|
-
},
|
|
14
|
-
size: useSizeProp,
|
|
15
|
-
disabled: Boolean,
|
|
16
|
-
clearable: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false
|
|
19
|
-
},
|
|
20
|
-
startPlaceholder: String,
|
|
21
|
-
endPlaceholder: String,
|
|
22
|
-
startProps: Object,
|
|
23
|
-
endProps: Object
|
|
9
|
+
const _hoisted_1 = /* @__PURE__ */ createElementVNode("span", { class: "margin-h-1" }, "\u2014\u2014", -1);
|
|
10
|
+
const __default__ = defineComponent({
|
|
11
|
+
name: "HzztInputRange"
|
|
24
12
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
...__default__,
|
|
15
|
+
props: inputRangeProps,
|
|
16
|
+
emits: inputRangeEmits,
|
|
17
|
+
setup(__props, { emit }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const startValue = ref(props.modelValue[0]);
|
|
20
|
+
const endValue = ref(props.modelValue[1]);
|
|
21
|
+
const nsInput = useNamespace("input-range");
|
|
22
|
+
const formSize = useFormSize();
|
|
23
|
+
const formDisabled = useFormDisabled();
|
|
24
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
25
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
26
|
+
const containerCls = computed(() => [
|
|
27
|
+
nsInput.b(),
|
|
28
|
+
nsInput.m(trueSize.value)
|
|
29
|
+
]);
|
|
30
|
+
watch(() => props.modelValue, (v) => {
|
|
31
|
+
startValue.value = v[0];
|
|
32
|
+
endValue.value = v[1];
|
|
33
|
+
}, {
|
|
34
|
+
deep: true
|
|
35
|
+
});
|
|
36
|
+
function change() {
|
|
37
|
+
if (startValue.value || endValue.value) {
|
|
38
|
+
const modelValue = [startValue.value, endValue.value];
|
|
39
|
+
emit("update:modelValue", modelValue);
|
|
40
|
+
emit("change", modelValue);
|
|
41
|
+
} else if (!startValue.value && !endValue.value) {
|
|
42
|
+
emit("update:modelValue", []);
|
|
43
|
+
emit("change", []);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
const _component_el_input = resolveComponent("el-input");
|
|
48
|
+
return openBlock(), createElementBlock("div", {
|
|
49
|
+
class: normalizeClass(["flex align-items-center", unref(containerCls)])
|
|
50
|
+
}, [
|
|
51
|
+
createVNode(_component_el_input, mergeProps({
|
|
52
|
+
modelValue: startValue.value,
|
|
53
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => startValue.value = $event)
|
|
54
|
+
}, _ctx.startProps, {
|
|
55
|
+
clearable: _ctx.clearable,
|
|
56
|
+
placeholder: _ctx.startPlaceholder,
|
|
57
|
+
size: unref(trueSize),
|
|
58
|
+
disabled: unref(trueDisabled),
|
|
59
|
+
class: "flex-1",
|
|
60
|
+
onChange: change
|
|
61
|
+
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"]),
|
|
62
|
+
_hoisted_1,
|
|
63
|
+
createVNode(_component_el_input, mergeProps({
|
|
64
|
+
modelValue: endValue.value,
|
|
65
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => endValue.value = $event)
|
|
66
|
+
}, _ctx.endProps, {
|
|
67
|
+
clearable: _ctx.clearable,
|
|
68
|
+
placeholder: _ctx.endPlaceholder,
|
|
69
|
+
size: unref(trueSize),
|
|
70
|
+
disabled: unref(trueDisabled),
|
|
71
|
+
class: "flex-1",
|
|
72
|
+
onChange: change
|
|
73
|
+
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"])
|
|
74
|
+
], 2);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var InputRange = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input-range.vue"]]);
|
|
29
79
|
|
|
30
|
-
export {
|
|
80
|
+
export { InputRange as default };
|
|
31
81
|
//# sourceMappingURL=input-range2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-range2.mjs","sources":["../../../../../../packages/components/input-range/src/input-range.
|
|
1
|
+
{"version":3,"file":"input-range2.mjs","sources":["../../../../../../packages/components/input-range/src/input-range.vue"],"sourcesContent":["<template>\n <div class=\"flex align-items-center\" :class=\"containerCls\">\n <el-input\n v-model=\"startValue\"\n v-bind=\"startProps\"\n :clearable=\"clearable\"\n :placeholder=\"startPlaceholder\"\n :size=\"trueSize\"\n :disabled=\"trueDisabled\"\n class=\"flex-1\"\n @change=\"change\"\n />\n <span class=\"margin-h-1\">——</span>\n <el-input\n v-model=\"endValue\"\n v-bind=\"endProps\"\n :clearable=\"clearable\"\n :placeholder=\"endPlaceholder\"\n :size=\"trueSize\"\n :disabled=\"trueDisabled\"\n class=\"flex-1\"\n @change=\"change\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {inputRangeEmits, inputRangeProps} from './input-range'\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import {computed, ref, watch} from \"vue\";\n import {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\n\n defineOptions({\n name: 'HzztInputRange',\n })\n\n const props = defineProps(inputRangeProps)\n const emit = defineEmits(inputRangeEmits)\n\n const startValue = ref(props.modelValue[0])\n const endValue = ref(props.modelValue[1])\n\n const nsInput = useNamespace('input-range')\n\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n watch(() => props.modelValue, (v) => {\n startValue.value = v[0];\n endValue.value = v[1];\n }, {\n deep: true,\n })\n\n function change() {\n if (startValue.value || endValue.value) {\n const modelValue = [startValue.value, endValue.value] as Array<string>;\n emit('update:modelValue', modelValue);\n emit('change', modelValue);\n } else if (!startValue.value && !endValue.value) {\n emit('update:modelValue', []);\n emit('change', []);\n }\n }\n\n</script>\n"],"names":["_defineComponent","_resolveComponent","_openBlock","_createElementBlock","_unref","_createVNode","_mergeProps"],"mappings":";;;;;;;;;;AA2BE,EAAA,IAAA,EAAA;AACA,CAAA,CAAA,CAAA;AACA,MAAQ,SAAA,mBAA2BA,eAAA,CAAA;AACnC,EAAA,GAAA;;wBAEc;AAAA,EACZ,KAAM,CAAA,OAAA,EAAA,EAAA,IAAA,EAAA,EAAA;AACR,IAAA,MAAA,KAAA,GAAA,OAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,YAAa,GAAA,QAAU,CAAA,MAAA,KAAY,CAAC,QAAA,IAAA,YAAA,CAAA,KAAA,CAAA,CAAA;AAC1C,IAAA,MAAM,YAAW,GAAI,QAAM,CAAA,MAAA;AAE3B,MAAM,OAAA,CAAA,CAAA,EAAA;AAEN,MAAA,kBAA6B,CAAA,KAAA,CAAA;AAC7B,KAAA,CAAA,CAAA;AAEA,IAAA,KAAA,CAAM,MAAW,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACf,UAAY,CAAA,KAAA,GAAA,CAAQ,CAAS,CAAA,CAAA,CAAA;AAAyB,MACxD,QAAA,CAAA,KAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,KAAA,EAAA;AAEA,MAAM,IAAA,EAAA,IAAA;AAA8B,KAAA,CAClC;AAAU,IACV,SAAA,MAAU,GAAA;AAAc,MACzB,IAAA,UAAA,CAAA,KAAA,IAAA,QAAA,CAAA,KAAA,EAAA;AAED,QAAA,MAAY,UAAkB,GAAA,CAAA,UAAO,CAAA,KAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACnC,QAAW,IAAA,CAAA,mBAAW,EAAA,UAAA,CAAA,CAAA;AACtB,QAAS,IAAA,CAAA,QAAA,EAAQ,UAAG,CAAA,CAAA;AAAA,OACnB,MAAA,IAAA,CAAA,UAAA,CAAA,KAAA,IAAA,CAAA,QAAA,CAAA,KAAA,EAAA;AAAA,QACK,IAAA,CAAA,mBAAA,EAAA,EAAA,CAAA,CAAA;AAAA,QACP,IAAA,CAAA,QAAA,EAAA,EAAA,CAAA,CAAA;AAED,OAAA;AACE,KAAI;AACF,IAAA,OAAA,CAAA,IAAmB,EAAA,MAAA,KAAY;AAC/B,MAAA,MAAA,sBAA0BC,gBAAU,CAAA,UAAA,CAAA,CAAA;AACpC,MAAA,OAAKC,SAAU,EAAU,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,6BACK,CAAA,CAAA,yBAAiB,EAAAC,KAAA,CAAA,YAAA,CAAA,CAAA,CAAA;AAC/C,OAAK,EAAA;AACL,QAAKC,WAAA,CAAA,mBAAY,EAAAC,UAAA,CAAA;AAAA,UACnB,UAAA,EAAA,UAAA,CAAA,KAAA;AAAA,UACF,qBAAA,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,MAAA,KAAA,UAAA,CAAA,KAAA,GAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import '../../utils/index.mjs';
|
|
2
|
+
import LazyList from './src/lazy-list2.mjs';
|
|
3
|
+
export { lazyListEmits, lazyListProps } from './src/lazy-list.mjs';
|
|
4
|
+
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
|
+
|
|
6
|
+
const HzztLazyList = withInstall(LazyList);
|
|
7
|
+
|
|
8
|
+
export { HzztLazyList, HzztLazyList as default };
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/lazy-list/index.ts"],"sourcesContent":["import {withInstall} from '@hzzt-plus/utils'\nimport LazyList from './src/lazy-list.vue'\nimport type {SFCWithInstall} from '@hzzt-plus/utils'\n\nexport const HzztLazyList: SFCWithInstall<typeof LazyList> = withInstall(LazyList)\nexport default HzztLazyList\n\nexport * from './src/lazy-list'\n"],"names":[],"mappings":";;;;;AAEY,MAAC,YAAY,GAAG,WAAW,CAAC,QAAQ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import type LazyList from './lazy-list.vue';
|
|
3
|
+
export declare const lazyListProps: {
|
|
4
|
+
size: import("hzzt-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
5
|
+
height: import("hzzt-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
6
|
+
data: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]) | ((new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]))[], unknown, unknown, () => never[], boolean>;
|
|
7
|
+
rowKey: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
8
|
+
};
|
|
9
|
+
export declare type LazyListProps = ExtractPropTypes<typeof lazyListProps>;
|
|
10
|
+
export declare const lazyListEmits: {
|
|
11
|
+
'row-click': (row: any) => any;
|
|
12
|
+
};
|
|
13
|
+
export declare type LazyListEmits = typeof lazyListEmits;
|
|
14
|
+
export declare type LazyListInstance = InstanceType<typeof LazyList>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
|
|
4
|
+
const lazyListProps = buildProps({
|
|
5
|
+
size: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 20
|
|
8
|
+
},
|
|
9
|
+
height: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 30
|
|
12
|
+
},
|
|
13
|
+
data: {
|
|
14
|
+
type: definePropType(Array),
|
|
15
|
+
default: () => []
|
|
16
|
+
},
|
|
17
|
+
rowKey: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "id"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const lazyListEmits = {
|
|
23
|
+
"row-click": (row) => row
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { lazyListEmits, lazyListProps };
|
|
27
|
+
//# sourceMappingURL=lazy-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-list.mjs","sources":["../../../../../../packages/components/lazy-list/src/lazy-list.ts"],"sourcesContent":["import {buildProps, definePropType} from '@hzzt-plus/utils'\nimport type {ExtractPropTypes} from 'vue'\nimport type LazyList from './lazy-list.vue'\n\nexport const lazyListProps = buildProps({\n size: {\n type: Number,\n default: 20,\n },\n height: {\n type: Number,\n default: 30,\n },\n data: {\n type: definePropType<Record<string, any>[]>(Array),\n default: () => [],\n },\n rowKey: {\n type: String,\n default: 'id',\n },\n})\n\nexport type LazyListProps = ExtractPropTypes<typeof lazyListProps>\n\nexport const lazyListEmits = {\n 'row-click': (row: any) => row\n}\n\nexport type LazyListEmits = typeof lazyListEmits\n\n\nexport type LazyListInstance = InstanceType<typeof LazyList>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG;AAC3B;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
size: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
3
|
+
height: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
4
|
+
data: import("../../../utils").EpPropFinalized<(new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]) | ((new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]))[], unknown, unknown, () => never[], boolean>;
|
|
5
|
+
rowKey: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
6
|
+
}, {
|
|
7
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
size: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
9
|
+
height: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
10
|
+
data: import("../../../utils").EpPropFinalized<(new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]) | ((new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]))[], unknown, unknown, () => never[], boolean>;
|
|
11
|
+
rowKey: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
12
|
+
}>> & {
|
|
13
|
+
"onRow-click"?: ((row: any) => any) | undefined;
|
|
14
|
+
}>>;
|
|
15
|
+
emit: (event: "row-click", row: any) => void;
|
|
16
|
+
totalHeight: import("vue").Ref<string>;
|
|
17
|
+
marginTop: import("vue").Ref<string>;
|
|
18
|
+
currentIndex: import("vue").Ref<number>;
|
|
19
|
+
current: import("vue").Ref<null>;
|
|
20
|
+
nsLazy: {
|
|
21
|
+
namespace: import("vue").ComputedRef<string>;
|
|
22
|
+
b: (blockSuffix?: string) => string;
|
|
23
|
+
e: (element?: string | undefined) => string;
|
|
24
|
+
m: (modifier?: string | undefined) => string;
|
|
25
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
26
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
27
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
28
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
29
|
+
is: {
|
|
30
|
+
(name: string, state: boolean | undefined): string;
|
|
31
|
+
(name: string): string;
|
|
32
|
+
};
|
|
33
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
34
|
+
cssVarName: (name: string) => string;
|
|
35
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
36
|
+
cssVarBlockName: (name: string) => string;
|
|
37
|
+
};
|
|
38
|
+
containerCls: import("vue").ComputedRef<string[]>;
|
|
39
|
+
calcList: import("vue").ComputedRef<Record<string, any>[]>;
|
|
40
|
+
scrollList: (e: Event) => void;
|
|
41
|
+
rowClick: (row: any) => void;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
'row-click': (row: any) => any;
|
|
44
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
+
size: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
46
|
+
height: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
47
|
+
data: import("../../../utils").EpPropFinalized<(new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]) | ((new (...args: any[]) => Record<string, any>[]) | (() => Record<string, any>[]))[], unknown, unknown, () => never[], boolean>;
|
|
48
|
+
rowKey: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
49
|
+
}>> & {
|
|
50
|
+
"onRow-click"?: ((row: any) => any) | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
size: number;
|
|
53
|
+
data: Record<string, any>[];
|
|
54
|
+
height: number;
|
|
55
|
+
rowKey: string;
|
|
56
|
+
}>;
|
|
57
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot } from 'vue';
|
|
2
|
+
import { lazyListProps, lazyListEmits } from './lazy-list.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
6
|
+
|
|
7
|
+
const _hoisted_1 = ["onClick"];
|
|
8
|
+
const __default__ = defineComponent({
|
|
9
|
+
name: "HzztLazyList"
|
|
10
|
+
});
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...__default__,
|
|
13
|
+
props: lazyListProps,
|
|
14
|
+
emits: lazyListEmits,
|
|
15
|
+
setup(__props, { emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const totalHeight = ref("100%");
|
|
18
|
+
const marginTop = ref("0px");
|
|
19
|
+
const currentIndex = ref(1);
|
|
20
|
+
const current = ref(null);
|
|
21
|
+
const nsLazy = useNamespace("lazy-list");
|
|
22
|
+
const containerCls = computed(() => [
|
|
23
|
+
"overflow-y-auto",
|
|
24
|
+
nsLazy.b()
|
|
25
|
+
]);
|
|
26
|
+
watch(() => props.data, () => {
|
|
27
|
+
totalHeight.value = props.data.length * props.height + "px";
|
|
28
|
+
}, {
|
|
29
|
+
immediate: true
|
|
30
|
+
});
|
|
31
|
+
const calcList = computed(() => props.data.slice(currentIndex.value === 1 ? 0 : (currentIndex.value - 1) * props.size - props.size / 2, (currentIndex.value + 1) * props.size + props.size / 2));
|
|
32
|
+
function scrollList(e) {
|
|
33
|
+
const target = e.target;
|
|
34
|
+
const scrollTop = target.scrollTop;
|
|
35
|
+
if (scrollTop < props.size / 2 * props.height) {
|
|
36
|
+
currentIndex.value = 1;
|
|
37
|
+
} else {
|
|
38
|
+
currentIndex.value = Math.ceil((scrollTop - props.size / 2 * props.height) / props.size / props.height);
|
|
39
|
+
}
|
|
40
|
+
if (currentIndex.value === 1) {
|
|
41
|
+
marginTop.value = "0px";
|
|
42
|
+
} else {
|
|
43
|
+
marginTop.value = ((currentIndex.value - 1) * props.size - props.size / 2) * props.height + "px";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function rowClick(row) {
|
|
47
|
+
current.value = row;
|
|
48
|
+
emit("row-click", row);
|
|
49
|
+
}
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
return openBlock(), createElementBlock("div", {
|
|
52
|
+
class: normalizeClass(unref(containerCls)),
|
|
53
|
+
onScroll: scrollList
|
|
54
|
+
}, [
|
|
55
|
+
createElementVNode("div", {
|
|
56
|
+
style: normalizeStyle({
|
|
57
|
+
height: totalHeight.value,
|
|
58
|
+
width: 0,
|
|
59
|
+
float: "left"
|
|
60
|
+
})
|
|
61
|
+
}, null, 4),
|
|
62
|
+
createElementVNode("div", {
|
|
63
|
+
style: normalizeStyle({ marginTop: marginTop.value })
|
|
64
|
+
}, [
|
|
65
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calcList), (item) => {
|
|
66
|
+
return openBlock(), createElementBlock("div", {
|
|
67
|
+
key: item[_ctx.rowKey],
|
|
68
|
+
style: normalizeStyle({
|
|
69
|
+
height: _ctx.height + "px"
|
|
70
|
+
}),
|
|
71
|
+
class: normalizeClass(["hzzt-lazy-list__item", current.value === item ? "is-active" : ""]),
|
|
72
|
+
onClick: ($event) => rowClick(item)
|
|
73
|
+
}, [
|
|
74
|
+
renderSlot(_ctx.$slots, "default", { data: item })
|
|
75
|
+
], 14, _hoisted_1);
|
|
76
|
+
}), 128))
|
|
77
|
+
], 4)
|
|
78
|
+
], 34);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var LazyList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "lazy-list.vue"]]);
|
|
83
|
+
|
|
84
|
+
export { LazyList as default };
|
|
85
|
+
//# sourceMappingURL=lazy-list2.mjs.map
|