dpzvc3-ui 3.0.2 → 3.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/dist/dpzvc3.esm.js +243 -224
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +57 -38
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist-prod/index.html +1 -1
- package/dist-prod/main.09c75d988141f805e29c.js +2 -0
- package/dist-prod/main.09c75d988141f805e29c.js.map +1 -0
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js +2 -0
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js.map +1 -0
- package/package.json +1 -1
- package/src/components/radioBox/radiobox.vue +5 -4
- package/src/components/slideBar/slideBar.vue +23 -5
- package/src/views/SlideBar.vue +5 -2
- package/dist-prod/main.500d6bc40855d284c027.js +0 -2
- package/dist-prod/main.500d6bc40855d284c027.js.map +0 -1
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +0 -2
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunkdpzvc3_ui=self.webpackChunkdpzvc3_ui||[]).push([[13],{2684(e,n,i){var t=i(3321);t.__esModule&&(t=t.default),"string"==typeof t&&(t=[[e.id,t,""]]),t.locals&&(e.exports=t.locals);(0,i(534).A)("948cae42",t,!0,{})},3321(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>s});var t=i(1354),l=i.n(t),d=i(6314),r=i.n(d)()(l());r.push([e.id,".SlideBar[data-v-67055e32] {\n width: 100%;\n}\n/*# sourceMappingURL=SlideBar.css.map */","",{version:3,sources:["webpack://./SlideBar.vue","webpack://./src/views/SlideBar.vue"],names:[],mappings:"AACA;EACE,WAAA;ACAF;AACA,uCAAuC",sourcesContent:["\n.SlideBar {\n width: 100%;\n}\n",".SlideBar {\n width: 100%;\n}\n/*# sourceMappingURL=SlideBar.css.map */"],sourceRoot:""}]);const s=r},3542(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>s});var t=i(5458),l=i(1425),d={class:"SlideBar"};const r=(0,l.pM)({name:"ViewSlideBar",setup:function(){return{items:(0,l.KR)([{name:"选项一"},{name:"选项二"},{name:"选项三"}]),index:(0,l.KR)(1),changeIndex:function(e){}}}});i(2684);const s=(0,i(6262).A)(r,[["render",function(e,n,i,r,s,a){var o=(0,l.g2)("Slide-bar",!0);return(0,l.uX)(),(0,l.CE)("div",d,[(0,l.bF)(o,{list:e.items,flex:!1,index:e.index,height:"100%","scroll-height":"50px","is-fixed-header":!0,onOnChange:e.changeIndex},{"slot-item-0":(0,l.k6)(function(){return(0,t.A)(n[0]||(n[0]=[(0,l.Lk)("div",{style:{height:"100%",flex:"1",background:"red",overflow:"scroll"}},[(0,l.Lk)("div",{style:{height:"40px",width:"100%","background-color":"blue"}}),(0,l.Lk)("div",{style:{height:"40px",width:"100%","background-color":"blue"}}),(0,l.Lk)("div",{style:{height:"40px",width:"100%","background-color":"blue"}}),(0,l.Lk)("div",{style:{height:"40px",width:"100%","background-color":"blue"}}),(0,l.Lk)("div",{style:{height:"40px",width:"100%","background-color":"blue"}})],-1)]))}),"slot-item-1":(0,l.k6)(function(){return(0,t.A)(n[1]||(n[1]=[(0,l.Lk)("div",{style:{height:"200px",flex:"1",background:"yellow"}},null,-1)]))}),"slot-item-2":(0,l.k6)(function(){return(0,t.A)(n[2]||(n[2]=[(0,l.Lk)("div",{style:{height:"200px",flex:"1",background:"black"}},null,-1)]))}),_:1},8,["list","index","onOnChange"])])}],["__scopeId","data-v-67055e32"]])}}]);
|
|
2
|
+
//# sourceMappingURL=slidebar.d7ad5de495550613661f.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sl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AAAA,IAAkE,OAA7DC,MAAA,0DACLD,EAAAA,EAAAA,IAAkE,OAA7DC,MAAA,2D,QAIE,eAAWJ,EAAAA,EAAAA,IACpB,kBAAAC,EAAAA,EAAAA,GAAwDC,EAAA,KAAAA,EAAA,KAAxDC,EAAAA,EAAAA,IAAwD,OAAnDC,MAAA,+CAAgD,W,GAG5C,eAAWJ,EAAAA,EAAAA,IACpB,kBAAAC,EAAAA,EAAAA,GAAuDC,EAAA,KAAAA,EAAA,KAAvDC,EAAAA,EAAAA,IAAuD,OAAlDC,MAAA,8CAA+C,W,6CCpBgB,CAAC,YAAY,oB","sources":["webpack://dpzvc3-ui/./src/views/SlideBar.vue?1f42","webpack://dpzvc3-ui/./src/views/SlideBar.vue?05d1","webpack://dpzvc3-ui/./src/views/SlideBar.vue","webpack://dpzvc3-ui/./src/views/SlideBar.vue?6fd3"],"sourcesContent":["// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/dist/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/less-loader/dist/cjs.js!../../node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./SlideBar.vue?vue&type=style&index=0&id=67055e32&lang=less&scoped=true\");\nif(content.__esModule) content = content.default;\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"948cae42\", content, true, {});","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.SlideBar[data-v-67055e32] {\n width: 100%;\n}\n/*# sourceMappingURL=SlideBar.css.map */`, \"\",{\"version\":3,\"sources\":[\"webpack://./SlideBar.vue\",\"webpack://./src/views/SlideBar.vue\"],\"names\":[],\"mappings\":\"AACA;EACE,WAAA;ACAF;AACA,uCAAuC\",\"sourcesContent\":[\"\\n.SlideBar {\\n width: 100%;\\n}\\n\",\".SlideBar {\\n width: 100%;\\n}\\n/*# sourceMappingURL=SlideBar.css.map */\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","<template>\n <div class=\"SlideBar\">\n <Slide-bar\n :list=\"items\"\n :flex=\"false\"\n :index=\"index\"\n height=\"100%\"\n scroll-height=\"50px\"\n :is-fixed-header=\"true\"\n @on-change=\"changeIndex\"\n >\n <!-- 具名插槽语法 Vue3 -->\n <template #slot-item-0>\n <div style=\"height:100%; flex: 1; background:red; overflow: scroll;\">\n <div style=\"height: 40px; width: 100%; background-color: blue;\" />\n <div style=\"height: 40px; width: 100%; background-color: blue;\" />\n <div style=\"height: 40px; width: 100%; background-color: blue;\" />\n <div style=\"height: 40px; width: 100%; background-color: blue;\" />\n <div style=\"height: 40px; width: 100%; background-color: blue;\" />\n </div>\n </template>\n\n <template #slot-item-1>\n <div style=\"height:200px; flex:1; background:yellow;\" />\n </template>\n\n <template #slot-item-2>\n <div style=\"height:200px; flex:1; background:black;\" />\n </template>\n </Slide-bar>\n </div>\n</template>\n\n<script>\nimport { defineComponent, ref } from 'vue'\n\nexport default defineComponent({\n name: 'ViewSlideBar',\n setup () {\n const items = ref([\n { name: '选项一' },\n { name: '选项二' },\n { name: '选项三' }\n ])\n const index = ref(1)\n const changeIndex = (index) => {\n console.log(index)\n }\n return { items, index, changeIndex }\n }\n})\n</script>\n\n<style lang=\"less\" scoped>\n.SlideBar {\n width: 100%;\n}\n</style>\n","import { render } from \"./SlideBar.vue?vue&type=template&id=67055e32&scoped=true\"\nimport script from \"./SlideBar.vue?vue&type=script&lang=js\"\nexport * from \"./SlideBar.vue?vue&type=script&lang=js\"\n\nimport \"./SlideBar.vue?vue&type=style&index=0&id=67055e32&lang=less&scoped=true\"\n\nimport exportComponent from \"../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-67055e32\"]])\n\nexport default __exports__"],"names":["content","__esModule","default","module","id","locals","exports","add","___CSS_LOADER_EXPORT___","push","class","defineComponent","name","setup","items","ref","index","changeIndex","_createElementBlock","_hoisted_1","_createVNode","_component_Slide_bar","list","_ctx","flex","height","onOnChange","_withCtx","_toConsumableArray","_cache","_createElementVNode","style"],"ignoreList":[],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -24,10 +24,10 @@ export default defineComponent({
|
|
|
24
24
|
name: 'RadioBox',
|
|
25
25
|
props: {
|
|
26
26
|
label: { type: [String, Number], required: true },
|
|
27
|
-
|
|
27
|
+
modelValue: { type: Boolean, default: false },
|
|
28
28
|
disable: { type: Boolean, default: false }
|
|
29
29
|
},
|
|
30
|
-
emits: ['update:
|
|
30
|
+
emits: ['update:modelValue', 'on-change'],
|
|
31
31
|
setup (props, { emit }) {
|
|
32
32
|
const slotEl = ref(null)
|
|
33
33
|
const show = ref(true)
|
|
@@ -37,7 +37,7 @@ export default defineComponent({
|
|
|
37
37
|
if (group) {
|
|
38
38
|
return group.currentValue.value === props.label
|
|
39
39
|
} else {
|
|
40
|
-
return props.
|
|
40
|
+
return props.modelValue
|
|
41
41
|
}
|
|
42
42
|
})
|
|
43
43
|
|
|
@@ -59,7 +59,8 @@ export default defineComponent({
|
|
|
59
59
|
if (group) {
|
|
60
60
|
group.change(props.label)
|
|
61
61
|
} else {
|
|
62
|
-
|
|
62
|
+
// console.log(checked, 'ddadda')
|
|
63
|
+
emit('update:modelValue', checked)
|
|
63
64
|
emit('on-change', checked)
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<script>
|
|
59
|
-
import { defineComponent, ref, computed, onMounted, onBeforeUnmount
|
|
59
|
+
import { defineComponent, ref, computed, onMounted, onBeforeUnmount } from 'vue'
|
|
60
60
|
|
|
61
61
|
const prefixCls = 'dpzvc3-slideBar'
|
|
62
62
|
|
|
@@ -93,8 +93,8 @@ export default defineComponent({
|
|
|
93
93
|
const fixed = ref(false)
|
|
94
94
|
|
|
95
95
|
const getItemWidth = computed(() => (isFlex.value ? clientWidth.value / items.value.length : props.childWidth))
|
|
96
|
-
const translateX = computed(() => -startIndex.value * clientWidth.value)
|
|
97
|
-
|
|
96
|
+
// const translateX = computed(() => -startIndex.value * clientWidth.value)
|
|
97
|
+
const translateX = ref(0)
|
|
98
98
|
const classes = computed(() => [prefixCls])
|
|
99
99
|
const headerClasses = computed(() => [prefixCls + '-header', { fixed: fixed.value }])
|
|
100
100
|
const wrapperClasses = computed(() => [
|
|
@@ -121,6 +121,7 @@ export default defineComponent({
|
|
|
121
121
|
function changeBar (index) {
|
|
122
122
|
if (startIndex.value === index) return
|
|
123
123
|
startIndex.value = index
|
|
124
|
+
translateX.value = -startIndex.value * clientWidth.value
|
|
124
125
|
emit('on-change', index)
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -134,21 +135,35 @@ export default defineComponent({
|
|
|
134
135
|
function onTouchMove (e) {
|
|
135
136
|
const currentX = e.touches[0].clientX
|
|
136
137
|
distance.value = props.distanceIndex ? (currentX - startX.value) / props.distanceIndex : currentX - startX.value
|
|
138
|
+
translateX.value = startTranslateX.value + distance.value
|
|
137
139
|
}
|
|
138
140
|
function onTouchEnd () {
|
|
139
141
|
if (distance.value < 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
140
142
|
slideLeft()
|
|
141
143
|
} else if (distance.value > 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
142
144
|
slideRight()
|
|
145
|
+
} else {
|
|
146
|
+
translateX.value = startTranslateX.value
|
|
143
147
|
}
|
|
144
148
|
dragging.value = false
|
|
145
149
|
}
|
|
146
150
|
function slideLeft () {
|
|
147
|
-
if (startIndex.value
|
|
151
|
+
if (startIndex.value >= maxIndex.value) {
|
|
152
|
+
translateX.value = startTranslateX.value
|
|
153
|
+
} else {
|
|
154
|
+
startIndex.value++
|
|
155
|
+
translateX.value = startTranslateX.value - clientWidth.value
|
|
156
|
+
}
|
|
148
157
|
emit('on-change', startIndex.value)
|
|
149
158
|
}
|
|
150
159
|
function slideRight () {
|
|
151
|
-
if (startIndex.value > 0) startIndex.value--
|
|
160
|
+
// if (startIndex.value > 0) startIndex.value--
|
|
161
|
+
if (startIndex.value <= 0) {
|
|
162
|
+
translateX.value = startTranslateX.value
|
|
163
|
+
} else {
|
|
164
|
+
startIndex.value--
|
|
165
|
+
translateX.value = startTranslateX.value + clientWidth.value
|
|
166
|
+
}
|
|
152
167
|
emit('on-change', startIndex.value)
|
|
153
168
|
}
|
|
154
169
|
|
|
@@ -162,8 +177,11 @@ export default defineComponent({
|
|
|
162
177
|
|
|
163
178
|
onMounted(() => {
|
|
164
179
|
clientWidth.value = header.value.clientWidth
|
|
180
|
+
translateX.value = -startIndex.value * clientWidth.value
|
|
165
181
|
window.addEventListener('resize', onResize)
|
|
182
|
+
onScroll()
|
|
166
183
|
if (props.canDrag && content.value) {
|
|
184
|
+
// console.log(content.value, 'dadsds')
|
|
167
185
|
content.value.addEventListener('touchstart', onTouchStart)
|
|
168
186
|
content.value.addEventListener('touchmove', onTouchMove)
|
|
169
187
|
content.value.addEventListener('touchend', onTouchEnd)
|
package/src/views/SlideBar.vue
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
:list="items"
|
|
5
5
|
:flex="false"
|
|
6
6
|
:index="index"
|
|
7
|
-
:can-drag="false"
|
|
8
7
|
height="100%"
|
|
9
8
|
scroll-height="50px"
|
|
10
9
|
:is-fixed-header="true"
|
|
10
|
+
@on-change="changeIndex"
|
|
11
11
|
>
|
|
12
12
|
<!-- 具名插槽语法 Vue3 -->
|
|
13
13
|
<template #slot-item-0>
|
|
@@ -43,7 +43,10 @@ export default defineComponent({
|
|
|
43
43
|
{ name: '选项三' }
|
|
44
44
|
])
|
|
45
45
|
const index = ref(1)
|
|
46
|
-
|
|
46
|
+
const changeIndex = (index) => {
|
|
47
|
+
console.log(index)
|
|
48
|
+
}
|
|
49
|
+
return { items, index, changeIndex }
|
|
47
50
|
}
|
|
48
51
|
})
|
|
49
52
|
</script>
|