-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react,vue,angular): Overhaul env, improve angular layouts
- Loading branch information
1 parent
405613f
commit 78202a4
Showing
22 changed files
with
221 additions
and
98 deletions.
There are no files selected for viewing
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
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
18 changes: 18 additions & 0 deletions
18
packages/create-angular/src/app/components/card-collapsible.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,18 @@ | ||
import { booleanAttribute, Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-card-collapsible', | ||
standalone: true, | ||
template: ` | ||
<details class="card" [open]="open"> | ||
<summary class="card-summary"> | ||
<span class="body1 card-summary-title">{{ title }}</span> | ||
</summary> | ||
<div class="card-content"><ng-content /></div> | ||
</details> | ||
`, | ||
}) | ||
export class CardCollapsibleComponent { | ||
@Input({ required: true }) title = ''; | ||
@Input({ transform: booleanAttribute }) open = true; | ||
} |
24 changes: 5 additions & 19 deletions
24
packages/create-angular/src/app/components/card.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 |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
import { booleanAttribute, Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-card', | ||
standalone: true, | ||
imports: [], | ||
template: ` | ||
@if (title) { | ||
<section class="card"> | ||
<div class="card-content"><ng-content /></div> | ||
</section> | ||
} @else { | ||
<details class="card" [open]="open"> | ||
<summary class="card-summary"> | ||
<span class="body1 card-summary-title">{{ title }}</span> | ||
</summary> | ||
<div class="card-content"><ng-content /></div> | ||
</details> | ||
} | ||
<section class="card"> | ||
<div class="card-content"><ng-content /></div> | ||
</section> | ||
`, | ||
}) | ||
export class CardComponent { | ||
public title?: string; | ||
public className = ''; | ||
public open = true; | ||
} | ||
export class CardComponent {} |
41 changes: 34 additions & 7 deletions
41
packages/create-angular/src/app/components/layers.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 |
---|---|---|
@@ -1,15 +1,42 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { Layer } from '@deck.gl/core'; | ||
import { CardComponent } from './card.component'; | ||
import { CardCollapsibleComponent } from './card-collapsible.component'; | ||
|
||
/** | ||
* Layer list and visibility controller. | ||
*/ | ||
@Component({ | ||
selector: 'app-layers', | ||
standalone: true, | ||
imports: [], | ||
imports: [CardCollapsibleComponent], | ||
template: ` | ||
<p> | ||
layers works! | ||
</p> | ||
` | ||
<aside class="layers"> | ||
<app-card-collapsible title="Layers" [open]="open"> | ||
TODO:LayersComponent | ||
<!--<label v-for="layer in layers" class="body2" :key="layer.id"> | ||
<input | ||
type="checkbox" | ||
:checked="layer.props.visible" | ||
@input=" | ||
({ target }) => | ||
setVisibility(layer.id, (target as HTMLInputElement).checked) | ||
" | ||
/>{{ layer.id }} | ||
</label>--> | ||
</app-card-collapsible> | ||
</aside> | ||
`, | ||
}) | ||
export class LayersComponent { | ||
|
||
/** Whether the layer list is open (default) or closed. */ | ||
@Input() open = true; | ||
/** List of deck.gl layers. */ | ||
@Input() layers: Layer[] = []; | ||
/** Layer visibility state. Object keys are layer names, values are boolean visibility. */ | ||
@Input() layerVisibility: Record<string, boolean> = {}; | ||
/** Callback to be invoked by the Layers component if a layer's visibility is toggled. */ | ||
@Output() layerVisibilityChanged = new EventEmitter< | ||
Record<string, boolean> | ||
>(); | ||
} |
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
12 changes: 12 additions & 0 deletions
12
packages/create-angular/src/environments/environment.development.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,12 @@ | ||
// TODO: In a newly-created project, this will override the correct injected | ||
// value from environment.ts, for only the Angular apps... need a way around. | ||
export const environment = { | ||
APP_TITLE: 'Angular template', | ||
ACCESS_TOKEN: | ||
'eyJhbGciOiJIUzI1NiJ9.eyJhIjoiYWNfNDd1dW5tZWciLCJqdGkiOiJhZjRlM2QxMSJ9.e1GDIOtg3Jy2zcwbFpAxsvK38RqycRrWII1NVTH7KtQ', | ||
|
||
AUTH_ENABLED: false, | ||
AUTH_CLIENT_ID: 'Rsco0zdjNo3S2DoOAfOWLr6FfrtsHQKT', | ||
AUTH_ORGANIZATION_ID: '', | ||
AUTH_DOMAIN: 'auth.carto.com', | ||
}; |
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,10 @@ | ||
export const environment = { | ||
APP_TITLE: '$title', | ||
ACCESS_TOKEN: '$accessToken', | ||
|
||
// @ts-expect-error Replaced in template setup. | ||
AUTH_ENABLED: '$authEnabled' === 'true', | ||
AUTH_CLIENT_ID: '$authClientID', | ||
AUTH_ORGANIZATION_ID: '$authOrganizationID', | ||
AUTH_DOMAIN: '$authDomain', | ||
}; |
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 |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
<title>$title</title> | ||
</head> | ||
<body> | ||
<app-root id="root"></app-root> | ||
<app-root></app-root> | ||
</body> | ||
</html> |
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
Oops, something went wrong.