@speckle/ui-components 2.18.16 → 2.19.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.
@@ -0,0 +1,28 @@
1
+ import type { ConcreteComponent } from 'vue';
2
+ type OptionType = {
3
+ value: string;
4
+ title: string;
5
+ introduction?: string;
6
+ icon: ConcreteComponent;
7
+ help?: string;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<{
10
+ modelValue: import("vue").PropType<string>;
11
+ options: {
12
+ type: import("vue").PropType<OptionType[]>;
13
+ required: true;
14
+ };
15
+ disabled: {
16
+ type: import("vue").PropType<boolean>;
17
+ };
18
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ modelValue: import("vue").PropType<string>;
20
+ options: {
21
+ type: import("vue").PropType<OptionType[]>;
22
+ required: true;
23
+ };
24
+ disabled: {
25
+ type: import("vue").PropType<boolean>;
26
+ };
27
+ }>>, {}, {}>;
28
+ export default _default;
@@ -1,12 +1,48 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  modelValue: import("vue").PropType<boolean>;
3
+ disabled: {
4
+ type: import("vue").PropType<boolean>;
5
+ };
6
+ id: {
7
+ type: import("vue").PropType<string>;
8
+ };
9
+ label: {
10
+ type: import("vue").PropType<string>;
11
+ };
12
+ name: {
13
+ type: import("vue").PropType<string>;
14
+ required: true;
15
+ };
16
+ showLabel: {
17
+ type: import("vue").PropType<boolean>;
18
+ default: boolean;
19
+ };
3
20
  icons: {
4
21
  type: import("vue").PropType<boolean>;
5
22
  };
6
23
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
24
  modelValue: import("vue").PropType<boolean>;
25
+ disabled: {
26
+ type: import("vue").PropType<boolean>;
27
+ };
28
+ id: {
29
+ type: import("vue").PropType<string>;
30
+ };
31
+ label: {
32
+ type: import("vue").PropType<string>;
33
+ };
34
+ name: {
35
+ type: import("vue").PropType<string>;
36
+ required: true;
37
+ };
38
+ showLabel: {
39
+ type: import("vue").PropType<boolean>;
40
+ default: boolean;
41
+ };
8
42
  icons: {
9
43
  type: import("vue").PropType<boolean>;
10
44
  };
11
- }>>, {}, {}>;
45
+ }>>, {
46
+ showLabel: boolean;
47
+ }, {}>;
12
48
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { type LayoutDialogButton } from '../../lib';
1
2
  type MaxWidthValue = 'sm' | 'md' | 'lg' | 'xl';
2
3
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
4
  open: boolean;
@@ -8,13 +9,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
8
9
  */
9
10
  preventCloseOnClickOutside?: boolean | undefined;
10
11
  title?: string | undefined;
11
- buttons?: {
12
- text: string;
13
- props: Record<string, unknown>;
14
- onClick?: (() => void) | undefined;
15
- disabled?: boolean | undefined;
16
- submit?: boolean | undefined;
17
- }[] | undefined;
12
+ buttons?: LayoutDialogButton[] | undefined;
13
+ /**
14
+ * Extra classes to apply to the button container.
15
+ */
16
+ buttonsWrapperClasses?: string | undefined;
18
17
  /**
19
18
  * If set, the modal will be wrapped in a form element and the `onSubmit` callback will be invoked when the user submits the form
20
19
  */
@@ -31,13 +30,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
31
30
  */
32
31
  preventCloseOnClickOutside?: boolean | undefined;
33
32
  title?: string | undefined;
34
- buttons?: {
35
- text: string;
36
- props: Record<string, unknown>;
37
- onClick?: (() => void) | undefined;
38
- disabled?: boolean | undefined;
39
- submit?: boolean | undefined;
40
- }[] | undefined;
33
+ buttons?: LayoutDialogButton[] | undefined;
34
+ /**
35
+ * Extra classes to apply to the button container.
36
+ */
37
+ buttonsWrapperClasses?: string | undefined;
41
38
  /**
42
39
  * If set, the modal will be wrapped in a form element and the `onSubmit` callback will be invoked when the user submits the form
43
40
  */
@@ -1,3 +1,4 @@
1
+ import type { PropType } from 'vue';
1
2
  import type { PropAnyComponent } from '../../helpers/common/components';
2
3
  type TitleColor = 'default' | 'danger' | 'warning' | 'success' | 'secondary' | 'info';
3
4
  type FormButtonColor = 'default' | 'invert' | 'danger' | 'warning' | 'success' | 'card' | 'secondary' | 'info';
@@ -23,6 +24,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
23
24
  type: BooleanConstructor;
24
25
  default: boolean;
25
26
  };
27
+ icon: {
28
+ type: PropType<PropAnyComponent>;
29
+ default: undefined;
30
+ };
26
31
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
32
  title: StringConstructor;
28
33
  borderT: BooleanConstructor;
@@ -45,7 +50,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
45
50
  type: BooleanConstructor;
46
51
  default: boolean;
47
52
  };
