@milaboratories/uikit 2.0.13 → 2.1.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.
@@ -1,13 +1,12 @@
1
1
  import './pl-text-field.scss';
2
+ import type { Equal } from '@milaboratories/helpers';
2
3
  /** Component for one-line string data manipulation */
3
- declare const _default: <M extends string | null | undefined = string, E extends M = M>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ declare const _default: <M, E = string, C = E>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
- readonly "onUpdate:modelValue"?: ((value: string | E) => any) | undefined;
6
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & {
7
- /**
8
- * The current value of the input field.
9
- */
10
- modelValue: M;
6
+ readonly "onUpdate:modelValue"?: ((modelValue: Equal<M, E | C> extends true ? M : never) => any) | undefined;
7
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & ({
8
+ modelValue: Equal<M, E | C> extends true ? M : never;
9
+ } & {
11
10
  /**
12
11
  * The label to display above the input field.
13
12
  */
@@ -16,7 +15,12 @@ declare const _default: <M extends string | null | undefined = string, E extends
16
15
  * If `true`, a clear icon will appear in the input field to clear the value (set it to empty string).
17
16
  * Or you can pass a callback that returns a custom "empty" value (null | undefined | string)
18
17
  */
19
- clearable?: boolean | (() => E);
18
+ clearable?: boolean | (() => C);
19
+ /**
20
+ * An optional callback to parse and/or cast the value, the return type overrides the model type.
21
+ * The callback must throw an exception if the value is invalid
22
+ */
23
+ parse?: (v: string) => E;
20
24
  /**
21
25
  * If `true`, the input field is marked as required.
22
26
  */
@@ -52,15 +56,17 @@ declare const _default: <M extends string | null | undefined = string, E extends
52
56
  /**
53
57
  * The string specifies whether the field should be a password or not, value could be "password" or undefined.
54
58
  */
55
- type?: "password";
56
- }> & import("vue").PublicProps;
59
+ type?: "password" | "number";
60
+ })> & import("vue").PublicProps;
57
61
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
58
62
  attrs: any;
59
63
  slots: {
60
64
  tooltip?(_: {}): any;
61
65
  append?(_: {}): any;
62
66
  };
63
- emit: (e: "update:modelValue", value: string | E) => void;
67
+ emit: {
68
+ 'update:modelValue': [modelValue: Equal<M, E | C> extends true ? M : never];
69
+ };
64
70
  }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
65
71
  [key: string]: any;
66
72
  }> & {