@bitrix24/b24ui-nuxt 0.6.1 → 0.6.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.
- package/dist/meta.d.mts +419 -18
- package/dist/meta.mjs +419 -18
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Form.vue +2 -1
- package/dist/runtime/components/Form.vue.d.ts +6 -0
- package/dist/runtime/inertia/components/Link.vue +153 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +97 -0
- package/dist/runtime/inertia/stubs.d.ts +45 -0
- package/dist/runtime/inertia/stubs.js +84 -0
- package/dist/runtime/types/utils.d.ts +5 -4
- package/dist/runtime/vue/components/Link.vue +2 -2
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/unplugin.d.mts +4 -0
- package/dist/unplugin.mjs +11 -3
- package/package.json +18 -12
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/b24ui/link";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
8
|
+
import { useForwardProps } from "reka-ui";
|
|
9
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
10
|
+
import { usePage, Link as InertiaLink } from "@inertiajs/vue3";
|
|
11
|
+
import { hasProtocol } from "ufo";
|
|
12
|
+
import { useAppConfig } from "#imports";
|
|
13
|
+
import { tv } from "../../utils/tv";
|
|
14
|
+
import B24LinkBase from "./../../components/LinkBase.vue";
|
|
15
|
+
defineOptions({ inheritAttrs: false });
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
as: { type: null, required: false, default: "button" },
|
|
18
|
+
type: { type: null, required: false, default: "button" },
|
|
19
|
+
disabled: { type: Boolean, required: false },
|
|
20
|
+
active: { type: Boolean, required: false, default: void 0 },
|
|
21
|
+
exact: { type: Boolean, required: false },
|
|
22
|
+
inactiveClass: { type: String, required: false, default: "" },
|
|
23
|
+
custom: { type: Boolean, required: false },
|
|
24
|
+
isAction: { type: Boolean, required: false, default: false },
|
|
25
|
+
raw: { type: Boolean, required: false },
|
|
26
|
+
class: { type: null, required: false },
|
|
27
|
+
activeClass: { type: String, required: false, default: "" },
|
|
28
|
+
to: { type: String, required: false },
|
|
29
|
+
href: { type: String, required: false },
|
|
30
|
+
external: { type: Boolean, required: false },
|
|
31
|
+
target: { type: [String, Object, null], required: false },
|
|
32
|
+
ariaCurrentValue: { type: String, required: false },
|
|
33
|
+
data: { type: Object, required: false },
|
|
34
|
+
method: { type: String, required: false },
|
|
35
|
+
headers: { type: Object, required: false },
|
|
36
|
+
onClick: { type: Function, required: false },
|
|
37
|
+
preserveScroll: { type: [Boolean, String, Function], required: false },
|
|
38
|
+
preserveState: { type: [Boolean, String, Function], required: false },
|
|
39
|
+
replace: { type: Boolean, required: false },
|
|
40
|
+
only: { type: Array, required: false },
|
|
41
|
+
except: { type: Array, required: false },
|
|
42
|
+
onCancelToken: { type: Function, required: false },
|
|
43
|
+
onBefore: { type: Function, required: false },
|
|
44
|
+
onStart: { type: Function, required: false },
|
|
45
|
+
onProgress: { type: Function, required: false },
|
|
46
|
+
onFinish: { type: Function, required: false },
|
|
47
|
+
onCancel: { type: Function, required: false },
|
|
48
|
+
onSuccess: { type: Function, required: false },
|
|
49
|
+
onError: { type: Function, required: false },
|
|
50
|
+
queryStringArrayFormat: { type: String, required: false },
|
|
51
|
+
async: { type: Boolean, required: false },
|
|
52
|
+
prefetch: { type: [Boolean, String, Array], required: false },
|
|
53
|
+
cacheFor: { type: [Number, String, Array], required: false }
|
|
54
|
+
});
|
|
55
|
+
defineSlots();
|
|
56
|
+
const appConfig = useAppConfig();
|
|
57
|
+
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "activeClass", "inactiveClass", "to", "raw", "class"));
|
|
58
|
+
const b24ui = computed(() => tv({
|
|
59
|
+
extend: tv(theme),
|
|
60
|
+
...defu({
|
|
61
|
+
variants: {
|
|
62
|
+
active: {
|
|
63
|
+
true: props.activeClass,
|
|
64
|
+
false: props.inactiveClass
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, appConfig.b24ui?.link || {})
|
|
68
|
+
}));
|
|
69
|
+
const isExternal = computed(() => {
|
|
70
|
+
if (!props.to) return false;
|
|
71
|
+
return typeof props.to === "string" && hasProtocol(props.to, { acceptRelative: true });
|
|
72
|
+
});
|
|
73
|
+
const linkClass = computed(() => {
|
|
74
|
+
const active = isActive.value;
|
|
75
|
+
if (props.raw) {
|
|
76
|
+
return [props.class, active ? props.activeClass : props.inactiveClass];
|
|
77
|
+
}
|
|
78
|
+
return b24ui.value({
|
|
79
|
+
class: props.class,
|
|
80
|
+
active,
|
|
81
|
+
disabled: props.disabled,
|
|
82
|
+
isAction: Boolean(props.isAction)
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
const page = usePage();
|
|
86
|
+
const url = computed(() => props.to ?? props.href ?? "#");
|
|
87
|
+
const isActive = computed(() => props.active || (props.exact ? url.value === props.href : page?.url.startsWith(url.value)));
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<template>
|
|
91
|
+
<template v-if="!isExternal">
|
|
92
|
+
<InertiaLink v-bind="routerLinkProps" :href="url" custom>
|
|
93
|
+
<template v-if="custom">
|
|
94
|
+
<slot
|
|
95
|
+
v-bind="{
|
|
96
|
+
...$attrs,
|
|
97
|
+
as,
|
|
98
|
+
type,
|
|
99
|
+
disabled,
|
|
100
|
+
href: url,
|
|
101
|
+
active: isActive
|
|
102
|
+
}"
|
|
103
|
+
/>
|
|
104
|
+
</template>
|
|
105
|
+
<B24LinkBase
|
|
106
|
+
v-else
|
|
107
|
+
v-bind="{
|
|
108
|
+
...$attrs,
|
|
109
|
+
as,
|
|
110
|
+
type,
|
|
111
|
+
disabled,
|
|
112
|
+
href: url,
|
|
113
|
+
active: isActive
|
|
114
|
+
}"
|
|
115
|
+
:class="linkClass"
|
|
116
|
+
>
|
|
117
|
+
<slot :active="isActive" />
|
|
118
|
+
</B24LinkBase>
|
|
119
|
+
</InertiaLink>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<template v-else>
|
|
123
|
+
<template v-if="custom">
|
|
124
|
+
<slot
|
|
125
|
+
v-bind="{
|
|
126
|
+
...$attrs,
|
|
127
|
+
as,
|
|
128
|
+
type,
|
|
129
|
+
disabled,
|
|
130
|
+
href: to,
|
|
131
|
+
target: isExternal ? '_blank' : void 0,
|
|
132
|
+
active: isActive
|
|
133
|
+
}"
|
|
134
|
+
/>
|
|
135
|
+
</template>
|
|
136
|
+
<B24LinkBase
|
|
137
|
+
v-else
|
|
138
|
+
v-bind="{
|
|
139
|
+
...$attrs,
|
|
140
|
+
as,
|
|
141
|
+
type,
|
|
142
|
+
disabled,
|
|
143
|
+
href: url,
|
|
144
|
+
target: isExternal ? '_blank' : void 0,
|
|
145
|
+
active: isActive
|
|
146
|
+
}"
|
|
147
|
+
:is-external="isExternal"
|
|
148
|
+
:class="linkClass"
|
|
149
|
+
>
|
|
150
|
+
<slot :active="isActive" />
|
|
151
|
+
</B24LinkBase>
|
|
152
|
+
</template>
|
|
153
|
+
</template>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes } from 'vue';
|
|
2
|
+
import type { InertiaLinkProps } from '@inertiajs/vue3';
|
|
3
|
+
interface NuxtLinkProps extends Omit<InertiaLinkProps, 'href'> {
|
|
4
|
+
activeClass?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Route Location the link should navigate to when clicked on.
|
|
7
|
+
*/
|
|
8
|
+
to?: string;
|
|
9
|
+
/**
|
|
10
|
+
* An alias for `to`. If used with `to`, `href` will be ignored
|
|
11
|
+
*/
|
|
12
|
+
href?: NuxtLinkProps['to'];
|
|
13
|
+
/**
|
|
14
|
+
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
|
|
15
|
+
*/
|
|
16
|
+
external?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Where to display the linked URL, as the name for a browsing context.
|
|
19
|
+
*/
|
|
20
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
|
|
21
|
+
ariaCurrentValue?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LinkProps extends NuxtLinkProps {
|
|
24
|
+
/**
|
|
25
|
+
* The element or component this component should render as when not a link.
|
|
26
|
+
* @defaultValue 'button'
|
|
27
|
+
*/
|
|
28
|
+
as?: any;
|
|
29
|
+
/**
|
|
30
|
+
* The type of the button when not a link.
|
|
31
|
+
* @defaultValue 'button'
|
|
32
|
+
*/
|
|
33
|
+
type?: ButtonHTMLAttributes['type'];
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Force the link to be active independent of the current route. */
|
|
36
|
+
active?: boolean;
|
|
37
|
+
/** Will only be active if the current route is an exact match. */
|
|
38
|
+
exact?: boolean;
|
|
39
|
+
/** The class to apply when the link is inactive. */
|
|
40
|
+
inactiveClass?: string;
|
|
41
|
+
custom?: boolean;
|
|
42
|
+
/** When `true`, uses special underlined styling. */
|
|
43
|
+
isAction?: boolean;
|
|
44
|
+
/** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
|
|
45
|
+
raw?: boolean;
|
|
46
|
+
class?: any;
|
|
47
|
+
}
|
|
48
|
+
export interface LinkSlots {
|
|
49
|
+
default(props: {
|
|
50
|
+
active: boolean;
|
|
51
|
+
}): any;
|
|
52
|
+
}
|
|
53
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkProps>, {
|
|
54
|
+
as: string;
|
|
55
|
+
type: string;
|
|
56
|
+
active: undefined;
|
|
57
|
+
isAction: boolean;
|
|
58
|
+
activeClass: string;
|
|
59
|
+
inactiveClass: string;
|
|
60
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkProps>, {
|
|
61
|
+
as: string;
|
|
62
|
+
type: string;
|
|
63
|
+
active: undefined;
|
|
64
|
+
isAction: boolean;
|
|
65
|
+
activeClass: string;
|
|
66
|
+
inactiveClass: string;
|
|
67
|
+
}>>> & Readonly<{}>, {
|
|
68
|
+
as: any;
|
|
69
|
+
type: "reset" | "submit" | "button";
|
|
70
|
+
activeClass: string;
|
|
71
|
+
active: boolean;
|
|
72
|
+
inactiveClass: string;
|
|
73
|
+
isAction: boolean;
|
|
74
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<LinkSlots> & LinkSlots>;
|
|
75
|
+
export default _default;
|
|
76
|
+
type __VLS_WithDefaults<P, D> = {
|
|
77
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
78
|
+
default: D[K];
|
|
79
|
+
}> : P[K];
|
|
80
|
+
};
|
|
81
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
82
|
+
type __VLS_TypePropsToOption<T> = {
|
|
83
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
84
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
85
|
+
} : {
|
|
86
|
+
type: import('vue').PropType<T[K]>;
|
|
87
|
+
required: true;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
91
|
+
new (): {
|
|
92
|
+
$slots: S;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
type __VLS_PrettifyLocal<T> = {
|
|
96
|
+
[K in keyof T]: T[K];
|
|
97
|
+
} & {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { NuxtApp } from '#app';
|
|
3
|
+
export { useHead } from '@unhead/vue';
|
|
4
|
+
export { defineShortcuts } from '../composables/defineShortcuts';
|
|
5
|
+
export { defineLocale } from '../composables/defineLocale';
|
|
6
|
+
export { useLocale } from '../composables/useLocale';
|
|
7
|
+
export { useConfetti } from '../composables/useConfetti';
|
|
8
|
+
export { useOverlay } from '../composables/useOverlay';
|
|
9
|
+
export declare const useRoute: () => {
|
|
10
|
+
fullPath: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const useRouter: () => void;
|
|
13
|
+
export declare const useColorMode: () => {
|
|
14
|
+
forced: boolean;
|
|
15
|
+
preference?: undefined;
|
|
16
|
+
readonly value?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
preference: "light" | "dark" | "system";
|
|
19
|
+
readonly value: import("@vueuse/core").BasicColorMode;
|
|
20
|
+
forced: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const useAppConfig: () => any;
|
|
23
|
+
export declare const useCookie: <T = string>(_name: string, _options?: Record<string, any>) => {
|
|
24
|
+
value: Ref<T, T>;
|
|
25
|
+
get: () => T;
|
|
26
|
+
set: () => void;
|
|
27
|
+
update: () => void;
|
|
28
|
+
refresh: () => Promise<Awaited<T>>;
|
|
29
|
+
remove: () => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const useState: <T>(key: string, init: () => T) => Ref<T>;
|
|
32
|
+
export declare function useNuxtApp(): {
|
|
33
|
+
isHydrating: boolean;
|
|
34
|
+
payload: {
|
|
35
|
+
serverRendered: boolean;
|
|
36
|
+
};
|
|
37
|
+
hooks: import("hookable").Hookable<Record<string, any>, string>;
|
|
38
|
+
hook: <NameT extends string>(name: NameT, function_: any, options?: {
|
|
39
|
+
allowDeprecated?: boolean;
|
|
40
|
+
}) => () => void;
|
|
41
|
+
};
|
|
42
|
+
export declare function useRuntimeHook(name: string, fn: (...args: any[]) => void): void;
|
|
43
|
+
export declare function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void): {
|
|
44
|
+
install(app: import("vue").App<any>): void;
|
|
45
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ref, onScopeDispose } from "vue";
|
|
2
|
+
import { createHooks } from "hookable";
|
|
3
|
+
import appConfig from "#build/app.config";
|
|
4
|
+
import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
5
|
+
import { usePage } from "@inertiajs/vue3";
|
|
6
|
+
export { useHead } from "@unhead/vue";
|
|
7
|
+
export { defineShortcuts } from "../composables/defineShortcuts.js";
|
|
8
|
+
export { defineLocale } from "../composables/defineLocale.js";
|
|
9
|
+
export { useLocale } from "../composables/useLocale.js";
|
|
10
|
+
export { useConfetti } from "../composables/useConfetti.js";
|
|
11
|
+
export { useOverlay } from "../composables/useOverlay.js";
|
|
12
|
+
export const useRoute = () => {
|
|
13
|
+
const page = usePage();
|
|
14
|
+
return {
|
|
15
|
+
fullPath: page.url
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const useRouter = () => {
|
|
19
|
+
};
|
|
20
|
+
export const useColorMode = () => {
|
|
21
|
+
if (!appConfig.colorMode) {
|
|
22
|
+
return {
|
|
23
|
+
forced: true
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const { store, system } = useColorModeVueUse();
|
|
27
|
+
return {
|
|
28
|
+
get preference() {
|
|
29
|
+
return store.value === "auto" ? "system" : store.value;
|
|
30
|
+
},
|
|
31
|
+
set preference(value) {
|
|
32
|
+
store.value = value === "system" ? "auto" : value;
|
|
33
|
+
},
|
|
34
|
+
get value() {
|
|
35
|
+
return store.value === "auto" ? system.value : store.value;
|
|
36
|
+
},
|
|
37
|
+
forced: false
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export const useAppConfig = () => appConfig;
|
|
41
|
+
export const useCookie = (_name, _options = {}) => {
|
|
42
|
+
const value = ref(null);
|
|
43
|
+
return {
|
|
44
|
+
value,
|
|
45
|
+
get: () => value.value,
|
|
46
|
+
set: () => {
|
|
47
|
+
},
|
|
48
|
+
update: () => {
|
|
49
|
+
},
|
|
50
|
+
refresh: () => Promise.resolve(value.value),
|
|
51
|
+
remove: () => {
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const state = {};
|
|
56
|
+
export const useState = (key, init) => {
|
|
57
|
+
if (state[key]) {
|
|
58
|
+
return state[key];
|
|
59
|
+
}
|
|
60
|
+
const value = ref(init());
|
|
61
|
+
state[key] = value;
|
|
62
|
+
return value;
|
|
63
|
+
};
|
|
64
|
+
const hooks = createHooks();
|
|
65
|
+
export function useNuxtApp() {
|
|
66
|
+
return {
|
|
67
|
+
isHydrating: true,
|
|
68
|
+
payload: { serverRendered: false },
|
|
69
|
+
hooks,
|
|
70
|
+
hook: hooks.hook
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function useRuntimeHook(name, fn) {
|
|
74
|
+
const nuxtApp = useNuxtApp();
|
|
75
|
+
const unregister = nuxtApp.hook(name, fn);
|
|
76
|
+
onScopeDispose(unregister);
|
|
77
|
+
}
|
|
78
|
+
export function defineNuxtPlugin(plugin) {
|
|
79
|
+
return {
|
|
80
|
+
install(app) {
|
|
81
|
+
app.runWithContext(() => plugin({ vueApp: app }));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -9,14 +9,15 @@ export type DeepPartial<T, O = any> = {
|
|
|
9
9
|
} & {
|
|
10
10
|
[key: string]: O | TightMap<O>;
|
|
11
11
|
};
|
|
12
|
+
export type DynamicSlotsKeys<Name extends string | undefined, Suffix extends string | undefined = undefined> = (Name extends string ? Suffix extends string ? Name | `${Name}-${Suffix}` : Name : never);
|
|
12
13
|
export type DynamicSlots<T extends {
|
|
13
14
|
slot?: string;
|
|
14
|
-
},
|
|
15
|
-
[K in T['slot']
|
|
15
|
+
}, Suffix extends string | undefined = undefined, ExtraProps extends object = {}> = {
|
|
16
|
+
[K in DynamicSlotsKeys<T['slot'], Suffix>]: (props: {
|
|
16
17
|
item: Extract<T, {
|
|
17
|
-
slot: K extends `${infer Base}-${
|
|
18
|
+
slot: K extends `${infer Base}-${Suffix}` ? Base : K;
|
|
18
19
|
}>;
|
|
19
|
-
} &
|
|
20
|
+
} & ExtraProps) => any;
|
|
20
21
|
};
|
|
21
22
|
export type GetObjectField<MaybeObject, Key extends string> = MaybeObject extends Record<string, any> ? MaybeObject[Key] : never;
|
|
22
23
|
export type AcceptableValue = Exclude<_AcceptableValue, Record<string, any>>;
|
|
@@ -9,8 +9,8 @@ import { isEqual, diff } from "ohash/utils";
|
|
|
9
9
|
import { useForwardProps } from "reka-ui";
|
|
10
10
|
import { reactiveOmit } from "@vueuse/core";
|
|
11
11
|
import { hasProtocol } from "ufo";
|
|
12
|
-
import { useRoute,
|
|
13
|
-
import {
|
|
12
|
+
import { useRoute, RouterLink } from "vue-router";
|
|
13
|
+
import { useAppConfig } from "#imports";
|
|
14
14
|
import { tv } from "../../utils/tv";
|
|
15
15
|
import B24LinkBase from "./../../components/LinkBase.vue";
|
|
16
16
|
defineOptions({ inheritAttrs: false });
|
|
@@ -12,7 +12,7 @@ export declare const useColorMode: () => {
|
|
|
12
12
|
preference?: undefined;
|
|
13
13
|
readonly value?: undefined;
|
|
14
14
|
} | {
|
|
15
|
-
preference: "
|
|
15
|
+
preference: "light" | "dark" | "system";
|
|
16
16
|
readonly value: import("@vueuse/core").BasicColorMode;
|
|
17
17
|
forced: boolean;
|
|
18
18
|
};
|
package/dist/unplugin.d.mts
CHANGED
|
@@ -25,6 +25,10 @@ interface Bitrix24UIOptions extends Omit<ModuleOptions, 'colorMode'> {
|
|
|
25
25
|
* Override options for `unplugin-vue-components`
|
|
26
26
|
*/
|
|
27
27
|
components?: Partial<Options$1>;
|
|
28
|
+
/**
|
|
29
|
+
* Enables compatibility layer for InertiaJS
|
|
30
|
+
*/
|
|
31
|
+
inertia?: boolean;
|
|
28
32
|
}
|
|
29
33
|
declare const runtimeDir: string;
|
|
30
34
|
declare const Bitrix24UIPlugin: unplugin.UnpluginInstance<Bitrix24UIOptions | undefined, boolean>;
|
package/dist/unplugin.mjs
CHANGED
|
@@ -107,6 +107,8 @@ function ComponentImportPlugin(options, meta) {
|
|
|
107
107
|
const componentNames = new Set(components.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
108
108
|
const componentsContent = globSync("**/*.vue", { cwd: join(runtimeDir, "components/content") });
|
|
109
109
|
const componentContentNames = new Set(componentsContent.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
110
|
+
const inertiaOverrides = globSync("**/*.vue", { cwd: join(runtimeDir, "inertia/components") });
|
|
111
|
+
const inertiaOverrideNames = new Set(inertiaOverrides.map((c) => `B24${c.replace(/\.vue$/, "")}`));
|
|
110
112
|
const componentsProse = globSync("**/*.vue", { cwd: join(runtimeDir, "prose") });
|
|
111
113
|
const componentProseNames = new Set(componentsProse.map((c) => `Prose${c.replace(/\.vue$/, "")}`));
|
|
112
114
|
const overrides = globSync("**/*.vue", { cwd: join(runtimeDir, "vue/components") });
|
|
@@ -120,6 +122,9 @@ function ComponentImportPlugin(options, meta) {
|
|
|
120
122
|
],
|
|
121
123
|
resolvers: [
|
|
122
124
|
(componentName) => {
|
|
125
|
+
if (options.inertia && inertiaOverrideNames.has(componentName)) {
|
|
126
|
+
return { name: "default", from: join(runtimeDir, "inertia/components", `${componentName.slice("B24".length)}.vue`) };
|
|
127
|
+
}
|
|
123
128
|
if (overrideNames.has(componentName))
|
|
124
129
|
return { name: "default", from: join(runtimeDir, "vue/components", `${componentName.slice("B24".length)}.vue`) };
|
|
125
130
|
if (componentProseNames.has(componentName))
|
|
@@ -147,6 +152,9 @@ function ComponentImportPlugin(options, meta) {
|
|
|
147
152
|
return;
|
|
148
153
|
}
|
|
149
154
|
const filename = id.match(/([^/]+)\.vue$/)?.[1];
|
|
155
|
+
if (filename && options.inertia && inertiaOverrideNames.has(`B24${filename}`)) {
|
|
156
|
+
return join(runtimeDir, "inertia/components", `${filename}.vue`);
|
|
157
|
+
}
|
|
150
158
|
if (filename && overrideNames.has(`B24${filename}`)) {
|
|
151
159
|
return join(runtimeDir, "vue/components", `${filename}.vue`);
|
|
152
160
|
}
|
|
@@ -157,8 +165,8 @@ function ComponentImportPlugin(options, meta) {
|
|
|
157
165
|
}
|
|
158
166
|
const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
|
|
159
167
|
|
|
160
|
-
function Bitrix24EnvironmentPlugin() {
|
|
161
|
-
const stubPath = resolvePathSync("../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
|
|
168
|
+
function Bitrix24EnvironmentPlugin(options) {
|
|
169
|
+
const stubPath = resolvePathSync(options.inertia ? "../runtime/inertia/stubs" : "../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
|
|
162
170
|
return {
|
|
163
171
|
name: "bitrix24:b24ui",
|
|
164
172
|
enforce: "pre",
|
|
@@ -198,7 +206,7 @@ const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
|
198
206
|
const options = defu(_options, {}, defaultOptions);
|
|
199
207
|
const appConfig = defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: getDefaultUiConfig() });
|
|
200
208
|
return [
|
|
201
|
-
Bitrix24EnvironmentPlugin(),
|
|
209
|
+
Bitrix24EnvironmentPlugin(options),
|
|
202
210
|
ComponentImportPlugin(options, meta),
|
|
203
211
|
AutoImportPlugin(options, meta),
|
|
204
212
|
tailwind(),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrix24/b24ui-nuxt",
|
|
3
3
|
"description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/bitrix24/b24ui.git"
|
|
@@ -102,14 +102,14 @@
|
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@bitrix24/b24icons-vue": "^1.0.5",
|
|
104
104
|
"@bitrix24/b24style": "^1.0.1",
|
|
105
|
-
"@internationalized/date": "^3.
|
|
106
|
-
"@internationalized/number": "^3.6.
|
|
105
|
+
"@internationalized/date": "^3.8.0",
|
|
106
|
+
"@internationalized/number": "^3.6.1",
|
|
107
107
|
"@nuxt/kit": "^3.16.2",
|
|
108
108
|
"@nuxt/schema": "^3.16.2",
|
|
109
109
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
110
110
|
"@standard-schema/spec": "^1.0.0",
|
|
111
|
-
"@tailwindcss/postcss": "^4.1.
|
|
112
|
-
"@tailwindcss/vite": "^4.1.
|
|
111
|
+
"@tailwindcss/postcss": "^4.1.4",
|
|
112
|
+
"@tailwindcss/vite": "^4.1.4",
|
|
113
113
|
"@tanstack/vue-table": "^8.21.2",
|
|
114
114
|
"@unhead/vue": "^2.0.3",
|
|
115
115
|
"@vueuse/core": "^13.0.0",
|
|
@@ -135,14 +135,12 @@
|
|
|
135
135
|
"reka-ui": "^2.2.0",
|
|
136
136
|
"scule": "^1.3.0",
|
|
137
137
|
"tailwind-variants": "^1.0.0",
|
|
138
|
-
"tailwindcss": "^4.1.
|
|
138
|
+
"tailwindcss": "^4.1.4",
|
|
139
139
|
"tinyglobby": "^0.2.12",
|
|
140
|
-
"unplugin": "^2.3.
|
|
140
|
+
"unplugin": "^2.3.2",
|
|
141
141
|
"unplugin-auto-import": "^19.1.2",
|
|
142
|
-
"unplugin-vue-components": "^28.
|
|
143
|
-
"vaul-vue": "^0.4.1"
|
|
144
|
-
"vue": "^3.5.13",
|
|
145
|
-
"vue-router": "^4.5.0"
|
|
142
|
+
"unplugin-vue-components": "^28.5.0",
|
|
143
|
+
"vaul-vue": "^0.4.1"
|
|
146
144
|
},
|
|
147
145
|
"devDependencies": {
|
|
148
146
|
"@nuxt/eslint-config": "^1.3.0",
|
|
@@ -161,14 +159,19 @@
|
|
|
161
159
|
"vue-tsc": "^2.2.0"
|
|
162
160
|
},
|
|
163
161
|
"peerDependencies": {
|
|
162
|
+
"@inertiajs/vue3": "^2.0.7",
|
|
164
163
|
"joi": "^17.13.0",
|
|
165
164
|
"superstruct": "^2.0.0",
|
|
166
165
|
"typescript": "^5.6.3",
|
|
167
166
|
"valibot": "^1.0.0",
|
|
167
|
+
"vue-router": "^4.5.0",
|
|
168
168
|
"yup": "^1.6.0",
|
|
169
169
|
"zod": "^3.24.0"
|
|
170
170
|
},
|
|
171
171
|
"peerDependenciesMeta": {
|
|
172
|
+
"@inertiajs/vue3": {
|
|
173
|
+
"optional": true
|
|
174
|
+
},
|
|
172
175
|
"joi": {
|
|
173
176
|
"optional": true
|
|
174
177
|
},
|
|
@@ -178,6 +181,9 @@
|
|
|
178
181
|
"superstruct": {
|
|
179
182
|
"optional": true
|
|
180
183
|
},
|
|
184
|
+
"vue-router": {
|
|
185
|
+
"optional": true
|
|
186
|
+
},
|
|
181
187
|
"yup": {
|
|
182
188
|
"optional": true
|
|
183
189
|
},
|
|
@@ -190,7 +196,7 @@
|
|
|
190
196
|
"chokidar": "3.6.0",
|
|
191
197
|
"debug": "4.3.7",
|
|
192
198
|
"rollup": "4.34.9",
|
|
193
|
-
"unplugin": "^2.3.
|
|
199
|
+
"unplugin": "^2.3.2",
|
|
194
200
|
"vue-tsc": "2.2.0"
|
|
195
201
|
},
|
|
196
202
|
"keywords": [
|