primevue 3.41.0 → 3.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/AutoComplete.d.ts +2 -2
- package/autocomplete/BaseAutoComplete.vue +2 -2
- package/autocomplete/autocomplete.cjs.js +2 -2
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +2 -2
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +2 -2
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +2 -2
- package/avatar/BaseAvatar.vue +2 -2
- package/avatar/avatar.cjs.js +2 -2
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -2
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -2
- package/avatar/avatar.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +2 -2
- package/button/BaseButton.vue +4 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.vue +1 -1
- package/button/button.cjs.js +6 -1
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +6 -1
- package/button/button.esm.min.js +1 -1
- package/button/button.js +6 -1
- package/button/button.min.js +1 -1
- package/calendar/BaseCalendar.vue +6 -2
- package/calendar/Calendar.d.ts +39 -2
- package/calendar/Calendar.vue +40 -11
- package/calendar/calendar.cjs.js +70 -30
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +70 -30
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +70 -30
- package/calendar/calendar.min.js +1 -1
- package/calendar/style/calendarstyle.cjs.js +4 -2
- package/calendar/style/calendarstyle.cjs.min.js +1 -1
- package/calendar/style/calendarstyle.esm.js +4 -2
- package/calendar/style/calendarstyle.esm.min.js +1 -1
- package/calendar/style/calendarstyle.js +4 -2
- package/calendar/style/calendarstyle.min.js +1 -1
- package/cascadeselect/BaseCascadeSelect.vue +2 -2
- package/cascadeselect/CascadeSelect.d.ts +2 -2
- package/cascadeselect/cascadeselect.cjs.js +2 -2
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +2 -2
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +2 -2
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/BaseCheckbox.vue +2 -2
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/checkbox.cjs.js +2 -2
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -2
- package/checkbox/checkbox.min.js +1 -1
- package/chips/BaseChips.vue +2 -2
- package/chips/Chips.d.ts +2 -2
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/column/Column.d.ts +4 -0
- package/confirmpopup/ConfirmPopup.vue +0 -1
- package/contextmenu/BaseContextMenu.vue +2 -2
- package/contextmenu/ContextMenu.d.ts +2 -2
- package/contextmenu/contextmenu.cjs.js +2 -2
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +2 -2
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +2 -2
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +59 -26
- package/core/core.min.js +10 -10
- package/datatable/DataTable.d.ts +1 -1
- package/datatable/DataTable.vue +4 -7
- package/datatable/HeaderCell.vue +1 -1
- package/datatable/datatable.cjs.js +6 -9
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +6 -9
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +6 -9
- package/datatable/datatable.min.js +1 -1
- package/dock/BaseDock.vue +2 -2
- package/dock/Dock.d.ts +2 -2
- package/dock/Dock.vue +27 -5
- package/dock/DockSub.vue +2 -2
- package/dock/dock.cjs.js +33 -12
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +33 -12
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +33 -12
- package/dock/dock.min.js +1 -1
- package/dropdown/BaseDropdown.vue +2 -2
- package/dropdown/Dropdown.d.ts +2 -2
- package/dropdown/dropdown.cjs.js +2 -2
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +2 -2
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +2 -2
- package/dropdown/dropdown.min.js +1 -1
- package/editor/Editor.vue +6 -0
- package/editor/editor.cjs.js +6 -0
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +6 -0
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +6 -0
- package/editor/editor.min.js +1 -1
- package/inlinemessage/InlineMessage.vue +2 -2
- package/inlinemessage/inlinemessage.cjs.js +7 -5
- package/inlinemessage/inlinemessage.cjs.min.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +5 -3
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +7 -5
- package/inlinemessage/inlinemessage.min.js +1 -1
- package/inputnumber/BaseInputNumber.vue +2 -2
- package/inputnumber/InputNumber.d.ts +2 -2
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/BaseInputSwitch.vue +2 -2
- package/inputswitch/InputSwitch.d.ts +2 -2
- package/inputswitch/inputswitch.cjs.js +2 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +2 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +2 -2
- package/inputswitch/inputswitch.min.js +1 -1
- package/knob/BaseKnob.vue +2 -2
- package/knob/Knob.d.ts +2 -2
- package/knob/knob.cjs.js +2 -2
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +2 -2
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -2
- package/knob/knob.min.js +1 -1
- package/listbox/BaseListbox.vue +14 -5
- package/listbox/Listbox.d.ts +3 -3
- package/listbox/Listbox.vue +4 -3
- package/listbox/listbox.cjs.js +18 -8
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +18 -8
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +18 -8
- package/listbox/listbox.min.js +1 -1
- package/megamenu/BaseMegaMenu.vue +2 -2
- package/megamenu/MegaMenu.d.ts +25 -2
- package/megamenu/MegaMenu.vue +45 -26
- package/megamenu/megamenu.cjs.js +65 -41
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +65 -41
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +65 -41
- package/megamenu/megamenu.min.js +1 -1
- package/megamenu/style/megamenustyle.cjs.js +1 -1
- package/megamenu/style/megamenustyle.cjs.min.js +1 -1
- package/megamenu/style/megamenustyle.esm.js +1 -1
- package/megamenu/style/megamenustyle.esm.min.js +1 -1
- package/megamenu/style/megamenustyle.js +1 -1
- package/megamenu/style/megamenustyle.min.js +1 -1
- package/menu/BaseMenu.vue +2 -2
- package/menu/Menu.d.ts +2 -2
- package/menu/Menu.vue +5 -1
- package/menu/menu.cjs.js +6 -3
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +6 -3
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +6 -3
- package/menu/menu.min.js +1 -1
- package/menubar/BaseMenubar.vue +2 -2
- package/menubar/Menubar.d.ts +29 -5
- package/menubar/Menubar.vue +48 -29
- package/menubar/menubar.cjs.js +70 -46
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +70 -46
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +70 -46
- package/menubar/menubar.min.js +1 -1
- package/multiselect/BaseMultiSelect.vue +2 -2
- package/multiselect/MultiSelect.d.ts +2 -2
- package/multiselect/multiselect.cjs.js +2 -2
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +2 -2
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +2 -2
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/BaseOrderList.vue +2 -2
- package/orderlist/OrderList.d.ts +2 -2
- package/orderlist/orderlist.cjs.js +2 -2
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -2
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +2 -2
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +1 -1
- package/panelmenu/style/panelmenustyle.cjs.js +1 -1
- package/panelmenu/style/panelmenustyle.cjs.min.js +1 -1
- package/panelmenu/style/panelmenustyle.esm.js +1 -1
- package/panelmenu/style/panelmenustyle.esm.min.js +1 -1
- package/panelmenu/style/panelmenustyle.js +1 -1
- package/panelmenu/style/panelmenustyle.min.js +1 -1
- package/password/BasePassword.vue +2 -2
- package/password/Password.d.ts +2 -2
- package/password/password.cjs.js +2 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -2
- package/password/password.min.js +1 -1
- package/picklist/PickList.vue +1 -4
- package/picklist/picklist.cjs.js +1 -4
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +1 -4
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +1 -4
- package/picklist/picklist.min.js +1 -1
- package/radiobutton/BaseRadioButton.vue +2 -2
- package/radiobutton/RadioButton.d.ts +2 -2
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +6 -6
- package/resources/themes/arya-green/theme.css +6 -6
- package/resources/themes/arya-orange/theme.css +6 -6
- package/resources/themes/arya-purple/theme.css +6 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +6 -6
- package/resources/themes/bootstrap4-dark-purple/theme.css +6 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +6 -6
- package/resources/themes/bootstrap4-light-purple/theme.css +6 -6
- package/resources/themes/fluent-light/theme.css +6 -6
- package/resources/themes/lara-dark-amber/theme.css +6 -6
- package/resources/themes/lara-dark-blue/theme.css +6 -6
- package/resources/themes/lara-dark-cyan/theme.css +6 -6
- package/resources/themes/lara-dark-green/theme.css +6 -6
- package/resources/themes/lara-dark-indigo/theme.css +6 -6
- package/resources/themes/lara-dark-pink/theme.css +6 -6
- package/resources/themes/lara-dark-purple/theme.css +6 -6
- package/resources/themes/lara-dark-teal/theme.css +6 -6
- package/resources/themes/lara-light-amber/theme.css +6 -6
- package/resources/themes/lara-light-blue/theme.css +6 -6
- package/resources/themes/lara-light-cyan/theme.css +6 -6
- package/resources/themes/lara-light-green/theme.css +6 -6
- package/resources/themes/lara-light-indigo/theme.css +6 -6
- package/resources/themes/lara-light-pink/theme.css +6 -6
- package/resources/themes/lara-light-purple/theme.css +6 -6
- package/resources/themes/lara-light-teal/theme.css +6 -6
- package/resources/themes/luna-amber/theme.css +6 -6
- package/resources/themes/luna-blue/theme.css +6 -6
- package/resources/themes/luna-green/theme.css +6 -6
- package/resources/themes/luna-pink/theme.css +6 -6
- package/resources/themes/md-dark-deeppurple/theme.css +6 -6
- package/resources/themes/md-dark-indigo/theme.css +6 -6
- package/resources/themes/md-light-deeppurple/theme.css +6 -6
- package/resources/themes/md-light-indigo/theme.css +6 -6
- package/resources/themes/mdc-dark-deeppurple/theme.css +6 -6
- package/resources/themes/mdc-dark-indigo/theme.css +6 -6
- package/resources/themes/mdc-light-deeppurple/theme.css +6 -6
- package/resources/themes/mdc-light-indigo/theme.css +6 -6
- package/resources/themes/mira/theme.css +6 -6
- package/resources/themes/nano/theme.css +6 -6
- package/resources/themes/nova/theme.css +6 -6
- package/resources/themes/nova-accent/theme.css +6 -6
- package/resources/themes/nova-alt/theme.css +6 -6
- package/resources/themes/nova-vue/theme.css +6 -6
- package/resources/themes/rhea/theme.css +6 -6
- package/resources/themes/saga-blue/theme.css +6 -6
- package/resources/themes/saga-green/theme.css +6 -6
- package/resources/themes/saga-orange/theme.css +6 -6
- package/resources/themes/saga-purple/theme.css +6 -6
- package/resources/themes/soho-dark/theme.css +6 -6
- package/resources/themes/soho-light/theme.css +6 -6
- package/resources/themes/tailwind-light/theme.css +6 -6
- package/resources/themes/vela-blue/theme.css +6 -6
- package/resources/themes/vela-green/theme.css +6 -6
- package/resources/themes/vela-orange/theme.css +6 -6
- package/resources/themes/vela-purple/theme.css +6 -6
- package/resources/themes/viva-dark/theme.css +6 -6
- package/resources/themes/viva-light/theme.css +6 -6
- package/selectbutton/BaseSelectButton.vue +1 -1
- package/selectbutton/SelectButton.d.ts +1 -1
- package/selectbutton/selectbutton.cjs.js +1 -1
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +1 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +1 -1
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/BaseSlider.vue +2 -2
- package/slider/Slider.d.ts +2 -2
- package/slider/slider.cjs.js +2 -2
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +2 -2
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +2 -2
- package/slider/slider.min.js +1 -1
- package/speeddial/BaseSpeedDial.vue +2 -2
- package/speeddial/SpeedDial.d.ts +2 -2
- package/speeddial/speeddial.cjs.js +2 -2
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -2
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -2
- package/speeddial/speeddial.min.js +1 -1
- package/splitter/Splitter.vue +1 -2
- package/splitter/splitter.cjs.js +1 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +1 -1
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +1 -1
- package/splitter/splitter.min.js +1 -1
- package/styleclass/StyleClass.d.ts +10 -0
- package/styleclass/styleclass.cjs.js +18 -0
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +18 -0
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +18 -0
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/BaseTabMenu.vue +2 -2
- package/tabmenu/TabMenu.d.ts +2 -2
- package/tabmenu/tabmenu.cjs.js +2 -2
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -2
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +2 -2
- package/tabmenu/tabmenu.min.js +1 -1
- package/tieredmenu/BaseTieredMenu.vue +2 -2
- package/tieredmenu/TieredMenu.d.ts +2 -2
- package/tieredmenu/TieredMenu.vue +5 -1
- package/tieredmenu/tieredmenu.cjs.js +6 -3
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +6 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +6 -3
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/togglebutton/BaseToggleButton.vue +2 -2
- package/togglebutton/ToggleButton.d.ts +2 -2
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/BaseToolbar.vue +1 -1
- package/toolbar/Toolbar.d.ts +1 -1
- package/toolbar/toolbar.cjs.js +1 -1
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +1 -1
- package/toolbar/toolbar.min.js +1 -1
- package/tree/BaseTree.vue +6 -2
- package/tree/Tree.d.ts +8 -62
- package/tree/Tree.vue +2 -1
- package/tree/TreeNode.vue +17 -8
- package/tree/style/treestyle.cjs.js +1 -0
- package/tree/style/treestyle.cjs.min.js +1 -1
- package/tree/style/treestyle.esm.js +1 -0
- package/tree/style/treestyle.esm.min.js +1 -1
- package/tree/style/treestyle.js +1 -0
- package/tree/style/treestyle.min.js +1 -1
- package/tree/tree.cjs.js +30 -11
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +31 -12
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +30 -11
- package/tree/tree.min.js +1 -1
- package/treenode/TreeNode.d.ts +71 -0
- package/treenode/package.json +3 -0
- package/treeselect/BaseTreeSelect.vue +2 -2
- package/treeselect/TreeSelect.d.ts +4 -3
- package/treeselect/treeselect.cjs.js +2 -2
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +2 -2
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -2
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BaseTreeTable.vue +4 -0
- package/treetable/BodyCell.vue +16 -4
- package/treetable/TreeTable.d.ts +6 -1
- package/treetable/TreeTable.vue +2 -1
- package/treetable/TreeTableRow.vue +5 -0
- package/treetable/treetable.cjs.js +33 -6
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +34 -7
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +33 -6
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/BaseTriStateCheckbox.vue +2 -2
- package/tristatecheckbox/TriStateCheckbox.d.ts +2 -2
- package/tristatecheckbox/tristatecheckbox.cjs.js +2 -2
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -2
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +2 -2
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),t=require("primevue/icons/plus"),n=require("primevue/ripple"),i=require("primevue/tooltip"),o=require("primevue/utils"),r=require("primevue/basecomponent"),c=require("primevue/speeddial/style"),a=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),u=s(t),d=s(n),f=s(i);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){var t=y(e,"string");return"symbol"===m(t)?t:String(t)}function y(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e){return x(e)||w(e)||I(e)||k()}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var C={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:s(r).default,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},style:s(c).default,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible:function(e){this.d_visible=e}},mounted:function(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){var e=o.DomHandler.findSingle(this.container,'[data-pc-name="button"]'),t=o.DomHandler.findSingle(this.list,'[data-pc-section="menuitem"]');if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),i=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(i/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(e,t){return this.ptm(t,{context:{active:this.isItemActive(e),hidden:!this.d_visible}})},onFocus:function(e){this.focused=!0,this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick:function(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(e){return(this.d_visible?e:this.model.length-e-1)*this.transitionDelay},onTogglerKeydown:function(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey:function(e){var t=this,n=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(e){return e.id===t.focusedOptionIndex}));this.onItemClick(e,this.model[n]),this.onBlur(e);var i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey:function(){this.hide();var e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp:function(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown:function(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")}));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[t.length-1].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?t.length-1:i-1},findNextOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[0].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?0:i+1},calculatePointStyle:function(e){var t=this.type;if("linear"!==t){var n=this.model.length,i=this.radius||20*n;if("circle"===t){var o=2*Math.PI/n;return{left:"calc(".concat(i*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(i*Math.sin(o*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var r=this.direction,c=Math.PI/(n-1),a="calc(".concat(i*Math.cos(c*e),"px + var(--item-diff-x, 0px))"),s="calc(".concat(i*Math.sin(c*e),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:a,bottom:s};if("down"===r)return{left:a,top:s};if("left"===r)return{right:s,top:a};if("right"===r)return{left:s,top:a}}else if("quarter-circle"===t){var l=this.direction,u=Math.PI/(2*(n-1)),d="calc(".concat(i*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(i*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(e){var t=this.calculateTransitionDelay(e),n=this.calculatePointStyle(e);return h({transitionDelay:"".concat(t,"ms")},n)},bindDocumentClickListener:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.d_visible&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:function(e){return"function"==typeof e.visible?e.visible():!1!==e.visible},isItemActive:function(e){return e===this.focusedOptionId},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:l.default,PlusIcon:u.default},directives:{ripple:d.default,tooltip:f.default}},O=["id","aria-activedescendant"],P=["id","aria-controls"],S=["href","target","onClick","aria-label"];C.render=function(e,t,n,i,o,r){var c=a.resolveComponent("SDButton"),s=a.resolveDirective("ripple"),l=a.resolveDirective("tooltip");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({ref:r.containerRef,class:r.containerClass,style:[e.style,e.sx("root")]},e.ptm("root"),{"data-pc-name":"speeddial"}),[a.renderSlot(e.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[a.createVNode(c,{type:"button",class:a.normalizeClass([e.cx("button"),e.buttonClass]),onClick:t[0]||(t[0]=function(e){return r.onClick(e)}),disabled:e.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button"),unstyled:e.unstyled},{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&e.hideIcon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.hideIcon?"span":"PlusIcon"),a.mergeProps({key:0,class:e.cx("buttonIcon")},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.showIcon?"span":"PlusIcon"),a.mergeProps({key:1,class:o.d_visible&&e.hideIcon?e.hideIcon:e.showIcon},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),a.createElementVNode("ul",a.mergeProps({ref:r.listRef,id:o.id+"_list",class:e.cx("menu"),style:e.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:t[1]||(t[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:t[2]||(t[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},e.ptm("menu")),[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.model,(function(t,n){return a.openBlock(),a.createElementBlock(a.Fragment,{key:n},[r.isItemVisible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:0,id:"".concat(o.id,"_").concat(n),"aria-controls":"".concat(o.id,"_item"),class:e.cx("menuitem",{id:"".concat(o.id,"_").concat(n)}),style:r.getItemStyle(n),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(n),"menuitem")),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:function(e){return r.onItemClick(e,t)}},null,8,["item","onClick"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:e.cx("action",{item:t}),target:t.target,onClick:function(e){return r.onItemClick(e,t)},"aria-label":t.label},r.getPTOptions("".concat(o.id,"_").concat(n),"action")),[t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:0,class:[e.cx("actionIcon"),t.icon]},r.getPTOptions("".concat(o.id,"_").concat(n),"actionIcon")),null,16)):a.createCommentVNode("",!0)],16,S)),[[s],[l,{value:t.label,disabled:!e.tooltipOptions},e.tooltipOptions]])],16,P)):a.createCommentVNode("",!0)],64)})),128))],16,O)],16),e.mask?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:[e.cx("mask"),e.maskClass],style:e.maskStyle},e.ptm("mask")),null,16)):a.createCommentVNode("",!0)],64)},module.exports=C;
|
|
1
|
+
"use strict";var e=require("primevue/button"),t=require("primevue/icons/plus"),n=require("primevue/ripple"),i=require("primevue/tooltip"),o=require("primevue/utils"),r=require("primevue/basecomponent"),c=require("primevue/speeddial/style"),a=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),u=s(t),d=s(n),f=s(i);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){var t=y(e,"string");return"symbol"===m(t)?t:String(t)}function y(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e){return x(e)||w(e)||I(e)||k()}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var C={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:s(r).default,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:s(c).default,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible:function(e){this.d_visible=e}},mounted:function(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){var e=o.DomHandler.findSingle(this.container,'[data-pc-name="button"]'),t=o.DomHandler.findSingle(this.list,'[data-pc-section="menuitem"]');if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),i=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(i/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(e,t){return this.ptm(t,{context:{active:this.isItemActive(e),hidden:!this.d_visible}})},onFocus:function(e){this.focused=!0,this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick:function(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(e){return(this.d_visible?e:this.model.length-e-1)*this.transitionDelay},onTogglerKeydown:function(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey:function(e){var t=this,n=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(e){return e.id===t.focusedOptionIndex}));this.onItemClick(e,this.model[n]),this.onBlur(e);var i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey:function(){this.hide();var e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp:function(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown:function(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")}));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[t.length-1].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?t.length-1:i-1},findNextOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[0].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?0:i+1},calculatePointStyle:function(e){var t=this.type;if("linear"!==t){var n=this.model.length,i=this.radius||20*n;if("circle"===t){var o=2*Math.PI/n;return{left:"calc(".concat(i*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(i*Math.sin(o*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var r=this.direction,c=Math.PI/(n-1),a="calc(".concat(i*Math.cos(c*e),"px + var(--item-diff-x, 0px))"),s="calc(".concat(i*Math.sin(c*e),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:a,bottom:s};if("down"===r)return{left:a,top:s};if("left"===r)return{right:s,top:a};if("right"===r)return{left:s,top:a}}else if("quarter-circle"===t){var l=this.direction,u=Math.PI/(2*(n-1)),d="calc(".concat(i*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(i*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(e){var t=this.calculateTransitionDelay(e),n=this.calculatePointStyle(e);return h({transitionDelay:"".concat(t,"ms")},n)},bindDocumentClickListener:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.d_visible&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:function(e){return"function"==typeof e.visible?e.visible():!1!==e.visible},isItemActive:function(e){return e===this.focusedOptionId},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:l.default,PlusIcon:u.default},directives:{ripple:d.default,tooltip:f.default}},O=["id","aria-activedescendant"],P=["id","aria-controls"],S=["href","target","onClick","aria-label"];C.render=function(e,t,n,i,o,r){var c=a.resolveComponent("SDButton"),s=a.resolveDirective("ripple"),l=a.resolveDirective("tooltip");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({ref:r.containerRef,class:r.containerClass,style:[e.style,e.sx("root")]},e.ptm("root"),{"data-pc-name":"speeddial"}),[a.renderSlot(e.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[a.createVNode(c,{type:"button",class:a.normalizeClass([e.cx("button"),e.buttonClass]),onClick:t[0]||(t[0]=function(e){return r.onClick(e)}),disabled:e.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button"),unstyled:e.unstyled},{icon:a.withCtx((function(){return[a.renderSlot(e.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&e.hideIcon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.hideIcon?"span":"PlusIcon"),a.mergeProps({key:0,class:e.cx("buttonIcon")},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.showIcon?"span":"PlusIcon"),a.mergeProps({key:1,class:o.d_visible&&e.hideIcon?e.hideIcon:e.showIcon},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),a.createElementVNode("ul",a.mergeProps({ref:r.listRef,id:o.id+"_list",class:e.cx("menu"),style:e.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:t[1]||(t[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:t[2]||(t[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},e.ptm("menu")),[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.model,(function(t,n){return a.openBlock(),a.createElementBlock(a.Fragment,{key:n},[r.isItemVisible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:0,id:"".concat(o.id,"_").concat(n),"aria-controls":"".concat(o.id,"_item"),class:e.cx("menuitem",{id:"".concat(o.id,"_").concat(n)}),style:r.getItemStyle(n),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(n),"menuitem")),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:function(e){return r.onItemClick(e,t)}},null,8,["item","onClick"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:e.cx("action",{item:t}),target:t.target,onClick:function(e){return r.onItemClick(e,t)},"aria-label":t.label},r.getPTOptions("".concat(o.id,"_").concat(n),"action")),[t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:0,class:[e.cx("actionIcon"),t.icon]},r.getPTOptions("".concat(o.id,"_").concat(n),"actionIcon")),null,16)):a.createCommentVNode("",!0)],16,S)),[[s],[l,{value:t.label,disabled:!e.tooltipOptions},e.tooltipOptions]])],16,P)):a.createCommentVNode("",!0)],64)})),128))],16,O)],16),e.mask?(a.openBlock(),a.createElementBlock("div",a.mergeProps({key:0,class:[e.cx("mask"),e.maskClass],style:e.maskStyle},e.ptm("mask")),null,16)):a.createCommentVNode("",!0)],64)},module.exports=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"primevue/button";import e from"primevue/icons/plus";import i from"primevue/ripple";import n from"primevue/tooltip";import{UniqueComponentId as o,DomHandler as r}from"primevue/utils";import s from"primevue/basecomponent";import c from"primevue/speeddial/style";import{resolveComponent as a,resolveDirective as l,openBlock as u,createElementBlock as d,Fragment as f,createElementVNode as p,mergeProps as h,renderSlot as m,createVNode as b,normalizeClass as y,withCtx as v,createBlock as g,resolveDynamicComponent as I,renderList as w,withDirectives as x,createCommentVNode as k}from"vue";function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function C(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function S(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?C(Object(i),!0).forEach((function(e){P(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):C(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function P(t,e,i){return(e=A(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function A(t){var e=D(t,"string");return"symbol"===O(e)?e:String(e)}function D(t,e){if("object"!==O(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _(t){return K(t)||j(t)||E(t)||L()}function L(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t,e){if(t){if("string"==typeof t)return N(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(t,e):void 0}}function j(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function K(t){if(Array.isArray(t))return N(t)}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var T={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:s,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},style:c,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||o()},visible:function(t){this.d_visible=t}},mounted:function(){if(this.id=this.id||o(),"linear"!==this.type){var t=r.findSingle(this.container,'[data-pc-name="button"]'),e=r.findSingle(this.list,'[data-pc-section="menuitem"]');if(t&&e){var i=Math.abs(t.offsetWidth-e.offsetWidth),n=Math.abs(t.offsetHeight-e.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(i/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(n/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(t,e){return this.ptm(e,{context:{active:this.isItemActive(t),hidden:!this.d_visible}})},onFocus:function(t){this.focused=!0,this.$emit("focus",t)},onBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onItemClick:function(t,e){e.command&&e.command({originalEvent:t,item:e}),this.hide(),this.isItemClicked=!0,t.preventDefault()},onClick:function(t){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",t)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(t){return(this.d_visible?t:this.model.length-t-1)*this.transitionDelay},onTogglerKeydown:function(t){switch(t.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(t);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(t);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(t){switch(t.code){case"ArrowDown":this.onArrowDown(t);break;case"ArrowUp":this.onArrowUp(t);break;case"ArrowLeft":this.onArrowLeft(t);break;case"ArrowRight":this.onArrowRight(t);break;case"Enter":case"Space":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t)}},onTogglerArrowUp:function(t){this.focused=!0,r.focus(this.list),this.show(),this.navigatePrevItem(t),t.preventDefault()},onTogglerArrowDown:function(t){this.focused=!0,r.focus(this.list),this.show(),this.navigateNextItem(t),t.preventDefault()},onEnterKey:function(t){var e=this,i=_(r.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(t){return t.id===e.focusedOptionIndex}));this.onItemClick(t,this.model[i]),this.onBlur(t);var n=r.findSingle(this.container,"button");n&&r.focus(n)},onEscapeKey:function(){this.hide();var t=r.findSingle(this.container,"button");t&&r.focus(t)},onArrowUp:function(t){"up"===this.direction?this.navigateNextItem(t):"down"===this.direction?this.navigatePrevItem(t):this.navigateNextItem(t)},onArrowDown:function(t){"up"===this.direction?this.navigatePrevItem(t):"down"===this.direction?this.navigateNextItem(t):this.navigatePrevItem(t)},onArrowLeft:function(t){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(t):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(t))},onArrowRight:function(t){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(t):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(t))},onEndKey:function(t){t.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(t)},onHomeKey:function(t){t.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(t)},navigateNextItem:function(t){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.preventDefault()},navigatePrevItem:function(t){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.preventDefault()},changeFocusedOptionIndex:function(t){var e=_(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")}));e[t]&&(this.focusedOptionIndex=e[t].getAttribute("id"))},findPrevOptionIndex:function(t){var e=_(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")})),i=-1===t?e[e.length-1].id:t,n=e.findIndex((function(t){return t.getAttribute("id")===i}));return n=-1===t?e.length-1:n-1},findNextOptionIndex:function(t){var e=_(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")})),i=-1===t?e[0].id:t,n=e.findIndex((function(t){return t.getAttribute("id")===i}));return n=-1===t?0:n+1},calculatePointStyle:function(t){var e=this.type;if("linear"!==e){var i=this.model.length,n=this.radius||20*i;if("circle"===e){var o=2*Math.PI/i;return{left:"calc(".concat(n*Math.cos(o*t),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(n*Math.sin(o*t),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===e){var r=this.direction,s=Math.PI/(i-1),c="calc(".concat(n*Math.cos(s*t),"px + var(--item-diff-x, 0px))"),a="calc(".concat(n*Math.sin(s*t),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:c,bottom:a};if("down"===r)return{left:c,top:a};if("left"===r)return{right:a,top:c};if("right"===r)return{left:a,top:c}}else if("quarter-circle"===e){var l=this.direction,u=Math.PI/(2*(i-1)),d="calc(".concat(n*Math.cos(u*t),"px + var(--item-diff-x, 0px))"),f="calc(".concat(n*Math.sin(u*t),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(t){var e=this.calculateTransitionDelay(t),i=this.calculatePointStyle(t);return S({transitionDelay:"".concat(e,"ms")},i)},bindDocumentClickListener:function(){var t=this;this.documentClickListener||(this.documentClickListener=function(e){t.d_visible&&t.isOutsideClicked(e)&&t.hide(),t.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(t){return this.container&&!(this.container.isSameNode(t.target)||this.container.contains(t.target)||this.isItemClicked)},isItemVisible:function(t){return"function"==typeof t.visible?t.visible():!1!==t.visible},isItemActive:function(t){return t===this.focusedOptionId},containerRef:function(t){this.container=t},listRef:function(t){this.list=t}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:t,PlusIcon:e},directives:{ripple:i,tooltip:n}},B=["id","aria-activedescendant"],M=["id","aria-controls"],$=["href","target","onClick","aria-label"];T.render=function(t,e,i,n,o,r){var s=a("SDButton"),c=l("ripple"),O=l("tooltip");return u(),d(f,null,[p("div",h({ref:r.containerRef,class:r.containerClass,style:[t.style,t.sx("root")]},t.ptm("root"),{"data-pc-name":"speeddial"}),[m(t.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[b(s,{type:"button",class:y([t.cx("button"),t.buttonClass]),onClick:e[0]||(e[0]=function(t){return r.onClick(t)}),disabled:t.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,pt:t.ptm("button"),unstyled:t.unstyled},{icon:v((function(){return[m(t.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&t.hideIcon?(u(),g(I(t.hideIcon?"span":"PlusIcon"),h({key:0,class:t.cx("buttonIcon")},t.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(u(),g(I(t.showIcon?"span":"PlusIcon"),h({key:1,class:o.d_visible&&t.hideIcon?t.hideIcon:t.showIcon},t.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),p("ul",h({ref:r.listRef,id:o.id+"_list",class:t.cx("menu"),style:t.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:e[1]||(e[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:e[2]||(e[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:e[3]||(e[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},t.ptm("menu")),[(u(!0),d(f,null,w(t.model,(function(e,i){return u(),d(f,{key:i},[r.isItemVisible(e)?(u(),d("li",h({key:0,id:"".concat(o.id,"_").concat(i),"aria-controls":"".concat(o.id,"_item"),class:t.cx("menuitem",{id:"".concat(o.id,"_").concat(i)}),style:r.getItemStyle(i),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(i),"menuitem")),[t.$slots.item?(u(),g(I(t.$slots.item),{key:1,item:e,onClick:function(t){return r.onItemClick(t,e)}},null,8,["item","onClick"])):x((u(),d("a",h({key:0,tabindex:-1,href:e.url||"#",role:"menuitem",class:t.cx("action",{item:e}),target:e.target,onClick:function(t){return r.onItemClick(t,e)},"aria-label":e.label},r.getPTOptions("".concat(o.id,"_").concat(i),"action")),[e.icon?(u(),d("span",h({key:0,class:[t.cx("actionIcon"),e.icon]},r.getPTOptions("".concat(o.id,"_").concat(i),"actionIcon")),null,16)):k("",!0)],16,$)),[[c],[O,{value:e.label,disabled:!t.tooltipOptions},t.tooltipOptions]])],16,M)):k("",!0)],64)})),128))],16,B)],16),t.mask?(u(),d("div",h({key:0,class:[t.cx("mask"),t.maskClass],style:t.maskStyle},t.ptm("mask")),null,16)):k("",!0)],64)};export{T as default};
|
|
1
|
+
import t from"primevue/button";import e from"primevue/icons/plus";import i from"primevue/ripple";import n from"primevue/tooltip";import{UniqueComponentId as o,DomHandler as r}from"primevue/utils";import s from"primevue/basecomponent";import c from"primevue/speeddial/style";import{resolveComponent as a,resolveDirective as l,openBlock as u,createElementBlock as d,Fragment as f,createElementVNode as p,mergeProps as h,renderSlot as m,createVNode as b,normalizeClass as y,withCtx as v,createBlock as g,resolveDynamicComponent as I,renderList as w,withDirectives as x,createCommentVNode as k}from"vue";function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function C(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function S(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?C(Object(i),!0).forEach((function(e){P(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):C(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function P(t,e,i){return(e=A(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function A(t){var e=D(t,"string");return"symbol"===O(e)?e:String(e)}function D(t,e){if("object"!==O(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function L(t){return K(t)||j(t)||E(t)||_()}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t,e){if(t){if("string"==typeof t)return N(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(t,e):void 0}}function j(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function K(t){if(Array.isArray(t))return N(t)}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var T={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:s,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:c,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||o()},visible:function(t){this.d_visible=t}},mounted:function(){if(this.id=this.id||o(),"linear"!==this.type){var t=r.findSingle(this.container,'[data-pc-name="button"]'),e=r.findSingle(this.list,'[data-pc-section="menuitem"]');if(t&&e){var i=Math.abs(t.offsetWidth-e.offsetWidth),n=Math.abs(t.offsetHeight-e.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(i/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(n/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(t,e){return this.ptm(e,{context:{active:this.isItemActive(t),hidden:!this.d_visible}})},onFocus:function(t){this.focused=!0,this.$emit("focus",t)},onBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onItemClick:function(t,e){e.command&&e.command({originalEvent:t,item:e}),this.hide(),this.isItemClicked=!0,t.preventDefault()},onClick:function(t){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",t)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(t){return(this.d_visible?t:this.model.length-t-1)*this.transitionDelay},onTogglerKeydown:function(t){switch(t.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(t);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(t);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(t){switch(t.code){case"ArrowDown":this.onArrowDown(t);break;case"ArrowUp":this.onArrowUp(t);break;case"ArrowLeft":this.onArrowLeft(t);break;case"ArrowRight":this.onArrowRight(t);break;case"Enter":case"Space":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t)}},onTogglerArrowUp:function(t){this.focused=!0,r.focus(this.list),this.show(),this.navigatePrevItem(t),t.preventDefault()},onTogglerArrowDown:function(t){this.focused=!0,r.focus(this.list),this.show(),this.navigateNextItem(t),t.preventDefault()},onEnterKey:function(t){var e=this,i=L(r.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(t){return t.id===e.focusedOptionIndex}));this.onItemClick(t,this.model[i]),this.onBlur(t);var n=r.findSingle(this.container,"button");n&&r.focus(n)},onEscapeKey:function(){this.hide();var t=r.findSingle(this.container,"button");t&&r.focus(t)},onArrowUp:function(t){"up"===this.direction?this.navigateNextItem(t):"down"===this.direction?this.navigatePrevItem(t):this.navigateNextItem(t)},onArrowDown:function(t){"up"===this.direction?this.navigatePrevItem(t):"down"===this.direction?this.navigateNextItem(t):this.navigatePrevItem(t)},onArrowLeft:function(t){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(t):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(t))},onArrowRight:function(t){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(t):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(t))},onEndKey:function(t){t.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(t)},onHomeKey:function(t){t.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(t)},navigateNextItem:function(t){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.preventDefault()},navigatePrevItem:function(t){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e),t.preventDefault()},changeFocusedOptionIndex:function(t){var e=L(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")}));e[t]&&(this.focusedOptionIndex=e[t].getAttribute("id"))},findPrevOptionIndex:function(t){var e=L(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")})),i=-1===t?e[e.length-1].id:t,n=e.findIndex((function(t){return t.getAttribute("id")===i}));return n=-1===t?e.length-1:n-1},findNextOptionIndex:function(t){var e=L(r.find(this.container,'[data-pc-section="menuitem"]')).filter((function(t){return!r.hasClass(r.findSingle(t,"a"),"p-disabled")})),i=-1===t?e[0].id:t,n=e.findIndex((function(t){return t.getAttribute("id")===i}));return n=-1===t?0:n+1},calculatePointStyle:function(t){var e=this.type;if("linear"!==e){var i=this.model.length,n=this.radius||20*i;if("circle"===e){var o=2*Math.PI/i;return{left:"calc(".concat(n*Math.cos(o*t),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(n*Math.sin(o*t),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===e){var r=this.direction,s=Math.PI/(i-1),c="calc(".concat(n*Math.cos(s*t),"px + var(--item-diff-x, 0px))"),a="calc(".concat(n*Math.sin(s*t),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:c,bottom:a};if("down"===r)return{left:c,top:a};if("left"===r)return{right:a,top:c};if("right"===r)return{left:a,top:c}}else if("quarter-circle"===e){var l=this.direction,u=Math.PI/(2*(i-1)),d="calc(".concat(n*Math.cos(u*t),"px + var(--item-diff-x, 0px))"),f="calc(".concat(n*Math.sin(u*t),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(t){var e=this.calculateTransitionDelay(t),i=this.calculatePointStyle(t);return S({transitionDelay:"".concat(e,"ms")},i)},bindDocumentClickListener:function(){var t=this;this.documentClickListener||(this.documentClickListener=function(e){t.d_visible&&t.isOutsideClicked(e)&&t.hide(),t.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(t){return this.container&&!(this.container.isSameNode(t.target)||this.container.contains(t.target)||this.isItemClicked)},isItemVisible:function(t){return"function"==typeof t.visible?t.visible():!1!==t.visible},isItemActive:function(t){return t===this.focusedOptionId},containerRef:function(t){this.container=t},listRef:function(t){this.list=t}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:t,PlusIcon:e},directives:{ripple:i,tooltip:n}},B=["id","aria-activedescendant"],M=["id","aria-controls"],$=["href","target","onClick","aria-label"];T.render=function(t,e,i,n,o,r){var s=a("SDButton"),c=l("ripple"),O=l("tooltip");return u(),d(f,null,[p("div",h({ref:r.containerRef,class:r.containerClass,style:[t.style,t.sx("root")]},t.ptm("root"),{"data-pc-name":"speeddial"}),[m(t.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[b(s,{type:"button",class:y([t.cx("button"),t.buttonClass]),onClick:e[0]||(e[0]=function(t){return r.onClick(t)}),disabled:t.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,pt:t.ptm("button"),unstyled:t.unstyled},{icon:v((function(){return[m(t.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&t.hideIcon?(u(),g(I(t.hideIcon?"span":"PlusIcon"),h({key:0,class:t.cx("buttonIcon")},t.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(u(),g(I(t.showIcon?"span":"PlusIcon"),h({key:1,class:o.d_visible&&t.hideIcon?t.hideIcon:t.showIcon},t.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),p("ul",h({ref:r.listRef,id:o.id+"_list",class:t.cx("menu"),style:t.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:e[1]||(e[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:e[2]||(e[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:e[3]||(e[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},t.ptm("menu")),[(u(!0),d(f,null,w(t.model,(function(e,i){return u(),d(f,{key:i},[r.isItemVisible(e)?(u(),d("li",h({key:0,id:"".concat(o.id,"_").concat(i),"aria-controls":"".concat(o.id,"_item"),class:t.cx("menuitem",{id:"".concat(o.id,"_").concat(i)}),style:r.getItemStyle(i),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(i),"menuitem")),[t.$slots.item?(u(),g(I(t.$slots.item),{key:1,item:e,onClick:function(t){return r.onItemClick(t,e)}},null,8,["item","onClick"])):x((u(),d("a",h({key:0,tabindex:-1,href:e.url||"#",role:"menuitem",class:t.cx("action",{item:e}),target:e.target,onClick:function(t){return r.onItemClick(t,e)},"aria-label":e.label},r.getPTOptions("".concat(o.id,"_").concat(i),"action")),[e.icon?(u(),d("span",h({key:0,class:[t.cx("actionIcon"),e.icon]},r.getPTOptions("".concat(o.id,"_").concat(i),"actionIcon")),null,16)):k("",!0)],16,$)),[[c],[O,{value:e.label,disabled:!t.tooltipOptions},t.tooltipOptions]])],16,M)):k("",!0)],64)})),128))],16,B)],16),t.mask?(u(),d("div",h({key:0,class:[t.cx("mask"),t.maskClass],style:t.maskStyle},t.ptm("mask")),null,16)):k("",!0)],64)};export{T as default};
|
package/speeddial/speeddial.js
CHANGED
|
@@ -66,11 +66,11 @@ this.primevue.speeddial = (function (Button, PlusIcon, Ripple, Tooltip, utils, B
|
|
|
66
66
|
tooltipOptions: null,
|
|
67
67
|
style: null,
|
|
68
68
|
"class": null,
|
|
69
|
-
|
|
69
|
+
ariaLabelledby: {
|
|
70
70
|
type: String,
|
|
71
71
|
"default": null
|
|
72
72
|
},
|
|
73
|
-
|
|
73
|
+
ariaLabel: {
|
|
74
74
|
type: String,
|
|
75
75
|
"default": null
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.speeddial=function(e,t,n,i,o,r,c,s){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),u=a(t),d=a(n),f=a(i);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){var t=y(e,"string");return"symbol"===m(t)?t:String(t)}function y(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e){return x(e)||w(e)||I(e)||k()}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var C={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:a(r).default,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},style:a(c).default,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible:function(e){this.d_visible=e}},mounted:function(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){var e=o.DomHandler.findSingle(this.container,'[data-pc-name="button"]'),t=o.DomHandler.findSingle(this.list,'[data-pc-section="menuitem"]');if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),i=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(i/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(e,t){return this.ptm(t,{context:{active:this.isItemActive(e),hidden:!this.d_visible}})},onFocus:function(e){this.focused=!0,this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick:function(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(e){return(this.d_visible?e:this.model.length-e-1)*this.transitionDelay},onTogglerKeydown:function(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey:function(e){var t=this,n=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(e){return e.id===t.focusedOptionIndex}));this.onItemClick(e,this.model[n]),this.onBlur(e);var i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey:function(){this.hide();var e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp:function(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown:function(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")}));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[t.length-1].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?t.length-1:i-1},findNextOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[0].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?0:i+1},calculatePointStyle:function(e){var t=this.type;if("linear"!==t){var n=this.model.length,i=this.radius||20*n;if("circle"===t){var o=2*Math.PI/n;return{left:"calc(".concat(i*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(i*Math.sin(o*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var r=this.direction,c=Math.PI/(n-1),s="calc(".concat(i*Math.cos(c*e),"px + var(--item-diff-x, 0px))"),a="calc(".concat(i*Math.sin(c*e),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:s,bottom:a};if("down"===r)return{left:s,top:a};if("left"===r)return{right:a,top:s};if("right"===r)return{left:a,top:s}}else if("quarter-circle"===t){var l=this.direction,u=Math.PI/(2*(n-1)),d="calc(".concat(i*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(i*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(e){var t=this.calculateTransitionDelay(e),n=this.calculatePointStyle(e);return h({transitionDelay:"".concat(t,"ms")},n)},bindDocumentClickListener:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.d_visible&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:function(e){return"function"==typeof e.visible?e.visible():!1!==e.visible},isItemActive:function(e){return e===this.focusedOptionId},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:l.default,PlusIcon:u.default},directives:{ripple:d.default,tooltip:f.default}},O=["id","aria-activedescendant"],P=["id","aria-controls"],S=["href","target","onClick","aria-label"];return C.render=function(e,t,n,i,o,r){var c=s.resolveComponent("SDButton"),a=s.resolveDirective("ripple"),l=s.resolveDirective("tooltip");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",s.mergeProps({ref:r.containerRef,class:r.containerClass,style:[e.style,e.sx("root")]},e.ptm("root"),{"data-pc-name":"speeddial"}),[s.renderSlot(e.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[s.createVNode(c,{type:"button",class:s.normalizeClass([e.cx("button"),e.buttonClass]),onClick:t[0]||(t[0]=function(e){return r.onClick(e)}),disabled:e.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button"),unstyled:e.unstyled},{icon:s.withCtx((function(){return[s.renderSlot(e.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&e.hideIcon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.hideIcon?"span":"PlusIcon"),s.mergeProps({key:0,class:e.cx("buttonIcon")},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.showIcon?"span":"PlusIcon"),s.mergeProps({key:1,class:o.d_visible&&e.hideIcon?e.hideIcon:e.showIcon},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),s.createElementVNode("ul",s.mergeProps({ref:r.listRef,id:o.id+"_list",class:e.cx("menu"),style:e.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:t[1]||(t[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:t[2]||(t[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},e.ptm("menu")),[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.model,(function(t,n){return s.openBlock(),s.createElementBlock(s.Fragment,{key:n},[r.isItemVisible(t)?(s.openBlock(),s.createElementBlock("li",s.mergeProps({key:0,id:"".concat(o.id,"_").concat(n),"aria-controls":"".concat(o.id,"_item"),class:e.cx("menuitem",{id:"".concat(o.id,"_").concat(n)}),style:r.getItemStyle(n),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(n),"menuitem")),[e.$slots.item?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:function(e){return r.onItemClick(e,t)}},null,8,["item","onClick"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",s.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:e.cx("action",{item:t}),target:t.target,onClick:function(e){return r.onItemClick(e,t)},"aria-label":t.label},r.getPTOptions("".concat(o.id,"_").concat(n),"action")),[t.icon?(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:0,class:[e.cx("actionIcon"),t.icon]},r.getPTOptions("".concat(o.id,"_").concat(n),"actionIcon")),null,16)):s.createCommentVNode("",!0)],16,S)),[[a],[l,{value:t.label,disabled:!e.tooltipOptions},e.tooltipOptions]])],16,P)):s.createCommentVNode("",!0)],64)})),128))],16,O)],16),e.mask?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:[e.cx("mask"),e.maskClass],style:e.maskStyle},e.ptm("mask")),null,16)):s.createCommentVNode("",!0)],64)},C}(primevue.button,primevue.icons.plus,primevue.ripple,primevue.tooltip,primevue.utils,primevue.basecomponent,primevue.speeddial.style,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.speeddial=function(e,t,n,i,o,r,c,s){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),u=a(t),d=a(n),f=a(i);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){var t=y(e,"string");return"symbol"===m(t)?t:String(t)}function y(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function g(e){return x(e)||w(e)||I(e)||k()}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var C={name:"SpeedDial",extends:{name:"BaseSpeedDial",extends:a(r).default,props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:a(c).default,provide:function(){return{$parentInstance:this}}},emits:["click","show","hide","focus","blur"],documentClickListener:null,container:null,list:null,data:function(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible:function(e){this.d_visible=e}},mounted:function(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){var e=o.DomHandler.findSingle(this.container,'[data-pc-name="button"]'),t=o.DomHandler.findSingle(this.list,'[data-pc-section="menuitem"]');if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),i=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(i/2,"px"))}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount:function(){this.unbindDocumentClickListener()},methods:{getPTOptions:function(e,t){return this.ptm(t,{context:{active:this.isItemActive(e),hidden:!this.d_visible}})},onFocus:function(e){this.focused=!0,this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick:function(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show:function(){this.d_visible=!0,this.$emit("show")},hide:function(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay:function(e){return(this.d_visible?e:this.model.length-e-1)*this.transitionDelay},onTogglerKeydown:function(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown:function(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey:function(e){var t=this,n=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).findIndex((function(e){return e.id===t.focusedOptionIndex}));this.onItemClick(e,this.model[n]),this.onBlur(e);var i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey:function(){this.hide();var e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp:function(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown:function(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight:function(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey:function(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem:function(e){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")}));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[t.length-1].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?t.length-1:i-1},findNextOptionIndex:function(e){var t=g(o.DomHandler.find(this.container,'[data-pc-section="menuitem"]')).filter((function(e){return!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")})),n=-1===e?t[0].id:e,i=t.findIndex((function(e){return e.getAttribute("id")===n}));return i=-1===e?0:i+1},calculatePointStyle:function(e){var t=this.type;if("linear"!==t){var n=this.model.length,i=this.radius||20*n;if("circle"===t){var o=2*Math.PI/n;return{left:"calc(".concat(i*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(i*Math.sin(o*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var r=this.direction,c=Math.PI/(n-1),s="calc(".concat(i*Math.cos(c*e),"px + var(--item-diff-x, 0px))"),a="calc(".concat(i*Math.sin(c*e),"px + var(--item-diff-y, 0px))");if("up"===r)return{left:s,bottom:a};if("down"===r)return{left:s,top:a};if("left"===r)return{right:a,top:s};if("right"===r)return{left:a,top:s}}else if("quarter-circle"===t){var l=this.direction,u=Math.PI/(2*(n-1)),d="calc(".concat(i*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(i*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===l)return{right:d,bottom:f};if("up-right"===l)return{left:d,bottom:f};if("down-left"===l)return{right:f,top:d};if("down-right"===l)return{left:f,top:d}}}return{}},getItemStyle:function(e){var t=this.calculateTransitionDelay(e),n=this.calculatePointStyle(e);return h({transitionDelay:"".concat(t,"ms")},n)},bindDocumentClickListener:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.d_visible&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:function(e){return"function"==typeof e.visible?e.visible():!1!==e.visible},isItemActive:function(e){return e===this.focusedOptionId},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{containerClass:function(){return[this.cx("root"),this.class]},focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:l.default,PlusIcon:u.default},directives:{ripple:d.default,tooltip:f.default}},O=["id","aria-activedescendant"],P=["id","aria-controls"],S=["href","target","onClick","aria-label"];return C.render=function(e,t,n,i,o,r){var c=s.resolveComponent("SDButton"),a=s.resolveDirective("ripple"),l=s.resolveDirective("tooltip");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",s.mergeProps({ref:r.containerRef,class:r.containerClass,style:[e.style,e.sx("root")]},e.ptm("root"),{"data-pc-name":"speeddial"}),[s.renderSlot(e.$slots,"button",{onClick:r.onClick,toggleCallback:r.onClick},(function(){return[s.createVNode(c,{type:"button",class:s.normalizeClass([e.cx("button"),e.buttonClass]),onClick:t[0]||(t[0]=function(e){return r.onClick(e)}),disabled:e.disabled,onKeydown:r.onTogglerKeydown,"aria-expanded":o.d_visible,"aria-haspopup":!0,"aria-controls":o.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button"),unstyled:e.unstyled},{icon:s.withCtx((function(){return[s.renderSlot(e.$slots,"icon",{visible:o.d_visible},(function(){return[o.d_visible&&e.hideIcon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.hideIcon?"span":"PlusIcon"),s.mergeProps({key:0,class:e.cx("buttonIcon")},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"])):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.showIcon?"span":"PlusIcon"),s.mergeProps({key:1,class:o.d_visible&&e.hideIcon?e.hideIcon:e.showIcon},e.ptm("button").icon,{"data-pc-section":"icon"}),null,16,["class"]))]}))]})),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt","unstyled"])]})),s.createElementVNode("ul",s.mergeProps({ref:r.listRef,id:o.id+"_list",class:e.cx("menu"),style:e.sx("menu"),role:"menu","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:"-1",onFocus:t[1]||(t[1]=function(){return r.onFocus&&r.onFocus.apply(r,arguments)}),onBlur:t[2]||(t[2]=function(){return r.onBlur&&r.onBlur.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onKeyDown&&r.onKeyDown.apply(r,arguments)})},e.ptm("menu")),[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.model,(function(t,n){return s.openBlock(),s.createElementBlock(s.Fragment,{key:n},[r.isItemVisible(t)?(s.openBlock(),s.createElementBlock("li",s.mergeProps({key:0,id:"".concat(o.id,"_").concat(n),"aria-controls":"".concat(o.id,"_item"),class:e.cx("menuitem",{id:"".concat(o.id,"_").concat(n)}),style:r.getItemStyle(n),role:"menuitem"},r.getPTOptions("".concat(o.id,"_").concat(n),"menuitem")),[e.$slots.item?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:function(e){return r.onItemClick(e,t)}},null,8,["item","onClick"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",s.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:e.cx("action",{item:t}),target:t.target,onClick:function(e){return r.onItemClick(e,t)},"aria-label":t.label},r.getPTOptions("".concat(o.id,"_").concat(n),"action")),[t.icon?(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:0,class:[e.cx("actionIcon"),t.icon]},r.getPTOptions("".concat(o.id,"_").concat(n),"actionIcon")),null,16)):s.createCommentVNode("",!0)],16,S)),[[a],[l,{value:t.label,disabled:!e.tooltipOptions},e.tooltipOptions]])],16,P)):s.createCommentVNode("",!0)],64)})),128))],16,O)],16),e.mask?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:[e.cx("mask"),e.maskClass],style:e.maskStyle},e.ptm("mask")),null,16)):s.createCommentVNode("",!0)],64)},C}(primevue.button,primevue.icons.plus,primevue.ripple,primevue.tooltip,primevue.utils,primevue.basecomponent,primevue.speeddial.style,Vue);
|
package/splitter/Splitter.vue
CHANGED
|
@@ -133,13 +133,12 @@ export default {
|
|
|
133
133
|
newNextPanelSize = this.nextPanelSize - newPos;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
137
|
-
|
|
138
136
|
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
|
|
139
137
|
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
140
138
|
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
141
139
|
this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;
|
|
142
140
|
this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;
|
|
141
|
+
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
this.$emit('resize', { originalEvent: event, sizes: this.panelSizes });
|
package/splitter/splitter.cjs.js
CHANGED
|
@@ -151,12 +151,12 @@ var script = {
|
|
|
151
151
|
newPrevPanelSize = this.prevPanelSize + newPos;
|
|
152
152
|
newNextPanelSize = this.nextPanelSize - newPos;
|
|
153
153
|
}
|
|
154
|
-
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
155
154
|
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
|
|
156
155
|
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
157
156
|
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
158
157
|
this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;
|
|
159
158
|
this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;
|
|
159
|
+
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
160
160
|
}
|
|
161
161
|
this.$emit('resize', {
|
|
162
162
|
originalEvent: event,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/splitter/style"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){return u(e)||l(e)||a(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var c={name:"Splitter",extends:{name:"BaseSplitter",extends:s(t).default,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:s(n).default,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.DomHandler.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.DomHandler.getWidth(this.$el):e.DomHandler.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.prevSize=parseFloat(s).toFixed(4),this.validateResize(s,r)&&(this.prevPanelElement.style.flexBasis="calc("+s+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+r+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=s,this.panelSizes[this.prevPanelIndex+1]=r),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach((function(e){return e.setAttribute("data-p-gutter-resizing",!1)})),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,t,n){this.onResizeStart(e,t,!0),this.onResize(e,n,!0)},setTimer:function(e,t,n){var i=this;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,t,n)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,t){switch(e.code){case"ArrowLeft":"horizontal"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowRight":"horizontal"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault();break;case"ArrowDown":"vertical"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowUp":"vertical"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault()}},onGutterMouseDown:function(e,t){this.onResizeStart(e,t),this.bindMouseListeners()},onGutterTouchStart:function(e,t){this.onResizeStart(e,t),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(t){return e.onResize(t)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(t){e.onResizeEnd(t),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(t){return e.onResize(t.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(t){e.resizeEnd(t),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(t,n){if(t>100||t<0)return!1;if(n>100||n<0)return!1;var i=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&i&&i>t)return!1;var s=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&s&&s>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return null!=this.stateKey},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){e.ObjectUtils.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,t=this.getStorage().getItem(this.stateKey);return!!t&&(this.panelSizes=JSON.parse(t),r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})).forEach((function(t,n){t.style.flexBasis="calc("+e.panelSizes[n]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),!0)}},computed:{panels:function(){var e=this,t=[];return this.$slots.default().forEach((function(n){e.isSplitterPanel(n)?t.push(n):n.children instanceof Array&&n.children.forEach((function(n){e.isSplitterPanel(n)&&t.push(n)}))})),t},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return"horizontal"===this.layout}}},p=["onMousedown","onTouchstart","onTouchmove","onTouchend"],d=["aria-orientation","aria-valuenow","onKeydown"];c.render=function(e,t,n,s,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),style:e.sx("root"),"data-p-resizing":!1},e.ptm("root",o.getPTOptions()),{"data-pc-name":"splitter"}),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.panels,(function(n,s){return i.openBlock(),i.createElementBlock(i.Fragment,{key:s},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n),{tabindex:"-1"})),s!==o.panels.length-1?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,ref_for:!0,ref:"gutter",class:e.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(e){return o.onGutterMouseDown(e,s)},onTouchstart:function(e){return o.onGutterTouchStart(e,s)},onTouchmove:function(e){return o.onGutterTouchMove(e,s)},onTouchend:function(e){return o.onGutterTouchEnd(e,s)},"data-p-gutter-resizing":!1},e.ptm("gutter")),[i.createElementVNode("div",i.mergeProps({class:e.cx("gutterHandler"),tabindex:"0",style:[o.gutterStyle],"aria-orientation":e.layout,"aria-valuenow":r.prevSize,onKeyup:t[0]||(t[0]=function(){return o.onGutterKeyUp&&o.onGutterKeyUp.apply(o,arguments)}),onKeydown:function(e){return o.onGutterKeyDown(e,s)}},e.ptm("gutterHandler")),null,16,d)],16,p)):i.createCommentVNode("",!0)],64)})),128))],16)},module.exports=c;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/basecomponent"),n=require("primevue/splitter/style"),i=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){return u(e)||l(e)||a(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var c={name:"Splitter",extends:{name:"BaseSplitter",extends:s(t).default,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:s(n).default,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.DomHandler.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.DomHandler.getWidth(this.$el):e.DomHandler.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.validateResize(s,r)&&(this.prevPanelElement.style.flexBasis="calc("+s+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+r+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=s,this.panelSizes[this.prevPanelIndex+1]=r,this.prevSize=parseFloat(s).toFixed(4)),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach((function(e){return e.setAttribute("data-p-gutter-resizing",!1)})),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,t,n){this.onResizeStart(e,t,!0),this.onResize(e,n,!0)},setTimer:function(e,t,n){var i=this;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,t,n)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,t){switch(e.code){case"ArrowLeft":"horizontal"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowRight":"horizontal"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault();break;case"ArrowDown":"vertical"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowUp":"vertical"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault()}},onGutterMouseDown:function(e,t){this.onResizeStart(e,t),this.bindMouseListeners()},onGutterTouchStart:function(e,t){this.onResizeStart(e,t),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(t){return e.onResize(t)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(t){e.onResizeEnd(t),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(t){return e.onResize(t.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(t){e.resizeEnd(t),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(t,n){if(t>100||t<0)return!1;if(n>100||n<0)return!1;var i=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&i&&i>t)return!1;var s=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&s&&s>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return null!=this.stateKey},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){e.ObjectUtils.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,t=this.getStorage().getItem(this.stateKey);return!!t&&(this.panelSizes=JSON.parse(t),r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})).forEach((function(t,n){t.style.flexBasis="calc("+e.panelSizes[n]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),!0)}},computed:{panels:function(){var e=this,t=[];return this.$slots.default().forEach((function(n){e.isSplitterPanel(n)?t.push(n):n.children instanceof Array&&n.children.forEach((function(n){e.isSplitterPanel(n)&&t.push(n)}))})),t},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return"horizontal"===this.layout}}},p=["onMousedown","onTouchstart","onTouchmove","onTouchend"],d=["aria-orientation","aria-valuenow","onKeydown"];c.render=function(e,t,n,s,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),style:e.sx("root"),"data-p-resizing":!1},e.ptm("root",o.getPTOptions()),{"data-pc-name":"splitter"}),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.panels,(function(n,s){return i.openBlock(),i.createElementBlock(i.Fragment,{key:s},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n),{tabindex:"-1"})),s!==o.panels.length-1?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,ref_for:!0,ref:"gutter",class:e.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(e){return o.onGutterMouseDown(e,s)},onTouchstart:function(e){return o.onGutterTouchStart(e,s)},onTouchmove:function(e){return o.onGutterTouchMove(e,s)},onTouchend:function(e){return o.onGutterTouchEnd(e,s)},"data-p-gutter-resizing":!1},e.ptm("gutter")),[i.createElementVNode("div",i.mergeProps({class:e.cx("gutterHandler"),tabindex:"0",style:[o.gutterStyle],"aria-orientation":e.layout,"aria-valuenow":r.prevSize,onKeyup:t[0]||(t[0]=function(){return o.onGutterKeyUp&&o.onGutterKeyUp.apply(o,arguments)}),onKeydown:function(e){return o.onGutterKeyDown(e,s)}},e.ptm("gutterHandler")),null,16,d)],16,p)):i.createCommentVNode("",!0)],64)})),128))],16)},module.exports=c;
|
package/splitter/splitter.esm.js
CHANGED
|
@@ -144,12 +144,12 @@ var script = {
|
|
|
144
144
|
newPrevPanelSize = this.prevPanelSize + newPos;
|
|
145
145
|
newNextPanelSize = this.nextPanelSize - newPos;
|
|
146
146
|
}
|
|
147
|
-
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
148
147
|
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
|
|
149
148
|
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
150
149
|
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
151
150
|
this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;
|
|
152
151
|
this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;
|
|
152
|
+
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
153
153
|
}
|
|
154
154
|
this.$emit('resize', {
|
|
155
155
|
originalEvent: event,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DomHandler as e,ObjectUtils as t}from"primevue/utils";import n from"primevue/basecomponent";import i from"primevue/splitter/style";import{openBlock as s,createElementBlock as r,mergeProps as o,Fragment as a,renderList as u,createBlock as l,resolveDynamicComponent as h,createElementVNode as p,createCommentVNode as c}from"vue";function d(e){return g(e)||v(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e){if(Array.isArray(e))return z(e)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var S={name:"Splitter",extends:{name:"BaseSplitter",extends:n,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:i,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=d(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.getWidth(this.$el):e.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.getOuterWidth(this.prevPanelElement,!0):e.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.getOuterWidth(this.nextPanelElement,!0):e.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.getOuterWidth(this.prevPanelElement,!0):e.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.getOuterWidth(this.nextPanelElement,!0):e.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.
|
|
1
|
+
import{DomHandler as e,ObjectUtils as t}from"primevue/utils";import n from"primevue/basecomponent";import i from"primevue/splitter/style";import{openBlock as s,createElementBlock as r,mergeProps as o,Fragment as a,renderList as u,createBlock as l,resolveDynamicComponent as h,createElementVNode as p,createCommentVNode as c}from"vue";function d(e){return g(e)||v(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e){if(Array.isArray(e))return z(e)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var S={name:"Splitter",extends:{name:"BaseSplitter",extends:n,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:i,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=d(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.getWidth(this.$el):e.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.getOuterWidth(this.prevPanelElement,!0):e.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.getOuterWidth(this.nextPanelElement,!0):e.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.getOuterWidth(this.prevPanelElement,!0):e.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.getOuterWidth(this.nextPanelElement,!0):e.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.validateResize(s,r)&&(this.prevPanelElement.style.flexBasis="calc("+s+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+r+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=s,this.panelSizes[this.prevPanelIndex+1]=r,this.prevSize=parseFloat(s).toFixed(4)),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach((function(e){return e.setAttribute("data-p-gutter-resizing",!1)})),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,t,n){this.onResizeStart(e,t,!0),this.onResize(e,n,!0)},setTimer:function(e,t,n){var i=this;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,t,n)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,t){switch(e.code){case"ArrowLeft":"horizontal"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowRight":"horizontal"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault();break;case"ArrowDown":"vertical"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowUp":"vertical"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault()}},onGutterMouseDown:function(e,t){this.onResizeStart(e,t),this.bindMouseListeners()},onGutterTouchStart:function(e,t){this.onResizeStart(e,t),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(t){return e.onResize(t)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(t){e.onResizeEnd(t),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(t){return e.onResize(t.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(t){e.resizeEnd(t),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(e,n){if(e>100||e<0)return!1;if(n>100||n<0)return!1;var i=t.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&i&&i>e)return!1;var s=t.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&s&&s>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return null!=this.stateKey},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){t.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,t=this.getStorage().getItem(this.stateKey);return!!t&&(this.panelSizes=JSON.parse(t),d(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})).forEach((function(t,n){t.style.flexBasis="calc("+e.panelSizes[n]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),!0)}},computed:{panels:function(){var e=this,t=[];return this.$slots.default().forEach((function(n){e.isSplitterPanel(n)?t.push(n):n.children instanceof Array&&n.children.forEach((function(n){e.isSplitterPanel(n)&&t.push(n)}))})),t},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return"horizontal"===this.layout}}},y=["onMousedown","onTouchstart","onTouchmove","onTouchend"],E=["aria-orientation","aria-valuenow","onKeydown"];S.render=function(e,t,n,i,d,m){return s(),r("div",o({class:e.cx("root"),style:e.sx("root"),"data-p-resizing":!1},e.ptm("root",m.getPTOptions()),{"data-pc-name":"splitter"}),[(s(!0),r(a,null,u(m.panels,(function(n,i){return s(),r(a,{key:i},[(s(),l(h(n),{tabindex:"-1"})),i!==m.panels.length-1?(s(),r("div",o({key:0,ref_for:!0,ref:"gutter",class:e.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(e){return m.onGutterMouseDown(e,i)},onTouchstart:function(e){return m.onGutterTouchStart(e,i)},onTouchmove:function(e){return m.onGutterTouchMove(e,i)},onTouchend:function(e){return m.onGutterTouchEnd(e,i)},"data-p-gutter-resizing":!1},e.ptm("gutter")),[p("div",o({class:e.cx("gutterHandler"),tabindex:"0",style:[m.gutterStyle],"aria-orientation":e.layout,"aria-valuenow":d.prevSize,onKeyup:t[0]||(t[0]=function(){return m.onGutterKeyUp&&m.onGutterKeyUp.apply(m,arguments)}),onKeydown:function(e){return m.onGutterKeyDown(e,i)}},e.ptm("gutterHandler")),null,16,E)],16,y)):c("",!0)],64)})),128))],16)};export{S as default};
|
package/splitter/splitter.js
CHANGED
|
@@ -148,12 +148,12 @@ this.primevue.splitter = (function (utils, BaseComponent, SplitterStyle, vue) {
|
|
|
148
148
|
newPrevPanelSize = this.prevPanelSize + newPos;
|
|
149
149
|
newNextPanelSize = this.nextPanelSize - newPos;
|
|
150
150
|
}
|
|
151
|
-
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
152
151
|
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
|
|
153
152
|
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
154
153
|
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
|
|
155
154
|
this.panelSizes[this.prevPanelIndex] = newPrevPanelSize;
|
|
156
155
|
this.panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;
|
|
156
|
+
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
|
|
157
157
|
}
|
|
158
158
|
this.$emit('resize', {
|
|
159
159
|
originalEvent: event,
|
package/splitter/splitter.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.splitter=function(e,t,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){return u(e)||l(e)||a(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var c={name:"Splitter",extends:{name:"BaseSplitter",extends:s(t).default,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:s(n).default,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.DomHandler.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.DomHandler.getWidth(this.$el):e.DomHandler.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.prevSize=parseFloat(s).toFixed(4),this.validateResize(s,r)&&(this.prevPanelElement.style.flexBasis="calc("+s+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+r+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=s,this.panelSizes[this.prevPanelIndex+1]=r),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach((function(e){return e.setAttribute("data-p-gutter-resizing",!1)})),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,t,n){this.onResizeStart(e,t,!0),this.onResize(e,n,!0)},setTimer:function(e,t,n){var i=this;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,t,n)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,t){switch(e.code){case"ArrowLeft":"horizontal"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowRight":"horizontal"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault();break;case"ArrowDown":"vertical"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowUp":"vertical"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault()}},onGutterMouseDown:function(e,t){this.onResizeStart(e,t),this.bindMouseListeners()},onGutterTouchStart:function(e,t){this.onResizeStart(e,t),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(t){return e.onResize(t)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(t){e.onResizeEnd(t),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(t){return e.onResize(t.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(t){e.resizeEnd(t),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(t,n){if(t>100||t<0)return!1;if(n>100||n<0)return!1;var i=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&i&&i>t)return!1;var s=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&s&&s>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return null!=this.stateKey},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){e.ObjectUtils.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,t=this.getStorage().getItem(this.stateKey);return!!t&&(this.panelSizes=JSON.parse(t),r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})).forEach((function(t,n){t.style.flexBasis="calc("+e.panelSizes[n]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),!0)}},computed:{panels:function(){var e=this,t=[];return this.$slots.default().forEach((function(n){e.isSplitterPanel(n)?t.push(n):n.children instanceof Array&&n.children.forEach((function(n){e.isSplitterPanel(n)&&t.push(n)}))})),t},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return"horizontal"===this.layout}}},p=["onMousedown","onTouchstart","onTouchmove","onTouchend"],d=["aria-orientation","aria-valuenow","onKeydown"];return c.render=function(e,t,n,s,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),style:e.sx("root"),"data-p-resizing":!1},e.ptm("root",o.getPTOptions()),{"data-pc-name":"splitter"}),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.panels,(function(n,s){return i.openBlock(),i.createElementBlock(i.Fragment,{key:s},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n),{tabindex:"-1"})),s!==o.panels.length-1?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,ref_for:!0,ref:"gutter",class:e.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(e){return o.onGutterMouseDown(e,s)},onTouchstart:function(e){return o.onGutterTouchStart(e,s)},onTouchmove:function(e){return o.onGutterTouchMove(e,s)},onTouchend:function(e){return o.onGutterTouchEnd(e,s)},"data-p-gutter-resizing":!1},e.ptm("gutter")),[i.createElementVNode("div",i.mergeProps({class:e.cx("gutterHandler"),tabindex:"0",style:[o.gutterStyle],"aria-orientation":e.layout,"aria-valuenow":r.prevSize,onKeyup:t[0]||(t[0]=function(){return o.onGutterKeyUp&&o.onGutterKeyUp.apply(o,arguments)}),onKeydown:function(e){return o.onGutterKeyDown(e,s)}},e.ptm("gutterHandler")),null,16,d)],16,p)):i.createCommentVNode("",!0)],64)})),128))],16)},c}(primevue.utils,primevue.basecomponent,primevue.splitter.style,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.splitter=function(e,t,n,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){return u(e)||l(e)||a(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var c={name:"Splitter",extends:{name:"BaseSplitter",extends:s(t).default,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:s(n).default,provide:function(){return{$parentInstance:this}}},emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){var e=this;if(this.panels&&this.panels.length){var t=!1;if(this.isStateful()&&(t=this.restoreState()),!t){var n=r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})),i=[];this.panels.map((function(t,s){var r=(t.props&&t.props.size?t.props.size:null)||100/e.panels.length;i[s]=r,n[s].style.flexBasis="calc("+r+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),this.panelSizes=i,this.prevSize=parseFloat(i[0]).toFixed(4)}}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{getPTOptions:function(){var t;return{context:{nested:"splitterpanel"===e.DomHandler.getAttribute(null===(t=this.$parentInstance)||void 0===t?void 0:t.$el,"data-pc-name")}}},isSplitterPanel:function(e){return"SplitterPanel"===e.type.name},onResizeStart:function(t,n,i){this.gutterElement=t.currentTarget||t.target.parentElement,this.size=this.horizontal?e.DomHandler.getWidth(this.$el):e.DomHandler.getHeight(this.$el),i||(this.dragging=!0,this.startPos="horizontal"===this.layout?t.pageX||t.changedTouches[0].pageX:t.pageY||t.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,i?(this.prevPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.prevPanelElement,!0):e.DomHandler.getOuterHeight(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?e.DomHandler.getOuterWidth(this.nextPanelElement,!0):e.DomHandler.getOuterHeight(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:t,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,t,n){var i,s,r;n?this.horizontal?(s=100*(this.prevPanelSize+t)/this.size,r=100*(this.nextPanelSize-t)/this.size):(s=100*(this.prevPanelSize-t)/this.size,r=100*(this.nextPanelSize+t)/this.size):(s=this.prevPanelSize+(i=this.horizontal?100*e.pageX/this.size-100*this.startPos/this.size:100*e.pageY/this.size-100*this.startPos/this.size),r=this.nextPanelSize-i),this.validateResize(s,r)&&(this.prevPanelElement.style.flexBasis="calc("+s+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+r+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=s,this.panelSizes[this.prevPanelIndex+1]=r,this.prevSize=parseFloat(s).toFixed(4)),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach((function(e){return e.setAttribute("data-p-gutter-resizing",!1)})),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,t,n){this.onResizeStart(e,t,!0),this.onResize(e,n,!0)},setTimer:function(e,t,n){var i=this;this.clearTimer(),this.timer=setTimeout((function(){i.repeat(e,t,n)}),40)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,t){switch(e.code){case"ArrowLeft":"horizontal"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowRight":"horizontal"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault();break;case"ArrowDown":"vertical"===this.layout&&this.setTimer(e,t,-1*this.step),e.preventDefault();break;case"ArrowUp":"vertical"===this.layout&&this.setTimer(e,t,this.step),e.preventDefault()}},onGutterMouseDown:function(e,t){this.onResizeStart(e,t),this.bindMouseListeners()},onGutterTouchStart:function(e,t){this.onResizeStart(e,t),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(t){return e.onResize(t)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(t){e.onResizeEnd(t),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(t){return e.onResize(t.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(t){e.resizeEnd(t),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(t,n){if(t>100||t<0)return!1;if(n>100||n<0)return!1;var i=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex],"minSize");if(this.panels[this.prevPanelIndex].props&&i&&i>t)return!1;var s=e.ObjectUtils.getVNodeProp(this.panels[this.prevPanelIndex+1],"minSize");return!(this.panels[this.prevPanelIndex+1].props&&s&&s>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return null!=this.stateKey},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){e.ObjectUtils.isArray(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,t=this.getStorage().getItem(this.stateKey);return!!t&&(this.panelSizes=JSON.parse(t),r(this.$el.children).filter((function(e){return"splitterpanel"===e.getAttribute("data-pc-name")})).forEach((function(t,n){t.style.flexBasis="calc("+e.panelSizes[n]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"})),!0)}},computed:{panels:function(){var e=this,t=[];return this.$slots.default().forEach((function(n){e.isSplitterPanel(n)?t.push(n):n.children instanceof Array&&n.children.forEach((function(n){e.isSplitterPanel(n)&&t.push(n)}))})),t},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return"horizontal"===this.layout}}},p=["onMousedown","onTouchstart","onTouchmove","onTouchend"],d=["aria-orientation","aria-valuenow","onKeydown"];return c.render=function(e,t,n,s,r,o){return i.openBlock(),i.createElementBlock("div",i.mergeProps({class:e.cx("root"),style:e.sx("root"),"data-p-resizing":!1},e.ptm("root",o.getPTOptions()),{"data-pc-name":"splitter"}),[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.panels,(function(n,s){return i.openBlock(),i.createElementBlock(i.Fragment,{key:s},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n),{tabindex:"-1"})),s!==o.panels.length-1?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,ref_for:!0,ref:"gutter",class:e.cx("gutter"),role:"separator",tabindex:"-1",onMousedown:function(e){return o.onGutterMouseDown(e,s)},onTouchstart:function(e){return o.onGutterTouchStart(e,s)},onTouchmove:function(e){return o.onGutterTouchMove(e,s)},onTouchend:function(e){return o.onGutterTouchEnd(e,s)},"data-p-gutter-resizing":!1},e.ptm("gutter")),[i.createElementVNode("div",i.mergeProps({class:e.cx("gutterHandler"),tabindex:"0",style:[o.gutterStyle],"aria-orientation":e.layout,"aria-valuenow":r.prevSize,onKeyup:t[0]||(t[0]=function(){return o.onGutterKeyUp&&o.onGutterKeyUp.apply(o,arguments)}),onKeydown:function(e){return o.onGutterKeyDown(e,s)}},e.ptm("gutterHandler")),null,16,d)],16,p)):i.createCommentVNode("",!0)],64)})),128))],16)},c}(primevue.utils,primevue.basecomponent,primevue.splitter.style,Vue);
|
|
@@ -21,8 +21,13 @@ export interface StyleClassOptions {
|
|
|
21
21
|
selector?: '@next' | '@prev' | '@parent' | '@grandparent' | string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Style class to add when item begins to get displayed.
|
|
24
|
+
* @deprecated since v3.41.0. Use 'enterFromClass' option instead.
|
|
24
25
|
*/
|
|
25
26
|
enterClass?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Style class to add when item begins to get displayed.
|
|
29
|
+
*/
|
|
30
|
+
enterFromClass?: string | undefined;
|
|
26
31
|
/**
|
|
27
32
|
* Style class to add during enter animation.
|
|
28
33
|
*/
|
|
@@ -33,8 +38,13 @@ export interface StyleClassOptions {
|
|
|
33
38
|
enterToClass?: string | undefined;
|
|
34
39
|
/**
|
|
35
40
|
* Style class to add when item begins to get hidden.
|
|
41
|
+
* @deprecated since v3.41.0. Use 'leaveFromClass' option instead.
|
|
36
42
|
*/
|
|
37
43
|
leaveClass?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Style class to add when item begins to get hidden.
|
|
46
|
+
*/
|
|
47
|
+
leaveFromClass?: string | undefined;
|
|
38
48
|
/**
|
|
39
49
|
* Style class to add during leave animation.
|
|
40
50
|
*/
|
|
@@ -50,9 +50,14 @@ var StyleClass = BaseStyleClass.extend('styleclass', {
|
|
|
50
50
|
target.style.height = '';
|
|
51
51
|
}
|
|
52
52
|
utils.DomHandler.addClass(target, binding.value.enterActiveClass);
|
|
53
|
+
|
|
54
|
+
// enterClass will be deprecated, use enterFromClass
|
|
53
55
|
if (binding.value.enterClass) {
|
|
54
56
|
utils.DomHandler.removeClass(target, binding.value.enterClass);
|
|
55
57
|
}
|
|
58
|
+
if (binding.value.enterFromClass) {
|
|
59
|
+
utils.DomHandler.removeClass(target, binding.value.enterFromClass);
|
|
60
|
+
}
|
|
56
61
|
target.$p_styleclass_enterlistener = function () {
|
|
57
62
|
utils.DomHandler.removeClass(target, binding.value.enterActiveClass);
|
|
58
63
|
if (binding.value.enterToClass) {
|
|
@@ -67,9 +72,13 @@ var StyleClass = BaseStyleClass.extend('styleclass', {
|
|
|
67
72
|
target.addEventListener('animationend', target.$p_styleclass_enterlistener);
|
|
68
73
|
}
|
|
69
74
|
} else {
|
|
75
|
+
// enterClass will be deprecated, use enterFromClass
|
|
70
76
|
if (binding.value.enterClass) {
|
|
71
77
|
utils.DomHandler.removeClass(target, binding.value.enterClass);
|
|
72
78
|
}
|
|
79
|
+
if (binding.value.enterFromClass) {
|
|
80
|
+
utils.DomHandler.removeClass(target, binding.value.enterFromClass);
|
|
81
|
+
}
|
|
73
82
|
if (binding.value.enterToClass) {
|
|
74
83
|
utils.DomHandler.addClass(target, binding.value.enterToClass);
|
|
75
84
|
}
|
|
@@ -83,9 +92,14 @@ var StyleClass = BaseStyleClass.extend('styleclass', {
|
|
|
83
92
|
if (!target.$_pstyleclass_animating) {
|
|
84
93
|
target.$_pstyleclass_animating = true;
|
|
85
94
|
utils.DomHandler.addClass(target, binding.value.leaveActiveClass);
|
|
95
|
+
|
|
96
|
+
// leaveClass will be deprecated, use leaveFromClass
|
|
86
97
|
if (binding.value.leaveClass) {
|
|
87
98
|
utils.DomHandler.removeClass(target, binding.value.leaveClass);
|
|
88
99
|
}
|
|
100
|
+
if (binding.value.leaveFromClass) {
|
|
101
|
+
utils.DomHandler.removeClass(target, binding.value.leaveFromClass);
|
|
102
|
+
}
|
|
89
103
|
target.$p_styleclass_leavelistener = function () {
|
|
90
104
|
utils.DomHandler.removeClass(target, binding.value.leaveActiveClass);
|
|
91
105
|
if (binding.value.leaveToClass) {
|
|
@@ -97,9 +111,13 @@ var StyleClass = BaseStyleClass.extend('styleclass', {
|
|
|
97
111
|
target.addEventListener('animationend', target.$p_styleclass_leavelistener);
|
|
98
112
|
}
|
|
99
113
|
} else {
|
|
114
|
+
// leaveClass will be deprecated, use leaveFromClass
|
|
100
115
|
if (binding.value.leaveClass) {
|
|
101
116
|
utils.DomHandler.removeClass(target, binding.value.leaveClass);
|
|
102
117
|
}
|
|
118
|
+
if (binding.value.leaveFromClass) {
|
|
119
|
+
utils.DomHandler.removeClass(target, binding.value.leaveFromClass);
|
|
120
|
+
}
|
|
103
121
|
if (binding.value.leaveToClass) {
|
|
104
122
|
utils.DomHandler.addClass(target, binding.value.leaveToClass);
|
|
105
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("primevue/basedirective")).default.extend({}).extend("styleclass",{mounted:function(e,s){e.setAttribute("data-pd-styleclass",!0),this.bind(e,s)},unmounted:function(e){this.unbind(e)},methods:{bind:function(s,l){var
|
|
1
|
+
"use strict";var e=require("primevue/utils");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("primevue/basedirective")).default.extend({}).extend("styleclass",{mounted:function(e,s){e.setAttribute("data-pd-styleclass",!0),this.bind(e,s)},unmounted:function(e){this.unbind(e)},methods:{bind:function(s,l){var a=this,t=this.resolveTarget(s,l);this.$el=t,s.$_pstyleclass_clicklistener=function(){l.value.toggleClass?e.DomHandler.hasClass(t,l.value.toggleClass)?e.DomHandler.removeClass(t,l.value.toggleClass):e.DomHandler.addClass(t,l.value.toggleClass):null===t.offsetParent?a.enter(t,s,l):a.leave(t,l)},s.addEventListener("click",s.$_pstyleclass_clicklistener)},unbind:function(e){e.$_pstyleclass_clicklistener&&(e.removeEventListener("click",e.$_pstyleclass_clicklistener),e.$_pstyleclass_clicklistener=null),this.unbindDocumentListener(e)},enter:function(s,l,a){a.value.enterActiveClass?s.$_pstyleclass_animating||(s.$_pstyleclass_animating=!0,"slidedown"===a.value.enterActiveClass&&(s.style.height="0px",e.DomHandler.removeClass(s,"hidden"),s.style.maxHeight=s.scrollHeight+"px",e.DomHandler.addClass(s,"hidden"),s.style.height=""),e.DomHandler.addClass(s,a.value.enterActiveClass),a.value.enterClass&&e.DomHandler.removeClass(s,a.value.enterClass),a.value.enterFromClass&&e.DomHandler.removeClass(s,a.value.enterFromClass),s.$p_styleclass_enterlistener=function(){e.DomHandler.removeClass(s,a.value.enterActiveClass),a.value.enterToClass&&e.DomHandler.addClass(s,a.value.enterToClass),s.removeEventListener("animationend",s.$p_styleclass_enterlistener),"slidedown"===a.value.enterActiveClass&&(s.style.maxHeight=""),s.$_pstyleclass_animating=!1},s.addEventListener("animationend",s.$p_styleclass_enterlistener)):(a.value.enterClass&&e.DomHandler.removeClass(s,a.value.enterClass),a.value.enterFromClass&&e.DomHandler.removeClass(s,a.value.enterFromClass),a.value.enterToClass&&e.DomHandler.addClass(s,a.value.enterToClass)),a.value.hideOnOutsideClick&&this.bindDocumentListener(s,l,a)},leave:function(s,l){l.value.leaveActiveClass?s.$_pstyleclass_animating||(s.$_pstyleclass_animating=!0,e.DomHandler.addClass(s,l.value.leaveActiveClass),l.value.leaveClass&&e.DomHandler.removeClass(s,l.value.leaveClass),l.value.leaveFromClass&&e.DomHandler.removeClass(s,l.value.leaveFromClass),s.$p_styleclass_leavelistener=function(){e.DomHandler.removeClass(s,l.value.leaveActiveClass),l.value.leaveToClass&&e.DomHandler.addClass(s,l.value.leaveToClass),s.removeEventListener("animationend",s.$p_styleclass_leavelistener),s.$_pstyleclass_animating=!1},s.addEventListener("animationend",s.$p_styleclass_leavelistener)):(l.value.leaveClass&&e.DomHandler.removeClass(s,l.value.leaveClass),l.value.leaveFromClass&&e.DomHandler.removeClass(s,l.value.leaveFromClass),l.value.leaveToClass&&e.DomHandler.addClass(s,l.value.leaveToClass)),l.value.hideOnOutsideClick&&this.unbindDocumentListener(s)},resolveTarget:function(e,s){switch(s.value.selector){case"@next":return e.nextElementSibling;case"@prev":return e.previousElementSibling;case"@parent":return e.parentElement;case"@grandparent":return e.parentElement.parentElement;default:return document.querySelector(s.value.selector)}},bindDocumentListener:function(e,s,l){var a=this;e.$p_styleclass_documentlistener||(e.$p_styleclass_documentlistener=function(t){a.isVisible(e)&&"static"!==getComputedStyle(e).getPropertyValue("position")?a.isOutsideClick(t,e,s)&&a.leave(e,l):a.unbindDocumentListener(e)},e.ownerDocument.addEventListener("click",e.$p_styleclass_documentlistener))},unbindDocumentListener:function(e){e.$p_styleclass_documentlistener&&(e.ownerDocument.removeEventListener("click",e.$p_styleclass_documentlistener),e.$p_styleclass_documentlistener=null)},isVisible:function(e){return null!==e.offsetParent},isOutsideClick:function(e,s,l){return!l.isSameNode(e.target)&&!l.contains(e.target)&&!s.contains(e.target)}}});module.exports=l;
|