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 Dropdown from './dropdown.js'\nimport { transition } from './transition'\n\nexport default class extends Dropdown {\n static targets = ['menu', 'overlay', 'close']\n\n openValueChanged() {\n transition(this.overlayTarget, this.openValue)\n transition(this.menuTarget, this.openValue)\n if (this.hasCloseTarget) transition(this.closeTarget, this.openValue)\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 }\n\n connect() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\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 window.dispatchEvent(new CustomEvent('tsc:tab-change'))\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\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 location.hash = this.tabTargets[this.indexValue].id\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 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 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\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\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,MAAO,QAAS,QAAQ,GAC1CK,EAHKL,EAGE,SAAS,CACd,MAAO,EACP,aAAc,OAChB,GCRF,IAAAM,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", "enter", "leave", "transitionClasses", "fromClasses", "toClasses", "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", "nextIndex", "previousIndex", "__publicField", "import_stimulus", "modal_default", "event", "enter", "leave", "scrollbarWidth", "__publicField", "import_stimulus", "popover_default", "transition", "event", "__publicField", "slideover_default", "dropdown_default", "transition", "__publicField", "import_stimulus", "tabs_default", "tab", "event", "panel", "index", "__publicField", "import_stimulus", "toggle_default", "event", "target", "transition", "__publicField"]
+ "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 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) {\n if (!!state) {\n enter(element)\n } else {\n leave(element)\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) {\n const transitionClasses = element.dataset.transitionEnter || \"enter\"\n const fromClasses = element.dataset.transitionEnterFrom || \"enter-from\"\n const toClasses = element.dataset.transitionEnterTo || \"enter-to\"\n const toggleClass = element.dataset.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) {\n const transitionClasses = element.dataset.transitionLeave || \"leave\"\n const fromClasses = element.dataset.transitionLeaveFrom || \"leave-from\"\n const toClasses = element.dataset.transitionLeaveTo || \"leave-to\"\n const toggleClass = element.dataset.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\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 = { open: Boolean, default: false }\n\n connect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.addEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.setAttribute(\"aria-haspopup\", \"true\")\n }\n }\n\n disconnect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.removeEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.removeAttribute(\"aria-haspopup\")\n }\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue)\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 hide(event) {\n if (event.target.nodeType && this.element.contains(event.target) === false && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem() {\n const nextIndex = Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n this.menuItemTargets[nextIndex].focus()\n }\n\n previousItem() {\n const previousIndex = Math.max(this.currentItemIndex - 1, 0)\n this.menuItemTargets[previousIndex].focus()\n }\n\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['container', 'background']\n static values = {\n open: { type: Boolean, default: false },\n restoreScroll: { type: Boolean, default: true }\n }\n\n disconnect() {\n this.close()\n }\n\n open() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n closeBackground(event) {\n if (event.target === this.backgroundTarget) this.close()\n }\n\n async openValueChanged() {\n if (this.openValue) {\n this.containerTarget.focus()\n this.lockScroll()\n enter(this.backgroundTarget)\n enter(this.containerTarget)\n } else {\n leave(this.containerTarget)\n await leave(this.backgroundTarget)\n this.unlockScroll()\n }\n }\n\n lockScroll() {\n // Save the scroll position before we hide the scrollbar\n if (this.restoreScrollValue) {\n this.saveScrollPosition()\n // Add negative top position in order for body to stay in place\n document.body.style.top = `-${this.scrollPosition}px`\n }\n\n // Add right padding to the body so the page doesn't shift\n // when we disable scrolling\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n document.body.style.paddingRight = `${scrollbarWidth}px`\n\n // Add classes to body to fix its position\n document.body.classList.add('fixed', 'inset-x-0', 'overflow-hidden')\n }\n\n unlockScroll() {\n // Remove tweaks for scrollbar\n document.body.style.paddingRight = null;\n\n // Remove classes from body to unfix position\n document.body.classList.remove('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Restore the scroll position of the body before it got locked\n if (this.restoreScrollValue) {\n this.restoreScrollPosition()\n\n // Remove the negative top inline style from body\n document.body.style.top = null\n }\n }\n\n saveScrollPosition() {\n this.scrollPosition = window.pageYOffset || document.body.scrollTop\n }\n\n restoreScrollPosition() {\n if (this.scrollPosition === undefined) return\n document.documentElement.scrollTop = this.scrollPosition\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 Dropdown from './dropdown.js'\nimport { transition } from './transition'\n\nexport default class extends Dropdown {\n static targets = ['menu', 'overlay', 'close']\n\n openValueChanged() {\n transition(this.overlayTarget, this.openValue)\n transition(this.menuTarget, this.openValue)\n if (this.hasCloseTarget) transition(this.closeTarget, this.openValue)\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 }\n\n connect() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\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 window.dispatchEvent(new CustomEvent('tsc:tab-change'))\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\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 location.hash = this.tabTargets[this.indexValue].id\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 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 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\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,EAAO,CACzCA,EACJC,EAAMF,CAAO,EAEbG,EAAMH,CAAO,CAEjB,CASA,eAAsBE,EAAMF,EAAS,CACnC,IAAMI,EAAoBJ,EAAQ,QAAQ,iBAAmB,QACvDK,EAAcL,EAAQ,QAAQ,qBAAuB,aACrDM,EAAYN,EAAQ,QAAQ,mBAAqB,WACjDO,EAAcP,EAAQ,QAAQ,aAAe,SAGnDA,EAAQ,UAAU,IAAI,GAAGI,EAAkB,MAAM,GAAG,CAAC,EACrDJ,EAAQ,UAAU,IAAI,GAAGK,EAAY,MAAM,GAAG,CAAC,EAC/CL,EAAQ,UAAU,OAAO,GAAGM,EAAU,MAAM,GAAG,CAAC,EAChDN,EAAQ,UAAU,OAAO,GAAGO,EAAY,MAAM,GAAG,CAAC,EAElD,MAAMC,EAAU,EAEhBR,EAAQ,UAAU,OAAO,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AAW,IAAI,GAAG,KAAK,gBAAgB,IAExEE,EAAM,UAAU,IAAI,QAAQ,EACxB,KAAK,mBAAmBF,GAAK,WAAW,OAAO,GAAG,KAAK,gBAAgB,EACvE,KAAK,qBAAqBA,GAAK,WAAW,IAAI,GAAG,KAAK,kBAAkB,EAEhF,CAAC,EAEG,KAAK,kBACP,KAAK,aAAa,cAAgB,KAAK,WAE3C,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,EAtFEI,EADKL,EACE,UAAU,CAAE,YAAa,aAAc,GAC9CK,EAFKL,EAEE,UAAU,CAAC,MAAO,QAAS,QAAQ,GAC1CK,EAHKL,EAGE,SAAS,CACd,MAAO,EACP,aAAc,OAChB,GCRF,IAAAM,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", "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", "nextIndex", "previousIndex", "__publicField", "import_stimulus", "modal_default", "event", "enter", "leave", "scrollbarWidth", "__publicField", "import_stimulus", "popover_default", "transition", "event", "__publicField", "slideover_default", "dropdown_default", "transition", "__publicField", "import_stimulus", "tabs_default", "tab", "event", "panel", "index", "__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 361e036..5433a96 100644
--- a/dist/tailwindcss-stimulus-components.module.js
+++ b/dist/tailwindcss-stimulus-components.module.js
@@ -1 +1 @@
-var v=Object.defineProperty;var V=(t,e,i)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var s=(t,e,i)=>(V(t,typeof e!="symbol"?e+"":e,i),i);import{Controller as y}from"@hotwired/stimulus";async function a(t,e){e?n(t):l(t)}async function n(t){let e=t.dataset.transitionEnter||"enter",i=t.dataset.transitionEnterFrom||"enter-from",o=t.dataset.transitionEnterTo||"enter-to";t.classList.add(...e.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),t.classList.remove("hidden"),await T(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...e.split(" "))}}async function l(t){let e=t.dataset.transitionLeave||"leave",i=t.dataset.transitionLeaveFrom||"leave-from",o=t.dataset.transitionLeaveTo||"leave-to";t.classList.add(...e.split(" ")),t.classList.add(...i.split(" ")),t.classList.remove(...o.split(" ")),await T(),t.classList.remove(...i.split(" ")),t.classList.add(...o.split(" "));try{await x(t)}finally{t.classList.remove(...e.split(" ")),t.classList.add("hidden")}}function T(){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(()=>{n(this.element)},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){l(this.element).then(()=>{this.element.remove()})}};s(p,"values",{dismissAfter:Number,showDelay:{type:Number,default:0},removeDelay:{type:Number,default:1100}});import{Controller as C}from"@hotwired/stimulus";var h=class extends C{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 w}from"@hotwired/stimulus";var d=class extends w{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,i=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),b=parseInt(t.substr(4,2),16);return(i*299+o*587+b*114)/1e3>=e?"#000":"#fff"}};s(d,"targets",["preview","color"]),s(d,"values",{style:{type:String,default:"backgroundColor"}});import{Controller as I}from"@hotwired/stimulus";var r=class extends I{connect(){this.hasButtonTarget&&(this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.buttonTarget.setAttribute("aria-haspopup","true"))}disconnect(){this.hasButtonTarget&&(this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown),this.buttonTarget.removeAttribute("aria-haspopup"))}openValueChanged(){a(this.menuTarget,this.openValue),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}hide(t){t.target.nodeType&&this.element.contains(t.target)===!1&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(){let t=Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1);this.menuItemTargets[t].focus()}previousItem(){let t=Math.max(this.currentItemIndex-1,0);this.menuItemTargets[t].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}};s(r,"targets",["menu","button","menuItem"]),s(r,"values",{open:Boolean,default:!1});import{Controller as L}from"@hotwired/stimulus";var c=class extends L{disconnect(){this.close()}open(){this.openValue=!0}close(){this.openValue=!1}closeBackground(t){t.target===this.backgroundTarget&&this.close()}async openValueChanged(){this.openValue?(this.containerTarget.focus(),this.lockScroll(),n(this.backgroundTarget),n(this.containerTarget)):(l(this.containerTarget),await l(this.backgroundTarget),this.unlockScroll())}lockScroll(){this.restoreScrollValue&&(this.saveScrollPosition(),document.body.style.top=`-${this.scrollPosition}px`);let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${t}px`,document.body.classList.add("fixed","inset-x-0","overflow-hidden")}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&(this.restoreScrollPosition(),document.body.style.top=null)}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};s(c,"targets",["container","background"]),s(c,"values",{open:{type:Boolean,default:!1},restoreScroll:{type:Boolean,default:!0}});import{Controller as S}from"@hotwired/stimulus";var m=class extends S{openValueChanged(){a(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(m,"targets",["content"]),s(m,"values",{dismissAfter:Number,open:{type:Boolean,default:!1}});var g=class extends r{openValueChanged(){a(this.overlayTarget,this.openValue),a(this.menuTarget,this.openValue),this.hasCloseTarget&&a(this.closeTarget,this.openValue)}};s(g,"targets",["menu","overlay","close"]);import{Controller as A}from"@hotwired/stimulus";var u=class extends A{connect(){this.anchor&&(this.indexValue=this.tabTargets.findIndex(t=>t.id===this.anchor)),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),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}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(){this.showTab(),this.updateAnchorValue&&(location.hash=this.tabTargets[this.indexValue].id)}showTab(){this.panelTargets.forEach((t,e)=>{let i=this.tabTargets[e];e===this.indexValue?(t.classList.remove("hidden"),this.hasInactiveTabClass&&i?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&i?.classList?.add(...this.activeTabClasses)):(t.classList.add("hidden"),this.hasActiveTabClass&&i?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&i?.classList?.add(...this.inactiveTabClasses))}),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue)}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};s(u,"classes",["activeTab","inactiveTab"]),s(u,"targets",["tab","panel","select"]),s(u,"values",{index:0,updateAnchor:Boolean});import{Controller as D}from"@hotwired/stimulus";var f=class extends D{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=>{a(t,this.openValue)})}};s(f,"targets",["toggleable"]),s(f,"values",{open:{type:Boolean,default:!1}});export{p as Alert,h as Autosave,d as ColorPreview,r as Dropdown,c as Modal,m as Popover,g as Slideover,u as Tabs,f as Toggle};
+var v=Object.defineProperty;var V=(t,e,a)=>e in t?v(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 i(t,e){e?n(t):l(t)}async function n(t){let e=t.dataset.transitionEnter||"enter",a=t.dataset.transitionEnterFrom||"enter-from",o=t.dataset.transitionEnterTo||"enter-to",h=t.dataset.toggleClass||"hidden";t.classList.add(...e.split(" ")),t.classList.add(...a.split(" ")),t.classList.remove(...o.split(" ")),t.classList.remove(...h.split(" ")),await x(),t.classList.remove(...a.split(" ")),t.classList.add(...o.split(" "));try{await b(t)}finally{t.classList.remove(...e.split(" "))}}async function l(t){let e=t.dataset.transitionLeave||"leave",a=t.dataset.transitionLeaveFrom||"leave-from",o=t.dataset.transitionLeaveTo||"leave-to",h=t.dataset.toggleClass||"hidden";t.classList.add(...e.split(" ")),t.classList.add(...a.split(" ")),t.classList.remove(...o.split(" ")),await x(),t.classList.remove(...a.split(" ")),t.classList.add(...o.split(" "));try{await b(t)}finally{t.classList.remove(...e.split(" ")),t.classList.add(...h.split(" "))}}function x(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function b(t){return Promise.all(t.getAnimations().map(e=>e.finished))}var g=class extends y{connect(){setTimeout(()=>{n(this.element)},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){l(this.element).then(()=>{this.element.remove()})}};s(g,"values",{dismissAfter:Number,showDelay:{type:Number,default:0},removeDelay:{type:Number,default:1100}});import{Controller as C}from"@hotwired/stimulus";var d=class extends C{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(d,"targets",["form","status"]),s(d,"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 w}from"@hotwired/stimulus";var c=class extends w{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),o=parseInt(t.substr(2,2),16),h=parseInt(t.substr(4,2),16);return(a*299+o*587+h*114)/1e3>=e?"#000":"#fff"}};s(c,"targets",["preview","color"]),s(c,"values",{style:{type:String,default:"backgroundColor"}});import{Controller as I}from"@hotwired/stimulus";var r=class extends I{connect(){this.hasButtonTarget&&(this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.buttonTarget.setAttribute("aria-haspopup","true"))}disconnect(){this.hasButtonTarget&&(this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown),this.buttonTarget.removeAttribute("aria-haspopup"))}openValueChanged(){i(this.menuTarget,this.openValue),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}hide(t){t.target.nodeType&&this.element.contains(t.target)===!1&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(){let t=Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1);this.menuItemTargets[t].focus()}previousItem(){let t=Math.max(this.currentItemIndex-1,0);this.menuItemTargets[t].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}};s(r,"targets",["menu","button","menuItem"]),s(r,"values",{open:Boolean,default:!1});import{Controller as L}from"@hotwired/stimulus";var m=class extends L{disconnect(){this.close()}open(){this.openValue=!0}close(){this.openValue=!1}closeBackground(t){t.target===this.backgroundTarget&&this.close()}async openValueChanged(){this.openValue?(this.containerTarget.focus(),this.lockScroll(),n(this.backgroundTarget),n(this.containerTarget)):(l(this.containerTarget),await l(this.backgroundTarget),this.unlockScroll())}lockScroll(){this.restoreScrollValue&&(this.saveScrollPosition(),document.body.style.top=`-${this.scrollPosition}px`);let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${t}px`,document.body.classList.add("fixed","inset-x-0","overflow-hidden")}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&(this.restoreScrollPosition(),document.body.style.top=null)}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};s(m,"targets",["container","background"]),s(m,"values",{open:{type:Boolean,default:!1},restoreScroll:{type:Boolean,default:!0}});import{Controller as S}from"@hotwired/stimulus";var f=class extends S{openValueChanged(){i(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(f,"targets",["content"]),s(f,"values",{dismissAfter:Number,open:{type:Boolean,default:!1}});var T=class extends r{openValueChanged(){i(this.overlayTarget,this.openValue),i(this.menuTarget,this.openValue),this.hasCloseTarget&&i(this.closeTarget,this.openValue)}};s(T,"targets",["menu","overlay","close"]);import{Controller as A}from"@hotwired/stimulus";var u=class extends A{connect(){this.anchor&&(this.indexValue=this.tabTargets.findIndex(t=>t.id===this.anchor)),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),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}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(){this.showTab(),this.updateAnchorValue&&(location.hash=this.tabTargets[this.indexValue].id)}showTab(){this.panelTargets.forEach((t,e)=>{let a=this.tabTargets[e];e===this.indexValue?(t.classList.remove("hidden"),this.hasInactiveTabClass&&a?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&a?.classList?.add(...this.activeTabClasses)):(t.classList.add("hidden"),this.hasActiveTabClass&&a?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&a?.classList?.add(...this.inactiveTabClasses))}),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue)}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};s(u,"classes",["activeTab","inactiveTab"]),s(u,"targets",["tab","panel","select"]),s(u,"values",{index:0,updateAnchor:Boolean});import{Controller as D}from"@hotwired/stimulus";var p=class extends D{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=>{i(t,this.openValue)})}};s(p,"targets",["toggleable"]),s(p,"values",{open:{type:Boolean,default:!1}});export{g as Alert,d as Autosave,c as ColorPreview,r as Dropdown,m as Modal,f as Popover,T as Slideover,u as Tabs,p as Toggle};
diff --git a/dist/tailwindcss-stimulus-components.module.js.map b/dist/tailwindcss-stimulus-components.module.js.map
index 726ca77..c90f7ae 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) {\n if (!!state) {\n enter(element)\n } else {\n leave(element)\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) {\n const transitionClasses = element.dataset.transitionEnter || \"enter\"\n const fromClasses = element.dataset.transitionEnterFrom || \"enter-from\"\n const toClasses = element.dataset.transitionEnterTo || \"enter-to\"\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(\"hidden\")\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) {\n const transitionClasses = element.dataset.transitionLeave || \"leave\"\n const fromClasses = element.dataset.transitionLeaveFrom || \"leave-from\"\n const toClasses = element.dataset.transitionLeaveTo || \"leave-to\"\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(\"hidden\")\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 = { open: Boolean, default: false }\n\n connect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.addEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.setAttribute(\"aria-haspopup\", \"true\")\n }\n }\n\n disconnect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.removeEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.removeAttribute(\"aria-haspopup\")\n }\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue)\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 hide(event) {\n if (event.target.nodeType && this.element.contains(event.target) === false && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem() {\n const nextIndex = Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n this.menuItemTargets[nextIndex].focus()\n }\n\n previousItem() {\n const previousIndex = Math.max(this.currentItemIndex - 1, 0)\n this.menuItemTargets[previousIndex].focus()\n }\n\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['container', 'background']\n static values = {\n open: { type: Boolean, default: false },\n restoreScroll: { type: Boolean, default: true }\n }\n\n disconnect() {\n this.close()\n }\n\n open() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n closeBackground(event) {\n if (event.target === this.backgroundTarget) this.close()\n }\n\n async openValueChanged() {\n if (this.openValue) {\n this.containerTarget.focus()\n this.lockScroll()\n enter(this.backgroundTarget)\n enter(this.containerTarget)\n } else {\n leave(this.containerTarget)\n await leave(this.backgroundTarget)\n this.unlockScroll()\n }\n }\n\n lockScroll() {\n // Save the scroll position before we hide the scrollbar\n if (this.restoreScrollValue) {\n this.saveScrollPosition()\n // Add negative top position in order for body to stay in place\n document.body.style.top = `-${this.scrollPosition}px`\n }\n\n // Add right padding to the body so the page doesn't shift\n // when we disable scrolling\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n document.body.style.paddingRight = `${scrollbarWidth}px`\n\n // Add classes to body to fix its position\n document.body.classList.add('fixed', 'inset-x-0', 'overflow-hidden')\n }\n\n unlockScroll() {\n // Remove tweaks for scrollbar\n document.body.style.paddingRight = null;\n\n // Remove classes from body to unfix position\n document.body.classList.remove('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Restore the scroll position of the body before it got locked\n if (this.restoreScrollValue) {\n this.restoreScrollPosition()\n\n // Remove the negative top inline style from body\n document.body.style.top = null\n }\n }\n\n saveScrollPosition() {\n this.scrollPosition = window.pageYOffset || document.body.scrollTop\n }\n\n restoreScrollPosition() {\n if (this.scrollPosition === undefined) return\n document.documentElement.scrollTop = this.scrollPosition\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 Dropdown from './dropdown.js'\nimport { transition } from './transition'\n\nexport default class extends Dropdown {\n static targets = ['menu', 'overlay', 'close']\n\n openValueChanged() {\n transition(this.overlayTarget, this.openValue)\n transition(this.menuTarget, this.openValue)\n if (this.hasCloseTarget) transition(this.closeTarget, this.openValue)\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 }\n\n connect() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\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 window.dispatchEvent(new CustomEvent('tsc:tab-change'))\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\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 location.hash = this.tabTargets[this.indexValue].id\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 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 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\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,EAAO,CACzCA,EACJC,EAAMF,CAAO,EAEbG,EAAMH,CAAO,CAEjB,CASA,eAAsBE,EAAMF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K,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", "enter", "leave", "transitionClasses", "fromClasses", "toClasses", "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", "__publicField", "Controller", "dropdown_default", "Controller", "transition", "event", "nextIndex", "previousIndex", "__publicField", "Controller", "modal_default", "Controller", "event", "enter", "leave", "scrollbarWidth", "__publicField", "Controller", "popover_default", "Controller", "transition", "event", "__publicField", "slideover_default", "dropdown_default", "transition", "__publicField", "Controller", "tabs_default", "Controller", "tab", "event", "panel", "index", "__publicField", "Controller", "toggle_default", "Controller", "event", "target", "transition", "__publicField"]
+ "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) {\n if (!!state) {\n enter(element)\n } else {\n leave(element)\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) {\n const transitionClasses = element.dataset.transitionEnter || \"enter\"\n const fromClasses = element.dataset.transitionEnterFrom || \"enter-from\"\n const toClasses = element.dataset.transitionEnterTo || \"enter-to\"\n const toggleClass = element.dataset.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) {\n const transitionClasses = element.dataset.transitionLeave || \"leave\"\n const fromClasses = element.dataset.transitionLeaveFrom || \"leave-from\"\n const toClasses = element.dataset.transitionLeaveTo || \"leave-to\"\n const toggleClass = element.dataset.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\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 = { open: Boolean, default: false }\n\n connect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.addEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.setAttribute(\"aria-haspopup\", \"true\")\n }\n }\n\n disconnect() {\n if (this.hasButtonTarget) {\n this.buttonTarget.removeEventListener(\"keydown\", this._onMenuButtonKeydown)\n this.buttonTarget.removeAttribute(\"aria-haspopup\")\n }\n }\n\n openValueChanged() {\n transition(this.menuTarget, this.openValue)\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 hide(event) {\n if (event.target.nodeType && this.element.contains(event.target) === false && this.openValue) {\n this.openValue = false\n }\n }\n\n toggle() {\n this.openValue = !this.openValue\n }\n\n nextItem() {\n const nextIndex = Math.min(this.currentItemIndex + 1, this.menuItemTargets.length - 1)\n this.menuItemTargets[nextIndex].focus()\n }\n\n previousItem() {\n const previousIndex = Math.max(this.currentItemIndex - 1, 0)\n this.menuItemTargets[previousIndex].focus()\n }\n\n get currentItemIndex() {\n return this.menuItemTargets.indexOf(document.activeElement)\n }\n}\n", "import { Controller } from \"@hotwired/stimulus\"\nimport { enter, leave } from \"./transition\"\n\nexport default class extends Controller {\n static targets = ['container', 'background']\n static values = {\n open: { type: Boolean, default: false },\n restoreScroll: { type: Boolean, default: true }\n }\n\n disconnect() {\n this.close()\n }\n\n open() {\n this.openValue = true\n }\n\n close() {\n this.openValue = false\n }\n\n closeBackground(event) {\n if (event.target === this.backgroundTarget) this.close()\n }\n\n async openValueChanged() {\n if (this.openValue) {\n this.containerTarget.focus()\n this.lockScroll()\n enter(this.backgroundTarget)\n enter(this.containerTarget)\n } else {\n leave(this.containerTarget)\n await leave(this.backgroundTarget)\n this.unlockScroll()\n }\n }\n\n lockScroll() {\n // Save the scroll position before we hide the scrollbar\n if (this.restoreScrollValue) {\n this.saveScrollPosition()\n // Add negative top position in order for body to stay in place\n document.body.style.top = `-${this.scrollPosition}px`\n }\n\n // Add right padding to the body so the page doesn't shift\n // when we disable scrolling\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n document.body.style.paddingRight = `${scrollbarWidth}px`\n\n // Add classes to body to fix its position\n document.body.classList.add('fixed', 'inset-x-0', 'overflow-hidden')\n }\n\n unlockScroll() {\n // Remove tweaks for scrollbar\n document.body.style.paddingRight = null;\n\n // Remove classes from body to unfix position\n document.body.classList.remove('fixed', 'inset-x-0', 'overflow-hidden')\n\n // Restore the scroll position of the body before it got locked\n if (this.restoreScrollValue) {\n this.restoreScrollPosition()\n\n // Remove the negative top inline style from body\n document.body.style.top = null\n }\n }\n\n saveScrollPosition() {\n this.scrollPosition = window.pageYOffset || document.body.scrollTop\n }\n\n restoreScrollPosition() {\n if (this.scrollPosition === undefined) return\n document.documentElement.scrollTop = this.scrollPosition\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 Dropdown from './dropdown.js'\nimport { transition } from './transition'\n\nexport default class extends Dropdown {\n static targets = ['menu', 'overlay', 'close']\n\n openValueChanged() {\n transition(this.overlayTarget, this.openValue)\n transition(this.menuTarget, this.openValue)\n if (this.hasCloseTarget) transition(this.closeTarget, this.openValue)\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 }\n\n connect() {\n if (this.anchor) this.indexValue = this.tabTargets.findIndex((tab) => tab.id === this.anchor)\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 window.dispatchEvent(new CustomEvent('tsc:tab-change'))\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\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 location.hash = this.tabTargets[this.indexValue].id\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 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 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\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,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AAW,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", "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", "nextIndex", "previousIndex", "__publicField", "Controller", "modal_default", "Controller", "event", "enter", "leave", "scrollbarWidth", "__publicField", "Controller", "popover_default", "Controller", "transition", "event", "__publicField", "slideover_default", "dropdown_default", "transition", "__publicField", "Controller", "tabs_default", "Controller", "tab", "event", "panel", "index", "__publicField", "Controller", "toggle_default", "Controller", "event", "target", "transition", "__publicField"]
}
diff --git a/docs/modal.md b/docs/modal.md
index 11dba06..9663e16 100644
--- a/docs/modal.md
+++ b/docs/modal.md
@@ -11,7 +11,7 @@ application.register('modal', Modal)
```html
-
Open Modal
+
Open Modal
Beginning in 2015, Google introduced what is called the
-
+
'local snack pack',
Terrible name - we know. But the biggest name in SEO came up with it.
diff --git a/docs/toggle.md b/docs/toggle.md
index 922b756..3f50dca 100644
--- a/docs/toggle.md
+++ b/docs/toggle.md
@@ -23,11 +23,11 @@ application.register('toggle', Toggle)
In this example, clicking the question will toggle the hidden class. The hidden class is the default. If you wish to use a different class, you can use the `data-toggle-class="custom-class"` attribute.
```html
-
+
What is the question?
-
@@ -48,4 +48,4 @@ while this only shows it
What is the question?
-```
\ No newline at end of file
+```
diff --git a/index.html b/index.html
index bd137ba..5628fb5 100644
--- a/index.html
+++ b/index.html
@@ -279,7 +279,7 @@
Radios as Tabs
-
Toggle
+
Toggle
Toggle button
@@ -296,26 +296,38 @@ Toggle
This is hidden text...
-
-
+
+
+ Toggle button with custom classes
+
+
+
This is toggleable text...
+
+
+
+
+
Color Picker and Preview
diff --git a/package-lock.json b/package-lock.json
index 36afd60..1fb4e5a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "tailwindcss-stimulus-components",
- "version": "4.0.0",
+ "version": "4.0.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tailwindcss-stimulus-components",
- "version": "4.0.0",
+ "version": "4.0.4",
"license": "MIT",
"devDependencies": {
"@open-wc/testing": "^3.2.0",
diff --git a/src/transition.js b/src/transition.js
index d7b6647..fa2a24b 100644
--- a/src/transition.js
+++ b/src/transition.js
@@ -24,12 +24,13 @@ export async function enter(element) {
const transitionClasses = element.dataset.transitionEnter || "enter"
const fromClasses = element.dataset.transitionEnterFrom || "enter-from"
const toClasses = element.dataset.transitionEnterTo || "enter-to"
+ const toggleClass = element.dataset.toggleClass || "hidden"
// Prepare transition
element.classList.add(...transitionClasses.split(" "))
element.classList.add(...fromClasses.split(" "))
element.classList.remove(...toClasses.split(" "))
- element.classList.remove("hidden")
+ element.classList.remove(...toggleClass.split(" "))
await nextFrame()
@@ -47,6 +48,7 @@ export async function leave(element) {
const transitionClasses = element.dataset.transitionLeave || "leave"
const fromClasses = element.dataset.transitionLeaveFrom || "leave-from"
const toClasses = element.dataset.transitionLeaveTo || "leave-to"
+ const toggleClass = element.dataset.toggleClass || "hidden"
// Prepare transition
element.classList.add(...transitionClasses.split(" "))
@@ -62,7 +64,7 @@ export async function leave(element) {
await afterTransition(element)
} finally {
element.classList.remove(...transitionClasses.split(" "))
- element.classList.add("hidden")
+ element.classList.add(...toggleClass.split(" "))
}
}
diff --git a/test/toggle_test.js b/test/toggle_test.js
index 7a41f39..940ed16 100644
--- a/test/toggle_test.js
+++ b/test/toggle_test.js
@@ -40,4 +40,55 @@ describe('ToggleController', () => {
expect(target.className.includes('hidden')).to.equal(false)
})
})
+
+ describe('#toggle with custom class', () => {
+ beforeEach(async () => {
+ await fixture(html`
+
+
+ What is the question?
+
+
+
+ `)
+
+ const application = Application.start()
+ application.register('toggle', Toggle)
+ })
+
+ it('removes class1 and class2', async () => {
+ const action = document.querySelector('#toggleAction')
+ const target = document.querySelector('#toggleTarget')
+
+ action.click()
+
+ await nextFrame()
+ expect(target.className.includes('class1')).to.equal(false)
+ expect(target.className.includes('class2')).to.equal(false)
+ }),
+ it('re-adds class1 and class2', async () => {
+ const action = document.querySelector('#toggleAction')
+ const target = document.querySelector('#toggleTarget')
+
+ action.click()
+ await nextFrame()
+ action.click()
+ await nextFrame()
+
+ expect(target.className.includes('class1')).to.equal(true)
+ expect(target.className.includes('class2')).to.equal(true)
+ })
+ })
})