@plexui/vue 0.5.2 → 0.6.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.
- package/dist/es/components/Badge/Badge.js +25 -8
- package/dist/es/components/Badge/Badge.js.map +1 -1
- package/dist/es/components/Field/Field.js +3 -0
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/Input/Input.js +4 -2
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/InputGroup/InputGroup.js +6 -4
- package/dist/es/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/es/components/Select/Select.js +9 -6
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/lib/fieldRow.js +15 -0
- package/dist/es/lib/fieldRow.js.map +1 -0
- package/dist/types/components/Badge/Badge.d.ts +31 -5
- package/dist/types/components/Field/Field.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +2 -2
- package/dist/types/components/InputGroup/InputGroup.d.ts +4 -4
- package/dist/types/components/Select/Select.d.ts +4 -4
- package/dist/types/lib/fieldRow.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { computed, inject, provide } from "vue";
|
|
2
|
+
// Vue port of packages/ui/src/lib/fieldRow.ts.
|
|
3
|
+
/**
|
|
4
|
+
* True in a `Field row` whose control ends the row. It stands there beside
|
|
5
|
+
* buttons and tags, so it takes their shape; a field with its label above stays
|
|
6
|
+
* rounded.
|
|
7
|
+
*/
|
|
8
|
+
const FieldRowKey = Symbol("PlexUIFieldRow");
|
|
9
|
+
export const provideFieldRow = (inRow) => provide(FieldRowKey, computed(inRow));
|
|
10
|
+
/** The control's own `pill`, or else the shape of its row. */
|
|
11
|
+
export const useFieldRowPill = (pill) => {
|
|
12
|
+
const inRow = inject(FieldRowKey, null);
|
|
13
|
+
return computed(() => pill() ?? inRow?.value ?? false);
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=fieldRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldRow.js","sourceRoot":"","sources":["../../../src/lib/fieldRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAuC,MAAM,KAAK,CAAA;AAEpF,+CAA+C;AAE/C;;;;GAIG;AACH,MAAM,WAAW,GAAuC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAE9F,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAA+B,EAAE,EAAE;IACjE,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACvC,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,CAAA;AACxD,CAAC,CAAA","sourcesContent":["import { computed, inject, provide, type ComputedRef, type InjectionKey } from \"vue\"\n\n// Vue port of packages/ui/src/lib/fieldRow.ts.\n\n/**\n * True in a `Field row` whose control ends the row. It stands there beside\n * buttons and tags, so it takes their shape; a field with its label above stays\n * rounded.\n */\nconst FieldRowKey: InjectionKey<ComputedRef<boolean>> = Symbol(\"PlexUIFieldRow\")\n\nexport const provideFieldRow = (inRow: () => boolean) => provide(FieldRowKey, computed(inRow))\n\n/** The control's own `pill`, or else the shape of its row. */\nexport const useFieldRowPill = (pill: () => boolean | undefined) => {\n const inRow = inject(FieldRowKey, null)\n return computed(() => pill() ?? inRow?.value ?? false)\n}\n"]}
|
|
@@ -7,9 +7,9 @@ declare const BadgeComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
7
7
|
type: PropType<Variants<"solid" | "soft" | "outline">>;
|
|
8
8
|
default: string;
|
|
9
9
|
};
|
|
10
|
-
/** Size scale of the badge: `sm` 20px, `md` 22px, `lg` 24px. @default "sm" */
|
|
10
|
+
/** Size scale of the badge: `sm` 20px, `md` 22px, `lg` 24px, `xl` 32px. @default "sm" */
|
|
11
11
|
size: {
|
|
12
|
-
type: PropType<Sizes<"sm" | "md" | "lg">>;
|
|
12
|
+
type: PropType<Sizes<"sm" | "md" | "lg" | "xl">>;
|
|
13
13
|
default: string;
|
|
14
14
|
};
|
|
15
15
|
/** Determines if the badge should be a fully rounded pill shape. @default false */
|
|
@@ -22,6 +22,18 @@ declare const BadgeComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
22
22
|
type: PropType<BadgeColor>;
|
|
23
23
|
default: string;
|
|
24
24
|
};
|
|
25
|
+
/** Adds a cross at the end of the badge that calls this when pressed. */
|
|
26
|
+
onRemove: PropType<(event: MouseEvent) => void>;
|
|
27
|
+
/** Accessible name of the cross. @default "Remove" */
|
|
28
|
+
removeLabel: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
/** Shows the cross as a mark, for a badge inside a control that takes the press. @default false */
|
|
33
|
+
removable: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
25
37
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
38
|
[key: string]: any;
|
|
27
39
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -30,9 +42,9 @@ declare const BadgeComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
30
42
|
type: PropType<Variants<"solid" | "soft" | "outline">>;
|
|
31
43
|
default: string;
|
|
32
44
|
};
|
|
33
|
-
/** Size scale of the badge: `sm` 20px, `md` 22px, `lg` 24px. @default "sm" */
|
|
45
|
+
/** Size scale of the badge: `sm` 20px, `md` 22px, `lg` 24px, `xl` 32px. @default "sm" */
|
|
34
46
|
size: {
|
|
35
|
-
type: PropType<Sizes<"sm" | "md" | "lg">>;
|
|
47
|
+
type: PropType<Sizes<"sm" | "md" | "lg" | "xl">>;
|
|
36
48
|
default: string;
|
|
37
49
|
};
|
|
38
50
|
/** Determines if the badge should be a fully rounded pill shape. @default false */
|
|
@@ -45,11 +57,25 @@ declare const BadgeComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
45
57
|
type: PropType<BadgeColor>;
|
|
46
58
|
default: string;
|
|
47
59
|
};
|
|
60
|
+
/** Adds a cross at the end of the badge that calls this when pressed. */
|
|
61
|
+
onRemove: PropType<(event: MouseEvent) => void>;
|
|
62
|
+
/** Accessible name of the cross. @default "Remove" */
|
|
63
|
+
removeLabel: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
/** Shows the cross as a mark, for a badge inside a control that takes the press. @default false */
|
|
68
|
+
removable: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
48
72
|
}>> & Readonly<{}>, {
|
|
49
|
-
size: "sm" | "md" | "lg";
|
|
73
|
+
size: "sm" | "md" | "lg" | "xl";
|
|
50
74
|
color: "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning";
|
|
51
75
|
variant: "solid" | "soft" | "outline";
|
|
52
76
|
pill: boolean;
|
|
77
|
+
removeLabel: string;
|
|
78
|
+
removable: boolean;
|
|
53
79
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
80
|
type BadgeOwnProps = InstanceType<typeof BadgeComponent>["$props"];
|
|
55
81
|
/** Badge props plus the native <div> attributes that fall through to it, as in React. */
|
|
@@ -90,6 +90,8 @@ declare const FieldComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
90
90
|
default?: (fieldProps: FieldChildProps) => VNodeChild;
|
|
91
91
|
label?: () => VNodeChild;
|
|
92
92
|
labelAction?: () => VNodeChild;
|
|
93
|
+
/** On a `fill` row, a control at the end of the row, such as a button that adds to a list. */
|
|
94
|
+
action?: () => VNodeChild;
|
|
93
95
|
description?: () => VNodeChild;
|
|
94
96
|
errorMessage?: () => VNodeChild;
|
|
95
97
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -48,7 +48,7 @@ declare const InputComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
48
48
|
};
|
|
49
49
|
/** Shows the clear button while the input has a value; called when it is clicked. */
|
|
50
50
|
onClear: PropType<(event: MouseEvent) => void>;
|
|
51
|
-
/** Fully rounded pill shape. @default false */
|
|
51
|
+
/** Fully rounded pill shape. @default false, or true at the end of a `Field row` */
|
|
52
52
|
pill: {
|
|
53
53
|
type: BooleanConstructor;
|
|
54
54
|
default: undefined;
|
|
@@ -127,7 +127,7 @@ declare const InputComponent: import("vue").DefineComponent<import("vue").Extrac
|
|
|
127
127
|
};
|
|
128
128
|
/** Shows the clear button while the input has a value; called when it is clicked. */
|
|
129
129
|
onClear: PropType<(event: MouseEvent) => void>;
|
|
130
|
-
/** Fully rounded pill shape. @default false */
|
|
130
|
+
/** Fully rounded pill shape. @default false, or true at the end of a `Field row` */
|
|
131
131
|
pill: {
|
|
132
132
|
type: BooleanConstructor;
|
|
133
133
|
default: undefined;
|
|
@@ -12,10 +12,10 @@ declare const InputGroupComponent: import("vue").DefineComponent<import("vue").E
|
|
|
12
12
|
type: PropType<ControlSize>;
|
|
13
13
|
default: string;
|
|
14
14
|
};
|
|
15
|
-
/** Fully rounded group, with pill buttons inside. @default false */
|
|
15
|
+
/** Fully rounded group, with pill buttons inside. @default false, or true at the end of a `Field row` */
|
|
16
16
|
pill: {
|
|
17
17
|
type: BooleanConstructor;
|
|
18
|
-
default:
|
|
18
|
+
default: undefined;
|
|
19
19
|
};
|
|
20
20
|
/** Disables the control and the buttons inside the group. @default false */
|
|
21
21
|
disabled: {
|
|
@@ -40,10 +40,10 @@ declare const InputGroupComponent: import("vue").DefineComponent<import("vue").E
|
|
|
40
40
|
type: PropType<ControlSize>;
|
|
41
41
|
default: string;
|
|
42
42
|
};
|
|
43
|
-
/** Fully rounded group, with pill buttons inside. @default false */
|
|
43
|
+
/** Fully rounded group, with pill buttons inside. @default false, or true at the end of a `Field row` */
|
|
44
44
|
pill: {
|
|
45
45
|
type: BooleanConstructor;
|
|
46
|
-
default:
|
|
46
|
+
default: undefined;
|
|
47
47
|
};
|
|
48
48
|
/** Disables the control and the buttons inside the group. @default false */
|
|
49
49
|
disabled: {
|
|
@@ -104,10 +104,10 @@ declare const SelectComponent: import("vue").DefineComponent<import("vue").Extra
|
|
|
104
104
|
type: PropType<"soft" | "outline" | "ghost">;
|
|
105
105
|
default: string;
|
|
106
106
|
};
|
|
107
|
-
/** Fully rounded pill shape for the trigger. @default false */
|
|
107
|
+
/** Fully rounded pill shape for the trigger. @default false, or true at the end of a `Field row` */
|
|
108
108
|
pill: {
|
|
109
109
|
type: BooleanConstructor;
|
|
110
|
-
default:
|
|
110
|
+
default: undefined;
|
|
111
111
|
};
|
|
112
112
|
/** Size of the trigger: `3xs` 22px up to `3xl` 48px. @default "md" */
|
|
113
113
|
size: {
|
|
@@ -253,10 +253,10 @@ declare const SelectComponent: import("vue").DefineComponent<import("vue").Extra
|
|
|
253
253
|
type: PropType<"soft" | "outline" | "ghost">;
|
|
254
254
|
default: string;
|
|
255
255
|
};
|
|
256
|
-
/** Fully rounded pill shape for the trigger. @default false */
|
|
256
|
+
/** Fully rounded pill shape for the trigger. @default false, or true at the end of a `Field row` */
|
|
257
257
|
pill: {
|
|
258
258
|
type: BooleanConstructor;
|
|
259
|
-
default:
|
|
259
|
+
default: undefined;
|
|
260
260
|
};
|
|
261
261
|
/** Size of the trigger: `3xs` 22px up to `3xl` 48px. @default "md" */
|
|
262
262
|
size: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
export declare const provideFieldRow: (inRow: () => boolean) => void;
|
|
3
|
+
/** The control's own `pill`, or else the shape of its row. */
|
|
4
|
+
export declare const useFieldRowPill: (pill: () => boolean | undefined) => ComputedRef<boolean>;
|