Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components): update to include mode classes on missing components #17838

Merged
merged 43 commits into from Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1851111
test(tabs): move vanilla test to standalone and add e2e
Mar 19, 2019
afb2a90
test(tabs): update test to include selecting third tab
Mar 20, 2019
46f84b3
test(datetime): fix typo
Mar 20, 2019
d70101f
fix(card): update card components to have mode classes
Mar 20, 2019
d01f712
test(card): update basic e2e to check for mode
Mar 20, 2019
2ac11f6
test(components): move check mode to utils
Mar 20, 2019
816e8f5
fix(badge): add mode classes
Mar 20, 2019
769d5bc
test(utils): update utils example to fix linter and clarify vars
Mar 21, 2019
eefcf6a
test(modes): add tests for mode classes
Mar 21, 2019
0559926
test(components): fix var names
Mar 21, 2019
798fc76
test(components): remove the check mode in favor of one e2e
Mar 21, 2019
091e51e
fix(components): add component class + mode
Mar 21, 2019
6afa265
test(modes): adds initial e2e test for mode classes
Mar 21, 2019
588601f
style(components): remove prop from mode
Mar 21, 2019
6ed94d7
style: fix lint
Mar 21, 2019
00a71a0
fix(components): add missing mode classes
Mar 21, 2019
9ee8695
fix(components): add missing mode classes
Mar 21, 2019
8add648
fix(components): add missing mode classes
Mar 21, 2019
be2fb84
Merge branch 'master' into test-updates
brandyscarney Mar 22, 2019
128aaf4
test(components): add in picker column test and format
Mar 22, 2019
0c3e07d
test(utils): update to include action sheet
Mar 22, 2019
41cd1d6
Merge branch 'master' into test-updates
brandyscarney Mar 22, 2019
097592e
fix(components): remove mode-less component classes
Mar 25, 2019
b024aad
fix(split-pane): remove dependency on component class
Mar 25, 2019
61ec70f
fix(slides): remove dependency on component class
Mar 25, 2019
dbde52b
fix(components): remove internal component classes
Mar 25, 2019
c634931
fix(components): update to use mode class without component name
Mar 25, 2019
638e506
test(utils): update util tests and add more surrounding classes
Mar 25, 2019
576d82c
Merge branch 'master' into test-updates
brandyscarney Mar 25, 2019
1af02bb
Merge branch 'master' into test-updates
brandyscarney Mar 25, 2019
b3df646
Merge branch 'master' into test-updates
brandyscarney Mar 25, 2019
95c4884
test(utils): add button class tests and wait for selector
Mar 25, 2019
d603c5e
fix(title): remove mode class styling in favor of host
Mar 25, 2019
4e5868c
test(modes): add check for changing the mode
Mar 25, 2019
0884dfb
Merge branch 'master' into test-updates
brandyscarney Mar 26, 2019
cb8c629
Merge branch 'master' into test-updates
brandyscarney Apr 10, 2019
38b1a77
fix(icon): add latest ionicons with mode
Apr 10, 2019
b449f72
revert(title): undo changes to make title mode separated
Apr 10, 2019
72cd76d
Merge branch 'master' into test-updates
brandyscarney Apr 15, 2019
d9a4ac5
Merge branch 'master' into test-updates
brandyscarney Apr 16, 2019
b2c6705
Merge branch 'master' into test-updates
brandyscarney Apr 16, 2019
2ca8664
style(slide): I broke the comma
Apr 16, 2019
b12d342
Merge branch 'master' into test-updates
brandyscarney Apr 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/package.json
Expand Up @@ -30,7 +30,7 @@
"loader/"
],
"dependencies": {
"ionicons": "4.5.5"
"ionicons": "4.5.6"
},
"devDependencies": {
"@stencil/core": "0.17.3-0",
Expand Down
2 changes: 2 additions & 0 deletions core/src/components/action-sheet/action-sheet.tsx
Expand Up @@ -196,6 +196,8 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
zIndex: 20000 + this.overlayIndex,
},
class: {
[`${this.mode}`]: true,

...getClassMap(this.cssClass),
'action-sheet-translucent': this.translucent
}
Expand Down
1 change: 1 addition & 0 deletions core/src/components/alert/alert.tsx
Expand Up @@ -392,6 +392,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
},
class: {
...getClassMap(this.cssClass),
[`${this.mode}`]: true,
'alert-translucent': this.translucent
}
};
Expand Down
4 changes: 3 additions & 1 deletion core/src/components/anchor/anchor.tsx
@@ -1,6 +1,6 @@
import { Component, ComponentInterface, Listen, Prop } from '@stencil/core';

