@ojiepermana/angular 0.1.1 → 21.0.0

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.
Files changed (92) hide show
  1. package/README.md +41 -249
  2. package/fesm2022/ojiepermana-angular-chart.mjs +3714 -0
  3. package/fesm2022/ojiepermana-angular-chart.mjs.map +1 -0
  4. package/fesm2022/ojiepermana-angular-component.mjs +3463 -0
  5. package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
  6. package/fesm2022/ojiepermana-angular-layout.mjs +276 -408
  7. package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
  8. package/fesm2022/ojiepermana-angular-navigation.mjs +2198 -404
  9. package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -1
  10. package/fesm2022/ojiepermana-angular-theme.mjs +381 -1
  11. package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -1
  12. package/fesm2022/ojiepermana-angular.mjs +15 -1
  13. package/fesm2022/ojiepermana-angular.mjs.map +1 -1
  14. package/package.json +49 -36
  15. package/theme/styles/etos.css +38 -0
  16. package/theme/styles/index.css +32 -8
  17. package/theme/styles/themes/brand/etos/color.css +21 -0
  18. package/theme/styles/themes/brand/etos/style.css +50 -0
  19. package/theme/styles/themes/library/_components.css +63 -0
  20. package/theme/styles/themes/library/_layers.css +15 -0
  21. package/theme/styles/themes/library/_material-overrides.css +254 -0
  22. package/theme/styles/themes/library/_tokens.css +54 -0
  23. package/theme/styles/themes/library/color/amber.css +18 -0
  24. package/theme/styles/themes/library/color/blue.css +23 -0
  25. package/theme/styles/themes/library/color/green.css +18 -0
  26. package/theme/styles/themes/library/color/index.css +9 -0
  27. package/theme/styles/themes/library/color/purple.css +18 -0
  28. package/theme/styles/themes/library/color/red.css +18 -0
  29. package/theme/styles/themes/library/style/brutal.css +47 -0
  30. package/theme/styles/themes/library/style/default.css +51 -0
  31. package/theme/styles/themes/library/style/index.css +8 -0
  32. package/theme/styles/themes/library/style/sharp.css +47 -0
  33. package/theme/styles/themes/library/style/soft.css +47 -0
  34. package/theme/styles/themes/mode/dark.css +20 -0
  35. package/theme/styles/themes/mode/index.css +6 -0
  36. package/theme/styles/themes/mode/light.css +24 -0
  37. package/theme/styles/themes/taildwind.css +109 -0
  38. package/types/ojiepermana-angular-chart.d.ts +1094 -0
  39. package/types/ojiepermana-angular-component.d.ts +1174 -0
  40. package/types/ojiepermana-angular-layout.d.ts +123 -76
  41. package/types/ojiepermana-angular-navigation.d.ts +256 -116
  42. package/types/ojiepermana-angular-theme.d.ts +170 -1
  43. package/types/ojiepermana-angular.d.ts +2 -1
  44. package/fesm2022/ojiepermana-angular-internal.mjs +0 -489
  45. package/fesm2022/ojiepermana-angular-internal.mjs.map +0 -1
  46. package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs +0 -721
  47. package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs.map +0 -1
  48. package/fesm2022/ojiepermana-angular-navigation-vertical.mjs +0 -1647
  49. package/fesm2022/ojiepermana-angular-navigation-vertical.mjs.map +0 -1
  50. package/fesm2022/ojiepermana-angular-shell.mjs +0 -19
  51. package/fesm2022/ojiepermana-angular-shell.mjs.map +0 -1
  52. package/fesm2022/ojiepermana-angular-theme-component.mjs +0 -235
  53. package/fesm2022/ojiepermana-angular-theme-component.mjs.map +0 -1
  54. package/fesm2022/ojiepermana-angular-theme-directive.mjs +0 -29
  55. package/fesm2022/ojiepermana-angular-theme-directive.mjs.map +0 -1
  56. package/fesm2022/ojiepermana-angular-theme-service.mjs +0 -241
  57. package/fesm2022/ojiepermana-angular-theme-service.mjs.map +0 -1
  58. package/layout/README.md +0 -144
  59. package/layout/src/component/horizontal/horizontal.css +0 -130
  60. package/layout/src/component/vertical/vertical.css +0 -75
  61. package/layout/src/layout.css +0 -16
  62. package/navigation/README.md +0 -301
  63. package/navigation/horizontal/README.md +0 -49
  64. package/shell/README.md +0 -41
  65. package/styles/index.css +0 -2
  66. package/styles/resets.css +0 -22
  67. package/theme/README.md +0 -379
  68. package/theme/styles/adapters/material-ui/index.css +0 -205
  69. package/theme/styles/modes/dark.css +0 -84
  70. package/theme/styles/presets/colors/blue.css +0 -45
  71. package/theme/styles/presets/colors/brand.css +0 -52
  72. package/theme/styles/presets/colors/cyan.css +0 -45
  73. package/theme/styles/presets/colors/green.css +0 -45
  74. package/theme/styles/presets/colors/index.css +0 -7
  75. package/theme/styles/presets/colors/orange.css +0 -45
  76. package/theme/styles/presets/colors/purple.css +0 -45
  77. package/theme/styles/presets/colors/red.css +0 -45
  78. package/theme/styles/presets/styles/flat.css +0 -61
  79. package/theme/styles/presets/styles/glass.css +0 -28
  80. package/theme/styles/presets/styles/index.css +0 -2
  81. package/theme/styles/roles/index.css +0 -67
  82. package/theme/styles/tokens/foundation.css +0 -136
  83. package/theme/styles/tokens/semantic.css +0 -87
  84. package/theme/styles/utilities/index.css +0 -88
  85. package/types/ojiepermana-angular-internal.d.ts +0 -90
  86. package/types/ojiepermana-angular-navigation-horizontal.d.ts +0 -81
  87. package/types/ojiepermana-angular-navigation-vertical.d.ts +0 -262
  88. package/types/ojiepermana-angular-shell.d.ts +0 -14
  89. package/types/ojiepermana-angular-theme-component.d.ts +0 -46
  90. package/types/ojiepermana-angular-theme-directive.d.ts +0 -10
  91. package/types/ojiepermana-angular-theme-service.d.ts +0 -68
  92. /package/{navigation/vertical → chart}/README.md +0 -0
