maz-ui 3.19.2 → 3.20.0

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 (30) hide show
  1. package/components/MazCheckbox.d.ts +22 -2
  2. package/components/MazCheckbox.mjs +144 -32
  3. package/components/MazFullscreenLoader.d.ts +3 -0
  4. package/components/MazPhoneNumberInput.mjs +1 -1
  5. package/components/MazSelect.d.ts +12 -4
  6. package/components/MazSelect.mjs +1 -1
  7. package/components/assets/MazCheckbox.css +1 -1
  8. package/components/assets/MazPhoneNumberInput.css +1 -1
  9. package/components/assets/MazSelect.css +1 -1
  10. package/components/chunks/{MazBtn-16ab35fe.mjs → MazBtn-090f5ced.mjs} +2 -2
  11. package/components/chunks/{MazBtn-0d8e3249.mjs → MazBtn-e578aab0.mjs} +2 -2
  12. package/components/chunks/MazCheckbox-12a37b71.mjs +144 -0
  13. package/components/chunks/MazCheckbox-aeada499.mjs +144 -0
  14. package/components/chunks/MazPhoneNumberInput-94d7c29b.mjs +1482 -0
  15. package/components/chunks/{MazSelect-1f4d1193.mjs → MazSelect-5c3b7a30.mjs} +128 -70
  16. package/components/chunks/{MazSpinner-5fdafc97.mjs → MazSpinner-5be69292.mjs} +1 -1
  17. package/components/chunks/{MazSpinner-6025406b.mjs → MazSpinner-f1454eeb.mjs} +1 -1
  18. package/components/chunks/check-77afbaee.mjs +32 -0
  19. package/css/main.css +1 -1
  20. package/nuxt/index.json +1 -1
  21. package/nuxt/index.mjs +9 -5
  22. package/package.json +15 -15
  23. package/types/components/MazCheckbox.vue.d.ts +22 -2
  24. package/types/components/MazFullscreenLoader.vue.d.ts +3 -0
  25. package/types/components/MazSelect.vue.d.ts +12 -4
  26. package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +3 -0
  27. package/types/tailwindcss/tailwind.config.d.ts +1 -2
  28. package/components/chunks/MazInput-15f3e149.mjs +0 -344
  29. package/components/chunks/MazPhoneNumberInput-901c4fa6.mjs +0 -651
  30. package/components/chunks/MazSelect-c5c3f874.mjs +0 -444
@@ -1,6 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
- import type { Color } from './types';
3
- export type { Color };
2
+ import type { Color, Size } from './types';
3
+ export type { Color, Size };
4
4
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
5
5
  modelValue: {
6
6
  type: BooleanConstructor;
@@ -18,7 +18,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
18
  type: StringConstructor;
19
19
  default: string;
20
20
  };
21
+ size: {
22
+ type: PropType<Size>;
23
+ default: string;
24
+ };
25
+ disabled: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
21
29
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ change: (...args: any[]) => void;
22
31
  "update:model-value": (...args: any[]) => void;
23
32
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
33
  modelValue: {
@@ -37,10 +46,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
37
46
  type: StringConstructor;
38
47
  default: string;
39
48
  };
49
+ size: {
50
+ type: PropType<Size>;
51
+ default: string;
52
+ };
53
+ disabled: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
40
57
  }>> & {
58
+ onChange?: ((...args: any[]) => any) | undefined;
41
59
  "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
42
60
  }, {
61
+ size: Size;
43
62
  color: Color;
63
+ disabled: boolean;
44
64
  name: string;
45
65
  id: string;
46
66
  }, {}>, {
@@ -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;
@@ -4,7 +4,7 @@ export type MazSelectOption = Record<string, ModelValueSimple>;
4
4
  export type { Color, Size, ModelValueSimple, Position };
5
5
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
6
6
  modelValue: {
7
- type: PropType<ModelValueSimple>;
7
+ type: PropType<ModelValueSimple | ModelValueSimple[]>;
8
8
  default: undefined;
9
9
  };
10
10
  id: {
@@ -73,6 +73,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
73
73
  type: StringConstructor;
74
74
  default: string;
75
75
  };
76
+ multiple: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
76
80
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
77
81
  close: (...args: any[]) => void;
78
82
  blur: (...args: any[]) => void;
@@ -83,7 +87,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
83
87
  "selected-option": (...args: any[]) => void;
84
88
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
85
89
  modelValue: {
86
- type: PropType<ModelValueSimple>;
90
+ type: PropType<ModelValueSimple | ModelValueSimple[]>;
87
91
  default: undefined;
88
92
  };
89
93
  id: {
@@ -152,6 +156,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
152
156
  type: StringConstructor;
153
157
  default: string;
154
158
  };
159
+ multiple: {
160
+ type: BooleanConstructor;
161
+ default: boolean;
162
+ };
155
163
  }>> & {
156
164
  onFocus?: ((...args: any[]) => any) | undefined;
157
165
  onBlur?: ((...args: any[]) => any) | undefined;
@@ -165,10 +173,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
165
173
  color: Color;
166
174
  search: boolean;
167
175
  disabled: boolean;
176
+ multiple: boolean;
168
177
  required: boolean;
169
178
  id: string;
170
179
  open: boolean;
171
- modelValue: ModelValueSimple;
180
+ modelValue: ModelValueSimple | ModelValueSimple[];
172
181
  options: MazSelectOption[];
173
182
  optionValueKey: string;
174
183
  optionLabelKey: string;
@@ -183,7 +192,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
183
192
  default?(_: {
184
193
  option: MazSelectOption;
185
194
  isSelected: boolean;
186
- selectedOption: ModelValueSimple;
187
195
  }): any;
188
196
  }>;
189
197
  export default _default;
@@ -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
- };