{"id":22274288,"url":"https://github.com/xenon615/form-a","last_synced_at":"2026-04-11T19:03:25.166Z","repository":{"id":243934877,"uuid":"576327152","full_name":"xenon615/form-a","owner":"xenon615","description":"simple form generator","archived":false,"fork":false,"pushed_at":"2024-10-23T12:41:10.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T14:51:19.222Z","etag":null,"topics":["forms","javascript","vite","vue","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/xenon615.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-12-09T15:07:17.000Z","updated_at":"2024-10-23T12:41:13.000Z","dependencies_parsed_at":"2024-06-12T05:03:19.591Z","dependency_job_id":"c7c42e59-e4a2-4f9c-811d-4c11830f6a7f","html_url":"https://github.com/xenon615/form-a","commit_stats":null,"previous_names":["xenon615/form-a"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenon615%2Fform-a","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenon615%2Fform-a/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenon615%2Fform-a/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenon615%2Fform-a/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xenon615","download_url":"https://codeload.github.com/xenon615/form-a/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245503077,"owners_count":20626099,"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":["forms","javascript","vite","vue","wordpress"],"created_at":"2024-12-03T13:19:02.932Z","updated_at":"2025-12-30T20:34:12.378Z","avatar_url":"https://github.com/xenon615.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Form-A\r\n### Yes, I agree, it's a rather ill-considered name :).\r\nSimple form generator based on vite \u0026 vue\r\nwas originally created as a tool to facilitate the creation of WordPress admin pages, and then we'll see\r\n\r\n#### Made for my own needs (and yes, it satisfies them). If this project in whole or in part it can be useful to someone, you are welcome\r\n\r\n## Usage: \r\n\r\n### HTML ( please refer to [index.html](./index.html) )\r\n(class \"form-a-placeholder\" is required).  You can place multiple forms\r\n\r\n```\r\n    \u003cform\u003e\r\n      \u003cdiv id=\"local-form-1\" class=\"form-a-placeholder\"\u003e\r\n      \u003c/div\u003e\r\n    \u003c/form\u003e\r\n```\r\n\r\n### Form loading ( please refer to [remote.js](./src/remote.js) )\r\n\r\nwindow.formA must exists and have 2 props: \r\n\"remote\"  that contain endpoint url and , in my case, wordpress nonce\r\nand \r\n\"forms\"\r\n\r\n```\r\nconst  formA = window.formA ??  { \r\n    remote: {\r\n        nonce: \"25e94a50ff\",\r\n        url: \"https://localhost/end/point/url\"\r\n    },\r\n    forms : {\r\n        ..........\r\n    }\r\n}\r\n\r\n```\r\n\r\n#### Option 1  (refer to 'local-form-...'  in [remote.js](./src/remote.js) )\r\nIn this case form definition is in window.formA.forms\r\n\r\n```\r\n...\r\n    forms : {\r\n        'local-form-slug' : {\r\n            def: {\r\n                // definition\r\n            }, \r\n            data: {\r\n                // prefil data\r\n            }\r\n        }\r\n    }\r\n....    \r\n\r\n```\r\n\r\n#### Option 2  (refer to 'remote-form'  in [remote.js](./src/remote.js) )\r\nIn this case form definition will load from backend\r\n\r\n```\r\n....\r\n    forms : {\r\n        'remote-form-slug' : {\r\n            remoteLoad: true\r\n        }\r\n    }\r\n....\r\n\r\n```\r\n\r\n### Form Definition\r\n please refer to [demo.js](./src/demo.js)  for full example\r\n```\r\nforms: {\r\n        'local-form-1': {     // placeholder id \r\n            data: {\r\n                // data for form prefill, may be empty \r\n            },\r\n            def: {\r\n                title: 'Plain Form',\r\n                remoteSubmit: true,   // i mean \"ajax submit\" :)\r\n                buttons: [    // one button implemented at the moment\r\n                    {\r\n                        text: 'Submit',\r\n                        classes: ['button', 'button-primary','button-large'],\r\n                        type: 'submit'\r\n                    }\r\n                ],    \r\n                fields: [\r\n                    {\r\n                        type: 'text',  //  email |  password |  number | textarea\r\n                        name: 'text-field',\r\n                        label: 'Text Field',   // short form  default position  - \"before\"\r\n                        default: 'Text Value',\r\n                        classes: ['col-2'],  //  grid of 18 columns and other classes by your taste\r\n                        breakAfter: false , //  \"true\" for new line \r\n                        validators: {\r\n                            required: true   // at the moment only \"required\" implemented\r\n                        }\r\n                    },\r\n                    // next field\r\n                ]\r\n            }\r\n        }\r\n    }    \r\n```\r\n\r\n### Submit options\r\n#### Option1 \r\n```\r\n         ....\r\n            def: {\r\n                remoteSubmit: true,   // ajax POST submit to remote URL\r\n        ....\r\n\r\n```    \r\n#### Option 2\r\n```\r\n         ....\r\n            def: {\r\n                remoteSubmit: false,   // POST with page reload (not tested properly at the moment )\r\n        ....\r\n\r\n```    \r\n\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenon615%2Fform-a","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxenon615%2Fform-a","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenon615%2Fform-a/lists"}