maz-ui 2.3.10 → 3.0.0-beta.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.
Files changed (198) hide show
  1. package/dist/cjs/index.js +1 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/dist/cjs/no_photo-4ae7c0fa.js +1 -0
  4. package/dist/cjs/no_photo-4ae7c0fa.js.map +1 -0
  5. package/dist/index.js +16 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/main.css +1454 -0
  8. package/dist/no_photo-a72545e4.js +2 -0
  9. package/dist/no_photo-a72545e4.js.map +1 -0
  10. package/dist/package.json +136 -0
  11. package/dist/types/components/MazArrowIcon.vue.d.ts +37 -0
  12. package/dist/types/components/MazAvatar.vue.d.ts +110 -0
  13. package/dist/types/components/MazBackDrop.vue.d.ts +90 -0
  14. package/dist/types/components/MazBottomSheet.vue.d.ts +31 -0
  15. package/dist/types/components/MazBtn.vue.d.ts +120 -0
  16. package/dist/types/components/MazCard.vue.d.ts +149 -0
  17. package/dist/types/components/MazCheckbox.vue.d.ts +40 -0
  18. package/dist/types/components/MazDialog.vue.d.ts +15 -0
  19. package/dist/types/components/MazDropzone/index.vue.d.ts +90 -0
  20. package/dist/types/components/MazGallery.vue.d.ts +117 -0
  21. package/dist/types/components/MazIcon.vue.d.ts +63 -0
  22. package/dist/types/components/MazInput.vue.d.ts +206 -0
  23. package/dist/types/components/MazInputPrice.vue.d.ts +47 -0
  24. package/dist/types/components/MazLazyImg.vue.d.ts +69 -0
  25. package/dist/types/components/MazPhoneNumberInput/constantes/locales.d.ts +11 -0
  26. package/dist/types/components/MazPhoneNumberInput/index.vue.d.ts +195 -0
  27. package/dist/types/components/MazPhoneNumberInput/types.d.ts +19 -0
  28. package/dist/types/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +3 -0
  29. package/dist/types/components/MazPhoneNumberInput/utils/index.d.ts +15 -0
  30. package/dist/types/components/MazSelect.vue.d.ts +110 -0
  31. package/dist/types/components/MazSpinner.vue.d.ts +25 -0
  32. package/dist/types/components/MazTransitionExpand.vue.d.ts +4 -0
  33. package/dist/types/components/index.d.ts +18 -0
  34. package/dist/types/components/types.d.ts +50 -0
  35. package/dist/types/components_tmp/MazCalendar/types.d.ts +16 -0
  36. package/dist/types/components_tmp/MazChart/includes.d.ts +11 -0
  37. package/dist/types/components_tmp/MazMap/map-module/create-html-marker.d.ts +18 -0
  38. package/dist/types/components_tmp/MazMap/map-module/map.d.ts +43 -0
  39. package/dist/types/components_tmp/MazMap/map-module/script-loader.d.ts +17 -0
  40. package/dist/types/components_tmp/MazPromiseDialog/use-maz-promise-dialog.d.ts +28 -0
  41. package/dist/types/components_tmp/MazSlider/utils.d.ts +15 -0
  42. package/dist/types/components_tmp/MazTabs/maz-tabs.composable.d.ts +3 -0
  43. package/dist/types/components_tmp/toaster/index.d.ts +3 -0
  44. package/dist/types/components_tmp/toaster/positions.d.ts +8 -0
  45. package/dist/types/components_tmp/toaster/timer.d.ts +11 -0
  46. package/dist/types/components_tmp/toaster/use-toast.d.ts +21 -0
  47. package/dist/types/directives/click-outside.directive.d.ts +10 -0
  48. package/dist/types/directives/closable.directive.d.ts +5 -0
  49. package/dist/types/directives/index.d.ts +4 -0
  50. package/dist/types/directives/v-lazy-img/index.d.ts +9 -0
  51. package/dist/types/directives/v-lazy-img/lazy-img-handler.d.ts +38 -0
  52. package/dist/types/directives/v-lazy-img/lazy-img.directive.d.ts +3 -0
  53. package/dist/types/directives/v-lazy-img/types.d.ts +51 -0
  54. package/dist/types/directives/zoom-img.directive.d.ts +5 -0
  55. package/dist/types/filters/capitalize.d.ts +1 -0
  56. package/dist/types/filters/currency.d.ts +5 -0
  57. package/dist/types/filters/date.d.ts +1 -0
  58. package/dist/types/filters/index.d.ts +5 -0
  59. package/dist/types/filters/number.d.ts +1 -0
  60. package/dist/types/filters/telephone.d.ts +1 -0
  61. package/dist/types/index.d.ts +7 -0
  62. package/dist/types/index.esm.d.ts +8 -0
  63. package/dist/types/utils/debounce.d.ts +7 -0
  64. package/dist/types/utils/index.d.ts +1 -0
  65. package/dist/types/utils/injectStrict.d.ts +1 -0
  66. package/package.json +103 -84
  67. package/LICENSE +0 -21
  68. package/README.md +0 -66
  69. package/bin/index.js +0 -63
  70. package/bin/lib/_constantes/default-colors.js +0 -69
  71. package/bin/lib/index.d.ts +0 -2
  72. package/bin/lib/index.js +0 -145
  73. package/bin/lib/methods/generate-root-css.js +0 -49
  74. package/bin/lib/methods/get-theme-settings.js +0 -58
  75. package/bin/lib/methods/set-css-vars.js +0 -11
  76. package/lib/css/base.css +0 -1
  77. package/lib/css/index.css +0 -1
  78. package/lib/css/maz-avatar.css +0 -1
  79. package/lib/css/maz-bottom-sheet.css +0 -1
  80. package/lib/css/maz-btn-group.css +0 -1
  81. package/lib/css/maz-btn.css +0 -0
  82. package/lib/css/maz-card.css +0 -1
  83. package/lib/css/maz-carousel.css +0 -1
  84. package/lib/css/maz-checkbox.css +0 -1
  85. package/lib/css/maz-collapse.css +0 -1
  86. package/lib/css/maz-dialog.css +0 -1
  87. package/lib/css/maz-draggable-list.css +0 -1
  88. package/lib/css/maz-dropdown.css +0 -1
  89. package/lib/css/maz-dropzone.css +0 -1
  90. package/lib/css/maz-flex.css +0 -0
  91. package/lib/css/maz-gallery.css +0 -0
  92. package/lib/css/maz-img.css +0 -1
  93. package/lib/css/maz-input-tags.css +0 -1
  94. package/lib/css/maz-input.css +0 -0
  95. package/lib/css/maz-list-item.css +0 -1
  96. package/lib/css/maz-list.css +0 -1
  97. package/lib/css/maz-loader.css +0 -0
  98. package/lib/css/maz-pagination.css +0 -1
  99. package/lib/css/maz-phone-number-input.css +0 -1
  100. package/lib/css/maz-picker.css +0 -1
  101. package/lib/css/maz-plotly.css +0 -0
  102. package/lib/css/maz-progress-bar.css +0 -1
  103. package/lib/css/maz-radio.css +0 -1
  104. package/lib/css/maz-read-more.css +0 -1
  105. package/lib/css/maz-responsive-menu.css +0 -1
  106. package/lib/css/maz-search.css +0 -1
  107. package/lib/css/maz-select.css +0 -0
  108. package/lib/css/maz-sidebar.css +0 -1
  109. package/lib/css/maz-slider.css +0 -1
  110. package/lib/css/maz-spinner.css +0 -0
  111. package/lib/css/maz-stepper.css +0 -1
  112. package/lib/css/maz-switch.css +0 -1
  113. package/lib/css/maz-tabs-bar.css +0 -1
  114. package/lib/css/maz-tabs-content-item.css +0 -1
  115. package/lib/css/maz-tabs-content.css +0 -1
  116. package/lib/css/maz-transition-expand.css +0 -0
  117. package/lib/index.d.ts +0 -1
  118. package/lib/index.js +0 -1
  119. package/lib/maz-avatar.d.ts +0 -3
  120. package/lib/maz-avatar.js +0 -430
  121. package/lib/maz-bottom-sheet.d.ts +0 -3
  122. package/lib/maz-bottom-sheet.js +0 -1046
  123. package/lib/maz-btn-group.d.ts +0 -3
  124. package/lib/maz-btn-group.js +0 -908
  125. package/lib/maz-btn.d.ts +0 -3
  126. package/lib/maz-btn.js +0 -765
  127. package/lib/maz-card.d.ts +0 -3
  128. package/lib/maz-card.js +0 -571
  129. package/lib/maz-carousel.d.ts +0 -3
  130. package/lib/maz-carousel.js +0 -569
  131. package/lib/maz-checkbox.d.ts +0 -3
  132. package/lib/maz-checkbox.js +0 -359
  133. package/lib/maz-collapse.d.ts +0 -3
  134. package/lib/maz-collapse.js +0 -1239
  135. package/lib/maz-dialog.d.ts +0 -3
  136. package/lib/maz-dialog.js +0 -1315
  137. package/lib/maz-draggable-list.d.ts +0 -3
  138. package/lib/maz-draggable-list.js +0 -439
  139. package/lib/maz-dropdown.d.ts +0 -3
  140. package/lib/maz-dropdown.js +0 -438
  141. package/lib/maz-dropzone.d.ts +0 -3
  142. package/lib/maz-dropzone.js +0 -664
  143. package/lib/maz-flex.d.ts +0 -3
  144. package/lib/maz-flex.js +0 -427
  145. package/lib/maz-gallery.d.ts +0 -3
  146. package/lib/maz-gallery.js +0 -673
  147. package/lib/maz-img.d.ts +0 -3
  148. package/lib/maz-img.js +0 -613
  149. package/lib/maz-input-tags.d.ts +0 -3
  150. package/lib/maz-input-tags.js +0 -1208
  151. package/lib/maz-input.d.ts +0 -3
  152. package/lib/maz-input.js +0 -1076
  153. package/lib/maz-list-item.d.ts +0 -3
  154. package/lib/maz-list-item.js +0 -304
  155. package/lib/maz-list.d.ts +0 -3
  156. package/lib/maz-list.js +0 -331
  157. package/lib/maz-loader.d.ts +0 -3
  158. package/lib/maz-loader.js +0 -304
  159. package/lib/maz-pagination.d.ts +0 -3
  160. package/lib/maz-pagination.js +0 -1415
  161. package/lib/maz-phone-number-input.d.ts +0 -3
  162. package/lib/maz-phone-number-input.js +0 -3778
  163. package/lib/maz-picker.d.ts +0 -3
  164. package/lib/maz-picker.js +0 -6472
  165. package/lib/maz-plotly.d.ts +0 -3
  166. package/lib/maz-plotly.js +0 -500
  167. package/lib/maz-progress-bar.d.ts +0 -3
  168. package/lib/maz-progress-bar.js +0 -398
  169. package/lib/maz-radio.d.ts +0 -3
  170. package/lib/maz-radio.js +0 -358
  171. package/lib/maz-read-more.d.ts +0 -3
  172. package/lib/maz-read-more.js +0 -344
  173. package/lib/maz-responsive-menu.d.ts +0 -3
  174. package/lib/maz-responsive-menu.js +0 -438
  175. package/lib/maz-search.d.ts +0 -3
  176. package/lib/maz-search.js +0 -1590
  177. package/lib/maz-select.d.ts +0 -3
  178. package/lib/maz-select.js +0 -2743
  179. package/lib/maz-sidebar.d.ts +0 -3
  180. package/lib/maz-sidebar.js +0 -815
  181. package/lib/maz-slider.d.ts +0 -3
  182. package/lib/maz-slider.js +0 -1014
  183. package/lib/maz-spinner.d.ts +0 -3
  184. package/lib/maz-spinner.js +0 -329
  185. package/lib/maz-stepper.d.ts +0 -3
  186. package/lib/maz-stepper.js +0 -1012
  187. package/lib/maz-switch.d.ts +0 -3
  188. package/lib/maz-switch.js +0 -375
  189. package/lib/maz-tabs-bar.d.ts +0 -3
  190. package/lib/maz-tabs-bar.js +0 -428
  191. package/lib/maz-tabs-content-item.d.ts +0 -3
  192. package/lib/maz-tabs-content-item.js +0 -376
  193. package/lib/maz-tabs-content.d.ts +0 -3
  194. package/lib/maz-tabs-content.js +0 -367
  195. package/lib/maz-transition-expand.d.ts +0 -3
  196. package/lib/maz-transition-expand.js +0 -328
  197. package/lib/maz-ui.common.d.ts +0 -1
  198. package/lib/maz-ui.common.js +0 -17200
