@frontile/forms 0.17.0-alpha.1 → 0.17.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/addon-main.js +0 -33
  2. package/declarations/components/form-field/select.d.ts +38 -0
  3. package/declarations/components/form-field/select.d.ts.map +1 -0
  4. package/declarations/components/native-select.d.ts +65 -0
  5. package/declarations/components/native-select.d.ts.map +1 -0
  6. package/declarations/components/select.d.ts +51 -0
  7. package/declarations/components/select.d.ts.map +1 -0
  8. package/declarations/index.d.ts +3 -0
  9. package/declarations/index.d.ts.map +1 -0
  10. package/declarations/template-registry.d.ts +3 -30
  11. package/declarations/template-registry.d.ts.map +1 -1
  12. package/dist/_app_/components/native-select.js +1 -0
  13. package/dist/_app_/components/select.js +1 -0
  14. package/dist/components/native-select.js +95 -0
  15. package/dist/components/native-select.js.map +1 -0
  16. package/dist/components/select.js +117 -0
  17. package/dist/components/select.js.map +1 -0
  18. package/dist/index.js +3 -0
  19. package/dist/index.js.map +1 -0
  20. package/package.json +19 -29
  21. package/dist/_app_/components/form-checkbox-group.js +0 -1
  22. package/dist/_app_/components/form-checkbox.js +0 -1
  23. package/dist/_app_/components/form-field/checkbox.js +0 -1
  24. package/dist/_app_/components/form-field/feedback.js +0 -1
  25. package/dist/_app_/components/form-field/hint.js +0 -1
  26. package/dist/_app_/components/form-field/input.js +0 -1
  27. package/dist/_app_/components/form-field/label.js +0 -1
  28. package/dist/_app_/components/form-field/radio.js +0 -1
  29. package/dist/_app_/components/form-field/textarea.js +0 -1
  30. package/dist/_app_/components/form-field.js +0 -1
  31. package/dist/_app_/components/form-input.js +0 -1
  32. package/dist/_app_/components/form-radio-group.js +0 -1
  33. package/dist/_app_/components/form-radio.js +0 -1
  34. package/dist/_app_/components/form-select.js +0 -1
  35. package/dist/_app_/components/form-textarea.js +0 -1
  36. package/dist/components/form-checkbox-group.js +0 -77
  37. package/dist/components/form-checkbox-group.js.map +0 -1
  38. package/dist/components/form-checkbox.js +0 -59
  39. package/dist/components/form-checkbox.js.map +0 -1
  40. package/dist/components/form-field/checkbox.js +0 -38
  41. package/dist/components/form-field/checkbox.js.map +0 -1
  42. package/dist/components/form-field/feedback.js +0 -36
  43. package/dist/components/form-field/feedback.js.map +0 -1
  44. package/dist/components/form-field/hint.js +0 -24
  45. package/dist/components/form-field/hint.js.map +0 -1
  46. package/dist/components/form-field/input.js +0 -44
  47. package/dist/components/form-field/input.js.map +0 -1
  48. package/dist/components/form-field/label.js +0 -24
  49. package/dist/components/form-field/label.js.map +0 -1
  50. package/dist/components/form-field/radio.js +0 -37
  51. package/dist/components/form-field/radio.js.map +0 -1
  52. package/dist/components/form-field/textarea.js +0 -38
  53. package/dist/components/form-field/textarea.js.map +0 -1
  54. package/dist/components/form-field.js +0 -44
  55. package/dist/components/form-field.js.map +0 -1
  56. package/dist/components/form-input.js +0 -89
  57. package/dist/components/form-input.js.map +0 -1
  58. package/dist/components/form-radio-group.js +0 -77
  59. package/dist/components/form-radio-group.js.map +0 -1
  60. package/dist/components/form-radio.js +0 -63
  61. package/dist/components/form-radio.js.map +0 -1
  62. package/dist/components/form-select.js +0 -124
  63. package/dist/components/form-select.js.map +0 -1
  64. package/dist/components/form-textarea.js +0 -48
  65. package/dist/components/form-textarea.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/forms",
3
- "version": "0.17.0-alpha.1",
3
+ "version": "0.17.0-alpha.12",
4
4
  "description": "Component Library for Ember Octane apps: Forms",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -41,31 +41,34 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@embroider/addon-shim": "^1.8.7",
44
- "@frontile/theme": "^0.17.0-alpha.1",
45
- "@glint/template": "1.2.1",
44
+ "@frontile/collections": "0.17.0-alpha.12",
45
+ "@frontile/overlays": "0.17.0-alpha.12",
46
+ "@frontile/theme": "0.17.0-alpha.12",
47
+ "@frontile/utilities": "0.17.0-alpha.12",
48
+ "@glint/template": "1.3.0",
46
49
  "ember-basic-dropdown": "^7.3.0",
47
50
  "ember-power-select": "^7.2.0"
48
51
  },
49
52
  "devDependencies": {
50
- "@babel/core": "7.23.6",
53
+ "@babel/core": "7.23.9",
51
54
  "@babel/plugin-proposal-class-properties": "7.18.6",
52
- "@babel/plugin-proposal-decorators": "7.23.6",
55
+ "@babel/plugin-proposal-decorators": "7.23.9",
53
56
  "@babel/plugin-transform-class-static-block": "^7.23.4",
54
57
  "@babel/preset-typescript": "7.23.3",
55
- "@embroider/addon-dev": "4.1.3",
58
+ "@embroider/addon-dev": "4.2.1",
56
59
  "@glimmer/component": "^1.1.2",
57
60
  "@glimmer/tracking": "^1.1.2",
58
- "@glint/core": "1.2.1",
59
- "@glint/environment-ember-loose": "1.2.1",
60
- "@glint/environment-ember-template-imports": "1.2.1",
61
+ "@glint/core": "1.3.0",
62
+ "@glint/environment-ember-loose": "1.3.0",
63
+ "@glint/environment-ember-template-imports": "1.3.0",
61
64
  "@rollup/plugin-node-resolve": "^15.2.3",
62
65
  "@tsconfig/ember": "^3.0.3",
63
66
  "babel-plugin-ember-template-compilation": "^2.2.1",
64
- "concurrently": "^8.2.0",
65
- "ember-source": "^5.5.0",
66
- "rollup": "^4.9.1",
67
+ "concurrently": "^8.2.2",
68
+ "ember-source": "^5.6.0",
69
+ "rollup": "^4.11.0",
67
70
  "rollup-plugin-ts": "^3.4.5",
68
- "tailwindcss": "^3.3.3",
71
+ "tailwindcss": "^3.4.1",
69
72
  "typescript": "^5.3.3"
70
73
  },
