Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Implementation Of KTable Component #727

Merged
merged 104 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
2f527c3
Initialisating KTable Component
BabyElias May 30, 2024
523168e
Initialised KTable (fixed linting)
BabyElias May 30, 2024
9109552
Fixed linting errors
BabyElias May 30, 2024
5b13c64
fixed failing tests
BabyElias May 30, 2024
ba89898
Merge pull request #647 from BabyElias/gsoc-table
MisRob May 31, 2024
60caa84
Added sorting functionality
BabyElias Jun 3, 2024
b85a6d3
organised file structure
BabyElias Jun 3, 2024
2784a07
added ktable to playground
BabyElias Jun 3, 2024
058e4c8
fixed linting errors
BabyElias Jun 3, 2024
b8db731
fixed linting errors
BabyElias Jun 3, 2024
bce8877
fixing linting errors, again
BabyElias Jun 3, 2024
491fe19
Merge pull request #649 from BabyElias/gsoc-table
MisRob Jun 5, 2024
f464d27
added scoped slots and sorting composable
BabyElias Jun 9, 2024
de583df
removed unnecessary validator
BabyElias Jun 9, 2024
2209b03
Merge branch 'learningequality:gsoc-table' into gsoc-table
BabyElias Jun 9, 2024
6f78cd7
Merge pull request #654 from BabyElias/gsoc-table
MisRob Jun 11, 2024
583999a
added changesort event handler and tests
BabyElias Jun 13, 2024
f843b55
Merge pull request #655 from BabyElias/gsoc-table
MisRob Jun 14, 2024
31f0f61
Added date sorting
BabyElias Jun 17, 2024
23a4c65
Merge branch 'learningequality:gsoc-table' into gsoc-table
BabyElias Jun 17, 2024
37beb3f
Fixed screen reader loading states
BabyElias Jun 18, 2024
218205b
Merge pull request #657 from BabyElias/gsoc-table
MisRob Jun 18, 2024
b8b752e
enhanced keyboard nav
BabyElias Jun 21, 2024
e897a71
Merge branch 'learningequality:gsoc-table' into gsoc-table
BabyElias Jul 9, 2024
091e7f2
fixed firefox accessibility issues
BabyElias Jul 11, 2024
11f0604
Merge pull request #669 from BabyElias/gsoc-table
MisRob Jul 12, 2024
e871bf2
Added scroll and custom widths
BabyElias Jul 16, 2024
a1393d1
Merge branch 'learningequality:gsoc-table' into gsoc-table
BabyElias Jul 16, 2024
48e969c
fixed conflicts
BabyElias Jul 16, 2024
96ede77
Added sticky panes
BabyElias Jul 18, 2024
d5b2b5c
added hover effect
BabyElias Jul 22, 2024
83b29fb
Added sortColumn icon
BabyElias Jul 26, 2024
f118cd9
added header highlight feature
BabyElias Jul 27, 2024
fb8bf2b
fixed focus state
BabyElias Aug 1, 2024
05576d1
partial theming
BabyElias Aug 2, 2024
2b0ca06
highlight-header theming and updated examples for clarity
BabyElias Aug 2, 2024
778c512
fixed outline and enhanced tab key navigation
BabyElias Aug 3, 2024
b7f5847
completed theming
BabyElias Aug 5, 2024
0613a21
fixed theming, removed unnecessary code
BabyElias Aug 5, 2024
9c4d02b
Merge pull request #682 from BabyElias/gsoc-table
MisRob Aug 6, 2024
b150305
added more tests
BabyElias Aug 8, 2024
67e1928
Merge branch 'learningequality:gsoc-table' into gsoc-table
BabyElias Aug 11, 2024
90d8c24
Merge branch 'gsoc-table-develop' into gsoc-table
BabyElias Aug 11, 2024
fe1736c
Merge pull request #3 from BabyElias/gsoc-table
BabyElias Aug 11, 2024
b413eae
added composable testing and documentation
BabyElias Aug 11, 2024
b6c4ee1
linting errors
BabyElias Aug 11, 2024
01a0179
documentation updates
BabyElias Aug 13, 2024
8d1c272
added sorted header color
BabyElias Aug 13, 2024
f27f9ae
updated documentation
BabyElias Aug 13, 2024
2e45abe
Updated documentation and examples
BabyElias Aug 14, 2024
5084f30
Merge branch 'develop' into gsoc-table-develop
BabyElias Aug 14, 2024
6e69cc0
tab key navigation fix
BabyElias Aug 15, 2024
dabdf0d
fixed scroll into view for sticky headers
BabyElias Aug 15, 2024
fefcad1
Merge branch 'develop' into gsoc-table-develop
BabyElias Aug 15, 2024
21cc84d
code refactor
BabyElias Aug 16, 2024
350a13a
set tab to default
BabyElias Aug 16, 2024
fb60111
trial
BabyElias Aug 16, 2024
ea166d4
final navigation changes
BabyElias Aug 16, 2024
39657cf
allow default tab behaviour post table navigation
BabyElias Aug 18, 2024
6bae55c
Update docs/pages/ktable.vue
BabyElias Aug 20, 2024
aaa46f3
Update docs/pages/ktable.vue
BabyElias Aug 20, 2024
a2af97c
Update docs/pages/ktable.vue
BabyElias Aug 20, 2024
c374f59
Update docs/pages/ktable.vue
BabyElias Aug 20, 2024
b0b8a93
added data-focus="true"
BabyElias Aug 21, 2024
4e1c3b9
added docstring comments
BabyElias Aug 21, 2024
cb0d3ae
reorganised file structure
BabyElias Aug 21, 2024
109c7d3
updated test suite
BabyElias Aug 21, 2024
b66421f
updated comment
BabyElias Aug 21, 2024
4d59b0f
Merge branch 'develop' into gsoc-table-develop
BabyElias Aug 21, 2024
25487db
added comments
BabyElias Aug 21, 2024
71bd3ab
Merge branch 'gsoc-table-develop' of https://github.com/BabyElias/kol…
BabyElias Aug 21, 2024
f960a47
updated rtl
BabyElias Aug 21, 2024
c8140b0
Merge branch 'develop' into gsoc-table-develop
BabyElias Aug 21, 2024
3d3803a
updated documentation
BabyElias Aug 22, 2024
8854e84
code refactor
BabyElias Aug 23, 2024
ab9c4e3
Merge branch 'develop' into gsoc-table-develop
BabyElias Aug 23, 2024
1215d91
minor change
BabyElias Aug 23, 2024
e43678c
replaced queryselector with refs
BabyElias Aug 25, 2024
0b1b1dc
updated queryselector with refs
BabyElias Aug 25, 2024
e014237
Added height prop to the table
BabyElias Aug 25, 2024
5be11a5
added visuallyhidden class
BabyElias Aug 27, 2024
90558b5
updated height
BabyElias Aug 28, 2024
186ea35
Merge branch 'gsoc-table-develop' into main
BabyElias Aug 28, 2024
da2ec92
Merge pull request #4 from BabyElias/main
BabyElias Aug 28, 2024
34479c3
added emptymessage and updated documentation
BabyElias Aug 28, 2024
1208c1a
updated API specs
BabyElias Aug 29, 2024
8071b67
updated documentation
BabyElias Aug 29, 2024
5d49e23
Merge branch 'learningequality:develop' into main
BabyElias Aug 30, 2024
74e2230
Merge branch 'learningequality:develop' into main
BabyElias Aug 31, 2024
1c04d92
fixed failing test
BabyElias Aug 31, 2024
9fe5d2a
updated datatype of 'content'
BabyElias Aug 31, 2024
7764ef4
added dataLoading prop
BabyElias Sep 1, 2024
feeb34a
added refs to highlightHeader
BabyElias Sep 1, 2024
8119361
added more computed properties
BabyElias Sep 1, 2024
9a69cef
Merge branch 'learningequality:develop' into main
BabyElias Sep 5, 2024
4089e06
Merge pull request #5 from BabyElias/main
BabyElias Sep 5, 2024
a766e78
updated API and other changes
BabyElias Sep 5, 2024
0565bcd
changelog changes
BabyElias Sep 5, 2024
f39cd22
changelog changes
BabyElias Sep 5, 2024
eb923d2
Added header align same as content alignment
BabyElias Sep 5, 2024
34dcfbc
Cleaned up playground page
BabyElias Sep 5, 2024
90bd023
fixed linting errors
BabyElias Sep 5, 2024
d41aef2
changelog.md reverted
BabyElias Sep 7, 2024
7acfa97
passed textAlign to KTableGridItem
BabyElias Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
BabyElias marked this conversation as resolved.
Show resolved Hide resolved
BabyElias marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +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


- [#723]
- **Description:** Updates $core-time value from 0.25s to 0.15s
- **Products impact:** User experience - faster transitions
Expand Down Expand Up @@ -72,6 +71,7 @@ Changelog is rather internal in nature. See release notes for the public overvie

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


- [#738]
- **Description:** Bump KDS version to 5.0.0-rc2.
- **Products impact:** -.
Expand All @@ -94,6 +94,7 @@ Changelog is rather internal in nature. See release notes for the public overvie

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


- [719]
- **Description:** Removes KResponsiveWindowMixin.
- **Products impact:** removed API.
Expand All @@ -105,6 +106,7 @@ Changelog is rather internal in nature. See release notes for the public overvie

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


- [#718]
- **Description:** This pull request resolves failing `KDateCalendar` component tests that occurred on the last day of the month in open pull requests by setting dates manually in the tests. Additionally, the `KDateCalendar` is updated to show the month of the `lastAllowedDate` property.
- **Products impact:** none
Expand Down
4 changes: 4 additions & 0 deletions custom-icons/sortColumn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions docs/pages/ktable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<template>

<DocsPageTemplate apiDocs>
<DocsPageSection title="Overview" anchor="#overview">
<p>
The <code>KTable</code> component is an accessible and customizable table component designed to handle a variety of data presentation needs. The component is suitable for both simple and complex data tables. It offers:
<ul>
<li>Offers built-in sorting by default</li>
<li>Integrates with already sorted data</li>
<li>Keyboard navigation</li>
<li>Dynamic column resizing</li>
<li>Sticky headers</li>
</ul>
</p>
</DocsPageSection>
<DocsPageSection title="Usage" anchor="#usage">
<!--Non-Sortable Table-->
<h3>Table without sorting functionality</h3>
<p>
This is an example to show how <code>KTable</code> can be used without any sorting functionality, as a simple table. Use of slots is optional.
</p>
<!-- eslint-disable -->
<DocsShowCode language="html">
<KTable
:headers="headers"
:rows="rows"
caption="Non Sortable Table"
>

<template #header="{ header, index }">
BabyElias marked this conversation as resolved.
Show resolved Hide resolved
<span>{ header.label } (Backend)</span>
</template>
<template #cell="{ content, rowIndex, colIndex }">
<span v-if="colIndex === 2">{ content } (City)</span>
MisRob marked this conversation as resolved.
Show resolved Hide resolved
<span v-else>{ content }</span>
</template>
</KTable>

</DocsShowCode>

<DocsShowCode language="javascript">
data() {
return {
headers: [
{ label: 'Name', dataType: 'string' },
{ label: 'Age', dataType: 'numeric' },
{ label: 'City', dataType: 'string' },
],
rows: [
['John Doe', 28, 'New York'],
['Jane Smith', 34, 'Los Angeles'],
['Samuel Green', 22, 'Chicago'],
['Alice Johnson', 30, 'Houston'],
['Michael Brown', 45, 'Phoenix'],
['Emily Davis', 27, 'Philadelphia'],
]
};
},
</DocsShowCode>

<DocsShow block>
<KTable
:headers="headers"
:rows="rows"
caption="Non-sortable table"
>
<template #header="{ header, index }">
<span>{{ header.label }} (Backend)</span>
</template>
<template #cell="{ content, rowIndex, colIndex }">
<span v-if="colIndex === 2">{{ content }} (City)</span>
<span v-else>{{ content }}</span>
</template>
</KTable>
</DocsShow>
<!-- eslint-enable -->
<!-- Frontend Sorting Example-->
<h3>Table with Default Sorting</h3>
<p>
The <code>KTable</code> can be used with default sorting functionality, allowing you to sort data on the client side without the need for server requests. There are 4 permissible data types - <code>string</code>,<code>numeric</code>,<code>date</code> and <code>others</code>. Columns declared with <code>others</code> data type are not sortable. This example demonstrates a table with default sorting enabled.
</p>
<!-- eslint-disable -->
<DocsShowCode language="html">
<KTable
:headers="headers"
:rows="rows"
caption="Table with built-in sorting"
sortable
/>

</DocsShowCode>

<DocsShowCode language="javascript">
data() {
return {
headers: [
{ label: 'Name', dataType: 'string' },
{ label: 'Age', dataType: 'numeric' },
{ label: 'City', dataType: 'string' },
],
rows: [
['John Doe', 28, 'New York'],
['Jane Smith', 34, 'Los Angeles'],
['Samuel Green', 22, 'Chicago'],
['Alice Johnson', 30, 'Houston'],
['Michael Brown', 45, 'Phoenix'],
['Emily Davis', 27, 'Philadelphia'],
]
};
},
</DocsShowCode>
<DocsShow block>
<KTable
:headers="headers"
:rows="rows"
caption="Local Sorting Table"
sortable
/>
<!-- eslint-enable -->
</DocsShow>

</DocsPageSection>


</DocsPageTemplate>

</template>


<script>

export default {
name: 'DocsKTable',
data() {
return {
headers: [
{ label: 'Name', dataType: 'string' },
{ label: 'Age', dataType: 'numeric' },
{ label: 'City', dataType: 'string' },
],
rows: [
['John Doe', 28, 'New York'],
['Jane Smith', 34, 'Los Angeles'],
['Samuel Green', 22, 'Chicago'],
['Alice Johnson', 30, 'Houston'],
['Michael Brown', 45, 'Phoenix'],
['Emily Davis', 27, 'Philadelphia'],
],
};
},
};

</script>
Loading
Loading