From 49d6d440e5685cf1863564727f434bb1ce65aac6 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Tue, 31 Jul 2018 15:52:38 +0530 Subject: [PATCH] navigation menu category ready, styles left to be applied accordingly --- .../Categories/CategoryComposer.php | 1 - .../Shop/src/Resources/assets/js/app.js | 6 +- .../assets/js/components/category-item.vue | 51 + .../assets/js/components/category-nav.vue | 74 ++ .../assets/js/components/imageSlider.vue | 3 - .../assets/js/components/navView.vue | 0 .../store/header/nav-menu/navmenu.blade.php | 15 +- public/vendor/webkul/shop/assets/js/shop.js | 974 +++++++++++++++--- 8 files changed, 977 insertions(+), 147 deletions(-) create mode 100644 packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue create mode 100644 packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue delete mode 100644 packages/Webkul/Shop/src/Resources/assets/js/components/navView.vue diff --git a/packages/Webkul/Shop/src/Http/ViewComposers/Categories/CategoryComposer.php b/packages/Webkul/Shop/src/Http/ViewComposers/Categories/CategoryComposer.php index d81f06b02..2d7b849eb 100644 --- a/packages/Webkul/Shop/src/Http/ViewComposers/Categories/CategoryComposer.php +++ b/packages/Webkul/Shop/src/Http/ViewComposers/Categories/CategoryComposer.php @@ -35,7 +35,6 @@ class CategoryComposer foreach ($categories as $category) { array_push($collected_cat, collect($category)); } - dd(count($collected_cat[0]['children'])); $view->with('categories', $collected_cat); } } diff --git a/packages/Webkul/Shop/src/Resources/assets/js/app.js b/packages/Webkul/Shop/src/Resources/assets/js/app.js index 2b909ea0e..84547dd7b 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/app.js +++ b/packages/Webkul/Shop/src/Resources/assets/js/app.js @@ -6,6 +6,10 @@ Vue.use(VeeValidate); //pure JS for resizing of browser purposes only +Vue.component("category-nav", require("./components/category-nav.vue")); +Vue.component("category-item", require("./components/category-item.vue")); +Vue.component("image-slider", require("./components/imageSlider.vue")); + $(window).resize(function() { var w = $(document).width(); var window = {}; @@ -29,8 +33,6 @@ $(window).resize(function() { }); $(document).ready(function() { - Vue.component("image-slider", require("./components/imageSlider.vue")); - // Vue.component("nav-view", require("./components/navVue.vue")); /* Responsiveness script goes here */ var w = $(document).width(); var window = {}; diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue new file mode 100644 index 000000000..c8c38891b --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue @@ -0,0 +1,51 @@ + + + + diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue new file mode 100644 index 000000000..7c21edbcc --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/category-nav.vue @@ -0,0 +1,74 @@ + + + + diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/imageSlider.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/imageSlider.vue index 0038732c8..1c7f4ede1 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/components/imageSlider.vue +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/imageSlider.vue @@ -17,9 +17,6 @@ export default { return { images: [ "vendor/webkul/shop/assets/images/banner.png", - "vendor/webkul/shop/assets/images/1.png", - "vendor/webkul/shop/assets/images/2.png", - "vendor/webkul/shop/assets/images/3.png" ], currentIndex: 0 }; diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/navView.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/navView.vue deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/Webkul/Shop/src/Resources/views/store/header/nav-menu/navmenu.blade.php b/packages/Webkul/Shop/src/Resources/views/store/header/nav-menu/navmenu.blade.php index 002a6553b..6bd2b1cd2 100644 --- a/packages/Webkul/Shop/src/Resources/views/store/header/nav-menu/navmenu.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/store/header/nav-menu/navmenu.blade.php @@ -1,11 +1,14 @@ - --}} + +{{-- --}} diff --git a/public/vendor/webkul/shop/assets/js/shop.js b/public/vendor/webkul/shop/assets/js/shop.js index 71bae6896..6de0fd25c 100644 --- a/public/vendor/webkul/shop/assets/js/shop.js +++ b/public/vendor/webkul/shop/assets/js/shop.js @@ -60,7 +60,7 @@ /******/ __webpack_require__.p = "/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ return __webpack_require__(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ @@ -92,24 +92,447 @@ module.exports = g; /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -__webpack_require__(2); -module.exports = __webpack_require__(13); +/* globals __VUE_SSR_CONTEXT__ */ + +// IMPORTANT: Do NOT use ES2015 features in this file. +// This module is a runtime utility for cleaner component module output and will +// be included in the final webpack user bundle. + +module.exports = function normalizeComponent ( + rawScriptExports, + compiledTemplate, + functionalTemplate, + injectStyles, + scopeId, + moduleIdentifier /* server only */ +) { + var esModule + var scriptExports = rawScriptExports = rawScriptExports || {} + + // ES6 modules interop + var type = typeof rawScriptExports.default + if (type === 'object' || type === 'function') { + esModule = rawScriptExports + scriptExports = rawScriptExports.default + } + + // Vue.extend constructor export interop + var options = typeof scriptExports === 'function' + ? scriptExports.options + : scriptExports + + // render functions + if (compiledTemplate) { + options.render = compiledTemplate.render + options.staticRenderFns = compiledTemplate.staticRenderFns + options._compiled = true + } + + // functional template + if (functionalTemplate) { + options.functional = true + } + + // scopedId + if (scopeId) { + options._scopeId = scopeId + } + + var hook + if (moduleIdentifier) { // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__ + } + // inject component styles + if (injectStyles) { + injectStyles.call(this, context) + } + // register component module identifier for async chunk inferrence + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier) + } + } + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook + } else if (injectStyles) { + hook = injectStyles + } + + if (hook) { + var functional = options.functional + var existing = functional + ? options.render + : options.beforeCreate + + if (!functional) { + // inject component registration as beforeCreate hook + options.beforeCreate = existing + ? [].concat(existing, hook) + : [hook] + } else { + // for template-only hot-reload because in that case the render fn doesn't + // go through the normalizer + options._injectStyles = hook + // register for functioal component in vue file + options.render = function renderWithStyleInjection (h, context) { + hook.call(context) + return existing(h, context) + } + } + } + + return { + esModule: esModule, + exports: scriptExports, + options: options + } +} /***/ }), /* 2 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), +/* 3 */ /***/ (function(module, exports, __webpack_require__) { -window.jQuery = window.$ = $ = __webpack_require__(3); -window.Vue = __webpack_require__(4); -window.VeeValidate = __webpack_require__(8); +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + Modified by Evan You @yyx990803 +*/ + +var hasDocument = typeof document !== 'undefined' + +if (typeof DEBUG !== 'undefined' && DEBUG) { + if (!hasDocument) { + throw new Error( + 'vue-style-loader cannot be used in a non-browser environment. ' + + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." + ) } +} + +var listToStyles = __webpack_require__(15) + +/* +type StyleObject = { + id: number; + parts: Array +} + +type StyleObjectPart = { + css: string; + media: string; + sourceMap: ?string +} +*/ + +var stylesInDom = {/* + [id: number]: { + id: number, + refs: number, + parts: Array<(obj?: StyleObjectPart) => void> + } +*/} + +var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) +var singletonElement = null +var singletonCounter = 0 +var isProduction = false +var noop = function () {} +var options = null +var ssrIdKey = 'data-vue-ssr-id' + +// Force single-tag solution on IE6-9, which has a hard limit on the # of