@frontile/forms-legacy 0.17.0-beta.1 → 0.17.0-beta.13
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/components/form-checkbox-group.d.ts +0 -1
- package/declarations/components/form-checkbox.d.ts +0 -1
- package/declarations/components/form-field/checkbox.d.ts +0 -1
- package/declarations/components/form-field/feedback.d.ts +0 -1
- package/declarations/components/form-field/hint.d.ts +0 -1
- package/declarations/components/form-field/input.d.ts +0 -1
- package/declarations/components/form-field/label.d.ts +0 -1
- package/declarations/components/form-field/radio.d.ts +0 -1
- package/declarations/components/form-field/textarea.d.ts +0 -1
- package/declarations/components/form-field.d.ts +0 -1
- package/declarations/components/form-input.d.ts +0 -1
- package/declarations/components/form-radio-group.d.ts +0 -1
- package/declarations/components/form-radio.d.ts +0 -1
- package/declarations/components/form-select.d.ts +2 -2
- package/declarations/components/form-textarea.d.ts +0 -1
- package/declarations/index.d.ts +0 -1
- package/declarations/template-registry.d.ts +0 -1
- package/dist/components/form-checkbox-group.js +20 -23
- package/dist/components/form-checkbox-group.js.map +1 -1
- package/dist/components/form-checkbox.js +14 -9
- package/dist/components/form-checkbox.js.map +1 -1
- package/dist/components/form-field/checkbox.js +14 -9
- package/dist/components/form-field/checkbox.js.map +1 -1
- package/dist/components/form-field/feedback.js +5 -5
- package/dist/components/form-field/feedback.js.map +1 -1
- package/dist/components/form-field/hint.js +5 -5
- package/dist/components/form-field/hint.js.map +1 -1
- package/dist/components/form-field/input.js +17 -9
- package/dist/components/form-field/input.js.map +1 -1
- package/dist/components/form-field/label.js +5 -5
- package/dist/components/form-field/label.js.map +1 -1
- package/dist/components/form-field/radio.js +14 -9
- package/dist/components/form-field/radio.js.map +1 -1
- package/dist/components/form-field/textarea.js +17 -9
- package/dist/components/form-field/textarea.js.map +1 -1
- package/dist/components/form-field.js +16 -20
- package/dist/components/form-field.js.map +1 -1
- package/dist/components/form-input.js +23 -25
- package/dist/components/form-input.js.map +1 -1
- package/dist/components/form-radio-group.js +20 -23
- package/dist/components/form-radio-group.js.map +1 -1
- package/dist/components/form-radio.js +14 -9
- package/dist/components/form-radio.js.map +1 -1
- package/dist/components/form-select.js +41 -31
- package/dist/components/form-select.js.map +1 -1
- package/dist/components/form-textarea.js +10 -10
- package/dist/components/form-textarea.js.map +1 -1
- package/dist/runtime-BPCpkOf1-B5Lbloj7.js +67 -0
- package/dist/runtime-BPCpkOf1-B5Lbloj7.js.map +1 -0
- package/package.json +47 -50
- package/declarations/components/form-checkbox-group.d.ts.map +0 -1
- package/declarations/components/form-checkbox.d.ts.map +0 -1
- package/declarations/components/form-field/checkbox.d.ts.map +0 -1
- package/declarations/components/form-field/feedback.d.ts.map +0 -1
- package/declarations/components/form-field/hint.d.ts.map +0 -1
- package/declarations/components/form-field/input.d.ts.map +0 -1
- package/declarations/components/form-field/label.d.ts.map +0 -1
- package/declarations/components/form-field/radio.d.ts.map +0 -1
- package/declarations/components/form-field/textarea.d.ts.map +0 -1
- package/declarations/components/form-field.d.ts.map +0 -1
- package/declarations/components/form-input.d.ts.map +0 -1
- package/declarations/components/form-radio-group.d.ts.map +0 -1
- package/declarations/components/form-radio.d.ts.map +0 -1
- package/declarations/components/form-select.d.ts.map +0 -1
- package/declarations/components/form-textarea.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/template-registry.d.ts.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type PowerSelectArgs, type Select } from 'ember-power-select/components/power-select';
|
|
3
|
+
import type Owner from '@ember/owner';
|
|
3
4
|
export interface FormSelectArgs extends PowerSelectArgs {
|
|
4
5
|
/** The input field label */
|
|
5
6
|
label?: string;
|
|
@@ -32,7 +33,7 @@ export interface FormSelectSignature {
|
|
|
32
33
|
export default class FormSelect extends Component<FormSelectSignature> {
|
|
33
34
|
shouldShowErrorFeedback: boolean;
|
|
34
35
|
isOpen: boolean;
|
|
35
|
-
constructor(owner:
|
|
36
|
+
constructor(owner: Owner, args: FormSelectArgs);
|
|
36
37
|
get showErrorFeedback(): boolean;
|
|
37
38
|
handleOpen(select: Select, event: Event): void;
|
|
38
39
|
handleClose(select: Select, event: Event): void;
|
|
@@ -47,4 +48,3 @@ export default class FormSelect extends Component<FormSelectSignature> {
|
|
|
47
48
|
feedback: string;
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
|
-
//# sourceMappingURL=form-select.d.ts.map
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
|
|
2
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
4
|
-
import '@babel/runtime/helpers/esm/initializerWarningHelper';
|
|
5
1
|
import Component from '@glimmer/component';
|
|
6
2
|
import { action } from '@ember/object';
|
|
7
3
|
import { tracked } from '@glimmer/tracking';
|
|
@@ -11,13 +7,15 @@ import FormField from './form-field.js';
|
|
|
11
7
|
import { hash } from '@ember/helper';
|
|
12
8
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
13
9
|
import { setComponentTemplate } from '@ember/component';
|
|
10
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../runtime-BPCpkOf1-B5Lbloj7.js';
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
class FormCheckboxGroup extends Component {
|
|
13
|
+
static {
|
|
14
|
+
decorateFieldV2(this.prototype, "shouldShowErrorFeedback", [tracked], function () {
|
|
15
|
+
return false;
|
|
16
|
+
});
|
|
20
17
|
}
|
|
18
|
+
#shouldShowErrorFeedback = (initializeDeferredDecorator(this, "shouldShowErrorFeedback"), void 0);
|
|
21
19
|
get showErrorFeedback() {
|
|
22
20
|
if (this.args.hasError === false) {
|
|
23
21
|
return false;
|
|
@@ -34,6 +32,9 @@ let FormCheckboxGroup = (_class = (_FormCheckboxGroup = class FormCheckboxGroup
|
|
|
34
32
|
this.args.onChange(value, event);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
35
|
+
static {
|
|
36
|
+
decorateMethodV2(this.prototype, "handleChange", [action]);
|
|
37
|
+
}
|
|
37
38
|
get classes() {
|
|
38
39
|
const {
|
|
39
40
|
formCheckboxGroup
|
|
@@ -57,21 +58,17 @@ let FormCheckboxGroup = (_class = (_FormCheckboxGroup = class FormCheckboxGroup
|
|
|
57
58
|
formCheckbox: formCheckbox()
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
enumerable: true,
|
|
70
|
-
writable: true,
|
|
71
|
-
initializer: function () {
|
|
72
|
-
return false;
|
|
61
|
+
static {
|
|
62
|
+
setComponentTemplate(precompileTemplate("\n <FormField @size={{@size}} class={{this.classes.base}} role=\"group\" ...attributes as |f|>\n {{#if @label}}\n <f.Label @class={{this.classes.label}}>\n {{@label}}\n </f.Label>\n {{/if}}\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield (component FormCheckbox privateContainerClass=this.classes.formCheckbox _parentOnChange=this.handleChange size=@size) (hash onChange=this.handleChange)}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n ", {
|
|
63
|
+
strictMode: true,
|
|
64
|
+
scope: () => ({
|
|
65
|
+
FormField,
|
|
66
|
+
FormCheckbox,
|
|
67
|
+
hash
|
|
68
|
+
})
|
|
69
|
+
}), this);
|
|
73
70
|
}
|
|
74
|
-
}
|
|
71
|
+
}
|
|
75
72
|
|
|
76
73
|
export { FormCheckboxGroup as default };
|
|
77
74
|
//# sourceMappingURL=form-checkbox-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-checkbox-group.js","sources":["../../src/components/form-checkbox-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport FormCheckbox from './form-checkbox';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\nimport { hash } from '@ember/helper';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormCheckboxGroupArgs {\n /** The group label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /** If the form has been submitted, used to force displaying errors */\n hasSubmitted?: boolean;\n /** If has errors */\n hasError?: boolean;\n /** Force displaying errors */\n showError?: boolean;\n /** A list of errors or a single text describing the error */\n errors?: string[] | string;\n /** CSS classes to be added in the container element */\n containerClass?: string;\n /** The size */\n size?: 'sm' | 'md' | 'lg';\n /** If the Checkbox should be in one line */\n isInline?: boolean;\n /** Default callback added to the yielded FormCheckbox component, called when onchange is triggered */\n onChange?: (value: unknown, event: Event) => void;\n}\n\nexport interface FormCheckboxGroupSignature {\n Args: FormCheckboxGroupArgs;\n Blocks: {\n default: [\n checkbox: WithBoundArgs<typeof FormCheckbox, 'privateContainerClass'> &\n WithBoundArgs<typeof FormCheckbox, '_parentOnChange'> &\n WithBoundArgs<typeof FormCheckbox, 'size'>,\n api: { onChange: (value: unknown, event: Event) => void }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormCheckboxGroup extends Component<FormCheckboxGroupSignature> {\n @tracked shouldShowErrorFeedback = false;\n\n get showErrorFeedback(): boolean {\n if (this.args.hasError === false) {\n return false;\n }\n\n if (\n (this.args.showError ||\n this.args.hasSubmitted ||\n this.shouldShowErrorFeedback) &&\n this.args.errors &&\n this.args.errors.length > 0\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n @action handleChange(value: unknown, event: Event): void {\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { formCheckboxGroup } = useStyles();\n const { base, label, formCheckbox, hint, feedback } = formCheckboxGroup({\n isInline: this.args.isInline\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n hint: hint(),\n feedback: feedback(),\n formCheckbox: formCheckbox()\n };\n }\n\n <template>\n <FormField\n @size={{@size}}\n class={{this.classes.base}}\n role=\"group\"\n ...attributes\n as |f|\n >\n {{#if @label}}\n <f.Label @class={{this.classes.label}}>\n {{@label}}\n </f.Label>\n {{/if}}\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield\n (component\n FormCheckbox\n privateContainerClass=this.classes.formCheckbox\n _parentOnChange=this.handleChange\n size=@size\n )\n (hash onChange=this.handleChange)\n }}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormCheckboxGroup","Component","
|
|
1
|
+
{"version":3,"file":"form-checkbox-group.js","sources":["../../src/components/form-checkbox-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport FormCheckbox from './form-checkbox';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\nimport { hash } from '@ember/helper';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormCheckboxGroupArgs {\n /** The group label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /** If the form has been submitted, used to force displaying errors */\n hasSubmitted?: boolean;\n /** If has errors */\n hasError?: boolean;\n /** Force displaying errors */\n showError?: boolean;\n /** A list of errors or a single text describing the error */\n errors?: string[] | string;\n /** CSS classes to be added in the container element */\n containerClass?: string;\n /** The size */\n size?: 'sm' | 'md' | 'lg';\n /** If the Checkbox should be in one line */\n isInline?: boolean;\n /** Default callback added to the yielded FormCheckbox component, called when onchange is triggered */\n onChange?: (value: unknown, event: Event) => void;\n}\n\nexport interface FormCheckboxGroupSignature {\n Args: FormCheckboxGroupArgs;\n Blocks: {\n default: [\n checkbox: WithBoundArgs<typeof FormCheckbox, 'privateContainerClass'> &\n WithBoundArgs<typeof FormCheckbox, '_parentOnChange'> &\n WithBoundArgs<typeof FormCheckbox, 'size'>,\n api: { onChange: (value: unknown, event: Event) => void }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormCheckboxGroup extends Component<FormCheckboxGroupSignature> {\n @tracked shouldShowErrorFeedback = false;\n\n get showErrorFeedback(): boolean {\n if (this.args.hasError === false) {\n return false;\n }\n\n if (\n (this.args.showError ||\n this.args.hasSubmitted ||\n this.shouldShowErrorFeedback) &&\n this.args.errors &&\n this.args.errors.length > 0\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n @action handleChange(value: unknown, event: Event): void {\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { formCheckboxGroup } = useStyles();\n const { base, label, formCheckbox, hint, feedback } = formCheckboxGroup({\n isInline: this.args.isInline\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n hint: hint(),\n feedback: feedback(),\n formCheckbox: formCheckbox()\n };\n }\n\n <template>\n <FormField\n @size={{@size}}\n class={{this.classes.base}}\n role=\"group\"\n ...attributes\n as |f|\n >\n {{#if @label}}\n <f.Label @class={{this.classes.label}}>\n {{@label}}\n </f.Label>\n {{/if}}\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield\n (component\n FormCheckbox\n privateContainerClass=this.classes.formCheckbox\n _parentOnChange=this.handleChange\n size=@size\n )\n (hash onChange=this.handleChange)\n }}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormCheckboxGroup","Component","g","prototype","tracked","i","void 0","showErrorFeedback","args","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleChange","value","event","onChange","n","action","classes","formCheckboxGroup","useStyles","base","label","formCheckbox","hint","feedback","isInline","class","containerClass","setComponentTemplate","precompileTemplate","strictMode","scope","FormField","FormCheckbox","hash"],"mappings":";;;;;;;;;;;AA6Ce,MAAMA,0BAA0BC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,yBAAA,EAAA,CACtDC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,MAAA;EAEnC,IAAIC,iBAAAA,GAA6B;AAC/B,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,KAAA,EAAO;AAChC,MAAA,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,IACE,CAAC,IAAI,CAACD,IAAI,CAACE,SAAS,IAClB,IAAI,CAACF,IAAI,CAACG,YAAY,IACtB,IAAI,CAACC,uBAAuB,KAC9B,IAAI,CAACJ,IAAI,CAACK,MAAM,IAChB,IAAI,CAACL,IAAI,CAACK,MAAM,CAACC,MAAM,GAAG,CAAA,EAC1B;AACA,MAAA,OAAO,IAAA;AACT,IAAA,CAAA,MAAO;AACL,MAAA,OAAO,KAAA;AACT,IAAA;AACF,EAAA;AAEQC,EAAAA,YAAAA,CAAaC,KAAc,EAAEC,KAAY,EAAQ;IACvD,IAAI,CAACL,uBAAuB,GAAG,IAAA;IAE/B,IAAI,OAAO,IAAI,CAACJ,IAAI,CAACU,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACV,IAAI,CAACU,QAAQ,CAACF,KAAA,EAAOC,KAAA,CAAA;AAC5B,IAAA;AACF,EAAA;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAAhB,SAAA,EAAA,cAAA,EAAA,CANCiB,MAAA,CAAA,CAAA;AAAA;EAQD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAmB,GAAGC,SAAA,EAAA;IAC9B,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC,YAAY;MAAEC,IAAI;AAAEC,MAAAA;KAAU,GAAGN,iBAAA,CAAkB;AACtEO,MAAAA,QAAA,EAAU,IAAI,CAACrB,IAAI,CAACqB;AACtB,KAAA,CAAA;IAEA,OAAO;MACLL,IAAA,EAAMA,IAAA,CAAK;AACTM,QAAAA,KAAA,EAAO,IAAI,CAACtB,IAAI,CAACuB;AACnB,OAAA,CAAA;MACAN,KAAA,EAAOA,KAAA,EAAA;MACPE,IAAA,EAAMA,IAAA,EAAA;MACNC,QAAA,EAAUA,QAAA,EAAA;MACVF,YAAA,EAAcA,YAAA;KAChB;AACF,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,qqBAAA,EAkCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,SAAA;QAAAC,YAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { action } from '@ember/object';
|
|
4
3
|
import { useStyles } from '@frontile/theme';
|
|
5
4
|
import FormField from './form-field.js';
|
|
6
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
import { a as decorateMethodV2 } from '../runtime-BPCpkOf1-B5Lbloj7.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
let FormCheckbox = (_class = (_FormCheckbox = class FormCheckbox extends Component {
|
|
9
|
+
class FormCheckbox extends Component {
|
|
11
10
|
handleChange(value, event) {
|
|
12
11
|
if (typeof this.args.onChange === 'function') {
|
|
13
12
|
this.args.onChange(value, event);
|
|
@@ -16,6 +15,9 @@ let FormCheckbox = (_class = (_FormCheckbox = class FormCheckbox extends Compone
|
|
|
16
15
|
this.args._parentOnChange(value, event);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
18
|
+
static {
|
|
19
|
+
decorateMethodV2(this.prototype, "handleChange", [action]);
|
|
20
|
+
}
|
|
19
21
|
get classes() {
|
|
20
22
|
const {
|
|
21
23
|
formCheckbox
|
|
@@ -48,12 +50,15 @@ let FormCheckbox = (_class = (_FormCheckbox = class FormCheckbox extends Compone
|
|
|
48
50
|
checkbox: checkbox()
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
53
|
+
static {
|
|
54
|
+
setComponentTemplate(precompileTemplate("\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n <div class={{this.classes.labelContainer}}>\n <div class={{this.classes.inputContainer}}>\n {{!-- Zero-width space character, used to align checkbox properly --}}\n {{!-- eslint-disable no-irregular-whitespace--}}\n \u200B\n <f.Checkbox @onChange={{this.handleChange}} @checked={{@checked}} @name={{@name}} @class={{this.classes.checkbox}} aria-describedby={{if @hint f.hintId}} ...attributes />\n </div>\n\n <f.Label @class={{this.classes.label}}>\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </f.Label>\n </div>\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n </FormField>\n ", {
|
|
55
|
+
strictMode: true,
|
|
56
|
+
scope: () => ({
|
|
57
|
+
FormField
|
|
58
|
+
})
|
|
59
|
+
}), this);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
57
62
|
|
|
58
63
|
export { FormCheckbox as default };
|
|
59
64
|
//# sourceMappingURL=form-checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-checkbox.js","sources":["../../src/components/form-checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\n\nexport interface FormCheckboxArgs {\n /** The input field label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /**\n * If the checkbox is checked.\n * You must also pass `onChange` to update its value.\n */\n checked: boolean;\n /** The name of the checkbox */\n name?: string;\n /** CSS classes to be added in the container element */\n containerClass?: string;\n /** The size */\n size?: 'sm' | 'md' | 'lg';\n /** Callback when onchange is triggered */\n onChange: (value: boolean, event: Event) => void;\n\n /**\n * Internal function for InputCheckboxGroup\n * @ignore\n **/\n _parentOnChange?: (value: boolean, event: Event) => void;\n\n /**\n * CSS classes to be added in the container element\n * @ignore\n * */\n privateContainerClass?: string;\n}\n\nexport interface FormCheckboxSignature {\n Args: FormCheckboxArgs;\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormCheckbox extends Component<FormCheckboxSignature> {\n @action handleChange(value: boolean, event: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n\n if (typeof this.args._parentOnChange === 'function') {\n this.args._parentOnChange(value, event);\n }\n }\n\n get classes() {\n const { formCheckbox } = useStyles();\n\n const { base, label, checkbox, hint, labelContainer, inputContainer } =\n formCheckbox({\n size: this.args.size\n });\n\n let containerClasses = '';\n if (this.args.containerClass) {\n containerClasses = this.args.containerClass;\n }\n if (this.args.privateContainerClass) {\n containerClasses += ' ' + this.args.privateContainerClass;\n }\n\n return {\n base: base({\n class: containerClasses\n }),\n label: label(),\n inputContainer: inputContainer(),\n labelContainer: labelContainer(),\n hint: hint(),\n checkbox: checkbox()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n <div class={{this.classes.labelContainer}}>\n <div class={{this.classes.inputContainer}}>\n {{! Zero-width space character, used to align checkbox properly }}\n {{! eslint-disable no-irregular-whitespace}}\n \n <f.Checkbox\n @onChange={{this.handleChange}}\n @checked={{@checked}}\n @name={{@name}}\n @class={{this.classes.checkbox}}\n aria-describedby={{if @hint f.hintId}}\n ...attributes\n />\n </div>\n\n <f.Label @class={{this.classes.label}}>\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </f.Label>\n </div>\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormCheckbox","Component","handleChange","value","event","args","onChange","_parentOnChange","classes","formCheckbox","useStyles","base","label","checkbox","hint","labelContainer","inputContainer","size","containerClasses","containerClass","privateContainerClass","class","setComponentTemplate","precompileTemplate","strictMode","scope","FormField"
|
|
1
|
+
{"version":3,"file":"form-checkbox.js","sources":["../../src/components/form-checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\n\nexport interface FormCheckboxArgs {\n /** The input field label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /**\n * If the checkbox is checked.\n * You must also pass `onChange` to update its value.\n */\n checked: boolean;\n /** The name of the checkbox */\n name?: string;\n /** CSS classes to be added in the container element */\n containerClass?: string;\n /** The size */\n size?: 'sm' | 'md' | 'lg';\n /** Callback when onchange is triggered */\n onChange: (value: boolean, event: Event) => void;\n\n /**\n * Internal function for InputCheckboxGroup\n * @ignore\n **/\n _parentOnChange?: (value: boolean, event: Event) => void;\n\n /**\n * CSS classes to be added in the container element\n * @ignore\n * */\n privateContainerClass?: string;\n}\n\nexport interface FormCheckboxSignature {\n Args: FormCheckboxArgs;\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormCheckbox extends Component<FormCheckboxSignature> {\n @action handleChange(value: boolean, event: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n\n if (typeof this.args._parentOnChange === 'function') {\n this.args._parentOnChange(value, event);\n }\n }\n\n get classes() {\n const { formCheckbox } = useStyles();\n\n const { base, label, checkbox, hint, labelContainer, inputContainer } =\n formCheckbox({\n size: this.args.size\n });\n\n let containerClasses = '';\n if (this.args.containerClass) {\n containerClasses = this.args.containerClass;\n }\n if (this.args.privateContainerClass) {\n containerClasses += ' ' + this.args.privateContainerClass;\n }\n\n return {\n base: base({\n class: containerClasses\n }),\n label: label(),\n inputContainer: inputContainer(),\n labelContainer: labelContainer(),\n hint: hint(),\n checkbox: checkbox()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n <div class={{this.classes.labelContainer}}>\n <div class={{this.classes.inputContainer}}>\n {{! Zero-width space character, used to align checkbox properly }}\n {{! eslint-disable no-irregular-whitespace}}\n \n <f.Checkbox\n @onChange={{this.handleChange}}\n @checked={{@checked}}\n @name={{@name}}\n @class={{this.classes.checkbox}}\n aria-describedby={{if @hint f.hintId}}\n ...attributes\n />\n </div>\n\n <f.Label @class={{this.classes.label}}>\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </f.Label>\n </div>\n\n {{#if @hint}}\n <f.Hint @class={{this.classes.hint}}>\n {{@hint}}\n </f.Hint>\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormCheckbox","Component","handleChange","value","event","args","onChange","_parentOnChange","n","prototype","action","classes","formCheckbox","useStyles","base","label","checkbox","hint","labelContainer","inputContainer","size","containerClasses","containerClass","privateContainerClass","class","setComponentTemplate","precompileTemplate","strictMode","scope","FormField"],"mappings":";;;;;;;;AA6Ce,MAAMA,qBAAqBC,SAAA,CAAU;AAC1CC,EAAAA,YAAAA,CAAaC,KAAc,EAAEC,KAAY,EAAQ;IACvD,IAAI,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACD,IAAI,CAACC,QAAQ,CAACH,KAAA,EAAOC,KAAA,CAAA;AAC5B,IAAA;IAEA,IAAI,OAAO,IAAI,CAACC,IAAI,CAACE,eAAe,KAAK,UAAA,EAAY;MACnD,IAAI,CAACF,IAAI,CAACE,eAAe,CAACJ,KAAA,EAAOC,KAAA,CAAA;AACnC,IAAA;AACF,EAAA;AAAA,EAAA;IAAAI,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CARCC,MAAA,CAAA,CAAA;AAAA;EAUD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAc,GAAGC,SAAA,EAAA;IAEzB,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC,QAAQ;MAAEC,IAAI;MAAEC,cAAc;AAAEC,MAAAA;KAAgB,GACnEP,YAAA,CAAa;AACXQ,MAAAA,IAAA,EAAM,IAAI,CAACf,IAAI,CAACe;AAClB,KAAA,CAAA;IAEF,IAAIC,gBAAA,GAAmB,EAAA;AACvB,IAAA,IAAI,IAAI,CAAChB,IAAI,CAACiB,cAAc,EAAE;AAC5BD,MAAAA,gBAAA,GAAmB,IAAI,CAAChB,IAAI,CAACiB,cAAc;AAC7C,IAAA;AACA,IAAA,IAAI,IAAI,CAACjB,IAAI,CAACkB,qBAAqB,EAAE;AACnCF,MAAAA,gBAAA,IAAoB,GAAA,GAAM,IAAI,CAAChB,IAAI,CAACkB,qBAAqB;AAC3D,IAAA;IAEA,OAAO;MACLT,IAAA,EAAMA,IAAA,CAAK;AACTU,QAAAA,KAAA,EAAOH;AACT,OAAA,CAAA;MACAN,KAAA,EAAOA,KAAA,EAAA;MACPI,cAAA,EAAgBA,cAAA,EAAA;MAChBD,cAAA,EAAgBA,cAAA,EAAA;MAChBD,IAAA,EAAMA,IAAA,EAAA;MACND,QAAA,EAAUA,QAAA;KACZ;AACF,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,k3BAAA,EAgCA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { action } from '@ember/object';
|
|
4
3
|
import { on } from '@ember/modifier';
|
|
5
4
|
import { useStyles } from '@frontile/theme';
|
|
6
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
import { a as decorateMethodV2 } from '../../runtime-BPCpkOf1-B5Lbloj7.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
let FormFieldCheckbox = (_class = (_FormFieldCheckbox = class FormFieldCheckbox extends Component {
|
|
9
|
+
class FormFieldCheckbox extends Component {
|
|
11
10
|
get isChecked() {
|
|
12
11
|
return !!this.args.checked;
|
|
13
12
|
}
|
|
@@ -18,6 +17,9 @@ let FormFieldCheckbox = (_class = (_FormFieldCheckbox = class FormFieldCheckbox
|
|
|
18
17
|
this.args.onChange(value, event);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
20
|
+
static {
|
|
21
|
+
decorateMethodV2(this.prototype, "handleChange", [action]);
|
|
22
|
+
}
|
|
21
23
|
get classes() {
|
|
22
24
|
const {
|
|
23
25
|
checkbox
|
|
@@ -28,12 +30,15 @@ let FormFieldCheckbox = (_class = (_FormFieldCheckbox = class FormFieldCheckbox
|
|
|
28
30
|
class: this.args.class
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
33
|
+
static {
|
|
34
|
+
setComponentTemplate(precompileTemplate("\n <input {{on \"change\" this.handleChange}} id={{@id}} name={{@name}} checked={{this.isChecked}} type=\"checkbox\" class={{this.classes}} data-test-id=\"form-field-checkbox\" ...attributes />\n ", {
|
|
35
|
+
strictMode: true,
|
|
36
|
+
scope: () => ({
|
|
37
|
+
on
|
|
38
|
+
})
|
|
39
|
+
}), this);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
|
|
38
43
|
export { FormFieldCheckbox as default };
|
|
39
44
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/form-field/checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldCheckboxArgs {\n id?: string;\n checked?: boolean;\n name?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n\n // Callback when onchange is triggered\n onChange?: (value: boolean, event: Event) => void;\n}\n\nexport interface FormFieldCheckboxSignature {\n Args: FormFieldCheckboxArgs;\n Element: HTMLInputElement;\n}\n\nexport default class FormFieldCheckbox extends Component<FormFieldCheckboxSignature> {\n get isChecked(): boolean {\n return !!this.args.checked;\n }\n\n @action handleChange(event: Event): void {\n event.preventDefault();\n\n const value = !this.args.checked;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { checkbox } = useStyles();\n\n return checkbox({\n size: this.args.size\n }).input({\n class: this.args.class\n });\n }\n\n <template>\n <input\n {{on \"change\" this.handleChange}}\n id={{@id}}\n name={{@name}}\n checked={{this.isChecked}}\n type=\"checkbox\"\n class={{this.classes}}\n data-test-id=\"form-field-checkbox\"\n ...attributes\n />\n </template>\n}\n"],"names":["FormFieldCheckbox","Component","isChecked","args","checked","handleChange","event","preventDefault","value","onChange","classes","checkbox","useStyles","size","input","class","setComponentTemplate","precompileTemplate","strictMode","scope","on"
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/form-field/checkbox.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldCheckboxArgs {\n id?: string;\n checked?: boolean;\n name?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n\n // Callback when onchange is triggered\n onChange?: (value: boolean, event: Event) => void;\n}\n\nexport interface FormFieldCheckboxSignature {\n Args: FormFieldCheckboxArgs;\n Element: HTMLInputElement;\n}\n\nexport default class FormFieldCheckbox extends Component<FormFieldCheckboxSignature> {\n get isChecked(): boolean {\n return !!this.args.checked;\n }\n\n @action handleChange(event: Event): void {\n event.preventDefault();\n\n const value = !this.args.checked;\n\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value, event);\n }\n }\n\n get classes() {\n const { checkbox } = useStyles();\n\n return checkbox({\n size: this.args.size\n }).input({\n class: this.args.class\n });\n }\n\n <template>\n <input\n {{on \"change\" this.handleChange}}\n id={{@id}}\n name={{@name}}\n checked={{this.isChecked}}\n type=\"checkbox\"\n class={{this.classes}}\n data-test-id=\"form-field-checkbox\"\n ...attributes\n />\n </template>\n}\n"],"names":["FormFieldCheckbox","Component","isChecked","args","checked","handleChange","event","preventDefault","value","onChange","n","prototype","action","classes","checkbox","useStyles","size","input","class","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;AAqBe,MAAMA,0BAA0BC,SAAA,CAAU;EACvD,IAAIC,SAAAA,GAAqB;AACvB,IAAA,OAAO,CAAC,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO;AAC5B,EAAA;EAEQC,YAAAA,CAAaC,KAAY,EAAQ;IACvCA,KAAA,CAAMC,cAAc,EAAA;AAEpB,IAAA,MAAMC,QAAQ,CAAC,IAAI,CAACL,IAAI,CAACC,OAAO;IAEhC,IAAI,OAAO,IAAI,CAACD,IAAI,CAACM,QAAQ,KAAK,UAAA,EAAY;MAC5C,IAAI,CAACN,IAAI,CAACM,QAAQ,CAACD,KAAA,EAAOF,KAAA,CAAA;AAC5B,IAAA;AACF,EAAA;AAAA,EAAA;IAAAI,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CARCC,MAAA,CAAA,CAAA;AAAA;EAUD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAU,GAAGC,SAAA,EAAA;AAErB,IAAA,OAAOD,QAAA,CAAS;AACdE,MAAAA,IAAA,EAAM,IAAI,CAACb,IAAI,CAACa;KAClB,CAAA,CAAGC,KAAK,CAAC;AACPC,MAAAA,KAAA,EAAO,IAAI,CAACf,IAAI,CAACe;AACnB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,0MAAA,EAWA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,7 +3,6 @@ import { useStyles } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
var _FormFieldFeedback;
|
|
7
6
|
class FormFieldFeedback extends Component {
|
|
8
7
|
get isError() {
|
|
9
8
|
return typeof this.args.errors !== 'undefined' || this.args.isError === true;
|
|
@@ -26,11 +25,12 @@ class FormFieldFeedback extends Component {
|
|
|
26
25
|
return this.args.errors.join('; ');
|
|
27
26
|
}
|
|
28
27
|
}
|
|
28
|
+
static {
|
|
29
|
+
setComponentTemplate(precompileTemplate("\n <div id={{@id}} class={{this.classes}} data-test-id=\"form-field-feedback\" aria-live={{if this.isError \"assertive\" \"polite\"}} ...attributes>\n {{this.errorMessage}}\n {{yield}}\n </div>\n ", {
|
|
30
|
+
strictMode: true
|
|
31
|
+
}), this);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
|
-
_FormFieldFeedback = FormFieldFeedback;
|
|
31
|
-
setComponentTemplate(precompileTemplate("\n <div id={{@id}} class={{this.classes}} data-test-id=\"form-field-feedback\" aria-live={{if this.isError \"assertive\" \"polite\"}} ...attributes>\n {{this.errorMessage}}\n {{yield}}\n </div>\n ", {
|
|
32
|
-
strictMode: true
|
|
33
|
-
}), _FormFieldFeedback);
|
|
34
34
|
|
|
35
35
|
export { FormFieldFeedback as default };
|
|
36
36
|
//# sourceMappingURL=feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.js","sources":["../../../src/components/form-field/feedback.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldFeedbackArgs {\n id?: string;\n isError?: boolean;\n errors?: string[] | string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldFeedbackSignature {\n Args: FormFieldFeedbackArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldFeedback extends Component<FormFieldFeedbackSignature> {\n get isError(): boolean {\n return (\n typeof this.args.errors !== 'undefined' || this.args.isError === true\n );\n }\n\n get classes() {\n const { formFeedback } = useStyles();\n\n return formFeedback({\n size: this.args.size,\n intent: this.isError ? 'danger' : 'primary',\n class: this.args.class\n });\n }\n\n get errorMessage(): string {\n if (!this.args.errors) return '';\n\n if (typeof this.args.errors === 'string') {\n return this.args.errors;\n } else {\n return this.args.errors.join('; ');\n }\n }\n\n <template>\n <div\n id={{@id}}\n class={{this.classes}}\n data-test-id=\"form-field-feedback\"\n aria-live={{if this.isError \"assertive\" \"polite\"}}\n ...attributes\n >\n {{this.errorMessage}}\n {{yield}}\n </div>\n </template>\n}\n"],"names":["FormFieldFeedback","Component","isError","args","errors","classes","formFeedback","useStyles","size","intent","class","errorMessage","join","
|
|
1
|
+
{"version":3,"file":"feedback.js","sources":["../../../src/components/form-field/feedback.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldFeedbackArgs {\n id?: string;\n isError?: boolean;\n errors?: string[] | string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldFeedbackSignature {\n Args: FormFieldFeedbackArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldFeedback extends Component<FormFieldFeedbackSignature> {\n get isError(): boolean {\n return (\n typeof this.args.errors !== 'undefined' || this.args.isError === true\n );\n }\n\n get classes() {\n const { formFeedback } = useStyles();\n\n return formFeedback({\n size: this.args.size,\n intent: this.isError ? 'danger' : 'primary',\n class: this.args.class\n });\n }\n\n get errorMessage(): string {\n if (!this.args.errors) return '';\n\n if (typeof this.args.errors === 'string') {\n return this.args.errors;\n } else {\n return this.args.errors.join('; ');\n }\n }\n\n <template>\n <div\n id={{@id}}\n class={{this.classes}}\n data-test-id=\"form-field-feedback\"\n aria-live={{if this.isError \"assertive\" \"polite\"}}\n ...attributes\n >\n {{this.errorMessage}}\n {{yield}}\n </div>\n </template>\n}\n"],"names":["FormFieldFeedback","Component","isError","args","errors","classes","formFeedback","useStyles","size","intent","class","errorMessage","join","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAmBe,MAAMA,0BAA0BC,SAAA,CAAU;EACvD,IAAIC,OAAAA,GAAmB;AACrB,IAAA,OACE,OAAO,IAAI,CAACC,IAAI,CAACC,MAAM,KAAK,WAAA,IAAe,IAAI,CAACD,IAAI,CAACD,OAAO,KAAK,IACnE;AACF,EAAA;EAEA,IAAIG,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAc,GAAGC,SAAA,EAAA;AAEzB,IAAA,OAAOD,YAAA,CAAa;AAClBE,MAAAA,IAAA,EAAM,IAAI,CAACL,IAAI,CAACK,IAAI;AACpBC,MAAAA,MAAA,EAAQ,IAAI,CAACP,OAAO,GAAG,QAAA,GAAW,SAAA;AAClCQ,MAAAA,KAAA,EAAO,IAAI,CAACP,IAAI,CAACO;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,YAAAA,GAAuB;IACzB,IAAI,CAAC,IAAI,CAACR,IAAI,CAACC,MAAM,EAAE,OAAO,EAAA;IAE9B,IAAI,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM,KAAK,QAAA,EAAU;AACxC,MAAA,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM;AACzB,IAAA,CAAA,MAAO;MACL,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM,CAACQ,IAAI,CAAC,IAAA,CAAA;AAC/B,IAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,uNAAA,EAWA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,7 +3,6 @@ import { useStyles } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
var _FormFieldHint;
|
|
7
6
|
class FormFieldHint extends Component {
|
|
8
7
|
get classes() {
|
|
9
8
|
const {
|
|
@@ -14,11 +13,12 @@ class FormFieldHint extends Component {
|
|
|
14
13
|
class: this.args.class
|
|
15
14
|
});
|
|
16
15
|
}
|
|
16
|
+
static {
|
|
17
|
+
setComponentTemplate(precompileTemplate("\n <div id={{@id}} class={{this.classes}} data-test-id=\"form-field-hint\" ...attributes>\n {{yield}}\n </div>\n ", {
|
|
18
|
+
strictMode: true
|
|
19
|
+
}), this);
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
|
-
_FormFieldHint = FormFieldHint;
|
|
19
|
-
setComponentTemplate(precompileTemplate("\n <div id={{@id}} class={{this.classes}} data-test-id=\"form-field-hint\" ...attributes>\n {{yield}}\n </div>\n ", {
|
|
20
|
-
strictMode: true
|
|
21
|
-
}), _FormFieldHint);
|
|
22
22
|
|
|
23
23
|
export { FormFieldHint as default };
|
|
24
24
|
//# sourceMappingURL=hint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint.js","sources":["../../../src/components/form-field/hint.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldHintArgs {\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldHintSignature {\n Args: FormFieldHintArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldHint extends Component<FormFieldHintSignature> {\n get classes() {\n const { formDescription } = useStyles();\n\n return formDescription({\n size: this.args.size,\n class: this.args.class\n });\n }\n\n <template>\n <div\n id={{@id}}\n class={{this.classes}}\n data-test-id=\"form-field-hint\"\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["FormFieldHint","Component","classes","formDescription","useStyles","size","args","class","
|
|
1
|
+
{"version":3,"file":"hint.js","sources":["../../../src/components/form-field/hint.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldHintArgs {\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldHintSignature {\n Args: FormFieldHintArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldHint extends Component<FormFieldHintSignature> {\n get classes() {\n const { formDescription } = useStyles();\n\n return formDescription({\n size: this.args.size,\n class: this.args.class\n });\n }\n\n <template>\n <div\n id={{@id}}\n class={{this.classes}}\n data-test-id=\"form-field-hint\"\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["FormFieldHint","Component","classes","formDescription","useStyles","size","args","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAiBe,MAAMA,sBAAsBC,SAAA,CAAU;EACnD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAiB,GAAGC,SAAA,EAAA;AAE5B,IAAA,OAAOD,eAAA,CAAgB;AACrBE,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AACnB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,+HAAA,EASA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { action } from '@ember/object';
|
|
4
3
|
import { on } from '@ember/modifier';
|
|
5
4
|
import { useStyles } from '@frontile/theme';
|
|
6
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
import { a as decorateMethodV2 } from '../../runtime-BPCpkOf1-B5Lbloj7.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
let FormFieldInput = (_class = (_FormFieldInput = class FormFieldInput extends Component {
|
|
9
|
+
class FormFieldInput extends Component {
|
|
11
10
|
get type() {
|
|
12
11
|
if (typeof this.args.type === 'string') {
|
|
13
12
|
return this.args.type;
|
|
@@ -19,11 +18,17 @@ let FormFieldInput = (_class = (_FormFieldInput = class FormFieldInput extends C
|
|
|
19
18
|
this.args.onInput(event.target.value, event);
|
|
20
19
|
}
|
|
21
20
|
}
|
|
21
|
+
static {
|
|
22
|
+
decorateMethodV2(this.prototype, "handleOnInput", [action]);
|
|
23
|
+
}
|
|
22
24
|
handleOnChange(event) {
|
|
23
25
|
if (typeof this.args.onChange === 'function') {
|
|
24
26
|
this.args.onChange(event.target.value, event);
|
|
25
27
|
}
|
|
26
28
|
}
|
|
29
|
+
static {
|
|
30
|
+
decorateMethodV2(this.prototype, "handleOnChange", [action]);
|
|
31
|
+
}
|
|
27
32
|
get classes() {
|
|
28
33
|
const {
|
|
29
34
|
input
|
|
@@ -34,12 +39,15 @@ let FormFieldInput = (_class = (_FormFieldInput = class FormFieldInput extends C
|
|
|
34
39
|
class: this.args.class
|
|
35
40
|
});
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
42
|
+
static {
|
|
43
|
+
setComponentTemplate(precompileTemplate("\n <input {{on \"input\" this.handleOnInput}} {{on \"change\" this.handleOnChange}} id={{@id}} value={{@value}} type={{this.type}} class={{this.classes}} data-test-id=\"form-field-input\" ...attributes />\n ", {
|
|
44
|
+
strictMode: true,
|
|
45
|
+
scope: () => ({
|
|
46
|
+
on
|
|
47
|
+
})
|
|
48
|
+
}), this);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
43
51
|
|
|
44
52
|
export { FormFieldInput as default };
|
|
45
53
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../../src/components/form-field/input.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldInputArgs {\n id?: string;\n type?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n value?: string;\n\n // Callback when oninput is triggered\n onInput?: (value: string, event: InputEvent) => void;\n\n // Callback when onchange is triggered\n onChange?: (value: string, event: InputEvent) => void;\n}\n\nexport interface FormFieldInputSignature {\n Args: FormFieldInputArgs;\n Element: HTMLInputElement;\n}\n\nexport default class FormFieldInput extends Component<FormFieldInputSignature> {\n get type(): string {\n if (typeof this.args.type === 'string') {\n return this.args.type;\n }\n return 'text';\n }\n\n @action handleOnInput(event: Event): void {\n if (typeof this.args.onInput === 'function') {\n this.args.onInput(\n (event.target as HTMLInputElement).value,\n event as InputEvent\n );\n }\n }\n\n @action handleOnChange(event: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(\n (event.target as HTMLInputElement).value,\n event as InputEvent\n );\n }\n }\n\n get classes() {\n const { input } = useStyles();\n\n return input({\n size: this.args.size\n }).input({\n class: this.args.class\n });\n }\n\n <template>\n <input\n {{on \"input\" this.handleOnInput}}\n {{on \"change\" this.handleOnChange}}\n id={{@id}}\n value={{@value}}\n type={{this.type}}\n class={{this.classes}}\n data-test-id=\"form-field-input\"\n ...attributes\n />\n </template>\n}\n"],"names":["FormFieldInput","Component","type","args","handleOnInput","event","onInput","target","value","handleOnChange","onChange","classes","input","useStyles","size","class","setComponentTemplate","precompileTemplate","strictMode","scope","on"
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../src/components/form-field/input.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldInputArgs {\n id?: string;\n type?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n value?: string;\n\n // Callback when oninput is triggered\n onInput?: (value: string, event: InputEvent) => void;\n\n // Callback when onchange is triggered\n onChange?: (value: string, event: InputEvent) => void;\n}\n\nexport interface FormFieldInputSignature {\n Args: FormFieldInputArgs;\n Element: HTMLInputElement;\n}\n\nexport default class FormFieldInput extends Component<FormFieldInputSignature> {\n get type(): string {\n if (typeof this.args.type === 'string') {\n return this.args.type;\n }\n return 'text';\n }\n\n @action handleOnInput(event: Event): void {\n if (typeof this.args.onInput === 'function') {\n this.args.onInput(\n (event.target as HTMLInputElement).value,\n event as InputEvent\n );\n }\n }\n\n @action handleOnChange(event: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(\n (event.target as HTMLInputElement).value,\n event as InputEvent\n );\n }\n }\n\n get classes() {\n const { input } = useStyles();\n\n return input({\n size: this.args.size\n }).input({\n class: this.args.class\n });\n }\n\n <template>\n <input\n {{on \"input\" this.handleOnInput}}\n {{on \"change\" this.handleOnChange}}\n id={{@id}}\n value={{@value}}\n type={{this.type}}\n class={{this.classes}}\n data-test-id=\"form-field-input\"\n ...attributes\n />\n </template>\n}\n"],"names":["FormFieldInput","Component","type","args","handleOnInput","event","onInput","target","value","n","prototype","action","handleOnChange","onChange","classes","input","useStyles","size","class","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;AAwBe,MAAMA,uBAAuBC,SAAA,CAAU;EACpD,IAAIC,IAAAA,GAAe;IACjB,IAAI,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,KAAK,QAAA,EAAU;AACtC,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI;AACvB,IAAA;AACA,IAAA,OAAO,MAAA;AACT,EAAA;EAEQE,aAAAA,CAAcC,KAAY,EAAQ;IACxC,IAAI,OAAO,IAAI,CAACF,IAAI,CAACG,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAACH,IAAI,CAACG,OAAO,CACdD,KAAA,CAAME,MAAM,CAAsBC,KAAK,EACxCH,KAAS,CAAA;AAEb,IAAA;AACF,EAAA;AAAA,EAAA;IAAAI,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CAPCC,MAAA,CAAA,CAAA;AAAA;EASOC,cAAAA,CAAeP,KAAY,EAAQ;IACzC,IAAI,OAAO,IAAI,CAACF,IAAI,CAACU,QAAQ,KAAK,UAAA,EAAY;AAC5C,MAAA,IAAI,CAACV,IAAI,CAACU,QAAQ,CACfR,KAAA,CAAME,MAAM,CAAsBC,KAAK,EACxCH,KAAS,CAAA;AAEb,IAAA;AACF,EAAA;AAAA,EAAA;IAAAI,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,gBAAA,EAAA,CAPCC,MAAA,CAAA,CAAA;AAAA;EASD,IAAIG,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAElB,IAAA,OAAOD,KAAA,CAAM;AACXE,MAAAA,IAAA,EAAM,IAAI,CAACd,IAAI,CAACc;KAClB,CAAA,CAAGF,KAAK,CAAC;AACPG,MAAAA,KAAA,EAAO,IAAI,CAACf,IAAI,CAACe;AACnB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,qNAAA,EAWA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,7 +3,6 @@ import { useStyles } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
var _FormFieldLabel;
|
|
7
6
|
class FormFieldLabel extends Component {
|
|
8
7
|
get classes() {
|
|
9
8
|
const {
|
|
@@ -18,11 +17,12 @@ class FormFieldLabel extends Component {
|
|
|
18
17
|
class: this.args.class
|
|
19
18
|
});
|
|
20
19
|
}
|
|
20
|
+
static {
|
|
21
|
+
setComponentTemplate(precompileTemplate("\n <label for={{@for}} class={{this.classes}} data-test-id=\"form-field-label\" ...attributes>\n {{yield}}\n </label>\n ", {
|
|
22
|
+
strictMode: true
|
|
23
|
+
}), this);
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
|
-
_FormFieldLabel = FormFieldLabel;
|
|
23
|
-
setComponentTemplate(precompileTemplate("\n <label for={{@for}} class={{this.classes}} data-test-id=\"form-field-label\" ...attributes>\n {{yield}}\n </label>\n ", {
|
|
24
|
-
strictMode: true
|
|
25
|
-
}), _FormFieldLabel);
|
|
26
26
|
|
|
27
27
|
export { FormFieldLabel as default };
|
|
28
28
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sources":["../../../src/components/form-field/label.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldLabelArgs {\n for?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldLabelSignature {\n Args: FormFieldLabelArgs;\n Element: HTMLLabelElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldLabel extends Component<FormFieldLabelSignature> {\n get classes() {\n const { label } = useStyles();\n\n const { base } = label({\n size: this.args.size || 'md'\n });\n return base({ class: this.args.class });\n }\n\n <template>\n <label\n for={{@for}}\n class={{this.classes}}\n data-test-id=\"form-field-label\"\n ...attributes\n >\n {{yield}}\n </label>\n </template>\n}\n"],"names":["FormFieldLabel","Component","classes","label","useStyles","base","size","args","class","
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../../../src/components/form-field/label.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormFieldLabelArgs {\n for?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\n\nexport interface FormFieldLabelSignature {\n Args: FormFieldLabelArgs;\n Element: HTMLLabelElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormFieldLabel extends Component<FormFieldLabelSignature> {\n get classes() {\n const { label } = useStyles();\n\n const { base } = label({\n size: this.args.size || 'md'\n });\n return base({ class: this.args.class });\n }\n\n <template>\n <label\n for={{@for}}\n class={{this.classes}}\n data-test-id=\"form-field-label\"\n ...attributes\n >\n {{yield}}\n </label>\n </template>\n}\n"],"names":["FormFieldLabel","Component","classes","label","useStyles","base","size","args","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAiBe,MAAMA,uBAAuBC,SAAA,CAAU;EACpD,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAElB,MAAM;AAAEC,MAAAA;KAAM,GAAGF,KAAA,CAAM;AACrBG,MAAAA,IAAA,EAAM,IAAI,CAACC,IAAI,CAACD,IAAI,IAAI;AAC1B,KAAA,CAAA;AACA,IAAA,OAAOD,IAAA,CAAK;AAAEG,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AAAM,KAAA,CAAA;AACvC,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sIAAA,EASA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|