Skip to content

Commit c27c269

Browse files
committed
feat(toolbar): remove is* prefix from property names
BREAKING CHANGE: rename mdcToolbar properties isFixed, isWaterfall, isFixedLastRowOnly, isFlexible, isFlexibleDefaultBehavior to respectively: fixed, waterfall, fixedLastRowOnly, flexible, flexibleDefaultBehavior
1 parent 5c9fa82 commit c27c269

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

bundle/src/components/toolbar/mdc.toolbar.directive.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class MdcToolbarMenuIcon {
122122
}
123123

124124
/**
125-
* For <code>isFixed</code> toolbars, this directive should be put on the page's
125+
* For <code>fixed</code> toolbars, this directive should be put on the page's
126126
* content wrapper element, and the exported directive should be assigned to the
127127
* <code>fixedAdjust</code> property of the <code>MdcToolbarDirective</code>.
128128
* This will make the toolbar aware of the content wrapper, so that the top marging
@@ -150,7 +150,7 @@ export class MdcToolbarDirective implements AfterViewInit, OnDestroy {
150150
@HostBinding('class.mdc-toolbar') _hostClass = true;
151151
/**
152152
* Assign a <code>MdcToolbarFixedAdjustDirective</code> put on the main
153-
* content of the page. Required for <code>isFixed</code> toolbars,
153+
* content of the page. Required for <code>fixed</code> toolbars,
154154
* to properly layout the toolbar and the content when users scroll.
155155
*/
156156
@Input() fixedAdjust: MdcToolbarFixedAdjustDirective;
@@ -267,42 +267,42 @@ export class MdcToolbarDirective implements AfterViewInit, OnDestroy {
267267
* If set to a value other than false, the toolbar will be fixed to the top of the
268268
* screen (or viewport).
269269
*/
270-
@Input() @HostBinding('class.mdc-toolbar--fixed') get isFixed() {
270+
@Input() @HostBinding('class.mdc-toolbar--fixed') get fixed() {
271271
return this._fixed;
272272
}
273273

274-
set isFixed(val: any) {
274+
set fixed(val: any) {
275275
let newValue = asBoolean(val);
276276
if (this._initialized && this._fixed !== newValue)
277-
throw new Error('isFixed directive should not be changed after the mdcToolbar is initialized');
277+
throw new Error('fixed property should not be changed after the mdcToolbar is initialized');
278278
this._fixed = newValue;
279279
}
280280

281281
/**
282-
* If set to a value other than false, and used in combination with <code>isFixed</code>
282+
* If set to a value other than false, and used in combination with <code>fixed</code>
283283
* the toolbar will become a waterfall toolbar.
284284
* A waterfall toolbar is initially static and has no elevation, but when content scrolls under it,
285285
* the toolbar becomes fixed and gains elevation.
286286
*/
287-
@Input() @HostBinding('class.mdc-toolbar--waterfall') get isWaterfall() {
287+
@Input() @HostBinding('class.mdc-toolbar--waterfall') get waterfall() {
288288
return this._waterfall;
289289
}
290290

291-
set isWaterfall(val: any) {
291+
set waterfall(val: any) {
292292
this._waterfall = asBoolean(val);
293293
}
294294

295295
/**
296296
* If set to a value other than false, fixed toolbars will anchor only the last row to the top.
297297
*/
298-
@Input() @HostBinding('class.mdc-toolbar--fixed-lastrow-only') get isFixedLastrowOnly() {
298+
@Input() @HostBinding('class.mdc-toolbar--fixed-lastrow-only') get fixedLastrowOnly() {
299299
return this._fixedLastRowOnly;
300300
}
301301

302-
set isFixedLastrowOnly(val: any) {
302+
set fixedLastrowOnly(val: any) {
303303
let newValue = asBoolean(val);
304304
if (this._initialized && this._fixedLastRowOnly !== newValue)
305-
throw new Error('isFixedLastrowOnly directive should not be changed after the mdcToolbar is initialized');
305+
throw new Error('fixedLastrowOnly property should not be changed after the mdcToolbar is initialized');
306306
this._fixedLastRowOnly = newValue;
307307
}
308308

@@ -318,14 +318,14 @@ export class MdcToolbarDirective implements AfterViewInit, OnDestroy {
318318
* <code>--mdc-toolbar-ratio-to-extend-flexible</code>.
319319
* </blockquote>
320320
*/
321-
@Input() @HostBinding('class.mdc-toolbar--flexible') get isFlexible() {
321+
@Input() @HostBinding('class.mdc-toolbar--flexible') get flexible() {
322322
return this._flexible;
323323
}
324324

325-
set isFlexible(val: any) {
325+
set flexible(val: any) {
326326
let newValue = asBoolean(val);
327327
if (this._initialized && this._flexible !== newValue)
328-
throw new Error('isFlexible directive should not be changed after the mdcToolbar is initialized');
328+
throw new Error('flexible property should not be changed after the mdcToolbar is initialized');
329329
this._flexible = newValue;
330330
}
331331

@@ -336,14 +336,14 @@ export class MdcToolbarDirective implements AfterViewInit, OnDestroy {
336336
* Flexible Toolbar documention
337337
* </a>.
338338
*/
339-
@Input() @HostBinding('class.mdc-toolbar--flexible-default-behavior') get isFlexibleDefaultBehavior() {
339+
@Input() @HostBinding('class.mdc-toolbar--flexible-default-behavior') get flexibleDefaultBehavior() {
340340
return this._flexibleDefaultBehavior;
341341
}
342342

343-
set isFlexibleDefaultBehavior(val: any) {
343+
set flexibleDefaultBehavior(val: any) {
344344
let newValue = asBoolean(val);
345345
if (this._initialized && this._flexibleDefaultBehavior !== newValue)
346-
throw new Error('isFlexibleDefaultBehavior directive should not be changed after the mdcToolbar is initialized');
346+
throw new Error('flexibleDefaultBehavior property should not be changed after the mdcToolbar is initialized');
347347
this._flexibleDefaultBehavior = newValue;
348348
}
349349

site/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<header mdcToolbar class="blox-header" isFixed [fixedAdjust]="main" isFlexible isFlexibleDefaultBehavior isFixedLastrowOnly isWaterfall>
1+
<header mdcToolbar class="blox-header" fixed [fixedAdjust]="main" flexible flexibleDefaultBehavior fixedLastrowOnly waterfall>
22
<div class="blox-container blox-material-header-logo">
33
</div>
44
<div mdcToolbarRow class="blox-container">

site/src/app/components/snippets/directives/snippet.toolbar.flexible.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<div #viewport class="blox-snippet-page">
1111
<!-- viewport is used to position the fixed toolbar relative the parent div, instead of to the browser window.
1212
You don't normally need this property, since the default viewport is the browser window -->
13-
<header mdcToolbar [viewport]="viewport" isFixed [fixedAdjust]="main"
14-
[isWaterfall]="waterfall" isFlexible isFlexibleDefaultBehavior
13+
<header mdcToolbar [viewport]="viewport" fixed [fixedAdjust]="main"
14+
[waterfall]="waterfall" flexible flexibleDefaultBehavior
1515
(expansionRatio)="updateExpansionRatio($event)">
1616
<div mdcToolbarRow>
1717
<section mdcToolbarSection alignStart>

0 commit comments

Comments
 (0)