parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"vpUX":[function(require,module,exports) {
module.exports={props:{primaryKeyField:{type:String,required:!0},fields:{type:Object,required:!0},items:{type:Array,default:function(){return[]}},viewOptions:{type:Object,default:function(){return{}}},viewQuery:{type:Object,default:function(){return{}}},loading:{type:Boolean,default:!1},lazyLoading:{type:Boolean,default:!1},selection:{type:Array,default:function(){return[]}},link:{type:String,default:null},sortField:{type:String,default:null}}};
},{}],"nCD6":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("../../../mixins/layout"));function e(t){return t&&t.__esModule?t:{default:t}}function i(t){return s(t)||n(t)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}var o={name:"layout-cards",mixins:[t.default],computed:{sortedOn:function(){var t;return(t=this.viewQuery.sort?this.viewQuery.sort:Object.keys(this.fields)[0]).startsWith("-")&&(t=t.substring(1)),t},sortDirection:function(){return this.viewQuery.sort&&"-"===this.viewQuery.sort.substring(0,1)?"desc":"asc"}},methods:{title:function(t){var e=this.viewOptions.title||this.primaryKeyField;return String(t[e])},subtitle:function(t){var e=this.viewOptions.subtitle||null;return e?t[e]?String(t[e]):"--":null},src:function(t){var e=this.viewOptions.src||null;return e?this.fields[e]&&"file"===this.fields[e].type.toLowerCase()?t[e]&&t[e].data&&t[e].data.thumbnails&&t[e].data.thumbnails[0]&&t[e].data.thumbnails[0].url:"data"===e&&"directus_files"===this.fields[e].collection?t[e]&&t[e].thumbnails&&t[e].thumbnails[0]&&t[e].thumbnails[0].url:t[e]||null:null},content:function(t){var e=this.viewOptions.content||null;return e&&t[e]||null},emptySrc:function(t){return null!=this.viewOptions.src&&null===this.src(t)},onScroll:function(t){var e=t.srcElement,i=e.scrollHeight,r=e.clientHeight,n=e.scrollTop;i-r-n<=500&&this.$emit("next-page"),this.scrolled=n>0},select:function(t){var e;e=this.selection.includes(t)?this.selection.filter(function(e){return e!==t}):[].concat(i(this.selection),[t]),this.$emit("select",e)},setSort:function(t){this.$emit("query",{sort:t})},setSortDirection:function(t){this.$emit("query",{sort:("desc"===t?"-":"")+this.sortedOn})}}};exports.default=o;
(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"layout-cards",on:{scroll:t.onScroll}},[o("div",{staticClass:"toolbar"},[o("p",[t._v(t._s(t.$t("sort_by")))]),t._v(" "),o("div",{staticClass:"sort-select"},[o("select",{domProps:{value:t.sortedOn},on:{input:function(e){return t.setSort(e.target.value)}}},t._l(t.fields,function(e,s){return o("option",{key:s,domProps:{value:s}},[t._v(t._s(t.$helpers.formatTitle(s)))])}),0),t._v(" "),o("i",{staticClass:"material-icons"},[t._v("arrow_drop_down")])]),t._v(" "),o("div",{staticClass:"sort-select"},[o("select",{domProps:{value:t.sortDirection},on:{input:function(e){return t.setSortDirection(e.target.value)}}},[o("option",{attrs:{value:"asc"}},[t._v("ASC")]),t._v(" "),o("option",{attrs:{value:"desc"}},[t._v("DESC")])]),t._v(" "),o("i",{staticClass:"material-icons"},[t._v("arrow_drop_down")])])]),t._v(" "),o("div",{staticClass:"cards",class:{loading:t.loading}},[t._l(t.items,function(e){return o("v-card",{key:e.id,attrs:{to:e[t.link],title:t.title(e),subtitle:t.subtitle(e),icon:t.emptySrc(e)?t.viewOptions.icon||"photo":null,opacity:t.emptySrc(e)?"half":null,src:t.src(e),body:t.content(e),selected:t.selection.includes(e.id),"selection-mode":t.selection.length>0},on:{select:function(o){return t.select(e.id)}}})}),t._v(" "),t.lazyLoading?o("v-card",{attrs:{color:"dark-gray",icon:"hourglass_empty",opacity:"half",title:t.$t("loading_more")}}):t._e()],2)])},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-a76a70",functional:void 0});})();
},{"../../../mixins/layout":"vpUX"}]},{},["nCD6"], "__DirectusExtension__")