yc-design-vue 2.0.1 → 2.0.2

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.
@@ -7,7 +7,7 @@ import "../_shared/utils/locale.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import _sfc_main$1 from "../_shared/icons/IconSeparator.vue2.js";
10
+ import _sfc_main$1 from "../_shared/icons/IconSeparator.vue.js";
11
11
  const _hoisted_1 = { class: "yc-breadcrumb-item-separator" };
12
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  __name: "BreadcrumbSeparator",
@@ -121,8 +121,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
121
121
  async () => {
122
122
  if (dragDirection.value) return;
123
123
  await nextTick();
124
- boxRef.value.style.width = `${valueToPx(computedWidth.value)}`;
125
- boxRef.value.style.height = `${valueToPx(computedHeight.value)}`;
124
+ boxRef.value.style.width = computedWidth.value ? `${valueToPx(computedWidth.value)}` : "";
125
+ boxRef.value.style.height = computedHeight.value ? `${valueToPx(computedHeight.value)}` : "";
126
126
  },
127
127
  {
128
128
  immediate: true
@@ -1,4 +1,26 @@
1
- import _sfc_main from "./IconSeparator.vue2.js";
1
+ import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
+ import "../../node_modules/tinycolor2/esm/tinycolor.js";
3
+ import "../utils/dom.js";
4
+ import "../utils/time.js";
5
+ import "../utils/locale.js";
6
+ /* empty css */
7
+ /* empty css */
8
+ import _sfc_main$1 from "../components/Icon/index.vue3.js";
9
+ /* empty css */
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ __name: "IconSeparator",
12
+ setup(__props) {
13
+ return (_ctx, _cache) => {
14
+ return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
15
+ default: withCtx(() => _cache[0] || (_cache[0] = [
16
+ createElementVNode("path", { d: "M29.506 6.502 18.493 41.498" }, null, -1)
17
+ ])),
18
+ _: 1,
19
+ __: [0]
20
+ }, 16);
21
+ };
22
+ }
23
+ });
2
24
  export {
3
25
  _sfc_main as default
4
26
  };
