maz-ui 3.22.0 → 3.22.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 (73) hide show
  1. package/components/MazInput.d.ts +38 -22
  2. package/components/MazInput.mjs +1 -2
  3. package/components/MazInputNumber.mjs +1 -1
  4. package/components/MazInputPrice.mjs +1 -1
  5. package/components/MazInputTags.mjs +1 -1
  6. package/components/MazPhoneNumberInput.d.ts +41 -1
  7. package/components/MazPhoneNumberInput.mjs +1 -1
  8. package/components/MazPicker.mjs +1 -1
  9. package/components/MazSelect.d.ts +33 -1
  10. package/components/MazSelect.mjs +1 -1
  11. package/components/MazTextarea.d.ts +17 -17
  12. package/components/MazTextarea.mjs +7 -8
  13. package/components/assets/MazInput.css +1 -1
  14. package/components/assets/MazInputPrice.css +1 -1
  15. package/components/assets/MazInputTags.css +1 -1
  16. package/components/assets/MazPhoneNumberInput.css +1 -1
  17. package/components/assets/MazSelect.css +1 -1
  18. package/components/assets/MazTextarea.css +1 -1
  19. package/components/chunks/{MazBtn-001d4174.mjs → MazBtn-0e02f0da.mjs} +2 -2
  20. package/components/chunks/{MazBtn-a3a285eb.mjs → MazBtn-2f4fa942.mjs} +2 -2
  21. package/components/chunks/{MazBtn-97d9e521.mjs → MazBtn-30723941.mjs} +2 -2
  22. package/components/chunks/{MazBtn-080c9397.mjs → MazBtn-4e1e116e.mjs} +2 -2
  23. package/components/chunks/{MazBtn-7f413085.mjs → MazBtn-b42e3575.mjs} +2 -2
  24. package/components/chunks/{MazBtn-29a43072.mjs → MazBtn-f48da79c.mjs} +2 -2
  25. package/components/chunks/{MazCheckbox-0595c207.mjs → MazCheckbox-9fa9179a.mjs} +1 -1
  26. package/components/chunks/{MazCheckbox-90f20e7f.mjs → MazCheckbox-e0bbe6ec.mjs} +1 -1
  27. package/components/chunks/MazInput-713b00d0.mjs +326 -0
  28. package/components/chunks/MazInput-b9386887.mjs +341 -0
  29. package/components/chunks/MazInput-c33627dd.mjs +334 -0
  30. package/components/chunks/{MazInputPrice-eb36a7dd.mjs → MazInputPrice-452297f5.mjs} +171 -191
  31. package/components/chunks/{MazInputTags-24164d56.mjs → MazInputTags-7a463b81.mjs} +176 -196
  32. package/components/chunks/{MazPhoneNumberInput-4cec4ade.mjs → MazPhoneNumberInput-31bc05f9.mjs} +241 -226
  33. package/components/chunks/{MazPicker-9f4c724c.mjs → MazPicker-50fc11d1.mjs} +4 -4
  34. package/components/chunks/{MazPickerCalendar-35fe36ab.mjs → MazPickerCalendar-cacb361c.mjs} +5 -5
  35. package/components/chunks/{MazPickerHeader-d8687abf.mjs → MazPickerHeader-63d45179.mjs} +1 -1
  36. package/components/chunks/{MazPickerMonthSwitcher-739ed62a.mjs → MazPickerMonthSwitcher-913c6e2c.mjs} +2 -2
  37. package/components/chunks/{MazPickerShortcuts-68622fe8.mjs → MazPickerShortcuts-c6fabfc6.mjs} +2 -2
  38. package/components/chunks/{MazPickerTime-031062b2.mjs → MazPickerTime-5e4475da.mjs} +2 -2
  39. package/components/chunks/{MazPickerYearSwitcher-2a006a30.mjs → MazPickerYearSwitcher-dd4fa89c.mjs} +3 -3
  40. package/components/chunks/{MazSelect-757bffd7.mjs → MazSelect-2e5cd411.mjs} +199 -206
  41. package/components/chunks/{MazSpinner-d356ad25.mjs → MazSpinner-100c99b8.mjs} +1 -1
  42. package/components/chunks/{MazSpinner-7bd9b831.mjs → MazSpinner-191ad23b.mjs} +1 -1
  43. package/components/chunks/{MazSpinner-89743727.mjs → MazSpinner-339a9006.mjs} +1 -1
  44. package/components/chunks/{MazSpinner-85c86950.mjs → MazSpinner-8859d658.mjs} +1 -1
  45. package/components/chunks/{MazSpinner-d669a3af.mjs → MazSpinner-cb6f99f3.mjs} +1 -1
  46. package/components/chunks/{MazSpinner-ac429216.mjs → MazSpinner-db6fc59d.mjs} +1 -1
  47. package/css/main.css +1 -1
  48. package/nuxt/index.json +1 -1
  49. package/nuxt/runtime/composables/use-theme-handler.mjs +1 -1
  50. package/nuxt/runtime/plugins/aos.d.ts +1 -1
  51. package/nuxt/runtime/plugins/aos.mjs +1 -1
  52. package/nuxt/runtime/plugins/maz-icon-path.d.ts +1 -1
  53. package/nuxt/runtime/plugins/maz-icon-path.mjs +1 -1
  54. package/nuxt/runtime/plugins/toaster.d.ts +1 -1
  55. package/nuxt/runtime/plugins/toaster.mjs +1 -1
  56. package/nuxt/runtime/plugins/v-click-outside.d.ts +1 -1
  57. package/nuxt/runtime/plugins/v-click-outside.mjs +1 -1
  58. package/nuxt/runtime/plugins/v-fullscreen-img.d.ts +1 -1
  59. package/nuxt/runtime/plugins/v-fullscreen-img.mjs +1 -1
  60. package/nuxt/runtime/plugins/v-lazy-img.d.ts +1 -1
  61. package/nuxt/runtime/plugins/v-lazy-img.mjs +1 -1
  62. package/nuxt/runtime/plugins/v-zoom-img.d.ts +1 -1
  63. package/nuxt/runtime/plugins/v-zoom-img.mjs +1 -1
  64. package/nuxt/runtime/plugins/wait.d.ts +1 -1
  65. package/nuxt/runtime/plugins/wait.mjs +1 -1
  66. package/package.json +2 -2
  67. package/types/components/MazInput.vue.d.ts +38 -22
  68. package/types/components/MazPhoneNumberInput.vue.d.ts +41 -1
  69. package/types/components/MazSelect.vue.d.ts +33 -1
  70. package/types/components/MazTextarea.vue.d.ts +17 -17
  71. package/components/chunks/MazInput-12a098d4.mjs +0 -361
  72. package/components/chunks/MazInput-20ea773f.mjs +0 -354
  73. package/components/chunks/MazInput-4313d3cc.mjs +0 -346
