@bitrix24/b24ui-nuxt 0.5.5 → 0.5.7

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.ts CHANGED
@@ -64211,23 +64211,6 @@ var B24UIMeta = {
64211
64211
  "schema": "any",
64212
64212
  "default": "\"div\""
64213
64213
  },
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
64214
  {
64232
64215
  "name": "useLightContent",
64233
64216
  "global": false,
@@ -64252,13 +64235,13 @@ var B24UIMeta = {
64252
64235
  "description": "",
64253
64236
  "tags": [],
64254
64237
  "required": false,
64255
- "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64238
+ "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64256
64239
  "schema": {
64257
64240
  "kind": "enum",
64258
- "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64241
+ "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64259
64242
  "schema": {
64260
64243
  "0": "undefined",
64261
- "1": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
64244
+ "1": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
64262
64245
  }
64263
64246
  }
64264
64247
  }
@@ -65312,28 +65295,86 @@ var B24UIMeta = {
65312
65295
  "schema": "any",
65313
65296
  "default": "\"div\""
65314
65297
  },
65298
+ {
65299
+ "name": "useLightContent",
65300
+ "global": false,
65301
+ "description": "",
65302
+ "tags": [],
65303
+ "required": false,
65304
+ "type": "boolean | undefined",
65305
+ "schema": {
65306
+ "kind": "enum",
65307
+ "type": "boolean | undefined",
65308
+ "schema": {
65309
+ "0": "undefined",
65310
+ "1": "false",
65311
+ "2": "true"
65312
+ }
65313
+ },
65314
+ "default": "true"
65315
+ },
65315
65316
  {
65316
65317
  "name": "b24ui",
65317
65318
  "global": false,
65318
65319
  "description": "",
65319
65320
  "tags": [],
65320
65321
  "required": false,
65321
- "type": "Partial<{ root: string; container: string; }> | undefined",
65322
+ "type": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
65322
65323
  "schema": {
65323
65324
  "kind": "enum",
65324
- "type": "Partial<{ root: string; container: string; }> | undefined",
65325
+ "type": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
65325
65326
  "schema": {
65326
65327
  "0": "undefined",
65327
- "1": "Partial<{ root: string; container: string; }>"
65328
+ "1": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
65328
65329
  }
65329
65330
  }
65330
65331
  }
65331
65332
  ],
