commons-shared-web-ui 0.0.12 → 0.0.14

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.
package/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import * as i15 from '@angular/material/button';
20
20
  import * as i16 from '@angular/material/menu';
21
21
  import * as i17 from '@angular/material/progress-bar';
22
22
  import * as i18 from '@angular/material/tooltip';
23
+ import { TooltipPosition } from '@angular/material/tooltip';
23
24
  import * as i19 from '@angular/material/slider';
24
25
  import * as i20 from '@angular/material/list';
25
26
  import * as i21 from '@angular/material/chips';
@@ -33,6 +34,7 @@ import * as i28 from '@angular/material/expansion';
33
34
  import * as i29 from '@angular/cdk/accordion';
34
35
  import * as i3$1 from '@angular/forms';
35
36
  import { ControlValueAccessor, FormGroup, FormBuilder, AbstractControl, FormControl, FormArray, ValidatorFn, ValidationErrors } from '@angular/forms';
37
+ import * as i3$2 from '@angular/router';
36
38
  import { Router, ActivatedRoute } from '@angular/router';
37
39
  import * as i11$1 from '@angular/cdk/scrolling';
38
40
  import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
@@ -1951,7 +1953,7 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1951
1953
  * validity whenever any of them change.
1952
1954
  */
1953
1955
  private setupFormulaValidation;
1954
- addGroupInstance(): void;
1956
+ addGroupInstance(initialData?: any): void;
1955
1957
  saveGroupInstance(index: number): void;
1956
1958
  cancelGroupInstance(index: number): void;
1957
1959
  editGroupInstance(index: number): void;
@@ -2052,9 +2054,78 @@ declare class SmartFormModule {
2052
2054
  static ɵinj: i0.ɵɵInjectorDeclaration<SmartFormModule>;
2053
2055
  }
2054
2056
 
