-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Proposed change https://fpaul-1a.github.io/otter/#/sdk Also, fixes #907 ![image](https://github.com/AmadeusITGroup/otter/assets/110407799/23a3a962-c7f0-4e56-a823-b9585d2764dc) ![image](https://github.com/AmadeusITGroup/otter/assets/110407799/a9829083-0736-47e4-bf1f-aa7182b5259e) ## Related issues - 🐛 Fixes #(issue) - 🚀 Feature #(issue) <!-- Please make sure to follow the contributing guidelines on https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md -->
- Loading branch information
Showing
44 changed files
with
398 additions
and
85 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
12 changes: 10 additions & 2 deletions
12
apps/showcase/src/components/showcase/sdk/sdk-pres.style.scss
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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
o3r-sdk-pres { | ||
.table-container { | ||
min-height: 33rem; | ||
.table-container { | ||
min-height: 41rem; | ||
} | ||
|
||
.table-column-photo, .table-column-actions { | ||
width: 2em; | ||
} | ||
|
||
.scroll-container { | ||
width: 100%; | ||
overflow-x: auto; | ||
} | ||
|
||
td, th { | ||
vertical-align: middle; | ||
} | ||
} |
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
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
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,2 @@ | ||
export * from './otter-picker-pres.component'; | ||
|
100 changes: 100 additions & 0 deletions
100
apps/showcase/src/components/utilities/otter-picker/otter-picker-pres.component.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,100 @@ | ||
import { ChangeDetectionStrategy, Component, forwardRef, Input, signal, ViewEncapsulation } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; | ||
import { O3rComponent } from '@o3r/core'; | ||
|
||
@O3rComponent({ componentType: 'Component' }) | ||
@Component({ | ||
selector: 'o3r-otter-picker-pres', | ||
standalone: true, | ||
imports: [CommonModule, NgbDropdownModule], | ||
templateUrl: './otter-picker-pres.template.html', | ||
styleUrls: ['./otter-picker-pres.style.scss'], | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => OtterPickerPresComponent), | ||
multi: true | ||
} | ||
], | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class OtterPickerPresComponent implements ControlValueAccessor { | ||
/** ID of the html element used for selection */ | ||
@Input() | ||
public id!: string; | ||
|
||
/** Currently selected otter */ | ||
public selectedOtter = signal(''); | ||
|
||
/** List of available otters */ | ||
public otters = [ | ||
'/assets/otter.svg', | ||
'/assets/mini-otters/astronotter.svg', | ||
'/assets/mini-otters/bonotter.svg', | ||
'/assets/mini-otters/c3potter.svg', | ||
'/assets/mini-otters/colombotter.svg', | ||
'/assets/mini-otters/djokotter.svg', | ||
'/assets/mini-otters/hallowtter.svg', | ||
'/assets/mini-otters/harry-otter.svg', | ||
'/assets/mini-otters/jack-sparrowtter.svg', | ||
'/assets/mini-otters/mandalotter.svg', | ||
'/assets/mini-otters/mariotter.svg', | ||
'/assets/mini-otters/neotter.svg', | ||
'/assets/mini-otters/pizzaiotter.svg', | ||
'/assets/mini-otters/ronaldotter.svg', | ||
'/assets/mini-otters/sombrerotter.svg' | ||
]; | ||
|
||
/** Base URL where the images can be fetched */ | ||
public baseUrl = location.href.split('/#', 1)[0]; | ||
|
||
private onChanges!: (val: string) => void; | ||
private onTouched!: () => void; | ||
private isDisabled = signal(false); | ||
|
||
/** | ||
* Select an otter and notify the parent | ||
* @param otter | ||
*/ | ||
public selectOtter(otter: string) { | ||
this.selectedOtter.set(otter); | ||
this.onChanges(otter); | ||
this.onTouched(); | ||
} | ||
|
||
/** | ||
* Implements ControlValueAccessor | ||
* @param fn | ||
*/ | ||
public registerOnChange(fn: any): void { | ||
this.onChanges = fn; | ||
} | ||
|
||
/** | ||
* Implements ControlValueAccessor | ||
* @param fn | ||
*/ | ||
public registerOnTouched(fn: any): void { | ||
this.onTouched = fn; | ||
} | ||
|
||
/** | ||
* Implements ControlValueAccessor | ||
* @param isDisabled | ||
*/ | ||
public setDisabledState(isDisabled: boolean): void { | ||
this.isDisabled.set(isDisabled); | ||
} | ||
|
||
/** | ||
* Implements ControlValueAccessor | ||
* @param obj | ||
*/ | ||
public writeValue(obj: any): void { | ||
this.selectedOtter.set(obj); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
apps/showcase/src/components/utilities/otter-picker/otter-picker-pres.spec.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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { OtterPickerPresComponent } from './otter-picker-pres.component'; | ||
|
||
describe('OtterPickerPresComponent', () => { | ||
let component: OtterPickerPresComponent; | ||
let fixture: ComponentFixture<OtterPickerPresComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [OtterPickerPresComponent] | ||
}); | ||
fixture = TestBed.createComponent(OtterPickerPresComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
apps/showcase/src/components/utilities/otter-picker/otter-picker-pres.style.scss
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 @@ | ||
o3r-otter-picker-pres { | ||
.dropdown-menu { | ||
flex-wrap: wrap; | ||
justify-content: space-around; | ||
|
||
&.show { | ||
display: flex; | ||
} | ||
|
||
.dropdown-item { | ||
display: inline-block; | ||
width: auto; | ||
} | ||
} | ||
|
||
.otter-dropdown { | ||
min-width: 9em; | ||
|
||
&.selected { | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
apps/showcase/src/components/utilities/otter-picker/otter-picker-pres.template.html
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,12 @@ | ||
<div ngbDropdown class="d-inline-block w-100"> | ||
<button type="button" class="btn btn-outline-primary otter-dropdown w-100" [class.selected]="!!selectedOtter()" [id]="id" ngbDropdownToggle> | ||
<div class="w-100" *ngIf="selectedOtter()"><img [src]="baseUrl+selectedOtter()" width="34" height="34" /></div> | ||
<span *ngIf="!selectedOtter()">Pick an icon</span> | ||
</button> | ||
<div ngbDropdownMenu [attr.aria-labelledby]="id"> | ||
<button ngbDropdownItem (click)="selectOtter('')">None</button> | ||
<button ngbDropdownItem *ngFor="let otter of otters" (click)="selectOtter(otter)"> | ||
<img [src]="baseUrl+otter" width="45" height="45" /> | ||
</button> | ||
</div> | ||
</div> |
1 change: 0 additions & 1 deletion
1
apps/showcase/src/components/utilities/scroll-back-top/README.md
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './clients/index'; | ||
export * from './fwk/index'; | ||
export * from './plugins/index'; | ||
export * from './utils/index'; |
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,5 @@ | ||
export * from './crypto'; | ||
export * from './encoder'; | ||
export * from './ie11'; | ||
export * from './json-token'; | ||
export * from './mime-types'; |
Oops, something went wrong.