Skip to content

Commit 1dd8370

Browse files
authored
Merge branch 'master' into issue#276
2 parents f57d2d1 + f741f09 commit 1dd8370

File tree

9 files changed

+142
-308
lines changed

9 files changed

+142
-308
lines changed

.storybook/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ addDecorator(
2727
);
2828

2929
// load global styles
30-
require("!style-loader!css-loader!sass-loader!./preview.scss");
31-
require("!style-loader!css-loader!sass-loader!./preview-experimental.scss");
30+
require("!style-loader!css-loader!postcss-loader!sass-loader!./preview.scss");
31+
require("!style-loader!css-loader!postcss-loader!sass-loader!./preview-experimental.scss");
3232

3333
require("../src/index.stories");
3434
// automatically import all files ending in *.stories.ts

src/file-uploader/file-uploader.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ export class FileUploader implements OnInit {
144144

145145
onFilesAdded() {
146146
const files = this.fileInput.nativeElement.files;
147+
if (!this.multiple) {
148+
this.files.clear();
149+
}
147150
for (let file of files) {
148151
const fileItem: FileItem = {
149152
uploaded: false,

src/file-uploader/file-uploader.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FileUploaderStory {
3535
static notificationCount = 0;
3636

3737
@Input() notificationId = `notification-${FileUploaderStory.notificationCount}`;
38-
@Input() files: any;
38+
@Input() files = new Set();
3939
@Input() title;
4040
@Input() description;
4141
@Input() buttonText;

src/pagination/pagination.component.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ExperimentalService } from "./../experimental.module";
2323
*
2424
* ```typescript
2525
* selectPage(page) {
26-
* // ... your code to laod the page goes here
26+
* // ... your code to load the page goes here
2727
*
2828
* this.model.currentPage = page;
2929
*
@@ -279,7 +279,6 @@ export class Pagination {
279279
* `PaginationModel` with the information about pages you're controlling.
280280
*
281281
* @type {Model}
282-
* @memberof Pagination
283282
*/
284283
@Input() model: PaginationModel;
285284

@@ -327,32 +326,28 @@ export class Pagination {
327326
*
328327
* You should tie into this and update `model.currentPage` once the fresh
329328
* data is finally loaded.
330-
*
331-
* @memberof Pagination
332329
*/
333330
@Output() selectPage = new EventEmitter<number>();
334331

335332
get itemsPerPage() {
336333
return this.model.pageLength;
337334
}
338335
set itemsPerPage(value) {
339-
this.model.pageLength = value;
336+
this.model.pageLength = Number(value);
340337
this.currentPage = 1; // reset page
341338
}
342339

343340
get currentPage() {
344341
return this.model.currentPage;
345342
}
346343
set currentPage(value) {
344+
value = Number(value);
347345
// emits the value to allow the user to update current page
348346
// in the model once the page is loaded
349347
this.selectPage.emit(value);
350348
}
351349
/**
352350
* The last page number to display in the pagination view.
353-
*
354-
* @returns {number}
355-
* @memberof Pagination
356351
*/
357352
get lastPage(): number {
358353
const last = Math.ceil(this.model.totalDataLength / this.model.pageLength);
@@ -371,19 +366,13 @@ export class Pagination {
371366

372367
/**
373368
* The previous page number to navigate to, from the current page.
374-
*
375-
* @returns {number}
376-
* @memberof Pagination
377369
*/
378370
get previousPage(): number {
379371
return this.currentPage <= 1 ? 1 : this.currentPage - 1;
380372
}
381373

382374
/**
383375
* The next page number to navigate to, from the current page.
384-
*
385-
* @returns {number}
386-
* @memberof Pagination
387376
*/
388377
get nextPage(): number {
389378
const lastPage = this.lastPage;
@@ -412,12 +401,7 @@ export class Pagination {
412401
/**
413402
* Generates a list of numbers. (Python function)
414403
* Used to display the correct pagination controls.
415-
*
416-
* @param {number} stop
417-
* @param {number} [start=0]
418-
* @param {number} [step=1]
419404
* @returns {array}
420-
* @memberof Pagination
421405
*/
422406
range(stop: number, start = 0, step = 1) {
423407
return range(stop, start, step);

0 commit comments

Comments
 (0)