-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from gjovanovicst/main
Implemented radio-button and radio-group components, cosmetics and ui…
- Loading branch information
Showing
86 changed files
with
3,195 additions
and
1,780 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/angular/projects/anywhere-ui/src/lib/app-initialize.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { NgZone } from '@angular/core'; | ||
import { setupConfig } from '@anywhere-ui/core'; | ||
import { applyPolyfills, defineCustomElements } from '@anywhere-ui/core/loader'; | ||
|
||
import { Config } from './providers/config'; | ||
// import { IonicWindow } from './types/interfaces'; | ||
import { raf } from './util/util'; | ||
|
||
export const appInitialize = (config: Config, doc: Document, zone: NgZone) => { | ||
return (): any => { | ||
// const win: IonicWindow | undefined = doc.defaultView as any; | ||
const win = window; | ||
if (win && typeof (window as any) !== 'undefined') { | ||
setupConfig({ | ||
...config, | ||
_zoneGate: (h: any) => zone.run(h), | ||
}); | ||
|
||
const aelFn = | ||
'__zone_symbol__addEventListener' in (doc.body as any) | ||
? '__zone_symbol__addEventListener' | ||
: 'addEventListener'; | ||
|
||
return applyPolyfills().then(() => { | ||
return defineCustomElements(win, { | ||
// exclude: ['ion-tabs', 'ion-tab'], | ||
syncQueue: true, | ||
raf, | ||
jmp: (h: any) => zone.runOutsideAngular(h), | ||
ael(elm, eventName, cb, opts) { | ||
(elm as any)[aelFn](eventName, cb, opts); | ||
}, | ||
rel(elm, eventName, cb, opts) { | ||
elm.removeEventListener(eventName, cb, opts); | ||
}, | ||
}); | ||
}); | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/angular/projects/anywhere-ui/src/lib/directives/radio-value-accessor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Directive, ElementRef } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
|
||
import { ValueAccessor } from './value-accessor'; | ||
|
||
@Directive({ | ||
/* tslint:disable-next-line:directive-selector */ | ||
selector: 'any-radio-button', | ||
host: { | ||
'(aOnSelect)': 'handleChangeEvent($event.target.checked)' | ||
}, | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: RadioValueAccessor, | ||
multi: true | ||
} | ||
] | ||
}) | ||
export class RadioValueAccessor extends ValueAccessor { | ||
constructor(el: ElementRef) { | ||
super(el); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.