primereact 7.0.0-rc.1 → 7.1.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/README.md +35 -10
- package/accordion/accordion.cjs.js +40 -27
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +7 -3
- package/accordion/accordion.esm.js +27 -14
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +40 -28
- package/accordion/accordion.min.js +1 -1
- package/api/api.cjs.js +82 -46
- package/api/api.cjs.min.js +1 -1
- package/api/api.d.ts +95 -61
- package/api/api.esm.js +69 -33
- package/api/api.esm.min.js +1 -1
- package/api/api.js +83 -47
- package/api/api.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +79 -71
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +11 -4
- package/autocomplete/autocomplete.esm.js +16 -8
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +75 -72
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/avatar.cjs.js +10 -9
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.d.ts +2 -1
- package/avatar/avatar.esm.js +5 -4
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -10
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/avatargroup.cjs.js +3 -3
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +4 -4
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/badge.cjs.js +3 -3
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +1 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +4 -4
- package/badge/badge.min.js +1 -1
- package/blockui/blockui.cjs.js +27 -16
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +17 -7
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +26 -17
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +16 -16
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -17
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +42 -53
- package/button/button.cjs.min.js +1 -1
- package/button/button.d.ts +4 -11
- package/button/button.esm.js +31 -42
- package/button/button.esm.min.js +1 -1
- package/button/button.js +41 -54
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +193 -154
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +7 -2
- package/calendar/calendar.esm.js +68 -29
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +189 -155
- package/calendar/calendar.min.css +1 -1
- package/calendar/calendar.min.js +1 -1
- package/captcha/captcha.cjs.js +1 -1
- package/captcha/captcha.cjs.min.js +1 -1
- package/captcha/captcha.esm.min.js +1 -1
- package/captcha/captcha.js +2 -2
- package/captcha/captcha.min.js +1 -1
- package/card/card.cjs.js +13 -13
- package/card/card.cjs.min.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +14 -14
- package/card/card.min.js +1 -1
- package/carousel/carousel.cjs.js +45 -45
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +10 -10
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +45 -46
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +51 -47
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +2 -1
- package/cascadeselect/cascadeselect.esm.js +7 -3
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +48 -48
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/chart.cjs.js +6 -8
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +5 -5
- package/chart/chart.min.js +1 -1
- package/checkbox/checkbox.cjs.js +20 -15
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +2 -1
- package/checkbox/checkbox.esm.js +13 -8
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +20 -16
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +16 -14
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +3 -4
- package/chip/chip.esm.js +11 -9
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +17 -15
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +46 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +10 -0
- package/chips/chips.esm.js +37 -11
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +46 -21
- package/chips/chips.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +35 -31
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.d.ts +20 -6
- package/colorpicker/colorpicker.esm.js +7 -3
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +32 -32
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.cjs.min.js +1 -1
- package/column/column.d.ts +24 -2
- package/column/column.esm.min.js +1 -1
- package/column/column.js +1 -1
- package/column/column.min.js +1 -1
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +1 -1
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/confirmdialog.cjs.js +22 -20
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.d.ts +4 -3
- package/confirmdialog/confirmdialog.esm.js +6 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +22 -21
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/confirmpopup.cjs.js +46 -41
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.d.ts +6 -4
- package/confirmpopup/confirmpopup.esm.js +12 -8
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +43 -41
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/contextmenu.cjs.js +68 -63
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +2 -1
- package/contextmenu/contextmenu.esm.js +35 -31
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +65 -64
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +11228 -846
- package/core/core.min.js +40 -1
- package/csstransition/csstransition.cjs.js +49 -19
- package/csstransition/csstransition.cjs.min.js +1 -1
- package/csstransition/csstransition.d.ts +8 -0
- package/csstransition/csstransition.esm.js +48 -19
- package/csstransition/csstransition.esm.min.js +1 -1
- package/csstransition/csstransition.js +49 -21
- package/csstransition/csstransition.min.js +1 -1
- package/csstransition/package.json +2 -1
- package/datascroller/datascroller.cjs.js +12 -11
- package/datascroller/datascroller.cjs.min.js +1 -1
- package/datascroller/datascroller.esm.js +4 -3
- package/datascroller/datascroller.esm.min.js +1 -1
- package/datascroller/datascroller.js +12 -12
- package/datascroller/datascroller.min.js +1 -1
- package/datatable/datatable.cjs.js +600 -519
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +30 -14
- package/datatable/datatable.esm.js +321 -240
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +597 -520
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +32 -29
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +6 -3
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -30
- package/dataview/dataview.min.js +1 -1
- package/deferredcontent/deferredcontent.cjs.js +1 -1
- package/deferredcontent/deferredcontent.cjs.min.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +2 -2
- package/deferredcontent/deferredcontent.min.js +1 -1
- package/dialog/dialog.cjs.js +60 -59
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +3 -1
- package/dialog/dialog.esm.js +13 -13
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +57 -60
- package/dialog/dialog.min.js +1 -1
- package/divider/divider.cjs.js +4 -4
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +5 -5
- package/divider/divider.min.js +1 -1
- package/dock/dock.cjs.js +51 -17
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.d.ts +13 -0
- package/dock/dock.esm.js +39 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +51 -18
- package/dock/dock.min.css +1 -1
- package/dock/dock.min.js +1 -1
- package/dropdown/dropdown.cjs.js +99 -77
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +2 -1
- package/dropdown/dropdown.esm.js +37 -15
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +95 -78
- package/dropdown/dropdown.min.js +1 -1
- package/editor/editor.cjs.js +44 -42
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.d.ts +1 -0
- package/editor/editor.esm.js +8 -4
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +43 -39
- package/editor/editor.min.js +1 -1
- package/fieldset/fieldset.cjs.js +17 -15
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +2 -1
- package/fieldset/fieldset.esm.js +3 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +16 -16
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +63 -56
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +2 -1
- package/fileupload/fileupload.esm.js +24 -17
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +63 -57
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/fullcalendar.cjs.js +6 -8
- package/fullcalendar/fullcalendar.cjs.min.js +1 -1
- package/fullcalendar/fullcalendar.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +5 -5
- package/fullcalendar/fullcalendar.min.js +1 -1
- package/galleria/galleria.cjs.js +71 -67
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +2 -1
- package/galleria/galleria.esm.js +7 -4
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +68 -68
- package/galleria/galleria.min.js +1 -1
- package/gmap/gmap.cjs.js +1 -1
- package/gmap/gmap.cjs.min.js +1 -1
- package/gmap/gmap.esm.min.js +1 -1
- package/gmap/gmap.js +2 -2
- package/gmap/gmap.min.js +1 -1
- package/image/image.cjs.js +31 -27
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +5 -5
- package/image/image.esm.js +5 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +29 -28
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +8 -8
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +1 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/inputmask.cjs.js +11 -10
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +1 -1
- package/inputmask/inputmask.esm.js +4 -3
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +11 -11
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +58 -34
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +4 -4
- package/inputnumber/inputnumber.esm.js +41 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +57 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +15 -12
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +8 -5
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +15 -13
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/inputtext.cjs.js +12 -10
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/inputtext/inputtext.esm.js +3 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +11 -11
- package/inputtext/inputtext.min.css +1 -1
- package/inputtext/inputtext.min.js +1 -1
- package/inputtextarea/inputtextarea.cjs.js +10 -9
- package/inputtextarea/inputtextarea.cjs.min.js +1 -1
- package/inputtextarea/inputtextarea.d.ts +1 -1
- package/inputtextarea/inputtextarea.esm.js +2 -1
- package/inputtextarea/inputtextarea.esm.min.js +1 -1
- package/inputtextarea/inputtextarea.js +10 -10
- package/inputtextarea/inputtextarea.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +5 -5
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +1 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +6 -6
- package/keyfilter/keyfilter.min.js +1 -1
- package/knob/knob.cjs.js +7 -7
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +8 -8
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +38 -36
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +3 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +37 -37
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +36 -35
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +36 -36
- package/megamenu/megamenu.min.js +1 -1
- package/mention/mention.cjs.js +53 -46
- package/mention/mention.cjs.min.js +1 -1
- package/mention/mention.d.ts +2 -1
- package/mention/mention.esm.js +9 -3
- package/mention/mention.esm.min.js +1 -1
- package/mention/mention.js +48 -47
- package/mention/mention.min.js +1 -1
- package/menu/menu.cjs.js +33 -28
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.d.ts +4 -1
- package/menu/menu.esm.js +7 -3
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +30 -29
- package/menu/menu.min.js +1 -1
- package/menubar/menubar.cjs.js +38 -35
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +4 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +37 -36
- package/menubar/menubar.min.css +1 -1
- package/menubar/menubar.min.js +1 -1
- package/message/message.cjs.js +9 -8
- package/message/message.cjs.min.js +1 -1
- package/message/message.d.ts +3 -1
- package/message/message.esm.js +3 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +10 -9
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +19 -17
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +2 -1
- package/messages/messages.esm.js +3 -1
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +18 -18
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +128 -116
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +5 -2
- package/multiselect/multiselect.esm.js +44 -32
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +124 -117
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +14 -13
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.d.ts +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +2 -1
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +14 -14
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/orderlist/orderlist.cjs.js +35 -34
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +35 -35
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +26 -26
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +27 -27
- package/organizationchart/organizationchart.min.css +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +33 -30
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +3 -2
- package/overlaypanel/overlaypanel.esm.js +11 -9
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +29 -31
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/overlayservice/overlayservice.cjs.js +2 -2
- package/overlayservice/overlayservice.cjs.min.js +1 -1
- package/overlayservice/overlayservice.esm.js +1 -1
- package/overlayservice/overlayservice.esm.min.js +1 -1
- package/overlayservice/overlayservice.js +3 -3
- package/overlayservice/overlayservice.min.js +1 -1
- package/package.json +11 -4
- package/paginator/paginator.cjs.js +48 -47
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +2 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +48 -48
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +21 -18
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +5 -3
- package/panel/panel.esm.js +6 -3
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +20 -19
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +40 -39
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +2 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +40 -40
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +33 -29
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +3 -2
- package/password/password.esm.js +7 -3
- package/password/password.esm.min.js +1 -1
- package/password/password.js +30 -30
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +58 -54
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +14 -10
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +58 -55
- package/picklist/picklist.min.js +1 -1
- package/portal/portal.cjs.js +4 -8
- package/portal/portal.cjs.min.js +1 -1
- package/portal/portal.esm.js +2 -6
- package/portal/portal.esm.min.js +1 -1
- package/portal/portal.js +5 -10
- package/portal/portal.min.js +1 -1
- package/primereact.all.cjs.js +3168 -2524
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1939 -1294
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +3167 -2521
- package/primereact.all.min.js +1 -1
- package/progressbar/progressbar.cjs.js +9 -9
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +10 -10
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/progressspinner.cjs.js +5 -5
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +6 -6
- package/progressspinner/progressspinner.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +10 -9
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +10 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +10 -9
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +4 -3
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +10 -10
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +484 -431
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +38 -18
- package/resources/themes/arya-green/theme.css +38 -18
- package/resources/themes/arya-orange/theme.css +38 -18
- package/resources/themes/arya-purple/theme.css +38 -18
- package/resources/themes/bootstrap4-dark-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-dark-purple/theme.css +42 -22
- package/resources/themes/bootstrap4-light-blue/theme.css +42 -22
- package/resources/themes/bootstrap4-light-purple/theme.css +42 -22
- package/resources/themes/fluent-light/theme.css +38 -18
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5675 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5675 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5675 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5675 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5675 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5675 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5675 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5675 -0
- package/resources/themes/luna-amber/theme.css +42 -22
- package/resources/themes/luna-blue/theme.css +42 -22
- package/resources/themes/luna-green/theme.css +42 -22
- package/resources/themes/luna-pink/theme.css +42 -22
- package/resources/themes/md-dark-deeppurple/theme.css +227 -47
- package/resources/themes/md-dark-indigo/theme.css +227 -47
- package/resources/themes/md-light-deeppurple/theme.css +227 -47
- package/resources/themes/md-light-indigo/theme.css +227 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-dark-indigo/theme.css +227 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +227 -47
- package/resources/themes/mdc-light-indigo/theme.css +227 -47
- package/resources/themes/nova/theme.css +42 -22
- package/resources/themes/nova-accent/theme.css +42 -22
- package/resources/themes/nova-alt/theme.css +42 -22
- package/resources/themes/rhea/theme.css +42 -22
- package/resources/themes/saga-blue/theme.css +38 -18
- package/resources/themes/saga-green/theme.css +38 -18
- package/resources/themes/saga-orange/theme.css +38 -18
- package/resources/themes/saga-purple/theme.css +38 -18
- package/resources/themes/tailwind-light/theme.css +42 -22
- package/resources/themes/vela-blue/theme.css +38 -18
- package/resources/themes/vela-green/theme.css +38 -18
- package/resources/themes/vela-orange/theme.css +38 -18
- package/resources/themes/vela-purple/theme.css +38 -18
- package/ripple/ripple.cjs.js +11 -11
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +3 -3
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +12 -12
- package/ripple/ripple.min.js +1 -1
- package/row/row.cjs.js +1 -1
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +2 -2
- package/row/row.min.js +1 -1
- package/scrollpanel/scrollpanel.cjs.js +19 -19
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +20 -20
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/scrolltop.cjs.js +18 -13
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +4 -2
- package/scrolltop/scrolltop.esm.js +9 -5
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +16 -14
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/selectbutton.cjs.js +17 -15
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +3 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +16 -16
- package/selectbutton/selectbutton.min.js +1 -1
- package/selectitem/selectitem.d.ts +3 -1
- package/sidebar/sidebar.cjs.js +142 -116
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +4 -1
- package/sidebar/sidebar.esm.js +133 -108
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +139 -117
- package/sidebar/sidebar.min.css +1 -1
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/skeleton.cjs.js +3 -3
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +4 -4
- package/skeleton/skeleton.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +37 -32
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +2 -1
- package/slidemenu/slidemenu.esm.js +7 -3
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +34 -33
- package/slidemenu/slidemenu.min.js +1 -1
- package/slider/slider.cjs.js +29 -19
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +21 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +30 -20
- package/slider/slider.min.js +1 -1
- package/speeddial/speeddial.cjs.js +20 -19
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +3 -2
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +20 -20
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +43 -35
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +8 -6
- package/splitbutton/splitbutton.esm.js +13 -5
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +40 -36
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/splitter.cjs.js +19 -19
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +20 -20
- package/splitter/splitter.min.js +1 -1
- package/steps/steps.cjs.js +10 -10
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -1
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +11 -11
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +17 -17
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +1 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +18 -18
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/tabmenu.cjs.js +16 -15
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +2 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +16 -16
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/tabview.cjs.js +195 -57
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +12 -1
- package/tabview/tabview.esm.js +165 -27
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +195 -58
- package/tabview/tabview.min.css +1 -1
- package/tabview/tabview.min.js +1 -1
- package/tag/tag.cjs.js +9 -8
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.d.ts +2 -1
- package/tag/tag.esm.js +5 -4
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +10 -9
- package/tag/tag.min.js +1 -1
- package/terminal/terminal.cjs.js +12 -12
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +13 -13
- package/terminal/terminal.min.js +1 -1
- package/terminalservice/terminalservice.cjs.js +2 -2
- package/terminalservice/terminalservice.cjs.min.js +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +3 -3
- package/terminalservice/terminalservice.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +42 -36
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +2 -1
- package/tieredmenu/tieredmenu.esm.js +8 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +38 -37
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/timeline.cjs.js +12 -12
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +13 -13
- package/timeline/timeline.min.js +1 -1
- package/toast/toast.cjs.js +46 -40
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +2 -1
- package/toast/toast.esm.js +20 -15
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +44 -41
- package/toast/toast.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +14 -9
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +3 -2
- package/togglebutton/togglebutton.esm.js +8 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +13 -10
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/toolbar.cjs.js +7 -7
- 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 +8 -8
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +65 -36
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip/tooltip.esm.js +36 -8
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +64 -37
- package/tooltip/tooltip.min.css +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +2 -0
- package/tree/tree.cjs.js +52 -51
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +14 -3
- package/tree/tree.esm.js +2 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +52 -52
- package/tree/tree.min.js +1 -1
- package/treenode/treenode.d.ts +3 -1
- package/treeselect/treeselect.cjs.js +50 -46
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +10 -6
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +47 -47
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +1363 -312
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +10 -3
- package/treetable/treetable.esm.js +1267 -216
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +1362 -313
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +11 -10
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +2 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +11 -11
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/utils.cjs.js +154 -33
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +17 -0
- package/utils/utils.esm.js +153 -33
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +155 -34
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +44 -34
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +29 -19
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +45 -35
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +2 -2
- package/core/core.cjs.js +0 -2987
- package/core/core.cjs.min.js +0 -1
- package/core/core.esm.js +0 -2963
- package/core/core.esm.min.js +0 -1
- package/core/package.json +0 -5
- package/util.d.ts +0 -1
package/core/core.cjs.js
DELETED
|
@@ -1,2987 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var PrimeReact = require('primereact/api');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var ReactDOM = require('react-dom');
|
|
8
|
-
var reactTransitionGroup = require('react-transition-group');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
15
|
-
|
|
16
|
-
function _arrayWithHoles(arr) {
|
|
17
|
-
if (Array.isArray(arr)) return arr;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _iterableToArrayLimit(arr, i) {
|
|
21
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
22
|
-
|
|
23
|
-
if (_i == null) return;
|
|
24
|
-
var _arr = [];
|
|
25
|
-
var _n = true;
|
|
26
|
-
var _d = false;
|
|
27
|
-
|
|
28
|
-
var _s, _e;
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
32
|
-
_arr.push(_s.value);
|
|
33
|
-
|
|
34
|
-
if (i && _arr.length === i) break;
|
|
35
|
-
}
|
|
36
|
-
} catch (err) {
|
|
37
|
-
_d = true;
|
|
38
|
-
_e = err;
|
|
39
|
-
} finally {
|
|
40
|
-
try {
|
|
41
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
42
|
-
} finally {
|
|
43
|
-
if (_d) throw _e;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return _arr;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _arrayLikeToArray$1(arr, len) {
|
|
51
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
52
|
-
|
|
53
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
54
|
-
arr2[i] = arr[i];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return arr2;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
61
|
-
if (!o) return;
|
|
62
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
63
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
64
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
65
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
66
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _nonIterableRest() {
|
|
70
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _slicedToArray(arr, i) {
|
|
74
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _typeof(obj) {
|
|
78
|
-
"@babel/helpers - typeof";
|
|
79
|
-
|
|
80
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
81
|
-
_typeof = function _typeof(obj) {
|
|
82
|
-
return typeof obj;
|
|
83
|
-
};
|
|
84
|
-
} else {
|
|
85
|
-
_typeof = function _typeof(obj) {
|
|
86
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return _typeof(obj);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function classNames() {
|
|
94
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
95
|
-
args[_key] = arguments[_key];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (args) {
|
|
99
|
-
var classes = [];
|
|
100
|
-
|
|
101
|
-
for (var i = 0; i < args.length; i++) {
|
|
102
|
-
var className = args[i];
|
|
103
|
-
if (!className) continue;
|
|
104
|
-
|
|
105
|
-
var type = _typeof(className);
|
|
106
|
-
|
|
107
|
-
if (type === 'string' || type === 'number') {
|
|
108
|
-
classes.push(className);
|
|
109
|
-
} else if (type === 'object') {
|
|
110
|
-
var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
|
|
111
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
112
|
-
key = _ref2[0],
|
|
113
|
-
value = _ref2[1];
|
|
114
|
-
|
|
115
|
-
return !!value ? key : null;
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
classes = _classes.length ? classes.concat(_classes.filter(function (c) {
|
|
119
|
-
return !!c;
|
|
120
|
-
})) : classes;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return classes.join(' ');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function _classCallCheck(instance, Constructor) {
|
|
131
|
-
if (!(instance instanceof Constructor)) {
|
|
132
|
-
throw new TypeError("Cannot call a class as a function");
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function _defineProperties(target, props) {
|
|
137
|
-
for (var i = 0; i < props.length; i++) {
|
|
138
|
-
var descriptor = props[i];
|
|
139
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
140
|
-
descriptor.configurable = true;
|
|
141
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
142
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
147
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
148
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
149
|
-
return Constructor;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
153
|
-
|
|
154
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
155
|
-
|
|
156
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
157
|
-
|
|
158
|
-
var DomHandler = /*#__PURE__*/function () {
|
|
159
|
-
function DomHandler() {
|
|
160
|
-
_classCallCheck(this, DomHandler);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
_createClass(DomHandler, null, [{
|
|
164
|
-
key: "innerWidth",
|
|
165
|
-
value: function innerWidth(el) {
|
|
166
|
-
if (el) {
|
|
167
|
-
var width = el.offsetWidth;
|
|
168
|
-
var style = getComputedStyle(el);
|
|
169
|
-
width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
|
|
170
|
-
return width;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return 0;
|
|
174
|
-
}
|
|
175
|
-
}, {
|
|
176
|
-
key: "width",
|
|
177
|
-
value: function width(el) {
|
|
178
|
-
if (el) {
|
|
179
|
-
var width = el.offsetWidth;
|
|
180
|
-
var style = getComputedStyle(el);
|
|
181
|
-
width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
|
|
182
|
-
return width;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return 0;
|
|
186
|
-
}
|
|
187
|
-
}, {
|
|
188
|
-
key: "getWindowScrollTop",
|
|
189
|
-
value: function getWindowScrollTop() {
|
|
190
|
-
var doc = document.documentElement;
|
|
191
|
-
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "getWindowScrollLeft",
|
|
195
|
-
value: function getWindowScrollLeft() {
|
|
196
|
-
var doc = document.documentElement;
|
|
197
|
-
return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "getOuterWidth",
|
|
201
|
-
value: function getOuterWidth(el, margin) {
|
|
202
|
-
if (el) {
|
|
203
|
-
var width = el.offsetWidth;
|
|
204
|
-
|
|
205
|
-
if (margin) {
|
|
206
|
-
var style = getComputedStyle(el);
|
|
207
|
-
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return width;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return 0;
|
|
214
|
-
}
|
|
215
|
-
}, {
|
|
216
|
-
key: "getOuterHeight",
|
|
217
|
-
value: function getOuterHeight(el, margin) {
|
|
218
|
-
if (el) {
|
|
219
|
-
var height = el.offsetHeight;
|
|
220
|
-
|
|
221
|
-
if (margin) {
|
|
222
|
-
var style = getComputedStyle(el);
|
|
223
|
-
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return height;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return 0;
|
|
230
|
-
}
|
|
231
|
-
}, {
|
|
232
|
-
key: "getClientHeight",
|
|
233
|
-
value: function getClientHeight(el, margin) {
|
|
234
|
-
if (el) {
|
|
235
|
-
var height = el.clientHeight;
|
|
236
|
-
|
|
237
|
-
if (margin) {
|
|
238
|
-
var style = getComputedStyle(el);
|
|
239
|
-
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return height;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return 0;
|
|
246
|
-
}
|
|
247
|
-
}, {
|
|
248
|
-
key: "getClientWidth",
|
|
249
|
-
value: function getClientWidth(el, margin) {
|
|
250
|
-
if (el) {
|
|
251
|
-
var width = el.clientWidth;
|
|
252
|
-
|
|
253
|
-
if (margin) {
|
|
254
|
-
var style = getComputedStyle(el);
|
|
255
|
-
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return width;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return 0;
|
|
262
|
-
}
|
|
263
|
-
}, {
|
|
264
|
-
key: "getViewport",
|
|
265
|
-
value: function getViewport() {
|
|
266
|
-
var win = window,
|
|
267
|
-
d = document,
|
|
268
|
-
e = d.documentElement,
|
|
269
|
-
g = d.getElementsByTagName('body')[0],
|
|
270
|
-
w = win.innerWidth || e.clientWidth || g.clientWidth,
|
|
271
|
-
h = win.innerHeight || e.clientHeight || g.clientHeight;
|
|
272
|
-
return {
|
|
273
|
-
width: w,
|
|
274
|
-
height: h
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
}, {
|
|
278
|
-
key: "getOffset",
|
|
279
|
-
value: function getOffset(el) {
|
|
280
|
-
if (el) {
|
|
281
|
-
var rect = el.getBoundingClientRect();
|
|
282
|
-
return {
|
|
283
|
-
top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
|
|
284
|
-
left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return {
|
|
289
|
-
top: 'auto',
|
|
290
|
-
left: 'auto'
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
}, {
|
|
294
|
-
key: "index",
|
|
295
|
-
value: function index(element) {
|
|
296
|
-
if (element) {
|
|
297
|
-
var children = element.parentNode.childNodes;
|
|
298
|
-
var num = 0;
|
|
299
|
-
|
|
300
|
-
for (var i = 0; i < children.length; i++) {
|
|
301
|
-
if (children[i] === element) return num;
|
|
302
|
-
if (children[i].nodeType === 1) num++;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return -1;
|
|
307
|
-
}
|
|
308
|
-
}, {
|
|
309
|
-
key: "addMultipleClasses",
|
|
310
|
-
value: function addMultipleClasses(element, className) {
|
|
311
|
-
if (element && className) {
|
|
312
|
-
if (element.classList) {
|
|
313
|
-
var styles = className.split(' ');
|
|
314
|
-
|
|
315
|
-
for (var i = 0; i < styles.length; i++) {
|
|
316
|
-
element.classList.add(styles[i]);
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
var _styles = className.split(' ');
|
|
320
|
-
|
|
321
|
-
for (var _i = 0; _i < _styles.length; _i++) {
|
|
322
|
-
element.className += ' ' + _styles[_i];
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}, {
|
|
328
|
-
key: "removeMultipleClasses",
|
|
329
|
-
value: function removeMultipleClasses(element, className) {
|
|
330
|
-
if (element && className) {
|
|
331
|
-
if (element.classList) {
|
|
332
|
-
var styles = className.split(' ');
|
|
333
|
-
|
|
334
|
-
for (var i = 0; i < styles.length; i++) {
|
|
335
|
-
element.classList.remove(styles[i]);
|
|
336
|
-
}
|
|
337
|
-
} else {
|
|
338
|
-
var _styles2 = className.split(' ');
|
|
339
|
-
|
|
340
|
-
for (var _i2 = 0; _i2 < _styles2.length; _i2++) {
|
|
341
|
-
element.className = element.className.replace(new RegExp('(^|\\b)' + _styles2[_i2].split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}, {
|
|
347
|
-
key: "addClass",
|
|
348
|
-
value: function addClass(element, className) {
|
|
349
|
-
if (element && className) {
|
|
350
|
-
if (element.classList) element.classList.add(className);else element.className += ' ' + className;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}, {
|
|
354
|
-
key: "removeClass",
|
|
355
|
-
value: function removeClass(element, className) {
|
|
356
|
-
if (element && className) {
|
|
357
|
-
if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}, {
|
|
361
|
-
key: "hasClass",
|
|
362
|
-
value: function hasClass(element, className) {
|
|
363
|
-
if (element) {
|
|
364
|
-
if (element.classList) return element.classList.contains(className);else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}, {
|
|
368
|
-
key: "find",
|
|
369
|
-
value: function find(element, selector) {
|
|
370
|
-
return element ? Array.from(element.querySelectorAll(selector)) : [];
|
|
371
|
-
}
|
|
372
|
-
}, {
|
|
373
|
-
key: "findSingle",
|
|
374
|
-
value: function findSingle(element, selector) {
|
|
375
|
-
if (element) {
|
|
376
|
-
return element.querySelector(selector);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return null;
|
|
380
|
-
}
|
|
381
|
-
}, {
|
|
382
|
-
key: "getHeight",
|
|
383
|
-
value: function getHeight(el) {
|
|
384
|
-
if (el) {
|
|
385
|
-
var height = el.offsetHeight;
|
|
386
|
-
var style = getComputedStyle(el);
|
|
387
|
-
height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
|
|
388
|
-
return height;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
return 0;
|
|
392
|
-
}
|
|
393
|
-
}, {
|
|
394
|
-
key: "getWidth",
|
|
395
|
-
value: function getWidth(el) {
|
|
396
|
-
if (el) {
|
|
397
|
-
var width = el.offsetWidth;
|
|
398
|
-
var style = getComputedStyle(el);
|
|
399
|
-
width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
|
|
400
|
-
return width;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
return 0;
|
|
404
|
-
}
|
|
405
|
-
}, {
|
|
406
|
-
key: "alignOverlay",
|
|
407
|
-
value: function alignOverlay(overlay, target, appendTo) {
|
|
408
|
-
var calculateMinWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
409
|
-
|
|
410
|
-
if (overlay && target) {
|
|
411
|
-
if (appendTo === 'self') {
|
|
412
|
-
this.relativePosition(overlay, target);
|
|
413
|
-
} else {
|
|
414
|
-
calculateMinWidth && (overlay.style.minWidth = DomHandler.getOuterWidth(target) + 'px');
|
|
415
|
-
this.absolutePosition(overlay, target);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}, {
|
|
420
|
-
key: "absolutePosition",
|
|
421
|
-
value: function absolutePosition(element, target) {
|
|
422
|
-
if (element) {
|
|
423
|
-
var elementDimensions = element.offsetParent ? {
|
|
424
|
-
width: element.offsetWidth,
|
|
425
|
-
height: element.offsetHeight
|
|
426
|
-
} : this.getHiddenElementDimensions(element);
|
|
427
|
-
var elementOuterHeight = elementDimensions.height;
|
|
428
|
-
var elementOuterWidth = elementDimensions.width;
|
|
429
|
-
var targetOuterHeight = target.offsetHeight;
|
|
430
|
-
var targetOuterWidth = target.offsetWidth;
|
|
431
|
-
var targetOffset = target.getBoundingClientRect();
|
|
432
|
-
var windowScrollTop = this.getWindowScrollTop();
|
|
433
|
-
var windowScrollLeft = this.getWindowScrollLeft();
|
|
434
|
-
var viewport = this.getViewport();
|
|
435
|
-
var top, left;
|
|
436
|
-
|
|
437
|
-
if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
|
|
438
|
-
top = targetOffset.top + windowScrollTop - elementOuterHeight;
|
|
439
|
-
|
|
440
|
-
if (top < 0) {
|
|
441
|
-
top = windowScrollTop;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
element.style.transformOrigin = 'bottom';
|
|
445
|
-
} else {
|
|
446
|
-
top = targetOuterHeight + targetOffset.top + windowScrollTop;
|
|
447
|
-
element.style.transformOrigin = 'top';
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
if (targetOffset.left + targetOuterWidth + elementOuterWidth > viewport.width) left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);else left = targetOffset.left + windowScrollLeft;
|
|
451
|
-
element.style.top = top + 'px';
|
|
452
|
-
element.style.left = left + 'px';
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}, {
|
|
456
|
-
key: "relativePosition",
|
|
457
|
-
value: function relativePosition(element, target) {
|
|
458
|
-
if (element) {
|
|
459
|
-
var elementDimensions = element.offsetParent ? {
|
|
460
|
-
width: element.offsetWidth,
|
|
461
|
-
height: element.offsetHeight
|
|
462
|
-
} : this.getHiddenElementDimensions(element);
|
|
463
|
-
var targetHeight = target.offsetHeight;
|
|
464
|
-
var targetOffset = target.getBoundingClientRect();
|
|
465
|
-
var viewport = this.getViewport();
|
|
466
|
-
var top, left;
|
|
467
|
-
|
|
468
|
-
if (targetOffset.top + targetHeight + elementDimensions.height > viewport.height) {
|
|
469
|
-
top = -1 * elementDimensions.height;
|
|
470
|
-
|
|
471
|
-
if (targetOffset.top + top < 0) {
|
|
472
|
-
top = -1 * targetOffset.top;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
element.style.transformOrigin = 'bottom';
|
|
476
|
-
} else {
|
|
477
|
-
top = targetHeight;
|
|
478
|
-
element.style.transformOrigin = 'top';
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
if (elementDimensions.width > viewport.width) {
|
|
482
|
-
// element wider then viewport and cannot fit on screen (align at left side of viewport)
|
|
483
|
-
left = targetOffset.left * -1;
|
|
484
|
-
} else if (targetOffset.left + elementDimensions.width > viewport.width) {
|
|
485
|
-
// element wider then viewport but can be fit on screen (align at right side of viewport)
|
|
486
|
-
left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
|
|
487
|
-
} else {
|
|
488
|
-
// element fits on screen (align with target)
|
|
489
|
-
left = 0;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
element.style.top = top + 'px';
|
|
493
|
-
element.style.left = left + 'px';
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}, {
|
|
497
|
-
key: "flipfitCollision",
|
|
498
|
-
value: function flipfitCollision(element, target) {
|
|
499
|
-
var _this = this;
|
|
500
|
-
|
|
501
|
-
var my = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'left top';
|
|
502
|
-
var at = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'left bottom';
|
|
503
|
-
var callback = arguments.length > 4 ? arguments[4] : undefined;
|
|
504
|
-
var targetOffset = target.getBoundingClientRect();
|
|
505
|
-
var viewport = this.getViewport();
|
|
506
|
-
var myArr = my.split(' ');
|
|
507
|
-
var atArr = at.split(' ');
|
|
508
|
-
|
|
509
|
-
var getPositionValue = function getPositionValue(arr, isOffset) {
|
|
510
|
-
return isOffset ? +arr.substring(arr.search(/(\+|-)/g)) || 0 : arr.substring(0, arr.search(/(\+|-)/g)) || arr;
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
var position = {
|
|
514
|
-
my: {
|
|
515
|
-
x: getPositionValue(myArr[0]),
|
|
516
|
-
y: getPositionValue(myArr[1] || myArr[0]),
|
|
517
|
-
offsetX: getPositionValue(myArr[0], true),
|
|
518
|
-
offsetY: getPositionValue(myArr[1] || myArr[0], true)
|
|
519
|
-
},
|
|
520
|
-
at: {
|
|
521
|
-
x: getPositionValue(atArr[0]),
|
|
522
|
-
y: getPositionValue(atArr[1] || atArr[0]),
|
|
523
|
-
offsetX: getPositionValue(atArr[0], true),
|
|
524
|
-
offsetY: getPositionValue(atArr[1] || atArr[0], true)
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
var myOffset = {
|
|
528
|
-
left: function left() {
|
|
529
|
-
var totalOffset = position.my.offsetX + position.at.offsetX;
|
|
530
|
-
return totalOffset + targetOffset.left + (position.my.x === 'left' ? 0 : -1 * (position.my.x === 'center' ? _this.getOuterWidth(element) / 2 : _this.getOuterWidth(element)));
|
|
531
|
-
},
|
|
532
|
-
top: function top() {
|
|
533
|
-
var totalOffset = position.my.offsetY + position.at.offsetY;
|
|
534
|
-
return totalOffset + targetOffset.top + (position.my.y === 'top' ? 0 : -1 * (position.my.y === 'center' ? _this.getOuterHeight(element) / 2 : _this.getOuterHeight(element)));
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
var alignWithAt = {
|
|
538
|
-
count: {
|
|
539
|
-
x: 0,
|
|
540
|
-
y: 0
|
|
541
|
-
},
|
|
542
|
-
left: function left() {
|
|
543
|
-
var left = myOffset.left();
|
|
544
|
-
var scrollLeft = DomHandler.getWindowScrollLeft();
|
|
545
|
-
element.style.left = left + scrollLeft + 'px';
|
|
546
|
-
|
|
547
|
-
if (this.count.x === 2) {
|
|
548
|
-
element.style.left = scrollLeft + 'px';
|
|
549
|
-
this.count.x = 0;
|
|
550
|
-
} else if (left < 0) {
|
|
551
|
-
this.count.x++;
|
|
552
|
-
position.my.x = 'left';
|
|
553
|
-
position.at.x = 'right';
|
|
554
|
-
position.my.offsetX *= -1;
|
|
555
|
-
position.at.offsetX *= -1;
|
|
556
|
-
this.right();
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
right: function right() {
|
|
560
|
-
var left = myOffset.left() + DomHandler.getOuterWidth(target);
|
|
561
|
-
var scrollLeft = DomHandler.getWindowScrollLeft();
|
|
562
|
-
element.style.left = left + scrollLeft + 'px';
|
|
563
|
-
|
|
564
|
-
if (this.count.x === 2) {
|
|
565
|
-
element.style.left = viewport.width - DomHandler.getOuterWidth(element) + scrollLeft + 'px';
|
|
566
|
-
this.count.x = 0;
|
|
567
|
-
} else if (left + DomHandler.getOuterWidth(element) > viewport.width) {
|
|
568
|
-
this.count.x++;
|
|
569
|
-
position.my.x = 'right';
|
|
570
|
-
position.at.x = 'left';
|
|
571
|
-
position.my.offsetX *= -1;
|
|
572
|
-
position.at.offsetX *= -1;
|
|
573
|
-
this.left();
|
|
574
|
-
}
|
|
575
|
-
},
|
|
576
|
-
top: function top() {
|
|
577
|
-
var top = myOffset.top();
|
|
578
|
-
var scrollTop = DomHandler.getWindowScrollTop();
|
|
579
|
-
element.style.top = top + scrollTop + 'px';
|
|
580
|
-
|
|
581
|
-
if (this.count.y === 2) {
|
|
582
|
-
element.style.left = scrollTop + 'px';
|
|
583
|
-
this.count.y = 0;
|
|
584
|
-
} else if (top < 0) {
|
|
585
|
-
this.count.y++;
|
|
586
|
-
position.my.y = 'top';
|
|
587
|
-
position.at.y = 'bottom';
|
|
588
|
-
position.my.offsetY *= -1;
|
|
589
|
-
position.at.offsetY *= -1;
|
|
590
|
-
this.bottom();
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
bottom: function bottom() {
|
|
594
|
-
var top = myOffset.top() + DomHandler.getOuterHeight(target);
|
|
595
|
-
var scrollTop = DomHandler.getWindowScrollTop();
|
|
596
|
-
element.style.top = top + scrollTop + 'px';
|
|
597
|
-
|
|
598
|
-
if (this.count.y === 2) {
|
|
599
|
-
element.style.left = viewport.height - DomHandler.getOuterHeight(element) + scrollTop + 'px';
|
|
600
|
-
this.count.y = 0;
|
|
601
|
-
} else if (top + DomHandler.getOuterHeight(target) > viewport.height) {
|
|
602
|
-
this.count.y++;
|
|
603
|
-
position.my.y = 'bottom';
|
|
604
|
-
position.at.y = 'top';
|
|
605
|
-
position.my.offsetY *= -1;
|
|
606
|
-
position.at.offsetY *= -1;
|
|
607
|
-
this.top();
|
|
608
|
-
}
|
|
609
|
-
},
|
|
610
|
-
center: function center(axis) {
|
|
611
|
-
if (axis === 'y') {
|
|
612
|
-
var top = myOffset.top() + DomHandler.getOuterHeight(target) / 2;
|
|
613
|
-
element.style.top = top + DomHandler.getWindowScrollTop() + 'px';
|
|
614
|
-
|
|
615
|
-
if (top < 0) {
|
|
616
|
-
this.bottom();
|
|
617
|
-
} else if (top + DomHandler.getOuterHeight(target) > viewport.height) {
|
|
618
|
-
this.top();
|
|
619
|
-
}
|
|
620
|
-
} else {
|
|
621
|
-
var left = myOffset.left() + DomHandler.getOuterWidth(target) / 2;
|
|
622
|
-
element.style.left = left + DomHandler.getWindowScrollLeft() + 'px';
|
|
623
|
-
|
|
624
|
-
if (left < 0) {
|
|
625
|
-
this.left();
|
|
626
|
-
} else if (left + DomHandler.getOuterWidth(element) > viewport.width) {
|
|
627
|
-
this.right();
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
alignWithAt[position.at.x]('x');
|
|
633
|
-
alignWithAt[position.at.y]('y');
|
|
634
|
-
|
|
635
|
-
if (this.isFunction(callback)) {
|
|
636
|
-
callback(position);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
}, {
|
|
640
|
-
key: "findCollisionPosition",
|
|
641
|
-
value: function findCollisionPosition(position) {
|
|
642
|
-
if (position) {
|
|
643
|
-
var isAxisY = position === 'top' || position === 'bottom';
|
|
644
|
-
var myXPosition = position === 'left' ? 'right' : 'left';
|
|
645
|
-
var myYPosition = position === 'top' ? 'bottom' : 'top';
|
|
646
|
-
|
|
647
|
-
if (isAxisY) {
|
|
648
|
-
return {
|
|
649
|
-
axis: 'y',
|
|
650
|
-
my: "center ".concat(myYPosition),
|
|
651
|
-
at: "center ".concat(position)
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
return {
|
|
656
|
-
axis: 'x',
|
|
657
|
-
my: "".concat(myXPosition, " center"),
|
|
658
|
-
at: "".concat(position, " center")
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}, {
|
|
663
|
-
key: "getParents",
|
|
664
|
-
value: function getParents(element) {
|
|
665
|
-
var parents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
666
|
-
return element['parentNode'] === null ? parents : this.getParents(element.parentNode, parents.concat([element.parentNode]));
|
|
667
|
-
}
|
|
668
|
-
}, {
|
|
669
|
-
key: "getScrollableParents",
|
|
670
|
-
value: function getScrollableParents(element) {
|
|
671
|
-
var scrollableParents = [];
|
|
672
|
-
|
|
673
|
-
if (element) {
|
|
674
|
-
var parents = this.getParents(element);
|
|
675
|
-
var overflowRegex = /(auto|scroll)/;
|
|
676
|
-
|
|
677
|
-
var overflowCheck = function overflowCheck(node) {
|
|
678
|
-
var styleDeclaration = window['getComputedStyle'](node, null);
|
|
679
|
-
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
var _iterator = _createForOfIteratorHelper(parents),
|
|
683
|
-
_step;
|
|
684
|
-
|
|
685
|
-
try {
|
|
686
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
687
|
-
var parent = _step.value;
|
|
688
|
-
var scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
|
|
689
|
-
|
|
690
|
-
if (scrollSelectors) {
|
|
691
|
-
var selectors = scrollSelectors.split(',');
|
|
692
|
-
|
|
693
|
-
var _iterator2 = _createForOfIteratorHelper(selectors),
|
|
694
|
-
_step2;
|
|
695
|
-
|
|
696
|
-
try {
|
|
697
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
698
|
-
var selector = _step2.value;
|
|
699
|
-
var el = this.findSingle(parent, selector);
|
|
700
|
-
|
|
701
|
-
if (el && overflowCheck(el)) {
|
|
702
|
-
scrollableParents.push(el);
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
} catch (err) {
|
|
706
|
-
_iterator2.e(err);
|
|
707
|
-
} finally {
|
|
708
|
-
_iterator2.f();
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
if (parent.nodeType !== 9 && overflowCheck(parent)) {
|
|
713
|
-
scrollableParents.push(parent);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
} catch (err) {
|
|
717
|
-
_iterator.e(err);
|
|
718
|
-
} finally {
|
|
719
|
-
_iterator.f();
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
return scrollableParents;
|
|
724
|
-
}
|
|
725
|
-
}, {
|
|
726
|
-
key: "getHiddenElementOuterHeight",
|
|
727
|
-
value: function getHiddenElementOuterHeight(element) {
|
|
728
|
-
if (element) {
|
|
729
|
-
element.style.visibility = 'hidden';
|
|
730
|
-
element.style.display = 'block';
|
|
731
|
-
var elementHeight = element.offsetHeight;
|
|
732
|
-
element.style.display = 'none';
|
|
733
|
-
element.style.visibility = 'visible';
|
|
734
|
-
return elementHeight;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
return 0;
|
|
738
|
-
}
|
|
739
|
-
}, {
|
|
740
|
-
key: "getHiddenElementOuterWidth",
|
|
741
|
-
value: function getHiddenElementOuterWidth(element) {
|
|
742
|
-
if (element) {
|
|
743
|
-
element.style.visibility = 'hidden';
|
|
744
|
-
element.style.display = 'block';
|
|
745
|
-
var elementWidth = element.offsetWidth;
|
|
746
|
-
element.style.display = 'none';
|
|
747
|
-
element.style.visibility = 'visible';
|
|
748
|
-
return elementWidth;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
return 0;
|
|
752
|
-
}
|
|
753
|
-
}, {
|
|
754
|
-
key: "getHiddenElementDimensions",
|
|
755
|
-
value: function getHiddenElementDimensions(element) {
|
|
756
|
-
var dimensions = {};
|
|
757
|
-
|
|
758
|
-
if (element) {
|
|
759
|
-
element.style.visibility = 'hidden';
|
|
760
|
-
element.style.display = 'block';
|
|
761
|
-
dimensions.width = element.offsetWidth;
|
|
762
|
-
dimensions.height = element.offsetHeight;
|
|
763
|
-
element.style.display = 'none';
|
|
764
|
-
element.style.visibility = 'visible';
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
return dimensions;
|
|
768
|
-
}
|
|
769
|
-
}, {
|
|
770
|
-
key: "fadeIn",
|
|
771
|
-
value: function fadeIn(element, duration) {
|
|
772
|
-
if (element) {
|
|
773
|
-
element.style.opacity = 0;
|
|
774
|
-
var last = +new Date();
|
|
775
|
-
var opacity = 0;
|
|
776
|
-
|
|
777
|
-
var tick = function tick() {
|
|
778
|
-
opacity = +element.style.opacity + (new Date().getTime() - last) / duration;
|
|
779
|
-
element.style.opacity = opacity;
|
|
780
|
-
last = +new Date();
|
|
781
|
-
|
|
782
|
-
if (+opacity < 1) {
|
|
783
|
-
window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 16);
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
tick();
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
}, {
|
|
791
|
-
key: "fadeOut",
|
|
792
|
-
value: function fadeOut(element, duration) {
|
|
793
|
-
if (element) {
|
|
794
|
-
var opacity = 1,
|
|
795
|
-
interval = 50,
|
|
796
|
-
gap = interval / duration;
|
|
797
|
-
var fading = setInterval(function () {
|
|
798
|
-
opacity -= gap;
|
|
799
|
-
|
|
800
|
-
if (opacity <= 0) {
|
|
801
|
-
opacity = 0;
|
|
802
|
-
clearInterval(fading);
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
element.style.opacity = opacity;
|
|
806
|
-
}, interval);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
}, {
|
|
810
|
-
key: "getUserAgent",
|
|
811
|
-
value: function getUserAgent() {
|
|
812
|
-
return navigator.userAgent;
|
|
813
|
-
}
|
|
814
|
-
}, {
|
|
815
|
-
key: "isIOS",
|
|
816
|
-
value: function isIOS() {
|
|
817
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];
|
|
818
|
-
}
|
|
819
|
-
}, {
|
|
820
|
-
key: "isAndroid",
|
|
821
|
-
value: function isAndroid() {
|
|
822
|
-
return /(android)/i.test(navigator.userAgent);
|
|
823
|
-
}
|
|
824
|
-
}, {
|
|
825
|
-
key: "isTouchDevice",
|
|
826
|
-
value: function isTouchDevice() {
|
|
827
|
-
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
828
|
-
}
|
|
829
|
-
}, {
|
|
830
|
-
key: "isFunction",
|
|
831
|
-
value: function isFunction(obj) {
|
|
832
|
-
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
833
|
-
}
|
|
834
|
-
}, {
|
|
835
|
-
key: "appendChild",
|
|
836
|
-
value: function appendChild(element, target) {
|
|
837
|
-
if (this.isElement(target)) target.appendChild(element);else if (target.el && target.el.nativeElement) target.el.nativeElement.appendChild(element);else throw new Error('Cannot append ' + target + ' to ' + element);
|
|
838
|
-
}
|
|
839
|
-
}, {
|
|
840
|
-
key: "removeChild",
|
|
841
|
-
value: function removeChild(element, target) {
|
|
842
|
-
if (this.isElement(target)) target.removeChild(element);else if (target.el && target.el.nativeElement) target.el.nativeElement.removeChild(element);else throw new Error('Cannot remove ' + element + ' from ' + target);
|
|
843
|
-
}
|
|
844
|
-
}, {
|
|
845
|
-
key: "isElement",
|
|
846
|
-
value: function isElement(obj) {
|
|
847
|
-
return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === "object" ? obj instanceof HTMLElement : obj && _typeof(obj) === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string";
|
|
848
|
-
}
|
|
849
|
-
}, {
|
|
850
|
-
key: "scrollInView",
|
|
851
|
-
value: function scrollInView(container, item) {
|
|
852
|
-
var borderTopValue = getComputedStyle(container).getPropertyValue('borderTopWidth');
|
|
853
|
-
var borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;
|
|
854
|
-
var paddingTopValue = getComputedStyle(container).getPropertyValue('paddingTop');
|
|
855
|
-
var paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;
|
|
856
|
-
var containerRect = container.getBoundingClientRect();
|
|
857
|
-
var itemRect = item.getBoundingClientRect();
|
|
858
|
-
var offset = itemRect.top + document.body.scrollTop - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;
|
|
859
|
-
var scroll = container.scrollTop;
|
|
860
|
-
var elementHeight = container.clientHeight;
|
|
861
|
-
var itemHeight = this.getOuterHeight(item);
|
|
862
|
-
|
|
863
|
-
if (offset < 0) {
|
|
864
|
-
container.scrollTop = scroll + offset;
|
|
865
|
-
} else if (offset + itemHeight > elementHeight) {
|
|
866
|
-
container.scrollTop = scroll + offset - elementHeight + itemHeight;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
}, {
|
|
870
|
-
key: "clearSelection",
|
|
871
|
-
value: function clearSelection() {
|
|
872
|
-
if (window.getSelection) {
|
|
873
|
-
if (window.getSelection().empty) {
|
|
874
|
-
window.getSelection().empty();
|
|
875
|
-
} else if (window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {
|
|
876
|
-
window.getSelection().removeAllRanges();
|
|
877
|
-
}
|
|
878
|
-
} else if (document['selection'] && document['selection'].empty) {
|
|
879
|
-
try {
|
|
880
|
-
document['selection'].empty();
|
|
881
|
-
} catch (error) {//ignore IE bug
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
}, {
|
|
886
|
-
key: "calculateScrollbarWidth",
|
|
887
|
-
value: function calculateScrollbarWidth(el) {
|
|
888
|
-
if (el) {
|
|
889
|
-
var style = getComputedStyle(el);
|
|
890
|
-
return el.offsetWidth - el.clientWidth - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth);
|
|
891
|
-
} else {
|
|
892
|
-
if (this.calculatedScrollbarWidth != null) return this.calculatedScrollbarWidth;
|
|
893
|
-
var scrollDiv = document.createElement("div");
|
|
894
|
-
scrollDiv.className = "p-scrollbar-measure";
|
|
895
|
-
document.body.appendChild(scrollDiv);
|
|
896
|
-
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
897
|
-
document.body.removeChild(scrollDiv);
|
|
898
|
-
this.calculatedScrollbarWidth = scrollbarWidth;
|
|
899
|
-
return scrollbarWidth;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}, {
|
|
903
|
-
key: "getBrowser",
|
|
904
|
-
value: function getBrowser() {
|
|
905
|
-
if (!this.browser) {
|
|
906
|
-
var matched = this.resolveUserAgent();
|
|
907
|
-
this.browser = {};
|
|
908
|
-
|
|
909
|
-
if (matched.browser) {
|
|
910
|
-
this.browser[matched.browser] = true;
|
|
911
|
-
this.browser['version'] = matched.version;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
if (this.browser['chrome']) {
|
|
915
|
-
this.browser['webkit'] = true;
|
|
916
|
-
} else if (this.browser['webkit']) {
|
|
917
|
-
this.browser['safari'] = true;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
return this.browser;
|
|
922
|
-
}
|
|
923
|
-
}, {
|
|
924
|
-
key: "resolveUserAgent",
|
|
925
|
-
value: function resolveUserAgent() {
|
|
926
|
-
var ua = navigator.userAgent.toLowerCase();
|
|
927
|
-
var match = /(chrome)[ ]([\w.]+)/.exec(ua) || /(webkit)[ ]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
|
|
928
|
-
return {
|
|
929
|
-
browser: match[1] || "",
|
|
930
|
-
version: match[2] || "0"
|
|
931
|
-
};
|
|
932
|
-
}
|
|
933
|
-
}, {
|
|
934
|
-
key: "isVisible",
|
|
935
|
-
value: function isVisible(element) {
|
|
936
|
-
return element && element.offsetParent != null;
|
|
937
|
-
}
|
|
938
|
-
}, {
|
|
939
|
-
key: "getFocusableElements",
|
|
940
|
-
value: function getFocusableElements(element) {
|
|
941
|
-
var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
942
|
-
var focusableElements = DomHandler.find(element, "button:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])".concat(selector, ",\n [href][clientHeight][clientWidth]:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n input:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n select:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n textarea:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n [tabIndex]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector, ",\n [contenteditable]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])").concat(selector));
|
|
943
|
-
var visibleFocusableElements = [];
|
|
944
|
-
|
|
945
|
-
var _iterator3 = _createForOfIteratorHelper(focusableElements),
|
|
946
|
-
_step3;
|
|
947
|
-
|
|
948
|
-
try {
|
|
949
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
950
|
-
var focusableElement = _step3.value;
|
|
951
|
-
if (getComputedStyle(focusableElement).display !== "none" && getComputedStyle(focusableElement).visibility !== "hidden") visibleFocusableElements.push(focusableElement);
|
|
952
|
-
}
|
|
953
|
-
} catch (err) {
|
|
954
|
-
_iterator3.e(err);
|
|
955
|
-
} finally {
|
|
956
|
-
_iterator3.f();
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
return visibleFocusableElements;
|
|
960
|
-
}
|
|
961
|
-
}, {
|
|
962
|
-
key: "getFirstFocusableElement",
|
|
963
|
-
value: function getFirstFocusableElement(element, selector) {
|
|
964
|
-
var focusableElements = DomHandler.getFocusableElements(element, selector);
|
|
965
|
-
return focusableElements.length > 0 ? focusableElements[0] : null;
|
|
966
|
-
}
|
|
967
|
-
}, {
|
|
968
|
-
key: "getLastFocusableElement",
|
|
969
|
-
value: function getLastFocusableElement(element, selector) {
|
|
970
|
-
var focusableElements = DomHandler.getFocusableElements(element, selector);
|
|
971
|
-
return focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
|
|
972
|
-
}
|
|
973
|
-
}, {
|
|
974
|
-
key: "getCursorOffset",
|
|
975
|
-
value: function getCursorOffset(el, prevText, nextText, currentText) {
|
|
976
|
-
if (el) {
|
|
977
|
-
var style = getComputedStyle(el);
|
|
978
|
-
var ghostDiv = document.createElement('div');
|
|
979
|
-
ghostDiv.style.position = 'absolute';
|
|
980
|
-
ghostDiv.style.top = '0px';
|
|
981
|
-
ghostDiv.style.left = '0px';
|
|
982
|
-
ghostDiv.style.visibility = 'hidden';
|
|
983
|
-
ghostDiv.style.pointerEvents = 'none';
|
|
984
|
-
ghostDiv.style.overflow = style.overflow;
|
|
985
|
-
ghostDiv.style.width = style.width;
|
|
986
|
-
ghostDiv.style.height = style.height;
|
|
987
|
-
ghostDiv.style.padding = style.padding;
|
|
988
|
-
ghostDiv.style.border = style.border;
|
|
989
|
-
ghostDiv.style.overflowWrap = style.overflowWrap;
|
|
990
|
-
ghostDiv.style.whiteSpace = style.whiteSpace;
|
|
991
|
-
ghostDiv.style.lineHeight = style.lineHeight;
|
|
992
|
-
ghostDiv.innerHTML = prevText.replace(/\r\n|\r|\n/g, '<br />');
|
|
993
|
-
var ghostSpan = document.createElement('span');
|
|
994
|
-
ghostSpan.textContent = currentText;
|
|
995
|
-
ghostDiv.appendChild(ghostSpan);
|
|
996
|
-
var text = document.createTextNode(nextText);
|
|
997
|
-
ghostDiv.appendChild(text);
|
|
998
|
-
document.body.appendChild(ghostDiv);
|
|
999
|
-
var offsetLeft = ghostSpan.offsetLeft,
|
|
1000
|
-
offsetTop = ghostSpan.offsetTop,
|
|
1001
|
-
clientHeight = ghostSpan.clientHeight;
|
|
1002
|
-
document.body.removeChild(ghostDiv);
|
|
1003
|
-
return {
|
|
1004
|
-
left: Math.abs(offsetLeft - el.scrollLeft),
|
|
1005
|
-
top: Math.abs(offsetTop - el.scrollTop) + clientHeight
|
|
1006
|
-
};
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
return {
|
|
1010
|
-
top: 'auto',
|
|
1011
|
-
left: 'auto'
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
}, {
|
|
1015
|
-
key: "invokeElementMethod",
|
|
1016
|
-
value: function invokeElementMethod(element, methodName, args) {
|
|
1017
|
-
element[methodName].apply(element, args);
|
|
1018
|
-
}
|
|
1019
|
-
}, {
|
|
1020
|
-
key: "isClickable",
|
|
1021
|
-
value: function isClickable(element) {
|
|
1022
|
-
var targetNode = element.nodeName;
|
|
1023
|
-
var parentNode = element.parentElement && element.parentElement.nodeName;
|
|
1024
|
-
return targetNode === 'INPUT' || targetNode === 'BUTTON' || targetNode === 'A' || parentNode === 'INPUT' || parentNode === 'BUTTON' || parentNode === 'A' || this.hasClass(element, 'p-button') || this.hasClass(element.parentElement, 'p-button') || this.hasClass(element.parentElement, 'p-checkbox') || this.hasClass(element.parentElement, 'p-radiobutton');
|
|
1025
|
-
}
|
|
1026
|
-
}, {
|
|
1027
|
-
key: "applyStyle",
|
|
1028
|
-
value: function applyStyle(element, style) {
|
|
1029
|
-
if (typeof style === 'string') {
|
|
1030
|
-
element.style.cssText = this.style;
|
|
1031
|
-
} else {
|
|
1032
|
-
for (var prop in this.style) {
|
|
1033
|
-
element.style[prop] = style[prop];
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
}, {
|
|
1038
|
-
key: "exportCSV",
|
|
1039
|
-
value: function exportCSV(csv, filename) {
|
|
1040
|
-
var blob = new Blob([csv], {
|
|
1041
|
-
type: 'application/csv;charset=utf-8;'
|
|
1042
|
-
});
|
|
1043
|
-
|
|
1044
|
-
if (window.navigator.msSaveOrOpenBlob) {
|
|
1045
|
-
navigator.msSaveOrOpenBlob(blob, filename + '.csv');
|
|
1046
|
-
} else {
|
|
1047
|
-
var link = document.createElement("a");
|
|
1048
|
-
|
|
1049
|
-
if (link.download !== undefined) {
|
|
1050
|
-
link.setAttribute('href', URL.createObjectURL(blob));
|
|
1051
|
-
link.setAttribute('download', filename + '.csv');
|
|
1052
|
-
link.style.display = 'none';
|
|
1053
|
-
document.body.appendChild(link);
|
|
1054
|
-
link.click();
|
|
1055
|
-
document.body.removeChild(link);
|
|
1056
|
-
} else {
|
|
1057
|
-
csv = 'data:text/csv;charset=utf-8,' + csv;
|
|
1058
|
-
window.open(encodeURI(csv));
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
}]);
|
|
1063
|
-
|
|
1064
|
-
return DomHandler;
|
|
1065
|
-
}();
|
|
1066
|
-
|
|
1067
|
-
var ConnectedOverlayScrollHandler = /*#__PURE__*/function () {
|
|
1068
|
-
function ConnectedOverlayScrollHandler(element) {
|
|
1069
|
-
var listener = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
1070
|
-
|
|
1071
|
-
_classCallCheck(this, ConnectedOverlayScrollHandler);
|
|
1072
|
-
|
|
1073
|
-
this.element = element;
|
|
1074
|
-
this.listener = listener;
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
_createClass(ConnectedOverlayScrollHandler, [{
|
|
1078
|
-
key: "bindScrollListener",
|
|
1079
|
-
value: function bindScrollListener() {
|
|
1080
|
-
this.scrollableParents = DomHandler.getScrollableParents(this.element);
|
|
1081
|
-
|
|
1082
|
-
for (var i = 0; i < this.scrollableParents.length; i++) {
|
|
1083
|
-
this.scrollableParents[i].addEventListener('scroll', this.listener);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
}, {
|
|
1087
|
-
key: "unbindScrollListener",
|
|
1088
|
-
value: function unbindScrollListener() {
|
|
1089
|
-
if (this.scrollableParents) {
|
|
1090
|
-
for (var i = 0; i < this.scrollableParents.length; i++) {
|
|
1091
|
-
this.scrollableParents[i].removeEventListener('scroll', this.listener);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
}, {
|
|
1096
|
-
key: "destroy",
|
|
1097
|
-
value: function destroy() {
|
|
1098
|
-
this.unbindScrollListener();
|
|
1099
|
-
this.element = null;
|
|
1100
|
-
this.listener = null;
|
|
1101
|
-
this.scrollableParents = null;
|
|
1102
|
-
}
|
|
1103
|
-
}]);
|
|
1104
|
-
|
|
1105
|
-
return ConnectedOverlayScrollHandler;
|
|
1106
|
-
}();
|
|
1107
|
-
|
|
1108
|
-
function EventBus () {
|
|
1109
|
-
var allHandlers = new Map();
|
|
1110
|
-
return {
|
|
1111
|
-
on: function on(type, handler) {
|
|
1112
|
-
var handlers = allHandlers.get(type);
|
|
1113
|
-
if (!handlers) handlers = [handler];else handlers.push(handler);
|
|
1114
|
-
allHandlers.set(type, handlers);
|
|
1115
|
-
},
|
|
1116
|
-
off: function off(type, handler) {
|
|
1117
|
-
var handlers = allHandlers.get(type);
|
|
1118
|
-
handlers && handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
1119
|
-
},
|
|
1120
|
-
emit: function emit(type, evt) {
|
|
1121
|
-
var handlers = allHandlers.get(type);
|
|
1122
|
-
handlers && handlers.slice().forEach(function (handler) {
|
|
1123
|
-
return handler(evt);
|
|
1124
|
-
});
|
|
1125
|
-
}
|
|
1126
|
-
};
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
function _defineProperty(obj, key, value) {
|
|
1130
|
-
if (key in obj) {
|
|
1131
|
-
Object.defineProperty(obj, key, {
|
|
1132
|
-
value: value,
|
|
1133
|
-
enumerable: true,
|
|
1134
|
-
configurable: true,
|
|
1135
|
-
writable: true
|
|
1136
|
-
});
|
|
1137
|
-
} else {
|
|
1138
|
-
obj[key] = value;
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
return obj;
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1145
|
-
|
|
1146
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1147
|
-
function mask(el, options) {
|
|
1148
|
-
var defaultOptions = {
|
|
1149
|
-
mask: null,
|
|
1150
|
-
slotChar: '_',
|
|
1151
|
-
autoClear: true,
|
|
1152
|
-
unmask: false,
|
|
1153
|
-
readOnly: false,
|
|
1154
|
-
onComplete: null,
|
|
1155
|
-
onChange: null,
|
|
1156
|
-
onFocus: null,
|
|
1157
|
-
onBlur: null
|
|
1158
|
-
};
|
|
1159
|
-
options = _objectSpread$2(_objectSpread$2({}, defaultOptions), options);
|
|
1160
|
-
var tests, partialPosition, len, firstNonMaskPos, defs, androidChrome, lastRequiredNonMaskPos, oldVal, focusText, caretTimeoutId, buffer, defaultBuffer;
|
|
1161
|
-
|
|
1162
|
-
var caret = function caret(first, last) {
|
|
1163
|
-
var range, begin, end;
|
|
1164
|
-
|
|
1165
|
-
if (!el.offsetParent || el !== document.activeElement) {
|
|
1166
|
-
return;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
if (typeof first === 'number') {
|
|
1170
|
-
begin = first;
|
|
1171
|
-
end = typeof last === 'number' ? last : begin;
|
|
1172
|
-
|
|
1173
|
-
if (el.setSelectionRange) {
|
|
1174
|
-
el.setSelectionRange(begin, end);
|
|
1175
|
-
} else if (el['createTextRange']) {
|
|
1176
|
-
range = el['createTextRange']();
|
|
1177
|
-
range.collapse(true);
|
|
1178
|
-
range.moveEnd('character', end);
|
|
1179
|
-
range.moveStart('character', begin);
|
|
1180
|
-
range.select();
|
|
1181
|
-
}
|
|
1182
|
-
} else {
|
|
1183
|
-
if (el.setSelectionRange) {
|
|
1184
|
-
begin = el.selectionStart;
|
|
1185
|
-
end = el.selectionEnd;
|
|
1186
|
-
} else if (document['selection'] && document['selection'].createRange) {
|
|
1187
|
-
range = document['selection'].createRange();
|
|
1188
|
-
begin = 0 - range.duplicate().moveStart('character', -100000);
|
|
1189
|
-
end = begin + range.text.length;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
return {
|
|
1193
|
-
begin: begin,
|
|
1194
|
-
end: end
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
|
-
var isCompleted = function isCompleted() {
|
|
1200
|
-
for (var i = firstNonMaskPos; i <= lastRequiredNonMaskPos; i++) {
|
|
1201
|
-
if (tests[i] && buffer[i] === getPlaceholder(i)) {
|
|
1202
|
-
return false;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
return true;
|
|
1207
|
-
};
|
|
1208
|
-
|
|
1209
|
-
var getPlaceholder = function getPlaceholder(i) {
|
|
1210
|
-
if (i < options.slotChar.length) {
|
|
1211
|
-
return options.slotChar.charAt(i);
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
return options.slotChar.charAt(0);
|
|
1215
|
-
};
|
|
1216
|
-
|
|
1217
|
-
var getValue = function getValue() {
|
|
1218
|
-
return options.unmask ? getUnmaskedValue() : el && el.value;
|
|
1219
|
-
};
|
|
1220
|
-
|
|
1221
|
-
var seekNext = function seekNext(pos) {
|
|
1222
|
-
while (++pos < len && !tests[pos]) {
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
return pos;
|
|
1226
|
-
};
|
|
1227
|
-
|
|
1228
|
-
var seekPrev = function seekPrev(pos) {
|
|
1229
|
-
while (--pos >= 0 && !tests[pos]) {
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
return pos;
|
|
1233
|
-
};
|
|
1234
|
-
|
|
1235
|
-
var shiftL = function shiftL(begin, end) {
|
|
1236
|
-
var i, j;
|
|
1237
|
-
|
|
1238
|
-
if (begin < 0) {
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
for (i = begin, j = seekNext(end); i < len; i++) {
|
|
1243
|
-
if (tests[i]) {
|
|
1244
|
-
if (j < len && tests[i].test(buffer[j])) {
|
|
1245
|
-
buffer[i] = buffer[j];
|
|
1246
|
-
buffer[j] = getPlaceholder(j);
|
|
1247
|
-
} else {
|
|
1248
|
-
break;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
j = seekNext(j);
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
writeBuffer();
|
|
1256
|
-
caret(Math.max(firstNonMaskPos, begin));
|
|
1257
|
-
};
|
|
1258
|
-
|
|
1259
|
-
var shiftR = function shiftR(pos) {
|
|
1260
|
-
var i, c, j, t;
|
|
1261
|
-
|
|
1262
|
-
for (i = pos, c = getPlaceholder(pos); i < len; i++) {
|
|
1263
|
-
if (tests[i]) {
|
|
1264
|
-
j = seekNext(i);
|
|
1265
|
-
t = buffer[i];
|
|
1266
|
-
buffer[i] = c;
|
|
1267
|
-
|
|
1268
|
-
if (j < len && tests[j].test(t)) {
|
|
1269
|
-
c = t;
|
|
1270
|
-
} else {
|
|
1271
|
-
break;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
var handleAndroidInput = function handleAndroidInput(e) {
|
|
1278
|
-
var curVal = el.value;
|
|
1279
|
-
var pos = caret();
|
|
1280
|
-
|
|
1281
|
-
if (oldVal && oldVal.length && oldVal.length > curVal.length) {
|
|
1282
|
-
// a deletion or backspace happened
|
|
1283
|
-
checkVal(true);
|
|
1284
|
-
|
|
1285
|
-
while (pos.begin > 0 && !tests[pos.begin - 1]) {
|
|
1286
|
-
pos.begin--;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
if (pos.begin === 0) {
|
|
1290
|
-
while (pos.begin < firstNonMaskPos && !tests[pos.begin]) {
|
|
1291
|
-
pos.begin++;
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
caret(pos.begin, pos.begin);
|
|
1296
|
-
} else {
|
|
1297
|
-
checkVal(true);
|
|
1298
|
-
|
|
1299
|
-
while (pos.begin < len && !tests[pos.begin]) {
|
|
1300
|
-
pos.begin++;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
caret(pos.begin, pos.begin);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
if (options.onComplete && isCompleted()) {
|
|
1307
|
-
options.onComplete({
|
|
1308
|
-
originalEvent: e,
|
|
1309
|
-
value: getValue()
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
|
-
var onBlur = function onBlur(e) {
|
|
1315
|
-
checkVal();
|
|
1316
|
-
updateModel(e);
|
|
1317
|
-
|
|
1318
|
-
if (options.onBlur) {
|
|
1319
|
-
options.onBlur(e);
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
if (el.value !== focusText) {
|
|
1323
|
-
var event = document.createEvent('HTMLEvents');
|
|
1324
|
-
event.initEvent('change', true, false);
|
|
1325
|
-
el.dispatchEvent(event);
|
|
1326
|
-
}
|
|
1327
|
-
};
|
|
1328
|
-
|
|
1329
|
-
var onKeyDown = function onKeyDown(e) {
|
|
1330
|
-
if (options.readOnly) {
|
|
1331
|
-
return;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
var k = e.which || e.keyCode,
|
|
1335
|
-
pos,
|
|
1336
|
-
begin,
|
|
1337
|
-
end;
|
|
1338
|
-
var iPhone = /iphone/i.test(DomHandler.getUserAgent());
|
|
1339
|
-
oldVal = el.value; //backspace, delete, and escape get special treatment
|
|
1340
|
-
|
|
1341
|
-
if (k === 8 || k === 46 || iPhone && k === 127) {
|
|
1342
|
-
pos = caret();
|
|
1343
|
-
begin = pos.begin;
|
|
1344
|
-
end = pos.end;
|
|
1345
|
-
|
|
1346
|
-
if (end - begin === 0) {
|
|
1347
|
-
begin = k !== 46 ? seekPrev(begin) : end = seekNext(begin - 1);
|
|
1348
|
-
end = k === 46 ? seekNext(end) : end;
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
clearBuffer(begin, end);
|
|
1352
|
-
shiftL(begin, end - 1);
|
|
1353
|
-
updateModel(e);
|
|
1354
|
-
e.preventDefault();
|
|
1355
|
-
} else if (k === 13) {
|
|
1356
|
-
// enter
|
|
1357
|
-
onBlur(e);
|
|
1358
|
-
updateModel(e);
|
|
1359
|
-
} else if (k === 27) {
|
|
1360
|
-
// escape
|
|
1361
|
-
el.value = focusText;
|
|
1362
|
-
caret(0, checkVal());
|
|
1363
|
-
updateModel(e);
|
|
1364
|
-
e.preventDefault();
|
|
1365
|
-
}
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
|
-
var onKeyPress = function onKeyPress(e) {
|
|
1369
|
-
if (options.readOnly) {
|
|
1370
|
-
return;
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
var k = e.which || e.keyCode,
|
|
1374
|
-
pos = caret(),
|
|
1375
|
-
p,
|
|
1376
|
-
c,
|
|
1377
|
-
next,
|
|
1378
|
-
completed;
|
|
1379
|
-
|
|
1380
|
-
if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {
|
|
1381
|
-
//Ignore
|
|
1382
|
-
return;
|
|
1383
|
-
} else if (k && k !== 13) {
|
|
1384
|
-
if (pos.end - pos.begin !== 0) {
|
|
1385
|
-
clearBuffer(pos.begin, pos.end);
|
|
1386
|
-
shiftL(pos.begin, pos.end - 1);
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
p = seekNext(pos.begin - 1);
|
|
1390
|
-
|
|
1391
|
-
if (p < len) {
|
|
1392
|
-
c = String.fromCharCode(k);
|
|
1393
|
-
|
|
1394
|
-
if (tests[p].test(c)) {
|
|
1395
|
-
shiftR(p);
|
|
1396
|
-
buffer[p] = c;
|
|
1397
|
-
writeBuffer();
|
|
1398
|
-
next = seekNext(p);
|
|
1399
|
-
|
|
1400
|
-
if (/android/i.test(DomHandler.getUserAgent())) {
|
|
1401
|
-
//Path for CSP Violation on FireFox OS 1.1
|
|
1402
|
-
var proxy = function proxy() {
|
|
1403
|
-
caret(next);
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
setTimeout(proxy, 0);
|
|
1407
|
-
} else {
|
|
1408
|
-
caret(next);
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
if (pos.begin <= lastRequiredNonMaskPos) {
|
|
1412
|
-
completed = isCompleted();
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
e.preventDefault();
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
updateModel(e);
|
|
1421
|
-
|
|
1422
|
-
if (options.onComplete && completed) {
|
|
1423
|
-
options.onComplete({
|
|
1424
|
-
originalEvent: e,
|
|
1425
|
-
value: getValue()
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
var clearBuffer = function clearBuffer(start, end) {
|
|
1431
|
-
var i;
|
|
1432
|
-
|
|
1433
|
-
for (i = start; i < end && i < len; i++) {
|
|
1434
|
-
if (tests[i]) {
|
|
1435
|
-
buffer[i] = getPlaceholder(i);
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
};
|
|
1439
|
-
|
|
1440
|
-
var writeBuffer = function writeBuffer() {
|
|
1441
|
-
el.value = buffer.join('');
|
|
1442
|
-
};
|
|
1443
|
-
|
|
1444
|
-
var checkVal = function checkVal(allow) {
|
|
1445
|
-
//try to place characters where they belong
|
|
1446
|
-
var test = el.value,
|
|
1447
|
-
lastMatch = -1,
|
|
1448
|
-
i,
|
|
1449
|
-
c,
|
|
1450
|
-
pos;
|
|
1451
|
-
|
|
1452
|
-
for (i = 0, pos = 0; i < len; i++) {
|
|
1453
|
-
if (tests[i]) {
|
|
1454
|
-
buffer[i] = getPlaceholder(i);
|
|
1455
|
-
|
|
1456
|
-
while (pos++ < test.length) {
|
|
1457
|
-
c = test.charAt(pos - 1);
|
|
1458
|
-
|
|
1459
|
-
if (tests[i].test(c)) {
|
|
1460
|
-
buffer[i] = c;
|
|
1461
|
-
lastMatch = i;
|
|
1462
|
-
break;
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
if (pos > test.length) {
|
|
1467
|
-
clearBuffer(i + 1, len);
|
|
1468
|
-
break;
|
|
1469
|
-
}
|
|
1470
|
-
} else {
|
|
1471
|
-
if (buffer[i] === test.charAt(pos)) {
|
|
1472
|
-
pos++;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
if (i < partialPosition) {
|
|
1476
|
-
lastMatch = i;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
if (allow) {
|
|
1482
|
-
writeBuffer();
|
|
1483
|
-
} else if (lastMatch + 1 < partialPosition) {
|
|
1484
|
-
if (options.autoClear || buffer.join('') === defaultBuffer) {
|
|
1485
|
-
// Invalid value. Remove it and replace it with the
|
|
1486
|
-
// mask, which is the default behavior.
|
|
1487
|
-
if (el.value) el.value = '';
|
|
1488
|
-
clearBuffer(0, len);
|
|
1489
|
-
} else {
|
|
1490
|
-
// Invalid value, but we opt to show the value to the
|
|
1491
|
-
// user and allow them to correct their mistake.
|
|
1492
|
-
writeBuffer();
|
|
1493
|
-
}
|
|
1494
|
-
} else {
|
|
1495
|
-
writeBuffer();
|
|
1496
|
-
el.value = el.value.substring(0, lastMatch + 1);
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
return partialPosition ? i : firstNonMaskPos;
|
|
1500
|
-
};
|
|
1501
|
-
|
|
1502
|
-
var onFocus = function onFocus(e) {
|
|
1503
|
-
if (options.readOnly) {
|
|
1504
|
-
return;
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
clearTimeout(caretTimeoutId);
|
|
1508
|
-
var pos;
|
|
1509
|
-
focusText = el.value;
|
|
1510
|
-
pos = checkVal();
|
|
1511
|
-
caretTimeoutId = setTimeout(function () {
|
|
1512
|
-
if (el !== document.activeElement) {
|
|
1513
|
-
return;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
writeBuffer();
|
|
1517
|
-
|
|
1518
|
-
if (pos === options.mask.replace("?", "").length) {
|
|
1519
|
-
caret(0, pos);
|
|
1520
|
-
} else {
|
|
1521
|
-
caret(pos);
|
|
1522
|
-
}
|
|
1523
|
-
}, 10);
|
|
1524
|
-
|
|
1525
|
-
if (options.onFocus) {
|
|
1526
|
-
options.onFocus(e);
|
|
1527
|
-
}
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
var onInput = function onInput(event) {
|
|
1531
|
-
if (androidChrome) handleAndroidInput(event);else handleInputChange(event);
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
|
-
var handleInputChange = function handleInputChange(e) {
|
|
1535
|
-
if (options.readOnly) {
|
|
1536
|
-
return;
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
var pos = checkVal(true);
|
|
1540
|
-
caret(pos);
|
|
1541
|
-
updateModel(e);
|
|
1542
|
-
|
|
1543
|
-
if (options.onComplete && isCompleted()) {
|
|
1544
|
-
options.onComplete({
|
|
1545
|
-
originalEvent: e,
|
|
1546
|
-
value: getValue()
|
|
1547
|
-
});
|
|
1548
|
-
}
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
var getUnmaskedValue = function getUnmaskedValue() {
|
|
1552
|
-
var unmaskedBuffer = [];
|
|
1553
|
-
|
|
1554
|
-
for (var i = 0; i < buffer.length; i++) {
|
|
1555
|
-
var c = buffer[i];
|
|
1556
|
-
|
|
1557
|
-
if (tests[i] && c !== getPlaceholder(i)) {
|
|
1558
|
-
unmaskedBuffer.push(c);
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
return unmaskedBuffer.join('');
|
|
1563
|
-
};
|
|
1564
|
-
|
|
1565
|
-
var updateModel = function updateModel(e) {
|
|
1566
|
-
if (options.onChange) {
|
|
1567
|
-
var val = getValue().replace(options.slotChar, '');
|
|
1568
|
-
options.onChange({
|
|
1569
|
-
originalEvent: e,
|
|
1570
|
-
value: defaultBuffer !== val ? val : ''
|
|
1571
|
-
});
|
|
1572
|
-
}
|
|
1573
|
-
};
|
|
1574
|
-
|
|
1575
|
-
var bindEvents = function bindEvents() {
|
|
1576
|
-
el.addEventListener('focus', onFocus);
|
|
1577
|
-
el.addEventListener('blur', onBlur);
|
|
1578
|
-
el.addEventListener('keydown', onKeyDown);
|
|
1579
|
-
el.addEventListener('keypress', onKeyPress);
|
|
1580
|
-
el.addEventListener('input', onInput);
|
|
1581
|
-
el.addEventListener('paste', handleInputChange);
|
|
1582
|
-
};
|
|
1583
|
-
|
|
1584
|
-
var unbindEvents = function unbindEvents() {
|
|
1585
|
-
el.removeEventListener('focus', onFocus);
|
|
1586
|
-
el.removeEventListener('blur', onBlur);
|
|
1587
|
-
el.removeEventListener('keydown', onKeyDown);
|
|
1588
|
-
el.removeEventListener('keypress', onKeyPress);
|
|
1589
|
-
el.removeEventListener('input', onInput);
|
|
1590
|
-
el.removeEventListener('paste', handleInputChange);
|
|
1591
|
-
};
|
|
1592
|
-
|
|
1593
|
-
var init = function init() {
|
|
1594
|
-
tests = [];
|
|
1595
|
-
partialPosition = options.mask.length;
|
|
1596
|
-
len = options.mask.length;
|
|
1597
|
-
firstNonMaskPos = null;
|
|
1598
|
-
defs = {
|
|
1599
|
-
'9': '[0-9]',
|
|
1600
|
-
'a': '[A-Za-z]',
|
|
1601
|
-
'*': '[A-Za-z0-9]'
|
|
1602
|
-
};
|
|
1603
|
-
var ua = DomHandler.getUserAgent();
|
|
1604
|
-
androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
1605
|
-
var maskTokens = options.mask.split('');
|
|
1606
|
-
|
|
1607
|
-
for (var i = 0; i < maskTokens.length; i++) {
|
|
1608
|
-
var c = maskTokens[i];
|
|
1609
|
-
|
|
1610
|
-
if (c === '?') {
|
|
1611
|
-
len--;
|
|
1612
|
-
partialPosition = i;
|
|
1613
|
-
} else if (defs[c]) {
|
|
1614
|
-
tests.push(new RegExp(defs[c]));
|
|
1615
|
-
|
|
1616
|
-
if (firstNonMaskPos === null) {
|
|
1617
|
-
firstNonMaskPos = tests.length - 1;
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
if (i < partialPosition) {
|
|
1621
|
-
lastRequiredNonMaskPos = tests.length - 1;
|
|
1622
|
-
}
|
|
1623
|
-
} else {
|
|
1624
|
-
tests.push(null);
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
buffer = [];
|
|
1629
|
-
|
|
1630
|
-
for (var _i = 0; _i < maskTokens.length; _i++) {
|
|
1631
|
-
var _c = maskTokens[_i];
|
|
1632
|
-
|
|
1633
|
-
if (_c !== '?') {
|
|
1634
|
-
if (defs[_c]) buffer.push(getPlaceholder(_i));else buffer.push(_c);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
defaultBuffer = buffer.join('');
|
|
1639
|
-
};
|
|
1640
|
-
|
|
1641
|
-
if (el && options.mask) {
|
|
1642
|
-
init();
|
|
1643
|
-
bindEvents();
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
return {
|
|
1647
|
-
init: init,
|
|
1648
|
-
bindEvents: bindEvents,
|
|
1649
|
-
unbindEvents: unbindEvents,
|
|
1650
|
-
updateModel: updateModel,
|
|
1651
|
-
getValue: getValue
|
|
1652
|
-
};
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
var ObjectUtils = /*#__PURE__*/function () {
|
|
1656
|
-
function ObjectUtils() {
|
|
1657
|
-
_classCallCheck(this, ObjectUtils);
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
_createClass(ObjectUtils, null, [{
|
|
1661
|
-
key: "equals",
|
|
1662
|
-
value: function equals(obj1, obj2, field) {
|
|
1663
|
-
if (field && obj1 && _typeof(obj1) === 'object' && obj2 && _typeof(obj2) === 'object') return this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field);else return this.deepEquals(obj1, obj2);
|
|
1664
|
-
}
|
|
1665
|
-
}, {
|
|
1666
|
-
key: "deepEquals",
|
|
1667
|
-
value: function deepEquals(a, b) {
|
|
1668
|
-
if (a === b) return true;
|
|
1669
|
-
|
|
1670
|
-
if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {
|
|
1671
|
-
var arrA = Array.isArray(a),
|
|
1672
|
-
arrB = Array.isArray(b),
|
|
1673
|
-
i,
|
|
1674
|
-
length,
|
|
1675
|
-
key;
|
|
1676
|
-
|
|
1677
|
-
if (arrA && arrB) {
|
|
1678
|
-
length = a.length;
|
|
1679
|
-
if (length !== b.length) return false;
|
|
1680
|
-
|
|
1681
|
-
for (i = length; i-- !== 0;) {
|
|
1682
|
-
if (!this.deepEquals(a[i], b[i])) return false;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
return true;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
if (arrA !== arrB) return false;
|
|
1689
|
-
var dateA = a instanceof Date,
|
|
1690
|
-
dateB = b instanceof Date;
|
|
1691
|
-
if (dateA !== dateB) return false;
|
|
1692
|
-
if (dateA && dateB) return a.getTime() === b.getTime();
|
|
1693
|
-
var regexpA = a instanceof RegExp,
|
|
1694
|
-
regexpB = b instanceof RegExp;
|
|
1695
|
-
if (regexpA !== regexpB) return false;
|
|
1696
|
-
if (regexpA && regexpB) return a.toString() === b.toString();
|
|
1697
|
-
var keys = Object.keys(a);
|
|
1698
|
-
length = keys.length;
|
|
1699
|
-
if (length !== Object.keys(b).length) return false;
|
|
1700
|
-
|
|
1701
|
-
for (i = length; i-- !== 0;) {
|
|
1702
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
for (i = length; i-- !== 0;) {
|
|
1706
|
-
key = keys[i];
|
|
1707
|
-
if (!this.deepEquals(a[key], b[key])) return false;
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
return true;
|
|
1711
|
-
}
|
|
1712
|
-
/*eslint no-self-compare: "off"*/
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
return a !== a && b !== b;
|
|
1716
|
-
}
|
|
1717
|
-
}, {
|
|
1718
|
-
key: "resolveFieldData",
|
|
1719
|
-
value: function resolveFieldData(data, field) {
|
|
1720
|
-
if (data && Object.keys(data).length && field) {
|
|
1721
|
-
if (this.isFunction(field)) {
|
|
1722
|
-
return field(data);
|
|
1723
|
-
} else if (field.indexOf('.') === -1) {
|
|
1724
|
-
return data[field];
|
|
1725
|
-
} else {
|
|
1726
|
-
var fields = field.split('.');
|
|
1727
|
-
var value = data;
|
|
1728
|
-
|
|
1729
|
-
for (var i = 0, len = fields.length; i < len; ++i) {
|
|
1730
|
-
if (value == null) {
|
|
1731
|
-
return null;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
value = value[fields[i]];
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
return value;
|
|
1738
|
-
}
|
|
1739
|
-
} else {
|
|
1740
|
-
return null;
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
}, {
|
|
1744
|
-
key: "isFunction",
|
|
1745
|
-
value: function isFunction(obj) {
|
|
1746
|
-
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
1747
|
-
}
|
|
1748
|
-
}, {
|
|
1749
|
-
key: "findDiffKeys",
|
|
1750
|
-
value: function findDiffKeys(obj1, obj2) {
|
|
1751
|
-
if (!obj1 || !obj2) {
|
|
1752
|
-
return {};
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
return Object.keys(obj1).filter(function (key) {
|
|
1756
|
-
return !obj2.hasOwnProperty(key);
|
|
1757
|
-
}).reduce(function (result, current) {
|
|
1758
|
-
result[current] = obj1[current];
|
|
1759
|
-
return result;
|
|
1760
|
-
}, {});
|
|
1761
|
-
}
|
|
1762
|
-
}, {
|
|
1763
|
-
key: "reorderArray",
|
|
1764
|
-
value: function reorderArray(value, from, to) {
|
|
1765
|
-
var target;
|
|
1766
|
-
|
|
1767
|
-
if (value && from !== to) {
|
|
1768
|
-
if (to >= value.length) {
|
|
1769
|
-
target = to - value.length;
|
|
1770
|
-
|
|
1771
|
-
while (target-- + 1) {
|
|
1772
|
-
value.push(undefined);
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
value.splice(to, 0, value.splice(from, 1)[0]);
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
}, {
|
|
1780
|
-
key: "findIndexInList",
|
|
1781
|
-
value: function findIndexInList(value, list, dataKey) {
|
|
1782
|
-
var _this = this;
|
|
1783
|
-
|
|
1784
|
-
if (list) {
|
|
1785
|
-
return dataKey ? list.findIndex(function (item) {
|
|
1786
|
-
return _this.equals(item, value, dataKey);
|
|
1787
|
-
}) : list.findIndex(function (item) {
|
|
1788
|
-
return item === value;
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
return -1;
|
|
1793
|
-
}
|
|
1794
|
-
}, {
|
|
1795
|
-
key: "getJSXElement",
|
|
1796
|
-
value: function getJSXElement(obj) {
|
|
1797
|
-
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1798
|
-
params[_key - 1] = arguments[_key];
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
return this.isFunction(obj) ? obj.apply(void 0, params) : obj;
|
|
1802
|
-
}
|
|
1803
|
-
}, {
|
|
1804
|
-
key: "getPropValue",
|
|
1805
|
-
value: function getPropValue(obj) {
|
|
1806
|
-
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1807
|
-
params[_key2 - 1] = arguments[_key2];
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
return this.isFunction(obj) ? obj.apply(void 0, params) : obj;
|
|
1811
|
-
}
|
|
1812
|
-
}, {
|
|
1813
|
-
key: "getRefElement",
|
|
1814
|
-
value: function getRefElement(ref) {
|
|
1815
|
-
if (ref) {
|
|
1816
|
-
return _typeof(ref) === 'object' && ref.hasOwnProperty('current') ? ref.current : ref;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
return null;
|
|
1820
|
-
}
|
|
1821
|
-
}, {
|
|
1822
|
-
key: "removeAccents",
|
|
1823
|
-
value: function removeAccents(str) {
|
|
1824
|
-
if (str && str.search(/[\xC0-\xFF]/g) > -1) {
|
|
1825
|
-
str = str.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y");
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
return str;
|
|
1829
|
-
}
|
|
1830
|
-
}, {
|
|
1831
|
-
key: "isEmpty",
|
|
1832
|
-
value: function isEmpty(value) {
|
|
1833
|
-
return value === null || value === undefined || value === '' || Array.isArray(value) && value.length === 0 || !(value instanceof Date) && _typeof(value) === 'object' && Object.keys(value).length === 0;
|
|
1834
|
-
}
|
|
1835
|
-
}, {
|
|
1836
|
-
key: "isNotEmpty",
|
|
1837
|
-
value: function isNotEmpty(value) {
|
|
1838
|
-
return !this.isEmpty(value);
|
|
1839
|
-
}
|
|
1840
|
-
}]);
|
|
1841
|
-
|
|
1842
|
-
return ObjectUtils;
|
|
1843
|
-
}();
|
|
1844
|
-
|
|
1845
|
-
var lastId = 0;
|
|
1846
|
-
function UniqueComponentId () {
|
|
1847
|
-
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pr_id_';
|
|
1848
|
-
lastId++;
|
|
1849
|
-
return "".concat(prefix).concat(lastId);
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
function handler() {
|
|
1853
|
-
var zIndexes = [];
|
|
1854
|
-
|
|
1855
|
-
var generateZIndex = function generateZIndex(key, baseZIndex) {
|
|
1856
|
-
baseZIndex = baseZIndex || getBaseZIndex(key);
|
|
1857
|
-
var lastZIndex = getLastZIndex(key, baseZIndex);
|
|
1858
|
-
var newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;
|
|
1859
|
-
zIndexes.push({
|
|
1860
|
-
key: key,
|
|
1861
|
-
value: newZIndex
|
|
1862
|
-
});
|
|
1863
|
-
return newZIndex;
|
|
1864
|
-
};
|
|
1865
|
-
|
|
1866
|
-
var revertZIndex = function revertZIndex(zIndex) {
|
|
1867
|
-
zIndexes = zIndexes.filter(function (obj) {
|
|
1868
|
-
return obj.value !== zIndex;
|
|
1869
|
-
});
|
|
1870
|
-
};
|
|
1871
|
-
|
|
1872
|
-
var getBaseZIndex = function getBaseZIndex(key) {
|
|
1873
|
-
return PrimeReact__default['default'].zIndex[key] || 999;
|
|
1874
|
-
};
|
|
1875
|
-
|
|
1876
|
-
var getCurrentZIndex = function getCurrentZIndex(key) {
|
|
1877
|
-
return getLastZIndex(key).value;
|
|
1878
|
-
};
|
|
1879
|
-
|
|
1880
|
-
var getLastZIndex = function getLastZIndex(key) {
|
|
1881
|
-
var baseZIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1882
|
-
return (zIndexes || []).reverse().find(function (obj) {
|
|
1883
|
-
return PrimeReact__default['default'].autoZIndex ? true : obj.key === key;
|
|
1884
|
-
}) || {
|
|
1885
|
-
key: key,
|
|
1886
|
-
value: baseZIndex
|
|
1887
|
-
};
|
|
1888
|
-
};
|
|
1889
|
-
|
|
1890
|
-
return {
|
|
1891
|
-
get: function get(el) {
|
|
1892
|
-
return el ? parseInt(el.style.zIndex, 10) || 0 : 0;
|
|
1893
|
-
},
|
|
1894
|
-
set: function set(key, el, baseZIndex) {
|
|
1895
|
-
if (el) {
|
|
1896
|
-
el.style.zIndex = String(generateZIndex(key, baseZIndex));
|
|
1897
|
-
}
|
|
1898
|
-
},
|
|
1899
|
-
clear: function clear(el) {
|
|
1900
|
-
if (el) {
|
|
1901
|
-
revertZIndex(ZIndexUtils.get(el));
|
|
1902
|
-
el.style.zIndex = '';
|
|
1903
|
-
}
|
|
1904
|
-
},
|
|
1905
|
-
getBase: function getBase(key) {
|
|
1906
|
-
return getBaseZIndex(key);
|
|
1907
|
-
},
|
|
1908
|
-
getCurrent: function getCurrent(key) {
|
|
1909
|
-
return getCurrentZIndex(key);
|
|
1910
|
-
}
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
var ZIndexUtils = handler();
|
|
1915
|
-
|
|
1916
|
-
function _assertThisInitialized(self) {
|
|
1917
|
-
if (self === void 0) {
|
|
1918
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
return self;
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
function _setPrototypeOf(o, p) {
|
|
1925
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
1926
|
-
o.__proto__ = p;
|
|
1927
|
-
return o;
|
|
1928
|
-
};
|
|
1929
|
-
|
|
1930
|
-
return _setPrototypeOf(o, p);
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
function _inherits(subClass, superClass) {
|
|
1934
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
1935
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
1939
|
-
constructor: {
|
|
1940
|
-
value: subClass,
|
|
1941
|
-
writable: true,
|
|
1942
|
-
configurable: true
|
|
1943
|
-
}
|
|
1944
|
-
});
|
|
1945
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
function _possibleConstructorReturn(self, call) {
|
|
1949
|
-
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
1950
|
-
return call;
|
|
1951
|
-
} else if (call !== void 0) {
|
|
1952
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
return _assertThisInitialized(self);
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
function _getPrototypeOf(o) {
|
|
1959
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
1960
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
1961
|
-
};
|
|
1962
|
-
return _getPrototypeOf(o);
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1966
|
-
|
|
1967
|
-
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1968
|
-
var Ripple = /*#__PURE__*/function (_Component) {
|
|
1969
|
-
_inherits(Ripple, _Component);
|
|
1970
|
-
|
|
1971
|
-
var _super = _createSuper$3(Ripple);
|
|
1972
|
-
|
|
1973
|
-
function Ripple(props) {
|
|
1974
|
-
var _this;
|
|
1975
|
-
|
|
1976
|
-
_classCallCheck(this, Ripple);
|
|
1977
|
-
|
|
1978
|
-
_this = _super.call(this, props);
|
|
1979
|
-
_this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
|
|
1980
|
-
return _this;
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
_createClass(Ripple, [{
|
|
1984
|
-
key: "getTarget",
|
|
1985
|
-
value: function getTarget() {
|
|
1986
|
-
return this.ink && this.ink.parentElement;
|
|
1987
|
-
}
|
|
1988
|
-
}, {
|
|
1989
|
-
key: "bindEvents",
|
|
1990
|
-
value: function bindEvents() {
|
|
1991
|
-
if (this.target) {
|
|
1992
|
-
this.target.addEventListener('mousedown', this.onMouseDown);
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
}, {
|
|
1996
|
-
key: "unbindEvents",
|
|
1997
|
-
value: function unbindEvents() {
|
|
1998
|
-
if (this.target) {
|
|
1999
|
-
this.target.removeEventListener('mousedown', this.onMouseDown);
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
}, {
|
|
2003
|
-
key: "onMouseDown",
|
|
2004
|
-
value: function onMouseDown(event) {
|
|
2005
|
-
if (!this.ink || getComputedStyle(this.ink, null).display === 'none') {
|
|
2006
|
-
return;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
DomHandler.removeClass(this.ink, 'p-ink-active');
|
|
2010
|
-
|
|
2011
|
-
if (!DomHandler.getHeight(this.ink) && !DomHandler.getWidth(this.ink)) {
|
|
2012
|
-
var d = Math.max(DomHandler.getOuterWidth(this.target), DomHandler.getOuterHeight(this.target));
|
|
2013
|
-
this.ink.style.height = d + 'px';
|
|
2014
|
-
this.ink.style.width = d + 'px';
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
var offset = DomHandler.getOffset(this.target);
|
|
2018
|
-
var x = event.pageX - offset.left + document.body.scrollTop - DomHandler.getWidth(this.ink) / 2;
|
|
2019
|
-
var y = event.pageY - offset.top + document.body.scrollLeft - DomHandler.getHeight(this.ink) / 2;
|
|
2020
|
-
this.ink.style.top = y + 'px';
|
|
2021
|
-
this.ink.style.left = x + 'px';
|
|
2022
|
-
DomHandler.addClass(this.ink, 'p-ink-active');
|
|
2023
|
-
}
|
|
2024
|
-
}, {
|
|
2025
|
-
key: "onAnimationEnd",
|
|
2026
|
-
value: function onAnimationEnd(event) {
|
|
2027
|
-
DomHandler.removeClass(event.currentTarget, 'p-ink-active');
|
|
2028
|
-
}
|
|
2029
|
-
}, {
|
|
2030
|
-
key: "componentDidMount",
|
|
2031
|
-
value: function componentDidMount() {
|
|
2032
|
-
if (this.ink) {
|
|
2033
|
-
this.target = this.getTarget();
|
|
2034
|
-
this.bindEvents();
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
}, {
|
|
2038
|
-
key: "componentDidUpdate",
|
|
2039
|
-
value: function componentDidUpdate() {
|
|
2040
|
-
if (this.ink && !this.target) {
|
|
2041
|
-
this.target = this.getTarget();
|
|
2042
|
-
this.bindEvents();
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
}, {
|
|
2046
|
-
key: "componentWillUnmount",
|
|
2047
|
-
value: function componentWillUnmount() {
|
|
2048
|
-
if (this.ink) {
|
|
2049
|
-
this.target = null;
|
|
2050
|
-
this.unbindEvents();
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
}, {
|
|
2054
|
-
key: "render",
|
|
2055
|
-
value: function render() {
|
|
2056
|
-
var _this2 = this;
|
|
2057
|
-
|
|
2058
|
-
return PrimeReact__default['default'].ripple && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2059
|
-
ref: function ref(el) {
|
|
2060
|
-
return _this2.ink = el;
|
|
2061
|
-
},
|
|
2062
|
-
className: "p-ink",
|
|
2063
|
-
onAnimationEnd: this.onAnimationEnd
|
|
2064
|
-
});
|
|
2065
|
-
}
|
|
2066
|
-
}]);
|
|
2067
|
-
|
|
2068
|
-
return Ripple;
|
|
2069
|
-
}(React.Component);
|
|
2070
|
-
|
|
2071
|
-
var KeyFilter = /*#__PURE__*/function () {
|
|
2072
|
-
function KeyFilter() {
|
|
2073
|
-
_classCallCheck(this, KeyFilter);
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
_createClass(KeyFilter, null, [{
|
|
2077
|
-
key: "isNavKeyPress",
|
|
2078
|
-
value:
|
|
2079
|
-
/* eslint-disable */
|
|
2080
|
-
|
|
2081
|
-
/* eslint-enable */
|
|
2082
|
-
function isNavKeyPress(e) {
|
|
2083
|
-
var k = e.keyCode;
|
|
2084
|
-
k = DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;
|
|
2085
|
-
return k >= 33 && k <= 40 || k === KeyFilter.KEYS.RETURN || k === KeyFilter.KEYS.TAB || k === KeyFilter.KEYS.ESC;
|
|
2086
|
-
}
|
|
2087
|
-
}, {
|
|
2088
|
-
key: "isSpecialKey",
|
|
2089
|
-
value: function isSpecialKey(e) {
|
|
2090
|
-
var k = e.keyCode;
|
|
2091
|
-
return k === 9 || k === 13 || k === 27 || k === 16 || k === 17 || k >= 18 && k <= 20 || DomHandler.getBrowser().opera && !e.shiftKey && (k === 8 || k >= 33 && k <= 35 || k >= 36 && k <= 39 || k >= 44 && k <= 45);
|
|
2092
|
-
}
|
|
2093
|
-
}, {
|
|
2094
|
-
key: "getKey",
|
|
2095
|
-
value: function getKey(e) {
|
|
2096
|
-
var k = e.keyCode || e.charCode;
|
|
2097
|
-
return DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;
|
|
2098
|
-
}
|
|
2099
|
-
}, {
|
|
2100
|
-
key: "getCharCode",
|
|
2101
|
-
value: function getCharCode(e) {
|
|
2102
|
-
return e.charCode || e.keyCode || e.which;
|
|
2103
|
-
}
|
|
2104
|
-
}, {
|
|
2105
|
-
key: "onKeyPress",
|
|
2106
|
-
value: function onKeyPress(e, keyfilter, validateOnly) {
|
|
2107
|
-
if (validateOnly) {
|
|
2108
|
-
return;
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
var regex = KeyFilter.DEFAULT_MASKS[keyfilter] ? KeyFilter.DEFAULT_MASKS[keyfilter] : keyfilter;
|
|
2112
|
-
var browser = DomHandler.getBrowser();
|
|
2113
|
-
|
|
2114
|
-
if (e.ctrlKey || e.altKey) {
|
|
2115
|
-
return;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
var k = this.getKey(e);
|
|
2119
|
-
|
|
2120
|
-
if (browser.mozilla && (this.isNavKeyPress(e) || k === KeyFilter.KEYS.BACKSPACE || k === KeyFilter.KEYS.DELETE && e.charCode === 0)) {
|
|
2121
|
-
return;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
var c = this.getCharCode(e);
|
|
2125
|
-
var cc = String.fromCharCode(c);
|
|
2126
|
-
|
|
2127
|
-
if (browser.mozilla && (this.isSpecialKey(e) || !cc)) {
|
|
2128
|
-
return;
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
if (!regex.test(cc)) {
|
|
2132
|
-
e.preventDefault();
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
}, {
|
|
2136
|
-
key: "validate",
|
|
2137
|
-
value: function validate(e, keyfilter) {
|
|
2138
|
-
var value = e.target.value,
|
|
2139
|
-
validatePattern = true;
|
|
2140
|
-
|
|
2141
|
-
if (value && !keyfilter.test(value)) {
|
|
2142
|
-
validatePattern = false;
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
return validatePattern;
|
|
2146
|
-
}
|
|
2147
|
-
}]);
|
|
2148
|
-
|
|
2149
|
-
return KeyFilter;
|
|
2150
|
-
}();
|
|
2151
|
-
|
|
2152
|
-
_defineProperty(KeyFilter, "DEFAULT_MASKS", {
|
|
2153
|
-
pint: /[\d]/,
|
|
2154
|
-
int: /[\d\-]/,
|
|
2155
|
-
pnum: /[\d\.]/,
|
|
2156
|
-
money: /[\d\.\s,]/,
|
|
2157
|
-
num: /[\d\-\.]/,
|
|
2158
|
-
hex: /[0-9a-f]/i,
|
|
2159
|
-
email: /[a-z0-9_\.\-@]/i,
|
|
2160
|
-
alpha: /[a-z_]/i,
|
|
2161
|
-
alphanum: /[a-z0-9_]/i
|
|
2162
|
-
});
|
|
2163
|
-
|
|
2164
|
-
_defineProperty(KeyFilter, "KEYS", {
|
|
2165
|
-
TAB: 9,
|
|
2166
|
-
RETURN: 13,
|
|
2167
|
-
ESC: 27,
|
|
2168
|
-
BACKSPACE: 8,
|
|
2169
|
-
DELETE: 46
|
|
2170
|
-
});
|
|
2171
|
-
|
|
2172
|
-
_defineProperty(KeyFilter, "SAFARI_KEYS", {
|
|
2173
|
-
63234: 37,
|
|
2174
|
-
// left
|
|
2175
|
-
63235: 39,
|
|
2176
|
-
// right
|
|
2177
|
-
63232: 38,
|
|
2178
|
-
// up
|
|
2179
|
-
63233: 40,
|
|
2180
|
-
// down
|
|
2181
|
-
63276: 33,
|
|
2182
|
-
// page up
|
|
2183
|
-
63277: 34,
|
|
2184
|
-
// page down
|
|
2185
|
-
63272: 46,
|
|
2186
|
-
// delete
|
|
2187
|
-
63273: 36,
|
|
2188
|
-
// home
|
|
2189
|
-
63275: 35 // end
|
|
2190
|
-
|
|
2191
|
-
});
|
|
2192
|
-
|
|
2193
|
-
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2194
|
-
|
|
2195
|
-
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2196
|
-
var Portal = /*#__PURE__*/function (_Component) {
|
|
2197
|
-
_inherits(Portal, _Component);
|
|
2198
|
-
|
|
2199
|
-
var _super = _createSuper$2(Portal);
|
|
2200
|
-
|
|
2201
|
-
function Portal(props) {
|
|
2202
|
-
var _this;
|
|
2203
|
-
|
|
2204
|
-
_classCallCheck(this, Portal);
|
|
2205
|
-
|
|
2206
|
-
_this = _super.call(this, props);
|
|
2207
|
-
_this.state = {
|
|
2208
|
-
mounted: props.visible
|
|
2209
|
-
};
|
|
2210
|
-
return _this;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
_createClass(Portal, [{
|
|
2214
|
-
key: "hasDOM",
|
|
2215
|
-
value: function hasDOM() {
|
|
2216
|
-
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
2217
|
-
}
|
|
2218
|
-
}, {
|
|
2219
|
-
key: "componentDidMount",
|
|
2220
|
-
value: function componentDidMount() {
|
|
2221
|
-
if (this.hasDOM() && !this.state.mounted) {
|
|
2222
|
-
this.setState({
|
|
2223
|
-
mounted: true
|
|
2224
|
-
}, this.props.onMounted);
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
}, {
|
|
2228
|
-
key: "componentWillUnmount",
|
|
2229
|
-
value: function componentWillUnmount() {
|
|
2230
|
-
this.props.onUnmounted && this.props.onUnmounted();
|
|
2231
|
-
}
|
|
2232
|
-
}, {
|
|
2233
|
-
key: "render",
|
|
2234
|
-
value: function render() {
|
|
2235
|
-
var element = this.props.element || this.props.children;
|
|
2236
|
-
|
|
2237
|
-
if (element && this.state.mounted) {
|
|
2238
|
-
var appendTo = this.props.appendTo || PrimeReact__default['default'].appendTo || document.body;
|
|
2239
|
-
return appendTo === 'self' ? element : /*#__PURE__*/ReactDOM__default['default'].createPortal(element, appendTo);
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
return null;
|
|
2243
|
-
}
|
|
2244
|
-
}]);
|
|
2245
|
-
|
|
2246
|
-
return Portal;
|
|
2247
|
-
}(React.Component);
|
|
2248
|
-
|
|
2249
|
-
_defineProperty(Portal, "defaultProps", {
|
|
2250
|
-
element: null,
|
|
2251
|
-
appendTo: null,
|
|
2252
|
-
visible: false,
|
|
2253
|
-
onMounted: null,
|
|
2254
|
-
onUnmounted: null
|
|
2255
|
-
});
|
|
2256
|
-
|
|
2257
|
-
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2258
|
-
|
|
2259
|
-
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2260
|
-
|
|
2261
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2262
|
-
|
|
2263
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2264
|
-
function tip(props) {
|
|
2265
|
-
var appendTo = props.appendTo || document.body;
|
|
2266
|
-
var tooltipWrapper = document.createDocumentFragment();
|
|
2267
|
-
DomHandler.appendChild(tooltipWrapper, appendTo);
|
|
2268
|
-
props = _objectSpread$1(_objectSpread$1({}, props), props.options);
|
|
2269
|
-
var tooltipEl = /*#__PURE__*/React__default['default'].createElement(Tooltip, props);
|
|
2270
|
-
ReactDOM__default['default'].render(tooltipEl, tooltipWrapper);
|
|
2271
|
-
|
|
2272
|
-
var updateTooltip = function updateTooltip(newProps) {
|
|
2273
|
-
props = _objectSpread$1(_objectSpread$1({}, props), newProps);
|
|
2274
|
-
ReactDOM__default['default'].render( /*#__PURE__*/React__default['default'].cloneElement(tooltipEl, props), tooltipWrapper);
|
|
2275
|
-
};
|
|
2276
|
-
|
|
2277
|
-
return {
|
|
2278
|
-
destroy: function destroy() {
|
|
2279
|
-
ReactDOM__default['default'].unmountComponentAtNode(tooltipWrapper);
|
|
2280
|
-
},
|
|
2281
|
-
updateContent: function updateContent(newContent) {
|
|
2282
|
-
console.warn("The 'updateContent' method has been deprecated on Tooltip. Use update(newProps) method.");
|
|
2283
|
-
updateTooltip({
|
|
2284
|
-
content: newContent
|
|
2285
|
-
});
|
|
2286
|
-
},
|
|
2287
|
-
update: function update(newProps) {
|
|
2288
|
-
updateTooltip(newProps);
|
|
2289
|
-
}
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2292
|
-
var Tooltip = /*#__PURE__*/function (_Component) {
|
|
2293
|
-
_inherits(Tooltip, _Component);
|
|
2294
|
-
|
|
2295
|
-
var _super = _createSuper$1(Tooltip);
|
|
2296
|
-
|
|
2297
|
-
function Tooltip(props) {
|
|
2298
|
-
var _this;
|
|
2299
|
-
|
|
2300
|
-
_classCallCheck(this, Tooltip);
|
|
2301
|
-
|
|
2302
|
-
_this = _super.call(this, props);
|
|
2303
|
-
_this.state = {
|
|
2304
|
-
visible: false,
|
|
2305
|
-
position: _this.props.position
|
|
2306
|
-
};
|
|
2307
|
-
_this.show = _this.show.bind(_assertThisInitialized(_this));
|
|
2308
|
-
_this.hide = _this.hide.bind(_assertThisInitialized(_this));
|
|
2309
|
-
_this.onMouseEnter = _this.onMouseEnter.bind(_assertThisInitialized(_this));
|
|
2310
|
-
_this.onMouseLeave = _this.onMouseLeave.bind(_assertThisInitialized(_this));
|
|
2311
|
-
return _this;
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
_createClass(Tooltip, [{
|
|
2315
|
-
key: "isTargetContentEmpty",
|
|
2316
|
-
value: function isTargetContentEmpty(target) {
|
|
2317
|
-
return !(this.props.content || this.getTargetOption(target, 'tooltip'));
|
|
2318
|
-
}
|
|
2319
|
-
}, {
|
|
2320
|
-
key: "isContentEmpty",
|
|
2321
|
-
value: function isContentEmpty(target) {
|
|
2322
|
-
return !(this.props.content || this.getTargetOption(target, 'tooltip') || this.props.children);
|
|
2323
|
-
}
|
|
2324
|
-
}, {
|
|
2325
|
-
key: "isMouseTrack",
|
|
2326
|
-
value: function isMouseTrack(target) {
|
|
2327
|
-
return this.getTargetOption(target, 'mousetrack') || this.props.mouseTrack;
|
|
2328
|
-
}
|
|
2329
|
-
}, {
|
|
2330
|
-
key: "isDisabled",
|
|
2331
|
-
value: function isDisabled(target) {
|
|
2332
|
-
return this.getTargetOption(target, 'disabled') === 'true' || this.hasTargetOption(target, 'disabled') || this.props.disabled;
|
|
2333
|
-
}
|
|
2334
|
-
}, {
|
|
2335
|
-
key: "isAutoHide",
|
|
2336
|
-
value: function isAutoHide() {
|
|
2337
|
-
return this.getTargetOption(this.currentTarget, 'autohide') || this.props.autoHide;
|
|
2338
|
-
}
|
|
2339
|
-
}, {
|
|
2340
|
-
key: "getTargetOption",
|
|
2341
|
-
value: function getTargetOption(target, option) {
|
|
2342
|
-
if (this.hasTargetOption(target, "data-pr-".concat(option))) {
|
|
2343
|
-
return target.getAttribute("data-pr-".concat(option));
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
return null;
|
|
2347
|
-
}
|
|
2348
|
-
}, {
|
|
2349
|
-
key: "hasTargetOption",
|
|
2350
|
-
value: function hasTargetOption(target, option) {
|
|
2351
|
-
return target && target.hasAttribute(option);
|
|
2352
|
-
}
|
|
2353
|
-
}, {
|
|
2354
|
-
key: "getEvents",
|
|
2355
|
-
value: function getEvents(target) {
|
|
2356
|
-
var showEvent = this.getTargetOption(target, 'showevent') || this.props.showEvent;
|
|
2357
|
-
var hideEvent = this.getTargetOption(target, 'hideevent') || this.props.hideEvent;
|
|
2358
|
-
|
|
2359
|
-
if (this.isMouseTrack(target)) {
|
|
2360
|
-
showEvent = 'mousemove';
|
|
2361
|
-
hideEvent = 'mouseleave';
|
|
2362
|
-
} else {
|
|
2363
|
-
var event = this.getTargetOption(target, 'event') || this.props.event;
|
|
2364
|
-
|
|
2365
|
-
if (event === 'focus') {
|
|
2366
|
-
showEvent = 'focus';
|
|
2367
|
-
hideEvent = 'blur';
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
return {
|
|
2372
|
-
showEvent: showEvent,
|
|
2373
|
-
hideEvent: hideEvent
|
|
2374
|
-
};
|
|
2375
|
-
}
|
|
2376
|
-
}, {
|
|
2377
|
-
key: "getPosition",
|
|
2378
|
-
value: function getPosition(target) {
|
|
2379
|
-
return this.getTargetOption(target, 'position') || this.state.position;
|
|
2380
|
-
}
|
|
2381
|
-
}, {
|
|
2382
|
-
key: "getMouseTrackPosition",
|
|
2383
|
-
value: function getMouseTrackPosition(target) {
|
|
2384
|
-
var top = this.getTargetOption(target, 'mousetracktop') || this.props.mouseTrackTop;
|
|
2385
|
-
var left = this.getTargetOption(target, 'mousetrackleft') || this.props.mouseTrackLeft;
|
|
2386
|
-
return {
|
|
2387
|
-
top: top,
|
|
2388
|
-
left: left
|
|
2389
|
-
};
|
|
2390
|
-
}
|
|
2391
|
-
}, {
|
|
2392
|
-
key: "updateText",
|
|
2393
|
-
value: function updateText(target, callback) {
|
|
2394
|
-
if (this.tooltipTextEl) {
|
|
2395
|
-
var content = this.getTargetOption(target, 'tooltip') || this.props.content;
|
|
2396
|
-
|
|
2397
|
-
if (content) {
|
|
2398
|
-
this.tooltipTextEl.innerHTML = ''; // remove children
|
|
2399
|
-
|
|
2400
|
-
this.tooltipTextEl.appendChild(document.createTextNode(content));
|
|
2401
|
-
callback();
|
|
2402
|
-
} else if (this.props.children) {
|
|
2403
|
-
callback();
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
}
|
|
2407
|
-
}, {
|
|
2408
|
-
key: "show",
|
|
2409
|
-
value: function show(e) {
|
|
2410
|
-
var _this2 = this;
|
|
2411
|
-
|
|
2412
|
-
this.currentTarget = e.currentTarget;
|
|
2413
|
-
|
|
2414
|
-
if (this.isContentEmpty(this.currentTarget) || this.isDisabled(this.currentTarget)) {
|
|
2415
|
-
return;
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
var updateTooltipState = function updateTooltipState() {
|
|
2419
|
-
_this2.updateText(_this2.currentTarget, function () {
|
|
2420
|
-
if (_this2.props.autoZIndex && !ZIndexUtils.get(_this2.containerEl)) {
|
|
2421
|
-
ZIndexUtils.set('tooltip', _this2.containerEl, _this2.props.baseZIndex);
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
_this2.containerEl.style.left = '';
|
|
2425
|
-
_this2.containerEl.style.top = '';
|
|
2426
|
-
|
|
2427
|
-
if (_this2.isMouseTrack(_this2.currentTarget) && !_this2.containerSize) {
|
|
2428
|
-
_this2.containerSize = {
|
|
2429
|
-
width: DomHandler.getOuterWidth(_this2.containerEl),
|
|
2430
|
-
height: DomHandler.getOuterHeight(_this2.containerEl)
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
_this2.align(_this2.currentTarget, {
|
|
2435
|
-
x: e.pageX,
|
|
2436
|
-
y: e.pageY
|
|
2437
|
-
});
|
|
2438
|
-
});
|
|
2439
|
-
};
|
|
2440
|
-
|
|
2441
|
-
if (this.state.visible) {
|
|
2442
|
-
this.applyDelay('updateDelay', updateTooltipState);
|
|
2443
|
-
} else {
|
|
2444
|
-
this.sendCallback(this.props.onBeforeShow, {
|
|
2445
|
-
originalEvent: e,
|
|
2446
|
-
target: this.currentTarget
|
|
2447
|
-
});
|
|
2448
|
-
this.applyDelay('showDelay', function () {
|
|
2449
|
-
_this2.setState({
|
|
2450
|
-
visible: true,
|
|
2451
|
-
position: _this2.getPosition(_this2.currentTarget)
|
|
2452
|
-
}, function () {
|
|
2453
|
-
updateTooltipState();
|
|
2454
|
-
|
|
2455
|
-
_this2.sendCallback(_this2.props.onShow, {
|
|
2456
|
-
originalEvent: e,
|
|
2457
|
-
target: _this2.currentTarget
|
|
2458
|
-
});
|
|
2459
|
-
});
|
|
2460
|
-
|
|
2461
|
-
_this2.bindDocumentResizeListener();
|
|
2462
|
-
|
|
2463
|
-
_this2.bindScrollListener();
|
|
2464
|
-
|
|
2465
|
-
DomHandler.addClass(_this2.currentTarget, _this2.getTargetOption(_this2.currentTarget, 'classname'));
|
|
2466
|
-
});
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
}, {
|
|
2470
|
-
key: "hide",
|
|
2471
|
-
value: function hide(e) {
|
|
2472
|
-
var _this3 = this;
|
|
2473
|
-
|
|
2474
|
-
this.clearTimeouts();
|
|
2475
|
-
|
|
2476
|
-
if (this.state.visible) {
|
|
2477
|
-
DomHandler.removeClass(this.currentTarget, this.getTargetOption(this.currentTarget, 'classname'));
|
|
2478
|
-
this.sendCallback(this.props.onBeforeHide, {
|
|
2479
|
-
originalEvent: e,
|
|
2480
|
-
target: this.currentTarget
|
|
2481
|
-
});
|
|
2482
|
-
this.applyDelay('hideDelay', function () {
|
|
2483
|
-
ZIndexUtils.clear(_this3.containerEl);
|
|
2484
|
-
DomHandler.removeClass(_this3.containerEl, 'p-tooltip-active');
|
|
2485
|
-
|
|
2486
|
-
if (!_this3.isAutoHide() && _this3.allowHide === false) {
|
|
2487
|
-
return;
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
_this3.setState({
|
|
2491
|
-
visible: false,
|
|
2492
|
-
position: _this3.props.position
|
|
2493
|
-
}, function () {
|
|
2494
|
-
if (_this3.tooltipTextEl) {
|
|
2495
|
-
ReactDOM__default['default'].unmountComponentAtNode(_this3.tooltipTextEl);
|
|
2496
|
-
}
|
|
2497
|
-
|
|
2498
|
-
_this3.unbindDocumentResizeListener();
|
|
2499
|
-
|
|
2500
|
-
_this3.unbindScrollListener();
|
|
2501
|
-
|
|
2502
|
-
_this3.currentTarget = null;
|
|
2503
|
-
_this3.scrollHandler = null;
|
|
2504
|
-
_this3.containerSize = null;
|
|
2505
|
-
_this3.allowHide = true;
|
|
2506
|
-
|
|
2507
|
-
_this3.sendCallback(_this3.props.onHide, {
|
|
2508
|
-
originalEvent: e,
|
|
2509
|
-
target: _this3.currentTarget
|
|
2510
|
-
});
|
|
2511
|
-
});
|
|
2512
|
-
});
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
}, {
|
|
2516
|
-
key: "align",
|
|
2517
|
-
value: function align(target, coordinate) {
|
|
2518
|
-
var _this4 = this;
|
|
2519
|
-
|
|
2520
|
-
var left = 0,
|
|
2521
|
-
top = 0;
|
|
2522
|
-
|
|
2523
|
-
if (this.isMouseTrack(target) && coordinate) {
|
|
2524
|
-
var containerSize = {
|
|
2525
|
-
width: DomHandler.getOuterWidth(this.containerEl),
|
|
2526
|
-
height: DomHandler.getOuterHeight(this.containerEl)
|
|
2527
|
-
};
|
|
2528
|
-
left = coordinate.x;
|
|
2529
|
-
top = coordinate.y;
|
|
2530
|
-
|
|
2531
|
-
var _this$getMouseTrackPo = this.getMouseTrackPosition(target),
|
|
2532
|
-
mouseTrackTop = _this$getMouseTrackPo.top,
|
|
2533
|
-
mouseTrackLeft = _this$getMouseTrackPo.left;
|
|
2534
|
-
|
|
2535
|
-
switch (this.state.position) {
|
|
2536
|
-
case 'left':
|
|
2537
|
-
left -= containerSize.width + mouseTrackLeft;
|
|
2538
|
-
top -= containerSize.height / 2 - mouseTrackTop;
|
|
2539
|
-
break;
|
|
2540
|
-
|
|
2541
|
-
case 'right':
|
|
2542
|
-
left += mouseTrackLeft;
|
|
2543
|
-
top -= containerSize.height / 2 - mouseTrackTop;
|
|
2544
|
-
break;
|
|
2545
|
-
|
|
2546
|
-
case 'top':
|
|
2547
|
-
left -= containerSize.width / 2 - mouseTrackLeft;
|
|
2548
|
-
top -= containerSize.height + mouseTrackTop;
|
|
2549
|
-
break;
|
|
2550
|
-
|
|
2551
|
-
case 'bottom':
|
|
2552
|
-
left -= containerSize.width / 2 - mouseTrackLeft;
|
|
2553
|
-
top += mouseTrackTop;
|
|
2554
|
-
break;
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
if (left <= 0 || this.containerSize.width > containerSize.width) {
|
|
2558
|
-
this.containerEl.style.left = '0px';
|
|
2559
|
-
this.containerEl.style.right = window.innerWidth - containerSize.width - left + 'px';
|
|
2560
|
-
} else {
|
|
2561
|
-
this.containerEl.style.right = '';
|
|
2562
|
-
this.containerEl.style.left = left + 'px';
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
this.containerEl.style.top = top + 'px';
|
|
2566
|
-
DomHandler.addClass(this.containerEl, 'p-tooltip-active');
|
|
2567
|
-
} else {
|
|
2568
|
-
var pos = DomHandler.findCollisionPosition(this.state.position);
|
|
2569
|
-
var my = this.getTargetOption(target, 'my') || this.props.my || pos.my;
|
|
2570
|
-
var at = this.getTargetOption(target, 'at') || this.props.at || pos.at;
|
|
2571
|
-
this.containerEl.style.padding = '0px';
|
|
2572
|
-
DomHandler.flipfitCollision(this.containerEl, target, my, at, function (currentPosition) {
|
|
2573
|
-
var _currentPosition$at = currentPosition.at,
|
|
2574
|
-
atX = _currentPosition$at.x,
|
|
2575
|
-
atY = _currentPosition$at.y;
|
|
2576
|
-
var myX = currentPosition.my.x;
|
|
2577
|
-
var position = _this4.props.at ? atX !== 'center' && atX !== myX ? atX : atY : currentPosition.at["".concat(pos.axis)];
|
|
2578
|
-
_this4.containerEl.style.padding = '';
|
|
2579
|
-
|
|
2580
|
-
_this4.setState({
|
|
2581
|
-
position: position
|
|
2582
|
-
}, function () {
|
|
2583
|
-
_this4.updateContainerPosition();
|
|
2584
|
-
|
|
2585
|
-
DomHandler.addClass(_this4.containerEl, 'p-tooltip-active');
|
|
2586
|
-
});
|
|
2587
|
-
});
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
}, {
|
|
2591
|
-
key: "updateContainerPosition",
|
|
2592
|
-
value: function updateContainerPosition() {
|
|
2593
|
-
if (this.containerEl) {
|
|
2594
|
-
var style = getComputedStyle(this.containerEl);
|
|
2595
|
-
if (this.state.position === 'left') this.containerEl.style.left = parseFloat(style.left) - parseFloat(style.paddingLeft) * 2 + 'px';else if (this.state.position === 'top') this.containerEl.style.top = parseFloat(style.top) - parseFloat(style.paddingTop) * 2 + 'px';
|
|
2596
|
-
}
|
|
2597
|
-
}
|
|
2598
|
-
}, {
|
|
2599
|
-
key: "onMouseEnter",
|
|
2600
|
-
value: function onMouseEnter() {
|
|
2601
|
-
if (!this.isAutoHide()) {
|
|
2602
|
-
this.allowHide = false;
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
}, {
|
|
2606
|
-
key: "onMouseLeave",
|
|
2607
|
-
value: function onMouseLeave(e) {
|
|
2608
|
-
if (!this.isAutoHide()) {
|
|
2609
|
-
this.allowHide = true;
|
|
2610
|
-
this.hide(e);
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
}, {
|
|
2614
|
-
key: "bindDocumentResizeListener",
|
|
2615
|
-
value: function bindDocumentResizeListener() {
|
|
2616
|
-
var _this5 = this;
|
|
2617
|
-
|
|
2618
|
-
this.documentResizeListener = function (e) {
|
|
2619
|
-
if (!DomHandler.isAndroid()) {
|
|
2620
|
-
_this5.hide(e);
|
|
2621
|
-
}
|
|
2622
|
-
};
|
|
2623
|
-
|
|
2624
|
-
window.addEventListener('resize', this.documentResizeListener);
|
|
2625
|
-
}
|
|
2626
|
-
}, {
|
|
2627
|
-
key: "unbindDocumentResizeListener",
|
|
2628
|
-
value: function unbindDocumentResizeListener() {
|
|
2629
|
-
if (this.documentResizeListener) {
|
|
2630
|
-
window.removeEventListener('resize', this.documentResizeListener);
|
|
2631
|
-
this.documentResizeListener = null;
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
}, {
|
|
2635
|
-
key: "bindScrollListener",
|
|
2636
|
-
value: function bindScrollListener() {
|
|
2637
|
-
var _this6 = this;
|
|
2638
|
-
|
|
2639
|
-
if (!this.scrollHandler) {
|
|
2640
|
-
this.scrollHandler = new ConnectedOverlayScrollHandler(this.currentTarget, function (e) {
|
|
2641
|
-
if (_this6.state.visible) {
|
|
2642
|
-
_this6.hide(e);
|
|
2643
|
-
}
|
|
2644
|
-
});
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
this.scrollHandler.bindScrollListener();
|
|
2648
|
-
}
|
|
2649
|
-
}, {
|
|
2650
|
-
key: "unbindScrollListener",
|
|
2651
|
-
value: function unbindScrollListener() {
|
|
2652
|
-
if (this.scrollHandler) {
|
|
2653
|
-
this.scrollHandler.unbindScrollListener();
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
}, {
|
|
2657
|
-
key: "bindTargetEvent",
|
|
2658
|
-
value: function bindTargetEvent(target) {
|
|
2659
|
-
if (target) {
|
|
2660
|
-
var _this$getEvents = this.getEvents(target),
|
|
2661
|
-
showEvent = _this$getEvents.showEvent,
|
|
2662
|
-
hideEvent = _this$getEvents.hideEvent;
|
|
2663
|
-
|
|
2664
|
-
target.addEventListener(showEvent, this.show);
|
|
2665
|
-
target.addEventListener(hideEvent, this.hide);
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
}, {
|
|
2669
|
-
key: "unbindTargetEvent",
|
|
2670
|
-
value: function unbindTargetEvent(target) {
|
|
2671
|
-
if (target) {
|
|
2672
|
-
var _this$getEvents2 = this.getEvents(target),
|
|
2673
|
-
showEvent = _this$getEvents2.showEvent,
|
|
2674
|
-
hideEvent = _this$getEvents2.hideEvent;
|
|
2675
|
-
|
|
2676
|
-
target.removeEventListener(showEvent, this.show);
|
|
2677
|
-
target.removeEventListener(hideEvent, this.hide);
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
}, {
|
|
2681
|
-
key: "applyDelay",
|
|
2682
|
-
value: function applyDelay(delayProp, callback) {
|
|
2683
|
-
this.clearTimeouts();
|
|
2684
|
-
var delay = this.getTargetOption(this.currentTarget, delayProp.toLowerCase()) || this.props[delayProp];
|
|
2685
|
-
|
|
2686
|
-
if (!!delay) {
|
|
2687
|
-
this["".concat(delayProp, "Timeout")] = setTimeout(function () {
|
|
2688
|
-
return callback();
|
|
2689
|
-
}, delay);
|
|
2690
|
-
} else {
|
|
2691
|
-
callback();
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
}, {
|
|
2695
|
-
key: "sendCallback",
|
|
2696
|
-
value: function sendCallback(callback) {
|
|
2697
|
-
if (callback) {
|
|
2698
|
-
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2699
|
-
params[_key - 1] = arguments[_key];
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
callback.apply(void 0, params);
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
}, {
|
|
2706
|
-
key: "clearTimeouts",
|
|
2707
|
-
value: function clearTimeouts() {
|
|
2708
|
-
clearTimeout(this.showDelayTimeout);
|
|
2709
|
-
clearTimeout(this.updateDelayTimeout);
|
|
2710
|
-
clearTimeout(this.hideDelayTimeout);
|
|
2711
|
-
}
|
|
2712
|
-
}, {
|
|
2713
|
-
key: "updateTargetEvents",
|
|
2714
|
-
value: function updateTargetEvents(target) {
|
|
2715
|
-
this.unloadTargetEvents(target);
|
|
2716
|
-
this.loadTargetEvents(target);
|
|
2717
|
-
}
|
|
2718
|
-
}, {
|
|
2719
|
-
key: "loadTargetEvents",
|
|
2720
|
-
value: function loadTargetEvents(target) {
|
|
2721
|
-
this.setTargetEventOperations(target || this.props.target, 'bindTargetEvent');
|
|
2722
|
-
}
|
|
2723
|
-
}, {
|
|
2724
|
-
key: "unloadTargetEvents",
|
|
2725
|
-
value: function unloadTargetEvents(target) {
|
|
2726
|
-
this.setTargetEventOperations(target || this.props.target, 'unbindTargetEvent');
|
|
2727
|
-
}
|
|
2728
|
-
}, {
|
|
2729
|
-
key: "setTargetEventOperations",
|
|
2730
|
-
value: function setTargetEventOperations(target, operation) {
|
|
2731
|
-
var _this7 = this;
|
|
2732
|
-
|
|
2733
|
-
if (target) {
|
|
2734
|
-
if (DomHandler.isElement(target)) {
|
|
2735
|
-
this[operation](target);
|
|
2736
|
-
} else {
|
|
2737
|
-
var setEvent = function setEvent(target) {
|
|
2738
|
-
var element = DomHandler.find(document, target);
|
|
2739
|
-
element.forEach(function (el) {
|
|
2740
|
-
_this7[operation](el);
|
|
2741
|
-
});
|
|
2742
|
-
};
|
|
2743
|
-
|
|
2744
|
-
if (target instanceof Array) {
|
|
2745
|
-
target.forEach(function (t) {
|
|
2746
|
-
setEvent(t);
|
|
2747
|
-
});
|
|
2748
|
-
} else {
|
|
2749
|
-
setEvent(target);
|
|
2750
|
-
}
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2753
|
-
}
|
|
2754
|
-
}, {
|
|
2755
|
-
key: "componentDidMount",
|
|
2756
|
-
value: function componentDidMount() {
|
|
2757
|
-
if (this.props.target) {
|
|
2758
|
-
this.loadTargetEvents();
|
|
2759
|
-
}
|
|
2760
|
-
}
|
|
2761
|
-
}, {
|
|
2762
|
-
key: "componentDidUpdate",
|
|
2763
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
2764
|
-
var _this8 = this;
|
|
2765
|
-
|
|
2766
|
-
if (prevProps.target !== this.props.target) {
|
|
2767
|
-
this.unloadTargetEvents(prevProps.target);
|
|
2768
|
-
this.loadTargetEvents();
|
|
2769
|
-
}
|
|
2770
|
-
|
|
2771
|
-
if (this.state.visible) {
|
|
2772
|
-
if (prevProps.content !== this.props.content) {
|
|
2773
|
-
this.applyDelay('updateDelay', function () {
|
|
2774
|
-
_this8.updateText(_this8.currentTarget, function () {
|
|
2775
|
-
_this8.align(_this8.currentTarget);
|
|
2776
|
-
});
|
|
2777
|
-
});
|
|
2778
|
-
}
|
|
2779
|
-
|
|
2780
|
-
if (this.currentTarget && this.isDisabled(this.currentTarget)) {
|
|
2781
|
-
this.hide();
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
}, {
|
|
2786
|
-
key: "componentWillUnmount",
|
|
2787
|
-
value: function componentWillUnmount() {
|
|
2788
|
-
this.clearTimeouts();
|
|
2789
|
-
this.unbindDocumentResizeListener();
|
|
2790
|
-
this.unloadTargetEvents();
|
|
2791
|
-
|
|
2792
|
-
if (this.scrollHandler) {
|
|
2793
|
-
this.scrollHandler.destroy();
|
|
2794
|
-
this.scrollHandler = null;
|
|
2795
|
-
}
|
|
2796
|
-
|
|
2797
|
-
ZIndexUtils.clear(this.containerEl);
|
|
2798
|
-
}
|
|
2799
|
-
}, {
|
|
2800
|
-
key: "renderElement",
|
|
2801
|
-
value: function renderElement() {
|
|
2802
|
-
var _this9 = this;
|
|
2803
|
-
|
|
2804
|
-
var tooltipClassName = classNames('p-tooltip p-component', _defineProperty({}, "p-tooltip-".concat(this.state.position), true), this.props.className);
|
|
2805
|
-
var isTargetContentEmpty = this.isTargetContentEmpty(this.currentTarget);
|
|
2806
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2807
|
-
id: this.props.id,
|
|
2808
|
-
ref: function ref(el) {
|
|
2809
|
-
return _this9.containerEl = el;
|
|
2810
|
-
},
|
|
2811
|
-
className: tooltipClassName,
|
|
2812
|
-
style: this.props.style,
|
|
2813
|
-
role: "tooltip",
|
|
2814
|
-
"aria-hidden": this.state.visible,
|
|
2815
|
-
onMouseEnter: this.onMouseEnter,
|
|
2816
|
-
onMouseLeave: this.onMouseLeave
|
|
2817
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2818
|
-
className: "p-tooltip-arrow"
|
|
2819
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2820
|
-
ref: function ref(el) {
|
|
2821
|
-
return _this9.tooltipTextEl = el;
|
|
2822
|
-
},
|
|
2823
|
-
className: "p-tooltip-text"
|
|
2824
|
-
}, isTargetContentEmpty && this.props.children));
|
|
2825
|
-
}
|
|
2826
|
-
}, {
|
|
2827
|
-
key: "render",
|
|
2828
|
-
value: function render() {
|
|
2829
|
-
if (this.state.visible) {
|
|
2830
|
-
var element = this.renderElement();
|
|
2831
|
-
return /*#__PURE__*/React__default['default'].createElement(Portal, {
|
|
2832
|
-
element: element,
|
|
2833
|
-
appendTo: this.props.appendTo,
|
|
2834
|
-
visible: true
|
|
2835
|
-
});
|
|
2836
|
-
}
|
|
2837
|
-
|
|
2838
|
-
return null;
|
|
2839
|
-
}
|
|
2840
|
-
}]);
|
|
2841
|
-
|
|
2842
|
-
return Tooltip;
|
|
2843
|
-
}(React.Component);
|
|
2844
|
-
|
|
2845
|
-
_defineProperty(Tooltip, "defaultProps", {
|
|
2846
|
-
id: null,
|
|
2847
|
-
target: null,
|
|
2848
|
-
content: null,
|
|
2849
|
-
disabled: false,
|
|
2850
|
-
className: null,
|
|
2851
|
-
style: null,
|
|
2852
|
-
appendTo: null,
|
|
2853
|
-
position: 'right',
|
|
2854
|
-
my: null,
|
|
2855
|
-
at: null,
|
|
2856
|
-
event: null,
|
|
2857
|
-
showEvent: 'mouseenter',
|
|
2858
|
-
hideEvent: 'mouseleave',
|
|
2859
|
-
autoZIndex: true,
|
|
2860
|
-
baseZIndex: 0,
|
|
2861
|
-
mouseTrack: false,
|
|
2862
|
-
mouseTrackTop: 5,
|
|
2863
|
-
mouseTrackLeft: 5,
|
|
2864
|
-
showDelay: 0,
|
|
2865
|
-
updateDelay: 0,
|
|
2866
|
-
hideDelay: 0,
|
|
2867
|
-
autoHide: true,
|
|
2868
|
-
onBeforeShow: null,
|
|
2869
|
-
onBeforeHide: null,
|
|
2870
|
-
onShow: null,
|
|
2871
|
-
onHide: null
|
|
2872
|
-
});
|
|
2873
|
-
|
|
2874
|
-
var OverlayService = EventBus();
|
|
2875
|
-
|
|
2876
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2877
|
-
|
|
2878
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2879
|
-
|
|
2880
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2881
|
-
|
|
2882
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
2883
|
-
var CSSTransition = /*#__PURE__*/function (_Component) {
|
|
2884
|
-
_inherits(CSSTransition, _Component);
|
|
2885
|
-
|
|
2886
|
-
var _super = _createSuper(CSSTransition);
|
|
2887
|
-
|
|
2888
|
-
function CSSTransition(props) {
|
|
2889
|
-
var _this;
|
|
2890
|
-
|
|
2891
|
-
_classCallCheck(this, CSSTransition);
|
|
2892
|
-
|
|
2893
|
-
_this = _super.call(this, props);
|
|
2894
|
-
_this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this));
|
|
2895
|
-
_this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this));
|
|
2896
|
-
_this.onEntered = _this.onEntered.bind(_assertThisInitialized(_this));
|
|
2897
|
-
_this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
|
|
2898
|
-
_this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
|
|
2899
|
-
_this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
|
|
2900
|
-
return _this;
|
|
2901
|
-
}
|
|
2902
|
-
|
|
2903
|
-
_createClass(CSSTransition, [{
|
|
2904
|
-
key: "onEnter",
|
|
2905
|
-
value: function onEnter(node, isAppearing) {
|
|
2906
|
-
this.props.onEnter && this.props.onEnter(node, isAppearing); // component
|
|
2907
|
-
|
|
2908
|
-
this.props.options && this.props.options.onEnter && this.props.options.onEnter(node, isAppearing); // user option
|
|
2909
|
-
}
|
|
2910
|
-
}, {
|
|
2911
|
-
key: "onEntering",
|
|
2912
|
-
value: function onEntering(node, isAppearing) {
|
|
2913
|
-
this.props.onEntering && this.props.onEntering(node, isAppearing); // component
|
|
2914
|
-
|
|
2915
|
-
this.props.options && this.props.options.onEntering && this.props.options.onEntering(node, isAppearing); // user option
|
|
2916
|
-
}
|
|
2917
|
-
}, {
|
|
2918
|
-
key: "onEntered",
|
|
2919
|
-
value: function onEntered(node, isAppearing) {
|
|
2920
|
-
this.props.onEntered && this.props.onEntered(node, isAppearing); // component
|
|
2921
|
-
|
|
2922
|
-
this.props.options && this.props.options.onEntered && this.props.options.onEntered(node, isAppearing); // user option
|
|
2923
|
-
}
|
|
2924
|
-
}, {
|
|
2925
|
-
key: "onExit",
|
|
2926
|
-
value: function onExit(node) {
|
|
2927
|
-
this.props.onExit && this.props.onExit(node); // component
|
|
2928
|
-
|
|
2929
|
-
this.props.options && this.props.options.onExit && this.props.options.onExit(node); // user option
|
|
2930
|
-
}
|
|
2931
|
-
}, {
|
|
2932
|
-
key: "onExiting",
|
|
2933
|
-
value: function onExiting(node) {
|
|
2934
|
-
this.props.onExiting && this.props.onExiting(node); // component
|
|
2935
|
-
|
|
2936
|
-
this.props.options && this.props.options.onExiting && this.props.options.onExiting(node); // user option
|
|
2937
|
-
}
|
|
2938
|
-
}, {
|
|
2939
|
-
key: "onExited",
|
|
2940
|
-
value: function onExited(node) {
|
|
2941
|
-
this.props.onExited && this.props.onExited(node); // component
|
|
2942
|
-
|
|
2943
|
-
this.props.options && this.props.options.onExited && this.props.options.onExited(node); // user option
|
|
2944
|
-
}
|
|
2945
|
-
}, {
|
|
2946
|
-
key: "render",
|
|
2947
|
-
value: function render() {
|
|
2948
|
-
var immutableProps = {
|
|
2949
|
-
nodeRef: this.props.nodeRef,
|
|
2950
|
-
in: this.props.in,
|
|
2951
|
-
onEnter: this.onEnter,
|
|
2952
|
-
onEntering: this.onEntering,
|
|
2953
|
-
onEntered: this.onEntered,
|
|
2954
|
-
onExit: this.onExit,
|
|
2955
|
-
onExiting: this.onExiting,
|
|
2956
|
-
onExited: this.onExited
|
|
2957
|
-
};
|
|
2958
|
-
var mutableProps = {
|
|
2959
|
-
classNames: this.props.classNames,
|
|
2960
|
-
timeout: this.props.timeout,
|
|
2961
|
-
unmountOnExit: this.props.unmountOnExit
|
|
2962
|
-
};
|
|
2963
|
-
|
|
2964
|
-
var props = _objectSpread(_objectSpread(_objectSpread({}, mutableProps), this.props.options || {}), immutableProps);
|
|
2965
|
-
|
|
2966
|
-
return /*#__PURE__*/React__default['default'].createElement(reactTransitionGroup.CSSTransition, props, this.props.children);
|
|
2967
|
-
}
|
|
2968
|
-
}]);
|
|
2969
|
-
|
|
2970
|
-
return CSSTransition;
|
|
2971
|
-
}(React.Component);
|
|
2972
|
-
|
|
2973
|
-
exports.CSSTransition = CSSTransition;
|
|
2974
|
-
exports.ConnectedOverlayScrollHandler = ConnectedOverlayScrollHandler;
|
|
2975
|
-
exports.DomHandler = DomHandler;
|
|
2976
|
-
exports.EventBus = EventBus;
|
|
2977
|
-
exports.KeyFilter = KeyFilter;
|
|
2978
|
-
exports.ObjectUtils = ObjectUtils;
|
|
2979
|
-
exports.OverlayService = OverlayService;
|
|
2980
|
-
exports.Portal = Portal;
|
|
2981
|
-
exports.Ripple = Ripple;
|
|
2982
|
-
exports.Tooltip = Tooltip;
|
|
2983
|
-
exports.UniqueComponentId = UniqueComponentId;
|
|
2984
|
-
exports.ZIndexUtils = ZIndexUtils;
|
|
2985
|
-
exports.classNames = classNames;
|
|
2986
|
-
exports.mask = mask;
|
|
2987
|
-
exports.tip = tip;
|