vue-devui 1.0.0-rc.2 → 1.0.0-rc.5
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 +9 -0
- package/auto-complete/index.es.js +132 -58
- package/auto-complete/index.umd.js +5 -3
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +77 -81
- package/avatar/index.umd.js +1 -1
- package/button/index.es.js +23 -15
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.es.js +3 -6
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +5 -11
- package/checkbox/index.umd.js +1 -1
- package/comment/index.es.js +4 -6
- package/comment/index.umd.js +1 -1
- package/countdown/index.es.js +3 -6
- package/countdown/index.umd.js +1 -1
- package/{tag-input → date-picker}/index.d.ts +0 -0
- package/date-picker/index.es.js +1151 -0
- package/date-picker/index.umd.js +1 -0
- package/date-picker/package.json +7 -0
- package/date-picker/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +236 -0
- package/drawer/index.umd.js +1 -0
- package/{tag-input → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +716 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.es.js +2 -5
- package/editable-select/index.umd.js +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7888 -0
- package/form/index.umd.js +27 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/grid/index.es.js +30 -36
- package/grid/index.umd.js +1 -1
- package/image-preview/index.es.js +19 -19
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +2 -5
- package/input/index.umd.js +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +229 -0
- package/input-number/index.umd.js +1 -0
- package/input-number/package.json +7 -0
- package/input-number/style.css +1 -0
- package/layout/index.es.js +9 -22
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +40 -25
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +70 -50
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +100 -10
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/commentProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/readTipProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/overlay/index.es.js +20 -8
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -2
- package/pagination/index.es.js +14 -13
- package/pagination/index.umd.js +1 -1
- package/popover/index.es.js +20 -8
- package/popover/index.umd.js +12 -12
- package/progress/index.es.js +33 -35
- package/progress/index.umd.js +3 -3
- package/rate/index.es.js +31 -41
- package/rate/index.umd.js +1 -1
- package/read-tip/index.es.js +34 -34
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.es.js +2 -5
- package/result/index.umd.js +1 -1
- package/search/index.es.js +11 -11
- package/search/index.umd.js +8 -8
- package/select/index.d.ts +7 -0
- package/select/index.es.js +696 -0
- package/select/index.umd.js +1 -0
- package/select/package.json +7 -0
- package/select/style.css +1 -0
- package/skeleton/index.es.js +9 -12
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +1 -4
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +23 -14
- package/splitter/index.umd.js +15 -15
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +4 -7
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +2376 -0
- package/table/index.umd.js +1 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +194 -0
- package/tabs/index.umd.js +1 -0
- package/tabs/package.json +7 -0
- package/tabs/style.css +1 -0
- package/textarea/index.es.js +2 -5
- package/textarea/index.umd.js +1 -1
- package/timeline/index.es.js +10 -16
- package/timeline/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5847 -0
- package/tooltip/index.umd.js +27 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- package/upload/index.es.js +160 -67
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +16936 -24821
- package/vue-devui.umd.js +24 -22
- package/nuxt/components/TagInput.js +0 -3
- package/tag-input/index.es.js +0 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/style.css +0 -1
package/rate/index.es.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, reactive, ref, onMounted, createVNode, resolveComponent } from "vue";
|
|
2
2
|
const rateProps = {
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: Number
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 0
|
|
5
6
|
},
|
|
6
7
|
read: {
|
|
7
8
|
type: Boolean,
|
|
@@ -54,18 +55,15 @@ var Rate = defineComponent({
|
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
const initRating = () => {
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
chooseValue.value = props.modelValue - 1;
|
|
58
|
+
chooseValue.value = props.modelValue;
|
|
61
59
|
const halfStar = chooseValue.value % 1;
|
|
62
60
|
const intCurrentLevel = Math.floor(chooseValue.value);
|
|
63
|
-
setChange(0, intCurrentLevel
|
|
61
|
+
setChange(0, intCurrentLevel, "100%");
|
|
64
62
|
if (halfStar > 0) {
|
|
65
|
-
totalLevelArray[intCurrentLevel
|
|
66
|
-
setChange(intCurrentLevel + 2, props.count, "0");
|
|
67
|
-
} else {
|
|
63
|
+
totalLevelArray[intCurrentLevel]["width"] = halfStar * 100 + "%";
|
|
68
64
|
setChange(intCurrentLevel + 1, props.count, "0");
|
|
65
|
+
} else {
|
|
66
|
+
setChange(intCurrentLevel, props.count, "0");
|
|
69
67
|
}
|
|
70
68
|
};
|
|
71
69
|
onMounted(() => {
|
|
@@ -76,33 +74,28 @@ var Rate = defineComponent({
|
|
|
76
74
|
}
|
|
77
75
|
initRating();
|
|
78
76
|
});
|
|
79
|
-
const
|
|
77
|
+
const isSemiSelected = (e) => {
|
|
78
|
+
const target = e.target;
|
|
79
|
+
return props.allowHalf && e.offsetX * 2 <= target.clientWidth;
|
|
80
|
+
};
|
|
81
|
+
const hoverToggle = (e, index2) => {
|
|
80
82
|
if (props.read) {
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} else {
|
|
91
|
-
setChange(0, index2 + 1, "100%");
|
|
92
|
-
if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
|
|
93
|
-
setChange(index2, index2 + 1, "50%");
|
|
94
|
-
} else {
|
|
95
|
-
setChange(index2, index2 + 1, "100%");
|
|
96
|
-
}
|
|
97
|
-
setChange(index2 + 1, props.count, "0");
|
|
98
|
-
}
|
|
85
|
+
setChange(0, index2 + 1, "100%");
|
|
86
|
+
const width = isSemiSelected(e) ? "50%" : "100%";
|
|
87
|
+
setChange(index2, index2 + 1, width);
|
|
88
|
+
setChange(index2 + 1, props.count, "0");
|
|
89
|
+
};
|
|
90
|
+
const onMouseleave = () => {
|
|
91
|
+
initRating();
|
|
99
92
|
};
|
|
100
93
|
const selectValue = (e, index2) => {
|
|
101
94
|
if (props.read) {
|
|
102
95
|
return;
|
|
103
96
|
}
|
|
104
97
|
setChange(0, index2, "100%");
|
|
105
|
-
if (
|
|
98
|
+
if (isSemiSelected(e)) {
|
|
106
99
|
setChange(index2, index2 + 1, "50%");
|
|
107
100
|
chooseValue.value = index2 - 0.5;
|
|
108
101
|
} else {
|
|
@@ -110,33 +103,33 @@ var Rate = defineComponent({
|
|
|
110
103
|
chooseValue.value = index2;
|
|
111
104
|
}
|
|
112
105
|
setChange(index2 + 1, props.count, "0");
|
|
113
|
-
|
|
114
|
-
props.onChange && props.onChange(index2 + 1);
|
|
106
|
+
props.onChange && props.onChange(chooseValue.value + 1);
|
|
115
107
|
props.onTouched && props.onTouched();
|
|
116
|
-
ctx.emit("update:modelValue",
|
|
108
|
+
ctx.emit("update:modelValue", chooseValue.value + 1);
|
|
117
109
|
};
|
|
118
110
|
return {
|
|
119
111
|
totalLevelArray,
|
|
120
112
|
chooseValue,
|
|
121
113
|
hoverToggle,
|
|
122
|
-
selectValue
|
|
114
|
+
selectValue,
|
|
115
|
+
onMouseleave
|
|
123
116
|
};
|
|
124
117
|
},
|
|
125
118
|
render() {
|
|
126
119
|
const {
|
|
127
120
|
totalLevelArray,
|
|
128
|
-
chooseValue,
|
|
129
121
|
icon,
|
|
130
122
|
character,
|
|
131
123
|
read,
|
|
132
124
|
type,
|
|
133
125
|
color,
|
|
134
126
|
hoverToggle,
|
|
135
|
-
selectValue
|
|
127
|
+
selectValue,
|
|
128
|
+
onMouseleave
|
|
136
129
|
} = this;
|
|
137
130
|
return createVNode("div", {
|
|
138
131
|
"class": "devui-star-container",
|
|
139
|
-
"onMouseleave":
|
|
132
|
+
"onMouseleave": onMouseleave
|
|
140
133
|
}, [totalLevelArray.map((item, index2) => createVNode("div", {
|
|
141
134
|
"class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
|
|
142
135
|
"key": index2,
|
|
@@ -166,7 +159,7 @@ var Rate = defineComponent({
|
|
|
166
159
|
"fill": "#E3E5E9",
|
|
167
160
|
"id": "Mask"
|
|
168
161
|
}, [createVNode("polygon", {
|
|
169
|
-
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835
|
|
162
|
+
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
|
|
170
163
|
}, null)])])])]), icon && !character && createVNode("span", {
|
|
171
164
|
"class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
|
|
172
165
|
"style": {
|
|
@@ -202,19 +195,16 @@ var Rate = defineComponent({
|
|
|
202
195
|
}, [createVNode("g", {
|
|
203
196
|
"id": "Mask"
|
|
204
197
|
}, [createVNode("polygon", {
|
|
205
|
-
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1
|
|
198
|
+
"points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
|
|
206
199
|
}, null)])])])])]))]);
|
|
207
200
|
}
|
|
208
201
|
});
|
|
209
|
-
Rate.install = function(app) {
|
|
210
|
-
app.component(Rate.name, Rate);
|
|
211
|
-
};
|
|
212
202
|
var index = {
|
|
213
203
|
title: "Rate \u8BC4\u5206",
|
|
214
204
|
category: "\u6570\u636E\u5C55\u793A",
|
|
215
205
|
status: "100%",
|
|
216
206
|
install(app) {
|
|
217
|
-
app.
|
|
207
|
+
app.component(Rate.name, Rate);
|
|
218
208
|
}
|
|
219
209
|
};
|
|
220
|
-
export { Rate, index as default };
|
|
210
|
+
export { Rate, index as default, rateProps };
|
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue))})(this,function(r,e){"use strict";const g={modelValue:{type:Number,default:0},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}};var p="",f=e.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(a,i){const n=e.reactive([]),c=e.ref(0),l=(o,t,h)=>{for(let v=o;v<t;v++)n[v].width=h},s=()=>{c.value=a.modelValue;const o=c.value%1,t=Math.floor(c.value);l(0,t,"100%"),o>0?(n[t].width=o*100+"%",l(t+1,a.count,"0")):l(t,a.count,"0")};e.onMounted(()=>{for(let o=0;o<a.count;o++)n.push({width:"0"});s()});const d=o=>{const t=o.target;return a.allowHalf&&o.offsetX*2<=t.clientWidth};return{totalLevelArray:n,chooseValue:c,hoverToggle:(o,t)=>{if(a.read)return;l(0,t+1,"100%");const h=d(o)?"50%":"100%";l(t,t+1,h),l(t+1,a.count,"0")},selectValue:(o,t)=>{a.read||(l(0,t,"100%"),d(o)?(l(t,t+1,"50%"),c.value=t-.5):(l(t,t+1,"100%"),c.value=t),l(t+1,a.count,"0"),a.onChange&&a.onChange(c.value+1),a.onTouched&&a.onTouched(),i.emit("update:modelValue",c.value+1))},onMouseleave:()=>{s()}}},render(){const{totalLevelArray:a,icon:i,character:n,read:c,type:l,color:s,hoverToggle:d,selectValue:w,onMouseleave:V}=this;return e.createVNode("div",{class:"devui-star-container",onMouseleave:V},[a.map((u,o)=>e.createVNode("div",{class:`devui-star-align devui-pointer ${c?"devui-only-read":""}`,key:o,onMouseover:t=>d(t,o),onClick:t=>w(t,o)},[i&&!n&&e.createVNode("span",{class:"devui-star-color"},[e.createVNode(e.resolveComponent("d-icon"),{name:i},null)]),n&&!i&&e.createVNode("span",{class:"devui-star-color"},[n]),!i&&!n&&e.createVNode("span",{class:"devui-star-color"},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),i&&!n&&e.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${l}`,style:{width:u.width}},[e.createVNode(e.resolveComponent("d-icon"),{name:i,color:s},null)]),n&&!i&&e.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${l}`,style:{color:s,width:u.width}},[n]),!n&&!i&&e.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${l}`,style:{color:s,width:u.width}},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])]))])}}),y={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(f.name,f)}};r.Rate=f,r.default=y,r.rateProps=g,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/read-tip/index.es.js
CHANGED
|
@@ -51,7 +51,8 @@ var TipsTemplate = defineComponent({
|
|
|
51
51
|
return deviationConstant;
|
|
52
52
|
};
|
|
53
53
|
onMounted(() => {
|
|
54
|
-
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const domBounding = (_a = document.querySelector(query)) == null ? void 0 : _a.getBoundingClientRect();
|
|
55
56
|
const {
|
|
56
57
|
width,
|
|
57
58
|
height
|
|
@@ -61,7 +62,7 @@ var TipsTemplate = defineComponent({
|
|
|
61
62
|
const heightDeviation = deviation(height);
|
|
62
63
|
const widthDeviation = deviation(width);
|
|
63
64
|
let positionLeft = 0;
|
|
64
|
-
const targetDom = document.querySelector(".read-tip-container").getBoundingClientRect();
|
|
65
|
+
const targetDom = (_b = document.querySelector(".read-tip-container")) == null ? void 0 : _b.getBoundingClientRect();
|
|
65
66
|
if (rule.appendToBody) {
|
|
66
67
|
positionTop = domBounding.y + document.documentElement.scrollTop;
|
|
67
68
|
positionLeft = domBounding.x;
|
|
@@ -90,14 +91,14 @@ var TipsTemplate = defineComponent({
|
|
|
90
91
|
"to": rule.appendToBody ? "body" : query
|
|
91
92
|
}, {
|
|
92
93
|
default: () => {
|
|
93
|
-
var _a;
|
|
94
|
+
var _a, _b;
|
|
94
95
|
return [createVNode("div", {
|
|
95
96
|
"ref": temp,
|
|
96
97
|
"class": ["read-tip-container", rule.position, rule.overlayClassName],
|
|
97
98
|
"style": styles
|
|
98
99
|
}, [createVNode("span", {
|
|
99
100
|
"class": "after"
|
|
100
|
-
}, null), rule.contentTemplate ? (_a = ctx.slots) == null ? void 0 : _a.default() : createVNode(Fragment, null, [createVNode("div", {
|
|
101
|
+
}, null), rule.contentTemplate ? (_b = (_a = ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a) : createVNode(Fragment, null, [createVNode("div", {
|
|
101
102
|
"class": "title"
|
|
102
103
|
}, [rule.title]), createVNode("div", {
|
|
103
104
|
"class": "content"
|
|
@@ -107,6 +108,19 @@ var TipsTemplate = defineComponent({
|
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
110
|
});
|
|
111
|
+
const rules = (ruleList) => {
|
|
112
|
+
if (ruleList === null) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
if (typeof ruleList === "object" && !Array.isArray(ruleList)) {
|
|
116
|
+
ruleList = [ruleList];
|
|
117
|
+
}
|
|
118
|
+
ruleList = [...ruleList];
|
|
119
|
+
Array.isArray(ruleList) && ruleList.map((rule) => {
|
|
120
|
+
rule.status = false;
|
|
121
|
+
});
|
|
122
|
+
return ruleList;
|
|
123
|
+
};
|
|
110
124
|
var ReadTip = defineComponent({
|
|
111
125
|
name: "DReadTip",
|
|
112
126
|
props: readTipProps,
|
|
@@ -126,6 +140,7 @@ var ReadTip = defineComponent({
|
|
|
126
140
|
};
|
|
127
141
|
const options = __spreadValues(__spreadValues({}, defaultOptions), props.readTipOptions);
|
|
128
142
|
const defaultSlot = ref(null);
|
|
143
|
+
const refRules = reactive(rules(options.rules));
|
|
129
144
|
const onMouseenter = (rule) => () => {
|
|
130
145
|
setTimeout(() => {
|
|
131
146
|
if (rule.id) {
|
|
@@ -144,8 +159,9 @@ var ReadTip = defineComponent({
|
|
|
144
159
|
rule.status = false;
|
|
145
160
|
}, rule.mouseleaveTime || options.mouseleaveTime);
|
|
146
161
|
};
|
|
147
|
-
const init = (
|
|
148
|
-
|
|
162
|
+
const init = (ruleList, trigger = "hover") => {
|
|
163
|
+
ruleList.map((rule) => {
|
|
164
|
+
var _a;
|
|
149
165
|
rule.status = false;
|
|
150
166
|
trigger = rule.trigger || trigger;
|
|
151
167
|
rule.overlayClassName = rule.overlayClassName || options.overlayClassName;
|
|
@@ -154,7 +170,7 @@ var ReadTip = defineComponent({
|
|
|
154
170
|
if (!("appendToBody" in rule)) {
|
|
155
171
|
rule.appendToBody = options.appendToBody;
|
|
156
172
|
}
|
|
157
|
-
const doms = defaultSlot.value.querySelectorAll(rule.selector);
|
|
173
|
+
const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
|
|
158
174
|
[...doms].map((dom, index2) => {
|
|
159
175
|
if (rule.appendToBody === false) {
|
|
160
176
|
dom.style.position = "relative";
|
|
@@ -167,7 +183,7 @@ var ReadTip = defineComponent({
|
|
|
167
183
|
newRule = __spreadValues({}, rule);
|
|
168
184
|
dom.id = id;
|
|
169
185
|
newRule.id = id;
|
|
170
|
-
|
|
186
|
+
ruleList.push(newRule);
|
|
171
187
|
}
|
|
172
188
|
if (trigger === "hover") {
|
|
173
189
|
dom.addEventListener("mouseenter", onMouseenter(newRule.id ? newRule : rule));
|
|
@@ -175,25 +191,11 @@ var ReadTip = defineComponent({
|
|
|
175
191
|
}
|
|
176
192
|
});
|
|
177
193
|
});
|
|
178
|
-
return
|
|
194
|
+
return ruleList;
|
|
179
195
|
};
|
|
180
|
-
function show(
|
|
196
|
+
function show(_, rule) {
|
|
181
197
|
rule.status = true;
|
|
182
198
|
}
|
|
183
|
-
const rules = (rules2) => {
|
|
184
|
-
if (rules2 === null) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (typeof rules2 === "object" && !Array.isArray(rules2)) {
|
|
188
|
-
rules2 = [rules2];
|
|
189
|
-
}
|
|
190
|
-
rules2 = [...rules2];
|
|
191
|
-
Array.isArray(rules2) && rules2.map((rule) => {
|
|
192
|
-
rule.status = false;
|
|
193
|
-
});
|
|
194
|
-
return rules2;
|
|
195
|
-
};
|
|
196
|
-
const refRules = reactive(rules(options.rules));
|
|
197
199
|
const clickFn = () => {
|
|
198
200
|
refRules.forEach((element) => {
|
|
199
201
|
element.status = false;
|
|
@@ -207,8 +209,9 @@ var ReadTip = defineComponent({
|
|
|
207
209
|
document.removeEventListener("click", clickFn);
|
|
208
210
|
});
|
|
209
211
|
const onClick = (e) => {
|
|
212
|
+
var _a;
|
|
210
213
|
for (const rule of refRules) {
|
|
211
|
-
const doms = defaultSlot.value.querySelectorAll(rule.selector);
|
|
214
|
+
const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
|
|
212
215
|
for (const dom of doms) {
|
|
213
216
|
if (doms.length > 1) {
|
|
214
217
|
if (dom === e.target && rule.id) {
|
|
@@ -228,34 +231,31 @@ var ReadTip = defineComponent({
|
|
|
228
231
|
}
|
|
229
232
|
};
|
|
230
233
|
return () => {
|
|
231
|
-
var _a;
|
|
234
|
+
var _a, _b;
|
|
232
235
|
return createVNode("div", {
|
|
233
236
|
"class": "devui-read-tip"
|
|
234
237
|
}, [createVNode("div", {
|
|
235
238
|
"ref": defaultSlot,
|
|
236
239
|
"onClick": onClick
|
|
237
|
-
}, [(_a = ctx.slots) == null ? void 0 : _a.default()]), refRules.map((rule) => createVNode("div", {
|
|
240
|
+
}, [(_b = (_a = ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a)]), refRules.map((rule) => createVNode("div", {
|
|
238
241
|
"data-test": "todo"
|
|
239
242
|
}, [rule.status && createVNode(TipsTemplate, {
|
|
240
243
|
"defaultTemplateProps": __spreadValues({}, rule)
|
|
241
244
|
}, {
|
|
242
245
|
default: () => {
|
|
243
|
-
var _a2;
|
|
244
|
-
return [rule.contentTemplate && ((_a2 = ctx.slots) == null ? void 0 : _a2.contentTemplate())];
|
|
246
|
+
var _a2, _b2;
|
|
247
|
+
return [rule.contentTemplate && ((_b2 = (_a2 = ctx.slots) == null ? void 0 : _a2.contentTemplate) == null ? void 0 : _b2.call(_a2))];
|
|
245
248
|
}
|
|
246
249
|
})]))]);
|
|
247
250
|
};
|
|
248
251
|
}
|
|
249
252
|
});
|
|
250
|
-
ReadTip.install = function(app) {
|
|
251
|
-
app.component(ReadTip.name, ReadTip);
|
|
252
|
-
};
|
|
253
253
|
var index = {
|
|
254
254
|
title: "ReadTip \u9605\u8BFB\u63D0\u793A",
|
|
255
255
|
category: "\u53CD\u9988",
|
|
256
256
|
status: "100%",
|
|
257
257
|
install(app) {
|
|
258
|
-
app.
|
|
258
|
+
app.component(ReadTip.name, ReadTip);
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
export { ReadTip, index as default };
|
|
261
|
+
export { ReadTip, index as default, readTipProps };
|
package/read-tip/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D=Object.defineProperty;var k=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var w=(s,e,p)=>e in s?D(s,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):s[e]=p,h=(s,e)=>{for(var p in e||(e={}))O.call(e,p)&&w(s,p,e[p]);if(k)for(var p of k(e))E.call(e,p)&&w(s,p,e[p]);return s};(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";const p={readTipOptions:{type:Object},defaultTemplateProps:{type:Object}};var F="",A=e.defineComponent({name:"DReadTipTemplate",props:p,emits:[],setup(d,m){const{defaultTemplateProps:V}=e.toRefs(d);let n=V.value;const u=(n==null?void 0:n.id)?`#${n.id}`:n.selector,c=e.reactive({});if(typeof n.dataFn=="function"){const a=n.dataFn({element:document.querySelector(u),rule:n});n=h(h({},n),a)}const b=e.ref(null),N=a=>{let f=a>24?0:-(a/2)+2;return a<=10&&(f=-10),f};return e.onMounted(()=>{var T,g;const a=(T=document.querySelector(u))==null?void 0:T.getBoundingClientRect(),{width:f,height:C}=a,v=10;let o=0;const i=N(C),t=N(f);let l=0;const r=(g=document.querySelector(".read-tip-container"))==null?void 0:g.getBoundingClientRect();switch(n.appendToBody&&(o=a.y+document.documentElement.scrollTop,l=a.x),n.position){case"top":c.top=o-r.height-v+"px",c.left=l+t+"px";break;case"left":c.top=o+i+"px",c.left=l-r.width-v+"px";break;case"bottom":c.top=o+a.height+v+"px",c.left=l+t+"px";break;case"right":c.top=o+i+"px",c.left=l+a.width+v+"px";break}}),()=>e.createVNode(e.Teleport,{to:n.appendToBody?"body":u},{default:()=>{var a,f;return[e.createVNode("div",{ref:b,class:["read-tip-container",n.position,n.overlayClassName],style:c},[e.createVNode("span",{class:"after"},null),n.contentTemplate?(f=(a=m.slots)==null?void 0:a.default)==null?void 0:f.call(a):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"title"},[n.title]),e.createVNode("div",{class:"content"},[n.content])])])]}})}});const S=d=>d===null?[]:(typeof d=="object"&&!Array.isArray(d)&&(d=[d]),d=[...d],Array.isArray(d)&&d.map(m=>{m.status=!1}),d);var B=e.defineComponent({name:"DReadTip",props:p,emits:[],setup(d,m){const n=h(h({},{trigger:"hover",showAnimate:!1,mouseenterTime:100,mouseleaveTime:100,position:"top",overlayClassName:"",appendToBody:!0,rules:{selector:null}}),d.readTipOptions),u=e.ref(null),c=e.reactive(S(n.rules)),b=o=>()=>{setTimeout(()=>{if(o.id){const i=c.find(t=>t.id===o.id);i.status=!0}o.status=!0},o.mouseenterTime||n.mouseenterTime)},N=o=>()=>{setTimeout(()=>{if(o.id){const i=c.find(t=>t.id===o.id);i.status=!1}o.status=!1},o.mouseleaveTime||n.mouseleaveTime)},a=(o,i="hover")=>(o.map(t=>{var r;t.status=!1,i=t.trigger||i,t.overlayClassName=t.overlayClassName||n.overlayClassName,t.position=t.position||n.position,t.contentTemplate=!!m.slots.contentTemplate,"appendToBody"in t||(t.appendToBody=n.appendToBody),[...(r=u.value)==null?void 0:r.querySelectorAll(t.selector)].map((T,g)=>{t.appendToBody===!1&&(T.style.position="relative");let y=e.reactive({id:null});const R=t.selector.slice(t.selector[0]==="."?1:0)+g;g>0&&(y=h({},t),T.id=R,y.id=R,o.push(y)),i==="hover"&&(T.addEventListener("mouseenter",b(y.id?y:t)),T.addEventListener("mouseleave",N(y.id?y:t)))})}),o);function f(o,i){i.status=!0}const C=()=>{c.forEach(o=>{o.status=!1})};e.onMounted(()=>{a(c,n.trigger),document.addEventListener("click",C,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",C)});const v=o=>{var i;for(const t of c){const l=(i=u.value)==null?void 0:i.querySelectorAll(t.selector);for(const r of l)if(l.length>1){if(r===o.target&&t.id){f(r,t);return}else if(r===o.target&&!t.id&&!r.id){f(r,t);return}}else if(r===o.target){f(r,t);return}else t.status=!1}};return()=>{var o,i;return e.createVNode("div",{class:"devui-read-tip"},[e.createVNode("div",{ref:u,onClick:v},[(i=(o=m.slots)==null?void 0:o.default)==null?void 0:i.call(o)]),c.map(t=>e.createVNode("div",{"data-test":"todo"},[t.status&&e.createVNode(A,{defaultTemplateProps:h({},t)},{default:()=>{var l,r;return[t.contentTemplate&&((r=(l=m.slots)==null?void 0:l.contentTemplate)==null?void 0:r.call(l))]}})]))])}}}),q={title:"ReadTip \u9605\u8BFB\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(d){d.component(B.name,B)}};s.ReadTip=B,s.default=q,s.readTipProps=p,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/read-tip/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-read-tip{position:relative}.devui-read-tip .title{font-size:16px}.source{overflow:initial}.read-tip-container{font-size:var(--devui-font-size, 12px);position:absolute;width:max-content;height:max-content;line-height:1.5;border:none;border-radius:var(--devui-border-radius-feedback, 4px);background-color:var(--devui-feedback-overlay-bg, #464d6e);color:var(--devui-feedback-overlay-text, #dfe1e6);overflow-wrap:break-word;padding:10px;z-index:50}.read-tip-container .after{content:"";width:12px;height:12px;transform:rotate(45deg);position:absolute;background-color:var(--devui-feedback-overlay-bg, #464d6e)}.read-tip-container.top .after{bottom:-4px}.read-tip-container.left .after{right:-4px}.read-tip-container.right .after{left:-4px}.read-tip-container.bottom .after{top:-4px}
|
package/result/index.es.js
CHANGED
|
@@ -90,15 +90,12 @@ var Result = defineComponent({
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
Result.install = function(app) {
|
|
94
|
-
app.component(Result.name, Result);
|
|
95
|
-
};
|
|
96
93
|
var index = {
|
|
97
94
|
title: "Result \u7ED3\u679C",
|
|
98
95
|
category: "\u53CD\u9988",
|
|
99
96
|
status: "100%",
|
|
100
97
|
install(app) {
|
|
101
|
-
app.
|
|
98
|
+
app.component(Result.name, Result);
|
|
102
99
|
}
|
|
103
100
|
};
|
|
104
|
-
export { Result, index as default };
|
|
101
|
+
export { Result, index as default, resultProps };
|
package/result/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";const u={icon:{type:String,default:"info"},title:{type:String,default:""},desc:{type:String,default:""}},c={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var f=e.defineComponent({name:"DIcon",props:c,setup(i){const{name:t,size:n,color:l,classPrefix:o}=e.toRefs(i);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${o.value} ${o.value}-${t.value}`,style:{fontSize:n.value,color:l.value}},null)}}),v="",r=e.defineComponent({name:"DResult",props:u,setup(i,t){let n;return function(l){l.success="right-o",l.danger="error-o",l.warning="warning-o",l.info="info-o"}(n||(n={})),()=>{var l,o,a,d;return e.createVNode("div",{class:"devui-result"},[t.slots.icon?e.createVNode("div",null,[(l=t.slots)==null?void 0:l.icon()]):e.createVNode(f,{name:n[i.icon]||"",class:`devui-result__icon-${i.icon}`,size:"64px"},null),e.createVNode("div",{class:"devui-result__title"},[t.slots.title?(o=t.slots)==null?void 0:o.title():i.title]),e.createVNode("div",{class:"devui-result__desc"},[t.slots.desc?(a=t.slots)==null?void 0:a.desc():i.desc]),e.createVNode("div",{class:"devui-result__extra"},[t.slots.extra?(d=t.slots)==null?void 0:d.extra():""])])}}}),p={title:"Result \u7ED3\u679C",category:"\u53CD\u9988",status:"100%",install(i){i.component(r.name,r)}};s.Result=r,s.default=p,s.resultProps=u,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/search/index.es.js
CHANGED
|
@@ -5723,6 +5723,16 @@ var Search = defineComponent({
|
|
|
5723
5723
|
ctx.emit("update:modelValue", event);
|
|
5724
5724
|
};
|
|
5725
5725
|
return () => {
|
|
5726
|
+
const inputProps2 = {
|
|
5727
|
+
size: props.size,
|
|
5728
|
+
disabled: props.disabled,
|
|
5729
|
+
autoFocus: props.autoFocus,
|
|
5730
|
+
modelValue: keywords.value,
|
|
5731
|
+
placeholder: props.placeholder,
|
|
5732
|
+
cssClass: props.cssClass,
|
|
5733
|
+
onKeydown: onInputKeydown,
|
|
5734
|
+
"onUpdate:modelValue": onInputUpdate
|
|
5735
|
+
};
|
|
5726
5736
|
return createVNode("div", {
|
|
5727
5737
|
"class": rootClasses.value
|
|
5728
5738
|
}, [props.iconPosition === "left" && createVNode("div", {
|
|
@@ -5732,17 +5742,7 @@ var Search = defineComponent({
|
|
|
5732
5742
|
"name": "search",
|
|
5733
5743
|
"size": "inherit",
|
|
5734
5744
|
"key": "search"
|
|
5735
|
-
}, null)]), createVNode(DInput, {
|
|
5736
|
-
"size": props.size,
|
|
5737
|
-
"disabled": props.disabled,
|
|
5738
|
-
"autoFocus": props.autoFocus,
|
|
5739
|
-
"modelValue": keywords.value,
|
|
5740
|
-
"maxLength": props.maxLength,
|
|
5741
|
-
"placeholder": props.placeholder,
|
|
5742
|
-
"cssClass": props.cssClass,
|
|
5743
|
-
"onKeydown": onInputKeydown,
|
|
5744
|
-
"onUpdate:modelValue": onInputUpdate
|
|
5745
|
-
}, null), clearIconShow.value && createVNode("div", {
|
|
5745
|
+
}, null)]), createVNode(DInput, inputProps2, null), clearIconShow.value && createVNode("div", {
|
|
5746
5746
|
"class": "devui-search__clear",
|
|
5747
5747
|
"onClick": onClearHandle
|
|
5748
5748
|
}, [createVNode(resolveComponent("d-icon"), {
|