@web-utils/component 1.0.14 → 1.0.18
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 +25 -0
- package/dist/ElementDialog.js +1 -1
- package/dist/{SplitPane.css → Trigger.css} +0 -0
- package/dist/index.es.js +7855 -7
- package/package.json +5 -5
- package/web-types.json +5420 -5420
- package/dist/index.umd.js +0 -7
package/README.md
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
1
|
# web-component
|
|
2
2
|
|
|
3
|
+
## usage
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import { defineConfig } from 'vite'
|
|
7
|
+
import styleImport from "vite-plugin-style-import";
|
|
8
|
+
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
styleImport({
|
|
12
|
+
libs: [{
|
|
13
|
+
libraryName: '@web-utils/component',
|
|
14
|
+
base: '@web-utils/component/dist/base.css',
|
|
15
|
+
ensureStyleFile: true,
|
|
16
|
+
libraryNameChangeCase: 'pascalCase',
|
|
17
|
+
resolveStyle: name => {
|
|
18
|
+
return `@web-utils/component/dist/${name}.css`
|
|
19
|
+
},
|
|
20
|
+
resolveComponent: name => {
|
|
21
|
+
return `@web-utils/component/dist/${name}.js`
|
|
22
|
+
}
|
|
23
|
+
}]
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
```
|
package/dist/ElementDialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import a from"element-ui/src/utils/popup";import s from"element-ui/src/mixins/emitter";import{dialogDrag as n}from"@web-utils/core/directives";import{n as r}from"./vueComponentNormalizer.js";var d=function(){var e=this,l=e.$createElement,t=e._self._c||l;return t("Transition",{attrs:{name:"dialog-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"},{name:"dialog-drag",rawName:"v-dialog-drag:[fullScreen]",arg:e.fullScreen}],staticClass:"el-dialog__wrapper",on:{click:function(o){return o.target!==o.currentTarget?null:e.handleWrapperClick.apply(null,arguments)}}},[t("div",{ref:"dialog",class:["el-dialog","element-dialog","el-dialog-resizeable","normalize",{"is-fullscreen":e.fullScreen,"el-dialog__body-padding":e.bodyPadding,"el-dialog--center":e.center,"el-dialog--flex-row":e.flexRow,"el-dialog--flex-column":e.flexColumn},e.customClass],style:e.style,attrs:{role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"}},[t("div",{staticClass:"el-dialog__header"},[e._t("title",function(){return[t("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]}),t("div",{staticClass:"header-button-wrapper"},[e._t("header-button"),e.showFullScreen?t("ElButton",{staticClass:"header-button",attrs:{type:"text",icon:e.fullScreen?"el-icon-copy-document":"el-icon-full-screen",size:"medium",title:e.fullScreen?"\u8FD8\u539F":"\u6700\u5927\u5316"},on:{click:e.toggleFullScreen}}):e._e(),e.showClose?t("ElButton",{staticClass:"header-button",attrs:{"aria-label":"Close",type:"text",title:"\u5173\u95ED",icon:"el-icon-close",size:"medium"},on:{click:e.handleClose}}):e._e()],2)],2),e.rendered?t("div",{staticClass:"el-dialog__body",style:{height:e.fullScreen?"100%":e.height}},[e.destroyOnClose?[e.visible?e._t("default"):e._e()]:e._t("default")],2):e._e(),e.shouldShowFooter()?t("div",{staticClass:"el-dialog__footer"},[e._t("footer",null,{handleClose:e.handleClose})],2):e._e()])])])},u=[];const c={props:{modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0}}},p={name:"ElementDialog",directives:{dialogDrag:n},mixins:[a,c,s],props:{title:{type:String,default:""},appendToBody:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},showFullScreen:Boolean,width:{type:String,default:void 0},height:{type:String,default:void 0},customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:{type:Function,default:void 0},center:{type:Boolean,default:!0},destroyOnClose:Boolean,flexRow:Boolean,flexColumn:Boolean,bodyPadding:{type:Boolean,default:!0}},data(){return{fullScreen:!1,closed:!1}},computed:{style(){const e={};return this.fullScreen||(e.marginTop=this.top,this.width&&(e.width=this.width)),e}},watch:{visible(e){e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick(()=>{this.$refs.dialog.scrollTop=0}),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"))}},mounted(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{toggleFullScreen(){this.fullScreen=!this.fullScreen},enterFullScreen(){this.fullScreen=!0},exitFullScreen(){this.fullScreen=!1},shouldShowFooter(){var e,l;return!!((l=(e=this.$scopedSlots).footer)!=null&&l.call(e))},handleWrapperClick(){!this.closeOnClickModal||this.handleClose()},handleClose(){typeof this.beforeClose=="function"?this.beforeClose(this.hide):this.hide()},hide(e){e!==!1&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter(){this.$emit("opened")},afterLeave(){this.exitFullScreen(),this.$emit("closed")}}},i={};var f=r(p,d,u,!1,h,null,null,null);function h(e){for(let l in i)this[l]=i[l]}var m=function(){return f.exports}();export{m as default};
|
|
1
|
+
import a from"element-ui/src/utils/popup";import s from"element-ui/src/mixins/emitter";import{dialogDrag as n}from"@web-utils/core/dist/directives/index";import{n as r}from"./vueComponentNormalizer.js";var d=function(){var e=this,l=e.$createElement,t=e._self._c||l;return t("Transition",{attrs:{name:"dialog-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"},{name:"dialog-drag",rawName:"v-dialog-drag:[fullScreen]",arg:e.fullScreen}],staticClass:"el-dialog__wrapper",on:{click:function(o){return o.target!==o.currentTarget?null:e.handleWrapperClick.apply(null,arguments)}}},[t("div",{ref:"dialog",class:["el-dialog","element-dialog","el-dialog-resizeable","normalize",{"is-fullscreen":e.fullScreen,"el-dialog__body-padding":e.bodyPadding,"el-dialog--center":e.center,"el-dialog--flex-row":e.flexRow,"el-dialog--flex-column":e.flexColumn},e.customClass],style:e.style,attrs:{role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"}},[t("div",{staticClass:"el-dialog__header"},[e._t("title",function(){return[t("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]}),t("div",{staticClass:"header-button-wrapper"},[e._t("header-button"),e.showFullScreen?t("ElButton",{staticClass:"header-button",attrs:{type:"text",icon:e.fullScreen?"el-icon-copy-document":"el-icon-full-screen",size:"medium",title:e.fullScreen?"\u8FD8\u539F":"\u6700\u5927\u5316"},on:{click:e.toggleFullScreen}}):e._e(),e.showClose?t("ElButton",{staticClass:"header-button",attrs:{"aria-label":"Close",type:"text",title:"\u5173\u95ED",icon:"el-icon-close",size:"medium"},on:{click:e.handleClose}}):e._e()],2)],2),e.rendered?t("div",{staticClass:"el-dialog__body",style:{height:e.fullScreen?"100%":e.height}},[e.destroyOnClose?[e.visible?e._t("default"):e._e()]:e._t("default")],2):e._e(),e.shouldShowFooter()?t("div",{staticClass:"el-dialog__footer"},[e._t("footer",null,{handleClose:e.handleClose})],2):e._e()])])])},u=[];const c={props:{modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0}}},p={name:"ElementDialog",directives:{dialogDrag:n},mixins:[a,c,s],props:{title:{type:String,default:""},appendToBody:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},showFullScreen:Boolean,width:{type:String,default:void 0},height:{type:String,default:void 0},customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:{type:Function,default:void 0},center:{type:Boolean,default:!0},destroyOnClose:Boolean,flexRow:Boolean,flexColumn:Boolean,bodyPadding:{type:Boolean,default:!0}},data(){return{fullScreen:!1,closed:!1}},computed:{style(){const e={};return this.fullScreen||(e.marginTop=this.top,this.width&&(e.width=this.width)),e}},watch:{visible(e){e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick(()=>{this.$refs.dialog.scrollTop=0}),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"))}},mounted(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{toggleFullScreen(){this.fullScreen=!this.fullScreen},enterFullScreen(){this.fullScreen=!0},exitFullScreen(){this.fullScreen=!1},shouldShowFooter(){var e,l;return!!((l=(e=this.$scopedSlots).footer)!=null&&l.call(e))},handleWrapperClick(){!this.closeOnClickModal||this.handleClose()},handleClose(){typeof this.beforeClose=="function"?this.beforeClose(this.hide):this.hide()},hide(e){e!==!1&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter(){this.$emit("opened")},afterLeave(){this.exitFullScreen(),this.$emit("closed")}}},i={};var f=r(p,d,u,!1,h,null,null,null);function h(e){for(let l in i)this[l]=i[l]}var m=function(){return f.exports}();export{m as default};
|
|
File without changes
|