frappe-ui 0.1.211 → 0.1.213

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.
@@ -73,10 +73,11 @@ const createNewOption = {
73
73
  } as ComboboxOption
74
74
 
75
75
  const linkOptions = computed(() => {
76
+ const _options = options.data || []
76
77
  if (props.allowCreate) {
77
- return [...(options.data || []), createNewOption]
78
+ return [..._options, createNewOption]
78
79
  }
79
- return options.data
80
+ return _options
80
81
  })
81
82
 
82
83
  const loadOptions = (txt: string = '') => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.1.211",
3
+ "version": "0.1.213",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.ts",
6
6
  "type": "module",
@@ -32,7 +32,9 @@ import type {
32
32
  ComboboxProps,
33
33
  } from './types'
34
34
 
35
- const props = defineProps<ComboboxProps>()
35
+ const props = withDefaults(defineProps<ComboboxProps>(), {
36
+ options: () => [],
37
+ })
36
38
  const emit = defineEmits([
37
39
  'update:modelValue',
38
40
  'update:selectedOption',
@@ -22,7 +22,11 @@
22
22
  :label="section.label"
23
23
  :items="section.items"
24
24
  :collapsible="section.collapsible"
25
- />
25
+ >
26
+ <template #sidebar-item="{ item, isCollapsed }"
27
+ ><slot name="sidebar-item" :item :isCollapsed ></slot
28
+ ></template>
29
+ </SidebarSection>
26
30
 
27
31
  <div class="mt-auto flex flex-col gap-2">
28
32
  <slot
@@ -40,19 +40,20 @@
40
40
  leave-to-class="max-h-0 overflow-hidden"
41
41
  >
42
42
  <nav v-if="!isCollapsed" class="space-y-0.5">
43
- <SidebarItem
44
- v-for="item in props.items"
45
- :key="item.label"
46
- :label="item.label"
47
- :accessKey="item.accessKey"
48
- :icon="item.icon"
49
- :suffix="item.suffix"
50
- :to="item.to"
51
- :isActive="item.isActive"
52
- :isCollapsed="isSidebarCollapsed"
53
- :onClick="item.onClick"
54
- >
55
- </SidebarItem>
43
+ <template v-for="item in props.items" :key="item.label">
44
+ <slot name="sidebar-item" :item="item" :isCollapsed="isSidebarCollapsed">
45
+ <SidebarItem
46
+ :label="item.label"
47
+ :accessKey="item.accessKey"
48
+ :icon="item.icon"
49
+ :suffix="item.suffix"
50
+ :to="item.to"
51
+ :isActive="item.isActive"
52
+ :isCollapsed="isSidebarCollapsed"
53
+ :onClick="item.onClick"
54
+ />
55
+ </slot>
56
+ </template>
56
57
  </nav>
57
58
  </transition>
58
59
  </div>