maz-ui 2.3.13 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/MazArrowIcon.d.ts +43 -0
- package/components/MazArrowIcon.js +1 -0
- package/components/MazAvatar.d.ts +149 -0
- package/components/MazAvatar.js +3 -0
- package/components/MazBackdrop.d.ts +89 -0
- package/components/MazBackdrop.js +3 -0
- package/components/MazBadge.d.ts +68 -0
- package/components/MazBadge.js +1 -0
- package/components/MazBottomSheet.d.ts +29 -0
- package/components/MazBottomSheet.js +3 -0
- package/components/MazBtn.d.ts +171 -0
- package/components/MazBtn.js +3 -0
- package/components/MazCard.d.ts +183 -0
- package/components/MazCard.js +3 -0
- package/components/MazCarousel.d.ts +16 -0
- package/components/MazCarousel.js +3 -0
- package/components/MazChart/includes.d.ts +11 -0
- package/components/MazChart.d.ts +114 -0
- package/components/MazChart.js +1 -0
- package/components/MazCheckbox.d.ts +49 -0
- package/components/MazCheckbox.js +1 -0
- package/components/MazDialog.d.ts +29 -0
- package/components/MazDialog.js +3 -0
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +30 -0
- package/components/MazDialogPromise.d.ts +28 -0
- package/components/MazDialogPromise.js +3 -0
- package/components/MazDrawer.d.ts +59 -0
- package/components/MazDrawer.js +3 -0
- package/components/MazDropzone.d.ts +128 -0
- package/components/MazDropzone.js +3 -0
- package/components/MazGallery.d.ts +144 -0
- package/components/MazGallery.js +3 -0
- package/components/MazIcon.d.ts +66 -0
- package/components/MazIcon.js +3 -0
- package/components/MazInput.d.ts +276 -0
- package/components/MazInput.js +3 -0
- package/components/MazInputNumber.d.ts +67 -0
- package/components/MazInputNumber.js +3 -0
- package/components/MazInputPrice.d.ts +64 -0
- package/components/MazInputPrice.js +3 -0
- package/components/MazInputTags.d.ts +96 -0
- package/components/MazInputTags.js +3 -0
- package/components/MazLazyImg.d.ts +80 -0
- package/components/MazLazyImg.js +3 -0
- package/components/MazPhoneNumberInput/constantes/locales.d.ts +12 -0
- package/components/MazPhoneNumberInput/types.d.ts +21 -0
- package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +2 -0
- package/components/MazPhoneNumberInput/utils/index.d.ts +12 -0
- package/components/MazPhoneNumberInput.d.ts +255 -0
- package/components/MazPhoneNumberInput.js +3 -0
- package/components/MazPicker/MazPickerCalendar.vue.d.ts +137 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +22 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +114 -0
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +124 -0
- package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +38 -0
- package/components/MazPicker/MazPickerContainer.vue.d.ts +212 -0
- package/components/MazPicker/MazPickerHeader.vue.d.ts +84 -0
- package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +43 -0
- package/components/MazPicker/MazPickerShortcuts.vue.d.ts +62 -0
- package/components/MazPicker/MazPickerTime.vue.d.ts +129 -0
- package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +35 -0
- package/components/MazPicker/types.d.ts +15 -0
- package/components/MazPicker/utils.d.ts +54 -0
- package/components/MazPicker.d.ts +313 -0
- package/components/MazPicker.js +3 -0
- package/components/MazRadioButtons.d.ts +69 -0
- package/components/MazRadioButtons.js +1 -0
- package/components/MazSelect.d.ts +176 -0
- package/components/MazSelect.js +3 -0
- package/components/MazSlider/utils.d.ts +15 -0
- package/components/MazSlider.d.ts +96 -0
- package/components/MazSlider.js +3 -0
- package/components/MazSpinner.d.ts +30 -0
- package/components/MazSpinner.js +1 -0
- package/components/MazStepper.d.ts +73 -0
- package/components/MazStepper.js +1 -0
- package/components/MazSwitch.d.ts +56 -0
- package/components/MazSwitch.js +1 -0
- package/components/MazTabsBar.d.ts +49 -0
- package/components/MazTabsBar.js +3 -0
- package/components/MazTabsContent.d.ts +16 -0
- package/components/MazTabsContent.js +1 -0
- package/components/MazTabsContentItem.d.ts +14 -0
- package/components/MazTabsContentItem.js +3 -0
- package/components/MazTextarea/textarea-autogrow.d.ts +9 -0
- package/components/MazTextarea.d.ts +125 -0
- package/components/MazTextarea.js +1 -0
- package/components/MazTransitionExpand.d.ts +4 -0
- package/components/MazTransitionExpand.js +1 -0
- package/components/index.d.ts +34 -0
- package/components/index.js +36 -0
- package/components/no_photo-a72545e4.js +1 -0
- package/components/types.d.ts +17 -0
- package/css/aos.css +1 -0
- package/css/main.css +1 -0
- package/maz-ui.d.ts +307 -0
- package/modules/index.js +3 -0
- package/modules/no_photo-a72545e4.js +1 -0
- package/package.json +145 -81
- package/tailwindcss/tailwind.config.js +65 -0
- package/tailwindcss/utils/colors.js +28 -0
- package/tailwindcss/variables/breakpoints.js +15 -0
- package/tailwindcss/variables/colors.js +44 -0
- package/tailwindcss/variables/utilities.js +20 -0
- package/tailwindcss/variables/z-indexes.js +15 -0
- package/LICENSE +0 -21
- package/README.md +0 -66
- package/bin/index.js +0 -63
- package/bin/lib/_constantes/default-colors.js +0 -69
- package/bin/lib/index.d.ts +0 -2
- package/bin/lib/index.js +0 -145
- package/bin/lib/methods/generate-root-css.js +0 -49
- package/bin/lib/methods/get-theme-settings.js +0 -58
- package/bin/lib/methods/set-css-vars.js +0 -11
- package/lib/css/base.css +0 -1
- package/lib/css/index.css +0 -1
- package/lib/css/maz-avatar.css +0 -1
- package/lib/css/maz-bottom-sheet.css +0 -1
- package/lib/css/maz-btn-group.css +0 -1
- package/lib/css/maz-btn.css +0 -0
- package/lib/css/maz-card.css +0 -1
- package/lib/css/maz-carousel.css +0 -1
- package/lib/css/maz-checkbox.css +0 -1
- package/lib/css/maz-collapse.css +0 -1
- package/lib/css/maz-dialog.css +0 -1
- package/lib/css/maz-draggable-list.css +0 -1
- package/lib/css/maz-dropdown.css +0 -1
- package/lib/css/maz-dropzone.css +0 -1
- package/lib/css/maz-flex.css +0 -0
- package/lib/css/maz-gallery.css +0 -0
- package/lib/css/maz-img.css +0 -1
- package/lib/css/maz-input-tags.css +0 -1
- package/lib/css/maz-input.css +0 -0
- package/lib/css/maz-list-item.css +0 -1
- package/lib/css/maz-list.css +0 -1
- package/lib/css/maz-loader.css +0 -0
- package/lib/css/maz-pagination.css +0 -1
- package/lib/css/maz-phone-number-input.css +0 -1
- package/lib/css/maz-picker.css +0 -1
- package/lib/css/maz-plotly.css +0 -0
- package/lib/css/maz-progress-bar.css +0 -1
- package/lib/css/maz-radio.css +0 -1
- package/lib/css/maz-read-more.css +0 -1
- package/lib/css/maz-responsive-menu.css +0 -1
- package/lib/css/maz-search.css +0 -1
- package/lib/css/maz-select.css +0 -0
- package/lib/css/maz-sidebar.css +0 -1
- package/lib/css/maz-slider.css +0 -1
- package/lib/css/maz-spinner.css +0 -0
- package/lib/css/maz-stepper.css +0 -1
- package/lib/css/maz-switch.css +0 -1
- package/lib/css/maz-tabs-bar.css +0 -1
- package/lib/css/maz-tabs-content-item.css +0 -1
- package/lib/css/maz-tabs-content.css +0 -1
- package/lib/css/maz-transition-expand.css +0 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/maz-avatar.d.ts +0 -3
- package/lib/maz-avatar.js +0 -430
- package/lib/maz-bottom-sheet.d.ts +0 -3
- package/lib/maz-bottom-sheet.js +0 -1045
- package/lib/maz-btn-group.d.ts +0 -3
- package/lib/maz-btn-group.js +0 -907
- package/lib/maz-btn.d.ts +0 -3
- package/lib/maz-btn.js +0 -764
- package/lib/maz-card.d.ts +0 -3
- package/lib/maz-card.js +0 -572
- package/lib/maz-carousel.d.ts +0 -3
- package/lib/maz-carousel.js +0 -569
- package/lib/maz-checkbox.d.ts +0 -3
- package/lib/maz-checkbox.js +0 -359
- package/lib/maz-collapse.d.ts +0 -3
- package/lib/maz-collapse.js +0 -1238
- package/lib/maz-dialog.d.ts +0 -3
- package/lib/maz-dialog.js +0 -1315
- package/lib/maz-draggable-list.d.ts +0 -3
- package/lib/maz-draggable-list.js +0 -439
- package/lib/maz-dropdown.d.ts +0 -3
- package/lib/maz-dropdown.js +0 -438
- package/lib/maz-dropzone.d.ts +0 -3
- package/lib/maz-dropzone.js +0 -664
- package/lib/maz-flex.d.ts +0 -3
- package/lib/maz-flex.js +0 -427
- package/lib/maz-gallery.d.ts +0 -3
- package/lib/maz-gallery.js +0 -672
- package/lib/maz-img.d.ts +0 -3
- package/lib/maz-img.js +0 -612
- package/lib/maz-input-tags.d.ts +0 -3
- package/lib/maz-input-tags.js +0 -1207
- package/lib/maz-input.d.ts +0 -3
- package/lib/maz-input.js +0 -1076
- package/lib/maz-list-item.d.ts +0 -3
- package/lib/maz-list-item.js +0 -304
- package/lib/maz-list.d.ts +0 -3
- package/lib/maz-list.js +0 -331
- package/lib/maz-loader.d.ts +0 -3
- package/lib/maz-loader.js +0 -304
- package/lib/maz-pagination.d.ts +0 -3
- package/lib/maz-pagination.js +0 -1414
- package/lib/maz-phone-number-input.d.ts +0 -3
- package/lib/maz-phone-number-input.js +0 -3776
- package/lib/maz-picker.d.ts +0 -3
- package/lib/maz-picker.js +0 -6474
- package/lib/maz-plotly.d.ts +0 -3
- package/lib/maz-plotly.js +0 -500
- package/lib/maz-progress-bar.d.ts +0 -3
- package/lib/maz-progress-bar.js +0 -398
- package/lib/maz-radio.d.ts +0 -3
- package/lib/maz-radio.js +0 -358
- package/lib/maz-read-more.d.ts +0 -3
- package/lib/maz-read-more.js +0 -344
- package/lib/maz-responsive-menu.d.ts +0 -3
- package/lib/maz-responsive-menu.js +0 -438
- package/lib/maz-search.d.ts +0 -3
- package/lib/maz-search.js +0 -1590
- package/lib/maz-select.d.ts +0 -3
- package/lib/maz-select.js +0 -2740
- package/lib/maz-sidebar.d.ts +0 -3
- package/lib/maz-sidebar.js +0 -815
- package/lib/maz-slider.d.ts +0 -3
- package/lib/maz-slider.js +0 -1014
- package/lib/maz-spinner.d.ts +0 -3
- package/lib/maz-spinner.js +0 -328
- package/lib/maz-stepper.d.ts +0 -3
- package/lib/maz-stepper.js +0 -1011
- package/lib/maz-switch.d.ts +0 -3
- package/lib/maz-switch.js +0 -375
- package/lib/maz-tabs-bar.d.ts +0 -3
- package/lib/maz-tabs-bar.js +0 -428
- package/lib/maz-tabs-content-item.d.ts +0 -3
- package/lib/maz-tabs-content-item.js +0 -376
- package/lib/maz-tabs-content.d.ts +0 -3
- package/lib/maz-tabs-content.js +0 -367
- package/lib/maz-transition-expand.d.ts +0 -3
- package/lib/maz-transition-expand.js +0 -328
- package/lib/maz-ui.common.d.ts +0 -1
- package/lib/maz-ui.common.js +0 -17202
|
@@ -1,3776 +0,0 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
-
/******/ // The module cache
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "/dist/";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 25);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ([
|
|
89
|
-
/* 0 */
|
|
90
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
91
|
-
|
|
92
|
-
"use strict";
|
|
93
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
94
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
95
|
-
|
|
96
|
-
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
97
|
-
// This module is a runtime utility for cleaner component module output and will
|
|
98
|
-
// be included in the final webpack user bundle.
|
|
99
|
-
|
|
100
|
-
function normalizeComponent (
|
|
101
|
-
scriptExports,
|
|
102
|
-
render,
|
|
103
|
-
staticRenderFns,
|
|
104
|
-
functionalTemplate,
|
|
105
|
-
injectStyles,
|
|
106
|
-
scopeId,
|
|
107
|
-
moduleIdentifier, /* server only */
|
|
108
|
-
shadowMode /* vue-cli only */
|
|
109
|
-
) {
|
|
110
|
-
// Vue.extend constructor export interop
|
|
111
|
-
var options = typeof scriptExports === 'function'
|
|
112
|
-
? scriptExports.options
|
|
113
|
-
: scriptExports
|
|
114
|
-
|
|
115
|
-
// render functions
|
|
116
|
-
if (render) {
|
|
117
|
-
options.render = render
|
|
118
|
-
options.staticRenderFns = staticRenderFns
|
|
119
|
-
options._compiled = true
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// functional template
|
|
123
|
-
if (functionalTemplate) {
|
|
124
|
-
options.functional = true
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// scopedId
|
|
128
|
-
if (scopeId) {
|
|
129
|
-
options._scopeId = 'data-v-' + scopeId
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var hook
|
|
133
|
-
if (moduleIdentifier) { // server build
|
|
134
|
-
hook = function (context) {
|
|
135
|
-
// 2.3 injection
|
|
136
|
-
context =
|
|
137
|
-
context || // cached call
|
|
138
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
139
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
140
|
-
// 2.2 with runInNewContext: true
|
|
141
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
142
|
-
context = __VUE_SSR_CONTEXT__
|
|
143
|
-
}
|
|
144
|
-
// inject component styles
|
|
145
|
-
if (injectStyles) {
|
|
146
|
-
injectStyles.call(this, context)
|
|
147
|
-
}
|
|
148
|
-
// register component module identifier for async chunk inferrence
|
|
149
|
-
if (context && context._registeredComponents) {
|
|
150
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
// used by ssr in case component is cached and beforeCreate
|
|
154
|
-
// never gets called
|
|
155
|
-
options._ssrRegister = hook
|
|
156
|
-
} else if (injectStyles) {
|
|
157
|
-
hook = shadowMode
|
|
158
|
-
? function () {
|
|
159
|
-
injectStyles.call(
|
|
160
|
-
this,
|
|
161
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
: injectStyles
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (hook) {
|
|
168
|
-
if (options.functional) {
|
|
169
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
170
|
-
// go through the normalizer
|
|
171
|
-
options._injectStyles = hook
|
|
172
|
-
// register for functional component in vue file
|
|
173
|
-
var originalRender = options.render
|
|
174
|
-
options.render = function renderWithStyleInjection (h, context) {
|
|
175
|
-
hook.call(context)
|
|
176
|
-
return originalRender(h, context)
|
|
177
|
-
}
|
|
178
|
-
} else {
|
|
179
|
-
// inject component registration as beforeCreate hook
|
|
180
|
-
var existing = options.beforeCreate
|
|
181
|
-
options.beforeCreate = existing
|
|
182
|
-
? [].concat(existing, hook)
|
|
183
|
-
: [hook]
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return {
|
|
188
|
-
exports: scriptExports,
|
|
189
|
-
options: options
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/***/ }),
|
|
195
|
-
/* 1 */
|
|
196
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
197
|
-
|
|
198
|
-
module.exports = __webpack_require__(9);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
/***/ }),
|
|
202
|
-
/* 2 */
|
|
203
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
204
|
-
|
|
205
|
-
"use strict";
|
|
206
|
-
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
207
|
-
data: function data() {
|
|
208
|
-
return {
|
|
209
|
-
uniqueId: null
|
|
210
|
-
};
|
|
211
|
-
},
|
|
212
|
-
mounted: function mounted() {
|
|
213
|
-
var id = this.id || this.$attrs.id;
|
|
214
|
-
this.uniqueId = id ? "".concat(id) : "".concat(this.$options.name, "-").concat(this._uid);
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
/***/ }),
|
|
219
|
-
/* 3 */,
|
|
220
|
-
/* 4 */
|
|
221
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
222
|
-
|
|
223
|
-
"use strict";
|
|
224
|
-
// ESM COMPAT FLAG
|
|
225
|
-
__webpack_require__.r(__webpack_exports__);
|
|
226
|
-
|
|
227
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazBtn/_main.vue?vue&type=template&id=247f3a44&
|
|
228
|
-
var render = function () {
|
|
229
|
-
var _vm = this
|
|
230
|
-
var _h = _vm.$createElement
|
|
231
|
-
var _c = _vm._self._c || _h
|
|
232
|
-
return _c(
|
|
233
|
-
_vm.componentType,
|
|
234
|
-
_vm._b(
|
|
235
|
-
{
|
|
236
|
-
tag: "component",
|
|
237
|
-
staticClass: "maz-base-component maz-btn maz-inline-flex",
|
|
238
|
-
class: [
|
|
239
|
-
_vm.classes,
|
|
240
|
-
{
|
|
241
|
-
"maz-text-hidden": _vm.loading,
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
attrs: {
|
|
245
|
-
id: _vm.uniqueId,
|
|
246
|
-
type: _vm.isLink ? null : _vm.type,
|
|
247
|
-
disabled: _vm.isLink ? null : _vm.isDisabled,
|
|
248
|
-
},
|
|
249
|
-
on: {
|
|
250
|
-
click: function ($event) {
|
|
251
|
-
return _vm.handleClick($event)
|
|
252
|
-
},
|
|
253
|
-
mouseenter: function ($event) {
|
|
254
|
-
return _vm.emitMouseEnter($event)
|
|
255
|
-
},
|
|
256
|
-
mouseleave: function ($event) {
|
|
257
|
-
return _vm.emitMouseLeave($event)
|
|
258
|
-
},
|
|
259
|
-
focus: function ($event) {
|
|
260
|
-
return _vm.emitFocus($event)
|
|
261
|
-
},
|
|
262
|
-
blur: function ($event) {
|
|
263
|
-
return _vm.emitBlur($event)
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
"component",
|
|
268
|
-
_vm.$attrs,
|
|
269
|
-
false
|
|
270
|
-
),
|
|
271
|
-
[
|
|
272
|
-
_vm.hasLeftIcon() || _vm.hasMainIcon()
|
|
273
|
-
? _c(
|
|
274
|
-
"div",
|
|
275
|
-
{
|
|
276
|
-
staticClass: "maz-flex maz-flex-center maz-btn__icon-left",
|
|
277
|
-
class: {
|
|
278
|
-
"maz-mr-2": !_vm.fab && _vm.hasSlotDefault(),
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
[
|
|
282
|
-
_vm._t("icon-left" || false, function () {
|
|
283
|
-
return [
|
|
284
|
-
_c("i", { staticClass: "material-icons" }, [
|
|
285
|
-
_vm._v(_vm._s(_vm.leftIconName || _vm.iconName)),
|
|
286
|
-
]),
|
|
287
|
-
]
|
|
288
|
-
}),
|
|
289
|
-
],
|
|
290
|
-
2
|
|
291
|
-
)
|
|
292
|
-
: _vm._e(),
|
|
293
|
-
_c(
|
|
294
|
-
"span",
|
|
295
|
-
{
|
|
296
|
-
staticClass:
|
|
297
|
-
"maz-flex maz-align-center maz-h-100 maz-overflow-hidden",
|
|
298
|
-
class: [_vm.textClasses, { "maz-flex-1": _vm.hasSlotDefault() }],
|
|
299
|
-
},
|
|
300
|
-
[_vm._t("default")],
|
|
301
|
-
2
|
|
302
|
-
),
|
|
303
|
-
_vm.hasRightIcon()
|
|
304
|
-
? _c(
|
|
305
|
-
"div",
|
|
306
|
-
{
|
|
307
|
-
staticClass: "maz-flex maz-flex-center maz-btn__icon-right",
|
|
308
|
-
class: {
|
|
309
|
-
"maz-ml-2": !_vm.fab && _vm.hasSlotDefault(),
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
[
|
|
313
|
-
_vm._t("icon-right", function () {
|
|
314
|
-
return [
|
|
315
|
-
_c("i", { staticClass: "material-icons" }, [
|
|
316
|
-
_vm._v(_vm._s(_vm.rightIconName)),
|
|
317
|
-
]),
|
|
318
|
-
]
|
|
319
|
-
}),
|
|
320
|
-
],
|
|
321
|
-
2
|
|
322
|
-
)
|
|
323
|
-
: _vm._e(),
|
|
324
|
-
_vm.loading
|
|
325
|
-
? _c(
|
|
326
|
-
"div",
|
|
327
|
-
{ staticClass: "maz-btn__spinner maz-flex maz-flex-center" },
|
|
328
|
-
[_c("MazSpinner", { attrs: { size: 25, color: _vm.color } })],
|
|
329
|
-
1
|
|
330
|
-
)
|
|
331
|
-
: _vm._e(),
|
|
332
|
-
]
|
|
333
|
-
)
|
|
334
|
-
}
|
|
335
|
-
var staticRenderFns = []
|
|
336
|
-
render._withStripped = true
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
// CONCATENATED MODULE: ./packages/components/MazBtn/_main.vue?vue&type=template&id=247f3a44&
|
|
340
|
-
|
|
341
|
-
// EXTERNAL MODULE: ./packages/components/MazSpinner/index.js + 5 modules
|
|
342
|
-
var MazSpinner = __webpack_require__(5);
|
|
343
|
-
|
|
344
|
-
// EXTERNAL MODULE: ./packages/mixins/uniqueId.js
|
|
345
|
-
var uniqueId = __webpack_require__(2);
|
|
346
|
-
|
|
347
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazBtn/_main.vue?vue&type=script&lang=js&
|
|
348
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
349
|
-
|
|
350
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
351
|
-
|
|
352
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
353
|
-
|
|
354
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
355
|
-
|
|
356
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
357
|
-
|
|
358
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
359
|
-
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
//
|
|
364
|
-
//
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
//
|
|
377
|
-
//
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
//
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
//
|
|
391
|
-
//
|
|
392
|
-
//
|
|
393
|
-
//
|
|
394
|
-
//
|
|
395
|
-
//
|
|
396
|
-
//
|
|
397
|
-
//
|
|
398
|
-
//
|
|
399
|
-
//
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
//
|
|
408
|
-
//
|
|
409
|
-
//
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
//
|
|
413
|
-
//
|
|
414
|
-
//
|
|
415
|
-
//
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
//
|
|
421
|
-
//
|
|
422
|
-
//
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
//
|
|
426
|
-
//
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* > Simple button component
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
/* harmony default export */ var _mainvue_type_script_lang_js_ = ({
|
|
434
|
-
name: 'MazBtn',
|
|
435
|
-
components: {
|
|
436
|
-
MazSpinner: MazSpinner["default"]
|
|
437
|
-
},
|
|
438
|
-
mixins: [uniqueId["a" /* default */]],
|
|
439
|
-
inheritAttrs: false,
|
|
440
|
-
props: {
|
|
441
|
-
// is the id of the button
|
|
442
|
-
id: {
|
|
443
|
-
type: String,
|
|
444
|
-
default: null
|
|
445
|
-
},
|
|
446
|
-
// is color type (`primary` / `secondary` / `third` / `success` / `danger` / `grey` / `info` / `warning` / `light` / `dark` / `default` / `white` / `black`)
|
|
447
|
-
color: {
|
|
448
|
-
type: String,
|
|
449
|
-
default: 'primary'
|
|
450
|
-
},
|
|
451
|
-
// is the button type (button, submit or something else)
|
|
452
|
-
type: {
|
|
453
|
-
type: String,
|
|
454
|
-
default: 'button'
|
|
455
|
-
},
|
|
456
|
-
// button size (`xl`, `lg` / `md` / `sm` / `mini`)
|
|
457
|
-
size: {
|
|
458
|
-
type: String,
|
|
459
|
-
default: 'md'
|
|
460
|
-
},
|
|
461
|
-
// is a `boolean` to show the loader & disable it
|
|
462
|
-
loading: {
|
|
463
|
-
type: Boolean,
|
|
464
|
-
default: false
|
|
465
|
-
},
|
|
466
|
-
// is a `boolean` to disable the button
|
|
467
|
-
disabled: {
|
|
468
|
-
type: Boolean,
|
|
469
|
-
default: false
|
|
470
|
-
},
|
|
471
|
-
// apply the outline style
|
|
472
|
-
outline: {
|
|
473
|
-
type: Boolean,
|
|
474
|
-
default: false
|
|
475
|
-
},
|
|
476
|
-
// apply the rounded style
|
|
477
|
-
rounded: {
|
|
478
|
-
type: Boolean,
|
|
479
|
-
default: false
|
|
480
|
-
},
|
|
481
|
-
// apply the fab style
|
|
482
|
-
fab: {
|
|
483
|
-
type: Boolean,
|
|
484
|
-
default: false
|
|
485
|
-
},
|
|
486
|
-
// apply the focus style
|
|
487
|
-
active: {
|
|
488
|
-
type: Boolean,
|
|
489
|
-
default: false
|
|
490
|
-
},
|
|
491
|
-
// take 100% of the width
|
|
492
|
-
block: {
|
|
493
|
-
type: Boolean,
|
|
494
|
-
default: false
|
|
495
|
-
},
|
|
496
|
-
// remove shadow/elevation
|
|
497
|
-
noShadow: {
|
|
498
|
-
type: Boolean,
|
|
499
|
-
default: false
|
|
500
|
-
},
|
|
501
|
-
// should be a [material icon](https://material.io/resources/icons/) name (usefull with fab buttons)
|
|
502
|
-
iconName: {
|
|
503
|
-
type: String,
|
|
504
|
-
default: null
|
|
505
|
-
},
|
|
506
|
-
// should be a [material icon](https://material.io/resources/icons/) name
|
|
507
|
-
leftIconName: {
|
|
508
|
-
type: String,
|
|
509
|
-
default: null
|
|
510
|
-
},
|
|
511
|
-
// should be a [material icon](https://material.io/resources/icons/) name
|
|
512
|
-
rightIconName: {
|
|
513
|
-
type: String,
|
|
514
|
-
default: null
|
|
515
|
-
},
|
|
516
|
-
// align text to left (for block button)
|
|
517
|
-
justifyStart: {
|
|
518
|
-
type: Boolean,
|
|
519
|
-
default: false
|
|
520
|
-
},
|
|
521
|
-
// align text to right (for block button)
|
|
522
|
-
justifyEnd: {
|
|
523
|
-
type: Boolean,
|
|
524
|
-
default: false
|
|
525
|
-
}
|
|
526
|
-
},
|
|
527
|
-
computed: {
|
|
528
|
-
componentType: function componentType() {
|
|
529
|
-
var _this$$attrs = this.$attrs,
|
|
530
|
-
href = _this$$attrs.href,
|
|
531
|
-
to = _this$$attrs.to;
|
|
532
|
-
if (href) return 'a';else if (to) return 'router-link';
|
|
533
|
-
return 'button';
|
|
534
|
-
},
|
|
535
|
-
isLink: function isLink() {
|
|
536
|
-
return this.componentType === 'a';
|
|
537
|
-
},
|
|
538
|
-
isDisabled: function isDisabled() {
|
|
539
|
-
var disabled = this.disabled,
|
|
540
|
-
loading = this.loading;
|
|
541
|
-
return loading || disabled;
|
|
542
|
-
},
|
|
543
|
-
classes: function classes() {
|
|
544
|
-
var color = this.color,
|
|
545
|
-
size = this.size,
|
|
546
|
-
outline = this.outline,
|
|
547
|
-
rounded = this.rounded,
|
|
548
|
-
fab = this.fab,
|
|
549
|
-
active = this.active,
|
|
550
|
-
block = this.block,
|
|
551
|
-
noShadow = this.noShadow,
|
|
552
|
-
hasRightIcon = this.hasRightIcon,
|
|
553
|
-
hasLeftIcon = this.hasLeftIcon,
|
|
554
|
-
hasIcon = this.hasIcon,
|
|
555
|
-
hasSlotDefault = this.hasSlotDefault;
|
|
556
|
-
return [].concat(_toConsumableArray(color ? ["maz-btn--".concat(color)] : [null]), _toConsumableArray(size ? ["maz-btn--".concat(size)] : [null]), _toConsumableArray(outline ? ['maz-btn--outline'] : [null]), _toConsumableArray(rounded ? ['maz-btn--rounded'] : [null]), _toConsumableArray(block ? ['maz-btn--block'] : [null]), _toConsumableArray(fab ? ['maz-btn--fab'] : [null]), _toConsumableArray(active ? ['maz-active'] : [null]), _toConsumableArray(noShadow ? ['maz-no-shadow'] : [null]), _toConsumableArray(hasLeftIcon() ? ['maz-btn--icon--left'] : [null]), _toConsumableArray(hasRightIcon() ? ['maz-btn--icon--right'] : [null]), _toConsumableArray(hasIcon() ? ['maz-btn--icon'] : [null]), _toConsumableArray(!hasSlotDefault() ? ['maz-btn--no-text'] : [null]));
|
|
557
|
-
},
|
|
558
|
-
textClasses: function textClasses() {
|
|
559
|
-
var justifyStart = this.justifyStart,
|
|
560
|
-
justifyEnd = this.justifyEnd;
|
|
561
|
-
return [].concat(_toConsumableArray(justifyStart ? ['maz-justify-start'] : [null]), _toConsumableArray(justifyEnd ? ['maz-justify-end'] : [null]), _toConsumableArray(!justifyStart && !justifyEnd ? ['maz-justify-center'] : [null]));
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
methods: {
|
|
565
|
-
hasSlotDefault: function hasSlotDefault() {
|
|
566
|
-
return this.$slots['default'];
|
|
567
|
-
},
|
|
568
|
-
hasIcon: function hasIcon() {
|
|
569
|
-
return this.hasLeftIcon() || this.hasRightIcon() || this.hasMainIcon();
|
|
570
|
-
},
|
|
571
|
-
hasMainIcon: function hasMainIcon() {
|
|
572
|
-
return this.iconName || this.$slots['icon'];
|
|
573
|
-
},
|
|
574
|
-
hasLeftIcon: function hasLeftIcon() {
|
|
575
|
-
return this.leftIconName || this.$slots['icon-left'];
|
|
576
|
-
},
|
|
577
|
-
hasRightIcon: function hasRightIcon() {
|
|
578
|
-
return this.rightIconName || this.$slots['icon-right'];
|
|
579
|
-
},
|
|
580
|
-
handleClick: function handleClick(e) {
|
|
581
|
-
// return click event
|
|
582
|
-
this.$emit('click', e);
|
|
583
|
-
},
|
|
584
|
-
emitMouseEnter: function emitMouseEnter(e) {
|
|
585
|
-
// return mouseenter event
|
|
586
|
-
this.$emit('mouseenter', e);
|
|
587
|
-
},
|
|
588
|
-
emitMouseLeave: function emitMouseLeave(e) {
|
|
589
|
-
// return mouseleave event
|
|
590
|
-
this.$emit('mouseleave', e);
|
|
591
|
-
},
|
|
592
|
-
emitFocus: function emitFocus(e) {
|
|
593
|
-
// return focus event
|
|
594
|
-
this.$emit('focus', e);
|
|
595
|
-
},
|
|
596
|
-
emitBlur: function emitBlur(e) {
|
|
597
|
-
// return blur event
|
|
598
|
-
this.$emit('blur', e);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
});
|
|
602
|
-
// CONCATENATED MODULE: ./packages/components/MazBtn/_main.vue?vue&type=script&lang=js&
|
|
603
|
-
/* harmony default export */ var MazBtn_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
|
|
604
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
605
|
-
var componentNormalizer = __webpack_require__(0);
|
|
606
|
-
|
|
607
|
-
// CONCATENATED MODULE: ./packages/components/MazBtn/_main.vue
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
/* normalize component */
|
|
614
|
-
|
|
615
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
616
|
-
MazBtn_mainvue_type_script_lang_js_,
|
|
617
|
-
render,
|
|
618
|
-
staticRenderFns,
|
|
619
|
-
false,
|
|
620
|
-
null,
|
|
621
|
-
null,
|
|
622
|
-
null
|
|
623
|
-
|
|
624
|
-
)
|
|
625
|
-
|
|
626
|
-
/* hot reload */
|
|
627
|
-
if (false) { var api; }
|
|
628
|
-
component.options.__file = "packages/components/MazBtn/_main.vue"
|
|
629
|
-
/* harmony default export */ var _main = (component.exports);
|
|
630
|
-
// CONCATENATED MODULE: ./packages/components/MazBtn/index.js
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
_main.install = function (Vue) {
|
|
634
|
-
Vue.component(_main.name, _main);
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
/* harmony default export */ var MazBtn = __webpack_exports__["default"] = (_main);
|
|
638
|
-
|
|
639
|
-
/***/ }),
|
|
640
|
-
/* 5 */
|
|
641
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
642
|
-
|
|
643
|
-
"use strict";
|
|
644
|
-
// ESM COMPAT FLAG
|
|
645
|
-
__webpack_require__.r(__webpack_exports__);
|
|
646
|
-
|
|
647
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSpinner/_main.vue?vue&type=template&id=67a8ca41&
|
|
648
|
-
var render = function () {
|
|
649
|
-
var _vm = this
|
|
650
|
-
var _h = _vm.$createElement
|
|
651
|
-
var _c = _vm._self._c || _h
|
|
652
|
-
return _c(
|
|
653
|
-
"svg",
|
|
654
|
-
{
|
|
655
|
-
staticClass: "maz-base-component maz-spinner maz-spinner-anim",
|
|
656
|
-
class: [
|
|
657
|
-
{
|
|
658
|
-
"spinner-anim__white": _vm.dark,
|
|
659
|
-
},
|
|
660
|
-
_vm.fillColorClass,
|
|
661
|
-
],
|
|
662
|
-
staticStyle: { "enable-background": "new 0 0 50 50" },
|
|
663
|
-
attrs: {
|
|
664
|
-
width: _vm.size + "px",
|
|
665
|
-
height: _vm.size + "px",
|
|
666
|
-
version: "1.1",
|
|
667
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
668
|
-
x: "0px",
|
|
669
|
-
y: "0px",
|
|
670
|
-
viewBox: "0 0 50 50",
|
|
671
|
-
"xml:space": "preserve",
|
|
672
|
-
},
|
|
673
|
-
},
|
|
674
|
-
[
|
|
675
|
-
_c("path", {
|
|
676
|
-
attrs: {
|
|
677
|
-
d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z",
|
|
678
|
-
},
|
|
679
|
-
}),
|
|
680
|
-
]
|
|
681
|
-
)
|
|
682
|
-
}
|
|
683
|
-
var staticRenderFns = []
|
|
684
|
-
render._withStripped = true
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
// CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue?vue&type=template&id=67a8ca41&
|
|
688
|
-
|
|
689
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSpinner/_main.vue?vue&type=script&lang=js&
|
|
690
|
-
//
|
|
691
|
-
//
|
|
692
|
-
//
|
|
693
|
-
//
|
|
694
|
-
//
|
|
695
|
-
//
|
|
696
|
-
//
|
|
697
|
-
//
|
|
698
|
-
//
|
|
699
|
-
//
|
|
700
|
-
//
|
|
701
|
-
//
|
|
702
|
-
//
|
|
703
|
-
//
|
|
704
|
-
//
|
|
705
|
-
//
|
|
706
|
-
//
|
|
707
|
-
//
|
|
708
|
-
//
|
|
709
|
-
//
|
|
710
|
-
/* harmony default export */ var _mainvue_type_script_lang_js_ = ({
|
|
711
|
-
name: 'MazSpinner',
|
|
712
|
-
props: {
|
|
713
|
-
size: {
|
|
714
|
-
type: Number,
|
|
715
|
-
default: 40
|
|
716
|
-
},
|
|
717
|
-
dark: {
|
|
718
|
-
type: Boolean,
|
|
719
|
-
default: false
|
|
720
|
-
},
|
|
721
|
-
color: {
|
|
722
|
-
type: String,
|
|
723
|
-
default: 'primary'
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
computed: {
|
|
727
|
-
fillColorClass: function fillColorClass() {
|
|
728
|
-
return "maz-fill-".concat(this.color);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
// CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue?vue&type=script&lang=js&
|
|
733
|
-
/* harmony default export */ var MazSpinner_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
|
|
734
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
735
|
-
var componentNormalizer = __webpack_require__(0);
|
|
736
|
-
|
|
737
|
-
// CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
/* normalize component */
|
|
744
|
-
|
|
745
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
746
|
-
MazSpinner_mainvue_type_script_lang_js_,
|
|
747
|
-
render,
|
|
748
|
-
staticRenderFns,
|
|
749
|
-
false,
|
|
750
|
-
null,
|
|
751
|
-
null,
|
|
752
|
-
null
|
|
753
|
-
|
|
754
|
-
)
|
|
755
|
-
|
|
756
|
-
/* hot reload */
|
|
757
|
-
if (false) { var api; }
|
|
758
|
-
component.options.__file = "packages/components/MazSpinner/_main.vue"
|
|
759
|
-
/* harmony default export */ var _main = (component.exports);
|
|
760
|
-
// CONCATENATED MODULE: ./packages/components/MazSpinner/index.js
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
_main.install = function (Vue) {
|
|
764
|
-
Vue.component(_main.name, _main);
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
/* harmony default export */ var MazSpinner = __webpack_exports__["default"] = (_main);
|
|
768
|
-
|
|
769
|
-
/***/ }),
|
|
770
|
-
/* 6 */
|
|
771
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
772
|
-
|
|
773
|
-
"use strict";
|
|
774
|
-
|
|
775
|
-
// EXPORTS
|
|
776
|
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ debounce; });
|
|
777
|
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ pascalCaseToKebabCase; });
|
|
778
|
-
|
|
779
|
-
// CONCATENATED MODULE: ./packages/utils/debounce.js
|
|
780
|
-
/* harmony default export */ var debounce = (function (func, delay) {
|
|
781
|
-
var debounceTimer;
|
|
782
|
-
return function () {
|
|
783
|
-
var context = this;
|
|
784
|
-
var args = arguments;
|
|
785
|
-
clearTimeout(debounceTimer);
|
|
786
|
-
debounceTimer = setTimeout(function () {
|
|
787
|
-
return func.apply(context, args);
|
|
788
|
-
}, delay);
|
|
789
|
-
};
|
|
790
|
-
});
|
|
791
|
-
// CONCATENATED MODULE: ./packages/utils/pascalCaseToKebabCase.js
|
|
792
|
-
/* harmony default export */ var pascalCaseToKebabCase = (function (string) {
|
|
793
|
-
return string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2').toLowerCase();
|
|
794
|
-
});
|
|
795
|
-
// CONCATENATED MODULE: ./packages/utils/index.js
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
/***/ }),
|
|
800
|
-
/* 7 */,
|
|
801
|
-
/* 8 */
|
|
802
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
803
|
-
|
|
804
|
-
"use strict";
|
|
805
|
-
// ESM COMPAT FLAG
|
|
806
|
-
__webpack_require__.r(__webpack_exports__);
|
|
807
|
-
|
|
808
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazInput/_main.vue?vue&type=template&id=5b617c72&
|
|
809
|
-
var render = function () {
|
|
810
|
-
var _vm = this
|
|
811
|
-
var _h = _vm.$createElement
|
|
812
|
-
var _c = _vm._self._c || _h
|
|
813
|
-
return _c(
|
|
814
|
-
"div",
|
|
815
|
-
{
|
|
816
|
-
ref: "parent",
|
|
817
|
-
staticClass:
|
|
818
|
-
"maz-base-component maz-input maz-border maz-border-color maz-border-color-hover maz-border-solid maz-border-radius",
|
|
819
|
-
class: [
|
|
820
|
-
{
|
|
821
|
-
"is-focused": _vm.isFocus || _vm.focus,
|
|
822
|
-
"is-valid": _vm.success,
|
|
823
|
-
"has-value": _vm.value,
|
|
824
|
-
"is-textarea": _vm.textarea,
|
|
825
|
-
"has-error": _vm.error,
|
|
826
|
-
"has-warning": _vm.warning,
|
|
827
|
-
"is-disabled": _vm.disabled,
|
|
828
|
-
"maz-is-dark": _vm.dark,
|
|
829
|
-
"has-hint": _vm.hint,
|
|
830
|
-
"has-no-label": !_vm.hasLabel && !_vm.hint,
|
|
831
|
-
"has-left-icon": _vm.hasLeftIcon(),
|
|
832
|
-
},
|
|
833
|
-
"maz-input--" + _vm.size,
|
|
834
|
-
"has-" + _vm.leftNumberIcon + "-right-icon",
|
|
835
|
-
"maz-input--" + _vm.color,
|
|
836
|
-
],
|
|
837
|
-
on: { click: _vm.focusInput },
|
|
838
|
-
},
|
|
839
|
-
[
|
|
840
|
-
_vm.hasLeftIcon()
|
|
841
|
-
? _c(
|
|
842
|
-
"div",
|
|
843
|
-
{
|
|
844
|
-
staticClass: "maz-input__icon maz-flex left",
|
|
845
|
-
class: [
|
|
846
|
-
_vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center",
|
|
847
|
-
],
|
|
848
|
-
},
|
|
849
|
-
[
|
|
850
|
-
_vm._t("icon-left", function () {
|
|
851
|
-
return [
|
|
852
|
-
_c("i", { staticClass: "material-icons" }, [
|
|
853
|
-
_vm._v(_vm._s(_vm.leftIconName)),
|
|
854
|
-
]),
|
|
855
|
-
]
|
|
856
|
-
}),
|
|
857
|
-
],
|
|
858
|
-
2
|
|
859
|
-
)
|
|
860
|
-
: _vm._e(),
|
|
861
|
-
_vm.hasRightIcon()
|
|
862
|
-
? _c(
|
|
863
|
-
"div",
|
|
864
|
-
{
|
|
865
|
-
staticClass: "maz-input__icon maz-flex right",
|
|
866
|
-
class: [
|
|
867
|
-
_vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center",
|
|
868
|
-
],
|
|
869
|
-
},
|
|
870
|
-
[
|
|
871
|
-
_vm._t("icon-right", function () {
|
|
872
|
-
return [
|
|
873
|
-
_c("i", { staticClass: "material-icons" }, [
|
|
874
|
-
_vm._v(_vm._s(_vm.rightIconName)),
|
|
875
|
-
]),
|
|
876
|
-
]
|
|
877
|
-
}),
|
|
878
|
-
],
|
|
879
|
-
2
|
|
880
|
-
)
|
|
881
|
-
: _vm._e(),
|
|
882
|
-
_vm.getType === "checkbox" && !_vm.textarea
|
|
883
|
-
? _c(
|
|
884
|
-
"input",
|
|
885
|
-
_vm._b(
|
|
886
|
-
{
|
|
887
|
-
directives: [
|
|
888
|
-
{
|
|
889
|
-
name: "model",
|
|
890
|
-
rawName: "v-model",
|
|
891
|
-
value: _vm.inputValue,
|
|
892
|
-
expression: "inputValue",
|
|
893
|
-
},
|
|
894
|
-
],
|
|
895
|
-
ref: "MazInput",
|
|
896
|
-
staticClass: "maz-input__input maz-border-radius",
|
|
897
|
-
class: {
|
|
898
|
-
"has-right-icon":
|
|
899
|
-
_vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
|
|
900
|
-
},
|
|
901
|
-
attrs: {
|
|
902
|
-
id: _vm.uniqueId,
|
|
903
|
-
placeholder: _vm.placeholderValue,
|
|
904
|
-
"aria-label": _vm.placeholder,
|
|
905
|
-
disabled: _vm.disabled,
|
|
906
|
-
required: _vm.required,
|
|
907
|
-
readonly: _vm.readonly,
|
|
908
|
-
type: "checkbox",
|
|
909
|
-
},
|
|
910
|
-
domProps: {
|
|
911
|
-
checked: Array.isArray(_vm.inputValue)
|
|
912
|
-
? _vm._i(_vm.inputValue, null) > -1
|
|
913
|
-
: _vm.inputValue,
|
|
914
|
-
},
|
|
915
|
-
on: {
|
|
916
|
-
keydown: _vm.keyDown,
|
|
917
|
-
keyup: _vm.keyUp,
|
|
918
|
-
focus: _vm.onFocus,
|
|
919
|
-
blur: _vm.onBlur,
|
|
920
|
-
paste: _vm.onPaste,
|
|
921
|
-
change: [
|
|
922
|
-
function ($event) {
|
|
923
|
-
var $$a = _vm.inputValue,
|
|
924
|
-
$$el = $event.target,
|
|
925
|
-
$$c = $$el.checked ? true : false
|
|
926
|
-
if (Array.isArray($$a)) {
|
|
927
|
-
var $$v = null,
|
|
928
|
-
$$i = _vm._i($$a, $$v)
|
|
929
|
-
if ($$el.checked) {
|
|
930
|
-
$$i < 0 && (_vm.inputValue = $$a.concat([$$v]))
|
|
931
|
-
} else {
|
|
932
|
-
$$i > -1 &&
|
|
933
|
-
(_vm.inputValue = $$a
|
|
934
|
-
.slice(0, $$i)
|
|
935
|
-
.concat($$a.slice($$i + 1)))
|
|
936
|
-
}
|
|
937
|
-
} else {
|
|
938
|
-
_vm.inputValue = $$c
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
_vm.onChange,
|
|
942
|
-
],
|
|
943
|
-
click: function ($event) {
|
|
944
|
-
return _vm.$emit("click", $event)
|
|
945
|
-
},
|
|
946
|
-
},
|
|
947
|
-
},
|
|
948
|
-
"input",
|
|
949
|
-
_vm.$attrs,
|
|
950
|
-
false
|
|
951
|
-
)
|
|
952
|
-
)
|
|
953
|
-
: _vm.getType === "radio" && !_vm.textarea
|
|
954
|
-
? _c(
|
|
955
|
-
"input",
|
|
956
|
-
_vm._b(
|
|
957
|
-
{
|
|
958
|
-
directives: [
|
|
959
|
-
{
|
|
960
|
-
name: "model",
|
|
961
|
-
rawName: "v-model",
|
|
962
|
-
value: _vm.inputValue,
|
|
963
|
-
expression: "inputValue",
|
|
964
|
-
},
|
|
965
|
-
],
|
|
966
|
-
ref: "MazInput",
|
|
967
|
-
staticClass: "maz-input__input maz-border-radius",
|
|
968
|
-
class: {
|
|
969
|
-
"has-right-icon":
|
|
970
|
-
_vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
|
|
971
|
-
},
|
|
972
|
-
attrs: {
|
|
973
|
-
id: _vm.uniqueId,
|
|
974
|
-
placeholder: _vm.placeholderValue,
|
|
975
|
-
"aria-label": _vm.placeholder,
|
|
976
|
-
disabled: _vm.disabled,
|
|
977
|
-
required: _vm.required,
|
|
978
|
-
readonly: _vm.readonly,
|
|
979
|
-
type: "radio",
|
|
980
|
-
},
|
|
981
|
-
domProps: { checked: _vm._q(_vm.inputValue, null) },
|
|
982
|
-
on: {
|
|
983
|
-
keydown: _vm.keyDown,
|
|
984
|
-
keyup: _vm.keyUp,
|
|
985
|
-
focus: _vm.onFocus,
|
|
986
|
-
blur: _vm.onBlur,
|
|
987
|
-
paste: _vm.onPaste,
|
|
988
|
-
change: [
|
|
989
|
-
function ($event) {
|
|
990
|
-
_vm.inputValue = null
|
|
991
|
-
},
|
|
992
|
-
_vm.onChange,
|
|
993
|
-
],
|
|
994
|
-
click: function ($event) {
|
|
995
|
-
return _vm.$emit("click", $event)
|
|
996
|
-
},
|
|
997
|
-
},
|
|
998
|
-
},
|
|
999
|
-
"input",
|
|
1000
|
-
_vm.$attrs,
|
|
1001
|
-
false
|
|
1002
|
-
)
|
|
1003
|
-
)
|
|
1004
|
-
: !_vm.textarea
|
|
1005
|
-
? _c(
|
|
1006
|
-
"input",
|
|
1007
|
-
_vm._b(
|
|
1008
|
-
{
|
|
1009
|
-
directives: [
|
|
1010
|
-
{
|
|
1011
|
-
name: "model",
|
|
1012
|
-
rawName: "v-model",
|
|
1013
|
-
value: _vm.inputValue,
|
|
1014
|
-
expression: "inputValue",
|
|
1015
|
-
},
|
|
1016
|
-
],
|
|
1017
|
-
ref: "MazInput",
|
|
1018
|
-
staticClass: "maz-input__input maz-border-radius",
|
|
1019
|
-
class: {
|
|
1020
|
-
"has-right-icon":
|
|
1021
|
-
_vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
|
|
1022
|
-
},
|
|
1023
|
-
attrs: {
|
|
1024
|
-
id: _vm.uniqueId,
|
|
1025
|
-
placeholder: _vm.placeholderValue,
|
|
1026
|
-
"aria-label": _vm.placeholder,
|
|
1027
|
-
disabled: _vm.disabled,
|
|
1028
|
-
required: _vm.required,
|
|
1029
|
-
readonly: _vm.readonly,
|
|
1030
|
-
type: _vm.getType,
|
|
1031
|
-
},
|
|
1032
|
-
domProps: { value: _vm.inputValue },
|
|
1033
|
-
on: {
|
|
1034
|
-
keydown: _vm.keyDown,
|
|
1035
|
-
keyup: _vm.keyUp,
|
|
1036
|
-
focus: _vm.onFocus,
|
|
1037
|
-
blur: _vm.onBlur,
|
|
1038
|
-
paste: _vm.onPaste,
|
|
1039
|
-
change: _vm.onChange,
|
|
1040
|
-
click: function ($event) {
|
|
1041
|
-
return _vm.$emit("click", $event)
|
|
1042
|
-
},
|
|
1043
|
-
input: function ($event) {
|
|
1044
|
-
if ($event.target.composing) {
|
|
1045
|
-
return
|
|
1046
|
-
}
|
|
1047
|
-
_vm.inputValue = $event.target.value
|
|
1048
|
-
},
|
|
1049
|
-
},
|
|
1050
|
-
},
|
|
1051
|
-
"input",
|
|
1052
|
-
_vm.$attrs,
|
|
1053
|
-
false
|
|
1054
|
-
)
|
|
1055
|
-
)
|
|
1056
|
-
: _c(
|
|
1057
|
-
"textarea",
|
|
1058
|
-
_vm._b(
|
|
1059
|
-
{
|
|
1060
|
-
directives: [
|
|
1061
|
-
{
|
|
1062
|
-
name: "model",
|
|
1063
|
-
rawName: "v-model",
|
|
1064
|
-
value: _vm.inputValue,
|
|
1065
|
-
expression: "inputValue",
|
|
1066
|
-
},
|
|
1067
|
-
],
|
|
1068
|
-
ref: "MazInput",
|
|
1069
|
-
staticClass: "maz-input__input maz-textarea",
|
|
1070
|
-
attrs: {
|
|
1071
|
-
id: _vm.uniqueId,
|
|
1072
|
-
placeholder: _vm.placeholderValue,
|
|
1073
|
-
type: _vm.type,
|
|
1074
|
-
required: _vm.required,
|
|
1075
|
-
readonly: _vm.readonly,
|
|
1076
|
-
},
|
|
1077
|
-
domProps: { value: _vm.inputValue },
|
|
1078
|
-
on: {
|
|
1079
|
-
keydown: _vm.keyDown,
|
|
1080
|
-
keyup: _vm.keyUp,
|
|
1081
|
-
focus: _vm.onFocus,
|
|
1082
|
-
blur: _vm.onBlur,
|
|
1083
|
-
paste: _vm.onPaste,
|
|
1084
|
-
change: _vm.onChange,
|
|
1085
|
-
click: function ($event) {
|
|
1086
|
-
return _vm.$emit("click", $event)
|
|
1087
|
-
},
|
|
1088
|
-
input: function ($event) {
|
|
1089
|
-
if ($event.target.composing) {
|
|
1090
|
-
return
|
|
1091
|
-
}
|
|
1092
|
-
_vm.inputValue = $event.target.value
|
|
1093
|
-
},
|
|
1094
|
-
},
|
|
1095
|
-
},
|
|
1096
|
-
"textarea",
|
|
1097
|
-
_vm.$attrs,
|
|
1098
|
-
false
|
|
1099
|
-
)
|
|
1100
|
-
),
|
|
1101
|
-
_vm.hasLabel || _vm.hint
|
|
1102
|
-
? _c(
|
|
1103
|
-
"label",
|
|
1104
|
-
{
|
|
1105
|
-
ref: "label",
|
|
1106
|
-
staticClass: "maz-input__label",
|
|
1107
|
-
class: _vm.error ? "maz-text-danger" : null,
|
|
1108
|
-
attrs: { for: _vm.uniqueId, tabindex: "-1" },
|
|
1109
|
-
on: { click: _vm.focusInput },
|
|
1110
|
-
},
|
|
1111
|
-
[
|
|
1112
|
-
_vm._v(
|
|
1113
|
-
"\n " +
|
|
1114
|
-
_vm._s(_vm.hintValue || _vm.placeholderValue) +
|
|
1115
|
-
"\n "
|
|
1116
|
-
),
|
|
1117
|
-
]
|
|
1118
|
-
)
|
|
1119
|
-
: _vm._e(),
|
|
1120
|
-
_c("transition-group", { attrs: { name: "maz-scale" } }, [
|
|
1121
|
-
_vm.hasClearBtn
|
|
1122
|
-
? _c(
|
|
1123
|
-
"button",
|
|
1124
|
-
{
|
|
1125
|
-
key: "clear-button",
|
|
1126
|
-
staticClass:
|
|
1127
|
-
"maz-input__toggle-btn --clear maz-flex maz-flex-center",
|
|
1128
|
-
class: { "has-right-icon": _vm.hasRightIcon() },
|
|
1129
|
-
attrs: { title: "clear", type: "button", tabindex: "-1" },
|
|
1130
|
-
on: {
|
|
1131
|
-
click: function ($event) {
|
|
1132
|
-
$event.stopPropagation()
|
|
1133
|
-
return _vm.clear.apply(null, arguments)
|
|
1134
|
-
},
|
|
1135
|
-
},
|
|
1136
|
-
},
|
|
1137
|
-
[
|
|
1138
|
-
_c(
|
|
1139
|
-
"i",
|
|
1140
|
-
{ staticClass: "maz-input__toggle-btn__icon material-icons" },
|
|
1141
|
-
[_vm._v("\n close\n ")]
|
|
1142
|
-
),
|
|
1143
|
-
]
|
|
1144
|
-
)
|
|
1145
|
-
: _vm._e(),
|
|
1146
|
-
_vm.hasPasswordBtn
|
|
1147
|
-
? _c(
|
|
1148
|
-
"button",
|
|
1149
|
-
{
|
|
1150
|
-
key: "password-button",
|
|
1151
|
-
staticClass:
|
|
1152
|
-
"maz-input__toggle-btn password maz-flex maz-flex-center",
|
|
1153
|
-
class: {
|
|
1154
|
-
"has-clear-btn": _vm.hasClearBtn,
|
|
1155
|
-
"has-right-icon": _vm.hasRightIcon(),
|
|
1156
|
-
},
|
|
1157
|
-
attrs: { title: "clear", type: "button", tabindex: "-1" },
|
|
1158
|
-
on: {
|
|
1159
|
-
click: function ($event) {
|
|
1160
|
-
_vm.showPassword = !_vm.showPassword
|
|
1161
|
-
},
|
|
1162
|
-
},
|
|
1163
|
-
},
|
|
1164
|
-
[
|
|
1165
|
-
_c(
|
|
1166
|
-
"i",
|
|
1167
|
-
{ staticClass: "maz-input__toggle-btn__icon material-icons" },
|
|
1168
|
-
[
|
|
1169
|
-
_vm._v(
|
|
1170
|
-
"\n " +
|
|
1171
|
-
_vm._s(
|
|
1172
|
-
_vm.showPassword ? "visibility_off" : "visibility"
|
|
1173
|
-
) +
|
|
1174
|
-
"\n "
|
|
1175
|
-
),
|
|
1176
|
-
]
|
|
1177
|
-
),
|
|
1178
|
-
]
|
|
1179
|
-
)
|
|
1180
|
-
: _vm._e(),
|
|
1181
|
-
]),
|
|
1182
|
-
_vm.loading
|
|
1183
|
-
? _c(
|
|
1184
|
-
"div",
|
|
1185
|
-
{
|
|
1186
|
-
staticClass: "maz-input__loader",
|
|
1187
|
-
class: { textarea: _vm.textarea },
|
|
1188
|
-
},
|
|
1189
|
-
[_c("div", { staticClass: "maz-input__loader__progress-bar" })]
|
|
1190
|
-
)
|
|
1191
|
-
: _vm._e(),
|
|
1192
|
-
],
|
|
1193
|
-
1
|
|
1194
|
-
)
|
|
1195
|
-
}
|
|
1196
|
-
var staticRenderFns = []
|
|
1197
|
-
render._withStripped = true
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
// CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=template&id=5b617c72&
|
|
1201
|
-
|
|
1202
|
-
// EXTERNAL MODULE: ./packages/mixins/uniqueId.js
|
|
1203
|
-
var uniqueId = __webpack_require__(2);
|
|
1204
|
-
|
|
1205
|
-
// EXTERNAL MODULE: ./packages/utils/index.js + 2 modules
|
|
1206
|
-
var utils = __webpack_require__(6);
|
|
1207
|
-
|
|
1208
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazInput/_main.vue?vue&type=script&lang=js&
|
|
1209
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1210
|
-
|
|
1211
|
-
//
|
|
1212
|
-
//
|
|
1213
|
-
//
|
|
1214
|
-
//
|
|
1215
|
-
//
|
|
1216
|
-
//
|
|
1217
|
-
//
|
|
1218
|
-
//
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
//
|
|
1222
|
-
//
|
|
1223
|
-
//
|
|
1224
|
-
//
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
//
|
|
1228
|
-
//
|
|
1229
|
-
//
|
|
1230
|
-
//
|
|
1231
|
-
//
|
|
1232
|
-
//
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
//
|
|
1236
|
-
//
|
|
1237
|
-
//
|
|
1238
|
-
//
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1242
|
-
//
|
|
1243
|
-
//
|
|
1244
|
-
//
|
|
1245
|
-
//
|
|
1246
|
-
//
|
|
1247
|
-
//
|
|
1248
|
-
//
|
|
1249
|
-
//
|
|
1250
|
-
//
|
|
1251
|
-
//
|
|
1252
|
-
//
|
|
1253
|
-
//
|
|
1254
|
-
//
|
|
1255
|
-
//
|
|
1256
|
-
//
|
|
1257
|
-
//
|
|
1258
|
-
//
|
|
1259
|
-
//
|
|
1260
|
-
//
|
|
1261
|
-
//
|
|
1262
|
-
//
|
|
1263
|
-
//
|
|
1264
|
-
//
|
|
1265
|
-
//
|
|
1266
|
-
//
|
|
1267
|
-
//
|
|
1268
|
-
//
|
|
1269
|
-
//
|
|
1270
|
-
//
|
|
1271
|
-
//
|
|
1272
|
-
//
|
|
1273
|
-
//
|
|
1274
|
-
//
|
|
1275
|
-
//
|
|
1276
|
-
//
|
|
1277
|
-
//
|
|
1278
|
-
//
|
|
1279
|
-
//
|
|
1280
|
-
//
|
|
1281
|
-
//
|
|
1282
|
-
//
|
|
1283
|
-
//
|
|
1284
|
-
//
|
|
1285
|
-
//
|
|
1286
|
-
//
|
|
1287
|
-
//
|
|
1288
|
-
//
|
|
1289
|
-
//
|
|
1290
|
-
//
|
|
1291
|
-
//
|
|
1292
|
-
//
|
|
1293
|
-
//
|
|
1294
|
-
//
|
|
1295
|
-
//
|
|
1296
|
-
//
|
|
1297
|
-
//
|
|
1298
|
-
//
|
|
1299
|
-
//
|
|
1300
|
-
//
|
|
1301
|
-
//
|
|
1302
|
-
//
|
|
1303
|
-
//
|
|
1304
|
-
//
|
|
1305
|
-
//
|
|
1306
|
-
//
|
|
1307
|
-
//
|
|
1308
|
-
//
|
|
1309
|
-
//
|
|
1310
|
-
//
|
|
1311
|
-
//
|
|
1312
|
-
//
|
|
1313
|
-
//
|
|
1314
|
-
//
|
|
1315
|
-
//
|
|
1316
|
-
//
|
|
1317
|
-
//
|
|
1318
|
-
//
|
|
1319
|
-
//
|
|
1320
|
-
//
|
|
1321
|
-
//
|
|
1322
|
-
//
|
|
1323
|
-
//
|
|
1324
|
-
//
|
|
1325
|
-
//
|
|
1326
|
-
//
|
|
1327
|
-
//
|
|
1328
|
-
//
|
|
1329
|
-
//
|
|
1330
|
-
//
|
|
1331
|
-
//
|
|
1332
|
-
//
|
|
1333
|
-
//
|
|
1334
|
-
//
|
|
1335
|
-
//
|
|
1336
|
-
//
|
|
1337
|
-
//
|
|
1338
|
-
//
|
|
1339
|
-
//
|
|
1340
|
-
//
|
|
1341
|
-
//
|
|
1342
|
-
//
|
|
1343
|
-
//
|
|
1344
|
-
//
|
|
1345
|
-
//
|
|
1346
|
-
//
|
|
1347
|
-
//
|
|
1348
|
-
//
|
|
1349
|
-
//
|
|
1350
|
-
//
|
|
1351
|
-
//
|
|
1352
|
-
//
|
|
1353
|
-
//
|
|
1354
|
-
//
|
|
1355
|
-
//
|
|
1356
|
-
//
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
var DEBOUNCE = 500;
|
|
1360
|
-
/**
|
|
1361
|
-
* > Beautiful input UI with loading & error manager
|
|
1362
|
-
*/
|
|
1363
|
-
|
|
1364
|
-
/* harmony default export */ var _mainvue_type_script_lang_js_ = ({
|
|
1365
|
-
name: 'MazInput',
|
|
1366
|
-
mixins: [uniqueId["a" /* default */]],
|
|
1367
|
-
props: {
|
|
1368
|
-
// value of the input
|
|
1369
|
-
value: {
|
|
1370
|
-
validator: function validator(prop) {
|
|
1371
|
-
return ['string', 'number'].includes(_typeof(prop)) || prop === null;
|
|
1372
|
-
},
|
|
1373
|
-
default: null
|
|
1374
|
-
},
|
|
1375
|
-
// input id
|
|
1376
|
-
id: {
|
|
1377
|
-
type: String,
|
|
1378
|
-
default: null
|
|
1379
|
-
},
|
|
1380
|
-
// value of the input
|
|
1381
|
-
placeholder: {
|
|
1382
|
-
type: String,
|
|
1383
|
-
default: 'Enter text'
|
|
1384
|
-
},
|
|
1385
|
-
// replace the label if is present
|
|
1386
|
-
hint: {
|
|
1387
|
-
type: String,
|
|
1388
|
-
default: null
|
|
1389
|
-
},
|
|
1390
|
-
// input size (`'lg'` / `'sm'`)
|
|
1391
|
-
size: {
|
|
1392
|
-
type: String,
|
|
1393
|
-
default: null
|
|
1394
|
-
},
|
|
1395
|
-
// is the input size (`text` or `number`)
|
|
1396
|
-
type: {
|
|
1397
|
-
type: String,
|
|
1398
|
-
default: 'text'
|
|
1399
|
-
},
|
|
1400
|
-
// should be a [material icon](https://material.io/resources/icons/) name
|
|
1401
|
-
leftIconName: {
|
|
1402
|
-
type: String,
|
|
1403
|
-
default: null
|
|
1404
|
-
},
|
|
1405
|
-
// should be a [material icon](https://material.io/resources/icons/) name
|
|
1406
|
-
rightIconName: {
|
|
1407
|
-
type: String,
|
|
1408
|
-
default: null
|
|
1409
|
-
},
|
|
1410
|
-
// When is `true` the input has the error style
|
|
1411
|
-
error: {
|
|
1412
|
-
type: Boolean,
|
|
1413
|
-
default: false
|
|
1414
|
-
},
|
|
1415
|
-
// When is `true` the input has the warning style
|
|
1416
|
-
warning: {
|
|
1417
|
-
type: Boolean,
|
|
1418
|
-
default: false
|
|
1419
|
-
},
|
|
1420
|
-
// When is `true` the input is disable
|
|
1421
|
-
disabled: {
|
|
1422
|
-
type: Boolean,
|
|
1423
|
-
default: false
|
|
1424
|
-
},
|
|
1425
|
-
// When is `true` the input has the dark theme
|
|
1426
|
-
dark: {
|
|
1427
|
-
type: Boolean,
|
|
1428
|
-
default: false
|
|
1429
|
-
},
|
|
1430
|
-
// When is `true` the input is on readonly mode
|
|
1431
|
-
readonly: {
|
|
1432
|
-
type: Boolean,
|
|
1433
|
-
default: false
|
|
1434
|
-
},
|
|
1435
|
-
// When is `true` the input has the valid style
|
|
1436
|
-
success: {
|
|
1437
|
-
type: Boolean,
|
|
1438
|
-
default: false
|
|
1439
|
-
},
|
|
1440
|
-
// When is `true` the input become required & has the `*` symbol
|
|
1441
|
-
required: {
|
|
1442
|
-
type: Boolean,
|
|
1443
|
-
default: false
|
|
1444
|
-
},
|
|
1445
|
-
// When is `true` the input is a textarea
|
|
1446
|
-
textarea: {
|
|
1447
|
-
type: Boolean,
|
|
1448
|
-
default: false
|
|
1449
|
-
},
|
|
1450
|
-
// When is `true` the input has a progress bar animated
|
|
1451
|
-
loading: {
|
|
1452
|
-
type: Boolean,
|
|
1453
|
-
default: false
|
|
1454
|
-
},
|
|
1455
|
-
// When is `true` the input can be clear with a button on the right
|
|
1456
|
-
clearable: {
|
|
1457
|
-
type: Boolean,
|
|
1458
|
-
default: false
|
|
1459
|
-
},
|
|
1460
|
-
// When is `true` the input has not label (top placeholder when value is not empty)
|
|
1461
|
-
noLabel: {
|
|
1462
|
-
type: Boolean,
|
|
1463
|
-
default: false
|
|
1464
|
-
},
|
|
1465
|
-
// When is `true` and is `required`, the `*` symbol is not showing
|
|
1466
|
-
noRequiredSymbol: {
|
|
1467
|
-
type: Boolean,
|
|
1468
|
-
default: false
|
|
1469
|
-
},
|
|
1470
|
-
// force focus style input
|
|
1471
|
-
focus: {
|
|
1472
|
-
type: Boolean,
|
|
1473
|
-
default: false
|
|
1474
|
-
},
|
|
1475
|
-
// color name in basic colors
|
|
1476
|
-
color: {
|
|
1477
|
-
type: String,
|
|
1478
|
-
default: 'primary'
|
|
1479
|
-
},
|
|
1480
|
-
// Add a debounce of 500ms to emit the value
|
|
1481
|
-
debounce: {
|
|
1482
|
-
type: Boolean,
|
|
1483
|
-
default: false
|
|
1484
|
-
}
|
|
1485
|
-
},
|
|
1486
|
-
data: function data() {
|
|
1487
|
-
return {
|
|
1488
|
-
isFocus: false,
|
|
1489
|
-
showPassword: false
|
|
1490
|
-
};
|
|
1491
|
-
},
|
|
1492
|
-
computed: {
|
|
1493
|
-
inputValue: {
|
|
1494
|
-
get: function get() {
|
|
1495
|
-
return this.value;
|
|
1496
|
-
},
|
|
1497
|
-
set: function set(value) {
|
|
1498
|
-
var valueToEmit = this.hasNumberType ? !value ? 0 : parseInt(value) : value;
|
|
1499
|
-
this.emitValue(valueToEmit);
|
|
1500
|
-
}
|
|
1501
|
-
},
|
|
1502
|
-
placeholderValue: function placeholderValue() {
|
|
1503
|
-
var placeholder = this.placeholder;
|
|
1504
|
-
if (this.required && placeholder && !this.noRequiredSymbol) placeholder += ' *';
|
|
1505
|
-
return placeholder;
|
|
1506
|
-
},
|
|
1507
|
-
hintValue: function hintValue() {
|
|
1508
|
-
var hint = this.hint;
|
|
1509
|
-
if (this.required && hint) hint += ' *';
|
|
1510
|
-
return hint;
|
|
1511
|
-
},
|
|
1512
|
-
hasNumberType: function hasNumberType() {
|
|
1513
|
-
return this.type === 'number';
|
|
1514
|
-
},
|
|
1515
|
-
hasLabel: function hasLabel() {
|
|
1516
|
-
return !this.noLabel;
|
|
1517
|
-
},
|
|
1518
|
-
getType: function getType() {
|
|
1519
|
-
return this.showPassword ? 'text' : this.type;
|
|
1520
|
-
},
|
|
1521
|
-
hasPasswordBtn: function hasPasswordBtn() {
|
|
1522
|
-
return this.type === 'password' && this.inputValue;
|
|
1523
|
-
},
|
|
1524
|
-
hasClearBtn: function hasClearBtn() {
|
|
1525
|
-
return this.clearable && this.inputValue && !this.textarea;
|
|
1526
|
-
},
|
|
1527
|
-
leftNumberIcon: function leftNumberIcon() {
|
|
1528
|
-
var array = [!!this.hasRightIcon(), !!this.hasClearBtn, !!this.hasPasswordBtn];
|
|
1529
|
-
return array.filter(function (a) {
|
|
1530
|
-
return a;
|
|
1531
|
-
}).length;
|
|
1532
|
-
}
|
|
1533
|
-
},
|
|
1534
|
-
methods: {
|
|
1535
|
-
debounceValue: Object(utils["a" /* debounce */])(function (value) {
|
|
1536
|
-
// return the input value (in `@input` or `v-model`)
|
|
1537
|
-
// @arg input
|
|
1538
|
-
this.$emit('input', value);
|
|
1539
|
-
}, DEBOUNCE),
|
|
1540
|
-
emitValue: function emitValue(value) {
|
|
1541
|
-
if (this.debounce) return this.debounceValue(value);
|
|
1542
|
-
this.$emit('input', value);
|
|
1543
|
-
},
|
|
1544
|
-
hasLeftIcon: function hasLeftIcon() {
|
|
1545
|
-
return this.leftIconName || this.$slots['icon-left'];
|
|
1546
|
-
},
|
|
1547
|
-
hasRightIcon: function hasRightIcon() {
|
|
1548
|
-
return this.rightIconName || this.$slots['icon-right'];
|
|
1549
|
-
},
|
|
1550
|
-
focusInput: function focusInput() {
|
|
1551
|
-
this.$refs.MazInput.focus();
|
|
1552
|
-
},
|
|
1553
|
-
onFocus: function onFocus(e) {
|
|
1554
|
-
// sent the focus event
|
|
1555
|
-
// @arg event
|
|
1556
|
-
this.$emit('focus', e);
|
|
1557
|
-
this.isFocus = true;
|
|
1558
|
-
},
|
|
1559
|
-
onBlur: function onBlur(e) {
|
|
1560
|
-
// sent the blur event
|
|
1561
|
-
// @arg event
|
|
1562
|
-
this.$emit('blur', e);
|
|
1563
|
-
this.isFocus = false;
|
|
1564
|
-
},
|
|
1565
|
-
onPaste: function onPaste(e) {
|
|
1566
|
-
// sent when text is past in the textfield
|
|
1567
|
-
// @arg event
|
|
1568
|
-
this.$emit('paste', e);
|
|
1569
|
-
},
|
|
1570
|
-
onChange: function onChange(e) {
|
|
1571
|
-
// sent on input change
|
|
1572
|
-
// @arg event
|
|
1573
|
-
this.$emit('change', e);
|
|
1574
|
-
},
|
|
1575
|
-
clear: function clear() {
|
|
1576
|
-
this.$emit('input', this.hasNumberType ? 0 : ''); // sent when the input is clear
|
|
1577
|
-
|
|
1578
|
-
this.$emit('clear');
|
|
1579
|
-
},
|
|
1580
|
-
keyUp: function keyUp(e) {
|
|
1581
|
-
// sent the keyup event
|
|
1582
|
-
// @arg event
|
|
1583
|
-
this.$emit('keyup', e);
|
|
1584
|
-
},
|
|
1585
|
-
keyDown: function keyDown(e) {
|
|
1586
|
-
// sent the keydown event
|
|
1587
|
-
// @arg event
|
|
1588
|
-
this.$emit('keydown', e);
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
// CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=script&lang=js&
|
|
1593
|
-
/* harmony default export */ var MazInput_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
|
|
1594
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1595
|
-
var componentNormalizer = __webpack_require__(0);
|
|
1596
|
-
|
|
1597
|
-
// CONCATENATED MODULE: ./packages/components/MazInput/_main.vue
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
/* normalize component */
|
|
1604
|
-
|
|
1605
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
1606
|
-
MazInput_mainvue_type_script_lang_js_,
|
|
1607
|
-
render,
|
|
1608
|
-
staticRenderFns,
|
|
1609
|
-
false,
|
|
1610
|
-
null,
|
|
1611
|
-
null,
|
|
1612
|
-
null
|
|
1613
|
-
|
|
1614
|
-
)
|
|
1615
|
-
|
|
1616
|
-
/* hot reload */
|
|
1617
|
-
if (false) { var api; }
|
|
1618
|
-
component.options.__file = "packages/components/MazInput/_main.vue"
|
|
1619
|
-
/* harmony default export */ var _main = (component.exports);
|
|
1620
|
-
// CONCATENATED MODULE: ./packages/components/MazInput/index.js
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
_main.install = function (Vue) {
|
|
1624
|
-
Vue.component(_main.name, _main);
|
|
1625
|
-
};
|
|
1626
|
-
|
|
1627
|
-
/* harmony default export */ var MazInput = __webpack_exports__["default"] = (_main);
|
|
1628
|
-
|
|
1629
|
-
/***/ }),
|
|
1630
|
-
/* 9 */
|
|
1631
|
-
/***/ (function(module, exports) {
|
|
1632
|
-
|
|
1633
|
-
module.exports = require("regenerator-runtime");
|
|
1634
|
-
|
|
1635
|
-
/***/ }),
|
|
1636
|
-
/* 10 */,
|
|
1637
|
-
/* 11 */
|
|
1638
|
-
/***/ (function(module, exports) {
|
|
1639
|
-
|
|
1640
|
-
module.exports = require("libphonenumber-js");
|
|
1641
|
-
|
|
1642
|
-
/***/ }),
|
|
1643
|
-
/* 12 */,
|
|
1644
|
-
/* 13 */,
|
|
1645
|
-
/* 14 */,
|
|
1646
|
-
/* 15 */,
|
|
1647
|
-
/* 16 */
|
|
1648
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1649
|
-
|
|
1650
|
-
"use strict";
|
|
1651
|
-
// ESM COMPAT FLAG
|
|
1652
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1653
|
-
|
|
1654
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSelect/_main.vue?vue&type=template&id=2fb08d76&
|
|
1655
|
-
var render = function () {
|
|
1656
|
-
var _vm = this
|
|
1657
|
-
var _h = _vm.$createElement
|
|
1658
|
-
var _c = _vm._self._c || _h
|
|
1659
|
-
return _c(
|
|
1660
|
-
"div",
|
|
1661
|
-
{
|
|
1662
|
-
staticClass: "maz-base-component maz-select",
|
|
1663
|
-
class: [
|
|
1664
|
-
{
|
|
1665
|
-
"has-list-open": _vm.hasOpenList,
|
|
1666
|
-
"maz-is-dark": _vm.dark,
|
|
1667
|
-
},
|
|
1668
|
-
"maz-select--" + _vm.color,
|
|
1669
|
-
"maz-select--" + _vm.size,
|
|
1670
|
-
],
|
|
1671
|
-
on: {
|
|
1672
|
-
"!blur": function ($event) {
|
|
1673
|
-
return _vm.closeList($event)
|
|
1674
|
-
},
|
|
1675
|
-
},
|
|
1676
|
-
},
|
|
1677
|
-
[
|
|
1678
|
-
_vm.multiple
|
|
1679
|
-
? _c(
|
|
1680
|
-
"div",
|
|
1681
|
-
{
|
|
1682
|
-
ref: "SelectedTags",
|
|
1683
|
-
staticClass: "maz-select__tags maz-flex maz-align-center",
|
|
1684
|
-
class: {
|
|
1685
|
-
"maz-left-offset": _vm.hasLeftIcon,
|
|
1686
|
-
},
|
|
1687
|
-
},
|
|
1688
|
-
[
|
|
1689
|
-
_c(
|
|
1690
|
-
"transition-group",
|
|
1691
|
-
{
|
|
1692
|
-
ref: "SelectedTagsContainer",
|
|
1693
|
-
staticClass: "maz-flex maz-align-center maz-h-100",
|
|
1694
|
-
attrs: { tag: "div", name: "maz-tags" },
|
|
1695
|
-
},
|
|
1696
|
-
_vm._l(_vm.selectedOptions, function (option, i) {
|
|
1697
|
-
return _c(
|
|
1698
|
-
"MazBtn",
|
|
1699
|
-
{
|
|
1700
|
-
key: "tags-" + i,
|
|
1701
|
-
staticClass: "maz-select__tag maz-flex maz-align-center",
|
|
1702
|
-
attrs: {
|
|
1703
|
-
disabled: _vm.disabled,
|
|
1704
|
-
color: _vm.color,
|
|
1705
|
-
size: _vm.size,
|
|
1706
|
-
},
|
|
1707
|
-
on: {
|
|
1708
|
-
click: function ($event) {
|
|
1709
|
-
$event.preventDefault()
|
|
1710
|
-
$event.stopPropagation()
|
|
1711
|
-
return _vm.removeOption(option[_vm.config.valueKey])
|
|
1712
|
-
},
|
|
1713
|
-
},
|
|
1714
|
-
},
|
|
1715
|
-
[
|
|
1716
|
-
_c("span", { staticClass: "maz-select__tag__text" }, [
|
|
1717
|
-
_vm._v(
|
|
1718
|
-
"\n " +
|
|
1719
|
-
_vm._s(option[_vm.config.labelKey]) +
|
|
1720
|
-
"\n "
|
|
1721
|
-
),
|
|
1722
|
-
]),
|
|
1723
|
-
_c(
|
|
1724
|
-
"i",
|
|
1725
|
-
{
|
|
1726
|
-
staticClass: "maz-select__tag__clear material-icons",
|
|
1727
|
-
},
|
|
1728
|
-
[_vm._v("\n close\n ")]
|
|
1729
|
-
),
|
|
1730
|
-
]
|
|
1731
|
-
)
|
|
1732
|
-
}),
|
|
1733
|
-
1
|
|
1734
|
-
),
|
|
1735
|
-
],
|
|
1736
|
-
1
|
|
1737
|
-
)
|
|
1738
|
-
: _vm._e(),
|
|
1739
|
-
_c(
|
|
1740
|
-
"MazInput",
|
|
1741
|
-
_vm._b(
|
|
1742
|
-
{
|
|
1743
|
-
ref: "textField",
|
|
1744
|
-
attrs: {
|
|
1745
|
-
value: _vm.valueShown,
|
|
1746
|
-
readonly: "",
|
|
1747
|
-
"no-label": _vm.hasNoLabel,
|
|
1748
|
-
color: _vm.color,
|
|
1749
|
-
size: _vm.size,
|
|
1750
|
-
placeholder: _vm.placeholderShown,
|
|
1751
|
-
disabled: _vm.disabled,
|
|
1752
|
-
focus: _vm.hasOpenList,
|
|
1753
|
-
},
|
|
1754
|
-
on: {
|
|
1755
|
-
clear: function ($event) {
|
|
1756
|
-
return _vm.emitValues(null)
|
|
1757
|
-
},
|
|
1758
|
-
keydown: function ($event) {
|
|
1759
|
-
_vm.search ? null : _vm.keyboardNav($event)
|
|
1760
|
-
},
|
|
1761
|
-
keyup: function ($event) {
|
|
1762
|
-
return _vm.$emit("keyup", $event)
|
|
1763
|
-
},
|
|
1764
|
-
blur: function ($event) {
|
|
1765
|
-
return _vm.$emit("blur", $event)
|
|
1766
|
-
},
|
|
1767
|
-
change: function ($event) {
|
|
1768
|
-
return _vm.$emit("change", $event)
|
|
1769
|
-
},
|
|
1770
|
-
paste: function ($event) {
|
|
1771
|
-
return _vm.$emit("paste", $event)
|
|
1772
|
-
},
|
|
1773
|
-
click: function ($event) {
|
|
1774
|
-
return _vm.$emit("click", $event)
|
|
1775
|
-
},
|
|
1776
|
-
focus: _vm.openList,
|
|
1777
|
-
},
|
|
1778
|
-
},
|
|
1779
|
-
"MazInput",
|
|
1780
|
-
_vm.$attrs,
|
|
1781
|
-
false
|
|
1782
|
-
),
|
|
1783
|
-
[
|
|
1784
|
-
_vm._t("icon-left", null, { slot: "icon-left" }),
|
|
1785
|
-
_c(
|
|
1786
|
-
"div",
|
|
1787
|
-
{
|
|
1788
|
-
staticClass: "maz-select__toggle maz-flex maz-flex-center",
|
|
1789
|
-
attrs: { slot: "icon-right", tabindex: "-1" },
|
|
1790
|
-
slot: "icon-right",
|
|
1791
|
-
},
|
|
1792
|
-
[
|
|
1793
|
-
_vm._t("arrow", function () {
|
|
1794
|
-
return [
|
|
1795
|
-
_c(
|
|
1796
|
-
"svg",
|
|
1797
|
-
{
|
|
1798
|
-
staticClass: "maz-select__toggle__arrow",
|
|
1799
|
-
attrs: {
|
|
1800
|
-
mlns: "http://www.w3.org/2000/svg",
|
|
1801
|
-
width: "24",
|
|
1802
|
-
height: "24",
|
|
1803
|
-
viewBox: "0 0 24 24",
|
|
1804
|
-
},
|
|
1805
|
-
},
|
|
1806
|
-
[
|
|
1807
|
-
_c("path", {
|
|
1808
|
-
staticClass: "arrow",
|
|
1809
|
-
attrs: {
|
|
1810
|
-
d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",
|
|
1811
|
-
},
|
|
1812
|
-
}),
|
|
1813
|
-
_c("path", {
|
|
1814
|
-
attrs: { fill: "none", d: "M0 0h24v24H0V0z" },
|
|
1815
|
-
}),
|
|
1816
|
-
]
|
|
1817
|
-
),
|
|
1818
|
-
]
|
|
1819
|
-
}),
|
|
1820
|
-
],
|
|
1821
|
-
2
|
|
1822
|
-
),
|
|
1823
|
-
],
|
|
1824
|
-
2
|
|
1825
|
-
),
|
|
1826
|
-
_c("transition", { attrs: { name: _vm.listTransition } }, [
|
|
1827
|
-
_c(
|
|
1828
|
-
"div",
|
|
1829
|
-
{
|
|
1830
|
-
directives: [
|
|
1831
|
-
{
|
|
1832
|
-
name: "show",
|
|
1833
|
-
rawName: "v-show",
|
|
1834
|
-
value: _vm.hasOpenList,
|
|
1835
|
-
expression: "hasOpenList",
|
|
1836
|
-
},
|
|
1837
|
-
],
|
|
1838
|
-
staticClass: "maz-select__options-list maz-flex maz-elevation",
|
|
1839
|
-
class: [
|
|
1840
|
-
_vm.hasPositionTop
|
|
1841
|
-
? "maz-select__options-list--top maz-direction-column-reverse"
|
|
1842
|
-
: "maz-direction-column",
|
|
1843
|
-
{ "maz-select__options-list--right": _vm.hasPositionRight },
|
|
1844
|
-
],
|
|
1845
|
-
style: [_vm.itemListSize],
|
|
1846
|
-
},
|
|
1847
|
-
[
|
|
1848
|
-
_vm.search
|
|
1849
|
-
? _c("MazInput", {
|
|
1850
|
-
ref: "SearchInput",
|
|
1851
|
-
staticClass: "maz-m-1",
|
|
1852
|
-
attrs: {
|
|
1853
|
-
color: _vm.color,
|
|
1854
|
-
value: _vm.searchQuery,
|
|
1855
|
-
placeholder: _vm.searchPlaceholder,
|
|
1856
|
-
size: "sm",
|
|
1857
|
-
"no-label": "",
|
|
1858
|
-
name: "new_search_in_options",
|
|
1859
|
-
autocomplete: "off",
|
|
1860
|
-
},
|
|
1861
|
-
on: {
|
|
1862
|
-
input: _vm.searchInOptions,
|
|
1863
|
-
keydown: [
|
|
1864
|
-
_vm.keyboardNav,
|
|
1865
|
-
function ($event) {
|
|
1866
|
-
if (
|
|
1867
|
-
!$event.type.indexOf("key") &&
|
|
1868
|
-
_vm._k($event.keyCode, "esc", 27, $event.key, [
|
|
1869
|
-
"Esc",
|
|
1870
|
-
"Escape",
|
|
1871
|
-
])
|
|
1872
|
-
) {
|
|
1873
|
-
return null
|
|
1874
|
-
}
|
|
1875
|
-
return _vm.closeList.apply(null, arguments)
|
|
1876
|
-
},
|
|
1877
|
-
],
|
|
1878
|
-
},
|
|
1879
|
-
})
|
|
1880
|
-
: _vm._e(),
|
|
1881
|
-
_c(
|
|
1882
|
-
"div",
|
|
1883
|
-
{
|
|
1884
|
-
ref: "optionsList",
|
|
1885
|
-
staticClass:
|
|
1886
|
-
"maz-select__options-list__items maz-flex maz-direction-column",
|
|
1887
|
-
},
|
|
1888
|
-
[
|
|
1889
|
-
_vm._l(_vm.optionsShown, function (option, i) {
|
|
1890
|
-
return _c(
|
|
1891
|
-
"button",
|
|
1892
|
-
{
|
|
1893
|
-
key: i,
|
|
1894
|
-
staticClass:
|
|
1895
|
-
"maz-select__options-list__item flex maz-align-center maz-text-left",
|
|
1896
|
-
class: [
|
|
1897
|
-
{
|
|
1898
|
-
selected:
|
|
1899
|
-
_vm.values.length &&
|
|
1900
|
-
_vm.values.includes(option[_vm.config.valueKey]),
|
|
1901
|
-
},
|
|
1902
|
-
{
|
|
1903
|
-
"keyboard-selected":
|
|
1904
|
-
_vm.tmpValue === option[_vm.config.valueKey],
|
|
1905
|
-
},
|
|
1906
|
-
],
|
|
1907
|
-
style: [_vm.optionHeight],
|
|
1908
|
-
attrs: { tabindex: "-1", type: "button" },
|
|
1909
|
-
on: {
|
|
1910
|
-
click: function ($event) {
|
|
1911
|
-
$event.preventDefault()
|
|
1912
|
-
$event.stopPropagation()
|
|
1913
|
-
return _vm.updateValue(option[_vm.config.valueKey])
|
|
1914
|
-
},
|
|
1915
|
-
},
|
|
1916
|
-
},
|
|
1917
|
-
[
|
|
1918
|
-
_vm._t(
|
|
1919
|
-
"default",
|
|
1920
|
-
function () {
|
|
1921
|
-
return [
|
|
1922
|
-
_c(
|
|
1923
|
-
"span",
|
|
1924
|
-
{
|
|
1925
|
-
staticClass: "maz-dots-text",
|
|
1926
|
-
class: [
|
|
1927
|
-
{
|
|
1928
|
-
"maz-text-muted":
|
|
1929
|
-
!option[_vm.config.valueKey],
|
|
1930
|
-
},
|
|
1931
|
-
_vm.values.includes(
|
|
1932
|
-
option[_vm.config.valueKey]
|
|
1933
|
-
)
|
|
1934
|
-
? "maz-text-white"
|
|
1935
|
-
: "maz-text-color",
|
|
1936
|
-
],
|
|
1937
|
-
},
|
|
1938
|
-
[
|
|
1939
|
-
_vm._v(
|
|
1940
|
-
"\n " +
|
|
1941
|
-
_vm._s(option[_vm.config.labelKey]) +
|
|
1942
|
-
"\n "
|
|
1943
|
-
),
|
|
1944
|
-
]
|
|
1945
|
-
),
|
|
1946
|
-
]
|
|
1947
|
-
},
|
|
1948
|
-
{
|
|
1949
|
-
option: Object.assign({}, option, {
|
|
1950
|
-
isSelected: _vm.values.includes(
|
|
1951
|
-
option[_vm.config.valueKey]
|
|
1952
|
-
),
|
|
1953
|
-
}),
|
|
1954
|
-
tag: "div",
|
|
1955
|
-
}
|
|
1956
|
-
),
|
|
1957
|
-
],
|
|
1958
|
-
2
|
|
1959
|
-
)
|
|
1960
|
-
}),
|
|
1961
|
-
!_vm.optionsShown.length
|
|
1962
|
-
? _vm._t(
|
|
1963
|
-
"no-results",
|
|
1964
|
-
function () {
|
|
1965
|
-
return [
|
|
1966
|
-
_c(
|
|
1967
|
-
"div",
|
|
1968
|
-
{
|
|
1969
|
-
staticClass:
|
|
1970
|
-
"maz-select__options-list__no-results maz-p-1 maz-flex maz-flex-center",
|
|
1971
|
-
},
|
|
1972
|
-
[
|
|
1973
|
-
_c(
|
|
1974
|
-
"i",
|
|
1975
|
-
{
|
|
1976
|
-
staticClass: "material-icons maz-text-danger",
|
|
1977
|
-
},
|
|
1978
|
-
[
|
|
1979
|
-
_vm._v(
|
|
1980
|
-
"\n search_off\n "
|
|
1981
|
-
),
|
|
1982
|
-
]
|
|
1983
|
-
),
|
|
1984
|
-
]
|
|
1985
|
-
),
|
|
1986
|
-
]
|
|
1987
|
-
},
|
|
1988
|
-
{ tag: "div" }
|
|
1989
|
-
)
|
|
1990
|
-
: _vm._e(),
|
|
1991
|
-
],
|
|
1992
|
-
2
|
|
1993
|
-
),
|
|
1994
|
-
],
|
|
1995
|
-
1
|
|
1996
|
-
),
|
|
1997
|
-
]),
|
|
1998
|
-
],
|
|
1999
|
-
1
|
|
2000
|
-
)
|
|
2001
|
-
}
|
|
2002
|
-
var staticRenderFns = []
|
|
2003
|
-
render._withStripped = true
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
// CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue?vue&type=template&id=2fb08d76&
|
|
2007
|
-
|
|
2008
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
2009
|
-
var regenerator = __webpack_require__(1);
|
|
2010
|
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
2011
|
-
|
|
2012
|
-
// EXTERNAL MODULE: ./packages/components/MazInput/index.js + 5 modules
|
|
2013
|
-
var MazInput = __webpack_require__(8);
|
|
2014
|
-
|
|
2015
|
-
// EXTERNAL MODULE: ./packages/components/MazBtn/index.js + 5 modules
|
|
2016
|
-
var MazBtn = __webpack_require__(4);
|
|
2017
|
-
|
|
2018
|
-
// EXTERNAL MODULE: ./packages/mixins/uniqueId.js
|
|
2019
|
-
var uniqueId = __webpack_require__(2);
|
|
2020
|
-
|
|
2021
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSelect/_main.vue?vue&type=script&lang=js&
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2025
|
-
|
|
2026
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2027
|
-
|
|
2028
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2029
|
-
|
|
2030
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2031
|
-
|
|
2032
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
2033
|
-
|
|
2034
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
2035
|
-
|
|
2036
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
2037
|
-
|
|
2038
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
2039
|
-
|
|
2040
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2041
|
-
|
|
2042
|
-
//
|
|
2043
|
-
//
|
|
2044
|
-
//
|
|
2045
|
-
//
|
|
2046
|
-
//
|
|
2047
|
-
//
|
|
2048
|
-
//
|
|
2049
|
-
//
|
|
2050
|
-
//
|
|
2051
|
-
//
|
|
2052
|
-
//
|
|
2053
|
-
//
|
|
2054
|
-
//
|
|
2055
|
-
//
|
|
2056
|
-
//
|
|
2057
|
-
//
|
|
2058
|
-
//
|
|
2059
|
-
//
|
|
2060
|
-
//
|
|
2061
|
-
//
|
|
2062
|
-
//
|
|
2063
|
-
//
|
|
2064
|
-
//
|
|
2065
|
-
//
|
|
2066
|
-
//
|
|
2067
|
-
//
|
|
2068
|
-
//
|
|
2069
|
-
//
|
|
2070
|
-
//
|
|
2071
|
-
//
|
|
2072
|
-
//
|
|
2073
|
-
//
|
|
2074
|
-
//
|
|
2075
|
-
//
|
|
2076
|
-
//
|
|
2077
|
-
//
|
|
2078
|
-
//
|
|
2079
|
-
//
|
|
2080
|
-
//
|
|
2081
|
-
//
|
|
2082
|
-
//
|
|
2083
|
-
//
|
|
2084
|
-
//
|
|
2085
|
-
//
|
|
2086
|
-
//
|
|
2087
|
-
//
|
|
2088
|
-
//
|
|
2089
|
-
//
|
|
2090
|
-
//
|
|
2091
|
-
//
|
|
2092
|
-
//
|
|
2093
|
-
//
|
|
2094
|
-
//
|
|
2095
|
-
//
|
|
2096
|
-
//
|
|
2097
|
-
//
|
|
2098
|
-
//
|
|
2099
|
-
//
|
|
2100
|
-
//
|
|
2101
|
-
//
|
|
2102
|
-
//
|
|
2103
|
-
//
|
|
2104
|
-
//
|
|
2105
|
-
//
|
|
2106
|
-
//
|
|
2107
|
-
//
|
|
2108
|
-
//
|
|
2109
|
-
//
|
|
2110
|
-
//
|
|
2111
|
-
//
|
|
2112
|
-
//
|
|
2113
|
-
//
|
|
2114
|
-
//
|
|
2115
|
-
//
|
|
2116
|
-
//
|
|
2117
|
-
//
|
|
2118
|
-
//
|
|
2119
|
-
//
|
|
2120
|
-
//
|
|
2121
|
-
//
|
|
2122
|
-
//
|
|
2123
|
-
//
|
|
2124
|
-
//
|
|
2125
|
-
//
|
|
2126
|
-
//
|
|
2127
|
-
//
|
|
2128
|
-
//
|
|
2129
|
-
//
|
|
2130
|
-
//
|
|
2131
|
-
//
|
|
2132
|
-
//
|
|
2133
|
-
//
|
|
2134
|
-
//
|
|
2135
|
-
//
|
|
2136
|
-
//
|
|
2137
|
-
//
|
|
2138
|
-
//
|
|
2139
|
-
//
|
|
2140
|
-
//
|
|
2141
|
-
//
|
|
2142
|
-
//
|
|
2143
|
-
//
|
|
2144
|
-
//
|
|
2145
|
-
//
|
|
2146
|
-
//
|
|
2147
|
-
//
|
|
2148
|
-
//
|
|
2149
|
-
//
|
|
2150
|
-
//
|
|
2151
|
-
//
|
|
2152
|
-
//
|
|
2153
|
-
//
|
|
2154
|
-
//
|
|
2155
|
-
//
|
|
2156
|
-
//
|
|
2157
|
-
//
|
|
2158
|
-
//
|
|
2159
|
-
//
|
|
2160
|
-
//
|
|
2161
|
-
//
|
|
2162
|
-
//
|
|
2163
|
-
//
|
|
2164
|
-
//
|
|
2165
|
-
//
|
|
2166
|
-
//
|
|
2167
|
-
//
|
|
2168
|
-
//
|
|
2169
|
-
//
|
|
2170
|
-
//
|
|
2171
|
-
//
|
|
2172
|
-
//
|
|
2173
|
-
//
|
|
2174
|
-
//
|
|
2175
|
-
//
|
|
2176
|
-
//
|
|
2177
|
-
//
|
|
2178
|
-
//
|
|
2179
|
-
//
|
|
2180
|
-
//
|
|
2181
|
-
//
|
|
2182
|
-
//
|
|
2183
|
-
//
|
|
2184
|
-
//
|
|
2185
|
-
//
|
|
2186
|
-
//
|
|
2187
|
-
//
|
|
2188
|
-
//
|
|
2189
|
-
//
|
|
2190
|
-
//
|
|
2191
|
-
//
|
|
2192
|
-
//
|
|
2193
|
-
//
|
|
2194
|
-
//
|
|
2195
|
-
//
|
|
2196
|
-
//
|
|
2197
|
-
//
|
|
2198
|
-
//
|
|
2199
|
-
//
|
|
2200
|
-
//
|
|
2201
|
-
//
|
|
2202
|
-
//
|
|
2203
|
-
//
|
|
2204
|
-
//
|
|
2205
|
-
//
|
|
2206
|
-
//
|
|
2207
|
-
//
|
|
2208
|
-
//
|
|
2209
|
-
//
|
|
2210
|
-
//
|
|
2211
|
-
//
|
|
2212
|
-
//
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
/**
|
|
2217
|
-
* > Beautiful select input
|
|
2218
|
-
*/
|
|
2219
|
-
|
|
2220
|
-
/* harmony default export */ var _mainvue_type_script_lang_js_ = ({
|
|
2221
|
-
name: 'MazSelect',
|
|
2222
|
-
components: {
|
|
2223
|
-
MazInput: MazInput["default"],
|
|
2224
|
-
MazBtn: MazBtn["default"]
|
|
2225
|
-
},
|
|
2226
|
-
mixins: [uniqueId["a" /* default */]],
|
|
2227
|
-
props: {
|
|
2228
|
-
// is the value of the input
|
|
2229
|
-
value: {
|
|
2230
|
-
required: true,
|
|
2231
|
-
validator: function validator(prop) {
|
|
2232
|
-
return ['number', 'string', 'boolean'].includes(_typeof(prop)) || Array.isArray(prop) || prop === null;
|
|
2233
|
-
}
|
|
2234
|
-
},
|
|
2235
|
-
// list of the options
|
|
2236
|
-
options: {
|
|
2237
|
-
type: Array,
|
|
2238
|
-
required: true
|
|
2239
|
-
},
|
|
2240
|
-
// When is `true` the select is disabled
|
|
2241
|
-
disabled: {
|
|
2242
|
-
type: Boolean,
|
|
2243
|
-
default: false
|
|
2244
|
-
},
|
|
2245
|
-
// When is `true` the select has the dark style
|
|
2246
|
-
dark: {
|
|
2247
|
-
type: Boolean,
|
|
2248
|
-
default: false
|
|
2249
|
-
},
|
|
2250
|
-
// Item in list height in pixel
|
|
2251
|
-
itemHeight: {
|
|
2252
|
-
type: Number,
|
|
2253
|
-
default: 35
|
|
2254
|
-
},
|
|
2255
|
-
// List height in pixel
|
|
2256
|
-
listHeight: {
|
|
2257
|
-
type: Number,
|
|
2258
|
-
default: 260
|
|
2259
|
-
},
|
|
2260
|
-
// List width in pixel or percent (:list-width="100", list-width="100%")
|
|
2261
|
-
listWidth: {
|
|
2262
|
-
type: [Number, String],
|
|
2263
|
-
default: null
|
|
2264
|
-
},
|
|
2265
|
-
// The select has no label in the input
|
|
2266
|
-
placeholder: {
|
|
2267
|
-
type: String,
|
|
2268
|
-
default: 'Select option'
|
|
2269
|
-
},
|
|
2270
|
-
// When is `true` the select you select multiple values
|
|
2271
|
-
noLabel: {
|
|
2272
|
-
type: Boolean,
|
|
2273
|
-
default: false
|
|
2274
|
-
},
|
|
2275
|
-
// When is `true` the select you select multiple values
|
|
2276
|
-
multiple: {
|
|
2277
|
-
type: Boolean,
|
|
2278
|
-
default: false
|
|
2279
|
-
},
|
|
2280
|
-
// When is `true` the select has an input to search in options
|
|
2281
|
-
search: {
|
|
2282
|
-
type: Boolean,
|
|
2283
|
-
default: false
|
|
2284
|
-
},
|
|
2285
|
-
// the search input placeholder
|
|
2286
|
-
searchPlaceholder: {
|
|
2287
|
-
type: String,
|
|
2288
|
-
default: 'Search in options'
|
|
2289
|
-
},
|
|
2290
|
-
// the search input placeholder
|
|
2291
|
-
color: {
|
|
2292
|
-
type: String,
|
|
2293
|
-
default: 'primary'
|
|
2294
|
-
},
|
|
2295
|
-
// input size
|
|
2296
|
-
size: {
|
|
2297
|
-
type: String,
|
|
2298
|
-
default: 'md'
|
|
2299
|
-
},
|
|
2300
|
-
// When is `true` the option list is open
|
|
2301
|
-
open: {
|
|
2302
|
-
type: Boolean,
|
|
2303
|
-
default: false
|
|
2304
|
-
},
|
|
2305
|
-
// set the position of option list (`top`, `top right`, `bottom right`)
|
|
2306
|
-
position: {
|
|
2307
|
-
type: String,
|
|
2308
|
-
default: 'left bottom'
|
|
2309
|
-
},
|
|
2310
|
-
// set label key and value key - Ex: `{ labelKey: '<your_object_key>', valueKey: '<your_object_key>', searchKey: '<your_object_key>' }`
|
|
2311
|
-
config: {
|
|
2312
|
-
type: Object,
|
|
2313
|
-
default: function _default() {
|
|
2314
|
-
return {
|
|
2315
|
-
labelKey: 'label',
|
|
2316
|
-
valueKey: 'value',
|
|
2317
|
-
searchKey: 'label'
|
|
2318
|
-
};
|
|
2319
|
-
}
|
|
2320
|
-
},
|
|
2321
|
-
// force value shown on input
|
|
2322
|
-
inputValue: {
|
|
2323
|
-
type: String,
|
|
2324
|
-
default: null
|
|
2325
|
-
}
|
|
2326
|
-
},
|
|
2327
|
-
data: function data() {
|
|
2328
|
-
return {
|
|
2329
|
-
listIsOpen: false,
|
|
2330
|
-
query: '',
|
|
2331
|
-
tmpValue: null,
|
|
2332
|
-
searchQuery: null,
|
|
2333
|
-
filteredOptions: null
|
|
2334
|
-
};
|
|
2335
|
-
},
|
|
2336
|
-
computed: {
|
|
2337
|
-
hasPositionTop: function hasPositionTop() {
|
|
2338
|
-
return this.position.includes('top');
|
|
2339
|
-
},
|
|
2340
|
-
hasPositionRight: function hasPositionRight() {
|
|
2341
|
-
return this.position.includes('right');
|
|
2342
|
-
},
|
|
2343
|
-
listTransition: function listTransition() {
|
|
2344
|
-
return this.position.includes('bottom') ? 'maz-slide' : 'maz-slideinvert';
|
|
2345
|
-
},
|
|
2346
|
-
hasOpenList: function hasOpenList() {
|
|
2347
|
-
return this.open || this.listIsOpen;
|
|
2348
|
-
},
|
|
2349
|
-
values: function values() {
|
|
2350
|
-
var multiple = this.multiple,
|
|
2351
|
-
value = this.value,
|
|
2352
|
-
options = this.options;
|
|
2353
|
-
if (!options) throw new Error('[MazSelect] options should be provide');
|
|
2354
|
-
if (multiple && !Array.isArray(value) && value !== null) throw new Error('[MazSelect] value should be an array or null');
|
|
2355
|
-
if (!multiple && Array.isArray(value)) throw new Error('[MazSelect] value should be a string, a number or null');
|
|
2356
|
-
return value ? multiple ? _toConsumableArray(value) : [value] : [];
|
|
2357
|
-
},
|
|
2358
|
-
hasLeftIcon: function hasLeftIcon() {
|
|
2359
|
-
return this.$attrs.leftIconName || this.$slots['icon-left'];
|
|
2360
|
-
},
|
|
2361
|
-
placeholderShown: function placeholderShown() {
|
|
2362
|
-
var placeholder = this.placeholder,
|
|
2363
|
-
multiple = this.multiple,
|
|
2364
|
-
values = this.values;
|
|
2365
|
-
return multiple && values.length ? null : placeholder;
|
|
2366
|
-
},
|
|
2367
|
-
hasNoLabel: function hasNoLabel() {
|
|
2368
|
-
return this.multiple || this.noLabel;
|
|
2369
|
-
},
|
|
2370
|
-
optionHeight: function optionHeight() {
|
|
2371
|
-
return {
|
|
2372
|
-
height: "".concat(this.itemHeight, "px"),
|
|
2373
|
-
flex: "0 0 ".concat(this.itemHeight, "px")
|
|
2374
|
-
};
|
|
2375
|
-
},
|
|
2376
|
-
itemListSize: function itemListSize() {
|
|
2377
|
-
var listHeight = this.listHeight,
|
|
2378
|
-
listWidth = this.listWidth;
|
|
2379
|
-
var width = !Number.isInteger(listWidth) ? listWidth : "".concat(listWidth, "px");
|
|
2380
|
-
return {
|
|
2381
|
-
maxHeight: "".concat(listHeight, "px"),
|
|
2382
|
-
width: width,
|
|
2383
|
-
maxWidth: width
|
|
2384
|
-
};
|
|
2385
|
-
},
|
|
2386
|
-
tmpValueIndex: function tmpValueIndex() {
|
|
2387
|
-
var config = this.config,
|
|
2388
|
-
tmpValue = this.tmpValue,
|
|
2389
|
-
optionsShown = this.optionsShown;
|
|
2390
|
-
return optionsShown.findIndex(function (c) {
|
|
2391
|
-
return c[config.valueKey] === tmpValue;
|
|
2392
|
-
});
|
|
2393
|
-
},
|
|
2394
|
-
selectedValueIndex: function selectedValueIndex() {
|
|
2395
|
-
var values = this.values,
|
|
2396
|
-
options = this.options,
|
|
2397
|
-
config = this.config;
|
|
2398
|
-
return values.length ? options.findIndex(function (c) {
|
|
2399
|
-
return c[config.valueKey] === values[values.length - 1];
|
|
2400
|
-
}) : null;
|
|
2401
|
-
},
|
|
2402
|
-
valueShown: function valueShown() {
|
|
2403
|
-
if (this.inputValue) return this.inputValue;
|
|
2404
|
-
var multiple = this.multiple,
|
|
2405
|
-
options = this.options,
|
|
2406
|
-
values = this.values,
|
|
2407
|
-
value = this.value,
|
|
2408
|
-
config = this.config;
|
|
2409
|
-
var valueSelected = options.find(function (o) {
|
|
2410
|
-
return o[config.valueKey] === value;
|
|
2411
|
-
});
|
|
2412
|
-
var result = valueSelected && valueSelected[config.valueKey] && !multiple ? valueSelected[config.labelKey] : values[0] ? ' ' : null;
|
|
2413
|
-
return result;
|
|
2414
|
-
},
|
|
2415
|
-
optionsShown: function optionsShown() {
|
|
2416
|
-
return this.filteredOptions || this.options;
|
|
2417
|
-
},
|
|
2418
|
-
selectedOptions: function selectedOptions() {
|
|
2419
|
-
var values = this.values,
|
|
2420
|
-
options = this.options,
|
|
2421
|
-
config = this.config;
|
|
2422
|
-
var optionsSelected = [];
|
|
2423
|
-
values.forEach(function (v) {
|
|
2424
|
-
return optionsSelected.push(options.find(function (o) {
|
|
2425
|
-
return v === o[config.valueKey];
|
|
2426
|
-
}));
|
|
2427
|
-
});
|
|
2428
|
-
return optionsSelected;
|
|
2429
|
-
}
|
|
2430
|
-
},
|
|
2431
|
-
watch: {
|
|
2432
|
-
value: {
|
|
2433
|
-
handler: function handler() {
|
|
2434
|
-
var multiple = this.multiple;
|
|
2435
|
-
if (multiple) this.scrollTags();
|
|
2436
|
-
},
|
|
2437
|
-
immediate: true
|
|
2438
|
-
}
|
|
2439
|
-
},
|
|
2440
|
-
methods: {
|
|
2441
|
-
scrollTags: function scrollTags() {
|
|
2442
|
-
var _this = this;
|
|
2443
|
-
|
|
2444
|
-
return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
|
|
2445
|
-
var _SelectedTagsContaine, _SelectedTagsContaine2;
|
|
2446
|
-
|
|
2447
|
-
var _this$$refs, SelectedTags, SelectedTagsContainer;
|
|
2448
|
-
|
|
2449
|
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
2450
|
-
while (1) {
|
|
2451
|
-
switch (_context.prev = _context.next) {
|
|
2452
|
-
case 0:
|
|
2453
|
-
_context.next = 2;
|
|
2454
|
-
return _this.$nextTick();
|
|
2455
|
-
|
|
2456
|
-
case 2:
|
|
2457
|
-
_this$$refs = _this.$refs, SelectedTags = _this$$refs.SelectedTags, SelectedTagsContainer = _this$$refs.SelectedTagsContainer;
|
|
2458
|
-
if (SelectedTags) SelectedTags.scrollLeft = (_SelectedTagsContaine = SelectedTagsContainer === null || SelectedTagsContainer === void 0 ? void 0 : (_SelectedTagsContaine2 = SelectedTagsContainer.$el) === null || _SelectedTagsContaine2 === void 0 ? void 0 : _SelectedTagsContaine2.clientWidth) !== null && _SelectedTagsContaine !== void 0 ? _SelectedTagsContaine : null;
|
|
2459
|
-
|
|
2460
|
-
case 4:
|
|
2461
|
-
case "end":
|
|
2462
|
-
return _context.stop();
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
}, _callee);
|
|
2466
|
-
}))();
|
|
2467
|
-
},
|
|
2468
|
-
removeOption: function removeOption(value) {
|
|
2469
|
-
var values = this.values,
|
|
2470
|
-
multiple = this.multiple;
|
|
2471
|
-
var leftValues = values.filter(function (v) {
|
|
2472
|
-
return v !== value;
|
|
2473
|
-
});
|
|
2474
|
-
var valueToReturn = leftValues.length ? multiple ? leftValues : leftValues[0] : null;
|
|
2475
|
-
this.emitValues(valueToReturn);
|
|
2476
|
-
},
|
|
2477
|
-
closeList: function closeList() {
|
|
2478
|
-
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2479
|
-
if (this.$el.contains(e.relatedTarget)) return e.preventDefault();
|
|
2480
|
-
this.$emit('close');
|
|
2481
|
-
this.listIsOpen = false;
|
|
2482
|
-
this.isFocus = false;
|
|
2483
|
-
},
|
|
2484
|
-
openList: function openList(e) {
|
|
2485
|
-
this.$emit('focus', e);
|
|
2486
|
-
var disabled = this.disabled,
|
|
2487
|
-
search = this.search,
|
|
2488
|
-
values = this.values;
|
|
2489
|
-
|
|
2490
|
-
if (!disabled) {
|
|
2491
|
-
if (disabled) return; // sent when the list is open
|
|
2492
|
-
|
|
2493
|
-
this.$emit('open');
|
|
2494
|
-
this.isFocus = true;
|
|
2495
|
-
this.listIsOpen = true;
|
|
2496
|
-
this.selectFirstValue();
|
|
2497
|
-
if (search) this.focusSearchInput();
|
|
2498
|
-
if (values.length) this.scrollToSelectedOnFocus(this.selectedValueIndex);
|
|
2499
|
-
}
|
|
2500
|
-
},
|
|
2501
|
-
clearSearch: function clearSearch() {
|
|
2502
|
-
this.searchQuery = null;
|
|
2503
|
-
this.filteredOptions = null;
|
|
2504
|
-
},
|
|
2505
|
-
reset: function reset() {
|
|
2506
|
-
var _this2 = this;
|
|
2507
|
-
|
|
2508
|
-
return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
|
|
2509
|
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
|
2510
|
-
while (1) {
|
|
2511
|
-
switch (_context2.prev = _context2.next) {
|
|
2512
|
-
case 0:
|
|
2513
|
-
_this2.clearSearch();
|
|
2514
|
-
|
|
2515
|
-
if (!_this2.multiple) {
|
|
2516
|
-
_context2.next = 3;
|
|
2517
|
-
break;
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2520
|
-
return _context2.abrupt("return");
|
|
2521
|
-
|
|
2522
|
-
case 3:
|
|
2523
|
-
_this2.closeList();
|
|
2524
|
-
|
|
2525
|
-
case 4:
|
|
2526
|
-
case "end":
|
|
2527
|
-
return _context2.stop();
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
}, _callee2);
|
|
2531
|
-
}))();
|
|
2532
|
-
},
|
|
2533
|
-
selectFirstValue: function selectFirstValue() {
|
|
2534
|
-
var multiple = this.multiple,
|
|
2535
|
-
value = this.value,
|
|
2536
|
-
options = this.options,
|
|
2537
|
-
config = this.config;
|
|
2538
|
-
if (value || multiple) return;
|
|
2539
|
-
var valueToReturn = options[0][config.valueKey] || null;
|
|
2540
|
-
this.tmpValue = valueToReturn;
|
|
2541
|
-
this.emitValues(valueToReturn, true);
|
|
2542
|
-
},
|
|
2543
|
-
updateValue: function updateValue(value) {
|
|
2544
|
-
var multiple = this.multiple,
|
|
2545
|
-
values = this.values,
|
|
2546
|
-
removeOption = this.removeOption;
|
|
2547
|
-
if (values.includes(value) && multiple) return removeOption(value);
|
|
2548
|
-
this.tmpValue = value;
|
|
2549
|
-
if (value) values.push(value);
|
|
2550
|
-
var valueToReturn = multiple && value ? values : value;
|
|
2551
|
-
this.emitValues(valueToReturn);
|
|
2552
|
-
},
|
|
2553
|
-
focusSearchInput: function focusSearchInput() {
|
|
2554
|
-
var _this3 = this;
|
|
2555
|
-
|
|
2556
|
-
return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
|
|
2557
|
-
var SearchInput;
|
|
2558
|
-
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
|
2559
|
-
while (1) {
|
|
2560
|
-
switch (_context3.prev = _context3.next) {
|
|
2561
|
-
case 0:
|
|
2562
|
-
_context3.next = 2;
|
|
2563
|
-
return _this3.$nextTick();
|
|
2564
|
-
|
|
2565
|
-
case 2:
|
|
2566
|
-
SearchInput = _this3.$refs.SearchInput;
|
|
2567
|
-
SearchInput.$el.querySelector('input').focus();
|
|
2568
|
-
|
|
2569
|
-
case 4:
|
|
2570
|
-
case "end":
|
|
2571
|
-
return _context3.stop();
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
}, _callee3);
|
|
2575
|
-
}))();
|
|
2576
|
-
},
|
|
2577
|
-
emitValues: function emitValues(values, noReset) {
|
|
2578
|
-
var _this4 = this;
|
|
2579
|
-
|
|
2580
|
-
return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
|
|
2581
|
-
return regenerator_default.a.wrap(function _callee4$(_context4) {
|
|
2582
|
-
while (1) {
|
|
2583
|
-
switch (_context4.prev = _context4.next) {
|
|
2584
|
-
case 0:
|
|
2585
|
-
// return the select input
|
|
2586
|
-
// @arg the option value selected
|
|
2587
|
-
_this4.$emit('input', values);
|
|
2588
|
-
|
|
2589
|
-
if (!noReset) {
|
|
2590
|
-
_context4.next = 3;
|
|
2591
|
-
break;
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
return _context4.abrupt("return");
|
|
2595
|
-
|
|
2596
|
-
case 3:
|
|
2597
|
-
_context4.next = 5;
|
|
2598
|
-
return _this4.$nextTick();
|
|
2599
|
-
|
|
2600
|
-
case 5:
|
|
2601
|
-
_this4.reset();
|
|
2602
|
-
|
|
2603
|
-
case 6:
|
|
2604
|
-
case "end":
|
|
2605
|
-
return _context4.stop();
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
}, _callee4);
|
|
2609
|
-
}))();
|
|
2610
|
-
},
|
|
2611
|
-
scrollToSelectedOnFocus: function scrollToSelectedOnFocus(arrayIndex) {
|
|
2612
|
-
var _this5 = this;
|
|
2613
|
-
|
|
2614
|
-
return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee5() {
|
|
2615
|
-
return regenerator_default.a.wrap(function _callee5$(_context5) {
|
|
2616
|
-
while (1) {
|
|
2617
|
-
switch (_context5.prev = _context5.next) {
|
|
2618
|
-
case 0:
|
|
2619
|
-
_context5.next = 2;
|
|
2620
|
-
return _this5.$nextTick();
|
|
2621
|
-
|
|
2622
|
-
case 2:
|
|
2623
|
-
_this5.$refs.optionsList.scrollTop = arrayIndex * _this5.itemHeight - _this5.itemHeight * 3;
|
|
2624
|
-
|
|
2625
|
-
case 3:
|
|
2626
|
-
case "end":
|
|
2627
|
-
return _context5.stop();
|
|
2628
|
-
}
|
|
2629
|
-
}
|
|
2630
|
-
}, _callee5);
|
|
2631
|
-
}))();
|
|
2632
|
-
},
|
|
2633
|
-
keyboardNav: function keyboardNav(e) {
|
|
2634
|
-
var code = e.keyCode;
|
|
2635
|
-
var hasOpenList = this.hasOpenList,
|
|
2636
|
-
tmpValueIndex = this.tmpValueIndex,
|
|
2637
|
-
optionsShown = this.optionsShown,
|
|
2638
|
-
openList = this.openList,
|
|
2639
|
-
tmpValue = this.tmpValue,
|
|
2640
|
-
search = this.search,
|
|
2641
|
-
config = this.config;
|
|
2642
|
-
|
|
2643
|
-
if (code === 40 || code === 38) {
|
|
2644
|
-
e.preventDefault();
|
|
2645
|
-
if (!hasOpenList) openList();
|
|
2646
|
-
var index = code === 40 ? tmpValueIndex + 1 : tmpValueIndex - 1;
|
|
2647
|
-
|
|
2648
|
-
if (index === -1 || index >= optionsShown.length) {
|
|
2649
|
-
index = index === -1 ? optionsShown.length - 1 : 0;
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
|
-
this.tmpValue = optionsShown[index][config.valueKey];
|
|
2653
|
-
this.scrollToSelectedOnFocus(index);
|
|
2654
|
-
} else if (code === 13) {
|
|
2655
|
-
// enter key
|
|
2656
|
-
e.preventDefault();
|
|
2657
|
-
hasOpenList ? this.updateValue(tmpValue) : this.openList();
|
|
2658
|
-
} else if (code === 27) {
|
|
2659
|
-
// escape key
|
|
2660
|
-
this.closeList();
|
|
2661
|
-
} else if (!search) {
|
|
2662
|
-
// typing an option's name
|
|
2663
|
-
this.searching(e);
|
|
2664
|
-
}
|
|
2665
|
-
},
|
|
2666
|
-
searching: function searching(e) {
|
|
2667
|
-
var _this6 = this;
|
|
2668
|
-
|
|
2669
|
-
var config = this.config,
|
|
2670
|
-
options = this.options;
|
|
2671
|
-
var code = e.keyCode;
|
|
2672
|
-
clearTimeout(queryTimer);
|
|
2673
|
-
var queryTimer = setTimeout(function () {
|
|
2674
|
-
_this6.query = '';
|
|
2675
|
-
}, 2000);
|
|
2676
|
-
var q = String.fromCharCode(code);
|
|
2677
|
-
|
|
2678
|
-
if (code === 8 && this.query !== '') {
|
|
2679
|
-
this.query = this.query.substring(0, this.query.length - 1);
|
|
2680
|
-
} else if (/[a-zA-Z-e ]/.test(q)) {
|
|
2681
|
-
if (!this.hasOpenList) this.openList();
|
|
2682
|
-
this.query += q.toLowerCase();
|
|
2683
|
-
var resultIndex = options.findIndex(function (o) {
|
|
2684
|
-
_this6.tmpValue = o[config.valueKey];
|
|
2685
|
-
return o[config.searchKey].toLowerCase().includes(_this6.query);
|
|
2686
|
-
});
|
|
2687
|
-
|
|
2688
|
-
if (resultIndex !== -1) {
|
|
2689
|
-
this.scrollToSelectedOnFocus(resultIndex);
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
},
|
|
2693
|
-
searchInOptions: function searchInOptions(query) {
|
|
2694
|
-
var config = this.config,
|
|
2695
|
-
options = this.options;
|
|
2696
|
-
this.searchQuery = query === '' ? null : query;
|
|
2697
|
-
if (!this.searchQuery) return this.filteredOptions = options;
|
|
2698
|
-
var searchQuery = query.toLowerCase();
|
|
2699
|
-
var filteredOptions = options.filter(function (o) {
|
|
2700
|
-
return o[config.valueKey] && o[config.searchKey].toLowerCase().includes(searchQuery) || o[config.labelKey] && o[config.labelKey].includes(searchQuery);
|
|
2701
|
-
});
|
|
2702
|
-
this.tmpValue = filteredOptions.length ? filteredOptions[0][config.valueKey] : null;
|
|
2703
|
-
this.filteredOptions = filteredOptions;
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
});
|
|
2707
|
-
// CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue?vue&type=script&lang=js&
|
|
2708
|
-
/* harmony default export */ var MazSelect_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
|
|
2709
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2710
|
-
var componentNormalizer = __webpack_require__(0);
|
|
2711
|
-
|
|
2712
|
-
// CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
/* normalize component */
|
|
2719
|
-
|
|
2720
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
2721
|
-
MazSelect_mainvue_type_script_lang_js_,
|
|
2722
|
-
render,
|
|
2723
|
-
staticRenderFns,
|
|
2724
|
-
false,
|
|
2725
|
-
null,
|
|
2726
|
-
null,
|
|
2727
|
-
null
|
|
2728
|
-
|
|
2729
|
-
)
|
|
2730
|
-
|
|
2731
|
-
/* hot reload */
|
|
2732
|
-
if (false) { var api; }
|
|
2733
|
-
component.options.__file = "packages/components/MazSelect/_main.vue"
|
|
2734
|
-
/* harmony default export */ var _main = (component.exports);
|
|
2735
|
-
// CONCATENATED MODULE: ./packages/components/MazSelect/index.js
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
_main.install = function (Vue) {
|
|
2739
|
-
Vue.component(_main.name, _main);
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
/* harmony default export */ var MazSelect = __webpack_exports__["default"] = (_main);
|
|
2743
|
-
|
|
2744
|
-
/***/ }),
|
|
2745
|
-
/* 17 */,
|
|
2746
|
-
/* 18 */,
|
|
2747
|
-
/* 19 */,
|
|
2748
|
-
/* 20 */,
|
|
2749
|
-
/* 21 */
|
|
2750
|
-
/***/ (function(module, exports) {
|
|
2751
|
-
|
|
2752
|
-
module.exports = require("libphonenumber-js/examples.mobile.json");
|
|
2753
|
-
|
|
2754
|
-
/***/ }),
|
|
2755
|
-
/* 22 */,
|
|
2756
|
-
/* 23 */,
|
|
2757
|
-
/* 24 */,
|
|
2758
|
-
/* 25 */
|
|
2759
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2760
|
-
|
|
2761
|
-
"use strict";
|
|
2762
|
-
// ESM COMPAT FLAG
|
|
2763
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2764
|
-
|
|
2765
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazPhoneNumberInput/_main.vue?vue&type=template&id=0022c02d&
|
|
2766
|
-
var render = function () {
|
|
2767
|
-
var _vm = this
|
|
2768
|
-
var _h = _vm.$createElement
|
|
2769
|
-
var _c = _vm._self._c || _h
|
|
2770
|
-
return _c(
|
|
2771
|
-
"div",
|
|
2772
|
-
{
|
|
2773
|
-
staticClass: "maz-base-component maz-phone-number-input maz-flex",
|
|
2774
|
-
class: [
|
|
2775
|
-
{ "maz-is-dark": _vm.dark },
|
|
2776
|
-
"maz-phone-number-input--" + _vm.size,
|
|
2777
|
-
],
|
|
2778
|
-
attrs: { id: _vm.id },
|
|
2779
|
-
},
|
|
2780
|
-
[
|
|
2781
|
-
!_vm.noCountrySelector
|
|
2782
|
-
? _c("MazSelect", {
|
|
2783
|
-
ref: "CountrySelector",
|
|
2784
|
-
staticClass: "country-selector",
|
|
2785
|
-
class: {
|
|
2786
|
-
"no-padding-left": _vm.noFlags || !_vm.countryCode,
|
|
2787
|
-
},
|
|
2788
|
-
attrs: {
|
|
2789
|
-
value: _vm.countryCode,
|
|
2790
|
-
options: _vm.countriesSorted,
|
|
2791
|
-
placeholder: _vm.t.countrySelectorLabel,
|
|
2792
|
-
search: !_vm.noSearch,
|
|
2793
|
-
position: _vm.position,
|
|
2794
|
-
"search-placeholder": _vm.t.countrySelectorSearchPlaceholder,
|
|
2795
|
-
"items-height": _vm.countriesHeight,
|
|
2796
|
-
error: _vm.shouldChooseCountry,
|
|
2797
|
-
hint: _vm.shouldChooseCountry ? _vm.t.countrySelectorError : null,
|
|
2798
|
-
size: _vm.size,
|
|
2799
|
-
success: _vm.isValid && !_vm.noValidation,
|
|
2800
|
-
disabled: _vm.disabled,
|
|
2801
|
-
"input-value": _vm.callingCode,
|
|
2802
|
-
"list-width": 250,
|
|
2803
|
-
config: {
|
|
2804
|
-
labelKey: "dialCode",
|
|
2805
|
-
searchKey: "name",
|
|
2806
|
-
valueKey: "iso2",
|
|
2807
|
-
},
|
|
2808
|
-
color: _vm.color,
|
|
2809
|
-
},
|
|
2810
|
-
on: {
|
|
2811
|
-
input: function ($event) {
|
|
2812
|
-
return _vm.setCountryCode($event, true)
|
|
2813
|
-
},
|
|
2814
|
-
},
|
|
2815
|
-
scopedSlots: _vm._u(
|
|
2816
|
-
[
|
|
2817
|
-
{
|
|
2818
|
-
key: "default",
|
|
2819
|
-
fn: function (ref) {
|
|
2820
|
-
var option = ref.option
|
|
2821
|
-
return [
|
|
2822
|
-
_c("div", { staticClass: "maz-flex maz-align-center" }, [
|
|
2823
|
-
!_vm.noFlags
|
|
2824
|
-
? _c(
|
|
2825
|
-
"div",
|
|
2826
|
-
{
|
|
2827
|
-
staticClass:
|
|
2828
|
-
"country-selector__flag-container maz-mr-2",
|
|
2829
|
-
},
|
|
2830
|
-
[
|
|
2831
|
-
_c("div", {
|
|
2832
|
-
class:
|
|
2833
|
-
"maz-flag maz-flag-" +
|
|
2834
|
-
option.iso2.toLowerCase(),
|
|
2835
|
-
}),
|
|
2836
|
-
]
|
|
2837
|
-
)
|
|
2838
|
-
: _vm._e(),
|
|
2839
|
-
_vm.showCodeOnList
|
|
2840
|
-
? _c(
|
|
2841
|
-
"span",
|
|
2842
|
-
{
|
|
2843
|
-
staticClass:
|
|
2844
|
-
"country-selector__calling-code maz-flex-fixed maz-text-muted",
|
|
2845
|
-
class: {
|
|
2846
|
-
"maz-text-muted-dark": option.isSelected,
|
|
2847
|
-
},
|
|
2848
|
-
},
|
|
2849
|
-
[
|
|
2850
|
-
_vm._v(
|
|
2851
|
-
"\n +" +
|
|
2852
|
-
_vm._s(option.dialCode) +
|
|
2853
|
-
"\n "
|
|
2854
|
-
),
|
|
2855
|
-
]
|
|
2856
|
-
)
|
|
2857
|
-
: _vm._e(),
|
|
2858
|
-
_c(
|
|
2859
|
-
"div",
|
|
2860
|
-
{
|
|
2861
|
-
staticClass:
|
|
2862
|
-
"maz-dots-text maz-flex-1 maz-text-left maz-text-color",
|
|
2863
|
-
class: {
|
|
2864
|
-
"maz-text-white": option.isSelected,
|
|
2865
|
-
},
|
|
2866
|
-
},
|
|
2867
|
-
[
|
|
2868
|
-
_vm._v(
|
|
2869
|
-
"\n " +
|
|
2870
|
-
_vm._s(option.name) +
|
|
2871
|
-
"\n "
|
|
2872
|
-
),
|
|
2873
|
-
]
|
|
2874
|
-
),
|
|
2875
|
-
]),
|
|
2876
|
-
]
|
|
2877
|
-
},
|
|
2878
|
-
},
|
|
2879
|
-
],
|
|
2880
|
-
null,
|
|
2881
|
-
false,
|
|
2882
|
-
2447316597
|
|
2883
|
-
),
|
|
2884
|
-
})
|
|
2885
|
-
: _vm._e(),
|
|
2886
|
-
_vm.countryCode && !_vm.noFlags && !_vm.noCountrySelector
|
|
2887
|
-
? _c(
|
|
2888
|
-
"button",
|
|
2889
|
-
{
|
|
2890
|
-
staticClass: "\n maz-phone-number-input__country-flag",
|
|
2891
|
-
attrs: { tabindex: "-1" },
|
|
2892
|
-
on: { click: _vm.focusCountrySelector },
|
|
2893
|
-
},
|
|
2894
|
-
[
|
|
2895
|
-
_c("div", {
|
|
2896
|
-
class: "maz-flag maz-flag-" + _vm.countryCode.toLowerCase(),
|
|
2897
|
-
}),
|
|
2898
|
-
]
|
|
2899
|
-
)
|
|
2900
|
-
: _vm._e(),
|
|
2901
|
-
_c(
|
|
2902
|
-
"MazInput",
|
|
2903
|
-
_vm._b(
|
|
2904
|
-
{
|
|
2905
|
-
ref: "PhoneNumberInput",
|
|
2906
|
-
staticClass: "input-phone-number maz-flex-1",
|
|
2907
|
-
class: {
|
|
2908
|
-
"has-border-radius": _vm.noCountrySelector,
|
|
2909
|
-
},
|
|
2910
|
-
attrs: {
|
|
2911
|
-
id: _vm.uniqueId ? _vm.uniqueId + "_phone_number" : null,
|
|
2912
|
-
value: _vm.asYouTypeNumber,
|
|
2913
|
-
placeholder: _vm.placeholder || _vm.t.phoneNumberLabel,
|
|
2914
|
-
hint: _vm.hint || _vm.hintValue,
|
|
2915
|
-
disabled: _vm.disabled,
|
|
2916
|
-
size: _vm.size,
|
|
2917
|
-
success: _vm.isValid && !_vm.noValidation,
|
|
2918
|
-
clearable: "",
|
|
2919
|
-
color: _vm.color,
|
|
2920
|
-
},
|
|
2921
|
-
on: {
|
|
2922
|
-
keydown: _vm.onKeydown,
|
|
2923
|
-
focus: function ($event) {
|
|
2924
|
-
return _vm.$emit("focus", $event)
|
|
2925
|
-
},
|
|
2926
|
-
blur: _vm.onBlur,
|
|
2927
|
-
change: function ($event) {
|
|
2928
|
-
return _vm.$emit("change", $event)
|
|
2929
|
-
},
|
|
2930
|
-
clear: function ($event) {
|
|
2931
|
-
return _vm.$emit("clear", $event)
|
|
2932
|
-
},
|
|
2933
|
-
input: _vm.buildResults,
|
|
2934
|
-
},
|
|
2935
|
-
},
|
|
2936
|
-
"MazInput",
|
|
2937
|
-
_vm.$attrs,
|
|
2938
|
-
false
|
|
2939
|
-
),
|
|
2940
|
-
[
|
|
2941
|
-
_vm._t("icon-left", null, { slot: "icon-left" }),
|
|
2942
|
-
_vm._t("icon-right", null, { slot: "icon-right" }),
|
|
2943
|
-
],
|
|
2944
|
-
2
|
|
2945
|
-
),
|
|
2946
|
-
],
|
|
2947
|
-
1
|
|
2948
|
-
)
|
|
2949
|
-
}
|
|
2950
|
-
var staticRenderFns = []
|
|
2951
|
-
render._withStripped = true
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue?vue&type=template&id=0022c02d&
|
|
2955
|
-
|
|
2956
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
2957
|
-
var regenerator = __webpack_require__(1);
|
|
2958
|
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
2959
|
-
|
|
2960
|
-
// EXTERNAL MODULE: external "libphonenumber-js"
|
|
2961
|
-
var external_libphonenumber_js_ = __webpack_require__(11);
|
|
2962
|
-
|
|
2963
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/constantes/js/phoneCodeCountries.js
|
|
2964
|
-
var allCountries = [['Afghanistan (افغانستان)', 'af', '93'], ['Albania (Shqipëri)', 'al', '355'], ['Algeria (الجزائر)', 'dz', '213'], ['American Samoa', 'as', '1684'], ['Andorra', 'ad', '376'], ['Angola', 'ao', '244'], ['Anguilla', 'ai', '1264'], ['Antigua and Barbuda', 'ag', '1268'], ['Argentina', 'ar', '54'], ['Armenia (Հայաստան)', 'am', '374'], ['Aruba', 'aw', '297'], ['Australia', 'au', '61', 0], ['Austria (Österreich)', 'at', '43'], ['Azerbaijan (Azərbaycan)', 'az', '994'], ['Bahamas', 'bs', '1242'], ['Bahrain (البحرين)', 'bh', '973'], ['Bangladesh (বাংলাদেশ)', 'bd', '880'], ['Barbados', 'bb', '1246'], ['Belarus (Беларусь)', 'by', '375'], ['Belgium (België)', 'be', '32'], ['Belize', 'bz', '501'], ['Benin (Bénin)', 'bj', '229'], ['Bermuda', 'bm', '1441'], ['Bhutan (འབྲུག)', 'bt', '975'], ['Bolivia', 'bo', '591'], ['Bosnia and Herzegovina (Босна и Херцеговина)', 'ba', '387'], ['Botswana', 'bw', '267'], ['Brazil (Brasil)', 'br', '55'], ['British Indian Ocean Territory', 'io', '246'], ['British Virgin Islands', 'vg', '1284'], ['Brunei', 'bn', '673'], ['Bulgaria (България)', 'bg', '359'], ['Burkina Faso', 'bf', '226'], ['Burundi (Uburundi)', 'bi', '257'], ['Cambodia (កម្ពុជា)', 'kh', '855'], ['Cameroon (Cameroun)', 'cm', '237'], ['Canada', 'ca', '1', 1, ['204', '226', '236', '249', '250', '289', '306', '343', '365', '387', '403', '416', '418', '431', '437', '438', '450', '506', '514', '519', '548', '579', '581', '587', '604', '613', '639', '647', '672', '705', '709', '742', '778', '780', '782', '807', '819', '825', '867', '873', '902', '905']], ['Cape Verde (Kabu Verdi)', 'cv', '238'], ['Caribbean Netherlands', 'bq', '599', 1], ['Cayman Islands', 'ky', '1345'], ['Central African Republic (République centrafricaine)', 'cf', '236'], ['Chad (Tchad)', 'td', '235'], ['Chile', 'cl', '56'], ['China (中国)', 'cn', '86'], ['Christmas Island', 'cx', '61', 2], ['Cocos (Keeling) Islands', 'cc', '61', 1], ['Colombia', 'co', '57'], ['Comoros (جزر القمر)', 'km', '269'], ['Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)', 'cd', '243'], ['Congo (Republic) (Congo-Brazzaville)', 'cg', '242'], ['Cook Islands', 'ck', '682'], ['Costa Rica', 'cr', '506'], ['Côte d’Ivoire', 'ci', '225'], ['Croatia (Hrvatska)', 'hr', '385'], ['Cuba', 'cu', '53'], ['Curaçao', 'cw', '599', 0], ['Cyprus (Κύπρος)', 'cy', '357'], ['Czech Republic (Česká republika)', 'cz', '420'], ['Denmark (Danmark)', 'dk', '45'], ['Djibouti', 'dj', '253'], ['Dominica', 'dm', '1767'], ['Dominican Republic (República Dominicana)', 'do', '1', 2, ['809', '829', '849']], ['Ecuador', 'ec', '593'], ['Egypt (مصر)', 'eg', '20'], ['El Salvador', 'sv', '503'], ['Equatorial Guinea (Guinea Ecuatorial)', 'gq', '240'], ['Eritrea', 'er', '291'], ['Estonia (Eesti)', 'ee', '372'], ['Ethiopia', 'et', '251'], ['Falkland Islands (Islas Malvinas)', 'fk', '500'], ['Faroe Islands (Føroyar)', 'fo', '298'], ['Fiji', 'fj', '679'], ['Finland (Suomi)', 'fi', '358', 0], ['France', 'fr', '33'], ['French Guiana (Guyane française)', 'gf', '594'], ['French Polynesia (Polynésie française)', 'pf', '689'], ['Gabon', 'ga', '241'], ['Gambia', 'gm', '220'], ['Georgia (საქართველო)', 'ge', '995'], ['Germany (Deutschland)', 'de', '49'], ['Ghana (Gaana)', 'gh', '233'], ['Gibraltar', 'gi', '350'], ['Greece (Ελλάδα)', 'gr', '30'], ['Greenland (Kalaallit Nunaat)', 'gl', '299'], ['Grenada', 'gd', '1473'], ['Guadeloupe', 'gp', '590', 0], ['Guam', 'gu', '1671'], ['Guatemala', 'gt', '502'], ['Guernsey', 'gg', '44', 1], ['Guinea (Guinée)', 'gn', '224'], ['Guinea-Bissau (Guiné Bissau)', 'gw', '245'], ['Guyana', 'gy', '592'], ['Haiti', 'ht', '509'], ['Honduras', 'hn', '504'], ['Hong Kong (香港)', 'hk', '852'], ['Hungary (Magyarország)', 'hu', '36'], ['Iceland (Ísland)', 'is', '354'], ['India (भारत)', 'in', '91'], ['Indonesia', 'id', '62'], ['Iran (ایران)', 'ir', '98'], ['Iraq (العراق)', 'iq', '964'], ['Ireland', 'ie', '353'], ['Isle of Man', 'im', '44', 2], ['Israel (ישראל)', 'il', '972'], ['Italy (Italia)', 'it', '39', 0], ['Jamaica', 'jm', '1876'], ['Japan (日本)', 'jp', '81'], ['Jersey', 'je', '44', 3], ['Jordan (الأردن)', 'jo', '962'], ['Kazakhstan (Казахстан)', 'kz', '7', 1], ['Kenya', 'ke', '254'], ['Kiribati', 'ki', '686'], ['Kosovo', 'xk', '383'], ['Kuwait (الكويت)', 'kw', '965'], ['Kyrgyzstan (Кыргызстан)', 'kg', '996'], ['Laos (ລາວ)', 'la', '856'], ['Latvia (Latvija)', 'lv', '371'], ['Lebanon (لبنان)', 'lb', '961'], ['Lesotho', 'ls', '266'], ['Liberia', 'lr', '231'], ['Libya (ليبيا)', 'ly', '218'], ['Liechtenstein', 'li', '423'], ['Lithuania (Lietuva)', 'lt', '370'], ['Luxembourg', 'lu', '352'], ['Macau (澳門)', 'mo', '853'], ['Macedonia (FYROM) (Македонија)', 'mk', '389'], ['Madagascar (Madagasikara)', 'mg', '261'], ['Malawi', 'mw', '265'], ['Malaysia', 'my', '60'], ['Maldives', 'mv', '960'], ['Mali', 'ml', '223'], ['Malta', 'mt', '356'], ['Marshall Islands', 'mh', '692'], ['Martinique', 'mq', '596'], ['Mauritania (موريتانيا)', 'mr', '222'], ['Mauritius (Moris)', 'mu', '230'], ['Mayotte', 'yt', '262', 1], ['Mexico (México)', 'mx', '52'], ['Micronesia', 'fm', '691'], ['Moldova (Republica Moldova)', 'md', '373'], ['Monaco', 'mc', '377'], ['Mongolia (Монгол)', 'mn', '976'], ['Montenegro (Crna Gora)', 'me', '382'], ['Montserrat', 'ms', '1664'], ['Morocco (المغرب)', 'ma', '212', 0], ['Mozambique (Moçambique)', 'mz', '258'], ['Myanmar (Burma) (မြန်မာ)', 'mm', '95'], ['Namibia (Namibië)', 'na', '264'], ['Nauru', 'nr', '674'], ['Nepal (नेपाल)', 'np', '977'], ['Netherlands (Nederland)', 'nl', '31'], ['New Caledonia (Nouvelle-Calédonie)', 'nc', '687'], ['New Zealand', 'nz', '64'], ['Nicaragua', 'ni', '505'], ['Niger (Nijar)', 'ne', '227'], ['Nigeria', 'ng', '234'], ['Niue', 'nu', '683'], ['Norfolk Island', 'nf', '672'], ['North Korea (조선 민주주의 인민 공화국)', 'kp', '850'], ['Northern Mariana Islands', 'mp', '1670'], ['Norway (Norge)', 'no', '47', 0], ['Oman (عُمان)', 'om', '968'], ['Pakistan (پاکستان)', 'pk', '92'], ['Palau', 'pw', '680'], ['Palestine (فلسطين)', 'ps', '970'], ['Panama (Panamá)', 'pa', '507'], ['Papua New Guinea', 'pg', '675'], ['Paraguay', 'py', '595'], ['Peru (Perú)', 'pe', '51'], ['Philippines', 'ph', '63'], ['Poland (Polska)', 'pl', '48'], ['Portugal', 'pt', '351'], ['Puerto Rico', 'pr', '1', 3, ['787', '939']], ['Qatar (قطر)', 'qa', '974'], ['Réunion (La Réunion)', 're', '262', 0], ['Romania (România)', 'ro', '40'], ['Russia (Россия)', 'ru', '7', 0], ['Rwanda', 'rw', '250'], ['Saint Barthélemy', 'bl', '590', 1], ['Saint Helena', 'sh', '290'], ['Saint Kitts and Nevis', 'kn', '1869'], ['Saint Lucia', 'lc', '1758'], ['Saint Martin (Saint-Martin (partie française))', 'mf', '590', 2], ['Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)', 'pm', '508'], ['Saint Vincent and the Grenadines', 'vc', '1784'], ['Samoa', 'ws', '685'], ['San Marino', 'sm', '378'], ['São Tomé and Príncipe (São Tomé e Príncipe)', 'st', '239'], ['Saudi Arabia (المملكة العربية السعودية)', 'sa', '966'], ['Senegal (Sénégal)', 'sn', '221'], ['Serbia (Србија)', 'rs', '381'], ['Seychelles', 'sc', '248'], ['Sierra Leone', 'sl', '232'], ['Singapore', 'sg', '65'], ['Sint Maarten', 'sx', '1721'], ['Slovakia (Slovensko)', 'sk', '421'], ['Slovenia (Slovenija)', 'si', '386'], ['Solomon Islands', 'sb', '677'], ['Somalia (Soomaaliya)', 'so', '252'], ['South Africa', 'za', '27'], ['South Korea (대한민국)', 'kr', '82'], ['South Sudan (جنوب السودان)', 'ss', '211'], ['Spain (España)', 'es', '34'], ['Sri Lanka (ශ්රී ලංකාව)', 'lk', '94'], ['Sudan (السودان)', 'sd', '249'], ['Suriname', 'sr', '597'], ['Svalbard and Jan Mayen', 'sj', '47', 1], ['Swaziland', 'sz', '268'], ['Sweden (Sverige)', 'se', '46'], ['Switzerland (Schweiz)', 'ch', '41'], ['Syria (سوريا)', 'sy', '963'], ['Taiwan (台灣)', 'tw', '886'], ['Tajikistan', 'tj', '992'], ['Tanzania', 'tz', '255'], ['Thailand (ไทย)', 'th', '66'], ['Timor-Leste', 'tl', '670'], ['Togo', 'tg', '228'], ['Tokelau', 'tk', '690'], ['Tonga', 'to', '676'], ['Trinidad and Tobago', 'tt', '1868'], ['Tunisia (تونس)', 'tn', '216'], ['Turkey (Türkiye)', 'tr', '90'], ['Turkmenistan', 'tm', '993'], ['Turks and Caicos Islands', 'tc', '1649'], ['Tuvalu', 'tv', '688'], ['U.S. Virgin Islands', 'vi', '1340'], ['Uganda', 'ug', '256'], ['Ukraine (Україна)', 'ua', '380'], ['United Arab Emirates (الإمارات العربية المتحدة)', 'ae', '971'], ['United Kingdom', 'gb', '44', 0], ['United States', 'us', '1', 0], ['Uruguay', 'uy', '598'], ['Uzbekistan (Oʻzbekiston)', 'uz', '998'], ['Vanuatu', 'vu', '678'], ['Vatican City (Città del Vaticano)', 'va', '39', 1], ['Venezuela', 've', '58'], ['Vietnam (Việt Nam)', 'vn', '84'], ['Wallis and Futuna (Wallis-et-Futuna)', 'wf', '681'], ['Western Sahara (الصحراء الغربية)', 'eh', '212', 1], ['Yemen (اليمن)', 'ye', '967'], ['Zambia', 'zm', '260'], ['Zimbabwe', 'zw', '263'], ['Åland Islands', 'ax', '358', 1]];
|
|
2965
|
-
var countriesIso = allCountries.map(function (country) {
|
|
2966
|
-
return country[1].toUpperCase();
|
|
2967
|
-
});
|
|
2968
|
-
var countries = allCountries.map(function (country) {
|
|
2969
|
-
return {
|
|
2970
|
-
name: country[0],
|
|
2971
|
-
iso2: country[1].toUpperCase(),
|
|
2972
|
-
dialCode: country[2],
|
|
2973
|
-
priority: country[3] || 0,
|
|
2974
|
-
areaCodes: country[4] || null
|
|
2975
|
-
};
|
|
2976
|
-
});
|
|
2977
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/utils/index.js
|
|
2978
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2979
|
-
|
|
2980
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2981
|
-
|
|
2982
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2987
|
-
|
|
2988
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
var browserLocale = function browserLocale() {
|
|
2993
|
-
if (typeof window === 'undefined') return null;
|
|
2994
|
-
var browserLocale = window.navigator.userLanguage || window.navigator.language;
|
|
2995
|
-
var locale = browserLocale ? browserLocale.substr(3, 4).toUpperCase() : null;
|
|
2996
|
-
if (locale === '') locale = browserLocale.substr(0, 2).toUpperCase(); // fallback to US country
|
|
2997
|
-
|
|
2998
|
-
if (locale === 'EN') locale = 'US';
|
|
2999
|
-
if (locale === 'JA') locale = 'JP';
|
|
3000
|
-
return locale;
|
|
3001
|
-
};
|
|
3002
|
-
var isCountryAvailable = /*#__PURE__*/function () {
|
|
3003
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee(locale) {
|
|
3004
|
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
3005
|
-
while (1) {
|
|
3006
|
-
switch (_context.prev = _context.next) {
|
|
3007
|
-
case 0:
|
|
3008
|
-
_context.prev = 0;
|
|
3009
|
-
|
|
3010
|
-
if (!countriesIso.includes(locale)) {
|
|
3011
|
-
_context.next = 3;
|
|
3012
|
-
break;
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
return _context.abrupt("return", true);
|
|
3016
|
-
|
|
3017
|
-
case 3:
|
|
3018
|
-
throw "MazPhoneNumberInput: The country ".concat(locale, " is not available");
|
|
3019
|
-
|
|
3020
|
-
case 6:
|
|
3021
|
-
_context.prev = 6;
|
|
3022
|
-
_context.t0 = _context["catch"](0);
|
|
3023
|
-
throw new Error(_context.t0);
|
|
3024
|
-
|
|
3025
|
-
case 9:
|
|
3026
|
-
case "end":
|
|
3027
|
-
return _context.stop();
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
}, _callee, null, [[0, 6]]);
|
|
3031
|
-
}));
|
|
3032
|
-
|
|
3033
|
-
return function isCountryAvailable(_x) {
|
|
3034
|
-
return _ref.apply(this, arguments);
|
|
3035
|
-
};
|
|
3036
|
-
}();
|
|
3037
|
-
var utils_getResultsFromPhoneNumber = function getResultsFromPhoneNumber(phoneNumber, countryCode) {
|
|
3038
|
-
var parsing = phoneNumber ? Object(external_libphonenumber_js_["parsePhoneNumberFromString"])(phoneNumber, countryCode) : null;
|
|
3039
|
-
var results = {
|
|
3040
|
-
countryCode: countryCode,
|
|
3041
|
-
phoneNumber: phoneNumber,
|
|
3042
|
-
isValid: false
|
|
3043
|
-
};
|
|
3044
|
-
|
|
3045
|
-
if (parsing) {
|
|
3046
|
-
results = _objectSpread(_objectSpread({}, results), {}, {
|
|
3047
|
-
countryCode: parsing.country,
|
|
3048
|
-
countryCallingCode: parsing.countryCallingCode,
|
|
3049
|
-
nationalNumber: parsing.nationalNumber,
|
|
3050
|
-
isValid: parsing.isValid(),
|
|
3051
|
-
type: parsing.getType(),
|
|
3052
|
-
formatInternational: parsing.formatInternational(),
|
|
3053
|
-
formatNational: parsing.formatNational(),
|
|
3054
|
-
uri: parsing.getURI(),
|
|
3055
|
-
e164: parsing.format('E.164')
|
|
3056
|
-
});
|
|
3057
|
-
}
|
|
3058
|
-
|
|
3059
|
-
return results;
|
|
3060
|
-
};
|
|
3061
|
-
var utils_getAsYouTypeFormat = function getAsYouTypeFormat(phoneNumber, countryCode) {
|
|
3062
|
-
if (!phoneNumber) return null;
|
|
3063
|
-
return countryCode ? new external_libphonenumber_js_["AsYouType"](countryCode).input(phoneNumber) : phoneNumber;
|
|
3064
|
-
};
|
|
3065
|
-
var fetchCountryCode = /*#__PURE__*/function () {
|
|
3066
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
|
|
3067
|
-
var response, responseText, result;
|
|
3068
|
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
|
3069
|
-
while (1) {
|
|
3070
|
-
switch (_context2.prev = _context2.next) {
|
|
3071
|
-
case 0:
|
|
3072
|
-
_context2.prev = 0;
|
|
3073
|
-
_context2.next = 3;
|
|
3074
|
-
return fetch('https://ip2c.org/s');
|
|
3075
|
-
|
|
3076
|
-
case 3:
|
|
3077
|
-
response = _context2.sent;
|
|
3078
|
-
_context2.next = 6;
|
|
3079
|
-
return response.text();
|
|
3080
|
-
|
|
3081
|
-
case 6:
|
|
3082
|
-
responseText = _context2.sent;
|
|
3083
|
-
result = (responseText || '').toString();
|
|
3084
|
-
|
|
3085
|
-
if (!(result && result[0] === '1')) {
|
|
3086
|
-
_context2.next = 10;
|
|
3087
|
-
break;
|
|
3088
|
-
}
|
|
3089
|
-
|
|
3090
|
-
return _context2.abrupt("return", result.substr(2, 2));
|
|
3091
|
-
|
|
3092
|
-
case 10:
|
|
3093
|
-
_context2.next = 15;
|
|
3094
|
-
break;
|
|
3095
|
-
|
|
3096
|
-
case 12:
|
|
3097
|
-
_context2.prev = 12;
|
|
3098
|
-
_context2.t0 = _context2["catch"](0);
|
|
3099
|
-
return _context2.abrupt("return", new Error('[MazPhoneNumberInput] Error while fetching country code'));
|
|
3100
|
-
|
|
3101
|
-
case 15:
|
|
3102
|
-
case "end":
|
|
3103
|
-
return _context2.stop();
|
|
3104
|
-
}
|
|
3105
|
-
}
|
|
3106
|
-
}, _callee2, null, [[0, 12]]);
|
|
3107
|
-
}));
|
|
3108
|
-
|
|
3109
|
-
return function fetchCountryCode() {
|
|
3110
|
-
return _ref2.apply(this, arguments);
|
|
3111
|
-
};
|
|
3112
|
-
}();
|
|
3113
|
-
// EXTERNAL MODULE: external "libphonenumber-js/examples.mobile.json"
|
|
3114
|
-
var examples_mobile_json_ = __webpack_require__(21);
|
|
3115
|
-
var examples_mobile_json_default = /*#__PURE__*/__webpack_require__.n(examples_mobile_json_);
|
|
3116
|
-
|
|
3117
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/constantes/locales/index.js
|
|
3118
|
-
/* harmony default export */ var locales = ({
|
|
3119
|
-
countrySelectorLabel: 'Country code',
|
|
3120
|
-
countrySelectorError: 'Choose country',
|
|
3121
|
-
countrySelectorSearchPlaceholder: 'Search country',
|
|
3122
|
-
phoneNumberLabel: 'Phone number',
|
|
3123
|
-
example: 'Example:'
|
|
3124
|
-
});
|
|
3125
|
-
// EXTERNAL MODULE: ./packages/components/MazInput/index.js + 5 modules
|
|
3126
|
-
var MazInput = __webpack_require__(8);
|
|
3127
|
-
|
|
3128
|
-
// EXTERNAL MODULE: ./packages/components/MazSelect/index.js + 5 modules
|
|
3129
|
-
var MazSelect = __webpack_require__(16);
|
|
3130
|
-
|
|
3131
|
-
// EXTERNAL MODULE: ./packages/mixins/uniqueId.js
|
|
3132
|
-
var uniqueId = __webpack_require__(2);
|
|
3133
|
-
|
|
3134
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazPhoneNumberInput/_main.vue?vue&type=script&lang=js&
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
function _mainvue_type_script_lang_js_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
3138
|
-
|
|
3139
|
-
function _mainvue_type_script_lang_js_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { _mainvue_type_script_lang_js_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { _mainvue_type_script_lang_js_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3140
|
-
|
|
3141
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3142
|
-
|
|
3143
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3144
|
-
|
|
3145
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3146
|
-
|
|
3147
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3148
|
-
|
|
3149
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3150
|
-
|
|
3151
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3152
|
-
|
|
3153
|
-
function _mainvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3154
|
-
|
|
3155
|
-
function _mainvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _mainvue_type_script_lang_js_ownKeys(Object(source), !0).forEach(function (key) { _mainvue_type_script_lang_js_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : _mainvue_type_script_lang_js_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3156
|
-
|
|
3157
|
-
function _mainvue_type_script_lang_js_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3158
|
-
|
|
3159
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3160
|
-
|
|
3161
|
-
//
|
|
3162
|
-
//
|
|
3163
|
-
//
|
|
3164
|
-
//
|
|
3165
|
-
//
|
|
3166
|
-
//
|
|
3167
|
-
//
|
|
3168
|
-
//
|
|
3169
|
-
//
|
|
3170
|
-
//
|
|
3171
|
-
//
|
|
3172
|
-
//
|
|
3173
|
-
//
|
|
3174
|
-
//
|
|
3175
|
-
//
|
|
3176
|
-
//
|
|
3177
|
-
//
|
|
3178
|
-
//
|
|
3179
|
-
//
|
|
3180
|
-
//
|
|
3181
|
-
//
|
|
3182
|
-
//
|
|
3183
|
-
//
|
|
3184
|
-
//
|
|
3185
|
-
//
|
|
3186
|
-
//
|
|
3187
|
-
//
|
|
3188
|
-
//
|
|
3189
|
-
//
|
|
3190
|
-
//
|
|
3191
|
-
//
|
|
3192
|
-
//
|
|
3193
|
-
//
|
|
3194
|
-
//
|
|
3195
|
-
//
|
|
3196
|
-
//
|
|
3197
|
-
//
|
|
3198
|
-
//
|
|
3199
|
-
//
|
|
3200
|
-
//
|
|
3201
|
-
//
|
|
3202
|
-
//
|
|
3203
|
-
//
|
|
3204
|
-
//
|
|
3205
|
-
//
|
|
3206
|
-
//
|
|
3207
|
-
//
|
|
3208
|
-
//
|
|
3209
|
-
//
|
|
3210
|
-
//
|
|
3211
|
-
//
|
|
3212
|
-
//
|
|
3213
|
-
//
|
|
3214
|
-
//
|
|
3215
|
-
//
|
|
3216
|
-
//
|
|
3217
|
-
//
|
|
3218
|
-
//
|
|
3219
|
-
//
|
|
3220
|
-
//
|
|
3221
|
-
//
|
|
3222
|
-
//
|
|
3223
|
-
//
|
|
3224
|
-
//
|
|
3225
|
-
//
|
|
3226
|
-
//
|
|
3227
|
-
//
|
|
3228
|
-
//
|
|
3229
|
-
//
|
|
3230
|
-
//
|
|
3231
|
-
//
|
|
3232
|
-
//
|
|
3233
|
-
//
|
|
3234
|
-
//
|
|
3235
|
-
//
|
|
3236
|
-
//
|
|
3237
|
-
//
|
|
3238
|
-
//
|
|
3239
|
-
//
|
|
3240
|
-
//
|
|
3241
|
-
//
|
|
3242
|
-
//
|
|
3243
|
-
//
|
|
3244
|
-
//
|
|
3245
|
-
//
|
|
3246
|
-
//
|
|
3247
|
-
//
|
|
3248
|
-
//
|
|
3249
|
-
//
|
|
3250
|
-
//
|
|
3251
|
-
//
|
|
3252
|
-
//
|
|
3253
|
-
//
|
|
3254
|
-
//
|
|
3255
|
-
//
|
|
3256
|
-
//
|
|
3257
|
-
//
|
|
3258
|
-
//
|
|
3259
|
-
//
|
|
3260
|
-
//
|
|
3261
|
-
//
|
|
3262
|
-
//
|
|
3263
|
-
//
|
|
3264
|
-
//
|
|
3265
|
-
//
|
|
3266
|
-
//
|
|
3267
|
-
//
|
|
3268
|
-
//
|
|
3269
|
-
//
|
|
3270
|
-
//
|
|
3271
|
-
//
|
|
3272
|
-
//
|
|
3273
|
-
//
|
|
3274
|
-
//
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
/* harmony default export */ var _mainvue_type_script_lang_js_ = ({
|
|
3284
|
-
name: 'MazPhoneNumberInput',
|
|
3285
|
-
components: {
|
|
3286
|
-
MazInput: MazInput["default"],
|
|
3287
|
-
MazSelect: MazSelect["default"]
|
|
3288
|
-
},
|
|
3289
|
-
mixins: [uniqueId["a" /* default */]],
|
|
3290
|
-
props: {
|
|
3291
|
-
value: {
|
|
3292
|
-
validator: function validator(prop) {
|
|
3293
|
-
return ['string', 'number'].includes(_typeof(prop)) || prop === null;
|
|
3294
|
-
},
|
|
3295
|
-
default: null
|
|
3296
|
-
},
|
|
3297
|
-
id: {
|
|
3298
|
-
type: String,
|
|
3299
|
-
default: null
|
|
3300
|
-
},
|
|
3301
|
-
disabled: {
|
|
3302
|
-
type: Boolean,
|
|
3303
|
-
default: false
|
|
3304
|
-
},
|
|
3305
|
-
// set default phone number (Ex: `default-phone-number="0658585858"`)
|
|
3306
|
-
defaultPhoneNumber: {
|
|
3307
|
-
type: String,
|
|
3308
|
-
default: null
|
|
3309
|
-
},
|
|
3310
|
-
// set default country code (Ex: `default-country-code="FR"`)
|
|
3311
|
-
defaultCountryCode: {
|
|
3312
|
-
type: String,
|
|
3313
|
-
default: null
|
|
3314
|
-
},
|
|
3315
|
-
// Same as MazInput (options: `sm|md|lg`)
|
|
3316
|
-
size: {
|
|
3317
|
-
type: String,
|
|
3318
|
-
default: null
|
|
3319
|
-
},
|
|
3320
|
-
// Countries selected will be at the top of the list - Ex : `preferred-countries="['FR', 'BE', 'DE']`
|
|
3321
|
-
preferredCountries: {
|
|
3322
|
-
type: Array,
|
|
3323
|
-
default: null
|
|
3324
|
-
},
|
|
3325
|
-
// Only countries selected are in list - Ex : `only-countries="['FR', 'BE', 'DE']`
|
|
3326
|
-
onlyCountries: {
|
|
3327
|
-
type: Array,
|
|
3328
|
-
default: null
|
|
3329
|
-
},
|
|
3330
|
-
// Countries seleted are remove from the list - Ex : `ignored-countries="['FR', 'BE', 'DE']`
|
|
3331
|
-
ignoredCountries: {
|
|
3332
|
-
type: Array,
|
|
3333
|
-
default: Array
|
|
3334
|
-
},
|
|
3335
|
-
// Translate text in component - By default `{ countrySelectorLabel: 'Country code', countrySelectorError: 'Choose country', phoneNumberLabel: 'Phone number', example: 'Example:' }`
|
|
3336
|
-
translations: {
|
|
3337
|
-
type: Object,
|
|
3338
|
-
default: null
|
|
3339
|
-
},
|
|
3340
|
-
// Remove the validation UI state (success border color)
|
|
3341
|
-
noValidation: {
|
|
3342
|
-
type: Boolean,
|
|
3343
|
-
default: false
|
|
3344
|
-
},
|
|
3345
|
-
// Remove flags in country selector
|
|
3346
|
-
noFlags: {
|
|
3347
|
-
type: Boolean,
|
|
3348
|
-
default: false
|
|
3349
|
-
},
|
|
3350
|
-
// Remove the number example from the label input
|
|
3351
|
-
noExample: {
|
|
3352
|
-
type: Boolean,
|
|
3353
|
-
default: false
|
|
3354
|
-
},
|
|
3355
|
-
// Remove the search countries functionality
|
|
3356
|
-
noSearch: {
|
|
3357
|
-
type: Boolean,
|
|
3358
|
-
default: false
|
|
3359
|
-
},
|
|
3360
|
-
// Change the height of country item in list
|
|
3361
|
-
countriesHeight: {
|
|
3362
|
-
type: Number,
|
|
3363
|
-
default: 30
|
|
3364
|
-
},
|
|
3365
|
-
// Disable use of browser locale to init the country selector (usefull for Nuxt.JS)
|
|
3366
|
-
noUseBrowserLocale: {
|
|
3367
|
-
type: Boolean,
|
|
3368
|
-
default: false
|
|
3369
|
-
},
|
|
3370
|
-
// Fetch country code via https://ip2c.org/s - Network needed - (Do not use it with default-country-code options)
|
|
3371
|
-
fetchCountry: {
|
|
3372
|
-
type: Boolean,
|
|
3373
|
-
default: false
|
|
3374
|
-
},
|
|
3375
|
-
// The country selector is not shown, you can validate your phone number with the country code set
|
|
3376
|
-
noCountrySelector: {
|
|
3377
|
-
type: Boolean,
|
|
3378
|
-
default: false
|
|
3379
|
-
},
|
|
3380
|
-
// Show the country phone code in the list
|
|
3381
|
-
showCodeOnList: {
|
|
3382
|
-
type: Boolean,
|
|
3383
|
-
default: false
|
|
3384
|
-
},
|
|
3385
|
-
// Enable the dark mode
|
|
3386
|
-
dark: {
|
|
3387
|
-
type: Boolean,
|
|
3388
|
-
default: false
|
|
3389
|
-
},
|
|
3390
|
-
// Use color
|
|
3391
|
-
color: {
|
|
3392
|
-
type: String,
|
|
3393
|
-
default: 'primary'
|
|
3394
|
-
},
|
|
3395
|
-
// Set placholder of phone number input
|
|
3396
|
-
placeholder: {
|
|
3397
|
-
type: String,
|
|
3398
|
-
default: null
|
|
3399
|
-
},
|
|
3400
|
-
// hint message shown on phone number text field
|
|
3401
|
-
hint: {
|
|
3402
|
-
type: String,
|
|
3403
|
-
default: null
|
|
3404
|
-
},
|
|
3405
|
-
// set the position of countries list (ex: `top`, `top right`, `bottom right`)
|
|
3406
|
-
position: {
|
|
3407
|
-
type: String,
|
|
3408
|
-
default: 'left bottom'
|
|
3409
|
-
}
|
|
3410
|
-
},
|
|
3411
|
-
data: function data() {
|
|
3412
|
-
return {
|
|
3413
|
-
results: {},
|
|
3414
|
-
countryCode: this.defaultCountryCode,
|
|
3415
|
-
cursorPosition: null,
|
|
3416
|
-
asYouTypeNumber: this.defaultPhoneNumber
|
|
3417
|
-
};
|
|
3418
|
-
},
|
|
3419
|
-
computed: {
|
|
3420
|
-
t: function t() {
|
|
3421
|
-
return _mainvue_type_script_lang_js_objectSpread(_mainvue_type_script_lang_js_objectSpread({}, locales), this.translations);
|
|
3422
|
-
},
|
|
3423
|
-
callingCode: function callingCode() {
|
|
3424
|
-
var _this = this;
|
|
3425
|
-
|
|
3426
|
-
var countryCode = this.countryCode;
|
|
3427
|
-
|
|
3428
|
-
var getDialCode = function getDialCode(code) {
|
|
3429
|
-
var result = _this.countriesSorted.find(function (m) {
|
|
3430
|
-
return m.iso2 === code;
|
|
3431
|
-
});
|
|
3432
|
-
|
|
3433
|
-
return result ? result.dialCode : null;
|
|
3434
|
-
};
|
|
3435
|
-
|
|
3436
|
-
return countryCode ? "+".concat(getDialCode(countryCode) || Object(external_libphonenumber_js_["getCountryCallingCode"])(countryCode)) : null;
|
|
3437
|
-
},
|
|
3438
|
-
// input states
|
|
3439
|
-
shouldChooseCountry: function shouldChooseCountry() {
|
|
3440
|
-
return !this.countryCode && !!this.asYouTypeNumber;
|
|
3441
|
-
},
|
|
3442
|
-
isValid: function isValid() {
|
|
3443
|
-
return this.results.isValid;
|
|
3444
|
-
},
|
|
3445
|
-
hasEmptyPhone: function hasEmptyPhone() {
|
|
3446
|
-
var asYouTypeNumber = this.asYouTypeNumber;
|
|
3447
|
-
return asYouTypeNumber === '' || !asYouTypeNumber;
|
|
3448
|
-
},
|
|
3449
|
-
// hint values
|
|
3450
|
-
phoneNumberExample: function phoneNumberExample() {
|
|
3451
|
-
var countryCode = this.countryCode;
|
|
3452
|
-
var phoneNumber = countryCode ? Object(external_libphonenumber_js_["getExampleNumber"])(countryCode, examples_mobile_json_default.a) : null;
|
|
3453
|
-
return phoneNumber ? phoneNumber.formatNational() : null;
|
|
3454
|
-
},
|
|
3455
|
-
hintValue: function hintValue() {
|
|
3456
|
-
var noExample = this.noExample,
|
|
3457
|
-
phoneNumberExample = this.phoneNumberExample,
|
|
3458
|
-
hasEmptyPhone = this.hasEmptyPhone,
|
|
3459
|
-
isValid = this.isValid,
|
|
3460
|
-
t = this.t;
|
|
3461
|
-
return noExample || !phoneNumberExample ? null : hasEmptyPhone || isValid ? null : "".concat(t.example, " ").concat(phoneNumberExample);
|
|
3462
|
-
},
|
|
3463
|
-
// Countries list management
|
|
3464
|
-
countriesList: function countriesList() {
|
|
3465
|
-
var _this2 = this;
|
|
3466
|
-
|
|
3467
|
-
return countries.filter(function (item) {
|
|
3468
|
-
return !_this2.ignoredCountries.includes(item.iso2);
|
|
3469
|
-
});
|
|
3470
|
-
},
|
|
3471
|
-
countriesFiltered: function countriesFiltered() {
|
|
3472
|
-
var _this3 = this;
|
|
3473
|
-
|
|
3474
|
-
var countries = this.onlyCountries || this.preferredCountries;
|
|
3475
|
-
return countries.map(function (country) {
|
|
3476
|
-
return _this3.countriesList.find(function (item) {
|
|
3477
|
-
return item.iso2.includes(country);
|
|
3478
|
-
});
|
|
3479
|
-
});
|
|
3480
|
-
},
|
|
3481
|
-
otherCountries: function otherCountries() {
|
|
3482
|
-
var _this4 = this;
|
|
3483
|
-
|
|
3484
|
-
return this.countriesList.filter(function (item) {
|
|
3485
|
-
return !_this4.preferredCountries.includes(item.iso2);
|
|
3486
|
-
});
|
|
3487
|
-
},
|
|
3488
|
-
countriesSorted: function countriesSorted() {
|
|
3489
|
-
return this.preferredCountries ? [].concat(_toConsumableArray(this.countriesFiltered), _toConsumableArray(this.otherCountries)) : this.onlyCountries ? this.countriesFiltered : this.countriesList;
|
|
3490
|
-
}
|
|
3491
|
-
},
|
|
3492
|
-
watch: {
|
|
3493
|
-
defaultPhoneNumber: {
|
|
3494
|
-
handler: function handler(phoneNumber, oldPhoneNumber) {
|
|
3495
|
-
if (phoneNumber === oldPhoneNumber) return;
|
|
3496
|
-
this.buildResults(phoneNumber);
|
|
3497
|
-
},
|
|
3498
|
-
immediate: true
|
|
3499
|
-
},
|
|
3500
|
-
defaultCountryCode: {
|
|
3501
|
-
handler: function handler(newValue, oldValue) {
|
|
3502
|
-
if (!newValue || newValue === oldValue) return;
|
|
3503
|
-
this.setCountryCode(newValue);
|
|
3504
|
-
},
|
|
3505
|
-
immediate: true
|
|
3506
|
-
}
|
|
3507
|
-
},
|
|
3508
|
-
mounted: function mounted() {
|
|
3509
|
-
var _this5 = this;
|
|
3510
|
-
|
|
3511
|
-
return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
|
|
3512
|
-
var defaultCountryCode, fetchCountry, noUseBrowserLocale, setCountryCode, locale;
|
|
3513
|
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
3514
|
-
while (1) {
|
|
3515
|
-
switch (_context.prev = _context.next) {
|
|
3516
|
-
case 0:
|
|
3517
|
-
_context.prev = 0;
|
|
3518
|
-
defaultCountryCode = _this5.defaultCountryCode, fetchCountry = _this5.fetchCountry, noUseBrowserLocale = _this5.noUseBrowserLocale, setCountryCode = _this5.setCountryCode;
|
|
3519
|
-
if (!_this5.defaultPhoneNumber && _this5.value) _this5.buildResults(_this5.value);
|
|
3520
|
-
|
|
3521
|
-
if (!(defaultCountryCode && fetchCountry)) {
|
|
3522
|
-
_context.next = 5;
|
|
3523
|
-
break;
|
|
3524
|
-
}
|
|
3525
|
-
|
|
3526
|
-
throw new Error('MazPhoneNumberInput: Do not use \'fetch-country\' and \'default-country-code\' options in the same time');
|
|
3527
|
-
|
|
3528
|
-
case 5:
|
|
3529
|
-
if (!(defaultCountryCode && noUseBrowserLocale)) {
|
|
3530
|
-
_context.next = 7;
|
|
3531
|
-
break;
|
|
3532
|
-
}
|
|
3533
|
-
|
|
3534
|
-
throw new Error('MazPhoneNumberInput: If you use a \'default-country-code\', do not use \'no-use-browser-locale\' options');
|
|
3535
|
-
|
|
3536
|
-
case 7:
|
|
3537
|
-
if (!defaultCountryCode) {
|
|
3538
|
-
_context.next = 9;
|
|
3539
|
-
break;
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
return _context.abrupt("return");
|
|
3543
|
-
|
|
3544
|
-
case 9:
|
|
3545
|
-
if (!fetchCountry) {
|
|
3546
|
-
_context.next = 15;
|
|
3547
|
-
break;
|
|
3548
|
-
}
|
|
3549
|
-
|
|
3550
|
-
_context.next = 12;
|
|
3551
|
-
return fetchCountryCode();
|
|
3552
|
-
|
|
3553
|
-
case 12:
|
|
3554
|
-
_context.t0 = _context.sent;
|
|
3555
|
-
_context.next = 23;
|
|
3556
|
-
break;
|
|
3557
|
-
|
|
3558
|
-
case 15:
|
|
3559
|
-
if (!noUseBrowserLocale) {
|
|
3560
|
-
_context.next = 19;
|
|
3561
|
-
break;
|
|
3562
|
-
}
|
|
3563
|
-
|
|
3564
|
-
_context.t1 = null;
|
|
3565
|
-
_context.next = 22;
|
|
3566
|
-
break;
|
|
3567
|
-
|
|
3568
|
-
case 19:
|
|
3569
|
-
_context.next = 21;
|
|
3570
|
-
return browserLocale();
|
|
3571
|
-
|
|
3572
|
-
case 21:
|
|
3573
|
-
_context.t1 = _context.sent;
|
|
3574
|
-
|
|
3575
|
-
case 22:
|
|
3576
|
-
_context.t0 = _context.t1;
|
|
3577
|
-
|
|
3578
|
-
case 23:
|
|
3579
|
-
locale = _context.t0;
|
|
3580
|
-
if (locale) setCountryCode(locale);
|
|
3581
|
-
_context.next = 30;
|
|
3582
|
-
break;
|
|
3583
|
-
|
|
3584
|
-
case 27:
|
|
3585
|
-
_context.prev = 27;
|
|
3586
|
-
_context.t2 = _context["catch"](0);
|
|
3587
|
-
throw new Error(_context.t2);
|
|
3588
|
-
|
|
3589
|
-
case 30:
|
|
3590
|
-
case "end":
|
|
3591
|
-
return _context.stop();
|
|
3592
|
-
}
|
|
3593
|
-
}
|
|
3594
|
-
}, _callee, null, [[0, 27]]);
|
|
3595
|
-
}))();
|
|
3596
|
-
},
|
|
3597
|
-
methods: {
|
|
3598
|
-
buildResults: function buildResults(phoneNumber, noAutoUpdateCountryCode) {
|
|
3599
|
-
var _this6 = this;
|
|
3600
|
-
|
|
3601
|
-
return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
|
|
3602
|
-
var countryCode, value, hasDeletedCharac, _this6$results, isValid, e164, cursorIsAtEnd, shouldUseAsYouType, valueToEmit;
|
|
3603
|
-
|
|
3604
|
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
|
3605
|
-
while (1) {
|
|
3606
|
-
switch (_context2.prev = _context2.next) {
|
|
3607
|
-
case 0:
|
|
3608
|
-
countryCode = _this6.countryCode, value = _this6.value;
|
|
3609
|
-
_context2.next = 3;
|
|
3610
|
-
return _this6.$nextTick();
|
|
3611
|
-
|
|
3612
|
-
case 3:
|
|
3613
|
-
hasDeletedCharac = _this6.asYouTypeNumber && phoneNumber && _this6.asYouTypeNumber.length > phoneNumber.length;
|
|
3614
|
-
_this6.results = utils_getResultsFromPhoneNumber(phoneNumber, countryCode);
|
|
3615
|
-
_this6$results = _this6.results, isValid = _this6$results.isValid, e164 = _this6$results.e164;
|
|
3616
|
-
cursorIsAtEnd = _this6.asYouTypeNumber && _this6.cursorPosition ? _this6.cursorPosition + 1 >= _this6.asYouTypeNumber.length : true;
|
|
3617
|
-
shouldUseAsYouType = !hasDeletedCharac && cursorIsAtEnd || isValid;
|
|
3618
|
-
_this6.asYouTypeNumber = shouldUseAsYouType ? utils_getAsYouTypeFormat(phoneNumber, countryCode) : phoneNumber;
|
|
3619
|
-
|
|
3620
|
-
if (!noAutoUpdateCountryCode && _this6.results && _this6.results.countryCode && countryCode !== _this6.results.countryCode) {
|
|
3621
|
-
_this6.setCountryCode(_this6.results.countryCode);
|
|
3622
|
-
} // sent when the user tape
|
|
3623
|
-
// @arg Object with all parsed values
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
_this6.$emit('update', _this6.results);
|
|
3627
|
-
|
|
3628
|
-
valueToEmit = isValid ? e164 : _this6.asYouTypeNumber;
|
|
3629
|
-
|
|
3630
|
-
if (!(!valueToEmit && valueToEmit === value)) {
|
|
3631
|
-
_context2.next = 14;
|
|
3632
|
-
break;
|
|
3633
|
-
}
|
|
3634
|
-
|
|
3635
|
-
return _context2.abrupt("return");
|
|
3636
|
-
|
|
3637
|
-
case 14:
|
|
3638
|
-
// sent when the user tape
|
|
3639
|
-
// @arg Phone number value formatted in e164 format (international format)
|
|
3640
|
-
_this6.$emit('input', valueToEmit);
|
|
3641
|
-
|
|
3642
|
-
case 15:
|
|
3643
|
-
case "end":
|
|
3644
|
-
return _context2.stop();
|
|
3645
|
-
}
|
|
3646
|
-
}
|
|
3647
|
-
}, _callee2);
|
|
3648
|
-
}))();
|
|
3649
|
-
},
|
|
3650
|
-
onBlur: function onBlur(event) {
|
|
3651
|
-
this.$emit('blur', event);
|
|
3652
|
-
|
|
3653
|
-
if (this.countryCode) {
|
|
3654
|
-
this.asYouTypeNumber = utils_getAsYouTypeFormat(this.asYouTypeNumber, this.countryCode);
|
|
3655
|
-
}
|
|
3656
|
-
},
|
|
3657
|
-
onKeydown: function onKeydown(event) {
|
|
3658
|
-
var target = event.target;
|
|
3659
|
-
this.cursorPosition = target === null || target === void 0 ? void 0 : target.selectionStart;
|
|
3660
|
-
},
|
|
3661
|
-
setCountryCode: function setCountryCode(locale, focusPhoneNumberInput) {
|
|
3662
|
-
var _this7 = this;
|
|
3663
|
-
|
|
3664
|
-
return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
|
|
3665
|
-
var buildResults, asYouTypeNumber, countryAvailable;
|
|
3666
|
-
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
|
3667
|
-
while (1) {
|
|
3668
|
-
switch (_context3.prev = _context3.next) {
|
|
3669
|
-
case 0:
|
|
3670
|
-
buildResults = _this7.buildResults, asYouTypeNumber = _this7.asYouTypeNumber;
|
|
3671
|
-
countryAvailable = isCountryAvailable(locale);
|
|
3672
|
-
|
|
3673
|
-
if (focusPhoneNumberInput) {
|
|
3674
|
-
_this7.focusPhoneNumberInput();
|
|
3675
|
-
|
|
3676
|
-
if (asYouTypeNumber && asYouTypeNumber.includes('+')) _this7.asYouTypeNumber = null;
|
|
3677
|
-
}
|
|
3678
|
-
|
|
3679
|
-
if (countryAvailable && locale) {
|
|
3680
|
-
_this7.countryCode = locale;
|
|
3681
|
-
buildResults(_this7.asYouTypeNumber, true);
|
|
3682
|
-
}
|
|
3683
|
-
|
|
3684
|
-
case 4:
|
|
3685
|
-
case "end":
|
|
3686
|
-
return _context3.stop();
|
|
3687
|
-
}
|
|
3688
|
-
}
|
|
3689
|
-
}, _callee3);
|
|
3690
|
-
}))();
|
|
3691
|
-
},
|
|
3692
|
-
focusCountrySelector: function focusCountrySelector() {
|
|
3693
|
-
var _this8 = this;
|
|
3694
|
-
|
|
3695
|
-
return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
|
|
3696
|
-
return regenerator_default.a.wrap(function _callee4$(_context4) {
|
|
3697
|
-
while (1) {
|
|
3698
|
-
switch (_context4.prev = _context4.next) {
|
|
3699
|
-
case 0:
|
|
3700
|
-
_context4.next = 2;
|
|
3701
|
-
return _this8.$nextTick();
|
|
3702
|
-
|
|
3703
|
-
case 2:
|
|
3704
|
-
_this8.$refs.CountrySelector.$el.querySelector('input').focus();
|
|
3705
|
-
|
|
3706
|
-
case 3:
|
|
3707
|
-
case "end":
|
|
3708
|
-
return _context4.stop();
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3711
|
-
}, _callee4);
|
|
3712
|
-
}))();
|
|
3713
|
-
},
|
|
3714
|
-
focusPhoneNumberInput: function focusPhoneNumberInput() {
|
|
3715
|
-
var _this9 = this;
|
|
3716
|
-
|
|
3717
|
-
return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee5() {
|
|
3718
|
-
return regenerator_default.a.wrap(function _callee5$(_context5) {
|
|
3719
|
-
while (1) {
|
|
3720
|
-
switch (_context5.prev = _context5.next) {
|
|
3721
|
-
case 0:
|
|
3722
|
-
_context5.next = 2;
|
|
3723
|
-
return _this9.$nextTick();
|
|
3724
|
-
|
|
3725
|
-
case 2:
|
|
3726
|
-
_this9.$refs.PhoneNumberInput.$el.querySelector('input').focus();
|
|
3727
|
-
|
|
3728
|
-
case 3:
|
|
3729
|
-
case "end":
|
|
3730
|
-
return _context5.stop();
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3733
|
-
}, _callee5);
|
|
3734
|
-
}))();
|
|
3735
|
-
}
|
|
3736
|
-
}
|
|
3737
|
-
});
|
|
3738
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue?vue&type=script&lang=js&
|
|
3739
|
-
/* harmony default export */ var MazPhoneNumberInput_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
|
|
3740
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
3741
|
-
var componentNormalizer = __webpack_require__(0);
|
|
3742
|
-
|
|
3743
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
/* normalize component */
|
|
3750
|
-
|
|
3751
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
3752
|
-
MazPhoneNumberInput_mainvue_type_script_lang_js_,
|
|
3753
|
-
render,
|
|
3754
|
-
staticRenderFns,
|
|
3755
|
-
false,
|
|
3756
|
-
null,
|
|
3757
|
-
null,
|
|
3758
|
-
null
|
|
3759
|
-
|
|
3760
|
-
)
|
|
3761
|
-
|
|
3762
|
-
/* hot reload */
|
|
3763
|
-
if (false) { var api; }
|
|
3764
|
-
component.options.__file = "packages/components/MazPhoneNumberInput/_main.vue"
|
|
3765
|
-
/* harmony default export */ var _main = (component.exports);
|
|
3766
|
-
// CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/index.js
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
_main.install = function (Vue) {
|
|
3770
|
-
Vue.component(_main.name, _main);
|
|
3771
|
-
};
|
|
3772
|
-
|
|
3773
|
-
/* harmony default export */ var MazPhoneNumberInput = __webpack_exports__["default"] = (_main);
|
|
3774
|
-
|
|
3775
|
-
/***/ })
|
|
3776
|
-
/******/ ]);
|