@dhis2-ui/table 8.16.0-alpha.2 → 8.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +5 -8
  2. package/types/index.d.ts +0 -396
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/table",
3
- "version": "8.16.0-alpha.2",
3
+ "version": "8.16.0",
4
4
  "description": "UI Table",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,6 @@
13
13
  "main": "./build/cjs/index.js",
14
14
  "module": "./build/es/index.js",
15
15
  "exports": {
16
- "types": "./types/index.d.ts",
17
16
  "import": "./build/es/index.js",
18
17
  "require": "./build/cjs/index.js"
19
18
  },
@@ -34,20 +33,18 @@
34
33
  },
35
34
  "dependencies": {
36
35
  "@dhis2/prop-types": "^3.1.2",
37
- "@dhis2/ui-constants": "8.16.0-alpha.2",
38
- "@dhis2/ui-icons": "8.16.0-alpha.2",
36
+ "@dhis2/ui-constants": "8.16.0",
37
+ "@dhis2/ui-icons": "8.16.0",
39
38
  "classnames": "^2.3.1",
40
39
  "prop-types": "^15.7.2"
41
40
  },
42
41
  "files": [
43
- "build",
44
- "types"
42
+ "build"
45
43
  ],
46
44
  "devDependencies": {
47
45
  "@dhis2/d2-i18n": "^1.1.0",
48
46
  "react": "16.13",
49
47
  "react-dom": "16.13",
50
48
  "styled-jsx": "^4.0.1"
51
- },
52
- "types": "types"
49
+ }
53
50
  }
