@planeasyinc/le-angular 0.0.2 → 0.0.4

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.
@@ -10,7 +10,8 @@ export declare class LeContainerComponent {
10
10
  }>;
11
11
  constructor();
12
12
  onSelectionChange(view: LeNode): void;
13
- private setEffects;
13
+ private listenAuthState;
14
+ private listenPageInit;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<LeContainerComponent, never>;
15
16
  static ɵcmp: i0.ɵɵComponentDeclaration<LeContainerComponent, "le-container", never, {}, {}, never, never, true, never>;
16
17
  }
@@ -0,0 +1,54 @@
1
+ import { ElementRef, OnDestroy, TemplateRef } from '@angular/core';
2
+ import { SelectionModel } from '@angular/cdk/collections';
3
+ import { FormControl, FormGroup } from '@angular/forms';
4
+ import { FilterModel, ColumnFilterModel } from '../../services/le-filters.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class FiltersComponent implements OnDestroy, OnDestroy {
7
+ private filtersService;
8
+ private overlay;
9
+ private viewContainerRef;
10
+ private _filteredOptions;
11
+ private _isDropdownOpened;
12
+ private overlayRef;
13
+ private destroy$;
14
+ readonly isOpened: import("@angular/core").Signal<boolean>;
15
+ readonly options: import("@angular/core").Signal<ColumnFilterModel[]>;
16
+ readonly filteredOptions: import("@angular/core").Signal<ColumnFilterModel[]>;
17
+ readonly isDropdownOpened: import("@angular/core").Signal<boolean>;
18
+ protected inputEl: import("@angular/core").Signal<ElementRef<HTMLInputElement>>;
19
+ protected inputContainerEl: import("@angular/core").Signal<ElementRef<HTMLInputElement>>;
20
+ protected dropdownTpl: import("@angular/core").Signal<TemplateRef<unknown>>;
21
+ protected contentTpl: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
22
+ protected search: FormControl<any>;
23
+ protected selectedFilters: SelectionModel<{
24
+ key: string;
25
+ type: string;
26
+ label: string;
27
+ options?: string[];
28
+ }>;
29
+ protected filtersForm: FormGroup<{}>;
30
+ constructor();
31
+ ngAfterViewInit(): void;
32
+ ngOnDestroy(): void;
33
+ onApplyClick(event: Event): void;
34
+ onResetClick(event: Event): void;
35
+ onCloseClick(event: Event): void;
36
+ onInput(event: Event): void;
37
+ onInputClearClick(event: Event): void;
38
+ onFocus(event: Event): void;
39
+ onBlur(event: Event): void;
40
+ onOptionClick(control: FilterModel['control']): void;
41
+ onFilterRemoveClick(control: FilterModel['control']): void;
42
+ private closePanel;
43
+ private openPanel;
44
+ private showDropdown;
45
+ private closeDropdown;
46
+ private clearSelection;
47
+ private initFilters;
48
+ private listenSearchChanges;
49
+ private listenSelectionChanges;
50
+ private listenDropdownState;
51
+ private filter;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<FiltersComponent, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<FiltersComponent, "le-filters", never, {}, {}, never, ["*"], true, never>;
54
+ }
@@ -1,9 +1,13 @@
1
1
  import * as i0 from "@angular/core";
