vue-devui 1.0.0-rc.0 → 1.0.0-rc.1
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 +13 -0
- package/accordion/index.es.js +6 -3
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +13 -6
- package/auto-complete/index.umd.js +1 -1
- package/back-top/index.es.js +4 -2
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/index.es.js +2 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/carousel/index.es.js +38 -53
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +16 -8
- package/cascader/style.css +1 -1
- package/color-picker/index.es.js +94 -85
- package/color-picker/index.umd.js +7 -7
- package/countdown/index.es.js +2 -1
- package/date-picker/index.es.js +40 -57
- package/date-picker/index.umd.js +1 -1
- package/dropdown/index.es.js +117 -62
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +6 -3
- package/form/index.es.js +87 -76
- package/form/index.umd.js +11 -11
- package/form/style.css +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/input-icon/index.es.js +38 -37
- package/input-icon/index.umd.js +1 -1
- package/input-number/index.es.js +46 -57
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -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/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 +44 -37
- package/popover/index.umd.js +6 -6
- package/popover/style.css +1 -1
- package/radio/index.es.js +3 -9
- package/radio/index.umd.js +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 +9 -5
- package/search/index.es.js +2 -5
- package/search/index.umd.js +4 -4
- package/select/index.es.js +42 -42
- package/select/index.umd.js +1 -1
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +2 -1
- package/splitter/index.es.js +54 -42
- package/splitter/index.umd.js +6 -6
- 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/steps-guide/index.es.js +6 -3
- package/style.css +1 -1
- package/table/index.es.js +117 -62
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tag/index.es.js +2 -1
- package/tag-input/index.es.js +4 -2
- package/time-picker/index.es.js +43 -42
- package/time-picker/index.umd.js +1 -1
- package/{time-axis → timeline}/index.d.ts +0 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{time-axis → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +44 -37
- package/tooltip/index.umd.js +6 -6
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +84 -77
- package/transfer/index.umd.js +7 -7
- package/transfer/style.css +1 -1
- package/tree/index.es.js +10 -5
- package/tree-select/index.es.js +8 -4
- package/upload/index.es.js +38 -40
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +771 -649
- package/vue-devui.umd.js +9 -9
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/time-axis/index.umd.js +0 -1
- package/time-axis/style.css +0 -1
package/carousel/index.es.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import { defineComponent, createVNode, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, createVNode, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
|
|
18
2
|
const carouselProps = {
|
|
19
3
|
arrowTrigger: {
|
|
20
4
|
type: String,
|
|
@@ -52,50 +36,51 @@ const carouselProps = {
|
|
|
52
36
|
type: Function
|
|
53
37
|
}
|
|
54
38
|
};
|
|
39
|
+
const iconProps = {
|
|
40
|
+
name: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "",
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "inherit"
|
|
48
|
+
},
|
|
49
|
+
color: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "inherit"
|
|
52
|
+
},
|
|
53
|
+
classPrefix: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "icon"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
55
58
|
var Icon = defineComponent({
|
|
56
59
|
name: "DIcon",
|
|
57
|
-
props:
|
|
58
|
-
name: {
|
|
59
|
-
type: String,
|
|
60
|
-
required: true
|
|
61
|
-
},
|
|
62
|
-
size: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "inherit"
|
|
65
|
-
},
|
|
66
|
-
color: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: "inherit"
|
|
69
|
-
},
|
|
70
|
-
classPrefix: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: "icon"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
60
|
+
props: iconProps,
|
|
75
61
|
setup(props) {
|
|
76
|
-
return __spreadValues({}, props);
|
|
77
|
-
},
|
|
78
|
-
render() {
|
|
79
62
|
const {
|
|
80
63
|
name,
|
|
81
64
|
size,
|
|
82
65
|
color,
|
|
83
66
|
classPrefix
|
|
84
|
-
} =
|
|
85
|
-
return
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
67
|
+
} = toRefs(props);
|
|
68
|
+
return () => {
|
|
69
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
70
|
+
"src": name.value,
|
|
71
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
72
|
+
"style": {
|
|
73
|
+
width: size.value,
|
|
74
|
+
verticalAlign: "text-bottom"
|
|
75
|
+
}
|
|
76
|
+
}, null) : createVNode("i", {
|
|
77
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
78
|
+
"style": {
|
|
79
|
+
fontSize: size.value,
|
|
80
|
+
color: color.value
|
|
81
|
+
}
|
|
82
|
+
}, null);
|
|
83
|
+
};
|
|
99
84
|
}
|
|
100
85
|
});
|
|
101
86
|
var carousel = "";
|
package/carousel/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue))})(this,function(c,e){"use strict";const R={arrowTrigger:{type:String,default:"hover"},autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:3e3},height:{type:String,default:"100%"},showDots:{type:Boolean,default:!0},dotTrigger:{type:String,default:"click"},dotPosition:{type:String,default:"bottom"},activeIndex:{type:Number,default:0},activeIndexChange:{type:Function}},D={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var b=e.defineComponent({name:"DIcon",props:D,setup(a){const{name:i,size:n,color:C,classPrefix:p}=e.toRefs(a);return()=>/^((https?):)?\/\//.test(i.value)?e.createVNode("img",{src:i.value,alt:i.value.split("/")[i.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${p.value} ${p.value}-${i.value}`,style:{fontSize:n.value,color:C.value}},null)}}),B="",y=e.defineComponent({name:"DCarousel",props:R,emits:["update:activeIndex"],setup(a,{emit:i}){const{arrowTrigger:n,autoplay:C,autoplaySpeed:p,dotTrigger:V,activeIndex:T,activeIndexChange:S}=a,I=500,o=e.ref(0),g=e.ref(!1),s=e.ref(0),d=e.ref(null),l=e.ref(null),u=e.ref(null);e.watch(()=>n,()=>{g.value=n==="always"},{immediate:!0}),e.watch(()=>T,()=>{s.value=T},{immediate:!0});const v=t=>{l.value&&(l.value.style.left=`${-t*100}%`)},N=t=>{setTimeout(()=>{l.value&&(l.value.style.transition=""),t.style.transform="",v(s.value)},I)},m=(t,r)=>{if(d.value){const h=d.value.getBoundingClientRect();t.style.transform=`translateX(${(r?-o.value:o.value)*h.width}px)`}},f=t=>{if(t===s.value||!d.value||!l.value)return;l.value.style.transition=`left ${I}ms ease`;let r=s.value;if(t<0&&s.value===0){r=o.value-1;const h=l.value.children[r];m(h,!0),v(-1),N(h)}else if(t>=o.value&&s.value===o.value-1){r=0;const h=l.value.children[r];m(h,!1),v(o.value),N(h)}else r=t<0?0:t>o.value-1?o.value-1:t,v(r);s.value=r,i("update:activeIndex",r),S==null||S(r),P()},k=()=>{f(s.value-1)},M=()=>{f(s.value+1)},A=t=>{n==="hover"&&(g.value=t==="enter")},E=(t,r)=>{r===V&&f(t)},x=()=>{u.value&&(clearTimeout(u.value),u.value=null)},P=()=>{x(),C&&p&&(u.value=setTimeout(()=>{M()},p))},j=t=>{o.value=t,P()};return e.onMounted(()=>{l.value&&(l.value.style.transition=`left ${I}ms ease`,l.value.style.left="0%"),P()}),e.onBeforeUnmount(()=>{x()}),{wrapperRef:d,containerRef:l,showArrow:g,currentIndex:s,itemCount:o,changeItemCount:j,goto:f,prev:k,next:M,arrowMouseEvent:A,switchStep:E}},render(){var v,N;const{showArrow:a,currentIndex:i,itemCount:n,arrowTrigger:C,height:p,showDots:V,dotPosition:T,prev:S,next:I,arrowMouseEvent:o,switchStep:g,changeItemCount:s,$slots:d}=this,l=(N=(v=d.default)==null?void 0:v.call(d))!=null?N:[];let u=l;return u.length===1&&u[0].type===e.Fragment&&(u=(u[0].children||[]).filter(m=>(m==null?void 0:m.type)!==e.Comment)),u.length!==n&&s(u.length),e.createVNode("div",{class:"devui-carousel-container",style:{height:p},onMouseenter:()=>o("enter"),onMouseleave:()=>o("leave")},[C!=="never"&&a?e.createVNode("div",{class:"devui-carousel-arrow"},[e.createVNode("button",{class:"arrow-left",onClick:()=>S()},[e.createVNode(b,{name:"arrow-left"},null)]),e.createVNode("button",{class:"arrow-right",onClick:()=>I()},[e.createVNode(b,{name:"arrow-right"},null)])]):null,e.createVNode("div",{class:"devui-carousel-item-wrapper",ref:"wrapperRef"},[e.createVNode("div",{class:"devui-carousel-item-container",style:{width:`${n*100}%`},ref:"containerRef"},[l])]),n>0&&V?e.createVNode("ul",{class:["devui-carousel-dots",T]},[u.map((m,f)=>e.createVNode("li",{class:{"dot-item":!0,active:i===f},onClick:()=>g(f,"click"),onMouseenter:()=>g(f,"hover")},null))]):null])}}),w=e.defineComponent({name:"DCarouselItem",render(){var n;const{$slots:a}=this,i=(n=a.default)==null?void 0:n.call(a);return e.createVNode("div",{class:"d-carousel-item "},[i])}});y.install=function(a){a.component(y.name,y)},w.install=function(a){a.component(w.name,w)};var $={title:"Carousel \u8D70\u9A6C\u706F",category:"\u6570\u636E\u5C55\u793A",status:"80%",install(a){a.use(y),a.use(w)}};c.Carousel=y,c.CarouselItem=w,c.default=$,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
package/cascader/index.es.js
CHANGED
|
@@ -5579,8 +5579,9 @@ const updateCheckOptionStatus = (tagList) => {
|
|
|
5579
5579
|
var _a;
|
|
5580
5580
|
if (((_a = node == null ? void 0 : node.children) == null ? void 0 : _a.length) > 0) {
|
|
5581
5581
|
node.children.forEach((item) => {
|
|
5582
|
-
if (item.disabled)
|
|
5582
|
+
if (item.disabled) {
|
|
5583
5583
|
return;
|
|
5584
|
+
}
|
|
5584
5585
|
if (type === "checked") {
|
|
5585
5586
|
item[type] = status;
|
|
5586
5587
|
item["halfChecked"] = false;
|
|
@@ -5616,8 +5617,9 @@ const findChildrenCheckedStatusToUpdateParent = (node) => {
|
|
|
5616
5617
|
}
|
|
5617
5618
|
};
|
|
5618
5619
|
const updateParentNodeStatus = (node, options, ulIndex) => {
|
|
5619
|
-
if (ulIndex < 0)
|
|
5620
|
+
if (ulIndex < 0) {
|
|
5620
5621
|
return;
|
|
5622
|
+
}
|
|
5621
5623
|
findChildrenCheckedStatusToUpdateParent(node);
|
|
5622
5624
|
ulIndex -= 1;
|
|
5623
5625
|
const parentNode = node == null ? void 0 : node.parent;
|
|
@@ -5671,8 +5673,9 @@ const DCascaderItem = (props) => {
|
|
|
5671
5673
|
} = updateCheckOptionStatus(tagList);
|
|
5672
5674
|
const disbaled = computed(() => cascaderItem == null ? void 0 : cascaderItem.disabled);
|
|
5673
5675
|
const updateValues = () => {
|
|
5674
|
-
if (stopDefault.value)
|
|
5676
|
+
if (stopDefault.value) {
|
|
5675
5677
|
return;
|
|
5678
|
+
}
|
|
5676
5679
|
activeIndexs.splice(ulIndex, activeIndexs.length - ulIndex);
|
|
5677
5680
|
activeIndexs[ulIndex] = liIndex;
|
|
5678
5681
|
if (!multiple) {
|
|
@@ -5680,8 +5683,9 @@ const DCascaderItem = (props) => {
|
|
|
5680
5683
|
}
|
|
5681
5684
|
};
|
|
5682
5685
|
const mouseEnter = () => {
|
|
5683
|
-
if (disbaled.value || multiple)
|
|
5686
|
+
if (disbaled.value || multiple) {
|
|
5684
5687
|
return;
|
|
5688
|
+
}
|
|
5685
5689
|
updateValues();
|
|
5686
5690
|
};
|
|
5687
5691
|
const mouseenter = {
|
|
@@ -5689,8 +5693,9 @@ const DCascaderItem = (props) => {
|
|
|
5689
5693
|
};
|
|
5690
5694
|
const mouseClick = () => {
|
|
5691
5695
|
var _a2;
|
|
5692
|
-
if (disbaled.value)
|
|
5696
|
+
if (disbaled.value) {
|
|
5693
5697
|
return;
|
|
5698
|
+
}
|
|
5694
5699
|
updateValues();
|
|
5695
5700
|
if (!multiple && (!cascaderItem.children || ((_a2 = cascaderItem == null ? void 0 : cascaderItem.children) == null ? void 0 : _a2.length) === 0)) {
|
|
5696
5701
|
confirmInputValueFlg.value = !confirmInputValueFlg.value;
|
|
@@ -5805,8 +5810,9 @@ const popupHandles = (props) => {
|
|
|
5805
5810
|
stopDefault.value = !menuShow.value;
|
|
5806
5811
|
};
|
|
5807
5812
|
const openPopup = () => {
|
|
5808
|
-
if (disabled.value)
|
|
5813
|
+
if (disabled.value) {
|
|
5809
5814
|
return;
|
|
5815
|
+
}
|
|
5810
5816
|
menuShow.value = !menuShow.value;
|
|
5811
5817
|
updateStopDefaultType();
|
|
5812
5818
|
};
|
|
@@ -5858,8 +5864,9 @@ var Cascader = defineComponent({
|
|
|
5858
5864
|
}
|
|
5859
5865
|
};
|
|
5860
5866
|
const updateCascaderView = (value, currentOption, index2) => {
|
|
5861
|
-
if (index2 === value.length)
|
|
5867
|
+
if (index2 === value.length) {
|
|
5862
5868
|
return;
|
|
5869
|
+
}
|
|
5863
5870
|
const i = value[index2];
|
|
5864
5871
|
const current = currentOption[i];
|
|
5865
5872
|
const children = current == null ? void 0 : current.children;
|
|
@@ -5872,8 +5879,9 @@ var Cascader = defineComponent({
|
|
|
5872
5879
|
};
|
|
5873
5880
|
const updateCascaderValue = (value, currentOption, index2) => {
|
|
5874
5881
|
if (!multiple.value) {
|
|
5875
|
-
if (index2 === value.length)
|
|
5882
|
+
if (index2 === value.length) {
|
|
5876
5883
|
return;
|
|
5884
|
+
}
|
|
5877
5885
|
const i = value[index2];
|
|
5878
5886
|
const current = getCurrentOption(currentOption, i);
|
|
5879
5887
|
const children = current == null ? void 0 : current.children;
|
package/cascader/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-cascader-li.devui-dropdown-item{height:32px;padding:8px 12px;color:var(--devui-text, #252b3a);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.devui-cascader-li .cascader-li__wraper{flex:1;display:flex;justify-content:flex-start;align-items:center}.devui-cascader-li .dropdown-item-label{display:inline-block;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;font-size:var(--devui-font-size, 12px)}.devui-cascader-li.devui-leaf-active{background:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-cascader-li.devui-leaf-active span{color:var(--devui-brand-active, #526ecc)}.devui-cascader-li.disabled{background-color:var(--devui-disabled-bg, #f5f5f6);cursor:not-allowed}.devui-cascader-li .cascader-li__checkbox{margin-right:4px}.devui-cascader-li .cascader-li__icon{margin-right:4px;font-size:var(--devui-font-size-icon, 16px);color:var(--devui-text, #252b3a)}.devui-cascader-li .cascader-li__icon.disabled{color:var(--devui-disabled-text, #adb0b8)!important}.devui-cascader-ul{height:180px;background:var(--devui-connected-overlay-bg, #ffffff);display:block;list-style:none;margin:0;padding:0;overflow-y:auto;border-left:1px solid var(--devui-dividing-line, #dfe1e6)}.devui-cascader-ul.devui-drop-no-data{color:var(--devui-disabled-text, #adb0b8);padding:8px;display:block;height:36px;line-height:36px;overflow-y:hidden;background-color:var(--devui-disabled-bg, #f5f5f6);font-size:var(--devui-font-size, 12px);display:flex;justify-content:center;align-items:flex-start;flex-direction:column}.devui-tag{margin:2px 4px 2px 0;display:inline-block;position:relative;
|
|
1
|
+
.devui-cascader-li.devui-dropdown-item{height:32px;padding:8px 12px;color:var(--devui-text, #252b3a);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.devui-cascader-li .cascader-li__wraper{flex:1;display:flex;justify-content:flex-start;align-items:center}.devui-cascader-li .dropdown-item-label{display:inline-block;flex:1;width:0;overflow:hidden;text-overflow:ellipsis;font-size:var(--devui-font-size, 12px)}.devui-cascader-li.devui-leaf-active{background:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-cascader-li.devui-leaf-active span{color:var(--devui-brand-active, #526ecc)}.devui-cascader-li.disabled{background-color:var(--devui-disabled-bg, #f5f5f6);cursor:not-allowed}.devui-cascader-li .cascader-li__checkbox{margin-right:4px}.devui-cascader-li .cascader-li__icon{margin-right:4px;font-size:var(--devui-font-size-icon, 16px);color:var(--devui-text, #252b3a)}.devui-cascader-li .cascader-li__icon.disabled{color:var(--devui-disabled-text, #adb0b8)!important}.devui-cascader-ul{height:180px;background:var(--devui-connected-overlay-bg, #ffffff);display:block;list-style:none;margin:0;padding:0;overflow-y:auto;border-left:1px solid var(--devui-dividing-line, #dfe1e6)}.devui-cascader-ul.devui-drop-no-data{color:var(--devui-disabled-text, #adb0b8);padding:8px;display:block;height:36px;line-height:36px;overflow-y:hidden;background-color:var(--devui-disabled-bg, #f5f5f6);font-size:var(--devui-font-size, 12px);display:flex;justify-content:center;align-items:flex-start;flex-direction:column}.devui-tag{margin:2px 4px 2px 0;display:inline-block;position:relative;align-items:center;padding:0 8px;background-color:var(--devui-label-bg, #eef0f5);border-radius:var(--devui-border-radius, 2px);border-color:inherit;border:0 solid}.devui-tag span{min-height:20px;line-height:20px;font-size:var(--devui-font-size, 12px);color:var(--devui-text, #252b3a);position:relative;cursor:default}.devui-tag__close{margin-left:12px;font-size:var(--devui-font-size, 12px);cursor:pointer;color:#fff;width:14px;height:14px;line-height:14px;background-color:var(--devui-line, #adb0b8);border-radius:50%;display:inline-block;text-align:center}.devui-tag__close:hover{background-color:var(--devui-brand, #5e7ce0)}.devui-tags-input{flex:1;padding:1px 20px 1px 4px;border:1px solid var(--devui-form-control-line, #adb0b8);border-radius:var(--devui-border-radius, 2px);outline:none;background-color:var(--devui-base-bg, #ffffff);transition:border-color .3s cubic-bezier(.645,.045,.355,1)}.devui-tags-box{width:100%;overflow:auto;min-height:28px;max-height:56px;display:flex;align-items:center;flex-wrap:wrap}.devui-tags-placeholder{font-size:var(--devui-font-size, 12px);line-height:22px;margin-left:6px;color:var(--devui-placeholder, #8a8e99)}.devui-cascader{display:flex;justify-content:flex-start;align-items:center;position:relative}.devui-cascader>div:nth-child(1){width:100%}.devui-cascader__icon{position:absolute;right:5px;top:0;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.devui-cascader__icon .icon{margin:0}.devui-cascader__disbaled .icon{color:var(--devui-disabled-text, #adb0b8)!important}.devui-cascader input{width:100%;padding-right:16px}.devui-cascader .devui-drop-menu-wrapper{display:block;margin:4px 0;font-size:0;white-space:nowrap;padding:0}.devui-drop-icon-animation{transition:transform .2s linear}.devui-drop-menu-animation{transition:opacity .2s ease-in-out,transform .2s ease-in-out;z-index:1000;margin-top:1px}.devui-drop-menu-animation .devui-dropdown-menu{width:auto;padding-bottom:0;display:flex;justify-content:"flex-start";align-items:center}.devui-dropdown__open .devui-cascader__icon{transform:rotate(180deg)}.devui-dropdown__open .devui-drop-menu-animation{transform-origin:0 0%;transform:scaleY(.9999) translateY(0);opacity:1}
|
package/color-picker/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { ref, watch, defineComponent, reactive, provide, onUpdated, onBeforeMount, onMounted, createVNode, inject, getCurrentInstance, computed, nextTick, resolveComponent, readonly, unref, Teleport, Transition } from "vue";
|
|
32
|
+
import { ref, watch, defineComponent, reactive, provide, onUpdated, onBeforeMount, onMounted, createVNode, inject, getCurrentInstance, computed, toRefs, nextTick, resolveComponent, readonly, unref, Teleport, Transition } from "vue";
|
|
33
33
|
function colorPickerResize(colorCubeRef, top, left) {
|
|
34
34
|
var _a;
|
|
35
35
|
const rect = (_a = colorCubeRef.value) == null ? void 0 : _a.getBoundingClientRect();
|
|
@@ -317,8 +317,9 @@ class DOMUtils {
|
|
|
317
317
|
};
|
|
318
318
|
const downFn = (event) => {
|
|
319
319
|
var _a;
|
|
320
|
-
if (isDragging)
|
|
320
|
+
if (isDragging) {
|
|
321
321
|
return;
|
|
322
|
+
}
|
|
322
323
|
document.onselectstart = () => false;
|
|
323
324
|
document.ondragstart = () => false;
|
|
324
325
|
DOMUtils.addEventListener(document, "mousemove", moveFn);
|
|
@@ -439,16 +440,16 @@ class DOMUtils {
|
|
|
439
440
|
if (event.clientX > originX && event.clientY > originY) {
|
|
440
441
|
angle = 180 - angle;
|
|
441
442
|
}
|
|
442
|
-
if (event.clientX
|
|
443
|
+
if (event.clientX === originX && event.clientY > originY) {
|
|
443
444
|
angle = 180;
|
|
444
445
|
}
|
|
445
|
-
if (event.clientX > originX && event.clientY
|
|
446
|
+
if (event.clientX > originX && event.clientY === originY) {
|
|
446
447
|
angle = 90;
|
|
447
448
|
}
|
|
448
449
|
if (event.clientX < originX && event.clientY > originY) {
|
|
449
450
|
angle = 180 + angle;
|
|
450
451
|
}
|
|
451
|
-
if (event.clientX < originX && event.clientY
|
|
452
|
+
if (event.clientX < originX && event.clientY === originY) {
|
|
452
453
|
angle = 270;
|
|
453
454
|
}
|
|
454
455
|
if (event.clientX < originX && event.clientY < originY) {
|
|
@@ -495,8 +496,9 @@ function HSVAtoRGBA(hsva) {
|
|
|
495
496
|
return { r: rgb[0], g: rgb[1], b: rgb[2], a };
|
|
496
497
|
}
|
|
497
498
|
function RGBAtoHSVA(rgba) {
|
|
498
|
-
if (!rgba)
|
|
499
|
+
if (!rgba) {
|
|
499
500
|
return { h: 0, s: 1, v: 1, a: 1 };
|
|
501
|
+
}
|
|
500
502
|
const r = rgba.r / 255;
|
|
501
503
|
const g = rgba.g / 255;
|
|
502
504
|
const b = rgba.b / 255;
|
|
@@ -512,8 +514,9 @@ function RGBAtoHSVA(rgba) {
|
|
|
512
514
|
h = 60 * (4 + (r - g) / (max - min));
|
|
513
515
|
}
|
|
514
516
|
}
|
|
515
|
-
if (h < 0)
|
|
517
|
+
if (h < 0) {
|
|
516
518
|
h = h + 360;
|
|
519
|
+
}
|
|
517
520
|
const s = max === 0 ? 0 : (max - min) / max;
|
|
518
521
|
const hsv = [h, s, max];
|
|
519
522
|
return { h: Math.round(hsv[0]), s: hsv[1], v: hsv[2], a: rgba.a };
|
|
@@ -639,8 +642,9 @@ function fromHex(hex2) {
|
|
|
639
642
|
return fromHexa(parseHex(hex2));
|
|
640
643
|
}
|
|
641
644
|
function parseColor(color2, oldColor) {
|
|
642
|
-
if (!color2)
|
|
645
|
+
if (!color2) {
|
|
643
646
|
return fromRGBA({ r: 0, g: 0, b: 0, a: 1 });
|
|
647
|
+
}
|
|
644
648
|
if (typeof color2 === "string") {
|
|
645
649
|
if (color2.indexOf("#") !== -1)
|
|
646
650
|
;
|
|
@@ -672,8 +676,9 @@ function parseColor(color2, oldColor) {
|
|
|
672
676
|
}
|
|
673
677
|
return fromHSVA({ h: parts[0], s: parts[1], v: parts[2], a: alpha });
|
|
674
678
|
}
|
|
675
|
-
if (color2 === "transparent")
|
|
679
|
+
if (color2 === "transparent") {
|
|
676
680
|
return fromHexa("#00000000");
|
|
681
|
+
}
|
|
677
682
|
const hex2 = parseHex(color2);
|
|
678
683
|
if (oldColor && hex2 === oldColor.hexa) {
|
|
679
684
|
return oldColor;
|
|
@@ -682,24 +687,28 @@ function parseColor(color2, oldColor) {
|
|
|
682
687
|
}
|
|
683
688
|
}
|
|
684
689
|
if (typeof color2 === "object") {
|
|
685
|
-
if (color2.hasOwnProperty("alpha"))
|
|
690
|
+
if (color2.hasOwnProperty("alpha")) {
|
|
686
691
|
return color2;
|
|
692
|
+
}
|
|
687
693
|
const a = color2.hasOwnProperty("a") ? parseFloat(color2.a) : 1;
|
|
688
694
|
if (has(color2, ["r", "g", "b"])) {
|
|
689
|
-
if (oldColor && color2 === oldColor.rgba)
|
|
695
|
+
if (oldColor && color2 === oldColor.rgba) {
|
|
690
696
|
return oldColor;
|
|
691
|
-
else
|
|
697
|
+
} else {
|
|
692
698
|
return fromRGBA(__spreadProps(__spreadValues({}, color2), { a }));
|
|
699
|
+
}
|
|
693
700
|
} else if (has(color2, ["h", "s", "l"])) {
|
|
694
|
-
if (oldColor && color2 === oldColor.hsla)
|
|
701
|
+
if (oldColor && color2 === oldColor.hsla) {
|
|
695
702
|
return oldColor;
|
|
696
|
-
else
|
|
703
|
+
} else {
|
|
697
704
|
return fromHSLA(__spreadProps(__spreadValues({}, color2), { a }));
|
|
705
|
+
}
|
|
698
706
|
} else if (has(color2, ["h", "s", "v"])) {
|
|
699
|
-
if (oldColor && color2 === oldColor.hsva)
|
|
707
|
+
if (oldColor && color2 === oldColor.hsva) {
|
|
700
708
|
return oldColor;
|
|
701
|
-
else
|
|
709
|
+
} else {
|
|
702
710
|
return fromHSVA(__spreadProps(__spreadValues({}, color2), { a }));
|
|
711
|
+
}
|
|
703
712
|
}
|
|
704
713
|
}
|
|
705
714
|
return fromRGBA({ r: 255, g: 0, b: 0, a: 1 });
|
|
@@ -720,8 +729,9 @@ function extractColor(color2, input, mode, showAlpha) {
|
|
|
720
729
|
const blue = keepDecimal(color2.rgba.b);
|
|
721
730
|
const hsvSaturation = keepDecimal(color2.hsva.s, 2);
|
|
722
731
|
const value = keepDecimal(color2.hsva.v, 2);
|
|
723
|
-
if (input == null)
|
|
732
|
+
if (input == null) {
|
|
724
733
|
return color2;
|
|
734
|
+
}
|
|
725
735
|
function isShowAlpha(mode2) {
|
|
726
736
|
return showAlpha ? mode2 + "a" : mode2;
|
|
727
737
|
}
|
|
@@ -739,12 +749,13 @@ function extractColor(color2, input, mode, showAlpha) {
|
|
|
739
749
|
}
|
|
740
750
|
if (typeof input === "object") {
|
|
741
751
|
const shouldStrip = typeof input.a === "number" && input.a === 0 ? !!input.a : !input.a;
|
|
742
|
-
if (has(input, ["r", "g", "b"]))
|
|
752
|
+
if (has(input, ["r", "g", "b"])) {
|
|
743
753
|
return stripAlpha(color2.rgba, shouldStrip);
|
|
744
|
-
else if (has(input, ["h", "s", "l"]))
|
|
754
|
+
} else if (has(input, ["h", "s", "l"])) {
|
|
745
755
|
return stripAlpha(color2.hsla, shouldStrip);
|
|
746
|
-
else if (has(input, ["h", "s", "v"]))
|
|
756
|
+
} else if (has(input, ["h", "s", "v"])) {
|
|
747
757
|
return stripAlpha(color2.hsva, shouldStrip);
|
|
758
|
+
}
|
|
748
759
|
}
|
|
749
760
|
}
|
|
750
761
|
const colorPickerPaletteProps = {
|
|
@@ -803,20 +814,6 @@ var colorPalette = defineComponent({
|
|
|
803
814
|
canvas.fillStyle = valueGradient;
|
|
804
815
|
canvas.fillRect(0, 0, parentWidth, props.height);
|
|
805
816
|
}
|
|
806
|
-
function clickPalette(event) {
|
|
807
|
-
const target = event.target;
|
|
808
|
-
if (target !== paletteElement.value) {
|
|
809
|
-
handleDrag(event);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
function updatePosition() {
|
|
813
|
-
var _a, _b;
|
|
814
|
-
if (paletteInstance) {
|
|
815
|
-
const parentWidth = paletteElement.value.offsetWidth;
|
|
816
|
-
cursorLeft.value = Number((_a = props.modelValue) == null ? void 0 : _a.hsva.s) * parentWidth;
|
|
817
|
-
cursorTop.value = (1 - Number((_b = props.modelValue) == null ? void 0 : _b.hsva.v)) * props.height;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
817
|
function handleDrag(event) {
|
|
821
818
|
const parentWidth = paletteElement.value.offsetWidth;
|
|
822
819
|
if (paletteInstance) {
|
|
@@ -844,6 +841,20 @@ var colorPalette = defineComponent({
|
|
|
844
841
|
ctx.emit("changeTextColor", isChangeTextColor.value);
|
|
845
842
|
}
|
|
846
843
|
}
|
|
844
|
+
function clickPalette(event) {
|
|
845
|
+
const target = event.target;
|
|
846
|
+
if (target !== paletteElement.value) {
|
|
847
|
+
handleDrag(event);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
function updatePosition() {
|
|
851
|
+
var _a, _b;
|
|
852
|
+
if (paletteInstance) {
|
|
853
|
+
const parentWidth = paletteElement.value.offsetWidth;
|
|
854
|
+
cursorLeft.value = Number((_a = props.modelValue) == null ? void 0 : _a.hsva.s) * parentWidth;
|
|
855
|
+
cursorTop.value = (1 - Number((_b = props.modelValue) == null ? void 0 : _b.hsva.v)) * props.height;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
847
858
|
onMounted(() => {
|
|
848
859
|
renderCanvas();
|
|
849
860
|
if (paletteInstance && paletteInstance.vnode.el && handlerElement.value) {
|
|
@@ -929,12 +940,6 @@ var colorHueSlider = defineComponent({
|
|
|
929
940
|
top: 0
|
|
930
941
|
}, clickTransfrom.value);
|
|
931
942
|
});
|
|
932
|
-
const onClickSider = (event) => {
|
|
933
|
-
const target = event.target;
|
|
934
|
-
if (target !== barElement.value) {
|
|
935
|
-
onMoveBar(event);
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
943
|
const onMoveBar = (event) => {
|
|
939
944
|
event.stopPropagation();
|
|
940
945
|
if (barElement.value && cursorElement.value) {
|
|
@@ -952,6 +957,12 @@ var colorHueSlider = defineComponent({
|
|
|
952
957
|
}));
|
|
953
958
|
}
|
|
954
959
|
};
|
|
960
|
+
const onClickSider = (event) => {
|
|
961
|
+
const target = event.target;
|
|
962
|
+
if (target !== barElement.value) {
|
|
963
|
+
onMoveBar(event);
|
|
964
|
+
}
|
|
965
|
+
};
|
|
955
966
|
onMounted(() => {
|
|
956
967
|
const dragConfig = {
|
|
957
968
|
drag: (event) => {
|
|
@@ -1016,12 +1027,6 @@ var colorAlphaSlider = defineComponent({
|
|
|
1016
1027
|
const clickTransfrom = ref(DEFAULT_TRANSITION);
|
|
1017
1028
|
const barElement = ref(null);
|
|
1018
1029
|
const cursorElement = ref(null);
|
|
1019
|
-
const onClickSider = (event) => {
|
|
1020
|
-
const target = event.target;
|
|
1021
|
-
if (target !== barElement.value) {
|
|
1022
|
-
onMoveBar(event);
|
|
1023
|
-
}
|
|
1024
|
-
};
|
|
1025
1030
|
const onMoveBar = (event) => {
|
|
1026
1031
|
event.stopPropagation();
|
|
1027
1032
|
if (barElement.value && cursorElement.value) {
|
|
@@ -1036,6 +1041,12 @@ var colorAlphaSlider = defineComponent({
|
|
|
1036
1041
|
})));
|
|
1037
1042
|
}
|
|
1038
1043
|
};
|
|
1044
|
+
const onClickSider = (event) => {
|
|
1045
|
+
const target = event.target;
|
|
1046
|
+
if (target !== barElement.value) {
|
|
1047
|
+
onMoveBar(event);
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1039
1050
|
const getBackgroundStyle = computed(() => {
|
|
1040
1051
|
return {
|
|
1041
1052
|
background: `linear-gradient(to right, transparent , ${RGBtoCSS(props.modelValue.rgba)})`
|
|
@@ -2444,55 +2455,53 @@ const colorPickerHistoryProps = {
|
|
|
2444
2455
|
type: Object
|
|
2445
2456
|
}
|
|
2446
2457
|
};
|
|
2458
|
+
const iconProps = {
|
|
2459
|
+
name: {
|
|
2460
|
+
type: String,
|
|
2461
|
+
default: "",
|
|
2462
|
+
required: true
|
|
2463
|
+
},
|
|
2464
|
+
size: {
|
|
2465
|
+
type: String,
|
|
2466
|
+
default: "inherit"
|
|
2467
|
+
},
|
|
2468
|
+
color: {
|
|
2469
|
+
type: String,
|
|
2470
|
+
default: "inherit"
|
|
2471
|
+
},
|
|
2472
|
+
classPrefix: {
|
|
2473
|
+
type: String,
|
|
2474
|
+
default: "icon"
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2447
2477
|
var Icon = defineComponent({
|
|
2448
2478
|
name: "DIcon",
|
|
2449
|
-
props:
|
|
2450
|
-
name: {
|
|
2451
|
-
type: String,
|
|
2452
|
-
required: true
|
|
2453
|
-
},
|
|
2454
|
-
size: {
|
|
2455
|
-
type: String,
|
|
2456
|
-
default: "inherit"
|
|
2457
|
-
},
|
|
2458
|
-
color: {
|
|
2459
|
-
type: String,
|
|
2460
|
-
default: "inherit"
|
|
2461
|
-
},
|
|
2462
|
-
classPrefix: {
|
|
2463
|
-
type: String,
|
|
2464
|
-
default: "icon"
|
|
2465
|
-
}
|
|
2466
|
-
},
|
|
2479
|
+
props: iconProps,
|
|
2467
2480
|
setup(props) {
|
|
2468
|
-
return __spreadValues({}, props);
|
|
2469
|
-
},
|
|
2470
|
-
render() {
|
|
2471
2481
|
const {
|
|
2472
2482
|
name,
|
|
2473
2483
|
size,
|
|
2474
2484
|
color: color2,
|
|
2475
2485
|
classPrefix
|
|
2476
|
-
} =
|
|
2477
|
-
return
|
|
2478
|
-
"
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
"
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2486
|
+
} = toRefs(props);
|
|
2487
|
+
return () => {
|
|
2488
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
2489
|
+
"src": name.value,
|
|
2490
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
2491
|
+
"style": {
|
|
2492
|
+
width: size.value,
|
|
2493
|
+
verticalAlign: "text-bottom"
|
|
2494
|
+
}
|
|
2495
|
+
}, null) : createVNode("i", {
|
|
2496
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
2497
|
+
"style": {
|
|
2498
|
+
fontSize: size.value,
|
|
2499
|
+
color: color2.value
|
|
2500
|
+
}
|
|
2501
|
+
}, null);
|
|
2502
|
+
};
|
|
2491
2503
|
}
|
|
2492
2504
|
});
|
|
2493
|
-
Icon.install = function(app) {
|
|
2494
|
-
app.component(Icon.name, Icon);
|
|
2495
|
-
};
|
|
2496
2505
|
var colorHistory$1 = "";
|
|
2497
2506
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2498
2507
|
var lodash = { exports: {} };
|