Skip to content

Commit

Permalink
feat(moduleless): migrating to standalone modules support (#6669)
Browse files Browse the repository at this point in the history
* feat(accordion): migrated to standalone

* feat(accordion): migrated to standalone

* feat(alert)): migrated to standalone

* feat(buttons): migrated to standalone

* feat(carousel): migrated to standalone

* feat(collapse): migrated to standalone

* feat(datepicker): migrated to standalone

* fix(accordion): fixed tests

* fix(accordion): fixed tests

* fix(accordion): fixed tests

* fix(accordion): fixed tests

* fix(accordion): fixed tests

* fix(carousel): fixed tests

* feat(dropdown): added moduleless support

* feat(focustrap): added moduleless support

* feat(modal): added moduleless support

* feat(pagination): added moduleless support

* feat(popover): added moduleless support

* feat(progressbar): added moduleless support

* feat(rating): added moduleless support

* feat(sortable): added moduleless support

* feat(tabs): added moduleless support

* feat(timepicker): added moduleless support

* feat(timepicker): added moduleless support

* feat(typeahead): added moduleless support

* feat(typeahead): added moduleless support

* fix(rating): tests ajust to moduleless

* fix(progressbar): tests ajust to moduleless

* chore(docs): added deprecations

* chore(docs): updated documentation regarding standalone usage

* chore(docs): updated documentation regarding standalone usage

* fix(modal): fixed nested backdrop issue

* 18.1.0

* chore(version): bumped version to 18.1.0
  • Loading branch information
lexasq authored Oct 16, 2024
1 parent d210ca6 commit 2c7d6f0
Show file tree
Hide file tree
Showing 173 changed files with 1,005 additions and 664 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip';
@NgModule({
...
imports: [TooltipModule.forRoot(),...]
imports: [TooltipModule,...]
...
})
```
Expand Down
2 changes: 1 addition & 1 deletion apps/ngx-bootstrap-docs/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { routes } from './app.routing';
bootstrap: [AppComponent], imports: [BrowserAnimationsModule,
DocsModule,
RouterModule.forRoot(routes, { useHash: environment.useHash }),
BsDropdownModule.forRoot()], providers: [
BsDropdownModule], providers: [
{ provide: NgApiDoc, useValue: ngdoc },
{ provide: DOCS_TOKENS, useValue: routes },
{ provide: SIDEBAR_ROUTES, useValue: SidebarRoutesStructure },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "18.0.2"
"version": "18.1.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h2 id="getting-started">Schematics</h2>
],
<span class="kwd">imports</span>: [
<span class="pln"> &hellip;</span>
<span class="lit">AccordionModule.forRoot()</span>,
<span class="lit">AccordionModule</span>,
],
bootstrap: [AppComponent]
<span class="pun">{{'}'}}</span>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export { ExamplesComponent } from './examples.component';
CommonModule,
NgApiDocModule,
RouterModule,
TabsModule.forRoot(),
TabsModule,
],
exports: [
ExamplesComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { ${className === 'DemoModalServiceFromComponent' ? `${className}, ModalC
declarations: [${className === 'DemoModalServiceFromComponent' ? `${className}, ModalContentComponent` : className}],
imports: [
${moduleData.moduleName}.forRoot(),
${className === 'DemoModalWithPopupsComponent' ? `TooltipModule.forRoot(),
PopoverModule.forRoot(),` : ''}
${className === 'DemoModalWithPopupsComponent' ? `TooltipModule,
PopoverModule,` : ''}
BrowserAnimationsModule,
CommonModule,
FormsModule,
Expand Down
4 changes: 2 additions & 2 deletions libs/common-docs/src/lib/docs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export { ThemesComponent } from './common/themes/themes.component';
NgApiDocModule,
ExamplesComponentModule,
ApiSectionsComponentModule,
TabsModule.forRoot(),
BsDropdownModule.forRoot(),
TabsModule,
BsDropdownModule,
RouterModule
],
exports: [
Expand Down
2 changes: 1 addition & 1 deletion libs/doc-pages/accordion/src/lib/accordion.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { AccordionSectionComponent } from './accordion-section.component';
...DEMO_COMPONENTS
],
imports: [
AccordionModule.forRoot(),
AccordionModule,
CommonModule,
FormsModule,
DocsModule,
Expand Down
20 changes: 19 additions & 1 deletion libs/doc-pages/accordion/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
### Standalone component usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { AccordionComponent, AccordionPanelComponent } from 'ngx-bootstrap/accordion';

@Component({
standalone: true,
imports: [
BrowserAnimationsModule,
AccordionComponent,
AccordionPanelComponent
...
]
})
export class AppComponent(){}

Also should be added web-animations-js polyfill for IE browser (Edge)
### Module usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { AccordionModule } from 'ngx-bootstrap/accordion';

@NgModule({
imports: [
BrowserAnimationsModule,
AccordionModule.forRoot(),
AccordionModule,
...
]
})
Expand Down
2 changes: 1 addition & 1 deletion libs/doc-pages/alerts/src/lib/alerts.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export { AlertsSectionComponent } from './alerts-section.component';
...DEMO_COMPONENTS
],
imports: [
AlertModule.forRoot(),
AlertModule,
CommonModule,
DocsModule,
RouterModule.forChild(routes)
Expand Down
13 changes: 12 additions & 1 deletion libs/doc-pages/alerts/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
### Standalone component usage
import { AlertComponent } from 'ngx-bootstrap/alert';

@Components({
standalone: true,
imports: [AlertComponent,...]
})
export class AppComponent(){}


### Module usage
import { AlertModule } from 'ngx-bootstrap/alert';

@NgModule({
imports: [AlertModule.forRoot(),...]
imports: [AlertModule,...]
})
export class AppModule(){}
2 changes: 1 addition & 1 deletion libs/doc-pages/buttons/src/lib/buttons.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export { ButtonsSectionComponent } from './buttons-section.component';
CommonModule,
DocsModule,
RouterModule.forChild(routes),
ButtonsModule.forRoot()
ButtonsModule
],
exports: [ButtonsSectionComponent]
})
Expand Down
15 changes: 14 additions & 1 deletion libs/doc-pages/buttons/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
### Standalone component usage
import { ButtonsModule } from 'ngx-bootstrap/buttons';

