@visns-studio/visns-components 6.1.5 → 6.1.7
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/package.json
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
92
92
|
},
|
|
93
93
|
"name": "@visns-studio/visns-components",
|
|
94
|
-
"version": "6.1.
|
|
94
|
+
"version": "6.1.7",
|
|
95
95
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
96
96
|
"main": "src/index.js",
|
|
97
97
|
"files": [
|
|
@@ -250,6 +250,13 @@ const loadData = async (
|
|
|
250
250
|
const ROW_HEIGHT = 34;
|
|
251
251
|
const GRID_CHROME = ROW_HEIGHT * 2 + 60; // header + filter row + footer
|
|
252
252
|
|
|
253
|
+
/**
|
|
254
|
+
* Column types whose renderer names the grid column `${type}.${id}` instead of
|
|
255
|
+
* the plain field path. Their filter entries must use the same name, otherwise
|
|
256
|
+
* the grid cannot pair the filter with its column and no editor is rendered.
|
|
257
|
+
*/
|
|
258
|
+
const TYPE_PREFIXED_FILTER_NAMES = ['age', 'coding'];
|
|
259
|
+
|
|
253
260
|
function fitToRows(dataCount, windowHeight) {
|
|
254
261
|
const roomy = Math.max(windowHeight * 0.7, 550);
|
|
255
262
|
|
|
@@ -3655,6 +3662,7 @@ const DataGrid = forwardRef(
|
|
|
3655
3662
|
column,
|
|
3656
3663
|
commonProps,
|
|
3657
3664
|
filterEditor,
|
|
3665
|
+
filterEditorProps,
|
|
3658
3666
|
});
|
|
3659
3667
|
case 'arrayCount':
|
|
3660
3668
|
return renderArrayCountColumn({
|
|
@@ -3672,6 +3680,8 @@ const DataGrid = forwardRef(
|
|
|
3672
3680
|
return renderCodingColumn({
|
|
3673
3681
|
column,
|
|
3674
3682
|
commonProps,
|
|
3683
|
+
filterEditor,
|
|
3684
|
+
filterEditorProps,
|
|
3675
3685
|
handleCoding,
|
|
3676
3686
|
});
|
|
3677
3687
|
case 'colour':
|
|
@@ -4285,21 +4295,31 @@ const DataGrid = forwardRef(
|
|
|
4285
4295
|
let filterName = '';
|
|
4286
4296
|
|
|
4287
4297
|
if (Array.isArray(column.id)) {
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4298
|
+
// The age/coding renderers name their column
|
|
4299
|
+
// `${type}.${id}` with the array stringified,
|
|
4300
|
+
// so the filter has to be named the same way or
|
|
4301
|
+
// the grid never matches it to the column.
|
|
4302
|
+
if (TYPE_PREFIXED_FILTER_NAMES.includes(column.type)) {
|
|
4303
|
+
filterName = `${column.type}.${column.id}`;
|
|
4304
|
+
} else {
|
|
4305
|
+
filterName = column.id.reduce(
|
|
4306
|
+
(acc, id) => acc + `${id}.`,
|
|
4307
|
+
''
|
|
4308
|
+
);
|
|
4292
4309
|
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4310
|
+
if (
|
|
4311
|
+
column.type === 'dropdown' &&
|
|
4312
|
+
filterName.endsWith('.')
|
|
4313
|
+
) {
|
|
4314
|
+
filterName = filterName.slice(0, -1);
|
|
4315
|
+
}
|
|
4298
4316
|
}
|
|
4299
4317
|
} else {
|
|
4300
4318
|
switch (column.type) {
|
|
4301
4319
|
case 'address':
|
|
4302
4320
|
case 'boolean':
|
|
4321
|
+
case 'age':
|
|
4322
|
+
case 'coding':
|
|
4303
4323
|
filterName = `${column.type}.${column.id}`;
|
|
4304
4324
|
break;
|
|
4305
4325
|
default:
|
|
@@ -4308,7 +4328,10 @@ const DataGrid = forwardRef(
|
|
|
4308
4328
|
}
|
|
4309
4329
|
}
|
|
4310
4330
|
|
|
4311
|
-
if (
|
|
4331
|
+
if (
|
|
4332
|
+
column.nameFrom &&
|
|
4333
|
+
!TYPE_PREFIXED_FILTER_NAMES.includes(column.type)
|
|
4334
|
+
) {
|
|
4312
4335
|
filterName += column.nameFrom;
|
|
4313
4336
|
}
|
|
4314
4337
|
|
|
@@ -1641,11 +1641,17 @@ export const renderPlaceholderColumn = ({ column, commonProps }) => {
|
|
|
1641
1641
|
};
|
|
1642
1642
|
|
|
1643
1643
|
// Age Column Renderer
|
|
1644
|
-
export const renderAgeColumn = ({
|
|
1644
|
+
export const renderAgeColumn = ({
|
|
1645
|
+
column,
|
|
1646
|
+
commonProps,
|
|
1647
|
+
filterEditor,
|
|
1648
|
+
filterEditorProps,
|
|
1649
|
+
}) => {
|
|
1645
1650
|
return {
|
|
1646
1651
|
...commonProps,
|
|
1647
1652
|
type: 'number',
|
|
1648
1653
|
filterEditor: filterEditor,
|
|
1654
|
+
filterEditorProps: filterEditorProps,
|
|
1649
1655
|
name: `${column.type}.${column.id}`,
|
|
1650
1656
|
render: ({ data }) => {
|
|
1651
1657
|
const value = column.id.reduce((acc, id) => {
|
|
@@ -1675,9 +1681,19 @@ export const renderAgeColumn = ({ column, commonProps, filterEditor }) => {
|
|
|
1675
1681
|
};
|
|
1676
1682
|
|
|
1677
1683
|
// Coding Column Renderer
|
|
1678
|
-
export const renderCodingColumn = ({
|
|
1684
|
+
export const renderCodingColumn = ({
|
|
1685
|
+
column,
|
|
1686
|
+
commonProps,
|
|
1687
|
+
filterEditor,
|
|
1688
|
+
filterEditorProps,
|
|
1689
|
+
handleCoding,
|
|
1690
|
+
}) => {
|
|
1679
1691
|
return {
|
|
1680
1692
|
...commonProps,
|
|
1693
|
+
// A coding column is a composite of several icon fields, so it cannot
|
|
1694
|
+
// be sorted — but it can be filtered when the config declares one.
|
|
1695
|
+
filterEditor: filterEditor,
|
|
1696
|
+
filterEditorProps: filterEditorProps,
|
|
1681
1697
|
name: `${column.type}.${column.id}`,
|
|
1682
1698
|
sortable: false,
|
|
1683
1699
|
render: ({ data }) => {
|
|
@@ -1828,18 +1828,19 @@ select:not(:placeholder-shown) + .fi__span {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
|
-
/* Tooltip positioning
|
|
1832
|
-
|
|
1831
|
+
/* Tooltip anchors inside the builder need a positioning context and a
|
|
1832
|
+
z-index below the header. Scoped to the builder's own controls — a bare
|
|
1833
|
+
`[data-tooltip-id]` here is GLOBAL (css-modules does not hash attribute
|
|
1834
|
+
selectors), and until 6.1.6 it leaked `position: relative` onto every
|
|
1835
|
+
tooltip-carrying element in every consuming app, breaking any anchor
|
|
1836
|
+
that relied on `position: absolute` (e.g. copy-to-clipboard icons). */
|
|
1837
|
+
.dragHandle[data-tooltip-id],
|
|
1838
|
+
.editIcon[data-tooltip-id],
|
|
1839
|
+
.deleteIcon[data-tooltip-id],
|
|
1840
|
+
.moveIcon[data-tooltip-id],
|
|
1841
|
+
.collapseToggle[data-tooltip-id] {
|
|
1833
1842
|
position: relative;
|
|
1834
|
-
z-index: 50;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
/* React Tooltip specific z-index override */
|
|
1838
|
-
:global([data-tooltip-id="field-tooltip"]),
|
|
1839
|
-
:global([data-tooltip-id="action-tooltip"]),
|
|
1840
|
-
:global([data-tooltip-id="system-tooltip"]) {
|
|
1841
|
-
position: relative;
|
|
1842
|
-
z-index: 50 !important;
|
|
1843
|
+
z-index: 50;
|
|
1843
1844
|
}
|
|
1844
1845
|
|
|
1845
1846
|
/* Ensure action tooltips take priority over field tooltips */
|