@signal24/vue-foundation 4.24.2 → 4.25.1

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.
@@ -1,8 +1,16 @@
1
1
  <template>
2
2
  <div id="demo-vf-smart-select">
3
- <VfSmartSelect v-model="selectedOption" :options="options" label-field="label" />
3
+ <div>
4
+ <VfSmartSelect v-model="selectedOption" :options="options" label-field="label" />
4
5
 
5
- Selected value: {{ selectedOption?.label ?? '-' }}
6
+ Selected value: {{ selectedOption?.label ?? '-' }}
7
+ </div>
8
+
9
+ <div>
10
+ <VfSmartSelect v-model="selectedOption" :options="options" label-field="label" group-field="group" null-title="No selection" />
11
+
12
+ Selected value: {{ selectedOption?.label ?? '-' }}
13
+ </div>
6
14
  </div>
7
15
  </template>
8
16
 
@@ -12,19 +20,27 @@ import { ref } from 'vue';
12
20
  import VfSmartSelect from '@/components/vf-smart-select.vue';
13
21
 
14
22
  const options = [
15
- { value: '1', label: 'Option 1' },
16
- { value: '2', label: 'Option 2' },
17
- { value: '3', label: 'Option 3' },
18
- { value: '4', label: 'Option 4' },
19
- { value: '5', label: 'Option 5' },
20
- { value: '6', label: 'Option 6' },
21
- { value: '7', label: 'Option 7' },
22
- { value: '8', label: 'Option 8' },
23
- { value: '9', label: 'Option 9' },
24
- { value: '10', label: 'Option 10' }
23
+ { value: '1', label: 'Option 1', group: 'Set 1' },
24
+ { value: '2', label: 'Option 2', group: 'Set 1' },
25
+ { value: '3', label: 'Option 3', group: 'Set 1' },
26
+ { value: '4', label: 'Option 4', group: 'Set 1' },
27
+ { value: '5', label: 'Option 5', group: 'Set 1' },
28
+ { value: '6', label: 'Option 6', group: 'Set 2' },
29
+ { value: '7', label: 'Option 7', group: 'Set 2' },
30
+ { value: '8', label: 'Option 8', group: 'Set 2' },
31
+ { value: '9', label: 'Option 9', group: 'Set 2' },
32
+ { value: '10', label: 'Option 10', group: 'Set 2' }
25
33
  ];
26
34
 
27
35
  const selectedOption = ref<(typeof options)[number] | null>(null);
28
36
  </script>
29
37
 
30
- <style lang="scss" scoped></style>
38
+ <style lang="scss" scoped>
39
+ #demo-vf-smart-select {
40
+ max-width: 450px;
41
+
42
+ > div {
43
+ margin-top: 12px;
44
+ }
45
+ }
46
+ </style>
@@ -1,5 +1,6 @@
1
1
  export interface VfSmartSelectOptionDescriptor<T> {
2
2
  key: string | symbol;
3
+ group?: string;
3
4
  title: string;
4
5
  subtitle?: string | null;
5
6
  searchContent?: string;
@@ -19,6 +19,8 @@ declare const _default: <T, V = T>(__VLS_props: NonNullable<Awaited<typeof __VLS
19
19
  valueField?: keyof T;
20
20
  valueExtractor?: (option: T) => V;
21
21
  labelField?: keyof T;
22
+ groupField?: keyof T;
23
+ groupFormatter?: (option: T) => string;
22
24
  formatter?: (option: T) => string;
23
25
  subtitleFormatter?: (option: T) => string;
24
26
  classForOption?: (option: T) => string;
@@ -37,6 +39,10 @@ declare const _default: <T, V = T>(__VLS_props: NonNullable<Awaited<typeof __VLS
37
39
  }>): void;
38
40
  attrs: any;
39
41
  slots: {
42
+ group?: (props: {
43
+ group: string;
44
+ }) => any;
45
+ } & {
40
46
  option?: (props: {
41
47
  option: VfSmartSelectOptionDescriptor<T>;
42
48
  }) => any;