From 495ef92c56c2cc6d28ab61547813fffee3d743c8 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Wed, 8 Mar 2017 17:05:15 -0800 Subject: [PATCH 01/24] feat(): move rlt fab into components toolbar as a menu option --- src/app/app.component.html | 5 +---- src/app/app.component.ts | 17 ++++------------- .../components/components.component.html | 13 ++++++++++++- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 05352eb512..e8eaf8fdf6 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,11 +1,8 @@ - + {{item.icon}}{{item.title}} - - {{root.dir.toUpperCase()}} - \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 229804c7fd..dc92ef04b6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,6 @@ -import { Component, ElementRef, Inject, Renderer } from '@angular/core'; -import { DomSanitizer, DOCUMENT } from '@angular/platform-browser'; -import { MdIconRegistry, Dir } from '@angular/material'; +import { Component } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { MdIconRegistry } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; @@ -36,13 +36,9 @@ export class DocsAppComponent { }, ]; - direction: string = 'ltr'; - constructor(private _iconRegistry: MdIconRegistry, private _domSanitizer: DomSanitizer, - translateService: TranslateService, - private el: ElementRef, private renderer: Renderer, - @Inject(DOCUMENT) private document: any) { + translateService: TranslateService) { // Set fallback language translateService.setDefaultLang('en'); // Supported languages @@ -67,9 +63,4 @@ export class DocsAppComponent { this._iconRegistry.addSvgIconInNamespace('assets', 'querygrid', this._domSanitizer.bypassSecurityTrustResourceUrl('app/assets/icons/querygrid.svg')); } - - changeDir(root: Dir): void { - this.direction = root._dir; - this.renderer.setElementAttribute(this.document.querySelector('html'), 'dir', this.direction); - } } diff --git a/src/app/components/components/components.component.html b/src/app/components/components/components.component.html index e120098096..34f9a724e7 100644 --- a/src/app/components/components/components.component.html +++ b/src/app/components/components/components.component.html @@ -48,6 +48,17 @@

{{item.title}}

Covalent Components & Addons + + + + +
+
+
- \ No newline at end of file From b78da8fe4d04e48c51971e2802852acf1068f25f Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Wed, 8 Mar 2017 18:05:12 -0800 Subject: [PATCH 02/24] fix(chips): added fallback for ltr support --- src/platform/core/chips/chips.component.scss | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/platform/core/chips/chips.component.scss b/src/platform/core/chips/chips.component.scss index 4862a4dd53..6e48c28d03 100644 --- a/src/platform/core/chips/chips.component.scss +++ b/src/platform/core/chips/chips.component.scss @@ -1,3 +1,5 @@ +@import '../common/styles/mixins'; + :host { display: block; padding: 0px 5px 0px 5px; @@ -6,12 +8,7 @@ cursor: default; border-radius: 16px; line-height: 32px; - [dir='ltr'] & { - margin: 8px 8px 0 0; - } - [dir='rtl'] & { - margin: 8px 0 0 8px; - } + @include rtl(margin, 8px 8px 0 0, 8px 0 0 8px); padding: 0 12px; box-sizing: border-box; max-width: 100%; @@ -19,11 +16,10 @@ md-icon { position: relative; top: 5px; - [dir='ltr'] & { - left: 5px; - } + left: 5px; [dir='rtl'] & { right: 5px; + left: auto; } height: 18px; width: 18px; From 33c23a41b2bcce2a66be689d8dad7218a7083aa4 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Wed, 8 Mar 2017 18:08:00 -0800 Subject: [PATCH 03/24] fix(): leverage rtl mixin in chips --- src/platform/core/chips/chips.component.scss | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/platform/core/chips/chips.component.scss b/src/platform/core/chips/chips.component.scss index 6e48c28d03..1dd50216e7 100644 --- a/src/platform/core/chips/chips.component.scss +++ b/src/platform/core/chips/chips.component.scss @@ -16,11 +16,8 @@ md-icon { position: relative; top: 5px; - left: 5px; - [dir='rtl'] & { - right: 5px; - left: auto; - } + @include rtl(left, 5px, auto); + @include rtl(right, auto, 5px); height: 18px; width: 18px; font-size: 19px; From e79e4579372ff0e9289f57abf9a76988bc3f08a8 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Wed, 8 Mar 2017 18:20:14 -0800 Subject: [PATCH 04/24] fix(toolbar): set fallback for ltr --- .../core/common/styles/_structure.scss | 21 +++++++++++++------ src/platform/core/common/styles/_toolbar.scss | 20 ++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/platform/core/common/styles/_structure.scss b/src/platform/core/common/styles/_structure.scss index 7ef67a2a15..477c56cb31 100644 --- a/src/platform/core/common/styles/_structure.scss +++ b/src/platform/core/common/styles/_structure.scss @@ -109,8 +109,11 @@ input { pointer-events: none; position: absolute; overflow: hidden; - [dir='ltr'] & {left: 0;} - [dir='rtl'] & {right:0;} + left: 0; + [dir='rtl'] & { + right:0; + left: auto; + } top: 0; width: 100%; height: 100%; @@ -124,8 +127,11 @@ input { pointer-events: none; position: absolute; overflow: hidden; - [dir='ltr'] & {left: 0;} - [dir='rtl'] & {right:0;} + left: 0; + [dir='rtl'] & { + right:0; + left: auto; + } top: 0; width: 100%; height: 100%; @@ -174,8 +180,11 @@ input { display: block; position: absolute; background-color: #fafafa; - [dir='ltr'] & {right: 0;} - [dir='rtl'] & {left:0;} + right: 0; + [dir='rtl'] & { + left:0; + right: auto; + } top: 0; bottom: 0; z-index: $z-index-scroll-mask; diff --git a/src/platform/core/common/styles/_toolbar.scss b/src/platform/core/common/styles/_toolbar.scss index 29e3642855..6d216511e5 100644 --- a/src/platform/core/common/styles/_toolbar.scss +++ b/src/platform/core/common/styles/_toolbar.scss @@ -2,18 +2,26 @@ md-toolbar { [md-button] { &:first-of-type:not(:last-child) { - [dir='ltr'] & {margin-left: -6px;} - [dir='rtl'] & {margin-right: -6px;} + margin-left: -6px; + [dir='rtl'] & { + margin-right: -6px; + margin-left: 0; + } } &:last-of-type:not(:first-child) { - [dir='ltr'] & {margin-right: -6px;} - [dir='rtl'] & {margin-left: -6px;} + margin-right: -6px; + [dir='rtl'] & { + margin-left: -6px; + margin-right: 0; + } } } .md-icon-logo { margin-right: 10px; - [dir='ltr'] & {margin-right: 10px;} - [dir='rtl'] & {margin-left: 10px;} + [dir='rtl'] & { + margin-left: 10px; + margin-right: 0; + } } [md-icon-button] { margin: 0 6px; From 078f898684f1d37210c2236ccb069a44b8f25797 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 17:47:56 -0800 Subject: [PATCH 05/24] chore(): move ltr option to the whole components page --- src/app/components/components/components.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/components/components.component.html b/src/app/components/components/components.component.html index 34f9a724e7..473be6c2f3 100644 --- a/src/app/components/components/components.component.html +++ b/src/app/components/components/components.component.html @@ -1,4 +1,5 @@ {{item.title}} -
+
\ No newline at end of file From 40ed7ac20b43a73dfe3c2f47eeac0bfcf21722ae Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 17:49:48 -0800 Subject: [PATCH 06/24] feat(data-table): add fallback for ltr and fix selected rtl --- .../data-table-cell.component.scss | 8 ++++---- .../data-table-column.component.scss | 18 +++++++++--------- .../core/data-table/data-table.component.scss | 17 +++++++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/platform/core/data-table/data-table-cell/data-table-cell.component.scss b/src/platform/core/data-table/data-table-cell/data-table-cell.component.scss index 4600f5aee7..6351129026 100644 --- a/src/platform/core/data-table/data-table-cell/data-table-cell.component.scss +++ b/src/platform/core/data-table/data-table-cell/data-table-cell.component.scss @@ -6,12 +6,12 @@ padding: 0 28px 0 28px; &:first-child { - [dir='ltr'] & { padding-left: 24px;} - [dir='rtl'] & { padding-right: 24px;} + @include rtl(padding-left, 24px, initial); + @include rtl(padding-right, initial, 24px); } &:last-child { - [dir='ltr'] & { padding-right: 24px;} - [dir='rtl'] & { padding-left: 24px;} + @include rtl(padding-left, initial, 24px); + @include rtl(padding-right, 24px, initial); } > * { diff --git a/src/platform/core/data-table/data-table-column/data-table-column.component.scss b/src/platform/core/data-table/data-table-column/data-table-column.component.scss index 5ff9d81e6e..b536fb0131 100644 --- a/src/platform/core/data-table/data-table-column/data-table-column.component.scss +++ b/src/platform/core/data-table/data-table-column/data-table-column.component.scss @@ -8,12 +8,12 @@ position: relative; &:first-child { - [dir='ltr'] & { padding-left: 24px;} - [dir='rtl'] & { padding-right: 24px;} + @include rtl(padding-left, 24px, initial); + @include rtl(padding-right, initial, 24px); } &:last-child { - [dir='ltr'] & { padding-right: 24px;} - [dir='rtl'] & { padding-left: 24px;} + @include rtl(padding-left, initial, 24px); + @include rtl(padding-right, 24px, initial); } md-icon { @@ -62,14 +62,14 @@ &.mat-numeric { @include rtl(text-align, right, left); md-icon.td-data-table-sort-icon { - [dir='ltr'] & { margin-left: -22px;} - [dir='rtl'] & { margin-right: -22px;} + @include rtl(margin-left, -22px, initial); + @include rtl(margin-right, initial, -22px); } } &:not(.mat-numeric) { md-icon.td-data-table-sort-icon { - [dir='ltr'] & { margin-left: 6px;} - [dir='rtl'] & { margin-right: 6px;} + @include rtl(margin-left, 6px, initial); + @include rtl(margin-right, initial, 6px); } } -} \ No newline at end of file +} diff --git a/src/platform/core/data-table/data-table.component.scss b/src/platform/core/data-table/data-table.component.scss index 409b022b2f..56e91ad615 100644 --- a/src/platform/core/data-table/data-table.component.scss +++ b/src/platform/core/data-table/data-table.component.scss @@ -13,15 +13,21 @@ table.td-data-table { transition: background-color 0.2s; } - &.mat-selectable td.td-data-table-cell, - &.mat-selectable th.td-data-table-column { + &.mat-selectable .td-data-table-column, + &.mat-selectable th.td-data-table-column, + &.mat-selectable td.td-data-table-cell { &:first-child { width: 20px; padding: 0 24px; } &:nth-child(2) { - [dir='ltr'] & { padding-left: 0px;} - [dir='rtl'] & { padding-right: 0px;} + padding-left: 0px; + } + [dir='rtl'] & { + &:nth-child(2){ + padding-right: 0px; + padding-left: 28px; + } } } @@ -34,8 +40,7 @@ table.td-data-table { height: $checkbox-size; /deep/ &.mat-pseudo-checkbox-checked::after { top: 3px !important; - [dir='ltr'] & { left: 1px !important;} - [dir='rtl'] & { right: 1px !important;} + left: 1px !important; width: 11px !important; height: 4px !important; } From ed127df584a69fbf3afe28bac440667b607bd47f Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:01:10 -0800 Subject: [PATCH 07/24] feat(dialog): add fallback for ltr in dialogs --- src/platform/core/dialogs/dialog.component.scss | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/platform/core/dialogs/dialog.component.scss b/src/platform/core/dialogs/dialog.component.scss index 77a08b7ee7..1762423a31 100644 --- a/src/platform/core/dialogs/dialog.component.scss +++ b/src/platform/core/dialogs/dialog.component.scss @@ -10,11 +10,10 @@ .td-dialog-actions { position: relative; top: 16px; - [dir='ltr'] & { - left: 16px; - } - [dir='rtl'] & { - right: 16px; + left: 16px; + /deep/ [dir='rtl'] & { + right: 16px; + left: auto; } } @@ -23,11 +22,10 @@ .td-dialog-actions { /deep/ button { text-transform: uppercase; - [dir='ltr'] & { - margin-left: 8px; - } + margin-left: 8px; [dir='rtl'] & { margin-right: 8px; + margin-left: inherit; } padding-left: 8px; padding-right: 8px; From 538dbfbfe43c77025387e0164453e06514e6ee4c Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:19:09 -0800 Subject: [PATCH 08/24] feat(expansion-panel): add fallback ltr --- .../core/expansion-panel/_expansion-panel-theme.scss | 9 --------- .../core/expansion-panel/expansion-panel.component.scss | 7 +++---- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/platform/core/expansion-panel/_expansion-panel-theme.scss b/src/platform/core/expansion-panel/_expansion-panel-theme.scss index d7ab44b0ff..ab9c565404 100644 --- a/src/platform/core/expansion-panel/_expansion-panel-theme.scss +++ b/src/platform/core/expansion-panel/_expansion-panel-theme.scss @@ -34,15 +34,6 @@ } .td-expansion-primary, .td-expansion-secondary { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - [dir='ltr'] & { - margin-right: 5px; - } - [dir='rtl'] & { - margin-left: 5px; - } &, & * { vertical-align: middle; } diff --git a/src/platform/core/expansion-panel/expansion-panel.component.scss b/src/platform/core/expansion-panel/expansion-panel.component.scss index 4f860b781b..29a7530ca9 100644 --- a/src/platform/core/expansion-panel/expansion-panel.component.scss +++ b/src/platform/core/expansion-panel/expansion-panel.component.scss @@ -37,10 +37,9 @@ md-nav-list { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - [dir='ltr'] & { - margin-right: 5px; - } - [dir='rtl'] & { + margin-right: 5px; + /deep/ [dir='rtl'] & { margin-left: 5px; + margin-right: inherit; } } \ No newline at end of file From 9e5e12a8412f2b413a0292138f48ed75f3fb4287 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:34:04 -0800 Subject: [PATCH 09/24] feat(layouts): add ltr fallback and fix rtl --- .../layout-manage-list.component.scss | 16 ++++++++-------- .../layout-nav-list.component.scss | 16 ++++++++-------- .../layout/layout-nav/layout-nav.component.scss | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.scss b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.scss index 949c1c7227..f74770e84e 100644 --- a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.scss +++ b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.scss @@ -1,3 +1,11 @@ +.td-menu-button { + margin-left: 0px; + /deep/ [dir='rtl'] & { + margin-right: 0px; + margin-left: 6px; + } +} + :host { display: flex; margin: 0; @@ -15,14 +23,6 @@ } } } - .td-menu-button { - [dir='ltr'] & { - margin-left: 0px; - } - [dir='rtl'] & { - margin-right: 0px; - } - } .list { text-align: start; } diff --git a/src/platform/core/layout/layout-nav-list/layout-nav-list.component.scss b/src/platform/core/layout/layout-nav-list/layout-nav-list.component.scss index 2927ec1825..ec2b7a7549 100644 --- a/src/platform/core/layout/layout-nav-list/layout-nav-list.component.scss +++ b/src/platform/core/layout/layout-nav-list/layout-nav-list.component.scss @@ -1,3 +1,11 @@ +.td-menu-button { + margin-left: 0px; + /deep/ [dir='rtl'] & { + margin-right: 0px; + margin-left: 6px; + } +} + :host { display: flex; margin: 0; @@ -15,14 +23,6 @@ } } } - .td-menu-button { - [dir='ltr'] & { - margin-left: 0px; - } - [dir='rtl'] & { - margin-right: 0px; - } - } .list { text-align: start; } diff --git a/src/platform/core/layout/layout-nav/layout-nav.component.scss b/src/platform/core/layout/layout-nav/layout-nav.component.scss index 9664e6c95e..05c007974b 100644 --- a/src/platform/core/layout/layout-nav/layout-nav.component.scss +++ b/src/platform/core/layout/layout-nav/layout-nav.component.scss @@ -1,3 +1,11 @@ +.td-menu-button { + margin-left: 0px; + /deep/ [dir='rtl'] & { + margin-right: 0px; + margin-left: 6px; + } +} + :host { display: flex; margin: 0; @@ -5,12 +13,4 @@ min-height: 100%; height: 100%; overflow: hidden; - .td-menu-button { - [dir='ltr'] & { - margin-left: 0px; - } - [dir='rtl'] & { - margin-right: 0px; - } - } } From 59ba67e68d72d52cafa69ff8464ce1178b0bf652 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:38:49 -0800 Subject: [PATCH 10/24] feat(menu): added fallback for ltr --- src/platform/core/menu/menu.component.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform/core/menu/menu.component.scss b/src/platform/core/menu/menu.component.scss index d7074c36f7..122baacd63 100644 --- a/src/platform/core/menu/menu.component.scss +++ b/src/platform/core/menu/menu.component.scss @@ -18,11 +18,10 @@ $td-menu-spacing: 8px !default; height: auto; padding: $td-menu-spacing; .mat-list-text { - [dir='ltr'] & { - padding-right: 0px; - } + padding-right: 0px; [dir='rtl'] & { padding-left: 0px; + padding-right: 16px; } } [md-line] + [md-line] { From 755a9b4704ec3ea7fe994f76ee77a41c983c2574 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:42:07 -0800 Subject: [PATCH 11/24] feat(notifications): rollback since this was already working --- .../notification-count.component.scss | 44 +++++-------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/src/platform/core/notifications/notification-count.component.scss b/src/platform/core/notifications/notification-count.component.scss index 2dbd95e371..490401ad98 100644 --- a/src/platform/core/notifications/notification-count.component.scss +++ b/src/platform/core/notifications/notification-count.component.scss @@ -40,21 +40,10 @@ $td-notification-content-size: 40px !default; bottom: 0px; } &.td-notification-before { - - [dir='ltr'] & { - left: 0px; - } - [dir='rtl'] & { - right: 0px; - } + left: 0px } &.td-notification-after { - [dir='ltr'] & { - right: 0px; - } - [dir='rtl'] & { - left: 0px; - } + right: 0px; } &.td-notification-no-count { width: 8px; @@ -66,39 +55,30 @@ $td-notification-content-size: 40px !default; bottom: 8px; } &.td-notification-before { - [dir='ltr'] & { - left: 8px; - } - [dir='rtl'] & { - right: 8px; - } + left: 8px; } &.td-notification-after { - [dir='ltr'] & { - right: 8px; - } - [dir='rtl'] & { - left: 8px; - } + right: 8px; } } /deep/ [dir='rtl'] & { &.td-notification-before { - @include rtl(right, 0px,auto); - @include rtl(left, auto, 0px); + right: 0px; + left: auto; } &.td-notification-after { - @include rtl(left, 0px,auto); - @include rtl(right, auto, 0px); + left: 0px; + right: auto; } &.td-notification-no-count { &.td-notification-before { @include rtl(right, 8px,auto); - @include rtl(left, auto, 8px); + right: 8px; + left: auto; } &.td-notification-after { - @include rtl(left, 8px,auto); - @include rtl(right, auto, 8px); + left: 8px; + right: auto; } } } From 194c10a4f48741b5a9efd1e24d329e65d107b179 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:43:10 -0800 Subject: [PATCH 12/24] fix(): remove unused code --- .../core/notifications/notification-count.component.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/platform/core/notifications/notification-count.component.scss b/src/platform/core/notifications/notification-count.component.scss index 490401ad98..c18186e19d 100644 --- a/src/platform/core/notifications/notification-count.component.scss +++ b/src/platform/core/notifications/notification-count.component.scss @@ -1,4 +1,3 @@ -@import '../common/styles/mixins'; $td-notification-size: 20px !default; $td-notification-content-size: 40px !default; @@ -72,7 +71,6 @@ $td-notification-content-size: 40px !default; } &.td-notification-no-count { &.td-notification-before { - @include rtl(right, 8px,auto); right: 8px; left: auto; } From 0e9abbe1c00e5d0b6019a148deaa13379ce9469c Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 18:55:07 -0800 Subject: [PATCH 13/24] fix(search): margin for rtl and fallback for ltr --- .../search/search-box/search-box.component.scss | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/platform/core/search/search-box/search-box.component.scss b/src/platform/core/search/search-box/search-box.component.scss index 2b2ec421b1..8821104545 100644 --- a/src/platform/core/search/search-box/search-box.component.scss +++ b/src/platform/core/search/search-box/search-box.component.scss @@ -1,6 +1,13 @@ :host { display: block; } +.td-search-icon { + margin-right: 12px; + /deep/ [dir='rtl'] & { + margin-left: 12px; + margin-right: 0px; + } +} .td-search-box { height: 64px; td-search-input { @@ -9,13 +16,5 @@ visibility: hidden; } } - - [dir='ltr'] & { - margin-left: 12px; - } - [dir='rtl'] & { - margin-right: 12px; - } - } } \ No newline at end of file From 73546bcb41cc456cc6f56bedd2c7ca7ef040ccea Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Thu, 9 Mar 2017 19:16:46 -0800 Subject: [PATCH 14/24] feat(search): change animation depending on rtl/ltr in search input --- .../search-input/search-input.component.html | 2 +- .../search-input/search-input.component.ts | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/platform/core/search/search-input/search-input.component.html b/src/platform/core/search/search-input/search-input.component.html index c6bfcb764c..5d97c7279b 100644 --- a/src/platform/core/search/search-input/search-input.component.html +++ b/src/platform/core/search/search-input/search-input.component.html @@ -11,7 +11,7 @@
\ No newline at end of file diff --git a/src/platform/core/paging/paging-bar.component.ts b/src/platform/core/paging/paging-bar.component.ts index 55ca19a5b1..66218344ff 100644 --- a/src/platform/core/paging/paging-bar.component.ts +++ b/src/platform/core/paging/paging-bar.component.ts @@ -1,4 +1,5 @@ -import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; +import { Component, Input, Output, EventEmitter, OnInit, Optional } from '@angular/core'; +import { Dir } from '@angular/material'; export interface IPageChangeEvent { page: number; @@ -126,6 +127,15 @@ export class TdPagingBarComponent implements OnInit { */ @Output('change') onChange: EventEmitter = new EventEmitter(); + get isRTL(): boolean { + if (this._dir) { + return this._dir.dir === 'rtl'; + } + return false; + } + + constructor(@Optional() private _dir: Dir) {} + ngOnInit(): void { this._page = this.initialPage; this._calculateRows(); From 1cf219763f5ae71d0f7aa57ce6799053e924a7c2 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Fri, 10 Mar 2017 14:56:26 -0800 Subject: [PATCH 24/24] feat(rtl): set dir in root `html` tag --- .../components/components/components.component.html | 2 +- src/app/components/components/components.component.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/components/components/components.component.html b/src/app/components/components/components.component.html index 473be6c2f3..278ff26993 100644 --- a/src/app/components/components/components.component.html +++ b/src/app/components/components/components.component.html @@ -53,7 +53,7 @@

{{item.title}}

more_vert - diff --git a/src/app/components/components/components.component.ts b/src/app/components/components/components.component.ts index a588d6317c..0a27398d6a 100644 --- a/src/app/components/components/components.component.ts +++ b/src/app/components/components/components.component.ts @@ -1,4 +1,5 @@ -import { Component, HostBinding, AfterViewInit } from '@angular/core'; +import { Component, HostBinding, AfterViewInit, ElementRef, Inject, Renderer } from '@angular/core'; +import { DOCUMENT } from '@angular/platform-browser'; import { TdMediaService } from '@covalent/core'; import { fadeAnimation } from '../../app.animations'; @@ -135,10 +136,16 @@ export class ComponentsComponent implements AfterViewInit { title: 'NGX-Translate', }]; - constructor(public media: TdMediaService) {} + constructor(public media: TdMediaService, + private _renderer: Renderer, + @Inject(DOCUMENT) private _document: HTMLElement) {} ngAfterViewInit(): void { // broadcast to all listener observables when loading the page this.media.broadcast(); } + + changeDir(dir: string): void { + this._renderer.setElementAttribute(this._document.querySelector('html'), 'dir', dir); + } }