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.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui-14.11.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb
playbook_ui_docs-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb