diff --git a/app/javascript/controllers/tag_input_controller.js b/app/javascript/controllers/tag_input_controller.js deleted file mode 100644 index 752577e4..00000000 --- a/app/javascript/controllers/tag_input_controller.js +++ /dev/null @@ -1,40 +0,0 @@ -// app/javascript/controllers/tag_input_controller.js - -import { Controller } from "@hotwired/stimulus" -import TomSelect from "tom-select"; - -export default class extends Controller { - // Triggered when the Stimulus controller is connected to the DOM. - connect() { - console.log("Stimulus - Tag Input controller connected"); - this.initializeTomSelect(); - } - - // Triggered when the Stimulus controller is removed from the DOM. - disconnect() { - this.destroyTomSelect(); - } - - // Initialize the TomSelect dropdown with the desired configurations. - initializeTomSelect() { - // Return early if no element is associated with the controller. - if (!this.element) return; - - // Create a new TomSelect instance with the specified configuration. - // see: https://tom-select.js.org/docs/ - // value, label, search, placeholder, etc can all be passed as static values instead of hard-coded. - this.select = new TomSelect(this.element, { - placeholder: "Add tags", - persist: false, - create: true, - createOnBlur: true - }); - } - - // Cleanup: Destroy the TomSelect instance when the controller is disconnected. - destroyTomSelect() { - if (this.select) { - this.select.destroy(); - } - } -} \ No newline at end of file diff --git a/app/javascript/index.js b/app/javascript/index.js index 088d26d6..c8917223 100644 --- a/app/javascript/index.js +++ b/app/javascript/index.js @@ -3,14 +3,12 @@ console.log('Vite ⚡️ Rails - GBL Admin') // Import Stimulus and controllers import { Application } from '@hotwired/stimulus' import ResultsController from "./controllers/results_controller" -import TagInputController from "./controllers/tag_input_controller" // Initialize Stimulus window.Stimulus = Application.start() // Register controllers Stimulus.register("results", ResultsController) -Stimulus.register("taginput", TagInputController) // Import channels import './channels'; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 981245f7..05649936 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@geoblacklight/admin", - "version": "0.4.13", + "version": "0.4.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@geoblacklight/admin", - "version": "0.4.13", + "version": "0.4.15", "license": "Apache-2.0", "dependencies": { "@hotwired/stimulus": "^3.2.2", @@ -28,7 +28,6 @@ "shave": "^2.5.10", "stimulus": "^3.2.2", "stimulus-scroll-to": "^4.1.0", - "tom-select": "^2.3.1", "turbolinks": "^5.2.0", "yargs-parser": "^13.1.2" }, @@ -161,19 +160,6 @@ "node": ">= 8" } }, - "node_modules/@orchidjs/sifter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.1.0.tgz", - "integrity": "sha512-mYwHCfr736cIWWdhhSZvDbf90AKt2xyrJspKFC3qyIJG1LtrJeJunYEqCGG4Aq2ijENbc4WkOjszcvNaIAS/pQ==", - "dependencies": { - "@orchidjs/unicode-variants": "^1.1.2" - } - }, - "node_modules/@orchidjs/unicode-variants": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.1.2.tgz", - "integrity": "sha512-5DobW1CHgnBROOEpFlEXytED5OosEWESFvg/VYmH0143oXcijYTprRYJTs+55HzGM4IqxiLFSuqEzu9mPNwVsA==" - }, "node_modules/@rails/actioncable": { "version": "6.1.7", "resolved": "https://registry.npmjs.org/@rails/actioncable/-/actioncable-6.1.7.tgz", @@ -878,22 +864,6 @@ "node": ">=8.0" } }, - "node_modules/tom-select": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.4.1.tgz", - "integrity": "sha512-adI8H8+wk8RRzHYLQ3bXSk2Q+FAq/kzAATrcWlJ2fbIrEzb0VkwaXzKHTAlBwSJrhqbPJvhV/0eypFkED/nAug==", - "dependencies": { - "@orchidjs/sifter": "^1.1.0", - "@orchidjs/unicode-variants": "^1.1.2" - }, - "engines": { - "node": "*" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/tom-select" - } - }, "node_modules/turbolinks": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/turbolinks/-/turbolinks-5.2.0.tgz", diff --git a/package.json b/package.json index b3e21be0..d5de60a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@geoblacklight/admin", "type": "module", - "version": "0.4.14", + "version": "0.4.15", "license": "Apache-2.0", "publishConfig": { "access": "public" @@ -51,7 +51,6 @@ "shave": "^2.5.10", "stimulus": "^3.2.2", "stimulus-scroll-to": "^4.1.0", - "tom-select": "^2.3.1", "turbolinks": "^5.2.0", "yargs-parser": "^13.1.2" },