vue-devui 1.0.0-pre.0 → 1.0.0-rc.2
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/README.md +126 -187
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +67 -82
- package/auto-complete/index.umd.js +3 -1
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/countdown/index.es.js +2 -1
- package/editable-select/index.es.js +122 -163
- package/editable-select/index.umd.js +1 -1
- package/fullscreen/index.es.js +13 -16
- package/fullscreen/index.umd.js +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/modal/index.es.js +81 -76
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +38 -40
- package/notification/index.umd.js +1 -1
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/overlay/index.es.js +44 -37
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -43
- package/pagination/index.es.js +10 -12
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +46 -39
- package/popover/index.umd.js +6 -6
- package/popover/style.css +1 -1
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +11 -11
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +2 -5
- package/search/index.umd.js +4 -4
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +60 -59
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +215 -160
- package/splitter/index.umd.js +11 -11
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/tag/index.es.js +15 -18
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -2
- package/{accordion → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{anchor → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/upload/index.es.js +38 -40
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +1478 -1196
- package/vue-devui.umd.js +19 -17
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1171
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -638
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7865
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -240
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/Select.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/Table.js +0 -3
- package/nuxt/components/Tabs.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/table/index.d.ts +0 -7
- package/table/index.es.js +0 -1969
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5828
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree/index.d.ts +0 -7
- package/tree/index.es.js +0 -6490
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/slider/index.es.js
CHANGED
|
@@ -44,33 +44,41 @@ var Slider = defineComponent({
|
|
|
44
44
|
const currentPosition = ref(0);
|
|
45
45
|
const newPostion = ref(0);
|
|
46
46
|
const percentDispaly = ref("");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
function handleOnInput(event) {
|
|
48
|
+
inputValue.value = parseInt(event.target.value);
|
|
49
|
+
if (!inputValue.value) {
|
|
50
|
+
inputValue.value = props.min;
|
|
51
|
+
percentDispaly.value = "0%";
|
|
52
|
+
} else {
|
|
53
|
+
if (inputValue.value < props.min || inputValue.value > props.max) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const re = /^(?:[1-9]?\d|100)$/;
|
|
57
|
+
if (re.test(`${inputValue.value}`)) {
|
|
58
|
+
percentDispaly.value = (inputValue.value - props.min) * 100 / (props.max - props.min) + "%";
|
|
59
|
+
ctx.emit("update:modelValue", inputValue.value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
const sliderWidth = sliderRunway.value.clientWidth;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
function setPostion(newPosition) {
|
|
64
|
+
const sliderWidth = Math.round(sliderRunway.value.clientWidth);
|
|
65
|
+
if (newPosition < 0) {
|
|
66
|
+
newPosition = 0;
|
|
67
|
+
}
|
|
68
|
+
const LengthPerStep = sliderWidth / ((props.max - props.min) / props.step);
|
|
69
|
+
const steps = Math.round(newPosition / LengthPerStep);
|
|
70
|
+
const value = steps * LengthPerStep;
|
|
71
|
+
if (Math.round(value) >= sliderWidth) {
|
|
72
|
+
currentPosition.value = sliderWidth;
|
|
73
|
+
inputValue.value = props.max;
|
|
74
|
+
percentDispaly.value = "100%";
|
|
75
|
+
ctx.emit("update:modelValue", props.max);
|
|
69
76
|
return;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
}
|
|
78
|
+
percentDispaly.value = Math.round(value * 100 / sliderWidth) + "%";
|
|
79
|
+
inputValue.value = Math.round(value * (props.max - props.min) / sliderWidth) + props.min;
|
|
80
|
+
currentPosition.value = newPosition;
|
|
81
|
+
ctx.emit("update:modelValue", inputValue.value);
|
|
74
82
|
}
|
|
75
83
|
function dragStart(event) {
|
|
76
84
|
isClick = false;
|
|
@@ -93,25 +101,34 @@ var Slider = defineComponent({
|
|
|
93
101
|
window.removeEventListener("mousemove", onDragging);
|
|
94
102
|
window.removeEventListener("mouseup", onDragEnd);
|
|
95
103
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const renderShowInput = () => {
|
|
105
|
+
return props.showInput ? createVNode("div", {
|
|
106
|
+
"class": "devui-input__out-wrap"
|
|
107
|
+
}, [createVNode("input", {
|
|
108
|
+
"onInput": handleOnInput,
|
|
109
|
+
"value": inputValue.value + ""
|
|
110
|
+
}, null)]) : "";
|
|
111
|
+
};
|
|
112
|
+
if (props.modelValue > props.max) {
|
|
113
|
+
percentDispaly.value = "100%";
|
|
114
|
+
} else if (props.modelValue < props.min) {
|
|
115
|
+
percentDispaly.value = "0%";
|
|
116
|
+
} else {
|
|
117
|
+
percentDispaly.value = (props.modelValue - props.min) * 100 / (props.max - props.min) + "%";
|
|
118
|
+
}
|
|
119
|
+
onMounted(() => {
|
|
120
|
+
const sliderWidth = sliderRunway.value.clientWidth;
|
|
121
|
+
currentPosition.value = sliderWidth * (inputValue.value - props.min) / (props.max - props.min);
|
|
122
|
+
});
|
|
123
|
+
function handleButtonMousedown(event) {
|
|
124
|
+
popoverShow.value = true;
|
|
125
|
+
if (props.disabled) {
|
|
109
126
|
return;
|
|
110
127
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
dragStart(event);
|
|
130
|
+
window.addEventListener("mousemove", onDragging);
|
|
131
|
+
window.addEventListener("mouseup", onDragEnd);
|
|
115
132
|
}
|
|
116
133
|
function handleRunwayMousedown(event) {
|
|
117
134
|
if (!props.disabled && isClick) {
|
|
@@ -123,22 +140,6 @@ var Slider = defineComponent({
|
|
|
123
140
|
return;
|
|
124
141
|
}
|
|
125
142
|
}
|
|
126
|
-
function handleOnInput(event) {
|
|
127
|
-
inputValue.value = parseInt(event.target.value);
|
|
128
|
-
if (!inputValue.value) {
|
|
129
|
-
inputValue.value = props.min;
|
|
130
|
-
percentDispaly.value = "0%";
|
|
131
|
-
} else {
|
|
132
|
-
if (inputValue.value < props.min || inputValue.value > props.max) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const re = /^(?:[1-9]?\d|100)$/;
|
|
136
|
-
if (re.test(`${inputValue.value}`)) {
|
|
137
|
-
percentDispaly.value = (inputValue.value - props.min) * 100 / (props.max - props.min) + "%";
|
|
138
|
-
ctx.emit("update:modelValue", inputValue.value);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
143
|
const disableClass = computed(() => {
|
|
143
144
|
return props.disabled ? " disabled" : "";
|
|
144
145
|
});
|
|
@@ -190,7 +191,7 @@ var index = {
|
|
|
190
191
|
category: "\u6570\u636E\u5F55\u5165",
|
|
191
192
|
status: "100%",
|
|
192
193
|
install(app) {
|
|
193
|
-
app.
|
|
194
|
+
app.component(Slider.name, Slider);
|
|
194
195
|
}
|
|
195
196
|
};
|
|
196
197
|
export { Slider, index as default };
|
package/slider/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";const g={disabled:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},modelValue:{type:Number,default:0},showInput:{type:Boolean,default:!1},step:{type:Number,default:1},tipsRenderer:{type:String,default:""}};var R="",o=t.defineComponent({name:"DSlider",props:g,emits:["update:modelValue"],setup(e,
|
|
1
|
+
(function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";const g={disabled:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},modelValue:{type:Number,default:0},showInput:{type:Boolean,default:!1},step:{type:Number,default:1},tipsRenderer:{type:String,default:""}};var R="",o=t.defineComponent({name:"DSlider",props:g,emits:["update:modelValue"],setup(e,m){let v=!0,f=0,s=0;const d=t.ref(!1),V=t.ref(null),l=t.ref(e.modelValue),r=t.ref(0),h=t.ref(0),u=t.ref("");function S(n){if(l.value=parseInt(n.target.value),!l.value)l.value=e.min,u.value="0%";else{if(l.value<e.min||l.value>e.max)return;/^(?:[1-9]?\d|100)$/.test(`${l.value}`)&&(u.value=(l.value-e.min)*100/(e.max-e.min)+"%",m.emit("update:modelValue",l.value))}}function M(n){const i=Math.round(V.value.clientWidth);n<0&&(n=0);const c=i/((e.max-e.min)/e.step),y=Math.round(n/c)*c;if(Math.round(y)>=i){r.value=i,l.value=e.max,u.value="100%",m.emit("update:modelValue",e.max);return}u.value=Math.round(y*100/i)+"%",l.value=Math.round(y*(e.max-e.min)/i)+e.min,r.value=n,m.emit("update:modelValue",l.value)}function E(n){v=!1,s=n.clientX,f=r.value,h.value=f}function N(n){d.value=!0;const c=n.clientX-s;h.value=f+c,M(h.value)}function _(){d.value=!1,setTimeout(()=>{v=!0},100),window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",_)}const X=()=>e.showInput?t.createVNode("div",{class:"devui-input__out-wrap"},[t.createVNode("input",{onInput:S,value:l.value+""},null)]):"";e.modelValue>e.max?u.value="100%":e.modelValue<e.min?u.value="0%":u.value=(e.modelValue-e.min)*100/(e.max-e.min)+"%",t.onMounted(()=>{const n=V.value.clientWidth;r.value=n*(l.value-e.min)/(e.max-e.min)});function b(n){d.value=!0,!e.disabled&&(n.preventDefault(),E(n),window.addEventListener("mousemove",N),window.addEventListener("mouseup",_))}function D(n){if(!e.disabled&&v){s=n.target.getBoundingClientRect().left;const i=n.clientX;M(i-s),b(n)}else return}const w=t.computed(()=>e.disabled?" disabled":""),I=()=>t.createVNode("div",{class:"devui-slider_popover",style:{left:u.value,opacity:d.value?1:0}},[t.createVNode("div",{class:"devui-slider_popover-arrow"},null),t.createVNode("div",{class:"devui-slider_popover-content"},[l.value+" "+e.tipsRenderer])]);return()=>t.createVNode("div",{class:"devui-slider"},[t.createVNode("div",{ref:V,class:"devui-slider__runway"+w.value,onMousedown:D,onMouseout:()=>d.value=!1},[t.createVNode("div",{class:"devui-slider__bar"+w.value,style:{width:u.value}},null),t.createVNode("div",{class:"devui-slider__button"+w.value,style:{left:u.value},onMousedown:b,onMouseenter:()=>d.value=!0,onMouseout:()=>d.value=!1},null),e.tipsRenderer==="null"?"":I()]),t.createVNode("span",{class:"devui-min_count"},[e.min]),t.createVNode("span",{class:"devui-max_count"},[e.max]),X()])}});o.install=function(e){e.component(o.name,o)};var x={title:"Slider \u6ED1\u5757",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component(o.name,o)}};a.Slider=o,a.default=x,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|