maz-ui 2.3.13 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/components/MazArrowIcon.d.ts +43 -0
  2. package/components/MazArrowIcon.js +1 -0
  3. package/components/MazAvatar.d.ts +149 -0
  4. package/components/MazAvatar.js +3 -0
  5. package/components/MazBackdrop.d.ts +89 -0
  6. package/components/MazBackdrop.js +3 -0
  7. package/components/MazBadge.d.ts +68 -0
  8. package/components/MazBadge.js +1 -0
  9. package/components/MazBottomSheet.d.ts +29 -0
  10. package/components/MazBottomSheet.js +3 -0
  11. package/components/MazBtn.d.ts +171 -0
  12. package/components/MazBtn.js +3 -0
  13. package/components/MazCard.d.ts +183 -0
  14. package/components/MazCard.js +3 -0
  15. package/components/MazCarousel.d.ts +16 -0
  16. package/components/MazCarousel.js +3 -0
  17. package/components/MazChart/includes.d.ts +11 -0
  18. package/components/MazChart.d.ts +114 -0
  19. package/components/MazChart.js +1 -0
  20. package/components/MazCheckbox.d.ts +49 -0
  21. package/components/MazCheckbox.js +1 -0
  22. package/components/MazDialog.d.ts +29 -0
  23. package/components/MazDialog.js +3 -0
  24. package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +30 -0
  25. package/components/MazDialogPromise.d.ts +28 -0
  26. package/components/MazDialogPromise.js +3 -0
  27. package/components/MazDrawer.d.ts +59 -0
  28. package/components/MazDrawer.js +3 -0
  29. package/components/MazDropzone.d.ts +128 -0
  30. package/components/MazDropzone.js +3 -0
  31. package/components/MazGallery.d.ts +144 -0
  32. package/components/MazGallery.js +3 -0
  33. package/components/MazIcon.d.ts +66 -0
  34. package/components/MazIcon.js +3 -0
  35. package/components/MazInput.d.ts +276 -0
  36. package/components/MazInput.js +3 -0
  37. package/components/MazInputNumber.d.ts +67 -0
  38. package/components/MazInputNumber.js +3 -0
  39. package/components/MazInputPrice.d.ts +64 -0
  40. package/components/MazInputPrice.js +3 -0
  41. package/components/MazInputTags.d.ts +96 -0
  42. package/components/MazInputTags.js +3 -0
  43. package/components/MazLazyImg.d.ts +80 -0
  44. package/components/MazLazyImg.js +3 -0
  45. package/components/MazPhoneNumberInput/constantes/locales.d.ts +12 -0
  46. package/components/MazPhoneNumberInput/types.d.ts +21 -0
  47. package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +2 -0
  48. package/components/MazPhoneNumberInput/utils/index.d.ts +12 -0
  49. package/components/MazPhoneNumberInput.d.ts +255 -0
  50. package/components/MazPhoneNumberInput.js +3 -0
  51. package/components/MazPicker/MazPickerCalendar.vue.d.ts +137 -0
  52. package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +22 -0
  53. package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +114 -0
  54. package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +124 -0
  55. package/components/MazPicker/MazPickerCalendarSwitcher.vue.d.ts +38 -0
  56. package/components/MazPicker/MazPickerContainer.vue.d.ts +212 -0
  57. package/components/MazPicker/MazPickerHeader.vue.d.ts +84 -0
  58. package/components/MazPicker/MazPickerMonthSwitcher.vue.d.ts +43 -0
  59. package/components/MazPicker/MazPickerShortcuts.vue.d.ts +62 -0
  60. package/components/MazPicker/MazPickerTime.vue.d.ts +129 -0
  61. package/components/MazPicker/MazPickerYearSwitcher.vue.d.ts +35 -0
  62. package/components/MazPicker/types.d.ts +15 -0
  63. package/components/MazPicker/utils.d.ts +54 -0
  64. package/components/MazPicker.d.ts +313 -0
  65. package/components/MazPicker.js +3 -0
  66. package/components/MazRadioButtons.d.ts +69 -0
  67. package/components/MazRadioButtons.js +1 -0
  68. package/components/MazSelect.d.ts +176 -0
  69. package/components/MazSelect.js +3 -0
  70. package/components/MazSlider/utils.d.ts +15 -0
  71. package/components/MazSlider.d.ts +96 -0
  72. package/components/MazSlider.js +3 -0
  73. package/components/MazSpinner.d.ts +30 -0
  74. package/components/MazSpinner.js +1 -0
  75. package/components/MazStepper.d.ts +73 -0
  76. package/components/MazStepper.js +1 -0
  77. package/components/MazSwitch.d.ts +56 -0
  78. package/components/MazSwitch.js +1 -0
  79. package/components/MazTabsBar.d.ts +49 -0
  80. package/components/MazTabsBar.js +3 -0
  81. package/components/MazTabsContent.d.ts +16 -0
  82. package/components/MazTabsContent.js +1 -0
  83. package/components/MazTabsContentItem.d.ts +14 -0
  84. package/components/MazTabsContentItem.js +3 -0
  85. package/components/MazTextarea/textarea-autogrow.d.ts +9 -0
  86. package/components/MazTextarea.d.ts +125 -0
  87. package/components/MazTextarea.js +1 -0
  88. package/components/MazTransitionExpand.d.ts +4 -0
  89. package/components/MazTransitionExpand.js +1 -0
  90. package/components/index.d.ts +34 -0
  91. package/components/index.js +36 -0
  92. package/components/no_photo-a72545e4.js +1 -0
  93. package/components/types.d.ts +17 -0
  94. package/css/aos.css +1 -0
  95. package/css/main.css +1 -0
  96. package/maz-ui.d.ts +307 -0
  97. package/modules/index.js +3 -0
  98. package/modules/no_photo-a72545e4.js +1 -0
  99. package/package.json +145 -81
  100. package/tailwindcss/tailwind.config.js +65 -0
  101. package/tailwindcss/utils/colors.js +28 -0
  102. package/tailwindcss/variables/breakpoints.js +15 -0
  103. package/tailwindcss/variables/colors.js +44 -0
  104. package/tailwindcss/variables/utilities.js +20 -0
  105. package/tailwindcss/variables/z-indexes.js +15 -0
  106. package/LICENSE +0 -21
  107. package/README.md +0 -66
  108. package/bin/index.js +0 -63
  109. package/bin/lib/_constantes/default-colors.js +0 -69
  110. package/bin/lib/index.d.ts +0 -2
  111. package/bin/lib/index.js +0 -145
  112. package/bin/lib/methods/generate-root-css.js +0 -49
  113. package/bin/lib/methods/get-theme-settings.js +0 -58
  114. package/bin/lib/methods/set-css-vars.js +0 -11
  115. package/lib/css/base.css +0 -1
  116. package/lib/css/index.css +0 -1
  117. package/lib/css/maz-avatar.css +0 -1
  118. package/lib/css/maz-bottom-sheet.css +0 -1
  119. package/lib/css/maz-btn-group.css +0 -1
  120. package/lib/css/maz-btn.css +0 -0
  121. package/lib/css/maz-card.css +0 -1
  122. package/lib/css/maz-carousel.css +0 -1
  123. package/lib/css/maz-checkbox.css +0 -1
  124. package/lib/css/maz-collapse.css +0 -1
  125. package/lib/css/maz-dialog.css +0 -1
  126. package/lib/css/maz-draggable-list.css +0 -1
  127. package/lib/css/maz-dropdown.css +0 -1
  128. package/lib/css/maz-dropzone.css +0 -1
  129. package/lib/css/maz-flex.css +0 -0
  130. package/lib/css/maz-gallery.css +0 -0
  131. package/lib/css/maz-img.css +0 -1
  132. package/lib/css/maz-input-tags.css +0 -1
  133. package/lib/css/maz-input.css +0 -0
  134. package/lib/css/maz-list-item.css +0 -1
  135. package/lib/css/maz-list.css +0 -1
  136. package/lib/css/maz-loader.css +0 -0
  137. package/lib/css/maz-pagination.css +0 -1
  138. package/lib/css/maz-phone-number-input.css +0 -1
  139. package/lib/css/maz-picker.css +0 -1
  140. package/lib/css/maz-plotly.css +0 -0
  141. package/lib/css/maz-progress-bar.css +0 -1
  142. package/lib/css/maz-radio.css +0 -1
  143. package/lib/css/maz-read-more.css +0 -1
  144. package/lib/css/maz-responsive-menu.css +0 -1
  145. package/lib/css/maz-search.css +0 -1
  146. package/lib/css/maz-select.css +0 -0
  147. package/lib/css/maz-sidebar.css +0 -1
  148. package/lib/css/maz-slider.css +0 -1
  149. package/lib/css/maz-spinner.css +0 -0
  150. package/lib/css/maz-stepper.css +0 -1
  151. package/lib/css/maz-switch.css +0 -1
  152. package/lib/css/maz-tabs-bar.css +0 -1
  153. package/lib/css/maz-tabs-content-item.css +0 -1
  154. package/lib/css/maz-tabs-content.css +0 -1
  155. package/lib/css/maz-transition-expand.css +0 -0
  156. package/lib/index.d.ts +0 -1
  157. package/lib/index.js +0 -1
  158. package/lib/maz-avatar.d.ts +0 -3
  159. package/lib/maz-avatar.js +0 -430
  160. package/lib/maz-bottom-sheet.d.ts +0 -3
  161. package/lib/maz-bottom-sheet.js +0 -1045
  162. package/lib/maz-btn-group.d.ts +0 -3
  163. package/lib/maz-btn-group.js +0 -907
  164. package/lib/maz-btn.d.ts +0 -3
  165. package/lib/maz-btn.js +0 -764
  166. package/lib/maz-card.d.ts +0 -3
  167. package/lib/maz-card.js +0 -572
  168. package/lib/maz-carousel.d.ts +0 -3
  169. package/lib/maz-carousel.js +0 -569
  170. package/lib/maz-checkbox.d.ts +0 -3
  171. package/lib/maz-checkbox.js +0 -359
  172. package/lib/maz-collapse.d.ts +0 -3
  173. package/lib/maz-collapse.js +0 -1238
  174. package/lib/maz-dialog.d.ts +0 -3
  175. package/lib/maz-dialog.js +0 -1315
  176. package/lib/maz-draggable-list.d.ts +0 -3
  177. package/lib/maz-draggable-list.js +0 -439
  178. package/lib/maz-dropdown.d.ts +0 -3
  179. package/lib/maz-dropdown.js +0 -438
  180. package/lib/maz-dropzone.d.ts +0 -3
  181. package/lib/maz-dropzone.js +0 -664
  182. package/lib/maz-flex.d.ts +0 -3
  183. package/lib/maz-flex.js +0 -427
  184. package/lib/maz-gallery.d.ts +0 -3
  185. package/lib/maz-gallery.js +0 -672
  186. package/lib/maz-img.d.ts +0 -3
  187. package/lib/maz-img.js +0 -612
  188. package/lib/maz-input-tags.d.ts +0 -3
  189. package/lib/maz-input-tags.js +0 -1207
  190. package/lib/maz-input.d.ts +0 -3
  191. package/lib/maz-input.js +0 -1076
  192. package/lib/maz-list-item.d.ts +0 -3
  193. package/lib/maz-list-item.js +0 -304
  194. package/lib/maz-list.d.ts +0 -3
  195. package/lib/maz-list.js +0 -331
  196. package/lib/maz-loader.d.ts +0 -3
  197. package/lib/maz-loader.js +0 -304
  198. package/lib/maz-pagination.d.ts +0 -3
  199. package/lib/maz-pagination.js +0 -1414
  200. package/lib/maz-phone-number-input.d.ts +0 -3
  201. package/lib/maz-phone-number-input.js +0 -3776
  202. package/lib/maz-picker.d.ts +0 -3
  203. package/lib/maz-picker.js +0 -6474
  204. package/lib/maz-plotly.d.ts +0 -3
  205. package/lib/maz-plotly.js +0 -500
  206. package/lib/maz-progress-bar.d.ts +0 -3
  207. package/lib/maz-progress-bar.js +0 -398
  208. package/lib/maz-radio.d.ts +0 -3
  209. package/lib/maz-radio.js +0 -358
  210. package/lib/maz-read-more.d.ts +0 -3
  211. package/lib/maz-read-more.js +0 -344
  212. package/lib/maz-responsive-menu.d.ts +0 -3
  213. package/lib/maz-responsive-menu.js +0 -438
  214. package/lib/maz-search.d.ts +0 -3
  215. package/lib/maz-search.js +0 -1590
  216. package/lib/maz-select.d.ts +0 -3
  217. package/lib/maz-select.js +0 -2740
  218. package/lib/maz-sidebar.d.ts +0 -3
  219. package/lib/maz-sidebar.js +0 -815
  220. package/lib/maz-slider.d.ts +0 -3
  221. package/lib/maz-slider.js +0 -1014
  222. package/lib/maz-spinner.d.ts +0 -3
  223. package/lib/maz-spinner.js +0 -328
  224. package/lib/maz-stepper.d.ts +0 -3
  225. package/lib/maz-stepper.js +0 -1011
  226. package/lib/maz-switch.d.ts +0 -3
  227. package/lib/maz-switch.js +0 -375
  228. package/lib/maz-tabs-bar.d.ts +0 -3
  229. package/lib/maz-tabs-bar.js +0 -428
  230. package/lib/maz-tabs-content-item.d.ts +0 -3
  231. package/lib/maz-tabs-content-item.js +0 -376
  232. package/lib/maz-tabs-content.d.ts +0 -3
  233. package/lib/maz-tabs-content.js +0 -367
  234. package/lib/maz-transition-expand.d.ts +0 -3
  235. package/lib/maz-transition-expand.js +0 -328
  236. package/lib/maz-ui.common.d.ts +0 -1
  237. package/lib/maz-ui.common.js +0 -17202
