@trackunit/react-form-components 1.27.3 → 1.27.5

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "1.27.3",
3
+ "version": "1.27.5",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "migrations": "./migrations.json",
@@ -10,17 +10,17 @@
10
10
  "dependencies": {
11
11
  "react-calendar": "^6.0.0",
12
12
  "react-select": "^5.10.2",
13
- "@trackunit/date-and-time-utils": "1.13.6",
13
+ "@trackunit/date-and-time-utils": "1.13.7",
14
14
  "usehooks-ts": "^3.1.0",
15
15
  "libphonenumber-js": "^1.12.22",
16
16
  "zod": "^3.25.76",
17
17
  "tailwind-merge": "^2.0.0",
18
- "@trackunit/css-class-variance-utilities": "1.13.6",
19
- "@trackunit/react-components": "1.26.2",
20
- "@trackunit/ui-icons": "1.13.6",
21
- "@trackunit/shared-utils": "1.15.6",
22
- "@trackunit/ui-design-tokens": "1.13.6",
23
- "@trackunit/i18n-library-translation": "1.22.1",
18
+ "@trackunit/css-class-variance-utilities": "1.13.7",
19
+ "@trackunit/react-components": "1.26.4",
20
+ "@trackunit/ui-icons": "1.13.7",
21
+ "@trackunit/shared-utils": "1.15.7",
22
+ "@trackunit/ui-design-tokens": "1.13.7",
23
+ "@trackunit/i18n-library-translation": "1.22.2",
24
24
  "string-ts": "^2.0.0",
25
25
  "es-toolkit": "^1.39.10"
26
26
  },
