sit-onyx 1.0.0-beta.53 → 1.0.0-beta.55
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/OnyxButton/OnyxButton.vue.d.ts +1 -1
- package/dist/components/OnyxButton/types.d.ts +2 -1
- package/dist/components/OnyxForm/OnyxForm.core.d.ts +40 -8
- package/dist/components/OnyxForm/OnyxForm.core.spec-d.d.ts +1 -0
- package/dist/components/OnyxForm/OnyxForm.vue.d.ts +4 -1
- package/dist/components/OnyxForm/types.d.ts +3 -2
- package/dist/components/OnyxIconButton/OnyxIconButton.vue.d.ts +1 -1
- package/dist/components/OnyxIconButton/types.d.ts +2 -1
- package/dist/components/OnyxInput/OnyxInput.vue.d.ts +4 -2
- package/dist/components/OnyxInput/types.d.ts +4 -7
- package/dist/components/OnyxNavBar/modules/OnyxMenuItem/OnyxMenuItem.vue.d.ts +10 -3
- package/dist/components/OnyxNavBar/modules/OnyxNavButton/NavButtonLayout.vue.d.ts +6 -0
- package/dist/components/OnyxNavBar/modules/OnyxUserMenu/UserMenuLayout.vue.d.ts +8 -1
- package/dist/components/OnyxPageLayout/types.d.ts +2 -1
- package/dist/components/OnyxSelectInput/types.d.ts +4 -7
- package/dist/components/OnyxStepper/OnyxStepper.vue.d.ts +4 -2
- package/dist/components/OnyxStepper/types.d.ts +4 -7
- package/dist/components/OnyxSwitch/OnyxSwitch.vue.d.ts +3 -2
- package/dist/components/OnyxSwitch/types.d.ts +4 -7
- package/dist/components/OnyxTextarea/OnyxTextarea.vue.d.ts +3 -2
- package/dist/components/OnyxVisuallyHidden/OnyxVisuallyHidden.vue.d.ts +10 -2
- package/dist/components/examples/ComponentShowcase/ComponentShowcase.vue.d.ts +9 -0
- package/dist/components/examples/GridPlayground/EditGridElementDialog/EditGridElementDialog.vue.d.ts +8 -0
- package/dist/components/examples/GridPlayground/GridBadge/GridBadge.vue.d.ts +18 -0
- package/dist/components/examples/GridPlayground/GridElement/GridElement.vue.d.ts +12 -0
- package/dist/components/examples/GridPlayground/GridOverlay/GridOverlay.vue.d.ts +6 -0
- package/dist/composables/density.d.ts +1 -1
- package/dist/composables/useErrorClass.d.ts +14 -0
- package/dist/composables/useSkeletonState.d.ts +54 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +1432 -1414
- package/dist/playwright/ScreenshotMatrix.vue.d.ts +4 -2
- package/dist/style.css +1 -1
- package/dist/types/components.d.ts +2 -1
- package/package.json +2 -1
- package/src/styles/mixins/input.scss +32 -31
|
@@ -2,9 +2,9 @@ import type { OnyxButtonProps } from "./types";
|
|
|
2
2
|
declare const _default: import("vue").DefineComponent<OnyxButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxButtonProps> & Readonly<{}>, {
|
|
3
3
|
type: import("./types").ButtonType;
|
|
4
4
|
color: import("./types").ButtonColor;
|
|
5
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
5
6
|
disabled: import("../OnyxForm/OnyxForm.core").FormInjected<boolean>;
|
|
6
7
|
loading: boolean;
|
|
7
8
|
mode: import("./types").ButtonMode;
|
|
8
|
-
skeleton: boolean;
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
2
3
|
import type { AutofocusProp } from "../../types";
|
|
3
4
|
import type { FormInjected } from "../OnyxForm/OnyxForm.core";
|
|
4
5
|
export type OnyxButtonProps = DensityProp & AutofocusProp & {
|
|
@@ -33,7 +34,7 @@ export type OnyxButtonProps = DensityProp & AutofocusProp & {
|
|
|
33
34
|
/**
|
|
34
35
|
* Whether to show a skeleton button.
|
|
35
36
|
*/
|
|
36
|
-
skeleton?:
|
|
37
|
+
skeleton?: SkeletonInjected;
|
|
37
38
|
};
|
|
38
39
|
export declare const BUTTON_TYPES: readonly ["button", "submit", "reset"];
|
|
39
40
|
export type ButtonType = (typeof BUTTON_TYPES)[number];
|
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
import { type Reactive, type Ref } from "vue";
|
|
2
|
+
import type { ShowErrorMode } from "../../composables/useErrorClass";
|
|
2
3
|
/**
|
|
3
4
|
* Props on the `OnyxForm` component.
|
|
4
5
|
* These are injected, so that they can be used in the form child components.
|
|
5
6
|
*/
|
|
6
|
-
export type
|
|
7
|
-
|
|
7
|
+
export type FormProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the input should be disabled and prevent the user from interacting with it.
|
|
10
|
+
* Disabled makes the element not mutable, focusable, or even submitted with the form.
|
|
11
|
+
* It will also not be validated.
|
|
12
|
+
*
|
|
13
|
+
* Defaults to `false`.
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Configures if and when errors are shown.
|
|
18
|
+
* When `true`, errors will be shown initially.
|
|
19
|
+
* When `false`, errors will never be shown. ⚠️ Only the displaying of the error is effected! An error can still block submission!
|
|
20
|
+
*
|
|
21
|
+
* The default is `"touched"`, which only shows an error *after* a user has significantly interacted with the input.
|
|
22
|
+
* See [:user-invalid](https://drafts.csswg.org/selectors/#user-invalid-pseudo).
|
|
23
|
+
*/
|
|
24
|
+
showError?: ShowErrorMode;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Props that may be used by the form child components.
|
|
28
|
+
*/
|
|
29
|
+
export type FormComputedProps = {
|
|
30
|
+
[TKey in keyof FormProps]-?: FormProps[TKey];
|
|
8
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* ❗️ DO NOT USE THIS TYPE ❗️
|
|
34
|
+
*
|
|
35
|
+
* Manual replication of the `keyof FormProps` type.
|
|
36
|
+
* Unfortunately this is necessary because Vue can only supports simple index types.
|
|
37
|
+
*
|
|
38
|
+
* See discussion in https://github.com/vuejs/core/issues/8286
|
|
39
|
+
*/
|
|
40
|
+
export type __DONT_USE_VUE_FIX_KeyOfFormProps = "disabled" | "showError";
|
|
9
41
|
/**
|
|
10
42
|
* Props that may be used by the form child components.
|
|
11
43
|
*/
|
|
12
|
-
type
|
|
13
|
-
[TKey in
|
|
44
|
+
export type FormInjectedProps = {
|
|
45
|
+
[TKey in __DONT_USE_VUE_FIX_KeyOfFormProps]?: FormInjected<FormProps[TKey]>;
|
|
14
46
|
};
|
|
15
47
|
/**
|
|
16
48
|
* Symbol for the injected form injected properties.
|
|
@@ -33,7 +65,7 @@ export type FORM_INJECTED = typeof FORM_INJECTED_SYMBOL;
|
|
|
33
65
|
* ```
|
|
34
66
|
*/
|
|
35
67
|
export type FormInjected<T> = T | FORM_INJECTED;
|
|
36
|
-
export declare const provideFormContext: (formProps: Reactive<
|
|
68
|
+
export declare const provideFormContext: (formProps: Reactive<FormProps> | undefined) => void;
|
|
37
69
|
/**
|
|
38
70
|
* Provides the injected form properties (if available).
|
|
39
71
|
* Otherwise a defined default is used.
|
|
@@ -52,7 +84,7 @@ export declare const provideFormContext: (formProps: Reactive<FormInjectedProps>
|
|
|
52
84
|
* const { disabled, readonly } = useFormContext(props);
|
|
53
85
|
* ```
|
|
54
86
|
*/
|
|
55
|
-
export declare const useFormContext: (props: Reactive<
|
|
56
|
-
disabled: Ref<boolean, boolean
|
|
87
|
+
export declare const useFormContext: (props: Reactive<FormInjectedProps>) => {
|
|
88
|
+
disabled: Readonly<Ref<boolean, boolean>>;
|
|
89
|
+
showError: Readonly<Ref<boolean | "touched", boolean | "touched">>;
|
|
57
90
|
};
|
|
58
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,7 +15,10 @@ declare function __VLS_template(): {
|
|
|
15
15
|
attrs: Partial<{}>;
|
|
16
16
|
};
|
|
17
17
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<OnyxFormProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxFormProps> & Readonly<{}>, {
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<OnyxFormProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxFormProps> & Readonly<{}>, {
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
showError: import("../../composables/useErrorClass").ShowErrorMode;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
22
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
23
|
export default _default;
|
|
21
24
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { SkeletonProvidedProp } from "../../composables/useSkeletonState";
|
|
3
|
+
import type { FormProps } from "./OnyxForm.core";
|
|
4
|
+
export type OnyxFormProps = FormProps & Partial<SkeletonProvidedProp> & DensityProp;
|
|
@@ -14,8 +14,8 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
14
14
|
declare const __VLS_component: import("vue").DefineComponent<OnyxIconButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OnyxIconButtonProps> & Readonly<{}>, {
|
|
15
15
|
type: import("../..").ButtonType;
|
|
16
16
|
color: import("../..").ButtonColor;
|
|
17
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
17
18
|
disabled: import("../OnyxForm/OnyxForm.core").FormInjected<boolean>;
|
|
18
|
-
skeleton: boolean;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
21
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
2
3
|
import type { AutofocusProp } from "../../types";
|
|
3
4
|
import type { ButtonColor, ButtonType } from "../OnyxButton/types";
|
|
4
5
|
import type { FormInjected } from "../OnyxForm/OnyxForm.core";
|
|
@@ -31,5 +32,5 @@ export type OnyxIconButtonProps = DensityProp & AutofocusProp & {
|
|
|
31
32
|
/**
|
|
32
33
|
* Whether to show a skeleton button.
|
|
33
34
|
*/
|
|
34
|
-
skeleton?:
|
|
35
|
+
skeleton?: SkeletonInjected;
|
|
35
36
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FORM_INJECTED_SYMBOL } from "../OnyxForm/OnyxForm.core";
|
|
1
2
|
import type { OnyxInputProps } from "./types";
|
|
2
3
|
declare const _default: import("vue").DefineComponent<OnyxInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
4
|
validityChange: (validity: ValidityState) => any;
|
|
@@ -8,10 +9,11 @@ declare const _default: import("vue").DefineComponent<OnyxInputProps, {}, {}, {}
|
|
|
8
9
|
}>, {
|
|
9
10
|
type: import("./types").InputType;
|
|
10
11
|
required: boolean;
|
|
11
|
-
|
|
12
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
13
|
+
disabled: boolean | typeof FORM_INJECTED_SYMBOL;
|
|
14
|
+
showError: boolean | "touched" | typeof FORM_INJECTED_SYMBOL;
|
|
12
15
|
autocapitalize: import("./types").Autocapitalize;
|
|
13
16
|
loading: boolean;
|
|
14
|
-
skeleton: boolean;
|
|
15
17
|
modelValue: string;
|
|
16
18
|
readonly: boolean;
|
|
17
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
2
|
import type { RequiredMarkerProp } from "../../composables/required";
|
|
3
3
|
import type { CustomValidityProp } from "../../composables/useCustomValidity";
|
|
4
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
4
5
|
import type { AutofocusProp } from "../../types";
|
|
5
|
-
import type {
|
|
6
|
+
import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
|
|
6
7
|
import type { OnyxFormElementProps } from "../OnyxFormElement/types";
|
|
7
|
-
export type OnyxInputProps = DensityProp & RequiredMarkerProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages"> & AutofocusProp & {
|
|
8
|
+
export type OnyxInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages"> & AutofocusProp & {
|
|
8
9
|
/**
|
|
9
10
|
* Current value of the input.
|
|
10
11
|
*/
|
|
@@ -47,10 +48,6 @@ export type OnyxInputProps = DensityProp & RequiredMarkerProp & CustomValidityPr
|
|
|
47
48
|
* Whether the input should be readonly.
|
|
48
49
|
*/
|
|
49
50
|
readonly?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Whether the input should be disabled.
|
|
52
|
-
*/
|
|
53
|
-
disabled?: FormInjected<boolean>;
|
|
54
51
|
/**
|
|
55
52
|
* Whether the input is loading. User interaction will be disabled.
|
|
56
53
|
*/
|
|
@@ -65,7 +62,7 @@ export type OnyxInputProps = DensityProp & RequiredMarkerProp & CustomValidityPr
|
|
|
65
62
|
/**
|
|
66
63
|
* Whether to show a skeleton input.
|
|
67
64
|
*/
|
|
68
|
-
skeleton?:
|
|
65
|
+
skeleton?: SkeletonInjected;
|
|
69
66
|
};
|
|
70
67
|
export declare const INPUT_TYPES: readonly ["email", "password", "search", "tel", "text", "url"];
|
|
71
68
|
export type InputType = (typeof INPUT_TYPES)[number];
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { type OnyxMenuItemProps } from "./types";
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
|
-
slots: {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
slots: Readonly<{
|
|
4
|
+
/**
|
|
5
|
+
* Text content of the menu item.
|
|
6
|
+
*/
|
|
7
|
+
default: () => unknown;
|
|
8
|
+
}> & {
|
|
9
|
+
/**
|
|
10
|
+
* Text content of the menu item.
|
|
11
|
+
*/
|
|
12
|
+
default: () => unknown;
|
|
6
13
|
};
|
|
7
14
|
refs: {};
|
|
8
15
|
attrs: Partial<{}>;
|
|
@@ -15,6 +15,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("../../../On
|
|
|
15
15
|
label: string;
|
|
16
16
|
active?: boolean;
|
|
17
17
|
} & {
|
|
18
|
+
/**
|
|
19
|
+
* If the mobile layout should be used.
|
|
20
|
+
*/
|
|
18
21
|
isMobile: boolean;
|
|
19
22
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
23
|
"update:mobileChildrenOpen": (isOpen: boolean) => any;
|
|
@@ -23,6 +26,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("../../../On
|
|
|
23
26
|
label: string;
|
|
24
27
|
active?: boolean;
|
|
25
28
|
} & {
|
|
29
|
+
/**
|
|
30
|
+
* If the mobile layout should be used.
|
|
31
|
+
*/
|
|
26
32
|
isMobile: boolean;
|
|
27
33
|
}> & Readonly<{
|
|
28
34
|
"onUpdate:mobileChildrenOpen"?: ((isOpen: boolean) => any) | undefined;
|
|
@@ -4,8 +4,15 @@ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue>(_
|
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
5
|
readonly "onUpdate:flyoutOpen"?: ((isOpen: boolean) => any) | undefined;
|
|
6
6
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:flyoutOpen"> & {
|
|
7
|
+
/**
|
|
8
|
+
* If the mobile layout should be used instead of the desktop layout.
|
|
9
|
+
*/
|
|
7
10
|
isMobile: boolean;
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Controls the open state of the user menu flyout.
|
|
13
|
+
* Will be managed automatically, if not provided as a prop.
|
|
14
|
+
*/
|
|
15
|
+
flyoutOpen?: ManagedProp<boolean>;
|
|
9
16
|
}> & import("vue").PublicProps;
|
|
10
17
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
11
18
|
attrs: any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SkeletonProvidedProp } from "../../composables/useSkeletonState";
|
|
2
|
+
export type OnyxPageLayoutProps = Partial<SkeletonProvidedProp> & {
|
|
2
3
|
/** When the page includes a sidebar as well as a footer,
|
|
3
4
|
* footerAsideSidebar will restrict the footer to span
|
|
4
5
|
* only the page main area and not the sidebar.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
2
|
import type { RequiredMarkerProp } from "../../composables/required";
|
|
3
3
|
import type { CustomValidityProp } from "../../composables/useCustomValidity";
|
|
4
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
4
5
|
import type { AutofocusProp } from "../../types";
|
|
5
|
-
import type {
|
|
6
|
+
import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
|
|
6
7
|
import type { OnyxFormElementProps } from "../OnyxFormElement/types";
|
|
7
8
|
export declare const MULTISELECT_TEXT_MODE: readonly ["summary", "preview"];
|
|
8
9
|
export type MultiselectTextMode = (typeof MULTISELECT_TEXT_MODE)[number];
|
|
9
|
-
export type OnyxSelectInputProps = DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & Omit<OnyxFormElementProps, "modelValue" | "maxlength" | "withCounter"> & {
|
|
10
|
+
export type OnyxSelectInputProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & Omit<OnyxFormElementProps, "modelValue" | "maxlength" | "withCounter"> & {
|
|
10
11
|
/**
|
|
11
12
|
* Current label(s) of the select.
|
|
12
13
|
*/
|
|
@@ -18,14 +19,10 @@ export type OnyxSelectInputProps = DensityProp & RequiredMarkerProp & CustomVali
|
|
|
18
19
|
* A number-badge appears next to it including a tooltip with all selected names.
|
|
19
20
|
*/
|
|
20
21
|
textMode?: MultiselectTextMode;
|
|
21
|
-
/**
|
|
22
|
-
* Whether the select should be disabled.
|
|
23
|
-
*/
|
|
24
|
-
disabled?: FormInjected<boolean>;
|
|
25
22
|
/**
|
|
26
23
|
* Whether to show a skeleton select.
|
|
27
24
|
*/
|
|
28
|
-
skeleton?:
|
|
25
|
+
skeleton?: SkeletonInjected;
|
|
29
26
|
/**
|
|
30
27
|
* Whether the select should be readonly.
|
|
31
28
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FORM_INJECTED_SYMBOL } from "../OnyxForm/OnyxForm.core";
|
|
1
2
|
import type { OnyxStepperProps } from "./types";
|
|
2
3
|
declare const _default: import("vue").DefineComponent<OnyxStepperProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
4
|
validityChange: (validity: ValidityState) => any;
|
|
@@ -6,9 +7,10 @@ declare const _default: import("vue").DefineComponent<OnyxStepperProps, {}, {},
|
|
|
6
7
|
onValidityChange?: ((validity: ValidityState) => any) | undefined;
|
|
7
8
|
"onUpdate:modelValue"?: ((value?: number | undefined) => any) | undefined;
|
|
8
9
|
}>, {
|
|
9
|
-
|
|
10
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
11
|
+
disabled: boolean | typeof FORM_INJECTED_SYMBOL;
|
|
12
|
+
showError: boolean | "touched" | typeof FORM_INJECTED_SYMBOL;
|
|
10
13
|
loading: boolean;
|
|
11
|
-
skeleton: boolean;
|
|
12
14
|
step: number;
|
|
13
15
|
readonly: boolean;
|
|
14
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
2
|
import type { CustomValidityProp } from "../../composables/useCustomValidity";
|
|
3
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
3
4
|
import type { AutofocusProp } from "../../types";
|
|
4
|
-
import type {
|
|
5
|
+
import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
|
|
5
6
|
import type { OnyxFormElementProps } from "../OnyxFormElement/types";
|
|
6
7
|
import type { Autocomplete } from "../OnyxInput/types";
|
|
7
|
-
export type OnyxStepperProps = DensityProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages" | "withCounter" | "maxlength"> & AutofocusProp & {
|
|
8
|
+
export type OnyxStepperProps = FormInjectedProps & DensityProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages" | "withCounter" | "maxlength"> & AutofocusProp & {
|
|
8
9
|
/**
|
|
9
10
|
* Current value of the input.
|
|
10
11
|
*/
|
|
@@ -38,10 +39,6 @@ export type OnyxStepperProps = DensityProp & CustomValidityProp & Omit<OnyxFormE
|
|
|
38
39
|
* @see [MDN autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
|
|
39
40
|
*/
|
|
40
41
|
autocomplete?: Autocomplete;
|
|
41
|
-
/**
|
|
42
|
-
* Whether to disable the input and prevent user interaction.
|
|
43
|
-
*/
|
|
44
|
-
disabled?: FormInjected<boolean>;
|
|
45
42
|
/**
|
|
46
43
|
* Whether the input should be readonly.
|
|
47
44
|
*/
|
|
@@ -53,5 +50,5 @@ export type OnyxStepperProps = DensityProp & CustomValidityProp & Omit<OnyxFormE
|
|
|
53
50
|
/**
|
|
54
51
|
* Whether to show a skeleton input.
|
|
55
52
|
*/
|
|
56
|
-
skeleton?:
|
|
53
|
+
skeleton?: SkeletonInjected;
|
|
57
54
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FORM_INJECTED_SYMBOL } from "../OnyxForm/OnyxForm.core";
|
|
1
2
|
import type { OnyxSwitchProps } from "./types";
|
|
2
3
|
declare const _default: import("vue").DefineComponent<OnyxSwitchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
4
|
validityChange: (validity: ValidityState) => any;
|
|
@@ -6,9 +7,9 @@ declare const _default: import("vue").DefineComponent<OnyxSwitchProps, {}, {}, {
|
|
|
6
7
|
onValidityChange?: ((validity: ValidityState) => any) | undefined;
|
|
7
8
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
8
9
|
}>, {
|
|
9
|
-
|
|
10
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
11
|
+
disabled: boolean | typeof FORM_INJECTED_SYMBOL;
|
|
10
12
|
loading: boolean;
|
|
11
|
-
skeleton: boolean;
|
|
12
13
|
modelValue: boolean;
|
|
13
14
|
truncation: import("../..").TruncationType;
|
|
14
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DensityProp } from "../../composables/density";
|
|
2
2
|
import type { RequiredMarkerProp } from "../../composables/required";
|
|
3
3
|
import type { CustomValidityProp } from "../../composables/useCustomValidity";
|
|
4
|
+
import type { SkeletonInjected } from "../../composables/useSkeletonState";
|
|
4
5
|
import type { AutofocusProp, TruncationType } from "../../types";
|
|
5
|
-
import type {
|
|
6
|
-
export type OnyxSwitchProps = DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & {
|
|
6
|
+
import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
|
|
7
|
+
export type OnyxSwitchProps = FormInjectedProps & DensityProp & RequiredMarkerProp & CustomValidityProp & AutofocusProp & {
|
|
7
8
|
/**
|
|
8
9
|
* Whether the switch should be checked or not.
|
|
9
10
|
*/
|
|
@@ -12,10 +13,6 @@ export type OnyxSwitchProps = DensityProp & RequiredMarkerProp & CustomValidityP
|
|
|
12
13
|
* The label of the switch.
|
|
13
14
|
*/
|
|
14
15
|
label: string;
|
|
15
|
-
/**
|
|
16
|
-
* Whether to disable the switch and prevent user interaction.
|
|
17
|
-
*/
|
|
18
|
-
disabled?: FormInjected<boolean>;
|
|
19
16
|
/**
|
|
20
17
|
* Shows a loading indicator.
|
|
21
18
|
*/
|
|
@@ -32,5 +29,5 @@ export type OnyxSwitchProps = DensityProp & RequiredMarkerProp & CustomValidityP
|
|
|
32
29
|
/**
|
|
33
30
|
* Whether to show a skeleton switch.
|
|
34
31
|
*/
|
|
35
|
-
skeleton?:
|
|
32
|
+
skeleton?: SkeletonInjected;
|
|
36
33
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FORM_INJECTED_SYMBOL } from "../OnyxForm/OnyxForm.core";
|
|
1
2
|
import type { OnyxTextareaProps } from "./types";
|
|
2
3
|
declare const _default: import("vue").DefineComponent<OnyxTextareaProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
4
|
validityChange: (validity: ValidityState) => any;
|
|
@@ -7,9 +8,9 @@ declare const _default: import("vue").DefineComponent<OnyxTextareaProps, {}, {},
|
|
|
7
8
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
9
|
}>, {
|
|
9
10
|
required: boolean;
|
|
10
|
-
|
|
11
|
+
skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
|
|
12
|
+
disabled: boolean | typeof FORM_INJECTED_SYMBOL;
|
|
11
13
|
autocapitalize: import("../..").Autocapitalize;
|
|
12
|
-
skeleton: boolean;
|
|
13
14
|
modelValue: string;
|
|
14
15
|
readonly: boolean;
|
|
15
16
|
disableManualResize: boolean;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { OnyxVisuallyHiddenProps } from "./types";
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
|
-
slots: {
|
|
4
|
-
|
|
3
|
+
slots: Readonly<{
|
|
4
|
+
/**
|
|
5
|
+
* Content that should be visually hidden.
|
|
6
|
+
*/
|
|
7
|
+
default: () => unknown;
|
|
8
|
+
}> & {
|
|
9
|
+
/**
|
|
10
|
+
* Content that should be visually hidden.
|
|
11
|
+
*/
|
|
12
|
+
default: () => unknown;
|
|
5
13
|
};
|
|
6
14
|
refs: {};
|
|
7
15
|
attrs: Partial<{}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
"dark"?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:dark": (dark: boolean) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
|
+
"onUpdate:dark"?: ((dark: boolean) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
package/dist/components/examples/GridPlayground/EditGridElementDialog/EditGridElementDialog.vue.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export type GridElementConfig = {
|
|
|
4
4
|
breakpoints?: Partial<Record<OnyxBreakpoint, number>>;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<{
|
|
7
|
+
/**
|
|
8
|
+
* Controls if the dialog is shown or not.
|
|
9
|
+
* State is reset when the dialog is closed.
|
|
10
|
+
*/
|
|
7
11
|
open?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Initial value. Useful if editing an existing element.
|
|
@@ -14,6 +18,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
18
|
apply: (element: GridElementConfig) => any;
|
|
15
19
|
close: () => any;
|
|
16
20
|
}, string, import("vue").PublicProps, Readonly<{
|
|
21
|
+
/**
|
|
22
|
+
* Controls if the dialog is shown or not.
|
|
23
|
+
* State is reset when the dialog is closed.
|
|
24
|
+
*/
|
|
17
25
|
open?: boolean;
|
|
18
26
|
/**
|
|
19
27
|
* Initial value. Useful if editing an existing element.
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import type { OnyxColor } from "../../../../types";
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Value shown on the badge itself.
|
|
5
|
+
*/
|
|
3
6
|
value: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* Label shown after the value.
|
|
9
|
+
*/
|
|
4
10
|
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* The badge color.
|
|
13
|
+
*/
|
|
5
14
|
color: Extract<OnyxColor, "info" | "warning" | "danger">;
|
|
6
15
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
16
|
+
/**
|
|
17
|
+
* Value shown on the badge itself.
|
|
18
|
+
*/
|
|
7
19
|
value: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Label shown after the value.
|
|
22
|
+
*/
|
|
8
23
|
label: string;
|
|
24
|
+
/**
|
|
25
|
+
* The badge color.
|
|
26
|
+
*/
|
|
9
27
|
color: Extract<OnyxColor, "info" | "warning" | "danger">;
|
|
10
28
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
29
|
export default _default;
|
|
@@ -22,10 +22,22 @@ declare function __VLS_template(): {
|
|
|
22
22
|
};
|
|
23
23
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
24
|
declare const __VLS_component: import("vue").DefineComponent<GridElementConfig & {
|
|
25
|
+
/**
|
|
26
|
+
* Rendered label of the grid element.
|
|
27
|
+
*/
|
|
25
28
|
label: string;
|
|
29
|
+
/**
|
|
30
|
+
* If the element should be rendered in the outline or default variant.
|
|
31
|
+
*/
|
|
26
32
|
mode?: "default" | "outline";
|
|
27
33
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GridElementConfig & {
|
|
34
|
+
/**
|
|
35
|
+
* Rendered label of the grid element.
|
|
36
|
+
*/
|
|
28
37
|
label: string;
|
|
38
|
+
/**
|
|
39
|
+
* If the element should be rendered in the outline or default variant.
|
|
40
|
+
*/
|
|
29
41
|
mode?: "default" | "outline";
|
|
30
42
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
43
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
/**
|
|
3
|
+
* The number of grid columns.
|
|
4
|
+
*/
|
|
2
5
|
columns?: number;
|
|
3
6
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
7
|
+
/**
|
|
8
|
+
* The number of grid columns.
|
|
9
|
+
*/
|
|
4
10
|
columns?: number;
|
|
5
11
|
}> & Readonly<{}>, {
|
|
6
12
|
columns: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* All possible `showError` values.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ShowErrorModes: readonly [true, false, "touched"];
|
|
6
|
+
/**
|
|
7
|
+
* Configures if and when errors are shown.
|
|
8
|
+
* When `true`, errors will be shown initially.
|
|
9
|
+
* When `false`, errors will never be shown.
|
|
10
|
+
* `"touched"` only shows an error *after* a user has significantly interacted with the input.
|
|
11
|
+
* See [:user-invalid](https://drafts.csswg.org/selectors/#user-invalid-pseudo).
|
|
12
|
+
*/
|
|
13
|
+
export type ShowErrorMode = (typeof ShowErrorModes)[number];
|
|
14
|
+
export declare const useErrorClass: (showError: Readonly<Ref<ShowErrorMode>>) => import("vue").ComputedRef<"onyx-form-element--immediate-invalid" | "onyx-form-element--suppress-invalid" | "onyx-form-element--touched-invalid">;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ComputedRef, type Reactive } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Prop on the parent component.
|
|
4
|
+
* It's value is provided, so that it can be used in child components.
|
|
5
|
+
*/
|
|
6
|
+
export type SkeletonProvidedProp = {
|
|
7
|
+
skeleton: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Prop that may be used by the child components.
|
|
11
|
+
*/
|
|
12
|
+
type LocalProps = {
|
|
13
|
+
skeleton: SKELETON_INJECTED | boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Symbol for the skeleton injected property.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SKELETON_INJECTED_SYMBOL: unique symbol;
|
|
19
|
+
export type SKELETON_INJECTED = typeof SKELETON_INJECTED_SYMBOL;
|
|
20
|
+
/**
|
|
21
|
+
* Prop type used by child elements, which indicates that the prop value is taken from the parent by default.
|
|
22
|
+
* The prop **MUST** use `SKELETON_INJECTED_SYMBOL` as default value.
|
|
23
|
+
* `useSkeletonContext` is used to access the injected parent property.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const props = withDefaults(defineProps<OnyxComponentProps>(), {
|
|
28
|
+
* skeleton: SKELETON_INJECTED_SYMBOL,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* const skeleton = useSkeletonContext(props);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export type SkeletonInjected = SKELETON_INJECTED | boolean;
|
|
35
|
+
export declare const provideSkeletonContext: (parentElementProps: Reactive<SkeletonProvidedProp> | undefined) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Provides the injected parent property (if available).
|
|
38
|
+
* Otherwise a defined default is used.
|
|
39
|
+
* A prop defined on the child component will always take precedence over the injected parent property.
|
|
40
|
+
*
|
|
41
|
+
* The prop **MUST** use `SKELETON_INJECTED_SYMBOL` as default value.
|
|
42
|
+
* The type `SkeletonInjected<T>` can be used as PropType wrapper.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const props = withDefaults(defineProps<OnyxComponentProps>(), {
|
|
47
|
+
* skeleton: SKELETON_INJECTED_SYMBOL, // By default, the parent injected value is used
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* const skeleton = useSkeletonContext(props);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const useSkeletonContext: (props: Reactive<LocalProps>) => ComputedRef<boolean>;
|
|
54
|
+
export {};
|