vue-devui 1.0.0-rc.8 → 1.0.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 +188 -149
- package/alert/index.es.js +14 -9
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8392 -418
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +10 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +191 -53
- package/button/index.umd.js +17 -17
- package/button/style.css +1 -1
- package/card/index.es.js +7 -3
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8050 -241
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12022 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +24 -7
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +190 -165
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +785 -145
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +399 -300
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +185 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8220 -45
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +279 -204
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +3 -3
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +53 -53
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8319 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +921 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +539 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +451 -173
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +212 -70
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/paginationInjectionKey.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +89 -142
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -4
- package/pagination/index.es.js +10180 -129
- package/pagination/index.umd.js +27 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +4 -0
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +262 -229
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/progress/style.css +1 -1
- package/radio/index.es.js +7954 -156
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3829 -1042
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9202 -495
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +89 -263
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +118 -145
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +454 -233
- package/splitter/index.umd.js +13 -13
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +6 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +387 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7787 -62
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5225 -1726
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +303 -102
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +11 -8
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7876 -41
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9607 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +170 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -238
- package/tooltip/index.umd.js +14 -14
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11342 -793
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +458 -102
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20475 -11072
- package/vue-devui.umd.js +31 -24
- package/date-picker/index.es.js +0 -1097
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Loading.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
package/form/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-popover__icon-wrap{width:16px;height:16px;margin-right:8px}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>path{fill:var(--devui-success, #50d4ab)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>circle,.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>path{fill:var(--devui-warning, #fac20a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>g{fill:var(--devui-info, #5e7ce0)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>path{fill:var(--devui-danger, #f66f6a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__content.devui-flexible-overlay{display:flex;flex-wrap:wrap;align-items:center;white-space:nowrap;padding:4px 12px;line-height:1.5;border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e);font-size:var(--devui-font-size-sm, 12px)}.devui-popover__content.devui-flexible-overlay.is-icon{flex-wrap:nowrap}.devui-popover--fade-bottom-enter-from,.devui-popover--fade-bottom-leave-to,.devui-popover--fade-top-enter-from,.devui-popover--fade-top-leave-to{opacity:.8;transform:scaleY(.8)}.devui-popover--fade-bottom-enter-to,.devui-popover--fade-bottom-leave-from,.devui-popover--fade-top-enter-to,.devui-popover--fade-top-leave-from{opacity:1;transform:scaleY(1)}.devui-popover--fade-bottom-enter-active,.devui-popover--fade-top-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-bottom-leave-active,.devui-popover--fade-top-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-popover--fade-left-enter-from,.devui-popover--fade-left-leave-to,.devui-popover--fade-right-enter-from,.devui-popover--fade-right-leave-to{opacity:.8;transform:scaleX(.8)}.devui-popover--fade-left-enter-to,.devui-popover--fade-left-leave-from,.devui-popover--fade-right-enter-to,.devui-popover--fade-right-leave-from{opacity:1;transform:scaleX(1)}.devui-popover--fade-left-enter-active,.devui-popover--fade-right-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-left-leave-active,.devui-popover--fade-right-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-form__label{align-self:flex-start}.devui-form__label--vertical{padding-bottom:8px}.devui-form__label--sm{flex:0 0 80px}.devui-form__label--md{flex:0 0 100px}.devui-form__label--lg{flex:0 0 150px}.devui-form__label--start{text-align:left}.devui-form__label--center{text-align:center}.devui-form__label--end{text-align:end}.devui-form__label-span{display:inline-block;vertical-align:middle;color:var(--devui-text, #252b3a)}.devui-form__label--required:before{content:"*";color:red;display:inline-block;margin-right:8px;margin-left:-12px}.devui-form__label-help{position:relative;top:-.1em;display:inline-block;vertical-align:middle;margin-left:4px;cursor:pointer}.devui-form__control{flex:1 1 auto;position:relative;width:100%}.devui-form__control--horizontal{margin-left:16px}.devui-form__control .devui-star{color:red}.devui-form__control .devui-form__control-container{position:relative}.devui-form__control .devui-form__control-container--horizontal{display:flex;width:100%}.devui-form__control .devui-form__control-container--horizontal .devui-validate-tip{margin:0}.devui-form__control .devui-form__control-container .devui-form__feedback-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:none;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg circle{fill:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg circle{fill:var(--devui-success, #50d4ab)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg{animation:loading-keyframes 1s infinite linear}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg path{fill:var(--devui-brand, #5e7ce0)}.devui-form__control .devui-form__control-container--has-feedback{display:flex;align-items:center}.devui-form__control .devui-form__control-container--has-feedback input{padding-right:28px}.devui-form__control .devui-form__control-container--feedback-error{border:1px solid #f66f6a;border-radius:2px}.devui-form__control .devui-form__control-container--feedback-error input{background-color:#ffeeed;border-color:transparent}.devui-form__control .devui-form__control-container--feedback-error input:hover{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error input:focus{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error .devui-select-arrow{right:24px!important}.devui-form__control .devui-form__control-info{line-height:1}.devui-form__control .devui-form__control-info .error-message{display:inline-block;min-height:20px;line-height:1.5;font-size:var(--devui-font-size, 14px);color:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-info .devui-form__control-extra{font-size:var(--devui-font-size, 14px);color:var(--devui-aide-text, #71757f);min-height:20px;line-height:1.5;text-align:justify}@keyframes loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.devui-form__item--horizontal{display:flex;align-items:center;margin-bottom:20px}.devui-form__item--vertical{display:flex;flex-direction:column;margin-bottom:20px}.devui-form__item--error{margin-bottom:0}.devui-form-operation .star{color:red}
|
package/fullscreen/index.es.js
CHANGED
|
@@ -38,8 +38,8 @@ function createBem(namespace, element, modifier) {
|
|
|
38
38
|
}
|
|
39
39
|
return cls;
|
|
40
40
|
}
|
|
41
|
-
function useNamespace(block) {
|
|
42
|
-
const namespace = `devui-${block}`;
|
|
41
|
+
function useNamespace(block, needDot = false) {
|
|
42
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
43
43
|
const b = () => createBem(namespace);
|
|
44
44
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
45
45
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
package/fullscreen/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(u,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(u=typeof globalThis!="undefined"?globalThis:u||self,l(u.index={},u.Vue))})(this,function(u,l){"use strict";const F={modelValue:{type:Boolean,default:!1},mode:{type:String,default:"normal"},zIndex:{type:Number,default:10}},S=27;function v(e,n){const{modelValue:t}=l.toRefs(e),s=c=>{c.keyCode===S&&t&&n.emit("update:modelValue",!1)};l.onMounted(()=>{document.addEventListener("keydown",s)}),l.onUnmounted(()=>{document.removeEventListener("keydown",s)})}function i(e,n,t){let s=e;return n&&(s+=`__${n}`),t&&(s+=`--${t}`),s}function h(e,n=!1){const t=n?`.devui-${e}`:`devui-${e}`;return{b:()=>i(t),e:r=>r?i(t,r):"",m:r=>r?i(t,"",r):"",em:(r,a)=>r&&a?i(t,r,a):""}}const m=h("fullscreen"),p=(e,n)=>{e.classList.add(m.b()),n.zIndex&&e.setAttribute("style",`z-index: ${n.zIndex}`)},b=e=>{e.classList.remove(m.b()),e.style.zIndex=""},w=async e=>{let n=null;return e.requestFullscreen?n=e.requestFullscreen():e.mozRequestFullScreen?n=e.mozRequestFullScreen():e.webkitRequestFullScreen?n=Promise.resolve(e.webkitRequestFullScreen()):e.msRequestFullscreen&&(n=Promise.resolve(e.msRequestFullscreen())),await(n==null?void 0:n.then(()=>!!document.fullscreenElement))},x=async e=>{let n=null;return e.exitFullscreen?n=e.exitFullscreen():e.mozCancelFullScreen?n=e.mozCancelFullScreen():e.webkitCancelFullScreen?n=Promise.resolve(e.webkitCancelFullScreen()):e.msExitFullscreen&&(n=Promise.resolve(e.msExitFullscreen())),await(n==null?void 0:n.then(()=>!!document.fullscreenElement))},C=()=>{document.getElementsByTagName("html")[0].classList.add(m.e("html"))},q=()=>{document.getElementsByTagName("html")[0].classList.remove(m.e("html"))};function z(e,n,t){const{modelValue:s,mode:c}=l.toRefs(e);let d=!1;const y=o=>{o?(p(n.value,e),C()):(b(n.value),q())},r=o=>{o?w(n.value):d||x(document)};l.watch(s,o=>{c.value==="normal"&&y(o),c.value==="immersive"&&r(o)});const a=()=>{document.fullscreenElement?d=!1:(t.emit("update:modelValue"),d=!0)};l.onMounted(()=>{document.addEventListener("fullscreenchange",a)}),l.onUnmounted(()=>{document.removeEventListener("fullscreenchange",a)})}var N="",f=l.defineComponent({name:"DFullscreen",props:F,emits:["update:modelValue"],setup(e,n){const t=l.ref();return z(e,t,n),v(e,n),()=>{const s=l.renderSlot(l.useSlots(),"default");return l.createVNode("div",{ref:t},[s])}}}),g={title:"Fullscreen \u5168\u5C4F",category:"\u901A\u7528",status:"100%",install(e){e.component(f.name,f)}};u.Fullscreen=f,u.default=g,u.fullscreenProps=F,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|
package/grid/index.es.js
CHANGED
|
@@ -122,8 +122,8 @@ function createBem(namespace, element, modifier) {
|
|
|
122
122
|
}
|
|
123
123
|
return cls;
|
|
124
124
|
}
|
|
125
|
-
function useNamespace(block) {
|
|
126
|
-
const namespace = `devui-${block}`;
|
|
125
|
+
function useNamespace(block, needDot = false) {
|
|
126
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
127
127
|
const b = () => createBem(namespace);
|
|
128
128
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
129
129
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
@@ -148,7 +148,7 @@ var Row = defineComponent({
|
|
|
148
148
|
const rowClass = computed(() => ({
|
|
149
149
|
[ns.em("align", props.align)]: true,
|
|
150
150
|
[ns.em("justify", props.justify)]: true,
|
|
151
|
-
[ns.e("wrap")]:
|
|
151
|
+
[ns.e("wrap")]: props.wrap
|
|
152
152
|
}));
|
|
153
153
|
let token;
|
|
154
154
|
onMounted(() => {
|
|
@@ -224,10 +224,12 @@ function useSize(colSizes) {
|
|
|
224
224
|
} else if (valueType === "object") {
|
|
225
225
|
const colSizesKeys = Object.keys(colSizes[key]);
|
|
226
226
|
const sum = colSizesKeys.filter((item) => item in colPropsBaseClass).reduce((tot, k) => {
|
|
227
|
-
|
|
227
|
+
const baseClass = colSizes[key];
|
|
228
|
+
const _class = baseClass[k];
|
|
229
|
+
if (typeof _class !== "number") {
|
|
228
230
|
return "";
|
|
229
231
|
} else {
|
|
230
|
-
tot = `${setSpace(tot)}${colNs.em(key, `${k}-${
|
|
232
|
+
tot = `${setSpace(tot)}${colNs.em(key, `${k}-${_class}`)}`;
|
|
231
233
|
}
|
|
232
234
|
return tot;
|
|
233
235
|
}, "");
|
|
@@ -265,7 +267,7 @@ var Col = defineComponent({
|
|
|
265
267
|
var _a;
|
|
266
268
|
return createVNode("div", {
|
|
267
269
|
"class": [ns.b(), colClassNames.value, sizeClassNames.value],
|
|
268
|
-
"style": __spreadValues(__spreadValues({}, colStyle.value), gutterStyle.value)
|
|
270
|
+
"style": __spreadValues(__spreadValues({}, colStyle.value), gutterStyle == null ? void 0 : gutterStyle.value)
|
|
269
271
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
270
272
|
};
|
|
271
273
|
}
|
package/grid/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var
|
|
1
|
+
var I=Object.defineProperty;var _=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var L=(s,n,i)=>n in s?I(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i,a=(s,n)=>{for(var i in n||(n={}))J.call(n,i)&&L(s,i,n[i]);if(_)for(var i of _(n))Q.call(n,i)&&L(s,i,n[i]);return s};(function(s,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(s=typeof globalThis!="undefined"?globalThis:s||self,n(s.index={},s.Vue))})(this,function(s,n){"use strict";const i={align:{type:String,default:"top"},gutter:{type:[Number,Object,Array],default:0},justify:{type:String,default:"start"},wrap:{type:Boolean,default:!1}},b=Number,B={flex:[String,Number],order:b},w={offset:b,pull:b,push:b,span:b},d=[Number,Object],x={xs:d,sm:d,md:d,lg:d,xl:d,xxl:d},O=a(a(a({},B),w),x),A=["xxl","xl","lg","md","sm","xs"],C={xs:"screen and (max-width: 575px)",sm:"screen and (min-width: 576px)",md:"screen and (min-width: 768px)",lg:"screen and (min-width: 992px)",xl:"screen and (min-width: 1200px)",xxl:"screen and (min-width: 1600px)"},f=new Map;let j=-1;const y={},R={};function z(){f.forEach(e=>{e(a({},y))})}function U(){Object.keys(C).forEach(e=>{const c=window.matchMedia(C[e]);c.matches&&(y[e]=!0,z());const r=u=>{y[e]=u.matches,z()};c.addEventListener("change",r),R[e]={res:c,listener:r}})}function V(e){return f.size||U(),j+=1,f.set(j,e),e(a({},y)),j}function D(){Object.keys(C).forEach(e=>{const c=R[e];c.res.removeEventListener("change",c.listener)}),f.clear()}function G(e){f.delete(e),f.size===0&&D()}function h(e,c,r){let u=e;return c&&(u+=`__${c}`),r&&(u+=`--${r}`),u}function N(e,c=!1){const r=c?`.devui-${e}`:`devui-${e}`;return{b:()=>h(r),e:t=>t?h(r,t):"",m:t=>t?h(r,"",t):"",em:(t,o)=>t&&o?h(r,t,o):""}}var W="",v=n.defineComponent({name:"DRow",props:i,emits:[],setup(e,{slots:c}){const r=n.ref({}),u=N("row"),l=n.computed(()=>({[u.em("align",e.align)]:!0,[u.em("justify",e.justify)]:!0,[u.e("wrap")]:e.wrap}));let p;n.onMounted(()=>{p=V(t=>{r.value=t})}),n.onUnmounted(()=>{G(p)});const g=n.computed(()=>{if(!e.gutter)return{};let t=[0,0];Array.isArray(e.gutter)?t=e.gutter:typeof e.gutter=="number"?t=[e.gutter,0]:A.some(T=>{const $=e.gutter[T];return r.value[T]&&$?(typeof $=="number"?t=[$,0]:t=$,!0):!1});const o=`${(t[0]||0)/2}px`,M=`${(t[0]||0)/2}px`,S=`${(t[1]||0)/2}px`,H=`${(t[1]||0)/2}px`;return{paddingLeft:o,paddingRight:M,paddingTop:S,paddingBottom:H}});return n.provide("gutterStyle",g),()=>{var t;return n.createVNode("div",{class:[u.b(),l.value]},[(t=c.default)==null?void 0:t.call(c)])}}});const m=N("col");function K(e){return n.computed(()=>({[m.em("span",e.span?String(e.span):"")]:!0,[m.em("offset",e.offset?String(e.offset):"")]:!0,[m.em("pull",e.pull?String(e.pull):"")]:!0,[m.em("push",e.push?String(e.push):"")]:!0}))}function P(e){return` ${e.trim()}${e&&" "}`}function q(e){const c=Object.keys(e).filter(r=>r in x);return n.computed(()=>c.reduce((r,u)=>{const l=typeof e[u];if(l==="number")r=`${P(r)}${m.em(u,`span-${e[u]}`)}`;else if(l==="object"){const g=Object.keys(e[u]).filter(t=>t in w).reduce((t,o)=>{const S=e[u][o];return typeof S!="number"?"":(t=`${P(t)}${m.em(u,`${o}-${S}`)}`,t)},"");r=`${P(r)}${g}`}return r},""))}var X="",E=n.defineComponent({name:"DCol",props:O,setup(e,{slots:c}){const r=N("col"),u=o=>typeof o=="number"?`${o} ${o} auto`:/^\d+(\.\d+)?(px|rem|em|%)$/.test(o)?`0 0 ${o}`:o,l=K(e),p=q(e),g=n.computed(()=>({flex:u(e.flex),order:e.order})),t=n.inject("gutterStyle");return()=>{var o;return n.createVNode("div",{class:[r.b(),l.value,p.value],style:a(a({},g.value),t==null?void 0:t.value)},[(o=c.default)==null?void 0:o.call(c)])}}}),F={title:"Grid \u6805\u683C",category:"\u5E03\u5C40",status:"100%",install(e){e.component(v.name,v),e.component(E.name,E)}};s.Col=E,s.Row=v,s.colProps=O,s.colPropsBaseClass=w,s.colPropsBaseStyle=B,s.default=F,s.rowProps=i,s.screenSizes=x,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/icon/index.es.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, toRefs, createVNode } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps } from "vue";
|
|
2
|
+
const DEFAULT_PREFIX = "icon";
|
|
2
3
|
const iconProps = {
|
|
3
4
|
name: {
|
|
4
5
|
type: String,
|
|
@@ -6,43 +7,203 @@ const iconProps = {
|
|
|
6
7
|
required: true
|
|
7
8
|
},
|
|
8
9
|
size: {
|
|
9
|
-
type: String,
|
|
10
|
+
type: [Number, String],
|
|
10
11
|
default: "inherit"
|
|
11
12
|
},
|
|
12
13
|
color: {
|
|
13
14
|
type: String,
|
|
14
15
|
default: "inherit"
|
|
15
16
|
},
|
|
17
|
+
component: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: null
|
|
20
|
+
},
|
|
16
21
|
classPrefix: {
|
|
17
22
|
type: String,
|
|
18
|
-
default:
|
|
23
|
+
default: DEFAULT_PREFIX
|
|
24
|
+
},
|
|
25
|
+
operable: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
rotate: {
|
|
34
|
+
type: [Number, String]
|
|
19
35
|
}
|
|
20
36
|
};
|
|
21
|
-
|
|
22
|
-
name:
|
|
23
|
-
|
|
37
|
+
const svgIconProps = {
|
|
38
|
+
name: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "",
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
color: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "inherit"
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
type: [Number, String],
|
|
49
|
+
default: "inherit"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function createBem(namespace, element, modifier) {
|
|
53
|
+
let cls = namespace;
|
|
54
|
+
if (element) {
|
|
55
|
+
cls += `__${element}`;
|
|
56
|
+
}
|
|
57
|
+
if (modifier) {
|
|
58
|
+
cls += `--${modifier}`;
|
|
59
|
+
}
|
|
60
|
+
return cls;
|
|
61
|
+
}
|
|
62
|
+
function useNamespace(block, needDot = false) {
|
|
63
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
64
|
+
const b = () => createBem(namespace);
|
|
65
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
66
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
67
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
68
|
+
return {
|
|
69
|
+
b,
|
|
70
|
+
e,
|
|
71
|
+
m,
|
|
72
|
+
em
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var icon = "";
|
|
76
|
+
var svgIcon = defineComponent({
|
|
77
|
+
name: "DSvgIcon",
|
|
78
|
+
props: svgIconProps,
|
|
24
79
|
setup(props) {
|
|
25
80
|
const {
|
|
26
81
|
name,
|
|
27
|
-
size,
|
|
28
82
|
color,
|
|
29
|
-
|
|
83
|
+
size
|
|
30
84
|
} = toRefs(props);
|
|
85
|
+
const ns = useNamespace("svg-icon");
|
|
86
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
87
|
+
const iconSize = computed(() => {
|
|
88
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
89
|
+
});
|
|
90
|
+
const styles = {
|
|
91
|
+
width: iconSize.value,
|
|
92
|
+
height: iconSize.value
|
|
93
|
+
};
|
|
94
|
+
return () => {
|
|
95
|
+
return createVNode("svg", {
|
|
96
|
+
"class": ns.b(),
|
|
97
|
+
"style": styles
|
|
98
|
+
}, [createVNode("use", {
|
|
99
|
+
"xlink:href": iconName.value,
|
|
100
|
+
"fill": color.value
|
|
101
|
+
}, null)]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function isUrl(value) {
|
|
106
|
+
return /^((http|https):)?\/\//.test(value);
|
|
107
|
+
}
|
|
108
|
+
function useIconDom(props, ctx) {
|
|
109
|
+
const {
|
|
110
|
+
component,
|
|
111
|
+
name,
|
|
112
|
+
size,
|
|
113
|
+
color,
|
|
114
|
+
classPrefix,
|
|
115
|
+
rotate
|
|
116
|
+
} = toRefs(props);
|
|
117
|
+
const ns = useNamespace("icon");
|
|
118
|
+
const iconSize = computed(() => {
|
|
119
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
120
|
+
});
|
|
121
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
122
|
+
const imgIconDom = () => {
|
|
123
|
+
return createVNode("img", mergeProps({
|
|
124
|
+
"src": name.value,
|
|
125
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
126
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
127
|
+
"style": {
|
|
128
|
+
width: iconSize.value || "",
|
|
129
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
130
|
+
verticalAlign: "middle"
|
|
131
|
+
}
|
|
132
|
+
}, ctx.attrs), null);
|
|
133
|
+
};
|
|
134
|
+
const svgIconDom = () => {
|
|
135
|
+
return createVNode(IconComponent, mergeProps({
|
|
136
|
+
"name": name.value,
|
|
137
|
+
"color": color.value,
|
|
138
|
+
"size": iconSize.value,
|
|
139
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
140
|
+
"style": {
|
|
141
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
142
|
+
}
|
|
143
|
+
}, ctx.attrs), null);
|
|
144
|
+
};
|
|
145
|
+
const fontIconDom = () => {
|
|
146
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
147
|
+
return createVNode("i", mergeProps({
|
|
148
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
149
|
+
"style": {
|
|
150
|
+
fontSize: iconSize.value,
|
|
151
|
+
color: color.value,
|
|
152
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
153
|
+
}
|
|
154
|
+
}, ctx.attrs), null);
|
|
155
|
+
};
|
|
156
|
+
const iconDom = () => {
|
|
157
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
158
|
+
};
|
|
159
|
+
return {
|
|
160
|
+
iconDom
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
var Icon = defineComponent({
|
|
164
|
+
name: "DIcon",
|
|
165
|
+
props: iconProps,
|
|
166
|
+
emits: ["click"],
|
|
167
|
+
setup(props, ctx) {
|
|
168
|
+
const {
|
|
169
|
+
disabled,
|
|
170
|
+
operable
|
|
171
|
+
} = toRefs(props);
|
|
172
|
+
const {
|
|
173
|
+
iconDom
|
|
174
|
+
} = useIconDom(props, ctx);
|
|
175
|
+
const ns = useNamespace("icon");
|
|
176
|
+
const wrapClassed = computed(() => ({
|
|
177
|
+
[ns.e("container")]: true,
|
|
178
|
+
[ns.m("disabled")]: disabled.value,
|
|
179
|
+
[ns.m("operable")]: operable.value,
|
|
180
|
+
[ns.m("no-slots")]: !Object.keys(ctx.slots).length
|
|
181
|
+
}));
|
|
182
|
+
const onClick = (e) => {
|
|
183
|
+
if (disabled.value) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
ctx.emit("click", e);
|
|
187
|
+
};
|
|
188
|
+
return () => {
|
|
189
|
+
var _a, _b, _c, _d;
|
|
190
|
+
return createVNode("div", {
|
|
191
|
+
"class": wrapClassed.value,
|
|
192
|
+
"onClick": onClick
|
|
193
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
var iconGroup = "";
|
|
198
|
+
var IconGroup = defineComponent({
|
|
199
|
+
name: "DIconGroup",
|
|
200
|
+
setup(_, ctx) {
|
|
201
|
+
const ns = useNamespace("icon-group");
|
|
31
202
|
return () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
width: size.value,
|
|
37
|
-
verticalAlign: "text-bottom"
|
|
38
|
-
}
|
|
39
|
-
}, null) : createVNode("i", {
|
|
40
|
-
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
41
|
-
"style": {
|
|
42
|
-
fontSize: size.value,
|
|
43
|
-
color: color.value
|
|
44
|
-
}
|
|
45
|
-
}, null);
|
|
203
|
+
var _a, _b;
|
|
204
|
+
return createVNode("div", {
|
|
205
|
+
"class": ns.b()
|
|
206
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
46
207
|
};
|
|
47
208
|
}
|
|
48
209
|
});
|
|
@@ -52,6 +213,7 @@ var index = {
|
|
|
52
213
|
status: "100%",
|
|
53
214
|
install(app) {
|
|
54
215
|
app.component(Icon.name, Icon);
|
|
216
|
+
app.component(IconGroup.name, IconGroup);
|
|
55
217
|
}
|
|
56
218
|
};
|
|
57
|
-
export { Icon, index as default, iconProps };
|
|
219
|
+
export { Icon, IconGroup, index as default, iconProps, svgIconProps };
|
package/icon/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(i=typeof globalThis!="undefined"?globalThis:i||self,n(i.index={},i.Vue))})(this,function(i,n){"use strict";const I={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},b={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function p(l,o,s){let t=l;return o&&(t+=`__${o}`),s&&(t+=`--${s}`),t}function d(l,o=!1){const s=o?`.devui-${l}`:`devui-${l}`;return{b:()=>p(s),e:e=>e?p(s,e):"",m:e=>e?p(s,"",e):"",em:(e,a)=>e&&a?p(s,e,a):""}}var V="",h=n.defineComponent({name:"DSvgIcon",props:b,setup(l){const{name:o,color:s,size:t}=n.toRefs(l),c=d("svg-icon"),r=n.computed(()=>`#icon-${o.value}`),u=n.computed(()=>typeof t.value=="number"?`${t.value}px`:t.value),e={width:u.value,height:u.value};return()=>n.createVNode("svg",{class:c.b(),style:e},[n.createVNode("use",{"xlink:href":r.value,fill:s.value},null)])}});function D(l){return/^((http|https):)?\/\//.test(l)}function S(l,o){const{component:s,name:t,size:c,color:r,classPrefix:u,rotate:e}=n.toRefs(l),a=d("icon"),m=n.computed(()=>typeof c.value=="number"?`${c.value}px`:c.value),f=s.value?n.resolveDynamicComponent(s.value):n.resolveDynamicComponent(h),v=()=>n.createVNode("img",n.mergeProps({src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],class:[(e==null?void 0:e.value)==="infinite"&&a.m("spin")],style:{width:m.value||"",transform:`rotate(${e==null?void 0:e.value}deg)`,verticalAlign:"middle"}},o.attrs),null),P=()=>n.createVNode(f,n.mergeProps({name:t.value,color:r.value,size:m.value,class:[(e==null?void 0:e.value)==="infinite"&&a.m("spin")],style:{transform:`rotate(${e==null?void 0:e.value}deg)`}},o.attrs),null),$=()=>{const C=/^icon-/.test(t.value)?t.value:`${u.value}-${t.value}`;return n.createVNode("i",n.mergeProps({class:[u.value,C,(e==null?void 0:e.value)==="infinite"&&a.m("spin")],style:{fontSize:m.value,color:r.value,transform:`rotate(${e==null?void 0:e.value}deg)`}},o.attrs),null)};return{iconDom:()=>s.value?P():D(t.value)?v():$()}}var g=n.defineComponent({name:"DIcon",props:I,emits:["click"],setup(l,o){const{disabled:s,operable:t}=n.toRefs(l),{iconDom:c}=S(l,o),r=d("icon"),u=n.computed(()=>({[r.e("container")]:!0,[r.m("disabled")]:s.value,[r.m("operable")]:t.value,[r.m("no-slots")]:!Object.keys(o.slots).length})),e=a=>{s.value||o.emit("click",a)};return()=>{var a,m,f,v;return n.createVNode("div",{class:u.value,onClick:e},[(m=(a=o.slots).prefix)==null?void 0:m.call(a),c(),(v=(f=o.slots).suffix)==null?void 0:v.call(f)])}}}),_="",y=n.defineComponent({name:"DIconGroup",setup(l,o){const s=d("icon-group");return()=>{var t,c;return n.createVNode("div",{class:s.b()},[(c=(t=o.slots).default)==null?void 0:c.call(t)])}}}),N={title:"Icon \u56FE\u6807",category:"\u901A\u7528",status:"100%",install(l){l.component(g.name,g),l.component(y.name,y)}};i.Icon=g,i.IconGroup=y,i.default=N,i.iconProps=I,i.svgIconProps=b,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
package/icon/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.devui-icon__container{display:inline-block;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--no-slots i,.devui-icon--no-slots img{display:block}.devui-icon--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #adb0b8)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 2px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}
|
|
@@ -151,8 +151,8 @@ function createBem(namespace, element, modifier) {
|
|
|
151
151
|
}
|
|
152
152
|
return cls;
|
|
153
153
|
}
|
|
154
|
-
function useNamespace(block) {
|
|
155
|
-
const namespace = `devui-${block}`;
|
|
154
|
+
function useNamespace(block, needDot = false) {
|
|
155
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
156
156
|
const b = () => createBem(namespace);
|
|
157
157
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
158
158
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var X=Object.defineProperty;var R=(s,e,d)=>e in s?X(s,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[e]=d;var r=(s,e,d)=>(R(s,typeof e!="symbol"?e+"":e,d),d);(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 d={url:{type:String,default:"",required:!0},previewUrlList:{type:Array,default:()=>[],required:!0},zIndex:{type:Number,required:!1},backDropZIndex:{type:Number,required:!1}};class V{constructor(t,n={}){r(this,"el");r(this,"oTransformX",0);r(this,"oTransformY",0);r(this,"transformX");r(this,"transformY");r(this,"zoom");r(this,"rotate");r(this,"STEP",.25);r(this,"MIN_SCALE",.2);r(this,"MAX_SCALE",2.5);r(this,"TRANSFORMX",0);r(this,"TRANSFORMY",0);r(this,"ZOOM",1);r(this,"ROTATE",0);this.el=t,this.transformX=n.transformX||this.TRANSFORMX,this.transformY=n.transformY||this.TRANSFORMY,this.zoom=n.zoom||this.ZOOM,this.rotate=n.rotate||this.ROTATE,this.handleDefaultDraggable(),this.onDraggable(),this.onMouseWheel()}handleDefaultDraggable(){document.body.ondragstart=()=>(window.event.returnValue=!1,!1)}onDraggable(){this.el.onmousedown=t=>{const n=t.clientX,i=t.clientY;document.onmousemove=l=>{const u=l.clientX-n,a=l.clientY-i;this.transformX=this.oTransformX+u,this.transformY=this.oTransformY+a,this.el.style.cursor="grabbing",this.setPosition()}},document.onmouseup=()=>{document.onmousemove=null,this.oTransformX=this.transformX,this.oTransformY=this.transformY,this.el.style.cursor="grab"}}onMouseWheel(){const t=this.throttle(this.setMouseWheel,100);this.el.onmousewheel=n=>{const i=-n.wheelDelta||n.deltaY||n.detail;t(i)}}throttle(t,n){let i=null;return(...l)=>{i||setTimeout(()=>{i=null,t.apply(this,l)},n)}}setMouseWheel(t){if(t<0){if(this.zoom>=this.MAX_SCALE){this.el.style.cursor="not-allowed";return}this.el.style.cursor="zoom-in",this.setZoomIn(this.STEP)}else{if(this.zoom<=this.MIN_SCALE){this.el.style.cursor="not-allowed";return}this.el.style.cursor="zoom-out",this.setZoomOut(this.STEP)}this.setPosition()}setZoomIn(t=this.STEP){this.zoom=Math.min(this.MAX_SCALE,this.zoom+t),this.setPosition()}setZoomOut(t=this.STEP){this.zoom=Math.max(this.MIN_SCALE,this.zoom-t),this.setPosition()}setZoomBest(){this.reset(),this.setPosition()}setZoomOriginal(){this.reset(),this.setPosition()}setRotate(){this.rotate+=.25,this.setPosition()}reset(){this.transformX=this.TRANSFORMX,this.transformY=this.TRANSFORMY,this.zoom=this.ZOOM}setPosition(){this.el.style.transform=`translate(${this.transformX}px, ${this.transformY}px) scale(${this.zoom}) rotate(${this.rotate}turn)`}}function f(o,t,n){let i=o;return t&&(i+=`__${t}`),n&&(i+=`--${n}`),i}function k(o){const t=`devui-${o}`;return{b:()=>f(t),e:a=>a?f(t,a):"",m:a=>a?f(t,"",a):"",em:(a,m)=>a&&m?f(t,a,m):""}}var Y="",I=e.defineComponent({name:"DImagePreview",props:d,emits:[],setup(o){const t=k("image-preview");let n=null;const i=e.ref(0),l=e.computed(()=>o.previewUrlList[i.value]),u=o.zIndex?{zIndex:o.zIndex}:{},a=o.backDropZIndex?{zIndex:o.backDropZIndex}:{};function m(){const h=document.querySelector(`.${t.e("main-image")}`);n=new V(h)}function P(){i.value=o.previewUrlList.findIndex(h=>h===o.url)}function g(){i.value=i.value<=0?o.previewUrlList.length-1:i.value-1}function w(){i.value=i.value>=o.previewUrlList.length-1?0:i.value+1}function b(){c.close()}function T(){n.setZoomIn()}function $(){n.setZoomOut()}function D(){n.setRotate()}function A(){n.setZoomBest()}function E(){n.setZoomOriginal()}function y(h){h.defaultPrevented||(h.code==="Escape"?b():h.code==="ArrowLeft"?g():h.code==="ArrowRight"&&w())}function S(){document.addEventListener("keydown",y,!1)}function O(){document.removeEventListener("keydown",y,!1)}return e.onMounted(()=>{P(),m(),S()}),e.onUnmounted(()=>{O()}),()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:t.b(),style:u},[e.createVNode("img",{class:t.e("main-image"),src:l.value},null),e.createVNode("button",{class:t.e("close-btn"),onClick:b},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"8 6.58578644 12.2426407 2.34314575 13.6568542 3.75735931 9.41421356 8 13.6568542 12.2426407 12.2426407 13.6568542 8 9.41421356 3.75735931 13.6568542 2.34314575 12.2426407 6.58578644 8 2.34314575 3.75735931 3.75735931 2.34314575"},null)])])]),e.createVNode("button",{class:t.e("arrow-left"),onClick:g},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"},null)])])]),e.createVNode("button",{class:t.e("arrow-right"),onClick:w},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",transform:"translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",points:"11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"},null)])])]),e.createVNode("div",{class:t.e("toolbar")},[e.createVNode("button",{onClick:T},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#293040","fill-rule":"nonzero"},[e.createVNode("path",{d:"M6,6 L6,4 L8,4 L8,6 L10,6 L10,8 L8,8 L8,10 L6,10 L6,8 L4,8 L4,6 L6,6 Z M12.6063847,11.1921711 L15.6568542,14.2426407 L14.2426407,15.6568542 L11.1921711,12.6063847 C10.0235906,13.4815965 8.5723351,14 7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,8.5723351 13.4815965,10.0235906 12.6063847,11.1921711 L12.6063847,11.1921711 Z M7,12 C9.76142375,12 12,9.76142375 12,7 C12,4.23857625 9.76142375,2 7,2 C4.23857625,2 2,4.23857625 2,7 C2,9.76142375 4.23857625,12 7,12 Z"},null)])])])]),e.createVNode("button",{onClick:$},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#293040","fill-rule":"nonzero"},[e.createVNode("path",{d:"M12.6063847,11.1921711 L15.6568542,14.2426407 L14.2426407,15.6568542 L11.1921711,12.6063847 C10.0235906,13.4815965 8.5723351,14 7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,8.5723351 13.4815965,10.0235906 12.6063847,11.1921711 L12.6063847,11.1921711 Z M7,12 C9.76142375,12 12,9.76142375 12,7 C12,4.23857625 9.76142375,2 7,2 C4.23857625,2 2,4.23857625 2,7 C2,9.76142375 4.23857625,12 7,12 Z M4,6 L10,6 L10,8 L4,8 L4,6 Z"},null)])])])]),e.createVNode("button",{onClick:D},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M7.5,3.02242151 L7.5,4 L4.5,2 L7.5,0 L7.5,1.01640228 C7.66526181,1.00552468 7.83198572,1 8,1 C12.1421356,1 15.5,4.35786438 15.5,8.5 C15.5,12.6421356 12.1421356,16 8,16 C3.85786438,16 0.5,12.6421356 0.5,8.5 C0.5,6.9828355 0.950484514,5.5708873 1.72499011,4.39061882 L3.42173231,5.4510827 C2.83944149,6.32371289 2.5,7.37221604 2.5,8.5 C2.5,11.5375661 4.96243388,14 8,14 C11.0375661,14 13.5,11.5375661 13.5,8.5 C13.5,5.46243388 11.0375661,3 8,3 C7.83145515,3 7.66468102,3.00758131 7.5,3.02242151 Z M8,11 C6.61928813,11 5.5,9.88071187 5.5,8.5 C5.5,7.11928813 6.61928813,6 8,6 C9.38071187,6 10.5,7.11928813 10.5,8.5 C10.5,9.88071187 9.38071187,11 8,11 Z M8,10 C8.82842712,10 9.5,9.32842712 9.5,8.5 C9.5,7.67157288 8.82842712,7 8,7 C7.17157288,7 6.5,7.67157288 6.5,8.5 C6.5,9.32842712 7.17157288,10 8,10 Z",fill:"#293040"},null)])])]),e.createVNode("button",{onClick:g},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"},null)])])]),e.createVNode("span",{class:t.e("index")},[i.value+1,e.createTextVNode(":"),o.previewUrlList.length]),e.createVNode("button",{onClick:w},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",transform:"translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",points:"11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"},null)])])]),e.createVNode("button",{onClick:A},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M16,16 L11.429,16 L11.429,15 L14.456,15 L11.006,11.226 L11.652,10.519 L15.086,14.275 L15.086,11 L16,11 L16,16 Z M15.164,1.544 L12.009,4.994 L11.418,4.348 L14.558,0.914 L11.82,0.914 L11.82,0 L16,0 L16,4.571 L15.164,4.571 L15.164,1.544 Z M5,15 L5,16 L0,16 L0,11 L1,11 L1,14.275 L4.756,10.519 L5.463,11.226 L1.689,15 L5,15 Z M4.365,4.994 L0.914,1.544 L0.914,4.571 L3.41060513e-13,4.571 L3.41060513e-13,0 L4.571,0 L4.571,0.914 L1.578,0.914 L5.011,4.348 L4.365,4.994 Z",fill:"#293040","fill-rule":"nonzero"},null)])])]),e.createVNode("button",{onClick:E},[e.createVNode("span",null,[e.createTextVNode("1:1")])])])]),e.createVNode("div",{class:t.e("bg"),style:a},null)])}});function Z(o){return e.createApp(I,o)}class c{static open(t){this.$body=document.body,this.$div=document.createElement("div"),this.$overflow=this.$body.style.overflow,this.$body.appendChild(this.$div),Z(t).mount(this.$div),this.$body.style.setProperty("overflow","hidden","important")}static close(){var t;(t=this.$body)==null||t.style.setProperty("overflow",this.$overflow),this.$overflow=null,this.$div&&this.$body.removeChild(this.$div),this.$body=null,this.$div=null}}r(c,"$body",null),r(c,"$div",null),r(c,"$overflow","");function p(o){c.open({url:o.url,previewUrlList:o.previewUrlList,zIndex:o.zIndex,backDropZIndex:o.backDropZIndex})}function x(){c.close()}function N(o){return[...o.querySelectorAll("img")].map(n=>n.getAttribute("src"))}function C(o){var i;o.stopPropagation();const t=o.currentTarget,n=o.target;if(((i=n==null?void 0:n.nodeName)==null?void 0:i.toLowerCase())==="img"){const l=N(t),u=n.getAttribute("src");p({url:u,previewUrlList:l,zIndex:t==null?void 0:t.zIndex,backDropZIndex:t==null?void 0:t.backDropZIndex})}}function L(o){o.addEventListener("click",C)}function M(o){o.removeEventListener("click",C)}var v={mounted(o,t){if(!t.value)return L(o);const{custom:n,disableDefault:i}=t.value;n instanceof Object&&(n.open=()=>{const l=N(o);p({url:l==null?void 0:l[0],previewUrlList:l,zIndex:o==null?void 0:o.zIndex,backDropZIndex:o==null?void 0:o.backDropZIndex})},n.close=()=>x()),!i&&L(o)},unmounted(){x()},updated(o,t){var n,i;if(o.zIndex=(n=t.value)==null?void 0:n.zIndex,o.backDropZIndex=(i=t.value)==null?void 0:i.backDropZIndex,t.value){const{value:{disableDefault:l},oldValue:{disableDefault:u}}=t;l!==u&&(l?M(o):L(o))}}},z={title:"ImagePreview \u56FE\u7247\u9884\u89C8",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.directive("d-image-preview",v),o.config.globalProperties.$imagePreviewService=c}};s.ImagePreviewDirective=v,s.ImagePreviewService=c,s.default=z,s.imagePreviewProps=d,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
|
1
|
+
var X=Object.defineProperty;var R=(s,e,d)=>e in s?X(s,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[e]=d;var r=(s,e,d)=>(R(s,typeof e!="symbol"?e+"":e,d),d);(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 d={url:{type:String,default:"",required:!0},previewUrlList:{type:Array,default:()=>[],required:!0},zIndex:{type:Number,required:!1},backDropZIndex:{type:Number,required:!1}};class k{constructor(o,n={}){r(this,"el");r(this,"oTransformX",0);r(this,"oTransformY",0);r(this,"transformX");r(this,"transformY");r(this,"zoom");r(this,"rotate");r(this,"STEP",.25);r(this,"MIN_SCALE",.2);r(this,"MAX_SCALE",2.5);r(this,"TRANSFORMX",0);r(this,"TRANSFORMY",0);r(this,"ZOOM",1);r(this,"ROTATE",0);this.el=o,this.transformX=n.transformX||this.TRANSFORMX,this.transformY=n.transformY||this.TRANSFORMY,this.zoom=n.zoom||this.ZOOM,this.rotate=n.rotate||this.ROTATE,this.handleDefaultDraggable(),this.onDraggable(),this.onMouseWheel()}handleDefaultDraggable(){document.body.ondragstart=()=>(window.event.returnValue=!1,!1)}onDraggable(){this.el.onmousedown=o=>{const n=o.clientX,i=o.clientY;document.onmousemove=l=>{const u=l.clientX-n,m=l.clientY-i;this.transformX=this.oTransformX+u,this.transformY=this.oTransformY+m,this.el.style.cursor="grabbing",this.setPosition()}},document.onmouseup=()=>{document.onmousemove=null,this.oTransformX=this.transformX,this.oTransformY=this.transformY,this.el.style.cursor="grab"}}onMouseWheel(){const o=this.throttle(this.setMouseWheel,100);this.el.onmousewheel=n=>{const i=-n.wheelDelta||n.deltaY||n.detail;o(i)}}throttle(o,n){let i=null;return(...l)=>{i||setTimeout(()=>{i=null,o.apply(this,l)},n)}}setMouseWheel(o){if(o<0){if(this.zoom>=this.MAX_SCALE){this.el.style.cursor="not-allowed";return}this.el.style.cursor="zoom-in",this.setZoomIn(this.STEP)}else{if(this.zoom<=this.MIN_SCALE){this.el.style.cursor="not-allowed";return}this.el.style.cursor="zoom-out",this.setZoomOut(this.STEP)}this.setPosition()}setZoomIn(o=this.STEP){this.zoom=Math.min(this.MAX_SCALE,this.zoom+o),this.setPosition()}setZoomOut(o=this.STEP){this.zoom=Math.max(this.MIN_SCALE,this.zoom-o),this.setPosition()}setZoomBest(){this.reset(),this.setPosition()}setZoomOriginal(){this.reset(),this.setPosition()}setRotate(){this.rotate+=.25,this.setPosition()}reset(){this.transformX=this.TRANSFORMX,this.transformY=this.TRANSFORMY,this.zoom=this.ZOOM}setPosition(){this.el.style.transform=`translate(${this.transformX}px, ${this.transformY}px) scale(${this.zoom}) rotate(${this.rotate}turn)`}}function f(t,o,n){let i=t;return o&&(i+=`__${o}`),n&&(i+=`--${n}`),i}function I(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>f(n),e:a=>a?f(n,a):"",m:a=>a?f(n,"",a):"",em:(a,L)=>a&&L?f(n,a,L):""}}var Y="",Z=e.defineComponent({name:"DImagePreview",props:d,emits:[],setup(t){const o=I("image-preview");let n=null;const i=e.ref(0),l=e.computed(()=>t.previewUrlList[i.value]),u=t.zIndex?{zIndex:t.zIndex}:{},m=t.backDropZIndex?{zIndex:t.backDropZIndex}:{};function a(){const h=document.querySelector(`.${o.e("main-image")}`);n=new k(h)}function L(){i.value=t.previewUrlList.findIndex(h=>h===t.url)}function w(){i.value=i.value<=0?t.previewUrlList.length-1:i.value-1}function p(){i.value=i.value>=t.previewUrlList.length-1?0:i.value+1}function y(){c.close()}function T(){n.setZoomIn()}function $(){n.setZoomOut()}function D(){n.setRotate()}function A(){n.setZoomBest()}function E(){n.setZoomOriginal()}function V(h){h.defaultPrevented||(h.code==="Escape"?y():h.code==="ArrowLeft"?w():h.code==="ArrowRight"&&p())}function S(){document.addEventListener("keydown",V,!1)}function O(){document.removeEventListener("keydown",V,!1)}return e.onMounted(()=>{L(),a(),S()}),e.onUnmounted(()=>{O()}),()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:o.b(),style:u},[e.createVNode("img",{class:o.e("main-image"),src:l.value},null),e.createVNode("button",{class:o.e("close-btn"),onClick:y},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"8 6.58578644 12.2426407 2.34314575 13.6568542 3.75735931 9.41421356 8 13.6568542 12.2426407 12.2426407 13.6568542 8 9.41421356 3.75735931 13.6568542 2.34314575 12.2426407 6.58578644 8 2.34314575 3.75735931 3.75735931 2.34314575"},null)])])]),e.createVNode("button",{class:o.e("arrow-left"),onClick:w},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"},null)])])]),e.createVNode("button",{class:o.e("arrow-right"),onClick:p},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",transform:"translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",points:"11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"},null)])])]),e.createVNode("div",{class:o.e("toolbar")},[e.createVNode("button",{onClick:T},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#293040","fill-rule":"nonzero"},[e.createVNode("path",{d:"M6,6 L6,4 L8,4 L8,6 L10,6 L10,8 L8,8 L8,10 L6,10 L6,8 L4,8 L4,6 L6,6 Z M12.6063847,11.1921711 L15.6568542,14.2426407 L14.2426407,15.6568542 L11.1921711,12.6063847 C10.0235906,13.4815965 8.5723351,14 7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,8.5723351 13.4815965,10.0235906 12.6063847,11.1921711 L12.6063847,11.1921711 Z M7,12 C9.76142375,12 12,9.76142375 12,7 C12,4.23857625 9.76142375,2 7,2 C4.23857625,2 2,4.23857625 2,7 C2,9.76142375 4.23857625,12 7,12 Z"},null)])])])]),e.createVNode("button",{onClick:$},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#293040","fill-rule":"nonzero"},[e.createVNode("path",{d:"M12.6063847,11.1921711 L15.6568542,14.2426407 L14.2426407,15.6568542 L11.1921711,12.6063847 C10.0235906,13.4815965 8.5723351,14 7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,8.5723351 13.4815965,10.0235906 12.6063847,11.1921711 L12.6063847,11.1921711 Z M7,12 C9.76142375,12 12,9.76142375 12,7 C12,4.23857625 9.76142375,2 7,2 C4.23857625,2 2,4.23857625 2,7 C2,9.76142375 4.23857625,12 7,12 Z M4,6 L10,6 L10,8 L4,8 L4,6 Z"},null)])])])]),e.createVNode("button",{onClick:D},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M7.5,3.02242151 L7.5,4 L4.5,2 L7.5,0 L7.5,1.01640228 C7.66526181,1.00552468 7.83198572,1 8,1 C12.1421356,1 15.5,4.35786438 15.5,8.5 C15.5,12.6421356 12.1421356,16 8,16 C3.85786438,16 0.5,12.6421356 0.5,8.5 C0.5,6.9828355 0.950484514,5.5708873 1.72499011,4.39061882 L3.42173231,5.4510827 C2.83944149,6.32371289 2.5,7.37221604 2.5,8.5 C2.5,11.5375661 4.96243388,14 8,14 C11.0375661,14 13.5,11.5375661 13.5,8.5 C13.5,5.46243388 11.0375661,3 8,3 C7.83145515,3 7.66468102,3.00758131 7.5,3.02242151 Z M8,11 C6.61928813,11 5.5,9.88071187 5.5,8.5 C5.5,7.11928813 6.61928813,6 8,6 C9.38071187,6 10.5,7.11928813 10.5,8.5 C10.5,9.88071187 9.38071187,11 8,11 Z M8,10 C8.82842712,10 9.5,9.32842712 9.5,8.5 C9.5,7.67157288 8.82842712,7 8,7 C7.17157288,7 6.5,7.67157288 6.5,8.5 C6.5,9.32842712 7.17157288,10 8,10 Z",fill:"#293040"},null)])])]),e.createVNode("button",{onClick:w},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"},null)])])]),e.createVNode("span",{class:o.e("index")},[i.value+1,e.createTextVNode(":"),t.previewUrlList.length]),e.createVNode("button",{onClick:p},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",transform:"translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",points:"11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"},null)])])]),e.createVNode("button",{onClick:A},[e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M16,16 L11.429,16 L11.429,15 L14.456,15 L11.006,11.226 L11.652,10.519 L15.086,14.275 L15.086,11 L16,11 L16,16 Z M15.164,1.544 L12.009,4.994 L11.418,4.348 L14.558,0.914 L11.82,0.914 L11.82,0 L16,0 L16,4.571 L15.164,4.571 L15.164,1.544 Z M5,15 L5,16 L0,16 L0,11 L1,11 L1,14.275 L4.756,10.519 L5.463,11.226 L1.689,15 L5,15 Z M4.365,4.994 L0.914,1.544 L0.914,4.571 L3.41060513e-13,4.571 L3.41060513e-13,0 L4.571,0 L4.571,0.914 L1.578,0.914 L5.011,4.348 L4.365,4.994 Z",fill:"#293040","fill-rule":"nonzero"},null)])])]),e.createVNode("button",{onClick:E},[e.createVNode("span",null,[e.createTextVNode("1:1")])])])]),e.createVNode("div",{class:o.e("bg"),style:m},null)])}});function M(t){return e.createApp(Z,t)}class c{static open(o){this.$body=document.body,this.$div=document.createElement("div"),this.$overflow=this.$body.style.overflow,this.$body.appendChild(this.$div),M(o).mount(this.$div),this.$body.style.setProperty("overflow","hidden","important")}static close(){var o;(o=this.$body)==null||o.style.setProperty("overflow",this.$overflow),this.$overflow=null,this.$div&&this.$body.removeChild(this.$div),this.$body=null,this.$div=null}}r(c,"$body",null),r(c,"$div",null),r(c,"$overflow","");function x(t){c.open({url:t.url,previewUrlList:t.previewUrlList,zIndex:t.zIndex,backDropZIndex:t.backDropZIndex})}function N(){c.close()}function C(t){return[...t.querySelectorAll("img")].map(n=>n.getAttribute("src"))}function v(t){var i;t.stopPropagation();const o=t.currentTarget,n=t.target;if(((i=n==null?void 0:n.nodeName)==null?void 0:i.toLowerCase())==="img"){const l=C(o),u=n.getAttribute("src");x({url:u,previewUrlList:l,zIndex:o==null?void 0:o.zIndex,backDropZIndex:o==null?void 0:o.backDropZIndex})}}function g(t){t.addEventListener("click",v)}function z(t){t.removeEventListener("click",v)}var b={mounted(t,o){if(!o.value)return g(t);const{custom:n,disableDefault:i}=o.value;n instanceof Object&&(n.open=()=>{const l=C(t);x({url:l==null?void 0:l[0],previewUrlList:l,zIndex:t==null?void 0:t.zIndex,backDropZIndex:t==null?void 0:t.backDropZIndex})},n.close=()=>N()),!i&&g(t)},unmounted(){N()},updated(t,o){var n,i;if(t.zIndex=(n=o.value)==null?void 0:n.zIndex,t.backDropZIndex=(i=o.value)==null?void 0:i.backDropZIndex,o.value){const{value:{disableDefault:l},oldValue:{disableDefault:u}}=o;l!==u&&(l?z(t):g(t))}}},P={title:"ImagePreview \u56FE\u7247\u9884\u89C8",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.directive("d-image-preview",b),t.config.globalProperties.$imagePreviewService=c}};s.ImagePreviewDirective=b,s.ImagePreviewService=c,s.default=P,s.imagePreviewProps=d,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/image-preview/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-image-preview{position:fixed;left:0;top:0;right:0;bottom:0;z-index:
|
|
1
|
+
.devui-image-preview{position:fixed;left:0;top:0;right:0;bottom:0;z-index:var(--devui-z-index-full-page-overlay, 1080);display:flex;align-items:center;justify-content:center;overflow:hidden}.devui-image-preview svg,.devui-image-preview polygon,.devui-image-preview g,.devui-image-preview path{fill:var(--devui-icon-text, #71757f)}.devui-image-preview__main-image{width:auto;height:auto;max-width:90%;max-height:90%;margin-top:-20px;cursor:grab}.devui-image-preview__close-btn{position:fixed;z-index:var(--devui-z-index-full-page-overlay, 1080);cursor:pointer;width:36px;height:36px;border-radius:50%;border:none;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-light-shadow, rgba(37, 43, 58, .1));display:inline-flex;align-items:center;justify-content:center;top:15px;right:20px}.devui-image-preview__close-btn:hover{background:var(--devui-area, #f8f8f8)}.devui-image-preview__close-btn svg{width:38px;height:18px}.devui-image-preview__arrow-left{position:fixed;z-index:var(--devui-z-index-full-page-overlay, 1080);cursor:pointer;width:36px;height:36px;border-radius:50%;border:none;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-light-shadow, rgba(37, 43, 58, .1));display:inline-flex;align-items:center;justify-content:center;top:50%;left:20px;transform:translateY(-50%)}.devui-image-preview__arrow-left:hover{background:var(--devui-area, #f8f8f8)}.devui-image-preview__arrow-left svg{width:38px;height:18px}.devui-image-preview__arrow-right{position:fixed;z-index:var(--devui-z-index-full-page-overlay, 1080);cursor:pointer;width:36px;height:36px;border-radius:50%;border:none;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-light-shadow, rgba(37, 43, 58, .1));display:inline-flex;align-items:center;justify-content:center;top:50%;right:20px;transform:translateY(-50%)}.devui-image-preview__arrow-right:hover{background:var(--devui-area, #f8f8f8)}.devui-image-preview__arrow-right svg{width:38px;height:18px}.devui-image-preview__toolbar{position:fixed;bottom:0;left:0;width:100%;height:50px;display:flex;align-items:center;justify-content:center;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-light-shadow, rgba(37, 43, 58, .1))}.devui-image-preview__toolbar button{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;color:var(--devui-text, #252b3a);border:none;background-color:transparent;cursor:pointer;outline:0;padding:0}.devui-image-preview__toolbar .devui-image-preview__index{display:inline-flex;width:100px;justify-content:center;align-items:center;cursor:pointer}.devui-image-preview__toolbar>:not(:first-child){margin-left:20px}.devui-image-preview__bg{position:fixed;left:0;top:0;right:0;bottom:0;z-index:calc(var(--devui-z-index-full-page-overlay, 1080) - 1);background:var(--devui-shadow, rgba(37, 43, 58, .2))}
|