@dashforge/tw 0.8.0-beta → 0.9.0-beta
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.
- package/CHANGELOG.md +188 -0
- package/COVERAGE.md +63 -0
- package/LICENSE +21 -0
- package/PERFORMANCE.md +59 -0
- package/REFINEMENT-NOTES.md +50 -0
- package/dist/index.esm.js +235 -160
- package/dist/src/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/src/components/DataGrid/filters/ColumnFilters.d.ts.map +1 -1
- package/dist/src/components/DataGrid/resize/useColumnResize.d.ts +7 -0
- package/dist/src/components/DataGrid/resize/useColumnResize.d.ts.map +1 -1
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityMenu.d.ts +44 -0
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityMenu.d.ts.map +1 -0
- package/dist/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/cells/RenderChip.d.ts.map +1 -1
- package/dist/src/components/Table/table.types.d.ts +29 -6
- package/dist/src/components/Table/table.types.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -1
- package/eslint.config.mjs +16 -1
- package/package.json +11 -8
- package/src/components/Breadcrumbs/Breadcrumbs.perf.test.tsx +5 -2
- package/src/components/DataGrid/DataGrid.perf.test.tsx +114 -0
- package/src/components/DataGrid/DataGrid.test.tsx +253 -17
- package/src/components/DataGrid/DataGrid.tsx +107 -24
- package/src/components/DataGrid/filters/ColumnFilters.test.tsx +330 -0
- package/src/components/DataGrid/filters/ColumnFilters.tsx +26 -2
- package/src/components/DataGrid/reorder/useColumnReorder.test.ts +95 -3
- package/src/components/DataGrid/resize/useColumnResize.test.ts +144 -0
- package/src/components/DataGrid/resize/useColumnResize.ts +30 -1
- package/src/components/DataGrid/visibility/ColumnVisibilityMenu.tsx +186 -0
- package/src/components/Dialog/Dialog.tsx +9 -0
- package/src/components/Table/Table.perf.test.tsx +81 -0
- package/src/components/Table/Table.test.tsx +72 -1
- package/src/components/Table/Table.tsx +41 -8
- package/src/components/Table/cells/RenderChip.tsx +6 -9
- package/src/components/Table/cells/cells.test.tsx +247 -0
- package/src/components/Table/table.types.ts +29 -6
- package/src/components/Typography/Typography.test.tsx +15 -0
- package/src/components/Typography/typography.variants.ts +14 -1
- package/test-output/vitest/coverage/base.css +224 -0
- package/test-output/vitest/coverage/block-navigation.js +87 -0
- package/test-output/vitest/coverage/clover.xml +2418 -0
- package/test-output/vitest/coverage/coverage-final.json +89 -0
- package/test-output/vitest/coverage/favicon.png +0 -0
- package/test-output/vitest/coverage/index.html +746 -0
- package/test-output/vitest/coverage/prettify.css +1 -0
- package/test-output/vitest/coverage/prettify.js +2 -0
- package/test-output/vitest/coverage/sort-arrow-sprite.png +0 -0
- package/test-output/vitest/coverage/sorter.js +210 -0
- package/test-output/vitest/coverage/src/components/Accordion/Accordion.tsx.html +376 -0
- package/test-output/vitest/coverage/src/components/Accordion/accordion.variants.ts.html +181 -0
- package/test-output/vitest/coverage/src/components/Accordion/index.html +131 -0
- package/test-output/vitest/coverage/src/components/AppShell/AppShell.tsx.html +802 -0
- package/test-output/vitest/coverage/src/components/AppShell/appShell.variants.ts.html +247 -0
- package/test-output/vitest/coverage/src/components/AppShell/index.html +131 -0
- package/test-output/vitest/coverage/src/components/AspectRatio/AspectRatio.tsx.html +304 -0
- package/test-output/vitest/coverage/src/components/AspectRatio/index.html +116 -0
- package/test-output/vitest/coverage/src/components/Autocomplete/Autocomplete.tsx.html +3292 -0
- package/test-output/vitest/coverage/src/components/Autocomplete/autocomplete.variants.ts.html +508 -0
- package/test-output/vitest/coverage/src/components/Autocomplete/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Box/Box.tsx.html +334 -0
- package/test-output/vitest/coverage/src/components/Box/box.variants.ts.html +775 -0
- package/test-output/vitest/coverage/src/components/Box/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Breadcrumbs/Breadcrumbs.tsx.html +694 -0
- package/test-output/vitest/coverage/src/components/Breadcrumbs/breadcrumbs.variants.ts.html +247 -0
- package/test-output/vitest/coverage/src/components/Breadcrumbs/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Button/Button.tsx.html +535 -0
- package/test-output/vitest/coverage/src/components/Button/button.variants.ts.html +562 -0
- package/test-output/vitest/coverage/src/components/Button/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Checkbox/Checkbox.tsx.html +943 -0
- package/test-output/vitest/coverage/src/components/Checkbox/checkbox.variants.ts.html +289 -0
- package/test-output/vitest/coverage/src/components/Checkbox/index.html +131 -0
- package/test-output/vitest/coverage/src/components/ConfirmDialog/ConfirmDialog.tsx.html +841 -0
- package/test-output/vitest/coverage/src/components/ConfirmDialog/confirmDialog.variants.ts.html +313 -0
- package/test-output/vitest/coverage/src/components/ConfirmDialog/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Container/Container.tsx.html +307 -0
- package/test-output/vitest/coverage/src/components/Container/container.variants.ts.html +328 -0
- package/test-output/vitest/coverage/src/components/Container/index.html +131 -0
- package/test-output/vitest/coverage/src/components/DataGrid/DataGrid.tsx.html +3937 -0
- package/test-output/vitest/coverage/src/components/DataGrid/dataGrid.variants.ts.html +541 -0
- package/test-output/vitest/coverage/src/components/DataGrid/filters/ColumnFilters.tsx.html +1453 -0
- package/test-output/vitest/coverage/src/components/DataGrid/filters/index.html +116 -0
- package/test-output/vitest/coverage/src/components/DataGrid/index.html +131 -0
- package/test-output/vitest/coverage/src/components/DataGrid/reorder/index.html +116 -0
- package/test-output/vitest/coverage/src/components/DataGrid/reorder/useColumnReorder.ts.html +517 -0
- package/test-output/vitest/coverage/src/components/DataGrid/resize/index.html +116 -0
- package/test-output/vitest/coverage/src/components/DataGrid/resize/useColumnResize.ts.html +490 -0
- package/test-output/vitest/coverage/src/components/DataGrid/visibility/ColumnVisibilityMenu.tsx.html +592 -0
- package/test-output/vitest/coverage/src/components/DataGrid/visibility/index.html +116 -0
- package/test-output/vitest/coverage/src/components/DateTimePicker/DateTimePicker.tsx.html +1042 -0
- package/test-output/vitest/coverage/src/components/DateTimePicker/dateTimePicker.variants.ts.html +337 -0
- package/test-output/vitest/coverage/src/components/DateTimePicker/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Dialog/Dialog.tsx.html +391 -0
- package/test-output/vitest/coverage/src/components/Dialog/dialog.variants.ts.html +283 -0
- package/test-output/vitest/coverage/src/components/Dialog/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Divider/Divider.tsx.html +505 -0
- package/test-output/vitest/coverage/src/components/Divider/divider.variants.ts.html +433 -0
- package/test-output/vitest/coverage/src/components/Divider/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Grid/Grid.tsx.html +529 -0
- package/test-output/vitest/coverage/src/components/Grid/grid.variants.ts.html +484 -0
- package/test-output/vitest/coverage/src/components/Grid/index.html +131 -0
- package/test-output/vitest/coverage/src/components/LeftNav/LeftNav.tsx.html +1075 -0
- package/test-output/vitest/coverage/src/components/LeftNav/index.html +131 -0
- package/test-output/vitest/coverage/src/components/LeftNav/leftNav.variants.ts.html +406 -0
- package/test-output/vitest/coverage/src/components/NumberField/NumberField.tsx.html +1048 -0
- package/test-output/vitest/coverage/src/components/NumberField/index.html +131 -0
- package/test-output/vitest/coverage/src/components/NumberField/numberField.variants.ts.html +367 -0
- package/test-output/vitest/coverage/src/components/OTPField/OTPField.tsx.html +835 -0
- package/test-output/vitest/coverage/src/components/OTPField/index.html +131 -0
- package/test-output/vitest/coverage/src/components/OTPField/otpField.variants.ts.html +301 -0
- package/test-output/vitest/coverage/src/components/Pagination/Pagination.tsx.html +916 -0
- package/test-output/vitest/coverage/src/components/Pagination/index.html +146 -0
- package/test-output/vitest/coverage/src/components/Pagination/pagination.helpers.ts.html +391 -0
- package/test-output/vitest/coverage/src/components/Pagination/pagination.variants.ts.html +436 -0
- package/test-output/vitest/coverage/src/components/Popover/Popover.tsx.html +250 -0
- package/test-output/vitest/coverage/src/components/Popover/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Popover/popover.variants.ts.html +157 -0
- package/test-output/vitest/coverage/src/components/RadioGroup/RadioGroup.tsx.html +934 -0
- package/test-output/vitest/coverage/src/components/RadioGroup/index.html +131 -0
- package/test-output/vitest/coverage/src/components/RadioGroup/radioGroup.variants.ts.html +346 -0
- package/test-output/vitest/coverage/src/components/Skeleton/Skeleton.tsx.html +232 -0
- package/test-output/vitest/coverage/src/components/Skeleton/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Skeleton/skeleton.variants.ts.html +346 -0
- package/test-output/vitest/coverage/src/components/Snackbar/Snackbar.tsx.html +979 -0
- package/test-output/vitest/coverage/src/components/Snackbar/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Snackbar/snackbar.variants.ts.html +307 -0
- package/test-output/vitest/coverage/src/components/Stack/Stack.tsx.html +430 -0
- package/test-output/vitest/coverage/src/components/Stack/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Stack/stack.variants.ts.html +325 -0
- package/test-output/vitest/coverage/src/components/Switch/Switch.tsx.html +559 -0
- package/test-output/vitest/coverage/src/components/Switch/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Switch/switch.variants.ts.html +295 -0
- package/test-output/vitest/coverage/src/components/Table/Table.tsx.html +2677 -0
- package/test-output/vitest/coverage/src/components/Table/cells/RenderButton.tsx.html +154 -0
- package/test-output/vitest/coverage/src/components/Table/cells/RenderChip.tsx.html +385 -0
- package/test-output/vitest/coverage/src/components/Table/cells/RenderText.tsx.html +196 -0
- package/test-output/vitest/coverage/src/components/Table/cells/RenderTwoLine.tsx.html +187 -0
- package/test-output/vitest/coverage/src/components/Table/cells/RowActionsMenu.tsx.html +526 -0
- package/test-output/vitest/coverage/src/components/Table/cells/index.html +191 -0
- package/test-output/vitest/coverage/src/components/Table/cells/index.ts.html +127 -0
- package/test-output/vitest/coverage/src/components/Table/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Table/table.variants.ts.html +706 -0
- package/test-output/vitest/coverage/src/components/Tabs/Tabs.tsx.html +283 -0
- package/test-output/vitest/coverage/src/components/Tabs/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Tabs/tabs.variants.ts.html +292 -0
- package/test-output/vitest/coverage/src/components/TextField/TextField.tsx.html +820 -0
- package/test-output/vitest/coverage/src/components/TextField/index.html +131 -0
- package/test-output/vitest/coverage/src/components/TextField/textField.variants.ts.html +400 -0
- package/test-output/vitest/coverage/src/components/Textarea/Textarea.tsx.html +655 -0
- package/test-output/vitest/coverage/src/components/Textarea/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Textarea/textarea.variants.ts.html +340 -0
- package/test-output/vitest/coverage/src/components/Tooltip/Tooltip.tsx.html +295 -0
- package/test-output/vitest/coverage/src/components/Tooltip/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Tooltip/tooltip.variants.ts.html +169 -0
- package/test-output/vitest/coverage/src/components/TopBar/TopBar.tsx.html +283 -0
- package/test-output/vitest/coverage/src/components/TopBar/index.html +131 -0
- package/test-output/vitest/coverage/src/components/TopBar/topBar.variants.ts.html +199 -0
- package/test-output/vitest/coverage/src/components/Typography/Typography.tsx.html +421 -0
- package/test-output/vitest/coverage/src/components/Typography/index.html +131 -0
- package/test-output/vitest/coverage/src/components/Typography/typography.variants.ts.html +436 -0
- package/test-output/vitest/coverage/src/components/VisuallyHidden/VisuallyHidden.tsx.html +262 -0
- package/test-output/vitest/coverage/src/components/VisuallyHidden/index.html +116 -0
- package/test-output/vitest/coverage/src/components/_shared/data/getNestedValue.ts.html +181 -0
- package/test-output/vitest/coverage/src/components/_shared/data/index.html +236 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useColumnAutoDetect.ts.html +385 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useControllableState.ts.html +229 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useDebouncedValue.ts.html +157 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useTableFilter.ts.html +439 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useTableSearch.ts.html +283 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useTableSelection.ts.html +385 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useTableSort.ts.html +508 -0
- package/test-output/vitest/coverage/src/components/_shared/data/useVirtualizer.ts.html +682 -0
- package/test-output/vitest/coverage/src/components/_shared/index.html +116 -0
- package/test-output/vitest/coverage/src/components/_shared/resolveValidationState.ts.html +265 -0
- package/test-output/vitest/coverage/src/hooks/index.html +116 -0
- package/test-output/vitest/coverage/src/hooks/useAccessState.ts.html +328 -0
- package/test-output/vitest/coverage/src/index.html +116 -0
- package/test-output/vitest/coverage/src/index.ts.html +1153 -0
- package/test-output/vitest/coverage/src/utils/cn.ts.html +172 -0
- package/test-output/vitest/coverage/src/utils/index.html +116 -0
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityDialog.d.ts +0 -33
- package/dist/src/components/DataGrid/visibility/ColumnVisibilityDialog.d.ts.map +0 -1
- package/src/components/DataGrid/visibility/ColumnVisibilityDialog.tsx +0 -200
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/utils/cn.ts</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> cn.ts</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>1/1</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>1/1</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
+
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
+
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
+
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
+
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
+
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
+
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
+
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
+
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
+
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
+
<a name='L27'></a><a href='#L27'>27</a>
|
|
93
|
+
<a name='L28'></a><a href='#L28'>28</a>
|
|
94
|
+
<a name='L29'></a><a href='#L29'>29</a>
|
|
95
|
+
<a name='L30'></a><a href='#L30'>30</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
96
|
+
<span class="cline-any cline-neutral"> </span>
|
|
97
|
+
<span class="cline-any cline-neutral"> </span>
|
|
98
|
+
<span class="cline-any cline-neutral"> </span>
|
|
99
|
+
<span class="cline-any cline-neutral"> </span>
|
|
100
|
+
<span class="cline-any cline-neutral"> </span>
|
|
101
|
+
<span class="cline-any cline-neutral"> </span>
|
|
102
|
+
<span class="cline-any cline-neutral"> </span>
|
|
103
|
+
<span class="cline-any cline-neutral"> </span>
|
|
104
|
+
<span class="cline-any cline-neutral"> </span>
|
|
105
|
+
<span class="cline-any cline-neutral"> </span>
|
|
106
|
+
<span class="cline-any cline-neutral"> </span>
|
|
107
|
+
<span class="cline-any cline-neutral"> </span>
|
|
108
|
+
<span class="cline-any cline-neutral"> </span>
|
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
|
111
|
+
<span class="cline-any cline-neutral"> </span>
|
|
112
|
+
<span class="cline-any cline-neutral"> </span>
|
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
|
114
|
+
<span class="cline-any cline-neutral"> </span>
|
|
115
|
+
<span class="cline-any cline-neutral"> </span>
|
|
116
|
+
<span class="cline-any cline-neutral"> </span>
|
|
117
|
+
<span class="cline-any cline-neutral"> </span>
|
|
118
|
+
<span class="cline-any cline-neutral"> </span>
|
|
119
|
+
<span class="cline-any cline-neutral"> </span>
|
|
120
|
+
<span class="cline-any cline-neutral"> </span>
|
|
121
|
+
<span class="cline-any cline-neutral"> </span>
|
|
122
|
+
<span class="cline-any cline-yes">28228x</span>
|
|
123
|
+
<span class="cline-any cline-neutral"> </span>
|
|
124
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import clsx, { type ClassValue } from 'clsx';
|
|
125
|
+
import { twMerge } from 'tailwind-merge';
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* className composition helper for Dashforge TW components.
|
|
129
|
+
*
|
|
130
|
+
* Wraps `clsx` (for boolean / object / array compaction) with
|
|
131
|
+
* `tailwind-merge` (for last-wins conflict resolution between
|
|
132
|
+
* conflicting Tailwind utilities). This is the override contract
|
|
133
|
+
* that powers `sx` and `slotProps`:
|
|
134
|
+
*
|
|
135
|
+
* ```tsx
|
|
136
|
+
* cn(buttonVariants({ variant: 'solid', color: 'primary' }), sx)
|
|
137
|
+
* // sx="bg-red-500" beats the variant's `bg-primary-500`.
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* Without `tailwind-merge`, Tailwind's stylesheet output order decides
|
|
141
|
+
* who wins, which is unpredictable for consumers and breaks the
|
|
142
|
+
* documented "override always wins" semantics.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* <button className={cn('px-4 py-2', isPrimary && 'bg-primary-500')}>
|
|
147
|
+
* cn(['inline-flex', { 'opacity-50': disabled }], extra);
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export function cn(...inputs: ClassValue[]): string {
|
|
151
|
+
return twMerge(clsx(inputs));
|
|
152
|
+
}
|
|
153
|
+
</pre></td></tr></table></pre>
|
|
154
|
+
|
|
155
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
156
|
+
</div><!-- /wrapper -->
|
|
157
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
158
|
+
Code coverage generated by
|
|
159
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
160
|
+
at 2026-05-20T08:18:26.407Z
|
|
161
|
+
</div>
|
|
162
|
+
<script src="../../prettify.js"></script>
|
|
163
|
+
<script>
|
|
164
|
+
window.onload = function () {
|
|
165
|
+
prettyPrint();
|
|
166
|
+
};
|
|
167
|
+
</script>
|
|
168
|
+
<script src="../../sorter.js"></script>
|
|
169
|
+
<script src="../../block-navigation.js"></script>
|
|
170
|
+
</body>
|
|
171
|
+
</html>
|
|
172
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/utils</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../index.html">All files</a> src/utils</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>1/1</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>1/1</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<div class="pad1">
|
|
66
|
+
<table class="coverage-summary">
|
|
67
|
+
<thead>
|
|
68
|
+
<tr>
|
|
69
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
<tbody><tr>
|
|
82
|
+
<td class="file high" data-value="cn.ts"><a href="cn.ts.html">cn.ts</a></td>
|
|
83
|
+
<td data-value="100" class="pic high">
|
|
84
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
|
+
</td>
|
|
86
|
+
<td data-value="100" class="pct high">100%</td>
|
|
87
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
88
|
+
<td data-value="100" class="pct high">100%</td>
|
|
89
|
+
<td data-value="0" class="abs high">0/0</td>
|
|
90
|
+
<td data-value="100" class="pct high">100%</td>
|
|
91
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
92
|
+
<td data-value="100" class="pct high">100%</td>
|
|
93
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
</tbody>
|
|
97
|
+
</table>
|
|
98
|
+
</div>
|
|
99
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
100
|
+
</div><!-- /wrapper -->
|
|
101
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
|
+
Code coverage generated by
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at 2026-05-20T08:18:26.407Z
|
|
105
|
+
</div>
|
|
106
|
+
<script src="../../prettify.js"></script>
|
|
107
|
+
<script>
|
|
108
|
+
window.onload = function () {
|
|
109
|
+
prettyPrint();
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
<script src="../../sorter.js"></script>
|
|
113
|
+
<script src="../../block-navigation.js"></script>
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
116
|
+
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { TableColumn } from '../../Table/table.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Column visibility dialog for DataGrid.
|
|
4
|
-
*
|
|
5
|
-
* Renders a toolbar button (the trigger) that opens a `<Dialog>` with
|
|
6
|
-
* one checkbox per `hideable` column. The consumer can:
|
|
7
|
-
* - Show/hide individual columns
|
|
8
|
-
* - "Show all" / "Hide all" shortcuts
|
|
9
|
-
* - Persist visibility via the controllable `hiddenColumns` model
|
|
10
|
-
*
|
|
11
|
-
* Columns with `hideable: false` are NEVER shown in the dialog —
|
|
12
|
-
* those are considered structurally required (e.g. an ID column).
|
|
13
|
-
*
|
|
14
|
-
* RBAC-hidden columns (`access.onUnauthorized === 'hide'`) are also
|
|
15
|
-
* excluded — they're already removed from `visibleCols` upstream.
|
|
16
|
-
*/
|
|
17
|
-
export interface ColumnVisibilityLabels {
|
|
18
|
-
columnsButton?: string;
|
|
19
|
-
columnsTitle?: string;
|
|
20
|
-
columnsDescription?: string;
|
|
21
|
-
columnsShowAll?: string;
|
|
22
|
-
columnsHideAll?: string;
|
|
23
|
-
columnsDone?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ColumnVisibilityTriggerProps<T extends object> {
|
|
26
|
-
cols: TableColumn<T>[];
|
|
27
|
-
hiddenColumns: string[];
|
|
28
|
-
onChange: (next: string[]) => void;
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
labels?: ColumnVisibilityLabels;
|
|
31
|
-
}
|
|
32
|
-
export declare function ColumnVisibilityTrigger<T extends object>(props: ColumnVisibilityTriggerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
//# sourceMappingURL=ColumnVisibilityDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnVisibilityDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/DataGrid/visibility/ColumnVisibilityDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAWD,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,MAAM;IAC5D,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACtD,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC,2CA8CvC"}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, type ReactNode } from 'react';
|
|
2
|
-
import { Dialog } from '../../Dialog/Dialog.js';
|
|
3
|
-
import { cn } from '../../../utils/cn.js';
|
|
4
|
-
import type { TableColumn } from '../../Table/table.types.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Column visibility dialog for DataGrid.
|
|
8
|
-
*
|
|
9
|
-
* Renders a toolbar button (the trigger) that opens a `<Dialog>` with
|
|
10
|
-
* one checkbox per `hideable` column. The consumer can:
|
|
11
|
-
* - Show/hide individual columns
|
|
12
|
-
* - "Show all" / "Hide all" shortcuts
|
|
13
|
-
* - Persist visibility via the controllable `hiddenColumns` model
|
|
14
|
-
*
|
|
15
|
-
* Columns with `hideable: false` are NEVER shown in the dialog —
|
|
16
|
-
* those are considered structurally required (e.g. an ID column).
|
|
17
|
-
*
|
|
18
|
-
* RBAC-hidden columns (`access.onUnauthorized === 'hide'`) are also
|
|
19
|
-
* excluded — they're already removed from `visibleCols` upstream.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export interface ColumnVisibilityLabels {
|
|
23
|
-
columnsButton?: string;
|
|
24
|
-
columnsTitle?: string;
|
|
25
|
-
columnsDescription?: string;
|
|
26
|
-
columnsShowAll?: string;
|
|
27
|
-
columnsHideAll?: string;
|
|
28
|
-
columnsDone?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const DEFAULT_VISIBILITY_LABELS: Required<ColumnVisibilityLabels> = {
|
|
32
|
-
columnsButton: 'Columns',
|
|
33
|
-
columnsTitle: 'Manage columns',
|
|
34
|
-
columnsDescription: 'Show or hide columns. Required columns cannot be toggled.',
|
|
35
|
-
columnsShowAll: 'Show all',
|
|
36
|
-
columnsHideAll: 'Hide all',
|
|
37
|
-
columnsDone: 'Done',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export interface ColumnVisibilityTriggerProps<T extends object> {
|
|
41
|
-
cols: TableColumn<T>[];
|
|
42
|
-
hiddenColumns: string[];
|
|
43
|
-
onChange: (next: string[]) => void;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
labels?: ColumnVisibilityLabels;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function ColumnVisibilityTrigger<T extends object>(
|
|
49
|
-
props: ColumnVisibilityTriggerProps<T>,
|
|
50
|
-
) {
|
|
51
|
-
const { cols, hiddenColumns, onChange, disabled, labels: labelsProp } = props;
|
|
52
|
-
const labels = { ...DEFAULT_VISIBILITY_LABELS, ...labelsProp };
|
|
53
|
-
const [open, setOpen] = useState(false);
|
|
54
|
-
|
|
55
|
-
// Hideable cols are the only ones the user can toggle. `hideable`
|
|
56
|
-
// defaults to `true` — a column is hideable unless explicitly opted
|
|
57
|
-
// out with `hideable: false` (structurally required column).
|
|
58
|
-
const hideableCols = cols.filter((c) => c.hideable !== false);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<>
|
|
62
|
-
<button
|
|
63
|
-
type="button"
|
|
64
|
-
onClick={() => setOpen(true)}
|
|
65
|
-
disabled={disabled}
|
|
66
|
-
className={cn(
|
|
67
|
-
'inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md',
|
|
68
|
-
'text-sm text-neutral-700 hover:text-neutral-900',
|
|
69
|
-
'border border-neutral-300 bg-neutral-50 hover:bg-neutral-100',
|
|
70
|
-
'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',
|
|
71
|
-
'transition-colors motion-reduce:transition-none',
|
|
72
|
-
'disabled:opacity-50 disabled:cursor-not-allowed',
|
|
73
|
-
)}
|
|
74
|
-
>
|
|
75
|
-
<ColumnsIcon />
|
|
76
|
-
<span>{labels.columnsButton}</span>
|
|
77
|
-
</button>
|
|
78
|
-
<Dialog
|
|
79
|
-
open={open}
|
|
80
|
-
onOpenChange={setOpen}
|
|
81
|
-
title={labels.columnsTitle}
|
|
82
|
-
description={labels.columnsDescription}
|
|
83
|
-
size="sm"
|
|
84
|
-
>
|
|
85
|
-
<ColumnVisibilityBody
|
|
86
|
-
cols={hideableCols}
|
|
87
|
-
hiddenColumns={hiddenColumns}
|
|
88
|
-
onChange={onChange}
|
|
89
|
-
onDone={() => setOpen(false)}
|
|
90
|
-
labels={labels}
|
|
91
|
-
/>
|
|
92
|
-
</Dialog>
|
|
93
|
-
</>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// ───── Dialog body ─────
|
|
98
|
-
|
|
99
|
-
function ColumnVisibilityBody<T extends object>(props: {
|
|
100
|
-
cols: TableColumn<T>[];
|
|
101
|
-
hiddenColumns: string[];
|
|
102
|
-
onChange: (next: string[]) => void;
|
|
103
|
-
onDone: () => void;
|
|
104
|
-
labels: Required<ColumnVisibilityLabels>;
|
|
105
|
-
}) {
|
|
106
|
-
const { cols, hiddenColumns, onChange, onDone, labels } = props;
|
|
107
|
-
// Local draft so the user can stage changes; commit on Done.
|
|
108
|
-
const [draft, setDraft] = useState<string[]>(hiddenColumns);
|
|
109
|
-
|
|
110
|
-
// Re-sync when the dialog re-opens with a different external state.
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
setDraft(hiddenColumns);
|
|
113
|
-
}, [hiddenColumns]);
|
|
114
|
-
|
|
115
|
-
const toggle = (field: string) => {
|
|
116
|
-
setDraft((prev) =>
|
|
117
|
-
prev.includes(field) ? prev.filter((f) => f !== field) : [...prev, field],
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const showAll = () => setDraft([]);
|
|
122
|
-
const hideAll = () => setDraft(cols.map((c) => c.field as string));
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<div className="flex flex-col gap-3">
|
|
126
|
-
<div className="flex items-center gap-2 pb-2 border-b border-neutral-200">
|
|
127
|
-
<button
|
|
128
|
-
type="button"
|
|
129
|
-
onClick={showAll}
|
|
130
|
-
className="text-xs text-neutral-600 hover:text-neutral-900 underline-offset-2 hover:underline focus:outline-none focus-visible:underline"
|
|
131
|
-
>
|
|
132
|
-
{labels.columnsShowAll}
|
|
133
|
-
</button>
|
|
134
|
-
<span className="text-neutral-300">·</span>
|
|
135
|
-
<button
|
|
136
|
-
type="button"
|
|
137
|
-
onClick={hideAll}
|
|
138
|
-
className="text-xs text-neutral-600 hover:text-neutral-900 underline-offset-2 hover:underline focus:outline-none focus-visible:underline"
|
|
139
|
-
>
|
|
140
|
-
{labels.columnsHideAll}
|
|
141
|
-
</button>
|
|
142
|
-
</div>
|
|
143
|
-
<ul className="flex flex-col gap-1.5 max-h-72 overflow-auto">
|
|
144
|
-
{cols.map((col) => {
|
|
145
|
-
const field = col.field as string;
|
|
146
|
-
const hidden = draft.includes(field);
|
|
147
|
-
const header =
|
|
148
|
-
typeof col.header === 'function' ? col.header() : col.header;
|
|
149
|
-
return (
|
|
150
|
-
<li key={field}>
|
|
151
|
-
<label className="flex items-center gap-2 cursor-pointer py-1 px-1 rounded hover:bg-neutral-100">
|
|
152
|
-
<input
|
|
153
|
-
type="checkbox"
|
|
154
|
-
checked={!hidden}
|
|
155
|
-
onChange={() => toggle(field)}
|
|
156
|
-
className="cursor-pointer"
|
|
157
|
-
/>
|
|
158
|
-
<span className="text-sm text-neutral-900">{header}</span>
|
|
159
|
-
</label>
|
|
160
|
-
</li>
|
|
161
|
-
);
|
|
162
|
-
})}
|
|
163
|
-
</ul>
|
|
164
|
-
<div className="flex justify-end gap-2 pt-2 border-t border-neutral-200">
|
|
165
|
-
<button
|
|
166
|
-
type="button"
|
|
167
|
-
onClick={() => {
|
|
168
|
-
onChange(draft);
|
|
169
|
-
onDone();
|
|
170
|
-
}}
|
|
171
|
-
className="text-sm bg-primary-500 text-white rounded-md hover:bg-primary-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 px-3 py-1.5"
|
|
172
|
-
>
|
|
173
|
-
{labels.columnsDone}
|
|
174
|
-
</button>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// ───── Icon ─────
|
|
181
|
-
|
|
182
|
-
function ColumnsIcon(): ReactNode {
|
|
183
|
-
return (
|
|
184
|
-
<svg
|
|
185
|
-
width="0.875em"
|
|
186
|
-
height="0.875em"
|
|
187
|
-
viewBox="0 0 16 16"
|
|
188
|
-
fill="none"
|
|
189
|
-
stroke="currentColor"
|
|
190
|
-
strokeWidth="1.5"
|
|
191
|
-
strokeLinecap="round"
|
|
192
|
-
strokeLinejoin="round"
|
|
193
|
-
aria-hidden="true"
|
|
194
|
-
>
|
|
195
|
-
<rect x="2" y="3" width="3.5" height="10" rx="0.5" />
|
|
196
|
-
<rect x="6.25" y="3" width="3.5" height="10" rx="0.5" />
|
|
197
|
-
<rect x="10.5" y="3" width="3.5" height="10" rx="0.5" />
|
|
198
|
-
</svg>
|
|
199
|
-
);
|
|
200
|
-
}
|