65332
65333
  "slots": [
65334
+ {
65335
+ "name": "sidebar",
65336
+ "type": "{ handleClick: () => void; }",
65337
+ "description": "Menu for mobile screen sizes.",
65338
+ "schema": {
65339
+ "kind": "object",
65340
+ "type": "{ handleClick: () => void; }",
65341
+ "schema": {
65342
+ "handleClick": {
65343
+ "name": "handleClick",
65344
+ "global": false,
65345
+ "description": "",
65346
+ "tags": [],
65347
+ "required": true,
65348
+ "type": "() => void",
65349
+ "schema": {
65350
+ "kind": "event",
65351
+ "type": "(): void"
65352
+ }
65353
+ }
65354
+ }
65355
+ }
65356
+ },
65357
+ {
65358
+ "name": "navbar",
65359
+ "type": "{} | undefined",
65360
+ "description": "Menu for desktop screen sizes.",
65361
+ "schema": {
65362
+ "kind": "enum",
65363
+ "type": "{} | undefined",
65364
+ "schema": {
65365
+ "0": "undefined",
65366
+ "1": {
65367
+ "kind": "object",
65368
+ "type": "{}",
65369
+ "schema": {}
65370
+ }
65371
+ }
65372
+ }
65373
+ },
65333
65374
  {
65334
65375
  "name": "default",
65335
65376
  "type": "{} | undefined",
65336
- "description": "",
65377
+ "description": "The page content.",
65337
65378
  "schema": {
65338
65379
  "kind": "enum",
65339
65380
  "type": "{} | undefined",
package/dist/meta.mjs CHANGED
@@ -64211,23 +64211,6 @@ const B24UIMeta = {
64211
64211
  "schema": "any",
64212
64212
  "default": "\"div\""
64213
64213
  },
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
64214
  {
64232
64215
  "name": "useLightContent",
64233
64216
  "global": false,
@@ -64252,13 +64235,13 @@ const B24UIMeta = {
64252
64235
  "description": "",
64253
64236
  "tags": [],
64254
64237
  "required": false,
64255
- "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64238
+ "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64256
64239
  "schema": {
64257
64240
  "kind": "enum",
64258
- "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64241
+ "type": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
64259
64242
  "schema": {
64260
64243
  "0": "undefined",
64261
- "1": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
64244
+ "1": "Partial<{ root: string; sidebar: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
64262
64245
  }
64263
64246
  }
64264
64247
  }
@@ -65312,28 +65295,86 @@ const B24UIMeta = {
65312
65295
  "schema": "any",
65313
65296
  "default": "\"div\""
65314
65297
  },
65298
+ {
65299
+ "name": "useLightContent",
65300
+ "global": false,
65301
+ "description": "",
65302
+ "tags": [],
65303
+ "required": false,
65304
+ "type": "boolean | undefined",
65305
+ "schema": {
65306
+ "kind": "enum",
65307
+ "type": "boolean | undefined",
65308
+ "schema": {
65309
+ "0": "undefined",
65310
+ "1": "false",
65311
+ "2": "true"
65312
+ }
65313
+ },
65314
+ "default": "true"
65315
+ },
65315
65316
  {
65316
65317
  "name": "b24ui",
65317
65318
  "global": false,
65318
65319
  "description": "",
65319
65320
  "tags": [],
65320
65321
  "required": false,
65321
- "type": "Partial<{ root: string; container: string; }> | undefined",
65322
+ "type": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
65322
65323
  "schema": {
65323
65324
  "kind": "enum",
65324
- "type": "Partial<{ root: string; container: string; }> | undefined",
65325
+ "type": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }> | undefined",
65325
65326
  "schema": {
65326
65327
  "0": "undefined",
65327
- "1": "Partial<{ root: string; container: string; }>"
65328
+ "1": "Partial<{ root: string; sidebarSlideoverContainer: string; sidebarSlideover: string; sidebarSlideoverBtnClose: string; header: string; headerMenuIcon: string; headerPaddings: string; headerWrapper: string; container: string; containerWrapper: string; containerWrapperInner: string; }>"
65328
65329
  }
65329
65330
  }
65330
65331
  }
65331
65332
  ],
65332
65333
  "slots": [
65334
+ {
65335
+ "name": "sidebar",
65336
+ "type": "{ handleClick: () => void; }",
65337
+ "description": "Menu for mobile screen sizes.",
65338
+ "schema": {
65339
+ "kind": "object",
65340
+ "type": "{ handleClick: () => void; }",
65341
+ "schema": {
65342
+ "handleClick": {
65343
+ "name": "handleClick",
65344
+ "global": false,
65345
+ "description": "",
65346
+ "tags": [],
65347
+ "required": true,
65348
+ "type": "() => void",
65349
+ "schema": {
65350
+ "kind": "event",
65351
+ "type": "(): void"
65352
+ }
65353
+ }
65354
+ }
65355
+ }
65356
+ },
65357
+ {
65358
+ "name": "navbar",
65359
+ "type": "{} | undefined",
65360
+ "description": "Menu for desktop screen sizes.",
65361
+ "schema": {
65362
+ "kind": "enum",
65363
+ "type": "{} | undefined",
65364
+ "schema": {
65365
+ "0": "undefined",
65366
+ "1": {
65367
+ "kind": "object",
65368
+ "type": "{}",
65369
+ "schema": {}
65370
+ }
65371
+ }
65372
+ }
65373
+ },
65333
65374
  {
65334
65375
  "name": "default",
65335
65376
  "type": "{} | undefined",
65336
- "description": "",
65377
+ "description": "The page content.",
65337
65378
  "schema": {
65338
65379
  "kind": "enum",
65339
65380
  "type": "{} | undefined",
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.BGKKwlPY.cjs');
5
+ const templates = require('./shared/b24ui-nuxt.BsnG7poi.cjs');
6
6
  require('node:url');
7
7
  require('scule');
8
8
 
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
7
  "docs": "https://bitrix24.github.io/b24ui/guide/installation-nuxt-app.html",
8
- "version": "0.5.5",
8
+ "version": "0.5.7",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
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.DWwKgFlo.mjs';
3
+ import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.CMCKw62O.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
- <slot v-else>
109
- <Component :is="icon" v-if="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
110
- <span v-else :class="b24ui.fallback({ class: props.b24ui?.fallback })">{{ fallback || '&nbsp;' }}</span>
111
- </slot>
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 || '&nbsp;' }}</span>
112
+ </slot>
113
+ </Slot>
112
114
  </Primitive>
113
115
  </template>
@@ -156,7 +156,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
156
156
  :external-icon="externalIcon"
157
157
  v-bind="item.content"
158
158
  >
159
- <template v-for="(_, name) in proxySlots" #[name]="slotData: any">
159
+ <template v-for="(_, name) in proxySlots" #[name]="slotData">
160
160
  <slot :name="(name as keyof DropdownMenuContentSlots<T>)" v-bind="slotData" />
161
161
  </template>
162
162
  </B24DropdownMenuContent>
@@ -223,7 +223,7 @@ export interface InputMenuSlots<
223
223
  </script>
224
224
 
225
225
  <script setup lang="ts" generic="T extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false">
226
- import { computed, ref, toRef, onMounted, toRaw } from 'vue'
226
+ import { computed, ref, toRef, onMounted, toRaw, nextTick } from 'vue'
227
227
  import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from 'reka-ui'
228
228
  import { defu } from 'defu'
229
229
  import { isEqual } from 'ohash/utils'
@@ -322,11 +322,7 @@ const filteredGroups = computed(() => {
322
322
 
323
323
  return fields.some(field => contains(get(item, field), searchTerm.value))
324
324
  })).filter(group => group.filter(item =>
325
- /**
326
- * @memo fix not obj
327
- * @see selectMenu
328
- */
329
- typeof item !== 'object' || (isInputItem(item) && (!item.type || !['label', 'separator'].includes(item.type)))
325
+ !isInputItem(item) || (isInputItem(item) && (!item.type || !['label', 'separator'].includes(item.type)))
330
326
  ).length > 0)
331
327
  })
