vue-devui 1.0.0-alpha.5 → 1.0.0-beta.11
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 +31 -36
- package/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +508 -1
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +175 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/anchor/index.d.ts +7 -0
- package/anchor/index.es.js +263 -1
- package/anchor/index.umd.js +1 -1
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +301 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +95 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/breadcrumb/index.es.js +127 -1
- package/breadcrumb/index.umd.js +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +392 -1
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +61 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +329 -1
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1343 -1
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +377 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +85 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +176 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +1172 -1
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +32 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +287 -0
- package/drawer/index.umd.js +1 -0
- package/drawer/package.json +7 -0
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +527 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5857 -1
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2244 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +163 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +75 -1
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +480 -1
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +190 -1
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +240 -1
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +100 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +256 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +1225 -1
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nav-sprite/index.es.js +742 -0
- package/nav-sprite/index.umd.js +1 -0
- package/nav-sprite/package.json +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.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/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +368 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -34
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +642 -1
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +205 -1
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +236 -1
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +153 -1
- package/progress/index.umd.js +3 -1
- package/quadrant-diagram/index.d.ts +7 -0
- package/quadrant-diagram/index.es.js +489 -1
- package/quadrant-diagram/index.umd.js +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +225 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +220 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +181 -1
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +543 -1
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +706 -1
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +297 -1
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +199 -1
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +636 -1
- package/splitter/index.umd.js +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +42 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +239 -1
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +1 -1
- package/sticky/index.d.ts +7 -0
- package/sticky/index.es.js +197 -1
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +100 -1
- 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 +1828 -1
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +195 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +329 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +299 -0
- package/time-axis/index.umd.js +1 -0
- package/time-axis/package.json +7 -0
- package/time-axis/style.css +1 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +1255 -1
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +2060 -1
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +171 -1
- package/tooltip/index.umd.js +1 -1
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +1725 -1
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +907 -1
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +2834 -1
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27743 -1
- package/vue-devui.umd.js +29 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(f,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(f=typeof globalThis!="undefined"?globalThis:f||self,o(f.index={},f.Vue))})(this,function(f,o){"use strict";const j={tickWidth:10,spaceBetweenLabelsAxis:20,xAxisLabel:"\u7D27\u6025\u5EA6",yAxisLabel:"\u91CD\u8981\u5EA6",xAxisRange:{min:0,max:100,step:10},yAxisRange:{min:0,max:50,step:5},originPosition:{left:30,bottom:30},axisMargin:35,xWeight:1,yWeight:1},X={height:900,width:950},E=15,q={diagramId:{type:String,default:"1"},axisConfigs:{type:Object,default:j},view:{type:Object,default:X}},H={diagramId:{type:String},axisConfigs:{type:Object},view:{type:Object}};var V=typeof global=="object"&&global&&global.Object===Object&&global,Q=V,G=typeof self=="object"&&self&&self.Object===Object&&self,Y=Q||G||Function("return this")(),P=Y,U=P.Symbol,S=U,_=Object.prototype,z=_.hasOwnProperty,K=_.toString,p=S?S.toStringTag:void 0;function Z(e){var r=z.call(e,p),l=e[p];try{e[p]=void 0;var c=!0}catch{}var s=K.call(e);return c&&(r?e[p]=l:delete e[p]),s}var J=Object.prototype,ii=J.toString;function ei(e){return ii.call(e)}var ai="[object Null]",ti="[object Undefined]",$=S?S.toStringTag:void 0;function ni(e){return e==null?e===void 0?ti:ai:$&&$ in Object(e)?Z(e):ei(e)}function si(e){return e!=null&&typeof e=="object"}var ri="[object Symbol]";function li(e){return typeof e=="symbol"||si(e)&&ni(e)==ri}var oi=/\s/;function xi(e){for(var r=e.length;r--&&oi.test(e.charAt(r)););return r}var ui=/^\s+/;function ci(e){return e&&e.slice(0,xi(e)+1).replace(ui,"")}function N(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var B=0/0,gi=/^[-+]0x[0-9a-f]+$/i,di=/^0b[01]+$/i,fi=/^0o[0-7]+$/i,vi=parseInt;function F(e){if(typeof e=="number")return e;if(li(e))return B;if(N(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=N(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=ci(e);var l=di.test(e);return l||fi.test(e)?vi(e.slice(2),l?2:8):gi.test(e)?B:+e}var Ti=function(){return P.Date.now()},L=Ti,mi="Expected a function",yi=Math.max,pi=Math.min;function hi(e,r,l){var c,s,d,g,i,a,t=0,A=!1,v=!1,b=!0;if(typeof e!="function")throw new TypeError(mi);r=F(r)||0,N(l)&&(A=!!l.leading,v="maxWait"in l,d=v?yi(F(l.maxWait)||0,r):d,b="trailing"in l?!!l.trailing:b);function O(x){var n=c,u=s;return c=s=void 0,t=x,g=e.apply(u,n),g}function C(x){return t=x,i=setTimeout(m,r),A?O(x):g}function M(x){var n=x-a,u=x-t,T=r-n;return v?pi(T,d-u):T}function w(x){var n=x-a,u=x-t;return a===void 0||n>=r||n<0||v&&u>=d}function m(){var x=L();if(w(x))return I(x);i=setTimeout(m,M(x))}function I(x){return i=void 0,b&&c?O(x):(c=s=void 0,g)}function W(){i!==void 0&&clearTimeout(i),t=0,c=a=s=i=void 0}function D(){return i===void 0?g:I(L())}function k(){var x=L(),n=w(x);if(c=arguments,s=this,a=x,n){if(i===void 0)return C(a);if(v)return clearTimeout(i),i=setTimeout(m,r),O(a)}return i===void 0&&(i=setTimeout(m,r)),g}return k.cancel=W,k.flush=D,k}var Oi="",Ai=o.defineComponent({name:"DQuadrantDiagramAxis",props:H,setup(e){const{diagramId:r,view:l,axisConfigs:c}=o.toRefs(e),s=o.ref("#0000ff"),d=o.ref("#ff0000"),g=o.ref(),i=o.ref(),a=o.reactive({axisOrigin:{x:0,y:0},axisTop:0,axisRight:0,axisWidth:0,axisHeight:0,yAxisTicksNum:0,xAxisTicksNum:0,xTickSpacing:0,yTickSpacing:0}),t=c.value;o.onMounted(()=>{A()}),o.watch(l.value,()=>{A()});const A=hi(()=>{v(),b(),O(),I()},200),v=()=>{g.value=document.querySelector("#devui-quadrant-axis-"+r.value)},b=()=>{i.value=g.value.getContext("2d"),a.axisOrigin=t.axisOrigin,a.axisTop=t.axisTop,a.axisRight=t.axisRight,a.axisWidth=t.axisWidth,a.axisHeight=t.axisHeight,a.yAxisTicksNum=t.yAxisTicksNum,a.xAxisTicksNum=t.xAxisTicksNum,a.xTickSpacing=t.xTickSpacing,a.yTickSpacing=t.yTickSpacing},O=()=>{i.value.save(),i.value.fillStyle=s.value,i.value.strokeStyle=s.value,M(),C(),i.value.lineWidth=.5,w(),m(),i.value.restore()},C=()=>{i.value.beginPath(),i.value.moveTo(a.axisOrigin.x,a.axisOrigin.y),i.value.lineTo(a.axisOrigin.x,a.axisTop-t.axisMargin),i.value.stroke(),i.value.moveTo(a.axisOrigin.x,a.axisTop-t.axisMargin),i.value.lineTo(a.axisOrigin.x+5,a.axisTop-t.axisMargin+10),i.value.lineTo(a.axisOrigin.x-5,a.axisTop-t.axisMargin+10),i.value.fill()},M=()=>{i.value.beginPath(),i.value.moveTo(a.axisOrigin.x,a.axisOrigin.y),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y),i.value.stroke(),i.value.moveTo(a.axisRight+t.axisMargin,a.axisOrigin.y),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y+5),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y-5),i.value.fill()},w=()=>{let n;for(let u=1;u<a.xAxisTicksNum;u++)i.value.beginPath(),u%t.xAxisRange.step==0?n=t.tickWidth:n=t.tickWidth/2,i.value.moveTo(a.axisOrigin.x+u*a.xTickSpacing,a.axisOrigin.y-n),i.value.lineTo(a.axisOrigin.x+u*a.xTickSpacing,a.axisOrigin.y+n),i.value.stroke()},m=()=>{let n;for(let u=1;u<a.yAxisTicksNum;u++)i.value.beginPath(),u%t.yAxisRange.step==0?n=t.tickWidth:n=t.tickWidth/2,i.value.moveTo(a.axisOrigin.x-n,a.axisOrigin.y-u*a.yTickSpacing),i.value.lineTo(a.axisOrigin.x+n,a.axisOrigin.y-u*a.yTickSpacing),i.value.stroke()},I=()=>{i.value.save(),i.value.fillStyle=d.value,W(),D(),i.value.restore(),k()},W=()=>{i.value.textAlign="center",i.value.textBaseline="top";for(let n=0;n<=a.xAxisTicksNum;n++)n%t.xAxisRange.step==0&&i.value.fillText(n,a.axisOrigin.x+n*a.xTickSpacing,a.axisOrigin.y+t.spaceBetweenLabelsAxis)},D=()=>{i.value.textAlign="center",i.value.textBaseline="middle";for(let n=0;n<=a.yAxisTicksNum;n++)n%t.yAxisRange.step==0&&i.value.fillText(n,a.axisOrigin.x-t.spaceBetweenLabelsAxis,a.axisOrigin.y-n*a.yTickSpacing)},k=()=>{i.value.font="12px Microsoft YaHei",i.value.textAlign="left",i.value.fillStyle=d.value;const n=i.value.measureText(t.xAxisLabel).width;x(t.xAxisLabel,a.axisRight+t.axisMargin/2,a.axisOrigin.y-n-E),i.value.fillText(t.yAxisLabel,a.axisOrigin.x+E,a.axisTop-t.axisMargin/2)},x=(n,u,T)=>{for(let R=0;R<n.length;R++){const y=n.slice(R,R+1).toString();y.match(/[A-Za-z0-9]/)?(i.value.save(),i.value.translate(u,T),i.value.rotate(Math.PI/180*90),i.value.textBaseline="bottom",i.value.fillText(y,0,0),i.value.restore(),T+=i.value.measureText(y).width):y.match(/[\u4E00-\u9FA5]/)&&(i.value.save(),i.value.textBaseline="top",i.value.fillText(y,u,T),i.value.restore(),T+=i.value.measureText(y).width)}}},render(){const{diagramId:e,view:r}=this;return o.createVNode("div",null,[o.createVNode("canvas",{id:"devui-quadrant-axis-"+e,height:r.height,width:r.width},null)])}}),h=o.defineComponent({name:"DQuadrantDiagram",props:q,setup(e){const{diagramId:r,axisConfigs:l,view:c}=o.toRefs(e),s=o.reactive({axisOrigin:{x:null,y:null},axisTop:null,axisRight:null,axisWidth:null,axisHeight:null,yAxisTicksNum:null,xAxisTicksNum:null,xTickSpacing:null,yTickSpacing:null}),d=()=>{const g=Object.keys(j);for(let i=0;i<g.length;i++)s[g[i]]===void 0&&(s[g[i]]=j[g[i]]);s.axisOrigin={x:l.value.originPosition.left,y:c.value.height-l.value.originPosition.bottom},s.axisTop=l.value.axisMargin,s.axisRight=c.value.width-l.value.axisMargin,s.axisWidth=s.axisRight-s.axisOrigin.x,s.axisHeight=s.axisOrigin.y-s.axisTop,s.yAxisTicksNum=l.value.yAxisRange.max-l.value.yAxisRange.min,s.xAxisTicksNum=l.value.xAxisRange.max-l.value.xAxisRange.min,s.xTickSpacing=s.axisWidth/s.xAxisTicksNum,s.yTickSpacing=s.axisHeight/s.yAxisTicksNum};return d(),o.watch(c.value,()=>{d()}),{diagramId:r,calAxisConfig:s}},render(){const{diagramId:e,calAxisConfig:r,view:l}=this;return o.createVNode("div",{class:"devui-quadrant-diagram",id:e},[o.createVNode(Ai,{diagramId:e,axisConfigs:r,view:l},null)])}});h.install=function(e){e.component(h.name,h)};var bi={title:"QuadrantDiagram \u8C61\u9650\u56FE",category:"\u6570\u636E\u5C55\u793A",status:"10%",install(e){e.use(h)}};f.QuadrantDiagram=h,f.default=bi,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
|
package/radio/index.d.ts
ADDED
package/radio/index.es.js
CHANGED
|
@@ -1 +1,225 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, inject, computed, createVNode, provide, toRef, isVNode } from "vue";
|
|
21
|
+
const radioCommonProps = {
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
beforeChange: {
|
|
31
|
+
type: Function,
|
|
32
|
+
default: null
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const radioProps = __spreadProps(__spreadValues({}, radioCommonProps), {
|
|
40
|
+
value: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
default: null
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const radioGroupProps = __spreadProps(__spreadValues({}, radioCommonProps), {
|
|
47
|
+
values: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: null
|
|
50
|
+
},
|
|
51
|
+
direction: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "column"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const radioGroupInjectionKey = Symbol("DRadioGroup");
|
|
57
|
+
var radio = "";
|
|
58
|
+
var Radio = defineComponent({
|
|
59
|
+
name: "DRadio",
|
|
60
|
+
props: radioProps,
|
|
61
|
+
emits: ["change", "update:modelValue"],
|
|
62
|
+
setup(props, {
|
|
63
|
+
emit
|
|
64
|
+
}) {
|
|
65
|
+
const radioGroupConf = inject(radioGroupInjectionKey, null);
|
|
66
|
+
const isDisabled = computed(() => {
|
|
67
|
+
return props.disabled || (radioGroupConf == null ? void 0 : radioGroupConf.disabled.value);
|
|
68
|
+
});
|
|
69
|
+
const isChecked = computed(() => {
|
|
70
|
+
const _value = radioGroupConf ? radioGroupConf.modelValue.value : props.modelValue;
|
|
71
|
+
return props.value === _value;
|
|
72
|
+
});
|
|
73
|
+
const radioName = computed(() => {
|
|
74
|
+
return radioGroupConf ? radioGroupConf.name.value : props.name;
|
|
75
|
+
});
|
|
76
|
+
const judgeCanChange = (_value) => {
|
|
77
|
+
const beforeChange = props.beforeChange || (radioGroupConf ? radioGroupConf.beforeChange : null);
|
|
78
|
+
let flag = Promise.resolve(true);
|
|
79
|
+
if (beforeChange) {
|
|
80
|
+
const canChange = beforeChange(_value);
|
|
81
|
+
if (typeof canChange === "undefined") {
|
|
82
|
+
return flag;
|
|
83
|
+
}
|
|
84
|
+
if (typeof canChange === "boolean") {
|
|
85
|
+
flag = Promise.resolve(canChange);
|
|
86
|
+
} else {
|
|
87
|
+
flag = canChange;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return flag;
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
isChecked,
|
|
94
|
+
radioName,
|
|
95
|
+
disabled: isDisabled,
|
|
96
|
+
handleChange: async (event) => {
|
|
97
|
+
const _value = props.value;
|
|
98
|
+
const canChange = await judgeCanChange(_value);
|
|
99
|
+
if (!canChange) {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
radioGroupConf == null ? void 0 : radioGroupConf.emitChange(_value);
|
|
104
|
+
emit("update:modelValue", _value);
|
|
105
|
+
emit("change", _value);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
render() {
|
|
110
|
+
var _a;
|
|
111
|
+
const {
|
|
112
|
+
disabled,
|
|
113
|
+
radioName,
|
|
114
|
+
value,
|
|
115
|
+
isChecked,
|
|
116
|
+
$slots,
|
|
117
|
+
handleChange
|
|
118
|
+
} = this;
|
|
119
|
+
const labelCls = ["devui-radio", {
|
|
120
|
+
active: isChecked,
|
|
121
|
+
disabled
|
|
122
|
+
}];
|
|
123
|
+
return createVNode("label", {
|
|
124
|
+
"class": labelCls
|
|
125
|
+
}, [createVNode("input", {
|
|
126
|
+
"type": "radio",
|
|
127
|
+
"name": radioName,
|
|
128
|
+
"class": "devui-radio-input",
|
|
129
|
+
"disabled": disabled,
|
|
130
|
+
"onChange": handleChange,
|
|
131
|
+
"value": value,
|
|
132
|
+
"checked": isChecked
|
|
133
|
+
}, null), createVNode("span", {
|
|
134
|
+
"class": "devui-radio-material"
|
|
135
|
+
}, [createVNode("svg", {
|
|
136
|
+
"height": "100%",
|
|
137
|
+
"width": "100%",
|
|
138
|
+
"viewBox": "0 0 1024 1024",
|
|
139
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
140
|
+
}, [createVNode("circle", {
|
|
141
|
+
"class": "devui-radio-material-outer",
|
|
142
|
+
"cx": "512",
|
|
143
|
+
"cy": "512",
|
|
144
|
+
"r": "486.5",
|
|
145
|
+
"stroke-width": "51"
|
|
146
|
+
}, null), createVNode("circle", {
|
|
147
|
+
"class": "devui-radio-material-inner",
|
|
148
|
+
"cx": "512",
|
|
149
|
+
"fill-rule": "nonzero",
|
|
150
|
+
"cy": "512",
|
|
151
|
+
"r": "320"
|
|
152
|
+
}, null)])]), createVNode("span", {
|
|
153
|
+
"class": "devui-radio-label"
|
|
154
|
+
}, [(_a = $slots.default) == null ? void 0 : _a.call($slots)])]);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
var radioGroup = "";
|
|
158
|
+
function _isSlot(s) {
|
|
159
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
160
|
+
}
|
|
161
|
+
var RadioGroup = defineComponent({
|
|
162
|
+
name: "DRadioGroup",
|
|
163
|
+
props: radioGroupProps,
|
|
164
|
+
emits: ["change", "update:modelValue"],
|
|
165
|
+
setup(props, {
|
|
166
|
+
emit
|
|
167
|
+
}) {
|
|
168
|
+
const emitChange = (radioValue) => {
|
|
169
|
+
emit("update:modelValue", radioValue);
|
|
170
|
+
emit("change", radioValue);
|
|
171
|
+
};
|
|
172
|
+
provide(radioGroupInjectionKey, {
|
|
173
|
+
modelValue: toRef(props, "modelValue"),
|
|
174
|
+
name: toRef(props, "name"),
|
|
175
|
+
disabled: toRef(props, "disabled"),
|
|
176
|
+
beforeChange: props.beforeChange,
|
|
177
|
+
emitChange
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
render() {
|
|
181
|
+
const {
|
|
182
|
+
values,
|
|
183
|
+
direction
|
|
184
|
+
} = this;
|
|
185
|
+
const getContent = () => {
|
|
186
|
+
const defaultSlot = this.$slots.default;
|
|
187
|
+
if (defaultSlot) {
|
|
188
|
+
return defaultSlot();
|
|
189
|
+
} else if (Array.isArray(values)) {
|
|
190
|
+
return values.map((item) => {
|
|
191
|
+
return createVNode(Radio, {
|
|
192
|
+
"key": item,
|
|
193
|
+
"value": item
|
|
194
|
+
}, _isSlot(item) ? item : {
|
|
195
|
+
default: () => [item]
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
return "";
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
return createVNode("div", {
|
|
203
|
+
"class": ["devui-radio-group", {
|
|
204
|
+
"is-row": direction === "row",
|
|
205
|
+
"is-column": direction === "column"
|
|
206
|
+
}]
|
|
207
|
+
}, [getContent()]);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Radio.install = function(app) {
|
|
211
|
+
app.component(Radio.name, Radio);
|
|
212
|
+
};
|
|
213
|
+
RadioGroup.install = function(app) {
|
|
214
|
+
app.component(RadioGroup.name, RadioGroup);
|
|
215
|
+
};
|
|
216
|
+
var index = {
|
|
217
|
+
title: "Radio \u5355\u9009\u6846",
|
|
218
|
+
category: "\u6570\u636E\u5F55\u5165",
|
|
219
|
+
status: "100%",
|
|
220
|
+
install(app) {
|
|
221
|
+
app.use(Radio);
|
|
222
|
+
app.use(RadioGroup);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
export { Radio, RadioGroup, index as default };
|
package/radio/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var S=Object.defineProperty,j=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var V=(n,e,o)=>e in n?S(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,p=(n,e)=>{for(var o in e||(e={}))k.call(e,o)&&V(n,o,e[o]);if(C)for(var o of C(e))x.call(e,o)&&V(n,o,e[o]);return n},y=(n,e)=>j(n,P(e));(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const o={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},v=y(p({},o),{value:{type:String,required:!0,default:null}}),N=y(p({},o),{values:{type:Array,default:null},direction:{type:String,default:"column"}}),b=Symbol("DRadioGroup");var D="",s=e.defineComponent({name:"DRadio",props:v,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=e.inject(b,null),i=e.computed(()=>a.disabled||(t==null?void 0:t.disabled.value)),l=e.computed(()=>{const r=t?t.modelValue.value:a.modelValue;return a.value===r}),h=e.computed(()=>t?t.name.value:a.name),g=r=>{const u=a.beforeChange||(t?t.beforeChange:null);let f=Promise.resolve(!0);if(u){const m=u(r);if(typeof m=="undefined")return f;typeof m=="boolean"?f=Promise.resolve(m):f=m}return f};return{isChecked:l,radioName:h,disabled:i,handleChange:async r=>{const u=a.value;if(!await g(u)){r.preventDefault();return}t==null||t.emitChange(u),d("update:modelValue",u),d("change",u)}}},render(){var r;const{disabled:a,radioName:d,value:t,isChecked:i,$slots:l,handleChange:h}=this,g=["devui-radio",{active:i,disabled:a}];return e.createVNode("label",{class:g},[e.createVNode("input",{type:"radio",name:d,class:"devui-radio-input",disabled:a,onChange:h,value:t,checked:i},null),e.createVNode("span",{class:"devui-radio-material"},[e.createVNode("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("circle",{class:"devui-radio-material-outer",cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),e.createVNode("circle",{class:"devui-radio-material-inner",cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),e.createVNode("span",{class:"devui-radio-label"},[(r=l.default)==null?void 0:r.call(l)])])}}),_="";function R(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!e.isVNode(a)}var c=e.defineComponent({name:"DRadioGroup",props:N,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=i=>{d("update:modelValue",i),d("change",i)};e.provide(b,{modelValue:e.toRef(a,"modelValue"),name:e.toRef(a,"name"),disabled:e.toRef(a,"disabled"),beforeChange:a.beforeChange,emitChange:t})},render(){const{values:a,direction:d}=this,t=()=>{const i=this.$slots.default;return i?i():Array.isArray(a)?a.map(l=>e.createVNode(s,{key:l,value:l},R(l)?l:{default:()=>[l]})):""};return e.createVNode("div",{class:["devui-radio-group",{"is-row":d==="row","is-column":d==="column"}]},[t()])}});s.install=function(a){a.component(s.name,s)},c.install=function(a){a.component(c.name,c)};var w={title:"Radio \u5355\u9009\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(a){a.use(s),a.use(c)}};n.Radio=s,n.RadioGroup=c,n.default=w,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
|
package/rate/index.d.ts
ADDED
package/rate/index.es.js
CHANGED
|
@@ -1 +1,220 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, reactive, ref, onMounted, createVNode, resolveComponent } from "vue";
|
|
2
|
+
const rateProps = {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: Number
|
|
5
|
+
},
|
|
6
|
+
read: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false
|
|
9
|
+
},
|
|
10
|
+
count: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 5
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
color: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
character: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
allowHalf: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
onChange: {
|
|
35
|
+
type: Function,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
onTouched: {
|
|
39
|
+
type: Function,
|
|
40
|
+
default: void 0
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var rate = "";
|
|
44
|
+
var Rate = defineComponent({
|
|
45
|
+
name: "DRate",
|
|
46
|
+
props: rateProps,
|
|
47
|
+
emits: ["change", "update:modelValue"],
|
|
48
|
+
setup(props, ctx) {
|
|
49
|
+
const totalLevelArray = reactive([]);
|
|
50
|
+
const chooseValue = ref(0);
|
|
51
|
+
const setChange = (start, end, width) => {
|
|
52
|
+
for (let i = start; i < end; i++) {
|
|
53
|
+
totalLevelArray[i]["width"] = width;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const initRating = () => {
|
|
57
|
+
if (!props.modelValue) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
chooseValue.value = props.modelValue - 1;
|
|
61
|
+
const halfStar = chooseValue.value % 1;
|
|
62
|
+
const intCurrentLevel = Math.floor(chooseValue.value);
|
|
63
|
+
setChange(0, intCurrentLevel + 1, "100%");
|
|
64
|
+
if (halfStar > 0) {
|
|
65
|
+
totalLevelArray[intCurrentLevel + 1]["width"] = halfStar * 100 + "%";
|
|
66
|
+
setChange(intCurrentLevel + 2, props.count, "0");
|
|
67
|
+
} else {
|
|
68
|
+
setChange(intCurrentLevel + 1, props.count, "0");
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
for (let i = 0; i < props.count; i++) {
|
|
73
|
+
totalLevelArray.push({
|
|
74
|
+
width: "0"
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
initRating();
|
|
78
|
+
});
|
|
79
|
+
const hoverToggle = (e, index2, reset = false) => {
|
|
80
|
+
if (props.read) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (reset) {
|
|
84
|
+
if (chooseValue.value >= 0) {
|
|
85
|
+
setChange(0, chooseValue.value + 1, "100%");
|
|
86
|
+
setChange(chooseValue.value + 1, props.count, "0");
|
|
87
|
+
} else {
|
|
88
|
+
setChange(0, props.count, "0");
|
|
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
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const selectValue = (e, index2) => {
|
|
101
|
+
if (props.read) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
setChange(0, index2, "100%");
|
|
105
|
+
if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
|
|
106
|
+
setChange(index2, index2 + 1, "50%");
|
|
107
|
+
chooseValue.value = index2 - 0.5;
|
|
108
|
+
} else {
|
|
109
|
+
setChange(index2, index2 + 1, "100%");
|
|
110
|
+
chooseValue.value = index2;
|
|
111
|
+
}
|
|
112
|
+
setChange(index2 + 1, props.count, "0");
|
|
113
|
+
index2 = chooseValue.value;
|
|
114
|
+
props.onChange && props.onChange(index2 + 1);
|
|
115
|
+
props.onTouched && props.onTouched();
|
|
116
|
+
ctx.emit("update:modelValue", index2 + 1);
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
totalLevelArray,
|
|
120
|
+
chooseValue,
|
|
121
|
+
hoverToggle,
|
|
122
|
+
selectValue
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
render() {
|
|
126
|
+
const {
|
|
127
|
+
totalLevelArray,
|
|
128
|
+
chooseValue,
|
|
129
|
+
icon,
|
|
130
|
+
character,
|
|
131
|
+
read,
|
|
132
|
+
type,
|
|
133
|
+
color,
|
|
134
|
+
hoverToggle,
|
|
135
|
+
selectValue
|
|
136
|
+
} = this;
|
|
137
|
+
return createVNode("div", {
|
|
138
|
+
"class": "devui-star-container",
|
|
139
|
+
"onMouseleave": (e) => hoverToggle(e, chooseValue, true)
|
|
140
|
+
}, [totalLevelArray.map((item, index2) => createVNode("div", {
|
|
141
|
+
"class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
|
|
142
|
+
"key": index2,
|
|
143
|
+
"onMouseover": (e) => hoverToggle(e, index2),
|
|
144
|
+
"onClick": (e) => selectValue(e, index2)
|
|
145
|
+
}, [icon && !character && createVNode("span", {
|
|
146
|
+
"class": "devui-star-color"
|
|
147
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
148
|
+
"name": icon
|
|
149
|
+
}, null)]), character && !icon && createVNode("span", {
|
|
150
|
+
"class": "devui-star-color"
|
|
151
|
+
}, [character]), !icon && !character && createVNode("span", {
|
|
152
|
+
"class": "devui-star-color"
|
|
153
|
+
}, [createVNode("svg", {
|
|
154
|
+
"width": "16px",
|
|
155
|
+
"height": "16px",
|
|
156
|
+
"viewBox": "0 0 16 16",
|
|
157
|
+
"version": "1.1",
|
|
158
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
159
|
+
"xmlns-xlink": "http://www.w3.org/1999/xlink"
|
|
160
|
+
}, [createVNode("g", {
|
|
161
|
+
"stroke": "none",
|
|
162
|
+
"stroke-width": "1",
|
|
163
|
+
"fill": "none",
|
|
164
|
+
"fill-rule": "evenodd"
|
|
165
|
+
}, [createVNode("g", {
|
|
166
|
+
"fill": "#E3E5E9",
|
|
167
|
+
"id": "Mask"
|
|
168
|
+
}, [createVNode("polygon", {
|
|
169
|
+
"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
|
+
}, null)])])])]), icon && !character && createVNode("span", {
|
|
171
|
+
"class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
|
|
172
|
+
"style": {
|
|
173
|
+
width: item.width
|
|
174
|
+
}
|
|
175
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
176
|
+
"name": icon,
|
|
177
|
+
"color": color
|
|
178
|
+
}, null)]), character && !icon && createVNode("span", {
|
|
179
|
+
"class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
|
|
180
|
+
"style": {
|
|
181
|
+
color,
|
|
182
|
+
width: item.width
|
|
183
|
+
}
|
|
184
|
+
}, [character]), !character && !icon && createVNode("span", {
|
|
185
|
+
"class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
|
|
186
|
+
"style": {
|
|
187
|
+
color,
|
|
188
|
+
width: item.width
|
|
189
|
+
}
|
|
190
|
+
}, [createVNode("svg", {
|
|
191
|
+
"width": "16px",
|
|
192
|
+
"height": "16px",
|
|
193
|
+
"viewBox": "0 0 16 16",
|
|
194
|
+
"version": "1.1",
|
|
195
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
196
|
+
"xmlns-xlink": "http://www.w3.org/1999/xlink"
|
|
197
|
+
}, [createVNode("g", {
|
|
198
|
+
"stroke": "none",
|
|
199
|
+
"stroke-width": "1",
|
|
200
|
+
"fill": "none",
|
|
201
|
+
"fill-rule": "evenodd"
|
|
202
|
+
}, [createVNode("g", {
|
|
203
|
+
"id": "Mask"
|
|
204
|
+
}, [createVNode("polygon", {
|
|
205
|
+
"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
|
+
}, null)])])])])]))]);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
Rate.install = function(app) {
|
|
210
|
+
app.component(Rate.name, Rate);
|
|
211
|
+
};
|
|
212
|
+
var index = {
|
|
213
|
+
title: "Rate \u8BC4\u5206",
|
|
214
|
+
category: "\u6570\u636E\u5C55\u793A",
|
|
215
|
+
status: "100%",
|
|
216
|
+
install(app) {
|
|
217
|
+
app.use(Rate);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
export { Rate, index as default };
|
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";const g={modelValue:{type:Number},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 V="",d=t.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(o,h){const r=t.reactive([]),a=t.ref(0),l=(n,e,c)=>{for(let s=n;s<e;s++)r[s].width=c},u=()=>{if(!o.modelValue)return;a.value=o.modelValue-1;const n=a.value%1,e=Math.floor(a.value);l(0,e+1,"100%"),n>0?(r[e+1].width=n*100+"%",l(e+2,o.count,"0")):l(e+1,o.count,"0")};return t.onMounted(()=>{for(let n=0;n<o.count;n++)r.push({width:"0"});u()}),{totalLevelArray:r,chooseValue:a,hoverToggle:(n,e,c=!1)=>{o.read||(c?a.value>=0?(l(0,a.value+1,"100%"),l(a.value+1,o.count,"0")):l(0,o.count,"0"):(l(0,e+1,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?l(e,e+1,"50%"):l(e,e+1,"100%"),l(e+1,o.count,"0")))},selectValue:(n,e)=>{o.read||(l(0,e,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?(l(e,e+1,"50%"),a.value=e-.5):(l(e,e+1,"100%"),a.value=e),l(e+1,o.count,"0"),e=a.value,o.onChange&&o.onChange(e+1),o.onTouched&&o.onTouched(),h.emit("update:modelValue",e+1))}}},render(){const{totalLevelArray:o,chooseValue:h,icon:r,character:a,read:l,type:u,color:f,hoverToggle:v,selectValue:n}=this;return t.createVNode("div",{class:"devui-star-container",onMouseleave:e=>v(e,h,!0)},[o.map((e,c)=>t.createVNode("div",{class:`devui-star-align devui-pointer ${l?"devui-only-read":""}`,key:c,onMouseover:s=>v(s,c),onClick:s=>n(s,c)},[r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode(t.resolveComponent("d-icon"),{name:r},null)]),a&&!r&&t.createVNode("span",{class:"devui-star-color"},[a]),!r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[t.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)])])])]),r&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{width:e.width}},[t.createVNode(t.resolveComponent("d-icon"),{name:r,color:f},null)]),a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[a]),!a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[t.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"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{id:"Mask"},[t.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)])])])])]))])}});d.install=function(o){o.component(d.name,d)};var w={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.use(d)}};i.Rate=d,i.default=w,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|