dce-reactkit 3.2.2-beta.34 → 3.2.2-beta.35
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/dist/cjs/index.js +20 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +20 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/IntelliTable.tsx +27 -1
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ import Modal from './Modal';
|
|
|
30
30
|
import ModalType from '../types/ModalType';
|
|
31
31
|
import CheckboxButton from './CheckboxButton';
|
|
32
32
|
import CSVDownloadButton from './CSVDownloadButton';
|
|
33
|
+
import Variant from '../types/Variant';
|
|
33
34
|
|
|
34
35
|
/*------------------------------------------------------------------------*/
|
|
35
36
|
/* Types */
|
|
@@ -234,6 +235,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
234
235
|
type: ActionType.ToggleColVisCusModalVisibility,
|
|
235
236
|
});
|
|
236
237
|
}}
|
|
238
|
+
okayVariant={Variant.Light}
|
|
237
239
|
>
|
|
238
240
|
{
|
|
239
241
|
columns.map((column) => {
|
|
@@ -241,6 +243,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
241
243
|
<CheckboxButton
|
|
242
244
|
key={column.param}
|
|
243
245
|
id={`IntelliTable-${id}-toggle-visibility-${column.param}`}
|
|
246
|
+
className="mb-2"
|
|
244
247
|
text={column.title}
|
|
245
248
|
onChanged={() => {
|
|
246
249
|
dispatch({
|
|
@@ -250,6 +253,8 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
250
253
|
}}
|
|
251
254
|
checked={columnVisibilityMap[column.param]}
|
|
252
255
|
ariaLabel={`show "${column.title}" column`}
|
|
256
|
+
checkedVariant={Variant.Light}
|
|
257
|
+
uncheckedVariant={Variant.Secondary}
|
|
253
258
|
/>
|
|
254
259
|
);
|
|
255
260
|
})
|
|
@@ -307,7 +312,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
307
312
|
borderLeft: '0.05rem solid #555',
|
|
308
313
|
}}
|
|
309
314
|
>
|
|
310
|
-
<div className="d-flex align-items-center justify-content-
|
|
315
|
+
<div className="d-flex align-items-center justify-content-start flex-row h-100">
|
|
311
316
|
{/* Title */}
|
|
312
317
|
<span className="text-nowrap">
|
|
313
318
|
{column.title}
|
|
@@ -355,6 +360,27 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
355
360
|
const aVal = a[sortColumnParam];
|
|
356
361
|
const bVal = b[sortColumnParam];
|
|
357
362
|
|
|
363
|
+
// Auto-sort undefined and null to end of list
|
|
364
|
+
if (
|
|
365
|
+
(aVal === undefined || aVal === null)
|
|
366
|
+
|| (bVal === undefined || bVal === null)
|
|
367
|
+
) {
|
|
368
|
+
// At least one was undefined
|
|
369
|
+
if (
|
|
370
|
+
(aVal === undefined || aVal === null)
|
|
371
|
+
&& (bVal === undefined || bVal === null)
|
|
372
|
+
) {
|
|
373
|
+
// Both undefined
|
|
374
|
+
return 0;
|
|
375
|
+
}
|
|
376
|
+
if (aVal === undefined || aVal === null) {
|
|
377
|
+
// First was undefined
|
|
378
|
+
return 1;
|
|
379
|
+
}
|
|
380
|
+
// Second was undefined
|
|
381
|
+
return -1;
|
|
382
|
+
}
|
|
383
|
+
|
|
358
384
|
// Sort differently based on the data type
|
|
359
385
|
// > Boolean
|
|
360
386
|
if (paramType === ParamType.Boolean) {
|