112 Commits

Author SHA1 Message Date
Peter Burns
6278ee5df9 chore: just import 'lit', it's cleaner
Fixes #2742

PiperOrigin-RevId: 399238961
2021-09-27 11:28:08 -07:00
Material Web Team
d00b098dd2 Fix compilation issues with TypeScript 4.4.
PiperOrigin-RevId: 394756224
2021-09-03 14:23:32 -07:00
Daniel Freedman
3bab26b49f
Add shadydom env d.ts for tests (#2654) 2021-08-26 14:41:35 -07:00
Material Web Team
02213ebe61 Add the override keyword to class members in TypeScript files
TypeScript’s override keyword (added in 4.3) works similarly to @Override in Java. It makes the intention clear and ensures there is actually a member in the base class with the same name. This helps with things like:
- Typos in the overriding member name
- Remember to rename members in sub classes when renaming an overridden member in a base class

class Parent {
  foo() {}
}

class Child extends Parent {
  override bar() {}
  //       ~~~ This member cannot have an 'override' modifier because it is not declared in the base class 'Parent'.
}

This change will not cause a runtime change: the override keyword is not present in the resulting JavaScript.

PiperOrigin-RevId: 392018020
2021-08-20 10:23:20 -07:00
Elizabeth Mitchell
72ff1e6854
chore: exclude deprecated switch from tests (#2598) 2021-08-06 13:46:00 -07:00
Daniel Freedman
ae4f422bf4 Add support for Form submission to FormElement subclasses
- Relies on `FormDataEvent`, which is supported by Chrome, Firefox, and Edge.
  - Safari and IE will need a polyfill
- Require `disabled` properties on FormElement subclasses
- Add `setFormData()` function to control what is added to the Form submission
- Set `checkbox` and `radio` `value`  property to `on` by default, to match native controls

Fixes #289

PiperOrigin-RevId: 385248919
2021-07-16 16:50:49 -07:00
Elizabeth Mitchell
d234ec3ffa
chore(switch): re-enable deprecated switch tests (#2550) 2021-07-16 11:04:39 -07:00
Liz Mitchell
9e41cb2e16 chore: add internal tslint comments
PiperOrigin-RevId: 385029244
2021-07-15 16:05:41 -07:00
Elizabeth Mitchell
cc0aa7a953
chore(switch): disable deprecated switch testing (#2542) 2021-07-15 14:00:15 -07:00
Daniel Freedman
26823c4a2e (chore): Remove chai dependencies
- Remove custom types for chai
- Remove karma-chai and chai modules

Fixes #2437
2021-05-25 15:43:26 -07:00
Daniel Freedman
a646aa6387 (chore): Prepare for switch to Jasmine expect
- Remove custom_typing for chai's `expect`
- Replace eslint mocha plugin and settings for jasmine equivalents
- Add jasmine typescript typings

Related #2437
2021-05-25 10:41:59 -07:00
Elliott Marquez
2212691aaf Docs: change license header to SPDX short form
fixes #2419

PiperOrigin-RevId: 374308530
2021-05-17 16:48:25 -07:00
Alexander Marks
7756005d1d Use full mwc-ripple import paths 2021-02-19 10:13:53 -08:00
Liz Mitchell
9901289376 chore: update clang-format 2021-01-13 12:56:07 -08:00
bradfordcsmith
06fe9d90f1 Silence type errors reported by TS 4.1 for Promise resolve() functions
PiperOrigin-RevId: 351428699
2021-01-12 12:51:57 -08:00
43081j
3ff3d8f44d remove Fake in place of module
less to maintain
2020-10-27 13:26:07 +00:00
Liz Mitchell
8604d59edb
chore: remove src folder from packages in GitHub (#1706)
* chore: remove src folder from packages in GitHub

* chore: add extra newline to button sass
2020-08-17 17:59:35 -07:00
Elliott Marquez
86c61f930d fix(build): CI build caused by refactor snackbar 2020-04-29 19:19:10 -07:00
Elliott Marquez
c6bca0e47f chore: run formatter 2020-04-06 19:20:34 -07:00
Elliott Marquez
e2667f4f1e fix(slider): fix bug where max was not being set 2020-04-06 19:11:41 -07:00
Elliott Marquez
c0a5741cf3
perf(menu): benchmarking (#1075) 2020-04-03 14:27:13 -07:00
Copybara-Service
6b94609581 Merge pull request #1024 from 43081j:more-tests
PiperOrigin-RevId: 304692336
2020-04-03 14:21:15 -07:00
43081j
103b437480 test: open/close events and scrim click 2020-03-25 20:46:17 +00:00
James Garbutt
54d406bc67 test: use own Fake 2020-03-23 19:32:05 +00:00
James Garbutt
65d307cca3 test: try our own fake implementation 2020-03-22 10:43:41 +00:00
Elliott Marquez
eee02653f1 test(mwc-list-item): wrote initial test for item 2020-03-12 18:19:50 -07:00
Elliott Marquez
70d756d1ab chore: run formatter 2020-03-12 18:19:50 -07:00
Elliott Marquez
405840aa98 perf(list): benchmarks for list and list-item 2020-03-12 18:19:50 -07:00
Elliott Marquez
aaafc9abe3
perf(list): benchmarks for list and list-item (#977)
* perf(list): benchmarks for list and list-item

* chore: run formatter
2020-03-06 16:35:29 -08:00
Elliott Marquez
94c9acaa5c
perf(select): implement select perf benchmarking (#969) 2020-03-05 16:30:58 -08:00
Elliott Marquez
b1871ba42a run formatter 2020-03-02 12:23:49 -08:00
Elliott Marquez
ca101c3208 chore: format helpers 2020-03-02 12:19:47 -08:00
Elliott Marquez
56dc6ddc34 first attempt at ponyfill 2020-01-31 19:54:51 -08:00
Alexander Marks
57c5e71215 Set up new unit test locations for Karma and update package configs. 2019-09-25 13:55:33 -07:00
Alexander Marks
5a286bdc77 Move unit test files into package directories.
Includes splitting tabs test into 3 files.
2019-09-25 13:55:30 -07:00
Elliott Marquez
2d43e4626d
Textfield fix ie (#491)
* IE fixes for textfield

* run formatter

* update changelog
2019-09-20 13:51:01 -07:00
James Garbutt
e93e16d73b add select() to text fields (#479)
* add select() to text fields

* add setSelectionRange
2019-09-19 16:13:46 -07:00
Elliott Marquez
2da5724c2b
mwc-dialog (#462)
* initial scaffolding for dialog

* add focus and blur functions to mwc-button

* flesh out dialog implementation

* do not display action footer if no actions slotted

* only layout on listeners if open

* run formatter

* scrollable actually is handled by adapter / found

* fix reversing of actions

* - slotchange + `hideActions`, buttons->actions

* fix slotted styles

* remove style tag mutation

* change style dependencies

* don't leak mdc in dialog actions and initial-focus atributes

* make action and focus attributes configurable

* add css custom properties to dialog

* forgot to change checkbox to dialog

* dialog was made in 2019

* button -> action and remove isVisible

* removed leaky events from dialog lifecycle

* clean up tsconfig

* add unit tests

* textfield -> dialog

* run formatter

* fix multiple dialogs

* fix scrolling

* try to make max-width better

* initial pass at making older tests pass

* escape key on document instead

* run formatter

* fix lint issues

* try more arcane keyboardevent for older browsers

* fix styling associated with multiple in sec action

* fix focus on textfield

* also fix blur on textfield

* mwc-dialog demo

* add dialog to the main demo page

* fix typo in demo

* fix style edge case max-width too small cause jump

* redo change to max-width jumping

* first half of readme

* include video tag in static urlify script

* finish readme

* regenerate package-lock

* fix readme typo

* change confirmation gif size

* cleanup extraneous readme code

* do not override mdcfoundation.open

* make stacked a css change rather than DOM

* make stacked a css change rather than DOM impl

* add color swatches to readme

* fix all test file copyright dates

* add in the styles for the list in the readme

* use formfield in confirmation example

* scrollable degification

* make styled example the same as spec page

* dedupe initial focused example readme

* small dialog readme fixes

* update initial focus readme example

* moved alert example to top and commented out Simple example

* update standard gif to be static

* move event listeners to open an close

* readme change suggestions

* HTMLSlotElement removed from public props

* make public props lit element props

* primary-action => primaryAction; d-i-f => dIF;

* implement suggestions

* run formatter

* resolve merge issues
2019-09-12 18:14:47 -07:00
Elliott Marquez
85da4fa18a
Fix focus button textfield (#463)
* add focus and blur functions to mwc-button

* fix focus on textfield

* also fix blur on textfield

* run formatter

* update changelog

* lintfix

* update changelog to match older style

* make ripple a dep vs dev dep

* focus and blur buttons with or without ripple
2019-09-10 11:41:14 -07:00
Elliott Marquez
05f7ab99fc remove console log and fix format 2019-08-28 02:09:41 -07:00
Elliott Marquez
a04f214c25 file file references in cli 2019-08-28 02:09:41 -07:00
Elliott Marquez
3b90ee46b1 move the benchmark runner 2019-08-28 02:09:41 -07:00
Alexander Marks
aa060417c0
Fix bug where mwc-snackbar labelText could not be set (#412)
This adds a lit directive implementation of @material/mdc-snackbar/util.ts#announce, which does some tricks to ensure that snackbar labels will be handled correctly by screen readers.

The existing MDC announce util function is difficult to use directly here, because Lit can crash when DOM that it is managing changes outside of its purvue. In this case, we would render our labelText as the text content of the label div, but the MDC announce function then clears that
text content, and resets it after a timeout. We do the same thing here, but in a way that fits into Lit's lifecycle.
2019-08-26 15:48:56 -07:00
Elliott Marquez
289898cafc run format 2019-08-26 14:26:39 -07:00
Elliott Marquez
9d3042ce8b validity tests 2019-08-26 14:26:39 -07:00
Elliott Marquez
488ad9e53a run formatter 2019-08-23 17:23:17 -07:00
Elliott Marquez
1e40cc9c55 revert icon toggle modifcations and remove tests 2019-08-23 17:23:17 -07:00
Elliott Marquez
26cf5756cb change to TDD 2019-08-23 17:23:17 -07:00
Elliott Marquez
b467043059 run formatter on tests 2019-08-23 17:23:16 -07:00
Elliott Marquez
839dc19a0e add tests showing how fixture is used 2019-08-23 17:23:16 -07:00