import { Color, RouterDirection } from '../../interface';
import { Color, Mode, RouterDirection } from '../../interface';
import { createColorClasses, openURL } from '../../utils/theme';

@Component({
Expand All @@ -9,6 +9,7 @@ import { createColorClasses, openURL } from '../../utils/theme';
shadow: true
})
export class Anchor implements ComponentInterface {
mode!: Mode;

@Prop({ context: 'window' }) win!: Window;

Expand Down Expand Up @@ -40,6 +41,7 @@ export class Anchor implements ComponentInterface {
return {
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true,
'ion-activatable': true
}
};
Expand Down
4 changes: 3 additions & 1 deletion core/src/components/app/app.tsx
@@ -1,6 +1,6 @@
import { Component, ComponentInterface, Element, Prop, QueueApi } from '@stencil/core';

import { Config } from '../../interface';
import { Config, Mode } from '../../interface';
import { rIC } from '../../utils/helpers';
import { isPlatform } from '../../utils/platform';

Expand All @@ -9,6 +9,7 @@ import { isPlatform } from '../../utils/platform';
styleUrl: 'app.scss'
})
export class App implements ComponentInterface {
mode!: Mode;

@Element() el!: HTMLElement;

Expand All @@ -34,6 +35,7 @@ export class App implements ComponentInterface {
hostData() {
return {
class: {
[`${this.mode}`]: true,
'ion-page': true,
'force-statusbar-padding': this.config.getBoolean('_forceStatusbarPadding')
}
Expand Down
11 changes: 11 additions & 0 deletions core/src/components/avatar/avatar.tsx
@@ -1,5 +1,7 @@
import { Component, ComponentInterface } from '@stencil/core';

import { Mode } from '../../interface';

@Component({
tag: 'ion-avatar',
styleUrls: {
Expand All @@ -9,6 +11,15 @@ import { Component, ComponentInterface } from '@stencil/core';
shadow: true
})
export class Avatar implements ComponentInterface {
mode!: Mode;

hostData() {
return {
class: {
[`${this.mode}`]: true,
}
};
}

render() {
return <slot></slot>;
Expand Down
1 change: 1 addition & 0 deletions core/src/components/back-button/back-button.tsx
Expand Up @@ -62,6 +62,7 @@ export class BackButton implements ComponentInterface {
return {
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true,

'button': true, // ion-buttons target .button
'ion-activatable': true,
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/backdrop/backdrop.tsx
@@ -1,5 +1,6 @@
import { Component, ComponentInterface, Event, EventEmitter, Listen, Prop } from '@stencil/core';

import { Mode } from '../../interface';
import { GESTURE_CONTROLLER } from '../../utils/gesture';
import { now } from '../../utils/helpers';

Expand All @@ -12,6 +13,7 @@ import { now } from '../../utils/helpers';
shadow: true
})
export class Backdrop implements ComponentInterface {
mode!: Mode;

private lastClick = -10000;
private blocker = GESTURE_CONTROLLER.createBlocker({
Expand Down Expand Up @@ -78,6 +80,7 @@ export class Backdrop implements ComponentInterface {
return {
tabindex: '-1',
class: {
[`${this.mode}`]: true,
'backdrop-hide': !this.visible,
'backdrop-no-tappable': !this.tappable,
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/components/badge/badge.tsx
Expand Up @@ -26,7 +26,10 @@ export class Badge implements ComponentInterface {

hostData() {
return {
class: createColorClasses(this.color)
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true
}
};
}

Expand Down
1 change: 1 addition & 0 deletions core/src/components/button/button.tsx
Expand Up @@ -148,6 +148,7 @@ export class Button implements ComponentInterface {
'aria-disabled': disabled ? 'true' : null,
class: {
...createColorClasses(color),
[`${this.mode}`]: true,
[buttonType]: true,
[`${buttonType}-${expand}`]: expand !== undefined,
[`${buttonType}-${size}`]: size !== undefined,
Expand Down
14 changes: 13 additions & 1 deletion core/src/components/buttons/buttons.tsx
@@ -1,5 +1,7 @@
import { Component, ComponentInterface } from '@stencil/core';

import { Mode } from '../../interface';

@Component({
tag: 'ion-buttons',
styleUrls: {
Expand All @@ -8,4 +10,14 @@ import { Component, ComponentInterface } from '@stencil/core';
},
scoped: true,
})
export class Buttons implements ComponentInterface {}
export class Buttons implements ComponentInterface {
mode!: Mode;

hostData() {
return {
class: {
[`${this.mode}`]: true
}
};
}
}
8 changes: 6 additions & 2 deletions core/src/components/card-content/card-content.tsx
@@ -1,7 +1,6 @@
import { Component, ComponentInterface, Prop } from '@stencil/core';

import { Mode } from '../../interface';
import { createThemedClasses } from '../../utils/theme';

@Component({
tag: 'ion-card-content',
Expand All @@ -19,7 +18,12 @@ export class CardContent implements ComponentInterface {

hostData() {
return {
class: createThemedClasses(this.mode, 'card-content')
class: {
[`${this.mode}`]: true,

// Used internally for styling
[`card-content-${this.mode}`]: true
}
};
}
}
1 change: 1 addition & 0 deletions core/src/components/card-header/card-header.tsx
Expand Up @@ -34,6 +34,7 @@ export class CardHeader implements ComponentInterface {
class: {
...createColorClasses(this.color),
'card-header-translucent': this.translucent,
[`${this.mode}`]: true
}
};
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/components/card-subtitle/card-subtitle.tsx
Expand Up @@ -26,7 +26,10 @@ export class CardSubtitle implements ComponentInterface {

hostData() {
return {
class: createColorClasses(this.color),
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true
},
'role': 'heading',
'aria-level': '3'
};
Expand Down
5 changes: 4 additions & 1 deletion core/src/components/card-title/card-title.tsx
Expand Up @@ -26,7 +26,10 @@ export class CardTitle implements ComponentInterface {

hostData() {
return {
class: createColorClasses(this.color),
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true
},
'role': 'heading',
'aria-level': '2'
};
Expand Down
5 changes: 4 additions & 1 deletion core/src/components/card/card.tsx
Expand Up @@ -27,7 +27,10 @@ export class Card implements ComponentInterface {

hostData() {
return {
class: createColorClasses(this.color)
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true
}
};
}
}
1 change: 1 addition & 0 deletions core/src/components/checkbox/checkbox.tsx
Expand Up @@ -137,6 +137,7 @@ export class Checkbox implements ComponentInterface {
'aria-labelledby': labelId,
class: {
...createColorClasses(color),
[`${this.mode}`]: true,
'in-item': hostContext('ion-item', el),
'checkbox-checked': checked,
'checkbox-disabled': disabled,
Expand Down
1 change: 1 addition & 0 deletions core/src/components/chip/chip.tsx
Expand Up @@ -33,6 +33,7 @@ export class Chip implements ComponentInterface {
return {
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true,
'chip-outline': this.outline,
'ion-activatable': true,
}
Expand Down
6 changes: 6 additions & 0 deletions core/src/components/col/col.tsx
@@ -1,5 +1,6 @@
import { Component, ComponentInterface, Element, Listen, Prop } from '@stencil/core';

import { Mode } from '../../interface';
import { matchBreakpoint } from '../../utils/media';

const win = window as any;
Expand All @@ -12,6 +13,8 @@ const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];
shadow: true
})
export class Col implements ComponentInterface {
mode!: Mode;

@Prop({ context: 'window' }) win!: Window;

@Element() el!: HTMLStencilElement;
Expand Down Expand Up @@ -247,6 +250,9 @@ export class Col implements ComponentInterface {
hostData() {
const isRTL = this.win.document.dir === 'rtl';
return {
class: {
[`${this.mode}`]: true
},
style: {
...this.calculateOffset(isRTL),
...this.calculatePull(isRTL),
Expand Down
1 change: 1 addition & 0 deletions core/src/components/content/content.tsx
Expand Up @@ -293,6 +293,7 @@ export class Content implements ComponentInterface {
return {
class: {
...createColorClasses(this.color),
[`${this.mode}`]: true,
'content-sizing': hostContext('ion-popover', this.el),
'overscroll': !!this.forceOverscroll,
},
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/datetime/datetime-util.spec.ts
Expand Up @@ -2,7 +2,7 @@ import { convertDataToISO, parseDate } from './datetime-util';

describe('datetime-util', () => {
describe('convertDataToISO', () => {
it('prints an emptry string for an empty datetime', () => {
it('prints an empty string for an empty datetime', () => {
expect(convertDataToISO({})).toEqual('');
});

Expand Down
1 change: 1 addition & 0 deletions core/src/components/datetime/datetime.tsx
Expand Up @@ -615,6 +615,7 @@ export class Datetime implements ComponentInterface {
'aria-haspopup': 'true',
'aria-labelledby': labelId,
class: {
[`${this.mode}`]: true,
'datetime-disabled': disabled,
'datetime-readonly': readonly,
'datetime-placeholder': addPlaceholderClass,
Expand Down
1 change: 1 addition & 0 deletions core/src/components/fab-button/fab-button.tsx
Expand Up @@ -95,6 +95,7 @@ export class FabButton implements ComponentInterface {
'aria-disabled': disabled ? 'true' : null,
class: {
...createColorClasses(color),
[`${this.mode}`]: true,
'fab-button-in-list': inList,
'fab-button-translucent-in-list': inList && translucent,
'fab-button-close-active': activated,
Expand Down
5 changes: 5 additions & 0 deletions core/src/components/fab-list/fab-list.tsx
@@ -1,11 +1,15 @@
import { Component, ComponentInterface, Element, Prop, Watch } from '@stencil/core';

import { Mode } from '../../interface';

@Component({
tag: 'ion-fab-list',
styleUrl: 'fab-list.scss',
shadow: true
})
export class FabList implements ComponentInterface {
mode!: Mode;

@Element() el!: HTMLIonFabElement;

/**
Expand All @@ -32,6 +36,7 @@ export class FabList implements ComponentInterface {
hostData() {
return {
class: {
[`${this.mode}`]: true,
'fab-list-active': this.activated,
[`fab-list-side-${this.side}`]: true
}
Expand Down
4 changes: 4 additions & 0 deletions core/src/components/fab/fab.tsx
@@ -1,11 +1,14 @@
import { Component, ComponentInterface, Element, Listen, Method, Prop, Watch } from '@stencil/core';

import { Mode } from '../../interface';

@Component({
tag: 'ion-fab',
styleUrl: 'fab.scss',
shadow: true
})
export class Fab implements ComponentInterface {
mode!: Mode;

@Element() el!: HTMLElement;

Expand Down Expand Up @@ -75,6 +78,7 @@ export class Fab implements ComponentInterface {
hostData() {
return {
class: {
[`${this.mode}`]: true,
[`fab-horizontal-${this.horizontal}`]: this.horizontal !== undefined,
[`fab-vertical-${this.vertical}`]: this.vertical !== undefined,
'fab-edge': this.edge
Expand Down
13 changes: 7 additions & 6 deletions core/src/components/footer/footer.tsx
@@ -1,7 +1,6 @@
import { Component, ComponentInterface, Prop } from '@stencil/core';

import { Mode } from '../../interface';
import { createThemedClasses } from '../../utils/theme';

@Component({
tag: 'ion-footer',
Expand All @@ -25,13 +24,15 @@ export class Footer implements ComponentInterface {
@Prop() translucent = false;

hostData() {
const themedClasses = createThemedClasses(this.mode, 'footer');
const translucentClasses = this.translucent ? createThemedClasses(this.mode, 'footer-translucent') : null;

return {
class: {
...themedClasses,
...translucentClasses
[`${this.mode}`]: true,

// Used internally for styling
[`footer-${this.mode}`]: true,

[`footer-translucent`]: this.translucent,
[`footer-translucent-${this.mode}`]: this.translucent,
}
};
}
Expand Down