@ubuilder/simple
Version:
UBuilder Simple Components
1,540 lines (1,332 loc) • 69.9 kB
JavaScript
module.exports =
/******/ (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 = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "8875":
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
// MIT license
// source: https://github.com/amiller-gh/currentScript-polyfill
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
(function (root, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}(typeof self !== 'undefined' ? self : this, function () {
function getCurrentScript () {
var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}
// IE 8-10 support script readyState
// IE 11+ & Firefox support stack trace
try {
throw new Error();
}
catch (err) {
// Find the second match for the "at" string to get file src url from stack.
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
scriptLocation = (stackDetails && stackDetails[1]) || false,
line = (stackDetails && stackDetails[2]) || false,
currentLocation = document.location.href.replace(document.location.hash, ''),
pageSource,
inlineScriptSourceRegExp,
inlineScriptSource,
scripts = document.getElementsByTagName('script'); // Live NodeList collection
if (scriptLocation === currentLocation) {
pageSource = document.documentElement.outerHTML;
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
}
for (var i = 0; i < scripts.length; i++) {
// If ready state is interactive, return the script tag
if (scripts[i].readyState === 'interactive') {
return scripts[i];
}
// If src matches, return the script tag
if (scripts[i].src === scriptLocation) {
return scripts[i];
}
// If inline source matches, return the script tag
if (
scriptLocation === currentLocation &&
scripts[i].innerHTML &&
scripts[i].innerHTML.trim() === inlineScriptSource
) {
return scripts[i];
}
}
// If no match, return null
return null;
}
};
return getCurrentScript
}));
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "UNavbar", function() { return /* reexport */ NavBar; });
__webpack_require__.d(__webpack_exports__, "UCombo", function() { return /* reexport */ Combo; });
__webpack_require__.d(__webpack_exports__, "UButton", function() { return /* reexport */ Button; });
__webpack_require__.d(__webpack_exports__, "UPage", function() { return /* reexport */ Page; });
__webpack_require__.d(__webpack_exports__, "ULoading", function() { return /* reexport */ Loading; });
__webpack_require__.d(__webpack_exports__, "ULoadingProgrammatic", function() { return /* reexport */ LoadingProgrammatic; });
__webpack_require__.d(__webpack_exports__, "UPagination", function() { return /* reexport */ Pagination; });
__webpack_require__.d(__webpack_exports__, "UTable", function() { return /* reexport */ Table; });
__webpack_require__.d(__webpack_exports__, "UGrid", function() { return /* reexport */ Grid; });
__webpack_require__.d(__webpack_exports__, "UModal", function() { return /* reexport */ Modal; });
__webpack_require__.d(__webpack_exports__, "UAlert", function() { return /* reexport */ Alert; });
__webpack_require__.d(__webpack_exports__, "UAlertProgrammatic", function() { return /* reexport */ AlertProgrammatic; });
__webpack_require__.d(__webpack_exports__, "UConfirm", function() { return /* reexport */ Confirm; });
__webpack_require__.d(__webpack_exports__, "UConfirmProgrammatic", function() { return /* reexport */ ConfirmProgrammatic; });
__webpack_require__.d(__webpack_exports__, "UPrompt", function() { return /* reexport */ Prompt; });
__webpack_require__.d(__webpack_exports__, "UPromptProgrammatic", function() { return /* reexport */ PromptProgrammatic; });
__webpack_require__.d(__webpack_exports__, "UTabs", function() { return /* reexport */ Tabs; });
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (true) {
var getCurrentScript = __webpack_require__("8875")
currentScript = getCurrentScript()
// for backward compatibility, because previously we directly included the polyfill
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
}
}
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/navbar/NavBar.vue?vue&type=template&id=a5bd11be&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',[_vm._t("prepend"),_c('ul',[_vm._l((_vm.data),function(item,index){return [(_vm.visible(item))?_c('nav-item',{key:index,attrs:{"item":item}}):_vm._e()]})],2),_vm._t("append")],2)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/navbar/NavBar.vue?vue&type=template&id=a5bd11be&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/navbar/NavItem.vue?vue&type=template&id=215da36f&
var NavItemvue_type_template_id_215da36f_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',[(_vm.item.link)?_c('router-link',{attrs:{"to":_vm.item.link,"exact":_vm.item.exact}},[_vm._v(" "+_vm._s(_vm.item.label)+" ")]):[_vm._v(" "+_vm._s(_vm.item.label)+" ")],(_vm.item.children)?_c('ul',[_vm._l((_vm.item.children),function(child,index){return [(_vm.visible(child))?_c('UNavItem',{key:index,attrs:{"item":child}}):_vm._e()]})],2):_vm._e()],2)}
var NavItemvue_type_template_id_215da36f_staticRenderFns = []
// CONCATENATED MODULE: ./src/navbar/NavItem.vue?vue&type=template&id=215da36f&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/navbar/NavItem.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var NavItemvue_type_script_lang_js_ = ({
name: 'UNavItem',
props: {
item: {
type: Object,
default: function _default() {
return {
label: 'undefined'
};
}
}
},
methods: {
visible: function visible(item) {
if (item.hide) {
return false;
}
if (item.permission) {
if (item.permission === true) {
return this.$user.isLoggedIn();
}
return this.$user.hasPermission(item.permission);
}
return true;
}
}
});
// CONCATENATED MODULE: ./src/navbar/NavItem.vue?vue&type=script&lang=js&
/* harmony default export */ var navbar_NavItemvue_type_script_lang_js_ = (NavItemvue_type_script_lang_js_);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* 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,
(options.functional ? this.parent : 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 functional 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
}
}
// CONCATENATED MODULE: ./src/navbar/NavItem.vue
/* normalize component */
var component = normalizeComponent(
navbar_NavItemvue_type_script_lang_js_,
NavItemvue_type_template_id_215da36f_render,
NavItemvue_type_template_id_215da36f_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var NavItem = (component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/navbar/NavBar.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var NavBarvue_type_script_lang_js_ = ({
components: {
NavItem: NavItem
},
props: {
data: {
type: Array,
default: function _default() {
return [];
}
}
},
methods: {
visible: function visible(item) {
if (item.hide) {
return false;
}
if (item.permission) {
if (item.permission === true) {
return this.$user.isLoggedIn();
}
return this.$user.hasPermission(item.permission);
}
return true;
}
},
install: function install(Vue) {
Vue.component('UNavbar', this);
}
});
// CONCATENATED MODULE: ./src/navbar/NavBar.vue?vue&type=script&lang=js&
/* harmony default export */ var navbar_NavBarvue_type_script_lang_js_ = (NavBarvue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/navbar/NavBar.vue
/* normalize component */
var NavBar_component = normalizeComponent(
navbar_NavBarvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var NavBar = (NavBar_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Combo.vue?vue&type=template&id=38a6abe1&
var Combovue_type_template_id_38a6abe1_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('select',{ref:"select",staticClass:"u-combo",attrs:{"disabled":_vm.disabled,"required":_vm.required},on:{"change":function($event){return _vm.$emit('input', $event.target.value)}}},[(_vm.placeholder)?_c('option',{attrs:{"value":"","disabled":""}},[_vm._v(" "+_vm._s(_vm.placeholder)+" ")]):_vm._e(),_vm._l((_vm.data),function(option){return _c('option',{key:option[_vm.valueKey],domProps:{"value":option[_vm.valueKey]}},[_vm._v(" "+_vm._s(option[_vm.textKey])+" ")])})],2)}
var Combovue_type_template_id_38a6abe1_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/Combo.vue?vue&type=template&id=38a6abe1&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Combo.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Combovue_type_script_lang_js_ = ({
props: {
value: {
type: String,
default: undefined
},
data: {
type: Array,
required: true
},
textKey: {
type: String,
default: 'text'
},
valueKey: {
type: String,
default: 'value'
},
placeholder: {
type: String,
default: null
},
disabled: {
type: Boolean,
default: false
},
required: {
type: Boolean,
default: false
}
},
watch: {
data: function data() {
this.selectByValue();
},
value: function value() {
this.selectByValue();
}
},
mounted: function mounted() {
this.selectByValue();
},
methods: {
selectByValue: function selectByValue() {
var options = this.$refs.select.options;
for (var i = 0; i < options.length; i += 1) {
if (options.item(i).value === this.value) {
this.$refs.select.selectedIndex = i;
return;
}
this.$refs.select.selectedIndex = -1;
}
}
},
install: function install(Vue) {
Vue.component('UCombo', this);
}
});
// CONCATENATED MODULE: ./src/components/Combo.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Combovue_type_script_lang_js_ = (Combovue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/components/Combo.vue
/* normalize component */
var Combo_component = normalizeComponent(
components_Combovue_type_script_lang_js_,
Combovue_type_template_id_38a6abe1_render,
Combovue_type_template_id_38a6abe1_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Combo = (Combo_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Button.vue?vue&type=template&id=9764cb2a&
var Buttonvue_type_template_id_9764cb2a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{class:{'u-progress': _vm.progress},attrs:{"type":_vm.type},on:{"click":function($event){return _vm.$emit('click')}}},[_vm._t("default")],2)}
var Buttonvue_type_template_id_9764cb2a_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/Button.vue?vue&type=template&id=9764cb2a&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Button.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Buttonvue_type_script_lang_js_ = ({
props: {
type: {
type: String,
default: 'button',
validator: function validator(value) {
return ['submit', 'reset', 'button'].indexOf(value.toLowerCase()) !== -1;
}
},
progress: {
type: Boolean,
default: false
}
},
install: function install(Vue) {
Vue.component('UButton', this);
}
});
// CONCATENATED MODULE: ./src/components/Button.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Buttonvue_type_script_lang_js_ = (Buttonvue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/components/Button.vue
/* normalize component */
var Button_component = normalizeComponent(
components_Buttonvue_type_script_lang_js_,
Buttonvue_type_template_id_9764cb2a_render,
Buttonvue_type_template_id_9764cb2a_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Button = (Button_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Page.vue?vue&type=template&id=36f8ce4e&
var Pagevue_type_template_id_36f8ce4e_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,{tag:"component"},[(_vm.visible)?_vm._t("default"):(_vm.$user.isLoggedIn())?_vm._t("403",[_c('p',[_vm._v("Forbidden")])]):_vm._t("401",[_c('p',[_vm._v("Unauthorized")])])],2)}
var Pagevue_type_template_id_36f8ce4e_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/Page.vue?vue&type=template&id=36f8ce4e&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Page.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Pagevue_type_script_lang_js_ = ({
props: {
tag: {
type: String,
default: 'div'
}
},
computed: {
visible: function visible() {
var _this$$route, _this$$route$meta, _this$$user;
if (((_this$$route = this.$route) === null || _this$$route === void 0 ? void 0 : (_this$$route$meta = _this$$route.meta) === null || _this$$route$meta === void 0 ? void 0 : _this$$route$meta.auth) === undefined) {
return true;
}
if (this.$route.meta.auth === true) {
return this.$user.isLoggedIn();
}
return (_this$$user = this.$user) === null || _this$$user === void 0 ? void 0 : _this$$user.hasPermission(this.$route.meta.auth);
}
},
install: function install(Vue) {
Vue.component('UPage', this);
}
});
// CONCATENATED MODULE: ./src/components/Page.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Pagevue_type_script_lang_js_ = (Pagevue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/components/Page.vue
/* normalize component */
var Page_component = normalizeComponent(
components_Pagevue_type_script_lang_js_,
Pagevue_type_template_id_36f8ce4e_render,
Pagevue_type_template_id_36f8ce4e_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Page = (Page_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Loading.vue?vue&type=template&id=783950f1&
var Loadingvue_type_template_id_783950f1_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"u-modal"}},[(_vm.active)?_c('div',{staticClass:"u-modal u-loading"},[_c('div',[_vm._v(_vm._s(_vm.message))]),_c('div',{staticClass:"u-progress"},[_vm._v(" P ")]),(_vm.cancelable)?_c('button',{ref:"button",attrs:{"type":"button"},on:{"click":_vm.cancel}},[_vm._v(" "+_vm._s(_vm.buttonText)+" ")]):_vm._e()]):_vm._e()])}
var Loadingvue_type_template_id_783950f1_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/Loading.vue?vue&type=template&id=783950f1&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Loading.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Loadingvue_type_script_lang_js_ = ({
model: {
prop: 'active'
},
props: {
active: {
type: Boolean,
default: false
},
message: {
type: String,
default: ''
},
buttonText: {
type: String,
default: 'Cancel'
},
cancelable: {
type: Boolean,
default: false
}
},
watch: {
active: function active(value) {
if (value) {
this.activateTrap();
} else {
this.close();
}
}
},
mounted: function mounted() {
if (this.active) {
this.activateTrap();
}
},
methods: {
activateTrap: function activateTrap() {
var _this = this;
document.activeElement.blur();
this.$nextTick(function () {
var _this$$refs$button;
document.addEventListener('keydown', _this.trap);
(_this$$refs$button = _this.$refs.button) === null || _this$$refs$button === void 0 ? void 0 : _this$$refs$button.focus();
});
},
trap: function trap(event) {
if (event.key === 'Tab') {
var _this$$refs$button2;
event.preventDefault();
(_this$$refs$button2 = this.$refs.button) === null || _this$$refs$button2 === void 0 ? void 0 : _this$$refs$button2.focus();
}
},
cancel: function cancel() {
this.$emit('cancel');
this.close();
},
close: function close() {
document.removeEventListener('keydown', this.trap);
this.$emit('input', false);
}
},
install: function install(Vue) {
Vue.component('ULoading', this);
}
});
// CONCATENATED MODULE: ./src/components/Loading.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Loadingvue_type_script_lang_js_ = (Loadingvue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/components/Loading.vue
/* normalize component */
var Loading_component = normalizeComponent(
components_Loadingvue_type_script_lang_js_,
Loadingvue_type_template_id_783950f1_render,
Loadingvue_type_template_id_783950f1_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Loading = (Loading_component.exports);
// CONCATENATED MODULE: ./src/components/LoadingProgrammatic.js
/* harmony default export */ var LoadingProgrammatic = ({
install: function install(Vue) {
var _Vue$prototype, _Vue$prototype$$ub;
// eslint-disable-next-line no-param-reassign
(_Vue$prototype$$ub = (_Vue$prototype = Vue.prototype).$ub) !== null && _Vue$prototype$$ub !== void 0 ? _Vue$prototype$$ub : _Vue$prototype.$ub = {}; // eslint-disable-next-line no-param-reassign
Vue.prototype.$ub.loading = function loading(params) {
if (typeof params === 'string') {
// eslint-disable-next-line no-param-reassign
params = {
message: params
};
}
var LoadingComponent = Vue.extend(Loading);
var instance = new LoadingComponent({
el: document.createElement('div'),
propsData: params
});
instance.$on('input', function (value) {
instance.$props.active = value;
});
instance.$on('cancel', function () {
if (typeof params.onCancel === 'function') {
params.onCancel();
}
setTimeout(function () {
document.body.removeChild(instance.$el);
instance.$destroy();
}, 500);
});
instance.$mount();
document.body.appendChild(instance.$el);
instance.$props.active = true;
return instance;
};
}
});
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Pagination.vue?vue&type=template&id=5bd66d04&
var Paginationvue_type_template_id_5bd66d04_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{staticClass:"u-pagination"},[_c('ul',[_c('li',[(_vm.onFirst)?[_c('a',{staticClass:"disabled"},[_vm._t("prev",[_vm._v("«")])],2)]:_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.$emit('input', _vm.value - 1)}}},[_vm._t("prev",[_vm._v("«")])],2)],2),(!_vm.allVisible && _vm.value > _vm.aroundButtonCount + 1)?_c('li',[_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.$emit('input', 1)}}},[_vm._v("1")]),(_vm.value > _vm.aroundButtonCount + 2)?_vm._t("ellipsis",[_c('span',[_vm._v("…")])]):_vm._e()],2):_vm._e(),_vm._l((_vm.pages),function(i){return _c('li',{key:i},[(i === _vm.value)?[_c('a',{staticClass:"current"},[_vm._v(_vm._s(i))])]:_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.$emit('input', i)}}},[_vm._v(_vm._s(i))])],2)}),(!_vm.allVisible && _vm.value < _vm.pageCount - _vm.aroundButtonCount)?_c('li',[(_vm.value < _vm.pageCount - _vm.aroundButtonCount - 1)?_vm._t("ellipsis",[_c('span',[_vm._v("…")])]):_vm._e(),_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.$emit('input', _vm.pageCount)}}},[_vm._v(_vm._s(_vm.pageCount))])],2):_vm._e(),_c('li',[(_vm.onLast)?[_c('a',{staticClass:"disabled"},[_vm._t("next",[_vm._v("»")])],2)]:_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.$emit('input', _vm.value + 1)}}},[_vm._t("next",[_vm._v("»")])],2)],2)],2)])}
var Paginationvue_type_template_id_5bd66d04_staticRenderFns = []
// CONCATENATED MODULE: ./src/grid/Pagination.vue?vue&type=template&id=5bd66d04&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Pagination.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Paginationvue_type_script_lang_js_ = ({
props: {
total: {
type: Number,
required: true
},
perPage: {
type: Number,
default: 20
},
aroundButtonCount: {
type: Number,
default: 2
},
value: {
type: Number,
default: 1
}
},
computed: {
onFirst: function onFirst() {
return this.value === 1;
},
onLast: function onLast() {
return this.value === this.pageCount;
},
pageCount: function pageCount() {
return Math.max(1, Math.ceil(this.total / this.perPage));
},
allVisible: function allVisible() {
return this.pageCount <= this.aroundButtonCount * 2 + 1;
},
pages: function pages() {
var begin = this.value - this.aroundButtonCount;
var end = this.value + this.aroundButtonCount;
var delta = 0;
if (begin < 1) {
delta = 1 - begin;
}
if (end > this.pageCount) {
delta = this.pageCount - end;
}
begin = Math.max(1, begin + delta);
end = Math.min(this.pageCount, end + delta);
return Array.from({
length: end - begin + 1
}, function (v, i) {
return i + begin;
});
}
},
install: function install(Vue) {
Vue.component('UPagination', this);
}
});
// CONCATENATED MODULE: ./src/grid/Pagination.vue?vue&type=script&lang=js&
/* harmony default export */ var grid_Paginationvue_type_script_lang_js_ = (Paginationvue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/grid/Pagination.vue
/* normalize component */
var Pagination_component = normalizeComponent(
grid_Paginationvue_type_script_lang_js_,
Paginationvue_type_template_id_5bd66d04_render,
Paginationvue_type_template_id_5bd66d04_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Pagination = (Pagination_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Table.vue?vue&type=template&id=dce64aa2&
var Tablevue_type_template_id_dce64aa2_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table',{staticClass:"u-table"},[_vm._t("caption"),(!_vm.hideHeader)?_c('thead',[_vm._t("header",[_c('table-header',{attrs:{"columns":_vm.columns},scopedSlots:_vm._u([{key:"column",fn:function(ref){
var column = ref.column;
return [_vm._t("column",null,{"column":column})]}}],null,true)})],{"columns":_vm.columns})],2):_vm._e(),_c('tbody',[_vm._t("default",_vm._l((_vm.data),function(row,index){return _c('tr',{key:index,on:{"click":function($event){return _vm.$emit('row-click', row)}}},[_vm._l((_vm.columns),function(column){return [_c('td',{key:index + (column.id || column.field || column.label)},[(column.slot)?[_vm._t(column.slot,[_vm._v(" "+_vm._s(row[column.field])+" ")],{"row":row,"index":index})]:[_vm._v(" "+_vm._s(row[column.field])+" ")]],2)]})],2)}),{"columns":_vm.columns,"data":_vm.data})],2),(_vm.showFooter)?_c('tfoot',[_vm._t("footer",[_c('table-header',{attrs:{"columns":_vm.columns},scopedSlots:_vm._u([{key:"column",fn:function(ref){
var column = ref.column;
return [_vm._t("column",null,{"column":column})]}}],null,true)})],{"columns":_vm.columns})],2):_vm._e()],2)}
var Tablevue_type_template_id_dce64aa2_staticRenderFns = []
// CONCATENATED MODULE: ./src/grid/Table.vue?vue&type=template&id=dce64aa2&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/TableHeader.vue?vue&type=template&id=30602761&
var TableHeadervue_type_template_id_30602761_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('tr',_vm._l((_vm.columns),function(column){return _c('th',{key:_vm.columnKey(column)},[_vm._t("column",[_vm._v(" "+_vm._s(_vm.columnLabel(column))+" ")],{"column":column})],2)}),0)}
var TableHeadervue_type_template_id_30602761_staticRenderFns = []
// CONCATENATED MODULE: ./src/grid/TableHeader.vue?vue&type=template&id=30602761&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/TableHeader.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var TableHeadervue_type_script_lang_js_ = ({
props: {
columns: {
type: Array,
required: true
}
},
methods: {
columnKey: function columnKey(column) {
return column instanceof Object ? column.id || column.field || column.label : column;
},
columnLabel: function columnLabel(column) {
return column instanceof Object ? column.label || column.id || column.field : column;
}
}
});
// CONCATENATED MODULE: ./src/grid/TableHeader.vue?vue&type=script&lang=js&
/* harmony default export */ var grid_TableHeadervue_type_script_lang_js_ = (TableHeadervue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/grid/TableHeader.vue
/* normalize component */
var TableHeader_component = normalizeComponent(
grid_TableHeadervue_type_script_lang_js_,
TableHeadervue_type_template_id_30602761_render,
TableHeadervue_type_template_id_30602761_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var TableHeader = (TableHeader_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Table.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Tablevue_type_script_lang_js_ = ({
components: {
TableHeader: TableHeader
},
props: {
columns: {
type: Array,
required: true
},
data: {
type: Array,
required: true
},
hideHeader: {
type: Boolean,
default: false
},
showFooter: {
type: Boolean,
default: false
}
},
install: function install(Vue) {
Vue.component('UTable', this);
}
});
// CONCATENATED MODULE: ./src/grid/Table.vue?vue&type=script&lang=js&
/* harmony default export */ var grid_Tablevue_type_script_lang_js_ = (Tablevue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/grid/Table.vue
/* normalize component */
var Table_component = normalizeComponent(
grid_Tablevue_type_script_lang_js_,
Tablevue_type_template_id_dce64aa2_render,
Tablevue_type_template_id_dce64aa2_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Table = (Table_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Grid.vue?vue&type=template&id=3441820c&
var Gridvue_type_template_id_3441820c_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"u-grid"},[_c('div',{staticClass:"table-wrapper"},[_c('u-table',_vm._b({attrs:{"data":_vm.rows},on:{"row-click":_vm.rowClick},scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(index,name){return {key:name,fn:function(slotData){return [_vm._t(name,null,null,slotData)]}}})],null,true)},'u-table',_vm.$props,false),[(_vm.loading || _vm.rows.length == 0)?_c('tr',[_c('td',{attrs:{"colspan":_vm.columns.length}},[(_vm.loading)?_vm._t("loading",[_vm._v(" Loading... ")]):_vm._t("no-data",[_vm._v(" NO DATA ")])],2)]):_vm._e()])],1),_c('u-pagination',{attrs:{"total":_vm.count,"per-page":_vm.perPage},model:{value:(_vm.page),callback:function ($$v) {_vm.page=$$v},expression:"page"}})],1)}
var Gridvue_type_template_id_3441820c_staticRenderFns = []
// CONCATENATED MODULE: ./src/grid/Grid.vue?vue&type=template&id=3441820c&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/grid/Grid.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Gridvue_type_script_lang_js_ = ({
components: {
UTable: Table,
UPagination: Pagination
},
props: {
columns: {
type: Array,
required: true
},
data: {
type: Array,
required: true
},
perPage: {
type: Number,
default: 20
},
totalCount: {
type: Number,
default: -1
},
showFooter: {
type: Boolean,
default: false
},
loading: {
type: Boolean,
default: false
}
},
data: function data() {
return {
page: 1
};
},
computed: {
rows: function rows() {
var start = (this.page - 1) * this.perPage;
return this.data.slice(start, start + this.perPage);
},
count: function count() {
if (this.totalCount >= 0) {
return this.totalCount;
}
return this.data.length;
}
},
methods: {
rowClick: function rowClick(row) {
this.$emit('row-click', row);
}
},
install: function install(Vue) {
Vue.component('UGrid', this);
}
});
// CONCATENATED MODULE: ./src/grid/Grid.vue?vue&type=script&lang=js&
/* harmony default export */ var grid_Gridvue_type_script_lang_js_ = (Gridvue_type_script_lang_js_);
// CONCATENATED MODULE: ./src/grid/Grid.vue
/* normalize component */
var Grid_component = normalizeComponent(
grid_Gridvue_type_script_lang_js_,
Gridvue_type_template_id_3441820c_render,
Gridvue_type_template_id_3441820c_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Grid = (Grid_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"83dd5702-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/modal/Modal.vue?vue&type=template&id=26b36584&
var Modalvue_type_template_id_26b36584_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"u-modal"}},[(_vm.value)?_c('div',{ref:"modal",staticClass:"u-modal"},[_c('div',{staticClass:"u-modal-content"},[_vm._t("default")],2)]):_vm._e()])}
var Modalvue_type_template_id_26b36584_staticRenderFns = []
// CONCATENATED MODULE: ./src/modal/Modal.vue?vue&type=template&id=26b36584&
// CONCATENATED MODULE: ./node_modules/tabbable/dist/index.esm.js
/*!
* tabbable 5.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/
var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
var matches = typeof Element === 'undefined' ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
var getCandidates = function getCandidates(el, includeContainer, filter) {
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
if (includeContainer && matches.call(el, candidateSelector)) {
candidates.unshift(el);
}
candidates = candidates.filter(filter);
return candidates;
};
var isContentEditable = function isContentEditable(node) {
return node.contentEditable === 'true';
};
var getTabindex = function getTabindex(node) {
var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
if (!isNaN(tabindexAttr)) {
return tabindexAttr;
} // Browsers do not return `tabIndex` correctly for contentEditable nodes;
// so if they don't have a tabindex attribute specifically set, assume it's 0.
if (isContentEditable(node)) {
return 0;
} // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
// yet they are still part of the regular tab order; in FF, they get a default
// `tabIndex` of 0; since Chrome still puts those elements in the regular tab
// order, consider their tab index to be 0.
if ((node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {
return 0;
}
return node.tabIndex;
};
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
};
var isInput = function isInput(node) {
return node.tagName === 'INPUT';
};
var isHiddenInput = function isHiddenInput(node) {
return isInput(node) && node.type === 'hidden';
};
var isDetailsWithSummary = function isDetailsWithSummary(node) {
var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
return child.tagName === 'SUMMARY';
});
return r;
};
var getCheckedRadio = function getCheckedRadio(nodes, form) {
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].checked && nodes[i].form === form) {
return nodes[i];
}
}
};
var isTabbableRadio = function isTabbableRadio(node) {
if (!node.name) {
return true;
}
var radioScope = node.form || node.ownerDocument;
var queryRadios = function queryRadios(name) {
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
};
var radioSet;
if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
radioSet = queryRadios(window.CSS.escape(node.name));
} else {
try {
radioSet = queryRadios(node.name);
} catch (err) {
// eslint-disable-next-line no-console
console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
return false;
}
}
var checked = getCheckedRadio(radioSet, node.form);
return !checked || checked === node;
};
var isRadio = function isRadio(node) {
return isInput(node) && node.type === 'radio';
};
var isNonTabbableRadio = function isNonTabbableRadio(node) {
return isRadio(node) && !isTabbableRadio(node);
};
var isHidden = function isHidden(node, displayCheck) {
if (getComputedStyle(node).visibility === 'hidden') {
return true;
}
var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
return true;
}
if (!displayCheck || displayCheck === 'full') {
while (node) {
if (getComputedStyle(node).display === 'none') {
return true;
}
node = node.parentElement;
}
} else if (displayCheck === 'non-zero-area') {
var _node$getBoundingClie = node.getBoundingClientRect(),
width = _node$getBoundingClie.width,
height = _node$getBoundingClie.height;
return width === 0 && height === 0;
}
return false;
};
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
if (node.disabled || isHiddenInput(node) || isHidden(node, options.displayCheck) ||
/* For a details element with a summary, the summary element gets the focused */
isDetailsWithSummary(node)) {
return false;
}
return true;
};
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
if (!isNodeMatchingSelectorFocusable(options, node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
return false;
}
return true;
};
var tabbable = function tabbable(el, options) {
options = options || {};
var r