@anton-gustafsson/snapshot-angular 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,7 +19,7 @@ import { snapshotService } from '@anton-gustafsson/snapshot-core';
|
|
|
19
19
|
class SnapshotNavListComponent {
|
|
20
20
|
items = [];
|
|
21
21
|
variant = 'icon-only';
|
|
22
|
-
overlayTint = '
|
|
22
|
+
overlayTint = 'none';
|
|
23
23
|
overlayOpacity = 0.35;
|
|
24
24
|
overlayBlur = 0;
|
|
25
25
|
/** 'bottom' is the caption strip (default); 'center' centers a larger title (icon-only variant only). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anton-gustafsson-snapshot-angular.mjs","sources":["../../src/snapshot-nav-list.component.ts","../../src/anton-gustafsson-snapshot-angular.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n CUSTOM_ELEMENTS_SCHEMA,\n type AfterViewInit,\n type OnChanges,\n type SimpleChanges,\n} from '@angular/core';\nimport '@anton-gustafsson/snapshot-core';\nimport { snapshotService as defaultSnapshotService } from '@anton-gustafsson/snapshot-core';\nimport type { NavItem, SnapshotNavList, SnapshotNavListVariant, SnapshotService } from '@anton-gustafsson/snapshot-core';\n\n/**\n * Thin Angular wrapper around <snapshot-nav-list>. Keeps CUSTOM_ELEMENTS_SCHEMA\n * contained here instead of leaking it into consuming app modules.\n *\n * `snapshotService` is bound as a real DOM property (objects can't cross an\n * HTML attribute); the rest are plain string/number values forwarded as\n * attributes for the Lit element's own attribute converters to parse.\n *\n * `items` is set by hand (ngOnChanges + ngAfterViewInit) instead of a\n * template binding: Angular's property binding only propagates when the\n * array *reference* changes. That's the correct, zoneless-safe behavior —\n * pass a new array when `items` changes rather than mutating in place\n * (`.push()`), since nothing here polls for in-place mutations.\n */\n@Component({\n selector: 'ngx-snapshot-nav-list',\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<snapshot-nav-list\n #el\n [snapshotService]=\"snapshotService\"\n [attr.variant]=\"variant\"\n [attr.overlay-tint]=\"overlayTint\"\n [attr.overlay-opacity]=\"overlayOpacity\"\n [attr.overlay-blur]=\"overlayBlur\"\n [attr.label-position]=\"labelPosition\"\n [attr.editable]=\"editable ? '' : null\"\n (nav-select)=\"onNavSelect($event)\"\n (nav-edit)=\"onNavEdit($event)\"\n ></snapshot-nav-list>`,\n})\nexport class SnapshotNavListComponent implements OnChanges, AfterViewInit {\n @Input() items: NavItem[] = [];\n @Input() variant: SnapshotNavListVariant = 'icon-only';\n @Input() overlayTint: 'dark' | 'light' | 'none' = '
|
|
1
|
+
{"version":3,"file":"anton-gustafsson-snapshot-angular.mjs","sources":["../../src/snapshot-nav-list.component.ts","../../src/anton-gustafsson-snapshot-angular.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n CUSTOM_ELEMENTS_SCHEMA,\n type AfterViewInit,\n type OnChanges,\n type SimpleChanges,\n} from '@angular/core';\nimport '@anton-gustafsson/snapshot-core';\nimport { snapshotService as defaultSnapshotService } from '@anton-gustafsson/snapshot-core';\nimport type { NavItem, SnapshotNavList, SnapshotNavListVariant, SnapshotService } from '@anton-gustafsson/snapshot-core';\n\n/**\n * Thin Angular wrapper around <snapshot-nav-list>. Keeps CUSTOM_ELEMENTS_SCHEMA\n * contained here instead of leaking it into consuming app modules.\n *\n * `snapshotService` is bound as a real DOM property (objects can't cross an\n * HTML attribute); the rest are plain string/number values forwarded as\n * attributes for the Lit element's own attribute converters to parse.\n *\n * `items` is set by hand (ngOnChanges + ngAfterViewInit) instead of a\n * template binding: Angular's property binding only propagates when the\n * array *reference* changes. That's the correct, zoneless-safe behavior —\n * pass a new array when `items` changes rather than mutating in place\n * (`.push()`), since nothing here polls for in-place mutations.\n */\n@Component({\n selector: 'ngx-snapshot-nav-list',\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<snapshot-nav-list\n #el\n [snapshotService]=\"snapshotService\"\n [attr.variant]=\"variant\"\n [attr.overlay-tint]=\"overlayTint\"\n [attr.overlay-opacity]=\"overlayOpacity\"\n [attr.overlay-blur]=\"overlayBlur\"\n [attr.label-position]=\"labelPosition\"\n [attr.editable]=\"editable ? '' : null\"\n (nav-select)=\"onNavSelect($event)\"\n (nav-edit)=\"onNavEdit($event)\"\n ></snapshot-nav-list>`,\n})\nexport class SnapshotNavListComponent implements OnChanges, AfterViewInit {\n @Input() items: NavItem[] = [];\n @Input() variant: SnapshotNavListVariant = 'icon-only';\n @Input() overlayTint: 'dark' | 'light' | 'none' = 'none';\n @Input() overlayOpacity = 0.35;\n @Input() overlayBlur = 0;\n /** 'bottom' is the caption strip (default); 'center' centers a larger title (icon-only variant only). */\n @Input() labelPosition: 'bottom' | 'center' = 'bottom';\n /** Defaults to the shared singleton — pass your own instance (e.g. a namespaced or custom-storage SnapshotService) if needed. */\n @Input() snapshotService: SnapshotService = defaultSnapshotService;\n /** Shows a top-right edit button per card. Off by default — clicking it fires `edit` instead of `select`; the consuming app decides what \"edit\" means (e.g. open its own dialog component). */\n @Input() editable = false;\n @Output() select = new EventEmitter<{ id: string; route?: string }>();\n @Output() edit = new EventEmitter<{ id: string; route?: string }>();\n\n @ViewChild('el') private elRef!: ElementRef<SnapshotNavList>;\n\n ngOnChanges(changes: SimpleChanges) {\n // Guard: ngOnChanges fires before the view (and @ViewChild) exists on the first pass.\n if (changes['items'] && this.elRef) this.elRef.nativeElement.items = [...this.items];\n }\n\n ngAfterViewInit() {\n this.elRef.nativeElement.items = [...this.items];\n }\n\n onNavSelect(event: Event) {\n this.select.emit((event as CustomEvent<{ id: string; route?: string }>).detail);\n }\n\n onNavEdit(event: Event) {\n this.edit.emit((event as CustomEvent<{ id: string; route?: string }>).detail);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["defaultSnapshotService"],"mappings":";;;;AAgBA;;;;;;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OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,aAAA,EAAA,eAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,IAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAbzB,CAAA;;;;;;;;;;;AAWY,uBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEX,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAhBpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;oBACjC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;AAWY,uBAAA,CAAA;AACvB,iBAAA;;sBAEE;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBAEA;;sBAEA;;sBACA;;sBACA;;sBAEA,SAAS;uBAAC,IAAI;;;AC7DjB;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anton-gustafsson/snapshot-angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Thin Angular wrapper around <snapshot-nav-list> from @anton-gustafsson/snapshot-core.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@angular/core": ">=17"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@anton-gustafsson/snapshot-core": "^0.0.
|
|
19
|
+
"@anton-gustafsson/snapshot-core": "^0.0.5",
|
|
20
20
|
"tslib": "^2.3.0"
|
|
21
21
|
},
|
|
22
22
|
"module": "fesm2022/anton-gustafsson-snapshot-angular.mjs",
|