{"id":15885492,"url":"https://github.com/diasbruno/vue-form-state-manager","last_synced_at":"2025-04-02T15:44:07.454Z","repository":{"id":56073478,"uuid":"316321616","full_name":"diasbruno/vue-form-state-manager","owner":"diasbruno","description":"Simple form state manager used as directive.","archived":false,"fork":false,"pushed_at":"2020-11-28T19:21:09.000Z","size":65,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T19:59:23.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diasbruno.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-26T19:35:54.000Z","updated_at":"2020-11-28T19:21:01.000Z","dependencies_parsed_at":"2022-08-15T12:40:28.599Z","dependency_job_id":null,"html_url":"https://github.com/diasbruno/vue-form-state-manager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fvue-form-state-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fvue-form-state-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fvue-form-state-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diasbruno%2Fvue-form-state-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diasbruno","download_url":"https://codeload.github.com/diasbruno/vue-form-state-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246847059,"owners_count":20843438,"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-10-06T05:04:06.659Z","updated_at":"2025-04-02T15:44:07.431Z","avatar_url":"https://github.com/diasbruno.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-form-state-manager\n\nA simple form state manager that can be used as directive.\n\n## usage\n\nTo register:\n\n```vue\nimport FormState from \"vue-form-state-manager\";\nVue.directive('form-control', FormState);\n```\n\nUse:\n\n```vue\n\u003cinput ... form-control=\"'field_name'\" /\u003e\n```\n\nChecking the form state:\n\n```js\nimport { formState, formIsDirty, formIsPristine } from \"vue-form-state-manager\";\n\nformState(formId) == { dirty: Boolean, pristine: Boolean };\nformState(formId).dirty == formIsDirty(formId);\nformState(formId).pristine == formIsPristine(formId);\n```\n\nReseting a single input:\n\n```js\nexport default {\n  name: \"MyComp\",\n  ...\n  methods: {\n    myMethod() {\n      this.prop = NEW_VALUE;\n      resetInitialValueFor(\"test-form\", \"field-name\", this.prop);\n    }\n  },\n  ...\n}\n```\n\n## roadmap\n\n- [x] API to control the state programmatically.\n\n## licence\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiasbruno%2Fvue-form-state-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiasbruno%2Fvue-form-state-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiasbruno%2Fvue-form-state-manager/lists"}