@@ -1,26 +1,4 @@
1
- import { defineComponent, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
2
- import "../../node_modules/tinycolor2/esm/tinycolor.js";
3
- import "../utils/dom.js";
4
- import "../utils/time.js";
5
- import "../utils/locale.js";
6
- /* empty css */
7
- /* empty css */
8
- import _sfc_main$1 from "../components/Icon/index.vue3.js";
9
- /* empty css */
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- __name: "IconSeparator",
12
- setup(__props) {
13
- return (_ctx, _cache) => {
14
- return openBlock(), createBlock(unref(_sfc_main$1), normalizeProps(guardReactiveProps(_ctx.$attrs)), {
15
- default: withCtx(() => _cache[0] || (_cache[0] = [
16
- createElementVNode("path", { d: "M29.506 6.502 18.493 41.498" }, null, -1)
17
- ])),
18
- _: 1,
19
- __: [0]
20
- }, 16);
21
- };
22
- }
23
- });
1
+ import _sfc_main from "./IconSeparator.vue.js";
24
2
  export {
25
3
  _sfc_main as default
26
4
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const r=require("../_shared/utils/is.js");require("../_shared/utils/time.js"),require("../_shared/utils/locale.js"),/* empty css */,/* empty css */;/* empty css */const o=require("../_shared/icons/IconSeparator.vue2.js"),t={class:"yc-breadcrumb-item-separator"},a=e.defineComponent({__name:"BreadcrumbSeparator",props:{separatorSlots:{type:Function},separator:{},itemSeparatorSlots:{type:Function},itemSeparator:{}},setup(a){const s=a,n=e.computed(()=>r.isUndefined(s.itemSeparatorSlots)?s.separatorSlots||s.separator:s.itemSeparatorSlots||s.itemSeparator||s.separatorSlots||s.separator),i=()=>{var e,o,t;return r.isUndefined(s.itemSeparatorSlots)?(null==(e=s.separatorSlots)?void 0:e.call(s))||s.separator:(null==(o=s.itemSeparatorSlots)?void 0:o.call(s))||s.itemSeparator||(null==(t=s.separatorSlots)?void 0:t.call(s))||s.separator};return(r,a)=>(e.openBlock(),e.createElementBlock("span",t,[n.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{key:0})):(e.openBlock(),e.createBlock(e.unref(o),{key:1}))]))}});module.exports=a;
1
+ "use strict";const e=require("vue");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_shared/utils/dom.js");const r=require("../_shared/utils/is.js");require("../_shared/utils/time.js"),require("../_shared/utils/locale.js"),/* empty css */,/* empty css */;/* empty css */const o=require("../_shared/icons/IconSeparator.vue.js"),t={class:"yc-breadcrumb-item-separator"},a=e.defineComponent({__name:"BreadcrumbSeparator",props:{separatorSlots:{type:Function},separator:{},itemSeparatorSlots:{type:Function},itemSeparator:{}},setup(a){const s=a,n=e.computed(()=>r.isUndefined(s.itemSeparatorSlots)?s.separatorSlots||s.separator:s.itemSeparatorSlots||s.itemSeparator||s.separatorSlots||s.separator),i=()=>{var e,o,t;return r.isUndefined(s.itemSeparatorSlots)?(null==(e=s.separatorSlots)?void 0:e.call(s))||s.separator:(null==(o=s.itemSeparatorSlots)?void 0:o.call(s))||s.itemSeparator||(null==(t=s.separatorSlots)?void 0:t.call(s))||s.separator};return(r,a)=>(e.openBlock(),e.createElementBlock("span",t,[n.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{key:0})):(e.openBlock(),e.createBlock(e.unref(o),{key:1}))]))}});module.exports=a;
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),t=require("../node_modules/@vueuse/core/index.js");require("../node_modules/tinycolor2/esm/tinycolor.js");const o=require("../_shared/utils/dom.js");require("../_shared/utils/time.js"),require("../_shared/utils/locale.js");const i=require("../_shared/utils/control.js");,/* empty css */,/* empty css */;/* empty css */const r=require("../_shared/icons/IconDragDot.vue.js"),n=["dir","onMousedown"],l={class:"yc-resizebox-trigger-icon-wrapper"},s=e.defineComponent({name:"ResizeBox",__name:"index",props:{width:{default:void 0},height:{default:void 0},component:{default:"div"},directions:{default:()=>["right"]}},emits:["update:width","update:height","moving-start","moving","moving-end"],setup(s,{emit:u}){e.useSlots();const a=s,c=u,{width:d,height:v}=e.toRefs(a),h=i(d,0,e=>{c("update:width",e)}),g=i(v,0,e=>{c("update:height",e)}),m=e.reactive([]),f=e.reactive({left:0,right:0,bottom:0,top:0}),p=e.ref(),y=e.ref(null);let x,w=0,b=0;return t.useEventListener("mousemove",async e=>{if(!y.value||!p.value)return;const{clientX:t,clientY:i}=e,r="left"==y.value?w-t:t-w,n="top"==y.value?b-i:i-b;w=t,b=i,["left","right"].includes(y.value)?(h.value+=r,p.value.style.width=`${o.valueToPx(h.value)}`):(g.value+=n,p.value.style.height=`${o.valueToPx(g.value)}`);const{width:l,height:s}=p.value.getBoundingClientRect();l!=h.value&&(h.value=l),s!=g.value&&(g.value=l),c("moving",{width:l,height:s},e)}),t.useEventListener("mouseup",e=>{y.value&&(y.value=null,document.body.style.cursor=x,c("moving-end",e))}),t.useResizeObserver(()=>m,e=>{e.forEach(e=>{const t=e.target.getAttribute("dir"),{contentRect:{width:o,height:i}}=e;f[t]=["right","left"].includes(t)?o:i})},{box:"border-box"}),e.watch([h,g],async()=>{y.value||(await e.nextTick(),p.value.style.width=`${o.valueToPx(h.value)}`,p.value.style.height=`${o.valueToPx(g.value)}`)},{immediate:!0}),(t,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),{style:e.normalizeStyle({minWidth:e.unref(o.valueToPx)(f.left+f.right),minHeight:e.unref(o.valueToPx)(f.top+f.bottom)}),class:"yc-resizebox",ref_key:"boxRef",ref:p},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.directions,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:e.normalizeClass(["yc-resizebox-trigger",`yc-resizebox-direction-${o}`,"yc-resizebox-trigger-"+(["left","right"].includes(o)?"vertical":"horizontal")]),dir:o,ref_for:!0,ref:e=>m[i]=e,onMousedown:e=>(async(e,t)=>{t.preventDefault(),y.value=e;const{width:o,height:i}=p.value.getBoundingClientRect();h.value=o,g.value=i;const{clientX:r,clientY:n}=t;w=r,b=n,x=getComputedStyle(document.body).cursor,document.body.style.cursor=["left","right"].includes(e)?"col-resize":"row-resize",c("moving-start",t)})(o,e)},[e.renderSlot(t.$slots,"resize-trigger",{direction:o},()=>[e.createElementVNode("div",l,[e.renderSlot(t.$slots,"resize-trigger-icon",{direction:o},()=>[e.createVNode(e.unref(r),{rotate:["left","right"].includes(o)?90:0},null,8,["rotate"])])])])],42,n))),128))]),_:3},8,["style"]))}});module.exports=s;
1
+ "use strict";const e=require("vue"),t=require("../node_modules/@vueuse/core/index.js");require("../node_modules/tinycolor2/esm/tinycolor.js");const o=require("../_shared/utils/dom.js");require("../_shared/utils/time.js"),require("../_shared/utils/locale.js");const i=require("../_shared/utils/control.js");,/* empty css */,/* empty css */;/* empty css */const r=require("../_shared/icons/IconDragDot.vue.js"),n=["dir","onMousedown"],l={class:"yc-resizebox-trigger-icon-wrapper"},s=e.defineComponent({name:"ResizeBox",__name:"index",props:{width:{default:void 0},height:{default:void 0},component:{default:"div"},directions:{default:()=>["right"]}},emits:["update:width","update:height","moving-start","moving","moving-end"],setup(s,{emit:u}){e.useSlots();const a=s,c=u,{width:d,height:v}=e.toRefs(a),h=i(d,0,e=>{c("update:width",e)}),g=i(v,0,e=>{c("update:height",e)}),m=e.reactive([]),f=e.reactive({left:0,right:0,bottom:0,top:0}),p=e.ref(),y=e.ref(null);let x,w=0,b=0;return t.useEventListener("mousemove",async e=>{if(!y.value||!p.value)return;const{clientX:t,clientY:i}=e,r="left"==y.value?w-t:t-w,n="top"==y.value?b-i:i-b;w=t,b=i,["left","right"].includes(y.value)?(h.value+=r,p.value.style.width=`${o.valueToPx(h.value)}`):(g.value+=n,p.value.style.height=`${o.valueToPx(g.value)}`);const{width:l,height:s}=p.value.getBoundingClientRect();l!=h.value&&(h.value=l),s!=g.value&&(g.value=l),c("moving",{width:l,height:s},e)}),t.useEventListener("mouseup",e=>{y.value&&(y.value=null,document.body.style.cursor=x,c("moving-end",e))}),t.useResizeObserver(()=>m,e=>{e.forEach(e=>{const t=e.target.getAttribute("dir"),{contentRect:{width:o,height:i}}=e;f[t]=["right","left"].includes(t)?o:i})},{box:"border-box"}),e.watch([h,g],async()=>{y.value||(await e.nextTick(),p.value.style.width=h.value?`${o.valueToPx(h.value)}`:"",p.value.style.height=g.value?`${o.valueToPx(g.value)}`:"")},{immediate:!0}),(t,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),{style:e.normalizeStyle({minWidth:e.unref(o.valueToPx)(f.left+f.right),minHeight:e.unref(o.valueToPx)(f.top+f.bottom)}),class:"yc-resizebox",ref_key:"boxRef",ref:p},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.directions,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:e.normalizeClass(["yc-resizebox-trigger",`yc-resizebox-direction-${o}`,"yc-resizebox-trigger-"+(["left","right"].includes(o)?"vertical":"horizontal")]),dir:o,ref_for:!0,ref:e=>m[i]=e,onMousedown:e=>(async(e,t)=>{t.preventDefault(),y.value=e;const{width:o,height:i}=p.value.getBoundingClientRect();h.value=o,g.value=i;const{clientX:r,clientY:n}=t;w=r,b=n,x=getComputedStyle(document.body).cursor,document.body.style.cursor=["left","right"].includes(e)?"col-resize":"row-resize",c("moving-start",t)})(o,e)},[e.renderSlot(t.$slots,"resize-trigger",{direction:o},()=>[e.createElementVNode("div",l,[e.renderSlot(t.$slots,"resize-trigger-icon",{direction:o},()=>[e.createVNode(e.unref(r),{rotate:["left","right"].includes(o)?90:0},null,8,["rotate"])])])])],42,n))),128))]),_:3},8,["style"]))}});module.exports=s;
@@ -1 +1 @@
1
- "use strict";const e=require("./IconSeparator.vue2.js");module.exports=e;
1
+ "use strict";const e=require("vue");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../utils/dom.js"),require("../utils/time.js"),require("../utils/locale.js"),/* empty css */;/* empty css */const o=require("../components/Icon/index.vue3.js");;/* empty css */const n=e.defineComponent({__name:"IconSeparator",setup:n=>(n,r)=>(e.openBlock(),e.createBlock(e.unref(o),e.normalizeProps(e.guardReactiveProps(n.$attrs)),{default:e.withCtx(()=>r[0]||(r[0]=[e.createElementVNode("path",{d:"M29.506 6.502 18.493 41.498"},null,-1)])),_:1,__:[0]},16))});module.exports=n;
@@ -1 +1 @@
1
- "use strict";const e=require("vue");require("../../node_modules/tinycolor2/esm/tinycolor.js"),require("../utils/dom.js"),require("../utils/time.js"),require("../utils/locale.js"),/* empty css */;/* empty css */const o=require("../components/Icon/index.vue3.js");;/* empty css */const n=e.defineComponent({__name:"IconSeparator",setup:n=>(n,r)=>(e.openBlock(),e.createBlock(e.unref(o),e.normalizeProps(e.guardReactiveProps(n.$attrs)),{default:e.withCtx(()=>r[0]||(r[0]=[e.createElementVNode("path",{d:"M29.506 6.502 18.493 41.498"},null,-1)])),_:1,__:[0]},16))});module.exports=n;
1
+ "use strict";const e=require("./IconSeparator.vue.js");module.exports=e;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yc-design-vue",
3
3
  "private": false,
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "description": "A Vue 3 component library.",
7
7
  "keywords": [