popover#toggle\" data-action=\"mouseenter->popover#show mouseleave->popover#hide\">\n\nimport { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['content']\n static values = {\n dismissAfter: Number,\n open: { type: Boolean, default: false }\n }\n\n openValueChanged() {\n transition(this.contentTarget, this.openValue)\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n }\n\n // If already true, extend the dismissal another X seconds since this will not trigger openValueChanged\n show(event) {\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n this.openValue = true\n }\n\n hide() {\n this.openValue = false\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n get shouldAutoDismiss() {\n return (this.openValue && this.hasDismissAfterValue)\n }\n\n scheduleDismissal() {\n if (!this.hasDismissAfterValue) return\n\n // Cancel any existing dismissals\n this.cancelDismissal()\n\n // Schedule the next dismissal\n this.timeoutId = setTimeout(() => {\n this.hide()\n this.timeoutId = undefined\n }, this.dismissAfterValue)\n }\n\n cancelDismissal() {\n if (typeof this.timeoutId === \"number\") {\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static classes = [ \"activeTab\", \"inactiveTab\" ]\n static targets = ['tab', 'panel', 'select']\n static values = {\n index: 0,\n updateAnchor: Boolean,\n scrollToAnchor: Boolean,\n scrollActiveTabIntoView: Boolean\n }\n\n initialize() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\n }\n\n connect() {\n this.showTab()\n }\n\n // Changes to the clicked tab\n change(event) {\n if (event.currentTarget.tagName === \"SELECT\") {\n this.indexValue = event.currentTarget.selectedIndex\n\n // If target specifies an index, use that\n } else if (event.currentTarget.dataset.index) {\n this.indexValue = event.currentTarget.dataset.index\n\n // If target specifies an id, use that\n } else if (event.currentTarget.dataset.id) {\n this.indexValue = this.tabTargets.findIndex((tab) => tab.id == event.currentTarget.dataset.id)\n\n // Otherwise, use the index of the current target\n } else {\n this.indexValue = this.tabTargets.indexOf(event.currentTarget)\n }\n\n }\n\n nextTab() {\n this.indexValue = Math.min(this.indexValue + 1, this.tabsCount - 1)\n }\n\n previousTab() {\n this.indexValue = Math.max(this.indexValue - 1, 0)\n }\n\n firstTab() {\n this.indexValue = 0\n }\n\n lastTab() {\n this.indexValue = this.tabsCount - 1\n }\n\n indexValueChanged() {\n this.showTab()\n this.dispatch(\"tab-change\", {\n target: this.tabTargets[this.indexValue],\n detail: {\n activeIndex: this.indexValue\n }\n })\n // Update URL with the tab ID if it has one\n // This will be automatically selected on page load\n if (this.updateAnchorValue) {\n const new_tab_id = this.tabTargets[this.indexValue].id // Grab the id from the newly activated tab\n if (this.scrollToAnchorValue){\n location.hash = new_tab_id // Use location.hash to change the URL with scrolling\n } else {\n const currentUrl = window.location.href // Get the current URL\n const newUrl = currentUrl.split('#')[0] + '#' + new_tab_id // Create a new URL with the updated ID\n history.replaceState({}, document.title, newUrl) // Use history.replaceState to change the URL without scrolling\n }\n }\n }\n\n showTab() {\n this.panelTargets.forEach((panel, index) => {\n const tab = this.tabTargets[index]\n\n if (index === this.indexValue) {\n panel.classList.remove('hidden')\n tab.ariaSelected = 'true'\n tab.dataset.active = true\n if (this.hasInactiveTabClass) tab?.classList?.remove(...this.inactiveTabClasses)\n if (this.hasActiveTabClass) tab?.classList?.add(...this.activeTabClasses)\n } else {\n panel.classList.add('hidden')\n tab.ariaSelected = null\n delete tab.dataset.active\n if (this.hasActiveTabClass) tab?.classList?.remove(...this.activeTabClasses)\n if (this.hasInactiveTabClass) tab?.classList?.add(...this.inactiveTabClasses)\n }\n })\n\n if (this.hasSelectTarget) {\n this.selectTarget.selectedIndex = this.indexValue\n }\n\n if (this.scrollActiveTabIntoViewValue) this.scrollToActiveTab()\n }\n\n // If tabs have horizontal scrolling, the active tab may be out of sight.\n // Make sure the active tab is visible by scrolling it into the view.\n scrollToActiveTab() {\n const activeTab = this.element.querySelector('[aria-selected]')\n if (activeTab) activeTab.scrollIntoView({ inline: 'center', })\n }\n\n get tabsCount() {\n return this.tabTargets.length\n }\n\n get anchor() {\n return (document.URL.split('#').length > 1) ? document.URL.split('#')[1] : null;\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['toggleable']\n static values = {\n open: { type: Boolean, default: false }\n }\n\n toggle(event) {\n this.openValue = !this.openValue\n this.animate()\n }\n\n // Sets open to value of checkbox or radio\n toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }\n\n hide() {\n this.openValue = false\n this.animate()\n }\n\n show() {\n this.openValue = true\n this.animate()\n }\n\n animate() {\n this.toggleableTargets.forEach(target => {\n transition(target, this.openValue)\n })\n }\n}\n"],
- "mappings": "wiBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,aAAAC,EAAA,iBAAAC,EAAA,aAAAC,EAAA,UAAAC,EAAA,YAAAC,EAAA,cAAAC,EAAA,SAAAC,EAAA,WAAAC,IAAA,eAAAC,EAAAX,GCAA,IAAAY,EAA2B,8BCO3B,eAAsBC,EAAWC,EAASC,EAAOC,EAAoB,CAAC,EAAG,CACjED,EACJE,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Q,EAHKR,EAGE,SAAS,CACd,MAAO,EACP,aAAc,QACd,eAAgB,QAChB,wBAAyB,OAC3B,GCVF,IAAAS,EAA2B,8BAG3B,IAAOC,EAAP,cAA6B,YAAW,CAMtC,OAAOC,EAAO,CACZ,KAAK,UAAY,CAAC,KAAK,UACvB,KAAK,QAAQ,CACf,CAGA,YAAYA,EAAO,CACjB,KAAK,UAAYA,EAAM,OAAO,QAC9B,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,SAAU,CACR,KAAK,kBAAkB,QAAQC,GAAU,CACvCC,EAAWD,EAAQ,KAAK,SAAS,CACnC,CAAC,CACH,CACF,EA/BEE,EADKJ,EACE,UAAU,CAAC,YAAY,GAC9BI,EAFKJ,EAEE,SAAS,CACd,KAAM,CAAE,KAAM,QAAS,QAAS,EAAM,CACxC",
+ "sourcesContent": ["export { default as Alert } from './alert'\nexport { default as Autosave } from './autosave'\nexport { default as ColorPreview } from './color_preview'\nexport { default as Dropdown } from './dropdown'\nexport { default as Modal } from './modal'\nexport { default as Popover } from './popover'\nexport { default as Slideover } from './slideover'\nexport { default as Tabs } from './tabs'\nexport { default as Toggle } from './toggle'\n", "import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static values = {\n dismissAfter: Number,\n showDelay: { type: Number, default: 0 },\n }\n\n connect() {\n setTimeout(() => {\n enter(this.element)\n }, this.showDelayValue)\n\n // Auto dimiss if defined\n if (this.hasDismissAfterValue) {\n setTimeout(() => {\n this.close()\n }, this.dismissAfterValue)\n }\n }\n\n // Runs hide animation and then removes element from the page\n close() {\n leave(this.element).then(() => {\n this.element.remove()\n })\n }\n}\n", "// Enter transition:\n//\n// transition(this.element, true)\n//\n// Leave transition:\n//\n// transition(this.element, false)\nexport async function transition(element, state, transitionOptions = {}) {\n if (!!state) {\n enter(element, transitionOptions)\n } else {\n leave(element, transitionOptions)\n }\n}\n\n// class=\"fixed inset-0 bg-black overflow-y-auto flex items-center justify-center bg-opacity-80 hidden\"\n// data-transition-enter=\"transition-all ease-in-out duration-300\"\n// data-transition-enter-from=\"bg-opacity-0\"\n// data-transition-enter-to=\"bg-opacity-80\"\n// data-transition-leave=\"transition-all ease-in-out duration-300\"\n// data-transition-leave-from=\"bg-opacity-80\"\n// data-transition-leave-to=\"bg-opacity-0\"\nexport async function enter(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionEnter || transitionOptions.enter || 'enter'\n const fromClasses =\n element.dataset.transitionEnterFrom || transitionOptions.enterFrom || 'enter-from'\n const toClasses = element.dataset.transitionEnterTo || transitionOptions.enterTo || 'enter-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggleClass || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n element.classList.remove(...toggleClass.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n }\n}\n\nexport async function leave(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionLeave || transitionOptions.leave || 'leave'\n const fromClasses =\n element.dataset.transitionLeaveFrom || transitionOptions.leaveFrom || 'leave-from'\n const toClasses = element.dataset.transitionLeaveTo || transitionOptions.leaveTo || 'leave-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggle || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n element.classList.add(...toggleClass.split(' '))\n }\n}\n\nfunction nextFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n })\n })\n}\n\nfunction afterTransition(element) {\n return Promise.all(element.getAnimations().map(animation => animation.finished))\n}\n", "// Form autosave\n//\n// <%= form_with(model: post, data: { controller: \"autosave\", autosave_target: \"form\", action: \"turbo:submit-end->autosave#success turbo:fetch-request-error->autosave#error\" }) do |form| %>\n//
\n// <%= form.label :title %>\n// <%= form.text_field :title, class: 'form-control', data: { action: \"keyup->autosave#save\" } %>\n//
\n// <% end %>\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['form', 'status']\n static values = {\n submitDuration: {type: Number, default: 1000},\n statusDuration: {type: Number, default: 2000},\n submittingText: {type: String, default: \"Saving...\"},\n successText: {type: String, default: \"Saved!\"},\n errorText: {type: String, default: \"Unable to save.\"}\n }\n\n connect() {\n this.timeout = null\n }\n\n save() {\n clearTimeout(this.timeout)\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = this.submittingTextValue\n this.formTarget.requestSubmit()\n }, this.submitDurationValue)\n }\n\n success() {\n this.setStatus(this.successTextValue)\n }\n\n error() {\n this.setStatus(this.errorTextValue)\n }\n\n setStatus(message) {\n this.statusTarget.textContent = message\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = ''\n }, this.statusDurationValue)\n }\n}\n", "// A color picker preview where you can choose to have the color or backgroundColor\n// get updated based on the result of a color picker. It also supports ensuring\n// the foreground text is always readable by performing a YIQ calculation to\n// set the text to black or white based on the contrast of the color and backgroundColor.\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['preview', 'color'];\n static values = {\n style: {type: String, default: \"backgroundColor\"}\n }\n\n update() {\n this.preview = this.colorTarget.value\n }\n\n set preview(color) {\n this.previewTarget.style[this.styleValue] = color\n\n // Ensure the foreground text is always readable by setting either the\n // backgroundColor or color to black or white.\n const yiqColor = this._getContrastYIQ(color)\n\n if (this.styleValue === 'color') {\n this.previewTarget.style.backgroundColor = yiqColor\n } else {\n this.previewTarget.style.color = yiqColor\n }\n }\n\n _getContrastYIQ(hexColor) {\n // Taken from: https://24ways.org/2010/calculating-color-contrast/\n hexColor = hexColor.replace('#', '');\n\n const yiqThreshold = 128;\n const r = parseInt(hexColor.substr(0, 2), 16);\n const g = parseInt(hexColor.substr(2, 2), 16);\n const b = parseInt(hexColor.substr(4, 2), 16);\n const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;\n\n return (yiq >= yiqThreshold) ? '#000' : '#fff';\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = ['menu', 'button', 'menuItem']\n static values = {\n open: { type: Boolean, default: false },\n closeOnEscape: { type: Boolean, default: true },\n closeOnClickOutside: { type: Boolean, default: true }\n }\n static classes = ['enter', 'enterFrom', 'enterTo', 'leave', 'leaveFrom', 'leaveTo', 'toggle']\n\n connect() {\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue, this.transitionOptions)\n\n if (this.openValue === true && this.hasMenuItemTarget) {\n this.menuItemTargets[0].focus()\n }\n }\n\n show() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n // Closes dropdown from outside click or keyboard\n hide(event) {\n // if the event is a click and the target is not inside the dropdown, then close it\n if (\n this.closeOnClickOutsideValue &&\n event.target.nodeType &&\n this.element.contains(event.target) === false &&\n this.openValue\n ) {\n this.openValue = false\n }\n\n // if the event is a keydown and the key is escape, then close it\n if (this.closeOnEscapeValue && event.key === 'Escape' && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.nextIndex].focus()\n }\n\n previousItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.previousIndex].focus()\n }\n\n // getters and setters\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n\n get nextIndex() {\n return Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n }\n\n get previousIndex() {\n return Math.max(this.currentItemIndex - 1, 0)\n }\n\n get transitionOptions() {\n // once the Class API default values are available, we can simplify this\n return {\n enter: this.hasEnterClass ? this.enterClass : 'transition ease-out duration-100',\n enterFrom: this.hasEnterFromClass ? this.enterFromClass : 'transform opacity-0 scale-95',\n enterTo: this.hasEnterToClass ? this.enterToClass : 'transform opacity-100 scale-100',\n leave: this.hasLeaveClass ? this.leaveClass : 'transition ease-in duration-75',\n leaveFrom: this.hasLeaveFromClass ? this.leaveFromClass : 'transform opacity-100 scale-100',\n leaveTo: this.hasLeaveToClass ? this.leaveToClass : 'transform opacity-0 scale-95',\n toggleClass: this.hasToggleClass ? this.toggleClass : 'hidden',\n }\n }\n\n // Ensures the menu is hidden before Turbo caches the page\n beforeCache() {\n this.openValue = false\n this.menuTarget.classList.add(\"hidden\")\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n // Allows for a closing animation since display transitions don't work yet\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n // For showing non-modally\n show() {\n this.dialogTarget.show()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "// A simple inline popover to be used wherever needed, with a configurable offset.\n// Visit The Stimulus Handbook for more details\n// https://stimulusjs.org/handbook/introduction\n//\n// This example controller works with specially annotated HTML like:\n//\n//
\n// which shows you local search results before normal organic results.\n//\n//\n// You can also toggle the popover using the click action.\n//
popover#toggle\" data-action=\"mouseenter->popover#show mouseleave->popover#hide\">\n\nimport { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['content']\n static values = {\n dismissAfter: Number,\n open: { type: Boolean, default: false }\n }\n\n openValueChanged() {\n transition(this.contentTarget, this.openValue)\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n }\n\n // If already true, extend the dismissal another X seconds since this will not trigger openValueChanged\n show(event) {\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n this.openValue = true\n }\n\n hide() {\n this.openValue = false\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n get shouldAutoDismiss() {\n return (this.openValue && this.hasDismissAfterValue)\n }\n\n scheduleDismissal() {\n if (!this.hasDismissAfterValue) return\n\n // Cancel any existing dismissals\n this.cancelDismissal()\n\n // Schedule the next dismissal\n this.timeoutId = setTimeout(() => {\n this.hide()\n this.timeoutId = undefined\n }, this.dismissAfterValue)\n }\n\n cancelDismissal() {\n if (typeof this.timeoutId === \"number\") {\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static classes = [ \"activeTab\", \"inactiveTab\" ]\n static targets = ['tab', 'panel', 'select']\n static values = {\n index: 0,\n updateAnchor: Boolean,\n scrollToAnchor: Boolean,\n scrollActiveTabIntoView: Boolean\n }\n\n initialize() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\n }\n\n connect() {\n this.showTab()\n }\n\n // Changes to the clicked tab\n change(event) {\n if (event.currentTarget.tagName === \"SELECT\") {\n this.indexValue = event.currentTarget.selectedIndex\n\n // If target specifies an index, use that\n } else if (event.currentTarget.dataset.index) {\n this.indexValue = event.currentTarget.dataset.index\n\n // If target specifies an id, use that\n } else if (event.currentTarget.dataset.id) {\n this.indexValue = this.tabTargets.findIndex((tab) => tab.id == event.currentTarget.dataset.id)\n\n // Otherwise, use the index of the current target\n } else {\n this.indexValue = this.tabTargets.indexOf(event.currentTarget)\n }\n\n }\n\n nextTab() {\n this.indexValue = Math.min(this.indexValue + 1, this.tabsCount - 1)\n }\n\n previousTab() {\n this.indexValue = Math.max(this.indexValue - 1, 0)\n }\n\n firstTab() {\n this.indexValue = 0\n }\n\n lastTab() {\n this.indexValue = this.tabsCount - 1\n }\n\n indexValueChanged() {\n this.showTab()\n this.dispatch(\"tab-change\", {\n target: this.tabTargets[this.indexValue],\n detail: {\n activeIndex: this.indexValue\n }\n })\n // Update URL with the tab ID if it has one\n // This will be automatically selected on page load\n if (this.updateAnchorValue) {\n const new_tab_id = this.tabTargets[this.indexValue].id // Grab the id from the newly activated tab\n if (this.scrollToAnchorValue){\n location.hash = new_tab_id // Use location.hash to change the URL with scrolling\n } else {\n const currentUrl = window.location.href // Get the current URL\n const newUrl = currentUrl.split('#')[0] + '#' + new_tab_id // Create a new URL with the updated ID\n history.replaceState({}, document.title, newUrl) // Use history.replaceState to change the URL without scrolling\n }\n }\n }\n\n showTab() {\n this.panelTargets.forEach((panel, index) => {\n const tab = this.tabTargets[index]\n\n if (index === this.indexValue) {\n panel.classList.remove('hidden')\n tab.ariaSelected = 'true'\n tab.dataset.active = true\n if (this.hasInactiveTabClass) tab?.classList?.remove(...this.inactiveTabClasses)\n if (this.hasActiveTabClass) tab?.classList?.add(...this.activeTabClasses)\n } else {\n panel.classList.add('hidden')\n tab.ariaSelected = null\n delete tab.dataset.active\n if (this.hasActiveTabClass) tab?.classList?.remove(...this.activeTabClasses)\n if (this.hasInactiveTabClass) tab?.classList?.add(...this.inactiveTabClasses)\n }\n })\n\n if (this.hasSelectTarget) {\n this.selectTarget.selectedIndex = this.indexValue\n }\n\n if (this.scrollActiveTabIntoViewValue) this.scrollToActiveTab()\n }\n\n // If tabs have horizontal scrolling, the active tab may be out of sight.\n // Make sure the active tab is visible by scrolling it into the view.\n scrollToActiveTab() {\n const activeTab = this.element.querySelector('[aria-selected]')\n if (activeTab) activeTab.scrollIntoView({ inline: 'center', })\n }\n\n get tabsCount() {\n return this.tabTargets.length\n }\n\n get anchor() {\n return (document.URL.split('#').length > 1) ? document.URL.split('#')[1] : null;\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['toggleable']\n static values = {\n open: { type: Boolean, default: false }\n }\n\n toggle(event) {\n this.openValue = !this.openValue\n this.animate()\n }\n\n // Sets open to value of checkbox or radio\n toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }\n\n hide() {\n this.openValue = false\n this.animate()\n }\n\n show() {\n this.openValue = true\n this.animate()\n }\n\n animate() {\n this.toggleableTargets.forEach(target => {\n transition(target, this.openValue)\n })\n }\n}\n"],
+ "mappings": "wiBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,aAAAC,EAAA,iBAAAC,EAAA,aAAAC,EAAA,U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C,EAAI,IAC7E,CACF,EAnHEC,EADKR,EACE,UAAU,CAAE,YAAa,aAAc,GAC9CQ,EAFKR,EAEE,UAAU,CAAC,MAAO,QAAS,QAAQ,GAC1CQ,EAHKR,EAGE,SAAS,CACd,MAAO,EACP,aAAc,QACd,eAAgB,QAChB,wBAAyB,OAC3B,GCVF,IAAAS,EAA2B,8BAG3B,IAAOC,EAAP,cAA6B,YAAW,CAMtC,OAAOC,EAAO,CACZ,KAAK,UAAY,CAAC,KAAK,UACvB,KAAK,QAAQ,CACf,CAGA,YAAYA,EAAO,CACjB,KAAK,UAAYA,EAAM,OAAO,QAC9B,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,SAAU,CACR,KAAK,kBAAkB,QAAQC,GAAU,CACvCC,EAAWD,EAAQ,KAAK,SAAS,CACnC,CAAC,CACH,CACF,EA/BEE,EADKJ,EACE,UAAU,CAAC,YAAY,GAC9BI,EAFKJ,EAEE,SAAS,CACd,KAAM,CAAE,KAAM,QAAS,QAAS,EAAM,CACxC",
"names": ["src_exports", "__export", "alert_default", "autosave_default", "color_preview_default", "dropdown_default", "modal_default", "popover_default", "slideover_default", "tabs_default", "toggle_default", "__toCommonJS", "import_stimulus", "transition", "element", "state", "transitionOptions", "enter", "leave", "transitionClasses", "fromClasses", "toClasses", "toggleClass", "nextFrame", "afterTransition", "resolve", "animation", "alert_default", "enter", "leave", "__publicField", "import_stimulus", "autosave_default", "message", "__publicField", "import_stimulus", "color_preview_default", "color", "yiqColor", "hexColor", "yiqThreshold", "r", "g", "b", "__publicField", "import_stimulus", "dropdown_default", "transition", "event", "__publicField", "import_stimulus", "modal_default", "animation", "event", "__publicField", "import_stimulus", "popover_default", "transition", "event", "__publicField", "import_stimulus", "slideover_default", "animation", "event", "__publicField", "import_stimulus", "tabs_default", "tab", "event", "new_tab_id", "newUrl", "panel", "index", "activeTab", "__publicField", "import_stimulus", "toggle_default", "event", "target", "transition", "__publicField"]
}
diff --git a/dist/tailwindcss-stimulus-components.module.js b/dist/tailwindcss-stimulus-components.module.js
index 9a990d2..2128d29 100644
--- a/dist/tailwindcss-stimulus-components.module.js
+++ b/dist/tailwindcss-stimulus-components.module.js
@@ -1 +1 @@
-var C=Object.defineProperty;var V=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(V(t,typeof e!="symbol"?e+"":e,a),a);import{Controller as y}from"@hotwired/stimulus";async function r(t,e,a={}){e?T(t,a):b(t,a)}async function T(t,e={}){let a=t.dataset.transitionEnter||e.enter||"enter",i=t.dataset.transitionEnterFrom||e.enterFrom||"enter-from",o=t.dataset.transitionEnterTo||e.enterTo||"enter-to",g=t.dataset.toggleClass||e.toggleClass||"hidden";t.classList.add(...a.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),t.classList.remove(...g.split(" ")),await v(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...a.split(" "))}}async function b(t,e={}){let a=t.dataset.transitionLeave||e.leave||"leave",i=t.dataset.transitionLeaveFrom||e.leaveFrom||"leave-from",o=t.dataset.transitionLeaveTo||e.leaveTo||"leave-to",g=t.dataset.toggleClass||e.toggle||"hidden";t.classList.add(...a.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),await v(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...a.split(" ")),t.classList.add(...g.split(" "))}}function v(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function x(t){return Promise.all(t.getAnimations().map(e=>e.finished))}var p=class extends y{connect(){setTimeout(()=>{T(this.element)},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){b(this.element).then(()=>{this.element.remove()})}};s(p,"values",{dismissAfter:Number,showDelay:{type:Number,default:0},removeDelay:{type:Number,default:1100}});import{Controller as I}from"@hotwired/stimulus";var h=class extends I{connect(){this.timeout=null}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent=this.submittingTextValue,this.formTarget.requestSubmit()},this.submitDurationValue)}success(){this.setStatus(this.successTextValue)}error(){this.setStatus(this.errorTextValue)}setStatus(t){this.statusTarget.textContent=t,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},this.statusDurationValue)}};s(h,"targets",["form","status"]),s(h,"values",{submitDuration:{type:Number,default:1e3},statusDuration:{type:Number,default:2e3},submittingText:{type:String,default:"Saving..."},successText:{type:String,default:"Saved!"},errorText:{type:String,default:"Unable to save."}});import{Controller as L}from"@hotwired/stimulus";var u=class extends L{update(){this.preview=this.colorTarget.value}set preview(t){this.previewTarget.style[this.styleValue]=t;let e=this._getContrastYIQ(t);this.styleValue==="color"?this.previewTarget.style.backgroundColor=e:this.previewTarget.style.color=e}_getContrastYIQ(t){t=t.replace("#","");let e=128,a=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return(a*299+i*587+o*114)/1e3>=e?"#000":"#fff"}};s(u,"targets",["preview","color"]),s(u,"values",{style:{type:String,default:"backgroundColor"}});import{Controller as A}from"@hotwired/stimulus";var l=class extends A{connect(){document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}openValueChanged(){r(this.menuTarget,this.openValue,this.transitionOptions),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}close(){this.openValue=!1}hide(t){this.closeOnClickOutsideValue&&t.target.nodeType&&this.element.contains(t.target)===!1&&this.openValue&&(this.openValue=!1),this.closeOnEscapeValue&&t.key==="Escape"&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(t){t.preventDefault(),this.menuItemTargets[this.nextIndex].focus()}previousItem(t){t.preventDefault(),this.menuItemTargets[this.previousIndex].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}get nextIndex(){return Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1)}get previousIndex(){return Math.max(this.currentItemIndex-1,0)}get transitionOptions(){return{enter:this.hasEnterClass?this.enterClass:"transition ease-out duration-100",enterFrom:this.hasEnterFromClass?this.enterFromClass:"transform opacity-0 scale-95",enterTo:this.hasEnterToClass?this.enterToClass:"transform opacity-100 scale-100",leave:this.hasLeaveClass?this.leaveClass:"transition ease-in duration-75",leaveFrom:this.hasLeaveFromClass?this.leaveFromClass:"transform opacity-100 scale-100",leaveTo:this.hasLeaveToClass?this.leaveToClass:"transform opacity-0 scale-95",toggleClass:this.hasToggleClass?this.toggleClass:"hidden"}}beforeCache(){this.openValue=!1,this.menuTarget.classList.add("hidden")}};s(l,"targets",["menu","button","menuItem"]),s(l,"values",{open:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0}}),s(l,"classes",["enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","toggle"]);import{Controller as w}from"@hotwired/stimulus";var c=class extends w{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName=="DIALOG"&&this.close()}show(){this.dialogTarget.show()}beforeCache(){this.close()}};s(c,"targets",["dialog"]),s(c,"values",{open:Boolean});import{Controller as D}from"@hotwired/stimulus";var d=class extends D{openValueChanged(){r(this.contentTarget,this.openValue),this.shouldAutoDismiss&&this.scheduleDismissal()}show(t){this.shouldAutoDismiss&&this.scheduleDismissal(),this.openValue=!0}hide(){this.openValue=!1}toggle(){this.openValue=!this.openValue}get shouldAutoDismiss(){return this.openValue&&this.hasDismissAfterValue}scheduleDismissal(){this.hasDismissAfterValue&&(this.cancelDismissal(),this.timeoutId=setTimeout(()=>{this.hide(),this.timeoutId=void 0},this.dismissAfterValue))}cancelDismissal(){typeof this.timeoutId=="number"&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)}};s(d,"targets",["content"]),s(d,"values",{dismissAfter:Number,open:{type:Boolean,default:!1}});import{Controller as E}from"@hotwired/stimulus";var m=class extends E{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName=="DIALOG"&&this.close()}beforeCache(){this.close()}};s(m,"targets",["dialog"]),s(m,"values",{open:Boolean});import{Controller as S}from"@hotwired/stimulus";var n=class extends S{initialize(){this.anchor&&(this.indexValue=this.tabTargets.findIndex(t=>t.id===this.anchor))}connect(){this.showTab()}change(t){t.currentTarget.tagName==="SELECT"?this.indexValue=t.currentTarget.selectedIndex:t.currentTarget.dataset.index?this.indexValue=t.currentTarget.dataset.index:t.currentTarget.dataset.id?this.indexValue=this.tabTargets.findIndex(e=>e.id==t.currentTarget.dataset.id):this.indexValue=this.tabTargets.indexOf(t.currentTarget)}nextTab(){this.indexValue=Math.min(this.indexValue+1,this.tabsCount-1)}previousTab(){this.indexValue=Math.max(this.indexValue-1,0)}firstTab(){this.indexValue=0}lastTab(){this.indexValue=this.tabsCount-1}indexValueChanged(){if(this.showTab(),this.dispatch("tab-change",{target:this.tabTargets[this.indexValue],detail:{activeIndex:this.indexValue}}),this.updateAnchorValue){let t=this.tabTargets[this.indexValue].id;if(this.scrollToAnchorValue)location.hash=t;else{let a=window.location.href.split("#")[0]+"#"+t;history.replaceState({},document.title,a)}}}showTab(){this.panelTargets.forEach((t,e)=>{let a=this.tabTargets[e];e===this.indexValue?(t.classList.remove("hidden"),a.ariaSelected="true",a.dataset.active=!0,this.hasInactiveTabClass&&a?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&a?.classList?.add(...this.activeTabClasses)):(t.classList.add("hidden"),a.ariaSelected=null,delete a.dataset.active,this.hasActiveTabClass&&a?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&a?.classList?.add(...this.inactiveTabClasses))}),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue),this.scrollActiveTabIntoViewValue&&this.scrollToActiveTab()}scrollToActiveTab(){let t=this.element.querySelector("[aria-selected]");t&&t.scrollIntoView({inline:"center"})}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};s(n,"classes",["activeTab","inactiveTab"]),s(n,"targets",["tab","panel","select"]),s(n,"values",{index:0,updateAnchor:Boolean,scrollToAnchor:Boolean,scrollActiveTabIntoView:Boolean});import{Controller as F}from"@hotwired/stimulus";var f=class extends F{toggle(t){this.openValue=!this.openValue,this.animate()}toggleInput(t){this.openValue=t.target.checked,this.animate()}hide(){this.openValue=!1,this.animate()}show(){this.openValue=!0,this.animate()}animate(){this.toggleableTargets.forEach(t=>{r(t,this.openValue)})}};s(f,"targets",["toggleable"]),s(f,"values",{open:{type:Boolean,default:!1}});export{p as Alert,h as Autosave,u as ColorPreview,l as Dropdown,c as Modal,d as Popover,m as Slideover,n as Tabs,f as Toggle};
+var C=Object.defineProperty;var V=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(V(t,typeof e!="symbol"?e+"":e,a),a);import{Controller as I}from"@hotwired/stimulus";async function r(t,e,a={}){e?T(t,a):b(t,a)}async function T(t,e={}){let a=t.dataset.transitionEnter||e.enter||"enter",i=t.dataset.transitionEnterFrom||e.enterFrom||"enter-from",o=t.dataset.transitionEnterTo||e.enterTo||"enter-to",g=t.dataset.toggleClass||e.toggleClass||"hidden";t.classList.add(...a.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),t.classList.remove(...g.split(" ")),await v(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...a.split(" "))}}async function b(t,e={}){let a=t.dataset.transitionLeave||e.leave||"leave",i=t.dataset.transitionLeaveFrom||e.leaveFrom||"leave-from",o=t.dataset.transitionLeaveTo||e.leaveTo||"leave-to",g=t.dataset.toggleClass||e.toggle||"hidden";t.classList.add(...a.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),await v(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...a.split(" ")),t.classList.add(...g.split(" "))}}function v(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function x(t){return Promise.all(t.getAnimations().map(e=>e.finished))}var p=class extends I{connect(){setTimeout(()=>{T(this.element)},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){b(this.element).then(()=>{this.element.remove()})}};s(p,"values",{dismissAfter:Number,showDelay:{type:Number,default:0}});import{Controller as y}from"@hotwired/stimulus";var h=class extends y{connect(){this.timeout=null}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent=this.submittingTextValue,this.formTarget.requestSubmit()},this.submitDurationValue)}success(){this.setStatus(this.successTextValue)}error(){this.setStatus(this.errorTextValue)}setStatus(t){this.statusTarget.textContent=t,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},this.statusDurationValue)}};s(h,"targets",["form","status"]),s(h,"values",{submitDuration:{type:Number,default:1e3},statusDuration:{type:Number,default:2e3},submittingText:{type:String,default:"Saving..."},successText:{type:String,default:"Saved!"},errorText:{type:String,default:"Unable to save."}});import{Controller as L}from"@hotwired/stimulus";var u=class extends L{update(){this.preview=this.colorTarget.value}set preview(t){this.previewTarget.style[this.styleValue]=t;let e=this._getContrastYIQ(t);this.styleValue==="color"?this.previewTarget.style.backgroundColor=e:this.previewTarget.style.color=e}_getContrastYIQ(t){t=t.replace("#","");let e=128,a=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return(a*299+i*587+o*114)/1e3>=e?"#000":"#fff"}};s(u,"targets",["preview","color"]),s(u,"values",{style:{type:String,default:"backgroundColor"}});import{Controller as A}from"@hotwired/stimulus";var l=class extends A{connect(){document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}openValueChanged(){r(this.menuTarget,this.openValue,this.transitionOptions),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}close(){this.openValue=!1}hide(t){this.closeOnClickOutsideValue&&t.target.nodeType&&this.element.contains(t.target)===!1&&this.openValue&&(this.openValue=!1),this.closeOnEscapeValue&&t.key==="Escape"&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(t){t.preventDefault(),this.menuItemTargets[this.nextIndex].focus()}previousItem(t){t.preventDefault(),this.menuItemTargets[this.previousIndex].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}get nextIndex(){return Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1)}get previousIndex(){return Math.max(this.currentItemIndex-1,0)}get transitionOptions(){return{enter:this.hasEnterClass?this.enterClass:"transition ease-out duration-100",enterFrom:this.hasEnterFromClass?this.enterFromClass:"transform opacity-0 scale-95",enterTo:this.hasEnterToClass?this.enterToClass:"transform opacity-100 scale-100",leave:this.hasLeaveClass?this.leaveClass:"transition ease-in duration-75",leaveFrom:this.hasLeaveFromClass?this.leaveFromClass:"transform opacity-100 scale-100",leaveTo:this.hasLeaveToClass?this.leaveToClass:"transform opacity-0 scale-95",toggleClass:this.hasToggleClass?this.toggleClass:"hidden"}}beforeCache(){this.openValue=!1,this.menuTarget.classList.add("hidden")}};s(l,"targets",["menu","button","menuItem"]),s(l,"values",{open:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0}}),s(l,"classes",["enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","toggle"]);import{Controller as w}from"@hotwired/stimulus";var c=class extends w{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName=="DIALOG"&&this.close()}show(){this.dialogTarget.show()}beforeCache(){this.close()}};s(c,"targets",["dialog"]),s(c,"values",{open:Boolean});import{Controller as D}from"@hotwired/stimulus";var d=class extends D{openValueChanged(){r(this.contentTarget,this.openValue),this.shouldAutoDismiss&&this.scheduleDismissal()}show(t){this.shouldAutoDismiss&&this.scheduleDismissal(),this.openValue=!0}hide(){this.openValue=!1}toggle(){this.openValue=!this.openValue}get shouldAutoDismiss(){return this.openValue&&this.hasDismissAfterValue}scheduleDismissal(){this.hasDismissAfterValue&&(this.cancelDismissal(),this.timeoutId=setTimeout(()=>{this.hide(),this.timeoutId=void 0},this.dismissAfterValue))}cancelDismissal(){typeof this.timeoutId=="number"&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)}};s(d,"targets",["content"]),s(d,"values",{dismissAfter:Number,open:{type:Boolean,default:!1}});import{Controller as E}from"@hotwired/stimulus";var m=class extends E{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map(t=>t.finished)).then(()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()})}backdropClose(t){t.target.nodeName=="DIALOG"&&this.close()}beforeCache(){this.close()}};s(m,"targets",["dialog"]),s(m,"values",{open:Boolean});import{Controller as S}from"@hotwired/stimulus";var n=class extends S{initialize(){this.anchor&&(this.indexValue=this.tabTargets.findIndex(t=>t.id===this.anchor))}connect(){this.showTab()}change(t){t.currentTarget.tagName==="SELECT"?this.indexValue=t.currentTarget.selectedIndex:t.currentTarget.dataset.index?this.indexValue=t.currentTarget.dataset.index:t.currentTarget.dataset.id?this.indexValue=this.tabTargets.findIndex(e=>e.id==t.currentTarget.dataset.id):this.indexValue=this.tabTargets.indexOf(t.currentTarget)}nextTab(){this.indexValue=Math.min(this.indexValue+1,this.tabsCount-1)}previousTab(){this.indexValue=Math.max(this.indexValue-1,0)}firstTab(){this.indexValue=0}lastTab(){this.indexValue=this.tabsCount-1}indexValueChanged(){if(this.showTab(),this.dispatch("tab-change",{target:this.tabTargets[this.indexValue],detail:{activeIndex:this.indexValue}}),this.updateAnchorValue){let t=this.tabTargets[this.indexValue].id;if(this.scrollToAnchorValue)location.hash=t;else{let a=window.location.href.split("#")[0]+"#"+t;history.replaceState({},document.title,a)}}}showTab(){this.panelTargets.forEach((t,e)=>{let a=this.tabTargets[e];e===this.indexValue?(t.classList.remove("hidden"),a.ariaSelected="true",a.dataset.active=!0,this.hasInactiveTabClass&&a?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&a?.classList?.add(...this.activeTabClasses)):(t.classList.add("hidden"),a.ariaSelected=null,delete a.dataset.active,this.hasActiveTabClass&&a?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&a?.classList?.add(...this.inactiveTabClasses))}),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue),this.scrollActiveTabIntoViewValue&&this.scrollToActiveTab()}scrollToActiveTab(){let t=this.element.querySelector("[aria-selected]");t&&t.scrollIntoView({inline:"center"})}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};s(n,"classes",["activeTab","inactiveTab"]),s(n,"targets",["tab","panel","select"]),s(n,"values",{index:0,updateAnchor:Boolean,scrollToAnchor:Boolean,scrollActiveTabIntoView:Boolean});import{Controller as F}from"@hotwired/stimulus";var f=class extends F{toggle(t){this.openValue=!this.openValue,this.animate()}toggleInput(t){this.openValue=t.target.checked,this.animate()}hide(){this.openValue=!1,this.animate()}show(){this.openValue=!0,this.animate()}animate(){this.toggleableTargets.forEach(t=>{r(t,this.openValue)})}};s(f,"targets",["toggleable"]),s(f,"values",{open:{type:Boolean,default:!1}});export{p as Alert,h as Autosave,u as ColorPreview,l as Dropdown,c as Modal,d as Popover,m as Slideover,n as Tabs,f as Toggle};
diff --git a/dist/tailwindcss-stimulus-components.module.js.map b/dist/tailwindcss-stimulus-components.module.js.map
index 28528b9..bfa3ce2 100644
--- a/dist/tailwindcss-stimulus-components.module.js.map
+++ b/dist/tailwindcss-stimulus-components.module.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
"sources": ["../src/alert.js", "../src/transition.js", "../src/autosave.js", "../src/color_preview.js", "../src/dropdown.js", "../src/modal.js", "../src/popover.js", "../src/slideover.js", "../src/tabs.js", "../src/toggle.js"],
- "sourcesContent": ["import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static values = {\n dismissAfter: Number,\n showDelay: { type: Number, default: 0 },\n removeDelay: { type: Number, default: 1100 }\n }\n\n connect() {\n setTimeout(() => {\n enter(this.element)\n }, this.showDelayValue)\n\n // Auto dimiss if defined\n if (this.hasDismissAfterValue) {\n setTimeout(() => {\n this.close()\n }, this.dismissAfterValue)\n }\n }\n\n // Runs hide animation and then removes element from the page\n close() {\n leave(this.element).then(() => {\n this.element.remove()\n })\n }\n}\n", "// Enter transition:\n//\n// transition(this.element, true)\n//\n// Leave transition:\n//\n// transition(this.element, false)\nexport async function transition(element, state, transitionOptions = {}) {\n if (!!state) {\n enter(element, transitionOptions)\n } else {\n leave(element, transitionOptions)\n }\n}\n\n// class=\"fixed inset-0 bg-black overflow-y-auto flex items-center justify-center bg-opacity-80 hidden\"\n// data-transition-enter=\"transition-all ease-in-out duration-300\"\n// data-transition-enter-from=\"bg-opacity-0\"\n// data-transition-enter-to=\"bg-opacity-80\"\n// data-transition-leave=\"transition-all ease-in-out duration-300\"\n// data-transition-leave-from=\"bg-opacity-80\"\n// data-transition-leave-to=\"bg-opacity-0\"\nexport async function enter(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionEnter || transitionOptions.enter || 'enter'\n const fromClasses =\n element.dataset.transitionEnterFrom || transitionOptions.enterFrom || 'enter-from'\n const toClasses = element.dataset.transitionEnterTo || transitionOptions.enterTo || 'enter-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggleClass || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n element.classList.remove(...toggleClass.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n }\n}\n\nexport async function leave(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionLeave || transitionOptions.leave || 'leave'\n const fromClasses =\n element.dataset.transitionLeaveFrom || transitionOptions.leaveFrom || 'leave-from'\n const toClasses = element.dataset.transitionLeaveTo || transitionOptions.leaveTo || 'leave-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggle || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n element.classList.add(...toggleClass.split(' '))\n }\n}\n\nfunction nextFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n })\n })\n}\n\nfunction afterTransition(element) {\n return Promise.all(element.getAnimations().map(animation => animation.finished))\n}\n", "// Form autosave\n//\n// <%= form_with(model: post, data: { controller: \"autosave\", autosave_target: \"form\", action: \"turbo:submit-end->autosave#success turbo:fetch-request-error->autosave#error\" }) do |form| %>\n//
\n// <%= form.label :title %>\n// <%= form.text_field :title, class: 'form-control', data: { action: \"keyup->autosave#save\" } %>\n//
\n//\n//
\n// <% end %>\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['form', 'status']\n static values = {\n submitDuration: {type: Number, default: 1000},\n statusDuration: {type: Number, default: 2000},\n submittingText: {type: String, default: \"Saving...\"},\n successText: {type: String, default: \"Saved!\"},\n errorText: {type: String, default: \"Unable to save.\"}\n }\n\n connect() {\n this.timeout = null\n }\n\n save() {\n clearTimeout(this.timeout)\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = this.submittingTextValue\n this.formTarget.requestSubmit()\n }, this.submitDurationValue)\n }\n\n success() {\n this.setStatus(this.successTextValue)\n }\n\n error() {\n this.setStatus(this.errorTextValue)\n }\n\n setStatus(message) {\n this.statusTarget.textContent = message\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = ''\n }, this.statusDurationValue)\n }\n}\n", "// A color picker preview where you can choose to have the color or backgroundColor\n// get updated based on the result of a color picker. It also supports ensuring\n// the foreground text is always readable by performing a YIQ calculation to\n// set the text to black or white based on the contrast of the color and backgroundColor.\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['preview', 'color'];\n static values = {\n style: {type: String, default: \"backgroundColor\"}\n }\n\n update() {\n this.preview = this.colorTarget.value\n }\n\n set preview(color) {\n this.previewTarget.style[this.styleValue] = color\n\n // Ensure the foreground text is always readable by setting either the\n // backgroundColor or color to black or white.\n const yiqColor = this._getContrastYIQ(color)\n\n if (this.styleValue === 'color') {\n this.previewTarget.style.backgroundColor = yiqColor\n } else {\n this.previewTarget.style.color = yiqColor\n }\n }\n\n _getContrastYIQ(hexColor) {\n // Taken from: https://24ways.org/2010/calculating-color-contrast/\n hexColor = hexColor.replace('#', '');\n\n const yiqThreshold = 128;\n const r = parseInt(hexColor.substr(0, 2), 16);\n const g = parseInt(hexColor.substr(2, 2), 16);\n const b = parseInt(hexColor.substr(4, 2), 16);\n const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;\n\n return (yiq >= yiqThreshold) ? '#000' : '#fff';\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = ['menu', 'button', 'menuItem']\n static values = {\n open: { type: Boolean, default: false },\n closeOnEscape: { type: Boolean, default: true },\n closeOnClickOutside: { type: Boolean, default: true }\n }\n static classes = ['enter', 'enterFrom', 'enterTo', 'leave', 'leaveFrom', 'leaveTo', 'toggle']\n\n connect() {\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue, this.transitionOptions)\n\n if (this.openValue === true && this.hasMenuItemTarget) {\n this.menuItemTargets[0].focus()\n }\n }\n\n show() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n // Closes dropdown from outside click or keyboard\n hide(event) {\n // if the event is a click and the target is not inside the dropdown, then close it\n if (\n this.closeOnClickOutsideValue &&\n event.target.nodeType &&\n this.element.contains(event.target) === false &&\n this.openValue\n ) {\n this.openValue = false\n }\n\n // if the event is a keydown and the key is escape, then close it\n if (this.closeOnEscapeValue && event.key === 'Escape' && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.nextIndex].focus()\n }\n\n previousItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.previousIndex].focus()\n }\n\n // getters and setters\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n\n get nextIndex() {\n return Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n }\n\n get previousIndex() {\n return Math.max(this.currentItemIndex - 1, 0)\n }\n\n get transitionOptions() {\n // once the Class API default values are available, we can simplify this\n return {\n enter: this.hasEnterClass ? this.enterClass : 'transition ease-out duration-100',\n enterFrom: this.hasEnterFromClass ? this.enterFromClass : 'transform opacity-0 scale-95',\n enterTo: this.hasEnterToClass ? this.enterToClass : 'transform opacity-100 scale-100',\n leave: this.hasLeaveClass ? this.leaveClass : 'transition ease-in duration-75',\n leaveFrom: this.hasLeaveFromClass ? this.leaveFromClass : 'transform opacity-100 scale-100',\n leaveTo: this.hasLeaveToClass ? this.leaveToClass : 'transform opacity-0 scale-95',\n toggleClass: this.hasToggleClass ? this.toggleClass : 'hidden',\n }\n }\n\n // Ensures the menu is hidden before Turbo caches the page\n beforeCache() {\n this.openValue = false\n this.menuTarget.classList.add(\"hidden\")\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n // Allows for a closing animation since display transitions don't work yet\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n // For showing non-modally\n show() {\n this.dialogTarget.show()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "// A simple inline popover to be used wherever needed, with a configurable offset.\n// Visit The Stimulus Handbook for more details\n// https://stimulusjs.org/handbook/introduction\n//\n// This example controller works with specially annotated HTML like:\n//\n//
\n// Beginning in 2015, Google introduced what is called the\n//
popover#mouseOver mouseout->popover#mouseOut\">\n//
'local snack pack', \n//
\n// Terrible name - we know. But the biggest name in SEO came up with it.\n//
\n//
\n// which shows you local search results before normal organic results.\n//\n//\n// You can also toggle the popover using the click action.\n//
popover#toggle\" data-action=\"mouseenter->popover#show mouseleave->popover#hide\">\n\nimport { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['content']\n static values = {\n dismissAfter: Number,\n open: { type: Boolean, default: false }\n }\n\n openValueChanged() {\n transition(this.contentTarget, this.openValue)\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n }\n\n // If already true, extend the dismissal another X seconds since this will not trigger openValueChanged\n show(event) {\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n this.openValue = true\n }\n\n hide() {\n this.openValue = false\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n get shouldAutoDismiss() {\n return (this.openValue && this.hasDismissAfterValue)\n }\n\n scheduleDismissal() {\n if (!this.hasDismissAfterValue) return\n\n // Cancel any existing dismissals\n this.cancelDismissal()\n\n // Schedule the next dismissal\n this.timeoutId = setTimeout(() => {\n this.hide()\n this.timeoutId = undefined\n }, this.dismissAfterValue)\n }\n\n cancelDismissal() {\n if (typeof this.timeoutId === \"number\") {\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static classes = [ \"activeTab\", \"inactiveTab\" ]\n static targets = ['tab', 'panel', 'select']\n static values = {\n index: 0,\n updateAnchor: Boolean,\n scrollToAnchor: Boolean,\n scrollActiveTabIntoView: Boolean\n }\n\n initialize() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\n }\n\n connect() {\n this.showTab()\n }\n\n // Changes to the clicked tab\n change(event) {\n if (event.currentTarget.tagName === \"SELECT\") {\n this.indexValue = event.currentTarget.selectedIndex\n\n // If target specifies an index, use that\n } else if (event.currentTarget.dataset.index) {\n this.indexValue = event.currentTarget.dataset.index\n\n // If target specifies an id, use that\n } else if (event.currentTarget.dataset.id) {\n this.indexValue = this.tabTargets.findIndex((tab) => tab.id == event.currentTarget.dataset.id)\n\n // Otherwise, use the index of the current target\n } else {\n this.indexValue = this.tabTargets.indexOf(event.currentTarget)\n }\n\n }\n\n nextTab() {\n this.indexValue = Math.min(this.indexValue + 1, this.tabsCount - 1)\n }\n\n previousTab() {\n this.indexValue = Math.max(this.indexValue - 1, 0)\n }\n\n firstTab() {\n this.indexValue = 0\n }\n\n lastTab() {\n this.indexValue = this.tabsCount - 1\n }\n\n indexValueChanged() {\n this.showTab()\n this.dispatch(\"tab-change\", {\n target: this.tabTargets[this.indexValue],\n detail: {\n activeIndex: this.indexValue\n }\n })\n // Update URL with the tab ID if it has one\n // This will be automatically selected on page load\n if (this.updateAnchorValue) {\n const new_tab_id = this.tabTargets[this.indexValue].id // Grab the id from the newly activated tab\n if (this.scrollToAnchorValue){\n location.hash = new_tab_id // Use location.hash to change the URL with scrolling\n } else {\n const currentUrl = window.location.href // Get the current URL\n const newUrl = currentUrl.split('#')[0] + '#' + new_tab_id // Create a new URL with the updated ID\n history.replaceState({}, document.title, newUrl) // Use history.replaceState to change the URL without scrolling\n }\n }\n }\n\n showTab() {\n this.panelTargets.forEach((panel, index) => {\n const tab = this.tabTargets[index]\n\n if (index === this.indexValue) {\n panel.classList.remove('hidden')\n tab.ariaSelected = 'true'\n tab.dataset.active = true\n if (this.hasInactiveTabClass) tab?.classList?.remove(...this.inactiveTabClasses)\n if (this.hasActiveTabClass) tab?.classList?.add(...this.activeTabClasses)\n } else {\n panel.classList.add('hidden')\n tab.ariaSelected = null\n delete tab.dataset.active\n if (this.hasActiveTabClass) tab?.classList?.remove(...this.activeTabClasses)\n if (this.hasInactiveTabClass) tab?.classList?.add(...this.inactiveTabClasses)\n }\n })\n\n if (this.hasSelectTarget) {\n this.selectTarget.selectedIndex = this.indexValue\n }\n\n if (this.scrollActiveTabIntoViewValue) this.scrollToActiveTab()\n }\n\n // If tabs have horizontal scrolling, the active tab may be out of sight.\n // Make sure the active tab is visible by scrolling it into the view.\n scrollToActiveTab() {\n const activeTab = this.element.querySelector('[aria-selected]')\n if (activeTab) activeTab.scrollIntoView({ inline: 'center', })\n }\n\n get tabsCount() {\n return this.tabTargets.length\n }\n\n get anchor() {\n return (document.URL.split('#').length > 1) ? document.URL.split('#')[1] : null;\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['toggleable']\n static values = {\n open: { type: Boolean, default: false }\n }\n\n toggle(event) {\n this.openValue = !this.openValue\n this.animate()\n }\n\n // Sets open to value of checkbox or radio\n toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }\n\n hide() {\n this.openValue = false\n this.animate()\n }\n\n show() {\n this.openValue = true\n this.animate()\n }\n\n animate() {\n this.toggleableTargets.forEach(target => {\n transition(target, this.openValue)\n })\n }\n}\n"],
- "mappings": "wKAAA,OAAS,cAAAA,MAAkB,qBCO3B,eAAsBC,EAAWC,EAASC,EAAOC,EAAoB,CAAC,EAAG,CACjED,EACJE,EAAMH,EAASE,CAAiB,EAEhCE,EAAMJ,EAASE,CAAiB,CAEpC,CASA,eAAsBC,EAAMH,EAASE,EAAoB,CAAC,EAAG,CAC3D,IAAMG,EAAoBL,EAAQ,QAAQ,iBAAmBE,EAAkB,OAAS,QAClFI,EACJN,EAAQ,QAAQ,qBAAuBE,EAAkB,WAAa,aAClEK,EAAYP,EAAQ,QAAQ,mBAAqBE,EAAkB,SAAW,WAC9EM,EAAcR,EAAQ,QAAQ,aAAeE,EAAkB,aAAe,SAGpFF,EAAQ,UAAU,IAAI,GAAGK,EAAkB,MAAM,GAAG,CAAC,EACrDL,EAAQ,UAAU,IAAI,GAAGM,EAAY,MAAM,GAAG,CAAC,EAC/CN,EAAQ,UAAU,OAAO,GAAGO,EAAU,MAAM,GAAG,CAAC,EAChDP,EAAQ,UAAU,OAAO,GAAGQ,EAAY,MAAM,GAAG,CAAC,EAElD,MAAMC,EAAU,EAEhBT,EAAQ,UAAU,OAAO,GAAGM,EAAY,MAAM,GAAG,CAAC,EAClDN,EAAQ,UAAU,IAAI,GAAGO,EAAU,MAAM,GAAG,CAAC,EAE7C,GAAI,CACF,MAAMG,EAAgBV,CAAO,CAC/B,QAAE,CACAA,EAAQ,UAAU,OAAO,GAAGK,EAAkB,MAAM,GAAG,CAAC,CAC1D,CACF,CAEA,eAAsBD,EAAMJ,EAASE,EAAoB,CAAC,EAAG,CAC3D,IAAMG,EAAoBL,EAAQ,QAAQ,iBAAmBE,EAAkB,OAAS,QAClFI,EACJN,EAAQ,QAAQ,qBAAuBE,EAAkB,WAAa,aAClEK,EAAYP,EAAQ,QAAQ,mBAAqBE,EAAk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C/D,CAEA,IAAI,WAAY,CACd,OAAO,KAAK,WAAW,MACzB,CAEA,IAAI,QAAS,CACX,OAAQ,SAAS,IAAI,MAAM,GAAG,EAAE,OAAS,EAAK,SAAS,IAAI,MAAM,GAAG,EAAE,CAAC,EAAI,IAC7E,CACF,EAnHEC,EADKT,EACE,UAAU,CAAE,YAAa,aAAc,GAC9CS,EAFKT,EAEE,UAAU,CAAC,MAAO,QAAS,QAAQ,GAC1CS,EAHKT,EAGE,SAAS,CACd,MAAO,EACP,aAAc,QACd,eAAgB,QAChB,wBAAyB,OAC3B,GCVF,OAAS,cAAAU,MAAkB,qBAG3B,IAAOC,EAAP,cAA6BC,CAAW,CAMtC,OAAOC,EAAO,CACZ,KAAK,UAAY,CAAC,KAAK,UACvB,KAAK,QAAQ,CACf,CAGA,YAAYA,EAAO,CACjB,KAAK,UAAYA,EAAM,OAAO,QAC9B,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,SAAU,CACR,KAAK,kBAAkB,QAAQC,GAAU,CACvCC,EAAWD,EAAQ,KAAK,SAAS,CACnC,CAAC,CACH,CACF,EA/BEE,EADKL,EACE,UAAU,CAAC,YAAY,GAC9BK,EAFKL,EAEE,SAAS,CACd,KAAM,CAAE,KAAM,QAAS,QAAS,EAAM,CACxC",
+ "sourcesContent": ["import { Controller } from '@hotwired/stimulus'\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static values = {\n dismissAfter: Number,\n showDelay: { type: Number, default: 0 },\n }\n\n connect() {\n setTimeout(() => {\n enter(this.element)\n }, this.showDelayValue)\n\n // Auto dimiss if defined\n if (this.hasDismissAfterValue) {\n setTimeout(() => {\n this.close()\n }, this.dismissAfterValue)\n }\n }\n\n // Runs hide animation and then removes element from the page\n close() {\n leave(this.element).then(() => {\n this.element.remove()\n })\n }\n}\n", "// Enter transition:\n//\n// transition(this.element, true)\n//\n// Leave transition:\n//\n// transition(this.element, false)\nexport async function transition(element, state, transitionOptions = {}) {\n if (!!state) {\n enter(element, transitionOptions)\n } else {\n leave(element, transitionOptions)\n }\n}\n\n// class=\"fixed inset-0 bg-black overflow-y-auto flex items-center justify-center bg-opacity-80 hidden\"\n// data-transition-enter=\"transition-all ease-in-out duration-300\"\n// data-transition-enter-from=\"bg-opacity-0\"\n// data-transition-enter-to=\"bg-opacity-80\"\n// data-transition-leave=\"transition-all ease-in-out duration-300\"\n// data-transition-leave-from=\"bg-opacity-80\"\n// data-transition-leave-to=\"bg-opacity-0\"\nexport async function enter(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionEnter || transitionOptions.enter || 'enter'\n const fromClasses =\n element.dataset.transitionEnterFrom || transitionOptions.enterFrom || 'enter-from'\n const toClasses = element.dataset.transitionEnterTo || transitionOptions.enterTo || 'enter-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggleClass || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n element.classList.remove(...toggleClass.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n }\n}\n\nexport async function leave(element, transitionOptions = {}) {\n const transitionClasses = element.dataset.transitionLeave || transitionOptions.leave || 'leave'\n const fromClasses =\n element.dataset.transitionLeaveFrom || transitionOptions.leaveFrom || 'leave-from'\n const toClasses = element.dataset.transitionLeaveTo || transitionOptions.leaveTo || 'leave-to'\n const toggleClass = element.dataset.toggleClass || transitionOptions.toggle || 'hidden'\n\n // Prepare transition\n element.classList.add(...transitionClasses.split(' '))\n element.classList.add(...fromClasses.split(' '))\n element.classList.remove(...toClasses.split(' '))\n\n await nextFrame()\n\n element.classList.remove(...fromClasses.split(' '))\n element.classList.add(...toClasses.split(' '))\n\n try {\n await afterTransition(element)\n } finally {\n element.classList.remove(...transitionClasses.split(' '))\n element.classList.add(...toggleClass.split(' '))\n }\n}\n\nfunction nextFrame() {\n return new Promise(resolve => {\n requestAnimationFrame(() => {\n requestAnimationFrame(resolve)\n })\n })\n}\n\nfunction afterTransition(element) {\n return Promise.all(element.getAnimations().map(animation => animation.finished))\n}\n", "// Form autosave\n//\n// <%= form_with(model: post, data: { controller: \"autosave\", autosave_target: \"form\", action: \"turbo:submit-end->autosave#success turbo:fetch-request-error->autosave#error\" }) do |form| %>\n//
\n// <%= form.label :title %>\n// <%= form.text_field :title, class: 'form-control', data: { action: \"keyup->autosave#save\" } %>\n//
\n//\n//
\n// <% end %>\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['form', 'status']\n static values = {\n submitDuration: {type: Number, default: 1000},\n statusDuration: {type: Number, default: 2000},\n submittingText: {type: String, default: \"Saving...\"},\n successText: {type: String, default: \"Saved!\"},\n errorText: {type: String, default: \"Unable to save.\"}\n }\n\n connect() {\n this.timeout = null\n }\n\n save() {\n clearTimeout(this.timeout)\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = this.submittingTextValue\n this.formTarget.requestSubmit()\n }, this.submitDurationValue)\n }\n\n success() {\n this.setStatus(this.successTextValue)\n }\n\n error() {\n this.setStatus(this.errorTextValue)\n }\n\n setStatus(message) {\n this.statusTarget.textContent = message\n\n this.timeout = setTimeout(() => {\n this.statusTarget.textContent = ''\n }, this.statusDurationValue)\n }\n}\n", "// A color picker preview where you can choose to have the color or backgroundColor\n// get updated based on the result of a color picker. It also supports ensuring\n// the foreground text is always readable by performing a YIQ calculation to\n// set the text to black or white based on the contrast of the color and backgroundColor.\n\nimport { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static targets = ['preview', 'color'];\n static values = {\n style: {type: String, default: \"backgroundColor\"}\n }\n\n update() {\n this.preview = this.colorTarget.value\n }\n\n set preview(color) {\n this.previewTarget.style[this.styleValue] = color\n\n // Ensure the foreground text is always readable by setting either the\n // backgroundColor or color to black or white.\n const yiqColor = this._getContrastYIQ(color)\n\n if (this.styleValue === 'color') {\n this.previewTarget.style.backgroundColor = yiqColor\n } else {\n this.previewTarget.style.color = yiqColor\n }\n }\n\n _getContrastYIQ(hexColor) {\n // Taken from: https://24ways.org/2010/calculating-color-contrast/\n hexColor = hexColor.replace('#', '');\n\n const yiqThreshold = 128;\n const r = parseInt(hexColor.substr(0, 2), 16);\n const g = parseInt(hexColor.substr(2, 2), 16);\n const b = parseInt(hexColor.substr(4, 2), 16);\n const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;\n\n return (yiq >= yiqThreshold) ? '#000' : '#fff';\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = ['menu', 'button', 'menuItem']\n static values = {\n open: { type: Boolean, default: false },\n closeOnEscape: { type: Boolean, default: true },\n closeOnClickOutside: { type: Boolean, default: true }\n }\n static classes = ['enter', 'enterFrom', 'enterTo', 'leave', 'leaveFrom', 'leaveTo', 'toggle']\n\n connect() {\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue, this.transitionOptions)\n\n if (this.openValue === true && this.hasMenuItemTarget) {\n this.menuItemTargets[0].focus()\n }\n }\n\n show() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n // Closes dropdown from outside click or keyboard\n hide(event) {\n // if the event is a click and the target is not inside the dropdown, then close it\n if (\n this.closeOnClickOutsideValue &&\n event.target.nodeType &&\n this.element.contains(event.target) === false &&\n this.openValue\n ) {\n this.openValue = false\n }\n\n // if the event is a keydown and the key is escape, then close it\n if (this.closeOnEscapeValue && event.key === 'Escape' && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.nextIndex].focus()\n }\n\n previousItem(event) {\n event.preventDefault()\n\n this.menuItemTargets[this.previousIndex].focus()\n }\n\n // getters and setters\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n\n get nextIndex() {\n return Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n }\n\n get previousIndex() {\n return Math.max(this.currentItemIndex - 1, 0)\n }\n\n get transitionOptions() {\n // once the Class API default values are available, we can simplify this\n return {\n enter: this.hasEnterClass ? this.enterClass : 'transition ease-out duration-100',\n enterFrom: this.hasEnterFromClass ? this.enterFromClass : 'transform opacity-0 scale-95',\n enterTo: this.hasEnterToClass ? this.enterToClass : 'transform opacity-100 scale-100',\n leave: this.hasLeaveClass ? this.leaveClass : 'transition ease-in duration-75',\n leaveFrom: this.hasLeaveFromClass ? this.leaveFromClass : 'transform opacity-100 scale-100',\n leaveTo: this.hasLeaveToClass ? this.leaveToClass : 'transform opacity-0 scale-95',\n toggleClass: this.hasToggleClass ? this.toggleClass : 'hidden',\n }\n }\n\n // Ensures the menu is hidden before Turbo caches the page\n beforeCache() {\n this.openValue = false\n this.menuTarget.classList.add(\"hidden\")\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n // Allows for a closing animation since display transitions don't work yet\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n // For showing non-modally\n show() {\n this.dialogTarget.show()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "// A simple inline popover to be used wherever needed, with a configurable offset.\n// Visit The Stimulus Handbook for more details\n// https://stimulusjs.org/handbook/introduction\n//\n// This example controller works with specially annotated HTML like:\n//\n//
\n// Beginning in 2015, Google introduced what is called the\n//
popover#mouseOver mouseout->popover#mouseOut\">\n//
'local snack pack', \n//
\n// Terrible name - we know. But the biggest name in SEO came up with it.\n//
\n//
\n// which shows you local search results before normal organic results.\n//\n//\n// You can also toggle the popover using the click action.\n//
popover#toggle\" data-action=\"mouseenter->popover#show mouseleave->popover#hide\">\n\nimport { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['content']\n static values = {\n dismissAfter: Number,\n open: { type: Boolean, default: false }\n }\n\n openValueChanged() {\n transition(this.contentTarget, this.openValue)\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n }\n\n // If already true, extend the dismissal another X seconds since this will not trigger openValueChanged\n show(event) {\n if (this.shouldAutoDismiss) this.scheduleDismissal()\n this.openValue = true\n }\n\n hide() {\n this.openValue = false\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n get shouldAutoDismiss() {\n return (this.openValue && this.hasDismissAfterValue)\n }\n\n scheduleDismissal() {\n if (!this.hasDismissAfterValue) return\n\n // Cancel any existing dismissals\n this.cancelDismissal()\n\n // Schedule the next dismissal\n this.timeoutId = setTimeout(() => {\n this.hide()\n this.timeoutId = undefined\n }, this.dismissAfterValue)\n }\n\n cancelDismissal() {\n if (typeof this.timeoutId === \"number\") {\n clearTimeout(this.timeoutId)\n this.timeoutId = undefined\n }\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from './transition'\n\nexport default class extends Controller {\n static targets = [\"dialog\"]\n static values = {\n open: Boolean\n }\n\n connect() {\n if (this.openValue) this.open()\n document.addEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n disconnect() {\n document.removeEventListener(\"turbo:before-cache\", this.beforeCache.bind(this))\n }\n\n open() {\n this.dialogTarget.showModal()\n }\n\n close() {\n this.dialogTarget.setAttribute(\"closing\", \"\")\n\n Promise.all(\n this.dialogTarget.getAnimations().map((animation) => animation.finished),\n ).then(() => {\n this.dialogTarget.removeAttribute(\"closing\")\n this.dialogTarget.close()\n })\n }\n\n backdropClose(event) {\n if (event.target.nodeName == \"DIALOG\") this.close()\n }\n\n beforeCache() {\n this.close()\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\n\nexport default class extends Controller {\n static classes = [ \"activeTab\", \"inactiveTab\" ]\n static targets = ['tab', 'panel', 'select']\n static values = {\n index: 0,\n updateAnchor: Boolean,\n scrollToAnchor: Boolean,\n scrollActiveTabIntoView: Boolean\n }\n\n initialize() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\n }\n\n connect() {\n this.showTab()\n }\n\n // Changes to the clicked tab\n change(event) {\n if (event.currentTarget.tagName === \"SELECT\") {\n this.indexValue = event.currentTarget.selectedIndex\n\n // If target specifies an index, use that\n } else if (event.currentTarget.dataset.index) {\n this.indexValue = event.currentTarget.dataset.index\n\n // If target specifies an id, use that\n } else if (event.currentTarget.dataset.id) {\n this.indexValue = this.tabTargets.findIndex((tab) => tab.id == event.currentTarget.dataset.id)\n\n // Otherwise, use the index of the current target\n } else {\n this.indexValue = this.tabTargets.indexOf(event.currentTarget)\n }\n\n }\n\n nextTab() {\n this.indexValue = Math.min(this.indexValue + 1, this.tabsCount - 1)\n }\n\n previousTab() {\n this.indexValue = Math.max(this.indexValue - 1, 0)\n }\n\n firstTab() {\n this.indexValue = 0\n }\n\n lastTab() {\n this.indexValue = this.tabsCount - 1\n }\n\n indexValueChanged() {\n this.showTab()\n this.dispatch(\"tab-change\", {\n target: this.tabTargets[this.indexValue],\n detail: {\n activeIndex: this.indexValue\n }\n })\n // Update URL with the tab ID if it has one\n // This will be automatically selected on page load\n if (this.updateAnchorValue) {\n const new_tab_id = this.tabTargets[this.indexValue].id // Grab the id from the newly activated tab\n if (this.scrollToAnchorValue){\n location.hash = new_tab_id // Use location.hash to change the URL with scrolling\n } else {\n const currentUrl = window.location.href // Get the current URL\n const newUrl = currentUrl.split('#')[0] + '#' + new_tab_id // Create a new URL with the updated ID\n history.replaceState({}, document.title, newUrl) // Use history.replaceState to change the URL without scrolling\n }\n }\n }\n\n showTab() {\n this.panelTargets.forEach((panel, index) => {\n const tab = this.tabTargets[index]\n\n if (index === this.indexValue) {\n panel.classList.remove('hidden')\n tab.ariaSelected = 'true'\n tab.dataset.active = true\n if (this.hasInactiveTabClass) tab?.classList?.remove(...this.inactiveTabClasses)\n if (this.hasActiveTabClass) tab?.classList?.add(...this.activeTabClasses)\n } else {\n panel.classList.add('hidden')\n tab.ariaSelected = null\n delete tab.dataset.active\n if (this.hasActiveTabClass) tab?.classList?.remove(...this.activeTabClasses)\n if (this.hasInactiveTabClass) tab?.classList?.add(...this.inactiveTabClasses)\n }\n })\n\n if (this.hasSelectTarget) {\n this.selectTarget.selectedIndex = this.indexValue\n }\n\n if (this.scrollActiveTabIntoViewValue) this.scrollToActiveTab()\n }\n\n // If tabs have horizontal scrolling, the active tab may be out of sight.\n // Make sure the active tab is visible by scrolling it into the view.\n scrollToActiveTab() {\n const activeTab = this.element.querySelector('[aria-selected]')\n if (activeTab) activeTab.scrollIntoView({ inline: 'center', })\n }\n\n get tabsCount() {\n return this.tabTargets.length\n }\n\n get anchor() {\n return (document.URL.split('#').length > 1) ? document.URL.split('#')[1] : null;\n }\n}\n", "import { Controller } from '@hotwired/stimulus'\nimport { transition } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['toggleable']\n static values = {\n open: { type: Boolean, default: false }\n }\n\n toggle(event) {\n this.openValue = !this.openValue\n this.animate()\n }\n\n // Sets open to value of checkbox or radio\n toggleInput(event) {\n this.openValue = event.target.checked\n this.animate()\n }\n\n hide() {\n this.openValue = false\n this.animate()\n }\n\n show() {\n this.openValue = true\n this.animate()\n }\n\n animate() {\n this.toggleableTargets.forEach(target => {\n transition(target, this.openValue)\n })\n }\n}\n"],
+ "mappings": "wKAAA,OAAS,cAAAA,MAAkB,qBCO3B,eAAsBC,EAAWC,EAASC,EAAOC,EAAoB,CAAC,EAAG,CACjED,EACJE,EAAMH,EAASE,CAAiB,EAEhCE,EAAMJ,EAASE,CAAiB,CAEpC,CASA,eAAsBC,EAAMH,EAASE,EAAoB,CAAC,EAAG,CAC3D,IAAMG,EAAoBL,EAAQ,QAAQ,iBAAmBE,EAAkB,OAAS,QAClFI,EACJN,EAAQ,QAAQ,qBAAuBE,EAAkB,WAAa,aAClEK,EAAYP,EAAQ,QAAQ,mBAAqBE,EAAkB,SAAW,WAC9EM,EAAcR,EAAQ,QAAQ,aAAeE,EAAkB,aAAe,SAGpFF,EAAQ,UAAU,IAAI,GAAGK,EAAkB,MAAM,GAAG,CAAC,EACrDL,EAAQ,UAAU,IAAI,GAAGM,EAAY,MAAM,GAAG,CAAC,EAC/CN,EAAQ,UAAU,OAAO,GAAGO,EAAU,MAAM,GAAG,CAAC,EAChDP,EAAQ,UAAU,OAAO,GAAGQ,EAAY,MAAM,GAAG,CAAC,EAElD,MAAMC,EAAU,EAEhBT,EAAQ,UAAU,OAAO,GAAGM,EAAY,MAAM,GAAG,CAAC,EAClDN,EAAQ,UAAU,IAAI,GAAGO,EAAU,MAAM,GAAG,CAAC,EAE7C,GAAI,CACF,MAAMG,EAAgBV,CAAO,CAC/B,QAAE,CACAA,EAAQ,UAAU,OAAO,GAAGK,EAAkB,MAAM,GAAG,CAAC,CAC1D,CACF,CAEA,eAAsBD,EAAMJ,EAASE,EAAoB,CAAC,EAAG,CAC3D,IAAMG,EAAoBL,EAAQ,QAAQ,iBAAmBE,EAAkB,OAAS,QAClFI,EACJN,EAAQ,QAAQ,qBAAuBE,EAAkB,WAAa,aAClEK,EAAYP,EAAQ,QAAQ,mBAAqBE,EAAkB,SA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B,CAEA,IAAI,QAAS,CACX,OAAQ,SAAS,IAAI,MAAM,GAAG,EAAE,OAAS,EAAK,SAAS,IAAI,MAAM,GAAG,EAAE,CAAC,EAAI,IAC7E,CACF,EAnHEC,EADKT,EACE,UAAU,CAAE,YAAa,aAAc,GAC9CS,EAFKT,EAEE,UAAU,CAAC,MAAO,QAAS,QAAQ,GAC1CS,EAHKT,EAGE,SAAS,CACd,MAAO,EACP,aAAc,QACd,eAAgB,QAChB,wBAAyB,OAC3B,GCVF,OAAS,cAAAU,MAAkB,qBAG3B,IAAOC,EAAP,cAA6BC,CAAW,CAMtC,OAAOC,EAAO,CACZ,KAAK,UAAY,CAAC,KAAK,UACvB,KAAK,QAAQ,CACf,CAGA,YAAYA,EAAO,CACjB,KAAK,UAAYA,EAAM,OAAO,QAC9B,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,MAAO,CACL,KAAK,UAAY,GACjB,KAAK,QAAQ,CACf,CAEA,SAAU,CACR,KAAK,kBAAkB,QAAQC,GAAU,CACvCC,EAAWD,EAAQ,KAAK,SAAS,CACnC,CAAC,CACH,CACF,EA/BEE,EADKL,EACE,UAAU,CAAC,YAAY,GAC9BK,EAFKL,EAEE,SAAS,CACd,KAAM,CAAE,KAAM,QAAS,QAAS,EAAM,CACxC",
"names": ["Controller", "transition", "element", "state", "transitionOptions", "enter", "leave", "transitionClasses", "fromClasses", "toClasses", "toggleClass", "nextFrame", "afterTransition", "resolve", "animation", "alert_default", "Controller", "enter", "leave", "__publicField", "Controller", "autosave_default", "Controller", "message", "__publicField", "Controller", "color_preview_default", "Controller", "color", "yiqColor", "hexColor", "yiqThreshold", "r", "g", "b", "__publicField", "Controller", "dropdown_default", "Controller", "transition", "event", "__publicField", "Controller", "modal_default", "Controller", "animation", "event", "__publicField", "Controller", "popover_default", "Controller", "transition", "event", "__publicField", "Controller", "slideover_default", "Controller", "animation", "event", "__publicField", "Controller", "tabs_default", "Controller", "tab", "event", "new_tab_id", "newUrl", "panel", "index", "activeTab", "__publicField", "Controller", "toggle_default", "Controller", "event", "target", "transition", "__publicField"]
}
diff --git a/docs/alert.md b/docs/alert.md
index e9a76dd..c4cc88a 100644
--- a/docs/alert.md
+++ b/docs/alert.md
@@ -54,5 +54,4 @@ Alerts are set up to slide into view from the top-right side of the screen. Clic
## Options
- `data-alert-dismiss-after-value` can be provided to make the alert dimiss after x miliseconds. Default is `undefined`.
-- `data-alert-show-delay-value` can be set to tell the alert to show itself after x miliseconds. Defaults to `0` miliseconds.
-- `data-alert-remove-delay-value` can be set to tell the alert to hide itself after x milisconds. Defaults to `1100` miliseconds.
\ No newline at end of file
+- `data-alert-show-delay-value` can be set to tell the alert to show itself after x miliseconds. Defaults to `0` miliseconds.
\ No newline at end of file
diff --git a/src/alert.js b/src/alert.js
index 27595c9..02d501e 100644
--- a/src/alert.js
+++ b/src/alert.js
@@ -5,7 +5,6 @@ export default class extends Controller {
static values = {
dismissAfter: Number,
showDelay: { type: Number, default: 0 },
- removeDelay: { type: Number, default: 0 }
}
connect() {
@@ -24,9 +23,7 @@ export default class extends Controller {
// Runs hide animation and then removes element from the page
close() {
leave(this.element).then(() => {
- setTimeout(() => {
- this.element.remove()
- }, this.removeDelayValue)
+ this.element.remove()
})
}
}
diff --git a/test/alert_test.js b/test/alert_test.js
index 59d0dc9..7a1c19a 100644
--- a/test/alert_test.js
+++ b/test/alert_test.js
@@ -46,20 +46,4 @@ describe('AlertController', () => {
expect(fetchElement()).to.equal(null)
})
})
-
- describe('with remove delay value', () => {
- it('removes after 1000ms', async () => {
- await loadFixture('alerts/alert_remove_delay.html')
- expect(fetchElement().className.includes("hidden")).to.equal(false)
-
- const closeButton = document.querySelector("[data-action='alert#close']")
- closeButton.click()
-
- await aTimeout(100)
- expect(fetchElement().className.includes("hidden")).to.equal(true)
-
- await aTimeout(1100)
- expect(fetchElement()).to.equal(null)
- })
- })
})
diff --git a/test/fixtures/alerts/alert_remove_delay.html b/test/fixtures/alerts/alert_remove_delay.html
deleted file mode 100644
index 1215a54..0000000
--- a/test/fixtures/alerts/alert_remove_delay.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
Stimulus is the JS of the future!
-
Close
-
-
\ No newline at end of file