![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@e-square/bdir
Advanced tools
A bidirectional support lib for angular
npm install @e-square/bdir
yarn add @e-square/bdir
Import the BDirModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BDirModule } from '@e-square/bdir';
@NgModule({
imports: [
BrowserModule,
BDirModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
Add bdir
directive In the application wrapper:
<div id="app-wrapper" bdir>
<h1>
Welcome to {{ title }}!
</h1>
<router-outlet></router-outlet>
</div>
Start using scss mixins
:
@import "~@e-square/bdir/styles/mixins";
h1 {
color: darkslategray;
@include padding-start(20px);
}
Now the h1
element will transpile to:
h1 {
color: darkslategray;
}
*[dir=ltr] h1 {
padding-right: 20px; }
*[dir=rtl] h1 {
padding-left: 20px; }
The service and directive implements Angular CDK's Directionality class and uses its API.
*setLang(lang: Lang)
- Setting the current language which will determine the direction value
*setDir(dir: Direction)
- Set the current direction value.
*getDir$(): Observable<Direction>
- Get the current direction value as observable.
*setLang(lang: Lang)
- Get the opposite direction value as observable.
bdir: 'start' | 'end'
- Will set a dir
attribute to the hosting element with rtl | ltr
value accordingly start
, is the default value.
<element bdir="start"></element>
<!-- Can also be written as -->
<element bdir></element>
RTL_LANGUAGES
- Define which language will consider as rtl
languages, default value: ['he', 'ar', 'hy', 'dv', 'ff', 'ku', 'fa']
.
DEFAULT_LANG
- Define the default language, default value: 'en'
All
mixins
were written following to thecss
syntax, simply change left & right with start & end.
Also the
mixins
were developed in a way that the transpiled code will be as minimal as possible.
*$encapsulation
property used for inner components to be affected by their host's direction by using angular's :host-context
padding-start($value, $encapsulation: true)
padding-end($value, $encapsulation: true)
margin-start($value, $encapsulation: true)
margin-end($value, $encapsulation: true)
border-start($value, $encapsulation: true)
border-end($value, $encapsulation: true)
float($start: true, $encapsulation: true)
dir($start: true, $encapsulation: true)
start($value, $encapsulation: true)
end($value, $encapsulation: true)
transformTranslate($x, $y: 0, $encapsulation: true)
transformScale($x, $y: 1, $encapsulation: true)
mirror($encapsulation: true)
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
A bidirectional support library for angular
The npm package @e-square/bdir receives a total of 16 weekly downloads. As such, @e-square/bdir popularity was classified as not popular.
We found that @e-square/bdir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.