sit-onyx 1.0.0-alpha.151 → 1.0.0-alpha.153
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/dist/components/OnyxColorSchemeDialog/OnyxColorSchemeDialog.vue.d.ts +1 -1
- package/dist/components/OnyxSelect/OnyxSelect.vue.d.ts +3 -1
- package/dist/components/OnyxSelect/types.d.ts +6 -0
- package/dist/components/OnyxToast/OnyxToast.vue.d.ts +42 -0
- package/dist/components/OnyxToast/types.d.ts +34 -0
- package/dist/composables/useManagedState.d.ts +26 -0
- package/dist/i18n/locales/en-US.json.d.ts +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +885 -800
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/i18n/locales/de-DE.json +1 -0
- package/src/i18n/locales/en-US.json +1 -0
|
@@ -3,8 +3,8 @@ import { ColorSchemeValue, OnyxColorSchemeDialogProps } from './types';
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxColorSchemeDialogProps>, {
|
|
4
4
|
open: boolean;
|
|
5
5
|
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
-
"update:modelValue": (value: ColorSchemeValue) => void;
|
|
7
6
|
close: () => void;
|
|
7
|
+
"update:modelValue": (value: ColorSchemeValue) => void;
|
|
8
8
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxColorSchemeDialogProps>, {
|
|
9
9
|
open: boolean;
|
|
10
10
|
}>>> & {
|
|
@@ -5,11 +5,13 @@ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue>(_
|
|
|
5
5
|
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
6
6
|
"onUpdate:modelValue"?: ((value: SelectOption<TValue> | SelectOption<TValue>[] | undefined) => any) | undefined;
|
|
7
7
|
onValidityChange?: ((validity: ValidityState) => any) | undefined;
|
|
8
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
8
9
|
"onUpdate:searchTerm"?: ((searchTerm: string) => any) | undefined;
|
|
9
10
|
onLazyLoad?: (() => any) | undefined;
|
|
10
11
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
|
|
11
12
|
"onUpdate:modelValue"?: ((value: SelectOption<TValue> | SelectOption<TValue>[] | undefined) => any) | undefined;
|
|
12
13
|
onValidityChange?: ((validity: ValidityState) => any) | undefined;
|
|
14
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
13
15
|
"onUpdate:searchTerm"?: ((searchTerm: string) => any) | undefined;
|
|
14
16
|
onLazyLoad?: (() => any) | undefined;
|
|
15
17
|
}, never>) & ({} & OnyxSelectProps<TValue>), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
@@ -54,7 +56,7 @@ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue>(_
|
|
|
54
56
|
*/
|
|
55
57
|
option?(props: SelectOption<TValue>): unknown;
|
|
56
58
|
}>;
|
|
57
|
-
emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", value: SelectOption<TValue> | SelectOption<TValue>[] | undefined) => void) & ((evt: "update:searchTerm", searchTerm: string) => void) & ((evt: "lazyLoad") => void);
|
|
59
|
+
emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", value: SelectOption<TValue> | SelectOption<TValue>[] | undefined) => void) & ((evt: "update:open", open: boolean) => void) & ((evt: "update:searchTerm", searchTerm: string) => void) & ((evt: "lazyLoad") => void);
|
|
58
60
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
59
61
|
[key: string]: any;
|
|
60
62
|
}> & {
|
|
@@ -13,6 +13,7 @@ export type SelectSearchProps = {
|
|
|
13
13
|
withSearch: true;
|
|
14
14
|
/**
|
|
15
15
|
* Value of the search input.
|
|
16
|
+
* Property is managed internally, when undefined.
|
|
16
17
|
*/
|
|
17
18
|
searchTerm?: string;
|
|
18
19
|
} | {
|
|
@@ -52,6 +53,11 @@ export type SelectModelValueProps<TValue extends SelectOptionValue> = {
|
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
55
|
export type OnyxSelectProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & SelectModelValueProps<TValue> & SelectSearchProps & Omit<OnyxSelectInputProps<TValue>, "density" | "modelValue"> & AutofocusProp & {
|
|
56
|
+
/**
|
|
57
|
+
* If true, the select popover is expanded and visible.
|
|
58
|
+
* Property is managed internally, when undefined.
|
|
59
|
+
*/
|
|
60
|
+
open?: boolean;
|
|
55
61
|
/**
|
|
56
62
|
* Label describing the list of options to support assistive technologies.
|
|
57
63
|
* @example: { label: "Your Animal", listLabel: "List of animals" }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnyxToastProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxToastProps>, {
|
|
4
|
+
color: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
clickable: boolean;
|
|
7
|
+
icon: undefined;
|
|
8
|
+
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
click: () => void;
|
|
10
|
+
close: () => void;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxToastProps>, {
|
|
12
|
+
color: string;
|
|
13
|
+
duration: number;
|
|
14
|
+
clickable: boolean;
|
|
15
|
+
icon: undefined;
|
|
16
|
+
}>>> & {
|
|
17
|
+
onClick?: (() => any) | undefined;
|
|
18
|
+
onClose?: (() => any) | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
color: Extract<import('../..').OnyxColor, "neutral" | "danger" | "warning" | "success">;
|
|
21
|
+
icon: string | false;
|
|
22
|
+
duration: number;
|
|
23
|
+
clickable: boolean;
|
|
24
|
+
}, {}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
type __VLS_WithDefaults<P, D> = {
|
|
36
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
37
|
+
default: D[K];
|
|
38
|
+
}> : P[K];
|
|
39
|
+
};
|
|
40
|
+
type __VLS_Prettify<T> = {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} & {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DensityProp } from '../../composables/density';
|
|
2
|
+
import { OnyxColor } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type OnyxToastProps = DensityProp & {
|
|
5
|
+
/**
|
|
6
|
+
* Main toast headline.
|
|
7
|
+
*/
|
|
8
|
+
headline: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional toast description (e.g. detailed error message).
|
|
11
|
+
*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Toast color.
|
|
15
|
+
*/
|
|
16
|
+
color?: Extract<OnyxColor, "neutral" | "danger" | "warning" | "success">;
|
|
17
|
+
/**
|
|
18
|
+
* Duration in milliseconds for the toast to close automatically.
|
|
19
|
+
* Timer will be paused when hovering the toast.
|
|
20
|
+
*
|
|
21
|
+
* Can be set to `0` to disable the auto closing.
|
|
22
|
+
*/
|
|
23
|
+
duration?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the toast is clickable (will emit the `click` event).
|
|
26
|
+
* Will also hide the manual close button.
|
|
27
|
+
*/
|
|
28
|
+
clickable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Icon to display. By default, an icon will be displayed depending on the current `color` property.
|
|
31
|
+
* Can be set to `false` to hide the icon.
|
|
32
|
+
*/
|
|
33
|
+
icon?: string | false;
|
|
34
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Composable for conditionally managing state based on the prop value.
|
|
5
|
+
*
|
|
6
|
+
* When the prop value is not undefined, the prop value is always used.
|
|
7
|
+
* If the prop value is undefined, then the internal state is used instead.
|
|
8
|
+
*
|
|
9
|
+
* @param prop `toRef(() => props.something)` ref of the optional prop.
|
|
10
|
+
* @param initialState in case of the prop being initially undefined, this will be used as the initial state value.
|
|
11
|
+
* @param emit function that is called when a state write is performed
|
|
12
|
+
* @returns ref of the state
|
|
13
|
+
*
|
|
14
|
+
* @example ```ts
|
|
15
|
+
* // IMPORTANT: default value MUST be set to undefined
|
|
16
|
+
* const props = withDefaults(defineProps<{ isExpanded?: boolean }>(), { isExpanded: undefined });
|
|
17
|
+
* const emit = defineEmits<{ "update:isExpanded": [isExpanded: boolean] }>();
|
|
18
|
+
*
|
|
19
|
+
* const isExpanded = useManagedState(
|
|
20
|
+
* toRef(() => props.isExpanded),
|
|
21
|
+
* false,
|
|
22
|
+
* (v) => emit("update:isExpanded", v ?? false),
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const useManagedState: <Prop extends Readonly<Ref<T | undefined>>, T>(prop: Prop, initialState: T, emit: (val: T) => void) => import('vue').WritableComputedRef<T>;
|