@speckle/ui-components 2.23.5 → 2.23.6

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/README.md CHANGED
@@ -6,7 +6,7 @@ Speckle UI component library built with Vue 3 and relying on the Speckle Tailwin
6
6
 
7
7
  1. Make sure you have `@speckle/tailwind-theme` installed and set up with Tailwind
8
8
  1. Install `@speckle/ui-components`
9
- 1. In your tailwind config import `tailwindContentEntry` from `@speckle/ui-components/tailwind-configure` and invoke it in the `contents` field to ensure PurgeCSS is configured correctly. It requires the CJS `require` object as its only parameter. If it isn't available (in an ESM environment), you can use node's `createRequire()`.
9
+ 1. In your tailwind config import `tailwindContentEntries` from `@speckle/ui-components/tailwind-configure` and invoke it in the `contents` field to ensure PurgeCSS is configured correctly. It requires the CJS `require` object as its only parameter. If it isn't available (in an ESM environment), you can use node's `createRequire()`.
10
10
  1. Import `@speckle/ui-components/style.css` in your app. If `exports` map isn't supported you can also import from `@speckle/ui-components/dist/style.css`
11
11
 
12
12
  ### Usage in Nuxt v3
@@ -0,0 +1,191 @@
1
+ import type { PropType } from 'vue';
2
+ import type { MaybeAsync, Optional } from '@speckle/shared';
3
+ import type { RuleExpression } from 'vee-validate';
4
+ import type { LabelPosition } from '../../../composables/form/input';
5
+ declare const _default: <SingleItem extends string | number | Record<string, unknown>>(__VLS_props: {
6
+ size?: Optional<"sm" | "base" | "lg" | "xl">;
7
+ readonly label: string;
8
+ modelValue?: ([{
9
+ type: PropType<SingleItem | SingleItem[] | undefined>;
10
+ default: undefined;
11
+ }] extends [import("vue").Prop<infer V, infer D>] ? unknown extends V ? import("@vue/shared").IfAny<V, V, D> : V : {
12
+ type: PropType<SingleItem | SingleItem[] | undefined>;
13
+ default: undefined;
14
+ }) | undefined;
15
+ "onUpdate:modelValue"?: ((v: SingleItem | SingleItem[] | undefined) => any) | undefined;
16
+ readonly name: string;
17
+ disabled?: Optional<boolean>;
18
+ rules?: RuleExpression<SingleItem | SingleItem[] | undefined>;
19
+ validateOnMount?: boolean | undefined;
20
+ showRequired?: boolean | undefined;
21
+ labelPosition?: LabelPosition | undefined;
22
+ validateOnValueUpdate?: boolean | undefined;
23
+ search?: boolean | undefined;
24
+ help?: Optional<string>;
25
+ showLabel?: boolean | undefined;
26
+ useLabelInErrors?: boolean | undefined;
27
+ readonly placeholder?: string | undefined;
28
+ showOptional?: boolean | undefined;
29
+ tooltipText?: string | undefined;
30
+ items?: SingleItem[] | undefined;
31
+ filterPredicate?: Optional<(item: SingleItem, searchString: string) => boolean>;
32
+ disabledItemPredicate?: Optional<(item: SingleItem) => boolean>;
33
+ getSearchResults?: Optional<(searchString: string) => MaybeAsync<SingleItem[]>>;
34
+ searchPlaceholder?: string | undefined;
35
+ readonly by?: string | undefined;
36
+ buttonStyle?: Optional<"base" | "simple" | "tinted">;
37
+ hideCheckmarks?: Optional<boolean>;
38
+ allowUnset?: Optional<boolean>;
39
+ clearable?: boolean | undefined;
40
+ fixedHeight?: boolean | undefined;
41
+ fullyControlValue?: boolean | undefined;
42
+ mountMenuOnBody?: boolean | undefined;
43
+ labelId?: string | undefined;
44
+ buttonId?: string | undefined;
45
+ readonly disabledItemTooltip?: string | undefined;
46
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
47
+ attrs: any;
48
+ slots: {
49
+ "nothing-selected"?(_: {}): any;
50
+ "something-selected"?(_: {
51
+ value: SingleItem[];
52
+ }): any;
53
+ "nothing-found"?(_: {}): any;
54
+ option?(_: {
55
+ class: string;
56
+ item: SingleItem;
57
+ selected: boolean;
58
+ disabled: boolean;
59
+ }): any;
60
+ };
61
+ emit: (e: 'update:modelValue', v: SingleItem | SingleItem[] | undefined) => void;
62
+ } | undefined, __VLS_expose?: ((exposed: import("vue").ShallowUnwrapRef<{
63
+ triggerSearch: () => Promise<void>;
64
+ }>) => void) | undefined, __VLS_setup?: Promise<{
65
+ props: {
66
+ size?: Optional<"sm" | "base" | "lg" | "xl">;
67
+ readonly label: string;
68
+ modelValue?: ([{
69
+ type: PropType<SingleItem | SingleItem[] | undefined>;
70
+ default: undefined;
71
+ }] extends [import("vue").Prop<infer V, infer D>] ? unknown extends V ? import("@vue/shared").IfAny<V, V, D> : V : {
72
+ type: PropType<SingleItem | SingleItem[] | undefined>;
73
+ default: undefined;
74
+ }) | undefined;
75
+ "onUpdate:modelValue"?: ((v: SingleItem | SingleItem[] | undefined) => any) | undefined;
76
+ readonly name: string;
77
+ disabled?: Optional<boolean>;
78
+ rules?: RuleExpression<SingleItem | SingleItem[] | undefined>;
79
+ validateOnMount?: boolean | undefined;
80
+ showRequired?: boolean | undefined;
81
+ labelPosition?: LabelPosition | undefined;
82
+ validateOnValueUpdate?: boolean | undefined;
83
+ search?: boolean | undefined;
84
+ help?: Optional<string>;
85
+ showLabel?: boolean | undefined;
86
+ useLabelInErrors?: boolean | undefined;
87
+ readonly placeholder?: string | undefined;
88
+ showOptional?: boolean | undefined;
89
+ tooltipText?: string | undefined;
90
+ items?: SingleItem[] | undefined;
91
+ filterPredicate?: Optional<(item: SingleItem, searchString: string) => boolean>;
92
+ disabledItemPredicate?: Optional<(item: SingleItem) => boolean>;
93
+ getSearchResults?: Optional<(searchString: string) => MaybeAsync<SingleItem[]>>;
94
+ searchPlaceholder?: string | undefined;
95
+ readonly by?: string | undefined;
96
+ buttonStyle?: Optional<"base" | "simple" | "tinted">;
97
+ hideCheckmarks?: Optional<boolean>;
98
+ allowUnset?: Optional<boolean>;
99
+ clearable?: boolean | undefined;
100
+ fixedHeight?: boolean | undefined;
101
+ fullyControlValue?: boolean | undefined;
102
+ mountMenuOnBody?: boolean | undefined;
103
+ labelId?: string | undefined;
104
+ buttonId?: string | undefined;
105
+ readonly disabledItemTooltip?: string | undefined;
106
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
107
+ expose(exposed: import("vue").ShallowUnwrapRef<{
108
+ triggerSearch: () => Promise<void>;
109
+ }>): void;
110
+ attrs: any;
111
+ slots: {
112
+ "nothing-selected"?(_: {}): any;
113
+ "something-selected"?(_: {
114
+ value: SingleItem[];
115
+ }): any;
116
+ "nothing-found"?(_: {}): any;
117
+ option?(_: {
118
+ class: string;
119
+ item: SingleItem;
120
+ selected: boolean;
121
+ disabled: boolean;
122
+ }): any;
123
+ };
124
+ emit: (e: 'update:modelValue', v: SingleItem | SingleItem[] | undefined) => void;
125
+ }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
126
+ [key: string]: any;
127
+ }> & {
128
+ __ctx?: {
129
+ props: {
130
+ size?: Optional<"sm" | "base" | "lg" | "xl">;
131
+ readonly label: string;
132
+ modelValue?: ([{
133
+ type: PropType<SingleItem | SingleItem[] | undefined>;
134
+ default: undefined;
135
+ }] extends [import("vue").Prop<infer V, infer D>] ? unknown extends V ? import("@vue/shared").IfAny<V, V, D> : V : {
136
+ type: PropType<SingleItem | SingleItem[] | undefined>;
137
+ default: undefined;
138
+ }) | undefined;
139
+ "onUpdate:modelValue"?: ((v: SingleItem | SingleItem[] | undefined) => any) | undefined;
140
+ readonly name: string;
141
+ disabled?: Optional<boolean>;
142
+ rules?: RuleExpression<SingleItem | SingleItem[] | undefined>;
143
+ validateOnMount?: boolean | undefined;
144
+ showRequired?: boolean | undefined;
145
+ labelPosition?: LabelPosition | undefined;
146
+ validateOnValueUpdate?: boolean | undefined;
147
+ search?: boolean | undefined;
148
+ help?: Optional<string>;
149
+ showLabel?: boolean | undefined;
150
+ useLabelInErrors?: boolean | undefined;
151
+ readonly placeholder?: string | undefined;
152
+ showOptional?: boolean | undefined;
153
+ tooltipText?: string | undefined;
154
+ items?: SingleItem[] | undefined;
155
+ filterPredicate?: Optional<(item: SingleItem, searchString: string) => boolean>;
156
+ disabledItemPredicate?: Optional<(item: SingleItem) => boolean>;
157
+ getSearchResults?: Optional<(searchString: string) => MaybeAsync<SingleItem[]>>;
158
+ searchPlaceholder?: string | undefined;
159
+ readonly by?: string | undefined;
160
+ buttonStyle?: Optional<"base" | "simple" | "tinted">;
161
+ hideCheckmarks?: Optional<boolean>;
162
+ allowUnset?: Optional<boolean>;
163
+ clearable?: boolean | undefined;
164
+ fixedHeight?: boolean | undefined;
165
+ fullyControlValue?: boolean | undefined;
166
+ mountMenuOnBody?: boolean | undefined;
167
+ labelId?: string | undefined;
168
+ buttonId?: string | undefined;
169
+ readonly disabledItemTooltip?: string | undefined;
170
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
171
+ expose(exposed: import("vue").ShallowUnwrapRef<{
172
+ triggerSearch: () => Promise<void>;
173
+ }>): void;
174
+ attrs: any;
175
+ slots: {
176
+ "nothing-selected"?(_: {}): any;
177
+ "something-selected"?(_: {
178
+ value: SingleItem[];
179
+ }): any;
180
+ "nothing-found"?(_: {}): any;
181
+ option?(_: {
182
+ class: string;
183
+ item: SingleItem;
184
+ selected: boolean;
185
+ disabled: boolean;
186
+ }): any;
187
+ };
188
+ emit: (e: 'update:modelValue', v: SingleItem | SingleItem[] | undefined) => void;
189
+ } | undefined;
190
+ };
191
+ export default _default;
@@ -27,3 +27,4 @@ export declare const stringContains: (params: {
27
27
  }) => GenericValidateFunction<string>;
28
28
  export declare const isUrl: GenericValidateFunction<string>;
29
29
  export declare const isItemSelected: GenericValidateFunction<unknown[]>;
30
+ export declare const isMultiItemSelected: <T>(val: unknown) => true | string;