@web-utils/component 1.0.15 → 1.0.19

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 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
+ ```
@@ -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};
package/dist/index.es.js CHANGED
@@ -40,7 +40,7 @@ import "codemirror/addon/fold/brace-fold";
40
40
  import "codemirror/addon/fold/comment-fold";
41
41
  import si from "element-ui/src/utils/popup";
42
42
  import ni from "element-ui/src/mixins/emitter";
43
- import { dialogDrag as ai } from "@web-utils/core/directives";
43
+ import { dialogDrag as ai } from "@web-utils/core/dist/directives/index";
44
44
  var li = function() {
45
45
  var e = this, t = e.$createElement, r = e._self._c || t;
46
46
  return r("ul", {
@@ -7848,7 +7848,7 @@ function jo(e) {
7848
7848
  var tt = /* @__PURE__ */ function() {
7849
7849
  return Do.exports;
7850
7850
  }();
7851
- const Ko = "1.0.15";
7851
+ const Ko = "1.0.18";
7852
7852
  function Wo(e) {
7853
7853
  e.component(ie.name, ie), e.component(U.name, U), e.component(se.name, se), e.component(ne.name, ne), e.component(ae.name, ae), e.component(le.name, le), e.component(oe.name, oe), e.component(ue.name, ue), e.component(ce.name, ce), e.component(de.name, de), e.component(he.name, he), e.component(pe.name, pe), e.component(me.name, me), e.component(_e.name, _e), e.component(ye.name, ye), e.component(ge.name, ge), e.component(ve.name, ve), e.component(be.name, be), e.component(xe.name, xe), e.component($e.name, $e), e.component(we.name, we), e.component(Se.name, Se), e.component(Ce.name, Ce), e.component(ke.name, ke), e.component(Be.name, Be), e.component(Te.name, Te), e.component(Fe.name, Fe), e.component(Pe.name, Pe), e.component(Ie.name, Ie), e.component(Ne.name, Ne), e.component(Ee.name, Ee), e.component(Re.name, Re), e.component(Me.name, Me), e.component(Oe.name, Oe), e.component(Le.name, Le), e.component(ze.name, ze), e.component(Ae.name, Ae), e.component(De.name, De), e.component(je.name, je), e.component(Ke.name, Ke), e.component(We.name, We), e.component(He.name, He), e.component(Xe.name, Xe), e.component(Ve.name, Ve), e.component(Ge.name, Ge), e.component(qe.name, qe), e.component(Ue.name, Ue), e.component(Je.name, Je), e.component(Ye.name, Ye), e.component(Qe.name, Qe), e.component(Ze.name, Ze), e.component(et.name, et), e.component(tt.name, tt);
7854
7854
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
- "version": "1.0.15",
3
+ "version": "1.0.19",
4
4
  "private": false,
5
5
  "license": "MIT",
6
- "main": "./dist/index.umd.js",
6
+ "main": "./dist/index.es.js",
7
7
  "module": "./dist/index.es.js",
8
8
  "exports": {
9
9
  ".": {
10
- "require": "./dist/index.umd.js",
10
+ "require": "./dist/index.es.js",
11
11
  "import": "./dist/index.es.js"
12
12
  },
13
13
  "./*": "./*"
@@ -33,9 +33,7 @@
33
33
  "@typescript-eslint/eslint-plugin": "^5.21.0",
34
34
  "@typescript-eslint/parser": "^5.21.0",
35
35
  "@vue/eslint-config-typescript": "^10.0.0",
36
- "@web-utils/core": "^1.4.6",
37
36
  "chalk": "^4.1.2",
38
- "element-ui": "^2.15.8",
39
37
  "eslint": "^8.14.0",
40
38
  "eslint-plugin-vue": "^8.7.1",
41
39
  "execa": "^5.0.0",
@@ -48,6 +46,7 @@
48
46
  "vite-plugin-style-import": "^1.4.1",
49
47
  "vite-plugin-vue2": "^2.0.0",
50
48
  "vue": "^2.6.14",
49
+ "vue-docgen-api": "^4.44.23",
51
50
  "vue-router": "^3.5.3",
52
51
  "vue-template-compiler": "^2.6.14"
53
52
  },
@@ -71,6 +70,14 @@
71
70
  "plugin:vue/recommended"
72
71
  ],
73
72
  "rules": {
73
+ "semi": [
74
+ "error",
75
+ "never"
76
+ ],
77
+ "quotes": [
78
+ "error",
79
+ "single"
80
+ ],
74
81
  "vue/no-deprecated-dollar-listeners-api": "off",
75
82
  "vue/multi-word-component-names": "off",
76
83
  "vue/no-v-html": "off",
@@ -107,8 +114,10 @@
107
114
  }
108
115
  },
109
116
  "dependencies": {
117
+ "@web-utils/core": "^1.4.8",
110
118
  "codemirror": "^5.65.3",
111
119
  "echarts": "^5.3.2",
120
+ "element-ui": "^2.15.8",
112
121
  "overlayscrollbars": "^1.13.1",
113
122
  "resize-detector": "^0.3.0"
114
123
  }