package/types/index.d.ts DELETED
@@ -1,396 +0,0 @@
1
- import * as React from 'react'
2
-
3
- export interface TableProps {
4
- /**
5
- * Should be `<TableHead>`, `<TableBody>`, and `<TableFoot>` components
6
- */
7
- children?: React.ReactNode
8
- className?: string
9
- dataTest?: string
10
- role?: string
11
- /**
12
- * Remove the default striping on alternating rows
13
- */
14
- suppressZebraStriping?: boolean
15
- }
16
-
17
- export const Table: React.FC<TableProps>
18
-
19
- export interface TableBodyProps {
20
- /**
21
- * Should be `<TableRow>` components
22
- */
23
- children?: React.ReactNode
24
- className?: string
25
- dataTest?: string
26
- role?: string
27
- }
28
-
29
- export const TableBody: React.FC<TableBodyProps>
30
-
31
- export interface TableCellProps {
32
- children?: React.ReactNode
33
- className?: string
34
- colSpan?: string
35
- dataTest?: string
36
- /**
37
- * Uses less padding and height for information-dense layouts
38
- */
39
- dense?: boolean
40
- role?: string
41
- rowSpan?: string
42
- }
43
-
44
- export const TableCell: React.FC<TableCellProps>
45
-
46
- export interface TableFootProps {
47
- /**
48
- * Should be `<TableRow>` components
49
- */
50
- children?: React.ReactNode
51
- className?: string
52
- dataTest?: string
53
- role?: string
54
- }
55
-
56
- export const TableFoot: React.FC<TableFootProps>
57
-
58
- export interface TableHeadProps {
59
- /**
60
- * Should be `<TableRowHead>` components
61
- */
62
- children?: React.ReactNode
63
- className?: string
64
- dataTest?: string
65
- role?: string
66
- }
67
-
68
- export const TableHead: React.FC<TableHeadProps>
69
-
70
- export interface TableCellHeadProps {
71
- children?: React.ReactNode
72
- className?: string
73
- colSpan?: string
74
- dataTest?: string
75
- /**
76
- * Uses less padding and height for information-dense layouts
77
- */
78
- dense?: boolean
79
- role?: string
80
- rowSpan?: string
81
- }
82
-
83
- export const TableCellHead: React.FC<TableCellHeadProps>
84
-
85
- export interface TableRowProps {
86
- /**
87
- * Should be `<TableCell>` or `<TableCellHead>` components
88
- */
89
- children?: React.ReactNode
90
- className?: string
91
- dataTest?: string
92
- role?: string
93
- /**
94
- * Disables the default row striping for this row
95
- */
96
- suppressZebraStriping?: boolean
97
- }
98
-
99
- export const TableRow: React.FC<TableRowProps>
100
-
101
- export interface TableRowHeadProps {
102
- /**
103
- * Should be `<TableCellHead>` components
104
- */
105
- children?: React.ReactNode
106
- className?: string
107
- dataTest?: string
108
- role?: string
109
- /**
110
- * Disables the default row striping for this row
111
- */
112
- suppressZebraStriping?: boolean
113
- }
114
-
115
- export const TableRowHead: React.FC<TableRowHeadProps>
116
-
117
- /** STACKEDTABLE */
118
-
119
- export interface StackedTableBodyProps {
120
- children?: React.ReactNode
121
- className?: string
122
- dataTest?: string
123
- }
124
-
125
- export const StackedTableBody: React.FC<StackedTableBodyProps>
126
-
127
- export interface StackedTableCellHeadProps {
128
- children?: string
129
- className?: string
130
- colSpan?: string
131
- dataTest?: string
132
- rowSpan?: string
133
- }
134
-
135
- export const StackedTableCellHead: React.FC<StackedTableCellHeadProps>
136
-
137
- export interface StackedTableCellProps {
138
- children?: React.ReactNode
139
- className?: string
140
- colSpan?: string
141
- column?: number
142
- dataTest?: string
143
- headerLabels?: string[]
144
- hideTitle?: boolean
145
- rowSpan?: string
146
- title?: string
147
- }
148
-
149
- export const StackedTableCell: React.FC<StackedTableCellProps>
150
-
151
- export interface StackedTableFootProps {
152
- children?: React.ReactNode
153
- className?: string
154
- dataTest?: string
155
- }
156
-
157
- export const StackedTableFoot: React.FC<StackedTableFootProps>
158
-
159
- export interface StackedTableHeadProps {
160
- children?: React.ReactNode
161
- className?: string
162
- dataTest?: string
163
- }
164
-
165
- export const StackedTableHead: React.FC<StackedTableHeadProps>
166
-
167
- export interface StackedTableRowHeadProps {
168
- children?: React.ReactNode
169
- className?: string
170
- dataTest?: string
171
- }
172
-
173
- export const StackedTableRowHead: React.FC<StackedTableRowHeadProps>
174
-
175
- export interface StackedTableRowProps {
176
- children?: React.ReactNode
177
- className?: string
178
- dataTest?: string
179
- }
180
-
181
- export const StackedTableRow: React.FC<StackedTableRowProps>
182
-
183
- export interface StackedTableProps {
184
- children?: React.ReactNode
185
- className?: string
186
- dataTest?: string
187
- /**
188
- * Labels for columns. Use an empty string for a column without a header.
189
- */
190
- headerLabels?: string[]
191
- }
192
-
193
- export const StackedTable: React.FC<StackedTableProps>
194
-
195
- /** DATATABLE */
196
-
197
- export type DataTableLayout = 'auto' | 'fixed' | 'initial' | 'inherit'
198
-
199
- export interface DataTableProps {
200
- /**
201
- * Should be `<DataTableHead>`, `<DataTableBody>`, and `<DataTableFoot>` components
202
- */
203
- children?: React.ReactNode
204
- className?: string
205
- dataTest?: string
206
- /**
207
- * Sets the `datatable-layout` property. Switching to `fixed` can prevent style
208
- * issues when dealing with a datatable with multiple frozen columns or when dealing
209
- * with filter elements in the datatable headers.
210
- */
211
- layout?: DataTableLayout
212
- role?: string
213
- /**
214
- * Sets max-height of scrollbox
215
- */
216
- scrollHeight?: string
217
- /**
218
- * Sets max-width of scrollbox
219
- */
220
- scrollWidth?: string
221
- /**
222
- * Sets the `width` property. Providing an explicit width can prevent style
223
- * issues when dealing with horizontally scrolling datatables with a fixed layout.
224
- */
225
- width?: string
226
- }
227
-
228
- export const DataTable: React.ForwardRefExoticComponent<DataTableProps>
229
-
230
- export interface DataTableBodyProps {
231
- children?: React.ReactNode
232
- className?: string
233
- dataTest?: string
234
- loading?: boolean
235
- role?: string
236
- }
237
-
238
- export const DataTableBody: React.ForwardRefExoticComponent<DataTableBodyProps>
239
-
240
- type TdProps = React.ComponentPropsWithoutRef<'td'>
241
- type ThProps = React.ComponentPropsWithoutRef<'th'>
242
- type DataTableCellForwardProps = Omit<
243
- TdProps | ThProps,
244
- keyof DataTableCellProps
245
- >
246
-
247
- export type DataTableCellProps = {
248
- /**
249
- * To toggle border color, for example for editing
250
- */
251
- active?: boolean
252
- align?: 'left' | 'center' | 'right'
253
- /**
254
- * Sets background color of the cell. Disables dynamic background colors from active, hover, and selected states
255
- */
256
- backgroundColor?: string
257
- bordered?: boolean
258
- children?: React.ReactNode
259
- className?: string
260
- colSpan?: string
261
- dataTest?: string
262
- /**
263
- * Mutually exclusive with muted and valid
264
- */
265
- error?: boolean
266
- /**
267
- * When true a TableHeaderCell with sticky positioning will be rendered
268
- */
269
- fixed?: boolean
270
- large?: boolean
271
- /**
272
- * Required when fixed
273
- */
274
- left?: boolean
275
- /**
276
- * Mutually exclusive with error and valid
277
- */
278
- muted?: boolean
279
- role?: string
280
- rowSpan?: string
281
- scope?: string
282
- /**
283
- * Surpress hover and active event styles
284
- */
285
- staticStyle?: boolean
286
- /**
287
- * Render a TableDataCell or TableHeaderCell respectively
288
- */
289
- tag?: 'td' | 'th'
290
- /**
291
- * Mutually exclusive with error and muted
292
- */
293
- valid?: boolean
294
- /**
295
- * Required when fixed
296
- */
297
- width?: string
298
- onClick?: React.MouseEventHandler
299
- }
300
-
301
- export const DataTableCell: React.ForwardRefExoticComponent<
302
- DataTableCellProps & DataTableCellForwardProps
303
- >
304
-
305
- export type DataTableSortDirection = 'asc' | 'desc' | 'default'
306
-
307
- export interface DataTableColumnHeaderProps {
308
- align?: 'left' | 'center' | 'right'
309
- children?: React.ReactNode
310
- className?: string
311
- colSpan?: string
312
- dataTest?: string
313
- /**
314
- * The filter element (JSX), required when onFilterIconClick or showFilter are present
315
- */
316
- filter?: boolean
317
- fixed?: boolean
318
- large?: boolean
319
- /**
320
- * Left or top required when fixed
321
- */
322
- left?: boolean
323
- /**
324
- * Can be used to match a column with a property name
325
- */
326
- name?: string
327
- role?: string
328
- rowSpan?: string
329
- scope?: string
330
- showFilter?: boolean
331
- sortDirection?: DataTableSortDirection
332
- sortIconTitle?: string
333
- /**
334
- * Left or top required when fixed
335
- */
336
- top?: boolean
337
- width?: string
338
- onFilterIconClick?: (
339
- payload: { name?: string; active: boolean },
340
- event: React.MouseEvent<HTMLButtonElement>
341
- ) => void
342
- /**
343
- * Sort icon click callback with `nextSortDirection` and `name` in payload
344
- */
345
- onSortIconClick?: (
346
- payload: { name?: string; direction: DataTableSortDirection },
347
- event: React.MouseEvent<HTMLButtonElement>
348
- ) => void
349
- }
350
-
351
- export const DataTableColumnHeader: React.ForwardRefExoticComponent<DataTableColumnHeaderProps>
352
-
353
- export const DataTableFoot: React.ForwardRefExoticComponent<TableFootProps>
354
-
355
- export const DataTableHead: React.ForwardRefExoticComponent<TableHeadProps>
356
-
357
- export interface DataTableRowProps {
358
- /**
359
- * Should be `<DataTableCell>` or `<DataTableCellHead>` components
360
- */
361
- children?: React.ReactNode
362
- className?: string
363
- dataTest?: string
364
- /**
365
- * Renders and additional table cell with drag icon and applies draggable styles
366
- */
367
- draggable?: boolean
368
- /**
369
- * This content will be rendered into an additional row with fullwidth cell and the presence of this prop will display an additional table cell with expand icon
370
- */
371
- expandableContent?: React.ReactNode
372
- /**
373
- * Toggles expand icon (up/down) and expandable content visibility
374
- */
375
- expanded?: boolean
376
- role?: string
377
- /**
378
- * Adds a green background color
379
- */
380
- selected?: boolean
381
- /**
382
- * Callback for expand icon cell clicks
383
- */
384
- onExpandToggle?: (payload: { expanded: boolean }) => void
385
- }
386
-
387
- export const DataTableRow: React.ForwardRefExoticComponent<DataTableRowProps>
388
-
389
- export interface DataTableToolbarProps {
390
- children?: React.ReactNode
391
- className?: string
392
- dataTest?: string
393
- position?: 'top' | 'bottom'
394
- }
395
-
396
- export const DataTableToolbar: React.ForwardRefExoticComponent<DataTableToolbarProps>