(function framework7ComponentLoader(e,t){void 0===t&&(t=!0);var a=e.$,l=(e.Template7,e.utils),n=(e.getDevice,e.getSupport,e.Class),c=(e.Modal,e.ConstructorMethods),o=(e.ModalMethods,l.deleteProps),d=l.extend;function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var s=function(e){var t,l;function n(t,l){var n;void 0===l&&(l={});var c=i(n=e.call(this,l,[t])||this),o={};c.useModulesParams(o),c.params=d(o,l);var s=a(c.params.el);if(0===s.length)return i(n);if(c.$el=s,c.el=s[0],c.$el[0].f7DataTable){var r=c.$el[0].f7DataTable;return c.destroy(),r||i(n)}function h(e){if(!e.detail||!e.detail.sentByF7DataTable){var t=a(this),l=t[0].checked,n=t.parents("td,th").index();if(t.parents("thead").length>0)0===n&&s.find("tbody tr")[l?"addClass":"removeClass"]("data-table-row-selected"),s.find("tbody tr td:nth-child("+(n+1)+") input").prop("checked",l).trigger("change",{sentByF7DataTable:!0}),t.prop("indeterminate",!1);else{0===n&&t.parents("tr")[l?"addClass":"removeClass"]("data-table-row-selected");var o=s.find("tbody .checkbox-cell:nth-child("+(n+1)+') input[type="checkbox"]:checked').length,d=s.find("tbody tr").length,i=s.find("thead .checkbox-cell:nth-child("+(n+1)+') input[type="checkbox"]');l?o===d&&i.prop("checked",!0).trigger("change",{sentByF7DataTable:!0}):i.prop("checked",!1),i.prop("indeterminate",o>0&&o<d)}c.checkSelectedHeader()}}function b(){var e,t=a(this),l=t.hasClass("sortable-cell-active"),n=t.hasClass("sortable-desc")?"desc":"asc";l?(e="desc"===n?"asc":"desc",t.removeClass("sortable-desc sortable-asc").addClass("sortable-"+e)):(s.find("thead .sortable-cell-active").removeClass("sortable-cell-active"),t.addClass("sortable-cell-active"),e=n),t.trigger("datatable:sort",e),c.emit("local::sort dataTableSort",c,e)}return c.$el[0].f7DataTable=c,d(c,{collapsible:s.hasClass("data-table-collapsible"),$headerEl:s.find(".data-table-header"),$headerSelectedEl:s.find(".data-table-header-selected")}),c.attachEvents=function(){c.$el.on("change",'.checkbox-cell input[type="checkbox"]',h),c.$el.find("thead .sortable-cell").on("click",b)},c.detachEvents=function(){c.$el.off("change",'.checkbox-cell input[type="checkbox"]',h),c.$el.find("thead .sortable-cell").off("click",b)},c.useModules(),c.init(),c||i(n)}l=e,(t=n).prototype=Object.create(l.prototype),t.prototype.constructor=t,t.__proto__=l;var c=n.prototype;return c.setCollapsibleLabels=function(){var e=this;e.collapsible&&e.$el.find("tbody td:not(.checkbox-cell)").each((function(t){var l=a(t),n=l.index(),c=l.attr("data-collapsible-title");c||""===c||l.attr("data-collapsible-title",e.$el.find("thead th").eq(n).text())}))},c.checkSelectedHeader=function(){if(this.$headerEl.length>0&&this.$headerSelectedEl.length>0){var e=this.$el.find("tbody .checkbox-cell input:checked").length;this.$el[e>0?"addClass":"removeClass"]("data-table-has-checked"),this.$headerSelectedEl.find(".data-table-selected-count").text(e)}},c.init=function(){this.attachEvents(),this.setCollapsibleLabels(),this.checkSelectedHeader()},c.destroy=function(){var e=this;e.$el.trigger("datatable:beforedestroy"),e.emit("local::beforeDestroy dataTableBeforeDestroy",e),e.attachEvents(),e.$el[0]&&(e.$el[0].f7DataTable=null,delete e.$el[0].f7DataTable),o(e),e=null},n}(n),r={name:"dataTable",static:{DataTable:s},create:function(){this.dataTable=c({defaultSelector:".data-table",constructor:s,app:this,domProp:"f7DataTable"})},on:{tabBeforeRemove:function(e){var t=this;a(e).find(".data-table-init").each((function(e){t.dataTable.destroy(e)}))},tabMounted:function(e){var t=this;a(e).find(".data-table-init").each((function(e){t.dataTable.create({el:e})}))},pageBeforeRemove:function(e){var t=this;e.$el.find(".data-table-init").each((function(e){t.dataTable.destroy(e)}))},pageInit:function(e){var t=this;e.$el.find(".data-table-init").each((function(e){t.dataTable.create({el:e})}))}},vnode:{"data-table-init":{insert:function(e){var t=e.elm;this.dataTable.create({el:t})},destroy:function(e){var t=e.elm;this.dataTable.destroy(t)}}}};if(t){if(e.prototype.modules&&e.prototype.modules[r.name])return;e.use(r),e.instance&&(e.instance.useModuleParams(r,e.instance.params),e.instance.useModule(r))}return r}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