53
+ icon: {
54
+ type: PropType<PropAnyComponent>;
55
+ default: undefined;
56
+ };
48
57
  }>>, {
58
+ icon: PropAnyComponent;
49
59
  borderT: boolean;
50
60
  borderB: boolean;
51
61
  allowOverflow: boolean;
@@ -21,11 +21,14 @@ declare const _default: <T extends {
21
21
  overflowCells?: boolean | undefined;
22
22
  onRowClick?: ((item: T) => void) | undefined;
23
23
  rowItemsAlign?: "center" | "stretch" | undefined;
24
+ emptyMessage?: string | undefined;
24
25
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
25
26
  attrs: any;
26
27
  slots: Partial<Record<NonNullable<C>, (_: {
27
28
  item: T;
28
- }) => any>>;
29
+ }) => any>> & {
30
+ empty?(_: {}): any;
31
+ };
29
32
  emit: any;
30
33
  } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
31
34
  props: {
@@ -35,12 +38,15 @@ declare const _default: <T extends {
35
38
  overflowCells?: boolean | undefined;
36
39
  onRowClick?: ((item: T) => void) | undefined;
37
40
  rowItemsAlign?: "center" | "stretch" | undefined;
41
+ emptyMessage?: string | undefined;
38
42
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
39
43
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
40
44
  attrs: any;
41
45
  slots: Partial<Record<NonNullable<C>, (_: {
42
46
  item: T;
43
- }) => any>>;
47
+ }) => any>> & {
48
+ empty?(_: {}): any;
49
+ };
44
50
  emit: any;
45
51
  }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
52
  [key: string]: any;
@@ -53,12 +59,15 @@ declare const _default: <T extends {
53
59
  overflowCells?: boolean | undefined;
54
60
  onRowClick?: ((item: T) => void) | undefined;
55
61
  rowItemsAlign?: "center" | "stretch" | undefined;
62
+ emptyMessage?: string | undefined;
56
63
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
57
64
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
58
65
  attrs: any;
59
66
  slots: Partial<Record<NonNullable<C>, (_: {
60
67
  item: T;
61
- }) => any>>;
68
+ }) => any>> & {
69
+ empty?(_: {}): any;
70
+ };
62
71
  emit: any;
63
72
  } | undefined;
64
73
  };
@@ -1,4 +1,4 @@
1
- import type { LayoutPageTabItem } from '../../helpers/layout/components';
1
+ import type { LayoutPageTabItem } from '../../../helpers/layout/components';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
3
  activeItem: {
4
4
  required: true;
@@ -8,12 +8,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
8
8
  type: import("vue").PropType<LayoutPageTabItem[]>;
9
9
  required: true;
10
10
  };
11
- vertical: {
12
- type: import("vue").PropType<boolean>;
13
- };
14
- title: {
15
- type: import("vue").PropType<string>;
16
- };
17
11
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
12
  activeItem: {
19
13
  required: true;
@@ -23,12 +17,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
23
17
  type: import("vue").PropType<LayoutPageTabItem[]>;
24
18
  required: true;
25
19
  };
