Skip to content

Commit

Permalink
feat(form-builder): autoresize textareas and code editor
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Feb 23, 2022
1 parent 273e9d2 commit edf0871
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 41 deletions.
3 changes: 2 additions & 1 deletion packages/form-builder/addon/components/cfb-code-editor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

<div
name={{@name}}
class={{concat "uk-textarea cfb-code-editor language-" @language}}
class="uk-textare cfb-code-editor {{concat 'language-' @language}}"
{{did-insert this.didInsertNode}}
{{will-destroy this.willDestroyNode}}
{{autoresize mode="height"}}
></div>

{{component @hintComponent}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,17 @@
@name="description"
@type="textarea"
@label={{t "caluma.form-builder.form.description"}}
@rows="4"
{{autoresize mode="height"}}
/>

<f.input
class="uk-flex uk-flex-between uk-flex-column"
@name="isArchived"
@label={{t "caluma.form-builder.form.isArchived"}}
@required={{true}}
@renderComponent={{component "cfb-toggle-switch" size="small"}}
/>

<f.input
class="uk-flex uk-flex-between uk-flex-column"
@name="isPublished"
@label={{t "caluma.form-builder.form.isPublished"}}
@required={{true}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
@label={{t "caluma.form-builder.question.confirmationText"}}
@name="infoText"
@type="textarea"
{{autoresize mode="height"}}
/>
{{else}}
<div class="uk-margin">
Expand Down Expand Up @@ -437,15 +438,13 @@
@optionTargetPath="component"
@optionLabelPath="label"
@options={{this.availableOverrides}}
class="uk-flex uk-flex-between uk-flex-column"
/>

<f.input
@name="isArchived"
@label={{t "caluma.form-builder.question.isArchived"}}
@required={{true}}
@renderComponent={{component "cfb-toggle-switch" size="small"}}
class="uk-flex uk-flex-between uk-flex-column"
/>

<UkButton
Expand All @@ -468,7 +467,6 @@
@required={{true}}
@label={{t "caluma.form-builder.question.validateOnEnter"}}
@renderComponent={{component "cfb-toggle-switch" size="small"}}
class="uk-flex uk-flex-between uk-flex-column"
/>
{{/if}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
.cfb-code-editor {
font-family: $base-code-font-family;
letter-spacing: normal;
height: 70px;
min-height: 70px;
line-height: 16px;
tab-size: 4;
}
3 changes: 2 additions & 1 deletion packages/form-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ember-resources": "^4.3.1",
"ember-test-selectors": "^6.0.0",
"ember-uikit": "^5.0.0",
"ember-validated-form": "^5.2.2",
"ember-validated-form": "^5.3.0",
"graphql": "^15.8.0",
"graphql-tag": "^2.12.6",
"jexl": "^2.3.0",
Expand All @@ -55,6 +55,7 @@
"@faker-js/faker": "6.0.0-alpha.7",
"@projectcaluma/ember-testing": "11.0.0-beta.3",
"broccoli-asset-rev": "3.0.0",
"ember-autoresize-modifier": "^0.5.0",
"ember-cli": "3.28.5",
"ember-cli-code-coverage": "1.0.3",
"ember-cli-dependency-checker": "3.2.0",
Expand Down
74 changes: 42 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@
browserslist "^4.17.5"
semver "^6.3.0"

"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.1", "@babel/helper-create-class-features-plugin@^7.5.5", "@babel/helper-create-class-features-plugin@^7.8.3":
version "7.17.1"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.1.tgz#9699f14a88833a7e055ce57dcd3ffdcd25186b21"
integrity sha512-JBdSr/LtyYIno/pNnJ75lBcqc3Z1XXujzPanHqjvvrhOA+DTceTFuJi8XjmWTZh4r3fsdfqaCMN0iZemdkxZHQ==
"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.1", "@babel/helper-create-class-features-plugin@^7.17.6", "@babel/helper-create-class-features-plugin@^7.5.5", "@babel/helper-create-class-features-plugin@^7.8.3":
version "7.17.6"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9"
integrity sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==
dependencies:
"@babel/helper-annotate-as-pure" "^7.16.7"
"@babel/helper-environment-visitor" "^7.16.7"
Expand Down Expand Up @@ -208,18 +208,18 @@
"@babel/types" "^7.16.7"

"@babel/helper-module-transforms@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41"
integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==
version "7.17.6"
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz#3c3b03cc6617e33d68ef5a27a67419ac5199ccd0"
integrity sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA==
dependencies:
"@babel/helper-environment-visitor" "^7.16.7"
"@babel/helper-module-imports" "^7.16.7"
"@babel/helper-simple-access" "^7.16.7"
"@babel/helper-split-export-declaration" "^7.16.7"
"@babel/helper-validator-identifier" "^7.16.7"
"@babel/template" "^7.16.7"
"@babel/traverse" "^7.16.7"
"@babel/types" "^7.16.7"
"@babel/traverse" "^7.17.3"
"@babel/types" "^7.17.0"

"@babel/helper-optimise-call-expression@^7.16.7":
version "7.16.7"
Expand Down Expand Up @@ -351,11 +351,11 @@
"@babel/helper-plugin-utils" "^7.16.7"

"@babel/plugin-proposal-class-static-block@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.7.tgz#712357570b612106ef5426d13dc433ce0f200c2a"
integrity sha512-dgqJJrcZoG/4CkMopzhPJjGxsIe9A8RlkQLnL/Vhhx8AA9ZuaRwGSlscSh42hazc7WSrya/IK7mTeoF0DP9tEw==
version "7.17.6"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz#164e8fd25f0d80fa48c5a4d1438a6629325ad83c"
integrity sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==
dependencies:
"@babel/helper-create-class-features-plugin" "^7.16.7"
"@babel/helper-create-class-features-plugin" "^7.17.6"
"@babel/helper-plugin-utils" "^7.16.7"
"@babel/plugin-syntax-class-static-block" "^7.14.5"

Expand Down Expand Up @@ -3231,9 +3231,9 @@ agent-base@6, agent-base@^6.0.2:
debug "4"

agentkeepalive@^4.1.3:
version "4.2.0"
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.0.tgz#616ce94ccb41d1a39a45d203d8076fe98713062d"
integrity sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw==
version "4.2.1"
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717"
integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==
dependencies:
debug "^4.1.0"
depd "^1.1.2"
Expand Down Expand Up @@ -8721,14 +8721,18 @@ ember-uikit@5.0.0, ember-uikit@^5.0.0:
ember-toggle "^9.0.3"
uikit "^3.10.1"

ember-validated-form@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/ember-validated-form/-/ember-validated-form-5.2.2.tgz#00428ab14dd2c4db192afb977dee284404a04cda"
integrity sha512-G5YNddhMgchhNfwrvEO4rM/dZPnUM1eGJGwHsUgh+EjDKwv+XCPA9toEmU0PQtMVDG3qKYqZfKQgSwNmlh25wQ==
ember-validated-form@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/ember-validated-form/-/ember-validated-form-5.3.0.tgz#fd697bfb4b46473dd85a592d2f23bfe564214fbb"
integrity sha512-o5TRotrvzhATp1S/ycXVBPqGS481Xv+EkwvKjX5ahfgUaKnjxl5ekwX6g9ZknQAEDYjbSmdKYD+C/IH9xrqFsQ==
dependencies:
"@glimmer/component" "^1.0.4"
"@glimmer/tracking" "^1.0.4"
ember-auto-import "^2.4.0"
ember-cli-babel "^7.26.6"
ember-cli-htmlbars "^5.7.1"
ember-changeset "^4.0.0-beta.5"
ember-changeset-validations "^4.0.0-beta.3"
ember-cli-babel "^7.26.11"
ember-cli-htmlbars "^6.0.1"
ember-truth-helpers "^3.0.0"

ember-validators@^4.1.2, ember-validators@~4.1.2:
Expand Down Expand Up @@ -10556,9 +10560,9 @@ graphql-tools@^4.0.8:
uuid "^3.1.0"

graphql-ws@^5.4.1:
version "5.6.0"
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.6.0.tgz#8914d0c0a7be0cc3e8fd486ea8a148e500b2ff29"
integrity sha512-Kz/4z1u9yGKWMtzlvia9wW8AJGjx68OyCCV40dabYq1OeyUxgU9t8Ll43vLAje7TYiLwZSwGbvtHviHaPyGYxw==
version "5.6.1"
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.6.1.tgz#2444eaa222c60f8d937f3131eab86106fb3ab21d"
integrity sha512-lXxGMjs4xUDLEFS4TB9kbQUamV24HorMoiv+U1dxHcis7xyrk7qztSCP+XvM9ZMStLwELqD+ROGDV1cqraFNPA==

graphql@15.8.0, graphql@^15.8.0:
version "15.8.0"
Expand Down Expand Up @@ -13057,11 +13061,16 @@ miller-rabin@^4.0.0:
bn.js "^4.0.0"
brorand "^1.0.1"

mime-db@1.51.0, "mime-db@>= 1.43.0 < 2":
mime-db@1.51.0:
version "1.51.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c"
integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==

"mime-db@>= 1.43.0 < 2":
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==

mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.19, mime-types@^2.1.26, mime-types@^2.1.27, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34:
version "2.1.34"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24"
Expand Down Expand Up @@ -15695,9 +15704,9 @@ rollup@^0.57.1:
sourcemap-codec "^1.4.1"

rollup@^2.50.0:
version "2.67.3"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.67.3.tgz#3f04391fc296f807d067c9081d173e0a33dbd37e"
integrity sha512-G/x1vUwbGtP6O5ZM8/sWr8+p7YfZhI18pPqMRtMYMWSbHjKZ/ajHGiM+GWNTlWyOR0EHIdT8LHU+Z4ciIZ1oBw==
version "2.68.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.68.0.tgz#6ccabfd649447f8f21d62bf41662e5caece3bd66"
integrity sha512-XrMKOYK7oQcTio4wyTz466mucnd8LzkiZLozZ4Rz0zQD+HeX4nUK4B8GrTX/2EvN2/vBF/i2WnaXboPxo0JylA==
optionalDependencies:
fsevents "~2.3.2"

Expand Down Expand Up @@ -17023,10 +17032,11 @@ terser@^4.1.2:
source-map-support "~0.5.12"

terser@^5.3.0, terser@^5.7.2:
version "5.10.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc"
integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==
version "5.11.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.11.0.tgz#2da5506c02e12cd8799947f30ce9c5b760be000f"
integrity sha512-uCA9DLanzzWSsN1UirKwylhhRz3aKPInlfmpGfw8VN6jHsAtu8HJtIpeeHHK23rxnE/cDc+yvmq5wqkIC6Kn0A==
dependencies:
acorn "^8.5.0"
commander "^2.20.0"
source-map "~0.7.2"
source-map-support "~0.5.20"
Expand Down

0 comments on commit edf0871

Please sign in to comment.