@pequity/squirrel 1.0.20-beta.1 → 1.0.20-beta.3
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/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
- package/dist/cjs/chunks/p-action-bar.js +60 -1
- package/dist/cjs/chunks/p-card.js +28 -1
- package/dist/cjs/chunks/p-checkbox.js +24 -1
- package/dist/cjs/chunks/p-dropdown-select.js +414 -1
- package/dist/cjs/chunks/p-input-percent.js +53 -1
- package/dist/cjs/chunks/p-pagination-info.js +66 -1
- package/dist/cjs/chunks/p-pagination.js +122 -1
- package/dist/cjs/chunks/p-ring-loader.js +81 -1
- package/dist/cjs/chunks/p-select-btn.js +97 -1
- package/dist/cjs/chunks/p-select.js +123 -1
- package/dist/cjs/chunks/p-table-loader.js +70 -1
- package/dist/cjs/chunks/p-tabs.js +52 -1
- package/dist/cjs/config.js +105 -1
- package/dist/cjs/currency.js +9 -1
- package/dist/cjs/dom.js +27 -1
- package/dist/cjs/index.js +976 -1
- package/dist/cjs/inputClassesMixin.js +50 -1
- package/dist/cjs/inputClassesShared.js +76 -1
- package/dist/cjs/listKeyboardNavigation.js +110 -1
- package/dist/cjs/number.js +9 -1
- package/dist/cjs/object.js +4 -1
- package/dist/cjs/p-action-bar.js +3 -1
- package/dist/cjs/p-alert.js +65 -1
- package/dist/cjs/p-avatar.js +71 -1
- package/dist/cjs/p-btn.js +358 -2
- package/dist/cjs/p-card.js +3 -1
- package/dist/cjs/p-checkbox.js +3 -1
- package/dist/cjs/p-chips.js +110 -1
- package/dist/cjs/p-close-btn.js +36 -1
- package/dist/cjs/p-date-picker.js +139 -1
- package/dist/cjs/p-drawer.js +253 -1
- package/dist/cjs/p-dropdown-select.js +3 -1
- package/dist/cjs/p-dropdown.js +138 -1
- package/dist/cjs/p-file-upload.js +21 -1
- package/dist/cjs/p-info-icon.js +35 -1
- package/dist/cjs/p-inline-date-picker.js +142 -1
- package/dist/cjs/p-input-number.js +146 -1
- package/dist/cjs/p-input-percent.js +3 -1
- package/dist/cjs/p-input-search.js +110 -1
- package/dist/cjs/p-input.js +89 -1
- package/dist/cjs/p-loading.js +38 -1
- package/dist/cjs/p-modal.js +369 -1
- package/dist/cjs/p-pagination-info.js +3 -1
- package/dist/cjs/p-pagination.js +3 -1
- package/dist/cjs/p-progress-bar.js +41 -1
- package/dist/cjs/p-ring-loader.js +3 -1
- package/dist/cjs/p-select-btn.js +3 -1
- package/dist/cjs/p-select-list.js +4 -1
- package/dist/cjs/p-select-pill.js +111 -1
- package/dist/cjs/p-select.js +3 -1
- package/dist/cjs/p-skeleton-loader.js +73 -1
- package/dist/cjs/p-table-filter-icon.js +20 -1
- package/dist/cjs/p-table-header-cell.js +75 -1
- package/dist/cjs/p-table-loader.js +3 -1
- package/dist/cjs/p-table-sort.js +8 -1
- package/dist/cjs/p-table-td.js +88 -1
- package/dist/cjs/p-table.js +12 -1
- package/dist/cjs/p-tabs.js +3 -1
- package/dist/cjs/p-textarea.js +73 -1
- package/dist/cjs/p-toggle.js +114 -1
- package/dist/cjs/pagination.js +29 -1
- package/dist/cjs/string.js +12 -1
- package/dist/cjs/tailwind.js +4353 -1
- package/dist/cjs/text.js +16 -1
- package/dist/cjs/useInputClasses.js +44 -1
- package/dist/cjs/usePLoading.js +35 -1
- package/dist/cjs/usePModal.js +21 -1
- package/dist/cjs/usePTableColResize.js +81 -1
- package/dist/cjs/usePTableRowVirtualizer.js +31 -1
- package/dist/cjs/useSelectList.js +256 -1
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
- package/dist/es/chunks/p-action-bar.js +45 -36
- package/dist/es/chunks/p-card.js +18 -14
- package/dist/es/chunks/p-checkbox.js +14 -11
- package/dist/es/chunks/p-dropdown-select.js +232 -183
- package/dist/es/chunks/p-input-percent.js +34 -25
- package/dist/es/chunks/p-pagination-info.js +30 -24
- package/dist/es/chunks/p-pagination.js +78 -48
- package/dist/es/chunks/p-ring-loader.js +63 -40
- package/dist/es/chunks/p-select-btn.js +80 -59
- package/dist/es/chunks/p-select.js +81 -54
- package/dist/es/chunks/p-table-loader.js +46 -32
- package/dist/es/chunks/p-tabs.js +35 -29
- package/dist/es/config.js +2 -2
- package/dist/es/currency.js +3 -3
- package/dist/es/dom.js +24 -12
- package/dist/es/index.js +703 -519
- package/dist/es/inputClassesMixin.js +20 -14
- package/dist/es/inputClassesShared.js +60 -45
- package/dist/es/listKeyboardNavigation.js +86 -36
- package/dist/es/number.js +7 -2
- package/dist/es/object.js +2 -2
- package/dist/es/p-action-bar.js +2 -2
- package/dist/es/p-alert.js +35 -30
- package/dist/es/p-avatar.js +30 -27
- package/dist/es/p-btn.js +209 -164
- package/dist/es/p-card.js +2 -2
- package/dist/es/p-checkbox.js +2 -2
- package/dist/es/p-chips.js +60 -40
- package/dist/es/p-close-btn.js +20 -16
- package/dist/es/p-date-picker.js +66 -58
- package/dist/es/p-drawer.js +108 -89
- package/dist/es/p-dropdown-select.js +2 -2
- package/dist/es/p-dropdown.js +52 -33
- package/dist/es/p-file-upload.js +17 -9
- package/dist/es/p-info-icon.js +21 -16
- package/dist/es/p-inline-date-picker.js +64 -53
- package/dist/es/p-input-number.js +84 -66
- package/dist/es/p-input-percent.js +2 -2
- package/dist/es/p-input-search.js +43 -41
- package/dist/es/p-input.js +51 -45
- package/dist/es/p-loading.js +31 -22
- package/dist/es/p-modal.js +261 -174
- package/dist/es/p-pagination-info.js +2 -2
- package/dist/es/p-pagination.js +2 -2
- package/dist/es/p-progress-bar.js +26 -23
- package/dist/es/p-ring-loader.js +2 -2
- package/dist/es/p-select-btn.js +2 -2
- package/dist/es/p-select-list.js +2 -2
- package/dist/es/p-select-pill.js +58 -41
- package/dist/es/p-select.js +2 -2
- package/dist/es/p-skeleton-loader.js +34 -29
- package/dist/es/p-table-filter-icon.js +11 -11
- package/dist/es/p-table-header-cell.js +38 -33
- package/dist/es/p-table-loader.js +2 -2
- package/dist/es/p-table-sort.js +2 -2
- package/dist/es/p-table-td.js +76 -29
- package/dist/es/p-table.js +10 -6
- package/dist/es/p-tabs.js +2 -2
- package/dist/es/p-textarea.js +36 -34
- package/dist/es/p-toggle.js +53 -48
- package/dist/es/pagination.js +25 -8
- package/dist/es/string.js +10 -2
- package/dist/es/tailwind.js +1660 -1101
- package/dist/es/text.js +13 -8
- package/dist/es/useInputClasses.js +38 -22
- package/dist/es/usePLoading.js +31 -15
- package/dist/es/usePModal.js +15 -12
- package/dist/es/usePTableColResize.js +71 -39
- package/dist/es/usePTableRowVirtualizer.js +24 -15
- package/dist/es/useSelectList.js +234 -121
- package/dist/style.css +2124 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1,976 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("./chunks/p-action-bar.js"),le=require("./p-alert.js"),oe=require("./p-avatar.js"),re=require("./p-btn.js"),se=require("./chunks/p-card.js"),ie=require("./chunks/p-checkbox.js"),ne=require("./p-chips.js"),ae=require("./p-close-btn.js"),ce=require("./p-date-picker.js"),ue=require("./p-drawer.js"),de=require("./p-dropdown.js"),j=require("./chunks/p-dropdown-select.js"),e=require("vue"),z=require("./p-file-upload.js"),G=require("lodash-es"),Y=require("./useInputClasses.js"),pe=require("vue-toastification"),L=require("./chunks/_plugin-vue_export-helper.js"),me=require("./p-table-filter-icon.js"),fe=require("./p-info-icon.js"),ge=require("./p-inline-date-picker.js"),ve=require("./p-input.js"),he=require("./p-input-number.js"),Ce=require("./chunks/p-input-percent.js"),K=require("./p-input-search.js"),ye=require("./p-loading.js"),Se=require("./p-modal.js"),be=require("./chunks/p-pagination.js"),ke=require("./chunks/p-pagination-info.js"),_e=require("./p-progress-bar.js"),Ee=require("./chunks/p-ring-loader.js"),Be=require("./chunks/p-select.js"),Ve=require("./chunks/p-select-btn.js"),R=require("./p-select-list.js"),H=require("./text.js"),q=require("./string.js"),Z=require("./useSelectList.js"),xe=require("./p-select-pill.js"),Ne=require("./p-skeleton-loader.js"),W=require("./p-table-header-cell.js"),y=require("./p-table.js"),U=require("./usePTableColResize.js"),Pe=require("./chunks/p-table-loader.js"),I=require("./p-table-sort.js"),Te=require("./p-table-td.js"),we=require("./chunks/p-tabs.js"),ze=require("./p-textarea.js"),Ie=require("./p-toggle.js"),$e=require("./usePLoading.js"),Fe=require("./usePModal.js"),Re=require("./usePTableRowVirtualizer.js"),qe="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8335%206.25016L10.0002%202.0835L14.1668%206.25016'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M10%202.0835V13.7502'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M2.91675%2015V18.3333H17.0834V15'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3c/svg%3e",Le="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M33%2012H14V44H42V21L33%2012Z'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M9%2036H6V4H25L28%207'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M37%2030H19M28%2021V39'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3c/svg%3e",J=t=>(e.pushScopeId("data-v-d07a8f64"),t=t(),e.popScopeId(),t),Me=["data-has-error"],De={key:0,class:"flex h-28 flex-col items-center justify-center"},Oe={key:0,class:"flex flex-col items-center"},Ae=J(()=>e.createElementVNode("img",{src:qe,class:"h-8 w-8"},null,-1)),He={class:"mt-2 text-p-gray-50"},je={class:"text-p-blue-60"},Ge={key:1,class:"flex flex-col items-center"},Ye=J(()=>e.createElementVNode("img",{src:Le,class:"h-8 w-8"},null,-1)),Ke={class:"mt-2 text-p-purple-60"},Ze=["accept","multiple","disabled"],We={class:"max-h-48 overflow-y-auto overflow-x-hidden"},Ue=["title"],Je=["onClick"],Qe={class:"mt-1 text-xs text-p-gray-40"},Xe=e.defineComponent({name:"PFileUpload",__name:"p-file-upload",props:{modelValue:{type:[Object,Array],default:()=>[]},multiple:{type:Boolean,default:!1},fileTypes:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},errorMsg:{type:String,default:""},label:{type:String,default:""},maxSizeInBytes:{type:Number,default:256*1e3},maxNumberOfFiles:{type:Number,default:10}},emits:["update:modelValue","file-removed","file-added"],setup(t,{emit:v}){const n=t,u=v,p=e.shallowRef(),m=e.ref(!1),f=pe.useToast(),{labelClasses:E,errorMsgClasses:x}=Y.useInputClasses(n),S=e.computed(()=>n.multiple?"files":"file"),c=e.computed({get(){return Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]},set(s){n.multiple?u("update:modelValue",s):u("update:modelValue",s[0])}}),k=e.computed(()=>n.fileTypes.length>0?G.uniq(n.fileTypes).join(","):void 0),B=e.computed(()=>n.multiple?c.value.length>=n.maxNumberOfFiles:c.value.length>=1),V=s=>{const o=[];for(let r=0;r<s.length;r++){const i=s[r],h=i.name||i.url;if(o.length+c.value.length>=n.maxNumberOfFiles){f.error(`You can only upload a maximum of ${n.maxNumberOfFiles} ${S.value}.`);break}if(h){if(i.url){o.push(i);continue}if(n.fileTypes.length!==0){const N=z.getFileExtension(h)?`.${z.getFileExtension(h)}`:"";if(!(N?n.fileTypes.includes(N):!1)){f.error(`${N} files are not allowed.`);continue}}if((i.size||0)>n.maxSizeInBytes){f.error(`File size of ${h} exceeds ${z.formatBytes(n.maxSizeInBytes)}.`);continue}o.push(i)}}return o},_=s=>{var i,h;const o=((i=s.target)==null?void 0:i.files)||((h=s.dataTransfer)==null?void 0:h.files);if(!o)return;const r=n.fileTypes?V(Array.from(o)):o;c.value=n.multiple?[...c.value,...r]:r,u("file-added",r)},C=s=>{_(s),p.value&&(p.value.value="")},l=s=>{if(s in c.value){const o=c.value[s];c.value=c.value.filter((r,i)=>i!==s),u("file-removed",o)}},b=s=>{m.value=!1,C(s)},g=()=>{p.value&&p.value.click()};return e.onMounted(()=>{Array.isArray(c.value)&&c.value.length>0&&(c.value=V(c.value))}),(s,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{hidden:s.$attrs.hidden}]),"data-has-error":!!t.errorMsg},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(e.unref(E))},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex w-full flex-col rounded border bg-surface p-4",[{"cursor-pointer":!B.value},{"border-dashed":!m.value},{"border-primary ring-1 ring-primary":m.value&&!t.errorMsg},t.errorMsg?"border-on-error":"border-p-gray-40 hover:border-primary",{"pointer-events-none opacity-50":t.disabled}]]),"aria-label":"dropzone",onDragover:o[1]||(o[1]=e.withModifiers(r=>m.value=!0,["prevent","stop"])),onDragleave:o[2]||(o[2]=e.withModifiers(r=>m.value=!1,["prevent","stop"])),onDrop:e.withModifiers(b,["prevent","stop"]),onClick:g},[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,[m.value?(e.openBlock(),e.createElementBlock("div",Ge,[Ye,e.createElementVNode("div",Ke,"Drop "+e.toDisplayString(S.value),1)])):(e.openBlock(),e.createElementBlock("div",Oe,[Ae,e.createElementVNode("div",He,[e.createTextVNode(" Drag or "),e.createElementVNode("span",je,"select "+e.toDisplayString(S.value),1)])])),e.createElementVNode("input",{ref_key:"fileInputRef",ref:p,type:"file",class:"hidden",tabindex:-1,accept:k.value,multiple:t.multiple,disabled:t.disabled,"aria-hidden":"true",onChange:C},null,40,Ze)])),e.createElementVNode("div",We,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(r,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["flex cursor-default items-center justify-between",{"border-b border-dashed border-p-gray-30 pb-4":i!==c.value.length-1},{"mt-4":i!==0}]),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"truncate",title:r.name},e.toDisplayString(r.name),9,Ue),e.createElementVNode("button",{class:"bg-file-upload-x-icon h-4 w-4 shrink-0 cursor-pointer",onClick:e.withModifiers(h=>l(i),["stop"])},null,8,Je)],2))),128))])],34),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(x))},e.toDisplayString(t.errorMsg),3),[[e.vShow,t.errorMsg]]),e.createElementVNode("div",Qe,e.toDisplayString(t.multiple?`Max ${t.maxNumberOfFiles}`:"One")+" "+e.toDisplayString(k.value)+" "+e.toDisplayString(t.multiple?"files":"file")+" with size less than "+e.toDisplayString(e.unref(z.formatBytes)(t.maxSizeInBytes))+" "+e.toDisplayString(t.multiple?"each":""),1)],10,Me))}}),et=L._export_sfc(Xe,[["__scopeId","data-v-d07a8f64"]]),tt=["data-has-error"],lt={class:"text-p-purple-60"},ot={class:"flex flex-row"},rt=e.createElementVNode("span",{class:"px-1 leading-none"},".",-1),st=["onClick"],it=["title"],nt={key:0,class:"ml-auto fill-p-purple-60 pl-2",src:j._imports_0},at=e.defineComponent({name:"PSelectList",inheritAttrs:!1,__name:"p-select-list",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:null},valueIsObject:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},label:{type:String,default:""},errorMsg:{type:String,default:""},required:{type:Boolean,default:!1},size:{type:String,default:"md",validator(t){return Object.keys(R.SIZES).includes(t)}},itemText:{type:String,default:"text"},itemValue:{type:[String,Number],default:"value"},itemSize:{type:Number,default:null},itemsVisible:{type:Number,default:7},searchable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:""},placeholderSearch:{type:String,default:""},selectedTopShown:{type:Boolean,default:!1},topSectionClass:{type:String,default:""},closePopperOnSelect:{type:Boolean,default:!0}},emits:["update:modelValue","select"],setup(t,{emit:v}){const n=v,u=t,p=e.ref({paddingTop:0,paddingBottom:0}),m=e.ref({maxHeight:"none"}),f=e.ref(null),E=e.ref(null),{labelClasses:x,errorMsgClasses:S}=Y.useInputClasses(u),c=e.useAttrs(),k=e.ref(null),{LIST_ITEM_CLASS:B,LIST_ITEM_ACTIVE_CLASS:V,selectedItems:_,computedItems:C,computedItemSize:l,computedInsideSelected:b,internalItems:g,search:s,rowVirtualizer:o,getValue:r,getText:i,isSelected:h,setupNavigationSvc:N,select:M,onFocus:$,onMousemove:D,scrollToActiveItem:Q,putSelectedItemsOnTop:X,selectAll:P,clearAll:O}=Z.useSelectList(u,f,k,n),ee=e.computed(()=>c.style);return e.onMounted(async()=>{var d,w;const T=((d=E.value)==null?void 0:d.clientHeight)||0;m.value={maxHeight:`${l.value*u.itemsVisible-T}px`},X(),u.searchable?(w=f.value)==null||w.$el.querySelector("input").focus():N(),Q({wait:200})}),(T,d)=>{const w=e.resolveDirective("close-popper");return e.openBlock(),e.createElementBlock("div",{ref:"formControl",class:e.normalizeClass([{hidden:e.unref(c).hidden},e.unref(c).class]),"data-has-error":!!t.errorMsg,style:e.normalizeStyle(ee.value),"p-select-list":""},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(e.unref(x))},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"border border-on-error":!!t.errorMsg},e.unref(c).disabled?"pointer-events-none bg-p-gray-10":"bg-white"])},[t.multiple||t.searchable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.topSectionClass)},[t.multiple?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"actionsContainer",ref:E,class:"flex flex-row justify-between text-xs font-semibold text-primary"},[e.createElementVNode("p",lt,e.toDisplayString(e.unref(C).length)+" items",1),e.createElementVNode("div",ot,[e.unref(C).length===e.unref(g).length?(e.openBlock(),e.createElementBlock("a",{key:0,class:e.normalizeClass([e.unref(_).length!==e.unref(g).length?"cursor-pointer":"pointer-events-none opacity-50"]),onClick:d[0]||(d[0]=(...a)=>e.unref(P)&&e.unref(P)(...a))}," Select all ",2)):(e.openBlock(),e.createElementBlock("a",{key:1,class:e.normalizeClass([e.unref(b)?"pointer-events-none opacity-50":"cursor-pointer"]),onClick:d[1]||(d[1]=(...a)=>e.unref(P)&&e.unref(P)(...a))}," Select all filtered ",2)),rt,e.createElementVNode("a",{class:e.normalizeClass([e.unref(_).length?"cursor-pointer":"pointer-events-none opacity-50"]),onClick:d[2]||(d[2]=(...a)=>e.unref(O)&&e.unref(O)(...a))}," Clear all ",2)])],512)):e.createCommentVNode("",!0),t.searchable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([{"mt-3":t.multiple}])},[e.createVNode(K,{ref_key:"inputSearch",ref:f,modelValue:e.unref(s),"onUpdate:modelValue":d[3]||(d[3]=a=>e.isRef(s)?s.value=a:null),size:t.size,placeholder:t.placeholderSearch,onFocus:e.unref($)},null,8,["modelValue","size","placeholder","onFocus"])],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"virtualizerRef",ref:k,style:e.normalizeStyle(m.value),class:e.normalizeClass(["overflow-y-auto",{"mt-3":t.multiple||t.searchable}])},[e.createElementVNode("div",{tabindex:"-1",class:"relative w-full","p-select-list-options":"",style:e.normalizeStyle({height:`${e.unref(o).getTotalSize()}px`}),onFocus:d[4]||(d[4]=(...a)=>e.unref($)&&e.unref($)(...a)),onMousemove:d[5]||(d[5]=(...a)=>e.unref(D)&&e.unref(D)(...a))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).getVirtualItems(),a=>(e.openBlock(),e.createElementBlock("div",{key:a.index,class:"absolute left-0 top-0 w-full","p-select-list-option":"",style:e.normalizeStyle({height:`${a.size}px`,transform:`translateY(${a.start}px)`})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(B),{[e.unref(V)]:e.unref(h)(e.unref(r)(a.index))}]),"p-select-list-option-item":"",style:e.normalizeStyle(p.value),onClick:F=>e.unref(M)(F,e.unref(r)(a.index))},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center",{[e.unref(R.SIZES)[t.size]]:!t.itemSize}])},[e.renderSlot(T.$slots,"item",{item:e.unref(C)[a.index],isItemSelected:e.unref(h)(e.unref(r)(a.index)),itemTextSplit:e.unref(H.splitStringForHighlight)(e.unref(q.toString)(e.unref(i)(a.index)),e.unref(s))},()=>[e.createElementVNode("div",{class:"truncate text-p-purple-60",title:e.unref(q.toString)(e.unref(i)(a.index))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(H.splitStringForHighlight)(e.unref(q.toString)(e.unref(i)(a.index)),e.unref(s)),(F,A)=>(e.openBlock(),e.createElementBlock("span",{key:`${e.unref(r)(a.index)}_${A}`,class:e.normalizeClass({"bg-p-blue-20":A===1})},e.toDisplayString(F),3))),128))],8,it)]),e.unref(h)(e.unref(r)(a.index))?(e.openBlock(),e.createElementBlock("img",nt)):e.createCommentVNode("",!0)],2)],14,st)),[[w,t.closePopperOnSelect&&!t.multiple]])],4))),128))],36),e.unref(C).length?e.createCommentVNode("",!0):e.renderSlot(T.$slots,"no-items",{key:0},()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-center",e.unref(R.SIZES)[t.size]])},"No items found",2)])],6)],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(S))},e.toDisplayString(t.errorMsg),3),[[e.vShow,t.errorMsg]])],14,tt)}}}),ct=["data-col-id"],ut={class:"flex"},dt=["onMousedown","onDblclick"],pt={key:0,class:"min-w-[80px] bg-gradient-to-r from-white via-p-gray-10 to-p-gray-10"},mt={key:0},ft={key:1},gt=e.defineComponent({name:"PTable",__name:"p-table",props:{cols:{},colsResizable:{type:Boolean,default:!1},isFirstColFixed:{type:Boolean,default:!1},isLastColFixed:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!1},virtualizer:{default:()=>({paddingTop:0,paddingBottom:0})}},emits:["scroll","click-filter-icon","col-resize"],setup(t,{emit:v}){const n=v,u=t;e.provide(y.colsInjectionKey,e.computed(()=>u.cols)),e.provide(y.isFirstColFixedInjectionKey,e.computed(()=>u.isFirstColFixed)),e.provide(y.isLastColFixedInjectionKey,e.computed(()=>u.isLastColFixed)),e.provide(y.isColsResizableInjectionKey,e.computed(()=>u.colsResizable));const p=e.ref(null),m=e.ref([]),{isColResizing:f,colResizeHandleLeft:E,colResizingIndex:x,colResizingWidth:S,colResize:c,colResizeStart:k,colResizeFitToData:B}=U.usePTableColResize({enabled:e.computed(()=>u.colsResizable),ths:m}),V=(l,b)=>{l instanceof Element&&(m.value[b]=l)},_=l=>{n("scroll",l)},C=(l,b)=>{const g=["relative","py-2"];return b.borderColor||g.push("border-b border-p-gray-30"),l===0&&u.isFirstColFixed||l===u.cols.length-1&&u.isLastColFixed?g.push("th-shadow px-4"):u.colsResizable?g.push("pl-2 pr-4"):g.push("px-2"),g};return e.onMounted(()=>{var l;(l=p.value)==null||l.addEventListener("scroll",_,!0)}),e.onBeforeUnmount(()=>{var l;(l=p.value)==null||l.removeEventListener("scroll",_,!0)}),e.watch(f,l=>{l===!1&&S.value>0&&n("col-resize",x.value,S.value)}),(l,b)=>{var g,s;return e.openBlock(),e.createElementBlock("div",{ref_key:"scrollWrapper",ref:p,class:e.normalizeClass(["block border border-p-gray-30",l.lockScroll?"overflow-hidden":"overflow-x-auto"])},[e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[100] w-1 cursor-col-resize bg-p-gray-30",style:e.normalizeStyle({top:`${(g=p.value)==null?void 0:g.offsetTop}px`,left:e.unref(E),height:`${(s=p.value)==null?void 0:s.offsetHeight}px`}),"data-resize-y-axis":""},null,4)):e.createCommentVNode("",!0),e.createElementVNode("table",e.mergeProps({class:["p-table mb-0 w-full bg-surface",{"last-col-fixed":l.isLastColFixed},{"first-col-fixed":l.isFirstColFixed}]},e.toHandlers(l.colsResizable?{mousemove:e.unref(c)}:{},!0)),[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.cols,(o,r)=>(e.openBlock(),e.createElementBlock("th",e.mergeProps({ref_for:!0,ref:i=>V(i,r),key:o.id,"data-col-id":o.id},o.thAttrs,{style:o.style,class:"bg-surface"}),[e.createElementVNode("div",{class:e.normalizeClass(C(r,o))},[e.createElementVNode("div",ut,[e.renderSlot(l.$slots,`prepend-header-cell-${e.unref(G.kebabCase)(o.name)}`,{col:o},void 0,!0),e.createVNode(W,e.mergeProps({text:o.title,"filter-active":o.filterActive,"show-filter-icon":o.filterable||o.sortable,"tooltip-text":o.tooltip,class:[{"pl-2":r===1&&l.isFirstColFixed,"pr-2":r===l.cols.length&&l.isLastColFixed},"grow"]},o.headerCellAttrs,{onClickFilterIcon:i=>l.$emit("click-filter-icon",i,o)}),null,16,["text","filter-active","show-filter-icon","tooltip-text","class","onClickFilterIcon"])]),l.colsResizable&&r!==0&&!(r===l.cols.length-1&&l.isLastColFixed)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute bottom-0 right-0 h-full w-2 cursor-col-resize after:absolute after:bottom-2 after:z-20 after:block after:h-5 after:w-px after:cursor-col-resize after:bg-p-gray-30",r===l.cols.length-1?" after:right-0":" after:right-1"]),"data-resize-handle":"",onMousedown:i=>e.unref(k)(i,r),onDblclick:i=>e.unref(B)(r)},null,42,dt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["absolute bottom-0 h-1 w-full",l.colsResizable?"-left-1":"left-0"]),style:e.normalizeStyle({background:o.borderColor})},null,6)],2)],16,ct))),128)),l.colsResizable&&!l.isLastColFixed?(e.openBlock(),e.createElementBlock("th",pt)):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",null,[l.virtualizer.paddingTop>0?(e.openBlock(),e.createElementBlock("tr",mt,[e.createElementVNode("td",{style:e.normalizeStyle({height:`${l.virtualizer.paddingTop}px`})},null,4)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},void 0,!0),l.virtualizer.paddingBottom>0?(e.openBlock(),e.createElementBlock("tr",ft,[e.createElementVNode("td",{style:e.normalizeStyle({height:`${l.virtualizer.paddingBottom}px`})},null,4)])):e.createCommentVNode("",!0)])],16)],2)}}}),vt=L._export_sfc(gt,[["__scopeId","data-v-170d774b"]]),ht=e.defineComponent({name:"PTableSort",props:{modelValue:{type:String,default:I.SORTING_TYPES.NO_SORTING,validator(t){return Object.values(I.SORTING_TYPES).includes(t)}}},emits:["update:modelValue"],data(){return{SORTING_TYPES:I.SORTING_TYPES}}}),Ct="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75838)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75838'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",yt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80096)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80096'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",St="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75842)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75842'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",bt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80100)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80100'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",kt={class:"flex items-center justify-between"},_t=e.createElementVNode("div",{class:"px-4 text-xs font-semibold text-p-gray-40"},"SORT",-1),Et={class:"mt-2"},Bt={key:0,src:Ct},Vt={key:1,src:yt},xt={key:0,src:St},Nt={key:1,src:bt};function Pt(t,v,n,u,p,m){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",kt,[_t,e.createElementVNode("div",{class:e.normalizeClass(["px-4 text-xs font-semibold text-primary",[t.SORTING_TYPES.ASC,t.SORTING_TYPES.DESC].includes(t.modelValue)?"cursor-pointer opacity-100":"opacity-50"]),onClick:v[0]||(v[0]=f=>t.$emit("update:modelValue",t.SORTING_TYPES.NO_SORTING))}," Clear ",2)]),e.createElementVNode("div",Et,[e.createElementVNode("div",{class:"flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",onClick:v[1]||(v[1]=f=>t.$emit("update:modelValue",t.SORTING_TYPES.ASC))},[e.createElementVNode("div",{class:e.normalizeClass(["text-sm font-semibold text-p-purple-60",{"text-primary":t.modelValue===t.SORTING_TYPES.ASC}])}," Sort ascending ",2),e.createElementVNode("div",null,[t.modelValue===t.SORTING_TYPES.NO_SORTING||t.modelValue===t.SORTING_TYPES.DESC?(e.openBlock(),e.createElementBlock("img",Bt)):(e.openBlock(),e.createElementBlock("img",Vt))])]),e.createElementVNode("div",{class:"flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",onClick:v[2]||(v[2]=f=>t.$emit("update:modelValue",t.SORTING_TYPES.DESC))},[e.createElementVNode("div",{class:e.normalizeClass(["text-sm font-semibold text-p-purple-60",{"text-primary":t.modelValue===t.SORTING_TYPES.DESC}])}," Sort descending ",2),e.createElementVNode("div",null,[t.modelValue===t.SORTING_TYPES.NO_SORTING||t.modelValue===t.SORTING_TYPES.ASC?(e.openBlock(),e.createElementBlock("img",xt)):(e.openBlock(),e.createElementBlock("img",Nt))])])])])}const Tt=L._export_sfc(ht,[["render",Pt]]);exports.PActionBar=te._sfc_main;exports.PAlert=le;exports.PAvatar=oe;exports.PBtn=re;exports.PCard=se._sfc_main;exports.PCheckbox=ie._sfc_main;exports.PChips=ne;exports.PCloseBtn=ae;exports.PDatePicker=ce;exports.PDrawer=ue;exports.PDropdown=de;exports.PDropdownSelect=j._sfc_main;exports.PFilterIcon=me;exports.PInfoIcon=fe;exports.PInlineDatePicker=ge;exports.PInput=ve;exports.PInputNumber=he;exports.PInputPercent=Ce._sfc_main;exports.PInputSearch=K;exports.PLoading=ye;exports.PModal=Se;exports.PPagination=be._sfc_main;exports.PPaginationInfo=ke._sfc_main;exports.PProgressBar=_e;exports.PRingLoader=Ee._sfc_main;exports.PSelect=Be._sfc_main;exports.PSelectBtn=Ve._sfc_main;exports.useSelectList=Z.useSelectList;exports.PSelectPill=xe;exports.PSkeletonLoader=Ne;exports.PTableHeaderCell=W;exports.MIN_WIDTH_COL_RESIZE=y.MIN_WIDTH_COL_RESIZE;exports.colsInjectionKey=y.colsInjectionKey;exports.isColsResizableInjectionKey=y.isColsResizableInjectionKey;exports.isFirstColFixedInjectionKey=y.isFirstColFixedInjectionKey;exports.isLastColFixedInjectionKey=y.isLastColFixedInjectionKey;exports.usePTableColResize=U.usePTableColResize;exports.PTableLoader=Pe._sfc_main;exports.SORTING_TYPES=I.SORTING_TYPES;exports.PTableTd=Te;exports.PTabs=we._sfc_main;exports.PTextarea=ze;exports.PToggle=Ie;exports.usePLoading=$e.usePLoading;exports.usePModal=Fe.usePModal;exports.usePTableRowVirtualizer=Re.usePTableRowVirtualizer;exports.PFileUpload=et;exports.PSelectList=at;exports.PTable=vt;exports.PTableSort=Tt;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const config = require("./config.js");
|
|
4
|
+
const pActionBar_vue_vue_type_script_setup_true_lang = require("./chunks/p-action-bar.js");
|
|
5
|
+
const pAlert = require("./p-alert.js");
|
|
6
|
+
const pAvatar = require("./p-avatar.js");
|
|
7
|
+
const pBtn = require("./p-btn.js");
|
|
8
|
+
const pCard_vue_vue_type_script_setup_true_lang = require("./chunks/p-card.js");
|
|
9
|
+
const pCheckbox_vue_vue_type_script_setup_true_lang = require("./chunks/p-checkbox.js");
|
|
10
|
+
const pChips = require("./p-chips.js");
|
|
11
|
+
const pCloseBtn = require("./p-close-btn.js");
|
|
12
|
+
const pDatePicker = require("./p-date-picker.js");
|
|
13
|
+
const pDrawer = require("./p-drawer.js");
|
|
14
|
+
const pDropdown = require("./p-dropdown.js");
|
|
15
|
+
const pDropdownSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-dropdown-select.js");
|
|
16
|
+
const vue = require("vue");
|
|
17
|
+
const pFileUpload$1 = require("./p-file-upload.js");
|
|
18
|
+
const lodashEs = require("lodash-es");
|
|
19
|
+
const useInputClasses = require("./useInputClasses.js");
|
|
20
|
+
const vueToastification = require("vue-toastification");
|
|
21
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
22
|
+
const pTableFilterIcon = require("./p-table-filter-icon.js");
|
|
23
|
+
const pInfoIcon = require("./p-info-icon.js");
|
|
24
|
+
const pInlineDatePicker = require("./p-inline-date-picker.js");
|
|
25
|
+
const pInput = require("./p-input.js");
|
|
26
|
+
const pInputNumber = require("./p-input-number.js");
|
|
27
|
+
const pInputPercent_vue_vue_type_script_setup_true_lang = require("./chunks/p-input-percent.js");
|
|
28
|
+
const pInputSearch = require("./p-input-search.js");
|
|
29
|
+
const pLoading = require("./p-loading.js");
|
|
30
|
+
const pModal = require("./p-modal.js");
|
|
31
|
+
const pPagination_vue_vue_type_script_setup_true_lang = require("./chunks/p-pagination.js");
|
|
32
|
+
const pPaginationInfo_vue_vue_type_script_setup_true_lang = require("./chunks/p-pagination-info.js");
|
|
33
|
+
const pProgressBar = require("./p-progress-bar.js");
|
|
34
|
+
const pRingLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-ring-loader.js");
|
|
35
|
+
const pSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-select.js");
|
|
36
|
+
const pSelectBtn_vue_vue_type_script_setup_true_lang = require("./chunks/p-select-btn.js");
|
|
37
|
+
const pSelectList = require("./p-select-list.js");
|
|
38
|
+
const text = require("./text.js");
|
|
39
|
+
const string = require("./string.js");
|
|
40
|
+
const useSelectList = require("./useSelectList.js");
|
|
41
|
+
const pSelectPill = require("./p-select-pill.js");
|
|
42
|
+
const pSkeletonLoader = require("./p-skeleton-loader.js");
|
|
43
|
+
const pTableHeaderCell = require("./p-table-header-cell.js");
|
|
44
|
+
const pTable$1 = require("./p-table.js");
|
|
45
|
+
const usePTableColResize = require("./usePTableColResize.js");
|
|
46
|
+
const pTableLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-table-loader.js");
|
|
47
|
+
const pTableSort$1 = require("./p-table-sort.js");
|
|
48
|
+
const pTableTd = require("./p-table-td.js");
|
|
49
|
+
const pTabs_vue_vue_type_script_setup_true_lang = require("./chunks/p-tabs.js");
|
|
50
|
+
const pTextarea = require("./p-textarea.js");
|
|
51
|
+
const pToggle = require("./p-toggle.js");
|
|
52
|
+
const usePLoading = require("./usePLoading.js");
|
|
53
|
+
const usePModal = require("./usePModal.js");
|
|
54
|
+
const usePTableRowVirtualizer = require("./usePTableRowVirtualizer.js");
|
|
55
|
+
const inputClassesMixin = require("./inputClassesMixin.js");
|
|
56
|
+
const currency = require("./currency.js");
|
|
57
|
+
const tailwind = require("./tailwind.js");
|
|
58
|
+
const inputClassesShared = require("./inputClassesShared.js");
|
|
59
|
+
const pagination = require("./pagination.js");
|
|
60
|
+
const dom = require("./dom.js");
|
|
61
|
+
const object = require("./object.js");
|
|
62
|
+
const listKeyboardNavigation = require("./listKeyboardNavigation.js");
|
|
63
|
+
const number = require("./number.js");
|
|
64
|
+
const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8335%206.25016L10.0002%202.0835L14.1668%206.25016'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M10%202.0835V13.7502'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M2.91675%2015V18.3333H17.0834V15'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3c/svg%3e";
|
|
65
|
+
const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M33%2012H14V44H42V21L33%2012Z'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M9%2036H6V4H25L28%207'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M37%2030H19M28%2021V39'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3c/svg%3e";
|
|
66
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-d07a8f64"), n = n(), vue.popScopeId(), n);
|
|
67
|
+
const _hoisted_1$3 = ["data-has-error"];
|
|
68
|
+
const _hoisted_2$3 = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "flex h-28 flex-col items-center justify-center"
|
|
71
|
+
};
|
|
72
|
+
const _hoisted_3$3 = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "flex flex-col items-center"
|
|
75
|
+
};
|
|
76
|
+
const _hoisted_4$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("img", {
|
|
77
|
+
src: _imports_0$1,
|
|
78
|
+
class: "h-8 w-8"
|
|
79
|
+
}, null, -1));
|
|
80
|
+
const _hoisted_5$3 = { class: "mt-2 text-p-gray-50" };
|
|
81
|
+
const _hoisted_6$3 = { class: "text-p-blue-60" };
|
|
82
|
+
const _hoisted_7$2 = {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: "flex flex-col items-center"
|
|
85
|
+
};
|
|
86
|
+
const _hoisted_8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("img", {
|
|
87
|
+
src: _imports_1$1,
|
|
88
|
+
class: "h-8 w-8"
|
|
89
|
+
}, null, -1));
|
|
90
|
+
const _hoisted_9 = { class: "mt-2 text-p-purple-60" };
|
|
91
|
+
const _hoisted_10 = ["accept", "multiple", "disabled"];
|
|
92
|
+
const _hoisted_11 = { class: "max-h-48 overflow-y-auto overflow-x-hidden" };
|
|
93
|
+
const _hoisted_12 = ["title"];
|
|
94
|
+
const _hoisted_13 = ["onClick"];
|
|
95
|
+
const _hoisted_14 = { class: "mt-1 text-xs text-p-gray-40" };
|
|
96
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
97
|
+
...{
|
|
98
|
+
name: "PFileUpload"
|
|
99
|
+
},
|
|
100
|
+
__name: "p-file-upload",
|
|
101
|
+
props: {
|
|
102
|
+
modelValue: {
|
|
103
|
+
type: [Object, Array],
|
|
104
|
+
default: () => []
|
|
105
|
+
},
|
|
106
|
+
multiple: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Array of file extensions to accept. If empty, all file types are accepted.
|
|
112
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
|
|
113
|
+
*/
|
|
114
|
+
fileTypes: {
|
|
115
|
+
type: Array,
|
|
116
|
+
default: () => []
|
|
117
|
+
},
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false
|
|
121
|
+
},
|
|
122
|
+
required: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
errorMsg: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: ""
|
|
129
|
+
},
|
|
130
|
+
label: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: ""
|
|
133
|
+
},
|
|
134
|
+
maxSizeInBytes: {
|
|
135
|
+
type: Number,
|
|
136
|
+
default: 256 * 1e3
|
|
137
|
+
// 256 KB
|
|
138
|
+
},
|
|
139
|
+
maxNumberOfFiles: {
|
|
140
|
+
type: Number,
|
|
141
|
+
default: 10
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
emits: ["update:modelValue", "file-removed", "file-added"],
|
|
145
|
+
setup(__props, { emit: __emit }) {
|
|
146
|
+
const props = __props;
|
|
147
|
+
const emit = __emit;
|
|
148
|
+
const fileInputRef = vue.shallowRef();
|
|
149
|
+
const isDraggingOver = vue.ref(false);
|
|
150
|
+
const toast = vueToastification.useToast();
|
|
151
|
+
const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
|
|
152
|
+
const fileWord = vue.computed(() => props.multiple ? "files" : "file");
|
|
153
|
+
const files = vue.computed({
|
|
154
|
+
get() {
|
|
155
|
+
return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
156
|
+
},
|
|
157
|
+
set(files2) {
|
|
158
|
+
if (props.multiple) {
|
|
159
|
+
emit("update:modelValue", files2);
|
|
160
|
+
} else {
|
|
161
|
+
emit("update:modelValue", files2[0]);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const acceptFileTypes = vue.computed(() => {
|
|
166
|
+
return props.fileTypes.length > 0 ? lodashEs.uniq(props.fileTypes).join(",") : void 0;
|
|
167
|
+
});
|
|
168
|
+
const maxFilesReached = vue.computed(() => {
|
|
169
|
+
return props.multiple ? files.value.length >= props.maxNumberOfFiles : files.value.length >= 1;
|
|
170
|
+
});
|
|
171
|
+
const validateFiles = (filesToUpload) => {
|
|
172
|
+
const res = [];
|
|
173
|
+
for (let i = 0; i < filesToUpload.length; i++) {
|
|
174
|
+
const file = filesToUpload[i];
|
|
175
|
+
const fileName = file.name || file.url;
|
|
176
|
+
if (res.length + files.value.length >= props.maxNumberOfFiles) {
|
|
177
|
+
toast.error(`You can only upload a maximum of ${props.maxNumberOfFiles} ${fileWord.value}.`);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
if (!fileName) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (file.url) {
|
|
184
|
+
res.push(file);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (props.fileTypes.length === 0)
|
|
188
|
+
;
|
|
189
|
+
else {
|
|
190
|
+
const extension = pFileUpload$1.getFileExtension(fileName) ? `.${pFileUpload$1.getFileExtension(fileName)}` : "";
|
|
191
|
+
const isValidExtension = extension ? props.fileTypes.includes(extension) : false;
|
|
192
|
+
if (!isValidExtension) {
|
|
193
|
+
toast.error(`${extension} files are not allowed.`);
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if ((file.size || 0) > props.maxSizeInBytes) {
|
|
198
|
+
toast.error(`File size of ${fileName} exceeds ${pFileUpload$1.formatBytes(props.maxSizeInBytes)}.`);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
res.push(file);
|
|
202
|
+
}
|
|
203
|
+
return res;
|
|
204
|
+
};
|
|
205
|
+
const uploadFile = (e) => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const f = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
|
|
208
|
+
if (!f) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const validatedFiles = props.fileTypes ? validateFiles(Array.from(f)) : f;
|
|
212
|
+
files.value = props.multiple ? [...files.value, ...validatedFiles] : validatedFiles;
|
|
213
|
+
emit("file-added", validatedFiles);
|
|
214
|
+
};
|
|
215
|
+
const changeFieldValue = (e) => {
|
|
216
|
+
uploadFile(e);
|
|
217
|
+
if (fileInputRef.value) {
|
|
218
|
+
fileInputRef.value.value = "";
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const removeFile = (index) => {
|
|
222
|
+
if (index in files.value) {
|
|
223
|
+
const removedFile = files.value[index];
|
|
224
|
+
files.value = files.value.filter((item, idx) => idx !== index);
|
|
225
|
+
emit("file-removed", removedFile);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const onDrop = (e) => {
|
|
229
|
+
isDraggingOver.value = false;
|
|
230
|
+
changeFieldValue(e);
|
|
231
|
+
};
|
|
232
|
+
const openFileDialog = () => {
|
|
233
|
+
if (fileInputRef.value) {
|
|
234
|
+
fileInputRef.value.click();
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
vue.onMounted(() => {
|
|
238
|
+
if (Array.isArray(files.value) && files.value.length > 0) {
|
|
239
|
+
files.value = validateFiles(files.value);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return (_ctx, _cache) => {
|
|
243
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
244
|
+
class: vue.normalizeClass([{ hidden: _ctx.$attrs.hidden }]),
|
|
245
|
+
"data-has-error": !!__props.errorMsg
|
|
246
|
+
}, [
|
|
247
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: vue.normalizeClass(vue.unref(labelClasses))
|
|
250
|
+
}, vue.toDisplayString(__props.label), 3)) : vue.createCommentVNode("", true),
|
|
251
|
+
vue.createElementVNode("div", {
|
|
252
|
+
class: vue.normalizeClass(["flex w-full flex-col rounded border bg-surface p-4", [
|
|
253
|
+
{ "cursor-pointer": !maxFilesReached.value },
|
|
254
|
+
{ "border-dashed": !isDraggingOver.value },
|
|
255
|
+
{ "border-primary ring-1 ring-primary": isDraggingOver.value && !__props.errorMsg },
|
|
256
|
+
__props.errorMsg ? "border-on-error" : "border-p-gray-40 hover:border-primary",
|
|
257
|
+
{ "pointer-events-none opacity-50": __props.disabled }
|
|
258
|
+
]]),
|
|
259
|
+
"aria-label": "dropzone",
|
|
260
|
+
onDragover: _cache[1] || (_cache[1] = vue.withModifiers(($event) => isDraggingOver.value = true, ["prevent", "stop"])),
|
|
261
|
+
onDragleave: _cache[2] || (_cache[2] = vue.withModifiers(($event) => isDraggingOver.value = false, ["prevent", "stop"])),
|
|
262
|
+
onDrop: vue.withModifiers(onDrop, ["prevent", "stop"]),
|
|
263
|
+
onClick: openFileDialog
|
|
264
|
+
}, [
|
|
265
|
+
!maxFilesReached.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
|
|
266
|
+
!isDraggingOver.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
|
|
267
|
+
_hoisted_4$3,
|
|
268
|
+
vue.createElementVNode("div", _hoisted_5$3, [
|
|
269
|
+
vue.createTextVNode(" Drag or "),
|
|
270
|
+
vue.createElementVNode("span", _hoisted_6$3, "select " + vue.toDisplayString(fileWord.value), 1)
|
|
271
|
+
])
|
|
272
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
|
|
273
|
+
_hoisted_8,
|
|
274
|
+
vue.createElementVNode("div", _hoisted_9, "Drop " + vue.toDisplayString(fileWord.value), 1)
|
|
275
|
+
])),
|
|
276
|
+
vue.createElementVNode("input", {
|
|
277
|
+
ref_key: "fileInputRef",
|
|
278
|
+
ref: fileInputRef,
|
|
279
|
+
type: "file",
|
|
280
|
+
class: "hidden",
|
|
281
|
+
tabindex: -1,
|
|
282
|
+
accept: acceptFileTypes.value,
|
|
283
|
+
multiple: __props.multiple,
|
|
284
|
+
disabled: __props.disabled,
|
|
285
|
+
"aria-hidden": "true",
|
|
286
|
+
onChange: changeFieldValue
|
|
287
|
+
}, null, 40, _hoisted_10)
|
|
288
|
+
])) : vue.createCommentVNode("", true),
|
|
289
|
+
vue.createElementVNode("div", _hoisted_11, [
|
|
290
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(files.value, (file, index) => {
|
|
291
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
292
|
+
key: index,
|
|
293
|
+
class: vue.normalizeClass([
|
|
294
|
+
"flex cursor-default items-center justify-between",
|
|
295
|
+
{ "border-b border-dashed border-p-gray-30 pb-4": index !== files.value.length - 1 },
|
|
296
|
+
{ "mt-4": index !== 0 }
|
|
297
|
+
]),
|
|
298
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
299
|
+
}, ["stop"]))
|
|
300
|
+
}, [
|
|
301
|
+
vue.createElementVNode("div", {
|
|
302
|
+
class: "truncate",
|
|
303
|
+
title: file.name
|
|
304
|
+
}, vue.toDisplayString(file.name), 9, _hoisted_12),
|
|
305
|
+
vue.createElementVNode("button", {
|
|
306
|
+
class: "bg-file-upload-x-icon h-4 w-4 shrink-0 cursor-pointer",
|
|
307
|
+
onClick: vue.withModifiers(($event) => removeFile(index), ["stop"])
|
|
308
|
+
}, null, 8, _hoisted_13)
|
|
309
|
+
], 2);
|
|
310
|
+
}), 128))
|
|
311
|
+
])
|
|
312
|
+
], 34),
|
|
313
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
314
|
+
class: vue.normalizeClass(vue.unref(errorMsgClasses))
|
|
315
|
+
}, vue.toDisplayString(__props.errorMsg), 3), [
|
|
316
|
+
[vue.vShow, __props.errorMsg]
|
|
317
|
+
]),
|
|
318
|
+
vue.createElementVNode("div", _hoisted_14, vue.toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + vue.toDisplayString(acceptFileTypes.value) + " " + vue.toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + vue.toDisplayString(vue.unref(pFileUpload$1.formatBytes)(__props.maxSizeInBytes)) + " " + vue.toDisplayString(__props.multiple ? "each" : ""), 1)
|
|
319
|
+
], 10, _hoisted_1$3);
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
const pFileUpload = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$3, [["__scopeId", "data-v-d07a8f64"]]);
|
|
324
|
+
const _hoisted_1$2 = ["data-has-error"];
|
|
325
|
+
const _hoisted_2$2 = { class: "text-p-purple-60" };
|
|
326
|
+
const _hoisted_3$2 = { class: "flex flex-row" };
|
|
327
|
+
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "px-1 leading-none" }, ".", -1);
|
|
328
|
+
const _hoisted_5$2 = ["onClick"];
|
|
329
|
+
const _hoisted_6$2 = ["title"];
|
|
330
|
+
const _hoisted_7$1 = {
|
|
331
|
+
key: 0,
|
|
332
|
+
class: "ml-auto fill-p-purple-60 pl-2",
|
|
333
|
+
src: pDropdownSelect_vue_vue_type_script_setup_true_lang._imports_0
|
|
334
|
+
};
|
|
335
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
336
|
+
...{
|
|
337
|
+
name: "PSelectList",
|
|
338
|
+
inheritAttrs: false
|
|
339
|
+
},
|
|
340
|
+
__name: "p-select-list",
|
|
341
|
+
props: {
|
|
342
|
+
modelValue: {
|
|
343
|
+
type: [String, Number, Boolean, Array, Object],
|
|
344
|
+
default: null
|
|
345
|
+
},
|
|
346
|
+
/**
|
|
347
|
+
* `p-select-list v-model normally works with a string or an array of strings (for multiple mode).
|
|
348
|
+
* Setting this prop to `true` will switch the behavior to an object (or array of objects) for the v-model value.
|
|
349
|
+
* e.g `:value="{ value: 1, text: 'option text' }"`
|
|
350
|
+
*/
|
|
351
|
+
valueIsObject: {
|
|
352
|
+
type: Boolean,
|
|
353
|
+
default: false
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* Can be an array of objects or array of strings. When using objects, will look for a text - value pair.
|
|
357
|
+
* This can be changed using the item-text, item-value props.
|
|
358
|
+
*/
|
|
359
|
+
items: {
|
|
360
|
+
type: Array,
|
|
361
|
+
default: () => []
|
|
362
|
+
},
|
|
363
|
+
label: {
|
|
364
|
+
type: String,
|
|
365
|
+
default: ""
|
|
366
|
+
},
|
|
367
|
+
errorMsg: {
|
|
368
|
+
type: String,
|
|
369
|
+
default: ""
|
|
370
|
+
},
|
|
371
|
+
required: {
|
|
372
|
+
type: Boolean,
|
|
373
|
+
default: false
|
|
374
|
+
},
|
|
375
|
+
size: {
|
|
376
|
+
type: String,
|
|
377
|
+
default: "md",
|
|
378
|
+
validator(value) {
|
|
379
|
+
return Object.keys(pSelectList.SIZES).includes(value);
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* Set property of **items**’s text value
|
|
384
|
+
*/
|
|
385
|
+
itemText: {
|
|
386
|
+
type: String,
|
|
387
|
+
default: "text"
|
|
388
|
+
},
|
|
389
|
+
/**
|
|
390
|
+
* Set property of **items**’s value - must be primitive.
|
|
391
|
+
*/
|
|
392
|
+
itemValue: {
|
|
393
|
+
type: [String, Number],
|
|
394
|
+
default: "value"
|
|
395
|
+
},
|
|
396
|
+
/**
|
|
397
|
+
* itemSize sets the list item's height and it's REQUIRED if a custom item template is used
|
|
398
|
+
* https://github.com/Akryum/vue-virtual-scroller/tree/v1/packages/vue-virtual-scroller#props
|
|
399
|
+
*/
|
|
400
|
+
itemSize: {
|
|
401
|
+
type: Number,
|
|
402
|
+
default: null
|
|
403
|
+
},
|
|
404
|
+
/**
|
|
405
|
+
* The number of items visible in the list
|
|
406
|
+
*/
|
|
407
|
+
itemsVisible: {
|
|
408
|
+
type: Number,
|
|
409
|
+
default: 7
|
|
410
|
+
},
|
|
411
|
+
searchable: {
|
|
412
|
+
type: Boolean,
|
|
413
|
+
default: false
|
|
414
|
+
},
|
|
415
|
+
/**
|
|
416
|
+
* Enables multiple selection
|
|
417
|
+
*/
|
|
418
|
+
multiple: {
|
|
419
|
+
type: Boolean,
|
|
420
|
+
default: false
|
|
421
|
+
},
|
|
422
|
+
/**
|
|
423
|
+
* Dropdown button text
|
|
424
|
+
*/
|
|
425
|
+
placeholder: {
|
|
426
|
+
type: String,
|
|
427
|
+
default: ""
|
|
428
|
+
},
|
|
429
|
+
/**
|
|
430
|
+
* Placeholder for the search field
|
|
431
|
+
*/
|
|
432
|
+
placeholderSearch: {
|
|
433
|
+
type: String,
|
|
434
|
+
default: ""
|
|
435
|
+
},
|
|
436
|
+
/**
|
|
437
|
+
* Setting it to `true` will display the selected options at the top of the list
|
|
438
|
+
*/
|
|
439
|
+
selectedTopShown: {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
default: false
|
|
442
|
+
},
|
|
443
|
+
topSectionClass: {
|
|
444
|
+
type: String,
|
|
445
|
+
default: ""
|
|
446
|
+
},
|
|
447
|
+
closePopperOnSelect: {
|
|
448
|
+
type: Boolean,
|
|
449
|
+
default: true
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
emits: ["update:modelValue", "select"],
|
|
453
|
+
setup(__props, { emit: __emit }) {
|
|
454
|
+
const emit = __emit;
|
|
455
|
+
const props = __props;
|
|
456
|
+
const listItemStyle = vue.ref({ paddingTop: 0, paddingBottom: 0 });
|
|
457
|
+
const scrollerStyle = vue.ref({ maxHeight: "none" });
|
|
458
|
+
const inputSearch = vue.ref(null);
|
|
459
|
+
const actionsContainer = vue.ref(null);
|
|
460
|
+
const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
|
|
461
|
+
const $attrs = vue.useAttrs();
|
|
462
|
+
const virtualizerRef = vue.ref(null);
|
|
463
|
+
const {
|
|
464
|
+
LIST_ITEM_CLASS,
|
|
465
|
+
LIST_ITEM_ACTIVE_CLASS,
|
|
466
|
+
selectedItems,
|
|
467
|
+
computedItems,
|
|
468
|
+
computedItemSize,
|
|
469
|
+
computedInsideSelected,
|
|
470
|
+
internalItems,
|
|
471
|
+
search,
|
|
472
|
+
rowVirtualizer,
|
|
473
|
+
getValue,
|
|
474
|
+
getText,
|
|
475
|
+
isSelected,
|
|
476
|
+
setupNavigationSvc,
|
|
477
|
+
select,
|
|
478
|
+
onFocus,
|
|
479
|
+
onMousemove,
|
|
480
|
+
scrollToActiveItem,
|
|
481
|
+
putSelectedItemsOnTop,
|
|
482
|
+
selectAll,
|
|
483
|
+
clearAll
|
|
484
|
+
} = useSelectList.useSelectList(props, inputSearch, virtualizerRef, emit);
|
|
485
|
+
const style = vue.computed(() => $attrs.style);
|
|
486
|
+
vue.onMounted(async () => {
|
|
487
|
+
var _a, _b;
|
|
488
|
+
const actionsContainerHeight = ((_a = actionsContainer.value) == null ? void 0 : _a.clientHeight) || 0;
|
|
489
|
+
scrollerStyle.value = { maxHeight: `${computedItemSize.value * props.itemsVisible - actionsContainerHeight}px` };
|
|
490
|
+
putSelectedItemsOnTop();
|
|
491
|
+
if (props.searchable) {
|
|
492
|
+
(_b = inputSearch.value) == null ? void 0 : _b.$el.querySelector("input").focus();
|
|
493
|
+
} else {
|
|
494
|
+
setupNavigationSvc();
|
|
495
|
+
}
|
|
496
|
+
scrollToActiveItem({ wait: 200 });
|
|
497
|
+
});
|
|
498
|
+
return (_ctx, _cache) => {
|
|
499
|
+
const _directive_close_popper = vue.resolveDirective("close-popper");
|
|
500
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
501
|
+
ref: "formControl",
|
|
502
|
+
class: vue.normalizeClass([{ hidden: vue.unref($attrs).hidden }, vue.unref($attrs).class]),
|
|
503
|
+
"data-has-error": !!__props.errorMsg,
|
|
504
|
+
style: vue.normalizeStyle(style.value),
|
|
505
|
+
"p-select-list": ""
|
|
506
|
+
}, [
|
|
507
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
508
|
+
key: 0,
|
|
509
|
+
class: vue.normalizeClass(vue.unref(labelClasses))
|
|
510
|
+
}, vue.toDisplayString(__props.label), 3)) : vue.createCommentVNode("", true),
|
|
511
|
+
vue.createElementVNode("div", {
|
|
512
|
+
class: vue.normalizeClass([
|
|
513
|
+
{ "border border-on-error": !!__props.errorMsg },
|
|
514
|
+
vue.unref($attrs).disabled ? "pointer-events-none bg-p-gray-10" : "bg-white"
|
|
515
|
+
])
|
|
516
|
+
}, [
|
|
517
|
+
__props.multiple || __props.searchable ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
518
|
+
key: 0,
|
|
519
|
+
class: vue.normalizeClass(__props.topSectionClass)
|
|
520
|
+
}, [
|
|
521
|
+
__props.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
522
|
+
key: 0,
|
|
523
|
+
ref_key: "actionsContainer",
|
|
524
|
+
ref: actionsContainer,
|
|
525
|
+
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
526
|
+
}, [
|
|
527
|
+
vue.createElementVNode("p", _hoisted_2$2, vue.toDisplayString(vue.unref(computedItems).length) + " items", 1),
|
|
528
|
+
vue.createElementVNode("div", _hoisted_3$2, [
|
|
529
|
+
vue.unref(computedItems).length === vue.unref(internalItems).length ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
530
|
+
key: 0,
|
|
531
|
+
class: vue.normalizeClass([
|
|
532
|
+
vue.unref(selectedItems).length !== vue.unref(internalItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"
|
|
533
|
+
]),
|
|
534
|
+
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
535
|
+
(...args) => vue.unref(selectAll) && vue.unref(selectAll)(...args))
|
|
536
|
+
}, " Select all ", 2)) : (vue.openBlock(), vue.createElementBlock("a", {
|
|
537
|
+
key: 1,
|
|
538
|
+
class: vue.normalizeClass([vue.unref(computedInsideSelected) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
|
|
539
|
+
onClick: _cache[1] || (_cache[1] = //@ts-ignore
|
|
540
|
+
(...args) => vue.unref(selectAll) && vue.unref(selectAll)(...args))
|
|
541
|
+
}, " Select all filtered ", 2)),
|
|
542
|
+
_hoisted_4$2,
|
|
543
|
+
vue.createElementVNode("a", {
|
|
544
|
+
class: vue.normalizeClass([vue.unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
|
|
545
|
+
onClick: _cache[2] || (_cache[2] = //@ts-ignore
|
|
546
|
+
(...args) => vue.unref(clearAll) && vue.unref(clearAll)(...args))
|
|
547
|
+
}, " Clear all ", 2)
|
|
548
|
+
])
|
|
549
|
+
], 512)) : vue.createCommentVNode("", true),
|
|
550
|
+
__props.searchable ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
551
|
+
key: 1,
|
|
552
|
+
class: vue.normalizeClass([{ "mt-3": __props.multiple }])
|
|
553
|
+
}, [
|
|
554
|
+
vue.createVNode(pInputSearch, {
|
|
555
|
+
ref_key: "inputSearch",
|
|
556
|
+
ref: inputSearch,
|
|
557
|
+
modelValue: vue.unref(search),
|
|
558
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.isRef(search) ? search.value = $event : null),
|
|
559
|
+
size: __props.size,
|
|
560
|
+
placeholder: __props.placeholderSearch,
|
|
561
|
+
onFocus: vue.unref(onFocus)
|
|
562
|
+
}, null, 8, ["modelValue", "size", "placeholder", "onFocus"])
|
|
563
|
+
], 2)) : vue.createCommentVNode("", true)
|
|
564
|
+
], 2)) : vue.createCommentVNode("", true),
|
|
565
|
+
vue.createElementVNode("div", {
|
|
566
|
+
ref_key: "virtualizerRef",
|
|
567
|
+
ref: virtualizerRef,
|
|
568
|
+
style: vue.normalizeStyle(scrollerStyle.value),
|
|
569
|
+
class: vue.normalizeClass(["overflow-y-auto", { "mt-3": __props.multiple || __props.searchable }])
|
|
570
|
+
}, [
|
|
571
|
+
vue.createElementVNode("div", {
|
|
572
|
+
tabindex: "-1",
|
|
573
|
+
class: "relative w-full",
|
|
574
|
+
"p-select-list-options": "",
|
|
575
|
+
style: vue.normalizeStyle({ height: `${vue.unref(rowVirtualizer).getTotalSize()}px` }),
|
|
576
|
+
onFocus: _cache[4] || (_cache[4] = //@ts-ignore
|
|
577
|
+
(...args) => vue.unref(onFocus) && vue.unref(onFocus)(...args)),
|
|
578
|
+
onMousemove: _cache[5] || (_cache[5] = //@ts-ignore
|
|
579
|
+
(...args) => vue.unref(onMousemove) && vue.unref(onMousemove)(...args))
|
|
580
|
+
}, [
|
|
581
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rowVirtualizer).getVirtualItems(), (row) => {
|
|
582
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
583
|
+
key: row.index,
|
|
584
|
+
class: "absolute left-0 top-0 w-full",
|
|
585
|
+
"p-select-list-option": "",
|
|
586
|
+
style: vue.normalizeStyle({ height: `${row.size}px`, transform: `translateY(${row.start}px)` })
|
|
587
|
+
}, [
|
|
588
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
589
|
+
class: vue.normalizeClass([vue.unref(LIST_ITEM_CLASS), { [vue.unref(LIST_ITEM_ACTIVE_CLASS)]: vue.unref(isSelected)(vue.unref(getValue)(row.index)) }]),
|
|
590
|
+
"p-select-list-option-item": "",
|
|
591
|
+
style: vue.normalizeStyle(listItemStyle.value),
|
|
592
|
+
onClick: ($event) => vue.unref(select)($event, vue.unref(getValue)(row.index))
|
|
593
|
+
}, [
|
|
594
|
+
vue.createElementVNode("div", {
|
|
595
|
+
class: vue.normalizeClass(["flex items-center", { [vue.unref(pSelectList.SIZES)[__props.size]]: !__props.itemSize }])
|
|
596
|
+
}, [
|
|
597
|
+
vue.renderSlot(_ctx.$slots, "item", {
|
|
598
|
+
item: vue.unref(computedItems)[row.index],
|
|
599
|
+
isItemSelected: vue.unref(isSelected)(vue.unref(getValue)(row.index)),
|
|
600
|
+
itemTextSplit: vue.unref(text.splitStringForHighlight)(vue.unref(string.toString)(vue.unref(getText)(row.index)), vue.unref(search))
|
|
601
|
+
}, () => [
|
|
602
|
+
vue.createElementVNode("div", {
|
|
603
|
+
class: "truncate text-p-purple-60",
|
|
604
|
+
title: vue.unref(string.toString)(vue.unref(getText)(row.index))
|
|
605
|
+
}, [
|
|
606
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(text.splitStringForHighlight)(vue.unref(string.toString)(vue.unref(getText)(row.index)), vue.unref(search)), (str, index) => {
|
|
607
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
608
|
+
key: `${vue.unref(getValue)(row.index)}_${index}`,
|
|
609
|
+
class: vue.normalizeClass({ "bg-p-blue-20": index === 1 })
|
|
610
|
+
}, vue.toDisplayString(str), 3);
|
|
611
|
+
}), 128))
|
|
612
|
+
], 8, _hoisted_6$2)
|
|
613
|
+
]),
|
|
614
|
+
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_7$1)) : vue.createCommentVNode("", true)
|
|
615
|
+
], 2)
|
|
616
|
+
], 14, _hoisted_5$2)), [
|
|
617
|
+
[_directive_close_popper, __props.closePopperOnSelect && !__props.multiple]
|
|
618
|
+
])
|
|
619
|
+
], 4);
|
|
620
|
+
}), 128))
|
|
621
|
+
], 36),
|
|
622
|
+
!vue.unref(computedItems).length ? vue.renderSlot(_ctx.$slots, "no-items", { key: 0 }, () => [
|
|
623
|
+
vue.createElementVNode("div", {
|
|
624
|
+
class: vue.normalizeClass(["flex items-center justify-center", vue.unref(pSelectList.SIZES)[__props.size]])
|
|
625
|
+
}, "No items found", 2)
|
|
626
|
+
]) : vue.createCommentVNode("", true)
|
|
627
|
+
], 6)
|
|
628
|
+
], 2),
|
|
629
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
630
|
+
class: vue.normalizeClass(vue.unref(errorMsgClasses))
|
|
631
|
+
}, vue.toDisplayString(__props.errorMsg), 3), [
|
|
632
|
+
[vue.vShow, __props.errorMsg]
|
|
633
|
+
])
|
|
634
|
+
], 14, _hoisted_1$2);
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
const _hoisted_1$1 = ["data-col-id"];
|
|
639
|
+
const _hoisted_2$1 = { class: "flex" };
|
|
640
|
+
const _hoisted_3$1 = ["onMousedown", "onDblclick"];
|
|
641
|
+
const _hoisted_4$1 = {
|
|
642
|
+
key: 0,
|
|
643
|
+
class: "min-w-[80px] bg-gradient-to-r from-white via-p-gray-10 to-p-gray-10"
|
|
644
|
+
};
|
|
645
|
+
const _hoisted_5$1 = { key: 0 };
|
|
646
|
+
const _hoisted_6$1 = { key: 1 };
|
|
647
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
648
|
+
...{ name: "PTable" },
|
|
649
|
+
__name: "p-table",
|
|
650
|
+
props: {
|
|
651
|
+
cols: {},
|
|
652
|
+
colsResizable: { type: Boolean, default: false },
|
|
653
|
+
isFirstColFixed: { type: Boolean, default: false },
|
|
654
|
+
isLastColFixed: { type: Boolean, default: false },
|
|
655
|
+
lockScroll: { type: Boolean, default: false },
|
|
656
|
+
virtualizer: { default: () => ({
|
|
657
|
+
paddingTop: 0,
|
|
658
|
+
paddingBottom: 0
|
|
659
|
+
}) }
|
|
660
|
+
},
|
|
661
|
+
emits: ["scroll", "click-filter-icon", "col-resize"],
|
|
662
|
+
setup(__props, { emit: __emit }) {
|
|
663
|
+
const emit = __emit;
|
|
664
|
+
const props = __props;
|
|
665
|
+
vue.provide(
|
|
666
|
+
pTable$1.colsInjectionKey,
|
|
667
|
+
vue.computed(() => props.cols)
|
|
668
|
+
);
|
|
669
|
+
vue.provide(
|
|
670
|
+
pTable$1.isFirstColFixedInjectionKey,
|
|
671
|
+
vue.computed(() => props.isFirstColFixed)
|
|
672
|
+
);
|
|
673
|
+
vue.provide(
|
|
674
|
+
pTable$1.isLastColFixedInjectionKey,
|
|
675
|
+
vue.computed(() => props.isLastColFixed)
|
|
676
|
+
);
|
|
677
|
+
vue.provide(
|
|
678
|
+
pTable$1.isColsResizableInjectionKey,
|
|
679
|
+
vue.computed(() => props.colsResizable)
|
|
680
|
+
);
|
|
681
|
+
const scrollWrapper = vue.ref(null);
|
|
682
|
+
const ths = vue.ref([]);
|
|
683
|
+
const {
|
|
684
|
+
isColResizing,
|
|
685
|
+
colResizeHandleLeft,
|
|
686
|
+
colResizingIndex,
|
|
687
|
+
colResizingWidth,
|
|
688
|
+
colResize,
|
|
689
|
+
colResizeStart,
|
|
690
|
+
colResizeFitToData
|
|
691
|
+
} = usePTableColResize.usePTableColResize({
|
|
692
|
+
enabled: vue.computed(() => props.colsResizable),
|
|
693
|
+
ths
|
|
694
|
+
});
|
|
695
|
+
const updateThsRefs = (el, index) => {
|
|
696
|
+
if (el instanceof Element) {
|
|
697
|
+
ths.value[index] = el;
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
const emitScroll = (e) => {
|
|
701
|
+
emit("scroll", e);
|
|
702
|
+
};
|
|
703
|
+
const thDivClasses = (i, col) => {
|
|
704
|
+
const res = ["relative", "py-2"];
|
|
705
|
+
if (!col.borderColor) {
|
|
706
|
+
res.push("border-b border-p-gray-30");
|
|
707
|
+
}
|
|
708
|
+
if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
|
|
709
|
+
res.push("th-shadow px-4");
|
|
710
|
+
} else {
|
|
711
|
+
!props.colsResizable ? res.push("px-2") : res.push("pl-2 pr-4");
|
|
712
|
+
}
|
|
713
|
+
return res;
|
|
714
|
+
};
|
|
715
|
+
vue.onMounted(() => {
|
|
716
|
+
var _a;
|
|
717
|
+
(_a = scrollWrapper.value) == null ? void 0 : _a.addEventListener("scroll", emitScroll, true);
|
|
718
|
+
});
|
|
719
|
+
vue.onBeforeUnmount(() => {
|
|
720
|
+
var _a;
|
|
721
|
+
(_a = scrollWrapper.value) == null ? void 0 : _a.removeEventListener("scroll", emitScroll, true);
|
|
722
|
+
});
|
|
723
|
+
vue.watch(isColResizing, (nV) => {
|
|
724
|
+
if (nV === false && colResizingWidth.value > 0) {
|
|
725
|
+
emit("col-resize", colResizingIndex.value, colResizingWidth.value);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
return (_ctx, _cache) => {
|
|
729
|
+
var _a, _b;
|
|
730
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
731
|
+
ref_key: "scrollWrapper",
|
|
732
|
+
ref: scrollWrapper,
|
|
733
|
+
class: vue.normalizeClass(["block border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
|
|
734
|
+
}, [
|
|
735
|
+
vue.unref(isColResizing) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
736
|
+
key: 0,
|
|
737
|
+
class: "fixed z-[100] w-1 cursor-col-resize bg-p-gray-30",
|
|
738
|
+
style: vue.normalizeStyle({
|
|
739
|
+
top: `${(_a = scrollWrapper.value) == null ? void 0 : _a.offsetTop}px`,
|
|
740
|
+
left: vue.unref(colResizeHandleLeft),
|
|
741
|
+
height: `${(_b = scrollWrapper.value) == null ? void 0 : _b.offsetHeight}px`
|
|
742
|
+
}),
|
|
743
|
+
"data-resize-y-axis": ""
|
|
744
|
+
}, null, 4)) : vue.createCommentVNode("", true),
|
|
745
|
+
vue.createElementVNode("table", vue.mergeProps({
|
|
746
|
+
class: [
|
|
747
|
+
"p-table mb-0 w-full bg-surface",
|
|
748
|
+
{ "last-col-fixed": _ctx.isLastColFixed },
|
|
749
|
+
{ "first-col-fixed": _ctx.isFirstColFixed }
|
|
750
|
+
]
|
|
751
|
+
}, vue.toHandlers(_ctx.colsResizable ? { mousemove: vue.unref(colResize) } : {}, true)), [
|
|
752
|
+
vue.createElementVNode("thead", null, [
|
|
753
|
+
vue.createElementVNode("tr", null, [
|
|
754
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.cols, (col, i) => {
|
|
755
|
+
return vue.openBlock(), vue.createElementBlock("th", vue.mergeProps({
|
|
756
|
+
ref_for: true,
|
|
757
|
+
ref: (el) => updateThsRefs(el, i),
|
|
758
|
+
key: col.id,
|
|
759
|
+
"data-col-id": col.id
|
|
760
|
+
}, col.thAttrs, {
|
|
761
|
+
style: col.style,
|
|
762
|
+
class: "bg-surface"
|
|
763
|
+
}), [
|
|
764
|
+
vue.createElementVNode("div", {
|
|
765
|
+
class: vue.normalizeClass(thDivClasses(i, col))
|
|
766
|
+
}, [
|
|
767
|
+
vue.createElementVNode("div", _hoisted_2$1, [
|
|
768
|
+
vue.renderSlot(_ctx.$slots, `prepend-header-cell-${vue.unref(lodashEs.kebabCase)(col.name)}`, { col }, void 0, true),
|
|
769
|
+
vue.createVNode(pTableHeaderCell, vue.mergeProps({
|
|
770
|
+
text: col.title,
|
|
771
|
+
"filter-active": col.filterActive,
|
|
772
|
+
"show-filter-icon": col.filterable || col.sortable,
|
|
773
|
+
"tooltip-text": col.tooltip,
|
|
774
|
+
class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"]
|
|
775
|
+
}, col.headerCellAttrs, {
|
|
776
|
+
onClickFilterIcon: ($event) => _ctx.$emit("click-filter-icon", $event, col)
|
|
777
|
+
}), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "onClickFilterIcon"])
|
|
778
|
+
]),
|
|
779
|
+
_ctx.colsResizable && i !== 0 && !(i === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
780
|
+
key: 0,
|
|
781
|
+
class: vue.normalizeClass(["absolute bottom-0 right-0 h-full w-2 cursor-col-resize after:absolute after:bottom-2 after:z-20 after:block after:h-5 after:w-px after:cursor-col-resize after:bg-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0" : " after:right-1"]),
|
|
782
|
+
"data-resize-handle": "",
|
|
783
|
+
onMousedown: ($event) => vue.unref(colResizeStart)($event, i),
|
|
784
|
+
onDblclick: ($event) => vue.unref(colResizeFitToData)(i)
|
|
785
|
+
}, null, 42, _hoisted_3$1)) : vue.createCommentVNode("", true),
|
|
786
|
+
vue.createElementVNode("div", {
|
|
787
|
+
class: vue.normalizeClass(["absolute bottom-0 h-1 w-full", _ctx.colsResizable ? "-left-1" : "left-0"]),
|
|
788
|
+
style: vue.normalizeStyle({ background: col.borderColor })
|
|
789
|
+
}, null, 6)
|
|
790
|
+
], 2)
|
|
791
|
+
], 16, _hoisted_1$1);
|
|
792
|
+
}), 128)),
|
|
793
|
+
_ctx.colsResizable && !_ctx.isLastColFixed ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_4$1)) : vue.createCommentVNode("", true)
|
|
794
|
+
])
|
|
795
|
+
]),
|
|
796
|
+
vue.createElementVNode("tbody", null, [
|
|
797
|
+
_ctx.virtualizer.paddingTop > 0 ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_5$1, [
|
|
798
|
+
vue.createElementVNode("td", {
|
|
799
|
+
style: vue.normalizeStyle({ height: `${_ctx.virtualizer.paddingTop}px` })
|
|
800
|
+
}, null, 4)
|
|
801
|
+
])) : vue.createCommentVNode("", true),
|
|
802
|
+
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
803
|
+
_ctx.virtualizer.paddingBottom > 0 ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_6$1, [
|
|
804
|
+
vue.createElementVNode("td", {
|
|
805
|
+
style: vue.normalizeStyle({ height: `${_ctx.virtualizer.paddingBottom}px` })
|
|
806
|
+
}, null, 4)
|
|
807
|
+
])) : vue.createCommentVNode("", true)
|
|
808
|
+
])
|
|
809
|
+
], 16)
|
|
810
|
+
], 2);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
const pTable = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["__scopeId", "data-v-170d774b"]]);
|
|
815
|
+
const _sfc_main = vue.defineComponent({
|
|
816
|
+
name: "PTableSort",
|
|
817
|
+
props: {
|
|
818
|
+
modelValue: {
|
|
819
|
+
type: String,
|
|
820
|
+
default: pTableSort$1.SORTING_TYPES.NO_SORTING,
|
|
821
|
+
validator(value) {
|
|
822
|
+
return Object.values(pTableSort$1.SORTING_TYPES).includes(value);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
emits: ["update:modelValue"],
|
|
827
|
+
data() {
|
|
828
|
+
return {
|
|
829
|
+
SORTING_TYPES: pTableSort$1.SORTING_TYPES
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
const _imports_0 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75838)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75838'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
834
|
+
const _imports_1 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80096)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80096'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
835
|
+
const _imports_2 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75842)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75842'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
836
|
+
const _imports_3 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80100)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80100'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
837
|
+
const _hoisted_1 = { class: "flex items-center justify-between" };
|
|
838
|
+
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "px-4 text-xs font-semibold text-p-gray-40" }, "SORT", -1);
|
|
839
|
+
const _hoisted_3 = { class: "mt-2" };
|
|
840
|
+
const _hoisted_4 = {
|
|
841
|
+
key: 0,
|
|
842
|
+
src: _imports_0
|
|
843
|
+
};
|
|
844
|
+
const _hoisted_5 = {
|
|
845
|
+
key: 1,
|
|
846
|
+
src: _imports_1
|
|
847
|
+
};
|
|
848
|
+
const _hoisted_6 = {
|
|
849
|
+
key: 0,
|
|
850
|
+
src: _imports_2
|
|
851
|
+
};
|
|
852
|
+
const _hoisted_7 = {
|
|
853
|
+
key: 1,
|
|
854
|
+
src: _imports_3
|
|
855
|
+
};
|
|
856
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
857
|
+
return vue.openBlock(), vue.createElementBlock("div", null, [
|
|
858
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
859
|
+
_hoisted_2,
|
|
860
|
+
vue.createElementVNode("div", {
|
|
861
|
+
class: vue.normalizeClass([
|
|
862
|
+
"px-4 text-xs font-semibold text-primary",
|
|
863
|
+
[_ctx.SORTING_TYPES.ASC, _ctx.SORTING_TYPES.DESC].includes(_ctx.modelValue) ? "cursor-pointer opacity-100" : "opacity-50"
|
|
864
|
+
]),
|
|
865
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.NO_SORTING))
|
|
866
|
+
}, " Clear ", 2)
|
|
867
|
+
]),
|
|
868
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
869
|
+
vue.createElementVNode("div", {
|
|
870
|
+
class: "flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",
|
|
871
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.ASC))
|
|
872
|
+
}, [
|
|
873
|
+
vue.createElementVNode("div", {
|
|
874
|
+
class: vue.normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": _ctx.modelValue === _ctx.SORTING_TYPES.ASC }])
|
|
875
|
+
}, " Sort ascending ", 2),
|
|
876
|
+
vue.createElementVNode("div", null, [
|
|
877
|
+
_ctx.modelValue === _ctx.SORTING_TYPES.NO_SORTING || _ctx.modelValue === _ctx.SORTING_TYPES.DESC ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_4)) : (vue.openBlock(), vue.createElementBlock("img", _hoisted_5))
|
|
878
|
+
])
|
|
879
|
+
]),
|
|
880
|
+
vue.createElementVNode("div", {
|
|
881
|
+
class: "flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",
|
|
882
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.DESC))
|
|
883
|
+
}, [
|
|
884
|
+
vue.createElementVNode("div", {
|
|
885
|
+
class: vue.normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": _ctx.modelValue === _ctx.SORTING_TYPES.DESC }])
|
|
886
|
+
}, " Sort descending ", 2),
|
|
887
|
+
vue.createElementVNode("div", null, [
|
|
888
|
+
_ctx.modelValue === _ctx.SORTING_TYPES.NO_SORTING || _ctx.modelValue === _ctx.SORTING_TYPES.ASC ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_6)) : (vue.openBlock(), vue.createElementBlock("img", _hoisted_7))
|
|
889
|
+
])
|
|
890
|
+
])
|
|
891
|
+
])
|
|
892
|
+
]);
|
|
893
|
+
}
|
|
894
|
+
const pTableSort = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
895
|
+
exports.config = config.config;
|
|
896
|
+
exports.PActionBar = pActionBar_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
897
|
+
exports.PAlert = pAlert;
|
|
898
|
+
exports.PAvatar = pAvatar;
|
|
899
|
+
exports.PBtn = pBtn;
|
|
900
|
+
exports.PCard = pCard_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
901
|
+
exports.PCheckbox = pCheckbox_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
902
|
+
exports.PChips = pChips;
|
|
903
|
+
exports.PCloseBtn = pCloseBtn;
|
|
904
|
+
exports.PDatePicker = pDatePicker;
|
|
905
|
+
exports.PDrawer = pDrawer;
|
|
906
|
+
exports.PDropdown = pDropdown;
|
|
907
|
+
exports.PDropdownSelect = pDropdownSelect_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
908
|
+
exports.useInputClasses = useInputClasses.useInputClasses;
|
|
909
|
+
exports.PFilterIcon = pTableFilterIcon;
|
|
910
|
+
exports.PInfoIcon = pInfoIcon;
|
|
911
|
+
exports.PInlineDatePicker = pInlineDatePicker;
|
|
912
|
+
exports.PInput = pInput;
|
|
913
|
+
exports.PInputNumber = pInputNumber;
|
|
914
|
+
exports.PInputPercent = pInputPercent_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
915
|
+
exports.PInputSearch = pInputSearch;
|
|
916
|
+
exports.PLoading = pLoading;
|
|
917
|
+
exports.PModal = pModal;
|
|
918
|
+
exports.PPagination = pPagination_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
919
|
+
exports.PPaginationInfo = pPaginationInfo_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
920
|
+
exports.PProgressBar = pProgressBar;
|
|
921
|
+
exports.PRingLoader = pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
922
|
+
exports.PSelect = pSelect_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
923
|
+
exports.PSelectBtn = pSelectBtn_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
924
|
+
exports.splitStringForHighlight = text.splitStringForHighlight;
|
|
925
|
+
exports.toString = string.toString;
|
|
926
|
+
exports.useSelectList = useSelectList.useSelectList;
|
|
927
|
+
exports.PSelectPill = pSelectPill;
|
|
928
|
+
exports.PSkeletonLoader = pSkeletonLoader;
|
|
929
|
+
exports.PTableHeaderCell = pTableHeaderCell;
|
|
930
|
+
exports.MIN_WIDTH_COL_RESIZE = pTable$1.MIN_WIDTH_COL_RESIZE;
|
|
931
|
+
exports.colsInjectionKey = pTable$1.colsInjectionKey;
|
|
932
|
+
exports.isColsResizableInjectionKey = pTable$1.isColsResizableInjectionKey;
|
|
933
|
+
exports.isFirstColFixedInjectionKey = pTable$1.isFirstColFixedInjectionKey;
|
|
934
|
+
exports.isLastColFixedInjectionKey = pTable$1.isLastColFixedInjectionKey;
|
|
935
|
+
exports.usePTableColResize = usePTableColResize.usePTableColResize;
|
|
936
|
+
exports.PTableLoader = pTableLoader_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
937
|
+
exports.SORTING_TYPES = pTableSort$1.SORTING_TYPES;
|
|
938
|
+
exports.PTableTd = pTableTd;
|
|
939
|
+
exports.PTabs = pTabs_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
940
|
+
exports.PTextarea = pTextarea;
|
|
941
|
+
exports.PToggle = pToggle;
|
|
942
|
+
exports.usePLoading = usePLoading.usePLoading;
|
|
943
|
+
exports.usePModal = usePModal.usePModal;
|
|
944
|
+
exports.usePTableRowVirtualizer = usePTableRowVirtualizer.usePTableRowVirtualizer;
|
|
945
|
+
exports.inputClassesMixin = inputClassesMixin;
|
|
946
|
+
exports.CURRENCY_INPUT_DEFAULTS = currency.CURRENCY_INPUT_DEFAULTS;
|
|
947
|
+
exports.getColor = tailwind.getColor;
|
|
948
|
+
exports.getColorDeep = tailwind.getColorDeep;
|
|
949
|
+
exports.getScreen = tailwind.getScreen;
|
|
950
|
+
exports.ERROR_MSG = inputClassesShared.ERROR_MSG;
|
|
951
|
+
exports.INPUT_BASE = inputClassesShared.INPUT_BASE;
|
|
952
|
+
exports.INPUT_ERROR = inputClassesShared.INPUT_ERROR;
|
|
953
|
+
exports.INPUT_NORMAL = inputClassesShared.INPUT_NORMAL;
|
|
954
|
+
exports.INPUT_SIZES = inputClassesShared.INPUT_SIZES;
|
|
955
|
+
exports.LABEL_BASE = inputClassesShared.LABEL_BASE;
|
|
956
|
+
exports.LABEL_REQUIRED = inputClassesShared.LABEL_REQUIRED;
|
|
957
|
+
exports.LABEL_SIZES = inputClassesShared.LABEL_SIZES;
|
|
958
|
+
exports.SELECT_ARROW = inputClassesShared.SELECT_ARROW;
|
|
959
|
+
exports.SELECT_BASE = inputClassesShared.SELECT_BASE;
|
|
960
|
+
exports.SELECT_SIZES = inputClassesShared.SELECT_SIZES;
|
|
961
|
+
exports.SPACING_LEFT = inputClassesShared.SPACING_LEFT;
|
|
962
|
+
exports.SPACING_PREFIX = inputClassesShared.SPACING_PREFIX;
|
|
963
|
+
exports.SPACING_RIGHT = inputClassesShared.SPACING_RIGHT;
|
|
964
|
+
exports.SPACING_SUFFIX = inputClassesShared.SPACING_SUFFIX;
|
|
965
|
+
exports.TEXTAREA_BASE = inputClassesShared.TEXTAREA_BASE;
|
|
966
|
+
exports.createPagingRange = pagination.createPagingRange;
|
|
967
|
+
exports.getNextActiveElement = dom.getNextActiveElement;
|
|
968
|
+
exports.isElement = dom.isElement;
|
|
969
|
+
exports.isVisible = dom.isVisible;
|
|
970
|
+
exports.isObject = object.isObject;
|
|
971
|
+
exports.setupListKeyboardNavigation = listKeyboardNavigation.setupListKeyboardNavigation;
|
|
972
|
+
exports.toNumberOrNull = number.toNumberOrNull;
|
|
973
|
+
exports.PFileUpload = pFileUpload;
|
|
974
|
+
exports.PSelectList = _sfc_main$2;
|
|
975
|
+
exports.PTable = pTable;
|
|
976
|
+
exports.PTableSort = pTableSort;
|