@trackunit/react-table-base-components 2.11.6 → 2.12.1
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/migrations/{v3-0-0/copyablecell-to-copy-pair.js → v2-8-0/copyablecell-to-copyablevalue.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.copyableCellToCopyableValue = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
6
6
|
const jsx_utils_1 = require("../utils/jsx-utils");
|
|
@@ -38,15 +38,16 @@ const secondaryTextExpression = (attr) => {
|
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
40
|
};
|
|
41
|
-
const renderPair = (textExpr, secondaryRow) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
`
|
|
41
|
+
const renderPair = (textExpr, secondaryRow, testIdText = null) => {
|
|
42
|
+
const props = [
|
|
43
|
+
testIdText !== null ? `data-testid=${testIdText}` : null,
|
|
44
|
+
`size="extraSmall"`,
|
|
45
|
+
secondaryRow ? `textSize="small"` : null,
|
|
46
|
+
`value={${textExpr}}`,
|
|
46
47
|
]
|
|
47
48
|
.filter(Boolean)
|
|
48
49
|
.join(" ");
|
|
49
|
-
return `<
|
|
50
|
+
return `<CopyableValue ${props} />`;
|
|
50
51
|
};
|
|
51
52
|
const attributeSourceText = (attr) => attr !== null && attr.initializer !== undefined ? attr.initializer.getText() : null;
|
|
52
53
|
const removeNamedImport = (content, packageName, name) => {
|
|
@@ -136,10 +137,7 @@ const transformCopyableCellUsage = (filePath, content) => {
|
|
|
136
137
|
const testIdText = attributeSourceText((0, jsx_utils_1.findJsxAttribute)(openingElement, "data-testid"));
|
|
137
138
|
let replacement;
|
|
138
139
|
if (secondaryAttr === null) {
|
|
139
|
-
replacement = renderPair(textExpr, false);
|
|
140
|
-
if (testIdText !== null) {
|
|
141
|
-
replacement = replacement.replace(`<div className="flex min-w-0 max-w-full items-center overflow-hidden">`, `<div className="flex min-w-0 max-w-full items-center overflow-hidden" data-testid=${testIdText}>`);
|
|
142
|
-
}
|
|
140
|
+
replacement = renderPair(textExpr, false, testIdText);
|
|
143
141
|
}
|
|
144
142
|
else {
|
|
145
143
|
const secondaryExpr = secondaryTextExpression(secondaryAttr);
|
|
@@ -171,23 +169,23 @@ const transformCopyableCellUsage = (filePath, content) => {
|
|
|
171
169
|
if (needsMultiRow) {
|
|
172
170
|
updated = ensureNamedImport(updated, TABLE_PACKAGE, ["MultiRowTableCell"]);
|
|
173
171
|
}
|
|
174
|
-
updated = ensureNamedImport(updated, COMPONENTS_PACKAGE, ["
|
|
172
|
+
updated = ensureNamedImport(updated, COMPONENTS_PACKAGE, ["CopyableValue"]);
|
|
175
173
|
return updated;
|
|
176
174
|
};
|
|
177
175
|
/**
|
|
178
176
|
* Rewrites `<CopyableCell text={x} secondary={{ text: y }} …/>` (removed in
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
177
|
+
* 2.8.0) into `CopyableValue` from `@trackunit/react-components` at the
|
|
178
|
+
* `extraSmall` table size, wrapped for two-row cells in `MultiRowTableCell`
|
|
179
|
+
* (with the `w-fit overflow-hidden` guard that keeps the pair inside the
|
|
180
|
+
* cell's grid track) and small text on the second row. Usages with spreads, dynamic
|
|
183
181
|
* `secondary` values, forwarded classNames, or a referenced
|
|
184
182
|
* `CopyableCellProps` type are left for manual review.
|
|
185
183
|
*/
|
|
186
|
-
const
|
|
184
|
+
const copyableCellToCopyableValue = (tree) => {
|
|
187
185
|
manualReviewCount = 0;
|
|
188
186
|
const touched = (0, jsx_utils_1.visitTsxFiles)(tree, COMPONENT_NAME, transformCopyableCellUsage);
|
|
189
|
-
(0, jsx_utils_1.logSummary)("copyablecell-to-
|
|
187
|
+
(0, jsx_utils_1.logSummary)("copyablecell-to-copyablevalue", touched, manualReviewCount);
|
|
190
188
|
};
|
|
191
|
-
exports.
|
|
192
|
-
exports.default = exports.
|
|
193
|
-
//# sourceMappingURL=copyablecell-to-
|
|
189
|
+
exports.copyableCellToCopyableValue = copyableCellToCopyableValue;
|
|
190
|
+
exports.default = exports.copyableCellToCopyableValue;
|
|
191
|
+
//# sourceMappingURL=copyablecell-to-copyablevalue.js.map
|
package/migrations.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generators": {
|
|
3
|
-
"
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "Replace the removed CopyableCell with
|
|
6
|
-
"implementation": "./migrations/
|
|
3
|
+
"v2-8-0-copyablecell-to-copyablevalue": {
|
|
4
|
+
"version": "2.8.0",
|
|
5
|
+
"description": "Replace the removed CopyableCell with CopyableValue from @trackunit/react-components, wrapped in MultiRowTableCell for two-row cells.",
|
|
6
|
+
"implementation": "./migrations/v2-8-0/copyablecell-to-copyablevalue"
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "3.
|
|
11
|
-
"@trackunit/ui-icons": "1.
|
|
12
|
-
"@trackunit/react-form-components": "2.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "2.
|
|
14
|
-
"@trackunit/date-and-time-utils": "1.
|
|
15
|
-
"@trackunit/react-date-and-time-hooks": "2.
|
|
16
|
-
"@trackunit/shared-utils": "1.
|
|
17
|
-
"@trackunit/i18n-library-translation": "2.
|
|
10
|
+
"@trackunit/react-components": "3.7.0",
|
|
11
|
+
"@trackunit/ui-icons": "1.17.0",
|
|
12
|
+
"@trackunit/react-form-components": "2.10.1",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "2.3.0",
|
|
14
|
+
"@trackunit/date-and-time-utils": "1.17.0",
|
|
15
|
+
"@trackunit/react-date-and-time-hooks": "2.10.1",
|
|
16
|
+
"@trackunit/shared-utils": "1.19.0",
|
|
17
|
+
"@trackunit/i18n-library-translation": "2.8.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|