|
| 1 | +import { Component, inject, NO_ERRORS_SCHEMA } from '@angular/core'; |
| 2 | +import { NativeScriptCommonModule } from '@nativescript/angular'; |
| 3 | +import { SplitViewState } from './split-view.state'; |
| 4 | + |
| 5 | +@Component({ |
| 6 | + selector: 'ns-split-view-secondary', |
| 7 | + template: ` |
| 8 | + <GridLayout rows="*" class="h-full bg-white dark:bg-slate-950"> |
| 9 | + <ScrollView> |
| 10 | + <StackLayout class="p-5"> |
| 11 | + <GridLayout columns="*,*" class="mb-4" columnGap="12"> |
| 12 | + <StackLayout |
| 13 | + col="0" |
| 14 | + class="rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900 p-4 mr-1" |
| 15 | + > |
| 16 | + <Label text="Active" class="text-xs font-semibold text-slate-500 dark:text-slate-400"></Label> |
| 17 | + <Label text="12" class="mt-1 text-3xl font-semibold text-slate-900 dark:text-slate-100"></Label> |
| 18 | + <Label text="items" class="text-xs text-slate-500 dark:text-slate-400"></Label> |
| 19 | + </StackLayout> |
| 20 | + <StackLayout |
| 21 | + col="1" |
| 22 | + class="rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900 p-4 ml-1" |
| 23 | + > |
| 24 | + <Label text="Updated" class="text-xs font-semibold text-slate-500 dark:text-slate-400"></Label> |
| 25 | + <Label text="2m" class="mt-1 text-3xl font-semibold text-slate-900 dark:text-slate-100"></Label> |
| 26 | + <Label text="ago" class="text-xs text-slate-500 dark:text-slate-400"></Label> |
| 27 | + </StackLayout> |
| 28 | + </GridLayout> |
| 29 | +
|
| 30 | + <StackLayout class="rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 p-4"> |
| 31 | + <Label text="Summary" class="text-base font-semibold text-slate-900 dark:text-slate-100"></Label> |
| 32 | + <Label |
| 33 | + text="This column is ideal for the main content. Put your routed page content here." |
| 34 | + class="mt-2 text-sm text-slate-700 dark:text-slate-200 leading-[3]" |
| 35 | + textWrap="true" |
| 36 | + ></Label> |
| 37 | +
|
| 38 | + <GridLayout rows="auto,auto,auto" columns="*,auto" class="mt-4" rowGap="10"> |
| 39 | + <Label row="0" col="0" text="Status" class="text-sm text-slate-500 dark:text-slate-400"></Label> |
| 40 | + <Label |
| 41 | + row="0" |
| 42 | + col="1" |
| 43 | + text="Ready" |
| 44 | + class="text-sm font-semibold text-slate-900 dark:text-slate-100" |
| 45 | + ></Label> |
| 46 | +
|
| 47 | + <Label row="1" col="0" text="Owner" class="text-sm text-slate-500 dark:text-slate-400"></Label> |
| 48 | + <Label |
| 49 | + row="1" |
| 50 | + col="1" |
| 51 | + text="Demo" |
| 52 | + class="text-sm font-semibold text-slate-900 dark:text-slate-100" |
| 53 | + ></Label> |
| 54 | +
|
| 55 | + <Label row="2" col="0" text="Mode" class="text-sm text-slate-500 dark:text-slate-400"></Label> |
| 56 | + <Label |
| 57 | + row="2" |
| 58 | + col="1" |
| 59 | + text="Two-beside" |
| 60 | + class="text-sm font-semibold text-slate-900 dark:text-slate-100" |
| 61 | + ></Label> |
| 62 | + </GridLayout> |
| 63 | + </StackLayout> |
| 64 | +
|
| 65 | + <StackLayout |
| 66 | + class="mt-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900 p-4" |
| 67 | + > |
| 68 | + <Label text="Next" class="text-xs font-semibold text-slate-500 dark:text-slate-400"></Label> |
| 69 | + <Label |
| 70 | + text="Add your real detail view here (lists, charts, forms)." |
| 71 | + class="mt-1 text-sm text-slate-700 dark:text-slate-200" |
| 72 | + textWrap="true" |
| 73 | + ></Label> |
| 74 | + </StackLayout> |
| 75 | +
|
| 76 | + @if (!splitViewState.inspectorVisible()) { |
| 77 | + <StackLayout |
| 78 | + class="mt-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900 p-4" |
| 79 | + (tap)="splitViewState.setInspectorVisible(true)" |
| 80 | + > |
| 81 | + <Label text="Open Inspector" class="text-xs font-semibold text-slate-500 dark:text-slate-400"></Label> |
| 82 | + <Label |
| 83 | + text="You can open the Inspector to adjust properties." |
| 84 | + class="mt-1 text-sm text-slate-700 dark:text-slate-200" |
| 85 | + textWrap="true" |
| 86 | + ></Label> |
| 87 | + </StackLayout> |
| 88 | + } |
| 89 | + </StackLayout> |
| 90 | + </ScrollView> |
| 91 | + </GridLayout> |
| 92 | + `, |
| 93 | + imports: [NativeScriptCommonModule], |
| 94 | + schemas: [NO_ERRORS_SCHEMA], |
| 95 | +}) |
| 96 | +export class SplitViewSecondaryComponent { |
| 97 | + splitViewState = inject(SplitViewState); |
| 98 | +} |
0 commit comments