UNPKG

framevuerk

Version:

Fast, Responsive, Without Dependencies, Both Direction Support and Configurable UI Framework based on Vue.js.

1,538 lines (1,412 loc) 336 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["Framevuerk"] = factory(); else root["Framevuerk"] = factory(); })(typeof self !== 'undefined' ? self : this, function() { return /******/ (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, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // 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 = 81); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = normalizeComponent; /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + 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 = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // 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 var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Parent = function () { function Parent() { _classCallCheck(this, Parent); this.calcWindow(); // this.$el = window.document.body this.lockRequests = {}; } _createClass(Parent, [{ key: 'calcWindow', value: function calcWindow() { this.$window = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' ? window : null; this.$document = this.$window ? this.$window.document : null; this.$body = this.$window ? this.$window.document.body : null; this.$documentElement = this.$window ? this.$window.document.documentElement : null; this.$scrollingElement = this.$window ? this.$window.document.scrollingElement : null; } }, { key: 'getSize', value: function getSize() { this.calcWindow(); var breakXs = 480; var breakSm = 768; var breakMd = 992; var breakLg = 1200; var size = this.$body ? this.$body.offsetWidth : 768; var ret = []; if (size < breakXs) { ret.push('xs'); } if (size >= breakXs) { ret.push('sm'); } if (size >= breakSm) { ret.push('md'); } if (size >= breakMd) { ret.push('lg'); } if (size >= breakLg) { ret.push('xl'); } return ret; } }, { key: 'lock', value: function lock() { var by = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'x'; this.calcWindow(); if (!this.$body) { return; } this.$body.classList.add('fv-lock'); this.lockRequests[by] = true; } }, { key: 'getViewport', value: function getViewport() { this.calcWindow(); if (!this.$window) { return; } return { width: this.$window.innerWidth, height: this.$window.innerHeight }; } }, { key: 'getScrollPosition', value: function getScrollPosition() { this.calcWindow(); if (!this.$body || !this.$scrollingElement || !this.$documentElement) { return; } return { top: this.$body.scrollTop || this.$documentElement.scrollTop || 0, height: this.$scrollingElement.offsetHeight || 0 }; } }, { key: 'unlock', value: function unlock() { var by = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'x'; this.calcWindow(); if (!this.$body || !this.lockRequests[by]) { return; } delete this.lockRequests[by]; if (Object.keys(this.lockRequests).length === 0) { this.$body.classList.remove('fv-lock'); } } }, { key: 'newEl', value: function newEl(tag) { var classList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; this.calcWindow(); if (!this.$document || !this.$body) { return; } var el = this.$document.createElement(tag); el.className = classList; this.$body.appendChild(el); return el; } }, { key: 'appendChild', value: function appendChild(tagName) { this.calcWindow(); if (!this.$body) { return; } return this.$body.appendChild(tagName); } }, { key: 'on', value: function on(name) { this.calcWindow(); if (!this.$window) { return; } if (name === 'outsideclick') { var currentEl = arguments[1]; var handler = arguments[2]; // why we keep this? to allow us to disable it later currentEl.stopPropagationHandler = function (event) { event.stopPropagation(); }; currentEl.inlineClickHandler = function (event) { var target = event.target; if (!currentEl.contains(target)) { handler(); } }; this.$window.addEventListener('click', currentEl.inlineClickHandler); this.$window.addEventListener('touchstart', currentEl.inlineClickHandler); } else if (name === 'sizechange') { this.$window.addEventListener('resize', arguments[1]); } else { var obj = arguments[2] ? this.$body : this.$window; obj.addEventListener(name, arguments[1]); } } }, { key: 'off', value: function off(name) { this.calcWindow(); if (!this.$window) { return; } if (name === 'outsideclick') { var currentEl = arguments[1]; this.$window.removeEventListener('click', currentEl.inlineClickHandler); this.$window.removeEventListener('touchstart', currentEl.inlineClickHandler); } else if (name === 'sizechange') { this.$window.removeEventListener('resize', arguments[1]); } else { var obj = arguments[2] ? this.$body : this.$window; obj.removeEventListener(name, arguments[1]); } } }]); return Parent; }(); exports.default = new Parent(); /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\" stroke=\"currentColor\" fill=\"none\">\r\n<polyline stroke-width=\"2\" stroke-miterlimit=\"10\" points=\"20.815,9 11.622,17.192 2.43,9\"/>\r\n</svg>\r\n" /***/ }), /* 3 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 4 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 5 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 6 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js___ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js___); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSidebar_vue_vue_type_script_lang_js____default.a); /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _parent = __webpack_require__(1); var _parent2 = _interopRequireDefault(_parent); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { props: { value: { type: Boolean }, pin: { type: [Boolean, Object], validator: function validator(value) { return [true, false, null].indexOf(value) > -1; }, default: null } }, data: function data() { return { isPinned: this.pin || false }; }, computed: { classList: function classList() { var position = this.getPosition(); return { left: position === 'left', right: position === 'right', pin: this.isPinned, unpin: !this.isPinned }; } }, watch: { value: function value(_value) { var _this = this; if (!this.isPinned) { if (_value) { _parent2.default.lock(this._uid); setTimeout(function () { _parent2.default.on('outsideclick', _this.$el, _this.close); }); } else { _parent2.default.unlock(this._uid); _parent2.default.off('outsideclick', this.$el, this.close); } } } }, methods: { close: function close() { this.$emit('input', false); }, openRequest: function openRequest() { this.$emit('input', true); }, getPosition: function getPosition() { if (!this.$el) { return "left"; } if (this.$el.nextSibling) { return "left"; } return "right"; }, onToggle: function onToggle(value) { this.$emit('input', value === 'open'); this.$emit(value); }, onResize: function onResize(event) { if (this.pin !== null) { return; } var isSmall = _parent2.default.getSize().indexOf('lg') === -1; if (this.isPinned === false) { this.close(); } if (isSmall) { this.isPinned = false; this.$emit('pinChange', false); this.close(); } else { this.isPinned = true; this.$emit('pinChange', true); this.openRequest(); } } }, mounted: function mounted() { _parent2.default.on('sizechange', this.onResize); this.onResize(); }, beforeDestroy: function beforeDestroy() { _parent2.default.off('sizechange', this.onResize); _parent2.default.unlock(this._uid); _parent2.default.off('outsideclick', this.$el, this.close); } }; // // // // // // // // // // /***/ }), /* 9 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js___ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js___); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvForm_vue_vue_type_script_lang_js____default.a); /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // exports.default = { methods: { submit: function submit() { function fvValidate(child) { if (typeof child.disabled !== 'undefined' && child.disabled) { return true; } if (typeof child.fvValidate !== 'undefined' && !child.fvValidate) { return false; } return true; } function focus(child) { if (typeof child.focus === 'function') { child.focus(); } else if (typeof child.$el.focus === 'function') { child.$el.focus(); } } function warn(child) { if (typeof child.warn === 'function') { child.warn(); } } function getChilds(parent) { var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var ret = []; if ((parent.$el.classList.contains('fv-form') || typeof parent.fvValidate !== 'undefined') && !force) { return []; } parent.$children.forEach(function (child) { ret.push(child); if (child.$children.length) { ret = ret.concat(getChilds(child, false)); } }); return ret; } var childs = getChilds(this, true); var invalids = []; childs.forEach(function (child) { if (!fvValidate(child)) { invalids.push(child); warn(child); } }); if (invalids.length) { focus(invalids[0]); this.$emit('reject', invalids); } else { this.$emit('submit'); } } } }; /***/ }), /* 12 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js___ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js___); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvSelect_vue_vue_type_script_lang_js____default.a); /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _ARR = __webpack_require__(2); var _ARR2 = _interopRequireDefault(_ARR); var _CLS = __webpack_require__(15); var _CLS2 = _interopRequireDefault(_CLS); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { props: { value: { default: undefined }, options: { type: Array, default: function _default() { return []; } }, disabledKey: { type: String, default: 'disabled' }, valueKey: { type: String, default: 'value' }, textKey: { type: String, default: 'text' }, required: { type: [Boolean, Function], default: false }, disabled: { type: Boolean, default: false }, search: { type: [Object, Boolean], validator: function validator(value) { return [true, false, null].indexOf(value) > -1; }, default: true }, placeholder: { type: String, default: '' }, multiple: { type: Boolean, default: false }, allowInsert: { type: Boolean, default: false }, loading: { type: Boolean, default: false }, deleteButton: { type: Boolean, default: true } }, data: function data() { return { isFocused: false, searchQuery: '', caretIcon: _ARR2.default, insertIcon: _CLS2.default }; }, computed: { filteredOptions: function filteredOptions() { var _this = this; return this.options.filter(function (option) { if (_this.search === true) { if (JSON.stringify(option).toUpperCase().indexOf(_this.searchQuery.toUpperCase()) !== -1) { return true; } return false; } return true; }); }, fvValidate: function fvValidate() { if (this.required === true) { if (typeof this.value === 'undefined' || this.value instanceof Array && this.value.length === 0) { return false; } return true; } else if (typeof this.required === 'function') { return this.required(this.value); } return true; } }, methods: { focus: function focus() { this.$refs.inputBox.focus(); }, setStructure: function setStructure() { if (this.multiple && (typeof this.value === 'undefined' || !(this.value instanceof Array))) { this.$emit('input', []); } }, onInsert: function onInsert(userString) { this.$emit('insert', userString); this.searchQuery = ''; }, onSearch: function onSearch() { if (this.$refs.list) { this.$refs.list.moveHighlight(null); } this.$emit('search', this.searchQuery); }, optionProp: function optionProp(option, prop) { if (!prop) { return option; } switch (prop) { case 'value': return this.valueKey ? option[this.valueKey] : option; case 'text': return this.textKey ? option[this.textKey] : option; case 'disabled': return this.disabledKey ? option[this.disabledKey] : false; } }, valueProp: function valueProp(value, prop) { var _this2 = this; var founded = this.options.find(function (option) { return _this2.optionProp(option, 'value') === value; }); if (!prop) { return founded; } if (typeof founded !== 'undefined') { return this.optionProp(founded, prop); } return value; }, clickOption: function clickOption(option) { if (this.isSelectedOption(option) && this.multiple) { var optionValue = this.optionProp(option, 'value'); this.deleteValue(optionValue); } else { this.selectOption(option); } this.searchQuery = ''; }, selectOption: function selectOption(option) { var newValue = void 0; var optionValue = this.optionProp(option, 'value'); if (this.multiple) { newValue = [].concat(_toConsumableArray(this.value), [optionValue]); } else { newValue = optionValue; } this.$emit('input', newValue); }, deleteValue: function deleteValue(value) { if (this.multiple) { if (typeof value === 'undefined') { this.$emit('input', []); } else { var newValue = JSON.parse(JSON.stringify(this.value)); var indexOf = newValue.findIndex(function (selectedValue) { return JSON.stringify(selectedValue) === JSON.stringify(value); }); if (indexOf !== -1) { newValue.splice(indexOf, 1); } this.$emit('input', newValue); } } else { this.$emit('input', undefined); } }, isSelectedOption: function isSelectedOption(option) { var _this3 = this; if (typeof this.value === 'undefined') { return false; } if (this.multiple) { var indexOf = this.value.findIndex(function (selectedValue) { return JSON.stringify(selectedValue) === JSON.stringify(_this3.optionProp(option, 'value')); }); if (indexOf !== -1) { return true; } return false; } return this.optionProp(option, 'value') === this.valueProp(this.value, 'value'); }, onKeydown: function onKeydown(event) { switch (event.which) { case 37: // left case 38: // up case 39: // right case 40: // down case 13: // enter if (this.$refs.list) { this.$refs.list.onKeydown(event); } break; case 8: // backspace if (this.searchQuery.length === 0 && this.deleteButton) { if (this.multiple) { if (this.value.length) { this.deleteValue(this.value[this.value.length - 1]); } } else { this.deleteValue(); } } break; case 46: // delete this.searchQuery = ''; if (this.deleteButton) { this.deleteValue(); } } } }, created: function created() { this.setStructure(); }, watch: { value: function value() { var _this4 = this; this.$nextTick(function () { if (!_this4.multiple) { _this4.$refs.inputBox.close(); } else { _this4.$refs.inputBox.focusInput(); } }); } } }; /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\" stroke=\"currentColor\" fill=\"none\">\r\n<line stroke-width=\"2\" stroke-miterlimit=\"10\" x1=\"4\" y1=\"4\" x2=\"20\" y2=\"20\"/>\r\n<line stroke-width=\"2\" stroke-miterlimit=\"10\" x1=\"20\" y1=\"4\" x2=\"4\" y2=\"20\"/>\r\n</svg>\r\n" /***/ }), /* 16 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js___ = __webpack_require__(18); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js___); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvDatepicker_vue_vue_type_script_lang_js____default.a); /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _ARR = __webpack_require__(2); var _ARR2 = _interopRequireDefault(_ARR); var _WRR = __webpack_require__(113); var _WRR2 = _interopRequireDefault(_WRR); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { props: { value: { default: undefined }, defaultValue: { default: Date.now() }, required: { type: [Boolean, Function], default: false }, disabled: { type: Boolean, default: false }, placeholder: { type: String, default: '' }, deleteButton: { type: Boolean, default: true }, dateLibrary: { type: [Object, Function] } }, data: function data() { return { Date: this.dateLibrary || Date, editingValue: undefined, visualProps: {}, weekDayNames: [], monthNames: [], searchQuery: undefined }; }, created: function created() { this.setEditingValue(true); var dt = new this.Date(); dt.setDate(dt.getDate() - dt.getDay()); for (var i = 0; i < 7; i++) { this.weekDayNames.push(dt.toString().split(' ')[0]); dt.setDate(dt.getDate() + 1); } dt.setDate(1); dt.setMonth(0); for (var _i = 0; _i < 12; _i++) { this.monthNames.push(dt.toString().replace(/[0-9,۰-۹]/g, '').split(' ').filter(function (p) { return !!p; })[1]); dt.setMonth(dt.getMonth() + 1); } }, computed: { fvValidate: function fvValidate() { if (this.required === true) { if (!this.value) { return false; } return true; } else if (typeof this.required === 'function') { return this.required(this.value); } return true; }, defaultFormattedValue: function defaultFormattedValue() { if (this.value) { var value = new this.Date(this.value); return value.getDate() + '/' + (value.getMonth() + 1) + '/' + value.getFullYear(); } return ''; }, icons: function icons() { return { icon: _ARR2.default, iconY: _WRR2.default, nextMonth: true ? 'rotate(-90deg)' : 'rotate(90deg)', prevMonth: true ? 'rotate(90deg)' : 'rotate(-90deg)', nextYear: true ? 'rotate(-90deg)' : 'rotate(90deg)', prevYear: true ? 'rotate(90deg)' : 'rotate(-90deg)' }; } }, methods: { onTyping: function onTyping(value) { var text = value.toString(); var digits = value.replace(/[^0-9]/g, ''); // if use type a seprator if (digits.length !== text.length) { this.searchQuery = ''; var editingValue = new this.Date(this.editingValue); var number = parseInt(digits); if (number.toString().length === 4) { editingValue.setFullYear(number); } else if (number.toString().length <= 2 && number <= 12 && this.searchQuery !== ' ') { editingValue.setMonth(number - 1); } this.$set(this, 'editingValue', editingValue); this.calcVisualProps(); } }, onOpen: function onOpen() { this.searchQuery = ''; this.setEditingValue(true); }, deleteValue: function deleteValue() { this.searchQuery = ''; this.$emit('input', undefined); }, setEditingValue: function setEditingValue() { var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!this.editingValue || force) { this.editingValue = new this.Date(this.value || this.defaultValue); this.calcVisualProps(); } }, monthFirstDay: function monthFirstDay(month, year) { return new this.Date(year, month, 1).getDay(); }, daysInMonth: function daysInMonth(month, year) { return new this.Date(year, month + 1, 0).getDate(); }, calcVisualProps: function calcVisualProps() { var visualProps = { year: this.editingValue.getFullYear(), month: this.editingValue.getMonth() + 1, date: this.editingValue.getDate(), monthFirstDay: this.monthFirstDay(this.editingValue.getMonth(), this.editingValue.getFullYear()), daysInMonth: this.daysInMonth(this.editingValue.getMonth(), this.editingValue.getFullYear()) }; this.$set(this, 'visualProps', visualProps); return visualProps; }, focus: function focus() { this.$refs.inputBox.focus(); }, dpRow: function dpRow(dp, month, year) { var _this = this; var calc = function calc(d, dp) { var date = d + (dp - 1) * 7 - _this.visualProps.monthFirstDay; var hidden = !(date > 0 && date <= _this.visualProps.daysInMonth); var realDate = date; var realMonth = month; var realYear = year; if (date < 1 || date > _this.visualProps.daysInMonth) { var dt = new _this.Date(year, month, date); realDate = dt.getDate(); realMonth = dt.getMonth(); realYear = dt.getFullYear(); } return { date: date, realDate: realDate, realMonth: realMonth, realYear: realYear, hidden: hidden, highlighted: _this.isHighlighted(realDate, realMonth, realYear), selected: _this.isSelected(realDate, realMonth, realYear), disabled: _this.isDateDisabled(realDate, realMonth, realYear) }; }; var ret = []; for (var d = 1; d <= 7; d++) { ret.push(calc(d, dp)); } return ret; }, isSelected: function isSelected(date, month, year) { if (!this.value) { return false; } var value = new this.Date(this.value); return value.getDate() === date && value.getMonth() === month && value.getFullYear() === year; }, isHighlighted: function isHighlighted(date, month, year) { if (!this.editingValue) { return false; } return this.editingValue.getDate() === date && this.editingValue.getMonth() === month && this.editingValue.getFullYear() === year; }, moveValue: function moveValue(unit, value) { var editingValue = new this.Date(this.editingValue); switch (unit) { case 'year': editingValue.setFullYear(editingValue.getFullYear() + value); break; case 'month': editingValue.setMonth(editingValue.getMonth() + value); break; case 'date': editingValue.setDate(editingValue.getDate() + value); break; } this.$set(this, 'editingValue', editingValue); this.calcVisualProps(); }, selectDate: function selectDate(value, event) { this.setDate(value); if (event.target.getAttribute('disabled')) { return; } this.searchQuery = ''; var ret = new this.Date(this.editingValue); this.$emit('input', ret); }, setDate: function setDate(value) { if (value !== null) { this.editingValue.setDate(value); } }, onKeydown: function onKeydown(event) { switch (event.which) { case 38: // up event.preventDefault(); this.moveValue('date', -7); break; case 40: // down event.preventDefault(); this.moveValue('date', 7); break; case true ? 37 : 39: // 37: left, 39: right, event.preventDefault(); this.moveValue('date', -1); break; case true ? 39 : 37: // 37: left, 39: right, event.preventDefault(); this.moveValue('date', 1); break; case 13: // enter event.preventDefault(); this.selectDate(parseInt(this.searchQuery) || null, event); break; case 8: // backspace if (this.searchQuery.length === 0 && this.deleteButton) { this.deleteValue(); } break; case 46: // delete this.searchQuery = ''; if (this.deleteButton) { this.deleteValue(); } } }, checkFvValidity: function checkFvValidity(day, month, year) { if (typeof this.required === 'function') { var dt = new this.Date(year, month, day); return this.required(dt); } return true; }, isDateDisabled: function isDateDisabled(day, month, year) { return !this.checkFvValidity(day, month, year); } }, watch: { value: function value() { var _this2 = this; this.$nextTick(function () { _this2.$refs.inputBox.close(); }); } } }; /***/ }), /* 19 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js___ = __webpack_require__(21); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js___); /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js___) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js___[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvList_vue_vue_type_script_lang_js____default.a); /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // // // // // exports.default = { props: { parent: { type: Boolean, default: false } }, data: function data() { return { highlighted: null, isFocused: false }; }, computed: { tabindex: function tabindex() { return this.$attrs && this.$attrs.tabindex ? parseInt(this.$attrs.tabindex) : this.parent ? 0 : undefined; } }, methods: { onFocus: function onFocus() { this.isFocused = true; }, onBlur: function onBlur() { this.isFocused = false; if (this.tabindex >= 0) { this.setHighlight(null); } }, onLeave: function onLeave() { if (!this.isFocused) { this.setHighlight(null); } }, setHighlight: function setHighlight(el) { var allItems = [].concat(_toConsumableArray(this.$el.querySelectorAll('.fv-list-item'))); allItems.forEach(function (li) { if (li !== el) { li.classList.remove('highlighted'); } }); if (el) { el.classList.add('highlighted'); el.__vue__.onHover(); } this.highlighted = el; }, moveHighlight: function moveHighlight() { var _this = this; var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; var allItems = [].concat(_toConsumableArray(this.$el.querySelectorAll('.fv-list-item'))).filter(function (el) { return el.offsetHeight; }); var highlightedIndex = allItems.findIndex(function (el) { return _this.highlighted === el; }); var shouldHighlightIndex = highlightedIndex; var tryTime = 0; do { if (tryTime++ >= allItems.length) { this.highlighted = null; return; } if (next === true) { shouldHighlightIndex = (shouldHighlightIndex + 1) % allItems.length; } else if (next === false) { shouldHighlightIndex = shouldHighlightIndex - 1 < 0 ? allItems.length - 1 : shouldHighlightIndex - 1; } else { shouldHighlightIndex = 0; } } while (allItems[shouldHighlightIndex].__vue__ && allItems[shouldHighlightIndex].__vue__.disabled); this.setHighlight(allItems[shouldHighlightIndex]); if (typeof this.highlighted.scrollIntoViewIfNeeded === 'function') { this.highlighted.scrollIntoViewIfNeeded(); } }, onKeydown: function onKeydown(event) { switch (event.which) { case 38: // up event.preventDefault(); this.moveHighlight(false); break; case 40: // down event.preventDefault(); this.moveHighlight(true); break; case true ? 37 : 39: // 37: left, 39: right, if (this.highlighted && this.highlighted.__vue__) { this.highlighted.__vue__.collapse(); } break; case true ? 39 : 37: // 37: left, 39: right, if (this.highlighted && this.highlighted.__vue__) { this.highlighted.__vue__.expand(); } break; case 13: // enter event.preventDefault(); if (this.highlighted && this.highlighted.__vue__) { this.highlighted.__vue__.onClick(event); } break; } }, onHover: function onHover(event) { var el = event.target; while (el) { if (el && el.tagName === 'LI' && el.classList.contains('fv-list-item')) { break; } if (el.tagName === 'UL' && el.classList.contains('fv-list')) { return; } el = el.parentNode; } if (this.highlighted === el || el.getAttribute('disabled')) { return; } this.setHighlight(el); }, bindEvents: function bindEvents() { if (this.parent) { this.$el.addEventListener('mousemove', this.onHover); this.$el.addEventListener('mouseleave', this.onLeave); this.$el.addEventListener('keydown', this.onKeydown); } if (this.tabindex >= 0) { this.$el.addEventListener('focus', this.onFocus); this.$el.addEventListener('blur', this.onBlur); } }, unbindEvents: function unbindEvents() { this.$el.removeEventListener('mouseleave', this.onLeave); this.$el.removeEventListener('mousemove', this.onHover); this.$el.removeEventListener('keydown', this.onKeydown); this.$el.removeEventListener('focus', this.onFocus); this.$el.removeEventListener('blur', this.onBlur); } }, mounted: function mounted() { this.bindEvents(); // this.setHighlight(null) }, beforeDestroy: function beforeDestroy() { this.unbindEvents(); } }; /***/ }), /* 22 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvListItem_vue_vue_type_script_lang_js___ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_modules_framevuerk_builder_node_modules_vue_loader_lib_index_js_vue_loader_options_fvListItem_vue_vue_type_script_lang_js____default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__node_modules_framevuerk_builder_node_modules_babel_loader_lib_index_js_ref_1_node_m