From ef1fe2ccd140386d75ffc4429dd7c08c76018fe9 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 23 Oct 2024 18:52:41 +1300 Subject: [PATCH 01/35] feat(tests/dummy/app/router): adds widget catalog. --- tests/dummy/app/router.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js index 529c99272..8f131720c 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -7,15 +7,16 @@ export default class Router extends EmberRouter { rootURL = config.rootURL; } -Router.map(function() { +Router.map(function () { this.route('introduction'); + this.route('catalog'); this.route('forms'); this.route('typography'); this.route('theme'); this.route('cookbook'); this.route('addons'); - this.route('demo', { path: 'components' }, function() { + this.route('demo', { path: 'components' }, function () { this.route('autocomplete'); this.route('button'); this.route('card'); @@ -28,7 +29,7 @@ Router.map(function() { this.route('input'); this.route('list'); this.route('menu'); - this.route('tabs', function() { + this.route('tabs', function () { this.route('nested-route'); }); this.route('progress-circular'); @@ -44,7 +45,7 @@ Router.map(function() { this.route('tooltip'); }); - this.route('layout', function() { + this.route('layout', function () { this.route('introduction'); this.route('layout-containers'); this.route('layout-children'); From 435132af171d37899761838e2b1cbf1477a25289 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 23 Oct 2024 18:53:36 +1300 Subject: [PATCH 02/35] feat(tests/dummy/app/templates/catalog): adds autocomplete. --- tests/dummy/app/controllers/catalog.js | 268 +++++++++++++++++++++++++ tests/dummy/app/templates/catalog.hbs | 161 +++++++++++++++ 2 files changed, 429 insertions(+) create mode 100644 tests/dummy/app/controllers/catalog.js create mode 100644 tests/dummy/app/templates/catalog.hbs diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js new file mode 100644 index 000000000..f36a45fb5 --- /dev/null +++ b/tests/dummy/app/controllers/catalog.js @@ -0,0 +1,268 @@ +import Controller from '@ember/controller'; +import { action } from '@ember/object'; +import { A } from '@ember/array'; + +export default class CatalogController extends Controller { + countries = A([ + { name: 'Afghanistan', code: 'AF' }, + { name: 'Åland Islands', code: 'AX' }, + { name: 'Albania', code: 'AL' }, + { name: 'Algeria', code: 'DZ' }, + { name: 'American Samoa', code: 'AS' }, + { name: 'AndorrA', code: 'AD' }, + { name: 'Angola', code: 'AO' }, + { name: 'Anguilla', code: 'AI' }, + { name: 'Antarctica', code: 'AQ' }, + { name: 'Antigua and Barbuda', code: 'AG' }, + { name: 'Argentina', code: 'AR' }, + { name: 'Armenia', code: 'AM' }, + { name: 'Aruba', code: 'AW' }, + { name: 'Australia', code: 'AU' }, + { name: 'Austria', code: 'AT' }, + { name: 'Azerbaijan', code: 'AZ' }, + { name: 'Bahamas', code: 'BS' }, + { name: 'Bahrain', code: 'BH' }, + { name: 'Bangladesh', code: 'BD' }, + { name: 'Barbados', code: 'BB' }, + { name: 'Belarus', code: 'BY' }, + { name: 'Belgium', code: 'BE' }, + { name: 'Belize', code: 'BZ' }, + { name: 'Benin', code: 'BJ' }, + { name: 'Bermuda', code: 'BM' }, + { name: 'Bhutan', code: 'BT' }, + { name: 'Bolivia', code: 'BO' }, + { name: 'Bosnia and Herzegovina', code: 'BA' }, + { name: 'Botswana', code: 'BW' }, + { name: 'Bouvet Island', code: 'BV' }, + { name: 'Brazil', code: 'BR' }, + { name: 'British Indian Ocean Territory', code: 'IO' }, + { name: 'Brunei Darussalam', code: 'BN' }, + { name: 'Bulgaria', code: 'BG' }, + { name: 'Burkina Faso', code: 'BF' }, + { name: 'Burundi', code: 'BI' }, + { name: 'Cambodia', code: 'KH' }, + { name: 'Cameroon', code: 'CM' }, + { name: 'Canada', code: 'CA' }, + { name: 'Cape Verde', code: 'CV' }, + { name: 'Cayman Islands', code: 'KY' }, + { name: 'Central African Republic', code: 'CF' }, + { name: 'Chad', code: 'TD' }, + { name: 'Chile', code: 'CL' }, + { name: 'China', code: 'CN' }, + { name: 'Christmas Island', code: 'CX' }, + { name: 'Cocos (Keeling) Islands', code: 'CC' }, + { name: 'Colombia', code: 'CO' }, + { name: 'Comoros', code: 'KM' }, + { name: 'Congo', code: 'CG' }, + { name: 'Congo, The Democratic Republic of the', code: 'CD' }, + { name: 'Cook Islands', code: 'CK' }, + { name: 'Costa Rica', code: 'CR' }, + { name: "Cote D'Ivoire", code: 'CI' }, + { name: 'Croatia', code: 'HR' }, + { name: 'Cuba', code: 'CU' }, + { name: 'Cyprus', code: 'CY' }, + { name: 'Czech Republic', code: 'CZ' }, + { name: 'Denmark', code: 'DK' }, + { name: 'Djibouti', code: 'DJ' }, + { name: 'Dominica', code: 'DM' }, + { name: 'Dominican Republic', code: 'DO' }, + { name: 'Ecuador', code: 'EC' }, + { name: 'Egypt', code: 'EG' }, + { name: 'El Salvador', code: 'SV' }, + { name: 'Equatorial Guinea', code: 'GQ' }, + { name: 'Eritrea', code: 'ER' }, + { name: 'Estonia', code: 'EE' }, + { name: 'Ethiopia', code: 'ET' }, + { name: 'Falkland Islands (Malvinas)', code: 'FK' }, + { name: 'Faroe Islands', code: 'FO' }, + { name: 'Fiji', code: 'FJ' }, + { name: 'Finland', code: 'FI' }, + { name: 'France', code: 'FR' }, + { name: 'French Guiana', code: 'GF' }, + { name: 'French Polynesia', code: 'PF' }, + { name: 'French Southern Territories', code: 'TF' }, + { name: 'Gabon', code: 'GA' }, + { name: 'Gambia', code: 'GM' }, + { name: 'Georgia', code: 'GE' }, + { name: 'Germany', code: 'DE' }, + { name: 'Ghana', code: 'GH' }, + { name: 'Gibraltar', code: 'GI' }, + { name: 'Greece', code: 'GR' }, + { name: 'Greenland', code: 'GL' }, + { name: 'Grenada', code: 'GD' }, + { name: 'Guadeloupe', code: 'GP' }, + { name: 'Guam', code: 'GU' }, + { name: 'Guatemala', code: 'GT' }, + { name: 'Guernsey', code: 'GG' }, + { name: 'Guinea', code: 'GN' }, + { name: 'Guinea-Bissau', code: 'GW' }, + { name: 'Guyana', code: 'GY' }, + { name: 'Haiti', code: 'HT' }, + { name: 'Heard Island and Mcdonald Islands', code: 'HM' }, + { name: 'Holy See (Vatican City State)', code: 'VA' }, + { name: 'Honduras', code: 'HN' }, + { name: 'Hong Kong', code: 'HK' }, + { name: 'Hungary', code: 'HU' }, + { name: 'Iceland', code: 'IS' }, + { name: 'India', code: 'IN' }, + { name: 'Indonesia', code: 'ID' }, + { name: 'Iran, Islamic Republic Of', code: 'IR' }, + { name: 'Iraq', code: 'IQ' }, + { name: 'Ireland', code: 'IE' }, + { name: 'Isle of Man', code: 'IM' }, + { name: 'Israel', code: 'IL' }, + { name: 'Italy', code: 'IT' }, + { name: 'Jamaica', code: 'JM' }, + { name: 'Japan', code: 'JP' }, + { name: 'Jersey', code: 'JE' }, + { name: 'Jordan', code: 'JO' }, + { name: 'Kazakhstan', code: 'KZ' }, + { name: 'Kenya', code: 'KE' }, + { name: 'Kiribati', code: 'KI' }, + { name: "Korea, Democratic People'S Republic of", code: 'KP' }, + { name: 'Korea, Republic of', code: 'KR' }, + { name: 'Kuwait', code: 'KW' }, + { name: 'Kyrgyzstan', code: 'KG' }, + { name: "Lao People'S Democratic Republic", code: 'LA' }, + { name: 'Latvia', code: 'LV' }, + { name: 'Lebanon', code: 'LB' }, + { name: 'Lesotho', code: 'LS' }, + { name: 'Liberia', code: 'LR' }, + { name: 'Libyan Arab Jamahiriya', code: 'LY' }, + { name: 'Liechtenstein', code: 'LI' }, + { name: 'Lithuania', code: 'LT' }, + { name: 'Luxembourg', code: 'LU' }, + { name: 'Macao', code: 'MO' }, + { name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK' }, + { name: 'Madagascar', code: 'MG' }, + { name: 'Malawi', code: 'MW' }, + { name: 'Malaysia', code: 'MY' }, + { name: 'Maldives', code: 'MV' }, + { name: 'Mali', code: 'ML' }, + { name: 'Malta', code: 'MT' }, + { name: 'Marshall Islands', code: 'MH' }, + { name: 'Martinique', code: 'MQ' }, + { name: 'Mauritania', code: 'MR' }, + { name: 'Mauritius', code: 'MU' }, + { name: 'Mayotte', code: 'YT' }, + { name: 'Mexico', code: 'MX' }, + { name: 'Micronesia, Federated States of', code: 'FM' }, + { name: 'Moldova, Republic of', code: 'MD' }, + { name: 'Monaco', code: 'MC' }, + { name: 'Mongolia', code: 'MN' }, + { name: 'Montserrat', code: 'MS' }, + { name: 'Morocco', code: 'MA' }, + { name: 'Mozambique', code: 'MZ' }, + { name: 'Myanmar', code: 'MM' }, + { name: 'Namibia', code: 'NA' }, + { name: 'Nauru', code: 'NR' }, + { name: 'Nepal', code: 'NP' }, + { name: 'Netherlands', code: 'NL' }, + { name: 'Netherlands Antilles', code: 'AN' }, + { name: 'New Caledonia', code: 'NC' }, + { name: 'New Zealand', code: 'NZ' }, + { name: 'Nicaragua', code: 'NI' }, + { name: 'Niger', code: 'NE' }, + { name: 'Nigeria', code: 'NG' }, + { name: 'Niue', code: 'NU' }, + { name: 'Norfolk Island', code: 'NF' }, + { name: 'Northern Mariana Islands', code: 'MP' }, + { name: 'Norway', code: 'NO' }, + { name: 'Oman', code: 'OM' }, + { name: 'Pakistan', code: 'PK' }, + { name: 'Palau', code: 'PW' }, + { name: 'Palestinian Territory, Occupied', code: 'PS' }, + { name: 'Panama', code: 'PA' }, + { name: 'Papua New Guinea', code: 'PG' }, + { name: 'Paraguay', code: 'PY' }, + { name: 'Peru', code: 'PE' }, + { name: 'Philippines', code: 'PH' }, + { name: 'Pitcairn', code: 'PN' }, + { name: 'Poland', code: 'PL' }, + { name: 'Portugal', code: 'PT' }, + { name: 'Puerto Rico', code: 'PR' }, + { name: 'Qatar', code: 'QA' }, + { name: 'Reunion', code: 'RE' }, + { name: 'Romania', code: 'RO' }, + { name: 'Russian Federation', code: 'RU' }, + { name: 'RWANDA', code: 'RW' }, + { name: 'Saint Helena', code: 'SH' }, + { name: 'Saint Kitts and Nevis', code: 'KN' }, + { name: 'Saint Lucia', code: 'LC' }, + { name: 'Saint Pierre and Miquelon', code: 'PM' }, + { name: 'Saint Vincent and the Grenadines', code: 'VC' }, + { name: 'Samoa', code: 'WS' }, + { name: 'San Marino', code: 'SM' }, + { name: 'Sao Tome and Principe', code: 'ST' }, + { name: 'Saudi Arabia', code: 'SA' }, + { name: 'Senegal', code: 'SN' }, + { name: 'Serbia and Montenegro', code: 'CS' }, + { name: 'Seychelles', code: 'SC' }, + { name: 'Sierra Leone', code: 'SL' }, + { name: 'Singapore', code: 'SG' }, + { name: 'Slovakia', code: 'SK' }, + { name: 'Slovenia', code: 'SI' }, + { name: 'Solomon Islands', code: 'SB' }, + { name: 'Somalia', code: 'SO' }, + { name: 'South Africa', code: 'ZA' }, + { name: 'South Georgia and the South Sandwich Islands', code: 'GS' }, + { name: 'Spain', code: 'ES' }, + { name: 'Sri Lanka', code: 'LK' }, + { name: 'Sudan', code: 'SD' }, + { name: 'Suriname', code: 'SR' }, + { name: 'Svalbard and Jan Mayen', code: 'SJ' }, + { name: 'Swaziland', code: 'SZ' }, + { name: 'Sweden', code: 'SE' }, + { name: 'Switzerland', code: 'CH' }, + { name: 'Syrian Arab Republic', code: 'SY' }, + { name: 'Taiwan, Province of China', code: 'TW' }, + { name: 'Tajikistan', code: 'TJ' }, + { name: 'Tanzania, United Republic of', code: 'TZ' }, + { name: 'Thailand', code: 'TH' }, + { name: 'Timor-Leste', code: 'TL' }, + { name: 'Togo', code: 'TG' }, + { name: 'Tokelau', code: 'TK' }, + { name: 'Tonga', code: 'TO' }, + { name: 'Trinidad and Tobago', code: 'TT' }, + { name: 'Tunisia', code: 'TN' }, + { name: 'Turkey', code: 'TR' }, + { name: 'Turkmenistan', code: 'TM' }, + { name: 'Turks and Caicos Islands', code: 'TC' }, + { name: 'Tuvalu', code: 'TV' }, + { name: 'Uganda', code: 'UG' }, + { name: 'Ukraine', code: 'UA' }, + { name: 'United Arab Emirates', code: 'AE' }, + { name: 'United Kingdom', code: 'GB' }, + { name: 'United States', code: 'US' }, + { name: 'United States Minor Outlying Islands', code: 'UM' }, + { name: 'Uruguay', code: 'UY' }, + { name: 'Uzbekistan', code: 'UZ' }, + { name: 'Vanuatu', code: 'VU' }, + { name: 'Venezuela', code: 'VE' }, + { name: 'Viet Nam', code: 'VN' }, + { name: 'Virgin Islands, British', code: 'VG' }, + { name: 'Virgin Islands, U.S.', code: 'VI' }, + { name: 'Wallis and Futuna', code: 'WF' }, + { name: 'Western Sahara', code: 'EH' }, + { name: 'Yemen', code: 'YE' }, + { name: 'Zambia', code: 'ZM' }, + { name: 'Zimbabwe', code: 'ZW' }, + ]); + selectedCountry = { name: 'Ireland', code: 'IE' }; + selectedCountry2 = { name: 'New Zealand', code: 'NZ' }; + + @action + raisedButton() { + alert('You pressed a raised button.'); + } + + @action + flatButton() { + alert('You pressed a flat button.'); + } + + @action + targetButton() { + alert('You pressed a target button.'); + } +} diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs new file mode 100644 index 000000000..beb2846ac --- /dev/null +++ b/tests/dummy/app/templates/catalog.hbs @@ -0,0 +1,161 @@ + + + +

Autocomplete

+
+ +

+ +

+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+{{outlet}} \ No newline at end of file From 2c7e2a6373af91db5f7fea5fc23d62f5c7ea8c33 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 23 Oct 2024 18:54:04 +1300 Subject: [PATCH 03/35] feat(tests/dummy/app/templates/catalog): adds button. --- tests/dummy/app/templates/catalog.hbs | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index beb2846ac..2a2083b22 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -157,5 +157,77 @@ + + + +

Button

+
+ +
+ Button with action + Primary (noink) + disabled + warn + accent + href link +
+

+ + Button with action + + Primary + disabled + warn + accent +

+ +

+ + Button with target + + + Button with bubble + + + Button no bubble + +

+
+ +

+ Fab + Fab + Mini + Mini + + + +

+ +

+ +

+
+
{{outlet}} \ No newline at end of file From ac4084f09d0ec29ccde118d08d636d9bb30d9a00 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 23 Oct 2024 18:54:30 +1300 Subject: [PATCH 04/35] feat(tests/dummy/app/templates/catalog): adds card. --- tests/dummy/app/templates/catalog.hbs | 241 ++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 2a2083b22..6c2766436 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -229,5 +229,246 @@

+ + + +

Card

+
+ +
+
+ + + + Card with image + Large + + + + + Action 1 + Action 2 + + + + + + + Card with block + Extra large + + + + +
+
+ + + {{paper-icon 'favorite'}} + + + {{paper-icon 'settings'}} + + + {{paper-icon 'share'}} + + +
+
+
+ +
+ + + + Card with image + Small + + + + + Action 1 + Action 2 + + + + + + + Card with block + Medium + + +
+
+
+ + Action 1 + Action 2 + +
+
+
+ +
+
+ + + + + Action buttons + + + +

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+
+ + Action 1 + Action 2 + +
+ + + + + + Vertical action buttons + + + +

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+
+ + Action 1 + Action 2 + +
+
+ +
+ + + + + Icon action buttons + + + +

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+
+ + + {{paper-icon 'favorite'}} + + + {{paper-icon 'settings'}} + + + {{paper-icon 'share'}} + + +
+ + + + + + {{paper-icon 'favorite'}} + + + {{paper-icon 'settings'}} + + + {{paper-icon 'share'}} + + + + + + + + tomster + + + Ember + Paper + + + + + + Card header + + + +

+ The titles of Washed Out's breakthrough song and the first + single from Paracosm share the two most important words in + Ernest Greene's musical language: feel it. It's a simple + request, as well... +

+
+
+
+
+
+
{{outlet}} \ No newline at end of file From 7328d6394543d13072881a5d8fc8ce118934d083 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Wed, 23 Oct 2024 18:56:20 +1300 Subject: [PATCH 05/35] ci(tests/dummy/app): fixes lint. --- tests/dummy/app/router.js | 1 - tests/dummy/app/templates/catalog.hbs | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js index 8f131720c..ffb02885c 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -1,4 +1,3 @@ -/* eslint-disable prettier/prettier */ import EmberRouter from '@ember/routing/router'; import config from 'dummy/config/environment'; diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 6c2766436..a44077b27 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -164,7 +164,7 @@
- Button with action + Button with action Primary (noink) disabled warn @@ -175,7 +175,7 @@ >href link

- + Button with action Primary @@ -185,20 +185,20 @@

- + Button with target Button with bubble Button no bubble From 20a7bac2119be7004d70574fdc3582cd8d7eb2c3 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 10:54:37 +1300 Subject: [PATCH 06/35] feat(tests/dummy/app/templates/catalog): adds checkbox. --- tests/dummy/app/controllers/catalog.js | 17 ++++++ tests/dummy/app/templates/catalog.hbs | 73 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index f36a45fb5..c3df41993 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -1,8 +1,10 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; import { A } from '@ember/array'; export default class CatalogController extends Controller { + // Autocomplete countries = A([ { name: 'Afghanistan', code: 'AF' }, { name: 'Åland Islands', code: 'AX' }, @@ -265,4 +267,19 @@ export default class CatalogController extends Controller { targetButton() { alert('You pressed a target button.'); } + + // Checkbox + checkboxValue1 = true; + checkboxValue2 = false; + checkboxValue3 = false; + checkboxValue4 = false; + checkboxValue5 = false; + @tracked checkboxValue6 = false; + @tracked checkboxValue7 = undefined; + get checkboxIsIndeterminate() { + return this.checkboxValue7 === undefined; + } + @action checkboxToggleCheckValue6() { + this.checkboxValue6 = !this.checkboxValue6; + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index a44077b27..44ea303e9 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -470,5 +470,78 @@ + + + +

Checkbox

+ + +
+ + A checkbox: + {{this.checkboxValue1}} + + + + A checkbox: + {{if this.checkboxValue2 'yep' 'nope'}} + + + + Checkbox (disabled) + + + + Checkbox (disabled and value) + + + + Checkbox (no ink) + + + + + + Indeterminate checkbox + + + + Indeterminate checkbox (disabled) + +
+
+ + {{outlet}} \ No newline at end of file From d6ba114dfb81e9286ac3731cd67b44e88e6c57c9 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 11:26:50 +1300 Subject: [PATCH 07/35] fix(tests/dummy/app/controllers/demo/chips): migrates to `faker.image.avatar()`. --- tests/dummy/app/controllers/demo/chips.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dummy/app/controllers/demo/chips.js b/tests/dummy/app/controllers/demo/chips.js index 579772be0..1b47be8ef 100644 --- a/tests/dummy/app/controllers/demo/chips.js +++ b/tests/dummy/app/controllers/demo/chips.js @@ -20,7 +20,7 @@ export default Controller.extend({ contacts.push({ name: faker.person.fullName(), email: faker.internet.email(), - image: faker.internet.avatar() + image: faker.image.avatar(), }); } @@ -48,7 +48,7 @@ export default Controller.extend({ contacts.push({ shortName: `${firstName} ${lastName[0]}`, emailAddress: `${firstName.toLowerCase()}.${lastName[0].toLowerCase()}@example.com`, - profileImage: faker.internet.avatar() + profileImage: faker.image.avatar(), }); } From c042a7ddf7672a62f76184faa1117f53693ddf45 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 11:29:24 +1300 Subject: [PATCH 08/35] feat(tests/dummy/app/templates/catalog): adds chips. --- tests/dummy/app/controllers/catalog.js | 82 ++++++++++++++++++++++++++ tests/dummy/app/templates/catalog.hbs | 59 ++++++++++++++++++ 2 files changed, 141 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index c3df41993..df2d7b34f 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -282,4 +282,86 @@ export default class CatalogController extends Controller { @action checkboxToggleCheckValue6() { this.checkboxValue6 = !this.checkboxValue6; } + + // Chips + @tracked chipsFruitNames = A(['Apple', 'Banana', 'Orange']); + @action chipsRemoveItem(item) { + this.chipsFruitNames.removeObject(item); + } + @action chipsAddItem(item) { + this.chipsFruitNames.pushObject(item); + } + + @tracked chipsCustomFruitNames = A(['Apple', 'Banana', 'Orange']); + @action chipsRemoveCustomItem(item) { + this.chipsCustomFruitNames.removeObject(item); + } + @action chipsAddCustomItem(item) { + this.chipsCustomFruitNames.pushObject(item); + } + + @tracked chipsVegeNames = A(['Broccoli']); + @tracked chipsAllVegeNames = A([ + 'Broccoli', + 'Cabbage', + 'Carrot', + 'Lettuce', + 'Spinach', + ]); + get chipsRemainingVegeNames() { + return this.chipsAllVegeNames.filter((source) => { + return !this.chipsVegeNames.any(function (myVegeName) { + return source === myVegeName; + }); + }); + } + + @tracked chipsVegetables = A([ + { + name: 'Broccoli', + family: 'Brassica', + }, + ]); + @action chipsRemoveVegetable(item) { + this.chipsVegetables.removeObject(item); + } + @action chipsAddVegetable(item) { + this.chipsVegetables.pushObject(item); + } + + @tracked chipsAllVegetables = A([ + { + name: 'Broccoli', + family: 'Brassica', + }, + { + name: 'Cabbage', + family: 'Brassica', + }, + { + name: 'Carrot', + family: 'Umbelliferous', + }, + { + name: 'Lettuce', + family: 'Composite', + }, + { + name: 'Spinach', + family: 'Goosefoot', + }, + ]); + get chipsRemainingVegetables() { + return this.chipsAllVegetables.filter((source) => { + return !this.chipsVegetables.any(function (myVegetable) { + return source.name === myVegetable.name; + }); + }); + } + @action chipsRemoveVegeName(item) { + this.chipsVegeNames.removeObject(item); + } + @action chipsAddVegeName(item) { + this.chipsVegeNames.pushObject(item); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 44ea303e9..af57ce626 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -542,6 +542,65 @@
+ + + +

Chips

+
+ + +

default template

+ + + {{item}} + (fruit) + +

custom template

+ +

Chips with Autocomplete

+ + {{item.name}} + {{#if item.family}} + {{item.family}} + {{/if}} + +

Chips with Autocomplete

+ + +

Chips with Autocomplete (requires match)

+
+
{{outlet}} \ No newline at end of file From 24f3cbb484a05f4b9308265bed8d62e63e04addf Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 11:40:16 +1300 Subject: [PATCH 09/35] feat(tests/dummy/app/templates/catalog): adds contact chips. --- tests/dummy/app/controllers/catalog.js | 34 ++++++++++++++++++++++++++ tests/dummy/app/templates/catalog.hbs | 26 ++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index df2d7b34f..2376ce11e 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -2,6 +2,7 @@ import Controller from '@ember/controller'; import { action } from '@ember/object'; import { tracked } from '@glimmer/tracking'; import { A } from '@ember/array'; +import { faker } from '@faker-js/faker'; export default class CatalogController extends Controller { // Autocomplete @@ -364,4 +365,37 @@ export default class CatalogController extends Controller { @action chipsAddVegeName(item) { this.chipsVegeNames.pushObject(item); } + + // Contact Chips + contactChipsNumOfContacts = 10; + get contactChipsContacts() { + let contacts = []; + let numOfContacts = this.contactChipsNumOfContacts; + + for (let i = 0; i < numOfContacts; i++) { + contacts.push({ + name: faker.person.fullName(), + email: faker.internet.email(), + image: faker.image.avatar(), + }); + } + + return contacts; + } + get contactChipsSelectedContacts() { + return this.contactChipsContacts.filter((c, index) => { + return index % 2 === 0; + }); + } + get contactChipsRemainingContacts() { + return this.contactChipsContacts.filter((c) => { + return this.contactChipsSelectedContacts.indexOf(c) === -1; + }); + } + @action contactChipsAddContact(item) { + this.contactChipsSelectedContacts.pushObject(item); + } + @action contactChipsRemoveContact(item) { + this.contactChipsSelectedContacts.removeObject(item); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index af57ce626..521c9cdd6 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -601,6 +601,32 @@

Chips with Autocomplete (requires match)

+ + + +

Contact Chips

+
+ + +

default

+ + +

read only contact chips

+
+
{{outlet}} \ No newline at end of file From 1ba0d0c11bbf5c0369266a6925ad452310438aeb Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 13:28:34 +1300 Subject: [PATCH 10/35] feat(tests/dummy/app/templates/catalog): adds dialog. --- tests/dummy/app/controllers/catalog.js | 6 +++ tests/dummy/app/styles/demo.scss | 4 ++ tests/dummy/app/templates/catalog.hbs | 61 ++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 2376ce11e..421fdece3 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -398,4 +398,10 @@ export default class CatalogController extends Controller { @action contactChipsRemoveContact(item) { this.contactChipsSelectedContacts.removeObject(item); } + + // Dialog + @tracked dialogShowDialog = true; + @action dialogToggleOpen() { + this.dialogShowDialog = !this.dialogShowDialog; + } } diff --git a/tests/dummy/app/styles/demo.scss b/tests/dummy/app/styles/demo.scss index b69d51002..195c55599 100644 --- a/tests/dummy/app/styles/demo.scss +++ b/tests/dummy/app/styles/demo.scss @@ -358,6 +358,10 @@ md-sidenav.site-sidenav { position: relative; } +.paper-dialog-demo { + min-height: 350px; +} + .list-demo .face { border-radius: 30px; border: 1px solid #ddd; diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 521c9cdd6..5ac3c07fe 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -627,6 +627,67 @@

read only contact chips

+ + + +

Dialog

+
+ +
+
+ +
+ + Open Dialog + +
+
+
+
+ +{{#if this.dialogShowDialog}} + +
+ + +

Mango (Fruit)

+ + + + +
+
+ + +

+ This is a dialog rendered into a specific element. Clicking outside + the dialog will close it. +

+
+ + + + + Cancel + + + OK + + +
+
+{{/if}} + {{outlet}} \ No newline at end of file From 3d1f6827f719f2833710698085ce8c2d0ec610aa Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 13:34:54 +1300 Subject: [PATCH 11/35] feat(tests/dummy/app/templates/catalog): adds divider. --- tests/dummy/app/templates/catalog.hbs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 5ac3c07fe..87c0f003f 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -649,6 +649,19 @@ + + + +

Divider

+
+ + +

divider: default

+ + +

divider: inset

+
+
{{#if this.dialogShowDialog}} From 9f9709a77fab0405bcca24e09ab0e206f0c2eda0 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 15:37:27 +1300 Subject: [PATCH 12/35] feat(tests/dummy/app/templates/catalog): adds grid list. --- tests/dummy/app/controllers/catalog.js | 11 + tests/dummy/app/controllers/demo/grid-list.js | 74 +---- tests/dummy/app/templates/catalog.hbs | 82 +++++ tests/dummy/app/utils/grid-list.js | 306 ++++++++++++++++++ 4 files changed, 400 insertions(+), 73 deletions(-) create mode 100644 tests/dummy/app/utils/grid-list.js diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 421fdece3..277a66d89 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -3,6 +3,7 @@ import { action } from '@ember/object'; import { tracked } from '@glimmer/tracking'; import { A } from '@ember/array'; import { faker } from '@faker-js/faker'; +import { buildGridModel } from '../utils/grid-list'; export default class CatalogController extends Controller { // Autocomplete @@ -404,4 +405,14 @@ export default class CatalogController extends Controller { @action dialogToggleOpen() { this.dialogShowDialog = !this.dialogShowDialog; } + + // Grid List + get gridListTiles() { + let tiles = buildGridModel({ + title: 'Svg-', + background: '', + }); + + return A(tiles); + } } diff --git a/tests/dummy/app/controllers/demo/grid-list.js b/tests/dummy/app/controllers/demo/grid-list.js index cea66a2c6..048bf8c7c 100644 --- a/tests/dummy/app/controllers/demo/grid-list.js +++ b/tests/dummy/app/controllers/demo/grid-list.js @@ -3,79 +3,7 @@ import Controller from '@ember/controller'; import { later } from '@ember/runloop'; import { A } from '@ember/array'; import EObject, { computed } from '@ember/object'; -import { assign } from '@ember/polyfills'; - -const COLORS = Object.freeze(['#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#e53935', '#d32f2f', '#c62828', '#b71c1c', '#ff8a80', '#ff5252', '#ff1744', '#d50000', '#f8bbd0', '#f48fb1', '#f06292', '#ec407a', '#e91e63', '#d81b60', '#c2185b', '#ad1457', '#880e4f', '#ff80ab', '#ff4081', '#f50057', '#c51162', '#e1bee7', '#ce93d8', '#ba68c8', '#ab47bc', '#9c27b0', '#8e24aa', '#7b1fa2', '#4a148c', '#ea80fc', '#e040fb', '#d500f9', '#aa00ff', '#ede7f6', '#d1c4e9', '#b39ddb', '#9575cd', '#7e57c2', '#673ab7', '#5e35b1', '#4527a0', '#311b92', '#b388ff', '#7c4dff', '#651fff', '#6200ea', '#c5cae9', '#9fa8da', '#7986cb', '#5c6bc0', '#3f51b5', '#3949ab', '#303f9f', '#283593', '#1a237e', '#8c9eff', '#536dfe', '#3d5afe', '#304ffe', '#e3f2fd', '#bbdefb', '#90caf9', '#64b5f6', '#42a5f5', '#2196f3', '#1e88e5', '#1976d2', '#1565c0', '#0d47a1', '#82b1ff', '#448aff', '#2979ff', '#2962ff', '#b3e5fc', '#81d4fa', '#4fc3f7', '#29b6f6', '#03a9f4', '#039be5', '#0288d1', '#0277bd', '#01579b', '#80d8ff', '#40c4ff', '#00b0ff', '#0091ea', '#e0f7fa', '#b2ebf2', '#80deea', '#4dd0e1', '#26c6da', '#00bcd4', '#00acc1', '#0097a7', '#00838f', '#006064', '#84ffff', '#18ffff', '#00e5ff', '#00b8d4', '#e0f2f1', '#b2dfdb', '#80cbc4', '#4db6ac', '#26a69a', '#009688', '#00897b', '#00796b', '#00695c', '#a7ffeb', '#64ffda', '#1de9b6', '#00bfa5', '#e8f5e9', '#c8e6c9', '#a5d6a7', '#81c784', '#66bb6a', '#4caf50', '#43a047', '#388e3c', '#2e7d32', '#1b5e20', '#b9f6ca', '#69f0ae', '#00e676', '#00c853', '#f1f8e9', '#dcedc8', '#c5e1a5', '#aed581', '#9ccc65', '#8bc34a', '#7cb342', '#689f38', '#558b2f', '#33691e', '#ccff90', '#b2ff59', '#76ff03', '#64dd17', '#f9fbe7', '#f0f4c3', '#e6ee9c', '#dce775', '#d4e157', '#cddc39', '#c0ca33', '#afb42b', '#9e9d24', '#827717', '#f4ff81', '#eeff41', '#c6ff00', '#aeea00', '#fffde7', '#fff9c4', '#fff59d', '#fff176', '#ffee58', '#ffeb3b', '#fdd835', '#fbc02d', '#f9a825', '#f57f17', '#ffff8d', '#ffff00', '#ffea00', '#ffd600', '#fff8e1', '#ffecb3', '#ffe082', '#ffd54f', '#ffca28', '#ffc107', '#ffb300', '#ffa000', '#ff8f00', '#ff6f00', '#ffe57f', '#ffd740', '#ffc400', '#ffab00', '#fff3e0', '#ffe0b2', '#ffcc80', '#ffb74d', '#ffa726', '#ff9800', '#fb8c00', '#f57c00', '#ef6c00', '#e65100', '#ffd180', '#ffab40', '#ff9100', '#ff6d00', '#fbe9e7', '#ffccbc', '#ffab91', '#ff8a65', '#ff7043', '#ff5722', '#f4511e', '#e64a19', '#d84315', '#bf360c', '#ff9e80', '#ff6e40', '#ff3d00', '#dd2c00', '#d7ccc8', '#bcaaa4', '#795548', '#d7ccc8', '#bcaaa4', '#8d6e63', '#eceff1', '#cfd8dc', '#b0bec5', '#90a4ae', '#78909c', '#607d8b', '#546e7a', '#cfd8dc', '#b0bec5', '#78909c']); - -function buildGridModel(tileTmpl) { - let results = []; - - for (let j = 0; j < 11; j++) { - - let it = assign({}, tileTmpl); - it.icon = it.icon + (j + 1); - it.title = it.title + (j + 1); - it.span = { row: 1, col: 1 }; - - switch (j + 1) { - case 1: - it.background = 'red'; - it.span.row = it.span.col = 2; - break; - case 2: - it.background = 'green'; - break; - case 3: - it.background = 'darkBlue'; - break; - case 4: - it.background = 'blue'; - it.span.col = 2; - break; - case 5: - it.background = 'yellow'; - it.span.row = it.span.col = 2; - break; - case 6: - it.background = 'pink'; - break; - case 7: - it.background = 'darkBlue'; - break; - case 8: - it.background = 'purple'; - break; - case 9: - it.background = 'deepBlue'; - break; - case 10: - it.background = 'lightPurple'; - break; - case 11: - it.background = 'yellow'; - break; - } - - results.push(it); - } - return results; -} - -function randomColor() { - let color = COLORS[Math.floor(Math.random() * COLORS.length)]; - return color.replace('#', 'bg-'); -} - -function randomSpan() { - let r = Math.random(); - if (r < 0.8) { - return 'gt-sm-1'; - } else if (r < 0.9) { - return 'gt-sm-2'; - } else { - return 'gt-sm-3'; - } -} +import { buildGridModel, randomColor, randomSpan } from '../../utils/grid-list'; export default Controller.extend({ diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 87c0f003f..70432ea70 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -662,6 +662,88 @@

divider: inset

+ + + +

Grid List: default

+
+ + + + + +

#1: (3r x 2c)

+
+
+ + + +

#2: (1r x 1c)

+
+
+ + + +

#3: (1r x 1c)

+
+
+ + + +

#4: (2r x 1c)

+
+
+ + + +

#5: (2r x 2c)

+
+
+ + + +

#6: (2r x 1c)

+
+
+ +
+
+
+ + + +

Grid List: dynamic tiles

+
+ + + + {{#each this.gridListTiles as |dynamicTile|}} + + + +

{{dynamicTile.title}}

+
+
+ {{/each}} + +
+
+
{{#if this.dialogShowDialog}} diff --git a/tests/dummy/app/utils/grid-list.js b/tests/dummy/app/utils/grid-list.js new file mode 100644 index 000000000..14360fd49 --- /dev/null +++ b/tests/dummy/app/utils/grid-list.js @@ -0,0 +1,306 @@ +import { assign } from '@ember/polyfills'; + +const COLORS = Object.freeze([ + '#ffebee', + '#ffcdd2', + '#ef9a9a', + '#e57373', + '#ef5350', + '#f44336', + '#e53935', + '#d32f2f', + '#c62828', + '#b71c1c', + '#ff8a80', + '#ff5252', + '#ff1744', + '#d50000', + '#f8bbd0', + '#f48fb1', + '#f06292', + '#ec407a', + '#e91e63', + '#d81b60', + '#c2185b', + '#ad1457', + '#880e4f', + '#ff80ab', + '#ff4081', + '#f50057', + '#c51162', + '#e1bee7', + '#ce93d8', + '#ba68c8', + '#ab47bc', + '#9c27b0', + '#8e24aa', + '#7b1fa2', + '#4a148c', + '#ea80fc', + '#e040fb', + '#d500f9', + '#aa00ff', + '#ede7f6', + '#d1c4e9', + '#b39ddb', + '#9575cd', + '#7e57c2', + '#673ab7', + '#5e35b1', + '#4527a0', + '#311b92', + '#b388ff', + '#7c4dff', + '#651fff', + '#6200ea', + '#c5cae9', + '#9fa8da', + '#7986cb', + '#5c6bc0', + '#3f51b5', + '#3949ab', + '#303f9f', + '#283593', + '#1a237e', + '#8c9eff', + '#536dfe', + '#3d5afe', + '#304ffe', + '#e3f2fd', + '#bbdefb', + '#90caf9', + '#64b5f6', + '#42a5f5', + '#2196f3', + '#1e88e5', + '#1976d2', + '#1565c0', + '#0d47a1', + '#82b1ff', + '#448aff', + '#2979ff', + '#2962ff', + '#b3e5fc', + '#81d4fa', + '#4fc3f7', + '#29b6f6', + '#03a9f4', + '#039be5', + '#0288d1', + '#0277bd', + '#01579b', + '#80d8ff', + '#40c4ff', + '#00b0ff', + '#0091ea', + '#e0f7fa', + '#b2ebf2', + '#80deea', + '#4dd0e1', + '#26c6da', + '#00bcd4', + '#00acc1', + '#0097a7', + '#00838f', + '#006064', + '#84ffff', + '#18ffff', + '#00e5ff', + '#00b8d4', + '#e0f2f1', + '#b2dfdb', + '#80cbc4', + '#4db6ac', + '#26a69a', + '#009688', + '#00897b', + '#00796b', + '#00695c', + '#a7ffeb', + '#64ffda', + '#1de9b6', + '#00bfa5', + '#e8f5e9', + '#c8e6c9', + '#a5d6a7', + '#81c784', + '#66bb6a', + '#4caf50', + '#43a047', + '#388e3c', + '#2e7d32', + '#1b5e20', + '#b9f6ca', + '#69f0ae', + '#00e676', + '#00c853', + '#f1f8e9', + '#dcedc8', + '#c5e1a5', + '#aed581', + '#9ccc65', + '#8bc34a', + '#7cb342', + '#689f38', + '#558b2f', + '#33691e', + '#ccff90', + '#b2ff59', + '#76ff03', + '#64dd17', + '#f9fbe7', + '#f0f4c3', + '#e6ee9c', + '#dce775', + '#d4e157', + '#cddc39', + '#c0ca33', + '#afb42b', + '#9e9d24', + '#827717', + '#f4ff81', + '#eeff41', + '#c6ff00', + '#aeea00', + '#fffde7', + '#fff9c4', + '#fff59d', + '#fff176', + '#ffee58', + '#ffeb3b', + '#fdd835', + '#fbc02d', + '#f9a825', + '#f57f17', + '#ffff8d', + '#ffff00', + '#ffea00', + '#ffd600', + '#fff8e1', + '#ffecb3', + '#ffe082', + '#ffd54f', + '#ffca28', + '#ffc107', + '#ffb300', + '#ffa000', + '#ff8f00', + '#ff6f00', + '#ffe57f', + '#ffd740', + '#ffc400', + '#ffab00', + '#fff3e0', + '#ffe0b2', + '#ffcc80', + '#ffb74d', + '#ffa726', + '#ff9800', + '#fb8c00', + '#f57c00', + '#ef6c00', + '#e65100', + '#ffd180', + '#ffab40', + '#ff9100', + '#ff6d00', + '#fbe9e7', + '#ffccbc', + '#ffab91', + '#ff8a65', + '#ff7043', + '#ff5722', + '#f4511e', + '#e64a19', + '#d84315', + '#bf360c', + '#ff9e80', + '#ff6e40', + '#ff3d00', + '#dd2c00', + '#d7ccc8', + '#bcaaa4', + '#795548', + '#d7ccc8', + '#bcaaa4', + '#8d6e63', + '#eceff1', + '#cfd8dc', + '#b0bec5', + '#90a4ae', + '#78909c', + '#607d8b', + '#546e7a', + '#cfd8dc', + '#b0bec5', + '#78909c', +]); + +export function buildGridModel(tileTmpl) { + let results = []; + + for (let j = 0; j < 11; j++) { + let it = assign({}, tileTmpl); + it.icon = it.icon + (j + 1); + it.title = it.title + (j + 1); + it.span = { row: 1, col: 1 }; + + switch (j + 1) { + case 1: + it.background = 'red'; + it.span.row = it.span.col = 2; + break; + case 2: + it.background = 'green'; + break; + case 3: + it.background = 'darkBlue'; + break; + case 4: + it.background = 'blue'; + it.span.col = 2; + break; + case 5: + it.background = 'yellow'; + it.span.row = it.span.col = 2; + break; + case 6: + it.background = 'pink'; + break; + case 7: + it.background = 'darkBlue'; + break; + case 8: + it.background = 'purple'; + break; + case 9: + it.background = 'deepBlue'; + break; + case 10: + it.background = 'lightPurple'; + break; + case 11: + it.background = 'yellow'; + break; + } + + results.push(it); + } + return results; +} + +export function randomColor() { + let color = COLORS[Math.floor(Math.random() * COLORS.length)]; + return color.replace('#', 'bg-'); +} + +export function randomSpan() { + let r = Math.random(); + if (r < 0.8) { + return 'gt-sm-1'; + } else if (r < 0.9) { + return 'gt-sm-2'; + } else { + return 'gt-sm-3'; + } +} From 0f809ce605f6d204a2cc26044900b9bd545a1c52 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 15:41:26 +1300 Subject: [PATCH 13/35] feat(tests/dummy/app/templates/catalog): adds icons. --- tests/dummy/app/templates/catalog.hbs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 70432ea70..6e7c13222 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -744,6 +744,24 @@ + + + +

Icons

+
+ + + + + + +

default

+ + + +

spinners

+
+
{{#if this.dialogShowDialog}} From b33a187707de932a6454bd69ef6850103052fef4 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 15:58:09 +1300 Subject: [PATCH 14/35] feat(tests/dummy/app/templates/catalog): adds input. --- tests/dummy/app/templates/catalog.hbs | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 6e7c13222..56257012a 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -762,6 +762,54 @@

spinners

+ + + +

Input

+
+ +
+ + + +
+
+ + +
+
+
{{#if this.dialogShowDialog}} From eecccbe7049c538ef49fcb974ce8b9748a7d2a87 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 16:20:40 +1300 Subject: [PATCH 15/35] chore(tests/dummy/app/templates/catalog): adjust paper icons to angle bracket invocation. --- tests/dummy/app/templates/catalog.hbs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 56257012a..45011cbe7 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -269,13 +269,13 @@ - {{paper-icon 'favorite'}} + - {{paper-icon 'settings'}} + - {{paper-icon 'share'}} + @@ -407,13 +407,13 @@ - {{paper-icon 'favorite'}} + - {{paper-icon 'settings'}} + - {{paper-icon 'share'}} + @@ -426,13 +426,13 @@ /> - {{paper-icon 'favorite'}} + - {{paper-icon 'settings'}} + - {{paper-icon 'share'}} + From 025ca6bb616506d73edd77be124b4c1906e4e9aa Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 16:24:12 +1300 Subject: [PATCH 16/35] feat(tests/dummy/app/templates/catalog): adds list. --- tests/dummy/app/controllers/catalog.js | 69 +++++++ tests/dummy/app/templates/catalog.hbs | 257 +++++++++++++++++++++++++ 2 files changed, 326 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 277a66d89..90720b395 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -415,4 +415,73 @@ export default class CatalogController extends Controller { return A(tiles); } + + // List + listNumOfRows = 3; + get listData() { + let contacts = []; + let numOfRows = this.listNumOfRows; + + for (let i = 0; i < numOfRows; i++) { + contacts.push({ + name: faker.person.fullName(), + email: faker.internet.email(), + img: faker.image.dataUri(), + }); + } + + return contacts; + } + listPhoneNumbers = Object.freeze([ + { + number: '(555) 251-1234', + type: 'Home', + }, + { + number: '(555) 786-9841', + type: 'Mobile', + }, + { + number: '(555) 314-1592', + type: 'Office', + }, + ]); + listToppings = Object.freeze([ + { + name: 'Pepperoni', + enabled: false, + }, + { + name: 'Sausage', + enabled: false, + }, + { + name: 'Black Olives', + enabled: true, + }, + { + name: 'Green Peppers', + enabled: false, + }, + ]); + listMessageData = Object.freeze([ + { + message: 'Message A', + }, + { + message: 'Message B', + }, + { + message: 'Message C', + }, + ]); + @action listTransitionTo(value) { + alert(`Imagine you transition to "${value}" here.`); + } + @action listTransitionToMenu() { + alert(`Imagine you transition to a menu here.`); + } + @action listSecondaryMessageClick() { + alert('Secondary actions can be used for one click actions.'); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 45011cbe7..d7c2a416b 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -810,6 +810,263 @@ + + + +

List

+
+ + + 3 line item + {{#each this.listData as |item|}} + + {{item.name}} +
+

{{item.name}}

+

{{item.email}}

+

Some longer notes here could be here. But they aren't.

+
+
+ {{/each}} + + + + 2 line item + {{#each this.listData as |item|}} + + {{item.name}} +
+

{{item.name}}

+

{{item.email}}

+
+
+ {{/each}} + + + + 3 line item, long paragraph + {{#each this.listData as |item|}} + + {{item.name}} +
+

{{item.name}}

+

+ Secondary line text Lorem ipsum dolor sit amet, consectetur + adipiscing elit. Nam massa quam. Nulla metus metus, ullamcorper + vel, tincidunt sed, euismod in, nibh. Quisque volutpat + condimentum velit. Class aptent taciti sociosqu ad litora + torquent per conubia nostra, per inceptos himenaeos. +

+
+
+ {{/each}} + + + + Icons + {{#each this.listPhoneNumbers as |phone|}} + + +
+

{{phone.number}}

+

{{phone.type}}

+
+
+ {{/each}} + +
+
+
+ + + +

List: controls

+
+ + + + Single Action Checkboxes + {{#each this.listToppings as |topping|}} + +

{{topping.name}}

+
+ +
+
+ {{/each}} + + + + Secondary Buttons + +

Clicking the button to the right will fire the secondary action

+
+ + More Info + +
+
+ +

Click anywhere to fire the primary action, or the button to fire + the secondary

+
+ + More Info + +
+
+ + + + Clickable Items with Secondary Controls + + +

Wi-Fi

+
+ +
+
+ + +

Bluetooth

+
+ +
+
+ + +

Data Usage

+
+ + + + Checkbox with Secondary Action + {{#each this.listMessageData as |item|}} + + +

{{item.message}}

+
+ + + +
+
+ {{/each}} + + + + Avatar with Secondary Action Icon + {{#each this.listData as |item|}} + + {{item.name}} +

{{item.name}}

+
+ + + + + + + +
+
+ {{/each}} + + + + Clickable Avatars + {{#each this.listData as |item|}} + + {{item.name}} +
+

{{item.name}}

+

{{item.email}}

+

Some notes here.

+
+
+ {{/each}} + + + + Avatar with Secondary Action Icon + {{#each this.listData as |item|}} + + {{item.name}} +
+

{{item.name}}

+

{{item.email}}

+

Some notes here.

+
+ + + +
+ {{/each}} + + Single Action Radios + {{#each this.listToppings as |topping|}} + +

{{topping.name}}

+
+ +
+
+ {{/each}} +
+
+
{{#if this.dialogShowDialog}} From a2daded60973a32d1fd1d3c6c3ac6612358a2c41 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 17:21:01 +1300 Subject: [PATCH 17/35] feat(tests/dummy/app/templates/catalog): adds menu. --- tests/dummy/app/controllers/catalog.js | 26 ++++++++++- tests/dummy/app/templates/catalog.hbs | 62 +++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 90720b395..4794b93c0 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -1,8 +1,8 @@ import Controller from '@ember/controller'; -import { action } from '@ember/object'; -import { tracked } from '@glimmer/tracking'; import { A } from '@ember/array'; +import { action } from '@ember/object'; import { faker } from '@faker-js/faker'; +import { tracked } from '@glimmer/tracking'; import { buildGridModel } from '../utils/grid-list'; export default class CatalogController extends Controller { @@ -484,4 +484,26 @@ export default class CatalogController extends Controller { @action listSecondaryMessageClick() { alert('Secondary actions can be used for one click actions.'); } + + // Menu + menuOptions = A([1, 2, 3, 4, 5]); + menuItems = A([ + { + icon: 'access_alarms', + title: 'Alarm', + isFirst: true, + }, + { + icon: 'airplay', + title: 'Airplay', + }, + + { + icon: 'airplanemode_active', + title: 'Airplane mode', + }, + ]); + @action menuOpenSomething() { + alert('Some action handler.'); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index d7c2a416b..77865298a 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -407,13 +407,13 @@ - + - + - + @@ -426,13 +426,13 @@ /> - + - + - + @@ -1067,6 +1067,56 @@ + + + +

Menu

+
+ + + +
+ {{#if this.dialogShowDialog}} From 7db07dec5b2e951e58a0f29e65ffaf606930c8bb Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 17:21:36 +1300 Subject: [PATCH 18/35] feat(tests/dummy/app/templates/catalog): adds progress circular. --- tests/dummy/app/templates/catalog.hbs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 77865298a..7be48c455 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1117,6 +1117,28 @@ + + +

Progress Circular

+
+ +
+ + + + + +
+
+
{{#if this.dialogShowDialog}} From 19de2e1337834d5c0d61fa1873bec73d67f39251 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 17:24:26 +1300 Subject: [PATCH 19/35] feat(tests/dummy/app/templates/catalog): adds progress circular determinate mode. --- tests/dummy/app/controllers/catalog.js | 45 ++++++++++++++++++++++++++ tests/dummy/app/templates/catalog.hbs | 4 +++ 2 files changed, 49 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 4794b93c0..b65f00432 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -1,6 +1,7 @@ import Controller from '@ember/controller'; import { A } from '@ember/array'; import { action } from '@ember/object'; +import { later, cancel } from '@ember/runloop'; import { faker } from '@faker-js/faker'; import { tracked } from '@glimmer/tracking'; import { buildGridModel } from '../utils/grid-list'; @@ -506,4 +507,48 @@ export default class CatalogController extends Controller { @action menuOpenSomething() { alert('Some action handler.'); } + + // Progress + @tracked progressDeterminateValue = 0; + @tracked progressDeterminateValue2 = 0; + @tracked progressTimer = null; + @tracked progressTimer2 = null; + @action progressStart() { + this.progressDeterminateValue = 30; + this.progressDeterminateValue2 = 30; + this.progressSetupTimer(); + this.progressSetupTimer2(); + } + progressSetupTimer() { + this.progressTimer = later( + this, + function () { + this.progressDeterminateValue += 1; + this.progressDeterminateValue2 += 1.5; + if (this.progressDeterminateValue > 100) { + this.progressDeterminateValue = 30; + this.progressDeterminateValue2 = 30; + } + + this.progressSetupTimer(); + }, + 100 + ); + } + progressSetupTimer2() { + this.progressTimer2 = later( + this, + function () { + this.mode = this.mode === 'query' ? 'determinate' : 'query'; + this.determinateValue = 30; + this.determinateValue2 = 30; + later(this, this.progressSetupTimer2); + }, + 7200 + ); + } + @action progressStop() { + cancel(this.progressTimer); + cancel(this.progressTimer2); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 7be48c455..d7c9ddf4b 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1122,6 +1122,9 @@

Progress Circular

+ +

determinate mode

+
@@ -1137,6 +1140,7 @@ />
+

non-determinate mode

From 929a33e3208aff05cefc9215d73fa186aedd5c09 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 17:24:43 +1300 Subject: [PATCH 20/35] feat(tests/dummy/app/templates/catalog): adds progress linear. --- tests/dummy/app/templates/catalog.hbs | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index d7c9ddf4b..71692644c 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1143,6 +1143,36 @@

non-determinate mode

+ + + +

Progress Linear

+
+ + +

determinate mode

+ + +

non-determinate mode

+ + +

buffer mode

+ + +

query mode

+
+
{{#if this.dialogShowDialog}} From 7e63e43f2c2309fe0e8ca082742252cf1eac135a Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Fri, 25 Oct 2024 17:32:45 +1300 Subject: [PATCH 21/35] feat(tests/dummy/app/templates/catalog): adds radio. --- tests/dummy/app/templates/catalog.hbs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 71692644c..5d5c37954 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1173,6 +1173,32 @@

query mode

+ + + +

Radio

+
+ + + Toggable + + + + Disabled + + +
{{#if this.dialogShowDialog}} From d9ecbbe62dc40651904733e9dab4da96363ac963 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 10:09:40 +1300 Subject: [PATCH 22/35] feat(tests/dummy/app/templates/catalog): adds select. --- tests/dummy/app/controllers/catalog.js | 10 ++++ tests/dummy/app/templates/catalog.hbs | 68 +++++++++++++++++++++----- 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index b65f00432..a4cd198ae 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -551,4 +551,14 @@ export default class CatalogController extends Controller { cancel(this.progressTimer); cancel(this.progressTimer2); } + + // Select + @tracked selectSelectedState = this.selectStates.objectAt(4); + get selectStates() { + return A( + 'AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY' + .split(' ') + .map((state) => ({ abbrev: state })) + ); + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 5d5c37954..49810abdc 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -172,7 +172,8 @@ href link + >href link +

@@ -208,17 +209,11 @@

Fab - Fab + Fab + Mini - Mini + Mini + @@ -1199,6 +1194,57 @@ + + + +

Select

+ + +
+
+ + {{state.abbrev}} + +

default

+
+ +
+ + {{state.abbrev}} + +

disabled

+
+ +
+ + {{state.abbrev}} + +

required

+
+
+
+ {{#if this.dialogShowDialog}} From d2ab783c6c476bff2e09df6239a2b4afd81dde26 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 10:14:13 +1300 Subject: [PATCH 23/35] feat(tests/dummy/app/templates/catalog): adds sidenav. --- tests/dummy/app/controllers/catalog.js | 3 + tests/dummy/app/templates/catalog.hbs | 87 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index a4cd198ae..9023ca9cf 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -561,4 +561,7 @@ export default class CatalogController extends Controller { .map((state) => ({ abbrev: state })) ); } + + // Sidenav + @tracked sidenavRightSideBarOpen = true; } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 49810abdc..bbf4fa163 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1245,6 +1245,93 @@ + + + +

Sidenav

+
+ + + + + + Left Sidenav + + + Çup? + + + + +
+

+ The left sidenav will "lock open" on a medium (>=960px wide) + device. The right sidenav never "locks open" because we set + lockedOpen=false. +

+

+ Left sidenav is + {{if + this.sidenavLeftSideBarOpen + 'opened' + 'closed' + }}. +

+

+ Right sidenav is + {{if + this.sidenavRightSideBarOpen + 'opened' + 'closed' + }}. +

+ + + + Toggle left sidenav + + + + + + Toggle right sidenav + + + +
+
+ + + + Right Sidenav + + + Çup? I'm on the right side. + + + +
+
+
{{#if this.dialogShowDialog}} From d86ae3a498e1ce8d153bde5f413a796b608b12d9 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 10:54:07 +1300 Subject: [PATCH 24/35] feat(tests/dummy/app/templates/catalog): adds slider. --- tests/dummy/app/controllers/catalog.js | 11 +++ tests/dummy/app/templates/catalog.hbs | 101 +++++++++++++++++++++++++ 2 files changed, 112 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 9023ca9cf..f48bad034 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -564,4 +564,15 @@ export default class CatalogController extends Controller { // Sidenav @tracked sidenavRightSideBarOpen = true; + + // Slider + @tracked sliderColor = { + red: 55, + green: 111, + blue: 222, + }; + @tracked sliderDisabled1 = 22; + @tracked sliderRating1 = 3; + @tracked sliderRating2 = 2; + @tracked sliderRating3 = 4; } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index bbf4fa163..6b9047962 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1332,6 +1332,107 @@ + + + +

Slider

+
+ + +

default

+ + +

md-warn

+ + +

md-primary

+ + +

disabled

+ +
+
+ R + + +
+ +
+ G + + +
+ +
+ B + + +
+

non-discrete

+
+
+
{{#if this.dialogShowDialog}} From 6f56d5d8054e6863649c6f657f083c1048cbf7bd Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 11:08:44 +1300 Subject: [PATCH 25/35] feat(tests/dummy/app/templates/catalog): adds speed dial. --- tests/dummy/app/controllers/catalog.js | 3 + tests/dummy/app/templates/catalog.hbs | 191 +++++++++++++++++++++++++ 2 files changed, 194 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index f48bad034..490936aee 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -575,4 +575,7 @@ export default class CatalogController extends Controller { @tracked sliderRating1 = 3; @tracked sliderRating2 = 2; @tracked sliderRating3 = 4; + + // Speed Dial + @tracked speedDialOpen = true; } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 6b9047962..56598d6d5 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1433,6 +1433,197 @@ + + + +

Speed Dial

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

up, fling

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

left, scale

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

right, fling

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

down, scale

+
+
+
{{#if this.dialogShowDialog}} From c0be6b4ad0cdd76fbbf03508fd09f0642e89e06c Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 11:18:02 +1300 Subject: [PATCH 26/35] feat(tests/dummy/app/templates/catalog): adds switch. --- tests/dummy/app/controllers/catalog.js | 10 +++ tests/dummy/app/templates/catalog.hbs | 106 +++++++++++++------------ 2 files changed, 67 insertions(+), 49 deletions(-) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 490936aee..00e2e46b3 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -578,4 +578,14 @@ export default class CatalogController extends Controller { // Speed Dial @tracked speedDialOpen = true; + + // Switch + @tracked switchProp1 = true; + @tracked switchProp2 = false; + @tracked switchProp3 = false; + @tracked switchProp4 = false; + @tracked switchProp5 = false; + @action switchToggle(which, newValue) { + this[`switchProp${which}`] = newValue; + } } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 56598d6d5..3bc767f76 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1438,7 +1438,7 @@

Speed Dial

- +
- + - + - + @@ -1501,28 +1492,19 @@ - + - + - + @@ -1547,28 +1529,19 @@ - + - + - + @@ -1593,28 +1566,19 @@ - + - + - + @@ -1624,6 +1588,50 @@
+ + + +

Switch

+
+ + + {{this.switchProp1}} + + + + {{this.switchProp2}} + + + + Disabled switch + + + + Noink switch + + + + +
+ {{#if this.dialogShowDialog}} From 5adbe89912885ab902bf1329f10d57e045332987 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 15:06:29 +1300 Subject: [PATCH 27/35] feat(tests/dummy/app/templates/catalog): adds tabs. --- tests/dummy/app/controllers/catalog.js | 7 ++ tests/dummy/app/router.js | 4 +- tests/dummy/app/templates/catalog.hbs | 117 +++++++++++++++++- tests/dummy/app/templates/catalog/index.hbs | 2 + .../app/templates/catalog/nested-route.hbs | 2 + 5 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 tests/dummy/app/templates/catalog/index.hbs create mode 100644 tests/dummy/app/templates/catalog/nested-route.hbs diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 00e2e46b3..88c8782c7 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -1,7 +1,9 @@ import Controller from '@ember/controller'; import { A } from '@ember/array'; import { action } from '@ember/object'; +import { readOnly } from '@ember/object/computed'; import { later, cancel } from '@ember/runloop'; +import { inject as service } from '@ember/service'; import { faker } from '@faker-js/faker'; import { tracked } from '@glimmer/tracking'; import { buildGridModel } from '../utils/grid-list'; @@ -588,4 +590,9 @@ export default class CatalogController extends Controller { @action switchToggle(which, newValue) { this[`switchProp${which}`] = newValue; } + + // Tabs + tabsSelectedTab = 0; + @service router; + @readOnly('router.currentRouteName') tabsCurrentRouteName; } diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js index ffb02885c..219f9def9 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -8,7 +8,9 @@ export default class Router extends EmberRouter { Router.map(function () { this.route('introduction'); - this.route('catalog'); + this.route('catalog', function () { + this.route('nested-route'); + }); this.route('forms'); this.route('typography'); this.route('theme'); diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 3bc767f76..d1da32ea4 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1632,6 +1632,119 @@
+ + +

Tabs

+
+ + +
+ + + Page One + + + Page Two (disabled) + + + Page Three + + + Page Four + + + Page Five + + + +

default (stretched)

+
+ +
+ + + Page One + + + Page Two (disabled) + + + Page Three + + + Page Four + + + Page Five + + + +

centered

+
+ +
+ + + Page One + + + Page Two (disabled) + + + Page Three + + + Page Four + + + Page Five + + + +

bottom border

+
+ +
+ + + Index + + + Nested Route + + + + +

nested routing

+
+
+
+ {{#if this.dialogShowDialog}} @@ -1671,6 +1784,4 @@ -{{/if}} - -{{outlet}} \ No newline at end of file +{{/if}} \ No newline at end of file diff --git a/tests/dummy/app/templates/catalog/index.hbs b/tests/dummy/app/templates/catalog/index.hbs new file mode 100644 index 000000000..7d58f48e8 --- /dev/null +++ b/tests/dummy/app/templates/catalog/index.hbs @@ -0,0 +1,2 @@ +

Index Route

+

This content lives in a nested "index" route.

diff --git a/tests/dummy/app/templates/catalog/nested-route.hbs b/tests/dummy/app/templates/catalog/nested-route.hbs new file mode 100644 index 000000000..7c68340ef --- /dev/null +++ b/tests/dummy/app/templates/catalog/nested-route.hbs @@ -0,0 +1,2 @@ +

Nested Route

+

This content lives in a nested "nested-route" route.

From 2567bb4aab7690315c7418eb8df1713f17e7cacf Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 16:43:29 +1300 Subject: [PATCH 28/35] refactor(tests/dummy/app/styles): moves catalog styles out into its own file. --- tests/dummy/app/styles/app.scss | 1 + tests/dummy/app/styles/catalog.scss | 11 +++++++++++ tests/dummy/app/styles/demo.scss | 4 ---- tests/dummy/app/templates/catalog.hbs | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 tests/dummy/app/styles/catalog.scss diff --git a/tests/dummy/app/styles/app.scss b/tests/dummy/app/styles/app.scss index 64b50ec70..660e1a751 100644 --- a/tests/dummy/app/styles/app.scss +++ b/tests/dummy/app/styles/app.scss @@ -3,6 +3,7 @@ $warn: 'amber'; $accent: 'pink'; @import 'ember-paper'; +@import 'catalog'; @import 'demo'; /** diff --git a/tests/dummy/app/styles/catalog.scss b/tests/dummy/app/styles/catalog.scss new file mode 100644 index 000000000..1b7f48a9f --- /dev/null +++ b/tests/dummy/app/styles/catalog.scss @@ -0,0 +1,11 @@ +.dialog-catalog { + min-height: 350px; +} + +.toast-catalog { + min-height: 150px; + + &--override-position { + position: relative !important; + } +} diff --git a/tests/dummy/app/styles/demo.scss b/tests/dummy/app/styles/demo.scss index 195c55599..b69d51002 100644 --- a/tests/dummy/app/styles/demo.scss +++ b/tests/dummy/app/styles/demo.scss @@ -358,10 +358,6 @@ md-sidenav.site-sidenav { position: relative; } -.paper-dialog-demo { - min-height: 350px; -} - .list-demo .face { border-radius: 30px; border: 1px solid #ddd; diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index d1da32ea4..77c38605a 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -629,7 +629,7 @@
-
+
From 0917ca14076b36f8fa0720a8758d4c4c738c4a90 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 16:44:23 +1300 Subject: [PATCH 29/35] refactor(tests/dummy/app/templates/catalog): migrates some leftover `action` calls to `fn`. --- tests/dummy/app/templates/catalog.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 77c38605a..4c0951e0f 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1596,14 +1596,14 @@ {{this.switchProp1}} {{this.switchProp2}} From aa7d067a22edc683a263db08f1b88abeb25ab491 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 16:56:15 +1300 Subject: [PATCH 30/35] feat(tests/dummy/app/templates/catalog): adds toast. --- tests/dummy/app/controllers/catalog.js | 3 ++ tests/dummy/app/templates/catalog.hbs | 67 ++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 88c8782c7..2967a27a0 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -595,4 +595,7 @@ export default class CatalogController extends Controller { tabsSelectedTab = 0; @service router; @readOnly('router.currentRouteName') tabsCurrentRouteName; + + // Toast + toastDuration = 60000; } diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 4c0951e0f..4e2561100 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1745,6 +1745,73 @@ + + +

Toast

+
+ +
+ + + default + + OK + + + + + capsule + + CANCEL + + + + + @class="md-accent" + + Wow, much accent + + + + + @class="md-warn" + + UNDO + + +
+
+ {{#if this.dialogShowDialog}} From 9bf0496d7dfeeac31fac1badf12ba904935e4bbf Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 16:58:51 +1300 Subject: [PATCH 31/35] feat(tests/dummy/app/templates/catalog): adds toolbar. --- tests/dummy/app/templates/catalog.hbs | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 4e2561100..b1e1da1b2 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1812,6 +1812,66 @@ + + +

Toolbar

+
+ + + + + + +

+ Toolbar with Icon Buttons +

+ + + + + + + +
+
+ +
+ {{! with contextual components }} + + + + Go Back + +

Toolbar with Standard Buttons

+ + + Learn More + + + + +
+
+ +
+ + + +

Toolbar: tall=true, accent=true

+
+
+ +
+ + + + +

Toolbar: tall with actions pin to the bottom (tall=true warn=true)

+
+
+
+
+ {{#if this.dialogShowDialog}} From c4ad7acdc82330dd4179b03bbfac193d0b0f3e28 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 17:26:06 +1300 Subject: [PATCH 32/35] fix(tests/dummy/app/templates/catalog): fixes for tabs due to dynamic nature of default. --- tests/dummy/app/templates/catalog.hbs | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index b1e1da1b2..2f31fa8c1 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1661,7 +1661,7 @@ -

default (stretched)

+

default (dynamic stretching based on media queries)

@@ -1692,13 +1692,40 @@

centered

+
+ + + Page One + + + Page Two (disabled) + + + Page Three + + + Page Four + + + Page Five + + + +

stretched

+
+
From 201382e8dd44661ec7e597895830b153f8bbacf4 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 17:26:53 +1300 Subject: [PATCH 33/35] chore(tests/dummy/app/templates/catalog): runs prettier. --- tests/dummy/app/templates/catalog.hbs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 2f31fa8c1..41d295b36 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1847,22 +1847,22 @@ - +

Toolbar with Icon Buttons

- + - + - +
-
+
{{! with contextual components }} @@ -1870,17 +1870,17 @@ Go Back

Toolbar with Standard Buttons

- + Learn More - - + +
-
+
@@ -1888,10 +1888,10 @@ -
+
- +

Toolbar: tall with actions pin to the bottom (tall=true warn=true)

From 9d0d6b072565e9d1283b82464b92a56e5959ec33 Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 17:27:15 +1300 Subject: [PATCH 34/35] feat(tests/dummy/app/templates/catalog): adds tooltip. --- tests/dummy/app/templates/catalog.hbs | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/dummy/app/templates/catalog.hbs b/tests/dummy/app/templates/catalog.hbs index 41d295b36..2b603fe04 100644 --- a/tests/dummy/app/templates/catalog.hbs +++ b/tests/dummy/app/templates/catalog.hbs @@ -1899,6 +1899,52 @@ + + +

Tooltip

+
+ +
+ + A button + + Hey! I'm a tooltip. Çup? + + +

position: bottom

+
+ +
+ + + + Create + + +

position: top

+
+ +
+ + + + Delete + + +

position: left

+
+ +
+ + + Icon tooltip + + +

position: right

+
+
+
+ {{#if this.dialogShowDialog}} From f0423cdb893c27a779b9bb57f8b18a8a4da0393e Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Tue, 29 Oct 2024 17:42:03 +1300 Subject: [PATCH 35/35] refactor(tests/dummy/app/templates/catalog): removes `ember/no-computed-properties-in-native-classes` lint. --- tests/dummy/app/controllers/catalog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/dummy/app/controllers/catalog.js b/tests/dummy/app/controllers/catalog.js index 2967a27a0..235bad15e 100644 --- a/tests/dummy/app/controllers/catalog.js +++ b/tests/dummy/app/controllers/catalog.js @@ -1,7 +1,6 @@ import Controller from '@ember/controller'; import { A } from '@ember/array'; import { action } from '@ember/object'; -import { readOnly } from '@ember/object/computed'; import { later, cancel } from '@ember/runloop'; import { inject as service } from '@ember/service'; import { faker } from '@faker-js/faker'; @@ -594,7 +593,9 @@ export default class CatalogController extends Controller { // Tabs tabsSelectedTab = 0; @service router; - @readOnly('router.currentRouteName') tabsCurrentRouteName; + get tabsCurrentRouteName() { + return this.router.currentRouteName; + } // Toast toastDuration = 60000;