@paperless/core 2.10.3 → 2.10.5
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/CHANGELOG.md +19 -0
- package/dist/build/{p-3c4ec52b.js → p-888bd79c.js} +1 -1
- package/dist/build/p-accordion.entry.esm.js.map +1 -1
- package/dist/build/p-calendar.entry.esm.js.map +1 -1
- package/dist/build/p-d4595315.entry.js +2 -0
- package/dist/{paperless/p-7a11522c.entry.js.map → build/p-d4595315.entry.js.map} +1 -1
- package/dist/build/p-d6d0dcf8.entry.js +2 -0
- package/dist/build/p-d6d0dcf8.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js +5 -5
- package/dist/cjs/p-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/p-accordion.entry.cjs.js.map +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js +4 -3
- package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/p-calendar.entry.cjs.js.map +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.css +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.js +4 -4
- package/dist/collection/components/molecules/accordion/accordion.component.js.map +1 -1
- package/dist/collection/components/molecules/calendar/calendar.component.css +1 -1
- package/dist/collection/components/molecules/calendar/calendar.component.js +3 -2
- package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
- package/dist/components/{p-YLVbGP5-.js → p-3tDukM8u.js} +6 -5
- package/dist/components/p-3tDukM8u.js.map +1 -0
- package/dist/components/p-accordion.js +5 -5
- package/dist/components/p-accordion.js.map +1 -1
- package/dist/components/p-calendar.js +1 -1
- package/dist/components/p-datepicker.js +1 -1
- package/dist/esm/p-accordion.entry.js +5 -5
- package/dist/esm/p-accordion.entry.js.map +1 -1
- package/dist/esm/p-calendar.entry.js +4 -3
- package/dist/esm/p-calendar.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-accordion.entry.esm.js.map +1 -1
- package/dist/paperless/p-calendar.entry.esm.js.map +1 -1
- package/dist/paperless/p-d4595315.entry.js +2 -0
- package/dist/{build/p-7a11522c.entry.js.map → paperless/p-d4595315.entry.js.map} +1 -1
- package/dist/paperless/p-d6d0dcf8.entry.js +2 -0
- package/dist/paperless/p-d6d0dcf8.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/package.json +1 -1
- package/dist/build/p-7a11522c.entry.js +0 -2
- package/dist/build/p-e2f3876d.entry.js +0 -2
- package/dist/build/p-e2f3876d.entry.js.map +0 -1
- package/dist/components/p-YLVbGP5-.js.map +0 -1
- package/dist/paperless/p-7a11522c.entry.js +0 -2
- package/dist/paperless/p-e2f3876d.entry.js +0 -2
- package/dist/paperless/p-e2f3876d.entry.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as r,h as e}from"./p-Dpmiv2da.js";import{c as a}from"./p-CBWjHURv.js";import{c as i}from"./p-CT54OXR2.js";import{b as o}from"./p-BIwGgs9f.js";import{T as s}from"./p-C1iNEsnH.js";import{r as n,t as h,c as d,o as c,p as m,n as p,x as l,y as u,q as f,u as w,l as y,v as g,w as b}from"./p-EKSDxqjG.js";import"./p-ChV9xqsO.js";function v(t,r){n(2,arguments);var e=h(t);var a=d(r);if(isNaN(a)){return new Date(NaN)}if(!a){return e}e.setDate(e.getDate()+a);return e}function x(t,r){n(2,arguments);var e=h(t);var a=d(r);if(isNaN(a)){return new Date(NaN)}if(!a){return e}var i=e.getDate();var o=new Date(e.getTime());o.setMonth(e.getMonth()+a+1,0);var s=o.getDate();if(i>=s){return o}else{e.setFullYear(o.getFullYear(),o.getMonth(),i);return e}}function k(t,r){n(2,arguments);var e=d(r);return x(t,e*12)}function D(t){n(1,arguments);var r=h(t);var e=r.getMonth();r.setFullYear(r.getFullYear(),e+1,0);r.setHours(23,59,59,999);return r}function _(t){n(1,arguments);var r=h(t);var e=r.getDay();return e}function M(t){n(1,arguments);var r=h(t);var e=r.getFullYear();var a=r.getMonth();var i=new Date(0);i.setFullYear(e,a+1,0);i.setHours(0,0,0,0);return i.getDate()}function j(t){n(1,arguments);return h(t).getFullYear()}function C(t,r){n(2,arguments);var e=h(t);var a=h(r);return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function N(t,r){n(2,arguments);var e=h(t);var a=h(r);return e.getFullYear()===a.getFullYear()}function A(t,r){n(2,arguments);var e=h(t);var a=d(r);var i=e.getFullYear();var o=e.getDate();var s=new Date(0);s.setFullYear(i,a,15);s.setHours(0,0,0,0);var c=M(s);e.setMonth(a,Math.min(o,c));return e}function V(t,r){n(2,arguments);var e=h(t);var a=d(r);e.setDate(a);return e}function z(t,r){n(2,arguments);var e=h(t);var a=d(r);if(isNaN(e.getTime())){return new Date(NaN)}e.setFullYear(a);return e}const E="*{box-sizing:border-box}.static{position:static!important}.col-start-1{grid-column-start:1!important}.col-start-2{grid-column-start:2!important}.col-start-3{grid-column-start:3!important}.col-start-4{grid-column-start:4!important}.col-start-5{grid-column-start:5!important}.col-start-6{grid-column-start:6!important}.col-start-7{grid-column-start:7!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.grid{display:grid!important}.h-8{height:2rem!important}.h-auto{height:auto!important}.h-full{height:100%!important}.max-h-\\[15rem\\]{max-height:15rem!important}.min-h-\\[12rem\\]{min-height:12rem!important}.min-h-\\[15rem\\]{min-height:15rem!important}.w-8{width:2rem!important}.w-\\[17\\.5rem\\]{width:17.5rem!important}.w-full{width:100%!important}.flex-1{flex:1 1 0%!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-4{gap:1rem!important}.overflow-scroll{overflow:scroll!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-off-white-700{--tw-border-opacity:1!important;border-color:rgb(222 219 213/var(--tw-border-opacity,1))!important}.border-storm-100{--tw-border-opacity:1!important;border-color:rgb(209 210 212/var(--tw-border-opacity,1))!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.text-storm-200{--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-500{color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.text-storm-500,.text-white{--tw-text-opacity:1!important}.text-white{color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.opacity-60{opacity:.6!important}.drop-shadow-2{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,2,2,.04)) drop-shadow(0 2px 2px rgba(0,2,2,.04)) drop-shadow(0 4px 4px rgba(0,2,2,.04))!important}.drop-shadow-2,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.hover\\:bg-white-600:hover{--tw-bg-opacity:1!important;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.hover\\:text-storm-500:hover{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.dark\\:border-none:where(:host([data-theme=dark]),:host([data-theme=dark]) *){border-style:none!important}.dark\\:bg-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))!important}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)!important}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-300:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1!important;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:text-white:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:border-none:where([data-theme=dark],[data-theme=dark] *){border-style:none!important}.dark\\:bg-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(163 165 169/var(--tw-bg-opacity,1))!important}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)!important}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(163 165 169/var(--tw-text-opacity,1))!important}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.dark\\:hover\\:bg-hurricane-300:hover:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1!important;background-color:rgb(116 120 127/var(--tw-bg-opacity,1))!important}.dark\\:hover\\:text-white:hover:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";const T=a(["w-[17.5rem] flex flex-col gap-4"],{variants:{variant:{default:["p-2 rounded-lg drop-shadow-2","border border-storm-100"],embedded:"p-1"}}});const R=a(["flex items-center gap-2","w-full p-2 rounded-lg","bg-off-white-300 dark:bg-white/15"],{variants:{type:{day:"justify-between",month:"justify-between",year:"justify-center"}}});const O=a(["flex flex-col gap-2","w-full"],{variants:{view:{day:"h-auto min-h-[12rem]",month:"min-h-[15rem]",year:"max-h-[15rem]"}}});const Y=class{constructor(e){t(this,e);this.valueChange=r(this,"valueChange",3)}variant="default";value;preselectToday=false;disabledDates;minDate=new Date(1970,0,1);maxDate=this._getAutomaticMax();disableWeekends=false;enableToday=true;todayText="today";mode="day";valueChange;_today=new Date;_view=this.mode;_viewDate=this._today;_value;_minDate;_maxDate;_disabledDates=[];_enableToday=true;_weekDays=Array.from(Array(7).keys());_yearItemsRef;componentWillLoad(){if(this.disabledDates){this._parseDisabledDates(this.disabledDates)}if(this.minDate){this._parseMinDate(this.minDate)}if(this.maxDate){this._parseMaxDate(this.maxDate)}this._parseValue(this.value);if(this._value){this._viewDate=this._value}if(c(this._viewDate,this._minDate)){this._viewDate=this._minDate}if(m(this._viewDate,this._maxDate)){this._viewDate=this._maxDate}this._modeChange(this.mode)}componentWillRender(){this._enableToday=this.enableToday&&this._checkTodayButton()}componentDidRender(){if(this._view==="year"){this._scrollYearIntoView()}}_parseValue(t){if(!t&&this.preselectToday){t=new Date}if(typeof t==="string"){t=new Date(t)}if(p(t)&&!l(t,this._viewDate)){this._viewDate=t}this._setValue(t)}_parseMinDate(t){if(typeof t==="string"){t=new Date(t)}if(!p(t)){return}this._minDate=t;if(c(this._viewDate,this._minDate)){this._viewDate=this._minDate}}_parseMaxDate(t){if(typeof t==="string"){t=new Date(t)}if(!p(t)){return}this._maxDate=t;if(m(this._viewDate,this._maxDate)){this._viewDate=this._maxDate}}_parseDisabledDates(t){if(typeof t==="string"){t=JSON.parse(t)}if(!t||!Array.isArray(t)){return}this._disabledDates=t.map((t=>{if(typeof t==="string"){return new Date(t)}return t})).filter((t=>p(t)))}_modeChange(t){if(t==="year"&&this._view!=="year"){this._view="year"}if(t==="month"&&this._view==="day"){this._view="month"}}render(){return e(s,{key:"3e8f512cbdb7d44b80f80d70c5c7d4b1c0933942"},e("div",{key:"34bca740dbd0e3df43899a7ba1c745dd0e121e83",class:T({variant:this.variant})},this._getView()))}_checkTodayButton(){if(this._maxDate&&m(this._today,this._maxDate)){return false}if(this._minDate&&c(this._today,this._minDate)){return false}if(this.disableWeekends&&u(this._today)){return false}if(this.mode!=="day"){return false}return true}_getView(){if(this._view==="year"){return this._getYearView()}if(this._view==="month"){return this._getMonthView()}return this._getDayView()}_getDayView(){const t=this._generateDaysInMonth();return e("div",{class:O({view:"day"})},this._getHeader("day"),e("div",{class:"grid grid-cols-7 justify-between gap-1"},this._weekDays.map((t=>e("span",{class:"w-8 text-center text-xs text-storm-200"},f(v(new Date(2022,7,1),t),o.locale==="nl"?"EEEEEE":"eee",{locale:o.locale==="nl"?w:y})))),t.map((t=>t.active?e("p-button",{variant:"primary",class:i("w-8",`col-start-${t.offset}`),onClick:()=>this._setValue(t.date)},t.day):e("time",{class:i("normal flex items-center justify-center rounded-lg","h-8 w-8 text-sm font-semibold","text-storm-300 dark:text-hurricane-200","dark:bg-white/15",{"cursor-pointer hover:bg-white-600 hover:text-storm-500 dark:hover:bg-hurricane-300 dark:hover:text-white":!t.disabled},`col-start-${t.offset}`,{"cursor-not-allowed opacity-60":t.disabled},{"border border-solid border-off-white-700 bg-off-white-300 text-storm-500 dark:border-none dark:bg-hurricane-200 dark:text-white":!t.disabled&&l(t.date,new Date)}),onClick:()=>this._setValue(t.date)},t.day)))))}_getMonthView(){const t=this._generateMonths();return e("div",{class:O({view:"month"})},this._getHeader("month"),e("div",{class:"flex flex-wrap items-start gap-2"},t.map((t=>e("p-button",{variant:t.active?"primary":"secondary",disabled:t.disabled,onClick:()=>this._setMonth(t.month)},f(A(new Date,t.month),"MMMM",{locale:o.locale==="nl"?w:y}))))))}_getYearView(){const t=this._generateYears();return e("div",{class:O({view:"year"})},this._getHeader("year"),e("div",{class:"grid h-full grid-cols-4 gap-2 overflow-scroll",ref:t=>this._yearItemsRef=t},t.map((t=>e("p-button",{class:"w-full",variant:t.active?"primary":"secondary",onClick:()=>this._setYear(t.year),"data-active":t.active,"data-current":t.current},t.year)))))}_getHeader(t="day"){let r=t=>this._changeMonth(t);let a="month";if(t==="month"||t==="year"){r=t=>this._changeYear(t);a="year"}return e("div",{class:R({type:this.mode})},this.mode!=="year"&&e("p-button",{variant:"secondary",iconOnly:true,icon:"caret",iconRotate:90,size:"sm",onClick:()=>r(-1),disabled:!this._canSetAmount(a,-1)||this._view==="year"}),e("div",{class:i("flex gap-2",{"flex-1":this._enableToday})},this.mode!=="year"&&e("p-button",{variant:"secondary",size:"sm",onClick:()=>this._changeView("month"),disabled:!this._canChangeView("month"),active:this._view==="month"&&this.mode!=="month"},f(this._viewDate,"MMMM",{locale:o.locale==="nl"?w:y})),e("p-button",{variant:"secondary",size:"sm",onClick:()=>this._changeView("year"),disabled:!this._canChangeView("year"),active:this._view==="year"&&this.mode!=="year"},j(this._viewDate)),this._enableToday&&e("p-tooltip",{class:"ml-auto",content:this.todayText},e("p-button",{variant:"secondary",size:"sm",icon:"calendar",slot:"trigger",iconOnly:true,onClick:()=>this._setToday()}))),this.mode!=="year"&&e("p-button",{variant:"secondary",iconOnly:true,icon:"caret",iconRotate:-90,size:"sm",onClick:()=>r(1),disabled:!this._canSetAmount(a,1)||this._view=="year"}))}_setYear(t){const r=z(this._viewDate,t);if(this.mode!=="year"){this._viewDate=r;this._view="month";return}this._viewDate=r;this._setValue(A(V(r,1),0))}_setMonth(t){const r=A(this._viewDate,t);if(this.mode==="day"){this._viewDate=r;this._view="day";return}this._viewDate=r;this._setValue(V(r,1))}_setToday(){this._viewDate=this._today;this._setValue(this._today);this._view="day"}_changeMonth(t=1){const r=this._canSetAmount("month",t);if(!r){return}const e=x(this._viewDate,t);this._viewDate=e}_changeYear(t=1){const r=this._canSetAmount("year",t);if(!r){return}let e=k(this._viewDate,t);this._viewDate=e}_setValue(t){if(t===null){this._value=null;this.valueChange.emit(null);return}if(!p(t)){return}if(this._isDisabledDay(t)){return}t=g(t);const r=l(t,this._value);if(r){return}this._value=t;this.valueChange.emit(t)}_generateDaysInMonth(){const t=Array.from(Array(M(this._viewDate)).keys());return t.map((t=>{t=t+1;const r=V(this._viewDate,t);const e=_(r);return{day:t,date:r,offset:t===1?e===0?7:e:false,current:l(r,this._today),active:l(r,this._value),disabled:this._isDisabledDay(r)}}))}_isDisabledDay(t){return c(t,this._minDate)&&!l(t,this._maxDate)||m(t,this._maxDate)&&!l(t,this._maxDate)||(_(t)===0||_(t)===6)&&this.disableWeekends||this._disabledDates.findIndex((r=>l(r,t)))>=0}_generateMonths(){const t=j(this._viewDate);const r=Array.from(Array(12).keys());return r.map((r=>{const e=new Date(t,r,1);return{month:r,current:C(this._today,e),active:C(this._value,e),disabled:m(e,this._maxDate)||c(D(e),this._minDate)}}))}_generateYears(){const t=j(this._maxDate)+1;const r=j(this._minDate);return Array.from(Array(t-r).keys()).map((t=>{const e=r+t;return{year:e,current:j(this._today)===e,active:j(this._value)===e}}))}_scrollYearIntoView(){const t=this._yearItemsRef;if(!t){return}const r=t.querySelector("p-button[data-active]");if(r){return t.scrollTo({top:r.offsetTop-100})}const e=t.querySelector("p-button[data-current]");if(e){return t.scrollTo({top:e.offsetTop-100})}}_changeView(t){if(!this._canChangeView(t)){return}this._view=t}_canChangeView(t){if(t==="year"){if(N(this._minDate,this._maxDate)){return false}return true}if(C(this._minDate,this._maxDate)){return false}return true}_canSetAmount(t,r=1){if(t==="month"){const t=x(this._viewDate,r);const e=b(t);if(c(e,b(this._minDate))&&!l(e,this._minDate)||m(e,D(this._maxDate))){return false}}if(t==="year"){let t=k(this._viewDate,r);const e=j(t);if(e<j(this._minDate)||e>j(this._maxDate)){return false}}return true}_getAutomaticMax(){const t=k(new Date,50);let r=j(t);r=Math.ceil(r/10)*10;return z(t,r)}static get watchers(){return{value:["_parseValue"],minDate:["_parseMinDate"],maxDate:["_parseMaxDate"],disabledDates:["_parseDisabledDates"],mode:["_modeChange"]}}};Y.style=E;export{Y as p_calendar};
|
|
2
|
-
//# sourceMappingURL=p-7a11522c.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-Dpmiv2da.js";import{c as a}from"./p-CT54OXR2.js";import"./p-ChV9xqsO.js";const o="*{box-sizing:border-box}.static{position:static!important}.my-0{margin-bottom:0!important;margin-top:0!important}.mt-4{margin-top:1rem!important}.flex{display:flex!important}.flex-1{flex:1 1 0%!important}.shrink-0{flex-shrink:0!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.whitespace-nowrap{white-space:nowrap!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.font-medium{font-weight:500!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.text-storm-500{--tw-text-opacity:1!important;color:rgb(24 30 41/var(--tw-text-opacity,1))!important}";const s=class{constructor(i){t(this,i);this.isOpen=e(this,"isOpen",3)}variant="primary";header;open=false;closeable=true;openable=true;isOpen;render(){return i(r,{key:"939cdec5ade9d5abe37c7e1abf205d40ba33f849"},i("div",{key:"0bec93367831704a1339cc148fea53878f9c5d60",class:a("flex cursor-pointer items-center gap-2",{"text-storm-500":this.variant==="primary","text-storm-300":this.variant==="secondary"}),onClick:()=>this._onClick()},i("p-icon",{key:"d74784bfb4d0f1c54326aa9dbbbc74823b43ee1d",class:"flex shrink-0",variant:"caret",rotate:this.open?0:-90}),i("p",{key:"9a2383ca8eaca8f626d78e3c69edf56d20c51c1f",class:"my-0 shrink-0 whitespace-nowrap text-base font-medium"},this.header),i("p-divider",{key:"9f63c5a1045c1bfef9fe399f9942604485c3799d",class:"flex-1"})),this.open&&i("div",{key:"869e5336f4ad06f11f02de632377a02fe34479cf",class:"mt-4"},i("slot",{key:"629b6038b0796d281356fc59e361fdaf50b997bf"})))}_onClick(){if(!this.closeable&&this.open){return}if(!this.openable&&!this.open){return}this.open=!this.open;this.isOpen.emit(this.open)}};s.style=o;export{s as p_accordion};
|
|
2
|
-
//# sourceMappingURL=p-e2f3876d.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["accordionComponentCss","Accordion","variant","header","open","closeable","openable","isOpen","render","h","Host","key","class","cn","this","onClick","_onClick","rotate","emit"],"sources":["src/components/molecules/accordion/accordion.component.css?tag=p-accordion&encapsulation=shadow","src/components/molecules/accordion/accordion.component.tsx"],"sourcesContent":[null,"import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport { cn } from '../../../utils';\n\n@Component({\n\ttag: 'p-accordion',\n\tstyleUrl: 'accordion.component.css',\n\tshadow: true,\n})\nexport class Accordion {\n\t/**\n\t * The variant of the accordion\n\t */\n\t@Prop() variant: 'primary' | 'secondary' = 'primary';\n\n\t/**\n\t * Header of the accordion\n\t */\n\t@Prop() header!: string;\n\n\t/**\n\t * Wether the accordion is open\n\t */\n\t@Prop() open: boolean = false;\n\n\t/**\n\t * Wether the accordion can be closed\n\t */\n\t@Prop() closeable: boolean = true;\n\n\t/**\n\t * Wether the accordion can be opened\n\t */\n\t@Prop() openable: boolean = true;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<div\n\t\t\t\t\tclass={cn('flex cursor-pointer items-center gap-2', {\n\t\t\t\t\t\t'text-storm-500': this.variant === 'primary',\n\t\t\t\t\t\t'text-storm-300': this.variant === 'secondary',\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={() => this._onClick()}\n\t\t\t\t>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\tclass='flex shrink-0'\n\t\t\t\t\t\tvariant='caret'\n\t\t\t\t\t\trotate={this.open ? 0 : -90}\n\t\t\t\t\t/>\n\t\t\t\t\t<p class='my-0 shrink-0 whitespace-nowrap text-base font-medium'>\n\t\t\t\t\t\t{this.header}\n\t\t\t\t\t</p>\n\t\t\t\t\t<p-divider class='flex-1' />\n\t\t\t\t</div>\n\t\t\t\t{this.open && (\n\t\t\t\t\t<div class='mt-4'>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _onClick() {\n\t\tif (!this.closeable && this.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.openable && !this.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.open = !this.open;\n\t\tthis.isOpen.emit(this.open);\n\t}\n}\n"],"mappings":"qHAAA,MAAMA,EAAwB,qsB,MCQjBC,EAAS,M,wDAIbC,QAAmC,UAKnCC,OAKAC,KAAgB,MAKhBC,UAAqB,KAKrBC,SAAoB,KAQ5BC,OAEA,MAAAC,GACC,OACCC,EAACC,EAAI,CAAAC,IAAA,4CACJF,EAAA,OAAAE,IAAA,2CACCC,MAAOC,EAAG,yCAA0C,CACnD,iBAAkBC,KAAKZ,UAAY,UACnC,iBAAkBY,KAAKZ,UAAY,cAEpCa,QAAS,IAAMD,KAAKE,YAEpBP,EACC,UAAAE,IAAA,2CAAAC,MAAM,gBACNV,QAAQ,QACRe,OAAQH,KAAKV,KAAO,GAAI,KAEzBK,EAAA,KAAAE,IAAA,2CAAGC,MAAM,yDACPE,KAAKX,QAEPM,EAAA,aAAAE,IAAA,2CAAWC,MAAM,YAEjBE,KAAKV,MACLK,EAAK,OAAAE,IAAA,2CAAAC,MAAM,QACVH,EAAA,QAAAE,IAAA,8C,CAOG,QAAAK,GACP,IAAKF,KAAKT,WAAaS,KAAKV,KAAM,CACjC,M,CAGD,IAAKU,KAAKR,WAAaQ,KAAKV,KAAM,CACjC,M,CAGDU,KAAKV,MAAQU,KAAKV,KAClBU,KAAKP,OAAOW,KAAKJ,KAAKV,K","ignoreList":[]}
|