@frontile/forms-legacy 0.17.0-beta.5 → 0.17.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +40 -43
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { guidFor } from '@ember/object/internals';
|
|
4
3
|
import { hash } from '@ember/helper';
|
|
@@ -12,33 +11,30 @@ import FormFieldTextarea from './form-field/textarea.js';
|
|
|
12
11
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
13
12
|
import { setComponentTemplate } from '@ember/component';
|
|
14
13
|
|
|
15
|
-
var _FormField;
|
|
16
14
|
class FormField extends Component {
|
|
17
|
-
|
|
18
|
-
super(...args);
|
|
19
|
-
_defineProperty(this, "id", guidFor(this));
|
|
20
|
-
}
|
|
15
|
+
id = guidFor(this);
|
|
21
16
|
get hintId() {
|
|
22
17
|
return this.id + '-hint';
|
|
23
18
|
}
|
|
24
19
|
get feedbackId() {
|
|
25
20
|
return this.id + '-feedback';
|
|
26
21
|
}
|
|
22
|
+
static {
|
|
23
|
+
setComponentTemplate(precompileTemplate("\n <div ...attributes>\n {{yield (hash id=this.id hintId=this.hintId feedbackId=this.feedbackId Label=(component FormFieldLabel for=this.id size=@size) Hint=(component FormFieldHint id=this.hintId size=@size) Feedback=(component FormFieldFeedback id=this.feedbackId size=@size) Input=(component FormFieldInput id=this.id size=@size) Textarea=(component FormFieldTextarea id=this.id size=@size) Checkbox=(component FormFieldCheckbox id=this.id size=@size) Radio=(component FormFieldRadio id=this.id size=@size))}}\n </div>\n ", {
|
|
24
|
+
strictMode: true,
|
|
25
|
+
scope: () => ({
|
|
26
|
+
hash,
|
|
27
|
+
FormFieldLabel,
|
|
28
|
+
FormFieldHint,
|
|
29
|
+
FormFieldFeedback,
|
|
30
|
+
FormFieldInput,
|
|
31
|
+
FormFieldTextarea,
|
|
32
|
+
FormFieldCheckbox,
|
|
33
|
+
FormFieldRadio
|
|
34
|
+
})
|
|
35
|
+
}), this);
|
|
36
|
+
}
|
|
27
37
|
}
|
|
28
|
-
_FormField = FormField;
|
|
29
|
-
setComponentTemplate(precompileTemplate("\n <div ...attributes>\n {{yield (hash id=this.id hintId=this.hintId feedbackId=this.feedbackId Label=(component FormFieldLabel for=this.id size=@size) Hint=(component FormFieldHint id=this.hintId size=@size) Feedback=(component FormFieldFeedback id=this.feedbackId size=@size) Input=(component FormFieldInput id=this.id size=@size) Textarea=(component FormFieldTextarea id=this.id size=@size) Checkbox=(component FormFieldCheckbox id=this.id size=@size) Radio=(component FormFieldRadio id=this.id size=@size))}}\n </div>\n ", {
|
|
30
|
-
strictMode: true,
|
|
31
|
-
scope: () => ({
|
|
32
|
-
hash,
|
|
33
|
-
FormFieldLabel,
|
|
34
|
-
FormFieldHint,
|
|
35
|
-
FormFieldFeedback,
|
|
36
|
-
FormFieldInput,
|
|
37
|
-
FormFieldTextarea,
|
|
38
|
-
FormFieldCheckbox,
|
|
39
|
-
FormFieldRadio
|
|
40
|
-
})
|
|
41
|
-
}), _FormField);
|
|
42
38
|
|
|
43
39
|
export { FormField as default };
|
|
44
40
|
//# sourceMappingURL=form-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.js","sources":["../../src/components/form-field.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport FormFieldCheckbox from './form-field/checkbox';\nimport FormFieldFeedback from './form-field/feedback';\nimport FormFieldHint from './form-field/hint';\nimport FormFieldInput from './form-field/input';\nimport FormFieldLabel from './form-field/label';\nimport FormFieldRadio from './form-field/radio';\nimport FormFieldTextarea from './form-field/textarea';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormFieldArgs {\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport interface FormFieldSignature {\n Args: FormFieldArgs;\n Blocks: {\n default: [\n {\n id: string;\n hintId: string;\n feedbackId: string;\n Label: WithBoundArgs<typeof FormFieldLabel, 'for'> &\n WithBoundArgs<typeof FormFieldLabel, 'size'>;\n Hint: WithBoundArgs<typeof FormFieldHint, 'id'> &\n WithBoundArgs<typeof FormFieldHint, 'size'>;\n Feedback: WithBoundArgs<typeof FormFieldFeedback, 'id'> &\n WithBoundArgs<typeof FormFieldFeedback, 'size'>;\n Input: WithBoundArgs<typeof FormFieldInput, 'id'> &\n WithBoundArgs<typeof FormFieldInput, 'size'>;\n Textarea: WithBoundArgs<typeof FormFieldTextarea, 'id'> &\n WithBoundArgs<typeof FormFieldTextarea, 'size'>;\n Checkbox: WithBoundArgs<typeof FormFieldCheckbox, 'id'> &\n WithBoundArgs<typeof FormFieldCheckbox, 'size'>;\n Radio: WithBoundArgs<typeof FormFieldRadio, 'id'> &\n WithBoundArgs<typeof FormFieldRadio, 'size'>;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormField extends Component<FormFieldSignature> {\n id = guidFor(this);\n\n get hintId(): string {\n return this.id + '-hint';\n }\n\n get feedbackId(): string {\n return this.id + '-feedback';\n }\n\n <template>\n <div ...attributes>\n {{yield\n (hash\n id=this.id\n hintId=this.hintId\n feedbackId=this.feedbackId\n Label=(component FormFieldLabel for=this.id size=@size)\n Hint=(component FormFieldHint id=this.hintId size=@size)\n Feedback=(component FormFieldFeedback id=this.feedbackId size=@size)\n Input=(component FormFieldInput id=this.id size=@size)\n Textarea=(component FormFieldTextarea id=this.id size=@size)\n Checkbox=(component FormFieldCheckbox id=this.id size=@size)\n Radio=(component FormFieldRadio id=this.id size=@size)\n )\n }}\n </div>\n </template>\n}\n"],"names":["FormField","Component","
|
|
1
|
+
{"version":3,"file":"form-field.js","sources":["../../src/components/form-field.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport FormFieldCheckbox from './form-field/checkbox';\nimport FormFieldFeedback from './form-field/feedback';\nimport FormFieldHint from './form-field/hint';\nimport FormFieldInput from './form-field/input';\nimport FormFieldLabel from './form-field/label';\nimport FormFieldRadio from './form-field/radio';\nimport FormFieldTextarea from './form-field/textarea';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormFieldArgs {\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport interface FormFieldSignature {\n Args: FormFieldArgs;\n Blocks: {\n default: [\n {\n id: string;\n hintId: string;\n feedbackId: string;\n Label: WithBoundArgs<typeof FormFieldLabel, 'for'> &\n WithBoundArgs<typeof FormFieldLabel, 'size'>;\n Hint: WithBoundArgs<typeof FormFieldHint, 'id'> &\n WithBoundArgs<typeof FormFieldHint, 'size'>;\n Feedback: WithBoundArgs<typeof FormFieldFeedback, 'id'> &\n WithBoundArgs<typeof FormFieldFeedback, 'size'>;\n Input: WithBoundArgs<typeof FormFieldInput, 'id'> &\n WithBoundArgs<typeof FormFieldInput, 'size'>;\n Textarea: WithBoundArgs<typeof FormFieldTextarea, 'id'> &\n WithBoundArgs<typeof FormFieldTextarea, 'size'>;\n Checkbox: WithBoundArgs<typeof FormFieldCheckbox, 'id'> &\n WithBoundArgs<typeof FormFieldCheckbox, 'size'>;\n Radio: WithBoundArgs<typeof FormFieldRadio, 'id'> &\n WithBoundArgs<typeof FormFieldRadio, 'size'>;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormField extends Component<FormFieldSignature> {\n id = guidFor(this);\n\n get hintId(): string {\n return this.id + '-hint';\n }\n\n get feedbackId(): string {\n return this.id + '-feedback';\n }\n\n <template>\n <div ...attributes>\n {{yield\n (hash\n id=this.id\n hintId=this.hintId\n feedbackId=this.feedbackId\n Label=(component FormFieldLabel for=this.id size=@size)\n Hint=(component FormFieldHint id=this.hintId size=@size)\n Feedback=(component FormFieldFeedback id=this.feedbackId size=@size)\n Input=(component FormFieldInput id=this.id size=@size)\n Textarea=(component FormFieldTextarea id=this.id size=@size)\n Checkbox=(component FormFieldCheckbox id=this.id size=@size)\n Radio=(component FormFieldRadio id=this.id size=@size)\n )\n }}\n </div>\n </template>\n}\n"],"names":["FormField","Component","id","guidFor","hintId","feedbackId","setComponentTemplate","precompileTemplate","strictMode","scope","hash","FormFieldLabel","FormFieldHint","FormFieldFeedback","FormFieldInput","FormFieldTextarea","FormFieldCheckbox","FormFieldRadio"],"mappings":";;;;;;;;;;;;;AA4Ce,MAAMA,kBAAkBC,SAAU,CAAA;AAC/CC,EAAAA,EAAK,GAAAC,OAAA,CAAQ,IAAI,CAAE;EAEnB,IAAIC,MAAAA,GAAiB;AACnB,IAAA,OAAO,IAAI,CAACF,EAAE,GAAG,OAAA;AACnB;EAEA,IAAIG,UAAAA,GAAqB;AACvB,IAAA,OAAO,IAAI,CAACH,EAAE,GAAG,WAAA;AACnB;AAEA,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAiBA,0hBAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;QAAAC,cAAA;QAAAC,aAAA;QAAAC,iBAAA;QAAAC,cAAA;QAAAC,iBAAA;QAAAC,iBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -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 { useStyles } from '@frontile/theme';
|
|
|
11
7
|
import FormField from './form-field.js';
|
|
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 FormInputBase 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,20 +32,19 @@ let FormInputBase = (_class = class FormInputBase extends Component {
|
|
|
34
32
|
this.args.onFocusIn(event);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
35
|
+
static {
|
|
36
|
+
decorateMethodV2(this.prototype, "handleFocusIn", [action]);
|
|
37
|
+
}
|
|
37
38
|
handleFocusOut(event) {
|
|
38
39
|
this.shouldShowErrorFeedback = true;
|
|
39
40
|
if (typeof this.args.onFocusOut === 'function') {
|
|
40
41
|
this.args.onFocusOut(event);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
enumerable: true,
|
|
46
|
-
writable: true,
|
|
47
|
-
initializer: function () {
|
|
48
|
-
return false;
|
|
44
|
+
static {
|
|
45
|
+
decorateMethodV2(this.prototype, "handleFocusOut", [action]);
|
|
49
46
|
}
|
|
50
|
-
}
|
|
47
|
+
}
|
|
51
48
|
class FormInput extends FormInputBase {
|
|
52
49
|
get classes() {
|
|
53
50
|
const {
|
|
@@ -74,16 +71,17 @@ class FormInput extends FormInputBase {
|
|
|
74
71
|
feedback: feedback()
|
|
75
72
|
};
|
|
76
73
|
}
|
|
74
|
+
static {
|
|
75
|
+
setComponentTemplate(precompileTemplate("\n <FormField @size={{@size}} class={{this.classes.base}} 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 <f.Input {{on \"focus\" this.handleFocusIn}} {{on \"blur\" this.handleFocusOut}} @onInput={{@onInput}} @onChange={{@onChange}} @value={{@value}} @type={{@type}} @class={{this.classes.input}} aria-invalid={{if this.showErrorFeedback \"true\"}} aria-describedby=\"{{if @hint f.hintId}}{{if this.showErrorFeedback (concat \" \" f.feedbackId)}}\" ...attributes />\n\n {{yield}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n ", {
|
|
76
|
+
strictMode: true,
|
|
77
|
+
scope: () => ({
|
|
78
|
+
FormField,
|
|
79
|
+
concat,
|
|
80
|
+
on
|
|
81
|
+
})
|
|
82
|
+
}), this);
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
|
-
_FormInput = FormInput;
|
|
79
|
-
setComponentTemplate(precompileTemplate("\n <FormField @size={{@size}} class={{this.classes.base}} 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 <f.Input {{on \"focus\" this.handleFocusIn}} {{on \"blur\" this.handleFocusOut}} @onInput={{@onInput}} @onChange={{@onChange}} @value={{@value}} @type={{@type}} @class={{this.classes.input}} aria-invalid={{if this.showErrorFeedback \"true\"}} aria-describedby=\"{{if @hint f.hintId}}{{if this.showErrorFeedback (concat \" \" f.feedbackId)}}\" ...attributes />\n\n {{yield}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n ", {
|
|
80
|
-
strictMode: true,
|
|
81
|
-
scope: () => ({
|
|
82
|
-
FormField,
|
|
83
|
-
concat,
|
|
84
|
-
on
|
|
85
|
-
})
|
|
86
|
-
}), _FormInput);
|
|
87
85
|
|
|
88
86
|
export { FormInputBase, FormInput as default };
|
|
89
87
|
//# sourceMappingURL=form-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-input.js","sources":["../../src/components/form-input.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\n\nexport interface FormInputArgs {\n /**\n * The value to be used in the input.\n * You must also pass `onChange` or `onInput` to update its value.\n */\n value: string | undefined;\n\n /**\n * The input type\n * @defaultValue 'text'\n */\n type?: string;\n\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 /** CSS classes to be added in the input element */\n inputClass?: 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 /** Callback when onfocus is triggered */\n onFocusIn?: (event: FocusEvent) => void;\n\n /** Callback when onblur is triggered */\n onFocusOut?: (event: FocusEvent) => void;\n}\n\nexport interface FormInputBaseSignature {\n Args: FormInputArgs;\n}\n\nexport interface FormInputSignature extends FormInputBaseSignature {\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport class FormInputBase<\n T extends FormInputBaseSignature\n> extends Component<T> {\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 handleFocusIn(event: FocusEvent): void {\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onFocusIn === 'function') {\n this.args.onFocusIn(event);\n }\n }\n\n @action handleFocusOut(event: FocusEvent): void {\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onFocusOut === 'function') {\n this.args.onFocusOut(event);\n }\n }\n}\n\nexport default class FormInput extends FormInputBase<FormInputSignature> {\n get classes() {\n const { formInput } = useStyles();\n\n const { base, label, input, hint, feedback } = formInput({\n size: this.args.size\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n input: input({ class: this.args.inputClass }),\n hint: hint(),\n feedback: feedback()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} 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 <f.Input\n {{on \"focus\" this.handleFocusIn}}\n {{on \"blur\" this.handleFocusOut}}\n @onInput={{@onInput}}\n @onChange={{@onChange}}\n @value={{@value}}\n @type={{@type}}\n @class={{this.classes.input}}\n aria-invalid={{if this.showErrorFeedback \"true\"}}\n aria-describedby=\"{{if @hint f.hintId}}{{if\n this.showErrorFeedback\n (concat ' ' f.feedbackId)\n }}\"\n ...attributes\n />\n\n {{yield}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormInputBase","
|
|
1
|
+
{"version":3,"file":"form-input.js","sources":["../../src/components/form-input.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\n\nexport interface FormInputArgs {\n /**\n * The value to be used in the input.\n * You must also pass `onChange` or `onInput` to update its value.\n */\n value: string | undefined;\n\n /**\n * The input type\n * @defaultValue 'text'\n */\n type?: string;\n\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 /** CSS classes to be added in the input element */\n inputClass?: 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 /** Callback when onfocus is triggered */\n onFocusIn?: (event: FocusEvent) => void;\n\n /** Callback when onblur is triggered */\n onFocusOut?: (event: FocusEvent) => void;\n}\n\nexport interface FormInputBaseSignature {\n Args: FormInputArgs;\n}\n\nexport interface FormInputSignature extends FormInputBaseSignature {\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport class FormInputBase<\n T extends FormInputBaseSignature\n> extends Component<T> {\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 handleFocusIn(event: FocusEvent): void {\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onFocusIn === 'function') {\n this.args.onFocusIn(event);\n }\n }\n\n @action handleFocusOut(event: FocusEvent): void {\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onFocusOut === 'function') {\n this.args.onFocusOut(event);\n }\n }\n}\n\nexport default class FormInput extends FormInputBase<FormInputSignature> {\n get classes() {\n const { formInput } = useStyles();\n\n const { base, label, input, hint, feedback } = formInput({\n size: this.args.size\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n input: input({ class: this.args.inputClass }),\n hint: hint(),\n feedback: feedback()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} 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 <f.Input\n {{on \"focus\" this.handleFocusIn}}\n {{on \"blur\" this.handleFocusOut}}\n @onInput={{@onInput}}\n @onChange={{@onChange}}\n @value={{@value}}\n @type={{@type}}\n @class={{this.classes.input}}\n aria-invalid={{if this.showErrorFeedback \"true\"}}\n aria-describedby=\"{{if @hint f.hintId}}{{if\n this.showErrorFeedback\n (concat ' ' f.feedbackId)\n }}\"\n ...attributes\n />\n\n {{yield}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormInputBase","Component","g","prototype","tracked","i","void 0","showErrorFeedback","args","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleFocusIn","event","onFocusIn","n","action","handleFocusOut","onFocusOut","FormInput","classes","formInput","useStyles","base","label","input","hint","feedback","size","class","containerClass","inputClass","setComponentTemplate","precompileTemplate","strictMode","scope","FormField","concat","on"],"mappings":";;;;;;;;;;;AAgEO,MAAMA,aAAA,SAEHC,SAAU,CAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,yBAAA,EAAA,CACjBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,KAAA,CAAA;EAEzC,IAAIC,iBAAAA,GAA6B;AAC/B,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,KAAO,EAAA;AAChC,MAAA,OAAO,KAAA;AACT;AAEA,IAAA,IACE,CAAC,IAAI,CAACD,IAAI,CAACE,SAAS,IAClB,IAA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EAAO,IAAI,CAACxB,IAAI,CAACyB;AACnB,OAAA,CAAA;MACAN,KAAO,EAAAA,KAAA,EAAA;MACPC,KAAA,EAAOA,KAAM,CAAA;AAAEI,QAAAA,KAAA,EAAO,IAAI,CAACxB,IAAI,CAAC0B;AAAW,OAAA,CAAA;MAC3CL,IAAM,EAAAA,IAAA,EAAA;MACNC,QAAU,EAAAA,QAAA;KACZ;AACF;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAoCA,i2BAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,SAAA;QAAAC,MAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -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 { useStyles } from '@frontile/theme';
|
|
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 FormRadioGroup 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 FormRadioGroup = (_class = (_FormRadioGroup = class FormRadioGroup extends C
|
|
|
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
|
formRadioGroup
|
|
@@ -57,21 +58,17 @@ let FormRadioGroup = (_class = (_FormRadioGroup = class FormRadioGroup extends C
|
|
|
57
58
|
formRadio: formRadio()
|
|
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=\"radiogroup\" ...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\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield (component FormRadio checked=@value privateContainerClass=this.classes.formRadio _parentOnChange=this.handleChange size=@size name=(concat f.id \"-radio-group\"))}}\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
|
+
FormRadio,
|
|
67
|
+
concat
|
|
68
|
+
})
|
|
69
|
+
}), this);
|
|
73
70
|
}
|
|
74
|
-
}
|
|
71
|
+
}
|
|
75
72
|
|
|
76
73
|
export { FormRadioGroup as default };
|
|
77
74
|
//# sourceMappingURL=form-radio-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-radio-group.js","sources":["../../src/components/form-radio-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport FormRadio from './form-radio';\nimport FormField from './form-field';\nimport { useStyles } from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormRadioGroupArgs {\n value: string | number | boolean | undefined;\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\n /** Default callback added to the yielded FormRadio component, called when onchange is triggered */\n onChange?: (value: unknown, event: Event) => void;\n}\n\nexport interface FormRadioGroupSignature {\n Args: FormRadioGroupArgs;\n Blocks: {\n default: [\n radio: WithBoundArgs<typeof FormRadio, 'checked'> &\n WithBoundArgs<typeof FormRadio, 'privateContainerClass'> &\n WithBoundArgs<typeof FormRadio, '_parentOnChange'> &\n WithBoundArgs<typeof FormRadio, 'size'> &\n WithBoundArgs<typeof FormRadio, 'name'>\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormRadioGroup extends Component<FormRadioGroupSignature> {\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 { formRadioGroup } = useStyles();\n const { base, label, formRadio, hint, feedback } = formRadioGroup({\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 formRadio: formRadio()\n };\n }\n\n <template>\n <FormField\n @size={{@size}}\n class={{this.classes.base}}\n role=\"radiogroup\"\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\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield\n (component\n FormRadio\n checked=@value\n privateContainerClass=this.classes.formRadio\n _parentOnChange=this.handleChange\n size=@size\n name=(concat f.id \"-radio-group\")\n )\n }}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormRadioGroup","Component","
|
|
1
|
+
{"version":3,"file":"form-radio-group.js","sources":["../../src/components/form-radio-group.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport FormRadio from './form-radio';\nimport FormField from './form-field';\nimport { useStyles } from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface FormRadioGroupArgs {\n value: string | number | boolean | undefined;\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\n /** Default callback added to the yielded FormRadio component, called when onchange is triggered */\n onChange?: (value: unknown, event: Event) => void;\n}\n\nexport interface FormRadioGroupSignature {\n Args: FormRadioGroupArgs;\n Blocks: {\n default: [\n radio: WithBoundArgs<typeof FormRadio, 'checked'> &\n WithBoundArgs<typeof FormRadio, 'privateContainerClass'> &\n WithBoundArgs<typeof FormRadio, '_parentOnChange'> &\n WithBoundArgs<typeof FormRadio, 'size'> &\n WithBoundArgs<typeof FormRadio, 'name'>\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormRadioGroup extends Component<FormRadioGroupSignature> {\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 { formRadioGroup } = useStyles();\n const { base, label, formRadio, hint, feedback } = formRadioGroup({\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 formRadio: formRadio()\n };\n }\n\n <template>\n <FormField\n @size={{@size}}\n class={{this.classes.base}}\n role=\"radiogroup\"\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\n {{@hint}}\n </f.Hint>\n {{/if}}\n\n {{yield\n (component\n FormRadio\n checked=@value\n privateContainerClass=this.classes.formRadio\n _parentOnChange=this.handleChange\n size=@size\n name=(concat f.id \"-radio-group\")\n )\n }}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormRadioGroup","Component","g","prototype","tracked","i","void 0","showErrorFeedback","args","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleChange","value","event","onChange","n","action","classes","formRadioGroup","useStyles","base","label","formRadio","hint","feedback","isInline","class","containerClass","setComponentTemplate","precompileTemplate","strictMode","scope","FormField","FormRadio","concat"],"mappings":";;;;;;;;;;;AAgDe,MAAMA,uBAAuBC,SAAU,CAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,yBAAA,EAAA,CACnDC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,KAAA,CAAA;EAEzC,IAAIC,iBAAAA,GAA6B;AAC/B,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,KAAO,EAAA;AAChC,MAAA,OAAO,KAAA;AACT;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,CAC1B,EAAA;AACA,MAAA,OAAO,IAAA;AACT,KAAO,MAAA;AACL,MAAA,OAAO,KAAA;AACT;AACF;AAEQC,EAAAA,YAAAA,CAAaC,KAAc,EAAEC,KAAY,EAAQ;IACvD,IAAI,CAACL,uBAAuB,GAAG,IAAA;IAE/B,IAAI,OAAO,IAAI,CAACJ,IAAI,CAACU,QAAQ,KAAK,UAAY,EAAA;MAC5C,IAAI,CAACV,IAAI,CAACU,QAAQ,CAACF,KAAO,EAAAC,KAAA,CAAA;AAC5B;AACF;AAAA,EAAA;IAAAE,gBAAA,CAAA,IAAA,CAAAhB,SAAA,EAAA,cAAA,EAAA,CANCiB,MAAA,CAAA,CAAA;AAAA;EAQD,IAAIC,OAAUA,GAAA;IACZ,MAAM;AAAEC,MAAAA;KAAgB,GAAGC,SAAA,EAAA;IAC3B,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC,SAAS;MAAEC,IAAI;AAAEC,MAAAA;KAAU,GAAGN,cAAe,CAAA;AAChEO,MAAAA,QAAA,EAAU,IAAI,CAACrB,IAAI,CAACqB;AACtB,KAAA,CAAA;IAEA,OAAO;MACLL,IAAA,EAAMA,IAAK,CAAA;AACTM,QAAAA,KAAA,EAAO,IAAI,CAACtB,IAAI,CAACuB;AACnB,OAAA,CAAA;MACAN,KAAO,EAAAA,KAAA,EAAA;MACPE,IAAM,EAAAA,IAAA,EAAA;MACNC,QAAU,EAAAA,QAAA,EAAA;MACVF,SAAW,EAAAA,SAAA;KACb;AACF;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAoCA,urBAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,SAAA;QAAAC,SAAA;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 FormField from './form-field.js';
|
|
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 FormRadio = (_class = (_FormRadio = class FormRadio extends Component {
|
|
9
|
+
class FormRadio extends Component {
|
|
11
10
|
handleChange(value, event) {
|
|
12
11
|
event.preventDefault();
|
|
13
12
|
if (typeof this.args.onChange === 'function') {
|
|
@@ -17,6 +16,9 @@ let FormRadio = (_class = (_FormRadio = class FormRadio extends Component {
|
|
|
17
16
|
this.args._parentOnChange(value, event);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
19
|
+
static {
|
|
20
|
+
decorateMethodV2(this.prototype, "handleChange", [action]);
|
|
21
|
+
}
|
|
20
22
|
get isChecked() {
|
|
21
23
|
return this.args.checked == this.args.value;
|
|
22
24
|
}
|
|
@@ -52,12 +54,15 @@ let FormRadio = (_class = (_FormRadio = class FormRadio extends Component {
|
|
|
52
54
|
radio: radio()
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
57
|
+
static {
|
|
58
|
+
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.Radio @onChange={{this.handleChange}} @value={{@value}} @checked={{@checked}} @name={{@name}} @class={{this.classes.radio}} 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 ", {
|
|
59
|
+
strictMode: true,
|
|
60
|
+
scope: () => ({
|
|
61
|
+
FormField
|
|
62
|
+
})
|
|
63
|
+
}), this);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
61
66
|
|
|
62
67
|
export { FormRadio as default };
|
|
63
68
|
//# sourceMappingURL=form-radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-radio.js","sources":["../../src/components/form-radio.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport FormField from './form-field';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormRadioArgs {\n /** The input field label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /**\n * The value to be used in the radio button.\n * You must also pass `onChange` to update its value.\n */\n value: string | number | boolean | undefined;\n /**\n * The current checked value.\n * This will be used to compare against the `value` argument,\n * if equal, the radio will me marked as checked.\n */\n checked: unknown;\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: unknown, event: Event) => void;\n\n /**\n * Internal function for InputRadioGroup\n * @ignore\n **/\n _parentOnChange?: (value: unknown, event: Event) => void;\n\n /** CSS classes to be added in the container element, in be used in for group\n * @ignore*/\n privateContainerClass?: string;\n}\n\nexport interface FormRadioSignature {\n Args: FormRadioArgs;\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormRadio extends Component<FormRadioSignature> {\n @action handleChange(value: unknown, event: Event): void {\n event.preventDefault();\n\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 isChecked(): boolean {\n return this.args.checked == this.args.value;\n }\n\n get classes() {\n const { formRadio } = useStyles();\n\n const { base, label, radio, hint, labelContainer, inputContainer } =\n formRadio({\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 radio: radio()\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.Radio\n @onChange={{this.handleChange}}\n @value={{@value}}\n @checked={{@checked}}\n @name={{@name}}\n @class={{this.classes.radio}}\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":["FormRadio","Component","handleChange","value","event","preventDefault","args","onChange","_parentOnChange","isChecked","checked","classes","formRadio","useStyles","base","label","radio","hint","labelContainer","inputContainer","size","containerClasses","containerClass","privateContainerClass","class","setComponentTemplate","precompileTemplate","strictMode","scope","FormField"
|
|
1
|
+
{"version":3,"file":"form-radio.js","sources":["../../src/components/form-radio.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport FormField from './form-field';\nimport { useStyles } from '@frontile/theme';\n\nexport interface FormRadioArgs {\n /** The input field label */\n label?: string;\n /** A help text to be displayed */\n hint?: string;\n /**\n * The value to be used in the radio button.\n * You must also pass `onChange` to update its value.\n */\n value: string | number | boolean | undefined;\n /**\n * The current checked value.\n * This will be used to compare against the `value` argument,\n * if equal, the radio will me marked as checked.\n */\n checked: unknown;\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: unknown, event: Event) => void;\n\n /**\n * Internal function for InputRadioGroup\n * @ignore\n **/\n _parentOnChange?: (value: unknown, event: Event) => void;\n\n /** CSS classes to be added in the container element, in be used in for group\n * @ignore*/\n privateContainerClass?: string;\n}\n\nexport interface FormRadioSignature {\n Args: FormRadioArgs;\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class FormRadio extends Component<FormRadioSignature> {\n @action handleChange(value: unknown, event: Event): void {\n event.preventDefault();\n\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 isChecked(): boolean {\n return this.args.checked == this.args.value;\n }\n\n get classes() {\n const { formRadio } = useStyles();\n\n const { base, label, radio, hint, labelContainer, inputContainer } =\n formRadio({\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 radio: radio()\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.Radio\n @onChange={{this.handleChange}}\n @value={{@value}}\n @checked={{@checked}}\n @name={{@name}}\n @class={{this.classes.radio}}\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":["FormRadio","Component","handleChange","value","event","preventDefault","args","onChange","_parentOnChange","n","prototype","action","isChecked","checked","classes","formRadio","useStyles","base","label","radio","hint","labelContainer","inputContainer","size","containerClasses","containerClass","privateContainerClass","class","setComponentTemplate","precompileTemplate","strictMode","scope","FormField"],"mappings":";;;;;;;;AAiDe,MAAMA,kBAAkBC,SAAU,CAAA;AACvCC,EAAAA,YAAAA,CAAaC,KAAc,EAAEC,KAAY,EAAQ;IACvDA,KAAA,CAAMC,cAAc,EAAA;IAEpB,IAAI,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,UAAY,EAAA;MAC5C,IAAI,CAACD,IAAI,CAACC,QAAQ,CAACJ,KAAO,EAAAC,KAAA,CAAA;AAC5B;IAEA,IAAI,OAAO,IAAI,CAACE,IAAI,CAACE,eAAe,KAAK,UAAY,EAAA;MACnD,IAAI,CAACF,IAAI,CAACE,eAAe,CAACL,KAAO,EAAAC,KAAA,CAAA;AACnC;AACF;AAAA,EAAA;IAAAK,gBAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAVCC,MAAA,CAAA,CAAA;AAAA;EAYD,IAAIC,SAAAA,GAAqB;IACvB,OAAO,IAAI,CAACN,IAAI,CAACO,OAAO,IAAI,IAAI,CAACP,IAAI,CAACH,KAAK;AAC7C;EAEA,IAAIW,OAAUA,GAAA;IACZ,MAAM;AAAEC,MAAAA;KAAW,GAAGC,SAAA,EAAA;IAEtB,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC,KAAK;MAAEC,IAAI;MAAEC,cAAc;AAAEC,MAAAA;KAAgB,GAChEP,SAAU,CAAA;AACRQ,MAAAA,IAAA,EAAM,IAAI,CAACjB,IAAI,CAACiB;AAClB,KAAA,CAAA;IAEF,IAAIC,gBAAmB,GAAA,EAAA;AACvB,IAAA,IAAI,IAAI,CAAClB,IAAI,CAACmB,cAAc,EAAE;AAC5BD,MAAAA,gBAAA,GAAmB,IAAI,CAAClB,IAAI,CAACmB,cAAc;AAC7C;AACA,IAAA,IAAI,IAAI,CAACnB,IAAI,CAACoB,qBAAqB,EAAE;AACnCF,MAAAA,gBAAA,IAAoB,GAAM,GAAA,IAAI,CAAClB,IAAI,CAACoB,qBAAqB;AAC3D;IAEA,OAAO;MACLT,IAAA,EAAMA,IAAK,CAAA;AACTU,QAAAA,KAAO,EAAAH;AACT,OAAA,CAAA;MACAN,KAAO,EAAAA,KAAA,EAAA;MACPI,cAAgB,EAAAA,cAAA,EAAA;MAChBD,cAAgB,EAAAA,cAAA,EAAA;MAChBD,IAAM,EAAAA,IAAA,EAAA;MACND,KAAO,EAAAA,KAAA;KACT;AACF;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAiCA,83BAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -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 { tracked } from '@glimmer/tracking';
|
|
7
3
|
import { action } from '@ember/object';
|
|
@@ -13,13 +9,23 @@ import { concat } from '@ember/helper';
|
|
|
13
9
|
import { useStyles } from '@frontile/theme';
|
|
14
10
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
15
11
|
import { setComponentTemplate } from '@ember/component';
|
|
12
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../runtime-BPCpkOf1-B5Lbloj7.js';
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
class FormSelect extends Component {
|
|
15
|
+
static {
|
|
16
|
+
decorateFieldV2(this.prototype, "shouldShowErrorFeedback", [tracked], function () {
|
|
17
|
+
return false;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
#shouldShowErrorFeedback = (initializeDeferredDecorator(this, "shouldShowErrorFeedback"), void 0);
|
|
21
|
+
static {
|
|
22
|
+
decorateFieldV2(this.prototype, "isOpen", [tracked], function () {
|
|
23
|
+
return false;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
#isOpen = (initializeDeferredDecorator(this, "isOpen"), void 0);
|
|
19
27
|
constructor(owner, args) {
|
|
20
28
|
super(owner, args);
|
|
21
|
-
_initializerDefineProperty(this, "shouldShowErrorFeedback", _descriptor, this);
|
|
22
|
-
_initializerDefineProperty(this, "isOpen", _descriptor2, this);
|
|
23
29
|
assert('<FormSelect> requires an `@onChange` function', this.args.onChange && typeof this.args.onChange === 'function');
|
|
24
30
|
}
|
|
25
31
|
get showErrorFeedback() {
|
|
@@ -39,6 +45,9 @@ let FormSelect = (_class = (_FormSelect = class FormSelect extends Component {
|
|
|
39
45
|
this.args.onOpen(select, event);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
48
|
+
static {
|
|
49
|
+
decorateMethodV2(this.prototype, "handleOpen", [action]);
|
|
50
|
+
}
|
|
42
51
|
handleClose(select, event) {
|
|
43
52
|
this.isOpen = false;
|
|
44
53
|
this.shouldShowErrorFeedback = true;
|
|
@@ -46,6 +55,9 @@ let FormSelect = (_class = (_FormSelect = class FormSelect extends Component {
|
|
|
46
55
|
this.args.onClose(select, event);
|
|
47
56
|
}
|
|
48
57
|
}
|
|
58
|
+
static {
|
|
59
|
+
decorateMethodV2(this.prototype, "handleClose", [action]);
|
|
60
|
+
}
|
|
49
61
|
handleFocusIn(select, event) {
|
|
50
62
|
this.shouldShowErrorFeedback = false;
|
|
51
63
|
if (typeof this.args.onFocusIn === 'function') {
|
|
@@ -56,6 +68,9 @@ let FormSelect = (_class = (_FormSelect = class FormSelect extends Component {
|
|
|
56
68
|
this.args.onFocus(select, event);
|
|
57
69
|
}
|
|
58
70
|
}
|
|
71
|
+
static {
|
|
72
|
+
decorateMethodV2(this.prototype, "handleFocusIn", [action]);
|
|
73
|
+
}
|
|
59
74
|
handleFocusOut(select, event) {
|
|
60
75
|
if (!this.isOpen) {
|
|
61
76
|
this.shouldShowErrorFeedback = true;
|
|
@@ -68,10 +83,16 @@ let FormSelect = (_class = (_FormSelect = class FormSelect extends Component {
|
|
|
68
83
|
this.args.onBlur(select, event);
|
|
69
84
|
}
|
|
70
85
|
}
|
|
86
|
+
static {
|
|
87
|
+
decorateMethodV2(this.prototype, "handleFocusOut", [action]);
|
|
88
|
+
}
|
|
71
89
|
handleChange(selection, select, event) {
|
|
72
90
|
this.shouldShowErrorFeedback = true;
|
|
73
91
|
this.args.onChange(selection, select, event);
|
|
74
92
|
}
|
|
93
|
+
static {
|
|
94
|
+
decorateMethodV2(this.prototype, "handleChange", [action]);
|
|
95
|
+
}
|
|
75
96
|
get classes() {
|
|
76
97
|
const {
|
|
77
98
|
formSelect
|
|
@@ -95,29 +116,18 @@ let FormSelect = (_class = (_FormSelect = class FormSelect extends Component {
|
|
|
95
116
|
feedback: feedback()
|
|
96
117
|
};
|
|
97
118
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
initializer: function () {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "isOpen", [tracked], {
|
|
114
|
-
configurable: true,
|
|
115
|
-
enumerable: true,
|
|
116
|
-
writable: true,
|
|
117
|
-
initializer: function () {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}), _applyDecoratedDescriptor(_class.prototype, "handleOpen", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOpen"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleClose", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleClose"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleFocusIn", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleFocusIn"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleFocusOut", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleFocusOut"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleChange"), _class.prototype), _class);
|
|
119
|
+
static {
|
|
120
|
+
setComponentTemplate(precompileTemplate("\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n\n {{#if @label}}\n <f.Label @for id={{f.id}} @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 {{!-- @glint-nocheck: need to fix powerselect types--}}\n {{#let (if @isMultiple PowerSelectMultiple PowerSelect) as |Component|}}\n <Component ...attributes @onChange={{this.handleChange}} @onFocus={{this.handleFocusIn}} @onBlur={{this.handleFocusOut}} @onOpen={{this.handleOpen}} @onClose={{this.handleClose}} @ariaDescribedBy=\"{{if @hint f.hintId}} {{if this.showErrorFeedback (concat \" \" f.feedbackId)}}{{if @ariaDescribedBy (concat \" \" @ariaDescribedBy)}}\" @ariaLabelledBy=\"{{if @label f.id}} {{if @ariaLabelledBy (concat \" \" @ariaLabelledBy)}}\" @ariaInvalid={{if this.showErrorFeedback \"true\"}} @triggerClass=\"{{@triggerClass}} {{if @size (concat \"ember-power-select-trigger-\" @size)}} {{this.classes.select}}\" @highlightOnHover={{@highlightOnHover}} @placeholderComponent={{@placeholderComponent}} @searchMessage={{@searchMessage}} @noMatchesMessage={{@noMatchesMessage}} @matchTriggerWidth={{@matchTriggerWidth}} @options={{@options}} @selected={{@selected}} @closeOnSelect={{@closeOnSelect}} @defaultHighlighted={{@defaultHighlighted}} @searchField={{@searchField}} @searchEnabled={{@searchEnabled}} @tabindex={{@tabindex}} @triggerComponent={{@triggerComponent}} @matcher={{@matcher}} @initiallyOpened={{@initiallyOpened}} @typeAheadOptionMatcher={{@typeAheadOptionMatcher}} @buildSelection={{@buildSelection}} @search={{@search}} @onInput={{@onInput}} @onKeydown={{@onKeydown}} @scrollTo={{@scrollTo}} @registerAPI={{@registerAPI}} @horizontalPosition={{@horizontalPosition}} @destination={{@destination}} @preventScroll={{@preventScroll}} @renderInPlace={{@renderInPlace}} @verticalPosition={{@verticalPosition}} @disabled={{@disabled}} @calculatePosition={{@calculatePosition}} @eventType={{@eventType}} @ariaLabel={{@ariaLabel}} @required={{@required}} @triggerRole={{@triggerRole}} @title={{@title}} @triggerId={{@triggerId}} @allowClear={{@allowClear}} @loadingMessage={{@loadingMessage}} @selectedItemComponent={{@selectedItemComponent}} @dropdownClass={{@dropdownClass}} @beforeOptionsComponent={{@beforeOptionsComponent}} @placeholder={{@placeholder}} @searchPlaceholder={{@searchPlaceholder}} @searchMessageComponent={{@searchMessageComponent}} @optionsComponent={{@optionsComponent}} @extra={{@extra}} @groupComponent={{@groupComponent}} @afterOptionsComponent={{@afterOptionsComponent}} as |option term|>\n {{yield option term}}\n </Component>\n {{/let}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n ", {
|
|
121
|
+
strictMode: true,
|
|
122
|
+
scope: () => ({
|
|
123
|
+
FormField,
|
|
124
|
+
PowerSelectMultiple,
|
|
125
|
+
PowerSelect,
|
|
126
|
+
concat
|
|
127
|
+
})
|
|
128
|
+
}), this);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
121
131
|
|
|
122
132
|
export { FormSelect as default };
|
|
123
133
|
//# sourceMappingURL=form-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-select.js","sources":["../../src/components/form-select.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport PowerSelect, {\n type PowerSelectArgs,\n type Select\n} from 'ember-power-select/components/power-select';\nimport PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';\nimport FormField from './form-field';\nimport { concat } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\nexport interface FormSelectArgs extends PowerSelectArgs {\n /** The input field 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\n /** If is multiple select instead of single */\n isMultiple?: boolean;\n\n // Same as onFocus from ember-power-select\n onFocusIn?: (select: Select, event: FocusEvent) => void;\n // Same as onBlur from ember-power-select\n onFocusOut?: (select: Select, event: FocusEvent) => void;\n}\n\nexport interface FormSelectSignature {\n Args: FormSelectArgs;\n Blocks: {\n default: [unknown, Select];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormSelect extends Component<FormSelectSignature> {\n @tracked shouldShowErrorFeedback = false;\n @tracked isOpen = false;\n\n constructor(owner: Owner, args: FormSelectArgs) {\n super(owner, args);\n assert(\n '<FormSelect> requires an `@onChange` function',\n this.args.onChange && typeof this.args.onChange === 'function'\n );\n }\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 handleOpen(select: Select, event: Event): void {\n this.isOpen = true;\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onOpen === 'function') {\n this.args.onOpen(select, event);\n }\n }\n\n @action handleClose(select: Select, event: Event): void {\n this.isOpen = false;\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onClose === 'function') {\n this.args.onClose(select, event);\n }\n }\n\n @action handleFocusIn(select: Select, event: FocusEvent): void {\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onFocusIn === 'function') {\n this.args.onFocusIn(select, event);\n }\n\n // ember-power-select argument\n if (typeof this.args.onFocus === 'function') {\n this.args.onFocus(select, event);\n }\n }\n\n @action handleFocusOut(select: Select, event: FocusEvent): void {\n if (!this.isOpen) {\n this.shouldShowErrorFeedback = true;\n }\n\n if (typeof this.args.onFocusOut === 'function') {\n this.args.onFocusOut(select, event);\n }\n\n // ember-power-select argument\n if (typeof this.args.onBlur === 'function') {\n this.args.onBlur(select, event);\n }\n }\n\n @action handleChange(\n selection: unknown,\n select: Select,\n event?: Event\n ): void {\n this.shouldShowErrorFeedback = true;\n this.args.onChange(selection, select, event);\n }\n\n get classes() {\n const { formSelect } = useStyles();\n\n const { base, label, select, hint, feedback } = formSelect({\n size: this.args.size\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n select: select(),\n hint: hint(),\n feedback: feedback()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n\n {{#if @label}}\n <f.Label @for=\"\" id={{f.id}} @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 {{! @glint-nocheck: need to fix powerselect types}}\n {{#let (if @isMultiple PowerSelectMultiple PowerSelect) as |Component|}}\n <Component\n ...attributes\n @onChange={{this.handleChange}}\n @onFocus={{this.handleFocusIn}}\n @onBlur={{this.handleFocusOut}}\n @onOpen={{this.handleOpen}}\n @onClose={{this.handleClose}}\n @ariaDescribedBy=\"{{if @hint f.hintId}} {{if\n this.showErrorFeedback\n (concat ' ' f.feedbackId)\n }}{{if @ariaDescribedBy (concat ' ' @ariaDescribedBy)}}\"\n @ariaLabelledBy=\"{{if @label f.id}} {{if\n @ariaLabelledBy\n (concat ' ' @ariaLabelledBy)\n }}\"\n @ariaInvalid={{if this.showErrorFeedback \"true\"}}\n @triggerClass=\"{{@triggerClass}} {{if\n @size\n (concat 'ember-power-select-trigger-' @size)\n }} {{this.classes.select}}\"\n @highlightOnHover={{@highlightOnHover}}\n @placeholderComponent={{@placeholderComponent}}\n @searchMessage={{@searchMessage}}\n @noMatchesMessage={{@noMatchesMessage}}\n @matchTriggerWidth={{@matchTriggerWidth}}\n @options={{@options}}\n @selected={{@selected}}\n @closeOnSelect={{@closeOnSelect}}\n @defaultHighlighted={{@defaultHighlighted}}\n @searchField={{@searchField}}\n @searchEnabled={{@searchEnabled}}\n @tabindex={{@tabindex}}\n @triggerComponent={{@triggerComponent}}\n @matcher={{@matcher}}\n @initiallyOpened={{@initiallyOpened}}\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\n @buildSelection={{@buildSelection}}\n @search={{@search}}\n @onInput={{@onInput}}\n @onKeydown={{@onKeydown}}\n @scrollTo={{@scrollTo}}\n @registerAPI={{@registerAPI}}\n @horizontalPosition={{@horizontalPosition}}\n @destination={{@destination}}\n @preventScroll={{@preventScroll}}\n @renderInPlace={{@renderInPlace}}\n @verticalPosition={{@verticalPosition}}\n @disabled={{@disabled}}\n @calculatePosition={{@calculatePosition}}\n @eventType={{@eventType}}\n @ariaLabel={{@ariaLabel}}\n @required={{@required}}\n @triggerRole={{@triggerRole}}\n @title={{@title}}\n @triggerId={{@triggerId}}\n @allowClear={{@allowClear}}\n @loadingMessage={{@loadingMessage}}\n @selectedItemComponent={{@selectedItemComponent}}\n @dropdownClass={{@dropdownClass}}\n @beforeOptionsComponent={{@beforeOptionsComponent}}\n @placeholder={{@placeholder}}\n @searchPlaceholder={{@searchPlaceholder}}\n @searchMessageComponent={{@searchMessageComponent}}\n @optionsComponent={{@optionsComponent}}\n @extra={{@extra}}\n @groupComponent={{@groupComponent}}\n @afterOptionsComponent={{@afterOptionsComponent}}\n as |option term|\n >\n {{yield option term}}\n </Component>\n {{/let}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormSelect","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","assert","onChange","showErrorFeedback","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleOpen","select","event","isOpen","onOpen","handleClose","onClose","handleFocusIn","onFocusIn","onFocus","handleFocusOut","onFocusOut","onBlur","handleChange","selection","classes","formSelect","useStyles","base","label","hint","feedback","size","class","containerClass","setComponentTemplate","precompileTemplate","strictMode","scope","FormField","PowerSelectMultiple","PowerSelect","concat","_FormSelect","_applyDecoratedDescriptor","_class","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;AAiDqBA,IAAAA,sCAAN,MAAMA,mBAAmBC,SAAU,CAAA;AAIhDC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAoB,EAAE;AAC9C,IAAA,KAAK,CAACD,KAAO,EAAAC,IAAA,CAAA;AAAAC,IAAAA,0BAAA,kCAAAC,WAAA,EAAA,IAAA,CAAA;AAAAD,IAAAA,0BAAA,iBAAAE,YAAA,EAAA,IAAA,CAAA;AACbC,IAAAA,MAAA,CACE,+CACA,EAAA,IAAI,CAACJ,IAAI,CAACK,QAAQ,IAAI,OAAO,IAAI,CAACL,IAAI,CAACK,QAAQ,KAAK,UAAA,CAAA;AAExD;EAEA,IAAIC,iBAAAA,GAA6B;AAC/B,IAAA,IAAI,IAAI,CAACN,IAAI,CAACO,QAAQ,KAAK,KAAO,EAAA;AAChC,MAAA,OAAO,KAAA;AACT;AAEA,IAAA,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MAAA,CAAAC,SAAA,EAAA,gBAAA,EAAA,CAaAM,MAAA,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,EAAA,gBAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,GAAAF,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAeAM,cAAAA,EAAAA,CAAAA,MAAA,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,mBAAAD,MAAA,CAAAC,SAAA,CAAA,EAAAD,MAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"form-select.js","sources":["../../src/components/form-select.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport PowerSelect, {\n type PowerSelectArgs,\n type Select\n} from 'ember-power-select/components/power-select';\nimport PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';\nimport FormField from './form-field';\nimport { concat } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport type Owner from '@ember/owner';\n\nexport interface FormSelectArgs extends PowerSelectArgs {\n /** The input field 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\n /** If is multiple select instead of single */\n isMultiple?: boolean;\n\n // Same as onFocus from ember-power-select\n onFocusIn?: (select: Select, event: FocusEvent) => void;\n // Same as onBlur from ember-power-select\n onFocusOut?: (select: Select, event: FocusEvent) => void;\n}\n\nexport interface FormSelectSignature {\n Args: FormSelectArgs;\n Blocks: {\n default: [unknown, Select];\n };\n Element: HTMLDivElement;\n}\n\nexport default class FormSelect extends Component<FormSelectSignature> {\n @tracked shouldShowErrorFeedback = false;\n @tracked isOpen = false;\n\n constructor(owner: Owner, args: FormSelectArgs) {\n super(owner, args);\n assert(\n '<FormSelect> requires an `@onChange` function',\n this.args.onChange && typeof this.args.onChange === 'function'\n );\n }\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 handleOpen(select: Select, event: Event): void {\n this.isOpen = true;\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onOpen === 'function') {\n this.args.onOpen(select, event);\n }\n }\n\n @action handleClose(select: Select, event: Event): void {\n this.isOpen = false;\n this.shouldShowErrorFeedback = true;\n\n if (typeof this.args.onClose === 'function') {\n this.args.onClose(select, event);\n }\n }\n\n @action handleFocusIn(select: Select, event: FocusEvent): void {\n this.shouldShowErrorFeedback = false;\n\n if (typeof this.args.onFocusIn === 'function') {\n this.args.onFocusIn(select, event);\n }\n\n // ember-power-select argument\n if (typeof this.args.onFocus === 'function') {\n this.args.onFocus(select, event);\n }\n }\n\n @action handleFocusOut(select: Select, event: FocusEvent): void {\n if (!this.isOpen) {\n this.shouldShowErrorFeedback = true;\n }\n\n if (typeof this.args.onFocusOut === 'function') {\n this.args.onFocusOut(select, event);\n }\n\n // ember-power-select argument\n if (typeof this.args.onBlur === 'function') {\n this.args.onBlur(select, event);\n }\n }\n\n @action handleChange(\n selection: unknown,\n select: Select,\n event?: Event\n ): void {\n this.shouldShowErrorFeedback = true;\n this.args.onChange(selection, select, event);\n }\n\n get classes() {\n const { formSelect } = useStyles();\n\n const { base, label, select, hint, feedback } = formSelect({\n size: this.args.size\n });\n\n return {\n base: base({\n class: this.args.containerClass\n }),\n label: label(),\n select: select(),\n hint: hint(),\n feedback: feedback()\n };\n }\n\n <template>\n <FormField @size={{@size}} class={{this.classes.base}} as |f|>\n\n {{#if @label}}\n <f.Label @for=\"\" id={{f.id}} @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 {{! @glint-nocheck: need to fix powerselect types}}\n {{#let (if @isMultiple PowerSelectMultiple PowerSelect) as |Component|}}\n <Component\n ...attributes\n @onChange={{this.handleChange}}\n @onFocus={{this.handleFocusIn}}\n @onBlur={{this.handleFocusOut}}\n @onOpen={{this.handleOpen}}\n @onClose={{this.handleClose}}\n @ariaDescribedBy=\"{{if @hint f.hintId}} {{if\n this.showErrorFeedback\n (concat ' ' f.feedbackId)\n }}{{if @ariaDescribedBy (concat ' ' @ariaDescribedBy)}}\"\n @ariaLabelledBy=\"{{if @label f.id}} {{if\n @ariaLabelledBy\n (concat ' ' @ariaLabelledBy)\n }}\"\n @ariaInvalid={{if this.showErrorFeedback \"true\"}}\n @triggerClass=\"{{@triggerClass}} {{if\n @size\n (concat 'ember-power-select-trigger-' @size)\n }} {{this.classes.select}}\"\n @highlightOnHover={{@highlightOnHover}}\n @placeholderComponent={{@placeholderComponent}}\n @searchMessage={{@searchMessage}}\n @noMatchesMessage={{@noMatchesMessage}}\n @matchTriggerWidth={{@matchTriggerWidth}}\n @options={{@options}}\n @selected={{@selected}}\n @closeOnSelect={{@closeOnSelect}}\n @defaultHighlighted={{@defaultHighlighted}}\n @searchField={{@searchField}}\n @searchEnabled={{@searchEnabled}}\n @tabindex={{@tabindex}}\n @triggerComponent={{@triggerComponent}}\n @matcher={{@matcher}}\n @initiallyOpened={{@initiallyOpened}}\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\n @buildSelection={{@buildSelection}}\n @search={{@search}}\n @onInput={{@onInput}}\n @onKeydown={{@onKeydown}}\n @scrollTo={{@scrollTo}}\n @registerAPI={{@registerAPI}}\n @horizontalPosition={{@horizontalPosition}}\n @destination={{@destination}}\n @preventScroll={{@preventScroll}}\n @renderInPlace={{@renderInPlace}}\n @verticalPosition={{@verticalPosition}}\n @disabled={{@disabled}}\n @calculatePosition={{@calculatePosition}}\n @eventType={{@eventType}}\n @ariaLabel={{@ariaLabel}}\n @required={{@required}}\n @triggerRole={{@triggerRole}}\n @title={{@title}}\n @triggerId={{@triggerId}}\n @allowClear={{@allowClear}}\n @loadingMessage={{@loadingMessage}}\n @selectedItemComponent={{@selectedItemComponent}}\n @dropdownClass={{@dropdownClass}}\n @beforeOptionsComponent={{@beforeOptionsComponent}}\n @placeholder={{@placeholder}}\n @searchPlaceholder={{@searchPlaceholder}}\n @searchMessageComponent={{@searchMessageComponent}}\n @optionsComponent={{@optionsComponent}}\n @extra={{@extra}}\n @groupComponent={{@groupComponent}}\n @afterOptionsComponent={{@afterOptionsComponent}}\n as |option term|\n >\n {{yield option term}}\n </Component>\n {{/let}}\n\n {{#if this.showErrorFeedback}}\n <f.Feedback @class={{this.classes.feedback}} @errors={{@errors}} />\n {{/if}}\n </FormField>\n </template>\n}\n"],"names":["FormSelect","Component","g","prototype","tracked","i","void 0","constructor","owner","args","assert","onChange","showErrorFeedback","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleOpen","select","event","isOpen","onOpen","n","action","handleClose","onClose","handleFocusIn","onFocusIn","onFocus","handleFocusOut","onFocusOut","onBlur","handleChange","selection","classes","formSelect","useStyles","base","label","hint","feedback","size","class","containerClass","setComponentTemplate","precompileTemplate","strictMode","scope","FormField","PowerSelectMultiple","PowerSelect","concat"],"mappings":";;;;;;;;;;;;;AAiDe,MAAMA,mBAAmBC,SAAU,CAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,yBAAA,EAAA,CAC/CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,KAAA,CAAA;AAAA,EAAA;IAAAJ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