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

Support RTL language issues: 80 , 1284 #1312

Closed
wants to merge 46 commits into from
Closed

Support RTL language issues: 80 , 1284 #1312

wants to merge 46 commits into from

Conversation

omriLugasi
Copy link

Add support RTL language in the components below:

1.md-bottom-bar-item
2.md-card-actions
3.md-auto-complete
4.md-datepicker
5.md-dialog-alert
6.md-dialog-confirm
7.md-dialog-prompt
8.md-checkbox
9.md-chip

This commit will be "Stage One" in supporting rtl languages;
Next pull request will support rtl languages in the components below:

  1. All input components
  2. List
  3. Menu
  4. Snackbar
  5. Tabs
  6. Tooltip

this pull request fix part of the problem at issue number : 80, and fix issue number 1284

omriLugasi and others added 8 commits December 16, 2017 15:27
1.md-bottom-bar-item
2.md-card-actions
3.md-auto-complete
4.md-datepicker
5.md-dialog-alert
6.md-dialog-confirm
7.md-dialog-prompt
8.md-checkbox
9.md-chip

This commit will be "Stage One" in supporting rtl languages;
Next pull request will support rtl languages in the components below:

1. All input components
2. List
3. Menu
4. Snackbar
5. Tabs
6. Tooltip
1.md-bottom-bar-item
2.md-card-actions
3.md-auto-complete
4.md-datepicker
5.md-dialog-alert
6.md-dialog-confirm
7.md-dialog-prompt
8.md-checkbox
9.md-chip

This commit will be "Stage One" in supporting rtl languages;
Next pull request will support rtl languages in the components below:

1. All input components
2. List
3. Menu
4. Snackbar
5. Tabs
6. Tooltip
fix vue-template-compiler version for travis issues
@omriLugasi
Copy link
Author

omriLugasi commented Dec 17, 2017

@Samuell1

Travis issue

src/components/MdField/MdField.test.js

  ● Test suite failed to run

    Vue packages version mismatch:  

    - vue@2.5.11

    - vue-template-compiler@2.5.9

    

    This may cause things to work incorrectly. Make sure to use the same version for both.

    If you are using vue-loader@>=10.0, simply update vue-template-compiler.

    If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

Please update " vue-template-compiler" version to 2.5.11

@Samuell1
Copy link
Member

@marcosmoura can you look at that dependency?

@omriLugasi i think better will be some global variable to enable RTL, then adding prop to all components, what you think?

@VdustR
Copy link
Member

VdustR commented Dec 18, 2017

about Vue packages version mismatch,
fixed in #1306

You could install vue@2.5.9 manually temporarily.

Sorry, I didn't see that's travis reporting. Please ignore me.

@omriLugasi
Copy link
Author

@Samuell1 Sure i can do it;
My idea was to let the user the option to write application with 2 options RTL and LTR, but i don't care to change it to global variable.

I'll change the flow to global variable :)

…, in the install function.

Then The library will create the components with a rtl support design.
…, in the install function.

Then The library will create the components with a rtl support design.

Quick fix for Codeclimate
@omriLugasi
Copy link
Author

@Samuell1

Ok 👍 :) Global configuration will be add by passing an object options to the vueMaterial Instace

const options = {
  mdRtl: true
}

Vue.use(VueMaterial , options);

Samuell1 and others added 8 commits December 18, 2017 23:10
* feat(MdCard): remove z-index to prevent card overlap FAB

* fix(MdSelect): fix select content under dialog

* refactor(MdSelect): change order of scss