package/lib/maz-search.js DELETED
@@ -1,1590 +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 = 47);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
-
93
- "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
- /* globals __VUE_SSR_CONTEXT__ */
96
-
97
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
- // This module is a runtime utility for cleaner component module output and will
99
- // be included in the final webpack user bundle.
100
-
101
- function normalizeComponent (
102
- scriptExports,
103
- render,
104
- staticRenderFns,
105
- functionalTemplate,
106
- injectStyles,
107
- scopeId,
108
- moduleIdentifier, /* server only */
109
- shadowMode /* vue-cli only */
110
- ) {
111
- // Vue.extend constructor export interop
112
- var options = typeof scriptExports === 'function'
113
- ? scriptExports.options
114
- : scriptExports
115
-
116
- // render functions
117
- if (render) {
118
- options.render = render
119
- options.staticRenderFns = staticRenderFns
120
- options._compiled = true
121
- }
122
-
123
- // functional template
124
- if (functionalTemplate) {
125
- options.functional = true
126
- }
127
-
128
- // scopedId
129
- if (scopeId) {
130
- options._scopeId = 'data-v-' + scopeId
131
- }
132
-
133
- var hook
134
- if (moduleIdentifier) { // server build
135
- hook = function (context) {
136
- // 2.3 injection
137
- context =
138
- context || // cached call
139
- (this.$vnode && this.$vnode.ssrContext) || // stateful
140
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
- // 2.2 with runInNewContext: true
142
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
- context = __VUE_SSR_CONTEXT__
144
- }
145
- // inject component styles
146
- if (injectStyles) {
147
- injectStyles.call(this, context)
148
- }
149
- // register component module identifier for async chunk inferrence
150
- if (context && context._registeredComponents) {
151
- context._registeredComponents.add(moduleIdentifier)
152
- }
153
- }
154
- // used by ssr in case component is cached and beforeCreate
155
- // never gets called
156
- options._ssrRegister = hook
157
- } else if (injectStyles) {
158
- hook = shadowMode
159
- ? function () {
160
- injectStyles.call(
161
- this,
162
- (options.functional ? this.parent : this).$root.$options.shadowRoot
163
- )
164
- }
165
- : injectStyles
166
- }
167
-
168
- if (hook) {
169
- if (options.functional) {
170
- // for template-only hot-reload because in that case the render fn doesn't
171
- // go through the normalizer
172
- options._injectStyles = hook
173
- // register for functional component in vue file
174
- var originalRender = options.render
175
- options.render = function renderWithStyleInjection (h, context) {
176
- hook.call(context)
177
- return originalRender(h, context)
178
- }
179
- } else {
180
- // inject component registration as beforeCreate hook
181
- var existing = options.beforeCreate
182
- options.beforeCreate = existing
183
- ? [].concat(existing, hook)
184
- : [hook]
185
- }
186
- }
187
-
188
- return {
189
- exports: scriptExports,
190
- options: options
191
- }
192
- }
193
-
194
-
195
- /***/ }),
196
-
197
- /***/ 2:
198
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
199
-
200
- "use strict";
201
- /* harmony default export */ __webpack_exports__["a"] = ({
202
- data: function data() {
203
- return {
204
- uniqueId: null
205
- };
206
- },
207
- mounted: function mounted() {
208
- var id = this.id || this.$attrs.id;
209
- this.uniqueId = id ? "".concat(id) : "".concat(this.$options.name, "-").concat(this._uid);
210
- }
211
- });
212
-
213
- /***/ }),
214
-
215
- /***/ 47:
216
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
217
-
218
- "use strict";
219
- // ESM COMPAT FLAG
220
- __webpack_require__.r(__webpack_exports__);
221
-
222
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSearch/_main.vue?vue&type=template&id=c5d051bc&
223
- var render = function () {
224
- var _vm = this
225
- var _h = _vm.$createElement
226
- var _c = _vm._self._c || _h
227
- return _c(
228
- "div",
229
- {
230
- staticClass: "maz-base-component maz-search",
231
- class: [
232
- { "maz-is-dark": _vm.dark },
233
- "maz-search--" + _vm.color,
234
- "maz-search--" + _vm.size,
235
- ],
236
- on: {
237
- "!blur": function ($event) {
238
- return _vm.closeList.apply(null, arguments)
239
- },
240
- },
241
- },
242
- [
243
- _c(
244
- "MazInput",
245
- _vm._b(
246
- {
247
- ref: "textField",
248
- attrs: {
249
- color: _vm.color,
250
- loading: _vm.loading,
251
- debounce: _vm.debounce,
252
- size: _vm.size,
253
- },
254
- on: {
255
- input: _vm.inputEvent,
256
- keydown: _vm.keyboardNav,
257
- focus: _vm.openList,
258
- keyup: function ($event) {
259
- return _vm.$emit("keyup", $event)
260
- },
261
- change: function ($event) {
262
- return _vm.$emit("change", $event)
263
- },
264
- clear: function ($event) {
265
- return _vm.$emit("clear", $event)
266
- },
267
- blur: function ($event) {
268
- return _vm.$emit("blur", $event)
269
- },
270
- paste: function ($event) {
271
- return _vm.$emit("paste", $event)
272
- },
273
- click: function ($event) {
274
- return _vm.$emit("click", $event)
275
- },
276
- },
277
- model: {
278
- value: _vm.query,
279
- callback: function ($$v) {
280
- _vm.query = $$v
281
- },
282
- expression: "query",
283
- },
284
- },
285
- "MazInput",
286
- _vm.$attrs,
287
- false
288
- ),
289
- [
290
- _vm._t("icon-left", null, { slot: "icon-left" }),
291
- _vm._t("icon-right", null, { slot: "icon-right" }),
292
- ],
293
- 2
294
- ),
295
- _c("transition", { attrs: { name: "maz-slide" } }, [
296
- _vm.hasListOpen
297
- ? _c(
298
- "div",
299
- {
300
- ref: "itemsList",
301
- staticClass: "maz-search__items maz-elevation",
302
- },
303
- [
304
- _vm._l(_vm.items, function (item, i) {
305
- return _c(
306
- "button",
307
- {
308
- key: i,
309
- ref: "item",
310
- refInFor: true,
311
- staticClass: "maz-search__items__item",
312
- class: [
313
- {
314
- selected:
315
- _vm.value ===
316
- (_vm.itemValue
317
- ? _vm.getItemQuery(_vm.itemValue, item)
318
- : item),
319
- },
320
- { "keyboard-selected": _vm.tmpValue === item },
321
- ],
322
- attrs: { type: "button", tabindex: "-1" },
323
- on: {
324
- click: function ($event) {
325
- $event.stopPropagation()
326
- return _vm.updateValue(item)
327
- },
328
- },
329
- },
330
- [
331
- _vm._t(
332
- "default",
333
- function () {
334
- return [
335
- _c("p", [
336
- _vm._v(
337
- _vm._s(
338
- _vm.itemText
339
- ? _vm.getItemQuery(_vm.itemText, item)
340
- : item
341
- )
342
- ),
343
- ]),
344
- ]
345
- },
346
- { item: item, tag: "div" }
347
- ),
348
- ],
349
- 2
350
- )
351
- }),
352
- _vm.hasNoDataSlot
353
- ? _vm._t(
354
- "no-data",
355
- function () {
356
- return [
357
- _c(
358
- "div",
359
- {
360
- staticClass:
361
- "maz-search__no-data maz-p-2 maz-flex maz-flex-center",
362
- },
363
- [
364
- _c(
365
- "i",
366
- {
367
- staticClass: "material-icons maz-text-danger",
368
- },
369
- [_vm._v("\n search_off\n ")]
370
- ),
371
- ]
372
- ),
373
- ]
374
- },
375
- { tag: "div" }
376
- )
377
- : _vm._e(),
378
- ],
379
- 2
380
- )
381
- : _vm._e(),
382
- ]),
383
- ],
384
- 1
385
- )
386
- }
387
- var staticRenderFns = []
388
- render._withStripped = true
389
-
390
-
391
- // CONCATENATED MODULE: ./packages/components/MazSearch/_main.vue?vue&type=template&id=c5d051bc&
392
-
393
- // EXTERNAL MODULE: ./packages/components/MazInput/index.js + 5 modules
394
- var MazInput = __webpack_require__(8);
395
-
396
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/MazSearch/_main.vue?vue&type=script&lang=js&
397
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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
- //
431
- //
432
- //
433
- //
434
- //
435
- //
436
- //
437
- //
438
- //
439
- //
440
- //
441
- //
442
- //
443
- //
444
- //
445
- //
446
- //
447
- //
448
- //
449
- //
450
- //
451
- //
452
- //
453
- //
454
- //
455
- //
456
- //
457
- //
458
- //
459
- //
460
- //
461
- //
462
- //
463
- //
464
- //
465
- //
466
- //
467
- //
468
- //
469
- //
470
- //
471
- //
472
- //
473
- //
474
- //
475
- //
476
- //
477
- //
478
- //
479
- //
480
-
481
-
482
- var resolve = function resolve(path, obj) {
483
- var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
484
- var properties = Array.isArray(path) ? path : path.split(separator);
485
- return properties.reduce(function (prev, curr) {
486
- return prev && prev[curr];
487
- }, obj);
488
- };
489
- /**
490
- * > UI search input component. The search component extends MazInput, so all props/options of [MazInput](/documentation/maz-input) are available here.
491
- */
492
-
493
-
494
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
495
- name: 'MazSearch',
496
- components: {
497
- MazInput: MazInput["default"]
498
- },
499
- props: {
500
- // Is the value return when you select an item
501
- value: {
502
- validator: function validator(prop) {
503
- return ['string', 'number', 'boolean', 'object', 'array'].includes(_typeof(prop)) || prop === null;
504
- },
505
- required: true
506
- },
507
- // set the initial query input value (will emit "request" event on created)
508
- initialQuery: {
509
- type: String,
510
- default: null
511
- },
512
- // Array of your results request
513
- items: {
514
- type: Array,
515
- default: null
516
- },
517
- // It's a key name of your result object to be returned in the model
518
- itemValue: {
519
- type: String,
520
- default: null
521
- },
522
- // It's a key name of your result object to be shown in the list
523
- itemText: {
524
- type: String,
525
- default: null
526
- },
527
- // Enable or disable the `dark-mode`
528
- dark: {
529
- type: Boolean,
530
- default: false
531
- },
532
- // to show `no-data` slot (when you request has no results)
533
- noData: {
534
- type: Boolean,
535
- default: false
536
- },
537
- // Choose your color
538
- color: {
539
- type: String,
540
- default: 'primary'
541
- },
542
- // To open the list
543
- open: {
544
- type: Boolean,
545
- default: false
546
- },
547
- // Add loading effect to input
548
- loading: {
549
- type: Boolean,
550
- default: false
551
- },
552
- // Replace the query typed by the "item text" selected in list
553
- replaceOnSelect: {
554
- type: Boolean,
555
- default: false
556
- },
557
- // Clear query typed on select
558
- clearOnSelect: {
559
- type: Boolean,
560
- default: false
561
- },
562
- // remove debounce before send request
563
- debounce: {
564
- type: Boolean,
565
- default: true
566
- },
567
- // input size
568
- size: {
569
- type: String,
570
- default: 'md'
571
- }
572
- },
573
- data: function data() {
574
- return {
575
- query: this.initialQuery,
576
- listOpen: false,
577
- tmpValue: null,
578
- inDebounce: false
579
- };
580
- },
581
- computed: {
582
- tmpValueIndex: function tmpValueIndex() {
583
- var _this = this;
584
-
585
- return this.items.findIndex(function (c) {
586
- return c === _this.tmpValue;
587
- });
588
- },
589
- selectedValueIndex: function selectedValueIndex() {
590
- var _this2 = this;
591
-
592
- var itemValue = this.itemValue,
593
- items = this.items,
594
- value = this.value,
595
- getItemQuery = this.getItemQuery;
596
- return value && items && items.length ? items.findIndex(function (c) {
597
- return (itemValue ? getItemQuery(itemValue, c) : c) === _this2.value;
598
- }) : null;
599
- },
600
- hasEmptyQuery: function hasEmptyQuery() {
601
- return this.query === null || this.query === '';
602
- },
603
- hasNoDataSlot: function hasNoDataSlot() {
604
- return (!this.items || !this.items.length) && !this.hasEmptyQuery && this.noData && !this.inDebounce && !this.loading;
605
- },
606
- hasListOpen: function hasListOpen() {
607
- return this.open || this.listOpen;
608
- }
609
- },
610
- watch: {
611
- query: function query(oldValue, newValue) {
612
- if (oldValue !== newValue && !this.hasListOpen && !this.hasEmptyQuery) this.openList();
613
- }
614
- },
615
- created: function created() {
616
- if (this.initialQuery) this.inputEvent(this.initialQuery);
617
- },
618
- methods: {
619
- getItemQuery: function getItemQuery(query, item) {
620
- return resolve(query, item);
621
- },
622
- openList: function openList(e) {
623
- this.$emit('focus', e);
624
- this.listOpen = true;
625
- if (this.value) this.scrollToSelectedOnFocus(this.selectedValueIndex);
626
- },
627
- closeList: function closeList() {
628
- var _this3 = this;
629
-
630
- setTimeout(function () {
631
- _this3.listOpen = false;
632
- }, 300);
633
- },
634
- updateValue: function updateValue(item) {
635
- var itemValue = this.itemValue,
636
- itemText = this.itemText,
637
- replaceOnSelect = this.replaceOnSelect,
638
- clearOnSelect = this.clearOnSelect,
639
- getItemQuery = this.getItemQuery;
640
- var valueReturned = itemValue ? getItemQuery(itemValue, item) : item; // event sent when user select an item in the items list
641
- // @arg The argument is a the item or an item[key] if you use `item-value`
642
-
643
- this.$emit('input', valueReturned);
644
-
645
- if (replaceOnSelect) {
646
- this.query = itemText ? getItemQuery(itemText, item) : JSON.stringify(item);
647
- } else if (clearOnSelect) {
648
- this.query = null;
649
- }
650
-
651
- this.closeList();
652
- },
653
- inputEvent: function inputEvent(q) {
654
- this.$emit('request', q);
655
- },
656
- scrollToSelectedOnFocus: function scrollToSelectedOnFocus(arrayIndex) {
657
- var _this4 = this;
658
-
659
- this.$nextTick(function () {
660
- var itemHeight = _this4.$refs.item && _this4.$refs.item[0] && _this4.$refs.item[0].clientHeight;
661
- if (_this4.$refs.itemsList) _this4.$refs.itemsList.scrollTop = arrayIndex * itemHeight - itemHeight;
662
- });
663
- },
664
- keyboardNav: function keyboardNav(e) {
665
- this.$emit('keydown', e);
666
- if (!Array.isArray(this.items) || !this.items.length) return;
667
- var code = e.keyCode;
668
-
669
- if (code === 40 || code === 38) {
670
- if (!this.hasListOpen) this.openList();
671
- var index = code === 40 ? this.tmpValueIndex + 1 : this.tmpValueIndex - 1;
672
-
673
- if (index === -1 || index >= this.items.length) {
674
- index = index === -1 ? this.items.length - 1 : 0;
675
- }
676
-
677
- this.tmpValue = this.items[index];
678
- this.scrollToSelectedOnFocus(index);
679
- } else if (code === 13) {
680
- // enter key
681
- e.preventDefault();
682
- this.hasListOpen ? this.updateValue(this.tmpValue) : this.openList();
683
- } else if (code === 27) {
684
- // escape key
685
- this.closeList();
686
- }
687
- }
688
- }
689
- });
690
- // CONCATENATED MODULE: ./packages/components/MazSearch/_main.vue?vue&type=script&lang=js&
691
- /* harmony default export */ var MazSearch_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
692
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
693
- var componentNormalizer = __webpack_require__(0);
694
-
695
- // CONCATENATED MODULE: ./packages/components/MazSearch/_main.vue
696
-
697
-
698
-
699
-
700
-
701
- /* normalize component */
702
-
703
- var component = Object(componentNormalizer["a" /* default */])(
704
- MazSearch_mainvue_type_script_lang_js_,
705
- render,
706
- staticRenderFns,
707
- false,
708
- null,
709
- null,
710
- null
711
-
712
- )
713
-
714
- /* hot reload */
715
- if (false) { var api; }
716
- component.options.__file = "packages/components/MazSearch/_main.vue"
717
- /* harmony default export */ var _main = (component.exports);
718
- // CONCATENATED MODULE: ./packages/components/MazSearch/index.js
719
-
720
-
721
- _main.install = function (Vue) {
722
- Vue.component(_main.name, _main);
723
- };
724
-
725
- /* harmony default export */ var MazSearch = __webpack_exports__["default"] = (_main);
726
-
727
- /***/ }),
728
-
729
- /***/ 6:
730
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
731
-
732
- "use strict";
733
-
734
- // EXPORTS
735
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ debounce; });
736
- __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ pascalCaseToKebabCase; });
737
-
738
- // CONCATENATED MODULE: ./packages/utils/debounce.js
739
- /* harmony default export */ var debounce = (function (func, delay) {
740
- var debounceTimer;
741
- return function () {
742
- var context = this;
743
- var args = arguments;
744
- clearTimeout(debounceTimer);
745
- debounceTimer = setTimeout(function () {
746
- return func.apply(context, args);
747
- }, delay);
748
- };
749
- });
750
- // CONCATENATED MODULE: ./packages/utils/pascalCaseToKebabCase.js
751
- /* harmony default export */ var pascalCaseToKebabCase = (function (string) {
752
- return string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2').toLowerCase();
753
- });
754
- // CONCATENATED MODULE: ./packages/utils/index.js
755
-
756
-
757
-
758
- /***/ }),
759
-
760
- /***/ 8:
761
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
762
-
763
- "use strict";
764
- // ESM COMPAT FLAG
765
- __webpack_require__.r(__webpack_exports__);
766
-
767
- // 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&
768
- var render = function () {
769
- var _vm = this
770
- var _h = _vm.$createElement
771
- var _c = _vm._self._c || _h
772
- return _c(
773
- "div",
774
- {
775
- ref: "parent",
776
- staticClass:
777
- "maz-base-component maz-input maz-border maz-border-color maz-border-color-hover maz-border-solid maz-border-radius",
778
- class: [
779
- {
780
- "is-focused": _vm.isFocus || _vm.focus,
781
- "is-valid": _vm.success,
782
- "has-value": _vm.value,
783
- "is-textarea": _vm.textarea,
784
- "has-error": _vm.error,
785
- "has-warning": _vm.warning,
786
- "is-disabled": _vm.disabled,
787
- "maz-is-dark": _vm.dark,
788
- "has-hint": _vm.hint,
789
- "has-no-label": !_vm.hasLabel && !_vm.hint,
790
- "has-left-icon": _vm.hasLeftIcon(),
791
- },
792
- "maz-input--" + _vm.size,
793
- "has-" + _vm.leftNumberIcon + "-right-icon",
794
- "maz-input--" + _vm.color,
795
- ],
796
- on: { click: _vm.focusInput },
797
- },
798
- [
799
- _vm.hasLeftIcon()
800
- ? _c(
801
- "div",
802
- {
803
- staticClass: "maz-input__icon maz-flex left",
804
- class: [
805
- _vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center",
806
- ],
807
- },
808
- [
809
- _vm._t("icon-left", function () {
810
- return [
811
- _c("i", { staticClass: "material-icons" }, [
812
- _vm._v(_vm._s(_vm.leftIconName)),
813
- ]),
814
- ]
815
- }),
816
- ],
817
- 2
818
- )
819
- : _vm._e(),
820
- _vm.hasRightIcon()
821
- ? _c(
822
- "div",
823
- {
824
- staticClass: "maz-input__icon maz-flex right",
825
- class: [
826
- _vm.textarea ? "maz-align-start maz-pt-2" : "maz-align-center",
827
- ],
828
- },
829
- [
830
- _vm._t("icon-right", function () {
831
- return [
832
- _c("i", { staticClass: "material-icons" }, [
833
- _vm._v(_vm._s(_vm.rightIconName)),
834
- ]),
835
- ]
836
- }),
837
- ],
838
- 2
839
- )
840
- : _vm._e(),
841
- _vm.getType === "checkbox" && !_vm.textarea
842
- ? _c(
843
- "input",
844
- _vm._b(
845
- {
846
- directives: [
847
- {
848
- name: "model",
849
- rawName: "v-model",
850
- value: _vm.inputValue,
851
- expression: "inputValue",
852
- },
853
- ],
854
- ref: "MazInput",
855
- staticClass: "maz-input__input maz-border-radius",
856
- class: {
857
- "has-right-icon":
858
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
859
- },
860
- attrs: {
861
- id: _vm.uniqueId,
862
- placeholder: _vm.placeholderValue,
863
- "aria-label": _vm.placeholder,
864
- disabled: _vm.disabled,
865
- required: _vm.required,
866
- readonly: _vm.readonly,
867
- type: "checkbox",
868
- },
869
- domProps: {
870
- checked: Array.isArray(_vm.inputValue)
871
- ? _vm._i(_vm.inputValue, null) > -1
872
- : _vm.inputValue,
873
- },
874
- on: {
875
- keydown: _vm.keyDown,
876
- keyup: _vm.keyUp,
877
- focus: _vm.onFocus,
878
- blur: _vm.onBlur,
879
- paste: _vm.onPaste,
880
- change: [
881
- function ($event) {
882
- var $$a = _vm.inputValue,
883
- $$el = $event.target,
884
- $$c = $$el.checked ? true : false
885
- if (Array.isArray($$a)) {
886
- var $$v = null,
887
- $$i = _vm._i($$a, $$v)
888
- if ($$el.checked) {
889
- $$i < 0 && (_vm.inputValue = $$a.concat([$$v]))
890
- } else {
891
- $$i > -1 &&
892
- (_vm.inputValue = $$a
893
- .slice(0, $$i)
894
- .concat($$a.slice($$i + 1)))
895
- }
896
- } else {
897
- _vm.inputValue = $$c
898
- }
899
- },
900
- _vm.onChange,
901
- ],
902
- click: function ($event) {
903
- return _vm.$emit("click", $event)
904
- },
905
- },
906
- },
907
- "input",
908
- _vm.$attrs,
909
- false
910
- )
911
- )
912
- : _vm.getType === "radio" && !_vm.textarea
913
- ? _c(
914
- "input",
915
- _vm._b(
916
- {
917
- directives: [
918
- {
919
- name: "model",
920
- rawName: "v-model",
921
- value: _vm.inputValue,
922
- expression: "inputValue",
923
- },
924
- ],
925
- ref: "MazInput",
926
- staticClass: "maz-input__input maz-border-radius",
927
- class: {
928
- "has-right-icon":
929
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
930
- },
931
- attrs: {
932
- id: _vm.uniqueId,
933
- placeholder: _vm.placeholderValue,
934
- "aria-label": _vm.placeholder,
935
- disabled: _vm.disabled,
936
- required: _vm.required,
937
- readonly: _vm.readonly,
938
- type: "radio",
939
- },
940
- domProps: { checked: _vm._q(_vm.inputValue, null) },
941
- on: {
942
- keydown: _vm.keyDown,
943
- keyup: _vm.keyUp,
944
- focus: _vm.onFocus,
945
- blur: _vm.onBlur,
946
- paste: _vm.onPaste,
947
- change: [
948
- function ($event) {
949
- _vm.inputValue = null
950
- },
951
- _vm.onChange,
952
- ],
953
- click: function ($event) {
954
- return _vm.$emit("click", $event)
955
- },
956
- },
957
- },
958
- "input",
959
- _vm.$attrs,
960
- false
961
- )
962
- )
963
- : !_vm.textarea
964
- ? _c(
965
- "input",
966
- _vm._b(
967
- {
968
- directives: [
969
- {
970
- name: "model",
971
- rawName: "v-model",
972
- value: _vm.inputValue,
973
- expression: "inputValue",
974
- },
975
- ],
976
- ref: "MazInput",
977
- staticClass: "maz-input__input maz-border-radius",
978
- class: {
979
- "has-right-icon":
980
- _vm.hasClearBtn || _vm.hasPasswordBtn || _vm.hasRightIcon(),
981
- },
982
- attrs: {
983
- id: _vm.uniqueId,
984
- placeholder: _vm.placeholderValue,
985
- "aria-label": _vm.placeholder,
986
- disabled: _vm.disabled,
987
- required: _vm.required,
988
- readonly: _vm.readonly,
989
- type: _vm.getType,
990
- },
991
- domProps: { value: _vm.inputValue },
992
- on: {
993
- keydown: _vm.keyDown,
994
- keyup: _vm.keyUp,
995
- focus: _vm.onFocus,
996
- blur: _vm.onBlur,
997
- paste: _vm.onPaste,
998
- change: _vm.onChange,
999
- click: function ($event) {
1000
- return _vm.$emit("click", $event)
1001
- },
1002
- input: function ($event) {
1003
- if ($event.target.composing) {
1004
- return
1005
- }
1006
- _vm.inputValue = $event.target.value
1007
- },
1008
- },
1009
- },
1010
- "input",
1011
- _vm.$attrs,
1012
- false
1013
- )
1014
- )
1015
- : _c(
1016
- "textarea",
1017
- _vm._b(
1018
- {
1019
- directives: [
1020
- {
1021
- name: "model",
1022
- rawName: "v-model",
1023
- value: _vm.inputValue,
1024
- expression: "inputValue",
1025
- },
1026
- ],
1027
- ref: "MazInput",
1028
- staticClass: "maz-input__input maz-textarea",
1029
- attrs: {
1030
- id: _vm.uniqueId,
1031
- placeholder: _vm.placeholderValue,
1032
- type: _vm.type,
1033
- required: _vm.required,
1034
- readonly: _vm.readonly,
1035
- },
1036
- domProps: { value: _vm.inputValue },
1037
- on: {
1038
- keydown: _vm.keyDown,
1039
- keyup: _vm.keyUp,
1040
- focus: _vm.onFocus,
1041
- blur: _vm.onBlur,
1042
- paste: _vm.onPaste,
1043
- change: _vm.onChange,
1044
- click: function ($event) {
1045
- return _vm.$emit("click", $event)
1046
- },
1047
- input: function ($event) {
1048
- if ($event.target.composing) {
1049
- return
1050
- }
1051
- _vm.inputValue = $event.target.value
1052
- },
1053
- },
1054
- },
1055
- "textarea",
1056
- _vm.$attrs,
1057
- false
1058
- )
1059
- ),
1060
- _vm.hasLabel || _vm.hint
1061
- ? _c(
1062
- "label",
1063
- {
1064
- ref: "label",
1065
- staticClass: "maz-input__label",
1066
- class: _vm.error ? "maz-text-danger" : null,
1067
- attrs: { for: _vm.uniqueId, tabindex: "-1" },
1068
- on: { click: _vm.focusInput },
1069
- },
1070
- [
1071
- _vm._v(
1072
- "\n " +
1073
- _vm._s(_vm.hintValue || _vm.placeholderValue) +
1074
- "\n "
1075
- ),
1076
- ]
1077
- )
1078
- : _vm._e(),
1079
- _c("transition-group", { attrs: { name: "maz-scale" } }, [
1080
- _vm.hasClearBtn
1081
- ? _c(
1082
- "button",
1083
- {
1084
- key: "clear-button",
1085
- staticClass:
1086
- "maz-input__toggle-btn --clear maz-flex maz-flex-center",
1087
- class: { "has-right-icon": _vm.hasRightIcon() },
1088
- attrs: { title: "clear", type: "button", tabindex: "-1" },
1089
- on: {
1090
- click: function ($event) {
1091
- $event.stopPropagation()
1092
- return _vm.clear.apply(null, arguments)
1093
- },
1094
- },
1095
- },
1096
- [
1097
- _c(
1098
- "i",
1099
- { staticClass: "maz-input__toggle-btn__icon material-icons" },
1100
- [_vm._v("\n close\n ")]
1101
- ),
1102
- ]
1103
- )
1104
- : _vm._e(),
1105
- _vm.hasPasswordBtn
1106
- ? _c(
1107
- "button",
1108
- {
1109
- key: "password-button",
1110
- staticClass:
1111
- "maz-input__toggle-btn password maz-flex maz-flex-center",
1112
- class: {
1113
- "has-clear-btn": _vm.hasClearBtn,
1114
- "has-right-icon": _vm.hasRightIcon(),
1115
- },
1116
- attrs: { title: "clear", type: "button", tabindex: "-1" },
1117
- on: {
1118
- click: function ($event) {
1119
- _vm.showPassword = !_vm.showPassword
1120
- },
1121
- },
1122
- },
1123
- [
1124
- _c(
1125
- "i",
1126
- { staticClass: "maz-input__toggle-btn__icon material-icons" },
1127
- [
1128
- _vm._v(
1129
- "\n " +
1130
- _vm._s(
1131
- _vm.showPassword ? "visibility_off" : "visibility"
1132
- ) +
1133
- "\n "
1134
- ),
1135
- ]
1136
- ),
1137
- ]
1138
- )
1139
- : _vm._e(),
1140
- ]),
1141
- _vm.loading
1142
- ? _c(
1143
- "div",
1144
- {
1145
- staticClass: "maz-input__loader",
1146
- class: { textarea: _vm.textarea },
1147
- },
1148
- [_c("div", { staticClass: "maz-input__loader__progress-bar" })]
1149
- )
1150
- : _vm._e(),
1151
- ],
1152
- 1
1153
- )
1154
- }
1155
- var staticRenderFns = []
1156
- render._withStripped = true
1157
-
1158
-
1159
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=template&id=5b617c72&
1160
-
1161
- // EXTERNAL MODULE: ./packages/mixins/uniqueId.js
1162
- var uniqueId = __webpack_require__(2);
1163
-
1164
- // EXTERNAL MODULE: ./packages/utils/index.js + 2 modules
1165
- var utils = __webpack_require__(6);
1166
-
1167
- // 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&
1168
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1169
-
1170
- //
1171
- //
1172
- //
1173
- //
1174
- //
1175
- //
1176
- //
1177
- //
1178
- //
1179
- //
1180
- //
1181
- //
1182
- //
1183
- //
1184
- //
1185
- //
1186
- //
1187
- //
1188
- //
1189
- //
1190
- //
1191
- //
1192
- //
1193
- //
1194
- //
1195
- //
1196
- //
1197
- //
1198
- //
1199
- //
1200
- //
1201
- //
1202
- //
1203
- //
1204
- //
1205
- //
1206
- //
1207
- //
1208
- //
1209
- //
1210
- //
1211
- //
1212
- //
1213
- //
1214
- //
1215
- //
1216
- //
1217
- //
1218
- //
1219
- //
1220
- //
1221
- //
1222
- //
1223
- //
1224
- //
1225
- //
1226
- //
1227
- //
1228
- //
1229
- //
1230
- //
1231
- //
1232
- //
1233
- //
1234
- //
1235
- //
1236
- //
1237
- //
1238
- //
1239
- //
1240
- //
1241
- //
1242
- //
1243
- //
1244
- //
1245
- //
1246
- //
1247
- //
1248
- //
1249
- //
1250
- //
1251
- //
1252
- //
1253
- //
1254
- //
1255
- //
1256
- //
1257
- //
1258
- //
1259
- //
1260
- //
1261
- //
1262
- //
1263
- //
1264
- //
1265
- //
1266
- //
1267
- //
1268
- //
1269
- //
1270
- //
1271
- //
1272
- //
1273
- //
1274
- //
1275
- //
1276
- //
1277
- //
1278
- //
1279
- //
1280
- //
1281
- //
1282
- //
1283
- //
1284
- //
1285
- //
1286
- //
1287
- //
1288
- //
1289
- //
1290
- //
1291
- //
1292
- //
1293
- //
1294
- //
1295
- //
1296
- //
1297
- //
1298
- //
1299
- //
1300
- //
1301
- //
1302
- //
1303
- //
1304
- //
1305
- //
1306
- //
1307
- //
1308
- //
1309
- //
1310
- //
1311
- //
1312
- //
1313
- //
1314
- //
1315
- //
1316
-
1317
-
1318
- var DEBOUNCE = 500;
1319
- /**
1320
- * > Beautiful input UI with loading & error manager
1321
- */
1322
-
1323
- /* harmony default export */ var _mainvue_type_script_lang_js_ = ({
1324
- name: 'MazInput',
1325
- mixins: [uniqueId["a" /* default */]],
1326
- props: {
1327
- // value of the input
1328
- value: {
1329
- validator: function validator(prop) {
1330
- return ['string', 'number'].includes(_typeof(prop)) || prop === null;
1331
- },
1332
- default: null
1333
- },
1334
- // input id
1335
- id: {
1336
- type: String,
1337
- default: null
1338
- },
1339
- // value of the input
1340
- placeholder: {
1341
- type: String,
1342
- default: 'Enter text'
1343
- },
1344
- // replace the label if is present
1345
- hint: {
1346
- type: String,
1347
- default: null
1348
- },
1349
- // input size (`'lg'` / `'sm'`)
1350
- size: {
1351
- type: String,
1352
- default: null
1353
- },
1354
- // is the input size (`text` or `number`)
1355
- type: {
1356
- type: String,
1357
- default: 'text'
1358
- },
1359
- // should be a [material icon](https://material.io/resources/icons/) name
1360
- leftIconName: {
1361
- type: String,
1362
- default: null
1363
- },
1364
- // should be a [material icon](https://material.io/resources/icons/) name
1365
- rightIconName: {
1366
- type: String,
1367
- default: null
1368
- },
1369
- // When is `true` the input has the error style
1370
- error: {
1371
- type: Boolean,
1372
- default: false
1373
- },
1374
- // When is `true` the input has the warning style
1375
- warning: {
1376
- type: Boolean,
1377
- default: false
1378
- },
1379
- // When is `true` the input is disable
1380
- disabled: {
1381
- type: Boolean,
1382
- default: false
1383
- },
1384
- // When is `true` the input has the dark theme
1385
- dark: {
1386
- type: Boolean,
1387
- default: false
1388
- },
1389
- // When is `true` the input is on readonly mode
1390
- readonly: {
1391
- type: Boolean,
1392
- default: false
1393
- },
1394
- // When is `true` the input has the valid style
1395
- success: {
1396
- type: Boolean,
1397
- default: false
1398
- },
1399
- // When is `true` the input become required & has the `*` symbol
1400
- required: {
1401
- type: Boolean,
1402
- default: false
1403
- },
1404
- // When is `true` the input is a textarea
1405
- textarea: {
1406
- type: Boolean,
1407
- default: false
1408
- },
1409
- // When is `true` the input has a progress bar animated
1410
- loading: {
1411
- type: Boolean,
1412
- default: false
1413
- },
1414
- // When is `true` the input can be clear with a button on the right
1415
- clearable: {
1416
- type: Boolean,
1417
- default: false
1418
- },
1419
- // When is `true` the input has not label (top placeholder when value is not empty)
1420
- noLabel: {
1421
- type: Boolean,
1422
- default: false
1423
- },
1424
- // When is `true` and is `required`, the `*` symbol is not showing
1425
- noRequiredSymbol: {
1426
- type: Boolean,
1427
- default: false
1428
- },
1429
- // force focus style input
1430
- focus: {
1431
- type: Boolean,
1432
- default: false
1433
- },
1434
- // color name in basic colors
1435
- color: {
1436
- type: String,
1437
- default: 'primary'
1438
- },
1439
- // Add a debounce of 500ms to emit the value
1440
- debounce: {
1441
- type: Boolean,
1442
- default: false
1443
- }
1444
- },
1445
- data: function data() {
1446
- return {
1447
- isFocus: false,
1448
- showPassword: false
1449
- };
1450
- },
1451
- computed: {
1452
- inputValue: {
1453
- get: function get() {
1454
- return this.value;
1455
- },
1456
- set: function set(value) {
1457
- var valueToEmit = this.hasNumberType ? !value ? 0 : parseInt(value) : value;
1458
- this.emitValue(valueToEmit);
1459
- }
1460
- },
1461
- placeholderValue: function placeholderValue() {
1462
- var placeholder = this.placeholder;
1463
- if (this.required && placeholder && !this.noRequiredSymbol) placeholder += ' *';
1464
- return placeholder;
1465
- },
1466
- hintValue: function hintValue() {
1467
- var hint = this.hint;
1468
- if (this.required && hint) hint += ' *';
1469
- return hint;
1470
- },
1471
- hasNumberType: function hasNumberType() {
1472
- return this.type === 'number';
1473
- },
1474
- hasLabel: function hasLabel() {
1475
- return !this.noLabel;
1476
- },
1477
- getType: function getType() {
1478
- return this.showPassword ? 'text' : this.type;
1479
- },
1480
- hasPasswordBtn: function hasPasswordBtn() {
1481
- return this.type === 'password' && this.inputValue;
1482
- },
1483
- hasClearBtn: function hasClearBtn() {
1484
- return this.clearable && this.inputValue && !this.textarea;
1485
- },
1486
- leftNumberIcon: function leftNumberIcon() {
1487
- var array = [!!this.hasRightIcon(), !!this.hasClearBtn, !!this.hasPasswordBtn];
1488
- return array.filter(function (a) {
1489
- return a;
1490
- }).length;
1491
- }
1492
- },
1493
- methods: {
1494
- debounceValue: Object(utils["a" /* debounce */])(function (value) {
1495
- // return the input value (in `@input` or `v-model`)
1496
- // @arg input
1497
- this.$emit('input', value);
1498
- }, DEBOUNCE),
1499
- emitValue: function emitValue(value) {
1500
- if (this.debounce) return this.debounceValue(value);
1501
- this.$emit('input', value);
1502
- },
1503
- hasLeftIcon: function hasLeftIcon() {
1504
- return this.leftIconName || this.$slots['icon-left'];
1505
- },
1506
- hasRightIcon: function hasRightIcon() {
1507
- return this.rightIconName || this.$slots['icon-right'];
1508
- },
1509
- focusInput: function focusInput() {
1510
- this.$refs.MazInput.focus();
1511
- },
1512
- onFocus: function onFocus(e) {
1513
- // sent the focus event
1514
- // @arg event
1515
- this.$emit('focus', e);
1516
- this.isFocus = true;
1517
- },
1518
- onBlur: function onBlur(e) {
1519
- // sent the blur event
1520
- // @arg event
1521
- this.$emit('blur', e);
1522
- this.isFocus = false;
1523
- },
1524
- onPaste: function onPaste(e) {
1525
- // sent when text is past in the textfield
1526
- // @arg event
1527
- this.$emit('paste', e);
1528
- },
1529
- onChange: function onChange(e) {
1530
- // sent on input change
1531
- // @arg event
1532
- this.$emit('change', e);
1533
- },
1534
- clear: function clear() {
1535
- this.$emit('input', this.hasNumberType ? 0 : ''); // sent when the input is clear
1536
-
1537
- this.$emit('clear');
1538
- },
1539
- keyUp: function keyUp(e) {
1540
- // sent the keyup event
1541
- // @arg event
1542
- this.$emit('keyup', e);
1543
- },
1544
- keyDown: function keyDown(e) {
1545
- // sent the keydown event
1546
- // @arg event
1547
- this.$emit('keydown', e);
1548
- }
1549
- }
1550
- });
1551
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue?vue&type=script&lang=js&
1552
- /* harmony default export */ var MazInput_mainvue_type_script_lang_js_ = (_mainvue_type_script_lang_js_);
1553
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1554
- var componentNormalizer = __webpack_require__(0);
1555
-
1556
- // CONCATENATED MODULE: ./packages/components/MazInput/_main.vue
1557
-
1558
-
1559
-
1560
-
1561
-
1562
- /* normalize component */
1563
-
1564
- var component = Object(componentNormalizer["a" /* default */])(
1565
- MazInput_mainvue_type_script_lang_js_,
1566
- render,
1567
- staticRenderFns,
1568
- false,
1569
- null,
1570
- null,
1571
- null
1572
-
1573
- )
1574
-
1575
- /* hot reload */
1576
- if (false) { var api; }
1577
- component.options.__file = "packages/components/MazInput/_main.vue"
1578
- /* harmony default export */ var _main = (component.exports);
1579
- // CONCATENATED MODULE: ./packages/components/MazInput/index.js
1580
-
1581
-
1582
- _main.install = function (Vue) {
1583
- Vue.component(_main.name, _main);
1584
- };
1585
-
1586
- /* harmony default export */ var MazInput = __webpack_exports__["default"] = (_main);
1587
-
1588
- /***/ })
1589
-
1590
- /******/ });