maz-ui 3.19.2 → 3.19.3

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.
@@ -1,6 +1,6 @@
1
1
  import "../assets/MazSpinner.css";
2
2
  import { defineComponent, openBlock, createElementBlock, normalizeClass, pushScopeId, popScopeId, createElementVNode } from "vue";
3
- import { _ as _export_sfc } from "./MazPhoneNumberInput-901c4fa6.mjs";
3
+ import { _ as _export_sfc } from "./MazPhoneNumberInput-e4f90230.mjs";
4
4
  const _withScopeId = (n) => (pushScopeId("data-v-c67298ec"), n = n(), popScopeId(), n);
5
5
  const _hoisted_1 = ["width", "height"];
6
6
  const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
package/nuxt/index.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "3.19.2"
7
+ "version": "3.19.3"
8
8
  }
package/nuxt/index.mjs CHANGED
@@ -12,11 +12,8 @@ import __cjs_mod__ from 'module';
12
12
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
13
13
  const __dirname = __cjs_path__.dirname(__filename);
14
14
  const require = __cjs_mod__.createRequire(import.meta.url);
15
- function isObject(value) {
16
- return value !== null && typeof value === "object";
17
- }
18
15
  function _defu(baseObject, defaults, namespace = ".", merger) {
19
- if (!isObject(defaults)) {
16
+ if (!_isPlainObject(defaults)) {
20
17
  return _defu(baseObject, {}, namespace, merger);
21
18
  }
22
19
  const object = Object.assign({}, defaults);
@@ -33,7 +30,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
33
30
  }
34
31
  if (Array.isArray(value) && Array.isArray(object[key])) {
35
32
  object[key] = [...value, ...object[key]];
36
- } else if (isObject(value) && isObject(object[key])) {
33
+ } else if (_isPlainObject(value) && _isPlainObject(object[key])) {
37
34
  object[key] = _defu(
38
35
  value,
39
36
  object[key],
@@ -46,6 +43,13 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
46
43
  }
47
44
  return object;
48
45
  }
46
+ function _isPlainObject(value) {
47
+ if (value === null || typeof value !== "object") {
48
+ return false;
49
+ }
50
+ const prototype = Object.getPrototypeOf(value);
51
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
52
+ }
49
53
  function createDefu(merger) {
50
54
  return (...arguments_) => (
51
55
  // eslint-disable-next-line unicorn/no-array-reduce
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.19.2",
3
+ "version": "3.19.3",
4
4
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
5
5
  "author": "Louis Mazel <me@loicmazuel.com>",
6
6
  "main": "./modules/index.mjs",
@@ -99,10 +99,10 @@
99
99
  "@nuxt/kit": "^3.8.0",
100
100
  "@nuxt/schema": "^3.8.0",
101
101
  "@types/dropzone": "^5.7.6",
102
- "@types/google.maps": "^3.54.4",
102
+ "@types/google.maps": "^3.54.5",
103
103
  "@vitejs/plugin-vue": "^4.4.0",
104
104
  "@vitest/coverage-v8": "^0.34.6",
105
- "@vue/compiler-sfc": "^3.3.6",
105
+ "@vue/compiler-sfc": "^3.3.7",
106
106
  "@vue/eslint-config-prettier": "^8.0.0",
107
107
  "@vue/eslint-config-typescript": "^12.0.0",
108
108
  "@vue/test-utils": "^2.4.1",
@@ -112,14 +112,14 @@
112
112
  "chalk": "^4.1.2",
113
113
  "chart.js": "^4.4.0",
114
114
  "dayjs": "^1.11.10",
115
- "defu": "^6.1.2",
115
+ "defu": "^6.1.3",
116
116
  "dropzone": "^5.9.3",
117
- "eslint-plugin-vue": "^9.17.0",
117
+ "eslint-plugin-vue": "^9.18.0",
118
118
  "eslint-plugin-vuejs-accessibility": "^2.2.0",
119
119
  "fs": "0.0.2",
120
120
  "jsdom": "^22.1.0",
121
121
  "json-templater": "^1.2.0",
122
- "libphonenumber-js": "^1.10.48",
122
+ "libphonenumber-js": "^1.10.49",
123
123
  "minimist": "^1.2.8",
124
124
  "nuxt": "^3.8.0",
125
125
  "onchange": "^7.1.0",
@@ -133,7 +133,7 @@
133
133
  "prettier-plugin-tailwindcss": "^0.5.6",
134
134
  "replace-in-file": "^7.0.1",
135
135
  "rimraf": "^5.0.5",
136
- "sass": "^1.69.4",
136
+ "sass": "^1.69.5",
137
137
  "semver": "^7.5.4",
138
138
  "sirv": "^2.0.3",
139
139
  "stylelint": "^15.11.0",
@@ -141,7 +141,7 @@
141
141
  "stylelint-config-standard": "^34.0.0",
142
142
  "stylelint-config-standard-scss": "^11.0.0",
143
143
  "stylelint-config-tailwindcss": "^0.0.7",
144
- "tailwindcss": "^3.3.3",
144
+ "tailwindcss": "^3.3.5",
145
145
  "terser": "^5.22.0",
146
146
  "vite": "^4.5.0",
147
147
  "vite-plugin-css-injected-by-js": "^3.3.0",
@@ -150,12 +150,12 @@
150
150
  "vite-svg-loader": "^4.0.0",
151
151
  "vitest": "^0.34.6",
152
152
  "vitest-canvas-mock": "^0.3.3",
153
- "vue": "^3.3.6",
153
+ "vue": "^3.3.7",
154
154
  "vue-chartjs": "^5.2.0",
155
155
  "vue-loader": "^17.3.0",
156
156
  "vue-router": "^4.2.5",
157
157
  "vue-scrollto": "^2.20.0",
158
- "vue-tsc": "^1.8.20"
158
+ "vue-tsc": "^1.8.22"
159
159
  },
160
160
  "engines": {
161
161
  "node": ">= 6.0.0",
@@ -32,6 +32,9 @@ type __VLS_WithDefaults<P, D> = {
32
32
  default: D[K];
33
33
  }> : P[K];
34
34
  };
35
+ type __VLS_Prettify<T> = {
36
+ [K in keyof T]: T[K];
37
+ } & {};
35
38
  type __VLS_WithTemplateSlots<T, S> = T & {
36
39
  new (): {
37
40
  $slots: S;
@@ -71,3 +71,6 @@ type __VLS_WithDefaults<P, D> = {
71
71
  default: D[K];
72
72
  }> : P[K];
73
73
  };
74
+ type __VLS_Prettify<T> = {
75
+ [K in keyof T]: T[K];
76
+ } & {};
@@ -1,4 +1,3 @@
1
- import type { Config } from 'tailwindcss';
2
1
  declare const _default: {
3
2
  darkMode: ["class", string];
4
3
  content: never[];
@@ -71,7 +70,7 @@ declare const _default: {
71
70
  };
72
71
  plugins: {
73
72
  handler: import("tailwindcss/types/config").PluginCreator;
74
- config?: Partial<Config> | undefined;
73
+ config?: Partial<import("tailwindcss/types/config").Config> | undefined;
75
74
  }[];
76
75
  };
77
76
  export default _default;
@@ -1,344 +0,0 @@
1
- import "../assets/MazInput.css";
2
- import { defineComponent, ref, getCurrentInstance, onMounted, computed, defineAsyncComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, createCommentVNode, withDirectives, mergeProps, toHandlers, vModelDynamic, createTextVNode, toDisplayString, createBlock, withModifiers, withCtx } from "vue";
3
- import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-901c4fa6.mjs";
4
- function debounce(func, delay) {
5
- let timeoutId;
6
- return (...args) => {
7
- if (timeoutId) {
8
- clearTimeout(timeoutId);
9
- }
10
- timeoutId = setTimeout(() => {
11
- func(...args);
12
- }, delay);
13
- };
14
- }
15
- const MazBtn = defineAsyncComponent(() => import("./MazBtn-0d8e3249.mjs"));
16
- const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
17
- const EyeOffIcon = defineAsyncComponent(() => import("./eye-slash-3c6844fc.mjs"));
18
- const EyeIcon = defineAsyncComponent(() => import("./eye-290c6a03.mjs"));
19
- const CheckIcon = defineAsyncComponent(() => import("./check-b1507ce9.mjs"));
20
- const _sfc_main = defineComponent({
21
- components: {
22
- MazBtn,
23
- MazIcon,
24
- CheckIcon,
25
- EyeIcon,
26
- EyeOffIcon
27
- },
28
- inheritAttrs: false,
29
- props: {
30
- modelValue: {
31
- type: [String, Number, Boolean],
32
- default: void 0
33
- },
34
- placeholder: { type: String, default: void 0 },
35
- color: {
36
- type: String,
37
- default: "primary"
38
- },
39
- label: { type: String, default: void 0 },
40
- name: { type: String, default: "input" },
41
- type: {
42
- type: String,
43
- default: "text",
44
- validator: (value) => {
45
- return [
46
- "text",
47
- "date",
48
- "number",
49
- "tel",
50
- "search",
51
- "url",
52
- "password",
53
- "month",
54
- "time",
55
- "week",
56
- "email"
57
- ].includes(value);
58
- }
59
- },
60
- required: { type: Boolean, default: false },
61
- disabled: { type: Boolean, default: false },
62
- readonly: { type: Boolean, default: false },
63
- id: { type: String, default: void 0 },
64
- error: { type: Boolean, default: false },
65
- success: { type: Boolean, default: false },
66
- warning: { type: Boolean, default: false },
67
- hint: { type: String, default: void 0 },
68
- inputClasses: { type: String, default: void 0 },
69
- noBorder: { type: Boolean, default: false },
70
- noRadius: { type: Boolean, default: false },
71
- size: {
72
- type: String,
73
- default: "md",
74
- validator: (value) => {
75
- return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
76
- }
77
- },
78
- debounce: { type: Boolean, default: false },
79
- debounceDelay: { type: Number, default: 500 },
80
- validButton: { type: Boolean, default: false },
81
- validButtonLoading: { type: Boolean, default: false },
82
- autoFocus: { type: Boolean, default: false },
83
- borderActive: { type: Boolean, default: false },
84
- leftIcon: { type: String, default: void 0 },
85
- rightIcon: { type: String, default: void 0 }
86
- },
87
- emits: ["focus", "blur", "update:model-value", "click", "change", "update"],
88
- setup(props, { emit, slots }) {
89
- const hasPasswordVisible = ref(false);
90
- const isFocused = ref(false);
91
- const input = ref();
92
- const instance = getCurrentInstance();
93
- const instanceId = useInstanceUniqId({
94
- componentName: "MazInput",
95
- instance,
96
- providedId: props.id
97
- });
98
- onMounted(() => {
99
- var _a;
100
- if (props.autoFocus) {
101
- (_a = input.value) == null ? void 0 : _a.focus();
102
- }
103
- });
104
- const isPasswordType = computed(() => props.type === "password");
105
- const inputType = computed(() => hasPasswordVisible.value ? "text" : props.type);
106
- const borderStyle = computed(() => {
107
- if (props.noBorder)
108
- return void 0;
109
- if (props.error)
110
- return "maz-border-danger";
111
- if (props.success)
112
- return "maz-border-success";
113
- if (props.warning)
114
- return "maz-border-warning";
115
- if (isFocused.value || props.borderActive) {
116
- if (props.color === "black")
117
- return "maz-border-black";
118
- if (props.color === "danger")
119
- return "maz-border-danger";
120
- if (props.color === "info")
121
- return "maz-border-info";
122
- if (props.color === "primary")
123
- return "maz-border-primary";
124
- if (props.color === "secondary")
125
- return "maz-border-secondary";
126
- if (props.color === "success")
127
- return "maz-border-success";
128
- if (props.color === "warning")
129
- return "maz-border-warning";
130
- if (props.color === "white")
131
- return "maz-border-white";
132
- }
133
- return "--default-border";
134
- });
135
- const computedPlaceholder = computed(() => {
136
- const { required, placeholder } = props;
137
- if (!placeholder)
138
- return void 0;
139
- return required ? `${placeholder} *` : placeholder;
140
- });
141
- const hasValue = computed(() => props.modelValue !== void 0 && props.modelValue !== "");
142
- const inputValue = computed({
143
- get: () => props.modelValue,
144
- set: (value) => emitValue(value)
145
- });
146
- const shouldUp = computed(() => {
147
- return (!!props.label || !!props.hint) && (isFocused.value || !!hasValue.value || !!props.placeholder || ["date", "month", "week"].includes(props.type));
148
- });
149
- const hasLabel = computed(() => !!props.label || !!props.hint);
150
- const hasRightPart = () => {
151
- return !!slots["right-icon"] || isPasswordType.value || !!slots["valid-button"] || props.validButton || !!props.rightIcon;
152
- };
153
- const hasLeftPart = () => {
154
- return !!slots["left-icon"] || !!props.leftIcon;
155
- };
156
- const focus = (event) => {
157
- emit("focus", event);
158
- isFocused.value = true;
159
- };
160
- const blur = (event) => {
161
- emit("blur", event);
162
- isFocused.value = false;
163
- };
164
- const change = (event) => emit("change", event);
165
- const debounceEmitValue = debounce((value) => {
166
- emit("update:model-value", value);
167
- }, props.debounceDelay);
168
- const emitValue = (value) => {
169
- if (props.debounce)
170
- return debounceEmitValue(value);
171
- emit("update:model-value", value);
172
- };
173
- return {
174
- inputValue,
175
- shouldUp,
176
- hasLabel,
177
- computedPlaceholder,
178
- isPasswordType,
179
- inputType,
180
- input,
181
- isFocused,
182
- hasPasswordVisible,
183
- borderStyle,
184
- focus,
185
- blur,
186
- change,
187
- emitValue,
188
- hasRightPart,
189
- hasLeftPart,
190
- instanceId
191
- };
192
- }
193
- });
194
- const MazInput_vue_vue_type_style_index_0_scoped_52aef9c7_lang = "";
195
- const _hoisted_1 = {
196
- key: 0,
197
- class: "m-input-wrapper-left"
198
- };
199
- const _hoisted_2 = { class: "m-input-wrapper-input" };
200
- const _hoisted_3 = ["id", "type", "name", "placeholder", "aria-label", "disabled", "readonly", "required"];
201
- const _hoisted_4 = ["for"];
202
- const _hoisted_5 = { key: 0 };
203
- const _hoisted_6 = {
204
- key: 1,
205
- class: "m-input-wrapper-right"
206
- };
207
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
208
- const _component_MazIcon = resolveComponent("MazIcon");
209
- const _component_EyeOffIcon = resolveComponent("EyeOffIcon");
210
- const _component_EyeIcon = resolveComponent("EyeIcon");
211
- const _component_MazBtn = resolveComponent("MazBtn");
212
- const _component_CheckIcon = resolveComponent("CheckIcon");
213
- return openBlock(), createElementBlock(
214
- "div",
215
- {
216
- class: normalizeClass(["m-input", [
217
- {
218
- "--is-focused": _ctx.isFocused || _ctx.borderActive,
219
- "--should-up": _ctx.shouldUp,
220
- "--has-label": _ctx.hasLabel,
221
- "--is-disabled": _ctx.disabled,
222
- "--is-readonly": _ctx.readonly,
223
- "--has-z-2": _ctx.error || _ctx.warning || _ctx.success,
224
- "--has-state": _ctx.error || _ctx.warning || _ctx.success
225
- },
226
- _ctx.$attrs.class,
227
- `--${_ctx.color}`,
228
- `--${_ctx.size}`
229
- ]]),
230
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("click", $event))
231
- },
232
- [
233
- createElementVNode(
234
- "div",
235
- {
236
- class: normalizeClass(["m-input-wrapper", [_ctx.inputClasses, _ctx.borderStyle, { "maz-rounded": !_ctx.noRadius }]])
237
- },
238
- [
239
- _ctx.hasLeftPart() ? (openBlock(), createElementBlock("div", _hoisted_1, [
240
- _ctx.$slots["left-icon"] || _ctx.leftIcon ? renderSlot(_ctx.$slots, "left-icon", { key: 0 }, () => [
241
- createVNode(_component_MazIcon, {
242
- name: _ctx.leftIcon,
243
- class: "maz-text-xl maz-text-muted"
244
- }, null, 8, ["name"])
245
- ], true) : createCommentVNode("v-if", true)
246
- ])) : createCommentVNode("v-if", true),
247
- createElementVNode("div", _hoisted_2, [
248
- withDirectives(createElementVNode("input", mergeProps({
249
- id: _ctx.instanceId,
250
- ref: "input",
251
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
252
- type: _ctx.inputType,
253
- name: _ctx.name
254
- }, _ctx.$attrs, {
255
- placeholder: _ctx.computedPlaceholder,
256
- "aria-label": _ctx.label || _ctx.placeholder,
257
- disabled: _ctx.disabled,
258
- readonly: _ctx.readonly,
259
- required: _ctx.required,
260
- class: "m-input-input"
261
- }, toHandlers({
262
- blur: _ctx.blur,
263
- focus: _ctx.focus,
264
- change: _ctx.change
265
- }, true)), null, 16, _hoisted_3), [
266
- [vModelDynamic, _ctx.inputValue]
267
- ]),
268
- _ctx.label || _ctx.hint ? (openBlock(), createElementBlock("label", {
269
- key: 0,
270
- ref: "label",
271
- for: _ctx.instanceId,
272
- class: normalizeClass(["m-input-label", [
273
- {
274
- "maz-text-danger-600": _ctx.error,
275
- "maz-text-success-600": _ctx.success,
276
- "maz-text-warning-600": _ctx.warning
277
- }
278
- ]])
279
- }, [
280
- createTextVNode(
281
- toDisplayString(_ctx.hint || _ctx.label) + " ",
282
- 1
283
- /* TEXT */
284
- ),
285
- _ctx.required ? (openBlock(), createElementBlock("sup", _hoisted_5, "*")) : createCommentVNode("v-if", true)
286
- ], 10, _hoisted_4)) : createCommentVNode("v-if", true)
287
- ]),
288
- _ctx.hasRightPart() ? (openBlock(), createElementBlock("div", _hoisted_6, [
289
- _ctx.$slots["right-icon"] || _ctx.rightIcon ? renderSlot(_ctx.$slots, "right-icon", { key: 0 }, () => [
290
- createVNode(_component_MazIcon, {
291
- name: _ctx.rightIcon,
292
- class: "maz-text-xl maz-text-muted"
293
- }, null, 8, ["name"])
294
- ], true) : createCommentVNode("v-if", true),
295
- _ctx.isPasswordType ? (openBlock(), createBlock(_component_MazBtn, {
296
- key: 1,
297
- color: "transparent",
298
- tabindex: "-1",
299
- size: "mini",
300
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.hasPasswordVisible = !_ctx.hasPasswordVisible, ["stop"]))
301
- }, {
302
- default: withCtx(() => [
303
- _ctx.hasPasswordVisible ? (openBlock(), createBlock(_component_EyeOffIcon, {
304
- key: 0,
305
- class: "maz-text-xl maz-text-muted"
306
- })) : (openBlock(), createBlock(_component_EyeIcon, {
307
- key: 1,
308
- class: "maz-text-xl maz-text-muted"
309
- }))
310
- ]),
311
- _: 1
312
- /* STABLE */
313
- })) : createCommentVNode("v-if", true),
314
- _ctx.$slots["valid-button"] || _ctx.validButton ? renderSlot(_ctx.$slots, "valid-button", { key: 2 }, () => [
315
- createVNode(_component_MazBtn, {
316
- color: "transparent",
317
- disabled: _ctx.disabled,
318
- tabindex: "-1",
319
- loading: _ctx.validButtonLoading,
320
- class: "m-input-valid-button",
321
- size: "mini",
322
- type: "submit"
323
- }, {
324
- default: withCtx(() => [
325
- createVNode(_component_CheckIcon, { class: "maz-text-2xl maz-text-normal" })
326
- ]),
327
- _: 1
328
- /* STABLE */
329
- }, 8, ["disabled", "loading"])
330
- ], true) : createCommentVNode("v-if", true)
331
- ])) : createCommentVNode("v-if", true)
332
- ],
333
- 2
334
- /* CLASS */
335
- )
336
- ],
337
- 2
338
- /* CLASS */
339
- );
340
- }
341
- const MazInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-52aef9c7"]]);
342
- export {
343
- MazInput as default
344
- };