@@ -1,2 +1,171 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, Provider, EnvironmentProviders } from '@angular/core';
1
3
 
2
- export { };
4
+ declare const MODES: readonly ["light", "dark"];
5
+ type ThemeMode = (typeof MODES)[number];
6
+ declare const COLOR_SCHEMES: readonly ["light", "dark", "system"];
7
+ type ColorScheme = (typeof COLOR_SCHEMES)[number];
8
+ declare const COLORS: readonly ["blue", "red", "green", "purple", "amber"];
9
+ type ThemeColor = (typeof COLORS)[number];
10
+ declare const STYLES: readonly ["default", "sharp", "brutal", "soft"];
11
+ type ThemeStyle = (typeof STYLES)[number];
12
+ declare const BRANDS: readonly ["etos"];
13
+ type ThemeBrand = (typeof BRANDS)[number];
14
+ interface ThemeConfig {
15
+ readonly mode: ThemeMode;
16
+ readonly brand: ThemeBrand | null;
17
+ readonly color: ThemeColor;
18
+ readonly style: ThemeStyle;
19
+ }
20
+ interface MaterialThemeConfig {
21
+ /** Initial mode preference. Supports `system` for first-visit OS detection. */
22
+ readonly mode?: ColorScheme;
23
+ /** Initial brand bundle. When set, it replaces the explicit color and style layers. */
24
+ readonly brand?: ThemeBrand | null;
25
+ /** Alias for `brand` to match the persisted `theme-brand` setting. */
26
+ readonly 'theme-brand'?: ThemeBrand | null;
27
+ /** Initial brand color layer. */
28
+ readonly color?: ThemeColor;
29
+ /** Initial style personality layer. */
30
+ readonly style?: ThemeStyle;
31
+ /** @deprecated Use `mode` instead. */
32
+ readonly defaultMode?: ColorScheme;
33
+ /** Default brand bundle. When set, it replaces the explicit color and style layers. */
34
+ readonly defaultBrand?: ThemeBrand | null;
35
+ /** @deprecated Use `color` instead. */
36
+ readonly defaultColor?: ThemeColor;
37
+ /** @deprecated Use `style` instead. */
38
+ readonly defaultStyle?: ThemeStyle;
39
+ /** @deprecated Use `defaultMode` instead. */
40
+ readonly defaultScheme?: ColorScheme;
41
+ /** @deprecated Use `defaultColor` instead. */
42
+ readonly defaultTheme?: ThemeColor | string;
43
+ /** @deprecated Use `modeStorageKey` instead. */
44
+ readonly storageKey?: string | null;
45
+ /** @deprecated Use `modeStorageKey` instead. */
46
+ readonly schemeStorageKey?: string | null;
47
+ /** @deprecated Use `colorStorageKey` instead. */
48
+ readonly themeStorageKey?: string | null;
49
+ /** localStorage key used to persist the mode preference. Set to `null` to disable persistence. */
50
+ readonly modeStorageKey?: string | null;
51
+ /** localStorage key used to persist the brand bundle. Set to `null` to disable persistence. */
52
+ readonly brandStorageKey?: string | null;
53
+ /** localStorage key used to persist the color layer. Set to `null` to disable persistence. */
54
+ readonly colorStorageKey?: string | null;
55
+ /** localStorage key used to persist the style layer. Set to `null` to disable persistence. */
56
+ readonly styleStorageKey?: string | null;
57
+ }
58
+ interface ResolvedMaterialThemeConfig {
59
+ readonly defaultMode: ColorScheme;
60
+ readonly defaultBrand: ThemeBrand | null;
61
+ readonly defaultColor: ThemeColor;
62
+ readonly defaultStyle: ThemeStyle;
63
+ readonly modeStorageKey: string | null;
64
+ readonly brandStorageKey: string | null;
65
+ readonly colorStorageKey: string | null;
66
+ readonly styleStorageKey: string | null;
67
+ }
68
+ declare const MATERIAL_THEME_CONFIG: InjectionToken<MaterialThemeConfig>;
69
+ declare const DEFAULT_MATERIAL_THEME_CONFIG: ResolvedMaterialThemeConfig;
70
+ declare function isColorScheme(value: string | null | undefined): value is ColorScheme;
71
+ declare function isThemeColor(value: string | null | undefined): value is ThemeColor;
72
+ declare function isThemeStyle(value: string | null | undefined): value is ThemeStyle;
73
+ declare function isThemeBrand(value: string | null | undefined): value is ThemeBrand;
74
+
75
+ declare class ThemeService {
76
+ private readonly document;
77
+ private readonly destroyRef;
78
+ private readonly config;
79
+ private readonly initialBrand;
80
+ private readonly _modePreference;
81
+ private readonly _brand;
82
+ private readonly _color;
83
+ private readonly _style;
84
+ private readonly _systemPrefersDark;
85
+ readonly scheme: _angular_core.Signal<"light" | "dark" | "system">;
86
+ readonly brand: _angular_core.Signal<"etos" | null>;
87
+ readonly color: _angular_core.Signal<"blue" | "red" | "green" | "purple" | "amber">;
88
+ readonly theme: _angular_core.Signal<"blue" | "red" | "green" | "purple" | "amber">;
89
+ readonly style: _angular_core.Signal<"default" | "sharp" | "brutal" | "soft">;
90
+ readonly mode: _angular_core.Signal<"light" | "dark">;
91
+ readonly snapshot: _angular_core.Signal<ThemeConfig>;
92
+ readonly isDark: _angular_core.Signal<boolean>;
93
+ constructor();
94
+ setMode(mode: ThemeMode): void;
95
+ setScheme(scheme: ColorScheme): void;
96
+ setBrand(brand: ThemeBrand | null): void;
97
+ setColor(color: ThemeColor): void;
98
+ setTheme(theme: ThemeColor | string): void;
99
+ setStyle(style: ThemeStyle): void;
100
+ setAll(config: Partial<ThemeConfig> & {
101
+ readonly scheme?: ColorScheme;
102
+ }): void;
103
+ toggleScheme(): void;
104
+ toggleMode(): void;
105
+ reset(): void;
106
+ private resolveConfig;
107
+ private resolveMode;
108
+ private prefersDark;
109
+ private watchSystemScheme;
110
+ private readPersistedMode;
111
+ private readPersistedBrand;
112
+ private readPersistedColor;
113
+ private readPersistedStyle;
114
+ private persistMode;
115
+ private persistBrand;
116
+ private persistColor;
117
+ private persistStyle;
118
+ private clearPersistedBrand;
119
+ private clearPersistedColor;
120
+ private clearPersistedStyle;
121
+ private clearPersistedItem;
122
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeService, never>;
123
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeService>;
124
+ }
125
+
126
+ /**
127
+ * Opaque feature unit consumed by {@link provideMaterialTheme}. Mirrors
128
+ * Angular's router/http feature pattern so add-ons can be composed without
129
+ * widening the primary provider signature.
130
+ */
131
+ interface MaterialThemeFeature {
132
+ readonly providers: Provider[];
133
+ }
134
+ /**
135
+ * Bootstrap the shared theme for any `@ojiepermana/angular/*` entry point.
136
+ *
137
+ * By default wires up the theme config token and eagerly initializes `ThemeService`
138
+ * so root theme attributes are applied during bootstrap. Opt in
139
+ * to Angular Material defaults (ripple / form-field) via
140
+ * {@link withMaterialDefaults}.
141
+ * Supports shorthand `mode`, `color`, and `style` config keys.
142
+ *
143
+ * @example
144
+ * export const appConfig: ApplicationConfig = {
145
+ * providers: [
146
+ * provideAnimations(),
147
+ * provideMaterialTheme(
148
+ * {
149
+ * mode: 'system',
150
+ * color: 'blue',
151
+ * style: 'soft',
152
+ * },
153
+ * withMaterialDefaults(),
154
+ * ),
155
+ * ],
156
+ * };
157
+ */
158
+ declare function provideMaterialTheme(config?: MaterialThemeConfig, ...features: MaterialThemeFeature[]): EnvironmentProviders;
159
+ /**
160
+ * Opt-in Angular Material defaults tuned for the shared theme layer:
161
+ *
162
+ * - Disables the global Material ripple.
163
+ * - Forces `appearance: 'outline'` + `subscriptSizing: 'dynamic'` on every
164
+ * `mat-form-field`.
165
+ *
166
+ * Only apply when your app actually renders Angular Material components.
167
+ */
168
+ declare function withMaterialDefaults(): MaterialThemeFeature;
169
+
170
+ export { BRANDS, COLORS, COLOR_SCHEMES, DEFAULT_MATERIAL_THEME_CONFIG, MATERIAL_THEME_CONFIG, MODES, STYLES, ThemeService, isColorScheme, isThemeBrand, isThemeColor, isThemeStyle, provideMaterialTheme, withMaterialDefaults };
171
+ export type { ColorScheme, MaterialThemeConfig, MaterialThemeFeature, ResolvedMaterialThemeConfig, ThemeBrand, ThemeColor, ThemeConfig, ThemeMode, ThemeStyle };
@@ -1,2 +1,3 @@
1
+ declare const MATERIAL_VERSION = "0.0.1";
1
2
 