@Component({
imports: [
ButtonsModule,
...
]
})
export class AppComponent(){}


### Module usage
import { ButtonsModule } from 'ngx-bootstrap/buttons';

@NgModule({
imports: [ButtonsModule.forRoot(),...]
imports: [ButtonsModule,...]
})
export class AppModule(){}
2 changes: 1 addition & 1 deletion libs/doc-pages/carousel/src/lib/carousel.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export { CarouselSectionComponent } from './carousel-section.component';
...DEMO_COMPONENTS
],
imports: [
CarouselModule.forRoot(),
CarouselModule,
CommonModule,
FormsModule,
DocsModule,
Expand Down
15 changes: 14 additions & 1 deletion libs/doc-pages/carousel/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
### Standalone component usage
import { CarouselModule } from 'ngx-bootstrap/carousel';

@Component({
imports: [
CarouselModule,
...
]
})
export class AppComponent(){}


### Module usage
import { CarouselModule } from 'ngx-bootstrap/carousel';

@NgModule({
imports: [CarouselModule.forRoot(),...]
imports: [CarouselModule,...]
})
export class AppModule(){}
2 changes: 1 addition & 1 deletion libs/doc-pages/collapse/src/lib/collapse.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { CollapseSectionComponent } from './collapse-section.component';
...DEMO_COMPONENTS
],
imports: [
CollapseModule.forRoot(),
CollapseModule,
CommonModule,
FormsModule,
DocsModule,
Expand Down
18 changes: 17 additions & 1 deletion libs/doc-pages/collapse/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
### Standalone component usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { CollapseDirective } from 'ngx-bootstrap/collapse';

@Component({
imports: [
BrowserAnimationsModule,
CollapseDirective,
...
]
})
export class AppComponent(){}


### Module usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { CollapseModule } from 'ngx-bootstrap/collapse';

@NgModule({
imports: [
BrowserAnimationsModule,
CollapseModule.forRoot(),
CollapseModule,
...
]
})
Expand Down
4 changes: 2 additions & 2 deletions libs/doc-pages/datepicker/src/lib/datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ locales.forEach((locale: LocaleData) => {
...DEMO_COMPONENTS
],
imports: [
BsDatepickerModule.forRoot(),
TabsModule.forRoot(),
BsDatepickerModule,
TabsModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
Expand Down
4 changes: 2 additions & 2 deletions libs/doc-pages/datepicker/src/lib/demo-datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ locales.forEach((locale: LocaleData) => {
...DEMO_COMPONENTS
],
imports: [
BsDatepickerModule.forRoot(),
TabsModule.forRoot(),
BsDatepickerModule,
TabsModule,
CommonModule,
FormsModule,
ReactiveFormsModule,
Expand Down
18 changes: 17 additions & 1 deletion libs/doc-pages/datepicker/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
### Standalone component usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';

@Components({
imports: [
BrowserAnimationsModule,
BsDatepickerModule,
...
]
})
export class AppComponents(){}


### Module usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';

@NgModule({
imports: [
BrowserAnimationsModule,
BsDatepickerModule.forRoot(),
BsDatepickerModule,
...
]
})
Expand Down
19 changes: 18 additions & 1 deletion libs/doc-pages/dropdown/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
### Standalone component usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { BsDropdownModule } from 'ngx-bootstrap/datepicker';

@Components({
standalone: true,
imports: [
BrowserAnimationsModule,
BsDropdownModule,
...
]
})
export class AppComponents(){}


### Module usage
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { BsDropdownModule } from 'ngx-bootstrap/dropdown';

@NgModule({
imports: [
BrowserAnimationsModule,
BsDropdownModule.forRoot()
BsDropdownModule
]
})
export class AppModule(){}
Expand Down
2 changes: 1 addition & 1 deletion libs/doc-pages/dropdown/src/lib/dropdown.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { DropdownSectionComponent } from './dropdown-section.component';
...DEMO_COMPONENTS
],
imports: [
BsDropdownModule.forRoot(),
BsDropdownModule,
CommonModule,
FormsModule,
DocsModule,
Expand Down
14 changes: 13 additions & 1 deletion libs/doc-pages/modal/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
### Standalone component usage
import { ModalModule, BsModalService } from 'ngx-bootstrap/modal';

@Component({
standalone: true,
imports: [ModalModule,...], // module can be optional
providers: [BsModalService]
})
export class AppComponent(){}

### Module usage
import { ModalModule } from 'ngx-bootstrap/modal';

@NgModule({
imports: [ModalModule.forRoot(),...]
imports: [ModalModule,...],
providers: [BsModalService]
})
export class AppModule(){}
11 changes: 6 additions & 5 deletions libs/doc-pages/modal/src/lib/modal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { ModalModule } from 'ngx-bootstrap/modal';
import { BsModalService, ModalModule } from 'ngx-bootstrap/modal';

import { DocsModule } from '@ngx-bootstrap-doc/docs';
import { ModalSectionComponent } from './modal-section.component';
Expand All @@ -24,14 +24,15 @@ export { ModalSectionComponent } from './modal-section.component';
...DEMO_COMPONENTS
],
imports: [
ModalModule.forRoot(),
PopoverModule.forRoot(),
TooltipModule.forRoot(),
ModalModule,
PopoverModule,
TooltipModule,
CommonModule,
FormsModule,
DocsModule,
RouterModule.forChild(routes)
],
exports: [ModalSectionComponent]
exports: [ModalSectionComponent],
providers: [BsModalService]
})
export class DemoModalModule {}
12 changes: 11 additions & 1 deletion libs/doc-pages/pagination/src/lib/docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
### Standalone component usage
import { PaginationModule } from 'ngx-bootstrap/pagination';

@Component({
standalone: true,
imports: [PaginationModule,...],
})
export class AppComponent(){}

### Module usage
import { PaginationModule } from 'ngx-bootstrap/pagination';

@NgModule({
imports: [PaginationModule.forRoot(),...]
imports: [PaginationModule,...]
})
export class AppModule(){}
2 changes: 1 addition & 1 deletion libs/doc-pages/pagination/src/lib/pagination.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { PaginationSectionComponent } from './pagination-section.component';
...DEMO_COMPONENTS
],
imports: [
PaginationModule.forRoot(),
PaginationModule,
CommonModule,
FormsModule,
DocsModule,
Expand Down
Loading

0 comments on commit 2c7d6f0

Please sign in to comment.