@merkaly/nuxt 0.6.1 → 0.6.4
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.
- package/dist/module.d.mts +11 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +86 -28
- package/dist/runtime/components/app.d.vue.ts +3 -3
- package/dist/runtime/components/app.vue +7 -0
- package/dist/runtime/components/app.vue.d.ts +3 -3
- package/dist/runtime/components/format/FormatDate.d.vue.ts +2 -2
- package/dist/runtime/components/format/FormatDate.vue.d.ts +2 -2
- package/dist/runtime/components/format/FormatIcon.d.vue.ts +22 -13
- package/dist/runtime/components/format/FormatIcon.vue +6 -3
- package/dist/runtime/components/format/FormatIcon.vue.d.ts +22 -13
- package/dist/runtime/components/format/FormatMoney.d.vue.ts +2 -2
- package/dist/runtime/components/format/FormatMoney.vue +7 -7
- package/dist/runtime/components/format/FormatMoney.vue.d.ts +2 -2
- package/dist/runtime/components/format/FormatNumber.d.vue.ts +52 -0
- package/dist/runtime/components/format/FormatNumber.vue +38 -0
- package/dist/runtime/components/format/FormatNumber.vue.d.ts +52 -0
- package/dist/runtime/components/format/FormatText.d.vue.ts +9 -3
- package/dist/runtime/components/format/FormatText.vue +2 -2
- package/dist/runtime/components/format/FormatText.vue.d.ts +9 -3
- package/dist/runtime/components/input/InputAddress.d.vue.ts +1 -1
- package/dist/runtime/components/input/InputAddress.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputDateRange.vue +6 -6
- package/dist/runtime/components/input/InputDropzone.vue +1 -1
- package/dist/runtime/components/input/InputMoney.d.vue.ts +1 -1
- package/dist/runtime/components/input/InputMoney.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputSelect.d.vue.ts +10 -11
- package/dist/runtime/components/input/InputSelect.vue +19 -11
- package/dist/runtime/components/input/InputSelect.vue.d.ts +10 -11
- package/dist/runtime/components/table/TableDatagrid.d.vue.ts +1 -1
- package/dist/runtime/components/table/TableDatagrid.vue +1 -1
- package/dist/runtime/components/table/TableDatagrid.vue.d.ts +1 -1
- package/dist/runtime/composables/useCounterUp.d.ts +8 -0
- package/dist/runtime/composables/useCounterUp.js +30 -0
- package/dist/runtime/composables/useNotify.d.ts +19 -0
- package/dist/runtime/composables/useNotify.js +40 -0
- package/dist/runtime/middleware/auth.d.ts +1 -1
- package/dist/runtime/plugins/api.global.d.ts +1 -1
- package/dist/runtime/plugins/auth0.client.d.ts +2 -2
- package/dist/runtime/plugins/sentry.global.d.ts +1 -1
- package/dist/runtime/types/nuxt.d.ts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +24 -21
- package/dist/runtime/composables/useMoney.d.ts +0 -7
- package/dist/runtime/composables/useMoney.js +0 -10
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, toRef } from "vue";
|
|
3
|
+
import { useCounterUp } from "../../composables/useCounterUp";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
currency: { type: String, default: () => "USD" },
|
|
6
|
+
tag: { type: String, default: "span" },
|
|
7
|
+
value: { type: Number, default: 0 },
|
|
8
|
+
type: { type: String, default: void 0 },
|
|
9
|
+
maxFractionDigits: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: void 0
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const counter = useCounterUp(toRef(props, "value"), {
|
|
15
|
+
decimals: props.maxFractionDigits ?? 0
|
|
16
|
+
});
|
|
17
|
+
const number = computed(
|
|
18
|
+
() => Intl.NumberFormat("en-US", {
|
|
19
|
+
currency: props.currency,
|
|
20
|
+
maximumFractionDigits: props.maxFractionDigits,
|
|
21
|
+
notation: "compact",
|
|
22
|
+
style: props.type
|
|
23
|
+
}).format(counter.value)
|
|
24
|
+
);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<component :is="tag" class="format-number">
|
|
29
|
+
<span v-text="number" />
|
|
30
|
+
</component>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.format-number {
|
|
35
|
+
font-variant-numeric: tabular-nums;
|
|
36
|
+
font-feature-settings: "tnum";
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
currency: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: () => string;
|
|
6
|
+
};
|
|
7
|
+
tag: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
value: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
type: {
|
|
16
|
+
type: PropType<Intl.NumberFormatOptions["style"]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
maxFractionDigits: {
|
|
20
|
+
type: PropType<Intl.NumberFormatOptions["maximumFractionDigits"]>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
currency: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: () => string;
|
|
27
|
+
};
|
|
28
|
+
tag: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
value: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
type: {
|
|
37
|
+
type: PropType<Intl.NumberFormatOptions["style"]>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
maxFractionDigits: {
|
|
41
|
+
type: PropType<Intl.NumberFormatOptions["maximumFractionDigits"]>;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
}>> & Readonly<{}>, {
|
|
45
|
+
type: keyof Intl.NumberFormatOptionsStyleRegistry | undefined;
|
|
46
|
+
value: number;
|
|
47
|
+
currency: string;
|
|
48
|
+
tag: string;
|
|
49
|
+
maxFractionDigits: number | undefined;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
1
2
|
declare var __VLS_9: string, __VLS_10: {};
|
|
2
3
|
type __VLS_Slots = {} & {
|
|
3
4
|
[K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
|
|
@@ -6,6 +7,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
6
7
|
fallback: {
|
|
7
8
|
type: StringConstructor;
|
|
8
9
|
required: false;
|
|
10
|
+
default: () => undefined;
|
|
9
11
|
};
|
|
10
12
|
tag: {
|
|
11
13
|
type: StringConstructor;
|
|
@@ -16,13 +18,15 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
16
18
|
required: true;
|
|
17
19
|
};
|
|
18
20
|
values: {
|
|
19
|
-
type: PropType<
|
|
21
|
+
type: PropType<object>;
|
|
20
22
|
required: false;
|
|
23
|
+
default: () => {};
|
|
21
24
|
};
|
|
22
25
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
26
|
fallback: {
|
|
24
27
|
type: StringConstructor;
|
|
25
28
|
required: false;
|
|
29
|
+
default: () => undefined;
|
|
26
30
|
};
|
|
27
31
|
tag: {
|
|
28
32
|
type: StringConstructor;
|
|
@@ -33,12 +37,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
33
37
|
required: true;
|
|
34
38
|
};
|
|
35
39
|
values: {
|
|
36
|
-
type: PropType<
|
|
40
|
+
type: PropType<object>;
|
|
37
41
|
required: false;
|
|
42
|
+
default: () => {};
|
|
38
43
|
};
|
|
39
44
|
}>> & Readonly<{}>, {
|
|
40
|
-
values:
|
|
45
|
+
values: object;
|
|
41
46
|
tag: string;
|
|
47
|
+
fallback: string;
|
|
42
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
49
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
44
50
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, useSlots } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
fallback: { type: String, required: false },
|
|
4
|
+
fallback: { type: String, required: false, default: () => void 0 },
|
|
5
5
|
tag: { type: String, default: () => "span" },
|
|
6
6
|
template: { type: String, required: true },
|
|
7
|
-
values: { type: Object, required: false }
|
|
7
|
+
values: { type: Object, required: false, default: () => ({}) }
|
|
8
8
|
});
|
|
9
9
|
const slots = useSlots();
|
|
10
10
|
const contentParts = computed(() => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
1
2
|
declare var __VLS_9: string, __VLS_10: {};
|
|
2
3
|
type __VLS_Slots = {} & {
|
|
3
4
|
[K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
|
|
@@ -6,6 +7,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
6
7
|
fallback: {
|
|
7
8
|
type: StringConstructor;
|
|
8
9
|
required: false;
|
|
10
|
+
default: () => undefined;
|
|
9
11
|
};
|
|
10
12
|
tag: {
|
|
11
13
|
type: StringConstructor;
|
|
@@ -16,13 +18,15 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
16
18
|
required: true;
|
|
17
19
|
};
|
|
18
20
|
values: {
|
|
19
|
-
type: PropType<
|
|
21
|
+
type: PropType<object>;
|
|
20
22
|
required: false;
|
|
23
|
+
default: () => {};
|
|
21
24
|
};
|
|
22
25
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
26
|
fallback: {
|
|
24
27
|
type: StringConstructor;
|
|
25
28
|
required: false;
|
|
29
|
+
default: () => undefined;
|
|
26
30
|
};
|
|
27
31
|
tag: {
|
|
28
32
|
type: StringConstructor;
|
|
@@ -33,12 +37,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
33
37
|
required: true;
|
|
34
38
|
};
|
|
35
39
|
values: {
|
|
36
|
-
type: PropType<
|
|
40
|
+
type: PropType<object>;
|
|
37
41
|
required: false;
|
|
42
|
+
default: () => {};
|
|
38
43
|
};
|
|
39
44
|
}>> & Readonly<{}>, {
|
|
40
|
-
values:
|
|
45
|
+
values: object;
|
|
41
46
|
tag: string;
|
|
47
|
+
fallback: string;
|
|
42
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
49
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
44
50
|
declare const _default: typeof __VLS_export;
|
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
placeholder: string;
|
|
85
84
|
countries: string[];
|
|
85
|
+
placeholder: string;
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
placeholder: string;
|
|
85
84
|
countries: string[];
|
|
85
|
+
placeholder: string;
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -15,10 +15,10 @@ const presets = [
|
|
|
15
15
|
{ key: "lastMonth", label: "Last month", icon: "calendar-xmark" }
|
|
16
16
|
];
|
|
17
17
|
const selectedPreset = ref(model.value?.preset || props.preset);
|
|
18
|
-
const getDateRange = (
|
|
18
|
+
const getDateRange = (key) => {
|
|
19
19
|
const now = /* @__PURE__ */ new Date();
|
|
20
20
|
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
21
|
-
switch (
|
|
21
|
+
switch (key) {
|
|
22
22
|
case "today":
|
|
23
23
|
return { start: today, end: today };
|
|
24
24
|
case "yesterday": {
|
|
@@ -81,11 +81,11 @@ onBeforeMount(() => selectPreset(props.preset));
|
|
|
81
81
|
<span class="fs-7 fw-bold text-gray-800">Date Range</span>
|
|
82
82
|
</div>
|
|
83
83
|
|
|
84
|
-
<template v-for="
|
|
85
|
-
<BDropdownItem :active="selectedPreset ===
|
|
84
|
+
<template v-for="item in presets" :key="item.key">
|
|
85
|
+
<BDropdownItem :active="selectedPreset === item.key" @click="selectPreset(item.key)">
|
|
86
86
|
<div class="d-flex align-items-center gap-2">
|
|
87
|
-
<FormatIcon :name="
|
|
88
|
-
<span v-text="
|
|
87
|
+
<FormatIcon :name="item.icon" class="text-gray-500" />
|
|
88
|
+
<span v-text="item.label" />
|
|
89
89
|
</div>
|
|
90
90
|
</BDropdownItem>
|
|
91
91
|
</template>
|
|
@@ -74,9 +74,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
}>> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
|
-
decimal: string;
|
|
78
77
|
min: number;
|
|
79
78
|
max: number;
|
|
79
|
+
decimal: string;
|
|
80
80
|
placeholder: string;
|
|
81
81
|
precision: number;
|
|
82
82
|
prefix: string;
|
|
@@ -74,9 +74,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
}>> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
|
-
decimal: string;
|
|
78
77
|
min: number;
|
|
79
78
|
max: number;
|
|
79
|
+
decimal: string;
|
|
80
80
|
placeholder: string;
|
|
81
81
|
precision: number;
|
|
82
82
|
prefix: string;
|
|
@@ -14,18 +14,19 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
14
14
|
};
|
|
15
15
|
fieldDisabled: {
|
|
16
16
|
type: PropType<(item: T) => boolean>;
|
|
17
|
+
default: undefined;
|
|
17
18
|
};
|
|
18
19
|
fieldSort: {
|
|
19
20
|
type: PropType<(item: T) => string>;
|
|
20
|
-
default: (it:
|
|
21
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
21
22
|
};
|
|
22
23
|
fieldText: {
|
|
23
24
|
type: PropType<(item: T) => string>;
|
|
24
|
-
default: (it:
|
|
25
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
25
26
|
};
|
|
26
27
|
fieldValue: {
|
|
27
28
|
type: PropType<(item: T) => unknown>;
|
|
28
|
-
default: (it:
|
|
29
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
29
30
|
};
|
|
30
31
|
filterable: {
|
|
31
32
|
type: BooleanConstructor;
|
|
@@ -53,15 +54,16 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
53
54
|
};
|
|
54
55
|
placeholder: {
|
|
55
56
|
type: StringConstructor;
|
|
56
|
-
|
|
57
|
-
selectedItem: {
|
|
58
|
-
type: PropType<T>;
|
|
59
|
-
default: undefined;
|
|
57
|
+
default: () => undefined;
|
|
60
58
|
};
|
|
61
59
|
required: {
|
|
62
60
|
type: BooleanConstructor;
|
|
63
61
|
default: () => boolean;
|
|
64
62
|
};
|
|
63
|
+
selectedItem: {
|
|
64
|
+
type: PropType<T>;
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
65
67
|
size: {
|
|
66
68
|
type: PropType<Size>;
|
|
67
69
|
default: () => undefined;
|
|
@@ -82,10 +84,7 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
82
84
|
selectedOption: boolean;
|
|
83
85
|
}) => any;
|
|
84
86
|
};
|
|
85
|
-
emit:
|
|
86
|
-
(e: "search", v: string): any;
|
|
87
|
-
(e: "request:selected", v: string): any;
|
|
88
|
-
} & ((evt: "update:modelValue", value: any) => void);
|
|
87
|
+
emit: ((e: "request:selected" | "search", v: string) => unknown) & ((event: "update:modelValue", value: any) => void);
|
|
89
88
|
}>) => import("vue").VNode & {
|
|
90
89
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
91
90
|
};
|
|
@@ -3,11 +3,11 @@ import { computed, onBeforeMount } from "vue";
|
|
|
3
3
|
import { useDebounceFn } from "@vueuse/core";
|
|
4
4
|
import VSelect from "vue-select";
|
|
5
5
|
import FormatIcon from "../format/FormatIcon.vue";
|
|
6
|
-
const emit = defineEmits(["
|
|
6
|
+
const emit = defineEmits(["request:selected", "search"]);
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
debounce: { type: Number, default: () => 250 },
|
|
9
9
|
disabled: { type: Boolean, default: () => false },
|
|
10
|
-
fieldDisabled: { type: Function },
|
|
10
|
+
fieldDisabled: { type: Function, default: void 0 },
|
|
11
11
|
fieldSort: { type: Function, default: (it) => it.fieldText },
|
|
12
12
|
fieldText: { type: Function, default: ((it) => it.name) },
|
|
13
13
|
fieldValue: { type: Function, default: ((it) => it._id) },
|
|
@@ -17,12 +17,12 @@ const props = defineProps({
|
|
|
17
17
|
noClear: { type: Boolean, default: () => false },
|
|
18
18
|
noCloseOnSelect: { type: Boolean, default: () => false },
|
|
19
19
|
options: { type: Array, default: () => [] },
|
|
20
|
-
placeholder: { type: String },
|
|
21
|
-
selectedItem: { type: Object, default: void 0 },
|
|
20
|
+
placeholder: { type: String, default: () => void 0 },
|
|
22
21
|
required: { type: Boolean, default: () => false },
|
|
22
|
+
selectedItem: { type: Object, default: void 0 },
|
|
23
23
|
size: { type: String, default: () => void 0 }
|
|
24
24
|
});
|
|
25
|
-
const model = defineModel({ type:
|
|
25
|
+
const model = defineModel({ type: [String, Object, Number, Boolean, Array], default: null });
|
|
26
26
|
onBeforeMount(() => {
|
|
27
27
|
if (props.selectedItem) return;
|
|
28
28
|
if (model.value) {
|
|
@@ -79,17 +79,25 @@ const bindAttrs = computed(() => ({
|
|
|
79
79
|
}));
|
|
80
80
|
const bindOn = {
|
|
81
81
|
search: (value) => {
|
|
82
|
-
value
|
|
82
|
+
if (value) debouncedFn(value);
|
|
83
83
|
return value;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
const debouncedFn = useDebounceFn((value) => emit("search", value), props.debounce);
|
|
87
|
+
const isRequired = computed(() => {
|
|
88
|
+
const isEmpty = props.multiple ? !model.value?.length : !model.value;
|
|
89
|
+
return props.required && isEmpty ? true : void 0;
|
|
90
|
+
});
|
|
87
91
|
</script>
|
|
88
92
|
|
|
89
93
|
<template>
|
|
90
94
|
<VSelect v-model="model" v-bind="bindAttrs" v-on="bindOn">
|
|
91
95
|
<template #search="scope">
|
|
92
|
-
<input
|
|
96
|
+
<input
|
|
97
|
+
:required="isRequired"
|
|
98
|
+
class="vs__search"
|
|
99
|
+
v-bind="scope.attributes"
|
|
100
|
+
v-on="scope.events">
|
|
93
101
|
</template>
|
|
94
102
|
|
|
95
103
|
<template #option="scope">
|
|
@@ -108,12 +116,12 @@ const debouncedFn = useDebounceFn((value) => emit("search", value), props.deboun
|
|
|
108
116
|
<span :required="props.required || void 0" />
|
|
109
117
|
</template>
|
|
110
118
|
|
|
111
|
-
<template #spinner="{ loading }">
|
|
112
|
-
<BSpinner v-if="
|
|
119
|
+
<template #spinner="{ loading: isLoading }">
|
|
120
|
+
<BSpinner v-if="isLoading" class="spinner" variant="primary" />
|
|
113
121
|
</template>
|
|
114
122
|
|
|
115
|
-
<template #no-options="{ search, searching, loading }">
|
|
116
|
-
<span v-if="
|
|
123
|
+
<template #no-options="{ search, searching, loading: isLoading }">
|
|
124
|
+
<span v-if="isLoading">Searching for "{{ search }}"</span>
|
|
117
125
|
<span v-else-if="searching">No results for "{{ search }}"</span>
|
|
118
126
|
<span v-else>Type to search</span>
|
|
119
127
|
</template>
|
|
@@ -14,18 +14,19 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
14
14
|
};
|
|
15
15
|
fieldDisabled: {
|
|
16
16
|
type: PropType<(item: T) => boolean>;
|
|
17
|
+
default: undefined;
|
|
17
18
|
};
|
|
18
19
|
fieldSort: {
|
|
19
20
|
type: PropType<(item: T) => string>;
|
|
20
|
-
default: (it:
|
|
21
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
21
22
|
};
|
|
22
23
|
fieldText: {
|
|
23
24
|
type: PropType<(item: T) => string>;
|
|
24
|
-
default: (it:
|
|
25
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
25
26
|
};
|
|
26
27
|
fieldValue: {
|
|
27
28
|
type: PropType<(item: T) => unknown>;
|
|
28
|
-
default: (it:
|
|
29
|
+
default: (it: Record<string, unknown>) => unknown;
|
|
29
30
|
};
|
|
30
31
|
filterable: {
|
|
31
32
|
type: BooleanConstructor;
|
|
@@ -53,15 +54,16 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
53
54
|
};
|
|
54
55
|
placeholder: {
|
|
55
56
|
type: StringConstructor;
|
|
56
|
-
|
|
57
|
-
selectedItem: {
|
|
58
|
-
type: PropType<T>;
|
|
59
|
-
default: undefined;
|
|
57
|
+
default: () => undefined;
|
|
60
58
|
};
|
|
61
59
|
required: {
|
|
62
60
|
type: BooleanConstructor;
|
|
63
61
|
default: () => boolean;
|
|
64
62
|
};
|
|
63
|
+
selectedItem: {
|
|
64
|
+
type: PropType<T>;
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
65
67
|
size: {
|
|
66
68
|
type: PropType<Size>;
|
|
67
69
|
default: () => undefined;
|
|
@@ -82,10 +84,7 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
82
84
|
selectedOption: boolean;
|
|
83
85
|
}) => any;
|
|
84
86
|
};
|
|
85
|
-
emit:
|
|
86
|
-
(e: "search", v: string): any;
|
|
87
|
-
(e: "request:selected", v: string): any;
|
|
88
|
-
} & ((evt: "update:modelValue", value: any) => void);
|
|
87
|
+
emit: ((e: "request:selected" | "search", v: string) => unknown) & ((event: "update:modelValue", value: any) => void);
|
|
89
88
|
}>) => import("vue").VNode & {
|
|
90
89
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
91
90
|
};
|
|
@@ -76,7 +76,7 @@ declare const __VLS_export: <G>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
76
76
|
emit: {
|
|
77
77
|
(e: "fetch", reason: "sort" | "filter" | "search" | "paginate" | "refresh"): void;
|
|
78
78
|
(e: "toggle:item", item: G, expanded: boolean): void;
|
|
79
|
-
} & ((
|
|
79
|
+
} & ((event: "update:modelValue", value: DataGrid<G>) => void);
|
|
80
80
|
}>) => import("vue").VNode & {
|
|
81
81
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
82
82
|
};
|
|
@@ -221,7 +221,7 @@ function getRowAttrs(item, idx) {
|
|
|
221
221
|
</BTd>
|
|
222
222
|
</BTbody>
|
|
223
223
|
|
|
224
|
-
<BTbody v-else class="fw-semibold text-
|
|
224
|
+
<BTbody v-else class="fw-semibold text-nowrap">
|
|
225
225
|
<template v-for="(item, idx) in visibleItems" :key="getRowKey(item, idx)">
|
|
226
226
|
<BTr v-bind="getRowAttrs(item, idx)">
|
|
227
227
|
<BTd v-if="hasDetailsSlot" class="p-0 w-25px">
|
|
@@ -76,7 +76,7 @@ declare const __VLS_export: <G>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
76
76
|
emit: {
|
|
77
77
|
(e: "fetch", reason: "sort" | "filter" | "search" | "paginate" | "refresh"): void;
|
|
78
78
|
(e: "toggle:item", item: G, expanded: boolean): void;
|
|
79
|
-
} & ((
|
|
79
|
+
} & ((event: "update:modelValue", value: DataGrid<G>) => void);
|
|
80
80
|
}>) => import("vue").VNode & {
|
|
81
81
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
82
82
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
type UseCounterUpOptions = {
|
|
3
|
+
duration?: number;
|
|
4
|
+
decimals?: number;
|
|
5
|
+
ease?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useCounterUp(target: MaybeRefOrGetter<number>, options?: UseCounterUpOptions): import("vue").ComputedRef<number>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { watchImmediate } from "@vueuse/core";
|
|
2
|
+
import gsap from "gsap";
|
|
3
|
+
import { computed, onBeforeUnmount, reactive, toValue } from "vue";
|
|
4
|
+
export function useCounterUp(target, options = {}) {
|
|
5
|
+
const { duration = 0.8, decimals = 0, ease = "power2.out" } = options;
|
|
6
|
+
const counter = reactive({
|
|
7
|
+
value: toValue(target) || 0
|
|
8
|
+
});
|
|
9
|
+
let tween;
|
|
10
|
+
let initialized = false;
|
|
11
|
+
watchImmediate(
|
|
12
|
+
() => toValue(target),
|
|
13
|
+
(value) => {
|
|
14
|
+
const nextValue = Number(value) || 0;
|
|
15
|
+
if (!initialized) {
|
|
16
|
+
counter.value = nextValue;
|
|
17
|
+
initialized = true;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
tween?.kill();
|
|
21
|
+
tween = gsap.to(counter, {
|
|
22
|
+
value: nextValue,
|
|
23
|
+
duration,
|
|
24
|
+
ease
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
onBeforeUnmount(() => tween?.kill());
|
|
29
|
+
return computed(() => Number(counter.value.toFixed(decimals)));
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface NotifyOptions {
|
|
2
|
+
title?: string;
|
|
3
|
+
message?: string;
|
|
4
|
+
variant: 'success' | 'danger' | 'warning' | 'info';
|
|
5
|
+
}
|
|
6
|
+
export interface NotifyConfirmOptions extends NotifyOptions {
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
confirmText?: string;
|
|
9
|
+
onConfirm?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface NotifyAlertOptions extends NotifyOptions {
|
|
12
|
+
okText?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NotifyApi {
|
|
15
|
+
alert(options: NotifyAlertOptions): void;
|
|
16
|
+
confirm(options: NotifyConfirmOptions): void;
|
|
17
|
+
toast(options: NotifyOptions): unknown;
|
|
18
|
+
}
|
|
19
|
+
export declare function useNotify(): NotifyApi;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { push } from "notivue";
|
|
2
|
+
import { useModal } from "bootstrap-vue-next";
|
|
3
|
+
export function useNotify() {
|
|
4
|
+
const $modal = useModal();
|
|
5
|
+
function toast(options) {
|
|
6
|
+
const toastByVariant = {
|
|
7
|
+
success: push.success,
|
|
8
|
+
danger: push.error,
|
|
9
|
+
warning: push.warning,
|
|
10
|
+
info: push.info
|
|
11
|
+
};
|
|
12
|
+
return toastByVariant[options.variant]({
|
|
13
|
+
title: options.title,
|
|
14
|
+
message: options.message
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function alert(options) {
|
|
18
|
+
const instance = $modal.create({
|
|
19
|
+
body: options.message,
|
|
20
|
+
centered: true,
|
|
21
|
+
okOnly: true,
|
|
22
|
+
okTitle: options.okText || "OK",
|
|
23
|
+
title: options.title || "Alert"
|
|
24
|
+
});
|
|
25
|
+
instance.show();
|
|
26
|
+
}
|
|
27
|
+
function confirm(options) {
|
|
28
|
+
const instance = $modal.create({
|
|
29
|
+
body: options.message,
|
|
30
|
+
cancelTitle: options.cancelText || "Cancel",
|
|
31
|
+
cancelVariant: "secondary",
|
|
32
|
+
okTitle: options.confirmText || "OK",
|
|
33
|
+
okVariant: options.variant || "primary",
|
|
34
|
+
onOk: options.onConfirm,
|
|
35
|
+
title: options.title || "Confirm"
|
|
36
|
+
});
|
|
37
|
+
instance.show();
|
|
38
|
+
}
|
|
39
|
+
return { toast, alert, confirm };
|
|
40
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("#app").RouteMiddleware;
|
|
2
2
|
export default _default;
|
|
@@ -46,5 +46,5 @@ export interface ParamsOptions {
|
|
|
46
46
|
export type ApiOptions<TData = unknown, TMeta = Record<string, unknown>, TParams = object> = ParamsOptions & HooksOptions<TData, TMeta, TParams> & RefOptions & {
|
|
47
47
|
params?: TParams;
|
|
48
48
|
};
|
|
49
|
-
declare const _default: import("
|
|
49
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
50
50
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("#app").Plugin<{
|
|
2
2
|
auth0: import("@auth0/auth0-spa-js").Auth0Client;
|
|
3
|
-
}> & import("
|
|
3
|
+
}> & import("#app").ObjectPlugin<{
|
|
4
4
|
auth0: import("@auth0/auth0-spa-js").Auth0Client;
|
|
5
5
|
}>;
|
|
6
6
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
package/dist/types.d.mts
CHANGED
|
@@ -10,4 +10,4 @@ export { type ApiOptions, type HooksOptions, type ParamsOptions, type RefOptions
|
|
|
10
10
|
|
|
11
11
|
export { default } from './module.mjs'
|
|
12
12
|
|
|
13
|
-
export { type MerkalyModuleOptions } from './module.mjs'
|
|
13
|
+
export { type MerkalyI18nLocale, type MerkalyModuleOptions } from './module.mjs'
|