{"_id":"@crispyyv/strapi-plugin-dynamic-enumeration-field","_rev":"2-27a831042fb730dedb25cf6a45b20a49","name":"@crispyyv/strapi-plugin-dynamic-enumeration-field","dist-tags":{"latest":"2.3.2"},"versions":{"2.3.1":{"name":"@crispyyv/strapi-plugin-dynamic-enumeration-field","version":"2.3.1","author":{"url":"https://github.com/alanzdr","name":"Alanderson Zelindro da Rosa"},"license":"MIT","_id":"@crispyyv/strapi-plugin-dynamic-enumeration-field@2.3.1","maintainers":[{"name":"crispyyv","email":"crispyyv@gmail.com"}],"homepage":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field#readme","bugs":{"url":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field/issues"},"dist":{"shasum":"79e87597a2608d2930099eba274b4ecdaedd4f2a","tarball":"https://registry.npmjs.org/@crispyyv/strapi-plugin-dynamic-enumeration-field/-/strapi-plugin-dynamic-enumeration-field-2.3.1.tgz","fileCount":54,"integrity":"sha512-X8LPHAP5C05SO1gKWF59L/jxcxw3/CqrKXIj3UTK9lOv3MzJITZZJwh+K0EKFmP0klCsHkgTVb7iH9HHL1eBgw==","signatures":[{"sig":"MEUCIQCxNZybbIk2CTRoxp1nm5yzFfwusK6NLIbEgzKV51zsuQIgZ5ChQbT+MUGtO6xdHQIAx8GdnEmNYaKfMjf50snHgAw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":270036},"strapi":{"kind":"plugin","name":"dynamic-enumeration","description":"Custom field to create dynamic enumerations","displayName":"Dynamic Enumeration Field"},"engines":{"npm":">=6.0.0","node":">=16.0.0 <=22.x.x"},"exports":{"./package.json":"./package.json","./strapi-admin":{"types":"./dist/admin/src/index.d.ts","import":"./dist/admin/index.mjs","source":"./admin/src/index.ts","default":"./dist/admin/index.js","require":"./dist/admin/index.js"},"./strapi-server":{"types":"./dist/server/src/index.d.ts","import":"./dist/server/index.mjs","source":"./server/src/index.ts","default":"./dist/server/index.js","require":"./dist/server/index.js"}},"gitHead":"299189a434d778a84a0eeffe6048df29499cee0b","scripts":{"dev":"tsx watch --include './admin/**/*' --include './server/**/*' build.ts ","build":"tsx build.ts"},"_npmUser":{"name":"crispyyv","email":"crispyyv@gmail.com"},"repository":{"url":"git+https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field.git","type":"git"},"_npmVersion":"10.5.2","description":"Custom field to create dynamic enumerations","directories":{},"_nodeVersion":"20.13.1","dependencies":{"immer":"^10.1.3","react":"^18.3.1","react-dom":"^18.3.1","react-intl":"7.1.11","react-redux":"9.2.0","@strapi/icons":"2.0.0-rc.30","@strapi/strapi":"^5.24.1","react-router-dom":"^6.27.0","styled-components":"^6.1.19","@strapi/design-system":"2.0.0-rc.30"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.17.1","devDependencies":{"tsx":"^4.20.6","vite":"^7.1.7","typescript":"^5.9.2","@types/react":"^19.1.14","@strapi/pack-up":"^5.1.0","@types/react-dom":"^19.1.9","vite-tsconfig-paths":"^5.1.4","@strapi/typescript-utils":"^5.24.1","rollup-plugin-node-externals":"^8.1.1"},"peerDependencies":{"@strapi/strapi":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/strapi-plugin-dynamic-enumeration-field_2.3.1_1762517463389_0.5729624160154614","host":"s3://npm-registry-packages-npm-production"}},"2.3.2":{"name":"@crispyyv/strapi-plugin-dynamic-enumeration-field","version":"2.3.2","description":"Custom field to create dynamic enumerations","strapi":{"name":"dynamic-enumeration","description":"Custom field to create dynamic enumerations","kind":"plugin","displayName":"Dynamic Enumeration Field"},"scripts":{"build":"tsx build.ts","dev":"tsx watch --include './admin/**/*' --include './server/**/*' build.ts "},"exports":{"./package.json":"./package.json","./strapi-admin":{"types":"./dist/admin/src/index.d.ts","source":"./admin/src/index.ts","import":"./dist/admin/index.mjs","require":"./dist/admin/index.js","default":"./dist/admin/index.js"},"./strapi-server":{"types":"./dist/server/src/index.d.ts","source":"./server/src/index.ts","import":"./dist/server/index.mjs","require":"./dist/server/index.js","default":"./dist/server/index.js"}},"dependencies":{"@strapi/design-system":"2.0.0-rc.30","@strapi/icons":"2.0.0-rc.30","@strapi/strapi":"^5.24.1","immer":"^10.1.3","react":"^18.3.1","react-dom":"^18.3.1","react-intl":"7.1.11","react-redux":"9.2.0","react-router-dom":"^6.27.0","styled-components":"^6.1.19"},"devDependencies":{"@strapi/pack-up":"^5.1.0","@strapi/typescript-utils":"^5.24.1","@types/react":"^19.1.14","@types/react-dom":"^19.1.9","rollup-plugin-node-externals":"^8.1.1","tsx":"^4.20.6","typescript":"^5.9.2","vite":"^7.1.7","vite-tsconfig-paths":"^5.1.4"},"peerDependencies":{"@strapi/strapi":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field.git"},"author":{"name":"Alanderson Zelindro da Rosa","url":"https://github.com/alanzdr"},"maintainers":[{"name":"crispyyv","email":"crispyyv@gmail.com"}],"engines":{"node":">=16.0.0 <=22.x.x","npm":">=6.0.0"},"license":"MIT","packageManager":"pnpm@10.17.1","_id":"@crispyyv/strapi-plugin-dynamic-enumeration-field@2.3.2","gitHead":"299189a434d778a84a0eeffe6048df29499cee0b","bugs":{"url":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field/issues"},"homepage":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field#readme","_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-sCmHVzmNvXVeMmzNX7fo5YnsMKq773/vP66ITRyOurbcVVDbh9M2IQUT8JtGlrdDrQWPgXjD3mqGz2Qs0iZr1A==","shasum":"b0be2aa463d0b1207fafff76bd4ff6a9bf5f4caa","tarball":"https://registry.npmjs.org/@crispyyv/strapi-plugin-dynamic-enumeration-field/-/strapi-plugin-dynamic-enumeration-field-2.3.2.tgz","fileCount":54,"unpackedSize":288655,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDhmxiHBUXB6/uW95Bsy1Mw4YjHFjcEoouFCY+t3vOrpwIgK7/oo8V/OqBvOf8ux2OyU4bb69zK81Xq3WZ83am7eac="}]},"_npmUser":{"name":"crispyyv","email":"crispyyv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strapi-plugin-dynamic-enumeration-field_2.3.2_1762530921517_0.6321706385202415"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-07T12:11:03.280Z","modified":"2025-11-07T15:55:22.258Z","2.3.1":"2025-11-07T12:11:03.583Z","2.3.2":"2025-11-07T15:55:21.755Z"},"bugs":{"url":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field/issues"},"author":{"name":"Alanderson Zelindro da Rosa","url":"https://github.com/alanzdr"},"license":"MIT","homepage":"https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field#readme","repository":{"type":"git","url":"git+https://github.com/alanzdr/strapi-plugin-dynamic-enumeration-field.git"},"description":"Custom field to create dynamic enumerations","maintainers":[{"name":"crispyyv","email":"crispyyv@gmail.com"}],"readme":"<p align=\"center\">\n  <img src=\".github/logo.png\" width=\"200\" alt=\"Dynamic Enumeration logo\">\n</p>\n\n<h1 align=\"center\">Dynamic Enumeration</h1>\n\n<p align=\"center\">\n  <a href=\"#tada-introduction\">Introduction</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\n  <a href=\"#page_facing_up-features\">Features</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\n  <a href=\"#cd-installation\">Installation</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\n  <a href=\"#wrench-configuration\">Configuration</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\n  <a href=\"#book-api\">Api</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\n  <a href=\"#memo-license\">License</a>\n</p>\n\n<p align=\"center\">\n  <img alt=\"License\" src=\"https://img.shields.io/static/v1?label=license&message=MIT&color=b40f20&labelColor=000000\">\n</p>\n\n<br />\n\n## :tada: Introduction\n\nThis plugin adds a new type of enumeration that works like a combobox, where you can get data already registered in the enumeration previously, or add a new item to the select options.\n\n<p align=\"center\">\n  <img src=\".github/example.png\" width=\"907\" alt=\"Dynamic Enumeration example\">\n</p>\n\n<br />\n\n## :page_facing_up: Features\n\n- New field `Dynamic Enumeration` appears in admin `content-type-builder` page, in the `custom` tab.\n- Save only registration options and remove options that is not being used.\n- Works inside `Components` and `Dynamic Zones`.\n- Separates each field options by its `API` or `Component`\n- You can create `Globals` fields, which keep the same list between different `API` and `Components`\n- You can load the options in plugin `API` or `Service`. For list the data in your frontend, for example.\n\n<br />\n\n## :cd: Installation\n\nInstall this plugin by adding it to the dependencies of your Strapi project.\n\n```sh\n# Yarn\nyarn add strapi-plugin-dynamic-enumeration-field\n\n# NPM\nnpm install strapi-plugin-dynamic-enumeration-field\n\n# PNPM\npnpm install strapi-plugin-dynamic-enumeration-field\n```\n\nAfter that you must add it to your plugin configuration file.\n\n<br />\n\n## :wrench: Configuration\n\nAdd the code below to your `./config/plugins.js` file:\n\n```js\nmodule.exports = ({ env }) => ({\n  // ...\n  'dynamic-enumeration': {\n    enabled: true,\n  },\n  // ...\n});\n```\n\nAfter that, you'll need to build your admin panel:\n\n```sh\nnpm run build\n```\n\n### Adding globals field\n\nYou can add several global field keys in the config part of the plugin settings.\n\n```js\nmodule.exports = ({ env }) => ({\n  // ...\n  'dynamic-enumeration': {\n    enabled: true,\n    config: {\n      globals: {\n        // Unique Key Name\n        'my-global-enumeration': {\n          // Frontend Name\n          name: 'My Global Enumeration',\n          // Fixed default values\n          defaults: ['Strapi', 'Node.js', 'React.js'],\n        },\n        // ...Others globals fields\n      },\n    },\n  },\n  // ...\n});\n```\n\n<br />\n\n## :book: Api\n\nThe plugin adds two `Api` and `Service` to your application:\n\n### Get Enumeration Values\n\nYou can get the options added to a field, sending the `uid` of the `API` or `Component`, and the `name` of the field.\n\nThe `uid` It is in the format `api::<api>.<api>` for api, and `<component-folder>.<component-file-name>` for components\n\nSee the example below:\n\n#### EXAMPLE\n\n```js\nconst uid = \"api::my-api.my-api\"\nconst name = \"city\"\nconst locale = 'en' // Optional, if you use i18b\n\n// Using Fetch\nawait fetch(`${API_URL}/api/dynamic-enumeration?uid=${uid}&name=${name}&locale=${locale}`);\n// GET /api/dynamic-enumeration?uid=your-api&name=your-attribute-name&locale=locale\n\n// Using Service in Strapi\nconst SERVICE_UID = 'plugin::dynamic-enumeration.dynamic-enumeration-service'\nconst service = strapi.service(SERVICE_UID)\nconst data = await service.getValues({\n  uid,\n  name,\n  locale // Optional\n})\n\n```\n\n### Get Globals Values\n\nYou can get the options added to all global field, sending the `key` of the `Globals Field` configured in your plugins file. ( See the settings part above )\n\nSee the example below:\n\n#### EXAMPLE\n\n```js\n\n// In Your \"./config/plugins.js\" file\nmodule.exports = ({ env }) => ({\n  // ...\n  'dynamic-enumeration': {\n    enabled: true,\n    config: {\n      globals: {\n        // The Global Key\n        'my-field': {\n          // Configurations\n        },\n      },\n    },\n  },\n  // ...\n});\n\n// Using Fetch\nawait fetch(`${API_URL}/api/dynamic-enumeration/globals?key=my-field`);\n// GET /api/dynamic-enumeration/globals?key=global-key&locale=locale\n\n// Using Service in Strapi\nconst SERVICE_UID = 'plugin::dynamic-enumeration.dynamic-enumeration-service'\nconst service = strapi.service(SERVICE_UID)\nconst data = await service.getGlobalValues({\n  key: 'my-field',\n  locale // Optional\n})\n\n```\n\n<br />\n\n## :memo: License\n\nThis project is under the MIT license. See the [LICENSE](LICENSE.md) file for more details.","readmeFilename":"README.md"}