71
74
  "engines": {
@@ -82,21 +85,8 @@
82
85
  "type": "addon",
83
86
  "main": "addon-main.js",
84
87
  "app-js": {
85
- "./components/form-checkbox-group.js": "./dist/_app_/components/form-checkbox-group.js",
86
- "./components/form-checkbox.js": "./dist/_app_/components/form-checkbox.js",
87
- "./components/form-field.js": "./dist/_app_/components/form-field.js",
88
- "./components/form-field/checkbox.js": "./dist/_app_/components/form-field/checkbox.js",
89
- "./components/form-field/feedback.js": "./dist/_app_/components/form-field/feedback.js",
90
- "./components/form-field/hint.js": "./dist/_app_/components/form-field/hint.js",
91
- "./components/form-field/input.js": "./dist/_app_/components/form-field/input.js",
92
- "./components/form-field/label.js": "./dist/_app_/components/form-field/label.js",
93
- "./components/form-field/radio.js": "./dist/_app_/components/form-field/radio.js",
94
- "./components/form-field/textarea.js": "./dist/_app_/components/form-field/textarea.js",
95
- "./components/form-input.js": "./dist/_app_/components/form-input.js",
96
- "./components/form-radio-group.js": "./dist/_app_/components/form-radio-group.js",
97
- "./components/form-radio.js": "./dist/_app_/components/form-radio.js",
98
- "./components/form-select.js": "./dist/_app_/components/form-select.js",
99
- "./components/form-textarea.js": "./dist/_app_/components/form-textarea.js"
88
+ "./components/native-select.js": "./dist/_app_/components/native-select.js",
89
+ "./components/select.js": "./dist/_app_/components/select.js"
100
90
  }
101
91
  },
102
92
  "exports": {
@@ -117,5 +107,5 @@
117
107
  ]
118
108
  }
119
109
  },
