Skip to content

Commit

Permalink
updated API specs
Browse files Browse the repository at this point in the history
  • Loading branch information
BabyElias committed Aug 29, 2024
1 parent 34479c3 commit 1208c1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
12 changes: 0 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ Changelog is rather internal in nature. See release notes for the public overvie

[#650]: https://github.com/learningequality/kolibri-design-system/pull/650


[#727]
- **Description:** Initial implementation of `KTable` component
- **Products impact:** New Component
- **Addresses:** [#328](https://github.com/learningequality/kolibri-design-system/issues/328)
- **Components:** KTable
- **Breaking:** No
- **Impacts a11y:** Yes
- **Guidance:**
[#727] https://github.com/learningequality/kolibri-design-system/pull/727


- [#723]
- **Description:** Updates $core-time value from 0.25s to 0.15s
- **Products impact:** User experience - faster transitions
Expand Down
4 changes: 1 addition & 3 deletions docs/pages/playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
:rows="rows"
caption="Local Sorting Table"
:style="{height: '300px'}"
:useLocalSorting="true"
sortable
>
<template #header="{ header, index }">
Expand All @@ -32,8 +31,8 @@
:headers="headersWithCustomWidths"
:rows="backendRows"
caption="Backend Sorting Table"
:useLocalSorting="false"
sortable
disableDefaultSorting
@changeSort="changeSortHandler"
>
<template #header="{ header, index }">
Expand All @@ -53,7 +52,6 @@
:headers="headers"
:rows="rows"
caption="Non Sortable Table"
:sortable="false"
/>

</div>
Expand Down
13 changes: 7 additions & 6 deletions lib/KTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
setup(props, { emit }) {
const headers = ref(props.headers);
const rows = ref(props.rows);
const useLocalSorting = ref(props.useLocalSorting);
const useLocalSorting = ref(props.sortable && !props.disableDefaultSorting);
const {
sortKey,
sortOrder,
Expand All @@ -112,8 +112,8 @@
} = useSorting(headers, rows, useLocalSorting);
const finalRows = computed(() => {
if (props.sortable) {
return useLocalSorting.value ? sortedRows.value : rows.value;
if (props.sortable && !props.disableDefaultSorting) {
return sortedRows.value;
} else {
return rows.value;
}
Expand Down Expand Up @@ -191,10 +191,11 @@
type: String,
required: true,
},
/**
* Enables or disables local sorting of the table data.
* Disables the default sorting when sortable is true. Facilitates integration with externally sorted data.
*/
useLocalSorting: {
disableDefaultSorting: {
type: Boolean,
default: false,
},
Expand All @@ -203,7 +204,7 @@
*/
sortable: {
type: Boolean,
default: true,
default: false,
},
/**
* The message to display when the table is empty.
Expand Down

0 comments on commit 1208c1a

Please sign in to comment.