@bitrix24/b24ui-nuxt 0.3.3 → 0.3.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/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/index.ts +1 -0
- package/.nuxt/b24ui/slideover.ts +101 -0
- package/dist/meta.cjs +467 -4
- package/dist/meta.d.cts +467 -4
- package/dist/meta.d.mts +467 -4
- package/dist/meta.d.ts +467 -4
- package/dist/meta.mjs +467 -4
- package/dist/module.cjs +1 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -2
- package/dist/runtime/components/App.vue +3 -4
- package/dist/runtime/components/Modal.vue +4 -2
- package/dist/runtime/components/OverlayProvider.vue +29 -0
- package/dist/runtime/components/Slideover.vue +193 -0
- package/dist/runtime/composables/useOverlay.d.ts +30 -0
- package/dist/runtime/composables/useOverlay.js +71 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +2 -0
- package/dist/runtime/vue/stubs.d.ts +10 -0
- package/dist/runtime/vue/stubs.js +22 -0
- package/dist/shared/{b24ui-nuxt.ngV6AJEg.cjs → b24ui-nuxt.BpFAFOHo.cjs} +120 -1
- package/dist/shared/{b24ui-nuxt.BTln9cW-.mjs → b24ui-nuxt.BqTJ-9uP.mjs} +120 -1
- package/dist/unplugin.cjs +3 -3
- package/dist/unplugin.mjs +3 -3
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/dist/runtime/components/ModalProvider.vue +0 -12
- package/dist/runtime/composables/useModal.d.ts +0 -17
- package/dist/runtime/composables/useModal.js +0 -46
- package/dist/runtime/plugins/modal.d.ts +0 -2
- package/dist/runtime/plugins/modal.js +0 -10
package/dist/unplugin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
|
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, a as getDefaultUiConfig } from './shared/b24ui-nuxt.BqTJ-9uP.mjs';
|
|
7
7
|
import { globSync } from 'tinyglobby';
|
|
8
8
|
import { genSafeVariableName } from 'knitwork';
|
|
9
9
|
import MagicString from 'magic-string';
|
|
@@ -184,7 +184,7 @@ function Bitrix24EnvironmentPlugin() {
|
|
|
184
184
|
function AutoImportPlugin(options, meta) {
|
|
185
185
|
const pluginOptions = defu(options.autoImport, {
|
|
186
186
|
dts: options.dts ?? true,
|
|
187
|
-
dirs: [join(runtimeDir, "composables")]
|
|
187
|
+
dirs: [join(runtimeDir, "composables"), join(runtimeDir, "vue/composables")]
|
|
188
188
|
});
|
|
189
189
|
return AutoImport.raw(pluginOptions, meta);
|
|
190
190
|
}
|
|
@@ -192,7 +192,7 @@ function AutoImportPlugin(options, meta) {
|
|
|
192
192
|
const runtimeDir = normalize(fileURLToPath(new URL("./runtime", import.meta.url)));
|
|
193
193
|
const Bitrix24UIPlugin = createUnplugin((_options = {}, meta) => {
|
|
194
194
|
const options = defu(_options, { devtools: { enabled: false } }, defaultOptions);
|
|
195
|
-
const appConfig = defu({ b24ui: options.b24ui }, { b24ui: getDefaultUiConfig() });
|
|
195
|
+
const appConfig = defu({ b24ui: options.b24ui, colorMode: options.colorMode }, { b24ui: getDefaultUiConfig() });
|
|
196
196
|
return [
|
|
197
197
|
Bitrix24EnvironmentPlugin(),
|
|
198
198
|
ComponentImportPlugin(options, meta),
|
package/dist/vite.cjs
CHANGED
package/dist/vite.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { inject } from 'vue'
|
|
3
|
-
import { useModal, modalInjectionKey } from '../composables/useModal'
|
|
4
|
-
|
|
5
|
-
const modalState = inject(modalInjectionKey)
|
|
6
|
-
|
|
7
|
-
const { isOpen } = useModal()
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<component :is="modalState.component" v-if="modalState" v-bind="modalState.props" v-model:open="isOpen" />
|
|
12
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
-
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
-
import type { ModalProps } from '../types';
|
|
4
|
-
export interface ModalState {
|
|
5
|
-
component: Component | string;
|
|
6
|
-
props: ModalProps;
|
|
7
|
-
}
|
|
8
|
-
export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
|
|
9
|
-
declare function _useModal(): {
|
|
10
|
-
open: <T extends Component>(component: T, props?: ModalProps & ComponentProps<T>) => void;
|
|
11
|
-
close: () => Promise<void>;
|
|
12
|
-
reset: () => void;
|
|
13
|
-
patch: <T extends Component = Record<string, never>>(props: Partial<ModalProps & ComponentProps<T>>) => void;
|
|
14
|
-
isOpen: import("vue").Ref<boolean, boolean>;
|
|
15
|
-
};
|
|
16
|
-
export declare const useModal: typeof _useModal;
|
|
17
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ref, inject } from "vue";
|
|
2
|
-
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
-
export const modalInjectionKey = Symbol("bitrix24-ui.modal");
|
|
4
|
-
function _useModal() {
|
|
5
|
-
const modalState = inject(modalInjectionKey);
|
|
6
|
-
const isOpen = ref(false);
|
|
7
|
-
function open(component, props) {
|
|
8
|
-
if (!modalState) {
|
|
9
|
-
throw new Error("useModal() is called without provider");
|
|
10
|
-
}
|
|
11
|
-
modalState.value = {
|
|
12
|
-
component,
|
|
13
|
-
props: props ?? {}
|
|
14
|
-
};
|
|
15
|
-
isOpen.value = true;
|
|
16
|
-
}
|
|
17
|
-
async function close() {
|
|
18
|
-
if (!modalState) return;
|
|
19
|
-
isOpen.value = false;
|
|
20
|
-
}
|
|
21
|
-
function reset() {
|
|
22
|
-
if (!modalState) return;
|
|
23
|
-
modalState.value = {
|
|
24
|
-
component: "div",
|
|
25
|
-
props: {}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function patch(props) {
|
|
29
|
-
if (!modalState) return;
|
|
30
|
-
modalState.value = {
|
|
31
|
-
...modalState.value,
|
|
32
|
-
props: {
|
|
33
|
-
...modalState.value.props,
|
|
34
|
-
...props
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
open,
|
|
40
|
-
close,
|
|
41
|
-
reset,
|
|
42
|
-
patch,
|
|
43
|
-
isOpen
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export const useModal = createSharedComposable(_useModal);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { shallowRef } from "vue";
|
|
2
|
-
import { defineNuxtPlugin } from "#imports";
|
|
3
|
-
import { modalInjectionKey } from "../composables/useModal.js";
|
|
4
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
const modalState = shallowRef({
|
|
6
|
-
component: "div",
|
|
7
|
-
props: {}
|
|
8
|
-
});
|
|
9
|
-
nuxtApp.vueApp.provide(modalInjectionKey, modalState);
|
|
10
|
-
});
|