332
328
  const filteredItems = computed(() => filteredGroups.value.flatMap(group => group))
@@ -390,6 +386,10 @@ function onUpdateOpen(value: boolean) {
390
386
  const event = new FocusEvent('focus')
391
387
  emits('focus', event)
392
388
  }
389
+
390
+ nextTick(() => {
391
+ searchTerm.value = ''
392
+ })
393
393
  }
394
394
 
395
395
  function onRemoveTag(event: any) {
@@ -477,7 +477,7 @@ defineExpose({
477
477
  </TagsInputItemDelete>
478
478
  </TagsInputItem>
479
479
 
480
- <ComboboxInput v-model="searchTerm" :display-value="displayValue" as-child>
480
+ <ComboboxInput as-child @update:model-value="searchTerm = $event">
481
481
  <TagsInputInput
482
482
  ref="inputRef"
483
483
  v-bind="{ ...$attrs, ...ariaAttrs }"
@@ -491,7 +491,6 @@ defineExpose({
491
491
  <ComboboxInput
492
492
  v-else
493
493
  ref="inputRef"
494
- v-model="searchTerm"
495
494
  :display-value="displayValue"
496
495
  v-bind="{ ...$attrs, ...ariaAttrs }"
497
496
  :type="type"
@@ -499,6 +498,7 @@ defineExpose({
499
498
  :required="required"
500
499
  @blur="onBlur"
501
500
  @focus="onFocus"
501
+ @update:model-value="searchTerm = $event"
502
502
  />
503
503
 
504
504
  <span v-if="isLeading || !!avatar || !!slots.leading" :class="b24ui.leading({ class: props.b24ui?.leading })">
@@ -328,11 +328,7 @@ const filteredGroups = computed(() => {
328
328
 
329
329
  return fields.some(field => contains(get(item, field), searchTerm.value))
330
330
  })).filter(group => group.filter(item =>
331
- /**
332
- * @memo fix not obj
333
- * @see inputMenu
334
- */
335
- typeof item !== 'object' || (isSelectItem(item) && (!item.type || !['label', 'separator'].includes(item.type)))
331
+ !isSelectItem(item) || (isSelectItem(item) && (!item.type || !['label', 'separator'].includes(item.type)))
336
332
  ).length > 0)
337
333
  })
338
334
  const filteredItems = computed(() => filteredGroups.value.flatMap(group => group))
@@ -15,7 +15,6 @@ export interface SidebarLayoutProps {
15
15
  * @defaultValue 'div'
16
16
  */
17
17
  as?: any
18
- useSidebar?: boolean
19
18
  useLightContent?: boolean
20
19
  class?: any
21
20
  b24ui?: Partial<typeof sidebarLayout.slots>
@@ -98,8 +97,9 @@ const handleNavigationClick = () => {
98
97
  <header :class="b24ui.header({ class: props.b24ui?.header })">
99
98
  <div
100
99
  v-if="isUseSideBar"
101
- :class="b24ui.headerPaddings({ class: props.b24ui?.headerPaddings })"
100
+ :class="b24ui.headerMenuIcon({ class: props.b24ui?.headerMenuIcon })"
102
101
  >
102
+ <!-- @todo: lang -->
103
103
  <B24Slideover
104
104
  v-model:open="openSidebarSlideover"
105
105
  title="Navigation"
@@ -112,6 +112,7 @@ const handleNavigationClick = () => {
112
112
  aria-label="Open navigation"
113
113
  color="link"
114
114
  size="sm"
115
+ :class="b24ui.headerPaddings({ class: props.b24ui?.headerPaddings })"
115
116
  :icon="MenuIcon"
116
117
  />
117
118
 
@@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema'
4
4
  import _appConfig from '#build/app.config'
5
5
  import theme from '#build/b24ui/stacked-layout'
6
6
  import { tv } from '../utils/tv'
7
+ import { useRoute } from 'vue-router'
7
8
 
8
9
  const appConfigStackedLayout = _appConfig as AppConfig & { b24ui: { stackedLayout: Partial<typeof theme> } }
9
10
 
@@ -17,33 +18,136 @@ export interface StackedLayoutProps {
17
18
  * @defaultValue 'div'
18
19
  */
19
20
  as?: any
21
+ useLightContent?: boolean
20
22
  class?: any
21
23
  b24ui?: Partial<typeof stackedLayout.slots>
22
24
  }
23
25
 
24
26
  export interface StackedLayoutSlots {
27
+ /**
28
+ * Menu for mobile screen sizes.
29
+ * @param props
30
+ * @param props.handleClick - Handler for navigation click events
31
+ */
32
+ sidebar(props: { handleClick: () => void }): any
33
+ /**
34
+ * Menu for desktop screen sizes.
35
+ */
36
+ navbar(props?: {}): any
37
+ /**
38
+ * The page content.
39
+ */
25
40
  default(props?: {}): any
26
41
  }
27
42
  </script>
28
43
 
29
44
  <script setup lang="ts">
45
+ import { ref, computed, watch, onUnmounted } from 'vue'
30
46
  import { Primitive } from 'reka-ui'
47
+ import B24Slideover from './Slideover.vue'
48
+ import B24Sidebar from './Sidebar.vue'
49
+ import B24ModalDialogClose from './ModalDialogClose.vue'
50
+ import B24Navbar from './Navbar.vue'
51
+ import MenuIcon from '@bitrix24/b24icons-vue/main/MenuIcon'
52
+ import Cross50Icon from '@bitrix24/b24icons-vue/actions/Cross50Icon'
31
53
 
32
54
  const props = withDefaults(defineProps<StackedLayoutProps>(), {
33
- as: 'div'
55
+ as: 'div',
56
+ useLightContent: true
34
57
  })
35
58
  const slots = defineSlots<StackedLayoutSlots>()
36
59
 
37
- // eslint-disable-next-line vue/no-dupe-keys
38
- const b24ui = stackedLayout()
60
+ const route = useRoute()
61
+ const isUseSideBar = computed(() => !!slots.sidebar)
62
+ const openSidebarSlideover = ref(false)
63
+
64
+ const b24ui = computed(() => stackedLayout({
65
+ useSidebar: isUseSideBar.value,
66
+ useLightContent: Boolean(props.useLightContent)
67
+ }))
68
+
69
+ const closeModal = () => {
70
+ if (openSidebarSlideover.value) {
71
+ openSidebarSlideover.value = false
72
+ }
73
+ }
74
+
75
+ const stopWatcher = watch(
76
+ () => route.path,
77
+ () => closeModal(),
78
+ { immediate: true }
79
+ )
80
+
81
+ onUnmounted(() => {
82
+ stopWatcher()
83
+ })
84
+
85
+ const handleNavigationClick = () => {
86
+ closeModal()
87
+ }
39
88
  </script>
40
89
 
41
90
  <template>
42
91
  <Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
43
- <template v-if="!!slots.default">
44
- <div :class="b24ui.container({ class: props.b24ui?.container })">
45
- <slot />
92
+ <header :class="b24ui.header({ class: props.b24ui?.header })">
93
+ <div
94
+ v-if="isUseSideBar"
95
+ :class="b24ui.headerMenuIcon({ class: props.b24ui?.headerMenuIcon })"
96
+ >
97
+ <!-- @todo: lang -->
98
+ <B24Slideover
99
+ v-model:open="openSidebarSlideover"
100
+ title="Navigation"
101
+ description="Content navigation"
102
+ side="left"
103
+ :b24ui="{ content: b24ui.sidebarSlideoverContainer({ class: props.b24ui?.sidebarSlideoverContainer }) }"
104
+ >
105
+ <!-- @todo: lang -->
106
+ <B24Button
107
+ aria-label="Open navigation"
108
+ color="link"
109
+ size="sm"
110
+ :class="b24ui.headerPaddings({ class: props.b24ui?.headerPaddings })"
111
+ :icon="MenuIcon"
112
+ />
113
+
114
+ <template #content>
115
+ <div :class="b24ui.sidebarSlideover({ class: props.b24ui?.sidebarSlideover })">
116
+ <B24Sidebar>
117
+ <div :class="b24ui.sidebarSlideoverBtnClose({ class: props.b24ui?.sidebarSlideoverBtnClose })">
118
+ <!-- @todo: lang -->
119
+ <B24ModalDialogClose>
120
+ <B24Button
121
+ color="link"
122
+ size="lg"
123
+ :icon="Cross50Icon"
124
+ aria-label="Close navigation"
125
+ />
126
+ </B24ModalDialogClose>
127
+ </div>
128
+
129
+ <slot name="sidebar" :handle-click="handleNavigationClick" />
130
+ </B24Sidebar>
131
+ </div>
132
+ </template>
133
+ </B24Slideover>
134
+ </div>
135
+ <div :class="b24ui.headerWrapper({ class: props.b24ui?.headerWrapper })">
136
+ <B24Navbar :class="b24ui.headerPaddings({ class: props.b24ui?.headerPaddings })">
137
+ <slot name="navbar" />
138
+ </B24Navbar>
46
139
  </div>
140
+ </header>
141
+
142
+ <!-- Page Content -->
143
+ <template v-if="!!slots.default">
144
+ <main :class="b24ui.container({ class: props.b24ui?.container })">
145
+ <div :class="b24ui.containerWrapper({ class: props.b24ui?.containerWrapper })">
146
+ <div :class="b24ui.containerWrapperInner({ class: props.b24ui?.containerWrapperInner })">
147
+ <slot />
148
+ </div>
149
+ </div>
150
+ </main>
47
151
  </template>
48
152
  </Primitive>
49
153
  </template>
@@ -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<any>;
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
  }
@@ -40,7 +40,6 @@ export * from '../components/Toast.vue';
40
40
  export * from '../components/Toaster.vue';
41
41
  export * from '../components/Tooltip.vue';
42
42
  export * from '../components/SidebarLayout.vue';
43
- export * from '../components/StackedLayout.vue';
44
43
  export * from '../components/Sidebar.vue';
45
44
  export * from '../components/SidebarHeader.vue';
46
45
  export * from '../components/SidebarBody.vue';
@@ -48,6 +47,7 @@ export * from '../components/SidebarFooter.vue';
48
47
  export * from '../components/SidebarSection.vue';
49
48
  export * from '../components/SidebarHeading.vue';
50
49
  export * from '../components/SidebarSpacer.vue';
50
+ export * from '../components/StackedLayout.vue';
51
51
  export * from '../components/Navbar.vue';
52
52
  export * from '../components/NavbarSection.vue';
53
53
  export * from '../components/NavbarDivider.vue';
@@ -40,7 +40,6 @@ export * from "../components/Toast.vue";
40
40
  export * from "../components/Toaster.vue";
41
41
  export * from "../components/Tooltip.vue";
42
42
  export * from "../components/SidebarLayout.vue";
43
- export * from "../components/StackedLayout.vue";
44
43
  export * from "../components/Sidebar.vue";
45
44
  export * from "../components/SidebarHeader.vue";
46
45
  export * from "../components/SidebarBody.vue";
@@ -48,6 +47,7 @@ export * from "../components/SidebarFooter.vue";
48
47
  export * from "../components/SidebarSection.vue";
49
48
  export * from "../components/SidebarHeading.vue";
50
49
  export * from "../components/SidebarSpacer.vue";
50
+ export * from "../components/StackedLayout.vue";
51
51
  export * from "../components/Navbar.vue";
52
52
  export * from "../components/NavbarSection.vue";
53
53
  export * from "../components/NavbarDivider.vue";
@@ -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
  };