@bitrix24/b24ui-nuxt 0.5.6 → 0.5.8
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/radio-group.ts +223 -15
- package/.nuxt/b24ui/sidebar-layout.ts +3 -2
- package/dist/meta.cjs +85 -38
- package/dist/meta.d.cts +85 -38
- package/dist/meta.d.mts +85 -38
- package/dist/meta.d.ts +85 -38
- package/dist/meta.mjs +85 -38
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Avatar.vue +7 -5
- package/dist/runtime/components/DropdownMenuContent.vue +5 -3
- package/dist/runtime/components/InputMenu.vue +2 -1
- package/dist/runtime/components/InputNumber.vue +2 -2
- package/dist/runtime/components/RadioGroup.vue +16 -5
- package/dist/runtime/components/SelectMenu.vue +1 -1
- package/dist/runtime/components/SidebarLayout.vue +0 -1
- package/dist/runtime/components/StackedLayout.vue +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +3 -2
- package/dist/runtime/vue/stubs.d.ts +5 -0
- package/dist/runtime/vue/stubs.js +11 -2
- package/dist/shared/{b24ui-nuxt.GF6icKT2.cjs → b24ui-nuxt.B9fPD5yO.cjs} +207 -6
- package/dist/shared/{b24ui-nuxt.Cdw6m70Y.mjs → b24ui-nuxt.DBFS6LH7.mjs} +207 -6
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +5 -4
package/dist/meta.mjs
CHANGED
|
@@ -42353,6 +42353,23 @@ const B24UIMeta = {
|
|
|
42353
42353
|
}
|
|
42354
42354
|
}
|
|
42355
42355
|
},
|
|
42356
|
+
{
|
|
42357
|
+
"name": "stepSnapping",
|
|
42358
|
+
"global": false,
|
|
42359
|
+
"description": "When `false`, prevents the value from snapping to the nearest increment of the step value",
|
|
42360
|
+
"tags": [],
|
|
42361
|
+
"required": false,
|
|
42362
|
+
"type": "boolean | undefined",
|
|
42363
|
+
"schema": {
|
|
42364
|
+
"kind": "enum",
|
|
42365
|
+
"type": "boolean | undefined",
|
|
42366
|
+
"schema": {
|
|
42367
|
+
"0": "undefined",
|
|
42368
|
+
"1": "false",
|
|
42369
|
+
"2": "true"
|
|
42370
|
+
}
|
|
42371
|
+
}
|
|
42372
|
+
},
|
|
42356
42373
|
{
|
|
42357
42374
|
"name": "formatOptions",
|
|
42358
42375
|
"global": false,
|
|
@@ -42372,6 +42389,23 @@ const B24UIMeta = {
|
|
|
42372
42389
|
}
|
|
42373
42390
|
}
|
|
42374
42391
|
}
|
|
42392
|
+
},
|
|
42393
|
+
{
|
|
42394
|
+
"name": "disableWheelChange",
|
|
42395
|
+
"global": false,
|
|
42396
|
+
"description": "When `true`, prevents the value from changing on wheel scroll.",
|
|
42397
|
+
"tags": [],
|
|
42398
|
+
"required": false,
|
|
42399
|
+
"type": "boolean | undefined",
|
|
42400
|
+
"schema": {
|
|
42401
|
+
"kind": "enum",
|
|
42402
|
+
"type": "boolean | undefined",
|
|
42403
|
+
"schema": {
|
|
42404
|
+
"0": "undefined",
|
|
42405
|
+
"1": "false",
|
|
42406
|
+
"2": "true"
|
|
42407
|
+
}
|
|
42408
|
+
}
|
|
42375
42409
|
}
|
|
42376
42410
|
],
|
|
42377
42411
|
"slots": [
|
|
@@ -53233,6 +53267,29 @@ const B24UIMeta = {
|
|
|
53233
53267
|
}
|
|
53234
53268
|
}
|
|
53235
53269
|
},
|
|
53270
|
+
{
|
|
53271
|
+
"name": "variant",
|
|
53272
|
+
"global": false,
|
|
53273
|
+
"description": "",
|
|
53274
|
+
"tags": [
|
|
53275
|
+
{
|
|
53276
|
+
"name": "defaultValue",
|
|
53277
|
+
"text": "'list'"
|
|
53278
|
+
}
|
|
53279
|
+
],
|
|
53280
|
+
"required": false,
|
|
53281
|
+
"type": "\"table\" | \"list\" | \"card\" | undefined",
|
|
53282
|
+
"schema": {
|
|
53283
|
+
"kind": "enum",
|
|
53284
|
+
"type": "\"table\" | \"list\" | \"card\" | undefined",
|
|
53285
|
+
"schema": {
|
|
53286
|
+
"0": "undefined",
|
|
53287
|
+
"1": "\"table\"",
|
|
53288
|
+
"2": "\"list\"",
|
|
53289
|
+
"3": "\"card\""
|
|
53290
|
+
}
|
|
53291
|
+
}
|
|
53292
|
+
},
|
|
53236
53293
|
{
|
|
53237
53294
|
"name": "color",
|
|
53238
53295
|
"global": false,
|
|
@@ -53284,19 +53341,42 @@ const B24UIMeta = {
|
|
|
53284
53341
|
},
|
|
53285
53342
|
"default": "\"vertical\""
|
|
53286
53343
|
},
|
|
53344
|
+
{
|
|
53345
|
+
"name": "indicator",
|
|
53346
|
+
"global": false,
|
|
53347
|
+
"description": "Position of the indicator.",
|
|
53348
|
+
"tags": [
|
|
53349
|
+
{
|
|
53350
|
+
"name": "defaultValue",
|
|
53351
|
+
"text": "'start'"
|
|
53352
|
+
}
|
|
53353
|
+
],
|
|
53354
|
+
"required": false,
|
|
53355
|
+
"type": "\"start\" | \"end\" | \"hidden\" | undefined",
|
|
53356
|
+
"schema": {
|
|
53357
|
+
"kind": "enum",
|
|
53358
|
+
"type": "\"start\" | \"end\" | \"hidden\" | undefined",
|
|
53359
|
+
"schema": {
|
|
53360
|
+
"0": "undefined",
|
|
53361
|
+
"1": "\"start\"",
|
|
53362
|
+
"2": "\"end\"",
|
|
53363
|
+
"3": "\"hidden\""
|
|
53364
|
+
}
|
|
53365
|
+
}
|
|
53366
|
+
},
|
|
53287
53367
|
{
|
|
53288
53368
|
"name": "b24ui",
|
|
53289
53369
|
"global": false,
|
|
53290
53370
|
"description": "",
|
|
53291
53371
|
"tags": [],
|
|
53292
53372
|
"required": false,
|
|
53293
|
-
"type": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator:
|
|
53373
|
+
"type": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator: \"start\" | \"end\" | \"hidden\"; container: string; wrapper: string; label: string; description: string; }> | undefined",
|
|
53294
53374
|
"schema": {
|
|
53295
53375
|
"kind": "enum",
|
|
53296
|
-
"type": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator:
|
|
53376
|
+
"type": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator: \"start\" | \"end\" | \"hidden\"; container: string; wrapper: string; label: string; description: string; }> | undefined",
|
|
53297
53377
|
"schema": {
|
|
53298
53378
|
"0": "undefined",
|
|
53299
|
-
"1": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator:
|
|
53379
|
+
"1": "Partial<{ root: string; fieldset: string; legend: string; item: string; base: string; indicator: \"start\" | \"end\" | \"hidden\"; container: string; wrapper: string; label: string; description: string; }>"
|
|
53300
53380
|
}
|
|
53301
53381
|
}
|
|
53302
53382
|
},
|
|
@@ -64211,23 +64291,6 @@ const B24UIMeta = {
|
|
|
64211
64291
|
"schema": "any",
|
|
64212
64292
|
"default": "\"div\""
|
|
64213
64293
|
},
|
|
64214
|
-
{
|
|
64215
|
-
"name": "useSidebar",
|
|
64216
|
-
"global": false,
|
|
64217
|
-
"description": "",
|
|
64218
|
-
"tags": [],
|
|
64219
|
-
"required": false,
|
|
64220
|
-
"type": "boolean | undefined",
|
|
64221
|
-
"schema": {
|
|
64222
|
-
"kind": "enum",
|
|
64223
|
-
"type": "boolean | undefined",
|
|
64224
|
-
"schema": {
|
|
64225
|
-
"0": "undefined",
|
|
64226
|
-
"1": "false",
|
|
64227
|
-
"2": "true"
|
|
64228
|
-
}
|
|
64229
|
-
}
|
|
64230
|
-
},
|
|
64231
64294
|
{
|
|
64232
64295
|
"name": "useLightContent",
|
|
64233
64296
|
"global": false,
|
|
@@ -65312,23 +65375,6 @@ const B24UIMeta = {
|
|
|
65312
65375
|
"schema": "any",
|
|
65313
65376
|
"default": "\"div\""
|
|
65314
65377
|
},
|
|
65315
|
-
{
|
|
65316
|
-
"name": "useSidebar",
|
|
65317
|
-
"global": false,
|
|
65318
|
-
"description": "",
|
|
65319
|
-
"tags": [],
|
|
65320
|
-
"required": false,
|
|
65321
|
-
"type": "boolean | undefined",
|
|
65322
|
-
"schema": {
|
|
65323
|
-
"kind": "enum",
|
|
65324
|
-
"type": "boolean | undefined",
|
|
65325
|
-
"schema": {
|
|
65326
|
-
"0": "undefined",
|
|
65327
|
-
"1": "false",
|
|
65328
|
-
"2": "true"
|
|
65329
|
-
}
|
|
65330
|
-
}
|
|
65331
|
-
},
|
|
65332
65378
|
{
|
|
65333
65379
|
"name": "useLightContent",
|
|
65334
65380
|
"global": false,
|
|
@@ -65344,7 +65390,8 @@ const B24UIMeta = {
|
|
|
65344
65390
|
"1": "false",
|
|
65345
65391
|
"2": "true"
|
|
65346
65392
|
}
|
|
65347
|
-
}
|
|
65393
|
+
},
|
|
65394
|
+
"default": "true"
|
|
65348
65395
|
},
|
|
65349
65396
|
{
|
|
65350
65397
|
"name": "b24ui",
|
package/dist/module.cjs
CHANGED
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.DBFS6LH7.mjs';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'scule';
|
|
6
6
|
|
|
@@ -42,7 +42,7 @@ export interface AvatarSlots {
|
|
|
42
42
|
|
|
43
43
|
<script setup lang="ts">
|
|
44
44
|
import { ref, computed, watch } from 'vue'
|
|
45
|
-
import { Primitive } from 'reka-ui'
|
|
45
|
+
import { Primitive, Slot } from 'reka-ui'
|
|
46
46
|
import ImageComponent from '#build/b24ui-image-component'
|
|
47
47
|
import { useAvatarGroup } from '../composables/useAvatarGroup'
|
|
48
48
|
|
|
@@ -105,9 +105,11 @@ function onError() {
|
|
|
105
105
|
@error="onError"
|
|
106
106
|
/>
|
|
107
107
|
|
|
108
|
-
<
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
<Slot v-else v-bind="$attrs">
|
|
109
|
+
<slot>
|
|
110
|
+
<Component :is="icon" v-if="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
111
|
+
<span v-else :class="b24ui.fallback({ class: props.b24ui?.fallback })">{{ fallback || ' ' }}</span>
|
|
112
|
+
</slot>
|
|
113
|
+
</Slot>
|
|
112
114
|
</Primitive>
|
|
113
115
|
</template>
|
|
@@ -38,6 +38,7 @@ import { computed } from 'vue'
|
|
|
38
38
|
import { DropdownMenu } from 'reka-ui/namespaced'
|
|
39
39
|
import { useForwardPropsEmits } from 'reka-ui'
|
|
40
40
|
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
|
41
|
+
import { useLocale } from '../composables/useLocale'
|
|
41
42
|
import { omit, get, isArrayOfArray } from '../utils'
|
|
42
43
|
import { pickLinkProps } from '../utils/link'
|
|
43
44
|
import icons from '../dictionary/icons'
|
|
@@ -52,11 +53,13 @@ const props = defineProps<DropdownMenuContentProps<T>>()
|
|
|
52
53
|
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
53
54
|
const slots = defineSlots<DropdownMenuContentSlots<T>>()
|
|
54
55
|
|
|
56
|
+
const { dir } = useLocale()
|
|
55
57
|
const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'labelKey', 'checkedIcon', 'externalIcon', 'class', 'b24ui', 'b24uiOverride'), emits)
|
|
56
58
|
const proxySlots = omit(slots, ['default'])
|
|
57
59
|
|
|
58
60
|
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: DropdownMenuItem, active?: boolean, index: number }>()
|
|
59
61
|
|
|
62
|
+
const childrenIcon = computed(() => dir.value === 'rtl' ? icons.chevronLeft : icons.chevronRight)
|
|
60
63
|
const groups = computed<DropdownMenuItem[][]>(() =>
|
|
61
64
|
props.items?.length
|
|
62
65
|
? isArrayOfArray(props.items)
|
|
@@ -102,7 +105,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
102
105
|
<span :class="b24ui.itemTrailing({ class: b24uiOverride?.itemTrailing })">
|
|
103
106
|
<slot :name="((item.slot ? `${item.slot}-trailing`: 'item-trailing') as keyof DropdownMenuContentSlots<T>)" :item="(item as Extract<NestedItem<T>, { slot: string; }>)" :active="active" :index="index">
|
|
104
107
|
<Component
|
|
105
|
-
:is="
|
|
108
|
+
:is="childrenIcon"
|
|
106
109
|
v-if="item.children?.length"
|
|
107
110
|
:class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color, active })"
|
|
108
111
|
/>
|
|
@@ -147,7 +150,6 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
147
150
|
:b24ui-override="b24uiOverride"
|
|
148
151
|
:portal="portal"
|
|
149
152
|
:items="(item.children as T)"
|
|
150
|
-
side="right"
|
|
151
153
|
align="start"
|
|
152
154
|
:align-offset="-4"
|
|
153
155
|
:side-offset="3"
|
|
@@ -156,7 +158,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
156
158
|
:external-icon="externalIcon"
|
|
157
159
|
v-bind="item.content"
|
|
158
160
|
>
|
|
159
|
-
<template v-for="(_, name) in proxySlots" #[name]="slotData
|
|
161
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
160
162
|
<slot :name="(name as keyof DropdownMenuContentSlots<T>)" v-bind="slotData" />
|
|
161
163
|
</template>
|
|
162
164
|
</B24DropdownMenuContent>
|
|
@@ -397,6 +397,7 @@ function onRemoveTag(event: any) {
|
|
|
397
397
|
const modelValue = props.modelValue as GetModelValue<T, VK, true>
|
|
398
398
|
const filteredValue = modelValue.filter(value => !isEqual(value, event))
|
|
399
399
|
emits('update:modelValue', filteredValue as GetModelValue<T, VK, M>)
|
|
400
|
+
onUpdate(filteredValue)
|
|
400
401
|
}
|
|
401
402
|
}
|
|
402
403
|
|
|
@@ -547,7 +548,7 @@ defineExpose({
|
|
|
547
548
|
:class="b24ui.item({ class: props.b24ui?.item, colorItem: isInputItem(item) ? item?.color : undefined })"
|
|
548
549
|
:disabled="isInputItem(item) && item.disabled"
|
|
549
550
|
:value="props.valueKey && isInputItem(item) ? get(item, String(props.valueKey)) : item"
|
|
550
|
-
@select="isInputItem(item) && item.onSelect"
|
|
551
|
+
@select="isInputItem(item) && item.onSelect?.($event)"
|
|
551
552
|
>
|
|
552
553
|
<slot name="item" :item="(item as NestedItem<T>)" :index="index">
|
|
553
554
|
<slot name="item-leading" :item="(item as NestedItem<T>)" :index="index">
|
|
@@ -14,7 +14,7 @@ const inputNumber = tv({ extend: tv(theme), ...(appConfigInputNumber.b24ui?.inpu
|
|
|
14
14
|
|
|
15
15
|
type InputNumberVariants = VariantProps<typeof inputNumber>
|
|
16
16
|
|
|
17
|
-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions'> {
|
|
17
|
+
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'stepSnapping' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange'> {
|
|
18
18
|
/**
|
|
19
19
|
* The element or component this component should render as.
|
|
20
20
|
* @defaultValue 'div'
|
|
@@ -137,7 +137,7 @@ const props = withDefaults(defineProps<InputNumberProps>(), {
|
|
|
137
137
|
const emits = defineEmits<InputNumberEmits>()
|
|
138
138
|
defineSlots<InputNumberSlots>()
|
|
139
139
|
|
|
140
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'formatOptions'), emits)
|
|
140
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange'), emits)
|
|
141
141
|
|
|
142
142
|
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)
|
|
143
143
|
|
|
@@ -49,6 +49,10 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
|
|
|
49
49
|
* @defaultValue 'md'
|
|
50
50
|
*/
|
|
51
51
|
size?: RadioGroupVariants['size']
|
|
52
|
+
/**
|
|
53
|
+
* @defaultValue 'list'
|
|
54
|
+
*/
|
|
55
|
+
variant?: RadioGroupVariants['variant']
|
|
52
56
|
/**
|
|
53
57
|
* @defaultValue 'primary'
|
|
54
58
|
*/
|
|
@@ -58,6 +62,11 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
|
|
|
58
62
|
* @defaultValue 'vertical'
|
|
59
63
|
*/
|
|
60
64
|
orientation?: RadioGroupRootProps['orientation']
|
|
65
|
+
/**
|
|
66
|
+
* Position of the indicator.
|
|
67
|
+
* @defaultValue 'start'
|
|
68
|
+
*/
|
|
69
|
+
indicator?: RadioGroupVariants['indicator']
|
|
61
70
|
class?: any
|
|
62
71
|
b24ui?: Partial<typeof radioGroup.slots>
|
|
63
72
|
}
|
|
@@ -101,7 +110,9 @@ const b24ui = computed(() => radioGroup({
|
|
|
101
110
|
color: color.value,
|
|
102
111
|
disabled: disabled.value,
|
|
103
112
|
required: props.required,
|
|
104
|
-
orientation: props.orientation
|
|
113
|
+
orientation: props.orientation,
|
|
114
|
+
variant: props.variant,
|
|
115
|
+
indicator: props.indicator
|
|
105
116
|
}))
|
|
106
117
|
|
|
107
118
|
function normalizeItem(item: any) {
|
|
@@ -167,7 +178,7 @@ function onUpdate(value: any) {
|
|
|
167
178
|
{{ legend }}
|
|
168
179
|
</slot>
|
|
169
180
|
</legend>
|
|
170
|
-
<div v-for="item in normalizedItems" :key="item.value" :class="b24ui.item({ class: props.b24ui?.item })">
|
|
181
|
+
<component :is="variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" :class="b24ui.item({ class: props.b24ui?.item })">
|
|
171
182
|
<div :class="b24ui.container({ class: props.b24ui?.container })">
|
|
172
183
|
<RadioGroupItem
|
|
173
184
|
:id="item.id"
|
|
@@ -180,18 +191,18 @@ function onUpdate(value: any) {
|
|
|
180
191
|
</div>
|
|
181
192
|
|
|
182
193
|
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
183
|
-
<Label :class="b24ui.label({ class: props.b24ui?.label })" :for="item.id">
|
|
194
|
+
<component :is="variant === 'list' ? Label : 'p'" :class="b24ui.label({ class: props.b24ui?.label })" :for="item.id">
|
|
184
195
|
<slot name="label" :item="item" :model-value="(modelValue as RadioGroupValue)">
|
|
185
196
|
{{ item.label }}
|
|
186
197
|
</slot>
|
|
187
|
-
</
|
|
198
|
+
</component>
|
|
188
199
|
<p v-if="item.description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
189
200
|
<slot name="description" :item="item" :model-value="(modelValue as RadioGroupValue)">
|
|
190
201
|
{{ item.description }}
|
|
191
202
|
</slot>
|
|
192
203
|
</p>
|
|
193
204
|
</div>
|
|
194
|
-
</
|
|
205
|
+
</component>
|
|
195
206
|
</fieldset>
|
|
196
207
|
</RadioGroupRoot>
|
|
197
208
|
</template>
|
|
@@ -495,7 +495,7 @@ function isSelectItem(item: SelectMenuItem): item is _SelectMenuItem {
|
|
|
495
495
|
:class="b24ui.item({ class: props.b24ui?.item, colorItem: isSelectItem(item) ? item?.color : undefined })"
|
|
496
496
|
:disabled="isSelectItem(item) && item.disabled"
|
|
497
497
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey as string) : item"
|
|
498
|
-
@select="isSelectItem(item) && item.onSelect"
|
|
498
|
+
@select="isSelectItem(item) && item.onSelect?.($event)"
|
|
499
499
|
>
|
|
500
500
|
<slot name="item" :item="(item as NestedItem<T>)" :index="index">
|
|
501
501
|
<slot name="item-leading" :item="(item as NestedItem<T>)" :index="index">
|
|
@@ -18,7 +18,6 @@ export interface StackedLayoutProps {
|
|
|
18
18
|
* @defaultValue 'div'
|
|
19
19
|
*/
|
|
20
20
|
as?: any
|
|
21
|
-
useSidebar?: boolean
|
|
22
21
|
useLightContent?: boolean
|
|
23
22
|
class?: any
|
|
24
23
|
b24ui?: Partial<typeof stackedLayout.slots>
|
|
@@ -53,7 +52,8 @@ import MenuIcon from '@bitrix24/b24icons-vue/main/MenuIcon'
|
|
|
53
52
|
import Cross50Icon from '@bitrix24/b24icons-vue/actions/Cross50Icon'
|
|
54
53
|
|
|
55
54
|
const props = withDefaults(defineProps<StackedLayoutProps>(), {
|
|
56
|
-
as: 'div'
|
|
55
|
+
as: 'div',
|
|
56
|
+
useLightContent: true
|
|
57
57
|
})
|
|
58
58
|
const slots = defineSlots<StackedLayoutSlots>()
|
|
59
59
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
2
|
+
import type { ComponentProps, ComponentEmit } from 'vue-component-type-helpers';
|
|
3
|
+
type CloseEventArgType<T> = T extends (event: 'close', args_0: infer R) => void ? R : never;
|
|
3
4
|
export type OverlayOptions<OverlayAttrs = Record<string, any>> = {
|
|
4
5
|
defaultOpen?: boolean;
|
|
5
6
|
props?: OverlayAttrs;
|
|
@@ -14,7 +15,7 @@ type ManagedOverlayOptionsPrivate<T extends Component> = {
|
|
|
14
15
|
};
|
|
15
16
|
export type Overlay = OverlayOptions<Component> & ManagedOverlayOptionsPrivate<Component>;
|
|
16
17
|
interface OverlayInstance<T> {
|
|
17
|
-
open: (props?: ComponentProps<T>) => Promise<
|
|
18
|
+
open: (props?: ComponentProps<T>) => Promise<CloseEventArgType<ComponentEmit<T>>>;
|
|
18
19
|
close: (value?: any) => void;
|
|
19
20
|
patch: (props: Partial<ComponentProps<T>>) => void;
|
|
20
21
|
}
|
|
@@ -31,7 +31,12 @@ export declare function useNuxtApp(): {
|
|
|
31
31
|
payload: {
|
|
32
32
|
serverRendered: boolean;
|
|
33
33
|
};
|
|
34
|
+
hooks: import("hookable").Hookable<Record<string, any>, string>;
|
|
35
|
+
hook: <NameT extends string>(name: NameT, function_: any, options?: {
|
|
36
|
+
allowDeprecated?: boolean;
|
|
37
|
+
}) => () => void;
|
|
34
38
|
};
|
|
39
|
+
export declare function useRuntimeHook(name: string, fn: (...args: any[]) => void): void;
|
|
35
40
|
export declare function defineNuxtPlugin(plugin: (nuxtApp: NuxtApp) => void): {
|
|
36
41
|
install(app: import("vue").App<any>): void;
|
|
37
42
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, onScopeDispose } from "vue";
|
|
2
|
+
import { createHooks } from "hookable";
|
|
2
3
|
import appConfig from "#build/app.config";
|
|
3
4
|
import { useColorMode as useColorModeVueUse } from "@vueuse/core";
|
|
4
5
|
export { useHead } from "@unhead/vue";
|
|
@@ -52,12 +53,20 @@ export const useState = (key, init) => {
|
|
|
52
53
|
state[key] = value;
|
|
53
54
|
return value;
|
|
54
55
|
};
|
|
56
|
+
const hooks = createHooks();
|
|
55
57
|
export function useNuxtApp() {
|
|
56
58
|
return {
|
|
57
59
|
isHydrating: true,
|
|
58
|
-
payload: { serverRendered: false }
|
|
60
|
+
payload: { serverRendered: false },
|
|
61
|
+
hooks,
|
|
62
|
+
hook: hooks.hook
|
|
59
63
|
};
|
|
60
64
|
}
|
|
65
|
+
export function useRuntimeHook(name, fn) {
|
|
66
|
+
const nuxtApp = useNuxtApp();
|
|
67
|
+
const unregister = nuxtApp.hook(name, fn);
|
|
68
|
+
onScopeDispose(unregister);
|
|
69
|
+
}
|
|
61
70
|
export function defineNuxtPlugin(plugin) {
|
|
62
71
|
return {
|
|
63
72
|
install(app) {
|