@@ -1,361 +0,0 @@
1
- import "../assets/MazInput.css";
2
- import { computed, defineAsyncComponent, defineComponent, ref, getCurrentInstance, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, createCommentVNode, withDirectives, mergeProps, toHandlers, vModelDynamic, createTextVNode, toDisplayString, createBlock, withModifiers, withCtx } from "vue";
3
- function debounce(fn, delay) {
4
- let timeout;
5
- return function(...args) {
6
- clearTimeout(timeout);
7
- timeout = setTimeout(() => {
8
- fn.apply(this, args);
9
- }, delay);
10
- };
11
- }
12
- const useInstanceUniqId = ({
13
- componentName,
14
- instance,
15
- providedId
16
- }) => {
17
- return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
18
- };
19
- const MazBtn = defineAsyncComponent(() => import("./MazBtn-29a43072.mjs"));
20
- const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
21
- const EyeOffIcon = defineAsyncComponent(() => import("./eye-slash-342420ff.mjs"));
22
- const EyeIcon = defineAsyncComponent(() => import("./eye-fbb13657.mjs"));
23
- const CheckIcon = defineAsyncComponent(() => import("./check-f2fcce10.mjs"));
24
- const _sfc_main = defineComponent({
25
- components: {
26
- MazBtn,
27
- MazIcon,
28
- CheckIcon,
29
- EyeIcon,
30
- EyeOffIcon
31
- },
32
- inheritAttrs: false,
33
- props: {
34
- modelValue: {
35
- type: [String, Number, Boolean],
36
- default: void 0
37
- },
38
- placeholder: { type: String, default: void 0 },
39
- color: {
40
- type: String,
41
- default: "primary"
42
- },
43
- label: { type: String, default: void 0 },
44
- name: { type: String, default: "input" },
45
- type: {
46
- type: String,
47
- default: "text",
48
- validator: (value) => {
49
- return [
50
- "text",
51
- "date",
52
- "number",
53
- "tel",
54
- "search",
55
- "url",
56
- "password",
57
- "month",
58
- "time",
59
- "week",
60
- "email"
61
- ].includes(value);
62
- }
63
- },
64
- required: { type: Boolean, default: false },
65
- disabled: { type: Boolean, default: false },
66
- readonly: { type: Boolean, default: false },
67
- id: { type: String, default: void 0 },
68
- error: { type: Boolean, default: false },
69
- success: { type: Boolean, default: false },
70
- warning: { type: Boolean, default: false },
71
- hint: { type: String, default: void 0 },
72
- inputClasses: { type: String, default: void 0 },
73
- noBorder: { type: Boolean, default: false },
74
- noRadius: { type: Boolean, default: false },
75
- size: {
76
- type: String,
77
- default: "md",
78
- validator: (value) => {
79
- return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
80
- }
81
- },
82
- debounce: { type: Boolean, default: false },
83
- debounceDelay: { type: Number, default: 500 },
84
- validButton: { type: Boolean, default: false },
85
- validButtonLoading: { type: Boolean, default: false },
86
- autoFocus: { type: Boolean, default: false },
87
- borderActive: { type: Boolean, default: false },
88
- leftIcon: { type: String, default: void 0 },
89
- rightIcon: { type: String, default: void 0 }
90
- },
91
- emits: ["focus", "blur", "update:model-value", "click", "change", "update"],
92
- setup(props, { emit, slots }) {
93
- const hasPasswordVisible = ref(false);
94
- const isFocused = ref(false);
95
- const input = ref();
96
- const instance = getCurrentInstance();
97
- const instanceId = useInstanceUniqId({
98
- componentName: "MazInput",
99
- instance,
100
- providedId: props.id
101
- });
102
- onMounted(() => {
103
- var _a;
104
- if (props.autoFocus) {
105
- (_a = input.value) == null ? void 0 : _a.focus();
106
- }
107
- });
108
- const isPasswordType = computed(() => props.type === "password");
109
- const inputType = computed(() => hasPasswordVisible.value ? "text" : props.type);
110
- const borderStyle = computed(() => {
111
- if (props.noBorder)
112
- return void 0;
113
- if (props.error)
114
- return "maz-border-danger";
115
- if (props.success)
116
- return "maz-border-success";
117
- if (props.warning)
118
- return "maz-border-warning";
119
- if (isFocused.value || props.borderActive) {
120
- if (props.color === "black")
121
- return "maz-border-black";
122
- if (props.color === "danger")
123
- return "maz-border-danger";
124
- if (props.color === "info")
125
- return "maz-border-info";
126
- if (props.color === "primary")
127
- return "maz-border-primary";
128
- if (props.color === "secondary")
129
- return "maz-border-secondary";
130
- if (props.color === "success")
131
- return "maz-border-success";
132
- if (props.color === "warning")
133
- return "maz-border-warning";
134
- if (props.color === "white")
135
- return "maz-border-white";
136
- }
137
- return "--default-border";
138
- });
139
- const computedPlaceholder = computed(() => {
140
- const { required, placeholder } = props;
141
- if (!placeholder)
142
- return void 0;
143
- return required ? `${placeholder} *` : placeholder;
144
- });
145
- const hasValue = computed(() => props.modelValue !== void 0 && props.modelValue !== "");
146
- const inputValue = computed({
147
- get: () => props.modelValue,
148
- set: (value) => emitValue(value)
149
- });
150
- const shouldUp = computed(() => {
151
- return (!!props.label || !!props.hint) && (isFocused.value || !!hasValue.value || !!props.placeholder || ["date", "month", "week"].includes(props.type));
152
- });
153
- const hasLabel = computed(() => !!props.label || !!props.hint);
154
- const hasRightPart = () => {
155
- return !!slots["right-icon"] || isPasswordType.value || !!slots["valid-button"] || props.validButton || !!props.rightIcon;
156
- };
157
- const hasLeftPart = () => {
158
- return !!slots["left-icon"] || !!props.leftIcon;
159
- };
160
- const focus = (event) => {
161
- emit("focus", event);
162
- isFocused.value = true;
163
- };
164
- const blur = (event) => {
165
- emit("blur", event);
166
- isFocused.value = false;
167
- };
168
- const change = (event) => emit("change", event);
169
- const debounceEmitValue = debounce((value) => {
170
- emit("update:model-value", value);
171
- }, props.debounceDelay);
172
- const emitValue = (value) => {
173
- if (props.debounce)
174
- return debounceEmitValue(value);
175
- emit("update:model-value", value);
176
- };
177
- return {
178
- inputValue,
179
- shouldUp,
180
- hasLabel,
181
- computedPlaceholder,
182
- isPasswordType,
183
- inputType,
184
- input,
185
- isFocused,
186
- hasPasswordVisible,
187
- borderStyle,
188
- focus,
189
- blur,
190
- change,
191
- emitValue,
192
- hasRightPart,
193
- hasLeftPart,
194
- instanceId
195
- };
196
- }
197
- });
198
- const MazInput_vue_vue_type_style_index_0_scoped_18b53f70_lang = "";
199
- const _export_sfc = (sfc, props) => {
200
- const target = sfc.__vccOpts || sfc;
201
- for (const [key, val] of props) {
202
- target[key] = val;
203
- }
204
- return target;
205
- };
206
- const _hoisted_1 = {
207
- key: 0,
208
- class: "m-input-wrapper-left"
209
- };
210
- const _hoisted_2 = { class: "m-input-wrapper-input" };
211
- const _hoisted_3 = ["id", "type", "name", "placeholder", "aria-label", "disabled", "readonly", "required"];
212
- const _hoisted_4 = { key: 0 };
213
- const _hoisted_5 = {
214
- key: 1,
215
- class: "m-input-wrapper-right"
216
- };
217
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
218
- const _component_MazIcon = resolveComponent("MazIcon");
219
- const _component_EyeOffIcon = resolveComponent("EyeOffIcon");
220
- const _component_EyeIcon = resolveComponent("EyeIcon");
221
- const _component_MazBtn = resolveComponent("MazBtn");
222
- const _component_CheckIcon = resolveComponent("CheckIcon");
223
- return openBlock(), createElementBlock(
224
- "div",
225
- {
226
- class: normalizeClass(["m-input", [
227
- {
228
- "--is-focused": _ctx.isFocused || _ctx.borderActive,
229
- "--should-up": _ctx.shouldUp,
230
- "--has-label": _ctx.hasLabel,
231
- "--is-disabled": _ctx.disabled,
232
- "--is-readonly": _ctx.readonly,
233
- "--has-z-2": _ctx.error || _ctx.warning || _ctx.success,
234
- "--has-state": _ctx.error || _ctx.warning || _ctx.success
235
- },
236
- _ctx.$attrs.class,
237
- `--${_ctx.color}`,
238
- `--${_ctx.size}`
239
- ]])
240
- },
241
- [
242
- createElementVNode(
243
- "div",
244
- {
245
- class: normalizeClass(["m-input-wrapper", [_ctx.inputClasses, _ctx.borderStyle, { "maz-rounded": !_ctx.noRadius }]])
246
- },
247
- [
248
- _ctx.hasLeftPart() ? (openBlock(), createElementBlock("div", _hoisted_1, [
249
- _ctx.$slots["left-icon"] || _ctx.leftIcon ? renderSlot(_ctx.$slots, "left-icon", { key: 0 }, () => [
250
- createVNode(_component_MazIcon, {
251
- name: _ctx.leftIcon,
252
- class: "maz-text-xl maz-text-muted"
253
- }, null, 8, ["name"])
254
- ], true) : createCommentVNode("v-if", true)
255
- ])) : createCommentVNode("v-if", true),
256
- createElementVNode("div", _hoisted_2, [
257
- withDirectives(createElementVNode("input", mergeProps({
258
- id: _ctx.instanceId,
259
- ref: "input",
260
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
261
- type: _ctx.inputType,
262
- name: _ctx.name
263
- }, _ctx.$attrs, {
264
- placeholder: _ctx.computedPlaceholder,
265
- "aria-label": _ctx.label || _ctx.placeholder,
266
- disabled: _ctx.disabled,
267
- readonly: _ctx.readonly,
268
- required: _ctx.required,
269
- class: "m-input-input"
270
- }, toHandlers({
271
- blur: _ctx.blur,
272
- focus: _ctx.focus,
273
- change: _ctx.change
274
- }, true), {
275
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click", $event))
276
- }), null, 16, _hoisted_3), [
277
- [vModelDynamic, _ctx.inputValue]
278
- ]),
279
- _ctx.label || _ctx.hint ? (openBlock(), createElementBlock(
280
- "span",
281
- {
282
- key: 0,
283
- ref: "label",
284
- class: normalizeClass(["m-input-label", [
285
- {
286
- "maz-text-danger-600": _ctx.error,
287
- "maz-text-success-600": _ctx.success,
288
- "maz-text-warning-600": _ctx.warning
289
- }
290
- ]])
291
- },
292
- [
293
- createTextVNode(
294
- toDisplayString(_ctx.hint || _ctx.label) + " ",
295
- 1
296
- /* TEXT */
297
- ),
298
- _ctx.required ? (openBlock(), createElementBlock("sup", _hoisted_4, "*")) : createCommentVNode("v-if", true)
299
- ],
300
- 2
301
- /* CLASS */
302
- )) : createCommentVNode("v-if", true)
303
- ]),
304
- _ctx.hasRightPart() ? (openBlock(), createElementBlock("div", _hoisted_5, [
305
- _ctx.$slots["right-icon"] || _ctx.rightIcon ? renderSlot(_ctx.$slots, "right-icon", { key: 0 }, () => [
306
- createVNode(_component_MazIcon, {
307
- name: _ctx.rightIcon,
308
- class: "maz-text-xl maz-text-muted"
309
- }, null, 8, ["name"])
310
- ], true) : createCommentVNode("v-if", true),
311
- _ctx.isPasswordType ? (openBlock(), createBlock(_component_MazBtn, {
312
- key: 1,
313
- color: "transparent",
314
- tabindex: "-1",
315
- size: "mini",
316
- onClick: _cache[2] || (_cache[2] = withModifiers(($event) => _ctx.hasPasswordVisible = !_ctx.hasPasswordVisible, ["stop"]))
317
- }, {
318
- default: withCtx(() => [
319
- _ctx.hasPasswordVisible ? (openBlock(), createBlock(_component_EyeOffIcon, {
320
- key: 0,
321
- class: "maz-text-xl maz-text-muted"
322
- })) : (openBlock(), createBlock(_component_EyeIcon, {
323
- key: 1,
324
- class: "maz-text-xl maz-text-muted"
325
- }))
326
- ]),
327
- _: 1
328
- /* STABLE */
329
- })) : createCommentVNode("v-if", true),
330
- _ctx.$slots["valid-button"] || _ctx.validButton ? renderSlot(_ctx.$slots, "valid-button", { key: 2 }, () => [
331
- createVNode(_component_MazBtn, {
332
- color: "transparent",
333
- disabled: _ctx.disabled,
334
- tabindex: "-1",
335
- loading: _ctx.validButtonLoading,
336
- class: "m-input-valid-button",
337
- size: "mini",
338
- type: "submit"
339
- }, {
340
- default: withCtx(() => [
341
- createVNode(_component_CheckIcon, { class: "maz-text-2xl maz-text-normal" })
342
- ]),
343
- _: 1
344
- /* STABLE */
345
- }, 8, ["disabled", "loading"])
346
- ], true) : createCommentVNode("v-if", true)
347
- ])) : createCommentVNode("v-if", true)
348
- ],
349
- 2
350
- /* CLASS */
351
- )
352
- ],
353
- 2
354
- /* CLASS */
355
- );
356
- }
357
- const MazInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-18b53f70"]]);
358
- export {
359
- MazInput as M,
360
- _export_sfc as _
361
- };