120
- "gitHead": "4e0e0501d968479c9ae9e707d4cc7ae1bdde92bb"
110
+ "gitHead": "296aeadaf5fae95ed88329be637d8b7187910f62"
121
111
  }
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-checkbox-group";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-checkbox";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/checkbox";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/feedback";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/hint";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/input";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/label";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/radio";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field/textarea";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-field";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-input";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-radio-group";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-radio";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-select";
@@ -1 +0,0 @@
1
- export { default } from "@frontile/forms/components/form-textarea";
@@ -1,77 +0,0 @@
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
- import Component from '@glimmer/component';
6
- import { action } from '@ember/object';
7
- import { tracked } from '@glimmer/tracking';
8
- import FormCheckbox from './form-checkbox.js';
9
- import { useStyles } from '@frontile/theme';
10
- import FormField from './form-field.js';
11
- import { hash } from '@ember/helper';
12
- import { precompileTemplate } from '@ember/template-compilation';
13
- import { setComponentTemplate } from '@ember/component';
14
-
15
- var _class, _descriptor, _class2;
16
- let FormCheckboxGroup = (_class = (_class2 = class FormCheckboxGroup extends Component {
17
- constructor(...args) {
18
- super(...args);
19
- _initializerDefineProperty(this, "shouldShowErrorFeedback", _descriptor, this);
20
- }
21
- get showErrorFeedback() {
22
- if (this.args.hasError === false) {
23
- return false;
24
- }
25
- if ((this.args.showError || this.args.hasSubmitted || this.shouldShowErrorFeedback) && this.args.errors && this.args.errors.length > 0) {
26
- return true;
27
- } else {
28
- return false;
29
- }
30
- }
31
- handleChange(value1, event1) {
32
- this.shouldShowErrorFeedback = true;
33
- if (typeof this.args.onChange === 'function') {
34
- this.args.onChange(value1, event1);
35
- }
36
- }
37
- get classes() {
38
- const {
39
- formCheckboxGroup: formCheckboxGroup1
40
- } = useStyles();
41
- const {
42
- base: base1,
43
- label: label1,
44
- formCheckbox: formCheckbox1,
45
- hint: hint1,
46
- feedback: feedback1
47
- } = formCheckboxGroup1({
48
- isInline: this.args.isInline
49
- });
50
- return {
51
- base: base1({
52
- class: this.args.containerClass
53
- }),
54
- label: label1(),
55
- hint: hint1(),
56
- feedback: feedback1(),
57
- formCheckbox: formCheckbox1()
58
- };
59
- }
60
- }, 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 ", {
61
- scope: () => ({
62
- FormField,
63
- FormCheckbox,
64
- hash
65
- }),
66
- strictMode: true
67
- }), _class2), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "shouldShowErrorFeedback", [tracked], {
68
- configurable: true,
69
- enumerable: true,
70
- writable: true,
71
- initializer: function () {
72
- return false;
73
- }
74
- }), _applyDecoratedDescriptor(_class.prototype, "handleChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleChange"), _class.prototype)), _class);
75
-
76
- export { FormCheckboxGroup as default };
77
- //# sourceMappingURL=form-checkbox-group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-checkbox-group.js","sources":["../../src/components/form-checkbox-group.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport 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';\nexport interface FormCheckboxGroupArgs {\n /** The group label */ label?: string;\n /** A help text to be displayed */ hint?: string;\n /** If the form has been submitted, used to force displaying errors */ hasSubmitted?: boolean;\n /** If has errors */ hasError?: boolean;\n /** Force displaying errors */ showError?: boolean;\n /** A list of errors or a single text describing the error */ errors?: string[] | string;\n /** CSS classes to be added in the container element */ containerClass?: string;\n /** The size */ size?: 'sm' | 'md' | 'lg';\n /** If the Checkbox should be in one line */ isInline?: boolean;\n /** Default callback added to the yielded FormCheckbox component, called when onchange is triggered */ onChange?: (value: unknown, event: Event) => void;\n}\nexport interface FormCheckboxGroupSignature {\n Args: FormCheckboxGroupArgs;\n Blocks: {\n default: [checkbox: WithBoundArgs<typeof FormCheckbox, 'privateContainerClass'> & WithBoundArgs<typeof FormCheckbox, '_parentOnChange'> & WithBoundArgs<typeof FormCheckbox, 'size'>, api: {\n onChange: (value: unknown, event: Event) => void;\n }];\n };\n Element: HTMLDivElement;\n}\nexport default class FormCheckboxGroup extends Component<FormCheckboxGroupSignature> {\n @tracked\n shouldShowErrorFeedback = false;\n get showErrorFeedback(): boolean {\n if (this.args.hasError === false) {\n return false;\n }\n if ((this.args.showError || this.args.hasSubmitted || this.shouldShowErrorFeedback) && this.args.errors && this.args.errors.length > 0) {\n return true;\n } else {\n return false;\n }\n }\n @action\n handleChange(value1: unknown, event1: Event): void {\n this.shouldShowErrorFeedback = true;\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value1, event1);\n }\n }\n get classes() {\n const { formCheckboxGroup: formCheckboxGroup1 } = useStyles();\n const { base: base1, label: label1, formCheckbox: formCheckbox1, hint: hint1, feedback: feedback1 } = formCheckboxGroup1({\n isInline: this.args.isInline\n });\n return {\n base: base1({\n class: this.args.containerClass\n }),\n label: label1(),\n hint: hint1(),\n feedback: feedback1(),\n formCheckbox: formCheckbox1()\n };\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormCheckboxGroup","_class","_class2","Component","constructor","args","_initializerDefineProperty","_descriptor","showErrorFeedback","hasError","showError","hasSubmitted","shouldShowErrorFeedback","errors","length","handleChange","value1","event1","onChange","classes","formCheckboxGroup","formCheckboxGroup1","useStyles","base","base1","label","label1","formCheckbox","formCheckbox1","hint","hint1","feedback","feedback1","isInline","class","containerClass","setComponentTemplate","precompileTemplate","scope","FormField","FormCheckbox","hash","strictMode","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;AA8BqBA,IAAAA,iBAAiB,IAAAC,MAAA,IAAAC,OAAA,GAAvB,MAAMF,iBAAiB,SAASG,SAAS,CAA6B;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,kCAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;EAGjF,IAAIC,iBAAiBA,GAAY;AAC7B,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,QAAQ,KAAK,KAAK,EAAE;AAC9B,MAAA,OAAO,KAAK,CAAA;AAChB,KAAA;AACA,IAAA,IAAI,CAAC,IAAI,CAACJ,IAAI,CAACK,SAAS,IAAI,IAAI,CAACL,IAAI,CAACM,YAAY,IAAI,IAAI,CAACC,uBAAuB,KAAK,IAAI,CAACP,IAAI,CAACQ,MAAM,IAAI,IAAI,CAACR,IAAI,CAACQ,MAAM,CAACC,MAAM,GAAG,CAAC,EAAE;AACpI,MAAA,OAAO,IAAI,CAAA;AACf,KAAC,MAAM;AACH,MAAA,OAAO,KAAK,CAAA;AAChB,KAAA;AACJ,GAAA;AAEAC,EAAAA,YAAYA,CAACC,MAAe,EAAEC,MAAa,EAAQ;IAC/C,IAAI,CAACL,uBAAuB,GAAG,IAAI,CAAA;IACnC,IAAI,OAAO,IAAI,CAACP,IAAI,CAACa,QAAQ,KAAK,UAAU,EAAE;MAC1C,IAAI,CAACb,IAAI,CAACa,QAAQ,CAACF,MAAM,EAAEC,MAAM,CAAC,CAAA;AACtC,KAAA;AACJ,GAAA;EACA,IAAIE,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,iBAAiB,EAAEC,kBAAAA;KAAoB,GAAGC,SAAS,EAAE,CAAA;IAC7D,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,KAAK,EAAEC,MAAM;AAAEC,MAAAA,YAAY,EAAEC,aAAa;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,QAAQ,EAAEC,SAAAA;KAAW,GAAGX,kBAAkB,CAAC;AACrHY,MAAAA,QAAQ,EAAE,IAAI,CAAC5B,IAAI,CAAC4B,QAAAA;AACxB,KAAC,CAAC,CAAA;IACF,OAAO;MACHV,IAAI,EAAEC,KAAK,CAAC;AACRU,QAAAA,KAAK,EAAE,IAAI,CAAC7B,IAAI,CAAC8B,cAAAA;AACrB,OAAC,CAAC;MACFV,KAAK,EAAEC,MAAM,EAAE;MACfG,IAAI,EAAEC,KAAK,EAAE;MACbC,QAAQ,EAAEC,SAAS,EAAE;MACrBL,YAAY,EAAEC,aAAa,EAAC;KAC/B,CAAA;AACL,GAAA;AA2CJ,CAAC,EAAAQ,oBAAA,CAzCOC,kBAAA,CAkCH,qqBAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,SAAA;IAAAC,YAAA;AAAAC,IAAAA,IAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAxC,OAAA,CAAA,EAAAA,OAAA,CAAAK,GAAAA,WAAA,GAAAoC,yBAAA,CAAA1C,MAAA,CAAA2C,SAAA,8BA1ELC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;AAAA,IAAA,OACkB,KAAK,CAAA;AAAA,GAAA;AAAA,CAAAN,CAAAA,EAAAA,yBAAA,CAAA1C,MAAA,CAAA2C,SAAA,EAW9BM,cAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAnD,MAAA,CAAA2C,SAAA,EAAA,cAAA,CAAA,EAAA3C,MAAA,CAAA2C,SAAA,IAAA3C,MAAA;;;;"}
@@ -1,59 +0,0 @@
1
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
2
- import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
- import { useStyles } from '@frontile/theme';
5
- import FormField from './form-field.js';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
-
9
- var _class, _class2;
10
- let FormCheckbox = (_class = (_class2 = class FormCheckbox extends Component {
11
- handleChange(value1, event1) {
12
- if (typeof this.args.onChange === 'function') {
13
- this.args.onChange(value1, event1);
14
- }
15
- if (typeof this.args._parentOnChange === 'function') {
16
- this.args._parentOnChange(value1, event1);
17
- }
18
- }
19
- get classes() {
20
- const {
21
- formCheckbox: formCheckbox1
22
- } = useStyles();
23
- const {
24
- base: base1,
25
- label: label1,
26
- checkbox: checkbox1,
27
- hint: hint1,
28
- labelContainer: labelContainer1,
29
- inputContainer: inputContainer1
30
- } = formCheckbox1({
31
- size: this.args.size
32
- });
33
- let containerClasses1 = '';
34
- if (this.args.containerClass) {
35
- containerClasses1 = this.args.containerClass;
36
- }
37
- if (this.args.privateContainerClass) {
38
- containerClasses1 += ' ' + this.args.privateContainerClass;
39
- }
40
- return {
41
- base: base1({
42
- class: containerClasses1
43
- }),
44
- label: label1(),
45
- inputContainer: inputContainer1(),
46
- labelContainer: labelContainer1(),
47
- hint: hint1(),
48
- checkbox: checkbox1()
49
- };
50
- }
51
- }, 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 ", {
52
- scope: () => ({
53
- FormField
54
- }),
55
- strictMode: true
56
- }), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleChange"), _class.prototype)), _class);
57
-
58
- export { FormCheckbox as default };
59
- //# sourceMappingURL=form-checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-checkbox.js","sources":["../../src/components/form-checkbox.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { useStyles } from '@frontile/theme';\nimport FormField from './form-field';\nexport interface FormCheckboxArgs {\n /** The input field label */ label?: string;\n /** A help text to be displayed */ hint?: string;\n /**\n * If the checkbox is checked.\n * You must also pass `onChange` to update its value.\n */ checked: boolean;\n /** The name of the checkbox */ name?: string;\n /** CSS classes to be added in the container element */ containerClass?: string;\n /** The size */ size?: 'sm' | 'md' | 'lg';\n /** Callback when onchange is triggered */ onChange: (value: boolean, event: Event) => void;\n /**\n * Internal function for InputCheckboxGroup\n * @ignore\n **/ _parentOnChange?: (value: boolean, event: Event) => void;\n /**\n * CSS classes to be added in the container element\n * @ignore\n * */ privateContainerClass?: string;\n}\nexport interface FormCheckboxSignature {\n Args: FormCheckboxArgs;\n Element: HTMLInputElement;\n Blocks: {\n default: [];\n };\n}\nexport default class FormCheckbox extends Component<FormCheckboxSignature> {\n @action\n handleChange(value1: boolean, event1: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value1, event1);\n }\n if (typeof this.args._parentOnChange === 'function') {\n this.args._parentOnChange(value1, event1);\n }\n }\n get classes() {\n const { formCheckbox: formCheckbox1 } = useStyles();\n const { base: base1, label: label1, checkbox: checkbox1, hint: hint1, labelContainer: labelContainer1, inputContainer: inputContainer1 } = formCheckbox1({\n size: this.args.size\n });\n let containerClasses1 = '';\n if (this.args.containerClass) {\n containerClasses1 = this.args.containerClass;\n }\n if (this.args.privateContainerClass) {\n containerClasses1 += ' ' + this.args.privateContainerClass;\n }\n return {\n base: base1({\n class: containerClasses1\n }),\n label: label1(),\n inputContainer: inputContainer1(),\n labelContainer: labelContainer1(),\n hint: hint1(),\n checkbox: checkbox1()\n };\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormCheckbox","_class","_class2","Component","handleChange","value1","event1","args","onChange","_parentOnChange","classes","formCheckbox","formCheckbox1","useStyles","base","base1","label","label1","checkbox","checkbox1","hint","hint1","labelContainer","labelContainer1","inputContainer","inputContainer1","size","containerClasses1","containerClass","privateContainerClass","class","setComponentTemplate","precompileTemplate","scope","FormField","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;AAgCqBA,IAAAA,YAAY,IAAAC,MAAA,IAAAC,OAAA,GAAlB,MAAMF,YAAY,SAASG,SAAS,CAAwB;AAEvEC,EAAAA,YAAYA,CAACC,MAAe,EAAEC,MAAa,EAAQ;IAC/C,IAAI,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,KAAK,UAAU,EAAE;MAC1C,IAAI,CAACD,IAAI,CAACC,QAAQ,CAACH,MAAM,EAAEC,MAAM,CAAC,CAAA;AACtC,KAAA;IACA,IAAI,OAAO,IAAI,CAACC,IAAI,CAACE,eAAe,KAAK,UAAU,EAAE;MACjD,IAAI,CAACF,IAAI,CAACE,eAAe,CAACJ,MAAM,EAAEC,MAAM,CAAC,CAAA;AAC7C,KAAA;AACJ,GAAA;EACA,IAAII,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,YAAY,EAAEC,aAAAA;KAAe,GAAGC,SAAS,EAAE,CAAA;IACnD,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,KAAK,EAAEC,MAAM;AAAEC,MAAAA,QAAQ,EAAEC,SAAS;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,cAAc,EAAEC,eAAe;AAAEC,MAAAA,cAAc,EAAEC,eAAAA;KAAiB,GAAGb,aAAa,CAAC;AACrJc,MAAAA,IAAI,EAAE,IAAI,CAACnB,IAAI,CAACmB,IAAAA;AACpB,KAAC,CAAC,CAAA;IACF,IAAIC,iBAAiB,GAAG,EAAE,CAAA;AAC1B,IAAA,IAAI,IAAI,CAACpB,IAAI,CAACqB,cAAc,EAAE;AAC1BD,MAAAA,iBAAiB,GAAG,IAAI,CAACpB,IAAI,CAACqB,cAAc,CAAA;AAChD,KAAA;AACA,IAAA,IAAI,IAAI,CAACrB,IAAI,CAACsB,qBAAqB,EAAE;AACjCF,MAAAA,iBAAiB,IAAI,GAAG,GAAG,IAAI,CAACpB,IAAI,CAACsB,qBAAqB,CAAA;AAC9D,KAAA;IACA,OAAO;MACHf,IAAI,EAAEC,KAAK,CAAC;AACRe,QAAAA,KAAK,EAAEH,iBAAAA;AACX,OAAC,CAAC;MACFX,KAAK,EAAEC,MAAM,EAAE;MACfO,cAAc,EAAEC,eAAe,EAAE;MACjCH,cAAc,EAAEC,eAAe,EAAE;MACjCH,IAAI,EAAEC,KAAK,EAAE;MACbH,QAAQ,EAAEC,SAAS,EAAC;KACvB,CAAA;AACL,GAAA;AAyCJ,CAAC,EAAAY,oBAAA,CAvCOC,kBAAA,CAgCH,k3BAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,SAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAjC,OAAA,CAAAA,EAAAA,OAAA,CAAAkC,GAAAA,yBAAA,CAAAnC,MAAA,CAAAoC,SAAA,EAtELC,cAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAvC,MAAA,CAAAoC,SAAA,EAAA,cAAA,CAAA,EAAApC,MAAA,CAAAoC,SAAA,CAAA,GAAApC,MAAA;;;;"}
@@ -1,38 +0,0 @@
1
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
2
- import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
- import { on } from '@ember/modifier';
5
- import { useStyles } from '@frontile/theme';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
-
9
- var _class, _class2;
10
- let FormFieldCheckbox = (_class = (_class2 = class FormFieldCheckbox extends Component {
11
- get isChecked() {
12
- return !!this.args.checked;
13
- }
14
- handleChange(event1) {
15
- event1.preventDefault();
16
- const value1 = !this.args.checked;
17
- if (typeof this.args.onChange === 'function') {
18
- this.args.onChange(value1, event1);
19
- }
20
- }
21
- get classes() {
22
- const {
23
- checkbox: checkbox1
24
- } = useStyles();
25
- return checkbox1({
26
- size: this.args.size,
27
- class: this.args.class
28
- });
29
- }
30
- }, 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 ", {
31
- scope: () => ({
32
- on
33
- }),
34
- strictMode: true
35
- }), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleChange"), _class.prototype)), _class);
36
-
37
- export { FormFieldCheckbox as default };
38
- //# sourceMappingURL=checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../../src/components/form-field/checkbox.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldCheckboxArgs {\n id?: string;\n checked?: boolean;\n name?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n // Callback when onchange is triggered\n onChange?: (value: boolean, event: Event) => void;\n}\nexport interface FormFieldCheckboxSignature {\n Args: FormFieldCheckboxArgs;\n Element: HTMLInputElement;\n}\nexport default class FormFieldCheckbox extends Component<FormFieldCheckboxSignature> {\n get isChecked(): boolean {\n return !!this.args.checked;\n }\n @action\n handleChange(event1: Event): void {\n event1.preventDefault();\n const value1 = !this.args.checked;\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(value1, event1);\n }\n }\n get classes() {\n const { checkbox: checkbox1 } = useStyles();\n return checkbox1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldCheckbox","_class","_class2","Component","isChecked","args","checked","handleChange","event1","preventDefault","value1","onChange","classes","checkbox","checkbox1","useStyles","size","class","setComponentTemplate","precompileTemplate","scope","on","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;AAkBqBA,IAAAA,iBAAiB,IAAAC,MAAA,IAAAC,OAAA,GAAvB,MAAMF,iBAAiB,SAASG,SAAS,CAA6B;EACjF,IAAIC,SAASA,GAAY;AACrB,IAAA,OAAO,CAAC,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO,CAAA;AAC9B,GAAA;EAEAC,YAAYA,CAACC,MAAa,EAAQ;IAC9BA,MAAM,CAACC,cAAc,EAAE,CAAA;AACvB,IAAA,MAAMC,MAAM,GAAG,CAAC,IAAI,CAACL,IAAI,CAACC,OAAO,CAAA;IACjC,IAAI,OAAO,IAAI,CAACD,IAAI,CAACM,QAAQ,KAAK,UAAU,EAAE;MAC1C,IAAI,CAACN,IAAI,CAACM,QAAQ,CAACD,MAAM,EAAEF,MAAM,CAAC,CAAA;AACtC,KAAA;AACJ,GAAA;EACA,IAAII,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,QAAQ,EAAEC,SAAAA;KAAW,GAAGC,SAAS,EAAE,CAAA;AAC3C,IAAA,OAAOD,SAAS,CAAC;AACbE,MAAAA,IAAI,EAAE,IAAI,CAACX,IAAI,CAACW,IAAI;AACpBC,MAAAA,KAAK,EAAE,IAAI,CAACZ,IAAI,CAACY,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAoBJ,CAAC,EAAAC,oBAAA,CAlBOC,kBAAA,CAWH,0MAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,EAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAApB,OAAA,CAAAA,EAAAA,OAAA,CAAAqB,GAAAA,yBAAA,CAAAtB,MAAA,CAAAuB,SAAA,EAhCLC,cAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAA1B,MAAA,CAAAuB,SAAA,EAAA,cAAA,CAAA,EAAAvB,MAAA,CAAAuB,SAAA,CAAA,GAAAvB,MAAA;;;;"}
@@ -1,36 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { useStyles } from '@frontile/theme';
3
- import { precompileTemplate } from '@ember/template-compilation';
4
- import { setComponentTemplate } from '@ember/component';
5
-
6
- var _class;
7
- class FormFieldFeedback extends Component {
8
- get isError() {
9
- return typeof this.args.errors !== 'undefined' || this.args.isError === true;
10
- }
11
- get classes() {
12
- const {
13
- feedback: feedback1
14
- } = useStyles();
15
- return feedback1({
16
- size: this.args.size,
17
- isError: this.isError,
18
- class: this.args.class
19
- });
20
- }
21
- get errorMessage() {
22
- if (!this.args.errors) return '';
23
- if (typeof this.args.errors === 'string') {
24
- return this.args.errors;
25
- } else {
26
- return this.args.errors.join('; ');
27
- }
28
- }
29
- }
30
- _class = 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
- }), _class);
34
-
35
- export { FormFieldFeedback as default };
36
- //# sourceMappingURL=feedback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feedback.js","sources":["../../../src/components/form-field/feedback.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldFeedbackArgs {\n id?: string;\n isError?: boolean;\n errors?: string[] | string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\nexport interface FormFieldFeedbackSignature {\n Args: FormFieldFeedbackArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class FormFieldFeedback extends Component<FormFieldFeedbackSignature> {\n get isError(): boolean {\n return (typeof this.args.errors !== 'undefined' || this.args.isError === true);\n }\n get classes() {\n const { feedback: feedback1 } = useStyles();\n return feedback1({\n size: this.args.size,\n isError: this.isError,\n class: this.args.class\n });\n }\n get errorMessage(): string {\n if (!this.args.errors) return '';\n if (typeof this.args.errors === 'string') {\n return this.args.errors;\n } else {\n return this.args.errors.join('; ');\n }\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldFeedback","Component","isError","args","errors","classes","feedback","feedback1","useStyles","size","class","errorMessage","join","_class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAiBe,MAAMA,iBAAiB,SAASC,SAAS,CAA6B;EACjF,IAAIC,OAAOA,GAAY;AACnB,IAAA,OAAQ,OAAO,IAAI,CAACC,IAAI,CAACC,MAAM,KAAK,WAAW,IAAI,IAAI,CAACD,IAAI,CAACD,OAAO,KAAK,IAAI,CAAA;AACjF,GAAA;EACA,IAAIG,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,QAAQ,EAAEC,SAAAA;KAAW,GAAGC,SAAS,EAAE,CAAA;AAC3C,IAAA,OAAOD,SAAS,CAAC;AACbE,MAAAA,IAAI,EAAE,IAAI,CAACN,IAAI,CAACM,IAAI;MACpBP,OAAO,EAAE,IAAI,CAACA,OAAO;AACrBQ,MAAAA,KAAK,EAAE,IAAI,CAACP,IAAI,CAACO,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;EACA,IAAIC,YAAYA,GAAW;IACvB,IAAI,CAAC,IAAI,CAACR,IAAI,CAACC,MAAM,EAAE,OAAO,EAAE,CAAA;IAChC,IAAI,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM,KAAK,QAAQ,EAAE;AACtC,MAAA,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM,CAAA;AAC3B,KAAC,MAAM;MACH,OAAO,IAAI,CAACD,IAAI,CAACC,MAAM,CAACQ,IAAI,CAAC,IAAI,CAAC,CAAA;AACtC,KAAA;AACJ,GAAA;AAoBJ,CAAA;AAACC,MAAA,GAvCoBb,iBAAiB,CAAA;AAqB9Bc,oBAAA,CAAAC,kBAAA,CAWH,uNAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAH,MAAA,CAAA;;;;"}
@@ -1,24 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { useStyles } from '@frontile/theme';
3
- import { precompileTemplate } from '@ember/template-compilation';
4
- import { setComponentTemplate } from '@ember/component';
5
-
6
- var _class;
7
- class FormFieldHint extends Component {
8
- get classes() {
9
- const {
10
- hint: hint1
11
- } = useStyles();
12
- return hint1({
13
- size: this.args.size,
14
- class: this.args.class
15
- });
16
- }
17
- }
18
- _class = 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
- }), _class);
22
-
23
- export { FormFieldHint as default };
24
- //# sourceMappingURL=hint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hint.js","sources":["../../../src/components/form-field/hint.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldHintArgs {\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\nexport interface FormFieldHintSignature {\n Args: FormFieldHintArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class FormFieldHint extends Component<FormFieldHintSignature> {\n get classes() {\n const { hint: hint1 } = useStyles();\n return hint1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldHint","Component","classes","hint","hint1","useStyles","size","args","class","_class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAee,MAAMA,aAAa,SAASC,SAAS,CAAyB;EACzE,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAAA;KAAO,GAAGC,SAAS,EAAE,CAAA;AACnC,IAAA,OAAOD,KAAK,CAAC;AACTE,MAAAA,IAAI,EAAE,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAK,EAAE,IAAI,CAACD,IAAI,CAACC,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAkBJ,CAAA;AAACC,MAAA,GAzBoBT,aAAa,CAAA;AAS1BU,oBAAA,CAAAC,kBAAA,CASH,+HAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAH,MAAA,CAAA;;;;"}
@@ -1,44 +0,0 @@
1
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
2
- import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
- import { on } from '@ember/modifier';
5
- import { useStyles } from '@frontile/theme';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
-
9
- var _class, _class2;
10
- let FormFieldInput = (_class = (_class2 = class FormFieldInput extends Component {
11
- get type() {
12
- if (typeof this.args.type === 'string') {
13
- return this.args.type;
14
- }
15
- return 'text';
16
- }
17
- handleOnInput(event1) {
18
- if (typeof this.args.onInput === 'function') {
19
- this.args.onInput(event1.target.value, event1);
20
- }
21
- }
22
- handleOnChange(event1) {
23
- if (typeof this.args.onChange === 'function') {
24
- this.args.onChange(event1.target.value, event1);
25
- }
26
- }
27
- get classes() {
28
- const {
29
- input: input1
30
- } = useStyles();
31
- return input1({
32
- size: this.args.size,
33
- class: this.args.class
34
- });
35
- }
36
- }, 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 ", {
37
- scope: () => ({
38
- on
39
- }),
40
- strictMode: true
41
- }), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleOnInput", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOnInput"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleOnChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOnChange"), _class.prototype)), _class);
42
-
43
- export { FormFieldInput as default };
44
- //# sourceMappingURL=input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.js","sources":["../../../src/components/form-field/input.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldInputArgs {\n id?: string;\n type?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n value?: string;\n // Callback when oninput is triggered\n onInput?: (value: string, event: InputEvent) => void;\n // Callback when onchange is triggered\n onChange?: (value: string, event: InputEvent) => void;\n}\nexport interface FormFieldInputSignature {\n Args: FormFieldInputArgs;\n Element: HTMLInputElement;\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 @action\n handleOnInput(event1: Event): void {\n if (typeof this.args.onInput === 'function') {\n this.args.onInput((event1.target as HTMLInputElement).value, event1 as InputEvent);\n }\n }\n @action\n handleOnChange(event1: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange((event1.target as HTMLInputElement).value, event1 as InputEvent);\n }\n }\n get classes() {\n const { input: input1 } = useStyles();\n return input1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldInput","_class","_class2","Component","type","args","handleOnInput","event1","onInput","target","value","handleOnChange","onChange","classes","input","input1","useStyles","size","class","setComponentTemplate","precompileTemplate","scope","on","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;AAoBqBA,IAAAA,cAAc,IAAAC,MAAA,IAAAC,OAAA,GAApB,MAAMF,cAAc,SAASG,SAAS,CAA0B;EAC3E,IAAIC,IAAIA,GAAW;IACf,IAAI,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,KAAK,QAAQ,EAAE;AACpC,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI,CAAA;AACzB,KAAA;AACA,IAAA,OAAO,MAAM,CAAA;AACjB,GAAA;EAEAE,aAAaA,CAACC,MAAa,EAAQ;IAC/B,IAAI,OAAO,IAAI,CAACF,IAAI,CAACG,OAAO,KAAK,UAAU,EAAE;AACzC,MAAA,IAAI,CAACH,IAAI,CAACG,OAAO,CAAED,MAAM,CAACE,MAAM,CAAsBC,KAAK,EAAEH,MAAoB,CAAC,CAAA;AACtF,KAAA;AACJ,GAAA;EAEAI,cAAcA,CAACJ,MAAa,EAAQ;IAChC,IAAI,OAAO,IAAI,CAACF,IAAI,CAACO,QAAQ,KAAK,UAAU,EAAE;AAC1C,MAAA,IAAI,CAACP,IAAI,CAACO,QAAQ,CAAEL,MAAM,CAACE,MAAM,CAAsBC,KAAK,EAAEH,MAAoB,CAAC,CAAA;AACvF,KAAA;AACJ,GAAA;EACA,IAAIM,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,KAAK,EAAEC,MAAAA;KAAQ,GAAGC,SAAS,EAAE,CAAA;AACrC,IAAA,OAAOD,MAAM,CAAC;AACVE,MAAAA,IAAI,EAAE,IAAI,CAACZ,IAAI,CAACY,IAAI;AACpBC,MAAAA,KAAK,EAAE,IAAI,CAACb,IAAI,CAACa,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAoBJ,CAAC,EAAAC,oBAAA,CAlBOC,kBAAA,CAWH,qNAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,EAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAArB,OAAA,CAAA,EAAAA,OAAA,CAAAsB,GAAAA,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,EApCLC,eAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,EAAAxB,eAAAA,CAAAA,EAAAA,MAAA,CAAAwB,SAAA,CAAA,EAAAD,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,EAAA,gBAAA,EAAA,CAMNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,qBAAAxB,MAAA,CAAAwB,SAAA,CAAA,GAAAxB,MAAA;;;;"}
@@ -1,24 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { useStyles } from '@frontile/theme';
3
- import { precompileTemplate } from '@ember/template-compilation';
4
- import { setComponentTemplate } from '@ember/component';
5
-
6
- var _class;
7
- class FormFieldLabel extends Component {
8
- get classes() {
9
- const {
10
- label: label1
11
- } = useStyles();
12
- return label1({
13
- size: this.args.size,
14
- class: this.args.class
15
- });
16
- }
17
- }
18
- _class = FormFieldLabel;
19
- setComponentTemplate(precompileTemplate("\n <label for={{@for}} class={{this.classes}} data-test-id=\"form-field-label\" ...attributes>\n {{yield}}\n </label>\n ", {
20
- strictMode: true
21
- }), _class);
22
-
23
- export { FormFieldLabel as default };
24
- //# sourceMappingURL=label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"label.js","sources":["../../../src/components/form-field/label.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldLabelArgs {\n for?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n}\nexport interface FormFieldLabelSignature {\n Args: FormFieldLabelArgs;\n Element: HTMLLabelElement;\n Blocks: {\n default: [];\n };\n}\nexport default class FormFieldLabel extends Component<FormFieldLabelSignature> {\n get classes() {\n const { label: label1 } = useStyles();\n return label1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldLabel","Component","classes","label","label1","useStyles","size","args","class","_class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAee,MAAMA,cAAc,SAASC,SAAS,CAA0B;EAC3E,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,KAAK,EAAEC,MAAAA;KAAQ,GAAGC,SAAS,EAAE,CAAA;AACrC,IAAA,OAAOD,MAAM,CAAC;AACVE,MAAAA,IAAI,EAAE,IAAI,CAACC,IAAI,CAACD,IAAI;AACpBE,MAAAA,KAAK,EAAE,IAAI,CAACD,IAAI,CAACC,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAkBJ,CAAA;AAACC,MAAA,GAzBoBT,cAAc,CAAA;AAS3BU,oBAAA,CAAAC,kBAAA,CASH,sIAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAH,MAAA,CAAA;;;;"}
@@ -1,37 +0,0 @@
1
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
2
- import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
- import { on } from '@ember/modifier';
5
- import { useStyles } from '@frontile/theme';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
-
9
- var _class, _class2;
10
- let FormFieldRadio = (_class = (_class2 = class FormFieldRadio extends Component {
11
- get isChecked() {
12
- return this.args.checked === this.args.value;
13
- }
14
- handleChange(event1) {
15
- event1.preventDefault();
16
- if (typeof this.args.onChange === 'function') {
17
- this.args.onChange(this.args.value, event1);
18
- }
19
- }
20
- get classes() {
21
- const {
22
- radio: radio1
23
- } = useStyles();
24
- return radio1({
25
- size: this.args.size,
26
- class: this.args.class
27
- });
28
- }
29
- }, setComponentTemplate(precompileTemplate("\n <input {{on \"change\" this.handleChange}} id={{@id}} name={{@name}} value={{@value}} checked={{this.isChecked}} type=\"radio\" class={{this.classes}} data-test-id=\"form-field-radio\" ...attributes />\n ", {
30
- scope: () => ({
31
- on
32
- }),
33
- strictMode: true
34
- }), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleChange"), _class.prototype)), _class);
35
-
36
- export { FormFieldRadio as default };
37
- //# sourceMappingURL=radio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio.js","sources":["../../../src/components/form-field/radio.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldRadioArgs {\n id?: string;\n value?: string | number | boolean;\n checked?: unknown;\n name?: string;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n // Callback when onchange is triggered\n onChange?: (value: unknown, event: Event) => void;\n}\nexport interface FormFieldRadioSignature {\n Args: FormFieldRadioArgs;\n Element: HTMLInputElement;\n}\nexport default class FormFieldRadio extends Component<FormFieldRadioSignature> {\n get isChecked(): boolean {\n return this.args.checked === this.args.value;\n }\n @action\n handleChange(event1: Event): void {\n event1.preventDefault();\n if (typeof this.args.onChange === 'function') {\n this.args.onChange(this.args.value, event1);\n }\n }\n get classes() {\n const { radio: radio1 } = useStyles();\n return radio1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\n template(`\n <input\n {{on \"change\" this.handleChange}}\n id={{@id}}\n name={{@name}}\n value={{@value}}\n checked={{this.isChecked}}\n type=\"radio\"\n class={{this.classes}}\n data-test-id=\"form-field-radio\"\n ...attributes\n />\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldRadio","_class","_class2","Component","isChecked","args","checked","value","handleChange","event1","preventDefault","onChange","classes","radio","radio1","useStyles","size","class","setComponentTemplate","precompileTemplate","scope","on","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;AAmBqBA,IAAAA,cAAc,IAAAC,MAAA,IAAAC,OAAA,GAApB,MAAMF,cAAc,SAASG,SAAS,CAA0B;EAC3E,IAAIC,SAASA,GAAY;IACrB,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,KAAK,IAAI,CAACD,IAAI,CAACE,KAAK,CAAA;AAChD,GAAA;EAEAC,YAAYA,CAACC,MAAa,EAAQ;IAC9BA,MAAM,CAACC,cAAc,EAAE,CAAA;IACvB,IAAI,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,KAAK,UAAU,EAAE;AAC1C,MAAA,IAAI,CAACN,IAAI,CAACM,QAAQ,CAAC,IAAI,CAACN,IAAI,CAACE,KAAK,EAAEE,MAAM,CAAC,CAAA;AAC/C,KAAA;AACJ,GAAA;EACA,IAAIG,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,KAAK,EAAEC,MAAAA;KAAQ,GAAGC,SAAS,EAAE,CAAA;AACrC,IAAA,OAAOD,MAAM,CAAC;AACVE,MAAAA,IAAI,EAAE,IAAI,CAACX,IAAI,CAACW,IAAI;AACpBC,MAAAA,KAAK,EAAE,IAAI,CAACZ,IAAI,CAACY,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAqBJ,CAAC,EAAAC,oBAAA,CAnBOC,kBAAA,CAYH,qNAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,EAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAApB,OAAA,CAAAA,EAAAA,OAAA,CAAAqB,GAAAA,yBAAA,CAAAtB,MAAA,CAAAuB,SAAA,EAhCLC,cAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAA1B,MAAA,CAAAuB,SAAA,EAAA,cAAA,CAAA,EAAAvB,MAAA,CAAAuB,SAAA,CAAA,GAAAvB,MAAA;;;;"}
@@ -1,38 +0,0 @@
1
- import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
2
- import Component from '@glimmer/component';
3
- import { action } from '@ember/object';
4
- import { on } from '@ember/modifier';
5
- import { useStyles } from '@frontile/theme';
6
- import { precompileTemplate } from '@ember/template-compilation';
7
- import { setComponentTemplate } from '@ember/component';
8
-
9
- var _class, _class2;
10
- let FormFieldTextarea = (_class = (_class2 = class FormFieldTextarea extends Component {
11
- handleOnInput(event1) {
12
- if (typeof this.args.onInput === 'function') {
13
- this.args.onInput(event1.target.value, event1);
14
- }
15
- }
16
- handleOnChange(event1) {
17
- if (typeof this.args.onChange === 'function') {
18
- this.args.onChange(event1.target.value, event1);
19
- }
20
- }
21
- get classes() {
22
- const {
23
- textarea: textarea1
24
- } = useStyles();
25
- return textarea1({
26
- size: this.args.size,
27
- class: this.args.class
28
- });
29
- }
30
- }, setComponentTemplate(precompileTemplate("\n <textarea {{on \"input\" this.handleOnInput}} {{on \"change\" this.handleOnChange}} id={{@id}} value={{@value}} class={{this.classes}} data-test-id=\"form-field-textarea\" ...attributes>\n </textarea>\n ", {
31
- scope: () => ({
32
- on
33
- }),
34
- strictMode: true
35
- }), _class2), _class2), (_applyDecoratedDescriptor(_class.prototype, "handleOnInput", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOnInput"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleOnChange", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOnChange"), _class.prototype)), _class);
36
-
37
- export { FormFieldTextarea as default };
38
- //# sourceMappingURL=textarea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textarea.js","sources":["../../../src/components/form-field/textarea.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport { useStyles } from '@frontile/theme';\nexport interface FormFieldTextareaArgs {\n id?: string;\n value?: string | number | boolean;\n size?: 'sm' | 'md' | 'lg';\n class?: string;\n // Callback when oninput is triggered\n onInput?: (value: string, event: InputEvent) => void;\n // Callback when onchange is triggered\n onChange?: (value: string, event: InputEvent) => void;\n}\nexport interface FormFieldTextareaSignature {\n Args: FormFieldTextareaArgs;\n Element: HTMLTextAreaElement;\n}\nexport default class FormFieldTextarea extends Component<FormFieldTextareaSignature> {\n @action\n handleOnInput(event1: Event): void {\n if (typeof this.args.onInput === 'function') {\n this.args.onInput((event1.target as HTMLInputElement).value, event1 as InputEvent);\n }\n }\n @action\n handleOnChange(event1: Event): void {\n if (typeof this.args.onChange === 'function') {\n this.args.onChange((event1.target as HTMLInputElement).value, event1 as InputEvent);\n }\n }\n get classes() {\n const { textarea: textarea1 } = useStyles();\n return textarea1({\n size: this.args.size,\n class: this.args.class\n });\n }\n static{\n template(`\n <textarea\n {{on \"input\" this.handleOnInput}}\n {{on \"change\" this.handleOnChange}}\n id={{@id}}\n value={{@value}}\n class={{this.classes}}\n data-test-id=\"form-field-textarea\"\n ...attributes\n >\n </textarea>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["FormFieldTextarea","_class","_class2","Component","handleOnInput","event1","args","onInput","target","value","handleOnChange","onChange","classes","textarea","textarea1","useStyles","size","class","setComponentTemplate","precompileTemplate","scope","on","strictMode","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;AAmBqBA,IAAAA,iBAAiB,IAAAC,MAAA,IAAAC,OAAA,GAAvB,MAAMF,iBAAiB,SAASG,SAAS,CAA6B;EAEjFC,aAAaA,CAACC,MAAa,EAAQ;IAC/B,IAAI,OAAO,IAAI,CAACC,IAAI,CAACC,OAAO,KAAK,UAAU,EAAE;AACzC,MAAA,IAAI,CAACD,IAAI,CAACC,OAAO,CAAEF,MAAM,CAACG,MAAM,CAAsBC,KAAK,EAAEJ,MAAoB,CAAC,CAAA;AACtF,KAAA;AACJ,GAAA;EAEAK,cAAcA,CAACL,MAAa,EAAQ;IAChC,IAAI,OAAO,IAAI,CAACC,IAAI,CAACK,QAAQ,KAAK,UAAU,EAAE;AAC1C,MAAA,IAAI,CAACL,IAAI,CAACK,QAAQ,CAAEN,MAAM,CAACG,MAAM,CAAsBC,KAAK,EAAEJ,MAAoB,CAAC,CAAA;AACvF,KAAA;AACJ,GAAA;EACA,IAAIO,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,QAAQ,EAAEC,SAAAA;KAAW,GAAGC,SAAS,EAAE,CAAA;AAC3C,IAAA,OAAOD,SAAS,CAAC;AACbE,MAAAA,IAAI,EAAE,IAAI,CAACV,IAAI,CAACU,IAAI;AACpBC,MAAAA,KAAK,EAAE,IAAI,CAACX,IAAI,CAACW,KAAAA;AACrB,KAAC,CAAC,CAAA;AACN,GAAA;AAoBJ,CAAC,EAAAC,oBAAA,CAlBOC,kBAAA,CAWH,uNAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,EAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAApB,OAAA,CAAA,EAAAA,OAAA,CAAAqB,GAAAA,yBAAA,CAAAtB,MAAA,CAAAuB,SAAA,EApCLC,eAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAA1B,MAAA,CAAAuB,SAAA,EAAAvB,eAAAA,CAAAA,EAAAA,MAAA,CAAAuB,SAAA,CAAA,EAAAD,yBAAA,CAAAtB,MAAA,CAAAuB,SAAA,EAAA,gBAAA,EAAA,CAMNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAA1B,MAAA,CAAAuB,SAAA,qBAAAvB,MAAA,CAAAuB,SAAA,CAAA,GAAAvB,MAAA;;;;"}