@signal24/vue-foundation 4.24.1 → 4.25.0

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" />
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>
@@ -7,6 +7,7 @@ declare const _default: <T extends string>(__VLS_props: NonNullable<Awaited<type
7
7
  placeholder?: string;
8
8
  options: { [key in T]: string; } | T[];
9
9
  formatter?: (label: string, key: T) => string;
10
+ name?: string;
10
11
  } & Partial<{}>> & import("vue").PublicProps;
11
12
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
12
13
  attrs: any;
@@ -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;
@@ -30,12 +32,17 @@ declare const _default: <T, V = T>(__VLS_props: NonNullable<Awaited<typeof __VLS
30
32
  required?: boolean;
31
33
  showCreateTextOnNewItem?: boolean;
32
34
  autoNext?: boolean;
35
+ name?: string;
33
36
  } & Partial<{}>> & import("vue").PublicProps;
34
37
  expose(exposed: import("vue").ShallowUnwrapRef<{
35
38
  addRemoteOption: (option: T) => void;
36
39
  }>): void;
37
40
  attrs: any;
38
41
  slots: {
42
+ group?: (props: {
43
+ group: string;
44
+ }) => any;
45
+ } & {
39
46
  option?: (props: {
40
47
  option: VfSmartSelectOptionDescriptor<T>;
41
48
  }) => any;
@@ -3,6 +3,7 @@ interface IOptions {
3
3
  errorHandler: (err: Error) => void;
4
4
  defaultDateFormat: string;
5
5
  defaultTimeFormat: string;
6
+ defaultCurrencyDivisor: number;
6
7
  }
7
8
  export declare const VfOptions: IOptions;
8
9
  export declare function configureVf(options: Partial<IOptions>): void;