@@ -1,3778 +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" && Symbol.iterator in Object(iter)) 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:
678
- "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"
679
- }
680
- })
681
- ]
682
- )
683
- }
684
- var staticRenderFns = []
685
- render._withStripped = true
686
-
687
-
688
- // CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue?vue&type=template&id=67a8ca41&
689
-
690
- // 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&
691
- //
692
- //
693
- //
694
- //
695
- //
696
- //
697
- //
698
- //
699
- //
700
- //
701
- //
702
- //
703
- //
704
- //
705
- //
706
- //
707
- //
708
- //
709
- //
710
- //
711
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
712
- name: 'MazSpinner',
713
- props: {
714
- size: {
715
- type: Number,
716
- default: 40
717
- },
718
- dark: {
719
- type: Boolean,
720
- default: false
721
- },
722
- color: {
723
- type: String,
724
- default: 'primary'
725
- }
726
- },
727
- computed: {
728
- fillColorClass: function fillColorClass() {
729
- return "maz-fill-".concat(this.color);
730
- }
731
- }
732
- });
733
- // CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue?vue&type=script&lang=js&
734
- /* harmony default export */ var MazSpinner_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
735
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
736
- var componentNormalizer = __webpack_require__(0);
737
-
738
- // CONCATENATED MODULE: ./packages/components/MazSpinner/_main.vue
739
-
740
-
741
-
742
-
743
-
744
- /* normalize component */
745
-
746
- var component = Object(componentNormalizer["a" /* default */])(
747
- MazSpinner_mainvue_type_script_lang_js_,
748
- render,
749
- staticRenderFns,
750
- false,
751
- null,
752
- null,
753
- null
754
-
755
- )
756
-
757
- /* hot reload */
758
- if (false) { var api; }
759
- component.options.__file = "packages/components/MazSpinner/_main.vue"
760
- /* harmony default export */ var _main = (component.exports);
761
- // CONCATENATED MODULE: ./packages/components/MazSpinner/index.js
762
-
763
-
764
- _main.install = function (Vue) {
765
- Vue.component(_main.name, _main);
766
- };
767
-
768
- /* harmony default export */ var MazSpinner = __webpack_exports__["default"] = (_main);
769
-
770
- /***/ }),
771
- /* 6 */
772
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
773
-
774
- "use strict";
775
-
776
- // EXPORTS
777
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ debounce; });
778
- __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ pascalCaseToKebabCase; });
779
-
780
- // CONCATENATED MODULE: ./packages/utils/debounce.js
781
- /* harmony default export */ var debounce = (function (func, delay) {
782
- var debounceTimer;
783
- return function () {
784
- var context = this;
785
- var args = arguments;
786
- clearTimeout(debounceTimer);
787
- debounceTimer = setTimeout(function () {
788
- return func.apply(context, args);
789
- }, delay);
790
- };
791
- });
792
- // CONCATENATED MODULE: ./packages/utils/pascalCaseToKebabCase.js
793
- /* harmony default export */ var pascalCaseToKebabCase = (function (string) {
794
- return string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2').toLowerCase();
795
- });
796
- // CONCATENATED MODULE: ./packages/utils/index.js
797
-
798
-
799
-
800
- /***/ }),
801
- /* 7 */,
802
- /* 8 */
803
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
804
-
805
- "use strict";
806
- // ESM COMPAT FLAG
807
- __webpack_require__.r(__webpack_exports__);
808
-
809
- // 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&
810
- var render = function() {
811
- var _vm = this
812
- var _h = _vm.$createElement
813
- var _c = _vm._self._c || _h
814
- return _c(
815
- "div",
816
- {
817
- ref: "parent",
818
- staticClass:
819
- "maz-base-component maz-input maz-border maz-border-color maz-border-color-hover maz-border-solid maz-border-radius",
820
- class: [
821
- {
822
- "is-focused": _vm.isFocus || _vm.focus,
823
- "is-valid": _vm.success,
824
- "has-value": _vm.value,
825
- "is-textarea": _vm.textarea,
826
- "has-error": _vm.error,
827
- "has-warning": _vm.warning,
828
- "is-disabled": _vm.disabled,
829
- "maz-is-dark": _vm.dark,
830
- "has-hint": _vm.hint,
831
- "has-no-label": !_vm.hasLabel && !_vm.hint,
832
- "has-left-icon": _vm.hasLeftIcon()
833
- },
834
- "maz-input--" + _vm.size,
835
- "has-" + _vm.leftNumberIcon + "-right-icon",
836
- "maz-input--" + _vm.color
837
- ],
838
- on: { click: _vm.focusInput }
839
- },
840
- [
841
- _vm.hasLeftIcon()
842
- ? _c(
843
- "div",
844
- {
845
- staticClass: "maz-input__icon maz-flex left",
846
- class: [
847
- _vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center"
848
- ]
849
- },
850
- [
851
- _vm._t("icon-left", function() {
852
- return [
853
- _c("i", { staticClass: "material-icons" }, [
854
- _vm._v(_vm._s(_vm.leftIconName))
855
- ])
856
- ]
857
- })
858
- ],
859
- 2
860
- )
861
- : _vm._e(),
862
- _vm.hasRightIcon()
863
- ? _c(
864
- "div",
865
- {
866
- staticClass: "maz-input__icon maz-flex right",
867
- class: [
868
- _vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center"
869
- ]
870
- },
871
- [
872
- _vm._t("icon-right", function() {
873
- return [
874
- _c("i", { staticClass: "material-icons" }, [
875
- _vm._v(_vm._s(_vm.rightIconName))
876
- ])
877
- ]
878
- })
879
- ],
880
- 2
881
- )
882
- : _vm._e(),
883
- _vm.getType === "checkbox" && !_vm.textarea
884
- ? _c(
885
- "input",
886
- _vm._b(
887
- {
888
- directives: [
889
- {
890
- name: "model",
891
- rawName: "v-model",
892
- value: _vm.inputValue,
893
- expression: "inputValue"
894
- }
895
- ],
896
- ref: "MazInput",
897
- staticClass: "maz-input__input maz-border-radius",
898
- class: {
899
- "has-right-icon":
900
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon()
901
- },
902
- attrs: {
903
- id: _vm.uniqueId,
904
- placeholder: _vm.placeholderValue,
905
- "aria-label": _vm.placeholder,
906
- disabled: _vm.disabled,
907
- required: _vm.required,
908
- readonly: _vm.readonly,
909
- type: "checkbox"
910
- },
911
- domProps: {
912
- checked: Array.isArray(_vm.inputValue)
913
- ? _vm._i(_vm.inputValue, null) > -1
914
- : _vm.inputValue
915
- },
916
- on: {
917
- keydown: _vm.keyDown,
918
- keyup: _vm.keyUp,
919
- focus: _vm.onFocus,
920
- blur: _vm.onBlur,
921
- paste: _vm.onPaste,
922
- change: [
923
- function($event) {
924
- var $$a = _vm.inputValue,
925
- $$el = $event.target,
926
- $$c = $$el.checked ? true : false
927
- if (Array.isArray($$a)) {
928
- var $$v = null,
929
- $$i = _vm._i($$a, $$v)
930
- if ($$el.checked) {
931
- $$i < 0 && (_vm.inputValue = $$a.concat([$$v]))
932
- } else {
933
- $$i > -1 &&
934
- (_vm.inputValue = $$a
935
- .slice(0, $$i)
936
- .concat($$a.slice($$i + 1)))
937
- }
938
- } else {
939
- _vm.inputValue = $$c
940
- }
941
- },
942
- _vm.onChange
943
- ],
944
- click: function($event) {
945
- return _vm.$emit("click", $event)
946
- }
947
- }
948
- },
949
- "input",
950
- _vm.$attrs,
951
- false
952
- )
953
- )
954
- : _vm.getType === "radio" && !_vm.textarea
955
- ? _c(
956
- "input",
957
- _vm._b(
958
- {
959
- directives: [
960
- {
961
- name: "model",
962
- rawName: "v-model",
963
- value: _vm.inputValue,
964
- expression: "inputValue"
965
- }
966
- ],
967
- ref: "MazInput",
968
- staticClass: "maz-input__input maz-border-radius",
969
- class: {
970
- "has-right-icon":
971
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon()
972
- },
973
- attrs: {
974
- id: _vm.uniqueId,
975
- placeholder: _vm.placeholderValue,
976
- "aria-label": _vm.placeholder,
977
- disabled: _vm.disabled,
978
- required: _vm.required,
979
- readonly: _vm.readonly,
980
- type: "radio"
981
- },
982
- domProps: { checked: _vm._q(_vm.inputValue, null) },
983
- on: {
984
- keydown: _vm.keyDown,
985
- keyup: _vm.keyUp,
986
- focus: _vm.onFocus,
987
- blur: _vm.onBlur,
988
- paste: _vm.onPaste,
989
- change: [
990
- function($event) {
991
- _vm.inputValue = null
992
- },
993
- _vm.onChange
994
- ],
995
- click: function($event) {
996
- return _vm.$emit("click", $event)
997
- }
998
- }
999
- },
1000
- "input",
1001
- _vm.$attrs,
1002
- false
1003
- )
1004
- )
1005
- : !_vm.textarea
1006
- ? _c(
1007
- "input",
1008
- _vm._b(
1009
- {
1010
- directives: [
1011
- {
1012
- name: "model",
1013
- rawName: "v-model",
1014
- value: _vm.inputValue,
1015
- expression: "inputValue"
1016
- }
1017
- ],
1018
- ref: "MazInput",
1019
- staticClass: "maz-input__input maz-border-radius",
1020
- class: {
1021
- "has-right-icon":
1022
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon()
1023
- },
1024
- attrs: {
1025
- id: _vm.uniqueId,
1026
- placeholder: _vm.placeholderValue,
1027
- "aria-label": _vm.placeholder,
1028
- disabled: _vm.disabled,
1029
- required: _vm.required,
1030
- readonly: _vm.readonly,
1031
- type: _vm.getType
1032
- },
1033
- domProps: { value: _vm.inputValue },
1034
- on: {
1035
- keydown: _vm.keyDown,
1036
- keyup: _vm.keyUp,
1037
- focus: _vm.onFocus,
1038
- blur: _vm.onBlur,
1039
- paste: _vm.onPaste,
1040
- change: _vm.onChange,
1041
- click: function($event) {
1042
- return _vm.$emit("click", $event)
1043
- },
1044
- input: function($event) {
1045
- if ($event.target.composing) {
1046
- return
1047
- }
1048
- _vm.inputValue = $event.target.value
1049
- }
1050
- }
1051
- },
1052
- "input",
1053
- _vm.$attrs,
1054
- false
1055
- )
1056
- )
1057
- : _c(
1058
- "textarea",
1059
- _vm._b(
1060
- {
1061
- directives: [
1062
- {
1063
- name: "model",
1064
- rawName: "v-model",
1065
- value: _vm.inputValue,
1066
- expression: "inputValue"
1067
- }
1068
- ],
1069
- ref: "MazInput",
1070
- staticClass: "maz-input__input maz-textarea",
1071
- attrs: {
1072
- id: _vm.uniqueId,
1073
- placeholder: _vm.placeholderValue,
1074
- type: _vm.type,
1075
- required: _vm.required,
1076
- readonly: _vm.readonly
1077
- },
1078
- domProps: { value: _vm.inputValue },
1079
- on: {
1080
- keydown: _vm.keyDown,
1081
- keyup: _vm.keyUp,
1082
- focus: _vm.onFocus,
1083
- blur: _vm.onBlur,
1084
- paste: _vm.onPaste,
1085
- change: _vm.onChange,
1086
- click: function($event) {
1087
- return _vm.$emit("click", $event)
1088
- },
1089
- input: function($event) {
1090
- if ($event.target.composing) {
1091
- return
1092
- }
1093
- _vm.inputValue = $event.target.value
1094
- }
1095
- }
1096
- },
1097
- "textarea",
1098
- _vm.$attrs,
1099
- false
1100
- )
1101
- ),
1102
- _vm.hasLabel || _vm.hint
1103
- ? _c(
1104
- "label",
1105
- {
1106
- ref: "label",
1107
- staticClass: "maz-input__label",
1108
- class: _vm.error ? "maz-text-danger" : null,
1109
- attrs: { for: _vm.uniqueId, tabindex: "-1" },
1110
- on: { click: _vm.focusInput }
1111
- },
1112
- [
1113
- _vm._v(
1114
- "\n " +
1115
- _vm._s(_vm.hintValue || _vm.placeholderValue) +
1116
- "\n "
1117
- )
1118
- ]
1119
- )
1120
- : _vm._e(),
1121
- _c("transition-group", { attrs: { name: "maz-scale" } }, [
1122
- _vm.hasClearBtn
1123
- ? _c(
1124
- "button",
1125
- {
1126
- key: "clear-button",
1127
- staticClass:
1128
- "maz-input__toggle-btn --clear maz-flex maz-flex-center",
1129
- class: { "has-right-icon": _vm.hasRightIcon() },
1130
- attrs: { title: "clear", type: "button", tabindex: "-1" },
1131
- on: {
1132
- click: function($event) {
1133
- $event.stopPropagation()
1134
- return _vm.clear.apply(null, arguments)
1135
- }
1136
- }
1137
- },
1138
- [
1139
- _c(
1140
- "i",
1141
- { staticClass: "maz-input__toggle-btn__icon material-icons" },
1142
- [_vm._v("\n close\n ")]
1143
- )
1144
- ]
1145
- )
1146
- : _vm._e(),
1147
- _vm.hasPasswordBtn
1148
- ? _c(
1149
- "button",
1150
- {
1151
- key: "password-button",
1152
- staticClass:
1153
- "maz-input__toggle-btn password maz-flex maz-flex-center",
1154
- class: {
1155
- "has-clear-btn": _vm.hasClearBtn,
1156
- "has-right-icon": _vm.hasRightIcon()
1157
- },
1158
- attrs: { title: "clear", type: "button", tabindex: "-1" },
1159
- on: {
1160
- click: function($event) {
1161
- _vm.showPassword = !_vm.showPassword
1162
- }
1163
- }
1164
- },
1165
- [
1166
- _c(
1167
- "i",
1168
- { staticClass: "maz-input__toggle-btn__icon material-icons" },
1169
- [
1170
- _vm._v(
1171
- "\n " +
1172
- _vm._s(
1173
- _vm.showPassword ? "visibility_off" : "visibility"
1174
- ) +
1175
- "\n "
1176
- )
1177
- ]
1178
- )
1179
- ]
1180
- )
1181
- : _vm._e()
1182
- ]),
1183
- _vm.loading
1184
- ? _c(
1185
- "div",
1186
- {
1187
- staticClass: "maz-input__loader",
1188
- class: { textarea: _vm.textarea }
1189
- },
1190
- [_c("div", { staticClass: "maz-input__loader__progress-bar" })]
1191
- )
1192
- : _vm._e()
1193
- ],
1194
- 1
1195
- )
1196
- }
1197
- var staticRenderFns = []
1198
- render._withStripped = true
1199
-
1200
-
1201
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=template&id=5b617c72&
1202
-
1203
- // EXTERNAL MODULE: ./packages/mixins/uniqueId.js
1204
- var uniqueId = __webpack_require__(2);
1205
-
1206
- // EXTERNAL MODULE: ./packages/utils/index.js + 2 modules
1207
- var utils = __webpack_require__(6);
1208
-
1209
- // 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&
1210
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
-
1360
- var DEBOUNCE = 500;
1361
- /**
1362
- * > Beautiful input UI with loading & error manager
1363
- */
1364
-
1365
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
1366
- name: 'MazInput',
1367
- mixins: [uniqueId["a" /* default */]],
1368
- props: {
1369
- // value of the input
1370
- value: {
1371
- validator: function validator(prop) {
1372
- return ['string', 'number'].includes(_typeof(prop)) || prop === null;
1373
- },
1374
- default: null
1375
- },
1376
- // input id
1377
- id: {
1378
- type: String,
1379
- default: null
1380
- },
1381
- // value of the input
1382
- placeholder: {
1383
- type: String,
1384
- default: 'Enter text'
1385
- },
1386
- // replace the label if is present
1387
- hint: {
1388
- type: String,
1389
- default: null
1390
- },
1391
- // input size (`'lg'` / `'sm'`)
1392
- size: {
1393
- type: String,
1394
- default: null
1395
- },
1396
- // is the input size (`text` or `number`)
1397
- type: {
1398
- type: String,
1399
- default: 'text'
1400
- },
1401
- // should be a [material icon](https://material.io/resources/icons/) name
1402
- leftIconName: {
1403
- type: String,
1404
- default: null
1405
- },
1406
- // should be a [material icon](https://material.io/resources/icons/) name
1407
- rightIconName: {
1408
- type: String,
1409
- default: null
1410
- },
1411
- // When is `true` the input has the error style
1412
- error: {
1413
- type: Boolean,
1414
- default: false
1415
- },
1416
- // When is `true` the input has the warning style
1417
- warning: {
1418
- type: Boolean,
1419
- default: false
1420
- },
1421
- // When is `true` the input is disable
1422
- disabled: {
1423
- type: Boolean,
1424
- default: false
1425
- },
1426
- // When is `true` the input has the dark theme
1427
- dark: {
1428
- type: Boolean,
1429
- default: false
1430
- },
1431
- // When is `true` the input is on readonly mode
1432
- readonly: {
1433
- type: Boolean,
1434
- default: false
1435
- },
1436
- // When is `true` the input has the valid style
1437
- success: {
1438
- type: Boolean,
1439
- default: false
1440
- },
1441
- // When is `true` the input become required & has the `*` symbol
1442
- required: {
1443
- type: Boolean,
1444
- default: false
1445
- },
1446
- // When is `true` the input is a textarea
1447
- textarea: {
1448
- type: Boolean,
1449
- default: false
1450
- },
1451
- // When is `true` the input has a progress bar animated
1452
- loading: {
1453
- type: Boolean,
1454
- default: false
1455
- },
1456
- // When is `true` the input can be clear with a button on the right
1457
- clearable: {
1458
- type: Boolean,
1459
- default: false
1460
- },
1461
- // When is `true` the input has not label (top placeholder when value is not empty)
1462
- noLabel: {
1463
- type: Boolean,
1464
- default: false
1465
- },
1466
- // When is `true` and is `required`, the `*` symbol is not showing
1467
- noRequiredSymbol: {
1468
- type: Boolean,
1469
- default: false
1470
- },
1471
- // force focus style input
1472
- focus: {
1473
- type: Boolean,
1474
- default: false
1475
- },
1476
- // color name in basic colors
1477
- color: {
1478
- type: String,
1479
- default: 'primary'
1480
- },
1481
- // Add a debounce of 500ms to emit the value
1482
- debounce: {
1483
- type: Boolean,
1484
- default: false
1485
- }
1486
- },
1487
- data: function data() {
1488
- return {
1489
- isFocus: false,
1490
- showPassword: false
1491
- };
1492
- },
1493
- computed: {
1494
- inputValue: {
1495
- get: function get() {
1496
- return this.value;
1497
- },
1498
- set: function set(value) {
1499
- var valueToEmit = this.hasNumberType ? !value ? 0 : parseInt(value) : value;
1500
- this.emitValue(valueToEmit);
1501
- }
1502
- },
1503
- placeholderValue: function placeholderValue() {
1504
- var placeholder = this.placeholder;
1505
- if (this.required && placeholder && !this.noRequiredSymbol) placeholder += ' *';
1506
- return placeholder;
1507
- },
1508
- hintValue: function hintValue() {
1509
- var hint = this.hint;
1510
- if (this.required && hint) hint += ' *';
1511
- return hint;
1512
- },
1513
- hasNumberType: function hasNumberType() {
1514
- return this.type === 'number';
1515
- },
1516
- hasLabel: function hasLabel() {
1517
- return !this.noLabel;
1518
- },
1519
- getType: function getType() {
1520
- return this.showPassword ? 'text' : this.type;
1521
- },
1522
- hasPasswordBtn: function hasPasswordBtn() {
1523
- return this.type === 'password' && this.inputValue;
1524
- },
1525
- hasClearBtn: function hasClearBtn() {
1526
- return this.clearable && this.inputValue && !this.textarea;
1527
- },
1528
- leftNumberIcon: function leftNumberIcon() {
1529
- var array = [!!this.hasRightIcon(), !!this.hasClearBtn, !!this.hasPasswordBtn];
1530
- return array.filter(function (a) {
1531
- return a;
1532
- }).length;
1533
- }
1534
- },
1535
- methods: {
1536
- debounceValue: Object(utils["a" /* debounce */])(function (value) {
1537
- // return the input value (in `@input` or `v-model`)
1538
- // @arg input
1539
- this.$emit('input', value);
1540
- }, DEBOUNCE),
1541
- emitValue: function emitValue(value) {
1542
- if (this.debounce) return this.debounceValue(value);
1543
- this.$emit('input', value);
1544
- },
1545
- hasLeftIcon: function hasLeftIcon() {
1546
- return this.leftIconName || this.$slots['icon-left'];
1547
- },
1548
- hasRightIcon: function hasRightIcon() {
1549
- return this.rightIconName || this.$slots['icon-right'];
1550
- },
1551
- focusInput: function focusInput() {
1552
- this.$refs.MazInput.focus();
1553
- },
1554
- onFocus: function onFocus(e) {
1555
- // sent the focus event
1556
- // @arg event
1557
- this.$emit('focus', e);
1558
- this.isFocus = true;
1559
- },
1560
- onBlur: function onBlur(e) {
1561
- // sent the blur event
1562
- // @arg event
1563
- this.$emit('blur', e);
1564
- this.isFocus = false;
1565
- },
1566
- onPaste: function onPaste(e) {
1567
- // sent when text is past in the textfield
1568
- // @arg event
1569
- this.$emit('paste', e);
1570
- },
1571
- onChange: function onChange(e) {
1572
- // sent on input change
1573
- // @arg event
1574
- this.$emit('change', e);
1575
- },
1576
- clear: function clear() {
1577
- this.$emit('input', this.hasNumberType ? 0 : ''); // sent when the input is clear
1578
-
1579
- this.$emit('clear');
1580
- },
1581
- keyUp: function keyUp(e) {
1582
- // sent the keyup event
1583
- // @arg event
1584
- this.$emit('keyup', e);
1585
- },
1586
- keyDown: function keyDown(e) {
1587
- // sent the keydown event
1588
- // @arg event
1589
- this.$emit('keydown', e);
1590
- }
1591
- }
1592
- });
1593
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=script&lang=js&
1594
- /* harmony default export */ var MazInput_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
1595
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1596
- var componentNormalizer = __webpack_require__(0);
1597
-
1598
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue
1599
-
1600
-
1601
-
1602
-
1603
-
1604
- /* normalize component */
1605
-
1606
- var component = Object(componentNormalizer["a" /* default */])(
1607
- MazInput_mainvue_type_script_lang_js_,
1608
- render,
1609
- staticRenderFns,
1610
- false,
1611
- null,
1612
- null,
1613
- null
1614
-
1615
- )
1616
-
1617
- /* hot reload */
1618
- if (false) { var api; }
1619
- component.options.__file = "packages/components/MazInput/_main.vue"
1620
- /* harmony default export */ var _main = (component.exports);
1621
- // CONCATENATED MODULE: ./packages/components/MazInput/index.js
1622
-
1623
-
1624
- _main.install = function (Vue) {
1625
- Vue.component(_main.name, _main);
1626
- };
1627
-
1628
- /* harmony default export */ var MazInput = __webpack_exports__["default"] = (_main);
1629
-
1630
- /***/ }),
1631
- /* 9 */
1632
- /***/ (function(module, exports) {
1633
-
1634
- module.exports = require("regenerator-runtime");
1635
-
1636
- /***/ }),
1637
- /* 10 */,
1638
- /* 11 */
1639
- /***/ (function(module, exports) {
1640
-
1641
- module.exports = require("libphonenumber-js");
1642
-
1643
- /***/ }),
1644
- /* 12 */,
1645
- /* 13 */,
1646
- /* 14 */,
1647
- /* 15 */,
1648
- /* 16 */
1649
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1650
-
1651
- "use strict";
1652
- // ESM COMPAT FLAG
1653
- __webpack_require__.r(__webpack_exports__);
1654
-
1655
- // 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&
1656
- var render = function() {
1657
- var _vm = this
1658
- var _h = _vm.$createElement
1659
- var _c = _vm._self._c || _h
1660
- return _c(
1661
- "div",
1662
- {
1663
- staticClass: "maz-base-component maz-select",
1664
- class: [
1665
- {
1666
- "has-list-open": _vm.hasOpenList,
1667
- "maz-is-dark": _vm.dark
1668
- },
1669
- "maz-select--" + _vm.color,
1670
- "maz-select--" + _vm.size
1671
- ],
1672
- on: {
1673
- "!blur": function($event) {
1674
- return _vm.closeList($event)
1675
- }
1676
- }
1677
- },
1678
- [
1679
- _vm.multiple
1680
- ? _c(
1681
- "div",
1682
- {
1683
- ref: "SelectedTags",
1684
- staticClass: "maz-select__tags maz-flex maz-align-center",
1685
- class: {
1686
- "maz-left-offset": _vm.hasLeftIcon
1687
- }
1688
- },
1689
- [
1690
- _c(
1691
- "transition-group",
1692
- {
1693
- ref: "SelectedTagsContainer",
1694
- staticClass: "maz-flex maz-align-center maz-h-100",
1695
- attrs: { tag: "div", name: "maz-tags" }
1696
- },
1697
- _vm._l(_vm.selectedOptions, function(option, i) {
1698
- return _c(
1699
- "MazBtn",
1700
- {
1701
- key: "tags-" + i,
1702
- staticClass: "maz-select__tag maz-flex maz-align-center",
1703
- attrs: {
1704
- disabled: _vm.disabled,
1705
- color: _vm.color,
1706
- size: _vm.size
1707
- },
1708
- on: {
1709
- click: function($event) {
1710
- $event.preventDefault()
1711
- $event.stopPropagation()
1712
- return _vm.removeOption(option[_vm.config.valueKey])
1713
- }
1714
- }
1715
- },
1716
- [
1717
- _c("span", { staticClass: "maz-select__tag__text" }, [
1718
- _vm._v(
1719
- "\n " +
1720
- _vm._s(option[_vm.config.labelKey]) +
1721
- "\n "
1722
- )
1723
- ]),
1724
- _c(
1725
- "i",
1726
- {
1727
- staticClass: "maz-select__tag__clear material-icons"
1728
- },
1729
- [_vm._v("\n close\n ")]
1730
- )
1731
- ]
1732
- )
1733
- }),
1734
- 1
1735
- )
1736
- ],
1737
- 1
1738
- )
1739
- : _vm._e(),
1740
- _c(
1741
- "MazInput",
1742
- _vm._b(
1743
- {
1744
- ref: "textField",
1745
- attrs: {
1746
- value: _vm.valueShown,
1747
- readonly: "",
1748
- "no-label": _vm.hasNoLabel,
1749
- color: _vm.color,
1750
- size: _vm.size,
1751
- placeholder: _vm.placeholderShown,
1752
- disabled: _vm.disabled,
1753
- focus: _vm.hasOpenList
1754
- },
1755
- on: {
1756
- clear: function($event) {
1757
- return _vm.emitValues(null)
1758
- },
1759
- keydown: function($event) {
1760
- _vm.search ? null : _vm.keyboardNav($event)
1761
- },
1762
- keyup: function($event) {
1763
- return _vm.$emit("keyup", $event)
1764
- },
1765
- blur: function($event) {
1766
- return _vm.$emit("blur", $event)
1767
- },
1768
- change: function($event) {
1769
- return _vm.$emit("change", $event)
1770
- },
1771
- paste: function($event) {
1772
- return _vm.$emit("paste", $event)
1773
- },
1774
- click: function($event) {
1775
- return _vm.$emit("click", $event)
1776
- },
1777
- focus: _vm.openList
1778
- }
1779
- },
1780
- "MazInput",
1781
- _vm.$attrs,
1782
- false
1783
- ),
1784
- [
1785
- _vm._t("icon-left", null, { slot: "icon-left" }),
1786
- _c(
1787
- "div",
1788
- {
1789
- staticClass: "maz-select__toggle maz-flex maz-flex-center",
1790
- attrs: { slot: "icon-right", tabindex: "-1" },
1791
- slot: "icon-right"
1792
- },
1793
- [
1794
- _vm._t("arrow", function() {
1795
- return [
1796
- _c(
1797
- "svg",
1798
- {
1799
- staticClass: "maz-select__toggle__arrow",
1800
- attrs: {
1801
- mlns: "http://www.w3.org/2000/svg",
1802
- width: "24",
1803
- height: "24",
1804
- viewBox: "0 0 24 24"
1805
- }
1806
- },
1807
- [
1808
- _c("path", {
1809
- staticClass: "arrow",
1810
- attrs: {
1811
- d:
1812
- "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
1813
- }
1814
- }),
1815
- _c("path", {
1816
- attrs: { fill: "none", d: "M0 0h24v24H0V0z" }
1817
- })
1818
- ]
1819
- )
1820
- ]
1821
- })
1822
- ],
1823
- 2
1824
- )
1825
- ],
1826
- 2
1827
- ),
1828
- _c("transition", { attrs: { name: _vm.listTransition } }, [
1829
- _c(
1830
- "div",
1831
- {
1832
- directives: [
1833
- {
1834
- name: "show",
1835
- rawName: "v-show",
1836
- value: _vm.hasOpenList,
1837
- expression: "hasOpenList"
1838
- }
1839
- ],
1840
- staticClass: "maz-select__options-list maz-flex maz-elevation",
1841
- class: [
1842
- _vm.hasPositionTop
1843
- ? "maz-select__options-list--top maz-direction-column-reverse"
1844
- : "maz-direction-column",
1845
- { "maz-select__options-list--right": _vm.hasPositionRight }
1846
- ],
1847
- style: [_vm.itemListSize]
1848
- },
1849
- [
1850
- _vm.search
1851
- ? _c("MazInput", {
1852
- ref: "SearchInput",
1853
- staticClass: "maz-m-1",
1854
- attrs: {
1855
- color: _vm.color,
1856
- value: _vm.searchQuery,
1857
- placeholder: _vm.searchPlaceholder,
1858
- size: "sm",
1859
- "no-label": "",
1860
- name: "new_search_in_options",
1861
- autocomplete: "off"
1862
- },
1863
- on: {
1864
- input: _vm.searchInOptions,
1865
- keydown: [
1866
- _vm.keyboardNav,
1867
- function($event) {
1868
- if (
1869
- !$event.type.indexOf("key") &&
1870
- _vm._k($event.keyCode, "esc", 27, $event.key, [
1871
- "Esc",
1872
- "Escape"
1873
- ])
1874
- ) {
1875
- return null
1876
- }
1877
- return _vm.closeList.apply(null, arguments)
1878
- }
1879
- ]
1880
- }
1881
- })
1882
- : _vm._e(),
1883
- _c(
1884
- "div",
1885
- {
1886
- ref: "optionsList",
1887
- staticClass:
1888
- "maz-select__options-list__items maz-flex maz-direction-column"
1889
- },
1890
- [
1891
- _vm._l(_vm.optionsShown, function(option, i) {
1892
- return _c(
1893
- "button",
1894
- {
1895
- key: i,
1896
- staticClass:
1897
- "maz-select__options-list__item flex maz-align-center maz-text-left",
1898
- class: [
1899
- {
1900
- selected:
1901
- _vm.values.length &&
1902
- _vm.values.includes(option[_vm.config.valueKey])
1903
- },
1904
- {
1905
- "keyboard-selected":
1906
- _vm.tmpValue === option[_vm.config.valueKey]
1907
- }
1908
- ],
1909
- style: [_vm.optionHeight],
1910
- attrs: { tabindex: "-1", type: "button" },
1911
- on: {
1912
- click: function($event) {
1913
- $event.preventDefault()
1914
- $event.stopPropagation()
1915
- return _vm.updateValue(option[_vm.config.valueKey])
1916
- }
1917
- }
1918
- },
1919
- [
1920
- _vm._t(
1921
- "default",
1922
- function() {
1923
- return [
1924
- _c(
1925
- "span",
1926
- {
1927
- staticClass: "maz-dots-text",
1928
- class: [
1929
- {
1930
- "maz-text-muted": !option[
1931
- _vm.config.valueKey
1932
- ]
1933
- },
1934
- _vm.values.includes(
1935
- option[_vm.config.valueKey]
1936
- )
1937
- ? "maz-text-white"
1938
- : "maz-text-color"
1939
- ]
1940
- },
1941
- [
1942
- _vm._v(
1943
- "\n " +
1944
- _vm._s(option[_vm.config.labelKey]) +
1945
- "\n "
1946
- )
1947
- ]
1948
- )
1949
- ]
1950
- },
1951
- {
1952
- option: Object.assign({}, option, {
1953
- isSelected: _vm.values.includes(
1954
- option[_vm.config.valueKey]
1955
- )
1956
- }),
1957
- tag: "div"
1958
- }
1959
- )
1960
- ],
1961
- 2
1962
- )
1963
- }),
1964
- !_vm.optionsShown.length
1965
- ? _vm._t(
1966
- "no-results",
1967
- function() {
1968
- return [
1969
- _c(
1970
- "div",
1971
- {
1972
- staticClass:
1973
- "maz-select__options-list__no-results maz-p-1 maz-flex maz-flex-center"
1974
- },
1975
- [
1976
- _c(
1977
- "i",
1978
- {
1979
- staticClass: "material-icons maz-text-danger"
1980
- },
1981
- [
1982
- _vm._v(
1983
- "\n search_off\n "
1984
- )
1985
- ]
1986
- )
1987
- ]
1988
- )
1989
- ]
1990
- },
1991
- { tag: "div" }
1992
- )
1993
- : _vm._e()
1994
- ],
1995
- 2
1996
- )
1997
- ],
1998
- 1
1999
- )
2000
- ])
2001
- ],
2002
- 1
2003
- )
2004
- }
2005
- var staticRenderFns = []
2006
- render._withStripped = true
2007
-
2008
-
2009
- // CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue?vue&type=template&id=2fb08d76&
2010
-
2011
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
2012
- var regenerator = __webpack_require__(1);
2013
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
2014
-
2015
- // EXTERNAL MODULE: ./packages/components/MazInput/index.js + 5 modules
2016
- var MazInput = __webpack_require__(8);
2017
-
2018
- // EXTERNAL MODULE: ./packages/components/MazBtn/index.js + 5 modules
2019
- var MazBtn = __webpack_require__(4);
2020
-
2021
- // EXTERNAL MODULE: ./packages/mixins/uniqueId.js
2022
- var uniqueId = __webpack_require__(2);
2023
-
2024
- // 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&
2025
-
2026
-
2027
- 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); } }
2028
-
2029
- 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); }); }; }
2030
-
2031
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2032
-
2033
- 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."); }
2034
-
2035
- 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); }
2036
-
2037
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
2038
-
2039
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2040
-
2041
- 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; }
2042
-
2043
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
-
2218
-
2219
- /**
2220
- * > Beautiful select input
2221
- */
2222
-
2223
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
2224
- name: 'MazSelect',
2225
- components: {
2226
- MazInput: MazInput["default"],
2227
- MazBtn: MazBtn["default"]
2228
- },
2229
- mixins: [uniqueId["a" /* default */]],
2230
- props: {
2231
- // is the value of the input
2232
- value: {
2233
- required: true,
2234
- validator: function validator(prop) {
2235
- return ['number', 'string', 'boolean'].includes(_typeof(prop)) || Array.isArray(prop) || prop === null;
2236
- }
2237
- },
2238
- // list of the options
2239
- options: {
2240
- type: Array,
2241
- required: true
2242
- },
2243
- // When is `true` the select is disabled
2244
- disabled: {
2245
- type: Boolean,
2246
- default: false
2247
- },
2248
- // When is `true` the select has the dark style
2249
- dark: {
2250
- type: Boolean,
2251
- default: false
2252
- },
2253
- // Item in list height in pixel
2254
- itemHeight: {
2255
- type: Number,
2256
- default: 35
2257
- },
2258
- // List height in pixel
2259
- listHeight: {
2260
- type: Number,
2261
- default: 260
2262
- },
2263
- // List width in pixel or percent (:list-width="100", list-width="100%")
2264
- listWidth: {
2265
- type: [Number, String],
2266
- default: null
2267
- },
2268
- // The select has no label in the input
2269
- placeholder: {
2270
- type: String,
2271
- default: 'Select option'
2272
- },
2273
- // When is `true` the select you select multiple values
2274
- noLabel: {
2275
- type: Boolean,
2276
- default: false
2277
- },
2278
- // When is `true` the select you select multiple values
2279
- multiple: {
2280
- type: Boolean,
2281
- default: false
2282
- },
2283
- // When is `true` the select has an input to search in options
2284
- search: {
2285
- type: Boolean,
2286
- default: false
2287
- },
2288
- // the search input placeholder
2289
- searchPlaceholder: {
2290
- type: String,
2291
- default: 'Search in options'
2292
- },
2293
- // the search input placeholder
2294
- color: {
2295
- type: String,
2296
- default: 'primary'
2297
- },
2298
- // input size
2299
- size: {
2300
- type: String,
2301
- default: 'md'
2302
- },
2303
- // When is `true` the option list is open
2304
- open: {
2305
- type: Boolean,
2306
- default: false
2307
- },
2308
- // set the position of option list (`top`, `top right`, `bottom right`)
2309
- position: {
2310
- type: String,
2311
- default: 'left bottom'
2312
- },
2313
- // set label key and value key - Ex: `{ labelKey: '<your_object_key>', valueKey: '<your_object_key>', searchKey: '<your_object_key>' }`
2314
- config: {
2315
- type: Object,
2316
- default: function _default() {
2317
- return {
2318
- labelKey: 'label',
2319
- valueKey: 'value',
2320
- searchKey: 'label'
2321
- };
2322
- }
2323
- },
2324
- // force value shown on input
2325
- inputValue: {
2326
- type: String,
2327
- default: null
2328
- }
2329
- },
2330
- data: function data() {
2331
- return {
2332
- listIsOpen: false,
2333
- query: '',
2334
- tmpValue: null,
2335
- searchQuery: null,
2336
- filteredOptions: null
2337
- };
2338
- },
2339
- computed: {
2340
- hasPositionTop: function hasPositionTop() {
2341
- return this.position.includes('top');
2342
- },
2343
- hasPositionRight: function hasPositionRight() {
2344
- return this.position.includes('right');
2345
- },
2346
- listTransition: function listTransition() {
2347
- return this.position.includes('bottom') ? 'maz-slide' : 'maz-slideinvert';
2348
- },
2349
- hasOpenList: function hasOpenList() {
2350
- return this.open || this.listIsOpen;
2351
- },
2352
- values: function values() {
2353
- var multiple = this.multiple,
2354
- value = this.value,
2355
- options = this.options;
2356
- if (!options) throw new Error('[MazSelect] options should be provide');
2357
- if (multiple && !Array.isArray(value) && value !== null) throw new Error('[MazSelect] value should be an array or null');
2358
- if (!multiple && Array.isArray(value)) throw new Error('[MazSelect] value should be a string, a number or null');
2359
- return value ? multiple ? _toConsumableArray(value) : [value] : [];
2360
- },
2361
- hasLeftIcon: function hasLeftIcon() {
2362
- return this.$attrs.leftIconName || this.$slots['icon-left'];
2363
- },
2364
- placeholderShown: function placeholderShown() {
2365
- var placeholder = this.placeholder,
2366
- multiple = this.multiple,
2367
- values = this.values;
2368
- return multiple && values.length ? null : placeholder;
2369
- },
2370
- hasNoLabel: function hasNoLabel() {
2371
- return this.multiple || this.noLabel;
2372
- },
2373
- optionHeight: function optionHeight() {
2374
- return {
2375
- height: "".concat(this.itemHeight, "px"),
2376
- flex: "0 0 ".concat(this.itemHeight, "px")
2377
- };
2378
- },
2379
- itemListSize: function itemListSize() {
2380
- var listHeight = this.listHeight,
2381
- listWidth = this.listWidth;
2382
- var width = !Number.isInteger(listWidth) ? listWidth : "".concat(listWidth, "px");
2383
- return {
2384
- maxHeight: "".concat(listHeight, "px"),
2385
- width: width,
2386
- maxWidth: width
2387
- };
2388
- },
2389
- tmpValueIndex: function tmpValueIndex() {
2390
- var config = this.config,
2391
- tmpValue = this.tmpValue,
2392
- optionsShown = this.optionsShown;
2393
- return optionsShown.findIndex(function (c) {
2394
- return c[config.valueKey] === tmpValue;
2395
- });
2396
- },
2397
- selectedValueIndex: function selectedValueIndex() {
2398
- var values = this.values,
2399
- options = this.options,
2400
- config = this.config;
2401
- return values.length ? options.findIndex(function (c) {
2402
- return c[config.valueKey] === values[values.length - 1];
2403
- }) : null;
2404
- },
2405
- valueShown: function valueShown() {
2406
- if (this.inputValue) return this.inputValue;
2407
- var multiple = this.multiple,
2408
- options = this.options,
2409
- values = this.values,
2410
- value = this.value,
2411
- config = this.config;
2412
- var valueSelected = options.find(function (o) {
2413
- return o[config.valueKey] === value;
2414
- });
2415
- var result = valueSelected && valueSelected[config.valueKey] && !multiple ? valueSelected[config.labelKey] : values[0] ? ' ' : null;
2416
- return result;
2417
- },
2418
- optionsShown: function optionsShown() {
2419
- return this.filteredOptions || this.options;
2420
- },
2421
- selectedOptions: function selectedOptions() {
2422
- var values = this.values,
2423
- options = this.options,
2424
- config = this.config;
2425
- var optionsSelected = [];
2426
- values.forEach(function (v) {
2427
- return optionsSelected.push(options.find(function (o) {
2428
- return v === o[config.valueKey];
2429
- }));
2430
- });
2431
- return optionsSelected;
2432
- }
2433
- },
2434
- watch: {
2435
- value: {
2436
- handler: function handler() {
2437
- var multiple = this.multiple;
2438
- if (multiple) this.scrollTags();
2439
- },
2440
- immediate: true
2441
- }
2442
- },
2443
- methods: {
2444
- scrollTags: function scrollTags() {
2445
- var _this = this;
2446
-
2447
- return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
2448
- var _SelectedTagsContaine, _SelectedTagsContaine2;
2449
-
2450
- var _this$$refs, SelectedTags, SelectedTagsContainer;
2451
-
2452
- return regenerator_default.a.wrap(function _callee$(_context) {
2453
- while (1) {
2454
- switch (_context.prev = _context.next) {
2455
- case 0:
2456
- _context.next = 2;
2457
- return _this.$nextTick();
2458
-
2459
- case 2:
2460
- _this$$refs = _this.$refs, SelectedTags = _this$$refs.SelectedTags, SelectedTagsContainer = _this$$refs.SelectedTagsContainer;
2461
- 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;
2462
-
2463
- case 4:
2464
- case "end":
2465
- return _context.stop();
2466
- }
2467
- }
2468
- }, _callee);
2469
- }))();
2470
- },
2471
- removeOption: function removeOption(value) {
2472
- var values = this.values,
2473
- multiple = this.multiple;
2474
- var leftValues = values.filter(function (v) {
2475
- return v !== value;
2476
- });
2477
- var valueToReturn = leftValues.length ? multiple ? leftValues : leftValues[0] : null;
2478
- this.emitValues(valueToReturn);
2479
- },
2480
- closeList: function closeList() {
2481
- var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2482
- if (this.$el.contains(e.relatedTarget)) return e.preventDefault();
2483
- this.$emit('close');
2484
- this.listIsOpen = false;
2485
- this.isFocus = false;
2486
- },
2487
- openList: function openList(e) {
2488
- this.$emit('focus', e);
2489
- var disabled = this.disabled,
2490
- search = this.search,
2491
- values = this.values;
2492
-
2493
- if (!disabled) {
2494
- if (disabled) return; // sent when the list is open
2495
-
2496
- this.$emit('open');
2497
- this.isFocus = true;
2498
- this.listIsOpen = true;
2499
- this.selectFirstValue();
2500
- if (search) this.focusSearchInput();
2501
- if (values.length) this.scrollToSelectedOnFocus(this.selectedValueIndex);
2502
- }
2503
- },
2504
- clearSearch: function clearSearch() {
2505
- this.searchQuery = null;
2506
- this.filteredOptions = null;
2507
- },
2508
- reset: function reset() {
2509
- var _this2 = this;
2510
-
2511
- return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
2512
- return regenerator_default.a.wrap(function _callee2$(_context2) {
2513
- while (1) {
2514
- switch (_context2.prev = _context2.next) {
2515
- case 0:
2516
- _this2.clearSearch();
2517
-
2518
- if (!_this2.multiple) {
2519
- _context2.next = 3;
2520
- break;
2521
- }
2522
-
2523
- return _context2.abrupt("return");
2524
-
2525
- case 3:
2526
- _this2.closeList();
2527
-
2528
- case 4:
2529
- case "end":
2530
- return _context2.stop();
2531
- }
2532
- }
2533
- }, _callee2);
2534
- }))();
2535
- },
2536
- selectFirstValue: function selectFirstValue() {
2537
- var multiple = this.multiple,
2538
- value = this.value,
2539
- options = this.options,
2540
- config = this.config;
2541
- if (value || multiple) return;
2542
- var valueToReturn = options[0][config.valueKey] || null;
2543
- this.tmpValue = valueToReturn;
2544
- this.emitValues(valueToReturn, true);
2545
- },
2546
- updateValue: function updateValue(value) {
2547
- var multiple = this.multiple,
2548
- values = this.values,
2549
- removeOption = this.removeOption;
2550
- if (values.includes(value) && multiple) return removeOption(value);
2551
- this.tmpValue = value;
2552
- if (value) values.push(value);
2553
- var valueToReturn = multiple && value ? values : value;
2554
- this.emitValues(valueToReturn);
2555
- },
2556
- focusSearchInput: function focusSearchInput() {
2557
- var _this3 = this;
2558
-
2559
- return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
2560
- var SearchInput;
2561
- return regenerator_default.a.wrap(function _callee3$(_context3) {
2562
- while (1) {
2563
- switch (_context3.prev = _context3.next) {
2564
- case 0:
2565
- _context3.next = 2;
2566
- return _this3.$nextTick();
2567
-
2568
- case 2:
2569
- SearchInput = _this3.$refs.SearchInput;
2570
- SearchInput.$el.querySelector('input').focus();
2571
-
2572
- case 4:
2573
- case "end":
2574
- return _context3.stop();
2575
- }
2576
- }
2577
- }, _callee3);
2578
- }))();
2579
- },
2580
- emitValues: function emitValues(values, noReset) {
2581
- var _this4 = this;
2582
-
2583
- return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
2584
- return regenerator_default.a.wrap(function _callee4$(_context4) {
2585
- while (1) {
2586
- switch (_context4.prev = _context4.next) {
2587
- case 0:
2588
- // return the select input
2589
- // @arg the option value selected
2590
- _this4.$emit('input', values);
2591
-
2592
- if (!noReset) {
2593
- _context4.next = 3;
2594
- break;
2595
- }
2596
-
2597
- return _context4.abrupt("return");
2598
-
2599
- case 3:
2600
- _context4.next = 5;
2601
- return _this4.$nextTick();
2602
-
2603
- case 5:
2604
- _this4.reset();
2605
-
2606
- case 6:
2607
- case "end":
2608
- return _context4.stop();
2609
- }
2610
- }
2611
- }, _callee4);
2612
- }))();
2613
- },
2614
- scrollToSelectedOnFocus: function scrollToSelectedOnFocus(arrayIndex) {
2615
- var _this5 = this;
2616
-
2617
- return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee5() {
2618
- return regenerator_default.a.wrap(function _callee5$(_context5) {
2619
- while (1) {
2620
- switch (_context5.prev = _context5.next) {
2621
- case 0:
2622
- _context5.next = 2;
2623
- return _this5.$nextTick();
2624
-
2625
- case 2:
2626
- _this5.$refs.optionsList.scrollTop = arrayIndex * _this5.itemHeight - _this5.itemHeight * 3;
2627
-
2628
- case 3:
2629
- case "end":
2630
- return _context5.stop();
2631
- }
2632
- }
2633
- }, _callee5);
2634
- }))();
2635
- },
2636
- keyboardNav: function keyboardNav(e) {
2637
- var code = e.keyCode;
2638
- var hasOpenList = this.hasOpenList,
2639
- tmpValueIndex = this.tmpValueIndex,
2640
- optionsShown = this.optionsShown,
2641
- openList = this.openList,
2642
- tmpValue = this.tmpValue,
2643
- search = this.search,
2644
- config = this.config;
2645
-
2646
- if (code === 40 || code === 38) {
2647
- e.preventDefault();
2648
- if (!hasOpenList) openList();
2649
- var index = code === 40 ? tmpValueIndex + 1 : tmpValueIndex - 1;
2650
-
2651
- if (index === -1 || index >= optionsShown.length) {
2652
- index = index === -1 ? optionsShown.length - 1 : 0;
2653
- }
2654
-
2655
- this.tmpValue = optionsShown[index][config.valueKey];
2656
- this.scrollToSelectedOnFocus(index);
2657
- } else if (code === 13) {
2658
- // enter key
2659
- e.preventDefault();
2660
- hasOpenList ? this.updateValue(tmpValue) : this.openList();
2661
- } else if (code === 27) {
2662
- // escape key
2663
- this.closeList();
2664
- } else if (!search) {
2665
- // typing an option's name
2666
- this.searching(e);
2667
- }
2668
- },
2669
- searching: function searching(e) {
2670
- var _this6 = this;
2671
-
2672
- var config = this.config,
2673
- options = this.options;
2674
- var code = e.keyCode;
2675
- clearTimeout(queryTimer);
2676
- var queryTimer = setTimeout(function () {
2677
- _this6.query = '';
2678
- }, 2000);
2679
- var q = String.fromCharCode(code);
2680
-
2681
- if (code === 8 && this.query !== '') {
2682
- this.query = this.query.substring(0, this.query.length - 1);
2683
- } else if (/[a-zA-Z-e ]/.test(q)) {
2684
- if (!this.hasOpenList) this.openList();
2685
- this.query += q.toLowerCase();
2686
- var resultIndex = options.findIndex(function (o) {
2687
- _this6.tmpValue = o[config.valueKey];
2688
- return o[config.searchKey].toLowerCase().includes(_this6.query);
2689
- });
2690
-
2691
- if (resultIndex !== -1) {
2692
- this.scrollToSelectedOnFocus(resultIndex);
2693
- }
2694
- }
2695
- },
2696
- searchInOptions: function searchInOptions(query) {
2697
- var config = this.config,
2698
- options = this.options;
2699
- this.searchQuery = query === '' ? null : query;
2700
- if (!this.searchQuery) return this.filteredOptions = options;
2701
- var searchQuery = query.toLowerCase();
2702
- var filteredOptions = options.filter(function (o) {
2703
- return o[config.valueKey] && o[config.searchKey].toLowerCase().includes(searchQuery) || o[config.labelKey] && o[config.labelKey].includes(searchQuery);
2704
- });
2705
- this.tmpValue = filteredOptions.length ? filteredOptions[0][config.valueKey] : null;
2706
- this.filteredOptions = filteredOptions;
2707
- }
2708
- }
2709
- });
2710
- // CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue?vue&type=script&lang=js&
2711
- /* harmony default export */ var MazSelect_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
2712
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2713
- var componentNormalizer = __webpack_require__(0);
2714
-
2715
- // CONCATENATED MODULE: ./packages/components/MazSelect/_main.vue
2716
-
2717
-
2718
-
2719
-
2720
-
2721
- /* normalize component */
2722
-
2723
- var component = Object(componentNormalizer["a" /* default */])(
2724
- MazSelect_mainvue_type_script_lang_js_,
2725
- render,
2726
- staticRenderFns,
2727
- false,
2728
- null,
2729
- null,
2730
- null
2731
-
2732
- )
2733
-
2734
- /* hot reload */
2735
- if (false) { var api; }
2736
- component.options.__file = "packages/components/MazSelect/_main.vue"
2737
- /* harmony default export */ var _main = (component.exports);
2738
- // CONCATENATED MODULE: ./packages/components/MazSelect/index.js
2739
-
2740
-
2741
- _main.install = function (Vue) {
2742
- Vue.component(_main.name, _main);
2743
- };
2744
-
2745
- /* harmony default export */ var MazSelect = __webpack_exports__["default"] = (_main);
2746
-
2747
- /***/ }),
2748
- /* 17 */,
2749
- /* 18 */,
2750
- /* 19 */,
2751
- /* 20 */,
2752
- /* 21 */
2753
- /***/ (function(module, exports) {
2754
-
2755
- module.exports = require("libphonenumber-js/examples.mobile.json");
2756
-
2757
- /***/ }),
2758
- /* 22 */,
2759
- /* 23 */,
2760
- /* 24 */,
2761
- /* 25 */
2762
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2763
-
2764
- "use strict";
2765
- // ESM COMPAT FLAG
2766
- __webpack_require__.r(__webpack_exports__);
2767
-
2768
- // 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&
2769
- var render = function() {
2770
- var _vm = this
2771
- var _h = _vm.$createElement
2772
- var _c = _vm._self._c || _h
2773
- return _c(
2774
- "div",
2775
- {
2776
- staticClass: "maz-base-component maz-phone-number-input maz-flex",
2777
- class: [
2778
- { "maz-is-dark": _vm.dark },
2779
- "maz-phone-number-input--" + _vm.size
2780
- ],
2781
- attrs: { id: _vm.id }
2782
- },
2783
- [
2784
- !_vm.noCountrySelector
2785
- ? _c("MazSelect", {
2786
- ref: "CountrySelector",
2787
- staticClass: "country-selector",
2788
- class: {
2789
- "no-padding-left": _vm.noFlags || !_vm.countryCode
2790
- },
2791
- attrs: {
2792
- value: _vm.countryCode,
2793
- options: _vm.countriesSorted,
2794
- placeholder: _vm.t.countrySelectorLabel,
2795
- search: "",
2796
- position: _vm.position,
2797
- "search-placeholder": _vm.t.countrySelectorSearchPlaceholder,
2798
- "items-height": _vm.countriesHeight,
2799
- error: _vm.shouldChooseCountry,
2800
- hint: _vm.shouldChooseCountry ? _vm.t.countrySelectorError : null,
2801
- size: _vm.size,
2802
- success: _vm.isValid && !_vm.noValidation,
2803
- disabled: _vm.disabled,
2804
- "input-value": _vm.callingCode,
2805
- "list-width": 250,
2806
- config: {
2807
- labelKey: "dialCode",
2808
- searchKey: "name",
2809
- valueKey: "iso2"
2810
- },
2811
- color: _vm.color
2812
- },
2813
- on: {
2814
- input: function($event) {
2815
- return _vm.setCountryCode($event, true)
2816
- }
2817
- },
2818
- scopedSlots: _vm._u(
2819
- [
2820
- {
2821
- key: "default",
2822
- fn: function(ref) {
2823
- var option = ref.option
2824
- return [
2825
- _c("div", { staticClass: "maz-flex maz-align-center" }, [
2826
- !_vm.noFlags
2827
- ? _c(
2828
- "div",
2829
- {
2830
- staticClass:
2831
- "country-selector__flag-container maz-mr-2"
2832
- },
2833
- [
2834
- _c("div", {
2835
- class:
2836
- "maz-flag maz-flag-" +
2837
- option.iso2.toLowerCase()
2838
- })
2839
- ]
2840
- )
2841
- : _vm._e(),
2842
- _vm.showCodeOnList
2843
- ? _c(
2844
- "span",
2845
- {
2846
- staticClass:
2847
- "country-selector__calling-code maz-flex-fixed maz-text-muted",
2848
- class: {
2849
- "maz-text-muted-dark": option.isSelected
2850
- }
2851
- },
2852
- [
2853
- _vm._v(
2854
- "\n +" +
2855
- _vm._s(option.dialCode) +
2856
- "\n "
2857
- )
2858
- ]
2859
- )
2860
- : _vm._e(),
2861
- _c(
2862
- "div",
2863
- {
2864
- staticClass:
2865
- "maz-dots-text maz-flex-1 maz-text-left maz-text-color",
2866
- class: {
2867
- "maz-text-white": option.isSelected
2868
- }
2869
- },
2870
- [
2871
- _vm._v(
2872
- "\n " +
2873
- _vm._s(option.name) +
2874
- "\n "
2875
- )
2876
- ]
2877
- )
2878
- ])
2879
- ]
2880
- }
2881
- }
2882
- ],
2883
- null,
2884
- false,
2885
- 2447316597
2886
- )
2887
- })
2888
- : _vm._e(),
2889
- _vm.countryCode && !_vm.noFlags && !_vm.noCountrySelector
2890
- ? _c(
2891
- "button",
2892
- {
2893
- staticClass: "\n maz-phone-number-input__country-flag",
2894
- attrs: { tabindex: "-1" },
2895
- on: { click: _vm.focusCountrySelector }
2896
- },
2897
- [
2898
- _c("div", {
2899
- class: "maz-flag maz-flag-" + _vm.countryCode.toLowerCase()
2900
- })
2901
- ]
2902
- )
2903
- : _vm._e(),
2904
- _c(
2905
- "MazInput",
2906
- _vm._b(
2907
- {
2908
- ref: "PhoneNumberInput",
2909
- staticClass: "input-phone-number maz-flex-1",
2910
- class: {
2911
- "has-border-radius": _vm.noCountrySelector
2912
- },
2913
- attrs: {
2914
- id: _vm.uniqueId ? _vm.uniqueId + "_phone_number" : null,
2915
- value: _vm.asYouTypeNumber,
2916
- placeholder: _vm.placeholder || _vm.t.phoneNumberLabel,
2917
- hint: _vm.hint || _vm.hintValue,
2918
- disabled: _vm.disabled,
2919
- size: _vm.size,
2920
- success: _vm.isValid && !_vm.noValidation,
2921
- clearable: "",
2922
- color: _vm.color
2923
- },
2924
- on: {
2925
- keydown: function(e) {
2926
- _vm.lastKeyPressed = e.keyCode
2927
- },
2928
- focus: function($event) {
2929
- return _vm.$emit("focus", $event)
2930
- },
2931
- blur: function($event) {
2932
- return _vm.$emit("blur", $event)
2933
- },
2934
- change: function($event) {
2935
- return _vm.$emit("change", $event)
2936
- },
2937
- clear: function($event) {
2938
- return _vm.$emit("clear", $event)
2939
- },
2940
- input: _vm.buildResults
2941
- }
2942
- },
2943
- "MazInput",
2944
- _vm.$attrs,
2945
- false
2946
- ),
2947
- [
2948
- _vm._t("icon-left", null, { slot: "icon-left" }),
2949
- _vm._t("icon-right", null, { slot: "icon-right" })
2950
- ],
2951
- 2
2952
- )
2953
- ],
2954
- 1
2955
- )
2956
- }
2957
- var staticRenderFns = []
2958
- render._withStripped = true
2959
-
2960
-
2961
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue?vue&type=template&id=0022c02d&
2962
-
2963
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
2964
- var regenerator = __webpack_require__(1);
2965
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
2966
-
2967
- // EXTERNAL MODULE: external "libphonenumber-js"
2968
- var external_libphonenumber_js_ = __webpack_require__(11);
2969
-
2970
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/constantes/js/phoneCodeCountries.js
2971
- 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]];
2972
- var countriesIso = allCountries.map(function (country) {
2973
- return country[1].toUpperCase();
2974
- });
2975
- var countries = allCountries.map(function (country) {
2976
- return {
2977
- name: country[0],
2978
- iso2: country[1].toUpperCase(),
2979
- dialCode: country[2],
2980
- priority: country[3] || 0,
2981
- areaCodes: country[4] || null
2982
- };
2983
- });
2984
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/utils/index.js
2985
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2986
-
2987
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2988
-
2989
- 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; }
2990
-
2991
-
2992
-
2993
- 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); } }
2994
-
2995
- 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); }); }; }
2996
-
2997
-
2998
-
2999
- var browserLocale = function browserLocale() {
3000
- if (typeof window === 'undefined') return null;
3001
- var browserLocale = window.navigator.userLanguage || window.navigator.language;
3002
- var locale = browserLocale ? browserLocale.substr(3, 4).toUpperCase() : null;
3003
- if (locale === '') locale = browserLocale.substr(0, 2).toUpperCase(); // fallback to US country
3004
-
3005
- if (locale === 'EN') locale = 'US';
3006
- if (locale === 'JA') locale = 'JP';
3007
- return locale;
3008
- };
3009
- var isCountryAvailable = /*#__PURE__*/function () {
3010
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee(locale) {
3011
- return regenerator_default.a.wrap(function _callee$(_context) {
3012
- while (1) {
3013
- switch (_context.prev = _context.next) {
3014
- case 0:
3015
- _context.prev = 0;
3016
-
3017
- if (!countriesIso.includes(locale)) {
3018
- _context.next = 3;
3019
- break;
3020
- }
3021
-
3022
- return _context.abrupt("return", true);
3023
-
3024
- case 3:
3025
- throw "MazPhoneNumberInput: The country ".concat(locale, " is not available");
3026
-
3027
- case 6:
3028
- _context.prev = 6;
3029
- _context.t0 = _context["catch"](0);
3030
- throw new Error(_context.t0);
3031
-
3032
- case 9:
3033
- case "end":
3034
- return _context.stop();
3035
- }
3036
- }
3037
- }, _callee, null, [[0, 6]]);
3038
- }));
3039
-
3040
- return function isCountryAvailable(_x) {
3041
- return _ref.apply(this, arguments);
3042
- };
3043
- }();
3044
- var utils_getResultsFromPhoneNumber = function getResultsFromPhoneNumber(phoneNumber, countryCode) {
3045
- var parsing = phoneNumber ? Object(external_libphonenumber_js_["parsePhoneNumberFromString"])(phoneNumber, countryCode) : null;
3046
- var results = {
3047
- countryCode: countryCode,
3048
- isValid: false
3049
- };
3050
-
3051
- if (parsing) {
3052
- results = _objectSpread(_objectSpread({}, results), {}, {
3053
- countryCode: parsing.country,
3054
- countryCallingCode: parsing.countryCallingCode,
3055
- nationalNumber: parsing.nationalNumber,
3056
- isValid: parsing.isValid(),
3057
- type: parsing.getType(),
3058
- formatInternational: parsing.formatInternational(),
3059
- formatNational: parsing.formatNational(),
3060
- uri: parsing.getURI(),
3061
- e164: parsing.format('E.164')
3062
- });
3063
- }
3064
-
3065
- return results;
3066
- };
3067
- var utils_getAsYouTypeFormat = function getAsYouTypeFormat(phoneNumber, countryCode) {
3068
- if (!phoneNumber) return null;
3069
- return countryCode ? new external_libphonenumber_js_["AsYouType"](countryCode).input(phoneNumber) : phoneNumber;
3070
- };
3071
- var fetchCountryCode = /*#__PURE__*/function () {
3072
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
3073
- var response, responseText, result;
3074
- return regenerator_default.a.wrap(function _callee2$(_context2) {
3075
- while (1) {
3076
- switch (_context2.prev = _context2.next) {
3077
- case 0:
3078
- _context2.prev = 0;
3079
- _context2.next = 3;
3080
- return fetch('https://ip2c.org/s');
3081
-
3082
- case 3:
3083
- response = _context2.sent;
3084
- _context2.next = 6;
3085
- return response.text();
3086
-
3087
- case 6:
3088
- responseText = _context2.sent;
3089
- result = (responseText || '').toString();
3090
-
3091
- if (!(result && result[0] === '1')) {
3092
- _context2.next = 10;
3093
- break;
3094
- }
3095
-
3096
- return _context2.abrupt("return", result.substr(2, 2));
3097
-
3098
- case 10:
3099
- _context2.next = 15;
3100
- break;
3101
-
3102
- case 12:
3103
- _context2.prev = 12;
3104
- _context2.t0 = _context2["catch"](0);
3105
- return _context2.abrupt("return", new Error('[MazPhoneNumberInput] Error while fetching country code'));
3106
-
3107
- case 15:
3108
- case "end":
3109
- return _context2.stop();
3110
- }
3111
- }
3112
- }, _callee2, null, [[0, 12]]);
3113
- }));
3114
-
3115
- return function fetchCountryCode() {
3116
- return _ref2.apply(this, arguments);
3117
- };
3118
- }();
3119
- // EXTERNAL MODULE: external "libphonenumber-js/examples.mobile.json"
3120
- var examples_mobile_json_ = __webpack_require__(21);
3121
- var examples_mobile_json_default = /*#__PURE__*/__webpack_require__.n(examples_mobile_json_);
3122
-
3123
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/constantes/locales/index.js
3124
- /* harmony default export */ var locales = ({
3125
- countrySelectorLabel: 'Country code',
3126
- countrySelectorError: 'Choose country',
3127
- countrySelectorSearchPlaceholder: 'Search country',
3128
- phoneNumberLabel: 'Phone number',
3129
- example: 'Example:'
3130
- });
3131
- // EXTERNAL MODULE: ./packages/components/MazInput/index.js + 5 modules
3132
- var MazInput = __webpack_require__(8);
3133
-
3134
- // EXTERNAL MODULE: ./packages/components/MazSelect/index.js + 5 modules
3135
- var MazSelect = __webpack_require__(16);
3136
-
3137
- // EXTERNAL MODULE: ./packages/mixins/uniqueId.js
3138
- var uniqueId = __webpack_require__(2);
3139
-
3140
- // 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&
3141
-
3142
-
3143
- 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); } }
3144
-
3145
- 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); }); }; }
3146
-
3147
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3148
-
3149
- 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."); }
3150
-
3151
- 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); }
3152
-
3153
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
3154
-
3155
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
3156
-
3157
- 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; }
3158
-
3159
- function _mainvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
3160
-
3161
- function _mainvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { _mainvue_type_script_lang_js_ownKeys(Object(source), true).forEach(function (key) { _mainvue_type_script_lang_js_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { _mainvue_type_script_lang_js_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3162
-
3163
- 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; }
3164
-
3165
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
-
3284
-
3285
-
3286
-
3287
-
3288
-
3289
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
3290
- name: 'MazPhoneNumberInput',
3291
- components: {
3292
- MazInput: MazInput["default"],
3293
- MazSelect: MazSelect["default"]
3294
- },
3295
- mixins: [uniqueId["a" /* default */]],
3296
- props: {
3297
- value: {
3298
- validator: function validator(prop) {
3299
- return ['string', 'number'].includes(_typeof(prop)) || prop === null;
3300
- },
3301
- default: null
3302
- },
3303
- id: {
3304
- type: String,
3305
- default: null
3306
- },
3307
- disabled: {
3308
- type: Boolean,
3309
- default: false
3310
- },
3311
- // set default phone number (Ex: `default-phone-number="0658585858"`)
3312
- defaultPhoneNumber: {
3313
- type: String,
3314
- default: null
3315
- },
3316
- // set default country code (Ex: `default-country-code="FR"`)
3317
- defaultCountryCode: {
3318
- type: String,
3319
- default: null
3320
- },
3321
- // Same as MazInput (options: `sm|md|lg`)
3322
- size: {
3323
- type: String,
3324
- default: null
3325
- },
3326
- // Countries selected will be at the top of the list - Ex : `preferred-countries="['FR', 'BE', 'DE']`
3327
- preferredCountries: {
3328
- type: Array,
3329
- default: null
3330
- },
3331
- // Only countries selected are in list - Ex : `only-countries="['FR', 'BE', 'DE']`
3332
- onlyCountries: {
3333
- type: Array,
3334
- default: null
3335
- },
3336
- // Countries seleted are remove from the list - Ex : `ignored-countries="['FR', 'BE', 'DE']`
3337
- ignoredCountries: {
3338
- type: Array,
3339
- default: Array
3340
- },
3341
- // Translate text in component - By default `{ countrySelectorLabel: 'Country code', countrySelectorError: 'Choose country', phoneNumberLabel: 'Phone number', example: 'Example:' }`
3342
- translations: {
3343
- type: Object,
3344
- default: null
3345
- },
3346
- // Remove the validation UI state (success border color)
3347
- noValidation: {
3348
- type: Boolean,
3349
- default: false
3350
- },
3351
- // Remove flags in country selector
3352
- noFlags: {
3353
- type: Boolean,
3354
- default: false
3355
- },
3356
- // Remove the number example from the label input
3357
- noExample: {
3358
- type: Boolean,
3359
- default: false
3360
- },
3361
- // Change the height of country item in list
3362
- countriesHeight: {
3363
- type: Number,
3364
- default: 30
3365
- },
3366
- // Disable use of browser locale to init the country selector (usefull for Nuxt.JS)
3367
- noUseBrowserLocale: {
3368
- type: Boolean,
3369
- default: false
3370
- },
3371
- // Fetch country code via https://ip2c.org/s - Network needed - (Do not use it with default-country-code options)
3372
- fetchCountry: {
3373
- type: Boolean,
3374
- default: false
3375
- },
3376
- // The country selector is not shown, you can validate your phone number with the country code set
3377
- noCountrySelector: {
3378
- type: Boolean,
3379
- default: false
3380
- },
3381
- // Show the country phone code in the list
3382
- showCodeOnList: {
3383
- type: Boolean,
3384
- default: false
3385
- },
3386
- // Enable the dark mode
3387
- dark: {
3388
- type: Boolean,
3389
- default: false
3390
- },
3391
- // Use color
3392
- color: {
3393
- type: String,
3394
- default: 'primary'
3395
- },
3396
- // Set placholder of phone number input
3397
- placeholder: {
3398
- type: String,
3399
- default: null
3400
- },
3401
- // hint message shown on phone number text field
3402
- hint: {
3403
- type: String,
3404
- default: null
3405
- },
3406
- // set the position of countries list (ex: `top`, `top right`, `bottom right`)
3407
- position: {
3408
- type: String,
3409
- default: 'left bottom'
3410
- }
3411
- },
3412
- data: function data() {
3413
- return {
3414
- results: {},
3415
- countryCode: this.defaultCountryCode,
3416
- lastKeyPressed: null,
3417
- asYouTypeNumber: this.defaultPhoneNumber
3418
- };
3419
- },
3420
- computed: {
3421
- t: function t() {
3422
- return _mainvue_type_script_lang_js_objectSpread(_mainvue_type_script_lang_js_objectSpread({}, locales), this.translations);
3423
- },
3424
- callingCode: function callingCode() {
3425
- var _this = this;
3426
-
3427
- var countryCode = this.countryCode;
3428
-
3429
- var getDialCode = function getDialCode(code) {
3430
- var result = _this.countriesSorted.find(function (m) {
3431
- return m.iso2 === code;
3432
- });
3433
-
3434
- return result ? result.dialCode : null;
3435
- };
3436
-
3437
- return countryCode ? "+".concat(getDialCode(countryCode) || Object(external_libphonenumber_js_["getCountryCallingCode"])(countryCode)) : null;
3438
- },
3439
- // input states
3440
- shouldChooseCountry: function shouldChooseCountry() {
3441
- return !this.countryCode && !!this.asYouTypeNumber;
3442
- },
3443
- isValid: function isValid() {
3444
- return this.results.isValid;
3445
- },
3446
- hasEmptyPhone: function hasEmptyPhone() {
3447
- var asYouTypeNumber = this.asYouTypeNumber;
3448
- return asYouTypeNumber === '' || !asYouTypeNumber;
3449
- },
3450
- // hint values
3451
- phoneNumberExample: function phoneNumberExample() {
3452
- var countryCode = this.countryCode;
3453
- var phoneNumber = countryCode ? Object(external_libphonenumber_js_["getExampleNumber"])(countryCode, examples_mobile_json_default.a) : null;
3454
- return phoneNumber ? phoneNumber.formatNational() : null;
3455
- },
3456
- hintValue: function hintValue() {
3457
- var noExample = this.noExample,
3458
- phoneNumberExample = this.phoneNumberExample,
3459
- hasEmptyPhone = this.hasEmptyPhone,
3460
- isValid = this.isValid,
3461
- t = this.t;
3462
- return noExample || !phoneNumberExample ? null : hasEmptyPhone || isValid ? null : "".concat(t.example, " ").concat(phoneNumberExample);
3463
- },
3464
- // Countries list management
3465
- countriesList: function countriesList() {
3466
- var _this2 = this;
3467
-
3468
- return countries.filter(function (item) {
3469
- return !_this2.ignoredCountries.includes(item.iso2);
3470
- });
3471
- },
3472
- countriesFiltered: function countriesFiltered() {
3473
- var _this3 = this;
3474
-
3475
- var countries = this.onlyCountries || this.preferredCountries;
3476
- return countries.map(function (country) {
3477
- return _this3.countriesList.find(function (item) {
3478
- return item.iso2.includes(country);
3479
- });
3480
- });
3481
- },
3482
- otherCountries: function otherCountries() {
3483
- var _this4 = this;
3484
-
3485
- return this.countriesList.filter(function (item) {
3486
- return !_this4.preferredCountries.includes(item.iso2);
3487
- });
3488
- },
3489
- countriesSorted: function countriesSorted() {
3490
- return this.preferredCountries ? [].concat(_toConsumableArray(this.countriesFiltered), _toConsumableArray(this.otherCountries)) : this.onlyCountries ? this.countriesFiltered : this.countriesList;
3491
- }
3492
- },
3493
- watch: {
3494
- defaultPhoneNumber: {
3495
- handler: function handler(phoneNumber, oldPhoneNumber) {
3496
- if (phoneNumber === oldPhoneNumber) return;
3497
- this.buildResults(phoneNumber);
3498
- },
3499
- immediate: true
3500
- },
3501
- defaultCountryCode: {
3502
- handler: function handler(newValue, oldValue) {
3503
- if (!newValue || newValue === oldValue) return;
3504
- this.setCountryCode(newValue);
3505
- },
3506
- immediate: true
3507
- }
3508
- },
3509
- mounted: function mounted() {
3510
- var _this5 = this;
3511
-
3512
- return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
3513
- var defaultCountryCode, fetchCountry, noUseBrowserLocale, setCountryCode, locale;
3514
- return regenerator_default.a.wrap(function _callee$(_context) {
3515
- while (1) {
3516
- switch (_context.prev = _context.next) {
3517
- case 0:
3518
- _context.prev = 0;
3519
- defaultCountryCode = _this5.defaultCountryCode, fetchCountry = _this5.fetchCountry, noUseBrowserLocale = _this5.noUseBrowserLocale, setCountryCode = _this5.setCountryCode;
3520
- if (!_this5.defaultPhoneNumber && _this5.value) _this5.buildResults(_this5.value);
3521
-
3522
- if (!(defaultCountryCode && fetchCountry)) {
3523
- _context.next = 5;
3524
- break;
3525
- }
3526
-
3527
- throw new Error('MazPhoneNumberInput: Do not use \'fetch-country\' and \'default-country-code\' options in the same time');
3528
-
3529
- case 5:
3530
- if (!(defaultCountryCode && noUseBrowserLocale)) {
3531
- _context.next = 7;
3532
- break;
3533
- }
3534
-
3535
- throw new Error('MazPhoneNumberInput: If you use a \'default-country-code\', do not use \'no-use-browser-locale\' options');
3536
-
3537
- case 7:
3538
- if (!defaultCountryCode) {
3539
- _context.next = 9;
3540
- break;
3541
- }
3542
-
3543
- return _context.abrupt("return");
3544
-
3545
- case 9:
3546
- if (!fetchCountry) {
3547
- _context.next = 15;
3548
- break;
3549
- }
3550
-
3551
- _context.next = 12;
3552
- return fetchCountryCode();
3553
-
3554
- case 12:
3555
- _context.t0 = _context.sent;
3556
- _context.next = 23;
3557
- break;
3558
-
3559
- case 15:
3560
- if (!noUseBrowserLocale) {
3561
- _context.next = 19;
3562
- break;
3563
- }
3564
-
3565
- _context.t1 = null;
3566
- _context.next = 22;
3567
- break;
3568
-
3569
- case 19:
3570
- _context.next = 21;
3571
- return browserLocale();
3572
-
3573
- case 21:
3574
- _context.t1 = _context.sent;
3575
-
3576
- case 22:
3577
- _context.t0 = _context.t1;
3578
-
3579
- case 23:
3580
- locale = _context.t0;
3581
- if (locale) setCountryCode(locale);
3582
- _context.next = 30;
3583
- break;
3584
-
3585
- case 27:
3586
- _context.prev = 27;
3587
- _context.t2 = _context["catch"](0);
3588
- throw new Error(_context.t2);
3589
-
3590
- case 30:
3591
- case "end":
3592
- return _context.stop();
3593
- }
3594
- }
3595
- }, _callee, null, [[0, 27]]);
3596
- }))();
3597
- },
3598
- methods: {
3599
- buildResults: function buildResults(phoneNumber, noAutoUpdateCountryCode) {
3600
- var _this6 = this;
3601
-
3602
- return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
3603
- var asYouTypeNumber, lastKeyPressed, countryCode, value, backSpacePressed, lastCharacOfPhoneNumber, _this6$results, isValid, e164, valueToEmit;
3604
-
3605
- return regenerator_default.a.wrap(function _callee2$(_context2) {
3606
- while (1) {
3607
- switch (_context2.prev = _context2.next) {
3608
- case 0:
3609
- asYouTypeNumber = _this6.asYouTypeNumber, lastKeyPressed = _this6.lastKeyPressed, countryCode = _this6.countryCode, value = _this6.value;
3610
- backSpacePressed = lastKeyPressed === 8;
3611
- _context2.next = 4;
3612
- return _this6.$nextTick();
3613
-
3614
- case 4:
3615
- lastCharacOfPhoneNumber = asYouTypeNumber ? asYouTypeNumber.slice(asYouTypeNumber.length - 1) : false;
3616
-
3617
- if (backSpacePressed && lastCharacOfPhoneNumber && lastCharacOfPhoneNumber === ')') {
3618
- _this6.asYouTypeNumber = asYouTypeNumber.slice(0, -1);
3619
- }
3620
-
3621
- _context2.next = 8;
3622
- return utils_getResultsFromPhoneNumber(phoneNumber, countryCode);
3623
-
3624
- case 8:
3625
- _this6.results = _context2.sent;
3626
- _context2.next = 11;
3627
- return utils_getAsYouTypeFormat(phoneNumber, countryCode);
3628
-
3629
- case 11:
3630
- _this6.asYouTypeNumber = _context2.sent;
3631
-
3632
- if (!noAutoUpdateCountryCode && _this6.results && _this6.results.countryCode && countryCode !== _this6.results.countryCode) {
3633
- _this6.setCountryCode(_this6.results.countryCode);
3634
- } // sent when the user tape
3635
- // @arg Object with all parsed values
3636
-
3637
-
3638
- _this6.$emit('update', _this6.results);
3639
-
3640
- _this6$results = _this6.results, isValid = _this6$results.isValid, e164 = _this6$results.e164;
3641
- valueToEmit = isValid ? e164 : _this6.asYouTypeNumber;
3642
-
3643
- if (!(!valueToEmit && valueToEmit === value)) {
3644
- _context2.next = 18;
3645
- break;
3646
- }
3647
-
3648
- return _context2.abrupt("return");
3649
-
3650
- case 18:
3651
- // sent when the user tape
3652
- // @arg Phone number value formatted in e164 format (international format)
3653
- _this6.$emit('input', valueToEmit);
3654
-
3655
- case 19:
3656
- case "end":
3657
- return _context2.stop();
3658
- }
3659
- }
3660
- }, _callee2);
3661
- }))();
3662
- },
3663
- setCountryCode: function setCountryCode(locale, focusPhoneNumberInput) {
3664
- var _this7 = this;
3665
-
3666
- return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
3667
- var buildResults, asYouTypeNumber, countryAvailable;
3668
- return regenerator_default.a.wrap(function _callee3$(_context3) {
3669
- while (1) {
3670
- switch (_context3.prev = _context3.next) {
3671
- case 0:
3672
- buildResults = _this7.buildResults, asYouTypeNumber = _this7.asYouTypeNumber;
3673
- countryAvailable = isCountryAvailable(locale);
3674
-
3675
- if (focusPhoneNumberInput) {
3676
- _this7.focusPhoneNumberInput();
3677
-
3678
- if (asYouTypeNumber && asYouTypeNumber.includes('+')) _this7.asYouTypeNumber = null;
3679
- }
3680
-
3681
- if (countryAvailable && locale) {
3682
- _this7.countryCode = locale;
3683
- buildResults(_this7.asYouTypeNumber, true);
3684
- }
3685
-
3686
- case 4:
3687
- case "end":
3688
- return _context3.stop();
3689
- }
3690
- }
3691
- }, _callee3);
3692
- }))();
3693
- },
3694
- focusCountrySelector: function focusCountrySelector() {
3695
- var _this8 = this;
3696
-
3697
- return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
3698
- return regenerator_default.a.wrap(function _callee4$(_context4) {
3699
- while (1) {
3700
- switch (_context4.prev = _context4.next) {
3701
- case 0:
3702
- _context4.next = 2;
3703
- return _this8.$nextTick();
3704
-
3705
- case 2:
3706
- _this8.$refs.CountrySelector.$el.querySelector('input').focus();
3707
-
3708
- case 3:
3709
- case "end":
3710
- return _context4.stop();
3711
- }
3712
- }
3713
- }, _callee4);
3714
- }))();
3715
- },
3716
- focusPhoneNumberInput: function focusPhoneNumberInput() {
3717
- var _this9 = this;
3718
-
3719
- return _mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee5() {
3720
- return regenerator_default.a.wrap(function _callee5$(_context5) {
3721
- while (1) {
3722
- switch (_context5.prev = _context5.next) {
3723
- case 0:
3724
- _context5.next = 2;
3725
- return _this9.$nextTick();
3726
-
3727
- case 2:
3728
- _this9.$refs.PhoneNumberInput.$el.querySelector('input').focus();
3729
-
3730
- case 3:
3731
- case "end":
3732
- return _context5.stop();
3733
- }
3734
- }
3735
- }, _callee5);
3736
- }))();
3737
- }
3738
- }
3739
- });
3740
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue?vue&type=script&lang=js&
3741
- /* harmony default export */ var MazPhoneNumberInput_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
3742
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3743
- var componentNormalizer = __webpack_require__(0);
3744
-
3745
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/_main.vue
3746
-
3747
-
3748
-
3749
-
3750
-
3751
- /* normalize component */
3752
-
3753
- var component = Object(componentNormalizer["a" /* default */])(
3754
- MazPhoneNumberInput_mainvue_type_script_lang_js_,
3755
- render,
3756
- staticRenderFns,
3757
- false,
3758
- null,
3759
- null,
3760
- null
3761
-
3762
- )
3763
-
3764
- /* hot reload */
3765
- if (false) { var api; }
3766
- component.options.__file = "packages/components/MazPhoneNumberInput/_main.vue"
3767
- /* harmony default export */ var _main = (component.exports);
3768
- // CONCATENATED MODULE: ./packages/components/MazPhoneNumberInput/index.js
3769
-
3770
-
3771
- _main.install = function (Vue) {
3772
- Vue.component(_main.name, _main);
3773
- };
3774
-
3775
- /* harmony default export */ var MazPhoneNumberInput = __webpack_exports__["default"] = (_main);
3776
-
3777
- /***/ })
3778
- /******/ ]);