sit-onyx 1.0.0-beta.60 → 1.0.0-beta.61

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,6 +1,7 @@
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, BaseSelectOption, Direction, SelectOptionValue } from "../../types";
5
6
  import type { FormInjected } from "../OnyxForm/OnyxForm.core";
6
7
  import type { OnyxFormElementProps } from "../OnyxFormElement/types";
@@ -35,6 +36,6 @@ export type OnyxCheckboxGroupProps<TValue extends SelectOptionValue = SelectOpti
35
36
  /**
36
37
  * If set, the specified number of skeleton radio buttons will be shown.
37
38
  */
38
- skeleton?: number;
39
+ skeleton?: SkeletonInjected;
39
40
  };
40
41
  export type CheckboxGroupOption<TValue extends SelectOptionValue = SelectOptionValue> = BaseSelectOption<TValue> & RequiredMarkerProp & CustomValidityProp & AutofocusProp;
@@ -54,7 +54,7 @@ export type OnyxInputProps = FormInjectedProps & DensityProp & RequiredMarkerPro
54
54
  loading?: boolean;
55
55
  /**
56
56
  * Minimum number of characters that have to to be entered.
57
- * Warning: when the value is (pre)set programatically,
57
+ * Warning: when the value is (pre)set programmatically,
58
58
  * the input invalidity will not be detected by the browser, it will only turn invalid
59
59
  * as soon as a user interacts with the input (types something).
60
60
  */
@@ -1,6 +1,7 @@
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, BaseSelectOption, Direction, SelectOptionValue } from "../../types";
5
6
  import type { FormInjected } from "../OnyxForm/OnyxForm.core";
6
7
  import type { OnyxFormElementProps } from "../OnyxFormElement/types";
@@ -30,6 +31,6 @@ export type OnyxRadioGroupProps<TValue extends SelectOptionValue = SelectOptionV
30
31
  /**
31
32
  * If set, the specified number of skeleton radio buttons will be shown.
32
33
  */
33
- skeleton?: number;
34
+ skeleton?: SkeletonInjected;
34
35
  };
35
36
  export type RadioButtonOption<TValue extends SelectOptionValue = SelectOptionValue> = Omit<BaseSelectOption<TValue>, "hideLabel"> & AutofocusProp;
@@ -1,16 +1,21 @@
1
1
  import type { OnyxStepperProps } from "./types";
2
- declare const _default: import("vue").DefineComponent<OnyxStepperProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare let __VLS_typeProps: OnyxStepperProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: number;
5
+ } & typeof __VLS_typeProps;
6
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
7
  validityChange: (validity: ValidityState) => any;
4
- "update:modelValue": (value?: number | undefined) => any;
5
- }, string, import("vue").PublicProps, Readonly<OnyxStepperProps> & Readonly<{
8
+ "update:modelValue": (modelValue: number) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
6
10
  onValidityChange?: ((validity: ValidityState) => any) | undefined;
7
- "onUpdate:modelValue"?: ((value?: number | undefined) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((modelValue: number) => any) | undefined;
8
12
  }>, {
9
13
  skeleton: import("../../composables/useSkeletonState").SkeletonInjected;
10
14
  disabled: boolean | symbol;
11
15
  showError: boolean | symbol | "touched";
12
16
  loading: boolean;
13
- step: number;
14
17
  readonly: boolean;
18
+ precision: number;
19
+ stripStep: boolean;
15
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
21
  export default _default;
@@ -6,10 +6,6 @@ import type { FormInjectedProps } from "../OnyxForm/OnyxForm.core";
6
6
  import type { OnyxFormElementProps } from "../OnyxFormElement/types";
7
7
  import type { Autocomplete } from "../OnyxInput/types";
8
8
  export type OnyxStepperProps = FormInjectedProps & DensityProp & CustomValidityProp & Omit<OnyxFormElementProps, "modelValue" | "errorMessages" | "withCounter" | "maxlength"> & AutofocusProp & {
9
- /**
10
- * Current value of the input.
11
- */
12
- modelValue?: number;
13
9
  /**
14
10
  * Same as the native `name` attribute of `<input>`.
15
11
  * Used to reference the input in JavaScript or in submitted form data.
@@ -30,7 +26,24 @@ export type OnyxStepperProps = FormInjectedProps & DensityProp & CustomValidityP
30
26
  /**
31
27
  * Incremental step.
32
28
  */
29
+ /**
30
+ * Incremental step.
31
+ * @deprecated
32
+ */
33
33
  step?: number;
34
+ /**
35
+ * The smallest allowed value and rounded precision
36
+ */
37
+ precision?: number;
38
+ /**
39
+ * The increment number
40
+ * @default precision is the default stepSize
41
+ */
42
+ stepSize?: number;
43
+ /**
44
+ * Ensure no wrong number can be inputed
45
+ */
46
+ stripStep?: boolean;
34
47
  /**
35
48
  * Specify how to provide automated assistance in filling out the input.
36
49
  * Some autocomplete values might required specific browser permissions to be allowed by the user.
@@ -19,7 +19,7 @@ export type UseCustomValidityOptions = {
19
19
  minlength?: number;
20
20
  min?: number;
21
21
  max?: number;
22
- step?: number;
22
+ precision?: number;
23
23
  } & Pick<BaseSelectOption, "hideLabel" | "label">;
24
24
  /**
25
25
  * Component emit as defined with `const emit = defineEmits()`
@@ -10,7 +10,7 @@ export type SkeletonProvidedProp = {
10
10
  * Prop that may be used by the child components.
11
11
  */
12
12
  type LocalProps = {
13
- skeleton: symbol | boolean;
13
+ skeleton: symbol | boolean | number;
14
14
  };
15
15
  /**
16
16
  * Symbol for the skeleton injected property.
@@ -22,6 +22,9 @@ export type SKELETON_INJECTED = symbol;
22
22
  * The prop **MUST** use `SKELETON_INJECTED_SYMBOL` as default value.
23
23
  * `useSkeletonContext` is used to access the injected parent property.
24
24
  *
25
+ * NOTE: The number type is used only for OnyxRadioGroup and OnyxCheckboxGroup components.
26
+ * NOTE: The number type is not intended to be used by other properties with boolean skeleton prop.
27
+ *
25
28
  * @example
26
29
  * ```ts
27
30
  * const props = withDefaults(defineProps<OnyxComponentProps>(), {
@@ -31,7 +34,7 @@ export type SKELETON_INJECTED = symbol;
31
34
  * const skeleton = useSkeletonContext(props);
32
35
  * ```
33
36
  */
34
- export type SkeletonInjected = symbol | boolean;
37
+ export type SkeletonInjected = symbol | boolean | number;
35
38
  export declare const provideSkeletonContext: (parentElementProps: Reactive<SkeletonProvidedProp> | undefined) => void;
36
39
  /**
37
40
  * Provides the injected parent property (if available).
@@ -50,5 +53,5 @@ export declare const provideSkeletonContext: (parentElementProps: Reactive<Skele
50
53
  * const skeleton = useSkeletonContext(props);
51
54
  * ```
52
55
  */
53
- export declare const useSkeletonContext: (props: Reactive<LocalProps>) => ComputedRef<boolean>;
56
+ export declare const useSkeletonContext: (props: Reactive<LocalProps>) => ComputedRef<number | boolean>;
54
57
  export {};