@studio-west/employees 0.6.54 → 0.6.55

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.
Files changed (46) hide show
  1. package/dist/SwButton-85-tKHA7-BpZ2q9aj.cjs +1 -0
  2. package/dist/SwButton-85-tKHA7-D0loTJgt.js +33 -0
  3. package/dist/SwCollapse-CuN3EbT6-1y2PMRQ8.cjs +1 -0
  4. package/dist/SwCollapse-CuN3EbT6-Bp57Ya_9.js +33 -0
  5. package/dist/SwDatePicker-C-UmCyTm-CTOiwZL1.cjs +1 -0
  6. package/dist/SwDatePicker-C-UmCyTm-Co9VaGQR.js +369 -0
  7. package/dist/SwDropdown-DQGTnnKw-BltvlnsL.cjs +1 -0
  8. package/dist/SwDropdown-DQGTnnKw-CJPDuCfV.js +111 -0
  9. package/dist/SwDropdownItem-Db2TXRVI-BcLri1T3.js +31 -0
  10. package/dist/SwDropdownItem-Db2TXRVI-DHp91ADz.cjs +1 -0
  11. package/dist/SwDropdownNew-CYfjZFd2-DIv6p-6i.cjs +1 -0
  12. package/dist/SwDropdownNew-CYfjZFd2-nlDq08DL.js +107 -0
  13. package/dist/SwFormItem-CaA4jsoa-6C3zw4iZ.js +24 -0
  14. package/dist/SwFormItem-CaA4jsoa-MFTEfPiY.cjs +1 -0
  15. package/dist/SwGide-Bv05X9FW-BTqybd7p.cjs +1 -0
  16. package/dist/SwGide-Bv05X9FW-XUYykhog.js +145 -0
  17. package/dist/SwInput-B1hD3QYw-DaqUVUBC.cjs +1 -0
  18. package/dist/SwInput-B1hD3QYw-zCu7Xl3k.js +91 -0
  19. package/dist/SwMessage-D24ZbJyd-B0sGfA92.js +60 -0
  20. package/dist/SwMessage-D24ZbJyd-hmjlb3jg.cjs +1 -0
  21. package/dist/SwSection-D8ooQ21I-DkmOwvIl.js +37 -0
  22. package/dist/SwSection-D8ooQ21I-Nsa_5V1p.cjs +1 -0
  23. package/dist/SwSelect-C2RKinez-BD70YvFF.js +71 -0
  24. package/dist/SwSelect-C2RKinez-KweWYzRe.cjs +1 -0
  25. package/dist/SwSkeleton-B7ysp8L9-DnocmEnE.js +26 -0
  26. package/dist/SwSkeleton-B7ysp8L9-RJwRbv_K.cjs +1 -0
  27. package/dist/SwSkeletonItem-CU7LvihY-BJmW7U8Z.cjs +1 -0
  28. package/dist/SwSkeletonItem-CU7LvihY-DdKyY6kY.js +29 -0
  29. package/dist/SwSlider-B8ah3WJf-DFs0WIbH.js +160 -0
  30. package/dist/SwSlider-B8ah3WJf-eotQC_I3.cjs +1 -0
  31. package/dist/SwSwitch-6rl1IT4p-BQTT__wH.cjs +1 -0
  32. package/dist/SwSwitch-6rl1IT4p-Cq2vi3fZ.js +47 -0
  33. package/dist/SwTable-BKZ5idCi-BMDZ1otG.cjs +1 -0
  34. package/dist/SwTable-BKZ5idCi-DEX2rFo2.js +152 -0
  35. package/dist/SwTableColumn-BLF5bPuJ-CHI10OyO.js +28 -0
  36. package/dist/SwTableColumn-BLF5bPuJ-CbuAoznO.cjs +1 -0
  37. package/dist/SwTabs-DkSI4oAh-By6KQ_XO.cjs +1 -0
  38. package/dist/SwTabs-DkSI4oAh-VaIFmFrU.js +38 -0
  39. package/dist/SwTabsPane-Dwtj8g7T-BUCrffEQ.cjs +1 -0
  40. package/dist/SwTabsPane-Dwtj8g7T-Dpg9j8nR.js +38 -0
  41. package/dist/VacationTable-3jJUSDHf.cjs +1 -0
  42. package/dist/VacationTable-GeJlpGuk.js +839 -0
  43. package/dist/VacationTable.cjs +1 -1
  44. package/dist/VacationTable.js +9 -726
  45. package/dist/employees.css +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),a={__name:"SwButton",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},round:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},href:{type:String,default:""}},setup(s){const t=s,n=()=>{if(t.href.length>0){const e=document.createElement("a");e.setAttribute("href",t.href),e.setAttribute("target","_blank"),e.click()}},u=l.computed(()=>{let e=["sw-button"];return t.size.length>0&&e.push("sw-"+t.size),t.type.length>0&&e.push("sw-"+t.type),t.round&&e.push("sw-round"),t.text&&e.push("sw-text"),t.link&&e.push("sw-link"),t.class.length>0&&e.push(t.class),e});return(e,o)=>(l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass(u.value),onClick:n},[l.renderSlot(e.$slots,"default")],2))}};exports.default=a;
