Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit f75fd81

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
refactor(example): move style import to angular.json
- also use appendTo="body" with ng-select all the time
1 parent 3536263 commit f75fd81

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"node_modules/flatpickr/dist/flatpickr.min.css",
2626
"node_modules/font-awesome/css/font-awesome.css",
2727
"src/assets/lib/multiple-select/multiple-select.css",
28+
"node_modules/@ng-select/ng-select/themes/default.theme.css",
2829
"src/app/slickgrid-custom-variables.scss",
2930
"src/styles.scss"
3031
],
@@ -92,6 +93,7 @@
9293
"node_modules/flatpickr/dist/flatpickr.min.css",
9394
"node_modules/font-awesome/css/font-awesome.css",
9495
"src/assets/lib/multiple-select/multiple-select.css",
96+
"node_modules/@ng-select/ng-select/themes/default.theme.css",
9597
"src/app/slickgrid-custom-variables.scss",
9698
"src/styles.scss"
9799
],
@@ -151,4 +153,4 @@
151153
"prefix": "app"
152154
}
153155
}
154-
}
156+
}

src/app/examples/editor-ng-select.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { Component } from '@angular/core';
22
import { Subject } from 'rxjs';
33

4+
// the appendTo="body" (necessary for SlickGrid filter) requires the body to be position relative like so
5+
// <body style="position: relative">
46
@Component({
57
template: `
68
<ng-select class="no-style-select"
79
[items]="collection"
810
autofocus
911
bindValue="id"
1012
bindLabel="name"
13+
appendTo="body"
1114
[clearable]="false"
1215
(change)="onChange($event)"
1316
[(ngModel)]="selectedId"

src/app/examples/filter-ng-select.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { Subject } from 'rxjs';
99
[items]="collection"
1010
bindValue="id"
1111
bindLabel="name"
12-
[clearable]="false"
1312
appendTo="body"
13+
[clearable]="false"
1414
(change)="onChange($event)"
1515
[(ngModel)]="selectedId"
1616
>

src/app/examples/grid-angular.component.scss

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ h3 {
55
.subtitle {
66
font-size: 18px;
77
}
8-
.ng-select.custom {
9-
border:0px;
10-
max-height: 27px;
11-
border-radius: 0;
12-
}
13-
.ng-input {
14-
padding-top: -4px !important;
15-
padding-left: 4px !important;
8+
.slick-headerrow-column {
9+
.ng-input {
10+
padding-top: -4px !important;
11+
padding-left: 4px !important;
12+
}
1613
}

src/app/examples/grid-angular.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CustomAngularComponentFilter } from './custom-angularComponentFilter';
21
import { Component, Injectable, OnInit, ViewEncapsulation } from '@angular/core';
32
import { TranslateService } from '@ngx-translate/core';
43
import {
@@ -11,10 +10,10 @@ import {
1110
Formatters,
1211
GridOption,
1312
OnEventArgs,
14-
OperatorType,
1513
} from './../modules/angular-slickgrid';
1614
import { EditorNgSelectComponent } from './editor-ng-select.component';
1715
import { CustomAngularComponentEditor } from './custom-angularComponentEditor';
16+
import { CustomAngularComponentFilter } from './custom-angularComponentFilter';
1817
import { CustomTitleFormatterComponent } from './custom-titleFormatter.component';
1918
import { FilterNgSelectComponent } from './filter-ng-select.component';
2019

src/styles.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@
2020
.faded:hover {
2121
opacity: 0.5;
2222
}
23-
24-
@import "~@ng-select/ng-select/themes/default.theme.css";

0 commit comments

Comments
 (0)