From d45bd7ecc21acddfa3c47d0d78936758b99fc8ef Mon Sep 17 00:00:00 2001 From: Albert Kaaman Date: Fri, 22 Feb 2019 11:20:34 +0100 Subject: [PATCH] refactor: data-table (#5737) initial rewrite of data-table and data-iterator --- .../docs/src/examples/data-tables/crud.vue | 147 ++-- .../src/examples/data-tables/customIcons.vue | 17 +- .../docs/src/examples/data-tables/expand.vue | 52 +- .../docs/src/examples/data-tables/footer.vue | 8 - .../src/examples/data-tables/headerCell.vue | 8 - .../src/examples/data-tables/headerless.vue | 28 +- .../docs/src/examples/data-tables/headers.vue | 77 +- .../docs/src/examples/data-tables/noData.vue | 4 +- .../src/examples/data-tables/paginate.vue | 34 +- .../src/examples/data-tables/progress.vue | 10 +- .../docs/src/examples/data-tables/search.vue | 14 +- .../docs/src/examples/data-tables/select.vue | 20 +- .../docs/src/examples/data-tables/server.vue | 27 +- .../docs/src/examples/data-tables/sort.vue | 28 +- .../docs/src/examples/data-tables/usage.vue | 12 +- .../components/VCheckbox/VSimpleCheckbox.ts | 81 ++ .../vuetify/src/components/VCheckbox/index.js | 3 +- .../vuetify/src/components/VData/VData.ts | 350 ++++++++ .../src/components/VData/VDataFooter.ts | 215 +++++ .../vuetify/src/components/VData/index.ts | 11 + .../components/VDataIterator/VDataIterator.js | 110 --- .../components/VDataIterator/VDataIterator.ts | 212 +++++ .../VDataIterator/{index.js => index.ts} | 0 .../src/components/VDataTable/VDataTable.js | 121 --- .../src/components/VDataTable/VDataTable.sass | 293 +++++++ .../src/components/VDataTable/VDataTable.ts | 477 ++++++++++ .../components/VDataTable/VDataTableHeader.ts | 27 + .../VDataTable/VDataTableHeaderDesktop.ts | 92 ++ .../VDataTable/VDataTableHeaderMobile.ts | 80 ++ .../VDataTable/VDataTableVirtual.ts | 126 +++ .../vuetify/src/components/VDataTable/VRow.ts | 57 ++ .../src/components/VDataTable/VRowGroup.ts | 48 ++ .../src/components/VDataTable/_mixins.sass | 56 ++ .../src/components/VDataTable/_variables.scss | 0 .../VDataTable/{index.js => index.ts} | 8 +- .../src/components/VDataTable/mixins/body.js | 77 -- .../src/components/VDataTable/mixins/foot.js | 24 - .../src/components/VDataTable/mixins/head.js | 138 --- .../components/VDataTable/mixins/header.ts | 82 ++ .../components/VDataTable/mixins/progress.js | 17 - packages/vuetify/src/components/index.ts | 1 + packages/vuetify/src/locale/en.ts | 14 +- packages/vuetify/src/mixins/data-iterable.js | 495 ----------- .../src/stylus/components/_data-table.styl | 322 +++++-- .../src/stylus/components/_tables.styl | 100 --- packages/vuetify/src/util/helpers.ts | 84 +- .../VDataIterator/VDataIterator.spec.js | 2 +- .../__snapshots__/VDataIterator.spec.js.snap | 814 ------------------ .../components/VDataTable/VDataTable.spec.js | 2 +- .../__snapshots__/VDataTable.spec.js.snap | 667 -------------- .../test/unit/mixins/data-iterable.spec.js | 126 --- 51 files changed, 2762 insertions(+), 3056 deletions(-) create mode 100644 packages/vuetify/src/components/VCheckbox/VSimpleCheckbox.ts create mode 100644 packages/vuetify/src/components/VData/VData.ts create mode 100644 packages/vuetify/src/components/VData/VDataFooter.ts create mode 100644 packages/vuetify/src/components/VData/index.ts delete mode 100644 packages/vuetify/src/components/VDataIterator/VDataIterator.js create mode 100644 packages/vuetify/src/components/VDataIterator/VDataIterator.ts rename packages/vuetify/src/components/VDataIterator/{index.js => index.ts} (100%) delete mode 100644 packages/vuetify/src/components/VDataTable/VDataTable.js create mode 100644 packages/vuetify/src/components/VDataTable/VDataTable.sass create mode 100644 packages/vuetify/src/components/VDataTable/VDataTable.ts create mode 100644 packages/vuetify/src/components/VDataTable/VDataTableHeader.ts create mode 100644 packages/vuetify/src/components/VDataTable/VDataTableHeaderDesktop.ts create mode 100644 packages/vuetify/src/components/VDataTable/VDataTableHeaderMobile.ts create mode 100644 packages/vuetify/src/components/VDataTable/VDataTableVirtual.ts create mode 100644 packages/vuetify/src/components/VDataTable/VRow.ts create mode 100644 packages/vuetify/src/components/VDataTable/VRowGroup.ts create mode 100644 packages/vuetify/src/components/VDataTable/_mixins.sass create mode 100644 packages/vuetify/src/components/VDataTable/_variables.scss rename packages/vuetify/src/components/VDataTable/{index.js => index.ts} (56%) delete mode 100644 packages/vuetify/src/components/VDataTable/mixins/body.js delete mode 100644 packages/vuetify/src/components/VDataTable/mixins/foot.js delete mode 100644 packages/vuetify/src/components/VDataTable/mixins/head.js create mode 100644 packages/vuetify/src/components/VDataTable/mixins/header.ts delete mode 100644 packages/vuetify/src/components/VDataTable/mixins/progress.js delete mode 100644 packages/vuetify/src/mixins/data-iterable.js delete mode 100644 packages/vuetify/src/stylus/components/_tables.styl delete mode 100644 packages/vuetify/test/unit/components/VDataIterator/__snapshots__/VDataIterator.spec.js.snap delete mode 100644 packages/vuetify/test/unit/components/VDataTable/__snapshots__/VDataTable.spec.js.snap delete mode 100644 packages/vuetify/test/unit/mixins/data-iterable.spec.js diff --git a/packages/docs/src/examples/data-tables/crud.vue b/packages/docs/src/examples/data-tables/crud.vue index b986d3d480e..f57fbd32768 100644 --- a/packages/docs/src/examples/data-tables/crud.vue +++ b/packages/docs/src/examples/data-tables/crud.vue @@ -1,82 +1,75 @@ diff --git a/packages/docs/src/examples/data-tables/progress.vue b/packages/docs/src/examples/data-tables/progress.vue index a656371779f..f79dff34d2e 100644 --- a/packages/docs/src/examples/data-tables/progress.vue +++ b/packages/docs/src/examples/data-tables/progress.vue @@ -5,14 +5,8 @@ :loading="true" class="elevation-1" > - - diff --git a/packages/docs/src/examples/data-tables/search.vue b/packages/docs/src/examples/data-tables/search.vue index 2900c7b3b5c..316fb0a8d5d 100644 --- a/packages/docs/src/examples/data-tables/search.vue +++ b/packages/docs/src/examples/data-tables/search.vue @@ -16,17 +16,11 @@ :items="desserts" :search="search" > - diff --git a/packages/docs/src/examples/data-tables/select.vue b/packages/docs/src/examples/data-tables/select.vue index 7a9052a14e7..3873474a872 100644 --- a/packages/docs/src/examples/data-tables/select.vue +++ b/packages/docs/src/examples/data-tables/select.vue @@ -4,25 +4,9 @@ :headers="headers" :items="desserts" item-key="name" - select-all + show-select class="elevation-1" - > - - + >