2
- export { };
3
+ export { MATERIAL_VERSION };
@@ -1,489 +0,0 @@
1
- import { provideLucideConfig, icons, LucideDynamicIcon } from '@lucide/angular';
2
- import * as i0 from '@angular/core';
3
- import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
4
- import { NgTemplateOutlet } from '@angular/common';
5
- import { getNavigationChildren, hasNavigationChildren, shouldRenderNavigationItem } from '@ojiepermana/angular/navigation';
6
-
7
- const libraryLucideConfigProvider = provideLucideConfig({
8
- absoluteStrokeWidth: true,
9
- strokeWidth: 1.35,
10
- });
11
-
12
- class LocalStorageStateAdapter {
13
- config;
14
- constructor(config) {
15
- this.config = config;
16
- }
17
- clear(axis) {
18
- if (!this.config.isBrowser || !this.config.storage) {
19
- return;
20
- }
21
- this.config.storage.removeItem(this.key(axis));
22
- this.config.storage.removeItem(this.legacyKey(axis));
23
- }
24
- persist(axis, value) {
25
- if (!this.config.isBrowser || !this.config.storage) {
26
- return;
27
- }
28
- this.config.storage.setItem(this.key(axis), value);
29
- this.config.storage.removeItem(this.legacyKey(axis));
30
- }
31
- readValue(axis) {
32
- if (!this.config.isBrowser || !this.config.storage) {
33
- return null;
34
- }
35
- const storedValue = this.config.storage.getItem(this.key(axis));
36
- if (storedValue !== null) {
37
- return storedValue;
38
- }
39
- const legacyValue = this.config.storage.getItem(this.legacyKey(axis));
40
- if (legacyValue !== null) {
41
- this.config.storage.setItem(this.key(axis), legacyValue);
42
- this.config.storage.removeItem(this.legacyKey(axis));
43
- return legacyValue;
44
- }
45
- return null;
46
- }
47
- read(axis, fallback, isValid) {
48
- if (!this.config.isBrowser || !this.config.storage) {
49
- return fallback;
50
- }
51
- const storedValue = this.config.storage.getItem(this.key(axis));
52
- if (storedValue && isValid(storedValue)) {
53
- return storedValue;
54
- }
55
- const legacyValue = this.config.storage.getItem(this.legacyKey(axis));
56
- if (legacyValue && isValid(legacyValue)) {
57
- this.config.storage.setItem(this.key(axis), legacyValue);
58
- this.config.storage.removeItem(this.legacyKey(axis));
59
- return legacyValue;
60
- }
61
- return fallback;
62
- }
63
- key(axis) {
64
- return this.config.keys[axis];
65
- }
66
- legacyKey(axis) {
67
- return `${this.config.legacyPrefix}:${axis}`;
68
- }
69
- }
70
-
71
- const navigationLucideIconRegistry = buildNavigationLucideIconRegistry();
72
- function buildNavigationLucideIconRegistry() {
73
- const registry = new Map();
74
- for (const icon of Object.values(icons)) {
75
- registry.set(icon.icon.name, icon);
76
- for (const alias of icon.icon.aliases ?? []) {
77
- registry.set(alias, icon);
78
- }
79
- }
80
- return registry;
81
- }
82
- class NavigationItemContent {
83
- item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
84
- level = input(0, ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
85
- variant = input('horizontal', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
86
- resolvedIcon = computed(() => {
87
- const iconName = this.item().icon;
88
- return iconName ? (navigationLucideIconRegistry.get(iconName) ?? null) : null;
89
- }, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
90
- horizontalIconClass = computed(() => this.joinClasses('horizontal-navigation-item-icon', this.item().classes?.icon), ...(ngDevMode ? [{ debugName: "horizontalIconClass" }] : /* istanbul ignore next */ []));
91
- verticalIconClass = computed(() => this.joinClasses('kit-navigation-item-icon', this.item().classes?.icon), ...(ngDevMode ? [{ debugName: "verticalIconClass" }] : /* istanbul ignore next */ []));
92
- horizontalTitleClass = computed(() => this.joinClasses('horizontal-navigation-item-label', this.item().classes?.title), ...(ngDevMode ? [{ debugName: "horizontalTitleClass" }] : /* istanbul ignore next */ []));
93
- titleClass = computed(() => this.item().classes?.title ?? null, ...(ngDevMode ? [{ debugName: "titleClass" }] : /* istanbul ignore next */ []));
94
- subtitleClass = computed(() => this.item().classes?.subtitle ?? null, ...(ngDevMode ? [{ debugName: "subtitleClass" }] : /* istanbul ignore next */ []));
95
- horizontalBadgeClass = computed(() => this.joinClasses('horizontal-navigation-item-badge', !this.item().badge?.classes ? 'bg-primary text-primary-foreground' : null, this.item().badge?.classes), ...(ngDevMode ? [{ debugName: "horizontalBadgeClass" }] : /* istanbul ignore next */ []));
96
- verticalBadgeClass = computed(() => this.joinClasses('kit-navigation-item-badge-content', this.item().badge?.classes), ...(ngDevMode ? [{ debugName: "verticalBadgeClass" }] : /* istanbul ignore next */ []));
97
- titleContainerClass = computed(() => this.variant() === 'vertical-group' ? 'kit-navigation-group-title' : 'kit-navigation-item-title', ...(ngDevMode ? [{ debugName: "titleContainerClass" }] : /* istanbul ignore next */ []));
98
- subtitleContainerClass = computed(() => this.variant() === 'vertical-group' ? 'kit-navigation-group-subtitle' : 'kit-navigation-item-subtitle', ...(ngDevMode ? [{ debugName: "subtitleContainerClass" }] : /* istanbul ignore next */ []));
99
- joinClasses(...classNames) {
100
- const value = classNames.filter((className) => !!className).join(' ');
101
- return value || null;
102
- }
103
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NavigationItemContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
104
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NavigationItemContent, isStandalone: true, selector: "navigation-item-content", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, providers: [libraryLucideConfigProvider], ngImport: i0, template: `
105
- @if (variant() === 'horizontal') {
106
- <span class="horizontal-navigation-item-body">
107
- <span
108
- class="horizontal-navigation-item-leading"
109
- [class.horizontal-navigation-item-leading--nested]="level() > 0">
110
- @if (resolvedIcon(); as icon) {
111
- <svg
112
- [lucideIcon]="icon"
113
- [absoluteStrokeWidth]="true"
114
- [attr.class]="horizontalIconClass()"
115
- aria-hidden="true"></svg>
116
- }
117
- <span [attr.class]="horizontalTitleClass()">
118
- {{ item().title }}
119
- </span>
120
- </span>
121
-
122
- @if (item().badge?.title) {
123
- <span [attr.class]="horizontalBadgeClass()">
124
- {{ item().badge?.title }}
125
- </span>
126
- }
127
- </span>
128
- } @else {
129
- <span class="kit-navigation-item-content">
130
- @if (resolvedIcon(); as icon) {
131
- <svg
132
- [lucideIcon]="icon"
133
- [absoluteStrokeWidth]="true"
134
- [attr.class]="verticalIconClass()"
135
- [size]="18"
136
- aria-hidden="true"></svg>
137
- }
138
-
139
- <div class="kit-navigation-item-title-wrapper">
140
- <div [class]="titleContainerClass()">
141
- <span [attr.class]="titleClass()">
142
- {{ item().title }}
143
- </span>
144
- </div>
145
-
146
- @if (item().subtitle) {
147
- <div [class]="subtitleContainerClass()">
148
- <span [attr.class]="subtitleClass()">
149
- {{ item().subtitle }}
150
- </span>
151
- </div>
152
- }
153
- </div>
154
-
155
- @if (item().badge?.title) {
156
- <div class="kit-navigation-item-badge">
157
- <div [attr.class]="verticalBadgeClass()">
158
- {{ item().badge?.title }}
159
- </div>
160
- </div>
161
- }
162
- </span>
163
- }
164
- `, isInline: true, styles: [":host{display:contents}.kit-navigation-item-content{display:flex;align-items:center;width:100%;min-width:0}.kit-navigation-item-title-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column}.kit-navigation-item-title,.kit-navigation-group-title,.kit-navigation-item-subtitle,.kit-navigation-group-subtitle{min-width:0}\n"], dependencies: [{ kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
165
- }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NavigationItemContent, decorators: [{
167
- type: Component,
168
- args: [{ selector: 'navigation-item-content', template: `
169
- @if (variant() === 'horizontal') {
170
- <span class="horizontal-navigation-item-body">
171
- <span
172
- class="horizontal-navigation-item-leading"
173
- [class.horizontal-navigation-item-leading--nested]="level() > 0">
174
- @if (resolvedIcon(); as icon) {
175
- <svg
176
- [lucideIcon]="icon"
177
- [absoluteStrokeWidth]="true"
178
- [attr.class]="horizontalIconClass()"
179
- aria-hidden="true"></svg>
180
- }
181
- <span [attr.class]="horizontalTitleClass()">
182
- {{ item().title }}
183
- </span>
184
- </span>
185
-
186
- @if (item().badge?.title) {
187
- <span [attr.class]="horizontalBadgeClass()">
188
- {{ item().badge?.title }}
189
- </span>
190
- }
191
- </span>
192
- } @else {
193
- <span class="kit-navigation-item-content">
194
- @if (resolvedIcon(); as icon) {
195
- <svg
196
- [lucideIcon]="icon"
197
- [absoluteStrokeWidth]="true"
198
- [attr.class]="verticalIconClass()"
199
- [size]="18"
200
- aria-hidden="true"></svg>
201
- }
202
-
203
- <div class="kit-navigation-item-title-wrapper">
204
- <div [class]="titleContainerClass()">
205
- <span [attr.class]="titleClass()">
206
- {{ item().title }}
207
- </span>
208
- </div>
209
-
210
- @if (item().subtitle) {
211
- <div [class]="subtitleContainerClass()">
212
- <span [attr.class]="subtitleClass()">
213
- {{ item().subtitle }}
214
- </span>
215
- </div>
216
- }
217
- </div>
218
-
219
- @if (item().badge?.title) {
220
- <div class="kit-navigation-item-badge">
221
- <div [attr.class]="verticalBadgeClass()">
222
- {{ item().badge?.title }}
223
- </div>
224
- </div>
225
- }
226
- </span>
227
- }
228
- `, imports: [LucideDynamicIcon], providers: [libraryLucideConfigProvider], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [":host{display:contents}.kit-navigation-item-content{display:flex;align-items:center;width:100%;min-width:0}.kit-navigation-item-title-wrapper{display:flex;flex:1 1 auto;min-width:0;flex-direction:column}.kit-navigation-item-title,.kit-navigation-group-title,.kit-navigation-item-subtitle,.kit-navigation-group-subtitle{min-width:0}\n"] }]
229
- }], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
230
-
231
- function trackNavigationTreeItem(index, item) {
232
- return item.id || item.title || index;
233
- }
234
- function getNavigationTreePathKey(parentKey, item) {
235
- const key = item.id || item.title;
236
- if (!key) {
237
- return parentKey;
238
- }
239
- return `${parentKey}/${key}`;
240
- }
241
- function isNavigationTreeItemExpanded(expandedByParent, parentKey, item) {
242
- return expandedByParent[parentKey] === getNavigationTreePathKey(parentKey, item);
243
- }
244
- function toggleNavigationTreeItemExpanded(expandedByParent, parentKey, item) {
245
- const key = getNavigationTreePathKey(parentKey, item);
246
- if (expandedByParent[parentKey] === key) {
247
- const next = { ...expandedByParent };
248
- delete next[parentKey];
249
- return next;
250
- }
251
- return {
252
- ...expandedByParent,
253
- [parentKey]: key,
254
- };
255
- }
256
- function hasActiveNavigationDescendant(item, isItemActive) {
257
- for (const child of getNavigationChildren(item)) {
258
- if (isItemActive(child)) {
259
- return true;
260
- }
261
- if (hasNavigationChildren(child) && hasActiveNavigationDescendant(child, isItemActive)) {
262
- return true;
263
- }
264
- }
265
- return false;
266
- }
267
- function isNavigationTreeDescendant(parent, item) {
268
- for (const child of getNavigationChildren(parent)) {
269
- if (child === item) {
270
- return true;
271
- }
272
- if (hasNavigationChildren(child) && isNavigationTreeDescendant(child, item)) {
273
- return true;
274
- }
275
- }
276
- return false;
277
- }
278
-
279
- class NavigationTreeOutlet {
280
- items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
281
- level = input(0, ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
282
- parentKey = input('root', ...(ngDevMode ? [{ debugName: "parentKey" }] : /* istanbul ignore next */ []));
283
- data = input(null, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
284
- branchTemplate = input.required(...(ngDevMode ? [{ debugName: "branchTemplate" }] : /* istanbul ignore next */ []));
285
- leafTemplate = input.required(...(ngDevMode ? [{ debugName: "leafTemplate" }] : /* istanbul ignore next */ []));
286
- groupTemplate = input.required(...(ngDevMode ? [{ debugName: "groupTemplate" }] : /* istanbul ignore next */ []));
287
- dividerTemplate = input(null, ...(ngDevMode ? [{ debugName: "dividerTemplate" }] : /* istanbul ignore next */ []));
288
- spacerTemplate = input(null, ...(ngDevMode ? [{ debugName: "spacerTemplate" }] : /* istanbul ignore next */ []));
289
- trackByFn = input(trackNavigationTreeItem, ...(ngDevMode ? [{ debugName: "trackByFn" }] : /* istanbul ignore next */ []));
290
- shouldRenderItemFn = input(shouldRenderNavigationItem, ...(ngDevMode ? [{ debugName: "shouldRenderItemFn" }] : /* istanbul ignore next */ []));
291
- hasChildrenFn = input(hasNavigationChildren, ...(ngDevMode ? [{ debugName: "hasChildrenFn" }] : /* istanbul ignore next */ []));
292
- resolveParentKeyFn = input(getNavigationTreePathKey, ...(ngDevMode ? [{ debugName: "resolveParentKeyFn" }] : /* istanbul ignore next */ []));
293
- trackItem(index, item) {
294
- return this.trackByFn()(index, item);
295
- }
296
- shouldRender(item) {
297
- return this.shouldRenderItemFn()(item);
298
- }
299
- hasChildren(item) {
300
- return this.hasChildrenFn()(item);
301
- }
302
- resolveParentKey(parentKey, item) {
303
- return this.resolveParentKeyFn()(parentKey, item);
304
- }
305
- templateContext(item, isLast) {
306
- return {
307
- $implicit: item,
308
- level: this.level(),
309
- parentKey: this.parentKey(),
310
- isLast,
311
- data: this.data(),
312
- };
313
- }
314
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NavigationTreeOutlet, deps: [], target: i0.ɵɵFactoryTarget.Component });
315
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NavigationTreeOutlet, isStandalone: true, selector: "navigation-tree-outlet", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, parentKey: { classPropertyName: "parentKey", publicName: "parentKey", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, branchTemplate: { classPropertyName: "branchTemplate", publicName: "branchTemplate", isSignal: true, isRequired: true, transformFunction: null }, leafTemplate: { classPropertyName: "leafTemplate", publicName: "leafTemplate", isSignal: true, isRequired: true, transformFunction: null }, groupTemplate: { classPropertyName: "groupTemplate", publicName: "groupTemplate", isSignal: true, isRequired: true, transformFunction: null }, dividerTemplate: { classPropertyName: "dividerTemplate", publicName: "dividerTemplate", isSignal: true, isRequired: false, transformFunction: null }, spacerTemplate: { classPropertyName: "spacerTemplate", publicName: "spacerTemplate", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null }, shouldRenderItemFn: { classPropertyName: "shouldRenderItemFn", publicName: "shouldRenderItemFn", isSignal: true, isRequired: false, transformFunction: null }, hasChildrenFn: { classPropertyName: "hasChildrenFn", publicName: "hasChildrenFn", isSignal: true, isRequired: false, transformFunction: null }, resolveParentKeyFn: { classPropertyName: "resolveParentKeyFn", publicName: "resolveParentKeyFn", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
316
- @for (child of items(); track trackItem($index, child); let isLast = $last) {
317
- @if (shouldRender(child)) {
318
- @switch (child.type) {
319
- @case ('basic') {
320
- <ng-container
321
- [ngTemplateOutlet]="leafTemplate()"
322
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
323
- }
324
-
325
- @case ('aside') {
326
- @if (hasChildren(child)) {
327
- <ng-container
328
- [ngTemplateOutlet]="branchTemplate()"
329
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
330
- } @else {
331
- <ng-container
332
- [ngTemplateOutlet]="leafTemplate()"
333
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
334
- }
335
- }
336
-
337
- @case ('collapsable') {
338
- @if (hasChildren(child)) {
339
- <ng-container
340
- [ngTemplateOutlet]="branchTemplate()"
341
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
342
- } @else {
343
- <ng-container
344
- [ngTemplateOutlet]="leafTemplate()"
345
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
346
- }
347
- }
348
-
349
- @case ('group') {
350
- @if (hasChildren(child)) {
351
- <ng-container
352
- [ngTemplateOutlet]="groupTemplate()"
353
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
354
- <navigation-tree-outlet
355
- [items]="child.children || []"
356
- [level]="level() + 1"
357
- [parentKey]="resolveParentKey(parentKey(), child)"
358
- [data]="data()"
359
- [branchTemplate]="branchTemplate()"
360
- [leafTemplate]="leafTemplate()"
361
- [groupTemplate]="groupTemplate()"
362
- [dividerTemplate]="dividerTemplate()"
363
- [spacerTemplate]="spacerTemplate()"
364
- [trackByFn]="trackByFn()"
365
- [shouldRenderItemFn]="shouldRenderItemFn()"
366
- [hasChildrenFn]="hasChildrenFn()"
367
- [resolveParentKeyFn]="resolveParentKeyFn()" />
368
- }
369
- }
370
-
371
- @case ('divider') {
372
- @if (dividerTemplate()) {
373
- <ng-container
374
- [ngTemplateOutlet]="dividerTemplate()"
375
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
376
- }
377
- }
378
-
379
- @case ('spacer') {
380
- @if (spacerTemplate()) {
381
- <ng-container
382
- [ngTemplateOutlet]="spacerTemplate()"
383
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
384
- }
385
- }
386
-
387
- @default {
388
- <ng-container
389
- [ngTemplateOutlet]="leafTemplate()"
390
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
391
- }
392
- }
393
- }
394
- }
395
- `, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => NavigationTreeOutlet), selector: "navigation-tree-outlet", inputs: ["items", "level", "parentKey", "data", "branchTemplate", "leafTemplate", "groupTemplate", "dividerTemplate", "spacerTemplate", "trackByFn", "shouldRenderItemFn", "hasChildrenFn", "resolveParentKeyFn"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
396
- }
397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NavigationTreeOutlet, decorators: [{
398
- type: Component,
399
- args: [{ selector: 'navigation-tree-outlet', template: `
400
- @for (child of items(); track trackItem($index, child); let isLast = $last) {
401
- @if (shouldRender(child)) {
402
- @switch (child.type) {
403
- @case ('basic') {
404
- <ng-container
405
- [ngTemplateOutlet]="leafTemplate()"
406
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
407
- }
408
-
409
- @case ('aside') {
410
- @if (hasChildren(child)) {
411
- <ng-container
412
- [ngTemplateOutlet]="branchTemplate()"
413
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
414
- } @else {
415
- <ng-container
416
- [ngTemplateOutlet]="leafTemplate()"
417
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
418
- }
419
- }
420
-
421
- @case ('collapsable') {
422
- @if (hasChildren(child)) {
423
- <ng-container
424
- [ngTemplateOutlet]="branchTemplate()"
425
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
426
- } @else {
427
- <ng-container
428
- [ngTemplateOutlet]="leafTemplate()"
429
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
430
- }
431
- }
432
-
433
- @case ('group') {
434
- @if (hasChildren(child)) {
435
- <ng-container
436
- [ngTemplateOutlet]="groupTemplate()"
437
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
438
- <navigation-tree-outlet
439
- [items]="child.children || []"
440
- [level]="level() + 1"
441
- [parentKey]="resolveParentKey(parentKey(), child)"
442
- [data]="data()"
443
- [branchTemplate]="branchTemplate()"
444
- [leafTemplate]="leafTemplate()"
445
- [groupTemplate]="groupTemplate()"
446
- [dividerTemplate]="dividerTemplate()"
447
- [spacerTemplate]="spacerTemplate()"
448
- [trackByFn]="trackByFn()"
449
- [shouldRenderItemFn]="shouldRenderItemFn()"
450
- [hasChildrenFn]="hasChildrenFn()"
451
- [resolveParentKeyFn]="resolveParentKeyFn()" />
452
- }
453
- }
454
-
455
- @case ('divider') {
456
- @if (dividerTemplate()) {
457
- <ng-container
458
- [ngTemplateOutlet]="dividerTemplate()"
459
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
460
- }
461
- }
462
-
463
- @case ('spacer') {
464
- @if (spacerTemplate()) {
465
- <ng-container
466
- [ngTemplateOutlet]="spacerTemplate()"
467
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
468
- }
469
- }
470
-
471
- @default {
472
- <ng-container
473
- [ngTemplateOutlet]="leafTemplate()"
474
- [ngTemplateOutletContext]="templateContext(child, isLast)"></ng-container>
475
- }
476
- }
477
- }
478
- }
479
- `, imports: [NgTemplateOutlet, forwardRef(() => NavigationTreeOutlet)], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [":host{display:block}\n"] }]
480
- }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], parentKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentKey", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], branchTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "branchTemplate", required: true }] }], leafTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "leafTemplate", required: true }] }], groupTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupTemplate", required: true }] }], dividerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dividerTemplate", required: false }] }], spacerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacerTemplate", required: false }] }], trackByFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByFn", required: false }] }], shouldRenderItemFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldRenderItemFn", required: false }] }], hasChildrenFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasChildrenFn", required: false }] }], resolveParentKeyFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolveParentKeyFn", required: false }] }] } });
481
-
482
- /* Internal composition utilities for library entrypoints. Not part of the supported consumer API. */
483
-
484
- /**
485
- * Generated bundle index. Do not edit.
486
- */
487
-
488
- export { LocalStorageStateAdapter, NavigationItemContent, NavigationTreeOutlet, getNavigationTreePathKey, hasActiveNavigationDescendant, isNavigationTreeDescendant, isNavigationTreeItemExpanded, libraryLucideConfigProvider, toggleNavigationTreeItemExpanded, trackNavigationTreeItem };
489
- //# sourceMappingURL=ojiepermana-angular-internal.mjs.map