@frontile/forms-legacy 0.17.0-alpha.12
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/LICENSE.md +9 -0
- package/README.md +37 -0
- package/addon-main.js +4 -0
- package/declarations/components/form-checkbox-group.d.ts +50 -0
- package/declarations/components/form-checkbox-group.d.ts.map +1 -0
- package/declarations/components/form-checkbox.d.ts +49 -0
- package/declarations/components/form-checkbox.d.ts.map +1 -0
- package/declarations/components/form-field/checkbox.d.ts +19 -0
- package/declarations/components/form-field/checkbox.d.ts.map +1 -0
- package/declarations/components/form-field/feedback.d.ts +21 -0
- package/declarations/components/form-field/feedback.d.ts.map +1 -0
- package/declarations/components/form-field/hint.d.ts +17 -0
- package/declarations/components/form-field/hint.d.ts.map +1 -0
- package/declarations/components/form-field/input.d.ts +21 -0
- package/declarations/components/form-field/input.d.ts.map +1 -0
- package/declarations/components/form-field/label.d.ts +17 -0
- package/declarations/components/form-field/label.d.ts.map +1 -0
- package/declarations/components/form-field/radio.d.ts +20 -0
- package/declarations/components/form-field/radio.d.ts.map +1 -0
- package/declarations/components/form-field/select.d.ts +38 -0
- package/declarations/components/form-field/select.d.ts.map +1 -0
- package/declarations/components/form-field/textarea.d.ts +19 -0
- package/declarations/components/form-field/textarea.d.ts.map +1 -0
- package/declarations/components/form-field.d.ts +38 -0
- package/declarations/components/form-field.d.ts.map +1 -0
- package/declarations/components/form-input.d.ts +64 -0
- package/declarations/components/form-input.d.ts.map +1 -0
- package/declarations/components/form-radio-group.d.ts +48 -0
- package/declarations/components/form-radio-group.d.ts.map +1 -0
- package/declarations/components/form-radio.d.ts +54 -0
- package/declarations/components/form-radio.d.ts.map +1 -0
- package/declarations/components/form-select.d.ts +51 -0
- package/declarations/components/form-select.d.ts.map +1 -0
- package/declarations/components/form-textarea.d.ts +17 -0
- package/declarations/components/form-textarea.d.ts.map +1 -0
- package/declarations/components/native-select.d.ts +65 -0
- package/declarations/components/native-select.d.ts.map +1 -0
- package/declarations/components/select.d.ts +51 -0
- package/declarations/components/select.d.ts.map +1 -0
- package/declarations/index.d.ts +2 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/template-registry.d.ts +33 -0
- package/declarations/template-registry.d.ts.map +1 -0
- package/dist/_app_/components/form-checkbox-group.js +1 -0
- package/dist/_app_/components/form-checkbox.js +1 -0
- package/dist/_app_/components/form-field/checkbox.js +1 -0
- package/dist/_app_/components/form-field/feedback.js +1 -0
- package/dist/_app_/components/form-field/hint.js +1 -0
- package/dist/_app_/components/form-field/input.js +1 -0
- package/dist/_app_/components/form-field/label.js +1 -0
- package/dist/_app_/components/form-field/radio.js +1 -0
- package/dist/_app_/components/form-field/textarea.js +1 -0
- package/dist/_app_/components/form-field.js +1 -0
- package/dist/_app_/components/form-input.js +1 -0
- package/dist/_app_/components/form-radio-group.js +1 -0
- package/dist/_app_/components/form-radio.js +1 -0
- package/dist/_app_/components/form-select.js +1 -0
- package/dist/_app_/components/form-textarea.js +1 -0
- package/dist/components/form-checkbox-group.js +77 -0
- package/dist/components/form-checkbox-group.js.map +1 -0
- package/dist/components/form-checkbox.js +59 -0
- package/dist/components/form-checkbox.js.map +1 -0
- package/dist/components/form-field/checkbox.js +38 -0
- package/dist/components/form-field/checkbox.js.map +1 -0
- package/dist/components/form-field/feedback.js +36 -0
- package/dist/components/form-field/feedback.js.map +1 -0
- package/dist/components/form-field/hint.js +24 -0
- package/dist/components/form-field/hint.js.map +1 -0
- package/dist/components/form-field/input.js +44 -0
- package/dist/components/form-field/input.js.map +1 -0
- package/dist/components/form-field/label.js +24 -0
- package/dist/components/form-field/label.js.map +1 -0
- package/dist/components/form-field/radio.js +37 -0
- package/dist/components/form-field/radio.js.map +1 -0
- package/dist/components/form-field/textarea.js +38 -0
- package/dist/components/form-field/textarea.js.map +1 -0
- package/dist/components/form-field.js +44 -0
- package/dist/components/form-field.js.map +1 -0
- package/dist/components/form-input.js +89 -0
- package/dist/components/form-input.js.map +1 -0
- package/dist/components/form-radio-group.js +77 -0
- package/dist/components/form-radio-group.js.map +1 -0
- package/dist/components/form-radio.js +63 -0
- package/dist/components/form-radio.js.map +1 -0
- package/dist/components/form-select.js +124 -0
- package/dist/components/form-select.js.map +1 -0
- package/dist/components/form-textarea.js +48 -0
- package/dist/components/form-textarea.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/template-registry.js +2 -0
- package/dist/template-registry.js.map +1 -0
- package/package.json +121 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @frontile/forms
|
|
2
|
+
|
|
3
|
+
Component Library for Ember Octane apps: Forms
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
- Ember.js v3.16 or above
|
|
8
|
+
- Ember CLI v2.13 or above
|
|
9
|
+
- Node.js v10 or above
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
ember install @frontile/forms
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Styles
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// tailwind.config.js
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
theme: {
|
|
24
|
+
// ...
|
|
25
|
+
},
|
|
26
|
+
plugins: [require('@frontile/forms/tailwind')]
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
Visit [frontile.dev](https://frontile.dev/) to read the docs
|
|
33
|
+
and see live demos.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
This project is licensed under the [MIT License](LICENSE.md).
|
package/addon-main.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import FormCheckbox from './form-checkbox';
|
|
3
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
4
|
+
export interface FormCheckboxGroupArgs {
|
|
5
|
+
/** The group label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** A help text to be displayed */
|
|
8
|
+
hint?: string;
|
|
9
|
+
/** If the form has been submitted, used to force displaying errors */
|
|
10
|
+
hasSubmitted?: boolean;
|
|
11
|
+
/** If has errors */
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
/** Force displaying errors */
|
|
14
|
+
showError?: boolean;
|
|
15
|
+
/** A list of errors or a single text describing the error */
|
|
16
|
+
errors?: string[] | string;
|
|
17
|
+
/** CSS classes to be added in the container element */
|
|
18
|
+
containerClass?: string;
|
|
19
|
+
/** The size */
|
|
20
|
+
size?: 'sm' | 'md' | 'lg';
|
|
21
|
+
/** If the Checkbox should be in one line */
|
|
22
|
+
isInline?: boolean;
|
|
23
|
+
/** Default callback added to the yielded FormCheckbox component, called when onchange is triggered */
|
|
24
|
+
onChange?: (value: unknown, event: Event) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface FormCheckboxGroupSignature {
|
|
27
|
+
Args: FormCheckboxGroupArgs;
|
|
28
|
+
Blocks: {
|
|
29
|
+
default: [
|
|
30
|
+
checkbox: WithBoundArgs<typeof FormCheckbox, 'privateContainerClass'> & WithBoundArgs<typeof FormCheckbox, '_parentOnChange'> & WithBoundArgs<typeof FormCheckbox, 'size'>,
|
|
31
|
+
api: {
|
|
32
|
+
onChange: (value: unknown, event: Event) => void;
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
};
|
|
36
|
+
Element: HTMLDivElement;
|
|
37
|
+
}
|
|
38
|
+
export default class FormCheckboxGroup extends Component<FormCheckboxGroupSignature> {
|
|
39
|
+
shouldShowErrorFeedback: boolean;
|
|
40
|
+
get showErrorFeedback(): boolean;
|
|
41
|
+
handleChange(value: unknown, event: Event): void;
|
|
42
|
+
get classes(): {
|
|
43
|
+
base: string;
|
|
44
|
+
label: string;
|
|
45
|
+
hint: string;
|
|
46
|
+
feedback: string;
|
|
47
|
+
formCheckbox: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=form-checkbox-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-checkbox-group.d.ts","sourceRoot":"","sources":["../../src/components/form-checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAI3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACv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input field label */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** A help text to be displayed */
|
|
6
|
+
hint?: string;
|
|
7
|
+
/**
|
|
8
|
+
* If the checkbox is checked.
|
|
9
|
+
* You must also pass `onChange` to update its value.
|
|
10
|
+
*/
|
|
11
|
+
checked: boolean;
|
|
12
|
+
/** The name of the checkbox */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** CSS classes to be added in the container element */
|
|
15
|
+
containerClass?: string;
|
|
16
|
+
/** The size */
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** Callback when onchange is triggered */
|
|
19
|
+
onChange: (value: boolean, event: Event) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Internal function for InputCheckboxGroup
|
|
22
|
+
* @ignore
|
|
23
|
+
**/
|
|
24
|
+
_parentOnChange?: (value: boolean, event: Event) => void;
|
|
25
|
+
/**
|
|
26
|
+
* CSS classes to be added in the container element
|
|
27
|
+
* @ignore
|
|
28
|
+
* */
|
|
29
|
+
privateContainerClass?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface FormCheckboxSignature {
|
|
32
|
+
Args: FormCheckboxArgs;
|
|
33
|
+
Element: HTMLInputElement;
|
|
34
|
+
Blocks: {
|
|
35
|
+
default: [];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export default class FormCheckbox extends Component<FormCheckboxSignature> {
|
|
39
|
+
handleChange(value: boolean, event: Event): void;
|
|
40
|
+
get classes(): {
|
|
41
|
+
base: string;
|
|
42
|
+
label: string;
|
|
43
|
+
inputContainer: string;
|
|
44
|
+
labelContainer: string;
|
|
45
|
+
hint: string;
|
|
46
|
+
checkbox: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=form-checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-checkbox.d.ts","sourceRoot":"","sources":["../../src/components/form-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjD;;;QAGI;IACJ,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEzD;;;SAGK;IACL,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IAChE,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAUxD,IAAI,OAAO;;;;;;;MA0BV;CA0DF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldCheckboxArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
name?: string;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
class?: string;
|
|
8
|
+
onChange?: (value: boolean, event: Event) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface FormFieldCheckboxSignature {
|
|
11
|
+
Args: FormFieldCheckboxArgs;
|
|
12
|
+
Element: HTMLInputElement;
|
|
13
|
+
}
|
|
14
|
+
export default class FormFieldCheckbox extends Component<FormFieldCheckboxSignature> {
|
|
15
|
+
get isChecked(): boolean;
|
|
16
|
+
handleChange(event: Event): void;
|
|
17
|
+
get classes(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAClF,IAAI,SAAS,IAAI,OAAO,CAEvB;IAEO,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAUxC,IAAI,OAAO,WAOV;CAkBF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldFeedbackArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
errors?: string[] | string;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FormFieldFeedbackSignature {
|
|
10
|
+
Args: FormFieldFeedbackArgs;
|
|
11
|
+
Element: HTMLDivElement;
|
|
12
|
+
Blocks: {
|
|
13
|
+
default: [];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export default class FormFieldFeedback extends Component<FormFieldFeedbackSignature> {
|
|
17
|
+
get isError(): boolean;
|
|
18
|
+
get classes(): string;
|
|
19
|
+
get errorMessage(): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAClF,IAAI,OAAO,IAAI,OAAO,CAIrB;IAED,IAAI,OAAO,WAQV;IAED,IAAI,YAAY,IAAI,MAAM,CAQzB;CAiBF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldHintArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FormFieldHintSignature {
|
|
8
|
+
Args: FormFieldHintArgs;
|
|
9
|
+
Element: HTMLDivElement;
|
|
10
|
+
Blocks: {
|
|
11
|
+
default: [];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default class FormFieldHint extends Component<FormFieldHintSignature> {
|
|
15
|
+
get classes(): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=hint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hint.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/hint.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS,CAAC,sBAAsB,CAAC;IAC1E,IAAI,OAAO,WAOV;CAeF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldInputArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
class?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
onInput?: (value: string, event: InputEvent) => void;
|
|
9
|
+
onChange?: (value: string, event: InputEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface FormFieldInputSignature {
|
|
12
|
+
Args: FormFieldInputArgs;
|
|
13
|
+
Element: HTMLInputElement;
|
|
14
|
+
}
|
|
15
|
+
export default class FormFieldInput extends Component<FormFieldInputSignature> {
|
|
16
|
+
get type(): string;
|
|
17
|
+
handleOnInput(event: Event): void;
|
|
18
|
+
handleOnChange(event: Event): void;
|
|
19
|
+
get classes(): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/input.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IAC5E,IAAI,IAAI,IAAI,MAAM,CAKjB;IAEO,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IASjC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAS1C,IAAI,OAAO,WAOV;CAkBF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldLabelArgs {
|
|
3
|
+
for?: string;
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FormFieldLabelSignature {
|
|
8
|
+
Args: FormFieldLabelArgs;
|
|
9
|
+
Element: HTMLLabelElement;
|
|
10
|
+
Blocks: {
|
|
11
|
+
default: [];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default class FormFieldLabel extends Component<FormFieldLabelSignature> {
|
|
15
|
+
get classes(): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/label.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IAC5E,IAAI,OAAO,WAIV;CAeF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldRadioArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
value?: string | number | boolean;
|
|
5
|
+
checked?: unknown;
|
|
6
|
+
name?: string;
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
class?: string;
|
|
9
|
+
onChange?: (value: unknown, event: Event) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface FormFieldRadioSignature {
|
|
12
|
+
Args: FormFieldRadioArgs;
|
|
13
|
+
Element: HTMLInputElement;
|
|
14
|
+
}
|
|
15
|
+
export default class FormFieldRadio extends Component<FormFieldRadioSignature> {
|
|
16
|
+
get isChecked(): boolean;
|
|
17
|
+
handleChange(event: Event): void;
|
|
18
|
+
get classes(): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/radio.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IAC5E,IAAI,SAAS,IAAI,OAAO,CAEvB;IAEO,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAQxC,IAAI,OAAO,WAOV;CAmBF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type ListboxSignature, type ListItemNode } from '@frontile/collections';
|
|
3
|
+
import { type PopoverSignature, type ContentSignature } from '@frontile/overlays';
|
|
4
|
+
interface FormFieldSelectArgs<T = unknown> extends Pick<PopoverSignature['Args'], 'placement' | 'flipOptions' | 'middleware' | 'shiftOptions' | 'offsetOptions' | 'strategy' | 'onClose'>, Pick<ListboxSignature<T>['Args'], 'appearance' | 'intent' | 'class' | 'selectedKeys' | 'disabledKeys' | 'allowEmpty' | 'onSelectionChange' | 'items'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'destinationElementId' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'transition'> {
|
|
5
|
+
selectionMode?: 'single' | 'multiple';
|
|
6
|
+
/**
|
|
7
|
+
* Whether the select should close upon selecting an item.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue true
|
|
10
|
+
*/
|
|
11
|
+
closeOnItemSelect?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @defaultValue true
|
|
14
|
+
*/
|
|
15
|
+
blockScroll?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue false
|
|
18
|
+
*/
|
|
19
|
+
disableFocusTrap?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface FormFieldSelectSignature {
|
|
22
|
+
Args: FormFieldSelectArgs;
|
|
23
|
+
Element: HTMLUListElement | HTMLSelectElement;
|
|
24
|
+
Blocks: ListboxSignature['Blocks'];
|
|
25
|
+
}
|
|
26
|
+
declare class FormFieldSelect extends Component<FormFieldSelectSignature> {
|
|
27
|
+
nodes: ListItemNode[];
|
|
28
|
+
get blockScroll(): boolean;
|
|
29
|
+
get disableFocusTrap(): boolean;
|
|
30
|
+
onAction: (key: string) => void;
|
|
31
|
+
get selectedText(): string | undefined;
|
|
32
|
+
onItemsChange: (nodes: ListItemNode[], _: 'add' | 'remove') => void;
|
|
33
|
+
get selectedTextValue(): string;
|
|
34
|
+
get backdrop(): "blur" | "none" | "transparent" | "faded";
|
|
35
|
+
}
|
|
36
|
+
export { FormFieldSelect, type FormFieldSelectSignature };
|
|
37
|
+
export default FormFieldSelect;
|
|
38
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/select.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAM5B,UAAU,mBAAmB,CAAC,CAAC,GAAG,OAAO,CACvC,SAAQ,IAAI,CACR,gBAAgB,CAAC,MAAM,CAAC,EACtB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,eAAe,GACf,UAAU,GACV,SAAS,CACZ,EACD,IAAI,CACF,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EACzB,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,cAAc,GACd,cAAc,GACd,YAAY,GACZ,mBAAmB,GACnB,OAAO,CACV,EACD,IAAI,CACF,gBAAgB,CAAC,MAAM,CAAC,EACtB,eAAe,GACf,sBAAsB,GACtB,oBAAoB,GACpB,UAAU,GACV,oBAAoB,GACpB,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,oBAAoB,GACpB,YAAY,CACf;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAEtC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,UAAU,wBAAwB;IAChC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IAC9C,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACpC;AAED,cAAM,eAAgB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IACtD,KAAK,EAAE,YAAY,EAAE,CAAM;IAEpC,IAAI,WAAW,YAKd;IAED,IAAI,gBAAgB,YAKnB;IAED,QAAQ,QAAS,MAAM,UAErB;IAEF,IAAI,YAAY,uBAEf;IAED,aAAa,UAAW,YAAY,EAAE,KAAK,KAAK,GAAG,QAAQ,UAEzD;IAEF,IAAI,iBAAiB,IAAI,MAAM,CAQ9B;IAED,IAAI,QAAQ,8CAKX;CAwFF;AAED,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormFieldTextareaArgs {
|
|
3
|
+
id?: string;
|
|
4
|
+
value?: string | number | boolean;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
class?: string;
|
|
7
|
+
onInput?: (value: string, event: InputEvent) => void;
|
|
8
|
+
onChange?: (value: string, event: InputEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface FormFieldTextareaSignature {
|
|
11
|
+
Args: FormFieldTextareaArgs;
|
|
12
|
+
Element: HTMLTextAreaElement;
|
|
13
|
+
}
|
|
14
|
+
export default class FormFieldTextarea extends Component<FormFieldTextareaSignature> {
|
|
15
|
+
handleOnInput(event: Event): void;
|
|
16
|
+
handleOnChange(event: Event): void;
|
|
17
|
+
get classes(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/form-field/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS,CAAC,0BAA0B,CAAC;IAC1E,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IASjC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAS1C,IAAI,OAAO,WAOV;CAiBF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import FormFieldCheckbox from './form-field/checkbox';
|
|
3
|
+
import FormFieldFeedback from './form-field/feedback';
|
|
4
|
+
import FormFieldHint from './form-field/hint';
|
|
5
|
+
import FormFieldInput from './form-field/input';
|
|
6
|
+
import FormFieldLabel from './form-field/label';
|
|
7
|
+
import FormFieldRadio from './form-field/radio';
|
|
8
|
+
import FormFieldTextarea from './form-field/textarea';
|
|
9
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
10
|
+
export interface FormFieldArgs {
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
}
|
|
13
|
+
export interface FormFieldSignature {
|
|
14
|
+
Args: FormFieldArgs;
|
|
15
|
+
Blocks: {
|
|
16
|
+
default: [
|
|
17
|
+
{
|
|
18
|
+
id: string;
|
|
19
|
+
hintId: string;
|
|
20
|
+
feedbackId: string;
|
|
21
|
+
Label: WithBoundArgs<typeof FormFieldLabel, 'for'> & WithBoundArgs<typeof FormFieldLabel, 'size'>;
|
|
22
|
+
Hint: WithBoundArgs<typeof FormFieldHint, 'id'> & WithBoundArgs<typeof FormFieldHint, 'size'>;
|
|
23
|
+
Feedback: WithBoundArgs<typeof FormFieldFeedback, 'id'> & WithBoundArgs<typeof FormFieldFeedback, 'size'>;
|
|
24
|
+
Input: WithBoundArgs<typeof FormFieldInput, 'id'> & WithBoundArgs<typeof FormFieldInput, 'size'>;
|
|
25
|
+
Textarea: WithBoundArgs<typeof FormFieldTextarea, 'id'> & WithBoundArgs<typeof FormFieldTextarea, 'size'>;
|
|
26
|
+
Checkbox: WithBoundArgs<typeof FormFieldCheckbox, 'id'> & WithBoundArgs<typeof FormFieldCheckbox, 'size'>;
|
|
27
|
+
Radio: WithBoundArgs<typeof FormFieldRadio, 'id'> & WithBoundArgs<typeof FormFieldRadio, 'size'>;
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
};
|
|
31
|
+
Element: HTMLDivElement;
|
|
32
|
+
}
|
|
33
|
+
export default class FormField extends Component<FormFieldSignature> {
|
|
34
|
+
id: string;
|
|
35
|
+
get hintId(): string;
|
|
36
|
+
get feedbackId(): string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=form-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../src/components/form-field.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO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AAC;aAChD;SACF,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAClE,EAAE,SAAiB;IAEnB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;CAqBF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormInputArgs {
|
|
3
|
+
/**
|
|
4
|
+
* The value to be used in the input.
|
|
5
|
+
* You must also pass `onChange` or `onInput` to update its value.
|
|
6
|
+
*/
|
|
7
|
+
value: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* The input type
|
|
10
|
+
* @defaultValue 'text'
|
|
11
|
+
*/
|
|
12
|
+
type?: string;
|
|
13
|
+
/** The group label */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** A help text to be displayed */
|
|
16
|
+
hint?: string;
|
|
17
|
+
/** If the form has been submitted, used to force displaying errors */
|
|
18
|
+
hasSubmitted?: boolean;
|
|
19
|
+
/** If has errors */
|
|
20
|
+
hasError?: boolean;
|
|
21
|
+
/** Force displaying errors */
|
|
22
|
+
showError?: boolean;
|
|
23
|
+
/** A list of errors or a single text describing the error */
|
|
24
|
+
errors?: string[] | string;
|
|
25
|
+
/** CSS classes to be added in the container element */
|
|
26
|
+
containerClass?: string;
|
|
27
|
+
/** The size */
|
|
28
|
+
size?: 'sm' | 'md' | 'lg';
|
|
29
|
+
/** CSS classes to be added in the input element */
|
|
30
|
+
inputClass?: string;
|
|
31
|
+
/** Callback when oninput is triggered */
|
|
32
|
+
onInput?: (value: string, event: InputEvent) => void;
|
|
33
|
+
/** Callback when onchange is triggered */
|
|
34
|
+
onChange?: (value: string, event: InputEvent) => void;
|
|
35
|
+
/** Callback when onfocus is triggered */
|
|
36
|
+
onFocusIn?: (event: FocusEvent) => void;
|
|
37
|
+
/** Callback when onblur is triggered */
|
|
38
|
+
onFocusOut?: (event: FocusEvent) => void;
|
|
39
|
+
}
|
|
40
|
+
export interface FormInputBaseSignature {
|
|
41
|
+
Args: FormInputArgs;
|
|
42
|
+
}
|
|
43
|
+
export interface FormInputSignature extends FormInputBaseSignature {
|
|
44
|
+
Element: HTMLInputElement;
|
|
45
|
+
Blocks: {
|
|
46
|
+
default: [];
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare class FormInputBase<T extends FormInputBaseSignature> extends Component<T> {
|
|
50
|
+
shouldShowErrorFeedback: boolean;
|
|
51
|
+
get showErrorFeedback(): boolean;
|
|
52
|
+
handleFocusIn(event: FocusEvent): void;
|
|
53
|
+
handleFocusOut(event: FocusEvent): void;
|
|
54
|
+
}
|
|
55
|
+
export default class FormInput extends FormInputBase<FormInputSignature> {
|
|
56
|
+
get classes(): {
|
|
57
|
+
base: string;
|
|
58
|
+
label: string;
|
|
59
|
+
input: string;
|
|
60
|
+
hint: string;
|
|
61
|
+
feedback: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=form-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-input.d.ts","sourceRoot":"","sources":["../../src/components/form-input.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAQ3C,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB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
|
|
2
|
+
import FormRadio from './form-radio';
|
|
3
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
4
|
+
export interface FormRadioGroupArgs {
|
|
5
|
+
value: string | number | boolean | undefined;
|
|
6
|
+
/** The group label */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** A help text to be displayed */
|
|
9
|
+
hint?: string;
|
|
10
|
+
/** If the form has been submitted, used to force displaying errors */
|
|
11
|
+
hasSubmitted?: boolean;
|
|
12
|
+
/** If has errors */
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
/** Force displaying errors */
|
|
15
|
+
showError?: boolean;
|
|
16
|
+
/** A list of errors or a single text describing the error */
|
|
17
|
+
errors?: string[] | string;
|
|
18
|
+
/** CSS classes to be added in the container element */
|
|
19
|
+
containerClass?: string;
|
|
20
|
+
/** The size */
|
|
21
|
+
size?: 'sm' | 'md' | 'lg';
|
|
22
|
+
/** If the Checkbox should be in one line */
|
|
23
|
+
isInline?: boolean;
|
|
24
|
+
/** Default callback added to the yielded FormRadio component, called when onchange is triggered */
|
|
25
|
+
onChange?: (value: unknown, event: Event) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface FormRadioGroupSignature {
|
|
28
|
+
Args: FormRadioGroupArgs;
|
|
29
|
+
Blocks: {
|
|
30
|
+
default: [
|
|
31
|
+
radio: WithBoundArgs<typeof FormRadio, 'checked'> & WithBoundArgs<typeof FormRadio, 'privateContainerClass'> & WithBoundArgs<typeof FormRadio, '_parentOnChange'> & WithBoundArgs<typeof FormRadio, 'size'> & WithBoundArgs<typeof FormRadio, 'name'>
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
Element: HTMLDivElement;
|
|
35
|
+
}
|
|
36
|
+
export default class FormRadioGroup extends Component<FormRadioGroupSignature> {
|
|
37
|
+
shouldShowErrorFeedback: boolean;
|
|
38
|
+
get showErrorFeedback(): boolean;
|
|
39
|
+
handleChange(value: unknown, event: Event): void;
|
|
40
|
+
get classes(): {
|
|
41
|
+
base: string;
|
|
42
|
+
label: string;
|
|
43
|
+
hint: string;
|
|
44
|
+
feedback: string;
|
|
45
|
+
formRadio: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=form-radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-radio-group.d.ts","sourceRoot":"","sources":["../../src/components/form-radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC7C,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3B,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,EAAE,SAAS,CAAC,GAC/C,aAAa,CAAC,OAAO,SAAS,EAAE,uBAAuB,CAAC,GACxD,aAAa,CAAC,OAAO,SAAS,EAAE,iBAAiB,CAAC,GAClD,aAAa,CAAC,OAAO,SAAS,EAAE,MAAM,CAAC,GACvC,aAAa,CAAC,OAAO,SAAS,EAAE,MAAM,CAAC;SAC1C,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IACnE,uBAAuB,UAAS;IAEzC,IAAI,iBAAiB,IAAI,OAAO,CAgB/B;IAEO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAQxD,IAAI,OAAO;;;;;;MAeV;CA8CF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
export interface FormRadioArgs {
|
|
3
|
+
/** The input field label */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** A help text to be displayed */
|
|
6
|
+
hint?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value to be used in the radio button.
|
|
9
|
+
* You must also pass `onChange` to update its value.
|
|
10
|
+
*/
|
|
11
|
+
value: string | number | boolean | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The current checked value.
|
|
14
|
+
* This will be used to compare against the `value` argument,
|
|
15
|
+
* if equal, the radio will me marked as checked.
|
|
16
|
+
*/
|
|
17
|
+
checked: unknown;
|
|
18
|
+
/** The name of the checkbox */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** CSS classes to be added in the container element */
|
|
21
|
+
containerClass?: string;
|
|
22
|
+
/** The size */
|
|
23
|
+
size?: 'sm' | 'md' | 'lg';
|
|
24
|
+
/** Callback when onchange is triggered */
|
|
25
|
+
onChange: (value: unknown, event: Event) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Internal function for InputRadioGroup
|
|
28
|
+
* @ignore
|
|
29
|
+
**/
|
|
30
|
+
_parentOnChange?: (value: unknown, event: Event) => void;
|
|
31
|
+
/** CSS classes to be added in the container element, in be used in for group
|
|
32
|
+
* @ignore*/
|
|
33
|
+
privateContainerClass?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface FormRadioSignature {
|
|
36
|
+
Args: FormRadioArgs;
|
|
37
|
+
Element: HTMLInputElement;
|
|
38
|
+
Blocks: {
|
|
39
|
+
default: [];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export default class FormRadio extends Component<FormRadioSignature> {
|
|
43
|
+
handleChange(value: unknown, event: Event): void;
|
|
44
|
+
get isChecked(): boolean;
|
|
45
|
+
get classes(): {
|
|
46
|
+
base: string;
|
|
47
|
+
label: string;
|
|
48
|
+
inputContainer: string;
|
|
49
|
+
labelContainer: string;
|
|
50
|
+
hint: string;
|
|
51
|
+
radio: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=form-radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-radio.d.ts","sourceRoot":"","sources":["../../src/components/form-radio.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,EAAE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