{"id":20405734,"url":"https://github.com/cloudquery/plugin-config-ui-lib","last_synced_at":"2025-04-12T15:05:41.039Z","repository":{"id":247600583,"uuid":"826401019","full_name":"cloudquery/plugin-config-ui-lib","owner":"cloudquery","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-11T18:14:53.000Z","size":1528,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T15:03:58.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudquery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-09T16:29:20.000Z","updated_at":"2025-03-31T16:15:21.000Z","dependencies_parsed_at":"2024-07-09T17:12:24.418Z","dependency_job_id":"efd69172-3e2a-47f3-b603-ee60d3219105","html_url":"https://github.com/cloudquery/plugin-config-ui-lib","commit_stats":null,"previous_names":["cloudquery/plugin-config-ui-lib"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudquery%2Fplugin-config-ui-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudquery%2Fplugin-config-ui-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudquery%2Fplugin-config-ui-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudquery%2Fplugin-config-ui-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudquery","download_url":"https://codeload.github.com/cloudquery/plugin-config-ui-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586236,"owners_count":21128997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:12:47.986Z","updated_at":"2025-04-12T15:05:41.027Z","avatar_url":"https://github.com/cloudquery.png","language":"TypeScript","readme":"# @cloudquery/plugin-config-ui-lib\n\nPlugin Config UI library for CloudQuery Plugin Config UI\n\n## Description\n\n`@cloudquery/plugin-config-ui-lib` is a library that provides various utilities that can be used in CloudQuery Plugin Config UI.\n\n## Installation\n\nTo install the library, you can use npm:\n\n```bash\nnpm install @cloudquery/plugin-config-ui-lib\n```\n\n## Documentation\n\n### Config UI Framework\n\nThe Config UI Framework provides a way for anyone to build a plugin UI with simply a config object and data transformer.\n\n[Documentation Center](https://66facee74aed74fa3fd566af-tromefybtu.chromatic.com/)\n\n### Hooks\n\n#### useFormActions\n\nThis hook is used export data and functions that can be used in the footer for plugin UI.\n\n```tsx\nconst formActions = useFormActions({\n  pluginUiMessageHandler,\n  teamName: 'my-team',\n  pluginTeamName: 'cloudquery',\n  pluginName: 'postgresql',\n  pluginKind: 'source',\n  getValues;\n  pluginVersion: '1.0.0',\n  isUpdating: false,\n});\n\nreturn \u003cFormFooter {...formActions} /\u003e;\n```\n\n#### useFormCurrentValues\n\nThis hook is used to respond to request for current values from CloudQuery Cloud App.\n\n```tsx\nuseFormCurrentValues({\n  pluginUiMessageHandler,\n  getCurrentValues,\n});\n```\n\n#### useFormInit\n\nThis hook is used get the initial values for the form from the CloudQuery Cloud App.\nThe initial values can be undefined, therefore the hook also returns information whether\nit was initialized.\n\n```tsx\nconst { initialized, initialValues } = useFormInit(pluginUiMessageHandler, false);\n\nif (!initialized) {\n  return null;\n}\n\nreturn (\n  \u003cdiv\u003e\n    \u003cform\u003e\n      \u003cinput type=\"text\" value={initialValues.name} /\u003e\n    \u003c/form\u003e\n  \u003c/div\u003e\n);\n```\n\n#### useFormSubmit\n\nThis hook is used to handle the submit event for the form from the CloudQuery Cloud App.\nIt requires the function that should validate the data and return an object either with\n`errors` or `values` depending on the validation result. The function can also return\na Promise of the same type.\n\n```tsx\nconst [name, setName] = useState('');\nconst handleValidate = () =\u003e {\n  if (!name.trim()) {\n    return { errors: { name: 'Name is required' } };\n  }\n\n  return { values: { name } };\n};\n\nuseFormSubmit(handleValidate);\n\nreturn \u003cinput type=\"text\" value={name} onChange={(event) =\u003e setName(event.target.value)} /\u003e;\n```\n\n## Development\n\n### Building the Library\n\nTo build the library, run:\n\n```bash\nnpm run build\n```\n\n### Running Tests\n\nTo run the test suite, execute:\n\n```bash\nnpm test\n```\n\n## Contributing\n\nIf you encounter any issues or have feature requests, please feel free to open an issue on the [GitHub repository](https://github.com/cloudquery/plugin-config-ui-lib/issues).\n\n## License\n\nThis project is licensed under the [Mozilla Public License.](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudquery%2Fplugin-config-ui-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudquery%2Fplugin-config-ui-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudquery%2Fplugin-config-ui-lib/lists"}