2057
+ interface SideNavItem {
2058
+ id: string;
2059
+ label: string;
2060
+ icon?: string;
2061
+ route?: string;
2062
+ roles?: string[];
2063
+ disabled?: boolean;
2064
+ showArrow?: boolean;
2065
+ tooltip?: string;
2066
+ }
2067
+ interface SideNavStyleConfig {
2068
+ bg?: string;
2069
+ width?: string;
2070
+ collapsedWidth?: string;
2071
+ fontFamily?: string;
2072
+ headingColor?: string;
2073
+ itemColor?: string;
2074
+ itemHoverBg?: string;
2075
+ activeBg?: string;
2076
+ activeColor?: string;
2077
+ activeHoverBg?: string;
2078
+ }
2079
+ interface SideNavSection {
2080
+ heading?: string;
2081
+ items: SideNavItem[];
2082
+ }
2083
+
2084
+ declare class SideNavComponent implements OnChanges {
2085
+ sections: SideNavSection[];
2086
+ userRoles?: string[];
2087
+ activeId?: string;
2088
+ styleConfig?: SideNavStyleConfig;
2089
+ /** Control whether the nav is collapsed externally (two-way bindable) */
2090
+ collapsed: boolean;
2091
+ /** Width of the nav when expanded. Overrides the CSS variable default. */
2092
+ width?: string;
2093
+ /** Width of the nav when collapsed (icons only). Overrides the CSS variable default. */
2094
+ collapsedWidth?: string;
2095
+ /** Whether to show the collapse toggle button */
2096
+ showCollapseToggle: boolean;
2097
+ /** Whether to hide icons when the side nav is expanded */
2098
+ hideIconsWhenExpanded: boolean;
2099
+ /** Whether to show tooltips on nav items */
2100
+ showTooltips: boolean;
2101
+ /** Position of the tooltip */
2102
+ tooltipPosition: TooltipPosition;
2103
+ itemClicked: EventEmitter<SideNavItem>;
2104
+ /** Emits whenever the collapsed state changes (supports two-way binding via [(collapsed)]) */
2105
+ collapsedChange: EventEmitter<boolean>;
2106
+ /** Applies collapsed class to :host for the width CSS transition */
2107
+ get isHostCollapsed(): boolean;
2108
+ filteredSections: SideNavSection[];
2109
+ ngOnChanges(changes: SimpleChanges): void;
2110
+ private filterSections;
2111
+ onItemClick(item: SideNavItem, event: Event): void;
2112
+ toggleCollapse(): void;
2113
+ get customStyles(): {
2114
+ [key: string]: string;
2115
+ };
2116
+ static ɵfac: i0.ɵɵFactoryDeclaration<SideNavComponent, never>;
2117
+ static ɵcmp: i0.ɵɵComponentDeclaration<SideNavComponent, "lib-side-nav", never, { "sections": { "alias": "sections"; "required": false; }; "userRoles": { "alias": "userRoles"; "required": false; }; "activeId": { "alias": "activeId"; "required": false; }; "styleConfig": { "alias": "styleConfig"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; "width": { "alias": "width"; "required": false; }; "collapsedWidth": { "alias": "collapsedWidth"; "required": false; }; "showCollapseToggle": { "alias": "showCollapseToggle"; "required": false; }; "hideIconsWhenExpanded": { "alias": "hideIconsWhenExpanded"; "required": false; }; "showTooltips": { "alias": "showTooltips"; "required": false; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; }; }, { "itemClicked": "itemClicked"; "collapsedChange": "collapsedChange"; }, never, never, false, never>;
2118
+ }
2119
+
2120
+ declare class SideNavModule {
2121
+ static ɵfac: i0.ɵɵFactoryDeclaration<SideNavModule, never>;
2122
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SideNavModule, [typeof SideNavComponent], [typeof i2$1.CommonModule, typeof i3$2.RouterModule, typeof MaterialModule], [typeof SideNavComponent]>;
2123
+ static ɵinj: i0.ɵɵInjectorDeclaration<SideNavModule>;
2124
+ }
2125
+
2055
2126
  declare class SharedUiModule {
2056
2127
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedUiModule, never>;
2057
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedUiModule, never, [typeof i2$1.CommonModule, typeof MaterialModule, typeof AlertModule, typeof ButtonModule, typeof ConfirmationModalModule, typeof FilterSidebarModule, typeof FilterModule, typeof SummaryCardModule, typeof ConfigurableFormModule, typeof FormComponentsModule, typeof SmartFormModule], [typeof MaterialModule, typeof AlertModule, typeof ButtonModule, typeof ConfirmationModalModule, typeof FilterSidebarModule, typeof FilterModule, typeof SummaryCardModule, typeof ConfigurableFormModule, typeof FormComponentsModule, typeof SmartFormModule]>;
2128
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedUiModule, never, [typeof i2$1.CommonModule, typeof MaterialModule, typeof AlertModule, typeof ButtonModule, typeof ConfirmationModalModule, typeof FilterSidebarModule, typeof FilterModule, typeof SummaryCardModule, typeof ConfigurableFormModule, typeof FormComponentsModule, typeof SmartFormModule, typeof SideNavModule], [typeof MaterialModule, typeof AlertModule, typeof ButtonModule, typeof ConfirmationModalModule, typeof FilterSidebarModule, typeof FilterModule, typeof SummaryCardModule, typeof ConfigurableFormModule, typeof FormComponentsModule, typeof SmartFormModule, typeof SideNavModule]>;
2058
2129
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedUiModule>;
2059
2130
  }
2060
2131
 
@@ -2216,6 +2287,7 @@ declare const PAGINATION_THEME_DEFAULT = "theme-1";
2216
2287
  declare const PAGINATION_THEME_DARK = "theme-2";
2217
2288
  declare const NAV_VARIANT_DEFAULT: 'filled' | 'underline' | 'pills';
2218
2289
  declare const NAV_ORIENTATION_DEFAULT: 'horizontal' | 'vertical';
2290
+ declare const DEFAULT_SIDE_NAV_TOOLTIP_POSITION = "right";
2219
2291
 
2220
2292
  interface TableOption {
2221
2293
  label: string;
@@ -2478,5 +2550,5 @@ declare class SnackbarModule {
2478
2550
  static ɵinj: i0.ɵɵInjectorDeclaration<SnackbarModule>;
2479
2551
  }
2480
2552
 
2481
- export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples_d as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SmartFormComponent, SmartFormController, smartForm_examples_d as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SnackbarComponent, SnackbarModule, SnackbarService, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
2482
- export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, IconInput, InputConfig, InputLabels, InputType, JsonFieldConfig, JsonFormConfig, KeyType, LengthConstraint, LocationConfig, NavItem, NavStyleConfig, NestedStringConfig, NumberConfig, OptionConfig$1 as OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableConfig, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
2553
+ export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples_d as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_SIDE_NAV_TOOLTIP_POSITION, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SideNavComponent, SideNavModule, SmartFormComponent, SmartFormController, smartForm_examples_d as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SnackbarComponent, SnackbarModule, SnackbarService, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
2554
+ export type { AlertLabels, AlertVariant, AttachmentConfig, ButtonLabels, ButtonVariant, CheckboxConfig, CheckboxLabels, CheckboxOption, ConfirmationModalConfig, DateConfig, DatePickerConfig, DatepickerLabels, DropdownConfig, DropdownLabels, DropdownOption, EmailConfig, FieldConfig, FieldType, FilterChangeEvent, FilterConfig, FilterItem, FilterItemType, FilterOutput, FilterSearchConfig, FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FormConfig, FormField, FormOption, FormSchema, FormSection, GeneratedConfig, IconInput, InputConfig, InputLabels, InputType, JsonFieldConfig, JsonFormConfig, KeyType, LengthConstraint, LocationConfig, NavItem, NavStyleConfig, NestedStringConfig, NumberConfig, OptionConfig$1 as OptionConfig, OptionDTO, OptionItem, PaginationConfig, PaginationLabels, PhoneConfig, QueryParamsConfig, RadioConfig, RadioLabels, RadioOption, RangeConfig, RatingConfig, SearchConfig, SearchLabels, SectionConfig, SideNavItem, SideNavSection, SideNavStyleConfig, SnackbarConfig, SnackbarVariant, StepperConfig, SubmitConfig, SummaryCardConfig, SummaryCardLabels, SummaryCardMeta, TableAction, TableActionItem, TableColumn, TableConfig, TableFilter, TableFilterChangeEvent, TableFilterColumn, TableFilterConfig, TableFilterItem, TableFilterLabels, TableFilterOutput, TableLabels, TableOption, TableTheme, TextConfig, ToggleConfig, ToggleLabels, UIConfig, UISubType, UIType, UploadedFile, ValidationResult, ValidationRules };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",
@@ -0,0 +1,94 @@
1
+ @use 'sass:map';
2
+
3
+ $default-side-nav-config: (
4
+ // Container & Global
5
+ bg: #F9C80E0D,
6
+ width: 220px,
7
+ collapsed-width: 56px,
8
+ gap-sections: 24px,
9
+ padding: 16px,
10
+
11
+ // Typographic Global
12
+ font-family: ('Poppins', sans-serif),
13
+
14
+ // Header Typography
15
+ heading-font-weight: 500,
16
+ heading-font-size: 16px,
17
+ heading-color: #3C4043,
18
+
19
+ // Item Defaults (Inactive)
20
+ item-gap: 4px,
21
+ item-padding: 12px 16px,
22
+ item-border-radius: 8px,
23
+ item-font-weight: 400,
24
+ item-font-size: 14px,
25
+ item-color: #5F6368,
26
+
27
+ // Item Hover
28
+ // (Figma didn't strictly specify hover for inactive, assume subtle transparency on the active color)
29
+ item-hover-bg: rgba(#E63E30, 0.05),
30
+ item-hover-color: #3C4043,
31
+
32
+ // Active Item
33
+ active-bg: #E63E30,
34
+ active-color: #FFFFFF,
35
+ active-font-weight: 500,
36
+ active-hover-bg: #D4382B, // Darkened active color
37
+
38
+ // Disable State
39
+ disabled-opacity: 0.5,
40
+
41
+ // Tooltip Styling
42
+ tooltip-bg: rgba(0, 0, 0, 0.8),
43
+ tooltip-color: #FFFFFF,
44
+ tooltip-padding: 8px 12px,
45
+ tooltip-border-radius: 6px,
46
+ tooltip-font-size: 12px
47
+ );
48
+
49
+ @mixin side-nav-theme($user-config: ()) {
50
+ $config: map.merge($default-side-nav-config, $user-config);
51
+
52
+ // Container
53
+ --cc-side-nav-bg: #{map.get($config, bg)};
54
+ --cc-side-nav-width: #{map.get($config, width)};
55
+ --cc-side-nav-collapsed-width: #{map.get($config, collapsed-width)};
56
+ --cc-side-nav-gap-sections: #{map.get($config, gap-sections)};
57
+ --cc-side-nav-padding: #{map.get($config, padding)};
58
+
59
+ // Typography Family
60
+ --cc-side-nav-font-family: #{map.get($config, font-family)};
61
+
62
+ // Headers
63
+ --cc-side-nav-heading-font-weight: #{map.get($config, heading-font-weight)};
64
+ --cc-side-nav-heading-font-size: #{map.get($config, heading-font-size)};
65
+ --cc-side-nav-heading-color: #{map.get($config, heading-color)};
66
+
67
+ // Items Config
68
+ --cc-side-nav-item-gap: #{map.get($config, item-gap)};
69
+ --cc-side-nav-item-padding: #{map.get($config, item-padding)};
70
+ --cc-side-nav-item-border-radius: #{map.get($config, item-border-radius)};
71
+
72
+ // Inactive Items
73
+ --cc-side-nav-item-font-weight: #{map.get($config, item-font-weight)};
74
+ --cc-side-nav-item-font-size: #{map.get($config, item-font-size)};
75
+ --cc-side-nav-item-color: #{map.get($config, item-color)};
76
+ --cc-side-nav-item-hover-bg: #{map.get($config, item-hover-bg)};
77
+ --cc-side-nav-item-hover-color: #{map.get($config, item-hover-color)};
78
+
79
+ // Active Items
80
+ --cc-side-nav-active-bg: #{map.get($config, active-bg)};
81
+ --cc-side-nav-active-color: #{map.get($config, active-color)};
82
+ --cc-side-nav-active-font-weight: #{map.get($config, active-font-weight)};
83
+ --cc-side-nav-active-hover-bg: #{map.get($config, active-hover-bg)};
84
+
85
+ // Disabled
86
+ --cc-side-nav-disabled-opacity: #{map.get($config, disabled-opacity)};
87
+
88
+ // Tooltip
89
+ --cc-side-nav-tooltip-bg: #{map.get($config, tooltip-bg)};
90
+ --cc-side-nav-tooltip-color: #{map.get($config, tooltip-color)};
91
+ --cc-side-nav-tooltip-padding: #{map.get($config, tooltip-padding)};
92
+ --cc-side-nav-tooltip-border-radius: #{map.get($config, tooltip-border-radius)};
93
+ --cc-side-nav-tooltip-font-size: #{map.get($config, tooltip-font-size)};
94
+ }
@@ -1,3 +1,4 @@
1
+ @use '../modules/side-nav/side-nav.theme' as sideNav;
1
2
  @import 'quill/dist/quill.snow.css';
2
3
 
3
4
  :root {
@@ -61,7 +62,7 @@
61
62
  --ms-btn-add-color: #3b82f6;
62
63
  --ms-btn-add-hover: #2563eb;
63
64
 
64
-
65
+ @include sideNav.side-nav-theme();
65
66
  }
66
67
 
67
68
  /* ----------------------------------------------------