@@ -22,8 +22,8 @@ var translation = {
22
22
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
23
23
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
24
24
  "numberField.error.REQUIRED": "Este campo é obrigatório",
25
- "passwordField.tooltip.hide": "Hide password",
26
- "passwordField.tooltip.show": "Show password",
25
+ "passwordField.tooltip.hide": "Ocultar palavra-passe",
26
+ "passwordField.tooltip.show": "Mostrar palavra-passe",
27
27
  "phoneField.error.INVALID_COUNTRY": "O código do país não é válido",
28
28
  "phoneField.error.INVALID_LENGTH": "O número de telefone não é válido",
29
29
  "phoneField.error.INVALID_NUMBER": "O número de telefone não é válido",
@@ -43,7 +43,7 @@ var translation = {
43
43
  "select.noOptionsMessage": "No options found",
44
44
  "urlField.error.INVALID_URL": "Please enter a valid URL",
45
45
  "urlField.error.REQUIRED": "The URL is required",
46
- "urlField.url.label": "Web address"
46
+ "urlField.url.label": "Endereço da Internet"
47
47
  };
48
48
 
49
49
  exports.default = translation;
@@ -14,7 +14,7 @@ var translation = {
14
14
  "dropzone.label.default": "<clickable>Bläddra</clickable> bland filerna eller dra dem hit...",
15
15
  "emailField.error.INVALID_EMAIL": "Ange en giltig e-postadress",
16
16
  "emailField.error.REQUIRED": "The email address is required",
17
- "emailField.sendEmailAction.label": "Email",
17
+ "emailField.sendEmailAction.label": "E-post",
18
18
  "field.notEditable.tooltip": "Detta fält kan inte redigeras",
19
19
  "field.required.asterisk.tooltip": "Detta fält är obligatoriskt",
20
20
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -22,8 +22,8 @@ var translation = {
22
22
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
23
23
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
24
24
  "numberField.error.REQUIRED": "This field is required",
25
- "passwordField.tooltip.hide": "Hide password",
26
- "passwordField.tooltip.show": "Show password",
25
+ "passwordField.tooltip.hide": "Dölj lösenord",
26
+ "passwordField.tooltip.show": "Visa lösenord",
27
27
  "phoneField.error.INVALID_COUNTRY": "Landskoden är inte giltig",
28
28
  "phoneField.error.INVALID_LENGTH": "Telefonnumret är inte giltigt",
29
29
  "phoneField.error.INVALID_NUMBER": "Telefonnumret är inte giltigt",
@@ -43,7 +43,7 @@ var translation = {
43
43
  "select.noOptionsMessage": "No options found",
44
44
  "urlField.error.INVALID_URL": "Please enter a valid URL",
45
45
  "urlField.error.REQUIRED": "The URL is required",
46
- "urlField.url.label": "Web address"
46
+ "urlField.url.label": "Webbadress"
47
47
  };
48
48
 
49
49
  exports.default = translation;
@@ -14,7 +14,7 @@ var translation = {
14
14
  "dropzone.label.default": "<clickable>ファイルを選択</clickable>またはここにファイルをドラッグ",
15
15
  "emailField.error.INVALID_EMAIL": "有効なメールアドレスを入力してください",
16
16
  "emailField.error.REQUIRED": "The email address is required",
17
- "emailField.sendEmailAction.label": "Email",
17
+ "emailField.sendEmailAction.label": "メールアドレス",
18
18
  "field.notEditable.tooltip": "このフィールドは編集できません",
19
19
  "field.required.asterisk.tooltip": "この欄は必須項目です",
20
20
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -22,8 +22,8 @@ var translation = {
22
22
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
23
23
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
24
24
  "numberField.error.REQUIRED": "この欄は必須項目です",
25
- "passwordField.tooltip.hide": "Hide password",
26
- "passwordField.tooltip.show": "Show password",
25
+ "passwordField.tooltip.hide": "パスワードを非表示にする",
26
+ "passwordField.tooltip.show": "パスワードを表示",
27
27
  "phoneField.error.INVALID_COUNTRY": "国コードが無効です",
28
28
  "phoneField.error.INVALID_LENGTH": "電話番号が無効です",
29
29
  "phoneField.error.INVALID_NUMBER": "電話番号が無効です",
@@ -43,7 +43,7 @@ var translation = {
43
43
  "select.noOptionsMessage": "No options found",
44
44
  "urlField.error.INVALID_URL": "Please enter a valid URL",
45
45
  "urlField.error.REQUIRED": "The URL is required",
46
- "urlField.url.label": "Web address"
46
+ "urlField.url.label": "Webアドレス"
47
47
  };
48
48
 
49
49
  exports.default = translation;
@@ -14,7 +14,7 @@ var translation = {
14
14
  "dropzone.label.default": "<clickable>Sfoglia</clickable> o trascina i file qui...",
15
15
  "emailField.error.INVALID_EMAIL": "Inserisci un indirizzo email valido",
16
16
  "emailField.error.REQUIRED": "The email address is required",
17
- "emailField.sendEmailAction.label": "Email",
17
+ "emailField.sendEmailAction.label": "E-mail",
18
18
  "field.notEditable.tooltip": "Questo campo non è modificabile",
19
19
  "field.required.asterisk.tooltip": "Questo campo è obbligatorio",
20
20
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -22,8 +22,8 @@ var translation = {
22
22
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
23
23
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
24
24
  "numberField.error.REQUIRED": "Questo campo è obbligatorio",
25
- "passwordField.tooltip.hide": "Hide password",
26
- "passwordField.tooltip.show": "Show password",
25
+ "passwordField.tooltip.hide": "Nascondi password",
26
+ "passwordField.tooltip.show": "Mostra password",
27
27
  "phoneField.error.INVALID_COUNTRY": "Il codice Paese non è valido",
28
28
  "phoneField.error.INVALID_LENGTH": "Il numero di telefono non è valido",
29
29
  "phoneField.error.INVALID_NUMBER": "Il numero di telefono non è valido",
@@ -43,7 +43,7 @@ var translation = {
43
43
  "select.noOptionsMessage": "No options found",
44
44
  "urlField.error.INVALID_URL": "Please enter a valid URL",
45
45
  "urlField.error.REQUIRED": "The URL is required",
46
- "urlField.url.label": "Web address"
46
+ "urlField.url.label": "Indirizzo web"
47
47
  };
48
48
 
49
49
  exports.default = translation;
@@ -20,8 +20,8 @@ var translation = {
20
20
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
21
21
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
22
22
  "numberField.error.REQUIRED": "Este campo é obrigatório",
23
- "passwordField.tooltip.hide": "Hide password",
24
- "passwordField.tooltip.show": "Show password",
23
+ "passwordField.tooltip.hide": "Ocultar palavra-passe",
24
+ "passwordField.tooltip.show": "Mostrar palavra-passe",
25
25
  "phoneField.error.INVALID_COUNTRY": "O código do país não é válido",
26
26
  "phoneField.error.INVALID_LENGTH": "O número de telefone não é válido",
27
27
  "phoneField.error.INVALID_NUMBER": "O número de telefone não é válido",
@@ -41,7 +41,7 @@ var translation = {
41
41
  "select.noOptionsMessage": "No options found",
42
42
  "urlField.error.INVALID_URL": "Please enter a valid URL",
43
43
  "urlField.error.REQUIRED": "The URL is required",
44
- "urlField.url.label": "Web address"
44
+ "urlField.url.label": "Endereço da Internet"
45
45
  };
46
46
 
47
47
  export { translation as default };
@@ -12,7 +12,7 @@ var translation = {
12
12
  "dropzone.label.default": "<clickable>Bläddra</clickable> bland filerna eller dra dem hit...",
13
13
  "emailField.error.INVALID_EMAIL": "Ange en giltig e-postadress",
14
14
  "emailField.error.REQUIRED": "The email address is required",
15
- "emailField.sendEmailAction.label": "Email",
15
+ "emailField.sendEmailAction.label": "E-post",
16
16
  "field.notEditable.tooltip": "Detta fält kan inte redigeras",
17
17
  "field.required.asterisk.tooltip": "Detta fält är obligatoriskt",
18
18
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -20,8 +20,8 @@ var translation = {
20
20
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
21
21
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
22
22
  "numberField.error.REQUIRED": "This field is required",
23
- "passwordField.tooltip.hide": "Hide password",
24
- "passwordField.tooltip.show": "Show password",
23
+ "passwordField.tooltip.hide": "Dölj lösenord",
24
+ "passwordField.tooltip.show": "Visa lösenord",
25
25
  "phoneField.error.INVALID_COUNTRY": "Landskoden är inte giltig",
26
26
  "phoneField.error.INVALID_LENGTH": "Telefonnumret är inte giltigt",
27
27
  "phoneField.error.INVALID_NUMBER": "Telefonnumret är inte giltigt",
@@ -41,7 +41,7 @@ var translation = {
41
41
  "select.noOptionsMessage": "No options found",
42
42
  "urlField.error.INVALID_URL": "Please enter a valid URL",
43
43
  "urlField.error.REQUIRED": "The URL is required",
44
- "urlField.url.label": "Web address"
44
+ "urlField.url.label": "Webbadress"
45
45
  };
46
46
 
47
47
  export { translation as default };
@@ -12,7 +12,7 @@ var translation = {
12
12
  "dropzone.label.default": "<clickable>ファイルを選択</clickable>またはここにファイルをドラッグ",
13
13
  "emailField.error.INVALID_EMAIL": "有効なメールアドレスを入力してください",
14
14
  "emailField.error.REQUIRED": "The email address is required",
15
- "emailField.sendEmailAction.label": "Email",
15
+ "emailField.sendEmailAction.label": "メールアドレス",
16
16
  "field.notEditable.tooltip": "このフィールドは編集できません",
17
17
  "field.required.asterisk.tooltip": "この欄は必須項目です",
18
18
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -20,8 +20,8 @@ var translation = {
20
20
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
21
21
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
22
22
  "numberField.error.REQUIRED": "この欄は必須項目です",
23
- "passwordField.tooltip.hide": "Hide password",
24
- "passwordField.tooltip.show": "Show password",
23
+ "passwordField.tooltip.hide": "パスワードを非表示にする",
24
+ "passwordField.tooltip.show": "パスワードを表示",
25
25
  "phoneField.error.INVALID_COUNTRY": "国コードが無効です",
26
26
  "phoneField.error.INVALID_LENGTH": "電話番号が無効です",
27
27
  "phoneField.error.INVALID_NUMBER": "電話番号が無効です",
@@ -41,7 +41,7 @@ var translation = {
41
41
  "select.noOptionsMessage": "No options found",
42
42
  "urlField.error.INVALID_URL": "Please enter a valid URL",
43
43
  "urlField.error.REQUIRED": "The URL is required",
44
- "urlField.url.label": "Web address"
44
+ "urlField.url.label": "Webアドレス"
45
45
  };
46
46
 
47
47
  export { translation as default };
@@ -12,7 +12,7 @@ var translation = {
12
12
  "dropzone.label.default": "<clickable>Sfoglia</clickable> o trascina i file qui...",
13
13
  "emailField.error.INVALID_EMAIL": "Inserisci un indirizzo email valido",
14
14
  "emailField.error.REQUIRED": "The email address is required",
15
- "emailField.sendEmailAction.label": "Email",
15
+ "emailField.sendEmailAction.label": "E-mail",
16
16
  "field.notEditable.tooltip": "Questo campo non è modificabile",
17
17
  "field.required.asterisk.tooltip": "Questo campo è obbligatorio",
18
18
  "numberField.error.GREATER_THAN": "Value must be greater than or equal to {{min}}",
@@ -20,8 +20,8 @@ var translation = {
20
20
  "numberField.error.LESS_THAN": "Value must be less than or equal to {{max}}",
21
21
  "numberField.error.NOT_IN_BETWEEN": "Must be between {{min}} and {{max}}",
22
22
  "numberField.error.REQUIRED": "Questo campo è obbligatorio",
23
- "passwordField.tooltip.hide": "Hide password",
24
- "passwordField.tooltip.show": "Show password",
23
+ "passwordField.tooltip.hide": "Nascondi password",
24
+ "passwordField.tooltip.show": "Mostra password",
25
25
  "phoneField.error.INVALID_COUNTRY": "Il codice Paese non è valido",
26
26
  "phoneField.error.INVALID_LENGTH": "Il numero di telefono non è valido",
27
27
  "phoneField.error.INVALID_NUMBER": "Il numero di telefono non è valido",
@@ -41,7 +41,7 @@ var translation = {
41
41
  "select.noOptionsMessage": "No options found",
42
42
  "urlField.error.INVALID_URL": "Please enter a valid URL",
43
43
  "urlField.error.REQUIRED": "The URL is required",
44
- "urlField.url.label": "Web address"
44
+ "urlField.url.label": "Indirizzo web"
45
45
  };
46
46
 
47
47
  export { translation as default };
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/form-components/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["// Migration entry point for @nx/js:tsc build target.\n// Migrations are registered in ../migrations.json and resolved by NX at runtime.\nexport {};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx-utils.js","sourceRoot":"","sources":["../../../../../../libs/react/form-components/migrations/utils/jsx-utils.ts"],"names":[],"mappings":";;;;AAAA,uCAAqE;AACrE,uDAAoD;AA8L3C,wFA9LA,iBAAO,OA8LA;AA7LhB,uDAAiC;AAEjC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AACjD,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAA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AAC,CAAC;QACpD,OAAO;IACT,CAAC;IACD,MAAM,YAAY,GAChB,kBAAkB,KAAK,SAAS,IAAI,kBAAkB,GAAG,CAAC;QACxD,CAAC,CAAC,KAAK,kBAAkB,kCAAkC;QAC3D,CAAC,CAAC,EAAE,CAAC;IACT,eAAM,CAAC,IAAI,CAAC,KAAK,aAAa,aAAa,OAAO,WAAW,YAAY,EAAE,CAAC,CAAC;AAC/E,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB;AAEF;;;;;;GAMG;AACI,MAAM,6BAA6B,GAAG,CAC3C,OAAe,EACf,cAA+D,EAC/D,aAAqB,EACb,EAAE;IACV,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IACnC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI,aAAa,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACtF,CAAC,CAAC;AARW,QAAA,6BAA6B,iCAQxC","sourcesContent":["import { logger, type Tree, visitNotIgnoredFiles } from \"@nx/devkit\";\nimport { tsquery } from \"@phenomnomnominal/tsquery\";\nimport * as ts from \"typescript\";\n\nconst TSX_EXTENSIONS = [\".tsx\", \".jsx\"] as const;\nconst TS_EXTENSIONS = [\".ts\", \".tsx\", \".jsx\"] as const;\n\nconst isTsxFile = (filePath: string): boolean => TSX_EXTENSIONS.some(ext => filePath.endsWith(ext));\nconst isTsFile = (filePath: string): boolean => TS_EXTENSIONS.some(ext => filePath.endsWith(ext));\n\nconst isUnderNodeModules = (filePath: string): boolean =>\n filePath.includes(\"/node_modules/\") || filePath.startsWith(\"node_modules/\");\n\nconst isUnderDist = (filePath: string): boolean =>\n filePath.includes(\"/dist/\") || filePath.startsWith(\"dist/\") || filePath.includes(\"/.nx/\");\n\n/**\n * Visits every `.tsx`/`.jsx` file under the workspace root and invokes the\n * callback with the file path and its current contents. Files that don't\n * include the marker substring are skipped, which makes large workspaces\n * cheap to scan.\n */\nexport const visitTsxFiles = (\n tree: Tree,\n marker: string,\n callback: (filePath: string, content: string) => string | null | undefined\n): number => {\n let touched = 0;\n visitNotIgnoredFiles(tree, \"/\", filePath => {\n if (!isTsxFile(filePath)) return;\n if (isUnderNodeModules(filePath) || isUnderDist(filePath)) return;\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) return;\n if (!content.includes(marker)) return;\n const updated = callback(filePath, content);\n if (updated !== null && updated !== undefined && updated !== content) {\n tree.write(filePath, updated);\n touched += 1;\n }\n });\n return touched;\n};\n\n/**\n * Same as {@link visitTsxFiles} but also includes plain `.ts` files. Use this\n * when the codemod also rewrites non-JSX files such as helpers or hooks.\n */\nexport const visitTsFiles = (\n tree: Tree,\n marker: string,\n callback: (filePath: string, content: string) => string | null | undefined\n): number => {\n let touched = 0;\n visitNotIgnoredFiles(tree, \"/\", filePath => {\n if (!isTsFile(filePath)) return;\n if (isUnderNodeModules(filePath) || isUnderDist(filePath)) return;\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) return;\n if (!content.includes(marker)) return;\n const updated = callback(filePath, content);\n if (updated !== null && updated !== undefined && updated !== content) {\n tree.write(filePath, updated);\n touched += 1;\n }\n });\n return touched;\n};\n\n/**\n * Mapping of imported component aliases to their original names for a given\n * package. For `import { IconButton as Btn } from \"@trackunit/react-components\"`\n * this returns `{ Btn: \"IconButton\" }`.\n *\n * Returns `null` when the file imports nothing from the package, which lets\n * callers short-circuit before parsing JSX.\n */\nexport const getImportedAliases = (sourceFile: ts.SourceFile, packageName: string): Record<string, string> | null => {\n const result: Record<string, string> = {};\n let found = false;\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpecifier = stmt.moduleSpecifier;\n if (!ts.isStringLiteral(moduleSpecifier)) continue;\n if (moduleSpecifier.text !== packageName) continue;\n\n const namedBindings = stmt.importClause?.namedBindings;\n if (namedBindings === undefined || !ts.isNamedImports(namedBindings)) continue;\n\n for (const element of namedBindings.elements) {\n const localName = element.name.text;\n const importedName = element.propertyName?.text ?? localName;\n result[localName] = importedName;\n found = true;\n }\n }\n\n return found ? result : null;\n};\n\n/**\n * Returns the local alias used in this file for `originalName` when imported\n * from `packageName`, or `null` if the component is not imported.\n */\nexport const getLocalAliasFor = (\n sourceFile: ts.SourceFile,\n packageName: string,\n originalName: string\n): string | null => {\n const aliases = getImportedAliases(sourceFile, packageName);\n if (aliases === null) return null;\n for (const [local, original] of Object.entries(aliases)) {\n if (original === originalName) return local;\n }\n return null;\n};\n\nexport type JsxElementMatch = {\n /** The opening JSX element (the one carrying the attributes). */\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement;\n /** The full element including children, or the self-closing element. */\n element: ts.JsxElement | ts.JsxSelfClosingElement;\n};\n\n/**\n * Finds every JSX element whose tag name resolves to one of `tagNames`\n * (typically the local aliases returned by {@link getImportedAliases}).\n *\n * The result intentionally includes both opening and full elements so callers\n * can manipulate attributes (via `openingElement`) or wrap/replace the whole\n * element (via `element`).\n */\nexport const findJsxElements = (\n sourceFile: ts.SourceFile,\n tagNames: ReadonlyArray<string>\n): ReadonlyArray<JsxElementMatch> => {\n const matches: Array<JsxElementMatch> = [];\n const tagSet = new Set(tagNames);\n\n const visit = (node: ts.Node): void => {\n if (ts.isJsxSelfClosingElement(node)) {\n if (ts.isIdentifier(node.tagName) && tagSet.has(node.tagName.text)) {\n matches.push({ openingElement: node, element: node });\n }\n } else if (ts.isJsxElement(node)) {\n const opening = node.openingElement;\n if (ts.isIdentifier(opening.tagName) && tagSet.has(opening.tagName.text)) {\n matches.push({ openingElement: opening, element: node });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return matches;\n};\n\n/**\n * Looks up a named JSX attribute on the opening element. Returns `null` when\n * the attribute is missing or part of a spread attribute (which we cannot\n * statically inspect).\n */\nexport const findJsxAttribute = (\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement,\n attributeName: string\n): ts.JsxAttribute | null => {\n for (const attr of openingElement.attributes.properties) {\n if (!ts.isJsxAttribute(attr)) continue;\n if (!ts.isIdentifier(attr.name)) continue;\n if (attr.name.text === attributeName) return attr;\n }\n return null;\n};\n\n/**\n * `true` when the element forwards a spread expression such as `{...rest}`,\n * which means we can't be sure which attributes are actually set.\n */\nexport const hasSpreadAttribute = (openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement): boolean => {\n return openingElement.attributes.properties.some(prop => ts.isJsxSpreadAttribute(prop));\n};\n\n/**\n * Parses the file as TSX so JSX is recognised. We do not need a full program\n * here; tsquery's `ast` helper produces a script-kind source file which loses\n * JSX context, so we go through `createSourceFile` directly.\n */\nexport const parseTsx = (content: string, fileName = \"file.tsx\"): ts.SourceFile =>\n ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n\n/** Re-exported for codemods that need direct AST queries. */\nexport { tsquery };\n\n/**\n * Helper for codemods to log a one-line summary at the end of a run. Migration\n * runners aggregate logs per migration, so this keeps output focused.\n */\nexport const logSummary = (migrationName: string, touched: number, manualReviewNeeded?: number): void => {\n if (touched === 0) {\n logger.info(` ${migrationName}: no files changed`);\n return;\n }\n const reviewSuffix =\n manualReviewNeeded !== undefined && manualReviewNeeded > 0\n ? ` (${manualReviewNeeded} location(s) need manual review)`\n : \"\";\n logger.info(` ${migrationName}: updated ${touched} file(s)${reviewSuffix}`);\n};\n\n/**\n * Inserts an attribute string immediately after the tag name (so the new\n * attribute appears first). Returns the resulting source content.\n *\n * The added attribute is rendered verbatim, so callers are responsible for\n * including the leading space (e.g. ` title=\"Close\"`).\n */\nexport const insertAttributeIntoOpeningTag = (\n content: string,\n openingElement: ts.JsxOpeningElement | ts.JsxSelfClosingElement,\n attributeText: string\n): string => {\n const tagName = openingElement.tagName;\n const insertPos = tagName.getEnd();\n return content.slice(0, insertPos) + ` ${attributeText}` + content.slice(insertPos);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionbutton-add-title.js","sourceRoot":"","sources":["../../../../../../libs/react/form-components/migrations/v2-0-0/actionbutton-add-title.ts"],"names":[],"mappings":";;;;AAAA,uCAA+C;AAC/C,uDAAiC;AACjC,kDAQ4B;AAE5B,MAAM,YAAY,GAAG,kCAAkC,CAAC;AACxD,MAAM,cAAc,GAAG,cAAc,CAAC;AAEtC,MAAM,oBAAoB,GAA2B;IACnD,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;IACnB,YAAY,EAAE,aAAa;IAC3B,WAAW,EAAE,WAAW;CACzB,CAAC;AAEF,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B,MAAM,mBAAmB,GAAG,CAAC,QAAgC,EAAU,EAAE;IACvE,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IAC5C,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;IACzC,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IACpD,IAAI,EAAE,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;QACpC,OAAO,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC;IACjE,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAiB,EAAE;IACtF,MAAM,UAAU,GAAG,IAAA,oBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC7D,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,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CAAC,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACI,MAAM,oBAAoB,GAAG,CAAC,IAAU,EAAQ,EAAE;IACvD,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,IAAI,EAAE,cAAc,EAAE,0BAA0B,CAAC,CAAC;IAChF,IAAA,sBAAU,EAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC9C,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,eAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEF,kBAAe,4BAAoB,CAAC","sourcesContent":["import { type Tree, logger } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\nimport {\n findJsxAttribute,\n findJsxElements,\n getImportedAliases,\n hasSpreadAttribute,\n logSummary,\n parseTsx,\n visitTsxFiles,\n} from \"../utils/jsx-utils\";\n\nconst PACKAGE_NAME = \"@trackunit/react-form-components\";\nconst COMPONENT_NAME = \"ActionButton\";\n\nconst ACTION_TYPE_TO_TITLE: Record<string, string> = {\n COPY: \"Copy value\",\n EDIT: \"Edit value\",\n EMAIL: \"Send email\",\n PHONE_NUMBER: \"Call number\",\n WEB_ADDRESS: \"Open link\",\n};\n\nconst DEFAULT_TITLE = \"Action\";\n\nconst resolveTitleForType = (typeAttr: ts.JsxAttribute | null): string => {\n if (typeAttr === null) return DEFAULT_TITLE;\n const initializer = typeAttr.initializer;\n if (initializer === undefined) return DEFAULT_TITLE;\n if (ts.isStringLiteral(initializer)) {\n return ACTION_TYPE_TO_TITLE[initializer.text] ?? DEFAULT_TITLE;\n }\n return DEFAULT_TITLE;\n};\n\nconst transformActionButtonUsage = (filePath: string, content: string): string | null => {\n const sourceFile = parseTsx(content, filePath);\n\n const aliases = getImportedAliases(sourceFile, PACKAGE_NAME);\n if (aliases === null) return null;\n\n const localAlias = Object.entries(aliases).find(([, name]) => name === COMPONENT_NAME)?.[0];\n if (localAlias === undefined) return null;\n\n const matches = findJsxElements(sourceFile, [localAlias]);\n if (matches.length === 0) return null;\n\n type Edit = { offset: number; text: string };\n const edits: Array<Edit> = [];\n\n for (const { openingElement } of matches) {\n if (hasSpreadAttribute(openingElement)) continue;\n if (findJsxAttribute(openingElement, \"title\") !== null) continue;\n\n const typeAttr = findJsxAttribute(openingElement, \"type\");\n const title = resolveTitleForType(typeAttr);\n edits.push({\n offset: openingElement.tagName.getEnd(),\n text: ` title=\"${title}\"`,\n });\n }\n\n if (edits.length === 0) return null;\n\n edits.sort((a, b) => (a.offset === b.offset ? 0 : b.offset - a.offset));\n\n let updated = content;\n for (const { offset, text } of edits) {\n updated = updated.slice(0, offset) + text + updated.slice(offset);\n }\n return updated;\n};\n\n/**\n * Adds the now-required `title` prop to `<ActionButton>` usages that don't\n * already provide one. The default value is derived from the `type` prop when\n * possible (e.g. `COPY` → \"Copy value\"); consumers should replace the\n * placeholders with their own localized strings.\n */\nexport const actionButtonAddTitle = (tree: Tree): void => {\n const touched = visitTsxFiles(tree, \"ActionButton\", transformActionButtonUsage);\n logSummary(\"actionbutton-add-title\", touched);\n if (touched > 0) {\n logger.info(` Replace placeholder ActionButton titles with your own localized strings.`);\n }\n};\n\nexport default actionButtonAddTitle;\n"]}