2
+ type leDrawerType = 'side' | 'over';
2
3
  export declare class LeDrawerDirective {
3
4
  opened: import("@angular/core").InputSignal<boolean>;
4
5
  width: import("@angular/core").InputSignal<number>;
5
6
  hideOnClose: import("@angular/core").InputSignal<boolean>;
6
- _width: import("@angular/core").Signal<number>;
7
+ type: import("@angular/core").InputSignal<leDrawerType>;
8
+ protected _width: import("@angular/core").Signal<number>;
9
+ protected _position: import("@angular/core").Signal<"absolute" | "relative">;
7
10
  static ɵfac: i0.ɵɵFactoryDeclaration<LeDrawerDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<LeDrawerDirective, "[leDrawer]", never, { "opened": { "alias": "opened"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "hideOnClose": { "alias": "hideOnClose"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LeDrawerDirective, "[leDrawer]", never, { "opened": { "alias": "opened"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "hideOnClose": { "alias": "hideOnClose"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
12
  }
13
+ export {};
@@ -14,4 +14,9 @@ export declare const ICONS_MAP: {
14
14
  viewBox: string;
15
15
  content: string[];
16
16
  };
17
+ readonly close: {
18
+ name: string;
19
+ viewBox: string;
20
+ content: string[];
21
+ };
17
22
  };
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class LeIconComponent {
3
- name: import("@angular/core").InputSignal<"chevron" | "arrow-down" | "sort">;
3
+ name: import("@angular/core").InputSignal<"chevron" | "arrow-down" | "sort" | "close">;
4
4
  size: import("@angular/core").InputSignal<string | number>;
5
5
  icon: import("@angular/core").Signal<{
6
6
  size: number;
@@ -17,6 +17,11 @@ export declare class LeIconComponent {
17
17
  name: string;
18
18
  viewBox: string;
19
19
  content: string[];
20
+ } | {
21
+ size: number;
22
+ name: string;
23
+ viewBox: string;
24
+ content: string[];
20
25
  }>;
21
26
  static ɵfac: i0.ɵɵFactoryDeclaration<LeIconComponent, never>;
22
27
  static ɵcmp: i0.ɵɵComponentDeclaration<LeIconComponent, "le-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -0,0 +1,5 @@
1
+ export declare const close: {
2
+ name: string;
3
+ viewBox: string;
4
+ content: string[];
5
+ };
@@ -6,10 +6,10 @@ export declare class LEDataService {
6
6
  private apiService;
7
7
  private _config;
8
8
  private _view;
9
- private _parentMenu;
9
+ private _parentPath;
10
10
  private _customCss;
11
11
  readonly view: import("@angular/core").Signal<LeNode>;
12
- readonly parentMenu: import("@angular/core").Signal<LeNode>;
12
+ readonly parentPath: import("@angular/core").Signal<LeNode[]>;
13
13
  readonly config: import("@angular/core").Signal<LeNode>;
14
14
  readonly customCss: import("@angular/core").Signal<string>;
15
15
  setView(node: LeNode): void;
@@ -0,0 +1,33 @@
1
+ import * as i0 from "@angular/core";
2
+ type filterType = 'EQ' | 'NEQ' | 'GT' | 'GTE' | 'LT' | 'LTE';
3
+ export interface FilterModel {
4
+ type: filterType;
5
+ control: {
6
+ key: string;
7
+ type: string;
8
+ label: string;
9
+ options?: string[];
10
+ };
11
+ }
12
+ export interface ColumnFilterModel {
13
+ label: string;
14
+ name: string;
15
+ filters: FilterModel[];
16
+ }
17
+ export declare class LEFiltersService {
18
+ private _shown;
19
+ private _options;
20
+ private _selection;
21
+ readonly shown: import("@angular/core").Signal<boolean>;
22
+ readonly options: import("@angular/core").Signal<ColumnFilterModel[]>;
23
+ readonly selection: import("@angular/core").Signal<Record<string, string>>;
24
+ open(): void;
25
+ close(): void;
26
+ updateSelection(value: Record<string, string>): void;
27
+ setOptions(options: ColumnFilterModel[]): void;
28
+ private filterValues;
29
+ private isEqual;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<LEFiltersService, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<LEFiltersService>;
32
+ }
33
+ export {};
@@ -1,6 +1,7 @@
1
1
  import { LeTableAction, LeTableNode } from '@planeasyinc/le-core';
2
2
  import { TableDataSource } from './table-data-sourse';
3
3
  import { PageChange } from './table-view.types';
4
+ import { ColumnFilterModel } from '../../services/le-filters.service';
4
5
  import * as i0 from "@angular/core";
5
6
  interface ColumnModel {
6
7
  type: string;
@@ -14,6 +15,7 @@ interface CellModel {
14
15
  export declare class TableViewComponent {
15
16
  private apiService;
16
17
  private dataService;
18
+ private filtersService;
17
19
  node: import("@angular/core").InputSignal<LeTableNode>;
18
20
  private _columns;
19
21
  private _data;
@@ -39,9 +41,11 @@ export declare class TableViewComponent {
39
41
  readonly isSortingEnabled: import("@angular/core").Signal<boolean>;
40
42
  readonly sortColumnKeys: import("@angular/core").Signal<Set<string>>;
41
43
  readonly hasRowClickAction: import("@angular/core").Signal<boolean>;
44
+ readonly filters: import("@angular/core").Signal<ColumnFilterModel[]>;
42
45
  constructor();
43
46
  onPageChange(pageChange: PageChange): void;
44
47
  onSortClick(event: Event, column: ColumnModel): void;
48
+ onFiltersClick(event: Event): void;
45
49
  onToolbarActionClick({ actions }: LeTableAction): void;
46
50
  onRowClick(row: CellModel): void;
47
51
  private processTableAction;
@@ -50,6 +54,7 @@ export declare class TableViewComponent {
50
54
  private buildRequest;
51
55
  private handleTableDataSuccessResponse;
52
56
  private handleTableDataErrorResponse;
57
+ private getFilters;
53
58
  private interpolateRowValues;
54
59
  private setEffects;
55
60
  static ɵfac: i0.ɵɵFactoryDeclaration<TableViewComponent, never>;
@@ -153,6 +153,20 @@ ul {
153
153
  flex: 1 1 auto;
154
154
  }
155
155
 
156
+ .le-divider {
157
+ background-color: var(--le-color-divider);
158
+
159
+ &-horizontal {
160
+ height: 1px;
161
+ width: 100%;
162
+ }
163
+
164
+ &-vertical {
165
+ width: 1px;
166
+ height: 100%;
167
+ }
168
+ }
169
+
156
170
  @mixin flex-row {
157
171
  display: flex;
158
172
  flex-direction: row;
@@ -440,6 +454,10 @@ ul {
440
454
  padding-left: 32px;
441
455
  }
442
456
 
457
+ .le-menu-group .le-menu-item {
458
+ padding-left: 48px;
459
+ }
460
+
443
461
  &.le-menu-group--expanded {
444
462
  opacity: 1;
445
463
  max-height: 5000px;
@@ -451,11 +469,12 @@ ul {
451
469
  ========================== */
452
470
 
453
471
  .le-toolbar {
454
- display: flex;
455
- flex-direction: row;
456
- align-items: center;
457
- justify-content: space-between;
472
+ @include flex-row;
473
+ @include align-center;
474
+ @include justify-between;
475
+
458
476
  height: 60px;
477
+ gap: 16px;
459
478
  }
460
479
 
461
480
  .le-table-container {
@@ -510,6 +529,7 @@ ul {
510
529
  @include flex-row;
511
530
  @include align-center;
512
531
  @include justify-between;
532
+ gap: 1rex;
513
533
  }
514
534
 
515
535
  .le-table-header-cell {
@@ -621,7 +641,7 @@ $sort-icon-size: 6px;
621
641
  @include align-center;
622
642
  @include justify-center;
623
643
  margin: 0 2px;
624
- width: calc($sort-icon-size * 3);
644
+ width: calc($sort-icon-size * 7);
625
645
  height: calc($sort-icon-size * 3);
626
646
  }
627
647
 
@@ -758,3 +778,113 @@ $sort-icon-size: 6px;
758
778
  background-color: var(--le-color-background);
759
779
  margin-bottom: 16px;
760
780
  }
781
+
782
+ /* =========================
783
+ FILTERS
784
+ ========================== */
785
+ .le-filters-container {
786
+ @include flex-column;
787
+ gap: 16px;
788
+ padding: 16px 8px;
789
+ width: 320px;
790
+ overflow-x: hidden;
791
+ }
792
+
793
+ .le-filters-title {
794
+ font-size: var(--le-font-size-lg);
795
+ font-weight: var(--le-font-weight-semibold);
796
+ }
797
+
798
+ .le-filters-actions {
799
+ @include flex-row;
800
+ @include justify-between;
801
+ }
802
+
803
+ .le-autocomplete-container {
804
+ @include flex-row;
805
+ @include align-center;
806
+
807
+ border: 1px solid var(--le-color-border);
808
+ padding: 2px 4px;
809
+ }
810
+
811
+ .le-button-icon {
812
+ @include flex-column;
813
+ @include align-center;
814
+ @include justify-center;
815
+
816
+ flex-shrink: 0;
817
+ border-radius: 50%;
818
+ padding: 0;
819
+ margin: 0;
820
+ border: 0;
821
+ width: 24px;
822
+ height: 24px;
823
+ }
824
+
825
+ .le-autocomplete-input {
826
+ border: 0;
827
+ width: 100%;
828
+ padding: 4px;
829
+
830
+ &:focus {
831
+ outline: none;
832
+ }
833
+ }
834
+
835
+ .le-autocomplete-panel {
836
+ height: 200px;
837
+ overflow: auto;
838
+ box-shadow: var(--le-dropdown-shadow);
839
+ background-color: var(--le-color-background);
840
+ }
841
+
842
+ .le-autocomplete-label, .le-autocomplete-option {
843
+ padding-top: 4px;
844
+ padding-bottom: 4px;
845
+ }
846
+ .le-autocomplete-label {
847
+ color: var(--le-color-gray-500);
848
+ padding-left: 8px;
849
+ }
850
+
851
+ .le-autocomplete-option {
852
+ padding-left: 16px;
853
+ cursor: pointer;
854
+
855
+ &:hover {
856
+ background-color: var(--le-color-gray-200);
857
+ }
858
+
859
+ &--selected {
860
+ background-color: var(--le-color-gray-100);
861
+ }
862
+ }
863
+
864
+ .le-filters-list {
865
+ @include flex-column;
866
+ gap: 8px;
867
+ }
868
+
869
+ .le-filters-list-item {
870
+ @include flex-column;
871
+ gap: 4px;
872
+
873
+ div {
874
+ @include flex-row;
875
+ @include align-center;
876
+ gap: 4px;
877
+ }
878
+
879
+ select,
880
+ input {
881
+ &:focus {
882
+ outline: none;
883
+ }
884
+ border-color: var(--le-color-border);
885
+ border-style: solid;
886
+ border-width: 1px;
887
+ flex-grow: 1;
888
+ padding: 4px 8px;
889
+ }
890
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planeasyinc/le-angular",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "exports": {
6
6
  ".": {
@@ -21,6 +21,7 @@
21
21
  "@angular/common": ">=17.0.0 <20.0.0",
22
22
  "@angular/cdk": ">=17.0.0 <20.0.0",
23
23
  "@angular/animations": ">=17.0.0 <20.0.0",
24
+ "@angular/forms": ">=17.0.0 <20.0.0",
24
25
  "rxjs": ">=7.0.0",
25
26
  "@planeasyinc/le-core": "^0.0.1",
26
27
  "@planeasyinc/fe-adapters-old": "^0.1",