@leavepulse/ui 0.78.1 → 0.78.2
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/chunks/{DropzoneLinkField-CLLhd3WB.js → DropzoneLinkField-CyE7TJ5f.js} +1 -1
- package/dist/chunks/LpAddressInput-ft8fQOGx.js +401 -0
- package/dist/chunks/{LpAppShell-BKbYCHkx.js → LpAppShell-DkvU6IBB.js} +1 -1
- package/dist/chunks/LpAutocomplete-CrZbd0uv.js +310 -0
- package/dist/chunks/LpCheckbox-CCWCwD0y.js +129 -0
- package/dist/chunks/{LpCodeDisplay-D3BUAhV1.js → LpCodeDisplay-D59uPwRb.js} +1 -1
- package/dist/chunks/LpColorPicker-BONURBFN.js +574 -0
- package/dist/chunks/LpDatePicker-C2AOtxgF.js +171 -0
- package/dist/chunks/{LpDateRangePicker-CNQXdTVv.js → LpDateRangePicker-CiXdIAyh.js} +43 -35
- package/dist/chunks/{LpFileTree-C-rJKzEQ.js → LpFileTree-CpNurwZp.js} +2 -2
- package/dist/chunks/{LpFileTreeNode-BgYn4U1J.js → LpFileTreeNode-DdF8Cq-s.js} +1 -1
- package/dist/chunks/{LpInput-D0O6dpuA.js → LpInput-CbI7z5fQ.js} +3 -4
- package/dist/chunks/{LpLogInspector-BdQlX6S-.js → LpLogInspector-CcSJSGan.js} +1 -1
- package/dist/chunks/{LpLogViewer-umCZBapN.js → LpLogViewer-CWu49Dko.js} +2 -2
- package/dist/chunks/{LpModalNav-gOi1Giz1.js → LpModalNav-DI3BW5ff.js} +1 -1
- package/dist/chunks/LpNumberField-C8LfUz_R.js +154 -0
- package/dist/chunks/LpOtpInput-B1X9l9no.js +140 -0
- package/dist/chunks/{LpPaletteTheme-BIXpZLGe.js → LpPaletteTheme-B-xuZiKK.js} +2 -2
- package/dist/chunks/{LpPasswordInput-D4HPhqfV.js → LpPasswordInput-Duc_3wPv.js} +1 -1
- package/dist/chunks/{LpPhoneInput-BSL7NX4z.js → LpPhoneInput-CctcRK9K.js} +124 -118
- package/dist/chunks/LpRadioGroup-DTM0nd9G.js +103 -0
- package/dist/chunks/LpRangeSlider-DJsEZXad.js +97 -0
- package/dist/chunks/LpRepeater-Czib3rmv.js +193 -0
- package/dist/chunks/{LpSecretField-B2roc4Iz.js → LpSecretField-BtlCk3IH.js} +1 -1
- package/dist/chunks/LpSegmented-sskrJKJJ.js +128 -0
- package/dist/chunks/LpSelect-JFZehOkd.js +515 -0
- package/dist/chunks/{LpSidebar-DDNJzb69.js → LpSidebar-CvRvVBTt.js} +1 -1
- package/dist/chunks/LpSlider-C4ilCtZX.js +76 -0
- package/dist/chunks/LpSwitch-DyAYTchz.js +122 -0
- package/dist/chunks/{LpTableFilter-B_XMOeAh.js → LpTableFilter-CJg5eIcV.js} +2 -2
- package/dist/chunks/{LpTagsInput-Dt0mteSj.js → LpTagsInput-CkNxpNYa.js} +4 -3
- package/dist/chunks/{LpTextarea-Co0b9PVx.js → LpTextarea-CFK_5QB8.js} +3 -2
- package/dist/chunks/{LpThemeStudio-ChU0_Ga8.js → LpThemeStudio-R-wohbCY.js} +2 -2
- package/dist/chunks/{LpThemeSwitcher-DmCZ21P_.js → LpThemeSwitcher-Bzy15MCP.js} +1 -1
- package/dist/chunks/LpTimeField-B5n0m8m0.js +115 -0
- package/dist/chunks/{LpTopologyCanvas-jqz1KCq2.js → LpTopologyCanvas-BNgw9RyZ.js} +2 -2
- package/dist/chunks/{LpWorkspaceSwitcher-BeNHCLd5.js → LpWorkspaceSwitcher-ugv-fyig.js} +1 -1
- package/dist/components/DropzoneLinkField.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +4 -0
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.d.ts +3 -3
- package/dist/components/LpAppShell.vue.d.ts +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.d.ts +4 -0
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpChart.vue.d.ts +1 -1
- package/dist/components/LpCheckbox.vue.d.ts +4 -0
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpCollapse.vue.d.ts +1 -1
- package/dist/components/LpColorPicker.vue.d.ts +5 -3
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDateRangePicker.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.d.ts +1 -1
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLogInspector.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +4 -0
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.d.ts +4 -0
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPaletteTheme.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.d.ts +4 -0
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.d.ts +4 -0
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpRangeSlider.vue.d.ts +4 -0
- package/dist/components/LpRangeSlider.vue.js +1 -1
- package/dist/components/LpRepeater.vue.d.ts +2 -0
- package/dist/components/LpRepeater.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.d.ts +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpSegmented.vue.d.ts +4 -0
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.d.ts +2 -0
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShinyText.vue.d.ts +1 -1
- package/dist/components/LpSidebar.vue.d.ts +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSlider.vue.d.ts +4 -0
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpSwitch.vue.d.ts +4 -0
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.js +2 -2
- package/dist/components/LpTableFilter.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +1 -1
- package/dist/components/LpTagsInput.vue.js +1 -1
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTimeField.vue.d.ts +4 -0
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/calendar.d.ts +2 -0
- package/dist/composables/useField.d.ts +50 -0
- package/dist/composables/useField.js +31 -2
- package/dist/composables/useMergedClass.d.ts +6 -2
- package/dist/composables/useMergedClass.js +6 -6
- package/dist/index.js +34 -34
- package/package.json +1 -1
- package/src/components/LpAddressInput.vue +8 -4
- package/src/components/LpAutocomplete.vue +11 -5
- package/src/components/LpCheckbox.vue +8 -6
- package/src/components/LpColorPicker.vue +7 -4
- package/src/components/LpDatePicker.vue +8 -4
- package/src/components/LpDateRangePicker.vue +8 -4
- package/src/components/LpInput.vue +3 -4
- package/src/components/LpNumberField.vue +11 -6
- package/src/components/LpOtpInput.vue +8 -6
- package/src/components/LpPhoneInput.vue +11 -6
- package/src/components/LpRadioGroup.vue +9 -5
- package/src/components/LpRangeSlider.vue +8 -4
- package/src/components/LpRepeater.vue +16 -4
- package/src/components/LpSegmented.vue +8 -4
- package/src/components/LpSelect.vue +8 -7
- package/src/components/LpSlider.vue +8 -4
- package/src/components/LpSwitch.vue +8 -5
- package/src/components/LpTagsInput.vue +4 -3
- package/src/components/LpTextarea.vue +3 -2
- package/src/components/LpTimeField.vue +8 -6
- package/src/components/calendar.ts +2 -0
- package/src/composables/useField.ts +52 -0
- package/src/composables/useMergedClass.ts +11 -5
- package/dist/chunks/LpAddressInput-BSS49jpm.js +0 -393
- package/dist/chunks/LpAutocomplete-DkY6CSyD.js +0 -302
- package/dist/chunks/LpCheckbox-D6RuDW4X.js +0 -124
- package/dist/chunks/LpColorPicker-COHzV68R.js +0 -567
- package/dist/chunks/LpDatePicker-DwSDY0mt.js +0 -163
- package/dist/chunks/LpNumberField-Csg-1Zh_.js +0 -148
- package/dist/chunks/LpOtpInput-BRpLBbOD.js +0 -132
- package/dist/chunks/LpRadioGroup-BrazjLY_.js +0 -95
- package/dist/chunks/LpRangeSlider-fz61tzc-.js +0 -89
- package/dist/chunks/LpRepeater-BkJHSPI1.js +0 -180
- package/dist/chunks/LpSegmented-DbEJhbv-.js +0 -123
- package/dist/chunks/LpSelect-Y-iuSymW.js +0 -512
- package/dist/chunks/LpSlider-A4ixovgS.js +0 -68
- package/dist/chunks/LpSwitch-DnC2-0aV.js +0 -115
- package/dist/chunks/LpTimeField-DeOcKWJq.js +0 -110
|
@@ -43,6 +43,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
43
43
|
/** A leading icon, as on LpInput; the `leading` slot replaces it. */
|
|
44
44
|
icon?: string;
|
|
45
45
|
invalid?: boolean;
|
|
46
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
47
|
+
error?: string;
|
|
46
48
|
/** Control height, matching LpInput. */
|
|
47
49
|
size?: "sm" | "md" | "lg";
|
|
48
50
|
labels?: Partial<NumberFieldLabels>;
|
|
@@ -87,6 +89,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
87
89
|
/** A leading icon, as on LpInput; the `leading` slot replaces it. */
|
|
88
90
|
icon?: string;
|
|
89
91
|
invalid?: boolean;
|
|
92
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
93
|
+
error?: string;
|
|
90
94
|
/** Control height, matching LpInput. */
|
|
91
95
|
size?: "sm" | "md" | "lg";
|
|
92
96
|
labels?: Partial<NumberFieldLabels>;
|
|
@@ -24,6 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
24
24
|
group?: number | number[];
|
|
25
25
|
/** Error state — tints the cells red (e.g. wrong code). */
|
|
26
26
|
invalid?: boolean;
|
|
27
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
28
|
+
error?: string;
|
|
27
29
|
size?: "sm" | "md" | "lg";
|
|
28
30
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
31
|
"update:modelValue": (value: string) => any;
|
|
@@ -52,6 +54,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
52
54
|
group?: number | number[];
|
|
53
55
|
/** Error state — tints the cells red (e.g. wrong code). */
|
|
54
56
|
invalid?: boolean;
|
|
57
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
58
|
+
error?: string;
|
|
55
59
|
size?: "sm" | "md" | "lg";
|
|
56
60
|
}> & Readonly<{
|
|
57
61
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
@@ -44,6 +44,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
44
44
|
placeholder?: string;
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
invalid?: boolean;
|
|
47
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
48
|
+
error?: string;
|
|
47
49
|
size?: "sm" | "md" | "lg";
|
|
48
50
|
emptyText?: string;
|
|
49
51
|
searchPlaceholder?: string;
|
|
@@ -62,6 +64,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
62
64
|
placeholder?: string;
|
|
63
65
|
disabled?: boolean;
|
|
64
66
|
invalid?: boolean;
|
|
67
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
68
|
+
error?: string;
|
|
65
69
|
size?: "sm" | "md" | "lg";
|
|
66
70
|
emptyText?: string;
|
|
67
71
|
searchPlaceholder?: string;
|
|
@@ -10,6 +10,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
10
10
|
modelValue?: string;
|
|
11
11
|
options?: RadioOption[];
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
/** A message under the group, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
14
|
+
error?: string;
|
|
13
15
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
16
|
"update:modelValue": (value: string) => any;
|
|
15
17
|
}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -17,6 +19,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
17
19
|
modelValue?: string;
|
|
18
20
|
options?: RadioOption[];
|
|
19
21
|
disabled?: boolean;
|
|
22
|
+
/** A message under the group, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
23
|
+
error?: string;
|
|
20
24
|
}> & Readonly<{
|
|
21
25
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
26
|
}>, {
|
|
@@ -11,6 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
11
11
|
/** The least distance the two ends keep between them, in model units. */
|
|
12
12
|
minGap?: number;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
15
|
+
error?: string;
|
|
14
16
|
/** Accessible names for the two thumbs when there's no visible label. */
|
|
15
17
|
ariaLabels?: [string, string];
|
|
16
18
|
/** Label over each thumb while it is in use: `(value) => "1:05"`. */
|
|
@@ -28,6 +30,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
28
30
|
/** The least distance the two ends keep between them, in model units. */
|
|
29
31
|
minGap?: number;
|
|
30
32
|
disabled?: boolean;
|
|
33
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
34
|
+
error?: string;
|
|
31
35
|
/** Accessible names for the two thumbs when there's no visible label. */
|
|
32
36
|
ariaLabels?: [string, string];
|
|
33
37
|
/** Label over each thumb while it is in use: `(value) => "1:05"`. */
|
|
@@ -7,6 +7,8 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
|
|
|
7
7
|
itemKey?: RepeaterItemKey<T>;
|
|
8
8
|
label?: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
11
|
+
error?: string;
|
|
10
12
|
labels?: Partial<{
|
|
11
13
|
add: string;
|
|
12
14
|
remove: string;
|
|
@@ -16,8 +16,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
17
|
onScroll?: ((event: Event) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
|
-
fade: boolean;
|
|
20
19
|
instant: boolean;
|
|
20
|
+
fade: boolean;
|
|
21
21
|
floating: boolean;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,6 +21,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
21
21
|
/** Stretch to fill the container with equal-width segments. */
|
|
22
22
|
block?: boolean;
|
|
23
23
|
disabled?: boolean;
|
|
24
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
25
|
+
error?: string;
|
|
24
26
|
/**
|
|
25
27
|
* The pill glides under the hovered segment and springs back on leave (the
|
|
26
28
|
* default, as in LpTabs). False pins it to the selected segment and hover
|
|
@@ -38,6 +40,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
38
40
|
/** Stretch to fill the container with equal-width segments. */
|
|
39
41
|
block?: boolean;
|
|
40
42
|
disabled?: boolean;
|
|
43
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
44
|
+
error?: string;
|
|
41
45
|
/**
|
|
42
46
|
* The pill glides under the hovered segment and springs back on leave (the
|
|
43
47
|
* default, as in LpTabs). False pins it to the selected segment and hover
|
|
@@ -30,6 +30,8 @@ declare const __VLS_export: <V extends SelectValue = string>(__VLS_props: NonNul
|
|
|
30
30
|
clearable?: boolean;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
invalid?: boolean;
|
|
33
|
+
/** A message under the select, as on LpInput: it marks the select invalid (what `form.field()` hands it). */
|
|
34
|
+
error?: string;
|
|
33
35
|
emptyText?: string;
|
|
34
36
|
searchTerm?: string;
|
|
35
37
|
loading?: boolean;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
26
26
|
}> & Readonly<{}>, {
|
|
27
27
|
as: string;
|
|
28
28
|
speed: number;
|
|
29
|
+
paused: boolean;
|
|
29
30
|
variant: "shine" | "gradient";
|
|
30
31
|
tone: ToneName | "ink";
|
|
31
|
-
paused: boolean;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
33
33
|
default?: (props: {}) => any;
|
|
34
34
|
}>;
|
|
@@ -191,8 +191,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
191
191
|
}>, {
|
|
192
192
|
maxWidth: number;
|
|
193
193
|
minWidth: number;
|
|
194
|
-
variant: "rail" | "panel";
|
|
195
194
|
compact: boolean;
|
|
195
|
+
variant: "rail" | "panel";
|
|
196
196
|
previewDelay: number;
|
|
197
197
|
skeletonRows: number;
|
|
198
198
|
skeletonHeader: boolean;
|
|
@@ -9,6 +9,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
9
9
|
max?: number;
|
|
10
10
|
step?: number;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
13
|
+
error?: string;
|
|
12
14
|
/** Accessible name for the thumb when there's no visible label. */
|
|
13
15
|
ariaLabel?: string;
|
|
14
16
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -22,6 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
22
24
|
max?: number;
|
|
23
25
|
step?: number;
|
|
24
26
|
disabled?: boolean;
|
|
27
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
28
|
+
error?: string;
|
|
25
29
|
/** Accessible name for the thumb when there's no visible label. */
|
|
26
30
|
ariaLabel?: string;
|
|
27
31
|
}> & Readonly<{
|
|
@@ -6,6 +6,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
6
6
|
palette?: PaletteControlOptions;
|
|
7
7
|
modelValue?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
10
|
+
error?: string;
|
|
9
11
|
label?: string;
|
|
10
12
|
/** Secondary line under the label. */
|
|
11
13
|
description?: string;
|
|
@@ -31,6 +33,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
33
|
palette?: PaletteControlOptions;
|
|
32
34
|
modelValue?: boolean;
|
|
33
35
|
disabled?: boolean;
|
|
36
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
37
|
+
error?: string;
|
|
34
38
|
label?: string;
|
|
35
39
|
/** Secondary line under the label. */
|
|
36
40
|
description?: string;
|
|
@@ -2,7 +2,7 @@ import { defineComponent, computed, useAttrs, ref, shallowRef, watch, onMounted,
|
|
|
2
2
|
import { usePaletteScope, suppressPaletteDiscovery, usePaletteCommands } from "../composables/usePaletteCommands.js";
|
|
3
3
|
import { menuPaletteCommands } from "./commandPalette.js";
|
|
4
4
|
import { _ as _sfc_main$1 } from "../chunks/LpDataList-CaVfsozH.js";
|
|
5
|
-
import { _ as _sfc_main$9 } from "../chunks/LpCheckbox-
|
|
5
|
+
import { _ as _sfc_main$9 } from "../chunks/LpCheckbox-CCWCwD0y.js";
|
|
6
6
|
import { _ as _sfc_main$8 } from "../chunks/LpContextMenu-Bx_IhQDS.js";
|
|
7
7
|
import { _ as _sfc_main$e } from "../chunks/LpEditable-DVT0Rh8F.js";
|
|
8
8
|
import { _ as _sfc_main$d } from "../chunks/LpEmptyState-DurPF001.js";
|
|
@@ -14,7 +14,7 @@ import { _ as _sfc_main$a } from "../chunks/LpPopover-BQSuxtai.js";
|
|
|
14
14
|
import { _ as _sfc_main$7 } from "../chunks/LpScrollArea-CqvwfZs2.js";
|
|
15
15
|
import { _ as _sfc_main$6 } from "../chunks/LpRollingText-B54Pje7P.js";
|
|
16
16
|
import { _ as _sfc_main$4 } from "../chunks/LpShift-DAgS_d2x.js";
|
|
17
|
-
import { _ as _sfc_main$b } from "../chunks/LpTableFilter-
|
|
17
|
+
import { _ as _sfc_main$b } from "../chunks/LpTableFilter-CJg5eIcV.js";
|
|
18
18
|
import { useKitStorage } from "../composables/usePersisted.js";
|
|
19
19
|
import { useAsyncTask } from "../composables/useAsyncTask.js";
|
|
20
20
|
import { useTableFacets } from "./tableFacets.js";
|
|
@@ -76,9 +76,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
76
76
|
}>, {
|
|
77
77
|
history: boolean;
|
|
78
78
|
block: boolean;
|
|
79
|
-
variant: "contained" | "plain" | "underline" | "bottom";
|
|
80
79
|
accent: boolean;
|
|
81
80
|
compact: boolean;
|
|
81
|
+
variant: "contained" | "plain" | "underline" | "bottom";
|
|
82
82
|
hoverFollow: boolean;
|
|
83
83
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
84
84
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -8,6 +8,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
8
8
|
modelValue?: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
invalid?: boolean;
|
|
11
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
12
|
+
error?: string;
|
|
11
13
|
size?: "sm" | "md" | "lg";
|
|
12
14
|
/** 24 or 12-hour clock, independent of the browser locale. */
|
|
13
15
|
hourCycle?: 12 | 24;
|
|
@@ -25,6 +27,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
25
27
|
modelValue?: string;
|
|
26
28
|
disabled?: boolean;
|
|
27
29
|
invalid?: boolean;
|
|
30
|
+
/** A message under the control, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
31
|
+
error?: string;
|
|
28
32
|
size?: "sm" | "md" | "lg";
|
|
29
33
|
/** 24 or 12-hour clock, independent of the browser locale. */
|
|
30
34
|
hourCycle?: 12 | 24;
|
|
@@ -23,6 +23,8 @@ export interface PickerFieldProps {
|
|
|
23
23
|
clearable?: boolean;
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
invalid?: boolean;
|
|
26
|
+
/** A message under the picker, as on LpInput: it marks it invalid and shows under it (what `form.field()` hands it). */
|
|
27
|
+
error?: string;
|
|
26
28
|
size?: "sm" | "md" | "lg";
|
|
27
29
|
/** Locale of the shown date and the calendar; defaults to reka's ConfigProvider, then the browser. */
|
|
28
30
|
locale?: string;
|
|
@@ -80,6 +80,56 @@ export declare function fieldWrapperBinds(wrapped: boolean, field: {
|
|
|
80
80
|
class: unknown;
|
|
81
81
|
style: unknown;
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Whether a control with these props draws its own LpFormField. A label or a
|
|
85
|
+
* hint is its own; an error alone is, except inside an outer LpFormField, which
|
|
86
|
+
* owns the label (its `for` points at the control) and the message line: a
|
|
87
|
+
* second field in it showed the message twice and took the label's control id.
|
|
88
|
+
* There the error only marks the control invalid.
|
|
89
|
+
*/
|
|
90
|
+
export declare function wrapsItself(own: {
|
|
91
|
+
label?: string;
|
|
92
|
+
hint?: string;
|
|
93
|
+
error?: string;
|
|
94
|
+
}, outer: ComputedRef<FieldContext> | null): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* A control that takes `label`, `hint` and `error` the way LpInput does: given
|
|
97
|
+
* any of them it wraps itself in LpFormField (FieldWrapper, bound to
|
|
98
|
+
* `wrapper`), an error marks it invalid, and the consumer's class and style lay
|
|
99
|
+
* out that field instead of the control (`ownAttrs` says whether the control's
|
|
100
|
+
* root still takes them). Without them it is the bare control, as before. So
|
|
101
|
+
* `v-bind="form.field('x')"`, which hands every control `error`, shows the
|
|
102
|
+
* message on any of them.
|
|
103
|
+
* Inside an outer LpFormField an error alone does not wrap (wrapsItself).
|
|
104
|
+
*/
|
|
105
|
+
export declare function useOwnField(state: () => {
|
|
106
|
+
label?: string;
|
|
107
|
+
hint?: string;
|
|
108
|
+
error?: string;
|
|
109
|
+
required?: boolean;
|
|
110
|
+
invalid?: boolean;
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
id?: string;
|
|
113
|
+
}): {
|
|
114
|
+
wrapped: ComputedRef<boolean>;
|
|
115
|
+
field: ComputedRef<Omit<FieldContext, "id"> & {
|
|
116
|
+
id?: string;
|
|
117
|
+
}>;
|
|
118
|
+
wrapper: ComputedRef<{
|
|
119
|
+
wrapped: boolean;
|
|
120
|
+
id: string | undefined;
|
|
121
|
+
label: string | undefined;
|
|
122
|
+
hint: string | undefined;
|
|
123
|
+
error: string | undefined;
|
|
124
|
+
required: boolean | undefined;
|
|
125
|
+
class: unknown;
|
|
126
|
+
style: unknown;
|
|
127
|
+
}>;
|
|
128
|
+
controlAttrs: ComputedRef<{
|
|
129
|
+
[x: string]: unknown;
|
|
130
|
+
}>;
|
|
131
|
+
ownAttrs: () => boolean;
|
|
132
|
+
};
|
|
83
133
|
/** The state of a control that takes its id from the app and draws no wrapper of its own. */
|
|
84
134
|
export declare function useAttrsField(state: () => {
|
|
85
135
|
invalid?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useId, computed, provide,
|
|
1
|
+
import { inject, useId, computed, provide, useAttrs, onScopeDispose } from "vue";
|
|
2
2
|
import { isElement } from "./realm.js";
|
|
3
3
|
const LP_FIELD = /* @__PURE__ */ Symbol.for("lp-field");
|
|
4
4
|
function provideField(context) {
|
|
@@ -74,6 +74,33 @@ function fieldWrapperBinds(wrapped, field, props, attrs) {
|
|
|
74
74
|
const { label, hint, error, required } = props;
|
|
75
75
|
return { wrapped, id: field.id, label, hint, error, required, class: attrs.class, style: attrs.style };
|
|
76
76
|
}
|
|
77
|
+
function wrapsItself(own, outer) {
|
|
78
|
+
if (own.label || own.hint) return true;
|
|
79
|
+
return !!own.error && !outer?.value;
|
|
80
|
+
}
|
|
81
|
+
function useOwnField(state) {
|
|
82
|
+
const attrs = useAttrs();
|
|
83
|
+
const outer = useField();
|
|
84
|
+
const wrapped = computed(() => wrapsItself(state(), outer));
|
|
85
|
+
const field = useFieldControl(() => {
|
|
86
|
+
const own = state();
|
|
87
|
+
return {
|
|
88
|
+
wrapped: wrapped.value,
|
|
89
|
+
hasMessage: !!own.error || !!own.hint,
|
|
90
|
+
id: own.id ?? (typeof attrs.id === "string" ? attrs.id : void 0),
|
|
91
|
+
invalid: !!own.invalid || !!own.error,
|
|
92
|
+
required: own.required,
|
|
93
|
+
disabled: own.disabled
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const wrapper = computed(() => fieldWrapperBinds(wrapped.value, field.value, state(), attrs));
|
|
97
|
+
const controlAttrs = computed(() => {
|
|
98
|
+
if (!wrapped.value) return attrs;
|
|
99
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
100
|
+
return rest;
|
|
101
|
+
});
|
|
102
|
+
return { wrapped, field, wrapper, controlAttrs, ownAttrs: () => !wrapped.value };
|
|
103
|
+
}
|
|
77
104
|
function useAttrsField(state) {
|
|
78
105
|
const attrs = useAttrs();
|
|
79
106
|
const field = useFieldControl(() => ({
|
|
@@ -94,5 +121,7 @@ export {
|
|
|
94
121
|
useAttrsField,
|
|
95
122
|
useField,
|
|
96
123
|
useFieldBlur,
|
|
97
|
-
useFieldControl
|
|
124
|
+
useFieldControl,
|
|
125
|
+
useOwnField,
|
|
126
|
+
wrapsItself
|
|
98
127
|
};
|
|
@@ -13,7 +13,9 @@ import { type ComputedRef, type MaybeRefOrGetter } from "vue";
|
|
|
13
13
|
* Pair it with `inheritAttrs: false` (and bind the rest of `$attrs` yourself)
|
|
14
14
|
* so the raw `class` does not land on the element a second time, unmerged.
|
|
15
15
|
*/
|
|
16
|
-
export declare function useMergedClass(own: MaybeRefOrGetter<string | undefined
|
|
16
|
+
export declare function useMergedClass(own: MaybeRefOrGetter<string | undefined>,
|
|
17
|
+
/** False while something else takes the consumer's class (a field wrapper). */
|
|
18
|
+
takesAttrs?: () => boolean): ComputedRef<string>;
|
|
17
19
|
/**
|
|
18
20
|
* `useMergedClass` plus the rest of `$attrs`, for the common `inheritAttrs:
|
|
19
21
|
* false` shape: bind `class` and `attrs` and the consumer's `class` lands once,
|
|
@@ -30,7 +32,9 @@ export declare function useMergedClass(own: MaybeRefOrGetter<string | undefined>
|
|
|
30
32
|
* Vue appends that second `class` to the merged one, and stylesheet order —
|
|
31
33
|
* not the caller — decides which wins.
|
|
32
34
|
*/
|
|
33
|
-
export declare function useMergedAttrs(own: MaybeRefOrGetter<string | undefined
|
|
35
|
+
export declare function useMergedAttrs(own: MaybeRefOrGetter<string | undefined>,
|
|
36
|
+
/** False while a field wrapper takes the consumer's class and style (useOwnField's `ownAttrs`). */
|
|
37
|
+
takesAttrs?: () => boolean): {
|
|
34
38
|
class: ComputedRef<string>;
|
|
35
39
|
attrs: ComputedRef<Record<string, unknown>>;
|
|
36
40
|
};
|
|
@@ -14,17 +14,17 @@ function merge(...classes) {
|
|
|
14
14
|
const joined = cx(...classes);
|
|
15
15
|
return joined ? kitMerge(joined) : "";
|
|
16
16
|
}
|
|
17
|
-
function useMergedClass(own) {
|
|
17
|
+
function useMergedClass(own, takesAttrs = () => true) {
|
|
18
18
|
const attrs = useAttrs();
|
|
19
|
-
return computed(() => merge(toValue(own), attrs.class));
|
|
19
|
+
return computed(() => merge(toValue(own), takesAttrs() ? attrs.class : void 0));
|
|
20
20
|
}
|
|
21
|
-
function useMergedAttrs(own) {
|
|
21
|
+
function useMergedAttrs(own, takesAttrs = () => true) {
|
|
22
22
|
const attrs = useAttrs();
|
|
23
23
|
return {
|
|
24
|
-
class: useMergedClass(own),
|
|
24
|
+
class: useMergedClass(own, takesAttrs),
|
|
25
25
|
attrs: computed(() => {
|
|
26
|
-
const { class: _omitted, ...rest } = attrs;
|
|
27
|
-
return rest;
|
|
26
|
+
const { class: _omitted, style, ...rest } = attrs;
|
|
27
|
+
return takesAttrs() ? { ...rest, ...style === void 0 ? {} : { style } } : rest;
|
|
28
28
|
})
|
|
29
29
|
};
|
|
30
30
|
}
|