* docs: remove z-index from main-nav (#1134)

* Revert "feat(MdCard): remove z-index to prevent card overlap FAB"

This reverts commit 9e12806.

* feat(MdButton): add fab z-index to prevent overlap
* feat(MdDatepicker): override browser native pickers

* docs(MdDatepicker): add md-override-native prop

* docs(MdDatepicker): remove note about firefox

* refactor(MdDatepicker): remove nested statement
check whether clicked target is contained in menu content element within `bodyClickObserver`

fix #1279
* feat(MdChips): feedback for duplicated chip

add `md-duplicated` class which has the same style as `md-accent`. add
`md-check-duplicated-on-change` props.

fix #1212

* fix(MdChips): change api `mdCheckDuplicatedOnChange` to `mdAlwaysCheckDuplicated`

* fix(MdChips): change for loop key from `key` to `chip` to prevent triggering animate while removing

* docs(MdChips): example and new props for duplicated chip checking

fix #1212

* fix(MdChips): always clear `duplicatedChip` on change

* style(MdChips): fix style to pass scss-lint

* fix(MdChips): rename prop

* fix(MdChips): rename prop

* fix(MdChips): rename prop

* fix(MdChips): rename prop

* style(MdChips): adjust code style
* Fix error to sort by attribute of child object

* Fix attribute name

* Remove blank lines

* refactor(MdTable): cache attributes
@marcosmoura
Copy link
Member

I don't think it's a good idea to have an option to configure the content direction.
I think the best and clever way to do it is to hook the styles based on [dir="rtl"] html attribute. It will be safer and complaint with HTML5 specs.

@marcosmoura
Copy link
Member

I think that a PR per component would be better. It will be really hard to track which components have been upgraded.

@marcosmoura
Copy link
Member

c.c @omriLugasi

upgrade vue-template-compiler in yarn.lock to resolve vue packages version mismatch
@omriLugasi
Copy link
Author

@marcosmoura
@Samuell1

Did you mean something like:

<md-dialog-alert
      :md-active.sync="second"
      md-title="Post created!"
      md-content="Your post <strong>Material Design is awesome</strong> has been created."
      dir="rtl"
 />

And in the md-dialog component under style section to do :

.md-dialog{
  ...
  &[dir="rtl"]{
     text-align: right;
  }
}

@omriLugasi
Copy link
Author

Still waiting for your answer....

@marcosmoura

@Samuell1

@marcosmoura
Copy link
Member

marcosmoura commented Dec 22, 2017

No. dir="rtl" inside the HTML tag:

<html dir="rtl"> ... </html>

This is the default standard.

mrwhy-orig and others added 17 commits December 22, 2017 19:47
…1323)

* Update layout.scss with large and xlarge props

* Added md-gutter-xlarge variable

* Removed Trailing white spaces

* fix: change gutter for large size
let developers choose what to show from outside

fix #1327
`<a>` attributes `download`, `hreflang`, `ping`, `rel`, `type` supported

fix #1320
* fix(MdSelect): make options in disabled groups un-selectable

fix #1286

* fix(MdSelect): make multiple selection checkboxes effective

* style(MdOption): remove empty lines
…irectly (#1285)

* (Fix #1261) Don't emit input directly in MdInput and MdTextarea

* use spread operator (+babel) instead of Object.assign for browser compatiblity
* fix(icons): fix components' name

* fix(docs): fix components' name
…1345)

* docs(componentExampleLoader): replace `vue-template-es2015-compiler` with `babel`

using babel to compile javascript in examples

fix #1337

* refactor(componentExampleLoader): replace `path.join` with `resolvePath`
* fix(MdTable): multiple selection with table sorting

an easy way to handle multiple selection

fix #1348

* refactor(MdTable): single selection using instance comparing instead of id comparing

both `MdTable` and `MdTableRow` emit `md-selected` event to avoid breaking change

* feat(MdTable): new props `:md-selected-value.sync` for reactive selection

fix #1292

* fix(MdTable): `syncSelectedValue` without `mdSelectedValue` in multiple selecting mode

* fix(MdTableHeadSelection): fix `allSelected`, now disabled row could be tick from `md-selected-value

* fix(MdTableRow): remove `md-selected` event

too many duplicated events on a selection. It should be emit from `MdTable`

BREAKING CHANGE: no more `md-selected` event from `MdTableRow`

* fix(MdTable): select event should be triggered after select update event

* fix(MdTableHeadSelection): select all only take effect on selectable items
@marcosmoura
Copy link
Member

@omriLugasi Any news on that? :)

@omriLugasi
Copy link
Author

@marcosmoura

There is an issue with this rule

Avoid qualifying attribute selectors with an element
html[dir='rtl']

in the codeclimate....

Anyway I committed our first support in the md-filed icons and labels.

Please tell if you like it, and i can keep going with this line of structure...

@Samuell1
Copy link
Member

I think this PR should be closed and opened new after components are more stable. And there are many commits that only removing, moving code and that can make many conflicts in codebase.

Maybe RTL support should be in separate files (Like rtl.scss in every component folder) or as package? What you think? @marcosmoura @omriLugasi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants