-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add clickable and hoverable rows to table (#265)
* feat: add clickable and hoverable rows to table * fix: add keyboard a11y * fix: add keyboard nav and conditionnaly add event listeners. * chore: export formatters and fix typing * fix: rework focus state to avoid double expand icon
- Loading branch information
1 parent
5873f6e
commit a94553e
Showing
33 changed files
with
561 additions
and
205 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,26 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.27.1-beta.1](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-29) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* make colors more easily customizable ([7f1591b](https://github.com/opendatasoft/ods-dataviz-sdk/commit/7f1591bb2770751e813dea4c82ac9c43be4306ee)) | ||
* rename rows, lint, simplify callbacks ([1a10a98](https://github.com/opendatasoft/ods-dataviz-sdk/commit/1a10a98297e93e44415ffb49d917d6ef92d3d7c1)) | ||
|
||
|
||
|
||
|
||
|
||
## [0.27.1-beta.0](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-27) | ||
|
||
**Note:** Version bump only for package @opendatasoft/visualizations-react | ||
|
||
|
||
|
||
|
||
|
||
# [0.27.0](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-06) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,36 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [0.27.1-beta.1](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-29) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* make colors more easily customizable ([7f1591b](https://github.com/opendatasoft/ods-dataviz-sdk/commit/7f1591bb2770751e813dea4c82ac9c43be4306ee)) | ||
* rename rows, lint, simplify callbacks ([1a10a98](https://github.com/opendatasoft/ods-dataviz-sdk/commit/1a10a98297e93e44415ffb49d917d6ef92d3d7c1)) | ||
|
||
|
||
### Reverts | ||
|
||
* Revert "chore: add accessor functiond and make warnings optionals" ([547cb6f](https://github.com/opendatasoft/ods-dataviz-sdk/commit/547cb6f820457a959b2314aa568268284a94cca5)) | ||
|
||
|
||
|
||
|
||
|
||
## [0.27.1-beta.0](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-27) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* add keyboard a11y ([e2ed58d](https://github.com/opendatasoft/ods-dataviz-sdk/commit/e2ed58d8c9a8acc5379cb3df7a8e281c96f1a2de)) | ||
* change implem to extra column to avoid formatting issues ([f2108e7](https://github.com/opendatasoft/ods-dataviz-sdk/commit/f2108e7801b34dc658ea975dcf177a35191386ac)) | ||
* import alias and export old types ([f7080ac](https://github.com/opendatasoft/ods-dataviz-sdk/commit/f7080acab8e15329cbda1899a4c88bedb46d0fac)) | ||
|
||
|
||
|
||
|
||
|
||
# [0.27.0](https://github.com/opendatasoft/ods-dataviz-sdk/compare/@opendatasoft/[email protected]...@opendatasoft/[email protected]) (2024-11-06) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
...ts/Table/Cell/Format/BooleanFormat.svelte → ...rc/components/Format/BooleanFormat.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/visualizations/src/components/Format/DateFormat.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script lang="ts"> | ||
import { warn } from './utils'; | ||
import type { DateFormatProps } from './types'; | ||
type $$Props = DateFormatProps; | ||
export let rawValue: $$Props['rawValue']; | ||
export let display: $$Props['display'] = (v: string) => v; | ||
export let intl: $$Props['intl'] = {}; | ||
export let locale = 'en-En'; | ||
$: format = (v: unknown) => { | ||
if ( | ||
(typeof v === 'string' || typeof v === 'number') && | ||
!Number.isNaN(new Date(v).getTime()) | ||
) { | ||
const intlValue = Intl.DateTimeFormat(locale, intl).format(new Date(v)); | ||
if (display) { | ||
return display(intlValue); | ||
} | ||
return v; | ||
} | ||
warn(v, 'date'); | ||
return v; | ||
}; | ||
$: value = format(rawValue); | ||
</script> | ||
|
||
{value} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/visualizations/src/components/Format/LongTextFormat.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { warn } from './utils'; | ||
import type { LongTextFormatProps } from './types'; | ||
type $$Props = LongTextFormatProps; | ||
export let rawValue: $$Props['rawValue']; | ||
export let display: $$Props['display'] = (v: string) => v; | ||
$: format = (v: unknown) => { | ||
if (typeof v !== 'string') { | ||
warn(v, 'text'); | ||
} | ||
if (display) { | ||
return display(v as string); | ||
} | ||
return v; | ||
}; | ||
$: value = format(rawValue); | ||
</script> | ||
|
||
<!-- Wrap value to style properly line clamp --> | ||
<span>{value}</span> |
27 changes: 27 additions & 0 deletions
27
packages/visualizations/src/components/Format/NumberFormat.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { warn } from './utils'; | ||
import type { NumberFormatProps } from './types'; | ||
type $$Props = NumberFormatProps; | ||
export let rawValue: $$Props['rawValue']; | ||
export let display: $$Props['display'] = (v: string) => v; | ||
export let intl: $$Props['intl'] = {}; | ||
export let locale = 'en-EN'; | ||
$: format = (v: unknown) => { | ||
if (!Number.isFinite(v)) { | ||
warn(v, 'number'); | ||
return v; | ||
} | ||
const intlValue = new Intl.NumberFormat(locale, intl).format(v as number); | ||
if (display) { | ||
return display(intlValue); | ||
} | ||
return intlValue; | ||
}; | ||
$: value = format(rawValue); | ||
</script> | ||
|
||
{value} |
Oops, something went wrong.
a94553e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report