Skip to content

Commit

Permalink
feat(design): shard paginator component (#2701)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `DaffPaginatorModule` has moved to its own package. Update imports to `@daffodil/design/paginator`
  • Loading branch information
xelaint committed Jan 2, 2024
1 parent de9ae3e commit b5338a0
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TestBed,
} from '@angular/core/testing';

import { DaffPaginatorModule } from '@daffodil/design';
import { DaffPaginatorModule } from '@daffodil/design/paginator';

import { DesignLandPaginatorComponent } from './paginator.component';

Expand Down
2 changes: 1 addition & 1 deletion apps/design-land/src/app/paginator/paginator.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffPaginatorModule } from '@daffodil/design';
import { DaffArticleModule } from '@daffodil/design/article';
import { DaffPaginatorModule } from '@daffodil/design/paginator';

import { DesignLandPaginatorRoutingModule } from './paginator-routing.module';
import { DesignLandPaginatorComponent } from './paginator.component';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';

import { DaffPaginatorModule } from '@daffodil/design';
import { DaffPaginatorModule } from '@daffodil/design/paginator';

import { BasicPaginatorComponent } from './basic-paginator.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';

import { DaffPaginatorModule } from '@daffodil/design';
import { DaffPaginatorModule } from '@daffodil/design/paginator';

import { LinkPaginatorComponent } from './link-paginator.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { DaffPaginatorModule } from '@daffodil/design';
import { DaffPaginatorModule } from '@daffodil/design/paginator';

import { PAGINATOR_EXAMPLES } from './examples';

Expand Down
8 changes: 8 additions & 0 deletions libs/design/paginator/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/design/paginator",
"lib": {
"entryFile": "src/public_api.ts",
"styleIncludePaths": ["../scss"]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use 'sass:map';
@use '../../../scss/core';
@use '../../../scss/theming';
@use '../../scss/core';
@use '../../scss/theming';

@mixin daff-paginator-theme-variant($active-color) {
color: currentColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import { DaffPaginatorComponent } from './paginator.component';
import { DaffPaginatorComponent } from './paginator/paginator.component';

@NgModule({
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import { By } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

import { DaffPaginatorComponent } from './paginator.component';
import { DaffPaginatorModule } from '../paginator.module';
import {
DaffPaginatorNumberOfPagesErrorMessage,
DaffPaginatorPageOutOfRangeErrorMessage,
} from './paginator-errors';
import { DaffPaginatorComponent } from './paginator.component';
import { DaffPaginatorModule } from './paginator.module';

} from '../utils/paginator-errors';

@Component({ template: '' })
class TestComponent {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import {
faChevronLeft,
} from '@fortawesome/free-solid-svg-icons';

import {
DaffPaginatorNumberOfPagesErrorMessage,
DaffPaginatorPageOutOfRangeErrorMessage,
} from './paginator-errors';
import {
daffColorMixin,
DaffColorable,
} from '../../core/colorable/public_api';
} from '@daffodil/design';

import {
DaffPaginatorNumberOfPagesErrorMessage,
DaffPaginatorPageOutOfRangeErrorMessage,
} from '../utils/paginator-errors';

/**
* An _elementRef and an instance of renderer2 are needed for the Colorable mixin
Expand Down
2 changes: 2 additions & 0 deletions libs/design/paginator/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { DaffPaginatorModule } from './paginator.module';
export { DaffPaginatorComponent } from './paginator/paginator.component';
2 changes: 1 addition & 1 deletion libs/design/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@use '../modal/src/modal-theme' as modal;
@use '../navbar/src/navbar-theme' as navbar;
@use '../notification/src/notification-theme' as notification;
@use '../src/molecules/paginator/paginator-theme' as paginator;
@use '../paginator/src/paginator-theme' as paginator;
@use '../sidebar/src/sidebar-theme' as sidebar;
@use '../scss/state/skeleton/mixins' as skeleton;
@use '../tree/src/tree-theme' as tree;
Expand Down
2 changes: 0 additions & 2 deletions libs/design/src/molecules/paginator/public_api.ts

This file was deleted.

1 change: 0 additions & 1 deletion libs/design/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export * from './molecules/backdrop/public_api';
export * from './molecules/button-set/public_api';
export * from './molecules/image-gallery/public_api';
export * from './molecules/image-list/public_api';
export * from './molecules/paginator/public_api';
export * from './molecules/qty-dropdown/public_api';
export * from './molecules/feature/public_api';

Expand Down

0 comments on commit b5338a0

Please sign in to comment.