26
- vertical: {
27
- type: import("vue").PropType<boolean>;
28
- };
29
- title: {
30
- type: import("vue").PropType<string>;
31
- };
32
20
  }>>, {}, {}>, {
33
21
  default?(_: {
34
22
  activeItem: LayoutPageTabItem;
@@ -0,0 +1,30 @@
1
+ import type { LayoutPageTabItem } from '../../../helpers/layout/components';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
+ activeItem: {
4
+ required: true;
5
+ type: import("vue").PropType<LayoutPageTabItem>;
6
+ };
7
+ items: {
8
+ type: import("vue").PropType<LayoutPageTabItem[]>;
9
+ required: true;
10
+ };
11
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ activeItem: {
13
+ required: true;
14
+ type: import("vue").PropType<LayoutPageTabItem>;
15
+ };
16
+ items: {
17
+ type: import("vue").PropType<LayoutPageTabItem[]>;
18
+ required: true;
19
+ };
20
+ }>>, {}, {}>, {
21
+ default?(_: {
22
+ activeItem: LayoutPageTabItem;
23
+ }): any;
24
+ }>;
25
+ export default _default;
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -1,6 +1,6 @@
1
1
  import type { RuleExpression } from 'vee-validate';
2
2
  import type { Ref, ToRefs } from 'vue';
3
- import type { Nullable } from '@speckle/shared';
3
+ import type { MaybeNullOrUndefined, Nullable } from '@speckle/shared';
4
4
  export type InputColor = 'page' | 'foundation' | 'transparent';
5
5
  /**
6
6
  * Common setup for text input & textarea fields
@@ -45,4 +45,57 @@ export declare function useTextInputCore<V extends string | string[] = string>(p
45
45
  clear: () => void;
46
46
  focus: () => void;
47
47
  labelClasses: import("vue").ComputedRef<string>;
48
+ shouldShowClear: import("vue").ComputedRef<boolean>;
48
49
  };
50
+ type FormInputChangeEvent = {
51
+ event?: Event;
52
+ value: string;
53
+ };
54
+ /**
55
+ * Attach returned on and bind using v-on and v-bind, and then you can use the returned `value`
56
+ * ref to get the input's value while ensuring normal input events are debounced and only change/clear
57
+ * events cause the value to propagate immediately
58
+ *
59
+ * Very useful for search inputs and other kind of auto-submitting inputs!
60
+ */
61
+ export declare function useDebouncedTextInput(params?: {
62
+ /**
63
+ * For how long should basic input events be debounced.
64
+ * Default: 1000 (ms)
65
+ */
66
+ debouncedBy?: number;
67
+ /**
68
+ * Optionally pass in the model ref that should be used as the source of truth
69
+ */
70
+ model?: Ref<MaybeNullOrUndefined<string>>;
71
+ /**
72
+ * Set to true if you're tracking changes on a basic HTML input element. This will change the events
73
+ * being used (e.g. input instead of update:modelValue)
74
+ *
75
+ * Default: false
76
+ */
77
+ isBasicHtmlInput?: boolean;
78
+ /**
79
+ * Set to false if you don't want the change event to be emitted on Enter key press.
80
+ * Setting only works for basic html inputs currently!
81
+ *
82
+ * Default: Default behavior (true for input, false for textarea)
83
+ */
84
+ submitOnEnter?: boolean;
85
+ /**
86
+ * Set to true if you want to see debug output for how events fire and are handled
87
+ */
88
+ debug?: boolean | ((...logArgs: unknown[]) => void);
89
+ }): {
90
+ on: {
91
+ [x: string]: ((val: string | InputEvent) => void) | ((e: KeyboardEvent) => void);
92
+ clear: () => void;
93
+ change: (val: FormInputChangeEvent | Event) => void;
94
+ keydown: (e: KeyboardEvent) => void;
95
+ };
96
+ bind: {
97
+ modelValue: import("vue").ComputedRef<string>;
98
+ };
99
+ value: Ref<MaybeNullOrUndefined<string>>;
100
+ };
101
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Directive } from 'vue';
2
+ /**
3
+ * Makes it possible to navigate to and click on the element using the keyboard
4
+ */
5
+ export declare const vKeyboardClickable: Directive<HTMLElement>;
@@ -1,5 +1,5 @@
1
- import type { ConcreteComponent, FunctionalComponent } from 'vue';
2
- export type PropAnyComponent = ConcreteComponent<any, any, any, any, any> | FunctionalComponent<any, any, any>;
1
+ import type { ConcreteComponent, FunctionalComponent, DefineComponent } from 'vue';
2
+ export type PropAnyComponent = ConcreteComponent<any, any, any, any, any> | FunctionalComponent<any, any, any> | DefineComponent | string;
3
3
  export type HorizontalOrVertical = 'horizontal' | 'vertical';
4
4
  export interface StepCoreType {
5
5
  name: string;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Visible, non-interactive elements with click handlers must have at least one keyboard listener for accessibility.
3
3
  * You can wrap your click handler with this in @keypress, to run it when enter is pressed on the selected component
4
+ * @deprecated Use vKeyboardClickable directive instead
4
5
  * See more: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/blob/main/docs/click-events-have-key-events.md
5
6
  */
6
7
  export declare function keyboardClick(cb: (e: KeyboardEvent) => void): (e: KeyboardEvent) => void;
@@ -1,4 +1,7 @@
1
1
  import type { ConcreteComponent } from 'vue';
2
+ import type { FormButton } from '../../lib';
3
+ type FormButtonProps = InstanceType<typeof FormButton>['$props'];
4
+ import type { PropAnyComponent } from '../../helpers/common/components';
2
5
  export declare enum GridListToggleValue {
3
6
  Grid = "grid",
4
7
  List = "list"
@@ -10,9 +13,11 @@ export type LayoutTabItem<I extends string = string> = {
10
13
  export type LayoutPageTabItem<I extends string = string> = {
11
14
  title: string;
12
15
  id: I;
13
- icon?: ConcreteComponent;
14
16
  count?: number;
15
17
  tag?: string;
18
+ icon?: PropAnyComponent;
19
+ disabled?: boolean;
20
+ disabledMessage?: string;
16
21
  };
17
22
  export type LayoutMenuItem<I extends string = string> = {
18
23
  icon?: ConcreteComponent;
@@ -22,3 +27,17 @@ export type LayoutMenuItem<I extends string = string> = {
22
27
  disabledTooltip?: string;
23
28
  color?: 'danger' | 'info';
24
29
  };
30
+ export type LayoutDialogButton = {
31
+ text: string;
32
+ props?: Record<string, unknown> & FormButtonProps;
33
+ onClick?: (e: MouseEvent) => void;
34
+ disabled?: boolean;
35
+ submit?: boolean;
36
+ /**
37
+ * This should uniquely identify the button within the form. Even if you have different sets
38
+ * of buttons rendered on different steps of a wizard, all of them should have unique IDs to
39
+ * ensure proper form functionality.
40
+ */
41
+ id?: string;
42
+ };
43
+ export {};
@@ -1 +1 @@
1
- export declare function rightClick(target: HTMLElement): void;
1
+ export declare function rightClick(target: HTMLElement): Promise<void>;