@frontile/forms 0.18.0-alpha.2 → 0.18.0-alpha.20
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/declarations/index.d.ts +1 -17
- package/declarations/template-registry.d.ts +1 -15
- package/declarations/test-support.d.ts +1 -2
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/dist/test-support.js +1 -1336
- package/dist/test-support.js.map +1 -1
- package/package.json +15 -41
- package/declarations/components/checkbox-group.d.ts +0 -42
- package/declarations/components/checkbox.d.ts +0 -40
- package/declarations/components/field-types.d.ts +0 -14
- package/declarations/components/field.d.ts +0 -85
- package/declarations/components/form-control.d.ts +0 -47
- package/declarations/components/form-description.d.ts +0 -18
- package/declarations/components/form-feedback.d.ts +0 -22
- package/declarations/components/form.d.ts +0 -254
- package/declarations/components/icons.d.ts +0 -7
- package/declarations/components/input.d.ts +0 -145
- package/declarations/components/label.d.ts +0 -40
- package/declarations/components/native-select.d.ts +0 -154
- package/declarations/components/radio-group.d.ts +0 -43
- package/declarations/components/radio.d.ts +0 -41
- package/declarations/components/select.d.ts +0 -531
- package/declarations/components/switch.d.ts +0 -152
- package/declarations/components/textarea.d.ts +0 -69
- package/declarations/utils/index.d.ts +0 -3
- package/declarations/utils/nested-data.d.ts +0 -44
- package/declarations/utils/standard-validator.d.ts +0 -151
- package/dist/_app_/components/checkbox-group.js +0 -1
- package/dist/_app_/components/checkbox.js +0 -1
- package/dist/_app_/components/field-types.js +0 -1
- package/dist/_app_/components/field.js +0 -1
- package/dist/_app_/components/form-control.js +0 -1
- package/dist/_app_/components/form-description.js +0 -1
- package/dist/_app_/components/form-feedback.js +0 -1
- package/dist/_app_/components/form.js +0 -1
- package/dist/_app_/components/icons.js +0 -1
- package/dist/_app_/components/input.js +0 -1
- package/dist/_app_/components/label.js +0 -1
- package/dist/_app_/components/native-select.js +0 -1
- package/dist/_app_/components/radio-group.js +0 -1
- package/dist/_app_/components/radio.js +0 -1
- package/dist/_app_/components/select.js +0 -1
- package/dist/_app_/components/switch.js +0 -1
- package/dist/_app_/components/textarea.js +0 -1
- package/dist/components/checkbox-group.js +0 -29
- package/dist/components/checkbox-group.js.map +0 -1
- package/dist/components/checkbox.js +0 -50
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/field-types.js +0 -2
- package/dist/components/field-types.js.map +0 -1
- package/dist/components/field.js +0 -103
- package/dist/components/field.js.map +0 -1
- package/dist/components/form-control.js +0 -61
- package/dist/components/form-control.js.map +0 -1
- package/dist/components/form-description.js +0 -24
- package/dist/components/form-description.js.map +0 -1
- package/dist/components/form-feedback.js +0 -36
- package/dist/components/form-feedback.js.map +0 -1
- package/dist/components/form.js +0 -13
- package/dist/components/form.js.map +0 -1
- package/dist/components/icons.js +0 -13
- package/dist/components/icons.js.map +0 -1
- package/dist/components/input.js +0 -106
- package/dist/components/input.js.map +0 -1
- package/dist/components/label.js +0 -23
- package/dist/components/label.js.map +0 -1
- package/dist/components/native-select.js +0 -134
- package/dist/components/native-select.js.map +0 -1
- package/dist/components/radio-group.js +0 -29
- package/dist/components/radio-group.js.map +0 -1
- package/dist/components/radio.js +0 -49
- package/dist/components/radio.js.map +0 -1
- package/dist/components/select.js +0 -386
- package/dist/components/select.js.map +0 -1
- package/dist/components/switch.js +0 -63
- package/dist/components/switch.js.map +0 -1
- package/dist/components/textarea.js +0 -53
- package/dist/components/textarea.js.map +0 -1
- package/dist/form-CVuJDJUq.js +0 -726
- package/dist/form-CVuJDJUq.js.map +0 -1
- package/dist/index-6gTa9ocT.js +0 -23
- package/dist/index-6gTa9ocT.js.map +0 -1
- package/dist/index-CeaQc-U7.js +0 -23
- package/dist/index-CeaQc-U7.js.map +0 -1
- package/dist/runtime-BPCpkOf1-B5Lbloj7.js +0 -67
- package/dist/runtime-BPCpkOf1-B5Lbloj7.js.map +0 -1
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { type LabelSlots, type LabelVariants, type SlotsToClasses } from '@frontile/theme';
|
|
3
|
-
interface LabelSignature {
|
|
4
|
-
Args: {
|
|
5
|
-
/**
|
|
6
|
-
* The 'for' attribute of a <label>.
|
|
7
|
-
*/
|
|
8
|
-
for?: string;
|
|
9
|
-
size?: LabelVariants['size'];
|
|
10
|
-
classes?: SlotsToClasses<LabelSlots>;
|
|
11
|
-
/**
|
|
12
|
-
* The class name to be passed to the label base slot.
|
|
13
|
-
*/
|
|
14
|
-
class?: string;
|
|
15
|
-
isRequired?: boolean;
|
|
16
|
-
};
|
|
17
|
-
Element: HTMLLabelElement;
|
|
18
|
-
Blocks: {
|
|
19
|
-
default: [];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
declare class Label extends Component<LabelSignature> {
|
|
23
|
-
get classes(): {
|
|
24
|
-
base: (slotProps?: ({
|
|
25
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
26
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
27
|
-
asterisk: (slotProps?: ({
|
|
28
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
29
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
30
|
-
} & {
|
|
31
|
-
base: (slotProps?: ({
|
|
32
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
33
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
34
|
-
asterisk: (slotProps?: ({
|
|
35
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
36
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
37
|
-
} & {};
|
|
38
|
-
}
|
|
39
|
-
export { Label, type LabelSignature };
|
|
40
|
-
export default Label;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import type Owner from '@ember/owner';
|
|
3
|
-
import { type NativeSelectSlots, type NativeSelectVariants, type SlotsToClasses } from '@frontile/theme';
|
|
4
|
-
import { type FormControlSharedArgs } from './form-control';
|
|
5
|
-
import { ListManager, type ListItem } from '@frontile/collections/utils/listManager';
|
|
6
|
-
import type { WithBoundArgs } from '@glint/template';
|
|
7
|
-
type ItemCompBounded = WithBoundArgs<typeof NativeSelectItem, 'manager'>;
|
|
8
|
-
interface BaseArgs<T> extends FormControlSharedArgs {
|
|
9
|
-
disabledKeys?: string[];
|
|
10
|
-
allowEmpty?: boolean;
|
|
11
|
-
items?: T[];
|
|
12
|
-
id?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
size?: NativeSelectVariants['size'];
|
|
15
|
-
classes?: SlotsToClasses<NativeSelectSlots>;
|
|
16
|
-
/**
|
|
17
|
-
* Placeholder text used when `allowEmpty` is set to `true`.
|
|
18
|
-
*/
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
onAction?: (key: string) => void;
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
onItemsChange?: (items: ListItem[], action: 'add' | 'remove') => void;
|
|
25
|
-
/**
|
|
26
|
-
* Controls pointer-events property of startContent.
|
|
27
|
-
* If you want to pass the click event to the input, set it to `none`.
|
|
28
|
-
*
|
|
29
|
-
* @defaultValue 'auto'
|
|
30
|
-
*/
|
|
31
|
-
startContentPointerEvents?: 'none' | 'auto';
|
|
32
|
-
/**
|
|
33
|
-
* Controls pointer-events property of endContent.
|
|
34
|
-
* Defauled to `none` to pass the click event to the input. If your content
|
|
35
|
-
* needs to capture events, consider adding `pointer-events-auto` class to that
|
|
36
|
-
* element only.
|
|
37
|
-
*
|
|
38
|
-
* @defaultValue 'none'
|
|
39
|
-
*/
|
|
40
|
-
endContentPointerEvents?: 'none' | 'auto';
|
|
41
|
-
}
|
|
42
|
-
interface SingleNativeSelectArgs<T> extends BaseArgs<T> {
|
|
43
|
-
selectionMode?: 'single' | undefined;
|
|
44
|
-
selectedKey?: string | null;
|
|
45
|
-
selectedKeys?: never;
|
|
46
|
-
onSelectionChange?: (key: string | null) => void;
|
|
47
|
-
}
|
|
48
|
-
interface MultipleNativeSelectArgs<T> extends BaseArgs<T> {
|
|
49
|
-
selectionMode: 'multiple';
|
|
50
|
-
selectedKey?: never;
|
|
51
|
-
selectedKeys?: string[];
|
|
52
|
-
onSelectionChange?: (keys: string[]) => void;
|
|
53
|
-
}
|
|
54
|
-
type Args<T> = SingleNativeSelectArgs<T> | MultipleNativeSelectArgs<T>;
|
|
55
|
-
interface NativeSelectSignature<T> {
|
|
56
|
-
Args: Args<T>;
|
|
57
|
-
Element: HTMLSelectElement;
|
|
58
|
-
Blocks: {
|
|
59
|
-
item: [{
|
|
60
|
-
item: T;
|
|
61
|
-
key: string;
|
|
62
|
-
label: string;
|
|
63
|
-
Item: ItemCompBounded;
|
|
64
|
-
}];
|
|
65
|
-
default: [{
|
|
66
|
-
Item: ItemCompBounded;
|
|
67
|
-
}];
|
|
68
|
-
startContent: [];
|
|
69
|
-
endContent: [];
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
declare class NativeSelect<T = unknown> extends Component<NativeSelectSignature<T>> {
|
|
73
|
-
constructor(owner: Owner, args: Args<T>);
|
|
74
|
-
validateArgs(): void;
|
|
75
|
-
get normalizedSelectedKeys(): string[];
|
|
76
|
-
listManager: ListManager;
|
|
77
|
-
handleSelectionChange(keys: string[]): void;
|
|
78
|
-
get classes(): {
|
|
79
|
-
base: (slotProps?: ({
|
|
80
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
81
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
82
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
83
|
-
hasStartContent?: boolean | undefined;
|
|
84
|
-
hasEndContent?: boolean | undefined;
|
|
85
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
86
|
-
innerContainer: (slotProps?: ({
|
|
87
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
88
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
89
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
90
|
-
hasStartContent?: boolean | undefined;
|
|
91
|
-
hasEndContent?: boolean | undefined;
|
|
92
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
93
|
-
startContent: (slotProps?: ({
|
|
94
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
95
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
96
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
97
|
-
hasStartContent?: boolean | undefined;
|
|
98
|
-
hasEndContent?: boolean | undefined;
|
|
99
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
100
|
-
endContent: (slotProps?: ({
|
|
101
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
102
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
103
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
104
|
-
hasStartContent?: boolean | undefined;
|
|
105
|
-
hasEndContent?: boolean | undefined;
|
|
106
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
107
|
-
input: (slotProps?: ({
|
|
108
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
109
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
110
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
111
|
-
hasStartContent?: boolean | undefined;
|
|
112
|
-
hasEndContent?: boolean | undefined;
|
|
113
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
114
|
-
} & {
|
|
115
|
-
input: (slotProps?: ({
|
|
116
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
117
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
118
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
119
|
-
hasStartContent?: boolean | undefined;
|
|
120
|
-
hasEndContent?: boolean | undefined;
|
|
121
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
122
|
-
icon: (slotProps?: ({
|
|
123
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
124
|
-
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
125
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
126
|
-
hasStartContent?: boolean | undefined;
|
|
127
|
-
hasEndContent?: boolean | undefined;
|
|
128
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
129
|
-
} & {};
|
|
130
|
-
get isMultiple(): boolean;
|
|
131
|
-
handleOnChange(event: Event): void;
|
|
132
|
-
}
|
|
133
|
-
export interface SelectItemSignature {
|
|
134
|
-
Args: {
|
|
135
|
-
manager: ListManager;
|
|
136
|
-
key: string;
|
|
137
|
-
textValue?: string;
|
|
138
|
-
};
|
|
139
|
-
Element: HTMLOptionElement;
|
|
140
|
-
Blocks: {
|
|
141
|
-
default: [];
|
|
142
|
-
selectedIcon: [];
|
|
143
|
-
start: [];
|
|
144
|
-
end: [];
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
declare class NativeSelectItem extends Component<SelectItemSignature> {
|
|
148
|
-
listItem?: ListItem;
|
|
149
|
-
get manager(): ListManager;
|
|
150
|
-
get key(): string;
|
|
151
|
-
onRegister(item: ListItem): void;
|
|
152
|
-
}
|
|
153
|
-
export { NativeSelect, type NativeSelectSignature, type ListItem };
|
|
154
|
-
export default NativeSelect;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { Radio, type RadioSignature } from './radio';
|
|
3
|
-
import { type FormControlSharedArgs } from './form-control';
|
|
4
|
-
import { type RadioGroupSlots, type RadioVariants, type SlotsToClasses } from '@frontile/theme';
|
|
5
|
-
import type { WithBoundArgs } from '@glint/template';
|
|
6
|
-
interface Args<T> extends FormControlSharedArgs {
|
|
7
|
-
name?: string;
|
|
8
|
-
value?: T;
|
|
9
|
-
onChange?: RadioSignature<T>['Args']['onChange'];
|
|
10
|
-
size?: RadioVariants['size'];
|
|
11
|
-
classes?: SlotsToClasses<RadioGroupSlots>;
|
|
12
|
-
orientation?: 'horizontal' | 'vertical';
|
|
13
|
-
}
|
|
14
|
-
interface RadioGroupSignature<T> {
|
|
15
|
-
Args: Args<T>;
|
|
16
|
-
Blocks: {
|
|
17
|
-
default: [
|
|
18
|
-
Radio: WithBoundArgs<typeof Radio, 'name' | 'onChange' | 'checkedValue' | 'isDisabled'>
|
|
19
|
-
];
|
|
20
|
-
};
|
|
21
|
-
Element: HTMLDivElement;
|
|
22
|
-
}
|
|
23
|
-
declare class RadioGroup<T extends string | number | boolean> extends Component<RadioGroupSignature<T>> {
|
|
24
|
-
get classes(): {
|
|
25
|
-
base: (slotProps?: ({
|
|
26
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
27
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
28
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
29
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
30
|
-
optionsContainer: (slotProps?: ({
|
|
31
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
32
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
33
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
34
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
35
|
-
label: (slotProps?: ({
|
|
36
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
37
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
38
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
39
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
40
|
-
} & {} & {};
|
|
41
|
-
}
|
|
42
|
-
export { RadioGroup, type RadioGroupSignature };
|
|
43
|
-
export default RadioGroup;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { type FormControlSharedArgs } from './form-control';
|
|
3
|
-
import { type SlotsToClasses, type RadioVariants, type RadioSlots } from '@frontile/theme';
|
|
4
|
-
interface Args<T> extends FormControlSharedArgs {
|
|
5
|
-
value: T;
|
|
6
|
-
checkedValue?: T | undefined | null;
|
|
7
|
-
name?: string;
|
|
8
|
-
size?: RadioVariants['size'];
|
|
9
|
-
classes?: SlotsToClasses<RadioSlots>;
|
|
10
|
-
onChange?: (value: T, event: Event) => void;
|
|
11
|
-
onBlur?: () => void;
|
|
12
|
-
}
|
|
13
|
-
interface RadioSignature<T> {
|
|
14
|
-
Args: Args<T>;
|
|
15
|
-
Element: HTMLInputElement;
|
|
16
|
-
}
|
|
17
|
-
declare class Radio<T extends string | boolean | number> extends Component<RadioSignature<T>> {
|
|
18
|
-
get isChecked(): boolean;
|
|
19
|
-
handleChange(event: Event): void;
|
|
20
|
-
handleBlur(): void;
|
|
21
|
-
get classes(): {
|
|
22
|
-
base: (slotProps?: ({
|
|
23
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
24
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
25
|
-
input: (slotProps?: ({
|
|
26
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
27
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
28
|
-
labelContainer: (slotProps?: ({
|
|
29
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
30
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
31
|
-
label: (slotProps?: ({
|
|
32
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
33
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
34
|
-
} & {
|
|
35
|
-
input: (slotProps?: ({
|
|
36
|
-
size?: "sm" | "md" | "lg" | undefined;
|
|
37
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
38
|
-
} & {};
|
|
39
|
-
}
|
|
40
|
-
export { Radio, type RadioSignature };
|
|
41
|
-
export default Radio;
|