From fe43e6535d99c0ac0003033412e1fc4e1fb9a4fe Mon Sep 17 00:00:00 2001 From: "shubhammehrotra.symfony@webkul.com" Date: Fri, 27 Dec 2019 09:43:59 +0530 Subject: [PATCH] sidebar updates --- config/app.php | 1 - .../publishable/assets/css/velocity.css | 26 ++ .../publishable/assets/js/velocity.js | 299 ++++++++++-------- .../js/UI/components/content-header.vue | 24 +- .../assets/js/UI/components/sidebar.vue | 3 +- .../Velocity/src/Resources/assets/js/app.js | 12 +- .../Resources/assets/sass/components/app.scss | 7 + .../assets/sass/components/home.scss | 6 + .../src/Resources/views/home/index.blade.php | 9 +- .../src/Resources/views/home/slider.blade.php | 30 +- .../Resources/views/layouts/master.blade.php | 1 + 11 files changed, 242 insertions(+), 176 deletions(-) diff --git a/config/app.php b/config/app.php index b4c617b84..7f8871153 100755 --- a/config/app.php +++ b/config/app.php @@ -247,7 +247,6 @@ return [ Webkul\API\Providers\APIServiceProvider::class, Webkul\Discount\Providers\DiscountServiceProvider::class, Webkul\CMS\Providers\CMSServiceProvider::class, - // Velocity provider Webkul\Velocity\Providers\VelocityServiceProvider::class ], diff --git a/packages/Webkul/Velocity/publishable/assets/css/velocity.css b/packages/Webkul/Velocity/publishable/assets/css/velocity.css index 3dbfa3cf8..d586df90e 100644 --- a/packages/Webkul/Velocity/publishable/assets/css/velocity.css +++ b/packages/Webkul/Velocity/publishable/assets/css/velocity.css @@ -1691,6 +1691,28 @@ padding: 10px; } +.search-result-status { + width: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} + +.slides-container { + top: -70px; + position: relative; +} + /* @author Shubham Mehrotra */ body { overflow-x: hidden; @@ -2114,6 +2136,10 @@ header #search-form > *:focus { display: inline-block; } +.categories-sidebar-container > .row.disabled { + cursor: not-allowed; +} + .categories-sidebar-container .main-category { border-bottom: 1px solid #CCCCCC; } diff --git a/packages/Webkul/Velocity/publishable/assets/js/velocity.js b/packages/Webkul/Velocity/publishable/assets/js/velocity.js index 8b1eec97b..5267f98c5 100644 --- a/packages/Webkul/Velocity/publishable/assets/js/velocity.js +++ b/packages/Webkul/Velocity/publishable/assets/js/velocity.js @@ -1119,12 +1119,14 @@ $(document).ready(function () { var rightBarContainer = document.getElementById('home-right-bar-container'); var categoryListContainer = document.getElementById('sidebar'); - categoryListContainer.classList.toggle('hide'); + if (categoryListContainer) { + categoryListContainer.classList.toggle('hide'); - if (rightBarContainer.className.search('col-10') > -1) { - rightBarContainer.className = rightBarContainer.className.replace('col-10', 'col-12'); - } else { - rightBarContainer.className = rightBarContainer.className.replace('col-12', 'col-10'); + if (rightBarContainer.className.search('col-10') > -1) { + rightBarContainer.className = rightBarContainer.className.replace('col-10', 'col-12'); + } else { + rightBarContainer.className = rightBarContainer.className.replace('col-12', 'col-10'); + } } }, @@ -1268,7 +1270,7 @@ if (false) { "use strict"; /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! - * Vue.js v2.6.10 + * Vue.js v2.6.11 * (c) 2014-2019 Evan You * Released under the MIT License. */ @@ -3234,7 +3236,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) { isUsingMicroTask = true; } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { // Fallback to setImmediate. - // Techinically it leverages the (macro) task queue, + // Technically it leverages the (macro) task queue, // but it is still a better choice than setTimeout. timerFunc = function () { setImmediate(flushCallbacks); @@ -3323,7 +3325,7 @@ var initProxy; warn( "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + - 'prevent conflicts with Vue internals' + + 'prevent conflicts with Vue internals. ' + 'See: https://vuejs.org/v2/api/#data', target ); @@ -4183,7 +4185,7 @@ function bindDynamicKeys (baseObj, values) { if (typeof key === 'string' && key) { baseObj[values[i]] = values[i + 1]; } else if (key !== '' && key !== null) { - // null is a speical value for explicitly removing a binding + // null is a special value for explicitly removing a binding warn( ("Invalid value for dynamic directive argument (expected string or null): " + key), this @@ -4678,6 +4680,12 @@ function _createElement ( ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); if (config.isReservedTag(tag)) { // platform built-in elements + if (isDef(data) && isDef(data.nativeOn)) { + warn( + ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."), + context + ); + } vnode = new VNode( config.parsePlatformTagName(tag), data, children, undefined, undefined, context @@ -4803,7 +4811,7 @@ function renderMixin (Vue) { // render self var vnode; try { - // There's no need to maintain a stack becaues all render fns are called + // There's no need to maintain a stack because all render fns are called // separately from one another. Nested component's render fns are called // when parent component is patched. currentRenderingInstance = vm; @@ -6702,7 +6710,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', { value: FunctionalRenderContext }); -Vue.version = '2.6.10'; +Vue.version = '2.6.11'; /* */ @@ -7375,7 +7383,7 @@ function createPatchFunction (backend) { } } - function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + function removeVnodes (vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { var ch = vnodes[startIdx]; if (isDef(ch)) { @@ -7486,7 +7494,7 @@ function createPatchFunction (backend) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); } else if (newStartIdx > newEndIdx) { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + removeVnodes(oldCh, oldStartIdx, oldEndIdx); } } @@ -7578,7 +7586,7 @@ function createPatchFunction (backend) { if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); } else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1); + removeVnodes(oldCh, 0, oldCh.length - 1); } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } @@ -7807,7 +7815,7 @@ function createPatchFunction (backend) { // destroy old node if (isDef(parentElm)) { - removeVnodes(parentElm, [oldVnode], 0, 0); + removeVnodes([oldVnode], 0, 0); } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode); } @@ -10513,7 +10521,7 @@ var startTagOpen = new RegExp(("^<" + qnameCapture)); var startTagClose = /^\s*(\/?)>/; var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var doctype = /^]+>/i; -// #7298: escape - to avoid being pased as HTML comment when inlined in page +// #7298: escape - to avoid being passed as HTML comment when inlined in page var comment = /^ can only appear at the root level inside " + - "the receiving the component", + "the receiving component", el ); } @@ -11985,7 +11993,7 @@ function isDirectChildOfTemplateFor (node) { /* */ -var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; +var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/; var fnInvokeRE = /\([^)]*?\);*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; @@ -12754,6 +12762,8 @@ function checkNode (node, warn) { var range = node.rawAttrsMap[name]; if (name === 'v-for') { checkFor(node, ("v-for=\"" + value + "\""), warn, range); + } else if (name === 'v-slot' || name[0] === '#') { + checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range); } else if (onRE.test(name)) { checkEvent(value, (name + "=\"" + value + "\""), warn, range); } else { @@ -12773,9 +12783,9 @@ function checkNode (node, warn) { } function checkEvent (exp, text, warn, range) { - var stipped = exp.replace(stripStringRE, ''); - var keywordMatch = stipped.match(unaryOperatorsRE); - if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { + var stripped = exp.replace(stripStringRE, ''); + var keywordMatch = stripped.match(unaryOperatorsRE); + if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') { warn( "avoid using JavaScript unary operator as property name: " + "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), @@ -12830,6 +12840,19 @@ function checkExpression (exp, text, warn, range) { } } +function checkFunctionParameterExpression (exp, text, warn, range) { + try { + new Function(exp, ''); + } catch (e) { + warn( + "invalid function parameter expression: " + (e.message) + " in\n\n" + + " " + exp + "\n\n" + + " Raw expression: " + (text.trim()) + "\n", + range + ); + } +} + /* */ var range = 2; @@ -35152,7 +35175,6 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); props: ['id', 'isOpen'], data: function data() { - debugger; return {}; }, @@ -35562,6 +35584,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // // // +// /* harmony default export */ __webpack_exports__["default"] = ({ props: ['categories', 'url', 'addClass', 'mainSidebar'], @@ -35614,76 +35637,81 @@ var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h - return _c( - "nav", - { - class: "" + (_vm.addClass ? _vm.addClass : ""), - attrs: { id: "sidebar" } - }, - [ - _c( - "ul", - { attrs: { type: "none" } }, - _vm._l(_vm.categories, function(category, index) { - return _c( - "li", - { key: index, attrs: { id: "category-" + category.id } }, - [ - _c( - "a", - { - staticClass: "category unset", - class: category.children.length > 0 ? "fw6" : "", - attrs: { - href: - _vm.url + - "/categories/" + - category["translations"][0].slug - }, - on: { - mouseover: function($event) { - return _vm.hover(index, "mouseover") - }, - mouseleave: function($event) { - return _vm.hover(index, "mouseleave") - } - } - }, + return _vm.categories && _vm.categories.length > 0 + ? _c( + "nav", + { + class: "" + (_vm.addClass ? _vm.addClass : ""), + attrs: { id: "sidebar" } + }, + [ + _c( + "ul", + { attrs: { type: "none" } }, + _vm._l(_vm.categories, function(category, index) { + return _c( + "li", + { key: index, attrs: { id: "category-" + category.id } }, [ - _c("span", [_vm._v(_vm._s(category["name"]))]), - _vm._v(" "), - category.children.length > 0 - ? _c("i", { - staticClass: "angle-right-icon text-down-3", - on: { - click: function($event) { - return _vm.toggleSubCategory(index) - } + _c( + "a", + { + staticClass: "category unset", + class: category.children.length > 0 ? "fw6" : "", + attrs: { + href: + _vm.url + + "/categories/" + + category["translations"][0].slug + }, + on: { + mouseover: function($event) { + return _vm.hover(index, "mouseover") + }, + mouseleave: function($event) { + return _vm.hover(index, "mouseleave") } - }) + } + }, + [ + _c("span", [_vm._v(_vm._s(category["name"]))]), + _vm._v(" "), + category.children.length > 0 + ? _c("i", { + staticClass: "angle-right-icon text-down-3", + on: { + click: function($event) { + return _vm.toggleSubCategory(index) + } + } + }) + : _vm._e() + ] + ), + _vm._v(" "), + category.children.length && category.children.length > 0 + ? _c( + "div", + { staticClass: "sub-categories" }, + [ + _c("sidebar-component", { + attrs: { + url: _vm.url, + categories: category.children + } + }) + ], + 1 + ) : _vm._e() ] - ), - _vm._v(" "), - category.children.length && category.children.length > 0 - ? _c( - "div", - { staticClass: "sub-categories" }, - [ - _c("sidebar-component", { - attrs: { url: _vm.url, categories: category.children } - }) - ], - 1 - ) - : _vm._e() - ] + ) + }), + 0 ) - }), - 0 + ] ) - ] - ) + : _vm._e() } var staticRenderFns = [] render._withStripped = true @@ -36679,24 +36707,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // // // +// /* harmony default export */ __webpack_exports__["default"] = ({ - props: ['heading', 'headerContent'], - - methods: { - // toggleSidebar: function (event) { - // let rightBarContainer = document.getElementById('home-right-bar-container'); - // let categoryListContainer = document.getElementById('sidebar'); - - // categoryListContainer.classList.toggle('hide'); - - // if (rightBarContainer.className.search('col-10') > -1) { - // rightBarContainer.className = rightBarContainer.className.replace('col-10', 'col-12'); - // } else { - // rightBarContainer.className = rightBarContainer.className.replace('col-12', 'col-10'); - // } - // } - } + props: ['heading', 'headerContent', 'isEnabled'] }); /***/ }), @@ -36707,43 +36721,50 @@ var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h - return _c("div", { staticClass: "row" }, [ - _c("div", { staticClass: "main-category fs20 pt10 col-2 pl30" }, [ - _c("i", { - staticClass: "rango-view-list cursor-pointer align-vertical-top", - on: { click: _vm.toggleSidebar } - }), - _vm._v(" "), - _c("span", { - staticClass: "text-up", - domProps: { textContent: _vm._s(_vm.heading) } - }) - ]), - _vm._v(" "), - _c("div", { staticClass: "content-list row no-margin col-10" }, [ - _c( - "ul", - { staticClass: "no-margin", attrs: { type: "none" } }, - _vm._l(_vm.headerContent, function(content, index) { - return _c("li", { key: index }, [ - content["content_type"] == "link" - ? _c("a", { - attrs: { - href: "content['page_link']", - target: content["link_target"] ? "_blank" : "_self" - }, - domProps: { textContent: _vm._s(content.title) } - }) - : _c("a", { - attrs: { href: "#" }, - domProps: { textContent: _vm._s(content.title) } - }) - ]) + return _c( + "div", + { class: "row " + (_vm.isEnabled == "0" ? "disabled" : "") }, + [ + _c("div", { staticClass: "main-category fs20 pt10 col-2 pl30" }, [ + _c("i", { + class: + "rango-view-list " + + (_vm.isEnabled == "0" ? "" : "cursor-pointer") + + " align-vertical-top", + on: { click: _vm.toggleSidebar } }), - 0 - ) - ]) - ]) + _vm._v(" "), + _c("span", { + staticClass: "text-up", + domProps: { textContent: _vm._s(_vm.heading) } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "content-list row no-margin col-10" }, [ + _c( + "ul", + { staticClass: "no-margin", attrs: { type: "none" } }, + _vm._l(_vm.headerContent, function(content, index) { + return _c("li", { key: index }, [ + content["content_type"] == "link" + ? _c("a", { + attrs: { + href: "content['page_link']", + target: content["link_target"] ? "_blank" : "_self" + }, + domProps: { textContent: _vm._s(content.title) } + }) + : _c("a", { + attrs: { href: "#" }, + domProps: { textContent: _vm._s(content.title) } + }) + ]) + }), + 0 + ) + ]) + ] + ) } var staticRenderFns = [] render._withStripped = true diff --git a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue index ec6ccd9b8..0622704df 100644 --- a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue +++ b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue @@ -1,7 +1,8 @@