@@ -0,0 +1,33 @@
1
+ import { computed as a, createElementBlock as u, openBlock as o, normalizeClass as r, renderSlot as p } from "vue";
2
+ const i = {
3
+ __name: "SwButton",
4
+ props: {
5
+ class: { type: String, default: "" },
6
+ size: { type: String, default: "" },
7
+ type: { type: String, default: "" },
8
+ round: { type: Boolean, default: !1 },
9
+ text: { type: Boolean, default: !1 },
10
+ link: { type: Boolean, default: !1 },
11
+ href: { type: String, default: "" }
12
+ },
13
+ setup(l) {
14
+ const t = l, s = () => {
15
+ if (t.href.length > 0) {
16
+ const e = document.createElement("a");
17
+ e.setAttribute("href", t.href), e.setAttribute("target", "_blank"), e.click();
18
+ }
19
+ }, n = a(() => {
20
+ let e = ["sw-button"];
21
+ return t.size.length > 0 && e.push("sw-" + t.size), t.type.length > 0 && e.push("sw-" + t.type), t.round && e.push("sw-round"), t.text && e.push("sw-text"), t.link && e.push("sw-link"), t.class.length > 0 && e.push(t.class), e;
22
+ });
23
+ return (e, f) => (o(), u("button", {
24
+ class: r(n.value),
25
+ onClick: s
26
+ }, [
27
+ p(e.$slots, "default")
28
+ ], 2));
29
+ }
30
+ };
31
+ export {
32
+ i as default
33
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r={__name:"SwCollapse",props:{visual:{type:Boolean,default:!0}},setup(n){e.onMounted(()=>{s.value="0px"});const l=e.ref(null),t=n;e.watch(()=>t.visual,()=>a());const s=e.ref("0px"),a=()=>{l.value&&(s.value=t.visual?l.value.scrollHeight+"px":"0px")};let o;return e.onMounted(()=>{a(),l.value&&(o=new ResizeObserver(a),o.observe(l.value))}),e.onBeforeUnmount(()=>{o&&o.disconnect()}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sw-collapse",{open:t.visual}]),style:e.normalizeStyle({maxHeight:s.value}),ref_key:"collapse",ref:l},[e.renderSlot(u.$slots,"default")],6))}};exports.default=r;
@@ -0,0 +1,33 @@
1
+ import { onMounted as t, ref as n, watch as p, createElementBlock as v, onBeforeUnmount as c, openBlock as i, normalizeStyle as f, normalizeClass as m, renderSlot as d } from "vue";
2
+ const w = {
3
+ __name: "SwCollapse",
4
+ props: {
5
+ visual: { type: Boolean, default: !0 }
6
+ },
7
+ setup(r) {
8
+ t(() => {
9
+ a.value = "0px";
10
+ });
11
+ const e = n(null), o = r;
12
+ p(() => o.visual, () => s());
13
+ const a = n("0px"), s = () => {
14
+ e.value && (a.value = o.visual ? e.value.scrollHeight + "px" : "0px");
15
+ };
16
+ let l;
17
+ return t(() => {
18
+ s(), e.value && (l = new ResizeObserver(s), l.observe(e.value));
19
+ }), c(() => {
20
+ l && l.disconnect();
21
+ }), (u, x) => (i(), v("div", {
22
+ class: m(["sw-collapse", { open: o.visual }]),
23
+ style: f({ maxHeight: a.value }),
24
+ ref_key: "collapse",
25
+ ref: e
26
+ }, [
27
+ d(u.$slots, "default")
28
+ ], 6));
29
+ }
30
+ };
31
+ export {
32
+ w as default
33
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./VacationTable-3jJUSDHf.cjs"),H={class:"sw-data-picker"},J={key:0,class:"month_year"},K={class:"text"},R={key:1,class:"month_year"},Z={class:"text"},Q={key:2,class:"week"},X={key:3,class:"year"},ee=["onClick"],te={key:4,class:"year"},ae=["onClick"],le={key:5,class:"month"},ne=["onClick"],re={key:0},oe={key:0,class:"month_year"},ue={class:"text"},ce={key:1,class:"month_year"},se={class:"text"},ie={key:2,class:"week"},ve={key:3,class:"year"},de=["onClick"],me={key:4,class:"year"},ke=["onClick"],pe={key:5,class:"month"},ye=["onClick"],ge={__name:"SwDatePicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:"solid"}},emits:["input"],setup(q,{emit:A}){var Y,z,_,I,j;const r=q,b=A,s=e.ref(5),y=e.ref(new Date),N=e.ref(new Date),u=e.ref(new Date().getFullYear()),o=e.ref(new Date().getMonth()),T=e.ref(new Date().getFullYear()),F=e.ref(new Date().getMonth()),V=e.ref(new Date(u.value,o.value+1,1).getMonth()),c=e.ref([]),B=e.ref(0),m=e.ref(-1),f=e.ref(-1),x=e.ref(navigator.language||"ru"),w=/en|zh|ja|he/.test(x.value)?0:1,L=e.computed(()=>Array.from({length:12},(l,t)=>{const a=new Date(2024,t);return new Intl.DateTimeFormat(x.value,{month:"long"}).format(a)})),h=e.ref(Math.floor(u.value/10)*10),D=e.computed(()=>Array.from({length:12},(l,t)=>h.value+t-1));(Y=r.data)!=null&&Y.startDate?(y.value=new Date(v.U(r.data.startDate)),u.value=y.value.getFullYear(),o.value=y.value.getMonth()):(z=r.data)!=null&&z.firstDate&&(u.value=new Date(v.U(r.data.firstDate)).getFullYear(),o.value=new Date(v.U(r.data.firstDate)).getMonth(),V.value=new Date(u.value,o.value+1,1).getMonth()),(_=r.data)!=null&&_.endDate&&r.range==="range"&&(N.value=new Date(v.U(r.data.endDate)),T.value=N.value.getFullYear(),F.value=N.value.getMonth());const $=()=>{c.value=[],B.value=0;const l=new Date(u.value,o.value,0);for(let a=l.getDate()-l.getDay()+w;a<=l.getDate();a++)l.getDay()!==6+w&&(c.value.push({day:a,month:l.getMonth(),year:l.getFullYear(),class:[]}),B.value++);const t=new Date(u.value,o.value+1,0).getDate();for(let a=1;a<=t;a++)c.value.push({day:a,month:o.value,year:u.value,class:[]}),B.value++;if(r.range==="range"){const a=new Date(u.value,o.value+1,1),n=new Date(u.value,o.value+2,0).getDate();for(let i=1;i<=n;i++)c.value.push({day:i,month:a.getMonth(),year:a.getFullYear(),class:[]})}O()},O=()=>{var t;if(!((t=r.data)!=null&&t.holiday))return;const l=(a,n)=>{a.forEach(i=>{const[p,k,g]=i.split("-").map(Number),E=c.value.findIndex(S=>S.year===p&&S.month+1===k&&S.day===g);E!==-1&&(c.value[E].class[0]=n)})};l(r.data.holiday.preholidays,"preholiday"),l(r.data.holiday.holidays,"weekend"),l(r.data.holiday.holiday,"holiday"),l(r.data.holiday.nowork,"nowork")},P=()=>{if(!r.limitation||r.limitation.length<2)return!1;const l=[...r.limitation].sort((t,a)=>new Date(v.U(t.startDate)).getTime()-new Date(v.U(a.startDate)).getTime());for(let t=1;t<l.length;t++){const a=new Date(v.U(l[t-1].endDate));if(new Date(v.U(l[t].startDate))<=a)return console.warn("Warning: Диапазоны пересекаются:",l[t-1],l[t]),!0}return!1},C=(l,t,a)=>{if(!r.limitation||r.limitation.length===0)return!0;const n=new Date(l,t,a).getTime();for(let i of r.limitation){const{startDate:p,endDate:k}=i;if(!p&&k){const g=new Date(v.U(k)).getTime();if(n<=g)return!1}if(p&&!k){const g=new Date(v.U(p)).getTime();if(n>=g)return!1}if(p&&k){const g=new Date(v.U(p)).getTime(),E=new Date(v.U(k)).getTime();if(g<=E){if(n>=g&&n<=E)return!1}else if(n>=g||n<=E)return!1}}return!0},M=(l,t)=>{const a=v.L(new Date(l.year,l.month,l.day),"{dd}.{m}.{Y}");r.range==="range"?f.value!==-1?(W(),m.value=t,c.value[t].class[1]="active"):m.value!==-1?(f.value=t,G(m.value,f.value,a)):(m.value=t,c.value[t].class[1]="active"):(m.value!==-1&&(c.value[m.value].class[1]=""),m.value=t,c.value[t].class[1]="active",b("input",{dateStart:a,count:1}))},W=()=>{c.value.forEach(l=>l.class[1]=""),m.value=-1,f.value=-1},G=(l,t,a)=>{let n=v.L(new Date(c.value[l].year,c.value[l].month,c.value[l].day),"{dd}.{m}.{Y}");if(t>=l){for(let i=l+1;i<t;i++)c.value[i].class[1]="select";b("input",{dateStart:n,dateEnd:a,count:U(l,t)})}else{for(let i=t+1;i<l;i++)c.value[i].class[1]="select";b("input",{dateStart:a,dateEnd:n,count:U(t,l)})}c.value[t].class[1]="active"},U=(l,t)=>{var p;let a=Math.abs(l-t)+1,[n,i]=[Math.min(l,t),Math.max(l,t)];for(let k=n;k<=i;k++)((p=c.value[k])==null?void 0:p.class[0])==="holiday"&&a--;return a},d=(l,t)=>{C(l,t)&&(y.value=new Date(l,t,1),u.value=y.value.getFullYear(),o.value=y.value.getMonth(),V.value=new Date(l,t+1,1).getMonth(),(r.range==="year"||r.range==="decades")&&s.value===0?M({year:l,month:t,day:1},8):$())};if($(),P(),(I=r.data)!=null&&I.startDate&&(m.value=c.value.findIndex(l=>l.day===y.value.getDate()&&l.month===o.value&&l.year===u.value),m.value!==-1&&(c.value[m.value].class[1]="active")),((j=r.data)==null?void 0:j.endDate)&&r.range==="range"&&(f.value=c.value.findIndex(l=>l.day===N.value.getDate()&&l.month===F.value&&l.year===T.value),f.value!==-1)){c.value[f.value].class[1]="active";for(let l=m.value+1;l<f.value;l++)c.value[l].class[1]="select"}return(l,t)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",null,[r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("p",J,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[16]||(t[16]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",K,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[1]||(t[1]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[17]||(t[17]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",R,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[2]||(t[2]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[18]||(t[18]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[3]||(t[3]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[19]||(t[19]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",Z,[e.createElementVNode("button",{onClick:t[4]||(t[4]=e.withModifiers(a=>s.value=3,["prevent"]))},e.toDisplayString(u.value),1),e.createElementVNode("button",{onClick:t[5]||(t[5]=e.withModifiers(a=>s.value=1,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[6]||(t[6]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[20]||(t[20]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[7]||(t[7]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[21]||(t[21]=e.createTextVNode("«",-1))])])])])),r.range==="year"||r.range==="decades"||s.value===1||s.value===3?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value!==3&&r.range==="year"||s.value===1?(e.openBlock(),e.createElementBlock("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n)},["prevent"]),class:e.normalizeClass(n===o.value?"active":"")},e.toDisplayString(a),11,ee))),128))])):r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=r.range==="year"?1:0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ae))),128))])):(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(u.value,o.value+1,1).getDay()+e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===o.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===o.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ne)):e.createCommentVNode("",!0)],64))),128))]))]),r.range==="range"?(e.openBlock(),e.createElementBlock("div",re,[r.range==="decades"||s.value===4?(e.openBlock(),e.createElementBlock("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[8]||(t[8]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[22]||(t[22]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",ue,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[9]||(t[9]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[23]||(t[23]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[10]||(t[10]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[24]||(t[24]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[11]||(t[11]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[25]||(t[25]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",se,[e.createElementVNode("button",{onClick:t[12]||(t[12]=e.withModifiers(a=>s.value=4,["prevent"]))},e.toDisplayString(new Date(u.value,o.value+1).getFullYear()),1),e.createElementVNode("button",{onClick:t[13]||(t[13]=e.withModifiers(a=>s.value=2,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[14]||(t[14]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[26]||(t[26]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[15]||(t[15]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[27]||(t[27]=e.createTextVNode("«",-1))])])])])),s.value===2||s.value===4?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value===2?(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n-1)},["prevent"]),class:e.normalizeClass(n===(o.value+1)%12?"active":"")},e.toDisplayString(a),11,de))),128))])):s.value===4?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ke))),128))])):(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-(7+new Date(u.value,o.value+1,1).getDay()-e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===V.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===V.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ye)):e.createCommentVNode("",!0)],64))),128))]))])):e.createCommentVNode("",!0)]))}};exports.default=ge;
@@ -0,0 +1,369 @@
1
+ import { ref as D, computed as ee, createElementBlock as s, openBlock as o, createElementVNode as r, createCommentVNode as z, withModifiers as d, renderSlot as m, createTextVNode as p, toDisplayString as h, unref as Y, Fragment as C, renderList as x, normalizeClass as I } from "vue";
2
+ import { U as k, L as N } from "./VacationTable-GeJlpGuk.js";
3
+ const re = { class: "sw-data-picker" }, se = {
4
+ key: 0,
5
+ class: "month_year"
6
+ }, oe = { class: "text" }, ce = {
7
+ key: 1,
8
+ class: "month_year"
9
+ }, ie = { class: "text" }, de = {
10
+ key: 2,
11
+ class: "week"
12
+ }, ye = {
13
+ key: 3,
14
+ class: "year"
15
+ }, ge = ["onClick"], he = {
16
+ key: 4,
17
+ class: "year"
18
+ }, De = ["onClick"], we = {
19
+ key: 5,
20
+ class: "month"
21
+ }, me = ["onClick"], pe = { key: 0 }, ke = {
22
+ key: 0,
23
+ class: "month_year"
24
+ }, fe = { class: "text" }, be = {
25
+ key: 1,
26
+ class: "month_year"
27
+ }, Ce = { class: "text" }, Me = {
28
+ key: 2,
29
+ class: "week"
30
+ }, $e = {
31
+ key: 3,
32
+ class: "year"
33
+ }, Fe = ["onClick"], Ye = {
34
+ key: 4,
35
+ class: "year"
36
+ }, xe = ["onClick"], Te = {
37
+ key: 5,
38
+ class: "month"
39
+ }, Se = ["onClick"], Ie = {
40
+ __name: "SwDatePicker",
41
+ props: {
42
+ data: Object,
43
+ limitation: {
44
+ type: [Boolean, Array],
45
+ default: () => !1
46
+ },
47
+ range: {
48
+ type: String,
49
+ default: "solid"
50
+ }
51
+ },
52
+ emits: ["input"],
53
+ setup(ae, { emit: te }) {
54
+ var R, U, Z, Q, X;
55
+ const n = ae, L = te, i = D(5), M = D(/* @__PURE__ */ new Date()), A = D(/* @__PURE__ */ new Date()), v = D((/* @__PURE__ */ new Date()).getFullYear()), u = D((/* @__PURE__ */ new Date()).getMonth()), W = D((/* @__PURE__ */ new Date()).getFullYear()), q = D((/* @__PURE__ */ new Date()).getMonth()), B = D(new Date(v.value, u.value + 1, 1).getMonth()), c = D([]), V = D(0), w = D(-1), F = D(-1), G = D(navigator.language || "ru"), S = /en|zh|ja|he/.test(G.value) ? 0 : 1, H = ee(() => Array.from({ length: 12 }, (t, e) => {
56
+ const a = new Date(2024, e);
57
+ return new Intl.DateTimeFormat(G.value, { month: "long" }).format(a);
58
+ })), T = D(Math.floor(v.value / 10) * 10), _ = ee(() => Array.from({ length: 12 }, (t, e) => T.value + e - 1));
59
+ (R = n.data) != null && R.startDate ? (M.value = new Date(k(n.data.startDate)), v.value = M.value.getFullYear(), u.value = M.value.getMonth()) : (U = n.data) != null && U.firstDate && (v.value = new Date(k(n.data.firstDate)).getFullYear(), u.value = new Date(k(n.data.firstDate)).getMonth(), B.value = new Date(v.value, u.value + 1, 1).getMonth()), (Z = n.data) != null && Z.endDate && n.range === "range" && (A.value = new Date(k(n.data.endDate)), W.value = A.value.getFullYear(), q.value = A.value.getMonth());
60
+ const J = () => {
61
+ c.value = [], V.value = 0;
62
+ const t = new Date(v.value, u.value, 0);
63
+ for (let a = t.getDate() - t.getDay() + S; a <= t.getDate(); a++)
64
+ t.getDay() !== 6 + S && (c.value.push({ day: a, month: t.getMonth(), year: t.getFullYear(), class: [] }), V.value++);
65
+ const e = new Date(v.value, u.value + 1, 0).getDate();
66
+ for (let a = 1; a <= e; a++)
67
+ c.value.push({ day: a, month: u.value, year: v.value, class: [] }), V.value++;
68
+ if (n.range === "range") {
69
+ const a = new Date(v.value, u.value + 1, 1), l = new Date(v.value, u.value + 2, 0).getDate();
70
+ for (let y = 1; y <= l; y++)
71
+ c.value.push({ day: y, month: a.getMonth(), year: a.getFullYear(), class: [] });
72
+ }
73
+ le();
74
+ }, le = () => {
75
+ var e;
76
+ if (!((e = n.data) != null && e.holiday)) return;
77
+ const t = (a, l) => {
78
+ a.forEach((y) => {
79
+ const [b, f, $] = y.split("-").map(Number), E = c.value.findIndex((P) => P.year === b && P.month + 1 === f && P.day === $);
80
+ E !== -1 && (c.value[E].class[0] = l);
81
+ });
82
+ };
83
+ t(n.data.holiday.preholidays, "preholiday"), t(n.data.holiday.holidays, "weekend"), t(n.data.holiday.holiday, "holiday"), t(n.data.holiday.nowork, "nowork");
84
+ }, ne = () => {
85
+ if (!n.limitation || n.limitation.length < 2) return !1;
86
+ const t = [...n.limitation].sort(
87
+ (e, a) => new Date(k(e.startDate)).getTime() - new Date(k(a.startDate)).getTime()
88
+ );
89
+ for (let e = 1; e < t.length; e++) {
90
+ const a = new Date(k(t[e - 1].endDate));
91
+ if (new Date(k(t[e].startDate)) <= a)
92
+ return console.warn("Warning: Диапазоны пересекаются:", t[e - 1], t[e]), !0;
93
+ }
94
+ return !1;
95
+ }, j = (t, e, a) => {
96
+ if (!n.limitation || n.limitation.length === 0) return !0;
97
+ const l = new Date(t, e, a).getTime();
98
+ for (let y of n.limitation) {
99
+ const { startDate: b, endDate: f } = y;
100
+ if (!b && f) {
101
+ const $ = new Date(k(f)).getTime();
102
+ if (l <= $) return !1;
103
+ }
104
+ if (b && !f) {
105
+ const $ = new Date(k(b)).getTime();
106
+ if (l >= $) return !1;
107
+ }
108
+ if (b && f) {
109
+ const $ = new Date(k(b)).getTime(), E = new Date(k(f)).getTime();
110
+ if ($ <= E) {
111
+ if (l >= $ && l <= E) return !1;
112
+ } else if (l >= $ || l <= E) return !1;
113
+ }
114
+ }
115
+ return !0;
116
+ }, O = (t, e) => {
117
+ const a = N(new Date(t.year, t.month, t.day), "{dd}.{m}.{Y}");
118
+ n.range === "range" ? F.value !== -1 ? (ue(), w.value = e, c.value[e].class[1] = "active") : w.value !== -1 ? (F.value = e, ve(w.value, F.value, a)) : (w.value = e, c.value[e].class[1] = "active") : (w.value !== -1 && (c.value[w.value].class[1] = ""), w.value = e, c.value[e].class[1] = "active", L("input", { dateStart: a, count: 1 }));
119
+ }, ue = () => {
120
+ c.value.forEach((t) => t.class[1] = ""), w.value = -1, F.value = -1;
121
+ }, ve = (t, e, a) => {
122
+ let l = N(new Date(c.value[t].year, c.value[t].month, c.value[t].day), "{dd}.{m}.{Y}");
123
+ if (e >= t) {
124
+ for (let y = t + 1; y < e; y++)
125
+ c.value[y].class[1] = "select";
126
+ L("input", { dateStart: l, dateEnd: a, count: K(t, e) });
127
+ } else {
128
+ for (let y = e + 1; y < t; y++)
129
+ c.value[y].class[1] = "select";
130
+ L("input", { dateStart: a, dateEnd: l, count: K(e, t) });
131
+ }
132
+ c.value[e].class[1] = "active";
133
+ }, K = (t, e) => {
134
+ var b;
135
+ let a = Math.abs(t - e) + 1, [l, y] = [Math.min(t, e), Math.max(t, e)];
136
+ for (let f = l; f <= y; f++)
137
+ ((b = c.value[f]) == null ? void 0 : b.class[0]) === "holiday" && a--;
138
+ return a;
139
+ }, g = (t, e) => {
140
+ j(t, e) && (M.value = new Date(t, e, 1), v.value = M.value.getFullYear(), u.value = M.value.getMonth(), B.value = new Date(t, e + 1, 1).getMonth(), (n.range === "year" || n.range === "decades") && i.value === 0 ? O({ year: t, month: e, day: 1 }, 8) : J());
141
+ };
142
+ if (J(), ne(), (Q = n.data) != null && Q.startDate && (w.value = c.value.findIndex((t) => t.day === M.value.getDate() && t.month === u.value && t.year === v.value), w.value !== -1 && (c.value[w.value].class[1] = "active")), ((X = n.data) == null ? void 0 : X.endDate) && n.range === "range" && (F.value = c.value.findIndex((t) => t.day === A.value.getDate() && t.month === q.value && t.year === W.value), F.value !== -1)) {
143
+ c.value[F.value].class[1] = "active";
144
+ for (let t = w.value + 1; t < F.value; t++)
145
+ c.value[t].class[1] = "select";
146
+ }
147
+ return (t, e) => (o(), s("div", re, [
148
+ r("div", null, [
149
+ n.range === "decades" || i.value === 3 ? (o(), s("p", se, [
150
+ r("span", null, [
151
+ r("button", {
152
+ onClick: e[0] || (e[0] = d((a) => {
153
+ T.value -= 10, g(v.value, u.value);
154
+ }, ["prevent"]))
155
+ }, [
156
+ m(t.$slots, "double-arrow", {}, () => [
157
+ e[16] || (e[16] = p("«", -1))
158
+ ])
159
+ ])
160
+ ]),
161
+ r("span", oe, h(_.value[0]) + " - " + h(_.value[11]), 1),
162
+ r("span", null, [
163
+ r("button", {
164
+ class: "sw-revers",
165
+ onClick: e[1] || (e[1] = d((a) => {
166
+ T.value += 10, g(v.value, u.value);
167
+ }, ["prevent"]))
168
+ }, [
169
+ m(t.$slots, "double-arrow", {}, () => [
170
+ e[17] || (e[17] = p("«", -1))
171
+ ])
172
+ ])
173
+ ])
174
+ ])) : (o(), s("p", ce, [
175
+ r("span", null, [
176
+ r("button", {
177
+ onClick: e[2] || (e[2] = d((a) => g(v.value - 1, u.value), ["prevent"]))
178
+ }, [
179
+ m(t.$slots, "double-arrow", {}, () => [
180
+ e[18] || (e[18] = p("«", -1))
181
+ ])
182
+ ]),
183
+ r("button", {
184
+ onClick: e[3] || (e[3] = d((a) => {
185
+ i.value = 0, g(v.value, u.value - 1);
186
+ }, ["prevent"]))
187
+ }, [
188
+ m(t.$slots, "arrow", {}, () => [
189
+ e[19] || (e[19] = p("‹", -1))
190
+ ])
191
+ ])
192
+ ]),
193
+ r("span", ie, [
194
+ r("button", {
195
+ onClick: e[4] || (e[4] = d((a) => i.value = 3, ["prevent"]))
196
+ }, h(v.value), 1),
197
+ r("button", {
198
+ onClick: e[5] || (e[5] = d((a) => i.value = 1, ["prevent"]))
199
+ }, h(Y(N)(M.value.setMonth(u.value), "{F}")), 1)
200
+ ]),
201
+ r("span", null, [
202
+ r("button", {
203
+ class: "sw-revers",
204
+ onClick: e[6] || (e[6] = d((a) => {
205
+ i.value = 0, g(v.value, u.value + 1);
206
+ }, ["prevent"]))
207
+ }, [
208
+ m(t.$slots, "arrow", {}, () => [
209
+ e[20] || (e[20] = p("‹", -1))
210
+ ])
211
+ ]),
212
+ r("button", {
213
+ class: "sw-revers",
214
+ onClick: e[7] || (e[7] = d((a) => g(v.value + 1, u.value), ["prevent"]))
215
+ }, [
216
+ m(t.$slots, "double-arrow", {}, () => [
217
+ e[21] || (e[21] = p("«", -1))
218
+ ])
219
+ ])
220
+ ])
221
+ ])),
222
+ n.range === "year" || n.range === "decades" || i.value === 1 || i.value === 3 ? z("", !0) : (o(), s("div", de, [
223
+ (o(), s(C, null, x(7, (a, l) => r("button", {
224
+ key: l,
225
+ class: "disabled"
226
+ }, h(Y(N)(new Date(1970, 1, a + Y(S)), "{D}")), 1)), 64))
227
+ ])),
228
+ i.value !== 3 && n.range === "year" || i.value === 1 ? (o(), s("div", ye, [
229
+ (o(!0), s(C, null, x(H.value, (a, l) => (o(), s("button", {
230
+ key: l,
231
+ onClick: d((y) => {
232
+ i.value = 0, g(v.value, l);
233
+ }, ["prevent"]),
234
+ class: I(l === u.value ? "active" : "")
235
+ }, h(a), 11, ge))), 128))
236
+ ])) : n.range === "decades" || i.value === 3 ? (o(), s("div", he, [
237
+ (o(!0), s(C, null, x(_.value, (a, l) => (o(), s("button", {
238
+ key: l,
239
+ onClick: d((y) => {
240
+ i.value = n.range === "year" ? 1 : 0, g(a, u.value);
241
+ }, ["prevent"]),
242
+ class: I(T.value + l - 1 === v.value ? "active" : "")
243
+ }, h(a), 11, De))), 128))
244
+ ])) : (o(), s("div", we, [
245
+ (o(!0), s(C, null, x(c.value, (a, l) => (o(), s(C, { key: l }, [
246
+ l < V.value + (7 - new Date(v.value, u.value + 1, 1).getDay() + Y(S)) % 7 ? (o(), s("button", {
247
+ key: 0,
248
+ class: I(a.month === u.value && j(a.year, a.month, a.day) ? a.class : "disabled"),
249
+ onClick: d(() => {
250
+ a.month === u.value && O(a, l);
251
+ }, ["prevent"])
252
+ }, h(a.day), 11, me)) : z("", !0)
253
+ ], 64))), 128))
254
+ ]))
255
+ ]),
256
+ n.range === "range" ? (o(), s("div", pe, [
257
+ n.range === "decades" || i.value === 4 ? (o(), s("p", ke, [
258
+ r("span", null, [
259
+ r("button", {
260
+ onClick: e[8] || (e[8] = d((a) => {
261
+ T.value -= 10, g(v.value, u.value);
262
+ }, ["prevent"]))
263
+ }, [
264
+ m(t.$slots, "double-arrow", {}, () => [
265
+ e[22] || (e[22] = p("«", -1))
266
+ ])
267
+ ])
268
+ ]),
269
+ r("span", fe, h(_.value[0]) + " - " + h(_.value[11]), 1),
270
+ r("span", null, [
271
+ r("button", {
272
+ class: "sw-revers",
273
+ onClick: e[9] || (e[9] = d((a) => {
274
+ T.value += 10, g(v.value, u.value);
275
+ }, ["prevent"]))
276
+ }, [
277
+ m(t.$slots, "double-arrow", {}, () => [
278
+ e[23] || (e[23] = p("«", -1))
279
+ ])
280
+ ])
281
+ ])
282
+ ])) : (o(), s("p", be, [
283
+ r("span", null, [
284
+ r("button", {
285
+ onClick: e[10] || (e[10] = d((a) => g(v.value - 1, u.value), ["prevent"]))
286
+ }, [
287
+ m(t.$slots, "double-arrow", {}, () => [
288
+ e[24] || (e[24] = p("«", -1))
289
+ ])
290
+ ]),
291
+ r("button", {
292
+ onClick: e[11] || (e[11] = d((a) => {
293
+ i.value = 0, g(v.value, u.value - 1);
294
+ }, ["prevent"]))
295
+ }, [
296
+ m(t.$slots, "arrow", {}, () => [
297
+ e[25] || (e[25] = p("‹", -1))
298
+ ])
299
+ ])
300
+ ]),
301
+ r("span", Ce, [
302
+ r("button", {
303
+ onClick: e[12] || (e[12] = d((a) => i.value = 4, ["prevent"]))
304
+ }, h(new Date(v.value, u.value + 1).getFullYear()), 1),
305
+ r("button", {
306
+ onClick: e[13] || (e[13] = d((a) => i.value = 2, ["prevent"]))
307
+ }, h(Y(N)(M.value.setMonth(u.value + 1), "{F}")), 1)
308
+ ]),
309
+ r("span", null, [
310
+ r("button", {
311
+ class: "sw-revers",
312
+ onClick: e[14] || (e[14] = d((a) => {
313
+ i.value = 0, g(v.value, u.value + 1);
314
+ }, ["prevent"]))
315
+ }, [
316
+ m(t.$slots, "arrow", {}, () => [
317
+ e[26] || (e[26] = p("‹", -1))
318
+ ])
319
+ ]),
320
+ r("button", {
321
+ class: "sw-revers",
322
+ onClick: e[15] || (e[15] = d((a) => g(v.value + 1, u.value), ["prevent"]))
323
+ }, [
324
+ m(t.$slots, "double-arrow", {}, () => [
325
+ e[27] || (e[27] = p("«", -1))
326
+ ])
327
+ ])
328
+ ])
329
+ ])),
330
+ i.value === 2 || i.value === 4 ? z("", !0) : (o(), s("div", Me, [
331
+ (o(), s(C, null, x(7, (a, l) => r("button", {
332
+ key: l,
333
+ class: "disabled"
334
+ }, h(Y(N)(new Date(1970, 1, a + Y(S)), "{D}")), 1)), 64))
335
+ ])),
336
+ i.value === 2 ? (o(), s("div", $e, [
337
+ (o(!0), s(C, null, x(H.value, (a, l) => (o(), s("button", {
338
+ key: l,
339
+ onClick: d((y) => {
340
+ i.value = 0, g(v.value, l - 1);
341
+ }, ["prevent"]),
342
+ class: I(l === (u.value + 1) % 12 ? "active" : "")
343
+ }, h(a), 11, Fe))), 128))
344
+ ])) : i.value === 4 ? (o(), s("div", Ye, [
345
+ (o(!0), s(C, null, x(_.value, (a, l) => (o(), s("button", {
346
+ key: l,
347
+ onClick: d((y) => {
348
+ i.value = 0, g(a, u.value);
349
+ }, ["prevent"]),
350
+ class: I(T.value + l - 1 === v.value ? "active" : "")
351
+ }, h(a), 11, xe))), 128))
352
+ ])) : (o(), s("div", Te, [
353
+ (o(!0), s(C, null, x(c.value, (a, l) => (o(), s(C, { key: l }, [
354
+ l >= V.value - (7 + new Date(v.value, u.value + 1, 1).getDay() - Y(S)) % 7 ? (o(), s("button", {
355
+ key: 0,
356
+ class: I(a.month === B.value && j(a.year, a.month, a.day) ? a.class : "disabled"),
357
+ onClick: d(() => {
358
+ a.month === B.value && O(a, l);
359
+ }, ["prevent"])
360
+ }, h(a.day), 11, Se)) : z("", !0)
361
+ ], 64))), 128))
362
+ ]))
363
+ ])) : z("", !0)
364
+ ]));
365
+ }
366
+ };
367
+ export {
368
+ Ie as default
369
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),B=["id"],C={__name:"SwDropdown",props:o.mergeModels({class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},trigger:{type:String,default:"click"},placement:{type:String,default:"bottom-left"},maxWidth:{type:Number,default:0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(g,{expose:x}){const r=g,a=o.useModel(g,"modelValue"),w=o.ref(null),p=o.ref(null),y=o.ref({}),E=Math.ceil(Math.random()*1e3),c=o.ref(0),L=o.computed(()=>{let l=["sw-dropdown"];return r.size.length>0&&l.push("sw-"+r.size),r.type.length>0&&l.push("sw-"+r.type),l}),b=new ResizeObserver(()=>{a.value&&c.value++,c.value>99&&(c.value=1)});o.watchEffect(()=>{if(!a.value||!p.value||!w.value)return;c.value<2&&b.observe(p.value);let l=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;document.body.style.position="fixed",document.body.style.top=`-${l}px`,document.body.style.left=`-${i}px`,document.body.style.position="",document.body.style.top="",document.body.style.left="",document.documentElement.scrollTop=l,document.documentElement.scrollLeft=i;const n=w.value.getBoundingClientRect();let h=window.innerWidth,z=window.innerHeight,s=p.value.offsetHeight,d=p.value.offsetWidth,e=n.left+n.width/2+i,t=n.top+n.height/2+l,u=n.height/2+8;const[$,f]=r.placement.split("-",2);switch($){case"bottom":t=l+z-s-u-8<t?t-u-s:t+u,f===void 0&&(e-=d/2);break;case"top":t=l+s+u+8>t?t+u:t-u-s,f===void 0&&(e-=d/2);break;case"left":e-d-n.width/2-8<0?e+n.width/2+8+d<h?(e=e+n.width/2+8,t=t-s/2):(t=l+s+u+8>t?t+u:t-u-s,e=e+n.width/2<h?e+n.width/2-d:e-d/2):(e=e-d-n.width/2-8,t=t-s/2);break;case"right":e+n.width/2+8+d>h?e-d-n.width/2-8>0?(e=e-d-n.width/2-8,t=t-s/2):(t=l+s+u+8>t?t+u:t-u-s,e=e-n.width/2):(e=e+n.width/2+8,t=t-s/2);break}switch(f){case"left":e=i+h-8>e-n.width/2+d?e-n.width/2:e-d+n.width/2;break;case"right":e=8<e+n.width/2-d?e-d+n.width/2:e-n.width/2;break}e<0&&(e=0),t<0&&(t=0),y.value={position:"absolute",top:`${t}px`,left:`${e}px`,maxWidth:r.maxWidth>0?`${r.maxWidth}px`:""}},{flush:"post"});const M=()=>{r.trigger==="click"&&(a.value=!a.value)},k=()=>{r.trigger==="hover"&&(a.value=!a.value)},S=()=>{r.trigger==="context"&&(a.value=!a.value)},m=()=>{a.value&&c.value++,c.value>99&&(c.value=1)};x({handleResize:m});const v=l=>{r.trigger!=="none"&&!l.target.closest(`[id="${E}"]`)&&w.value&&!w.value.contains(l.target)&&(a.value=!1)};return o.onMounted(()=>{window.addEventListener("resize",m),document.documentElement.ontouchstart!==void 0?document.documentElement.addEventListener("touchstart",v,!0):document.documentElement.addEventListener("click",v,!0),window.onscrollend!==void 0?window.addEventListener("scrollend",m):window.addEventListener("scroll",m)}),o.onUnmounted(()=>{b.disconnect(),window.removeEventListener("resize",m),document.documentElement.ontouchstart!==void 0?document.documentElement.removeEventListener("touchstart",v):document.documentElement.removeEventListener("click",v),window.onscrollend!==void 0?window.removeEventListener("scrollend",m):window.removeEventListener("scroll",m)}),(l,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(L.value),onClick:i[0]||(i[0]=n=>M()),onMouseover:i[1]||(i[1]=o.withModifiers(n=>k(),["stop"])),onMouseleave:i[2]||(i[2]=o.withModifiers(n=>k(),["stop"])),onContextmenu:i[3]||(i[3]=o.withModifiers(n=>S(),["stop"])),ref_key:"dropdownRef",ref:w},[o.renderSlot(l.$slots,"default"),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[a.value?(o.openBlock(),o.createElementBlock("ul",{key:0,ref_key:"popupRef",ref:p,id:o.unref(E),class:o.normalizeClass(["sw-dropdown-popup",r.class]),style:o.normalizeStyle(y.value),tabindex:"-1"},[o.renderSlot(l.$slots,"dropdown")],14,B)):o.createCommentVNode("",!0)]))],34))}};exports.default=C;
@@ -0,0 +1,111 @@
1
+ import { mergeModels as V, useModel as _, ref as h, computed as H, watchEffect as O, createElementBlock as z, onMounted as N, onUnmounted as A, openBlock as g, withModifiers as y, normalizeClass as M, renderSlot as S, createBlock as D, Teleport as G, createCommentVNode as U, normalizeStyle as X, unref as Y } from "vue";
2
+ const j = ["id"], F = {
3
+ __name: "SwDropdown",
4
+ props: /* @__PURE__ */ V({
5
+ class: { type: String, default: "" },
6
+ size: { type: String, default: "" },
7
+ type: { type: String, default: "" },
8
+ trigger: { type: String, default: "click" },
9
+ placement: { type: String, default: "bottom-left" },
10
+ maxWidth: { type: Number, default: 0 }
11
+ }, {
12
+ modelValue: {},
13
+ modelModifiers: {}
14
+ }),
15
+ emits: ["update:modelValue"],
16
+ setup(E, { expose: $ }) {
17
+ const i = E, u = _(E, "modelValue"), m = h(null), w = h(null), b = h({}), k = Math.ceil(Math.random() * 1e3), a = h(0), W = H(
18
+ () => {
19
+ let n = ["sw-dropdown"];
20
+ return i.size.length > 0 && n.push("sw-" + i.size), i.type.length > 0 && n.push("sw-" + i.type), n;
21
+ }
22
+ ), x = new ResizeObserver(() => {
23
+ u.value && a.value++, a.value > 99 && (a.value = 1);
24
+ });
25
+ O(
26
+ () => {
27
+ if (!u.value || !w.value || !m.value)
28
+ return;
29
+ a.value < 2 && x.observe(w.value);
30
+ let n = window.pageYOffset || document.documentElement.scrollTop, d = window.pageXOffset || document.documentElement.scrollLeft;
31
+ document.body.style.position = "fixed", document.body.style.top = `-${n}px`, document.body.style.left = `-${d}px`, document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.documentElement.scrollTop = n, document.documentElement.scrollLeft = d;
32
+ const o = m.value.getBoundingClientRect();
33
+ let v = window.innerWidth, B = window.innerHeight, s = w.value.offsetHeight, l = w.value.offsetWidth, e = o.left + o.width / 2 + d, t = o.top + o.height / 2 + n, r = o.height / 2 + 8;
34
+ const [T, f] = i.placement.split("-", 2);
35
+ switch (T) {
36
+ case "bottom":
37
+ t = n + B - s - r - 8 < t ? t - r - s : t + r, f === void 0 && (e -= l / 2);
38
+ break;
39
+ case "top":
40
+ t = n + s + r + 8 > t ? t + r : t - r - s, f === void 0 && (e -= l / 2);
41
+ break;
42
+ case "left":
43
+ e - l - o.width / 2 - 8 < 0 ? e + o.width / 2 + 8 + l < v ? (e = e + o.width / 2 + 8, t = t - s / 2) : (t = n + s + r + 8 > t ? t + r : t - r - s, e = e + o.width / 2 < v ? e + o.width / 2 - l : e - l / 2) : (e = e - l - o.width / 2 - 8, t = t - s / 2);
44
+ break;
45
+ case "right":
46
+ e + o.width / 2 + 8 + l > v ? e - l - o.width / 2 - 8 > 0 ? (e = e - l - o.width / 2 - 8, t = t - s / 2) : (t = n + s + r + 8 > t ? t + r : t - r - s, e = e - o.width / 2) : (e = e + o.width / 2 + 8, t = t - s / 2);
47
+ break;
48
+ }
49
+ switch (f) {
50
+ case "left":
51
+ e = d + v - 8 > e - o.width / 2 + l ? e - o.width / 2 : e - l + o.width / 2;
52
+ break;
53
+ case "right":
54
+ e = 8 < e + o.width / 2 - l ? e - l + o.width / 2 : e - o.width / 2;
55
+ break;
56
+ }
57
+ e < 0 && (e = 0), t < 0 && (t = 0), b.value = {
58
+ position: "absolute",
59
+ top: `${t}px`,
60
+ left: `${e}px`,
61
+ maxWidth: i.maxWidth > 0 ? `${i.maxWidth}px` : ""
62
+ };
63
+ },
64
+ { flush: "post" }
65
+ );
66
+ const C = () => {
67
+ i.trigger === "click" && (u.value = !u.value);
68
+ }, L = () => {
69
+ i.trigger === "hover" && (u.value = !u.value);
70
+ }, R = () => {
71
+ i.trigger === "context" && (u.value = !u.value);
72
+ }, c = () => {
73
+ u.value && a.value++, a.value > 99 && (a.value = 1);
74
+ };
75
+ $({ handleResize: c });
76
+ const p = (n) => {
77
+ i.trigger !== "none" && !n.target.closest(`[id="${k}"]`) && m.value && !m.value.contains(n.target) && (u.value = !1);
78
+ };
79
+ return N(() => {
80
+ window.addEventListener("resize", c), document.documentElement.ontouchstart !== void 0 ? document.documentElement.addEventListener("touchstart", p, !0) : document.documentElement.addEventListener("click", p, !0), window.onscrollend !== void 0 ? window.addEventListener("scrollend", c) : window.addEventListener("scroll", c);
81
+ }), A(() => {
82
+ x.disconnect(), window.removeEventListener("resize", c), document.documentElement.ontouchstart !== void 0 ? document.documentElement.removeEventListener("touchstart", p) : document.documentElement.removeEventListener("click", p), window.onscrollend !== void 0 ? window.removeEventListener("scrollend", c) : window.removeEventListener("scroll", c);
83
+ }), (n, d) => (g(), z("div", {
84
+ class: M(W.value),
85
+ onClick: d[0] || (d[0] = (o) => C()),
86
+ onMouseover: d[1] || (d[1] = y((o) => L(), ["stop"])),
87
+ onMouseleave: d[2] || (d[2] = y((o) => L(), ["stop"])),
88
+ onContextmenu: d[3] || (d[3] = y((o) => R(), ["stop"])),
89
+ ref_key: "dropdownRef",
90
+ ref: m
91
+ }, [
92
+ S(n.$slots, "default"),
93
+ (g(), D(G, { to: "body" }, [
94
+ u.value ? (g(), z("ul", {
95
+ key: 0,
96
+ ref_key: "popupRef",
97
+ ref: w,
98
+ id: Y(k),
99
+ class: M(["sw-dropdown-popup", i.class]),
100
+ style: X(b.value),
101
+ tabindex: "-1"
102
+ }, [
103
+ S(n.$slots, "dropdown")
104
+ ], 14, j)) : U("", !0)
105
+ ]))
106
+ ], 34));
107
+ }
108
+ };
109
+ export {
110
+ F as default
111
+ };
@@ -0,0 +1,31 @@
1
+ import { computed as n, createElementBlock as r, openBlock as l, normalizeClass as a, createBlock as c, createCommentVNode as p, renderSlot as i } from "vue";
2
+ import { g as u } from "./VacationTable-GeJlpGuk.js";
3
+ const g = {
4
+ __name: "SwDropdownItem",
5
+ props: {
6
+ class: { type: String, default: "" },
7
+ size: { type: String, default: "" },
8
+ type: { type: String, default: "" },
9
+ iconBefore: { type: String, default: "" }
10
+ },
11
+ setup(o) {
12
+ const e = o, s = n(
13
+ () => {
14
+ let t = ["sw-dropdown-item"];
15
+ return e.size.length > 0 && t.push("sw-" + e.size), e.type.length > 0 && t.push("sw-" + e.type), e.class.length > 0 && t.push(e.class), t;
16
+ }
17
+ );
18
+ return (t, d) => (l(), r("li", {
19
+ class: a(s.value)
20
+ }, [
21
+ o.iconBefore.length > 0 ? (l(), c(u, {
22
+ key: 0,
23
+ "icon-class": o.iconBefore
24
+ }, null, 8, ["icon-class"])) : p("", !0),
25
+ i(t.$slots, "default")
26
+ ], 2));
27
+ }
28
+ };
29
+ export {
30
+ g as default
31
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./VacationTable-3jJUSDHf.cjs"),r={__name:"SwDropdownItem",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},iconBefore:{type:String,default:""}},setup(o){const t=o,n=e.computed(()=>{let l=["sw-dropdown-item"];return t.size.length>0&&l.push("sw-"+t.size),t.type.length>0&&l.push("sw-"+t.type),t.class.length>0&&l.push(t.class),l});return(l,c)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(n.value)},[o.iconBefore.length>0?(e.openBlock(),e.createBlock(s.g,{key:0,"icon-class":o.iconBefore},null,8,["icon-class"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")],2))}};exports.default=r;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),B=["id"],C={__name:"SwDropdownNew",props:o.mergeModels({class:{type:String,default:""},type:{type:String,default:""},trigger:{type:String,default:"click"},placement:{type:String,default:"bottom-left"},maxWidth:{type:Number,default:0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(h,{expose:k}){const u=h,a=o.useModel(h,"modelValue"),v=o.ref(null),p=o.ref(null),y=o.ref({}),x=Math.ceil(Math.random()*1e3),c=o.ref(0),E=o.computed(()=>{let n=["sw-dropdown"];return u.type.length>0&&n.push("sw-"+u.type),n}),g=new ResizeObserver(()=>{a.value&&c.value++,c.value>99&&(c.value=1)});o.watchEffect(()=>{if(!a.value||!p.value||!v.value)return;c.value<2&&g.observe(p.value);let n=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;document.body.style.position="fixed",document.body.style.top=`-${n}px`,document.body.style.left=`-${i}px`,document.body.style.position="",document.body.style.top="",document.body.style.left="",document.documentElement.scrollTop=n,document.documentElement.scrollLeft=i;const l=v.value.getBoundingClientRect();let m=window.innerWidth,z=window.innerHeight,r=p.value.offsetHeight,d=p.value.offsetWidth,e=l.left+l.width/2+i,t=l.top+l.height/2+n,s=l.height/2+8;const[L,f]=u.placement.split("-",2);switch(L){case"bottom":t=n+z-r-s-8<t?t-s-r:t+s,f===void 0&&(e-=d/2);break;case"top":t=n+r+s+8>t?t+s:t-s-r,f===void 0&&(e-=d/2);break;case"left":e-d-l.width/2-8<0?e+l.width/2+8+d<m?(e=e+l.width/2+8,t=t-r/2):(t=n+r+s+8>t?t+s:t-s-r,e=e+l.width/2<m?e+l.width/2-d:e-d/2):(e=e-d-l.width/2-8,t=t-r/2);break;case"right":e+l.width/2+8+d>m?e-d-l.width/2-8>0?(e=e-d-l.width/2-8,t=t-r/2):(t=n+r+s+8>t?t+s:t-s-r,e=e-l.width/2):(e=e+l.width/2+8,t=t-r/2);break}switch(f){case"left":e=i+m-8>e-l.width/2+d?e-l.width/2:e-d+l.width/2;break;case"right":e=8<e+l.width/2-d?e-d+l.width/2:e-l.width/2;break}e<0&&(e=0),t<0&&(t=0),y.value={position:"absolute",top:`${t}px`,left:`${e}px`,maxWidth:u.maxWidth>0?`${u.maxWidth}px`:""}},{flush:"post"});const M=()=>{u.trigger==="click"&&(a.value=!a.value)},b=()=>{u.trigger==="hover"&&(a.value=!a.value)},S=()=>{u.trigger==="context"&&(a.value=!a.value)},w=()=>{a.value&&c.value++,c.value>99&&(c.value=1)};return k({handleResize:w}),o.onMounted(()=>{window.addEventListener("resize",w),window.onscrollend!==void 0?window.addEventListener("scrollend",w):window.addEventListener("scroll",w)}),o.onUnmounted(()=>{g.disconnect(),window.removeEventListener("resize",w),window.onscrollend!==void 0?window.removeEventListener("scrollend",w):window.removeEventListener("scroll",w)}),(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(E.value),onClick:i[0]||(i[0]=l=>M()),onMouseover:i[1]||(i[1]=o.withModifiers(l=>b(),["stop"])),onMouseleave:i[2]||(i[2]=o.withModifiers(l=>b(),["stop"])),onContextmenu:i[3]||(i[3]=o.withModifiers(l=>S(),["stop"])),ref_key:"dropdownRef",ref:v},[o.renderSlot(n.$slots,"default"),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[a.value?(o.openBlock(),o.createElementBlock("ul",{key:0,popover:"",ref_key:"popupRef",ref:p,id:o.unref(x),class:o.normalizeClass(["sw-dropdown-popup",u.class]),style:o.normalizeStyle(y.value),tabindex:"-1"},[o.renderSlot(n.$slots,"dropdown")],14,B)):o.createCommentVNode("",!0)]))],34))}};exports.default=C;