quasar-ui-danx 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/danx.umd.js CHANGED
@@ -24,5 +24,5 @@ Use Save As... to download, then click back to return to this page.`)&&(location
24
24
  * vue-router v4.3.0
25
25
  * (c) 2024 Eduardo San Martin Morote
26
26
  * @license MIT
27
- */var Df;(function(t){t.pop="pop",t.push="push"})(Df||(Df={}));var qf;(function(t){t.back="back",t.forward="forward",t.unknown=""})(qf||(qf={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var Of;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Of||(Of={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const dS=Symbol(process.env.NODE_ENV!=="production"?"router":""),uS=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function fS(){return o.inject(dS)}function _S(){return o.inject(uS)}function mS(t,e){let n=!1,r=null,i=null;const l=`dx-${t}-pager`,s=o.shallowRef(null),a=o.ref({}),c=o.ref({}),d=o.ref(!1),u=o.shallowRef([]),f=o.ref(!1),_=o.ref(!1),m=o.shallowRef(null),h=o.shallowRef(null),p=o.shallowRef(""),y=o.ref({}),x=o.ref(!1),w=o.computed(()=>Object.keys(a.value).filter(N=>a.value[N]!==void 0).length),C={__sort:null,sortBy:null,descending:!1,page:0,rowsNumber:0,rowsPerPage:50},E=o.shallowRef(C),B=o.computed(()=>({perPage:E.value.rowsPerPage,page:E.value.page,filter:{...a.value,...c.value},sort:E.value.__sort||void 0}));o.watch(B,()=>{Pt(),k()}),o.watch(a,()=>{Pt(),g()}),o.watch(u,g),e.refreshFilters&&o.watch(a,D);async function k(){n&&(f.value=!0,U(await e.routes.list(B.value)),f.value=!1)}async function g(){if(!e.routes.summary||!n)return;_.value=!0;const N={id:null,...a.value,...c.value};u.value.length&&(N.id=u.value.map(L=>L.id)),m.value=await e.routes.summary(N),_.value=!1}async function S(){await Promise.all([k(),g()])}function T(N){return y.value[N]||[]}async function D(){!e.routes.fieldOptions||!n||(x.value=!0,y.value=await e.routes.fieldOptions(a.value)||{},x.value=!1)}function V(N,L=null){var G;if(e.urlPattern&&N.match(e.urlPattern)){const fe=(G=L==null?void 0:L.value)==null?void 0:G.map(dn=>dn.fields.map(Eo=>Eo.name)).flat(),Mt=Bf(N,fe);Object.keys(Mt).length>0&&(a.value=Mt,Ln("filter",a.value))}}function U(N){let L=[],G;Array.isArray(N)?(L=N,G={total:N.length}):N.data&&(L=N.data,G=N.meta),G&&G.total!==E.value.rowsNumber&&(E.value.rowsNumber=G.total),L=L.map(fe=>(fe.isSaving=fe.isSaving===void 0?!1:fe.isSaving,st(fe))),s.value={data:L,meta:G}}function j(){E.value=C}function O(N){E.value=N}function K(N){u.value=N}function Y(){u.value=[]}async function ce(N,L=void 0){var fe,Mt,dn;if(!e.routes.more)return!1;const G=await e.routes.more({page:N+1,perPage:L,filter:{...a.value,...c.value}});return G&&G.length>0?(U({data:[...((fe=s.value)==null?void 0:fe.data)||[],...G],meta:{total:((dn=(Mt=s.value)==null?void 0:Mt.meta)==null?void 0:dn.total)||0}}),!0):!1}async function Ae(){return Promise.all([k(),g(),D(),Xe()])}function Ln(N,L){const G=Bt(l)||{};G[N]=L,Tt(l,G)}function cn(){if(!n)return;const N=Bt(l);N?(a.value={...N.filter,...a.value},E.value=N.pagination):a.value={...e.filterDefaults,...a.value},setTimeout(()=>{f.value||k(),_.value||g(),x.value||D()},1)}async function Pt(){const N={filter:a.value,pagination:{...E.value,page:1}};Tt(l,N)}async function Xe(){if(!h.value||!e.routes.details)return;const N=await e.routes.details(h.value);if(!N||!N.__type||!N.id)return console.error("Invalid response from details route: All responses must include a __type and id field. result =",N);h.value=st(N)}e.routes.details&&o.watch(()=>h.value,async(N,L)=>{N&&(L==null?void 0:L.id)!==N.id&&await Xe()});function kr(N,L=""){var G;(N==null?void 0:N.id)===((G=h.value)==null?void 0:G.id)&&L===p.value||(Ge(N),p.value=L,r&&i&&(N!=null&&N.id)&&i.push({name:Array.isArray(r.name)?r.name[0]:r.name,params:{id:N.id,panel:L},replace:!0}))}function Ge(N){h.value=N&&st(N),N!=null&&N.id||i==null||i.push({name:(r==null?void 0:r.name)||"home"})}async function gt(N){var fe,Mt,dn,Eo;if(!((fe=s.value)!=null&&fe.data))return;const L=s.value.data.findIndex($S=>{var Pf;return $S.id===((Pf=h.value)==null?void 0:Pf.id)});if(L==null)return;let G=L+N;if(G<0)if(E.value.page>1)E.value={...E.value,page:E.value.page-1},await Bo(f,!1),G=s.value.data.length-1;else return;if(G>=s.value.data.length)if(E.value.page<(((dn=(Mt=s.value)==null?void 0:Mt.meta)==null?void 0:dn.last_page)||1))E.value={...E.value,page:E.value.page+1},await Bo(f,!1),G=0;else return;h.value=(Eo=s.value)==null?void 0:Eo.data[G]}function DS(N){a.value=N||{}}async function qS(N){return e.routes.export(N)}function OS(){if(n=!0,cn(),r=_S(),i=fS(),e.routes.details){const{params:N,meta:L}=r,G=r.name;i.afterEach(fe=>{fe.name===G&&Af(fe.params,fe.meta)}),Af(N,L)}}function Af(N,L){const G=Array.isArray(N==null?void 0:N.id)?N.id[0]:N==null?void 0:N.id;if(G&&L.type){const fe=Array.isArray(N==null?void 0:N.panel)?N.panel[0]:N==null?void 0:N.panel;kr({id:G,__type:""+L.type},fe||p.value||"")}}return{name:t,label:e.label||t,pagedItems:s,activeFilter:a,globalFilter:c,filterActiveCount:w,showFilters:d,summary:m,selectedRows:u,isLoadingList:f,isLoadingFilters:x,isLoadingSummary:_,pager:B,pagination:E,activeItem:h,activePanel:p,initialize:OS,resetPaging:j,setPagination:O,setSelectedRows:K,clearSelectedRows:Y,loadList:k,loadSummary:g,loadListAndSummary:S,loadMore:ce,getActiveItemDetails:Xe,refreshAll:Ae,exportList:qS,setActiveItem:Ge,getNextItem:gt,activatePanel:kr,setActiveFilter:DS,applyFilterFromUrl:V,getFieldOptions:T}}function pS(t,e){const n=`${t}-column-order`,r=`${t}-visible-columns`,i=`${t}-title-columns`,l=o.ref(Bt(n)||[]),s=o.ref(Bt(r,[])),a=o.ref(Bt(i,[])),c=o.computed(()=>d.value.slice(0,1)),d=o.computed(()=>[...e].sort((m,h)=>{const p=l.value.indexOf(m.name),y=l.value.indexOf(h.name);return p===-1?1:y===-1?-1:p-y})),u=o.computed({get(){return d.value.slice(1)},set(m){l.value=[...c.value.map(h=>h.name),...m.map(h=>h.name)],Tt(n,l.value)}}),f=o.computed(()=>d.value.filter(m=>!s.value.includes(m.name))),_=o.computed(()=>d.value.filter(m=>a.value.includes(m.name)));return o.watch(()=>s.value,()=>Tt(r,s.value)),o.watch(()=>a.value,()=>Tt(i,a.value)),{sortableColumns:u,lockedColumns:c,visibleColumns:f,hiddenColumnNames:s,titleColumnNames:a,orderedTitleColumns:_}}const hS={class:"flex space-x-2"},gS=["innerHTML"],Ol={__name:"AuditHistoryItemValue",props:{type:{type:String,required:!0},value:{type:[Number,String,Array,Object,Boolean],default:null}},setup(t){const e=t;function n(r){if(r===null||r===""||r===void 0)return"";switch(e.type){case"NUMBER":return at(r);case"CURRENCY":return ei(r);case"DATE":return Je(r);case"DATETIME":return xn(r);case"BOOLEAN":return r?"Yes":"No"}return r}return(r,i)=>(o.openBlock(),o.createElementBlock("div",hS,[t.type==="SINGLE_FILE"?(o.openBlock(),o.createBlock(o.unref(rr),{key:0,file:t.value,class:"w-24"},null,8,["file"])):t.type==="MULTI_FILE"?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(t.value,l=>(o.openBlock(),o.createBlock(o.unref(rr),{key:"file-"+l.id,file:l,class:"w-24 mb-2"},null,8,["file"]))),128)):t.type==="WYSIWYG"?(o.openBlock(),o.createElementBlock("div",{key:2,innerHTML:t.value},null,8,gS)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString(n(t.value)),1)],64))]))}},yS={class:"text-gray-700 flex items-stretch flex-nowrap p-4"},bS={class:"flex-grow text-sm w-3/5 overflow-auto"},kS={class:"flex flex-nowrap items-center mt-4"},xS={class:"bg-red-200 line-through p-2"},wS={class:"bg-emerald-200 ml-2.5 p-2"},SS={class:"ml-4 text-sm w-2/5"},CS=["href"],ES={__name:"AuditHistoryItem",props:{item:{type:Object,required:!0},change:{type:Object,required:!0},novaUrl:{type:String,default:"/nova"}},setup(t){const e=t,n=o.computed(()=>e.novaUrl+`/resources/audit-requests/${e.item.audit_request_id}`);return(r,i)=>(o.openBlock(),o.createElementBlock("div",yS,[o.createElementVNode("div",bS,[o.createElementVNode("h5",null,o.toDisplayString(t.change.label)+" ("+o.toDisplayString(t.change.name)+")",1),o.createElementVNode("div",kS,[o.createElementVNode("div",xS,[o.createVNode(o.unref(Ol),{type:t.change.type,value:t.change.oldValue},null,8,["type","value"])]),o.createElementVNode("div",wS,[o.createVNode(o.unref(Ol),{type:t.change.type,value:t.change.newValue},null,8,["type","value"])])])]),o.createElementVNode("div",SS,[t.item.user?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",null,o.toDisplayString(t.item.user.name),1),o.createElementVNode("div",null,o.toDisplayString(t.item.user.email),1)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",null,o.toDisplayString(t.item.account),1),o.createElementVNode("div",null,[t.item.audit_request_id?(o.openBlock(),o.createElementBlock("a",{key:0,href:n.value,target:"_blank"},o.toDisplayString(o.unref(xn)(t.item.timestamp)),9,CS)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(o.unref(xn)(t.item.timestamp)),1)],64))])])]))}},TS=["onClick"],BS={key:0,class:"flex-shrink-0"},IS={__name:"NavigationMenu",props:{collapsed:Boolean,itemClass:{type:String,default:"hover:bg-gray-200"},activeClass:{type:String,default:"bg-blue-200"},items:{type:Array,required:!0}},setup(t){const e=t,n=o.computed(()=>e.items.filter(r=>!r.hidden));return(r,i)=>{const l=o.resolveComponent("QTooltip"),s=o.resolveComponent("QSeparator");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["p-4",{"is-collapsed":t.collapsed}])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,a=>(o.openBlock(),o.createElementBlock("div",{key:"nav-item-"+a.label,class:"nav-menu-item-box"},[o.createElementVNode("div",{class:o.normalizeClass(["nav-menu-item flex flex-nowrap",a.class||t.itemClass]),onClick:a.onClick},[a.icon?(o.openBlock(),o.createElementBlock("div",BS,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(a.icon),{class:o.normalizeClass(["nav-icon",a.iconClass])},null,8,["class"]))])):o.createCommentVNode("",!0),t.collapsed?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["label ml-2",a.labelClass])},o.toDisplayString(a.label),3)),t.collapsed?(o.openBlock(),o.createBlock(l,o.normalizeProps(o.mergeProps({key:2},a.tooltip)),{default:o.withCtx(()=>{var c;return[o.createTextVNode(o.toDisplayString(((c=a.tooltip)==null?void 0:c.text)||a.label),1)]}),_:2},1040)):o.createCommentVNode("",!0)],10,TS),a.separator?(o.openBlock(),o.createBlock(s,{key:"separator-"+a.label,class:"my-2"})):o.createCommentVNode("",!0)]))),128))],2)}}},NS={name:"quasar-ui-danx",version:"0.4.3",author:"Dan <dan@flytedesk.com>",description:"DanX Vue / Quasar component library",license:"MIT",type:"module",main:"dist/danx.es.js",module:"dist/danx.es.js",scripts:{dev:"cd dev && quasar dev && cd ..",build:"vite build",preview:"vite preview",postversion:'yarn build && npm publish && cd .. && git add ui && git commit -m "v$npm_package_version" && git tag "v$npm_package_version" && git push'},repository:{type:"git",url:"https://github.com/flytedan/quasar-ui-danx"},devDependencies:{"@quasar/extras":"^1.16.4","@types/luxon":"^3.4.2","@types/node":"^20.12.7","@typescript-eslint/eslint-plugin":"^7.6.0","@typescript-eslint/parser":"^7.6.0","@vitejs/plugin-vue":"^5.0.4",autoprefixer:"^10.4.19",chalk:"^4.1.0","core-js":"^3.0.0",cssnano:"^4.1.10",eslint:"^8.5.0","eslint-plugin-import":"^2.29.1","eslint-plugin-vue":"^9.24.1","fs-extra":"^8.1.0",postcss:"^8.4.38",quasar:"^2.0.0",sass:"^1.33.0",tailwindcss:"^3.4.3","ts-node":"^10.9.2",typescript:"^5.4.4",vite:"^5.2.8","vite-plugin-dts":"^3.8.1","vite-svg-loader":"^5.1.0",vue:"^3.4.21","vue-eslint-parser":"^9.4.2","vue-router":"^4.0.0"},dependencies:{"@heroicons/vue":"v1","@tinymce/tinymce-vue":"^5.1.1","@vueuse/core":"^10.7.2","danx-icon":"^1.0.2",exifreader:"^4.21.1",gsap:"^3.12.5",luxon:"^3.4.4"},browserslist:["last 4 Chrome versions","last 4 Firefox versions","last 2 Edge versions","last 4 Safari versions","last 4 Android versions","last 4 ChromeAndroid versions","last 4 FirefoxAndroid versions","last 4 iOS versions"]},{version:$f}=NS;function FS(t){console.log(`Installing Danx UI ${$f}... Nothing to do really.`)}b.ActionMenu=Sl,b.ActionTable=Nf,b.ActionTableColumn=Ku,b.ActionTableHeaderColumn=nf,b.ActionTableLayout=cS,b.ActionToolbar=Ff,b.ActionVnode=Od,b.AddressFormat=g2,b.AuditHistoryItem=ES,b.AuditHistoryItemValue=Ol,b.BadgeTab=D2,b.BooleanField=Tl,b.CaretDownIcon=hd,b.CollapsableFiltersSidebar=bf,b.CollapsableSidebar=Dd,b.ColumnListItem=El,b.ColumnSettingsDialog=sx,b.ConfirmActionDialog=Hb,b.ConfirmDialog=Nn,b.ConfirmPasswordField=hx,b.ContentDrawer=$i,b.DateField=Il,b.DateRangeField=Nl,b.DateTime=q,b.DateTimeField=Ex,b.DateTimePicker=Fl,b.DragAndDrop=Cl,b.DragHandleDotsIcon=gd,b.DragHandleIcon=yd,b.EditOnClickTextField=Mx,b.EditableDiv=Tx,b.EmptyTableState=Cf,b.ExportButton=md,b.FieldLabel=ht,b.FilePreview=rr,b.FileUpload=ro,b.FileUploadButton=Vx,b.FilterIcon=bd,b.FilterItem=gf,b.FilterList=yf,b.FilterListToggle=kf,b.FilterToolbarLayout=$w,b.FilterableField=ql,b.FlashMessages=Pe,b.FlatListFormat=y2,b.FullScreenCarouselDialog=Id,b.FullScreenDialog=Jb,b.GpsCoordinatesFormat=x2,b.HandleDraggable=Ju,b.IconWithTextFormat=S2,b.ImageIcon=qi,b.IndicatorTab=$2,b.InfoDialog=Nd,b.InlineDateTimeField=Rx,b.InputDialog=t2,b.IntegerField=of,b.InteractiveTooltip=I2,b.LabelValueBlock=lf,b.LabelValueFormat=E2,b.LabeledInput=Bl,b.ListDragAndDrop=ef,b.ListItemDraggable=tf,b.ListTransition=Pd,b.MaxHeightTransition=A2,b.MaxLengthCounter=af,b.MultiFileField=sf,b.MultiKeywordField=cf,b.NavigationMenu=IS,b.NewPasswordField=Yx,b.NumberField=yr,b.NumberRangeField=Co,b.PanelsDrawer=Sf,b.PanelsDrawerPanels=xf,b.PanelsDrawerTabs=wf,b.PdfIcon=kd,b.PercentIcon=xd,b.PopoverMenu=Ad,b.PreviousNextControls=Ed,b.RefreshButton=pd,b.RenderComponent=$d,b.RenderVnode=Yt,b.RenderedForm=Uw,b.SERVER_TZ=Qo,b.SelectDrawer=ew,b.SelectField=br,b.SelectWithChildrenField=df,b.SingleFileField=uf,b.SkipNextIcon=wd,b.SkipPreviousIcon=Sd,b.SlideTransition=P2,b.SliderNumberField=sw,b.StaggeredListTransition=Xk,b.SvgImg=Fd,b.TableSummaryRow=If,b.TextField=So,b.TitleColumnFormat=rf,b.TrashIcon=lo,b.VisibleColumnsToggleButtons=fx,b.WarningIcon=Cd,b.WysiwygField=hf,b.XIcon=so,b.activeActionVnode=vt,b.addHotkey=$y,b.applyCssVars=zy,b.buildCssVars=Di,b.centerTruncate=e1,b.configure=Mf,b.danxOptions=_e,b.dbDateTime=Jo,b.diffInDays=r1,b.download=Rr,b.downloadFile=Ca,b.downloadFileResponse=Ea,b.fCurrency=ei,b.fDate=Je,b.fDateTime=Lr,b.fElapsedTime=Jm,b.fJSON=Sa,b.fLocalizedDateTime=xn,b.fMarkdownJSON=n1,b.fNameOrCount=wa,b.fNumber=at,b.fPercent=xa,b.fPhone=t1,b.fQDate=Xm,b.fSecondsToTime=Km,b.fetchResourceListWithSelected=vy,b.getFilterFromUrl=Bf,b.getItem=Bt,b.getResponseHeader=ti,b.getUrlParam=dd,b.incrementName=zl,b.install=FS,b.isJSON=Ll,b.listen=Ay,b.localizedDateTime=Xo,b.mapSortBy=Tf,b.metersToMiles=Qf,b.milesToMeters=Xf,b.minmax=Yf,b.notify=Hf,b.parseCoords=Kf,b.parseDateTime=jt,b.parseQDate=zr,b.parseQDateTime=Ko,b.registerHotkeys=My,b.registerStickyScrolling=Ef,b.remoteDateTime=ka,b.remove=Un,b.replace=To,b.request=et,b.resolveFileLocation=ld,b.setItem=Tt,b.sleep=Vl,b.storeObject=st,b.uniqueBy=Wf,b.unlisten=Py,b.useActionRoutes=Vy,b.useActions=Zf,b.useCompatibility=jl,b.useListControls=mS,b.useMultiFileUpload=cd,b.useSingleFileUpload=ud,b.useTableColumns=pS,b.version=$f,b.waitForRef=Bo,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
27
+ */var Df;(function(t){t.pop="pop",t.push="push"})(Df||(Df={}));var qf;(function(t){t.back="back",t.forward="forward",t.unknown=""})(qf||(qf={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var Of;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Of||(Of={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const dS=Symbol(process.env.NODE_ENV!=="production"?"router":""),uS=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function fS(){return o.inject(dS)}function _S(){return o.inject(uS)}function mS(t,e){let n=!1,r=null,i=null;const l=`dx-${t}-pager`,s=o.shallowRef(null),a=o.ref({}),c=o.ref({}),d=o.ref(!1),u=o.shallowRef([]),f=o.ref(!1),_=o.ref(!1),m=o.shallowRef(null),h=o.shallowRef(null),p=o.shallowRef(""),y=o.ref({}),x=o.ref(!1),w=o.computed(()=>Object.keys(a.value).filter(N=>a.value[N]!==void 0).length),C={__sort:null,sortBy:null,descending:!1,page:0,rowsNumber:0,rowsPerPage:50},E=o.shallowRef(C),B=o.computed(()=>({perPage:E.value.rowsPerPage,page:E.value.page,filter:{...a.value,...c.value},sort:E.value.__sort||void 0}));o.watch(B,()=>{Pt(),k()}),o.watch(a,()=>{Pt(),g()}),o.watch(u,g),e.refreshFilters&&o.watch(a,D);async function k(){n&&(f.value=!0,U(await e.routes.list(B.value)),f.value=!1)}async function g(){if(!e.routes.summary||!n)return;_.value=!0;const N={id:null,...a.value,...c.value};u.value.length&&(N.id=u.value.map(L=>L.id)),m.value=await e.routes.summary(N),_.value=!1}async function S(){await Promise.all([k(),g()])}function T(N){return y.value[N]||[]}async function D(){!e.routes.fieldOptions||!n||(x.value=!0,y.value=await e.routes.fieldOptions(a.value)||{},x.value=!1)}function V(N,L=null){var G;if(e.urlPattern&&N.match(e.urlPattern)){const fe=(G=L==null?void 0:L.value)==null?void 0:G.map(dn=>dn.fields.map(Eo=>Eo.name)).flat(),Mt=Bf(N,fe);Object.keys(Mt).length>0&&(a.value=Mt,Ln("filter",a.value))}}function U(N){let L=[],G;Array.isArray(N)?(L=N,G={total:N.length}):N.data&&(L=N.data,G=N.meta),G&&G.total!==E.value.rowsNumber&&(E.value.rowsNumber=G.total),L=L.map(fe=>(fe.isSaving=fe.isSaving===void 0?!1:fe.isSaving,st(fe))),s.value={data:L,meta:G}}function j(){E.value=C}function O(N){E.value=N}function K(N){u.value=N}function Y(){u.value=[]}async function ce(N,L=void 0){var fe,Mt,dn;if(!e.routes.more)return!1;const G=await e.routes.more({page:N+1,perPage:L,filter:{...a.value,...c.value}});return G&&G.length>0?(U({data:[...((fe=s.value)==null?void 0:fe.data)||[],...G],meta:{total:((dn=(Mt=s.value)==null?void 0:Mt.meta)==null?void 0:dn.total)||0}}),!0):!1}async function Ae(){return Promise.all([k(),g(),D(),Xe()])}function Ln(N,L){const G=Bt(l)||{};G[N]=L,Tt(l,G)}function cn(){if(!n)return;const N=Bt(l);N?(a.value={...N.filter,...a.value},E.value=N.pagination):a.value={...e.filterDefaults,...a.value},setTimeout(()=>{f.value||k(),_.value||g(),x.value||D()},1)}async function Pt(){const N={filter:a.value,pagination:{...E.value,page:1}};Tt(l,N)}async function Xe(){if(!h.value||!e.routes.details)return;const N=await e.routes.details(h.value);if(!N||!N.__type||!N.id)return console.error("Invalid response from details route: All responses must include a __type and id field. result =",N);h.value=st(N)}e.routes.details&&o.watch(()=>h.value,async(N,L)=>{N&&(L==null?void 0:L.id)!==N.id&&await Xe()});function kr(N,L=""){var G;(N==null?void 0:N.id)===((G=h.value)==null?void 0:G.id)&&L===p.value||(Ge(N),p.value=L,r&&i&&(N!=null&&N.id)&&i.push({name:Array.isArray(r.name)?r.name[0]:r.name,params:{id:N.id,panel:L},replace:!0}))}function Ge(N){h.value=N&&st(N),N!=null&&N.id||i==null||i.push({name:(r==null?void 0:r.name)||"home"})}async function gt(N){var fe,Mt,dn,Eo;if(!((fe=s.value)!=null&&fe.data))return;const L=s.value.data.findIndex($S=>{var Pf;return $S.id===((Pf=h.value)==null?void 0:Pf.id)});if(L==null)return;let G=L+N;if(G<0)if(E.value.page>1)E.value={...E.value,page:E.value.page-1},await Bo(f,!1),G=s.value.data.length-1;else return;if(G>=s.value.data.length)if(E.value.page<(((dn=(Mt=s.value)==null?void 0:Mt.meta)==null?void 0:dn.last_page)||1))E.value={...E.value,page:E.value.page+1},await Bo(f,!1),G=0;else return;h.value=(Eo=s.value)==null?void 0:Eo.data[G]}function DS(N){a.value=N||{}}async function qS(N){return e.routes.export(N)}function OS(){if(n=!0,cn(),r=_S(),i=fS(),console.log("init listControl",t,e,"vueRoute",r),e.routes.details&&r){const{params:N,meta:L}=r,G=r.name;i.afterEach(fe=>{fe.name===G&&Af(fe.params,fe.meta)}),Af(N,L)}}function Af(N,L){const G=Array.isArray(N==null?void 0:N.id)?N.id[0]:N==null?void 0:N.id;if(G&&L.type){const fe=Array.isArray(N==null?void 0:N.panel)?N.panel[0]:N==null?void 0:N.panel;kr({id:G,__type:""+L.type},fe||p.value||"")}}return{name:t,label:e.label||t,pagedItems:s,activeFilter:a,globalFilter:c,filterActiveCount:w,showFilters:d,summary:m,selectedRows:u,isLoadingList:f,isLoadingFilters:x,isLoadingSummary:_,pager:B,pagination:E,activeItem:h,activePanel:p,initialize:OS,resetPaging:j,setPagination:O,setSelectedRows:K,clearSelectedRows:Y,loadList:k,loadSummary:g,loadListAndSummary:S,loadMore:ce,getActiveItemDetails:Xe,refreshAll:Ae,exportList:qS,setActiveItem:Ge,getNextItem:gt,activatePanel:kr,setActiveFilter:DS,applyFilterFromUrl:V,getFieldOptions:T}}function pS(t,e){const n=`${t}-column-order`,r=`${t}-visible-columns`,i=`${t}-title-columns`,l=o.ref(Bt(n)||[]),s=o.ref(Bt(r,[])),a=o.ref(Bt(i,[])),c=o.computed(()=>d.value.slice(0,1)),d=o.computed(()=>[...e].sort((m,h)=>{const p=l.value.indexOf(m.name),y=l.value.indexOf(h.name);return p===-1?1:y===-1?-1:p-y})),u=o.computed({get(){return d.value.slice(1)},set(m){l.value=[...c.value.map(h=>h.name),...m.map(h=>h.name)],Tt(n,l.value)}}),f=o.computed(()=>d.value.filter(m=>!s.value.includes(m.name))),_=o.computed(()=>d.value.filter(m=>a.value.includes(m.name)));return o.watch(()=>s.value,()=>Tt(r,s.value)),o.watch(()=>a.value,()=>Tt(i,a.value)),{sortableColumns:u,lockedColumns:c,visibleColumns:f,hiddenColumnNames:s,titleColumnNames:a,orderedTitleColumns:_}}const hS={class:"flex space-x-2"},gS=["innerHTML"],Ol={__name:"AuditHistoryItemValue",props:{type:{type:String,required:!0},value:{type:[Number,String,Array,Object,Boolean],default:null}},setup(t){const e=t;function n(r){if(r===null||r===""||r===void 0)return"";switch(e.type){case"NUMBER":return at(r);case"CURRENCY":return ei(r);case"DATE":return Je(r);case"DATETIME":return xn(r);case"BOOLEAN":return r?"Yes":"No"}return r}return(r,i)=>(o.openBlock(),o.createElementBlock("div",hS,[t.type==="SINGLE_FILE"?(o.openBlock(),o.createBlock(o.unref(rr),{key:0,file:t.value,class:"w-24"},null,8,["file"])):t.type==="MULTI_FILE"?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(t.value,l=>(o.openBlock(),o.createBlock(o.unref(rr),{key:"file-"+l.id,file:l,class:"w-24 mb-2"},null,8,["file"]))),128)):t.type==="WYSIWYG"?(o.openBlock(),o.createElementBlock("div",{key:2,innerHTML:t.value},null,8,gS)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString(n(t.value)),1)],64))]))}},yS={class:"text-gray-700 flex items-stretch flex-nowrap p-4"},bS={class:"flex-grow text-sm w-3/5 overflow-auto"},kS={class:"flex flex-nowrap items-center mt-4"},xS={class:"bg-red-200 line-through p-2"},wS={class:"bg-emerald-200 ml-2.5 p-2"},SS={class:"ml-4 text-sm w-2/5"},CS=["href"],ES={__name:"AuditHistoryItem",props:{item:{type:Object,required:!0},change:{type:Object,required:!0},novaUrl:{type:String,default:"/nova"}},setup(t){const e=t,n=o.computed(()=>e.novaUrl+`/resources/audit-requests/${e.item.audit_request_id}`);return(r,i)=>(o.openBlock(),o.createElementBlock("div",yS,[o.createElementVNode("div",bS,[o.createElementVNode("h5",null,o.toDisplayString(t.change.label)+" ("+o.toDisplayString(t.change.name)+")",1),o.createElementVNode("div",kS,[o.createElementVNode("div",xS,[o.createVNode(o.unref(Ol),{type:t.change.type,value:t.change.oldValue},null,8,["type","value"])]),o.createElementVNode("div",wS,[o.createVNode(o.unref(Ol),{type:t.change.type,value:t.change.newValue},null,8,["type","value"])])])]),o.createElementVNode("div",SS,[t.item.user?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",null,o.toDisplayString(t.item.user.name),1),o.createElementVNode("div",null,o.toDisplayString(t.item.user.email),1)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",null,o.toDisplayString(t.item.account),1),o.createElementVNode("div",null,[t.item.audit_request_id?(o.openBlock(),o.createElementBlock("a",{key:0,href:n.value,target:"_blank"},o.toDisplayString(o.unref(xn)(t.item.timestamp)),9,CS)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(o.unref(xn)(t.item.timestamp)),1)],64))])])]))}},TS=["onClick"],BS={key:0,class:"flex-shrink-0"},IS={__name:"NavigationMenu",props:{collapsed:Boolean,itemClass:{type:String,default:"hover:bg-gray-200"},activeClass:{type:String,default:"bg-blue-200"},items:{type:Array,required:!0}},setup(t){const e=t,n=o.computed(()=>e.items.filter(r=>!r.hidden));return(r,i)=>{const l=o.resolveComponent("QTooltip"),s=o.resolveComponent("QSeparator");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["p-4",{"is-collapsed":t.collapsed}])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,a=>(o.openBlock(),o.createElementBlock("div",{key:"nav-item-"+a.label,class:"nav-menu-item-box"},[o.createElementVNode("div",{class:o.normalizeClass(["nav-menu-item flex flex-nowrap",a.class||t.itemClass]),onClick:a.onClick},[a.icon?(o.openBlock(),o.createElementBlock("div",BS,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(a.icon),{class:o.normalizeClass(["nav-icon",a.iconClass])},null,8,["class"]))])):o.createCommentVNode("",!0),t.collapsed?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["label ml-2",a.labelClass])},o.toDisplayString(a.label),3)),t.collapsed?(o.openBlock(),o.createBlock(l,o.normalizeProps(o.mergeProps({key:2},a.tooltip)),{default:o.withCtx(()=>{var c;return[o.createTextVNode(o.toDisplayString(((c=a.tooltip)==null?void 0:c.text)||a.label),1)]}),_:2},1040)):o.createCommentVNode("",!0)],10,TS),a.separator?(o.openBlock(),o.createBlock(s,{key:"separator-"+a.label,class:"my-2"})):o.createCommentVNode("",!0)]))),128))],2)}}},NS={name:"quasar-ui-danx",version:"0.4.4",author:"Dan <dan@flytedesk.com>",description:"DanX Vue / Quasar component library",license:"MIT",type:"module",main:"dist/danx.es.js",module:"dist/danx.es.js",scripts:{dev:"cd dev && quasar dev && cd ..",build:"vite build",preview:"vite preview",postversion:'yarn build && npm publish && cd .. && git add ui && git commit -m "v$npm_package_version" && git tag "v$npm_package_version" && git push'},repository:{type:"git",url:"https://github.com/flytedan/quasar-ui-danx"},devDependencies:{"@quasar/extras":"^1.16.4","@types/luxon":"^3.4.2","@types/node":"^20.12.7","@typescript-eslint/eslint-plugin":"^7.6.0","@typescript-eslint/parser":"^7.6.0","@vitejs/plugin-vue":"^5.0.4",autoprefixer:"^10.4.19",chalk:"^4.1.0","core-js":"^3.0.0",cssnano:"^4.1.10",eslint:"^8.5.0","eslint-plugin-import":"^2.29.1","eslint-plugin-vue":"^9.24.1","fs-extra":"^8.1.0",postcss:"^8.4.38",quasar:"^2.0.0",sass:"^1.33.0",tailwindcss:"^3.4.3","ts-node":"^10.9.2",typescript:"^5.4.4",vite:"^5.2.8","vite-plugin-dts":"^3.8.1","vite-svg-loader":"^5.1.0",vue:"^3.4.21","vue-eslint-parser":"^9.4.2","vue-router":"^4.0.0"},dependencies:{"@heroicons/vue":"v1","@tinymce/tinymce-vue":"^5.1.1","@vueuse/core":"^10.7.2","danx-icon":"^1.0.2",exifreader:"^4.21.1",gsap:"^3.12.5",luxon:"^3.4.4"},browserslist:["last 4 Chrome versions","last 4 Firefox versions","last 2 Edge versions","last 4 Safari versions","last 4 Android versions","last 4 ChromeAndroid versions","last 4 FirefoxAndroid versions","last 4 iOS versions"]},{version:$f}=NS;function FS(t){console.log(`Installing Danx UI ${$f}... Nothing to do really.`)}b.ActionMenu=Sl,b.ActionTable=Nf,b.ActionTableColumn=Ku,b.ActionTableHeaderColumn=nf,b.ActionTableLayout=cS,b.ActionToolbar=Ff,b.ActionVnode=Od,b.AddressFormat=g2,b.AuditHistoryItem=ES,b.AuditHistoryItemValue=Ol,b.BadgeTab=D2,b.BooleanField=Tl,b.CaretDownIcon=hd,b.CollapsableFiltersSidebar=bf,b.CollapsableSidebar=Dd,b.ColumnListItem=El,b.ColumnSettingsDialog=sx,b.ConfirmActionDialog=Hb,b.ConfirmDialog=Nn,b.ConfirmPasswordField=hx,b.ContentDrawer=$i,b.DateField=Il,b.DateRangeField=Nl,b.DateTime=q,b.DateTimeField=Ex,b.DateTimePicker=Fl,b.DragAndDrop=Cl,b.DragHandleDotsIcon=gd,b.DragHandleIcon=yd,b.EditOnClickTextField=Mx,b.EditableDiv=Tx,b.EmptyTableState=Cf,b.ExportButton=md,b.FieldLabel=ht,b.FilePreview=rr,b.FileUpload=ro,b.FileUploadButton=Vx,b.FilterIcon=bd,b.FilterItem=gf,b.FilterList=yf,b.FilterListToggle=kf,b.FilterToolbarLayout=$w,b.FilterableField=ql,b.FlashMessages=Pe,b.FlatListFormat=y2,b.FullScreenCarouselDialog=Id,b.FullScreenDialog=Jb,b.GpsCoordinatesFormat=x2,b.HandleDraggable=Ju,b.IconWithTextFormat=S2,b.ImageIcon=qi,b.IndicatorTab=$2,b.InfoDialog=Nd,b.InlineDateTimeField=Rx,b.InputDialog=t2,b.IntegerField=of,b.InteractiveTooltip=I2,b.LabelValueBlock=lf,b.LabelValueFormat=E2,b.LabeledInput=Bl,b.ListDragAndDrop=ef,b.ListItemDraggable=tf,b.ListTransition=Pd,b.MaxHeightTransition=A2,b.MaxLengthCounter=af,b.MultiFileField=sf,b.MultiKeywordField=cf,b.NavigationMenu=IS,b.NewPasswordField=Yx,b.NumberField=yr,b.NumberRangeField=Co,b.PanelsDrawer=Sf,b.PanelsDrawerPanels=xf,b.PanelsDrawerTabs=wf,b.PdfIcon=kd,b.PercentIcon=xd,b.PopoverMenu=Ad,b.PreviousNextControls=Ed,b.RefreshButton=pd,b.RenderComponent=$d,b.RenderVnode=Yt,b.RenderedForm=Uw,b.SERVER_TZ=Qo,b.SelectDrawer=ew,b.SelectField=br,b.SelectWithChildrenField=df,b.SingleFileField=uf,b.SkipNextIcon=wd,b.SkipPreviousIcon=Sd,b.SlideTransition=P2,b.SliderNumberField=sw,b.StaggeredListTransition=Xk,b.SvgImg=Fd,b.TableSummaryRow=If,b.TextField=So,b.TitleColumnFormat=rf,b.TrashIcon=lo,b.VisibleColumnsToggleButtons=fx,b.WarningIcon=Cd,b.WysiwygField=hf,b.XIcon=so,b.activeActionVnode=vt,b.addHotkey=$y,b.applyCssVars=zy,b.buildCssVars=Di,b.centerTruncate=e1,b.configure=Mf,b.danxOptions=_e,b.dbDateTime=Jo,b.diffInDays=r1,b.download=Rr,b.downloadFile=Ca,b.downloadFileResponse=Ea,b.fCurrency=ei,b.fDate=Je,b.fDateTime=Lr,b.fElapsedTime=Jm,b.fJSON=Sa,b.fLocalizedDateTime=xn,b.fMarkdownJSON=n1,b.fNameOrCount=wa,b.fNumber=at,b.fPercent=xa,b.fPhone=t1,b.fQDate=Xm,b.fSecondsToTime=Km,b.fetchResourceListWithSelected=vy,b.getFilterFromUrl=Bf,b.getItem=Bt,b.getResponseHeader=ti,b.getUrlParam=dd,b.incrementName=zl,b.install=FS,b.isJSON=Ll,b.listen=Ay,b.localizedDateTime=Xo,b.mapSortBy=Tf,b.metersToMiles=Qf,b.milesToMeters=Xf,b.minmax=Yf,b.notify=Hf,b.parseCoords=Kf,b.parseDateTime=jt,b.parseQDate=zr,b.parseQDateTime=Ko,b.registerHotkeys=My,b.registerStickyScrolling=Ef,b.remoteDateTime=ka,b.remove=Un,b.replace=To,b.request=et,b.resolveFileLocation=ld,b.setItem=Tt,b.sleep=Vl,b.storeObject=st,b.uniqueBy=Wf,b.unlisten=Py,b.useActionRoutes=Vy,b.useActions=Zf,b.useCompatibility=jl,b.useListControls=mS,b.useMultiFileUpload=cd,b.useSingleFileUpload=ud,b.useTableColumns=pS,b.version=$f,b.waitForRef=Bo,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
28
28
  //# sourceMappingURL=danx.umd.js.map