From 7dd944c466e0070544a6f0ecc4e6e5574b8a0e4a Mon Sep 17 00:00:00 2001 From: keizah7 Date: Wed, 16 Sep 2020 22:10:22 +0300 Subject: [PATCH] Filter component update --- dist/js/filter.js | 2 +- resources/js/components/Filter.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/js/filter.js b/dist/js/filter.js index ede54fe..de13c19 100644 --- a/dist/js/filter.js +++ b/dist/js/filter.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),e.exports=n(6)},function(e,t,n){Nova.booting(function(e,t,r){e.component("custom-date-filter",n(2))})},function(e,t,n){var r=n(3)(n(4),n(5),!1,null,null,null);e.exports=r.exports},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var u,f="function"==typeof a?a.options:a;if(t&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0),n&&(f.functional=!0),o&&(f._scopeId=o),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},f._ssrRegister=u):r&&(u=r),u){var c=f.functional,d=c?f.render:f.beforeCreate;c?(f._injectStyles=u,f.render=function(e,t){return u.call(t),d(e,t)}):f.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:f}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{resourceName:{type:String,required:!0},filterKey:{type:String,required:!0}},methods:{handleChange:function(e){this.$store.commit(this.resourceName+"/updateFilterState",{filterClass:this.filterKey,value:e}),this.$emit("change")}},computed:{filter:function(){return this.$store.getters[this.resourceName+"/getFilter"](this.filterKey)},value:function(){return this.filter.currentValue},altFormat:function(){return this.filter.options.altFormat||"Y-m-d H:i"},dateFormat:function(){return this.filter.options.altFormat||"Y-m-d H:i"},placeholder:function(){return this.filter.options.placeholder||this.__("Choose date")},enableTime:function(){return this.filter.options.enableTime||!0},enableSeconds:function(){return this.filter.options.enableSeconds||!1},firstDayOfWeek:function(){return this.filter.options.firstDayOfWeek||0}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h3",{staticClass:"text-sm uppercase tracking-wide text-80 bg-30 p-3"},[e._v("\n "+e._s(e.filter.name)+"\n ")]),e._v(" "),n("div",{staticClass:"p-2"},[n("date-time-picker",{staticClass:"w-full form-control form-input form-input-bordered",attrs:{dusk:"date-filter",name:"date-filter",autocomplete:"off",value:e.value,"alt-format":e.altFormat,"date-format":e.dateFormat,placeholder:e.placeholder,"enable-time":e.enableTime,"enable-seconds":e.enableSeconds,"first-day-of-week":e.firstDayOfWeek},on:{input:function(e){e.preventDefault()},change:e.handleChange}})],1)])},staticRenderFns:[]}},function(e,t){}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),e.exports=n(6)},function(e,t,n){Nova.booting(function(e,t,r){e.component("custom-date-filter",n(2))})},function(e,t,n){var r=n(3)(n(4),n(5),!1,null,null,null);e.exports=r.exports},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var u,f="function"==typeof a?a.options:a;if(t&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0),n&&(f.functional=!0),o&&(f._scopeId=o),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},f._ssrRegister=u):r&&(u=r),u){var c=f.functional,d=c?f.render:f.beforeCreate;c?(f._injectStyles=u,f.render=function(e,t){return u.call(t),d(e,t)}):f.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:f}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{resourceName:{type:String,required:!0},filterKey:{type:String,required:!0}},methods:{handleChange:function(e){this.$store.commit(this.resourceName+"/updateFilterState",{filterClass:this.filterKey,value:e}),this.$emit("change")}},computed:{filter:function(){return this.$store.getters[this.resourceName+"/getFilter"](this.filterKey)},value:function(){return this.filter.currentValue},altFormat:function(){return this.filter.options.altFormat||"Y-m-d H:i"},dateFormat:function(){return this.filter.options.altFormat||"Y-m-d H:i"},placeholder:function(){return this.filter.options.placeholder||this.__("Choose date")},enableTime:function(){return this.filter.options.enableTime||!1},enableSeconds:function(){return this.filter.options.enableSeconds||!1},firstDayOfWeek:function(){return this.filter.options.firstDayOfWeek||0}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h3",{staticClass:"text-sm uppercase tracking-wide text-80 bg-30 p-3"},[e._v("\n "+e._s(e.filter.name)+"\n ")]),e._v(" "),n("div",{staticClass:"p-2"},[n("date-time-picker",{staticClass:"w-full form-control form-input form-input-bordered",attrs:{dusk:"date-filter",name:"date-filter",autocomplete:"off",value:e.value,"alt-format":e.altFormat,"date-format":e.dateFormat,placeholder:e.placeholder,"enable-time":e.enableTime,"enable-seconds":e.enableSeconds,"first-day-of-week":e.firstDayOfWeek},on:{input:function(e){e.preventDefault()},change:e.handleChange}})],1)])},staticRenderFns:[]}},function(e,t){}]); \ No newline at end of file diff --git a/resources/js/components/Filter.vue b/resources/js/components/Filter.vue index ee3003b..2629a04 100644 --- a/resources/js/components/Filter.vue +++ b/resources/js/components/Filter.vue @@ -46,7 +46,7 @@ export default { this.$emit('change'); }, }, - + computed: { filter() { return this.$store.getters[`${this.resourceName}/getFilter`]( @@ -71,7 +71,7 @@ export default { }, enableTime() { - return this.filter.options.enableTime || true; + return this.filter.options.enableTime || false; }, enableSeconds() {