* begin subnav implementation

* implement subnav AND angular forms for comparison

* unions working-ish, list of enums working

* new form approach almost complete

* finish new forms approach for action inputs and config

* expandable list items and handlebars display

* Config animation (#394)

* config cammel

* config animation

Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>

* improve server settings inputs, still needs work

* delete all notifications, styling, and bugs

* contracted by default

Co-authored-by: Drew Ansbacher <drew.ansbacher@gmail.com>
Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>
This commit is contained in:
Matt Hill
2021-08-06 09:25:20 -06:00
committed by Aiden McClelland
parent a43ff976a2
commit 5741cf084f
117 changed files with 1967 additions and 1271 deletions

View File

@@ -0,0 +1,33 @@
import { Inject, Injectable, InjectionToken } from '@angular/core'
import { IonNav } from '@ionic/angular'
import { AppConfigComponentMapping } from '../modals/app-config-injectable'
import { ConfigCursor } from '../pkg-config/config-cursor'
export const APP_CONFIG_COMPONENT_MAPPING = new InjectionToken<string>('APP_CONFIG_COMPONENTS')
@Injectable({
providedIn: 'root',
})
export class SubNavService {
path: string[]
constructor (
@Inject(APP_CONFIG_COMPONENT_MAPPING) private readonly appConfigComponentMapping: AppConfigComponentMapping,
) { }
async push (key: string, cursor: ConfigCursor<any>, nav: IonNav) {
const component = this.appConfigComponentMapping[cursor.spec().type]
this.path.push(key)
nav.push(component, { cursor }, { mode: 'ios' })
}
async pop (nav: IonNav) {
this.path.pop()
nav.pop({ mode: 'ios' })
}
async popTo (index: number, nav: IonNav) {
this.path = this.path.slice(0, index + 1)
nav.popTo(index, { mode: 'ios' })
}
}