Sha256: 9a1fddefa9a168c72eff44d784db787969f7ee3806d3a48df15ca64c03ba5326

Contents?: true

Size: 1.06 KB

Versions: 2087

Compression:

Stored size: 1.06 KB

Contents

<%= pb_rails("date_picker", props: {
  label: "onChange",
  picker_id: "date-picker-hooks-onchange"
}) %>

<%= javascript_tag do %>
  window.addEventListener("DOMContentLoaded", () => {
    <%# Access flatpickr instance with picker id and assign it a variable %>
    const fp = document.querySelector("#date-picker-hooks-onchange")._flatpickr

    <%# Define Hook %>
    const changeHook = () => {
      alert('date changed')
    }
    <%# Push one or more hooks to onChange config array %>
    fp.config.onChange.push(changeHook)
  })
<% end %>

<%= pb_rails("date_picker", props: {
  label: "onOpen",
  picker_id: "date-picker-hooks-onopen"
}) %>

<%= javascript_tag do %>
  window.addEventListener("DOMContentLoaded", () => {
    <%# Access flatpickr instance with picker id and assign it a variable %>
    const fp = document.querySelector("#date-picker-hooks-onopen")._flatpickr

    <%# Define Hook %>
    const openHook = () => {
      alert('calendar opened')
    }
    <%# Push one or more hooks to onOpen config array %>
    fp.config.onOpen.push(openHook)
  })
<% end %>

Version data entries

2,087 entries across 2,087 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb