Commit graph

60 commits

Author SHA1 Message Date
metonym
260bf4e040
breaking(types): type arrays as read-only (#1335)
Closes #1259

* breaking(types): type arrays as read-only

* Run "yarn build:docs"

* test: assert read-only arrays
2022-06-05 13:25:43 -07:00
metonym
31dacd53ab
fix(data-table): apply custom widths to empty columns (#1314)
Fixes #1313
2022-05-25 18:50:55 -07:00
metonym
c6f210899b
feat(data-table): allow custom column widths (#1265)
* feat(data-table): allow header column `width`, `minWidth` values

* Run "yarn build:docs"

* test(data-table): assert width, minWidth properties

* docs(data-table): add "Custom column widths" example
2022-05-14 09:24:24 -07:00
metonym
6239c11024
breaking(data-table): use data attribute instead of id for table header/row (#1297)
Fixes #1294
2022-05-13 20:18:32 -07:00
Nicolas Peugnet
43e2986434
fix(data-table): rows should be reactive (#1255) 2022-04-18 17:50:19 -07:00
metonym
ba58ba8f00
refactor: use icons from carbon-icons-svelte@11 (#1227)
* chore: update ignore rules, remove unused files

* refactor(icons): use icons from carbon-icons-svelte@11

* docs(time-picker): fix default value

* chore: upgrade carbon-icons-svelte to v11

* docs: update examples to use icons from carbon-icons-svelte@11

* docs: update number of icons [ci skip]
2022-04-03 11:57:28 -07:00
metonym
051a8702e3
perf(data-table): only render table row content when expanded (#1211)
Closes #1209
2022-03-25 06:49:58 -07:00
metonym
53fdbdf991
fix(data-table): expandable rows should work with zebra styles (#1200)
Fixes #1199
2022-03-23 08:04:08 -07:00
metonym
2df7b92269
feat(toolbar-search): support auto-filterable rows (#1179)
Closes #591
2022-03-19 12:01:03 -07:00
metonym
95a1dfa1af
feat(data-table): support non-selectable rows (#1166)
Closes #1148
2022-03-12 19:36:02 -08:00
metonym
48348df43d
perf: use direct imports where possible (#1158) 2022-03-12 13:50:40 -08:00
metonym
dce0309bab
fix(data-table): pass header key to TableHeader (#1114)
The id is needed to update the sort icon direction accordingly.

Fixes #1113
2022-02-21 08:33:41 -08:00
metonym
3b70a35df6
feat(data-table): pass row index, cell index to "cell" slot (#1086) 2022-02-11 07:13:55 -08:00
metonym
34affd851a
fix(data-table): batch selection checkbox should be reactive (#1085) 2022-02-10 19:51:26 -08:00
metonym
a5f5550aa0
fix(data-table): headers should be reactive (#1075)
If `headers` is dynamically updated, clicking a sortable table header will sort the incorrect column. Instead of randomly generating an id and keeping track of it through context, we can simply use the required key in `headers` as the id.
2022-02-09 19:48:20 -08:00
kwieszalka-maystreet
5da83ec869
feat(data-table): support paginated data table (#880)
Closes #702
2022-01-19 07:51:42 -08:00
Eric Liu
ae96fdf3d9
fix(data-table): forgo "click", "click:row" events if target is a checkbox, radio button (#951)
Fixes #933
2021-12-28 13:26:09 -08:00
Eric Liu
4f83b2d1e1
fix(data-table): forgo "click", "click:row" events if target is an OverflowMenu (#918)
#917
2021-11-19 08:29:16 -08:00
Eric Liu
040e3d3372
Inline carbon icons, remove carbon-icons-svelte from dependencies (#904)
* feat(icons): inline carbon icons used by components

* feat(icons): update svelte components to use inlined carbon icons

* breaking(deps): remove carbon-icons-svelte

* chore(deps-dev): install carbon-icons-svelte as a devDependency
2021-11-11 08:54:45 -08:00
Eric Liu
b3a73cf80c
fix(data-table): avoid triggering click:row when clicking expandable row chevron (#890)
Fixes #889
2021-11-06 10:33:33 -07:00
Eric Liu
fb7ebb93cb
fix(data-table): expand batch expansion chevron if all rows are expanded #867 (#873)
Fixes #867
2021-10-22 07:18:03 -07:00
Eric Liu
2aeeb728a2
fix(data-table): collapse batch expansion button if one or more rows collapsed #867 (#868) 2021-10-20 17:45:53 -07:00
Eric Liu
c64075acbe
fix(data-table): include border style for non-expandable rows (#864)
* fix(data-table): include border style for non-expandable rows

Fixes #861

* docs(data-table): use batchExpansion for non-expandable rows example [ci skip]
2021-10-20 10:02:10 -07:00
Eric Liu
96d848e9ef
feat(data-table): add nonExpandableRowIds prop (#862)
* feat(data-table): add nonExpandableRowIds prop #861

* test(data-table): validate nonExpandableRowIds prop

* docs(data-table): add Non-expandable rows example
2021-10-19 07:25:22 -07:00
Paweł Malinowski
d3eb146fb5
fix(DataTable): handle null/undefined values when sorting (#846) 2021-10-11 10:11:59 -07:00
Florian-Schoenherr
dbf1f225dc
fix(DataTable): useStaticWidth fix for title/description (#824)
* fix(DataTable): useStaticWidth title/description

Signed-off-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>

* docs(DataTable): useStaticWidth title/description

Signed-off-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>

* chore(deps-dev): upgrade carbon-components, sass

Co-authored-by: metonym <ericyl.us@gmail.com>
2021-09-23 08:55:06 -07:00
Nguyễn Trường Minh
89513fb4cb
fix(DataTable): undefined cell value fallback (#745)
* fix(DataTable): undefined cell value fallback

* Update DataTable.svelte

* fix(data-table): remove "" as the default value for table cells

Co-authored-by: Eric Y Liu <ericyl.us@gmail.com>
2021-07-15 06:37:42 -07:00
Eric Liu
a1e56bd135
Fixes (#749)
* fix(data-table): type DataTableRowId as "any" #530

Fixes #530

* fix(tree-view): make first node focusable if activeId does not match selected

* fix(overflow-menu): set type="button" to prevent default submit behavior #554

Fixes #554

* fix(overflow-menu): update semantic attributes in OverflowMenuItem

* fix(number-input): do not dispatch change event on initialization #561

Fixes #561

* fix(tree-view): make first focusable node tabbable regardless of active/selected states

* fix(date-picker): load rangePlugin dynamically

* build(rollup): enable inlineDynamicImports

* build(rollup): remove "clipboard-copy" global

* fix(overflow-menu): do not render title if using a slot #537

Fixes #537

* fix(select): forward missing focus, input events #501

Fixes #501
2021-07-14 13:48:23 -07:00
Eric Liu
0a69f8ec74
Various features/fixes (#727)
* fix(data-table): export useStaticWidth prop

* docs(data-table): add static width example

* fix(data-table): do not render table header if title/description not provided

* feat(modal): dispatch "click:button--primary" as an alias to "submit"

* test: update DataTable types test

* test(modal): update modal type tests

* docs(data-table): add clear reminder to key headers/rows
2021-07-05 13:22:56 -07:00
Eric Liu
5fee13b2eb
feat(data-table): make title, description slottable #720 (#722)
Closes #720
2021-07-05 08:44:07 -07:00
Eric Liu
f9909827d0
Align v10.34 (#621)
* feat(theme): add g80 theme

* docs(data-table): use link with icon variant

* feat(search): support expandable variant

* fix(file-uploaded): use semantic p element instead of strong

* feat(side-nav): dispatch open, close, click:overlay events

* refactor(ui-shell): remove usage of deprecated Icon component

* feat(ui-shell): allow custom hamburger menu icons

* feat(button): support xl size

* fix(code-snippet): wrap code element with pre

* refactor(button): use button specific tooltip class for icon-only variant

* feat(password-input): support warning, inline props

* feat(data-table): support medium size
2021-06-25 03:45:30 -07:00
Eric Y Liu
cff16e5d7d v0.33.0 2021-04-30 17:12:02 -07:00
mabentley85
081783c719
Fix the colspan when a DataTable is Expandable and Selectable (#618) 2021-04-30 16:24:35 -07:00
rafadess
47c79b16c7
Adding display attr to DataTableCell (#615) 2021-04-30 16:18:47 -07:00
Khiman Louer
2676d8d045
Add support for nested object fields in DataTable (#602)
* feature: Add support for nested object fields in Data Table

feature: Add support for nested object fields in Data Table

* fix can't open dropdown with keyboard (#610)

* fix(Dropdown): update selectedId when selectedIndex changes. (#611)

* chore(deps-dev): patch carbon-components@10.32.1 (#613)

* v0.32.2

* feature: Add support for nested object fields in Data Table

feature: Add support for nested object fields in Data Table

* chore: Added example for nested object values into the documentation

Co-authored-by: Lyu, Wei-Da <36730922+jasonlyu123@users.noreply.github.com>
Co-authored-by: David Espinosa <david.emanuel.espinosa@gmail.com>
Co-authored-by: Eric Liu <ericyl.us@gmail.com>
2021-04-24 09:20:06 -07:00
Vegard Andreas Larsen
93f14c92e4
Fix "Cannot use import statement outside a module" (#594)
* Fix "Cannot use import statement outside a module"

Using `HamburgerMenu` from a SvelteKit project would result in the following error:

```
4:01:51 PM [vite] Error when evaluating SSR module /node_modules/carbon-components-svelte/src/UIShell/SideNav/HamburgerMenu.svelte:
/home/vegard/beat/backoffice-sapper/node_modules/carbon-icons-svelte/lib/Close20/index.js:1
import Close20 from "./Close20.svelte";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1101:16)
    at Module._compile (internal/modules/cjs/loader.js:1149:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at nodeRequire (/home/vegard/beat/backoffice-sapper/node_modules/vite/dist/node/chunks/dep-66eb515d.js:69044:17)
    at ssrImport (/home/vegard/beat/backoffice-sapper/node_modules/vite/dist/node/chunks/dep-66eb515d.js:69002:20)
    at eval (/node_modules/carbon-components-svelte/src/UIShell/SideNav/HamburgerMenu.svelte:7:31) (x3)
```

To fix it, we need to reference the `.svelte` files for the icons.

* Fix DataTable icon import.
2021-04-12 16:25:15 -07:00
Eric Liu
fa9b90cd79
Alignment with Carbon version 10.32 (#588)
* feat(code-snippet): add copy functionality

- docs: add custom feedback copy text example

* feat(tile): support disabled state for SelectableTile, RadioTile

Closes #539

* build(rollup): add clipboard-copy to globals

* feat(copy-button): add copy functionality

* feat(content-switcher): deprecate the light prop

- docs: remove the light variant example

* fix(toolbar-search): remove outer div

* feat(search): add searchClass prop

* fix(composed-modal): set hasScrollingContent class on ModalBody

* docs(data-table): add expandable size examples

* feat(tooltip): add TooltipFooter component

* fix(time-picker): correctly display invalidText

* feat(breadcrumb): support overflow menu

* feat(multi-select): export inputRef prop

* chore(deps-dev): upgrade carbon-components to v10.32.0

* feat(form): add noMargin prop to FormGroup

* docs(tooltip): document TooltipFooter

* feat(context-menu): support danger kind for ContextMenuOption

* feat(data-table): support rendering empty table header in skeleton

* refactor(types): use shorter import path in DataTableSkeleton

* feat(data-table): allow sorting to be disabled for a specific header

* docs(data-table): update example to desort the Protocol header

As an example, it makes more sense because all the values ("http") are the same.

* fix(context-menu): set initial y offset of context menu based on window height #577

* fix(context-menu): render submenu based on viewport constraints #577
2021-04-02 13:31:53 -07:00
Eric Liu
827a9822e7
fix(data-table): specify that restProps are forwarded to "div" #524 (#525) 2021-02-17 05:56:33 -08:00
Eric Liu
3d002f3246
chore(deps-dev): upgrade prettier-plugin-svelte (#498) 2021-01-27 15:02:02 -08:00
Eric Liu
71c15db2ca
expand headers type in DataTableSkeleton, fix DataTableRow type to require "id" (#415)
* feat(data-table-skeleton): support object type for headers

* fix(data-table): require "id" in DataTableRow interface
2020-11-26 10:28:07 -08:00
Eric Liu
0d8064043f
fix(types): export component types (#411) 2020-11-25 10:19:11 -08:00
Eric Liu
eed617433b test: add TS types 2020-11-19 14:16:01 -08:00
Eric Liu
d38e6d8be6 refactor: update/fix JSDoc props 2020-11-04 06:04:25 -08:00
Eric Liu
3c02829e73 feat(data-table): support empty table body columns 2020-10-26 11:55:58 -07:00
Eric Liu
a0caa12a27 fix(data-table): cancelling selection should uncheck batch selection checkbox 2020-10-26 08:24:20 -07:00
Eric Liu
f22dfd52a6
Merge pull request #356 from albertms10/datatable-sort-fix
fix(datatable): fix sort parameters
2020-10-24 15:03:09 -07:00
Eric Liu
73036aea4a feat(data-table): dispatch row mouseenter, mouseleave events
Add a row id for easier querying.
Add missing selected row class.
2020-10-24 13:58:49 -07:00
Eric Liu
f43b132088 feat(data-table): support radio, selectable variants with batch actions 2020-10-24 13:37:00 -07:00
Eric Liu
611d72bcf3 feat(data-table): add toolbar, toolbar search 2020-10-24 11:10:31 -07:00
albert
d0750d1fa2 fix(datatable): fix sort parameters 2020-10-23 16:08:02 +02:00