@bitrix24/b24ui-nuxt 0.2.7 → 0.2.9
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/avatar.ts +1 -1
- package/.nuxt/b24ui/badge.ts +1 -1
- package/.nuxt/b24ui/modal.ts +3 -2
- package/.nuxt/b24ui/prose/table-wrapper.ts +46 -0
- package/README.md +1 -1
- package/dist/meta.cjs +13302 -16514
- package/dist/meta.d.cts +13302 -16514
- package/dist/meta.d.mts +13302 -16514
- package/dist/meta.d.ts +13302 -16514
- package/dist/meta.mjs +13302 -16514
- package/dist/module.cjs +4 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/Alert.vue +2 -2
- package/dist/runtime/components/Avatar.vue +21 -34
- package/dist/runtime/components/Badge.vue +7 -5
- package/dist/runtime/components/Form.vue +6 -4
- package/dist/runtime/components/Modal.vue +20 -15
- package/dist/runtime/components/Toast.vue +2 -2
- package/dist/runtime/components/Toaster.vue +2 -1
- package/dist/runtime/components/Tooltip.vue +1 -1
- package/dist/runtime/components/prose/TableWrapper.vue +67 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/shared/{b24ui-nuxt.BhidWnCI.mjs → b24ui-nuxt.0h2uYsyZ.mjs} +92 -7
- package/dist/shared/{b24ui-nuxt.DWZW38ni.cjs → b24ui-nuxt.DcPkWX-m.cjs} +92 -7
- package/dist/unplugin.cjs +14 -2
- package/dist/unplugin.mjs +14 -2
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +17 -16
package/dist/module.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const defu = require('defu');
|
|
4
4
|
const kit = require('@nuxt/kit');
|
|
5
|
-
const templates = require('./shared/b24ui-nuxt.
|
|
5
|
+
const templates = require('./shared/b24ui-nuxt.DcPkWX-m.cjs');
|
|
6
6
|
require('node:url');
|
|
7
7
|
require('scule');
|
|
8
8
|
|
|
@@ -30,15 +30,15 @@ const module$1 = kit.defineNuxtModule({
|
|
|
30
30
|
} else {
|
|
31
31
|
nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
|
|
32
32
|
}
|
|
33
|
-
async function registerModule(name, options2) {
|
|
33
|
+
async function registerModule(name, key, options2) {
|
|
34
34
|
if (!kit.hasNuxtModule(name)) {
|
|
35
35
|
await kit.installModule(name, options2);
|
|
36
36
|
} else {
|
|
37
|
-
nuxt.options[
|
|
37
|
+
nuxt.options[key] = defu.defu(nuxt.options[key], options2);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
if (options.colorMode) {
|
|
41
|
-
await registerModule("@nuxtjs/color-mode", { classSuffix: "", disableTransition: true });
|
|
41
|
+
await registerModule("@nuxtjs/color-mode", "colorMode", { classSuffix: "", disableTransition: true });
|
|
42
42
|
}
|
|
43
43
|
kit.addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
44
44
|
kit.addPlugin({ src: resolve("./runtime/plugins/modal") });
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.
|
|
3
|
+
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.0h2uYsyZ.mjs';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'scule';
|
|
6
6
|
|
|
@@ -27,15 +27,15 @@ const module = defineNuxtModule({
|
|
|
27
27
|
} else {
|
|
28
28
|
nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
|
|
29
29
|
}
|
|
30
|
-
async function registerModule(name, options2) {
|
|
30
|
+
async function registerModule(name, key, options2) {
|
|
31
31
|
if (!hasNuxtModule(name)) {
|
|
32
32
|
await installModule(name, options2);
|
|
33
33
|
} else {
|
|
34
|
-
nuxt.options[
|
|
34
|
+
nuxt.options[key] = defu(nuxt.options[key], options2);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
if (options.colorMode) {
|
|
38
|
-
await registerModule("@nuxtjs/color-mode", { classSuffix: "", disableTransition: true });
|
|
38
|
+
await registerModule("@nuxtjs/color-mode", "colorMode", { classSuffix: "", disableTransition: true });
|
|
39
39
|
}
|
|
40
40
|
addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
41
41
|
addPlugin({ src: resolve("./runtime/plugins/modal") });
|
|
@@ -38,7 +38,7 @@ export interface AlertProps {
|
|
|
38
38
|
* @emits 'update:open'
|
|
39
39
|
* @defaultValue false
|
|
40
40
|
*/
|
|
41
|
-
close?:
|
|
41
|
+
close?: boolean | Partial<ButtonProps>
|
|
42
42
|
/**
|
|
43
43
|
* The icon displayed in the close button.
|
|
44
44
|
* @defaultValue icons.close
|
|
@@ -129,7 +129,7 @@ const b24ui = computed(() => alert({
|
|
|
129
129
|
size="xs"
|
|
130
130
|
color="link"
|
|
131
131
|
:aria-label="t('alert.close')"
|
|
132
|
-
v-bind="typeof close === 'object' ? close :
|
|
132
|
+
v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
|
|
133
133
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
134
134
|
@click="emits('update:open', false)"
|
|
135
135
|
/>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
-
import type { AvatarFallbackProps } from 'reka-ui'
|
|
4
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
4
|
import _appConfig from '#build/app.config'
|
|
6
5
|
import theme from '#build/b24ui/avatar'
|
|
@@ -13,7 +12,7 @@ const avatar = tv({ extend: tv(theme), ...(appConfigAvatar.b24ui?.avatar || {})
|
|
|
13
12
|
|
|
14
13
|
type AvatarVariants = VariantProps<typeof avatar>
|
|
15
14
|
|
|
16
|
-
export interface AvatarProps
|
|
15
|
+
export interface AvatarProps {
|
|
17
16
|
/**
|
|
18
17
|
* The element or component this component should render as.
|
|
19
18
|
* @defaultValue 'span'
|
|
@@ -34,18 +33,14 @@ export interface AvatarSlots {
|
|
|
34
33
|
</script>
|
|
35
34
|
|
|
36
35
|
<script setup lang="ts">
|
|
37
|
-
import { ref, computed,
|
|
38
|
-
import {
|
|
39
|
-
import { reactivePick, useImage } from '@vueuse/core'
|
|
36
|
+
import { ref, computed, watch } from 'vue'
|
|
37
|
+
import { Primitive } from 'reka-ui'
|
|
40
38
|
import ImageComponent from '#build/b24ui-image-component'
|
|
41
39
|
import { useAvatarGroup } from '../composables/useAvatarGroup'
|
|
42
40
|
|
|
43
41
|
defineOptions({ inheritAttrs: false })
|
|
44
42
|
|
|
45
43
|
const props = withDefaults(defineProps<AvatarProps>(), { as: 'span' })
|
|
46
|
-
const attrs = useAttrs()
|
|
47
|
-
|
|
48
|
-
const fallbackProps = useForwardProps(reactivePick(props, 'delayMs'))
|
|
49
44
|
|
|
50
45
|
const fallback = computed(() => props.text || (props.alt || '')
|
|
51
46
|
.replace(/[+\-*)(}\][{]/g, '')
|
|
@@ -55,8 +50,6 @@ const fallback = computed(() => props.text || (props.alt || '')
|
|
|
55
50
|
.substring(0, 2)
|
|
56
51
|
)
|
|
57
52
|
|
|
58
|
-
const imageLoaded = ref(false)
|
|
59
|
-
|
|
60
53
|
const { size } = useAvatarGroup(props)
|
|
61
54
|
|
|
62
55
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
@@ -76,43 +69,37 @@ const sizePx = computed(() => ({
|
|
|
76
69
|
'3xl': 94
|
|
77
70
|
})[props.size || 'md'])
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
onMounted(() => {
|
|
81
|
-
if (!props.src || (ImageComponent as unknown as string) !== 'img') {
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const { then } = useImage({ ...props, ...attrs, src: props.src! })
|
|
72
|
+
const error = ref(false)
|
|
86
73
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
74
|
+
watch(() => props.src, () => {
|
|
75
|
+
if (error.value) {
|
|
76
|
+
error.value = false
|
|
77
|
+
}
|
|
92
78
|
})
|
|
79
|
+
|
|
80
|
+
function onError() {
|
|
81
|
+
error.value = true
|
|
82
|
+
}
|
|
93
83
|
</script>
|
|
94
84
|
|
|
95
85
|
<template>
|
|
96
|
-
<
|
|
86
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
|
|
97
87
|
<component
|
|
98
88
|
:is="ImageComponent"
|
|
99
|
-
v-if="src"
|
|
100
|
-
v-show="imageLoaded"
|
|
89
|
+
v-if="src && !error"
|
|
101
90
|
role="img"
|
|
102
91
|
:src="src"
|
|
103
92
|
:alt="alt"
|
|
104
93
|
:width="sizePx"
|
|
105
94
|
:height="sizePx"
|
|
106
|
-
v-bind="attrs"
|
|
95
|
+
v-bind="$attrs"
|
|
107
96
|
:class="b24ui.image({ class: props.b24ui?.image })"
|
|
108
|
-
@
|
|
97
|
+
@error="onError"
|
|
109
98
|
/>
|
|
110
99
|
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</AvatarFallback>
|
|
117
|
-
</AvatarRoot>
|
|
100
|
+
<slot v-else>
|
|
101
|
+
<Component :is="icon" v-if="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
102
|
+
<span v-else :class="b24ui.fallback({ class: props.b24ui?.fallback })">{{ fallback || ' ' }}</span>
|
|
103
|
+
</slot>
|
|
104
|
+
</Primitive>
|
|
118
105
|
</template>
|
|
@@ -100,11 +100,13 @@ const b24ui = computed(() => badge({
|
|
|
100
100
|
/>
|
|
101
101
|
</slot>
|
|
102
102
|
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
<span :class="b24ui.label({ class: props.b24ui?.label })">
|
|
104
|
+
<slot>
|
|
105
|
+
<span v-if="label">
|
|
106
|
+
{{ label }}
|
|
107
|
+
</span>
|
|
108
|
+
</slot>
|
|
109
|
+
</span>
|
|
108
110
|
</Primitive>
|
|
109
111
|
<slot name="trailing">
|
|
110
112
|
<Cross20Icon
|
|
@@ -19,6 +19,7 @@ export interface FormProps<T extends object> {
|
|
|
19
19
|
disabled?: boolean
|
|
20
20
|
validateOnInputDelay?: number
|
|
21
21
|
class?: any
|
|
22
|
+
transform?: boolean
|
|
22
23
|
onSubmit?: ((event: FormSubmitEvent<T>) => void | Promise<void>) | (() => void | Promise<void>)
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -43,7 +44,8 @@ const props = withDefaults(defineProps<FormProps<T>>(), {
|
|
|
43
44
|
validateOn() {
|
|
44
45
|
return ['input', 'blur', 'change'] as FormInputEvents[]
|
|
45
46
|
},
|
|
46
|
-
validateOnInputDelay: 300
|
|
47
|
+
validateOnInputDelay: 300,
|
|
48
|
+
transform: true
|
|
47
49
|
})
|
|
48
50
|
const emits = defineEmits<FormEmits<T>>()
|
|
49
51
|
defineSlots<FormSlots>()
|
|
@@ -192,7 +194,7 @@ async function onSubmitWrapper(payload: Event) {
|
|
|
192
194
|
const event = payload as FormSubmitEvent<any>
|
|
193
195
|
|
|
194
196
|
try {
|
|
195
|
-
event.data = await _validate({ nested: true, transform:
|
|
197
|
+
event.data = await _validate({ nested: true, transform: props.transform })
|
|
196
198
|
await props.onSubmit?.(event)
|
|
197
199
|
} catch (error) {
|
|
198
200
|
if (!(error instanceof FormValidationException)) {
|
|
@@ -205,9 +207,9 @@ async function onSubmitWrapper(payload: Event) {
|
|
|
205
207
|
children: error.children
|
|
206
208
|
}
|
|
207
209
|
emits('error', errorEvent)
|
|
210
|
+
} finally {
|
|
211
|
+
loading.value = false
|
|
208
212
|
}
|
|
209
|
-
|
|
210
|
-
loading.value = false
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
const disabled = computed(() => props.disabled || loading.value)
|
|
@@ -40,7 +40,7 @@ export interface ModalProps extends DialogRootProps {
|
|
|
40
40
|
* `{ size: 'xs', color: 'link' }`{lang="ts-type"}
|
|
41
41
|
* @defaultValue true
|
|
42
42
|
*/
|
|
43
|
-
close?:
|
|
43
|
+
close?: boolean | Partial<ButtonProps>
|
|
44
44
|
/**
|
|
45
45
|
* The icon displayed in the close button.
|
|
46
46
|
* @defaultValue icons.close
|
|
@@ -97,11 +97,14 @@ const contentEvents = computed(() => {
|
|
|
97
97
|
return {
|
|
98
98
|
pointerDownOutside: (e: Event) => e.preventDefault(),
|
|
99
99
|
interactOutside: (e: Event) => e.preventDefault(),
|
|
100
|
-
escapeKeyDown: (e: Event) => e.preventDefault()
|
|
100
|
+
escapeKeyDown: (e: Event) => e.preventDefault(),
|
|
101
|
+
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
return {
|
|
105
|
+
return {
|
|
106
|
+
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
107
|
+
}
|
|
105
108
|
})
|
|
106
109
|
|
|
107
110
|
const b24ui = computed(() => modal({
|
|
@@ -137,17 +140,19 @@ const b24ui = computed(() => modal({
|
|
|
137
140
|
<slot name="content">
|
|
138
141
|
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
139
142
|
<slot name="header">
|
|
140
|
-
<
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
144
|
+
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
145
|
+
<slot name="title">
|
|
146
|
+
{{ title }}
|
|
147
|
+
</slot>
|
|
148
|
+
</DialogTitle>
|
|
149
|
+
|
|
150
|
+
<DialogDescription v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
151
|
+
<slot name="description">
|
|
152
|
+
{{ description }}
|
|
153
|
+
</slot>
|
|
154
|
+
</DialogDescription>
|
|
155
|
+
</div>
|
|
151
156
|
|
|
152
157
|
<DialogClose as-child>
|
|
153
158
|
<slot name="close" :b24ui="b24ui">
|
|
@@ -157,7 +162,7 @@ const b24ui = computed(() => modal({
|
|
|
157
162
|
size="xs"
|
|
158
163
|
color="link"
|
|
159
164
|
:aria-label="t('modal.close')"
|
|
160
|
-
v-bind="typeof close === 'object' ? close :
|
|
165
|
+
v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
|
|
161
166
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
162
167
|
/>
|
|
163
168
|
</slot>
|
|
@@ -38,7 +38,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
38
38
|
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
|
|
39
39
|
* @defaultValue true
|
|
40
40
|
*/
|
|
41
|
-
close?:
|
|
41
|
+
close?: boolean | Partial<ButtonProps>
|
|
42
42
|
/**
|
|
43
43
|
* The icon displayed in the close button.
|
|
44
44
|
* @defaultValue icons.close
|
|
@@ -167,7 +167,7 @@ defineExpose({
|
|
|
167
167
|
size="xs"
|
|
168
168
|
color="link"
|
|
169
169
|
:aria-label="t('toast.close')"
|
|
170
|
-
v-bind="typeof close === 'object' ? close :
|
|
170
|
+
v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
|
|
171
171
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
172
172
|
@click.stop
|
|
173
173
|
/>
|
|
@@ -106,7 +106,8 @@ function getOffset(index: number) {
|
|
|
106
106
|
v-for="(toast, index) of toasts"
|
|
107
107
|
:key="toast.id"
|
|
108
108
|
ref="refs"
|
|
109
|
-
v-bind="omit(toast, ['id'])"
|
|
109
|
+
v-bind="omit(toast, ['id', 'close'])"
|
|
110
|
+
:close="(toast.close as boolean)"
|
|
110
111
|
:data-expanded="expanded"
|
|
111
112
|
:data-front="!expanded && index === toasts.length - 1"
|
|
112
113
|
:style="{
|
|
@@ -67,7 +67,7 @@ const b24ui = computed(() => tooltip({
|
|
|
67
67
|
|
|
68
68
|
<template>
|
|
69
69
|
<TooltipRoot v-slot="{ open }" v-bind="rootProps">
|
|
70
|
-
<TooltipTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
70
|
+
<TooltipTrigger v-if="!!slots.default" v-bind="$attrs" as-child :class="props.class">
|
|
71
71
|
<slot :open="open" />
|
|
72
72
|
</TooltipTrigger>
|
|
73
73
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/b24ui/prose/table-wrapper'
|
|
6
|
+
import { tv } from '../../utils/tv'
|
|
7
|
+
|
|
8
|
+
const appConfigTableWrapper = _appConfig as AppConfig & { b24ui: { prose: { tableWrapper: Partial<typeof theme> } } }
|
|
9
|
+
|
|
10
|
+
const tableWrapper = tv({ extend: tv(theme), ...(appConfigTableWrapper.b24ui?.prose?.tableWrapper || {}) })
|
|
11
|
+
|
|
12
|
+
type TableWrapperVariants = VariantProps<typeof tableWrapper>
|
|
13
|
+
|
|
14
|
+
export interface TableWrapperProps {
|
|
15
|
+
/**
|
|
16
|
+
* The element or component this component should render as.
|
|
17
|
+
* @defaultValue 'div'
|
|
18
|
+
*/
|
|
19
|
+
as?: any
|
|
20
|
+
size?: TableWrapperVariants['size']
|
|
21
|
+
rounded?: boolean
|
|
22
|
+
zebra?: boolean
|
|
23
|
+
pinRows?: boolean
|
|
24
|
+
pinCols?: boolean
|
|
25
|
+
rowHover?: boolean
|
|
26
|
+
bordered?: boolean
|
|
27
|
+
scrollbarThin?: boolean
|
|
28
|
+
class?: any
|
|
29
|
+
b24ui?: Partial<typeof tableWrapper.slots>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface TableWrapperSlots {
|
|
33
|
+
default(props?: {}): any
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { computed } from 'vue'
|
|
39
|
+
import { Primitive } from 'reka-ui'
|
|
40
|
+
|
|
41
|
+
defineOptions({ inheritAttrs: false })
|
|
42
|
+
|
|
43
|
+
const props = withDefaults(defineProps<TableWrapperProps>(), {
|
|
44
|
+
as: 'div',
|
|
45
|
+
scrollbarThin: true
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const b24ui = computed(() => tableWrapper({
|
|
49
|
+
size: props.size,
|
|
50
|
+
rounded: Boolean(props.rounded),
|
|
51
|
+
zebra: Boolean(props.zebra),
|
|
52
|
+
pinRows: Boolean(props.pinRows),
|
|
53
|
+
pinCols: Boolean(props.pinCols),
|
|
54
|
+
rowHover: Boolean(props.rowHover),
|
|
55
|
+
bordered: Boolean(props.bordered),
|
|
56
|
+
scrollbarThin: Boolean(props.scrollbarThin)
|
|
57
|
+
}))
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<Primitive
|
|
62
|
+
:as="as"
|
|
63
|
+
:class="b24ui.base({ class: [props.class, props.b24ui?.base] })"
|
|
64
|
+
>
|
|
65
|
+
<slot />
|
|
66
|
+
</Primitive>
|
|
67
|
+
</template>
|
package/dist/runtime/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@plugin "@bitrix24/b24style";@import "#build/b24ui.css";@import "./keyframes.css";@variant light (&:where(.light, .light *));@variant dark (&:where(.dark, .dark *));@layer base{body{@apply antialiased scheme-light dark:scheme-dark}}
|
|
1
|
+
@plugin "@bitrix24/b24style";@import "#build/b24ui.css";@import "./keyframes.css";@variant light (&:where(.light, .light *));@variant dark (&:where(.dark, .dark *));@layer base{body{@apply antialiased scheme-light dark:scheme-dark}.scrollbar-thin{scrollbar-width:thin}}
|
|
@@ -34,6 +34,7 @@ export * from '../components/Toast.vue';
|
|
|
34
34
|
export * from '../components/Toaster.vue';
|
|
35
35
|
export * from '../components/Tooltip.vue';
|
|
36
36
|
export * from '../components/content/DescriptionList.vue';
|
|
37
|
+
export * from '../components/prose/TableWrapper.vue';
|
|
37
38
|
export * from './form';
|
|
38
39
|
export * from './locale';
|
|
39
40
|
export * from './icons';
|
|
@@ -34,6 +34,7 @@ export * from "../components/Toast.vue";
|
|
|
34
34
|
export * from "../components/Toaster.vue";
|
|
35
35
|
export * from "../components/Tooltip.vue";
|
|
36
36
|
export * from "../components/content/DescriptionList.vue";
|
|
37
|
+
export * from "../components/prose/TableWrapper.vue";
|
|
37
38
|
export * from "./form.js";
|
|
38
39
|
export * from "./locale.js";
|
|
39
40
|
export * from "./icons.js";
|
|
@@ -175,7 +175,7 @@ const alert = {
|
|
|
175
175
|
const avatar = {
|
|
176
176
|
slots: {
|
|
177
177
|
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-base-100 dark:bg-base-900",
|
|
178
|
-
image: "h-full w-full rounded-[inherit] object-cover
|
|
178
|
+
image: "h-full w-full rounded-[inherit] object-cover",
|
|
179
179
|
fallback: "font-medium text-base-500 dark:text-base-600 truncate",
|
|
180
180
|
icon: "text-base-500 shrink-0 dark:text-base-600"
|
|
181
181
|
},
|
|
@@ -341,8 +341,7 @@ const badge = {
|
|
|
341
341
|
"px-2 leading-normal rounded-md"
|
|
342
342
|
].join(" "),
|
|
343
343
|
wrapper: "inline-flex items-center",
|
|
344
|
-
label: "max-w-full whitespace-nowrap text-ellipsis",
|
|
345
|
-
// truncate ////
|
|
344
|
+
label: "max-w-full whitespace-nowrap text-ellipsis decoration-from-font",
|
|
346
345
|
leadingIcon: "shrink-0",
|
|
347
346
|
leadingAvatar: "shrink-0",
|
|
348
347
|
leadingAvatarSize: "",
|
|
@@ -3157,10 +3156,10 @@ const modal = {
|
|
|
3157
3156
|
content: [
|
|
3158
3157
|
"py-md2 px-5",
|
|
3159
3158
|
"fixed bg-white dark:bg-base-950",
|
|
3160
|
-
// 'divide-y divide-base-900/10 dark:divide-white/20',
|
|
3161
3159
|
"flex flex-col focus:outline-none"
|
|
3162
3160
|
].join(" "),
|
|
3163
|
-
header: "pe-5 pt-0",
|
|
3161
|
+
header: "flex items-center gap-1.5 pe-5 pt-0 min-h-lg2",
|
|
3162
|
+
wrapper: "",
|
|
3164
3163
|
body: "flex-1 overflow-y-auto my-2.5 text-md leading-normal",
|
|
3165
3164
|
footer: "flex items-center justify-center gap-3 mt-2.5 pt-4 border-t border-t-1 border-t-base-900/10 dark:border-t-white/20",
|
|
3166
3165
|
title: "font-bold text-md leading-normal text-base-900 dark:text-base-150",
|
|
@@ -3181,7 +3180,7 @@ const modal = {
|
|
|
3181
3180
|
false: {
|
|
3182
3181
|
content: [
|
|
3183
3182
|
"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
3184
|
-
"w-[calc(100vw-2rem)] max-w-[32rem] max-h-[calc(
|
|
3183
|
+
"w-[calc(100vw-2rem)] max-w-[32rem] max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)]",
|
|
3185
3184
|
"rounded-md shadow-lg",
|
|
3186
3185
|
"ring ring-base-300 dark:ring-base-800"
|
|
3187
3186
|
].join(" ")
|
|
@@ -4972,8 +4971,94 @@ const theme = {
|
|
|
4972
4971
|
tooltip: tooltip
|
|
4973
4972
|
};
|
|
4974
4973
|
|
|
4974
|
+
const variantTable = "[&>table]";
|
|
4975
|
+
const variantHeadTr = "[&>table>thead>tr]";
|
|
4976
|
+
const variantBodyTr = "[&>table>tbody>tr]";
|
|
4977
|
+
const variantFoot = "[&>table>tfoot]";
|
|
4978
|
+
const variantFootTr = "[&>table>tfoot>tr]";
|
|
4979
|
+
const variantsTr = [
|
|
4980
|
+
variantHeadTr,
|
|
4981
|
+
variantBodyTr,
|
|
4982
|
+
variantFootTr
|
|
4983
|
+
];
|
|
4984
|
+
const variantsTdTh = [
|
|
4985
|
+
"[&>table>thead>tr>td]",
|
|
4986
|
+
"[&>table>thead>tr>th]",
|
|
4987
|
+
"[&>table>tbody>tr>td]",
|
|
4988
|
+
"[&>table>tbody>tr>th]",
|
|
4989
|
+
"[&>table>tfoot>tr>td]",
|
|
4990
|
+
"[&>table>tfoot>tr>th]"
|
|
4991
|
+
];
|
|
4992
|
+
const tableWrapper = {
|
|
4993
|
+
slots: {
|
|
4994
|
+
base: [
|
|
4995
|
+
`font-b24-primary ${variantTable}:text-md ${variantTable}:relative ${variantTable}:w-full ${variantTable}:text-left ${variantTable}:rtl:text-right`,
|
|
4996
|
+
`${variantTable}:text-base-900 dark:${variantTable}:text-base-200`,
|
|
4997
|
+
...variantsTdTh.map((variant) => `${variant}:align-middle`),
|
|
4998
|
+
...variantsTdTh.filter((variant) => !variant.includes("tbody>tr>td")).map((variant) => `${variant}:whitespace-nowrap ${variant}:text-md ${variant}:font-normal`),
|
|
4999
|
+
`${variantHeadTr}:border-base-300 dark:${variantHeadTr}:border-base-800`,
|
|
5000
|
+
`${variantBodyTr}:border-base-master/10 dark:${variantBodyTr}:border-base-100/20`,
|
|
5001
|
+
`${variantFoot}:border-base-300 dark:${variantFoot}:border-base-800`,
|
|
5002
|
+
`${variantHeadTr}:border-b ${variantBodyTr.replace(">tr]", ">tr:not(:last-child)]")}:border-b`,
|
|
5003
|
+
`${variantFoot}:border-t`
|
|
5004
|
+
].join(" ")
|
|
5005
|
+
},
|
|
5006
|
+
variants: {
|
|
5007
|
+
size: {
|
|
5008
|
+
xs: [
|
|
5009
|
+
...variantsTdTh.map((variant) => `${variant}:text-xs ${variant}:px-2 ${variant}:py-1`)
|
|
5010
|
+
].join(" "),
|
|
5011
|
+
sm: [
|
|
5012
|
+
...variantsTdTh.map((variant) => `${variant}:text-sm ${variant}:px-3 ${variant}:py-2`)
|
|
5013
|
+
].join(" "),
|
|
5014
|
+
md: [
|
|
5015
|
+
...variantsTdTh.map((variant) => `${variant}:text-md ${variant}:px-4 ${variant}:py-3.5`)
|
|
5016
|
+
].join(" "),
|
|
5017
|
+
lg: [
|
|
5018
|
+
...variantsTdTh.map((variant) => `${variant}:text-lg ${variant}:px-5 ${variant}:py-4`)
|
|
5019
|
+
].join(" ")
|
|
5020
|
+
},
|
|
5021
|
+
rounded: {
|
|
5022
|
+
true: "rounded-md",
|
|
5023
|
+
false: "rounded"
|
|
5024
|
+
},
|
|
5025
|
+
zebra: {
|
|
5026
|
+
true: [
|
|
5027
|
+
...variantsTr.filter((variant) => variant === variantBodyTr).map((variant) => `${variant}:even:bg-base-30 ${variant}:even:[&>td]:bg-base-30 ${variant}:even:[&>th]:bg-base-30 dark:${variant}:even:bg-base-dark dark:${variant}:even:[&>td]:bg-base-dark dark:${variant}:even:[&>th]:bg-base-dark`)
|
|
5028
|
+
].join(" ")
|
|
5029
|
+
},
|
|
5030
|
+
pinRows: {
|
|
5031
|
+
true: [
|
|
5032
|
+
...variantsTr.filter((variant) => variant !== variantBodyTr).map((variant) => `${variant}:sticky ${variant}:${variant === variantHeadTr ? "top-0" : "bottom-0"} ${variant}:z-1 ${variant}:bg-white dark:${variant}:bg-base-dark ${variant}:${variant === variantHeadTr ? "shadow-bottom-sm" : "shadow-top-sm"}`)
|
|
5033
|
+
].join(" ")
|
|
5034
|
+
},
|
|
5035
|
+
pinCols: {
|
|
5036
|
+
true: [
|
|
5037
|
+
...variantsTr.map((row) => {
|
|
5038
|
+
const variant = row.replace(">tr]", ">tr>th]");
|
|
5039
|
+
return `${variant}:sticky ${variant}:right-0 ${variant}:left-0 ${variant}:bg-base-20 dark:${variant}:bg-base-dark`;
|
|
5040
|
+
})
|
|
5041
|
+
].join(" ")
|
|
5042
|
+
},
|
|
5043
|
+
rowHover: {
|
|
5044
|
+
true: `${variantBodyTr}:hover:bg-base-40 ${variantBodyTr}:hover:[&>td]:bg-base-40 ${variantBodyTr}:hover:[&>th]:bg-base-40 dark:${variantBodyTr}:hover:bg-base-900 dark:${variantBodyTr}:hover:[&>td]:bg-base-900 dark:${variantBodyTr}:hover:[&>th]:bg-base-900`
|
|
5045
|
+
},
|
|
5046
|
+
bordered: {
|
|
5047
|
+
true: "border border-base-master/10 dark:border-base-800"
|
|
5048
|
+
},
|
|
5049
|
+
scrollbarThin: {
|
|
5050
|
+
true: "scrollbar-thin"
|
|
5051
|
+
}
|
|
5052
|
+
},
|
|
5053
|
+
defaultVariants: {
|
|
5054
|
+
size: "md",
|
|
5055
|
+
scrollbarThin: true
|
|
5056
|
+
}
|
|
5057
|
+
};
|
|
5058
|
+
|
|
4975
5059
|
const themeProse = {
|
|
4976
|
-
__proto__: null
|
|
5060
|
+
__proto__: null,
|
|
5061
|
+
tableWrapper: tableWrapper
|
|
4977
5062
|
};
|
|
4978
5063
|
|
|
4979
5064
|
const descriptionList = {
|