@craftkit/craft-sample-stickyheader
Version:
Sample implementation for Craft-Widget-StickyHeaderNavi
206 lines (177 loc) • 147 kB
JavaScript
window["Demo"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/@craftkit/craft-uikit/index.js":
/*!*****************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/index.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nconst Craft = __webpack_require__(/*! ./main.js */ \"./node_modules/@craftkit/craft-uikit/main.js\");\n\nmodule.exports = Craft.default || Craft;\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/index.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/main.js":
/*!****************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/main.js ***!
\****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _src_Craft_Core_Bootstrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/Craft/Core/Bootstrap.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Bootstrap.js\");\n/* harmony import */ var _src_Craft_Core_Route_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/Craft/Core/Route.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Route.js\");\n/* harmony import */ var _src_Craft_Core_Router_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./src/Craft/Core/Router.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Router.js\");\n/* harmony import */ var _src_Craft_Core_HashRouter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./src/Craft/Core/HashRouter.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/HashRouter.js\");\n/* harmony import */ var _src_Craft_Core_PathRouter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./src/Craft/Core/PathRouter.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/PathRouter.js\");\n/* harmony import */ var _src_Craft_Core_Context_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./src/Craft/Core/Context.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js\");\n/* harmony import */ var _src_Craft_Core_Defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./src/Craft/Core/Defaults.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js\");\n/* harmony import */ var _src_Craft_Core_ComponentStack_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./src/Craft/Core/ComponentStack.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/ComponentStack.js\");\n/* harmony import */ var _src_Craft_Core_KeyboardManager_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./src/Craft/Core/KeyboardManager.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/KeyboardManager.js\");\n/* harmony import */ var _src_Craft_Core_NotificationCenter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./src/Craft/Core/NotificationCenter.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/NotificationCenter.js\");\n/* harmony import */ var _src_Craft_Core_Component_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./src/Craft/Core/Component.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Component.js\");\n/* harmony import */ var _src_Craft_Core_StickComponent_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./src/Craft/Core/StickComponent.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/StickComponent.js\");\n/* harmony import */ var _src_Craft_Core_Transition_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./src/Craft/Core/Transition.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Transition.js\");\n/* harmony import */ var _src_Craft_Core_Gesture_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./src/Craft/Core/Gesture.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Gesture.js\");\n/* harmony import */ var _src_Craft_UI_View_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./src/Craft/UI/View.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/UI/View.js\");\n/* harmony import */ var _src_Craft_UI_DefaultViewController_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./src/Craft/UI/DefaultViewController.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/UI/DefaultViewController.js\");\n/* harmony import */ var _src_Craft_UI_DefaultRootViewController_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./src/Craft/UI/DefaultRootViewController.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/UI/DefaultRootViewController.js\");\n/* harmony import */ var _src_Craft_UI_ModalViewController_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./src/Craft/UI/ModalViewController.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/UI/ModalViewController.js\");\n/* harmony import */ var _src_Craft_UI_Device_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./src/Craft/UI/Device.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/UI/Device.js\");\n\nconst Craft = {};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCraft.Core = {\n\tBootstrap : _src_Craft_Core_Bootstrap_js__WEBPACK_IMPORTED_MODULE_0__[\"Bootstrap\"],\n\tContext : _src_Craft_Core_Context_js__WEBPACK_IMPORTED_MODULE_5__[\"Context\"],\n\tDefaults : _src_Craft_Core_Defaults_js__WEBPACK_IMPORTED_MODULE_6__[\"Defaults\"],\n\tComponentStack : _src_Craft_Core_ComponentStack_js__WEBPACK_IMPORTED_MODULE_7__[\"ComponentStack\"],\n\tKeyboardManager : _src_Craft_Core_KeyboardManager_js__WEBPACK_IMPORTED_MODULE_8__[\"KeyboardManager\"],\n\tNotificationCenter : _src_Craft_Core_NotificationCenter_js__WEBPACK_IMPORTED_MODULE_9__[\"NotificationCenter\"],\n\tComponent : _src_Craft_Core_Component_js__WEBPACK_IMPORTED_MODULE_10__[\"Component\"],\n\tStickComponent : _src_Craft_Core_StickComponent_js__WEBPACK_IMPORTED_MODULE_11__[\"StickComponent\"],\n\tTransition : _src_Craft_Core_Transition_js__WEBPACK_IMPORTED_MODULE_12__[\"Transition\"],\n\tGesture : _src_Craft_Core_Gesture_js__WEBPACK_IMPORTED_MODULE_13__[\"Gesture\"],\n\tRoute : _src_Craft_Core_Route_js__WEBPACK_IMPORTED_MODULE_1__[\"Route\"],\n\tRouter : _src_Craft_Core_Router_js__WEBPACK_IMPORTED_MODULE_2__[\"Router\"],\n\tHashRouter : _src_Craft_Core_HashRouter_js__WEBPACK_IMPORTED_MODULE_3__[\"HashRouter\"],\n\tPathRouter : _src_Craft_Core_PathRouter_js__WEBPACK_IMPORTED_MODULE_4__[\"PathRouter\"]\n};\n\n\n\n\n\n\n\nCraft.UI = {\n\tView : _src_Craft_UI_View_js__WEBPACK_IMPORTED_MODULE_14__[\"View\"],\n\tDefaultViewController : _src_Craft_UI_DefaultViewController_js__WEBPACK_IMPORTED_MODULE_15__[\"DefaultViewController\"],\n\tDefaultRootViewController : _src_Craft_UI_DefaultRootViewController_js__WEBPACK_IMPORTED_MODULE_16__[\"DefaultRootViewController\"],\n\tModalViewController : _src_Craft_UI_ModalViewController_js__WEBPACK_IMPORTED_MODULE_17__[\"ModalViewController\"],\n\tDevice : _src_Craft_UI_Device_js__WEBPACK_IMPORTED_MODULE_18__[\"Device\"]\n};\n\nCraft.Widget = {}; // placeholder\n\nCraft.usePackage = function(packages){\n\tpackages.inject(Craft);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Craft);\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/main.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/Bootstrap.js":
/*!************************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/Bootstrap.js ***!
\************************************************************************/
/*! exports provided: Bootstrap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Bootstrap\", function() { return Bootstrap; });\n/* harmony import */ var _Context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Context.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js\");\n\n\n\n/** \n * The application entry point.\n * \n * Argument for `Craft.Core.Bootstrap.boot` must have your entry function named as `didBootApplication`. \n * The function will be called just after the initialization process of Craft-UIKit itself. \n * \n * You can also set your optional value or function in the argument object. \n * It can be retrieved via `Craft.Core.Context.getApp()`.\n * \n * @namespace Craft.Core.Bootstrap\n * @packagename Craft.Core.Bootstrap\n * \n * @example\n * \n * Craft.Core.Bootstrap.boot({\n * router : Craft.Core.HashRouter,\n * didBootApplication : function(options){\n * let widget = new MyWidget();\n * widget.loadView();\n * document.getElementById('CraftRoot').appendChild(widget.view);\n * },\n * token : some_token\n * });\n * \n * const token = Craft.Core.Context.getApp().token;\n * \n */\nvar Bootstrap = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.Bootstrap',\n\t\n\t/**\n\t * @typedef {Object} LaunchEnv\n\t * @property {String} entryPoint - launching hash\n\t */\n\t \n\t/**\n\t * Entry point of Craft-UIKit application.\n\t * \n\t * @memberof Craft.Core.Bootstrap\n\t * @method Craft.Core.Bootstrap.boot\n\t * \n\t * @param {Object} app - your application bootloader with didBootApplication\n\t * @param {Function} app.didBootApplication - your bootstrap\n\t * @param {Craft.Core.Router} app.didBootApplication - your bootstrap\n\t * @return {LaunchEnv} - info about launch environment\n\t */\n\tboot : function(app){\n\t\tif( !app ){\n\t\t\tthrow \"no app\";\n\t\t}\n\t\t\n\t\t// also, init context\n\t\t_Context_js__WEBPACK_IMPORTED_MODULE_0__[\"Context\"].setApp(app);\n\t\t\n\t\t// ok, launch the application\n\t\t_Context_js__WEBPACK_IMPORTED_MODULE_0__[\"Context\"].getApp().didBootApplication();\n\t}\n\t\n};\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/Bootstrap.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/Component.js":
/*!************************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/Component.js ***!
\************************************************************************/
/*! exports provided: Component */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Component\", function() { return Component; });\n/* harmony import */ var _ComponentStack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ComponentStack.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/ComponentStack.js\");\n\n\n\n/** \n * Super class for all Craft-UIKit Components.\n * \n * @packagename Craft.Core.Component\n */\nclass Component {\n\t\n\t/**\n\t * Component constructor.\n\t */\n\tconstructor(){\n\t\tthis.packagename = ''; // TODO: waiting ES2020 class fields (define this to use for componentId base name instead of class name)\n\t\tthis.componentId = ''; // unique identifier defined by name and serial\n\t\tthis.componentname = ''; // conceptional name, automatically generated by init() according to the this.packagename\n\t\tthis.viewController = ''; // optional. viewController this component is managed by. would be set by viewController or by yourself.\n\t\tthis.isViewLoaded = false; // true after init() and render() was called\n\t\tthis.visible = false; // true while visible\n\t\tthis.parent = null; // parent Component\n\t\t\n\t\tthis.view = document.createElement('div'); // shadow host\n\t\tthis.root = ''; // component root based on `template`\n\t\tthis.shadow = this.view.attachShadow({ mode: 'open' }); // shadow root\n\t\tthis.css = ''; // array of style\n\t\t\n\t\t// will be upgraded in init() if you define packagename\n\t\tthis.componentname = this.constructor.name;\n\t\tthis.component_serial = _ComponentStack_js__WEBPACK_IMPORTED_MODULE_0__[\"ComponentStack\"].nextSerial();\n\t\tthis.componentId = this.componentname + '_' + this.component_serial;\n\t}\n\t\n\t/**\n\t * Initialize instance values \n\t * \n\t * Upgrade this.componentname and this.componentId by this.packagename if defined.\n\t * To avoid conflicting componentId, it is highly recommended to define this.packagename in the constructor of your Component sub-class.\n\t * \n\t * TODO: waiting ES2020 class fields (to be able to define packagename in class field)\n\t * \n\t * You should never call this method directly, and should never override this method. \n\t * This is a part of `loadView` the initialization processs of Component, but separated for readability. \n\t * \n\t * Use `viewDidLoad` for your additional initialization.\n\t * \n\t * (highly recommended to be implemented as synchronous)\n\t */\n\tinit(){\n\t\tif( this.packagename ){\n\t\t\tthis.componentname = this.packagename.replace(/[\\/\\.]/g,'_'); // id should not have dot\n\t\t}else{\n\t\t\tthis.componentname = this.constructor.name;\n\t\t}\n\t\tthis.componentId = this.componentname + '_' + this.component_serial;\n\t\t_ComponentStack_js__WEBPACK_IMPORTED_MODULE_0__[\"ComponentStack\"].set(this.componentId,this);\n\t\t\n\t\tthis.view.id = this.componentId;\n\t}\n\t\n\t/**\n\t * Render RootView and load stylesheet.\n\t * \n\t * `template()` and `style()` can access to its instance variables via `this`. \n\t * \n\t * (highly recommended to be implemented as synchronous)\n\t */\n\trender(){\n\t\tthis.loadStyle();\n\t\tthis.renderView();\n\t}\n\t\n\t/**\n\t * Render template, and get the shadow DOM. \n\t * \n\t * If you call this method, this.root(including scoped style) will be cleared. \n\t */\n\trenderView(){\n\t\tlet html = this.template(this.componentId).trim();\n\t\tlet tmpl = document.createElement('template');\n\t\ttmpl.innerHTML = html;\n\t\t\n\t\tif( this.root ){ this.root.remove(); }\n\t\t\n\t\tthis.root = tmpl.content.firstChild;\n\t\t\n\t\tthis.shadow.appendChild(this.root);\n\t}\n\t\n\t/**\n\t * Load style defined in this instance\n\t */\n\tloadStyle(){\n\t\tif( this.style ){\n\t\t\tthis.appendStyle( this.style(this.componentId) );\n\t\t}\n\t}\n\t\n\t/**\n\t * Load style from text, and append it to the shadow root.\n\t * \n\t * @param {String} style - stylesheet text expression\n\t * @param {String} id - id for the style tag (optional)\n\t */\n\tappendStyle(style,id){\n\t\tif( id ){\n\t\t\tlet element = this.view.getElementById(id);\n\t\t\tif( element ){ this.view.removeChild(element); }\n\t\t}\n\t\tlet element = document.createElement('style');\n\t\telement.textContent = style;\n\t\telement.id = id || this.componentId + '_' + _ComponentStack_js__WEBPACK_IMPORTED_MODULE_0__[\"ComponentStack\"].nextSerial();\n\t\tthis.shadow.appendChild(element);\n\t\t\n\t\tif( !this.css ){ this.css = []; }\n\t\tthis.css.push(element);\n\t}\n\t\n\t/**\n\t * Remove all styles\n\t */\n\tunloadStyle(){\n\t\tif( this.css ){\n\t\t\tfor( let i=0; i<this.css.length; i++ ){\n\t\t\t\tthis.css[i].remove();\n\t\t\t}\n\t\t\tthis.css = '';\n\t\t}\n\t}\n\t\n\t/** \n\t * Make this.view(RootView) and this.css.\n\t * \n\t * ViewController or component consumer should call this method just after instantiate the component,\n\t * or whenever you want to use the instance of this component that is not yet ready (isViewLoaded is false).\n\t * \n\t * You should not never override this method. \n\t * Use `viewDidLoad` for your additional initialization.\n\t * \n\t * If you have to implement your own `loadView` method, you must implement yours as:\n\t * \n\t * 1. this.init(); \n\t * 2. this.render(); \n\t * (here, you can access to the RootView of this component) \n\t * (your component setup is in here) \n\t * 3. set isViewLoaded to true. \n\t * 4. call this.viewDidLoad(callback); \n\t * \n\t * and incomming callback should be passed to the `viewDidLoad`.\n\t * \n\t * (this is highly recommended to be implemented as synchronous)\n\t * \n\t * @summary Make this.view(RootView) and this.css\n\t * @argument {Function} callback - callback\n\t */\n\tloadView(callback){\n\t\tthis.init();\n\t\tthis.render();\n\t\tthis.isViewLoaded = true;\n\t\tthis.viewDidLoad(callback);\n\t}\n\t\n\t/**\n\t * Remove this.view (shadow DOM) from the Shadow host, and clear memory.\n\t * \n\t * @argument {Function} callback - callback\n\t */ \n\tunloadView(callback){\n\t\tthis.viewWillDisappear();\n\t\tthis.view.remove();\n\t\tthis.viewDidDisappear();\n\t\tthis.view = '';\n\t\tthis.isViewLoaded = false;\n\t\t_ComponentStack_js__WEBPACK_IMPORTED_MODULE_0__[\"ComponentStack\"].del(this.componentId);\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Lifecycle method: \n\t * Called at the end of `loadView`. Component instance loaded and ready to use this.view. \n\t * \n\t * You have to call callback at the end of yours.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tviewDidLoad(callback){\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Lifecycle method: \n\t * Called just before appending `this.view` to the parent. \n\t * \n\t * You *must* call callback at the end of yours.\n\t * \n\t * Component RootView is now on the screen (in the browser DOM tree), \n\t * and concrete ViewController should ensure to be able to access `this.view` via global DOM tree after here.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tviewWillAppear(callback){\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Lifecycle method: \n\t * Called just after `this.view` appended to the parent. \n\t * After this method, you can access the compoenent's RootView via `document.getElementByID` and some other query selectors. \n\t * \n\t * You have to call callback at the end of yours.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tviewDidAppear(callback){\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Lifecycle method: \n\t * Called just before removing `this.view` from its parent. \n\t * You may remove your listener defined in `viewWillAppear` or `viewDidAppear`. \n\t * \n\t * You have to call callback at the end of yours.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tviewWillDisappear(callback){\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Lifecycle method: \n\t * Called just after `this.view` removed from its parent.\n\t * \n\t * You have to call callback at the end of yours.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tviewDidDisappear(callback){\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Show this component.\n\t * \n\t * TODO:\n\t * this.view.style.display should cascade original definition.\n\t * It may be `inline-block`.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\tshowComponent(callback){\n\t\tthis.view.style.display = 'block';\n\t\tthis.visible = true;\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Hide this component.\n\t * \n\t * @argument {Function} callback - callback\n\t */\n\thideComponent(callback){\n\t\tthis.view.style.display = 'none';\n\t\tthis.visible = false;\n\t\tif( callback ){ callback() }\n\t}\n\t\n\t/**\n\t * Append sub-view to this.view.\n\t * \n\t * @param {Object} options - option\n\t * @param {Element} options.target - target element to place the view\n\t * @param {Craft.UI.Componenet} options.component - sub view\n\t * @param {Function} callback - callback\n\t * @summary Append sub-view to this.view\n\t * \n\t * @example\n\t * \n\t * // append btn.view at the end of panel.view.\n\t * \n\t * panel.appendView(btn);\n\t * \n\t * // append btn.view in '#btn' under the ShadwRoot\n\t * \n\t * this.appendView({\n\t * target : this.shadow.getElementById('btn'),\n\t * component : btn\n\t * });\n\t * \n\t * // if you know the structrue of panel.view, you can append btn.view directly into the deep point of the panel.\n\t * \n\t * panel.appendView({\n\t * target : panel.shadow.getElementById('btn'),\n\t * component : btn\n\t * });\n\t * \n\t */\n\tappendSubView(options){\n\t\tif( !options ){ return; }\n\t\tlet target, component, callback;\n\t\t\n\t\tif( options instanceof Component ){\n\t\t\ttarget = this.root;\n\t\t\tcomponent = options;\n\t\t}else{\n\t\t\ttarget = options.target || this.root;\n\t\t\tcomponent = options.component;\n\t\t\tcallback = options.callback;\n\t\t}\n\t\t\n\t\tif( !component.isViewLoaded ){\n\t\t\tcomponent.loadView();\n\t\t}\n\t\t\n\t\tif( this.viewController ){\n\t\t\tcomponent.setViewController(this.viewController);\n\t\t}\n\t\t\n\t\tcomponent.parent = this;\n\t\t\n\t\tcomponent.viewWillAppear( () => {\n\t\t\ttarget.appendChild(component.view);\n\t\t\tif( callback ){ callback(); }\n\t\t\tcomponent.viewDidAppear();\n\t\t});\n\t}\n\t\n\t/** \n\t * DEPRECATED: \n\t * alias for appendSubView\n\t */\n\tappendView(options){\n\t\tthis.appendSubView(options);\n\t}\n\t\n\t/** \n\t * DEPRECATED: \n\t * alias for appendSubView\n\t */\n\tappend(options){\n\t\tthis.appendSubView(options);\n\t}\n\t\n\t/**\n\t * Remove a sub-view from this.view\n\t * \n\t * `removeView` does not call `unloadView` of the removed view.\n\t * When to parge the component is a responsibility of your component consumer.\n\t * \n\t * @param {Object} options - option or remove target Componenet\n\t * @param {Craft.UI.Componenet} options.component - Component to be removed\n\t * @param {Function} callback - callback\n\t * @summary Remove a sub-view from this.view\n\t * \n\t * @example\n\t * \n\t * // remove this.btn.view from this.view. \n\t * \n\t * this.removeView(this.btn);\n\t * \n\t */\n\tremoveSubView(options){\n\t\tif( !options ){ return; }\n\t\tlet target, component, callback;\n\t\t\n\t\tif( options instanceof Component ){\n\t\t\tcomponent = options;\n\t\t}else{\n\t\t\tcomponent = options.component;\n\t\t\tcallback = options.callback;\n\t\t}\n\t\t\n\t\tcomponent.viewWillDisappear( () => {\n\t\t\tcomponent.view.remove();\n\t\t\tif( callback ){ callback(); }\n\t\t\tcomponent.viewDidDisappear();\n\t\t});\n\t}\n\t\n\t/** \n\t * DEPRECATED:\n\t * TODO: remove this method\n\t * alias for removeSubView\n\t */\n\tremoveView(options){\n\t\tthis.removeSubView(options);\n\t}\n\t\n\t/** \n\t * Remove me from parent\n\t */\n\tremoveFromParent(options){\n\t\tthis.parent.removeSubView(this);\n\t}\n\t\n\t/**\n\t * TODO: \n\t * replaceView -> replaceSubView\n\t * \n\t * Replace view\n\t * \n\t * remove all components in the target, and append new one.\n\t * \n\t * @example\n\t * \n\t * let loading_indicator = new LoadingIndicator();\n\t * \n\t * this.appendView(loading_indicator);\n\t * \n\t * database.load(id,(data)=>{\n\t * let view = new DataView({data:data});\n\t * this.replaceView(view);\n\t * });\n\t * \n\t */\n\treplaceView(options){\n\t\tif( !options ){ return; }\n\t\tlet target, component, callback;\n\t\t\n\t\tif( options instanceof Component ){\n\t\t\ttarget = this.root;\n\t\t\tcomponent = options;\n\t\t}else{\n\t\t\ttarget = options.target || this.root;\n\t\t\tcomponent = options.component;\n\t\t\tcallback = options.callback;\n\t\t}\n\t\t\n\t\twhile(target.firstChild){\n\t\t\ttarget.removeChild(target.firstChild);\n\t\t}\n\t\tthis.appendSubView({\n\t\t\ttarget : target,\n\t\t\tcomponent : component\n\t\t});\n\t}\n\t\n\t/**\n\t * Stylesheet definition.\n\t * \n\t * If you would like to cascade styles from parent class, just append super.style\n\t * \n\t * ``` \n\t * style(componentId){\n\t * return super.style(componentId) + `\n\t * .override { ... }\n\t * `;\n\t * }\n\t * ```\n\t * \n\t * @param {String} componentId - this.componentId\n\t */\n\tstyle(componentId){ return `.root {}`; }\n\t\n\t/**\n\t * RootView template.\n\t * \n\t * `template` must have only one element.\n\t * \n\t * @param {String} componentId - this.componentId\n\t */\n\ttemplate(componentId){ return `<div class=\"root\"></div>`; }\n}\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/Component.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/ComponentStack.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/ComponentStack.js ***!
\*****************************************************************************/
/*! exports provided: ComponentStack */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ComponentStack\", function() { return ComponentStack; });\n/* harmony import */ var _Defaults_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Defaults.js */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js\");\n\n\n\n/** \n * Provides global Component access. \n * \n * You may love to set`Craft.Core.Defaults.ALLOW_COMPONENT_SHORTCUT = true` to be able to access component via its id.\n * \n * ### Example in your template\n * \n * ``` \n * <!-- fully qualified -->\n * <div onclick=\"window.Craft.Core.ComponentStack.get('${componentId}').action()\">action</div>\n * \n * <!-- ALLOW_COMPONENT_SHORTCUT is true -->\n * <div onclick=\"${componentId}.action()\">action</div>\n * ``` \n * \n * @namespace Craft.Core.ComponentStack\n * @packagename Craft.Core.ComponentStack\n * \n */\nvar ComponentStack = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.ComponentStack',\n\t\n\t/** @private */\n\tcounter : 0,\n\t\n\t/** @private */\n\tcontainer : {},\n\t\n\t/**\n\t * Shortcut for set\n\t * \n\t * @memberof Craft.Core.ComponentStack\n\t * @method Craft.Core.ComponentStack.push\n\t */\n\tpush : function(component){\n\t\tthis.container[component.componentId] = component;\n\t},\n\n\t/**\n\t * Set component into the stack\n\t * \n\t * @memberof Craft.Core.ComponentStack\n\t * @method Craft.Core.ComponentStack.set\n\t * \n\t * @param {String} componentId - componentId\n\t * @param {Craft.Core.Component} component - component\n\t */\n\tset : function(componentId,component){\n\t\tthis.container[componentId] = component;\n\t\tif( _Defaults_js__WEBPACK_IMPORTED_MODULE_0__[\"Defaults\"].ALLOW_COMPONENT_SHORTCUT ){\n\t\t\twindow[componentId] = component;\n\t\t}\n\t},\n\t\n\t/**\n\t * Get component from the stack\n\t * \n\t * @memberof Craft.Core.ComponentStack\n\t * @method Craft.Core.ComponentStack.get\n\t * \n\t * @param {string} componentId - componentId\n\t */\n\tget : function(componentId){\n\t\treturn this.container[componentId];\n\t},\n\t\n\t/**\n\t * Delete component from the stack\n\t * \n\t * @memberof Craft.Core.ComponentStack\n\t * @method Craft.Core.ComponentStack.del\n\t * \n\t * @param {string} componentId - componentId\n\t */\n\tdel : function(componentId){\n\t\tdelete this.container[componentId];\n\t\tif( _Defaults_js__WEBPACK_IMPORTED_MODULE_0__[\"Defaults\"].ALLOW_COMPONENT_SHORTCUT ){\n\t\t\tdelete window[componentId];\n\t\t}\n\t},\n\t\n\t/**\n\t * Publish new serial number. Actual componentId will be made by its packagename.\n\t * \n\t * @memberof Craft.Core.ComponentStack\n\t * @method Craft.Core.ComponentStack.nextSerial\n\t * \n\t * @return {Number}\n\t */\n\tnextSerial : function(){\n\t\treturn this.counter++;\n\t}\n\t\n};\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/ComponentStack.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js":
/*!**********************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js ***!
\**********************************************************************/
/*! exports provided: Context */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Context\", function() { return Context; });\n/* harmony import */ var _Defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Defaults */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js\");\n/* harmony import */ var _HashRouter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HashRouter */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/HashRouter.js\");\n\n\n\n\n/** \n * Application context.\n * \n * @namespace Craft.Core.Context\n * @packagename Craft.Core.Context\n */\nvar Context = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.Context',\n\t\n\t/** \n\t * RootViewController of this application.\n\t * @private\n\t */\n\trootViewController : '',\n\t\n\t/** \n\t * Concrete application boot loader.\n\t * @private \n\t */\n\tapp : '', \n\t\n\t/**\n\t * Set your application bootloader.\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.setApp\n\t * \n\t * @param {Object} app - your application bootloader\n\t * @param {Function} app.didBootApplication - called jsut after core system booted\n\t */\n\tsetApp : function(app){\n\t\tthis.app = app;\n\t\t\n\t\tif( this.app.router ){\n\t\t\tthis.router = this.app.router;\n\t\t}else{\n\t\t\tthis.router = _HashRouter__WEBPACK_IMPORTED_MODULE_1__[\"HashRouter\"];\n\t\t}\n\t},\n\t\n\t/**\n\t * Get your application bootloader.\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.getApp\n\t * \n\t * @return {Object} app - your application bootloader\n\t */\n\tgetApp : function(){\n\t\treturn this.app;\n\t},\n\t\n\t/**\n\t * Setting Root-Element of your app.\n\t * \n\t * If you have your RootViewController, \n\t * `Craft.Core.Context.setRootViewController()` will set Root-Element according to`Craft.Core.Default.BASE_DIV_NAME`.\n\t * Otherwise, this is optional.\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.setRootElement\n\t * \n\t * @param {Element} rootElement \n\t */\n\tsetRootElement : function(rootElement){\n\t\tthis.rootElement = rootElement;\n\t},\n\t\n\t/**\n\t * Getting Root-Element of your app.\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.getRootElement\n\t * \n\t * @return {Element} rootElement \n\t */\n\tgetRootElement : function(){\n\t\treturn this.rootElement;\n\t},\n\t\n\t/**\n\t * Setting RootViewController of you application. \n\t * \n\t * If you want to manage popstate and history, you have to set your RootViewController that implements appropriate interface.\n\t * @see {@link Craft.UI.DefaultViewController}\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.setRootViewController\n\t * \n\t * @param {Craft.UI.ViewController} rootViewController - rootViewController#resolveRoutingRequest required\n\t */\n\tsetRootViewController : function(rootViewController){\n\t\tthis.rootViewController = rootViewController;\n\t\tif( !this.rootElement ){\n\t\t\tthis.rootElement = document.getElementById(_Defaults__WEBPACK_IMPORTED_MODULE_0__[\"Defaults\"].BASE_DIV_NAME);\n\t\t}\n\t\trootViewController.viewWillAppear();\n\t\tif( !rootViewController.isViewLoaded ){\n\t\t\trootViewController.loadView();\n\t\t}\n\t\tthis.rootElement.appendChild(rootViewController.view);\n\t\trootViewController.viewDidAppear();\n\t\t\n\t\t// delegate popstate event to the RootViewController\n\t\twindow.addEventListener('popstate',(event) => {\n\t\t\trootViewController.didReceivePopstate(event);\n\t\t});\n\t},\n\t\n\t/**\n\t * Getting RootViewController.\n\t * \n\t * @memberof Craft.Core.Context\n\t * @method Craft.Core.Context.getRootViewController\n\t * \n\t * @return {Craft.UI.ViewController} - RootViewController of you application\n\t */\n\tgetRootViewController : function(){\n\t\treturn this.rootViewController;\n\t},\n\t\n\t/** \n\t * Concrete router object.\n\t * @private \n\t */\n\trouter : '', \n\t\n\t/**\n\t * set router. always called by setApp().\n\t * \n\t * @param {Craft.Core.Router} router - Router implementation\n\t * \n\t * @memberof Craft.Core.Context\n\t * @member Craft.Core.Context.setRouter\n\t */\n\tsetRouter : function(router){\n\t\tthis.router = router;\n\t},\n\t\n\t/**\n\t * get router\n\t * \n\t * @memberof Craft.Core.Context\n\t * @member Craft.Core.Context.getRouter\n\t * \n\t * @return {Craft.Core.Router} - return router implementation\n\t */\n\tgetRouter : function(){\n\t\treturn this.router;\n\t},\n\t\n};\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js":
/*!***********************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js ***!
\***********************************************************************/
/*! exports provided: Defaults */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Defaults\", function() { return Defaults; });\n\n/** \n * Application default variables.\n * \n * @namespace Craft.Core.Defaults\n * @packagename Craft.Core.Defaults\n * \n * @example\n * \n * Craft.Core.Defaults.BASE_DIV_NAME = 'CraftRoot';\n * Craft.Core.Defaults.ALLOW_COMPONENT_SHORTCUT = true;\n * \n */\nvar Defaults = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.Defaults',\n\t\n\t/**\n\t * Element.id of the root element. \n\t * It is recommended to use default (CraftRoot).\n\t * \n\t * @memberof Craft.Core.Defaults\n\t * @member Craft.Core.Defaults.BASE_DIV_NAME\n\t * \n\t * @example\n\t * \n\t * // at your bootloader\n\t * Craft.Core.Defaults.BASE_DIV_NAME = 'ROOT';\n\t * \n\t * // at any place\n\t * let rootElement = document.getElementById(Craft.Core.Defaults.BASE_DIV_NAME);\n\t * \n\t * // if your RootViewController is managed by Craft.Core.Context, you may get the same result by:\n\t * let rootElement = Craft.Core.Contest.getRootElement();\n\t * \n\t */\n\tBASE_DIV_NAME : 'CraftRoot',\n\t\n\t/**\n\t * Whether to use component shortcut. \n\t * \n\t * True to set `window['componentId'] = component`, to be able to use `${componentId}.method()` in template. \n\t * This is set to false by default, but it is recommended to set to true at the start of your application bootloader.\n\t * \n\t * @memberof Craft.Core.Defaults\n\t * @member Craft.Core.Defaults.ALLOW_COMPONENT_SHORTCUT\n\t */\n\tALLOW_COMPONENT_SHORTCUT : false,\n\t\n};\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/Defaults.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/Gesture.js":
/*!**********************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/Gesture.js ***!
\**********************************************************************/
/*! exports provided: Gesture */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Gesture\", function() { return Gesture; });\n\n/** \n * Entry point for gesture.\n * \n * @namespace Craft.Core.Gesture\n * @packagename Craft.Core.Gesture\n */\nvar Gesture = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.Gesture',\n\t\n\t/**\n\t * Enable tap\n\t * \n\t * @memberof Craft.Core.Gesture\n\t * @method Craft.Core.Gesture.enableTap\n\t * \n\t * @param {Element} options.target - target element\n\t * @param {Function} options.tap - tap handler\n\t * @return {Craft.Core.Gesture.Swipe} swipe handling instance (see code)\n\t * \n\t * @example\n\t * \n\t * Craft.Core.Gesture.enableTap({\n\t * target : this.view.querySelector('#id'),\n\t * tap : tapHandler\n\t * });\n\t * \n\t */\n\tenableTap : function(options){\n\t\treturn new Tap(options);\n\t},\n\t\n\t/**\n\t * Enable swipe\n\t * \n\t * @memberof Craft.Core.Gesture\n\t * @method Craft.Core.Gesture.enableSwipe\n\t * \n\t * @param {Element} options.target - target element\n\t * @param {Number} options.left - swipe left hander\n\t * @param {Number} options.right - swipe right hander\n\t * @param {Number} options.up - swipe up hander\n\t * @param {Number} options.down - swipe down hander\n\t * @param {Number} options.DIFF_THRESHOLD - movement should more than this\n\t * @param {Number} options.TIME_THRESHOLD - time should be more than this\n\t * @param {Number} options.MULTI_THRESHOLD - last multi-touch more than before\n\t * @return {Craft.Core.Gesture.Tap} tap handling instance (see code)\n\t * \n\t * @example\n\t * \n\t * Craft.Core.Gesture.enableSwipe({\n\t * target : this.view.querySelector('#id'),\n\t * left : swipeLeftHandler,\n\t * right : swipeRgihtHandler,\n\t * up : swipeUpHandler,\n\t * down : swipeDownHandler,\n\t * });\n\t * \n\t */\n\tenableSwipe : function(options){\n\t\treturn new Swipe(options);\n\t}\n\t\n};\n\n/** \n * Internal class for handling tap \n * @private\n */\nclass Tap {\n\t\n\t/**\n\t * Make tap handler instance\n\t * @param {Element} options.target - target element\n\t * @param {Function} options.tap - tap handler\n\t */\n\tconstructor(options){\n\t\tthis.packagename = 'Craft.Core.Gesture.Tap';\n\t\t\n\t\tthis.target = options.target;\n\t\tthis.tapHandler = options.tap;\n\t\t\n\t\tif( 'ontouchend' in window ){\n\t\t\tthis.target.addEventListener('touchend', this.handleTouchEnd.bind(this), false); // mobile\n\t\t}else{\n\t\t\tthis.target.addEventListener('mouseup', this.handleTouchEnd.bind(this), false); // pc\n\t\t}\n\t}\n\t\n\t/**\n\t * Call by tap event\n\t * @param {UIEvent} event - TouchEvent|MouseEvent\n\t */\n\thandleTouchEnd(event){\n\t\tif( this.tapHandler ){\n\t\t\tthis.tapHandler(event);\n\t\t}\n\t}\n};\n\n/** \n * Internal clss for handling swipe \n * @private\n */\nclass Swipe {\n\t\n\t/**\n\t * Make swipe handler instance\n\t * @param {Element} options.target - target element\n\t * @param {Function} options.left - swipe left hander\n\t * @param {Function} options.right - swipe right hander\n\t * @param {Function} options.up - swipe up hander\n\t * @param {Function} options.down - swipe down hander\n\t * @param {Number} options.DIFF_THRESHOLD - movement should more than this\n\t * @param {Number} options.TIME_THRESHOLD - time should be more than this\n\t * @param {Number} options.MULTI_THRESHOLD - last multi-touch more than before\n\t */\n\tconstructor(options){\n\t\tthis.packagename = 'Craft.Core.Gesture.Swipe';\n\t\t\n\t\tthis.target = options.target;\n\t\t\n\t\tthis.target.addEventListener('touchstart', this.handleTouchStart.bind(this), false); \n\t\tthis.target.addEventListener('touchmove', this.handleTouchMove.bind(this), false);\n\t\t\n\t\tthis.swipeLeftHandler = options.left;\n\t\tthis.swipeRightHandler = options.right;\n\t\tthis.swipeUpHandler = options.up;\n\t\tthis.swipeDownHandler = options.down;\n\t\t\n\t\tthis.DIFF_THRESHOLD = options.DIFF_THRESHOLD || 50;\n\t\tthis.TIME_THRESHOLD = options.TIME_THRESHOLD || 40;\n\t\tthis.MULTI_THRESHOLD = options.MULTI_THRESHOLD || 60;\n\t\t\n\t\tthis.xDown = null;\n\t\tthis.yDown = null;\n\t\tthis.tDown = null;\n\t\t\n\t\tthis.lastMultiTouch = null;\n\t}\n\t\n\t/**\n\t * Called by touch start event\n\t * @param {TouchEvent} event - TouchEvent\n\t */\n\thandleTouchStart(event){\n\t\tlet firstTouch = event.touches[0];\n\t\tthis.xDown = firstTouch.clientX;\n\t\tthis.yDown = firstTouch.clientY;\n\t\tthis.tDown = Date.now();\n\t}\n\t\n\t/**\n\t * Called by touch end event\n\t * @param {TouchEvent} event - TouchEvent\n\t */\n\thandleTouchMove(event){\n\t\tif( !this.xDown || !this.yDown || !this.tDown ){\n\t\t\treturn;\n\t\t}\n\t\tif( event.touches.length > 1 ){\n\t\t\tthis.lastMultiTouch = Date.now();\n\t\t\treturn; // multi touch\n\t\t}\n\t\t\n\t\tlet xUp = event.touches[0].clientX;\n\t\tlet yUp = event.touches[0].clientY;\n\t\t\n\t\tlet xDiff = this.xDown - xUp;\n\t\tlet yDiff = this.yDown - yUp;\n\t\tlet tDiff = Date.now() - this.tDown;\n\t\tlet mDiff = Date.now() - this.lastMultiTouch;\n\t\t\n\t\tif( Math.abs(xDiff) + Math.abs(yDiff) < this.DIFF_THRESHOLD ){\n\t\t\treturn;\n\t\t}\n\t\tif( tDiff < this.TIME_THRESHOLD ){\n\t\t\treturn;\n\t\t}\n\t\tif( mDiff < this.MULTI_THRESHOLD ){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( Math.abs( xDiff ) > Math.abs( yDiff ) ){\n\t\t\tif( xDiff > 0 ){\n\t\t\t\tif( this.swipeLeftHandler ){ this.swipeLeftHandler(event); }\n\t\t\t}else{\n\t\t\t\tif( this.swipeRightHandler ){ this.swipeRightHandler(event); }\n\t\t\t}\n\t\t}else{\n\t\t\tif( yDiff > 0 ){\n\t\t\t\tif( this.swipeUpHandler ){ this.swipeUpHandler(event); }\n\t\t\t}else{ \n\t\t\t\tif( this.swipeDownHandler){ this.swipeDownHandler(event); }\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.xDown = null;\n\t\tthis.yDown = null;\n\t\tthis.tDown = null;\n\t}\n\t\n};\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/Gesture.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/HashRouter.js":
/*!*************************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/HashRouter.js ***!
\*************************************************************************/
/*! exports provided: HashRouter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HashRouter\", function() { return HashRouter; });\n/* harmony import */ var _Route__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Route */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Route.js\");\n/* harmony import */ var _Context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Context */ \"./node_modules/@craftkit/craft-uikit/src/Craft/Core/Context.js\");\n\n\n\n\n\n/** \n * router by hash strategy\n * \n * @namespace Craft.Core.HashRouter\n * @packagename Craft.Core.HashRouter\n */\nvar HashRouter = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.HashRouter',\n\t\n\t/**\n\t * make Route from location.hash\n\t * \n\t * @memberof Craft.Core.HashRoute\n\t * @method Craft.Core.HashRoute.route\n\t * \n\t * @param {PopStateEvent} event - PopStateEvent\n\t * @param {Boolean} launch - true if this is the first launch, or access from out side of application history scope caused by browser back/foward\n\t */\n\troute : function(event,launch){\n\t\tlet hash = window.location.hash;\n\t\tlet match = hash.match(/^#\\/(.*)/);\n\t\tlet path = '';\n\t\tif( match ){\n\t\t\tpath = match[1];\n\t\t}\n\t\t\n\t\tlet route = new _Route__WEBPACK_IMPORTED_MODULE_0__[\"Route\"]({\n\t\t\tlaunch : launch,\n\t\t\tpath : path,\n\t\t\tevent : event || {}\n\t\t});\n\t\t\n\t\t_Context__WEBPACK_IMPORTED_MODULE_1__[\"Context\"].getRootViewController().resolveRoutingRequest(route);\n\t},\n\t\n\t/**\n\t * normalize path\n\t * \n\t * Concrete RootViewController that has a responsibility for routing request should normalize path to absorb the inaccuracy.\n\t * \n\t * @memberof Craft.Core.PathRoute\n\t * @method Craft.Core.PathRoute.normalize\n\t * \n\t * @param {String} path - path for component\n\t */\n\tnormalize : function(path){\n\t\tif( !path ){ path = ''; }\n\t\tpath = path.replace(/^#*\\/*/,'');\n\t\treturn '#/'+path;\n\t}\n\t\n};\n\n\n\n//# sourceURL=webpack://Demo/./node_modules/@craftkit/craft-uikit/src/Craft/Core/HashRouter.js?");
/***/ }),
/***/ "./node_modules/@craftkit/craft-uikit/src/Craft/Core/KeyboardManager.js":
/*!******************************************************************************!*\
!*** ./node_modules/@craftkit/craft-uikit/src/Craft/Core/KeyboardManager.js ***!
\******************************************************************************/
/*! exports provided: KeyboardManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"KeyboardManager\", function() { return KeyboardManager; });\n\n/** \n * Global key-press event manager. \n * \n * Before you use this utility, you have to call `activate`. \n * (You will call this in your bootstrap)\n * \n * You have to manage your registration key by yourself.\n * \n * @namespace Craft.Core.KeyboardManager\n * @packagename Craft.Core.KeyboardManager\n * \n * @example\n * \n * const ESC_KEY = 27;\n * \n * Craft.Core.KeyboardManager.activate();\n * \n * const action_id = 'action_name'+this.componentId;\n * \n * Craft.Core.KeyboardManager.register(action_id,ESC_KEY, () => {\n * this.work_when_esc_pressed();\n * Craft.Core.KeyboardManager.remove(action_id);\n * });\n * \n */\nvar KeyboardManager = {\n\t\n\t/** @private */\n\tpackagename : 'Craft.Core.KeyboardManager',\n\t\n\t/** @private */\n\tkeyboard_actions : {},\n\t\n\t/**\n\t * key-press handler\n\t * @private\n\t * @param {KeyboardEvent} e - KeyboardEvent\n\t */\n\thandler : function(e){\n\t\tCraft.Core.KeyboardManager.action(e.keyCode);\n\t},\n\t\n\t/**\n\t * Activate KeyboardManager\n\t * \n\t * @memberof Craft.Core.KeyboardManager\n\t * @method Craft.Core.KeyboardManager.activate\n\t */\n\tactivate : function(){\n\t\twindow.addEventListener('keyup',this.handler);\n\t},\n\t\n\t/**\n\t * Deactivate KeyboardManager\n\t */\n\tdeactivate : function(){\n\t\twindow.removeEventListener('keyup',this.handler);\n\t},\n\t\n\t/**\n\t * Register key-press handler\n\t * \n\t * @memberof Craft.Core.KeyboardManager\n\t * @method Craft.Core.KeyboardManager.register\n\t * \n\t * @param {String} id - identifier\n\t * @param {Number} key - key number ex) ESC:27\n\t * @param {Function} action - handler\n\t */\n\tregister : function(id,key,action){\n\t\tif( !(id && key && action) ){ return; }\n\t\tif( !this.keyboard_actions[key] ){\n\t\t\tthis.