primereact 10.6.5 → 10.7.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 +1 -1
- package/api/api.d.ts +8 -0
- package/button/button.cjs.js +1 -0
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +1 -0
- package/button/button.esm.min.js +1 -1
- package/button/button.js +1 -0
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +81 -45
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +8 -10
- package/calendar/calendar.esm.js +81 -45
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +81 -45
- package/calendar/calendar.min.js +1 -1
- package/chart/chart.d.ts +1 -13
- package/checkbox/checkbox.cjs.js +64 -0
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +12 -0
- package/checkbox/checkbox.esm.js +64 -0
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +64 -0
- package/checkbox/checkbox.min.js +1 -1
- package/colorpicker/colorpicker.cjs.js +18 -4
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +19 -5
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +18 -4
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/column.d.ts +36 -14
- package/core/core.js +213 -58
- package/core/core.min.js +12 -12
- package/csstransition/csstransition.cjs.js +0 -6
- package/csstransition/csstransition.esm.js +0 -6
- package/csstransition/csstransition.js +0 -6
- package/datatable/datatable.cjs.js +157 -100
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +1 -1
- package/datatable/datatable.esm.js +157 -100
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +157 -100
- package/datatable/datatable.min.js +1 -1
- package/dialog/dialog.cjs.js +19 -4
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +19 -4
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +19 -4
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +10 -8
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +10 -8
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +10 -8
- package/dropdown/dropdown.min.js +1 -1
- package/focustrap/focustrap.cjs.js +12 -1
- package/focustrap/focustrap.cjs.min.js +1 -1
- package/focustrap/focustrap.esm.js +12 -1
- package/focustrap/focustrap.esm.min.js +1 -1
- package/focustrap/focustrap.js +12 -1
- package/focustrap/focustrap.min.js +1 -1
- package/galleria/galleria.cjs.js +7 -0
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +8 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +7 -0
- package/galleria/galleria.min.js +1 -1
- package/hooks/hooks.cjs.js +2 -1
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.esm.js +2 -1
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +2 -1
- package/hooks/hooks.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +17 -13
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +17 -13
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +17 -13
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputotp/inputotp.cjs.js +26 -3
- package/inputotp/inputotp.cjs.min.js +1 -1
- package/inputotp/inputotp.esm.js +27 -4
- package/inputotp/inputotp.esm.min.js +1 -1
- package/inputotp/inputotp.js +26 -3
- package/inputotp/inputotp.min.js +1 -1
- package/inputtext/inputtext.d.ts +1 -1
- package/keyfilter/keyfilter.cjs.js +1 -1
- 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 +1 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/listbox/listbox.cjs.js +23 -35
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +23 -35
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +23 -35
- package/listbox/listbox.min.js +1 -1
- package/menubar/menubar.d.ts +9 -0
- package/metergroup/metergroup.cjs.js +5 -4
- package/metergroup/metergroup.cjs.min.js +1 -1
- package/metergroup/metergroup.d.ts +3 -10
- package/metergroup/metergroup.esm.js +5 -4
- package/metergroup/metergroup.esm.min.js +1 -1
- package/metergroup/metergroup.js +5 -4
- package/metergroup/metergroup.min.js +1 -1
- package/multiselect/multiselect.cjs.js +11 -2
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +11 -2
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +11 -2
- package/multiselect/multiselect.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.cjs.js +9 -0
- package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.esm.js +9 -0
- package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
- package/multistatecheckbox/multistatecheckbox.js +9 -0
- package/multistatecheckbox/multistatecheckbox.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +0 -1
- package/organizationchart/organizationchart.esm.js +0 -1
- package/organizationchart/organizationchart.js +0 -1
- package/package.json +4 -4
- package/paginator/paginator.cjs.js +1 -1
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +1 -1
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -12
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -12
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -12
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +10 -81
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +10 -81
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +10 -81
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +2 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -2
- package/password/password.min.js +1 -1
- package/primereact.all.cjs.js +2826 -1797
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2823 -1798
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2826 -1797
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +13 -10
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +13 -10
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +13 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/resources/images/line.gif +0 -0
- package/resources/themes/arya-blue/theme.css +62 -0
- package/resources/themes/arya-green/theme.css +62 -0
- package/resources/themes/arya-orange/theme.css +62 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +62 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +207 -43
- package/resources/themes/bootstrap4-light-blue/theme.css +62 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +207 -43
- package/resources/themes/fluent-light/theme.css +62 -0
- package/resources/themes/lara-dark-amber/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-amber/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-amber/theme.css +62 -9
- package/resources/themes/lara-dark-blue/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +62 -9
- package/resources/themes/lara-dark-cyan/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-cyan/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-cyan/theme.css +62 -9
- package/resources/themes/lara-dark-green/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-green/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-green/theme.css +62 -9
- package/resources/themes/lara-dark-indigo/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +62 -9
- package/resources/themes/lara-dark-pink/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-pink/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-pink/theme.css +62 -9
- package/resources/themes/lara-dark-purple/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +62 -9
- package/resources/themes/lara-light-amber/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-amber/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-amber/theme.css +62 -9
- package/resources/themes/lara-light-blue/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +62 -9
- package/resources/themes/lara-light-cyan/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-cyan/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-cyan/theme.css +62 -9
- package/resources/themes/lara-light-green/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-green/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-green/theme.css +62 -9
- package/resources/themes/lara-light-indigo/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +62 -9
- package/resources/themes/lara-light-pink/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-pink/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-pink/theme.css +62 -9
- package/resources/themes/lara-light-purple/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-italic.var.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-roman.var.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +62 -9
- package/resources/themes/luna-amber/theme.css +62 -0
- package/resources/themes/luna-blue/theme.css +62 -0
- package/resources/themes/luna-green/theme.css +62 -0
- package/resources/themes/luna-pink/theme.css +62 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/md-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/md-dark-deeppurple/theme.css +225 -43
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/md-dark-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/md-dark-indigo/theme.css +213 -151
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/md-light-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/md-light-deeppurple/theme.css +225 -43
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/md-light-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/md-light-indigo/theme.css +62 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/mdc-dark-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +225 -43
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/mdc-dark-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/mdc-dark-indigo/theme.css +213 -151
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/mdc-light-deeppurple/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +225 -43
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-500.woff +0 -0
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-500.woff2 +0 -0
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-700.woff +0 -0
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/mdc-light-indigo/fonts/roboto-v20-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/mdc-light-indigo/theme.css +62 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/mira/theme.css +62 -0
- package/resources/themes/nano/theme.css +62 -0
- package/resources/themes/nova/theme.css +62 -0
- package/resources/themes/nova-accent/theme.css +62 -0
- package/resources/themes/nova-alt/theme.css +62 -0
- package/resources/themes/rhea/theme.css +62 -0
- package/resources/themes/saga-blue/theme.css +62 -0
- package/resources/themes/saga-green/theme.css +62 -0
- package/resources/themes/saga-orange/theme.css +62 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-dark/theme.css +87 -25
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-light/theme.css +62 -0
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/tailwind-light/theme.css +62 -0
- package/resources/themes/vela-blue/theme.css +62 -0
- package/resources/themes/vela-green/theme.css +62 -0
- package/resources/themes/vela-orange/theme.css +62 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-dark/theme.css +62 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-light/theme.css +62 -0
- package/sidebar/sidebar.d.ts +4 -0
- package/splitbutton/splitbutton.cjs.js +0 -1
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +0 -1
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +0 -1
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabview/tabview.cjs.js +0 -3
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +1 -1
- package/tabview/tabview.esm.js +0 -3
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +0 -3
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +0 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +0 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +0 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/tooltip/tooltip.cjs.js +12 -3
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +13 -4
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +12 -3
- package/tooltip/tooltip.min.js +1 -1
- package/tooltip/tooltipoptions.d.ts +5 -0
- package/tree/tree.cjs.js +60 -14
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +60 -14
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +60 -14
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +0 -1
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +0 -1
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +0 -1
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +249 -9
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +29 -0
- package/treetable/treetable.esm.js +249 -9
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +249 -9
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +3 -6
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.d.ts +7 -4
- package/utils/utils.esm.js +3 -6
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +3 -6
- package/utils/utils.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +23 -1
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +23 -1
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +23 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +77 -30
package/dialog/dialog.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,i,a,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=d(t),g=m(t),b=d(n);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return v(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(e,t){if("object"!==y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e){var t=D(e,"string");return"symbol"===y(t)?t:String(t)}function P(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return j(e)||z(e,t)||w(e,t)||I()}var R=r.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return a.ObjectUtils.getMergedProps(e,R.defaultProps)},getOtherProps:function(e){return a.ObjectUtils.getDiffProps(e,R.defaultProps)}});function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=f.default.memo(f.default.forwardRef((function(e,t){var r=f.default.useRef(null),o=f.default.useRef(null),l=f.default.useRef(null),c=f.default.useContext(n.PrimeReactContext),s=R.getProps(e,c),u={props:s};i.useStyle(R.css.styles,{name:"focustrap"});R.setMetaData(H({},u));f.default.useImperativeHandle(t,(function(){return{props:s,getInk:function(){return o.current},getTarget:function(){return r.current}}})),i.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,m,g,b,h=function(){return o.current&&o.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,i=t.autoFocus,l=void 0!==i&&i,c=a.DomHandler.getFirstFocusableElement(e,"[autofocus]".concat(v(void 0===n?"":n)));l&&!c&&(c=a.DomHandler.getFirstFocusableElement(e,v(o))),a.DomHandler.focus(c)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:a.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(m=function(e,t){return f.default.createElement("span",{ref:"firstfocusableelement"===t?o:l,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:e,"data-pc-section":t})})((function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:a.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)}),"firstfocusableelement"),b=m(x,"lastfocusableelement"),g.ref.current&&b.ref.current&&(g.ref.current.$_pfocustrap_lasthiddenfocusableelement=b.ref.current,b.ref.current.$_pfocustrap_firsthiddenfocusableelement=g.ref.current),f.default.createElement(f.default.Fragment,null,g,s.children,b)})));function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return a.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return a.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return a.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return a.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return a.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===b.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===b.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return M({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=g.forwardRef((function(e,t){var d=i.useMergeProps(),m=g.useContext(n.PrimeReactContext),f=T.getProps(e,m),y=f.id?f.id:a.UniqueComponentId(),v=k(g.useState(y),2),D=v[0],S=k(g.useState(!1),2),P=S[0],j=S[1],z=k(g.useState(!1),2),I=z[0],R=z[1],C=k(g.useState(f.maximized),2),H=C[0],N=C[1],M=g.useRef(null),B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),A=g.useRef(null),L=g.useRef(null),Y=g.useRef(null),$=g.useRef(!1),V=g.useRef(!1),Z=g.useRef(null),J=g.useRef(null),W=g.useRef(null),G=g.useRef(y),K=g.useRef(null),q=f.onMaximize?f.maximized:H,Q=I&&(f.blockScroll||f.maximizable&&q),ee=f.closable&&f.closeOnEscape&&I,te=i.useDisplayOrder("dialog",ee),ne=T.setMetaData(F(F({props:f},f.__parentMetadata),{},{state:{id:D,maximized:q,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ie=ne.sx,ae=ne.isUnstyled;r.useHandleStyle(T.css.styles,ae,{name:"dialog"}),i.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[i.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ze(e)}}),2),ce=le[0],se=le[1],ue=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),pe=ue[0],de=ue[1],me=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){f.onHide(),e.preventDefault()},xe=function(e){U.current=e.target,f.onPointerDown&&f.onPointerDown(e)},Oe=function(e){f.dismissableMask&&f.modal&&B.current===e.target&&!U.current&&ve(e),f.onMaskClick&&f.onMaskClick(e),U.current=null},we=function(e){f.onMaximize?f.onMaximize({originalEvent:e,maximized:!q}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){a.DomHandler.hasClass(e.target,"p-dialog-header-icon")||a.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||f.draggable&&($.current=!0,Z.current=e.pageX,J.current=e.pageY,M.current.style.margin="0",a.DomHandler.addClass(document.body,"p-unselectable-text"),f.onDragStart&&f.onDragStart(e))},De=function(e){if($.current){var t=a.DomHandler.getOuterWidth(M.current),n=a.DomHandler.getOuterHeight(M.current),r=e.pageX-Z.current,o=e.pageY-J.current,i=M.current.getBoundingClientRect(),l=i.left+r,c=i.top+o,s=a.DomHandler.getViewport(),u=getComputedStyle(M.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);M.current.style.position="fixed",f.keepInViewport?(l>=f.minX&&l+t<s.width&&(Z.current=e.pageX,M.current.style.left=l-p+"px"),c>=f.minY&&c+n<s.height&&(J.current=e.pageY,M.current.style.top=c-d+"px")):(Z.current=e.pageX,M.current.style.left=l-p+"px",J.current=e.pageY,M.current.style.top=c-d+"px"),f.onDrag&&f.onDrag(e)}},Se=function(e){$.current&&($.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onDragEnd&&f.onDragEnd(e))},Pe=function(e){f.resizable&&(V.current=!0,Z.current=e.pageX,J.current=e.pageY,a.DomHandler.addClass(document.body,"p-unselectable-text"),f.onResizeStart&&f.onResizeStart(e))},je=function(e,t,n){!n&&(n=a.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},ze=function(e){if(V.current){var t=e.pageX-Z.current,n=e.pageY-J.current,r=a.DomHandler.getOuterWidth(M.current),o=a.DomHandler.getOuterHeight(M.current),i=M.current.getBoundingClientRect(),l=a.DomHandler.getViewport(),c=!parseInt(M.current.style.top)||!parseInt(M.current.style.left),s=je(M.current.style.minWidth,"width",l),u=je(M.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&i.left+p<l.width&&(M.current.style.width=p+"px"),(!u||d>u)&&i.top+d<l.height&&(M.current.style.height=d+"px"),Z.current=e.pageX,J.current=e.pageY,f.onResize&&f.onResize(e)}},Ie=function(e){V.current&&(V.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onResizeEnd&&f.onResizeEnd(e))},ke=function(){M.current.style.position="",M.current.style.left="",M.current.style.top="",M.current.style.margin=""},Re=function(){M.current.setAttribute(G.current,"")},Ce=function(){var e;f.onShow&&f.onShow(),f.focusOnShow&&!((e=document.activeElement)&&M.current&&M.current.contains(e))&&f.closable&&f.showHeader&&Y.current&&Y.current.focus(),Ne()},He=function(){f.modal&&!ae()&&a.DomHandler.addClass(B.current,"p-component-overlay-leave")},_e=function(){f.onHide&&f.onHide(),$.current=!1,a.ZIndexUtils.clear(B.current),j(!1),Me(),a.DomHandler.focus(K.current),K.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&I){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(x(r=document.primeDialogParams)||O(r)||w(r)||E(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?a.DomHandler.blockBodyScroll():a.DomHandler.unblockBodyScroll()},Be=function(){f.draggable&&(fe(),he()),f.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){W.current=a.DomHandler.createInlineStyle(m&&m.nonce||b.default.nonce,m&&m.styleContainer);var e="";for(var t in f.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(G.current,"] {\n width: ").concat(f.breakpoints[t]," !important;\n }\n }\n ");W.current.innerHTML=e};i.useMountEffect((function(){Te(!0),f.visible&&j(!0)})),g.useEffect((function(){return f.breakpoints&&Ue(),function(){W.current=a.DomHandler.removeInlineStyle(W.current)}}),[f.breakpoints]),i.useUpdateEffect((function(){f.visible&&!P&&j(!0),f.visible!==I&&P&&R(f.visible),f.visible&&(K.current=document.activeElement)}),[f.visible,P]),i.useUpdateEffect((function(){P&&(a.ZIndexUtils.set("modal",B.current,m&&m.autoZIndex||b.default.autoZIndex,f.baseZIndex||m&&m.zIndex.modal||b.default.zIndex.modal),R(!0))}),[P]),i.useUpdateEffect((function(){Te(!0)}),[Q,I]),i.useUnmountEffect((function(){Me(),Te(!1),a.DomHandler.removeInlineStyle(W.current),a.ZIndexUtils.clear(B.current)})),g.useImperativeHandle(t,(function(){return{props:f,resetPosition:ke,getElement:function(){return M.current},getMask:function(){return B.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return Y.current}}}));var Xe=function(){if(f.closable){var e=f.ariaCloseIconLabel||n.localeOption("close"),t=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=a.IconUtils.getJSXIcon(f.closeIcon||g.createElement(l.TimesIcon,t),F({},t),{props:f}),o=d({ref:Y,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve},re("closeButton"));return g.createElement("button",o,r,g.createElement(p.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=a.IconUtils.getJSXIcon(q?f.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):f.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:f});if(f.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return g.createElement("button",n,t,g.createElement(p.Ripple,null))}return null},Le=function(){if(f.showHeader){var e=Xe(),t=Ae(),n=a.ObjectUtils.getJSXElement(f.icons,f),r=a.ObjectUtils.getJSXElement(f.header,f),o=D+"_header",i=d({ref:A,style:f.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return g.createElement("div",i,g.createElement("div",l,r),g.createElement("div",c,n,t,e))}return null},Ye=function(){var e=a.ObjectUtils.getJSXElement(f.footer,f),t=d({ref:L,className:oe("footer")},re("footer"));return e&&g.createElement("div",t,e)};return P&&function(){var t,n,r,i,l,c,s=D+"_header",p=D+"_content",b={enter:"center"===f.position?150:300,exit:"center"===f.position?150:300},y=d({ref:B,style:ie("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:M,id:D,className:a.classNames(f.className,oe("root",{props:f,maximized:q,context:m})),style:f.style,onClick:f.onClick,role:"dialog","aria-labelledby":s,"aria-describedby":p,"aria-modal":f.modal,onPointerDown:xe},T.getOtherProps(f),re("root")),x=d({classNames:oe("transition"),timeout:b,in:I,options:f.transitionOptions,unmountOnExit:!0,onEnter:Re,onEntered:Ce,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:f.header,content:f.message,message:null==f||null===(l=f.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=a.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:Y,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:f.contentStyle,className:oe("content")},re("content")),r=g.createElement("div",t,f.children),i=Ye(),O=g.createElement(g.Fragment,null,n,r,i,f.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=g.createElement("div",y,g.createElement(o.CSSTransition,h({nodeRef:M},x),g.createElement("div",v,g.createElement(_,{autoFocus:!0},O))));return g.createElement(u.Portal,{element:w,appendTo:f.appendTo,visible:!0})}()}));return U.displayName="Dialog",e.Dialog=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.utils,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,a,i,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=d(t),g=m(t),b=d(n);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return v(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(e,t){if("object"!==y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e){var t=D(e,"string");return"symbol"===y(t)?t:String(t)}function P(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return j(e)||z(e,t)||w(e,t)||I()}var R=r.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return i.ObjectUtils.getMergedProps(e,R.defaultProps)},getOtherProps:function(e){return i.ObjectUtils.getDiffProps(e,R.defaultProps)}});function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=f.default.memo(f.default.forwardRef((function(e,t){var r=f.default.useRef(null),o=f.default.useRef(null),l=f.default.useRef(null),c=f.default.useContext(n.PrimeReactContext),s=R.getProps(e,c),u={props:s};a.useStyle(R.css.styles,{name:"focustrap"});R.setMetaData(H({},u));f.default.useImperativeHandle(t,(function(){return{props:s,getInk:function(){return o.current},getTarget:function(){return r.current}}})),a.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,m,g,b,h=function(){return o.current&&o.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,a=t.autoFocus,l=void 0!==a&&a,c="".concat(v(void 0===n?"":n)),u="[autofocus]".concat(c,", [data-pc-autofocus='true']").concat(c),p=i.DomHandler.getFirstFocusableElement(e,u);l&&!p&&(p=i.DomHandler.getFirstFocusableElement(e,v(o))),i.DomHandler.focus(p)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:i.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(m=function(e,t){return f.default.createElement("span",{ref:"firstfocusableelement"===t?o:l,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:e,"data-pc-section":t})})((function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:i.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)}),"firstfocusableelement"),b=m(x,"lastfocusableelement"),g.ref.current&&b.ref.current&&(g.ref.current.$_pfocustrap_lasthiddenfocusableelement=b.ref.current,b.ref.current.$_pfocustrap_firsthiddenfocusableelement=g.ref.current),f.default.createElement(f.default.Fragment,null,g,s.children,b)})));function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return i.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return i.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return i.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return i.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return i.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===b.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===b.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return M({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=g.forwardRef((function(e,t){var d=a.useMergeProps(),m=g.useContext(n.PrimeReactContext),f=T.getProps(e,m),y=f.id?f.id:i.UniqueComponentId(),v=k(g.useState(y),2),D=v[0],S=k(g.useState(!1),2),P=S[0],j=S[1],z=k(g.useState(!1),2),I=z[0],R=z[1],C=k(g.useState(f.maximized),2),H=C[0],N=C[1],M=g.useRef(null),B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),A=g.useRef(null),L=g.useRef(null),Y=g.useRef(null),$=g.useRef(!1),V=g.useRef(!1),Z=g.useRef(null),J=g.useRef(null),W=g.useRef(null),G=g.useRef(y),K=g.useRef(null),q=f.onMaximize?f.maximized:H,Q=I&&(f.blockScroll||f.maximizable&&q),ee=f.closable&&f.closeOnEscape&&I,te=a.useDisplayOrder("dialog",ee),ne=T.setMetaData(F(F({props:f},f.__parentMetadata),{},{state:{id:D,maximized:q,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ae=ne.sx,ie=ne.isUnstyled;r.useHandleStyle(T.css.styles,ie,{name:"dialog"}),a.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[a.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ze(e)}}),2),ce=le[0],se=le[1],ue=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),pe=ue[0],de=ue[1],me=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){f.onHide(),e.preventDefault()},xe=function(e){U.current=e.target,f.onPointerDown&&f.onPointerDown(e)},Oe=function(e){f.dismissableMask&&f.modal&&B.current===e.target&&!U.current&&ve(e),f.onMaskClick&&f.onMaskClick(e),U.current=null},we=function(e){f.onMaximize?f.onMaximize({originalEvent:e,maximized:!q}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||f.draggable&&($.current=!0,Z.current=e.pageX,J.current=e.pageY,M.current.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onDragStart&&f.onDragStart(e))},De=function(e){if($.current){var t=i.DomHandler.getOuterWidth(M.current),n=i.DomHandler.getOuterHeight(M.current),r=e.pageX-Z.current,o=e.pageY-J.current,a=M.current.getBoundingClientRect(),l=a.left+r,c=a.top+o,s=i.DomHandler.getViewport(),u=getComputedStyle(M.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);M.current.style.position="fixed",f.keepInViewport?(l>=f.minX&&l+t<s.width&&(Z.current=e.pageX,M.current.style.left=l-p+"px"),c>=f.minY&&c+n<s.height&&(J.current=e.pageY,M.current.style.top=c-d+"px")):(Z.current=e.pageX,M.current.style.left=l-p+"px",J.current=e.pageY,M.current.style.top=c-d+"px"),f.onDrag&&f.onDrag(e)}},Se=function(e){$.current&&($.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onDragEnd&&f.onDragEnd(e))},Pe=function(e){f.resizable&&(V.current=!0,Z.current=e.pageX,J.current=e.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onResizeStart&&f.onResizeStart(e))},je=function(e,t,n){!n&&(n=i.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},ze=function(e){if(V.current){var t=e.pageX-Z.current,n=e.pageY-J.current,r=i.DomHandler.getOuterWidth(M.current),o=i.DomHandler.getOuterHeight(M.current),a=M.current.getBoundingClientRect(),l=i.DomHandler.getViewport(),c=!parseInt(M.current.style.top)||!parseInt(M.current.style.left),s=je(M.current.style.minWidth,"width",l),u=je(M.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&a.left+p<l.width&&(M.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(M.current.style.height=d+"px"),Z.current=e.pageX,J.current=e.pageY,f.onResize&&f.onResize(e)}},Ie=function(e){V.current&&(V.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onResizeEnd&&f.onResizeEnd(e))},ke=function(){M.current.style.position="",M.current.style.left="",M.current.style.top="",M.current.style.margin=""},Re=function(){M.current.setAttribute(G.current,"")},Ce=function(){var e;f.onShow&&f.onShow(),f.focusOnShow&&!((e=document.activeElement)&&M.current&&M.current.contains(e))&&f.closable&&f.showHeader&&Y.current&&Y.current.focus(),Ne()},He=function(){f.modal&&!ie()&&i.DomHandler.addClass(B.current,"p-component-overlay-leave")},_e=function(){$.current=!1,i.ZIndexUtils.clear(B.current),j(!1),Me(),i.DomHandler.focus(K.current),K.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&I){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(x(r=document.primeDialogParams)||O(r)||w(r)||E(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?i.DomHandler.blockBodyScroll():i.DomHandler.unblockBodyScroll()},Be=function(){f.draggable&&(fe(),he()),f.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){W.current=i.DomHandler.createInlineStyle(m&&m.nonce||b.default.nonce,m&&m.styleContainer);var e="";for(var t in f.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(G.current,"] {\n width: ").concat(f.breakpoints[t]," !important;\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){Te(!0),f.visible&&j(!0)})),g.useEffect((function(){return f.breakpoints&&Ue(),function(){W.current=i.DomHandler.removeInlineStyle(W.current)}}),[f.breakpoints]),a.useUpdateEffect((function(){f.visible&&!P&&j(!0),f.visible!==I&&P&&R(f.visible),f.visible&&(K.current=document.activeElement)}),[f.visible,P]),a.useUpdateEffect((function(){P&&(i.ZIndexUtils.set("modal",B.current,m&&m.autoZIndex||b.default.autoZIndex,f.baseZIndex||m&&m.zIndex.modal||b.default.zIndex.modal),R(!0))}),[P]),a.useUpdateEffect((function(){Te(!0)}),[Q,I]),a.useUnmountEffect((function(){Me(),Te(!1),i.DomHandler.removeInlineStyle(W.current),i.ZIndexUtils.clear(B.current)})),g.useImperativeHandle(t,(function(){return{props:f,resetPosition:ke,getElement:function(){return M.current},getMask:function(){return B.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return Y.current}}}));var Xe=function(){if(f.closable){var e=f.ariaCloseIconLabel||n.localeOption("close"),t=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=i.IconUtils.getJSXIcon(f.closeIcon||g.createElement(l.TimesIcon,t),F({},t),{props:f}),o=d({ref:Y,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},re("closeButton"));return g.createElement("button",o,r,g.createElement(p.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=i.IconUtils.getJSXIcon(q?f.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):f.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:f});if(f.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return g.createElement("button",n,t,g.createElement(p.Ripple,null))}return null},Le=function(){if(f.showHeader){var e=Xe(),t=Ae(),n=i.ObjectUtils.getJSXElement(f.icons,f),r=i.ObjectUtils.getJSXElement(f.header,f),o=D+"_header",a=d({ref:A,style:f.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return g.createElement("div",a,g.createElement("div",l,r),g.createElement("div",c,n,t,e))}return null},Ye=function(){var e=i.ObjectUtils.getJSXElement(f.footer,f),t=d({ref:L,className:oe("footer")},re("footer"));return e&&g.createElement("div",t,e)};return P&&function(){var t,n,r,a,l,c,s=D+"_header",p=D+"_content",b={enter:"center"===f.position?150:300,exit:"center"===f.position?150:300},y=d({ref:B,style:ae("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:M,id:D,className:i.classNames(f.className,oe("root",{props:f,maximized:q,context:m})),style:f.style,onClick:f.onClick,role:"dialog","aria-labelledby":s,"aria-describedby":p,"aria-modal":f.modal,onPointerDown:xe},T.getOtherProps(f),re("root")),x=d({classNames:oe("transition"),timeout:b,in:I,options:f.transitionOptions,unmountOnExit:!0,onEnter:Re,onEntered:Ce,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:f.header,content:f.message,message:null==f||null===(l=f.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=i.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:Y,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:f.contentStyle,className:oe("content")},re("content")),r=g.createElement("div",t,f.children),a=Ye(),O=g.createElement(g.Fragment,null,n,r,a,f.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=g.createElement("div",y,g.createElement(o.CSSTransition,h({nodeRef:M},x),g.createElement("div",v,g.createElement(_,{autoFocus:!0},O))));return g.createElement(u.Portal,{element:w,appendTo:f.appendTo,visible:!0})}()}));return U.displayName="Dialog",e.Dialog=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.utils,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
|
package/dropdown/dropdown.cjs.js
CHANGED
|
@@ -413,7 +413,7 @@ var DropdownItem = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
413
413
|
if (selected) {
|
|
414
414
|
var checkIconProps = mergeProps({
|
|
415
415
|
className: cx('checkIcon')
|
|
416
|
-
}, getPTOptions('
|
|
416
|
+
}, getPTOptions('checkIcon'));
|
|
417
417
|
return /*#__PURE__*/React__namespace.createElement(check.CheckIcon, checkIconProps);
|
|
418
418
|
}
|
|
419
419
|
var blankIconProps = mergeProps({
|
|
@@ -500,7 +500,7 @@ var DropdownPanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__name
|
|
|
500
500
|
height: scrollerOptions.props ? scrollerOptions.props.itemSize : undefined
|
|
501
501
|
};
|
|
502
502
|
style = _objectSpread$1(_objectSpread$1({}, style), option.style);
|
|
503
|
-
if (option.group && props.optionGroupLabel) {
|
|
503
|
+
if (option.group && option.optionGroup && props.optionGroupLabel) {
|
|
504
504
|
var optionGroupLabel = props.optionGroupLabel;
|
|
505
505
|
var groupContent = props.optionGroupTemplate ? utils.ObjectUtils.getJSXElement(props.optionGroupTemplate, option, index) : props.getOptionGroupLabel(option);
|
|
506
506
|
var key = index + '_' + props.getOptionGroupRenderKey(option);
|
|
@@ -881,10 +881,9 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
881
881
|
};
|
|
882
882
|
var onOptionSelect = function onOptionSelect(event, option) {
|
|
883
883
|
var isHide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
884
|
-
var value = getOptionValue(option);
|
|
885
884
|
selectItem({
|
|
886
885
|
originalEvent: event,
|
|
887
|
-
option:
|
|
886
|
+
option: option
|
|
888
887
|
});
|
|
889
888
|
isHide && hide();
|
|
890
889
|
};
|
|
@@ -1167,8 +1166,9 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1167
1166
|
}
|
|
1168
1167
|
};
|
|
1169
1168
|
var onEditableInputChange = function onEditableInputChange(event) {
|
|
1169
|
+
!overlayVisibleState && show();
|
|
1170
1170
|
var searchIndex = null;
|
|
1171
|
-
if (event.target.value) {
|
|
1171
|
+
if (event.target.value && visibleOptions) {
|
|
1172
1172
|
searchIndex = visibleOptions.findIndex(function (item) {
|
|
1173
1173
|
return getOptionLabel(item).toLocaleLowerCase().startsWith(event.target.value.toLocaleLowerCase());
|
|
1174
1174
|
});
|
|
@@ -1374,10 +1374,12 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1374
1374
|
}
|
|
1375
1375
|
};
|
|
1376
1376
|
var getOptionLabel = function getOptionLabel(option) {
|
|
1377
|
-
|
|
1377
|
+
var optionLabel = props.optionLabel ? utils.ObjectUtils.resolveFieldData(option, props.optionLabel) : utils.ObjectUtils.resolveFieldData(option, 'label');
|
|
1378
|
+
return utils.ObjectUtils.isNotEmpty(optionLabel) ? optionLabel : option;
|
|
1378
1379
|
};
|
|
1379
1380
|
var getOptionValue = function getOptionValue(option) {
|
|
1380
|
-
|
|
1381
|
+
var optionValue = props.OptionValue ? utils.ObjectUtils.resolveFieldData(option, props.optionValue) : utils.ObjectUtils.resolveFieldData(option, 'value');
|
|
1382
|
+
return utils.ObjectUtils.isNotEmpty(optionValue) ? optionValue : option;
|
|
1381
1383
|
};
|
|
1382
1384
|
var getOptionRenderKey = function getOptionRenderKey(option) {
|
|
1383
1385
|
return props.dataKey ? utils.ObjectUtils.resolveFieldData(option, props.dataKey) : getOptionLabel(option);
|
|
@@ -1550,7 +1552,7 @@ var Dropdown = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
1550
1552
|
}, ariaProps), ptm('input'));
|
|
1551
1553
|
return /*#__PURE__*/React__namespace.createElement("input", _inputProps);
|
|
1552
1554
|
}
|
|
1553
|
-
var content = props.valueTemplate ? utils.ObjectUtils.getJSXElement(props.valueTemplate, selectedOption, props) : label || props.placeholder ||
|
|
1555
|
+
var content = props.valueTemplate ? utils.ObjectUtils.getJSXElement(props.valueTemplate, selectedOption, props) : label || props.placeholder || props.emptyMessage || /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, "\xA0");
|
|
1554
1556
|
var inputProps = mergeProps({
|
|
1555
1557
|
ref: inputRef,
|
|
1556
1558
|
className: cx('input', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),r=require("primereact/hooks"),o=require("primereact/icons/chevrondown"),l=require("primereact/icons/spinner"),i=require("primereact/icons/times"),a=require("primereact/overlayservice"),u=require("primereact/tooltip"),c=require("primereact/utils"),s=require("primereact/csstransition"),p=require("primereact/icons/search"),d=require("primereact/portal"),f=require("primereact/virtualscroller"),m=require("primereact/ripple"),v=require("primereact/icons/check"),b=require("primereact/iconbase");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function h(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=h(e),w=g(t);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function E(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function x(e){var t=E(e,"string");return"symbol"===I(t)?t:String(t)}function S(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){if(Array.isArray(e))return e}function j(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}function C(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return D(e)||j(e,t)||N(e,t)||C()}var L=n.ComponentBase.extend({defaultProps:{__TYPE:"Dropdown",__parentMetadata:null,appendTo:null,ariaLabel:null,ariaLabelledBy:null,autoFocus:!1,children:void 0,className:null,clearIcon:null,dataKey:null,disabled:!1,dropdownIcon:null,editable:!1,emptyFilterMessage:null,highlightOnSelect:!0,checkmark:!1,emptyMessage:null,filter:!1,filterBy:null,filterClearIcon:null,filterIcon:null,filterInputAutoFocus:!1,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,focusInputRef:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,itemTemplate:null,loading:!1,loadingIcon:null,maxLength:null,name:null,onBlur:null,onChange:null,onContextMenu:null,onFilter:null,onFocus:null,onHide:null,onMouseDown:null,onShow:null,optionDisabled:null,optionGroupChildren:"items",selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,panelClassName:null,panelFooterTemplate:null,panelStyle:null,placeholder:null,required:!1,resetFilterOnHide:!1,scrollHeight:"200px",showClear:!1,showFilterClear:!1,showOnFocus:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,value:null,valueTemplate:null,virtualScrollerOptions:null},css:{classes:{root:function(e){var t=e.props,n=e.focusedState,r=e.overlayVisibleState,o=e.context;return c.classNames("p-dropdown p-component p-inputwrapper",{"p-disabled":t.disabled,"p-invalid":t.invalid,"p-focus":n,"p-variant-filled":t.variant?"filled"===t.variant:o&&"filled"===o.inputStyle,"p-dropdown-clearable":t.showClear&&!t.disabled,"p-inputwrapper-filled":c.ObjectUtils.isNotEmpty(t.value),"p-inputwrapper-focus":n||r})},input:function(e){var t=e.props,n=e.label;return t.editable?"p-dropdown-label p-inputtext":c.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===n&&t.placeholder,"p-dropdown-label-empty":null===n&&!t.placeholder})},trigger:"p-dropdown-trigger",emptyMessage:"p-dropdown-empty-message",itemGroup:function(e){var t=e.optionGroupLabel;return c.classNames("p-dropdown-item-group",{"p-dropdown-item-empty":!t||0===t.length})},itemGroupLabel:"p-dropdown-item-group-label",dropdownIcon:"p-dropdown-trigger-icon p-clickable",loadingIcon:"p-dropdown-trigger-icon p-clickable",clearIcon:"p-dropdown-clear-icon p-clickable",filterIcon:"p-dropdown-filter-icon",filterClearIcon:"p-dropdown-filter-clear-icon",filterContainer:function(e){return c.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!e.clearIcon})},filterInput:function(e){var t=e.props,n=e.context;return c.classNames("p-dropdown-filter p-inputtext p-component",{"p-variant-filled":t.variant?"filled"===t.variant:n&&"filled"===n.inputStyle})},list:function(e){return"p-dropdown-items"},panel:function(e){var t=e.context;return c.classNames("p-dropdown-panel p-component",{"p-input-filled":t&&"filled"===t.inputStyle||"filled"===w.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===w.default.ripple})},item:function(e){var t=e.label;return c.classNames("p-dropdown-item",{"p-highlight":e.selected&&e.highlightOnSelect,"p-disabled":e.disabled,"p-focus":e.index===e.focusedOptionIndex,"p-dropdown-item-empty":!t||0===t.length})},itemLabel:"p-dropdown-item-label",checkIcon:"p-dropdown-check-icon",blankIcon:"p-dropdown-blank-icon",wrapper:"p-dropdown-items-wrapper",header:"p-dropdown-header",footer:"p-dropdown-footer",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n input.p-dropdown-label {\n cursor: default;\n }\n \n .p-dropdown .p-dropdown-panel {\n min-width: 100%;\n }\n \n .p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-dropdown-items-wrapper {\n overflow: auto;\n }\n \n .p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-dropdown-filter {\n width: 100%;\n }\n \n .p-dropdown-filter-container {\n position: relative;\n }\n \n .p-dropdown-clear-icon,\n .p-dropdown-filter-icon,\n .p-dropdown-filter-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-dropdown {\n display: flex;\n }\n \n .p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n }\n}\n",inlineStyles:{wrapper:function(e){return{maxHeight:e.props.scrollHeight||"auto"}},panel:function(e){}}}}),P=y.memo(y.forwardRef((function(e,t){var n=b.IconBase.getPTI(e);return y.createElement("svg",O({ref:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("rect",{width:"1",height:"1",fill:"currentColor",fillOpacity:"0"}))})));P.displayName="BlankIcon";var U=y.memo((function(e){var t=r.useMergeProps(),n=e.ptm,o=e.cx,l=e.selected,i=e.disabled,a=e.option,u=e.label,s=e.index,p=e.focusedOptionIndex,d=e.checkmark,f=e.highlightOnSelect,b=function(e){return n(e,{context:{selected:l,disabled:i}})},g=e.template?c.ObjectUtils.getJSXElement(e.template,e.option):e.label,h=t({role:"option",key:e.label,className:c.classNames(a.className,o("item",{selected:l,disabled:i,label:u,index:s,focusedOptionIndex:p,highlightOnSelect:f})),style:e.style,onClick:function(t){return n=t,void(e.onClick&&e.onClick({originalEvent:n,option:a}));var n},onMouseMove:function(t){return null==e?void 0:e.onMouseMove(t,s)},"aria-label":u,"aria-selected":l,"data-p-highlight":l,"data-p-focused":p===s,"data-p-disabled":i},b("item")),w=t({className:o("itemLabel")},b("itemLabel"));return y.createElement("li",h,d&&function(){if(l){var e=t({className:o("checkIcon")},b("checIcon"));return y.createElement(v.CheckIcon,e)}var n=t({className:o("blankIcon")},b("blankIcon"));return y.createElement(P,n)}(),y.createElement("span",w,g),y.createElement(m.Ripple,null))}));function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}U.displayName="DropdownItem";var M=y.memo(y.forwardRef((function(e,n){var o,l,a,u,m,v=r.useMergeProps(),b=e.ptm,g=e.cx,h=e.sx,w=y.useContext(t.PrimeReactContext),I=y.useRef(null),E=!(e.visibleOptions&&e.visibleOptions.length)&&e.hasFilter,x={filter:function(e){return F(e)},reset:function(){return e.resetFilter()}},S=function(t,n){return b(t,T({hostName:e.hostName},n))},D=function(){e.onEnter((function(){if(e.virtualScrollerRef.current){var t=e.getSelectedOptionIndex();-1!==t&&setTimeout((function(){return e.virtualScrollerRef.current.scrollToIndex(t)}),0)}}))},j=function(){e.onEntered((function(){e.filter&&e.filterInputAutoFocus&&c.DomHandler.focus(I.current,!1)}))},F=function(t){e.virtualScrollerRef.current&&e.virtualScrollerRef.current.scrollToIndex(0),e.onFilterInputChange&&e.onFilterInputChange(t)},N=function(){if(e.panelFooterTemplate){var t=c.ObjectUtils.getJSXElement(e.panelFooterTemplate,e,e.onOverlayHide),n=v({className:g("footer")},S("footer"));return y.createElement("div",n,t)}return null},C=function(t,n){var r;e.focusOnHover&&(null==e||null===(r=e.changeFocusedOptionIndex)||void 0===r||r.call(e,t,n))},k=function(n,r){var o=c.ObjectUtils.getJSXElement(n,e)||t.localeOption(r?"emptyFilterMessage":"emptyMessage"),l=v({className:g("emptyMessage")},S("emptyMessage"));return y.createElement("li",l,o)},L=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={height:r.props?r.props.itemSize:void 0};if(o=T(T({},o),t.style),t.group&&e.optionGroupLabel){var l=e.optionGroupLabel,i=e.optionGroupTemplate?c.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),a=n+"_"+e.getOptionGroupRenderKey(t),u=v({className:g("itemGroup",{optionGroupLabel:l}),style:o,"data-p-highlight":e.selected},S("itemGroup")),s=v({className:g("itemGroupLabel")},S("itemGroupLabel"));return y.createElement("li",O({key:a},u),y.createElement("span",s,i))}var p=e.getOptionRenderKey(t)+"_"+n,d=e.getOptionLabel(t),f=e.isOptionDisabled(t);return y.createElement(U,{key:p,label:d,index:n,focusedOptionIndex:e.focusedOptionIndex,option:t,style:o,template:e.itemTemplate,selected:e.isSelected(t),highlightOnSelect:e.highlightOnSelect,disabled:f,onClick:e.onOptionClick,onMouseMove:C,ptm:b,cx:g,checkmark:e.checkmark})},P=function(){if(e.showFilterClear&&e.filterValue){var n=t.localeOption("clear"),r=v({className:g("filterClearIcon"),"aria-label":n,onClick:function(){return e.onFilterClearIconClick((function(){return c.DomHandler.focus(I.current)}))}},S("filterClearIcon"));return c.IconUtils.getJSXIcon(e.filterClearIcon||y.createElement(i.TimesIcon,r),T({},r),{props:e})}return null},R=function(){if(e.filter){var t=P(),n=v({className:g("filterIcon")},S("filterIcon")),r=c.IconUtils.getJSXIcon(e.filterIcon||y.createElement(p.SearchIcon,n),T({},n),{props:e}),o=v({className:g("filterContainer",{clearIcon:t})},S("filterContainer")),l=v({ref:I,type:"text",autoComplete:"off",className:g("filterInput",{context:w}),placeholder:e.filterPlaceholder,onKeyDown:e.onFilterInputKeyDown,onChange:function(e){return F(e)},value:e.filterValue},S("filterInput")),i=y.createElement("div",o,y.createElement("input",l),t,r);if(e.filterTemplate){var a={className:c.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!t}),element:i,filterOptions:x,filterInputKeyDown:e.onFilterInputKeyDown,filterInputChange:F,filterIconClassName:"p-dropdown-filter-icon",clearIcon:t,props:e};i=c.ObjectUtils.getJSXElement(e.filterTemplate,a)}var u=v({className:g("header")},S("header"));return y.createElement("div",u,i)}return null},M=function(){if(e.virtualScrollerOptions){var t=T(T({},e.virtualScrollerOptions),{style:T(T({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:c.classNames("p-dropdown-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,autoSize:!0,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(T(T({},t),{filter:e.filterValue}))},itemTemplate:function(e,t){return e&&L(e,t.index,t)},contentTemplate:function(t){var n=E?k(e.hasFilter?e.emptyFilterMessage:e.emptyMessage):t.children,r=v({ref:t.contentRef,style:t.style,className:c.classNames(t.className,g("list",{virtualScrollerProps:e.virtualScrollerOptions})),role:"listbox"},S("list"));return y.createElement("ul",r,n)}});return y.createElement(f.VirtualScroller,O({ref:e.virtualScrollerRef},t,{pt:b("virtualScroller")}))}var n=c.ObjectUtils.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(L):e.hasFilter?k(e.emptyFilterMessage,!0):k(e.emptyMessage),r=v({className:g("wrapper"),style:h("wrapper")},S("wrapper")),o=v({className:g("list"),role:"listbox"},S("list"));return y.createElement("div",r,y.createElement("ul",o,n))},H=(o=R(),l=M(),a=N(),u=v({className:c.classNames(e.panelClassName,g("panel",{context:w})),style:h("panel"),onClick:e.onClick},S("panel")),m=v({classNames:g("transition"),in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:D,onEntered:j,onExit:e.onExit,onExited:e.onExited},S("transition")),y.createElement(s.CSSTransition,O({nodeRef:n},m),y.createElement("div",O({ref:n},u),e.firstFocusableElement,o,l,a,e.lastFocusableElement)));return y.createElement(d.Portal,{element:H,appendTo:e.appendTo})})));function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 l,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,l=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw l}}}}function G(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}M.displayName="DropdownPanel";var K=y.memo(y.forwardRef((function(e,s){var p=r.useMergeProps(),d=y.useContext(t.PrimeReactContext),f=L.getProps(e,d),m=k(y.useState(""),2),v=m[0],b=m[1],g=k(y.useState(!1),2),h=g[0],E=g[1],x=k(y.useState(-1),2),D=x[0],j=x[1],F=k(y.useState(!1),2),N=F[0],C=F[1],P=y.useRef(!1),U=y.useRef(null),R=y.useRef(null),T=y.useRef(null),G=y.useRef(null),A=y.useRef(f.inputRef),q=y.useRef(f.focusInputRef),K=y.useRef(null),B=y.useRef(null),_=y.useRef(null);y.useRef(null);var J=f.virtualScrollerOptions&&f.virtualScrollerOptions.lazy,X=c.ObjectUtils.isNotEmpty(v),z=f.appendTo||d&&d.appendTo||w.default.appendTo,Z=L.setMetaData(V(V({props:f},f.__parentMetadata),{},{state:{filter:v,focused:h,overlayVisible:N}})),W=Z.ptm,$=Z.cx,Y=Z.sx;n.useHandleStyle(L.css.styles,Z.isUnstyled,{name:"dropdown"});var Q=k(r.useOverlayListener({target:U,overlay:R,listener:function(e,t){t.valid&&("outside"===t.type?!re(e)&&Ae():Ae())},when:N}),2),ee=Q[0],te=Q[1],ne=function(e){return(e||[]).reduce((function(e,t,n){e.push({optionGroup:t,group:!0,index:n,code:t.code,label:t.label});var r=ze(t);return r&&r.forEach((function(t){return e.push(t)})),e}),[])},re=function(e){return c.DomHandler.isAttributeEquals(e.target,"data-pc-section","clearicon")||c.DomHandler.isAttributeEquals(e.target.parentElement||e.target,"data-pc-section","filterclearicon")},oe=function(e){f.showOnFocus&&!N&&Ge(),E(!0),f.onFocus&&f.onFocus(e)},le=function(e){E(!1),f.onBlur&&setTimeout((function(){var t=A.current?A.current.value:void 0;f.onBlur({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:t}})}),200)},ie=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=_e(t);Ue({originalEvent:e,option:r}),n&&Ae()},ae=function(e){if(f.disabled||c.DomHandler.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":he(e);break;case"ArrowUp":ye(e);break;case"ArrowLeft":case"ArrowRight":we(e,f.editable);break;case"Home":Oe(e);break;case"End":Ie(e);break;case"PageDown":xe(e);break;case"PageUp":Ee(e);break;case"Space":Se(e,f.editable);break;case"NumpadEnter":case"Enter":De(e);break;case"Escape":je(e);break;case"Tab":Fe(e);break;case"Backspace":Ne(e,f.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&c.ObjectUtils.isPrintableCharacter(e.key)&&(!N&&!f.editable&&Ge(),!f.editable&&me(e,e.key))}P.current=!1}},ue=function(e){var t;return ce(e)&&(null===(t=Be(e))||void 0===t?void 0:t.toLocaleLowerCase(f.filterLocale).startsWith(_.current.toLocaleLowerCase(f.filterLocale)))},ce=function(e){return c.ObjectUtils.isNotEmpty(e)&&!(Xe(e)||Je(e))},se=function(){return c.ObjectUtils.isNotEmpty(f.value)},pe=function(e){return ce(e)&&He(e)},de=function(){return se?nt.findIndex((function(e){return pe(e)})):-1},fe=function(){var e=de();return e<0?ve():e},me=function(e,t){_.current=(_.current||"")+t;var n=-1,r=!1;return c.ObjectUtils.isNotEmpty(_.current)&&(-1!==(n=-1!==D?-1===(n=nt.slice(D).findIndex((function(e){return ue(e)})))?nt.slice(0,D).findIndex((function(e){return ue(e)})):n+D:nt.findIndex((function(e){return ue(e)})))&&(r=!0),-1===n&&-1===D&&(n=fe()),-1!==n&&ge(e,n)),B.current&&clearTimeout(B.current),B.current=setTimeout((function(){_.current="",B.current=null}),500),r},ve=function(){return nt.findIndex((function(e){return ce(e)}))},be=function(){return c.ObjectUtils.findLastIndex(nt,(function(e){return ce(e)}))},ge=function(e,t){D!==t&&(j(t),f.selectOnFocus&&ie(e,nt[t],!1))},he=function(e){if(N){var t=-1!==D?(r=(n=D)<nt.length-1?nt.slice(n+1).findIndex((function(e){return ce(e)})):-1)>-1?r+n+1:n:P.current?ve():fe();ge(e,t)}else Ge(),f.editable&&ge(e,de());var n,r;e.preventDefault()},ye=function(e){var t,n,r;if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==D&&ie(e,nt[D]),state.overlayVisible&&Ae(),e.preventDefault();else{var o=-1!==D?(r=(n=D)>0?c.ObjectUtils.findLastIndex(nt.slice(0,n),(function(e){return ce(e)})):-1)>-1?r:n:P.current?be():(t=de())<0?be():t;ge(e,o),!N&&Ge(),e.preventDefault()}},we=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&j(-1)},Oe=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),j(-1)):(ge(e,ve()),!N&&Ge()),e.preventDefault()},Ie=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n),j(-1)}else ge(e,be()),!N&&Ge();e.preventDefault()},Ee=function(e){e.preventDefault()},xe=function(e){e.preventDefault()},Se=function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&De(e)},De=function(e){N?(-1!==D&&ie(e,nt[D]),Ae()):(j(-1),he(e)),e.preventDefault()},je=function(e){N&&Ae(),e.preventDefault()},Fe=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(!N||c.DomHandler.getFocusableElements(R.current,':not([data-p-hidden-focusable="true"])').length>0?(-1!==D&&ie(e,nt[D]),N&&Ae()):(c.DomHandler.focus(T.current),e.preventDefault()))},Ne=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!N&&Ge()},Ce=function(e){var t=null;e.target.value&&(t=nt.findIndex((function(t){return Be(t).toLocaleLowerCase().startsWith(e.target.value.toLocaleLowerCase())}))),j(t),f.onChange&&f.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:e.target.value}})},ke=function(e){E(!0),Ae(),f.onFocus&&f.onFocus(e)},Le=function(e){b(""),f.onFilter&&f.onFilter({filter:""}),e&&e()},Pe=function(e){f.onChange&&f.onChange({originalEvent:e,value:void 0,stopPropagation:function(){null==e||e.stopPropagation()},preventDefault:function(){null==e||e.preventDefault()},target:{name:f.name,id:f.id,value:void 0}}),f.filter&&Le(),Ke()},Ue=function(e){if(rt!==e.option){Ke(e.option),j(-1);var t=_e(e.option),n=Me(e.option,nt);f.onChange&&f.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:t}}),ge(e.originalEvent,n)}},Re=function(e){if(e=e||nt,null!=f.value&&e){if(!f.optionGroupLabel)return Me(f.value,e);for(var t=0;t<e.length;t++){var n=Me(f.value,ze(e[t]));if(-1!==n)return{group:t,option:n}}}return-1},Te=function(){return f.optionValue?null:f.dataKey},Me=function(e,t){var n=Te();return t.findIndex((function(t){return c.ObjectUtils.equals(e,_e(t),n)}))},He=function(e){return c.ObjectUtils.equals(f.value,_e(e),Te())},Ge=function(){j(-1!==D?D:f.autoOptionFocus?fe():f.editable?-1:de()),C(!0)},Ae=function(){C(!1),P.current=!1},qe=function(){c.DomHandler.alignOverlay(R.current,A.current.parentElement,f.appendTo||d&&d.appendTo||w.default.appendTo)},Ve=function(){var e=c.DomHandler.findSingle(R.current,'li[data-p-focused="true"]');if(e&&e.scrollIntoView)e.scrollIntoView({block:"nearest",inline:"nearest"});else{var t=c.DomHandler.findSingle(R.current,'li[data-p-highlight="true"]');t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}},Ke=function(e){A.current&&(A.current.value=e?Be(e):f.value||"",q.current&&(q.current.value=A.current.value))},Be=function(e){return c.ObjectUtils.resolveFieldData(e,f.optionLabel?f.optionLabel:"label")},_e=function(e){return f.optionValue?c.ObjectUtils.resolveFieldData(e,f.optionValue):c.ObjectUtils.resolveFieldData(e,"value")||e},Je=function(e){return f.optionGroupLabel&&e.optionGroup&&e.group},Xe=function(e){return f.optionDisabled?c.ObjectUtils.isFunction(f.optionDisabled)?f.optionDisabled(e):c.ObjectUtils.resolveFieldData(e,f.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},ze=function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupChildren)},Ze=function(){if(f.editable&&A.current){var e=(rt?Be(rt):null)||f.value||"";A.current.value=e,q.current&&(q.current.value=e)}};y.useImperativeHandle(s,(function(){return{props:f,show:Ge,hide:Ae,clear:Pe,focus:function(){return c.DomHandler.focus(q.current)},getElement:function(){return U.current},getOverlay:function(){return R.current},getInput:function(){return A.current},getFocusInput:function(){return q.current},getVirtualScroller:function(){return K.current}}})),y.useEffect((function(){c.ObjectUtils.combinedRefs(A,f.inputRef),c.ObjectUtils.combinedRefs(q,f.focusInputRef)}),[A,f.inputRef,q,f.focusInputRef]),r.useMountEffect((function(){f.autoFocus&&c.DomHandler.focus(q.current,f.autoFocus),qe()})),r.useUpdateEffect((function(){N&&(f.value||D>=0)&&Ve()}),[N,f.value,D]),r.useUpdateEffect((function(){N&&v&&f.filter&&qe()}),[N,v,f.filter]),r.useUpdateEffect((function(){!v||f.options&&0!==f.options.length||b(""),Ze(),A.current&&(A.current.selectedIndex=1)})),r.useUnmountEffect((function(){c.ZIndexUtils.clear(R.current)}));var We,$e,Ye,Qe,et,tt=function(e){"Enter"!==e.key&&"Space"!==e.code||(Pe(e),e.preventDefault())},nt=function(){var e=f.optionGroupLabel?ne(f.options):f.options;if(X&&!J){var n=v.trim().toLocaleLowerCase(f.filterLocale),r=f.filterBy?f.filterBy.split(","):[f.optionLabel||"label"];if(f.optionGroupLabel){var o,l=[],i=H(f.options);try{for(i.s();!(o=i.n()).done;){var a=o.value,u=t.FilterService.filter(ze(a),r,n,f.filterMatchMode,f.filterLocale);u&&u.length&&l.push(V(V({},a),S({},"".concat(f.optionGroupChildren),u)))}}catch(e){i.e(e)}finally{i.f()}return ne(l)}return t.FilterService.filter(e,r,n,f.filterMatchMode,f.filterLocale)}return e}(),rt=-1!==(We=Re(f.options))?f.optionGroupLabel?ze(f.options[We.group])[We.option]:f.options[We]:null,ot=c.ObjectUtils.isNotEmpty(f.tooltip),lt=L.getOtherProps(f),it=c.ObjectUtils.reduceKeys(lt,c.DomHandler.ARIA_PROPS),at=function(){var e={value:"",label:f.placeholder};if(rt){var t=_e(rt);e={value:"object"===I(t)?f.options.findIndex((function(e){return e===t})):t,label:Be(rt)}}var n=p({className:"p-hidden-accessible p-dropdown-hidden-select"},W("hiddenSelectedMessage")),r=p({ref:A,required:f.required,defaultValue:e.value,name:f.name,tabIndex:-1,"aria-hidden":"true"},W("select")),o=p({value:e.value},W("option"));return y.createElement("div",n,y.createElement("select",r,y.createElement("option",o,e.label)))}(),ut=function(){var e=c.ObjectUtils.isNotEmpty(rt)?Be(rt):null;f.editable&&(e=e||f.value||"");var t=p({className:"p-hidden-accessible"},W("hiddenSelectedMessage")),n=p(V({ref:q,id:f.inputId,defaultValue:e,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:oe,onBlur:le,onKeyDown:ae,disabled:f.disabled,tabIndex:f.disabled?-1:f.tabIndex||0},it),W("input"));return y.createElement("div",t,y.createElement("input",n))}(),ct=function(){var e=c.ObjectUtils.isNotEmpty(rt)?Be(rt):null;if(f.editable){var t=p(V({ref:A,type:"text",defaultValue:e||f.value||"",className:$("input",{label:e}),disabled:f.disabled,placeholder:f.placeholder,maxLength:f.maxLength,onInput:Ce,onFocus:ke,onKeyDown:ae,onBlur:le,tabIndex:f.disabled?-1:f.tabIndex||0,"aria-haspopup":"listbox"},it),W("input"));return y.createElement("input",t)}var n=f.valueTemplate?c.ObjectUtils.getJSXElement(f.valueTemplate,rt,f):e||f.placeholder||"empty",r=p({ref:A,className:$("input",{label:e}),tabIndex:"-1"},W("input"));return y.createElement("span",r,n)}(),st=f.loading?($e=p({className:$("loadingIcon"),"data-pr-overlay-visible":N},W("loadingIcon")),Ye=c.IconUtils.getJSXIcon(f.loadingIcon||y.createElement(l.SpinnerIcon,{spin:!0}),V({},$e),{props:f}),Qe=f.placeholder||f.ariaLabel,et=p({className:$("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":N,"aria-label":Qe},W("trigger")),y.createElement("div",et,Ye)):function(){var e=p({className:$("dropdownIcon"),"data-pr-overlay-visible":N},W("dropdownIcon")),t=c.IconUtils.getJSXIcon(f.dropdownIcon||y.createElement(o.ChevronDownIcon,e),V({},e),{props:f}),n=f.placeholder||f.ariaLabel,r=p({className:$("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":N,"aria-label":n},W("trigger"));return y.createElement("div",r,t)}(),pt=function(){if(null!=f.value&&f.showClear&&!f.disabled){var e=p({className:$("clearIcon"),onPointerUp:Pe,tabIndex:f.tabIndex||"0",onKeyDown:tt,"aria-label":t.localeOption("clear")},W("clearIcon"));return c.IconUtils.getJSXIcon(f.clearIcon||y.createElement(i.TimesIcon,e),V({},e),{props:f})}return null}(),dt=p({id:f.id,ref:U,className:c.classNames(f.className,$("root",{context:d,focusedState:h,overlayVisibleState:N})),style:f.style,onClick:function(e){return t=e,void(f.disabled||f.loading||(f.onClick&&f.onClick(t),t.defaultPrevented||re(t)||"INPUT"===t.target.tagName||(R.current&&R.current&&R.current.contains(t.target)||(c.DomHandler.focus(q.current),N?Ae():Ge()),P.current=!0)));var t},onMouseDown:f.onMouseDown,onContextMenu:f.onContextMenu,onFocus:function(){f.editable&&!N&&!1===P.current&&c.DomHandler.focus(A.current)},"data-p-disabled":f.disabled,"data-p-focus":h},lt,W("root")),ft=p({ref:T,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===q.current?c.DomHandler.getFirstFocusableElement(R.current,':not([data-p-hidden-focusable="true"])'):q.current;c.DomHandler.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},W("hiddenFirstFocusableEl")),mt=p({ref:G,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===q.current?c.DomHandler.getLastFocusableElement(R.current,':not([data-p-hidden-focusable="true"])'):q.current;c.DomHandler.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},W("hiddenLastFocusableEl"));return y.createElement(y.Fragment,null,y.createElement("div",dt,ut,at,ct,pt,st,y.createElement(M,O({hostName:"Dropdown",ref:R,visibleOptions:nt,virtualScrollerRef:K},f,{appendTo:z,cx:$,filterValue:v,focusedOptionIndex:D,getOptionGroupChildren:ze,getOptionGroupLabel:function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupLabel)},getOptionGroupRenderKey:function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupLabel)},getOptionLabel:Be,getOptionRenderKey:function(e){return f.dataKey?c.ObjectUtils.resolveFieldData(e,f.dataKey):Be(e)},getSelectedOptionIndex:Re,hasFilter:X,in:N,isOptionDisabled:Xe,isSelected:He,onClick:function(e){a.OverlayService.emit("overlay-click",{originalEvent:e,target:U.current})},onEnter:function(e){c.ZIndexUtils.set("overlay",R.current,d&&d.autoZIndex||w.default.autoZIndex,d&&d.zIndex.overlay||w.default.zIndex.overlay),c.DomHandler.addStyles(R.current,{position:"absolute",top:"0",left:"0"}),qe(),e&&e()},onEntered:function(e){e&&e(),ee(),f.onShow&&f.onShow()},onExit:function(){te()},onExited:function(){f.filter&&f.resetFilterOnHide&&Le(),c.ZIndexUtils.clear(R.current),f.onHide&&f.onHide()},onFilterClearIconClick:function(e){Le(e)},onFilterInputChange:function(e){var t=e.target.value;b(t),f.onFilter&&f.onFilter({originalEvent:e,filter:t})},onFilterInputKeyDown:function(e){switch(e.code){case"ArrowDown":he(e);break;case"ArrowUp":ye(e);break;case"ArrowLeft":case"ArrowRight":we(e,!0);break;case"Escape":case"Enter":case"NumpadEnter":De(e),e.preventDefault()}},onOptionClick:function(e){e.option.disabled||(Ue(e),c.DomHandler.focus(q.current)),Ae()},ptm:W,resetFilter:Le,changeFocusedOptionIndex:ge,firstFocusableElement:y.createElement("span",ft),lastFocusableElement:y.createElement("span",mt),sx:Y}))),ot&&y.createElement(u.Tooltip,O({target:U,content:f.tooltip,pt:W("tooltip")},f.tooltipOptions)))})));K.displayName="Dropdown",exports.Dropdown=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),r=require("primereact/hooks"),o=require("primereact/icons/chevrondown"),l=require("primereact/icons/spinner"),i=require("primereact/icons/times"),a=require("primereact/overlayservice"),u=require("primereact/tooltip"),c=require("primereact/utils"),s=require("primereact/csstransition"),p=require("primereact/icons/search"),d=require("primereact/portal"),f=require("primereact/virtualscroller"),m=require("primereact/ripple"),v=require("primereact/icons/check"),b=require("primereact/iconbase");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function h(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=h(e),w=g(t);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function E(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function x(e){var t=E(e,"string");return"symbol"===I(t)?t:String(t)}function S(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){if(Array.isArray(e))return e}function j(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}function C(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return D(e)||j(e,t)||N(e,t)||C()}var L=n.ComponentBase.extend({defaultProps:{__TYPE:"Dropdown",__parentMetadata:null,appendTo:null,ariaLabel:null,ariaLabelledBy:null,autoFocus:!1,children:void 0,className:null,clearIcon:null,dataKey:null,disabled:!1,dropdownIcon:null,editable:!1,emptyFilterMessage:null,highlightOnSelect:!0,checkmark:!1,emptyMessage:null,filter:!1,filterBy:null,filterClearIcon:null,filterIcon:null,filterInputAutoFocus:!1,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,focusInputRef:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,itemTemplate:null,loading:!1,loadingIcon:null,maxLength:null,name:null,onBlur:null,onChange:null,onContextMenu:null,onFilter:null,onFocus:null,onHide:null,onMouseDown:null,onShow:null,optionDisabled:null,optionGroupChildren:"items",selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,panelClassName:null,panelFooterTemplate:null,panelStyle:null,placeholder:null,required:!1,resetFilterOnHide:!1,scrollHeight:"200px",showClear:!1,showFilterClear:!1,showOnFocus:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,value:null,valueTemplate:null,virtualScrollerOptions:null},css:{classes:{root:function(e){var t=e.props,n=e.focusedState,r=e.overlayVisibleState,o=e.context;return c.classNames("p-dropdown p-component p-inputwrapper",{"p-disabled":t.disabled,"p-invalid":t.invalid,"p-focus":n,"p-variant-filled":t.variant?"filled"===t.variant:o&&"filled"===o.inputStyle,"p-dropdown-clearable":t.showClear&&!t.disabled,"p-inputwrapper-filled":c.ObjectUtils.isNotEmpty(t.value),"p-inputwrapper-focus":n||r})},input:function(e){var t=e.props,n=e.label;return t.editable?"p-dropdown-label p-inputtext":c.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===n&&t.placeholder,"p-dropdown-label-empty":null===n&&!t.placeholder})},trigger:"p-dropdown-trigger",emptyMessage:"p-dropdown-empty-message",itemGroup:function(e){var t=e.optionGroupLabel;return c.classNames("p-dropdown-item-group",{"p-dropdown-item-empty":!t||0===t.length})},itemGroupLabel:"p-dropdown-item-group-label",dropdownIcon:"p-dropdown-trigger-icon p-clickable",loadingIcon:"p-dropdown-trigger-icon p-clickable",clearIcon:"p-dropdown-clear-icon p-clickable",filterIcon:"p-dropdown-filter-icon",filterClearIcon:"p-dropdown-filter-clear-icon",filterContainer:function(e){return c.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!e.clearIcon})},filterInput:function(e){var t=e.props,n=e.context;return c.classNames("p-dropdown-filter p-inputtext p-component",{"p-variant-filled":t.variant?"filled"===t.variant:n&&"filled"===n.inputStyle})},list:function(e){return"p-dropdown-items"},panel:function(e){var t=e.context;return c.classNames("p-dropdown-panel p-component",{"p-input-filled":t&&"filled"===t.inputStyle||"filled"===w.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===w.default.ripple})},item:function(e){var t=e.label;return c.classNames("p-dropdown-item",{"p-highlight":e.selected&&e.highlightOnSelect,"p-disabled":e.disabled,"p-focus":e.index===e.focusedOptionIndex,"p-dropdown-item-empty":!t||0===t.length})},itemLabel:"p-dropdown-item-label",checkIcon:"p-dropdown-check-icon",blankIcon:"p-dropdown-blank-icon",wrapper:"p-dropdown-items-wrapper",header:"p-dropdown-header",footer:"p-dropdown-footer",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n input.p-dropdown-label {\n cursor: default;\n }\n \n .p-dropdown .p-dropdown-panel {\n min-width: 100%;\n }\n \n .p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-dropdown-items-wrapper {\n overflow: auto;\n }\n \n .p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-dropdown-filter {\n width: 100%;\n }\n \n .p-dropdown-filter-container {\n position: relative;\n }\n \n .p-dropdown-clear-icon,\n .p-dropdown-filter-icon,\n .p-dropdown-filter-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-dropdown {\n display: flex;\n }\n \n .p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n }\n}\n",inlineStyles:{wrapper:function(e){return{maxHeight:e.props.scrollHeight||"auto"}},panel:function(e){}}}}),P=y.memo(y.forwardRef((function(e,t){var n=b.IconBase.getPTI(e);return y.createElement("svg",O({ref:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("rect",{width:"1",height:"1",fill:"currentColor",fillOpacity:"0"}))})));P.displayName="BlankIcon";var U=y.memo((function(e){var t=r.useMergeProps(),n=e.ptm,o=e.cx,l=e.selected,i=e.disabled,a=e.option,u=e.label,s=e.index,p=e.focusedOptionIndex,d=e.checkmark,f=e.highlightOnSelect,b=function(e){return n(e,{context:{selected:l,disabled:i}})},g=e.template?c.ObjectUtils.getJSXElement(e.template,e.option):e.label,h=t({role:"option",key:e.label,className:c.classNames(a.className,o("item",{selected:l,disabled:i,label:u,index:s,focusedOptionIndex:p,highlightOnSelect:f})),style:e.style,onClick:function(t){return n=t,void(e.onClick&&e.onClick({originalEvent:n,option:a}));var n},onMouseMove:function(t){return null==e?void 0:e.onMouseMove(t,s)},"aria-label":u,"aria-selected":l,"data-p-highlight":l,"data-p-focused":p===s,"data-p-disabled":i},b("item")),w=t({className:o("itemLabel")},b("itemLabel"));return y.createElement("li",h,d&&function(){if(l){var e=t({className:o("checkIcon")},b("checkIcon"));return y.createElement(v.CheckIcon,e)}var n=t({className:o("blankIcon")},b("blankIcon"));return y.createElement(P,n)}(),y.createElement("span",w,g),y.createElement(m.Ripple,null))}));function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}U.displayName="DropdownItem";var M=y.memo(y.forwardRef((function(e,n){var o,l,a,u,m,v=r.useMergeProps(),b=e.ptm,g=e.cx,h=e.sx,w=y.useContext(t.PrimeReactContext),I=y.useRef(null),E=!(e.visibleOptions&&e.visibleOptions.length)&&e.hasFilter,x={filter:function(e){return F(e)},reset:function(){return e.resetFilter()}},S=function(t,n){return b(t,T({hostName:e.hostName},n))},D=function(){e.onEnter((function(){if(e.virtualScrollerRef.current){var t=e.getSelectedOptionIndex();-1!==t&&setTimeout((function(){return e.virtualScrollerRef.current.scrollToIndex(t)}),0)}}))},j=function(){e.onEntered((function(){e.filter&&e.filterInputAutoFocus&&c.DomHandler.focus(I.current,!1)}))},F=function(t){e.virtualScrollerRef.current&&e.virtualScrollerRef.current.scrollToIndex(0),e.onFilterInputChange&&e.onFilterInputChange(t)},N=function(){if(e.panelFooterTemplate){var t=c.ObjectUtils.getJSXElement(e.panelFooterTemplate,e,e.onOverlayHide),n=v({className:g("footer")},S("footer"));return y.createElement("div",n,t)}return null},C=function(t,n){var r;e.focusOnHover&&(null==e||null===(r=e.changeFocusedOptionIndex)||void 0===r||r.call(e,t,n))},k=function(n,r){var o=c.ObjectUtils.getJSXElement(n,e)||t.localeOption(r?"emptyFilterMessage":"emptyMessage"),l=v({className:g("emptyMessage")},S("emptyMessage"));return y.createElement("li",l,o)},L=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={height:r.props?r.props.itemSize:void 0};if(o=T(T({},o),t.style),t.group&&t.optionGroup&&e.optionGroupLabel){var l=e.optionGroupLabel,i=e.optionGroupTemplate?c.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),a=n+"_"+e.getOptionGroupRenderKey(t),u=v({className:g("itemGroup",{optionGroupLabel:l}),style:o,"data-p-highlight":e.selected},S("itemGroup")),s=v({className:g("itemGroupLabel")},S("itemGroupLabel"));return y.createElement("li",O({key:a},u),y.createElement("span",s,i))}var p=e.getOptionRenderKey(t)+"_"+n,d=e.getOptionLabel(t),f=e.isOptionDisabled(t);return y.createElement(U,{key:p,label:d,index:n,focusedOptionIndex:e.focusedOptionIndex,option:t,style:o,template:e.itemTemplate,selected:e.isSelected(t),highlightOnSelect:e.highlightOnSelect,disabled:f,onClick:e.onOptionClick,onMouseMove:C,ptm:b,cx:g,checkmark:e.checkmark})},P=function(){if(e.showFilterClear&&e.filterValue){var n=t.localeOption("clear"),r=v({className:g("filterClearIcon"),"aria-label":n,onClick:function(){return e.onFilterClearIconClick((function(){return c.DomHandler.focus(I.current)}))}},S("filterClearIcon"));return c.IconUtils.getJSXIcon(e.filterClearIcon||y.createElement(i.TimesIcon,r),T({},r),{props:e})}return null},R=function(){if(e.filter){var t=P(),n=v({className:g("filterIcon")},S("filterIcon")),r=c.IconUtils.getJSXIcon(e.filterIcon||y.createElement(p.SearchIcon,n),T({},n),{props:e}),o=v({className:g("filterContainer",{clearIcon:t})},S("filterContainer")),l=v({ref:I,type:"text",autoComplete:"off",className:g("filterInput",{context:w}),placeholder:e.filterPlaceholder,onKeyDown:e.onFilterInputKeyDown,onChange:function(e){return F(e)},value:e.filterValue},S("filterInput")),i=y.createElement("div",o,y.createElement("input",l),t,r);if(e.filterTemplate){var a={className:c.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!t}),element:i,filterOptions:x,filterInputKeyDown:e.onFilterInputKeyDown,filterInputChange:F,filterIconClassName:"p-dropdown-filter-icon",clearIcon:t,props:e};i=c.ObjectUtils.getJSXElement(e.filterTemplate,a)}var u=v({className:g("header")},S("header"));return y.createElement("div",u,i)}return null},M=function(){if(e.virtualScrollerOptions){var t=T(T({},e.virtualScrollerOptions),{style:T(T({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:c.classNames("p-dropdown-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,autoSize:!0,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(T(T({},t),{filter:e.filterValue}))},itemTemplate:function(e,t){return e&&L(e,t.index,t)},contentTemplate:function(t){var n=E?k(e.hasFilter?e.emptyFilterMessage:e.emptyMessage):t.children,r=v({ref:t.contentRef,style:t.style,className:c.classNames(t.className,g("list",{virtualScrollerProps:e.virtualScrollerOptions})),role:"listbox"},S("list"));return y.createElement("ul",r,n)}});return y.createElement(f.VirtualScroller,O({ref:e.virtualScrollerRef},t,{pt:b("virtualScroller")}))}var n=c.ObjectUtils.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(L):e.hasFilter?k(e.emptyFilterMessage,!0):k(e.emptyMessage),r=v({className:g("wrapper"),style:h("wrapper")},S("wrapper")),o=v({className:g("list"),role:"listbox"},S("list"));return y.createElement("div",r,y.createElement("ul",o,n))},H=(o=R(),l=M(),a=N(),u=v({className:c.classNames(e.panelClassName,g("panel",{context:w})),style:h("panel"),onClick:e.onClick},S("panel")),m=v({classNames:g("transition"),in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:D,onEntered:j,onExit:e.onExit,onExited:e.onExited},S("transition")),y.createElement(s.CSSTransition,O({nodeRef:n},m),y.createElement("div",O({ref:n},u),e.firstFocusableElement,o,l,a,e.lastFocusableElement)));return y.createElement(d.Portal,{element:H,appendTo:e.appendTo})})));function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 l,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,l=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw l}}}}function G(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}M.displayName="DropdownPanel";var K=y.memo(y.forwardRef((function(e,s){var p=r.useMergeProps(),d=y.useContext(t.PrimeReactContext),f=L.getProps(e,d),m=k(y.useState(""),2),v=m[0],b=m[1],g=k(y.useState(!1),2),h=g[0],E=g[1],x=k(y.useState(-1),2),D=x[0],j=x[1],F=k(y.useState(!1),2),N=F[0],C=F[1],P=y.useRef(!1),U=y.useRef(null),R=y.useRef(null),T=y.useRef(null),G=y.useRef(null),A=y.useRef(f.inputRef),q=y.useRef(f.focusInputRef),K=y.useRef(null),B=y.useRef(null),_=y.useRef(null);y.useRef(null);var J=f.virtualScrollerOptions&&f.virtualScrollerOptions.lazy,X=c.ObjectUtils.isNotEmpty(v),z=f.appendTo||d&&d.appendTo||w.default.appendTo,Z=L.setMetaData(V(V({props:f},f.__parentMetadata),{},{state:{filter:v,focused:h,overlayVisible:N}})),W=Z.ptm,$=Z.cx,Y=Z.sx;n.useHandleStyle(L.css.styles,Z.isUnstyled,{name:"dropdown"});var Q=k(r.useOverlayListener({target:U,overlay:R,listener:function(e,t){t.valid&&("outside"===t.type?!re(e)&&Ae():Ae())},when:N}),2),ee=Q[0],te=Q[1],ne=function(e){return(e||[]).reduce((function(e,t,n){e.push({optionGroup:t,group:!0,index:n,code:t.code,label:t.label});var r=ze(t);return r&&r.forEach((function(t){return e.push(t)})),e}),[])},re=function(e){return c.DomHandler.isAttributeEquals(e.target,"data-pc-section","clearicon")||c.DomHandler.isAttributeEquals(e.target.parentElement||e.target,"data-pc-section","filterclearicon")},oe=function(e){f.showOnFocus&&!N&&Ge(),E(!0),f.onFocus&&f.onFocus(e)},le=function(e){E(!1),f.onBlur&&setTimeout((function(){var t=A.current?A.current.value:void 0;f.onBlur({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:t}})}),200)},ie=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Ue({originalEvent:e,option:t}),n&&Ae()},ae=function(e){if(f.disabled||c.DomHandler.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":he(e);break;case"ArrowUp":ye(e);break;case"ArrowLeft":case"ArrowRight":we(e,f.editable);break;case"Home":Oe(e);break;case"End":Ie(e);break;case"PageDown":xe(e);break;case"PageUp":Ee(e);break;case"Space":Se(e,f.editable);break;case"NumpadEnter":case"Enter":De(e);break;case"Escape":je(e);break;case"Tab":Fe(e);break;case"Backspace":Ne(e,f.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&c.ObjectUtils.isPrintableCharacter(e.key)&&(!N&&!f.editable&&Ge(),!f.editable&&me(e,e.key))}P.current=!1}},ue=function(e){var t;return ce(e)&&(null===(t=Be(e))||void 0===t?void 0:t.toLocaleLowerCase(f.filterLocale).startsWith(_.current.toLocaleLowerCase(f.filterLocale)))},ce=function(e){return c.ObjectUtils.isNotEmpty(e)&&!(Xe(e)||Je(e))},se=function(){return c.ObjectUtils.isNotEmpty(f.value)},pe=function(e){return ce(e)&&He(e)},de=function(){return se?nt.findIndex((function(e){return pe(e)})):-1},fe=function(){var e=de();return e<0?ve():e},me=function(e,t){_.current=(_.current||"")+t;var n=-1,r=!1;return c.ObjectUtils.isNotEmpty(_.current)&&(-1!==(n=-1!==D?-1===(n=nt.slice(D).findIndex((function(e){return ue(e)})))?nt.slice(0,D).findIndex((function(e){return ue(e)})):n+D:nt.findIndex((function(e){return ue(e)})))&&(r=!0),-1===n&&-1===D&&(n=fe()),-1!==n&&ge(e,n)),B.current&&clearTimeout(B.current),B.current=setTimeout((function(){_.current="",B.current=null}),500),r},ve=function(){return nt.findIndex((function(e){return ce(e)}))},be=function(){return c.ObjectUtils.findLastIndex(nt,(function(e){return ce(e)}))},ge=function(e,t){D!==t&&(j(t),f.selectOnFocus&&ie(e,nt[t],!1))},he=function(e){if(N){var t=-1!==D?(r=(n=D)<nt.length-1?nt.slice(n+1).findIndex((function(e){return ce(e)})):-1)>-1?r+n+1:n:P.current?ve():fe();ge(e,t)}else Ge(),f.editable&&ge(e,de());var n,r;e.preventDefault()},ye=function(e){var t,n,r;if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==D&&ie(e,nt[D]),state.overlayVisible&&Ae(),e.preventDefault();else{var o=-1!==D?(r=(n=D)>0?c.ObjectUtils.findLastIndex(nt.slice(0,n),(function(e){return ce(e)})):-1)>-1?r:n:P.current?be():(t=de())<0?be():t;ge(e,o),!N&&Ge(),e.preventDefault()}},we=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&j(-1)},Oe=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),j(-1)):(ge(e,ve()),!N&&Ge()),e.preventDefault()},Ie=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n),j(-1)}else ge(e,be()),!N&&Ge();e.preventDefault()},Ee=function(e){e.preventDefault()},xe=function(e){e.preventDefault()},Se=function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&De(e)},De=function(e){N?(-1!==D&&ie(e,nt[D]),Ae()):(j(-1),he(e)),e.preventDefault()},je=function(e){N&&Ae(),e.preventDefault()},Fe=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(!N||c.DomHandler.getFocusableElements(R.current,':not([data-p-hidden-focusable="true"])').length>0?(-1!==D&&ie(e,nt[D]),N&&Ae()):(c.DomHandler.focus(T.current),e.preventDefault()))},Ne=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!N&&Ge()},Ce=function(e){!N&&Ge();var t=null;e.target.value&&nt&&(t=nt.findIndex((function(t){return Be(t).toLocaleLowerCase().startsWith(e.target.value.toLocaleLowerCase())}))),j(t),f.onChange&&f.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:e.target.value}})},ke=function(e){E(!0),Ae(),f.onFocus&&f.onFocus(e)},Le=function(e){b(""),f.onFilter&&f.onFilter({filter:""}),e&&e()},Pe=function(e){f.onChange&&f.onChange({originalEvent:e,value:void 0,stopPropagation:function(){null==e||e.stopPropagation()},preventDefault:function(){null==e||e.preventDefault()},target:{name:f.name,id:f.id,value:void 0}}),f.filter&&Le(),Ke()},Ue=function(e){if(rt!==e.option){Ke(e.option),j(-1);var t=_e(e.option),n=Me(e.option,nt);f.onChange&&f.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:f.name,id:f.id,value:t}}),ge(e.originalEvent,n)}},Re=function(e){if(e=e||nt,null!=f.value&&e){if(!f.optionGroupLabel)return Me(f.value,e);for(var t=0;t<e.length;t++){var n=Me(f.value,ze(e[t]));if(-1!==n)return{group:t,option:n}}}return-1},Te=function(){return f.optionValue?null:f.dataKey},Me=function(e,t){var n=Te();return t.findIndex((function(t){return c.ObjectUtils.equals(e,_e(t),n)}))},He=function(e){return c.ObjectUtils.equals(f.value,_e(e),Te())},Ge=function(){j(-1!==D?D:f.autoOptionFocus?fe():f.editable?-1:de()),C(!0)},Ae=function(){C(!1),P.current=!1},qe=function(){c.DomHandler.alignOverlay(R.current,A.current.parentElement,f.appendTo||d&&d.appendTo||w.default.appendTo)},Ve=function(){var e=c.DomHandler.findSingle(R.current,'li[data-p-focused="true"]');if(e&&e.scrollIntoView)e.scrollIntoView({block:"nearest",inline:"nearest"});else{var t=c.DomHandler.findSingle(R.current,'li[data-p-highlight="true"]');t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}},Ke=function(e){A.current&&(A.current.value=e?Be(e):f.value||"",q.current&&(q.current.value=A.current.value))},Be=function(e){var t=c.ObjectUtils.resolveFieldData(e,f.optionLabel?f.optionLabel:"label");return c.ObjectUtils.isNotEmpty(t)?t:e},_e=function(e){var t=c.ObjectUtils.resolveFieldData(e,f.OptionValue?f.optionValue:"value");return c.ObjectUtils.isNotEmpty(t)?t:e},Je=function(e){return f.optionGroupLabel&&e.optionGroup&&e.group},Xe=function(e){return f.optionDisabled?c.ObjectUtils.isFunction(f.optionDisabled)?f.optionDisabled(e):c.ObjectUtils.resolveFieldData(e,f.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},ze=function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupChildren)},Ze=function(){if(f.editable&&A.current){var e=(rt?Be(rt):null)||f.value||"";A.current.value=e,q.current&&(q.current.value=e)}};y.useImperativeHandle(s,(function(){return{props:f,show:Ge,hide:Ae,clear:Pe,focus:function(){return c.DomHandler.focus(q.current)},getElement:function(){return U.current},getOverlay:function(){return R.current},getInput:function(){return A.current},getFocusInput:function(){return q.current},getVirtualScroller:function(){return K.current}}})),y.useEffect((function(){c.ObjectUtils.combinedRefs(A,f.inputRef),c.ObjectUtils.combinedRefs(q,f.focusInputRef)}),[A,f.inputRef,q,f.focusInputRef]),r.useMountEffect((function(){f.autoFocus&&c.DomHandler.focus(q.current,f.autoFocus),qe()})),r.useUpdateEffect((function(){N&&(f.value||D>=0)&&Ve()}),[N,f.value,D]),r.useUpdateEffect((function(){N&&v&&f.filter&&qe()}),[N,v,f.filter]),r.useUpdateEffect((function(){!v||f.options&&0!==f.options.length||b(""),Ze(),A.current&&(A.current.selectedIndex=1)})),r.useUnmountEffect((function(){c.ZIndexUtils.clear(R.current)}));var We,$e,Ye,Qe,et,tt=function(e){"Enter"!==e.key&&"Space"!==e.code||(Pe(e),e.preventDefault())},nt=function(){var e=f.optionGroupLabel?ne(f.options):f.options;if(X&&!J){var n=v.trim().toLocaleLowerCase(f.filterLocale),r=f.filterBy?f.filterBy.split(","):[f.optionLabel||"label"];if(f.optionGroupLabel){var o,l=[],i=H(f.options);try{for(i.s();!(o=i.n()).done;){var a=o.value,u=t.FilterService.filter(ze(a),r,n,f.filterMatchMode,f.filterLocale);u&&u.length&&l.push(V(V({},a),S({},"".concat(f.optionGroupChildren),u)))}}catch(e){i.e(e)}finally{i.f()}return ne(l)}return t.FilterService.filter(e,r,n,f.filterMatchMode,f.filterLocale)}return e}(),rt=-1!==(We=Re(f.options))?f.optionGroupLabel?ze(f.options[We.group])[We.option]:f.options[We]:null,ot=c.ObjectUtils.isNotEmpty(f.tooltip),lt=L.getOtherProps(f),it=c.ObjectUtils.reduceKeys(lt,c.DomHandler.ARIA_PROPS),at=function(){var e={value:"",label:f.placeholder};if(rt){var t=_e(rt);e={value:"object"===I(t)?f.options.findIndex((function(e){return e===t})):t,label:Be(rt)}}var n=p({className:"p-hidden-accessible p-dropdown-hidden-select"},W("hiddenSelectedMessage")),r=p({ref:A,required:f.required,defaultValue:e.value,name:f.name,tabIndex:-1,"aria-hidden":"true"},W("select")),o=p({value:e.value},W("option"));return y.createElement("div",n,y.createElement("select",r,y.createElement("option",o,e.label)))}(),ut=function(){var e=c.ObjectUtils.isNotEmpty(rt)?Be(rt):null;f.editable&&(e=e||f.value||"");var t=p({className:"p-hidden-accessible"},W("hiddenSelectedMessage")),n=p(V({ref:q,id:f.inputId,defaultValue:e,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:oe,onBlur:le,onKeyDown:ae,disabled:f.disabled,tabIndex:f.disabled?-1:f.tabIndex||0},it),W("input"));return y.createElement("div",t,y.createElement("input",n))}(),ct=function(){var e=c.ObjectUtils.isNotEmpty(rt)?Be(rt):null;if(f.editable){var t=p(V({ref:A,type:"text",defaultValue:e||f.value||"",className:$("input",{label:e}),disabled:f.disabled,placeholder:f.placeholder,maxLength:f.maxLength,onInput:Ce,onFocus:ke,onKeyDown:ae,onBlur:le,tabIndex:f.disabled?-1:f.tabIndex||0,"aria-haspopup":"listbox"},it),W("input"));return y.createElement("input",t)}var n=f.valueTemplate?c.ObjectUtils.getJSXElement(f.valueTemplate,rt,f):e||f.placeholder||f.emptyMessage||y.createElement(y.Fragment,null," "),r=p({ref:A,className:$("input",{label:e}),tabIndex:"-1"},W("input"));return y.createElement("span",r,n)}(),st=f.loading?($e=p({className:$("loadingIcon"),"data-pr-overlay-visible":N},W("loadingIcon")),Ye=c.IconUtils.getJSXIcon(f.loadingIcon||y.createElement(l.SpinnerIcon,{spin:!0}),V({},$e),{props:f}),Qe=f.placeholder||f.ariaLabel,et=p({className:$("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":N,"aria-label":Qe},W("trigger")),y.createElement("div",et,Ye)):function(){var e=p({className:$("dropdownIcon"),"data-pr-overlay-visible":N},W("dropdownIcon")),t=c.IconUtils.getJSXIcon(f.dropdownIcon||y.createElement(o.ChevronDownIcon,e),V({},e),{props:f}),n=f.placeholder||f.ariaLabel,r=p({className:$("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":N,"aria-label":n},W("trigger"));return y.createElement("div",r,t)}(),pt=function(){if(null!=f.value&&f.showClear&&!f.disabled){var e=p({className:$("clearIcon"),onPointerUp:Pe,tabIndex:f.tabIndex||"0",onKeyDown:tt,"aria-label":t.localeOption("clear")},W("clearIcon"));return c.IconUtils.getJSXIcon(f.clearIcon||y.createElement(i.TimesIcon,e),V({},e),{props:f})}return null}(),dt=p({id:f.id,ref:U,className:c.classNames(f.className,$("root",{context:d,focusedState:h,overlayVisibleState:N})),style:f.style,onClick:function(e){return t=e,void(f.disabled||f.loading||(f.onClick&&f.onClick(t),t.defaultPrevented||re(t)||"INPUT"===t.target.tagName||(R.current&&R.current&&R.current.contains(t.target)||(c.DomHandler.focus(q.current),N?Ae():Ge()),P.current=!0)));var t},onMouseDown:f.onMouseDown,onContextMenu:f.onContextMenu,onFocus:function(){f.editable&&!N&&!1===P.current&&c.DomHandler.focus(A.current)},"data-p-disabled":f.disabled,"data-p-focus":h},lt,W("root")),ft=p({ref:T,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===q.current?c.DomHandler.getFirstFocusableElement(R.current,':not([data-p-hidden-focusable="true"])'):q.current;c.DomHandler.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},W("hiddenFirstFocusableEl")),mt=p({ref:G,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===q.current?c.DomHandler.getLastFocusableElement(R.current,':not([data-p-hidden-focusable="true"])'):q.current;c.DomHandler.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},W("hiddenLastFocusableEl"));return y.createElement(y.Fragment,null,y.createElement("div",dt,ut,at,ct,pt,st,y.createElement(M,O({hostName:"Dropdown",ref:R,visibleOptions:nt,virtualScrollerRef:K},f,{appendTo:z,cx:$,filterValue:v,focusedOptionIndex:D,getOptionGroupChildren:ze,getOptionGroupLabel:function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupLabel)},getOptionGroupRenderKey:function(e){return c.ObjectUtils.resolveFieldData(e,f.optionGroupLabel)},getOptionLabel:Be,getOptionRenderKey:function(e){return f.dataKey?c.ObjectUtils.resolveFieldData(e,f.dataKey):Be(e)},getSelectedOptionIndex:Re,hasFilter:X,in:N,isOptionDisabled:Xe,isSelected:He,onClick:function(e){a.OverlayService.emit("overlay-click",{originalEvent:e,target:U.current})},onEnter:function(e){c.ZIndexUtils.set("overlay",R.current,d&&d.autoZIndex||w.default.autoZIndex,d&&d.zIndex.overlay||w.default.zIndex.overlay),c.DomHandler.addStyles(R.current,{position:"absolute",top:"0",left:"0"}),qe(),e&&e()},onEntered:function(e){e&&e(),ee(),f.onShow&&f.onShow()},onExit:function(){te()},onExited:function(){f.filter&&f.resetFilterOnHide&&Le(),c.ZIndexUtils.clear(R.current),f.onHide&&f.onHide()},onFilterClearIconClick:function(e){Le(e)},onFilterInputChange:function(e){var t=e.target.value;b(t),f.onFilter&&f.onFilter({originalEvent:e,filter:t})},onFilterInputKeyDown:function(e){switch(e.code){case"ArrowDown":he(e);break;case"ArrowUp":ye(e);break;case"ArrowLeft":case"ArrowRight":we(e,!0);break;case"Escape":case"Enter":case"NumpadEnter":De(e),e.preventDefault()}},onOptionClick:function(e){e.option.disabled||(Ue(e),c.DomHandler.focus(q.current)),Ae()},ptm:W,resetFilter:Le,changeFocusedOptionIndex:ge,firstFocusableElement:y.createElement("span",ft),lastFocusableElement:y.createElement("span",mt),sx:Y}))),ot&&y.createElement(u.Tooltip,O({target:U,content:f.tooltip,pt:W("tooltip")},f.tooltipOptions)))})));K.displayName="Dropdown",exports.Dropdown=K;
|
package/dropdown/dropdown.esm.js
CHANGED
|
@@ -386,7 +386,7 @@ var DropdownItem = /*#__PURE__*/React.memo(function (props) {
|
|
|
386
386
|
if (selected) {
|
|
387
387
|
var checkIconProps = mergeProps({
|
|
388
388
|
className: cx('checkIcon')
|
|
389
|
-
}, getPTOptions('
|
|
389
|
+
}, getPTOptions('checkIcon'));
|
|
390
390
|
return /*#__PURE__*/React.createElement(CheckIcon, checkIconProps);
|
|
391
391
|
}
|
|
392
392
|
var blankIconProps = mergeProps({
|
|
@@ -473,7 +473,7 @@ var DropdownPanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(funct
|
|
|
473
473
|
height: scrollerOptions.props ? scrollerOptions.props.itemSize : undefined
|
|
474
474
|
};
|
|
475
475
|
style = _objectSpread$1(_objectSpread$1({}, style), option.style);
|
|
476
|
-
if (option.group && props.optionGroupLabel) {
|
|
476
|
+
if (option.group && option.optionGroup && props.optionGroupLabel) {
|
|
477
477
|
var optionGroupLabel = props.optionGroupLabel;
|
|
478
478
|
var groupContent = props.optionGroupTemplate ? ObjectUtils.getJSXElement(props.optionGroupTemplate, option, index) : props.getOptionGroupLabel(option);
|
|
479
479
|
var key = index + '_' + props.getOptionGroupRenderKey(option);
|
|
@@ -854,10 +854,9 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
854
854
|
};
|
|
855
855
|
var onOptionSelect = function onOptionSelect(event, option) {
|
|
856
856
|
var isHide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
857
|
-
var value = getOptionValue(option);
|
|
858
857
|
selectItem({
|
|
859
858
|
originalEvent: event,
|
|
860
|
-
option:
|
|
859
|
+
option: option
|
|
861
860
|
});
|
|
862
861
|
isHide && hide();
|
|
863
862
|
};
|
|
@@ -1140,8 +1139,9 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
1140
1139
|
}
|
|
1141
1140
|
};
|
|
1142
1141
|
var onEditableInputChange = function onEditableInputChange(event) {
|
|
1142
|
+
!overlayVisibleState && show();
|
|
1143
1143
|
var searchIndex = null;
|
|
1144
|
-
if (event.target.value) {
|
|
1144
|
+
if (event.target.value && visibleOptions) {
|
|
1145
1145
|
searchIndex = visibleOptions.findIndex(function (item) {
|
|
1146
1146
|
return getOptionLabel(item).toLocaleLowerCase().startsWith(event.target.value.toLocaleLowerCase());
|
|
1147
1147
|
});
|
|
@@ -1347,10 +1347,12 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
1347
1347
|
}
|
|
1348
1348
|
};
|
|
1349
1349
|
var getOptionLabel = function getOptionLabel(option) {
|
|
1350
|
-
|
|
1350
|
+
var optionLabel = props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : ObjectUtils.resolveFieldData(option, 'label');
|
|
1351
|
+
return ObjectUtils.isNotEmpty(optionLabel) ? optionLabel : option;
|
|
1351
1352
|
};
|
|
1352
1353
|
var getOptionValue = function getOptionValue(option) {
|
|
1353
|
-
|
|
1354
|
+
var optionValue = props.OptionValue ? ObjectUtils.resolveFieldData(option, props.optionValue) : ObjectUtils.resolveFieldData(option, 'value');
|
|
1355
|
+
return ObjectUtils.isNotEmpty(optionValue) ? optionValue : option;
|
|
1354
1356
|
};
|
|
1355
1357
|
var getOptionRenderKey = function getOptionRenderKey(option) {
|
|
1356
1358
|
return props.dataKey ? ObjectUtils.resolveFieldData(option, props.dataKey) : getOptionLabel(option);
|
|
@@ -1523,7 +1525,7 @@ var Dropdown = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
|
1523
1525
|
}, ariaProps), ptm('input'));
|
|
1524
1526
|
return /*#__PURE__*/React.createElement("input", _inputProps);
|
|
1525
1527
|
}
|
|
1526
|
-
var content = props.valueTemplate ? ObjectUtils.getJSXElement(props.valueTemplate, selectedOption, props) : label || props.placeholder ||
|
|
1528
|
+
var content = props.valueTemplate ? ObjectUtils.getJSXElement(props.valueTemplate, selectedOption, props) : label || props.placeholder || props.emptyMessage || /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0");
|
|
1527
1529
|
var inputProps = mergeProps({
|
|
1528
1530
|
ref: inputRef,
|
|
1529
1531
|
className: cx('input', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t,{PrimeReactContext as n,localeOption as r,FilterService as o}from"primereact/api";import{ComponentBase as l,useHandleStyle as i}from"primereact/componentbase";import{useMergeProps as a,useOverlayListener as u,useMountEffect as c,useUpdateEffect as p,useUnmountEffect as s}from"primereact/hooks";import{ChevronDownIcon as d}from"primereact/icons/chevrondown";import{SpinnerIcon as f}from"primereact/icons/spinner";import{TimesIcon as m}from"primereact/icons/times";import{OverlayService as v}from"primereact/overlayservice";import{Tooltip as b}from"primereact/tooltip";import{classNames as g,ObjectUtils as h,DomHandler as y,IconUtils as w,ZIndexUtils as E}from"primereact/utils";import{CSSTransition as I}from"primereact/csstransition";import{SearchIcon as O}from"primereact/icons/search";import{Portal as x}from"primereact/portal";import{VirtualScroller as S}from"primereact/virtualscroller";import{Ripple as F}from"primereact/ripple";import{CheckIcon as k}from"primereact/icons/check";import{IconBase as C}from"primereact/iconbase";function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function L(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=L(e,"string");return"symbol"===N(t)?t:String(t)}function R(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){if(Array.isArray(e))return e}function j(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function G(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function A(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,t){return T(e)||j(e,t)||G(e,t)||A()}var V=l.extend({defaultProps:{__TYPE:"Dropdown",__parentMetadata:null,appendTo:null,ariaLabel:null,ariaLabelledBy:null,autoFocus:!1,children:void 0,className:null,clearIcon:null,dataKey:null,disabled:!1,dropdownIcon:null,editable:!1,emptyFilterMessage:null,highlightOnSelect:!0,checkmark:!1,emptyMessage:null,filter:!1,filterBy:null,filterClearIcon:null,filterIcon:null,filterInputAutoFocus:!1,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,focusInputRef:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,itemTemplate:null,loading:!1,loadingIcon:null,maxLength:null,name:null,onBlur:null,onChange:null,onContextMenu:null,onFilter:null,onFocus:null,onHide:null,onMouseDown:null,onShow:null,optionDisabled:null,optionGroupChildren:"items",selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,panelClassName:null,panelFooterTemplate:null,panelStyle:null,placeholder:null,required:!1,resetFilterOnHide:!1,scrollHeight:"200px",showClear:!1,showFilterClear:!1,showOnFocus:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,value:null,valueTemplate:null,virtualScrollerOptions:null},css:{classes:{root:function(e){var t=e.props,n=e.focusedState,r=e.overlayVisibleState,o=e.context;return g("p-dropdown p-component p-inputwrapper",{"p-disabled":t.disabled,"p-invalid":t.invalid,"p-focus":n,"p-variant-filled":t.variant?"filled"===t.variant:o&&"filled"===o.inputStyle,"p-dropdown-clearable":t.showClear&&!t.disabled,"p-inputwrapper-filled":h.isNotEmpty(t.value),"p-inputwrapper-focus":n||r})},input:function(e){var t=e.props,n=e.label;return t.editable?"p-dropdown-label p-inputtext":g("p-dropdown-label p-inputtext",{"p-placeholder":null===n&&t.placeholder,"p-dropdown-label-empty":null===n&&!t.placeholder})},trigger:"p-dropdown-trigger",emptyMessage:"p-dropdown-empty-message",itemGroup:function(e){var t=e.optionGroupLabel;return g("p-dropdown-item-group",{"p-dropdown-item-empty":!t||0===t.length})},itemGroupLabel:"p-dropdown-item-group-label",dropdownIcon:"p-dropdown-trigger-icon p-clickable",loadingIcon:"p-dropdown-trigger-icon p-clickable",clearIcon:"p-dropdown-clear-icon p-clickable",filterIcon:"p-dropdown-filter-icon",filterClearIcon:"p-dropdown-filter-clear-icon",filterContainer:function(e){return g("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!e.clearIcon})},filterInput:function(e){var t=e.props,n=e.context;return g("p-dropdown-filter p-inputtext p-component",{"p-variant-filled":t.variant?"filled"===t.variant:n&&"filled"===n.inputStyle})},list:function(e){return"p-dropdown-items"},panel:function(e){var n=e.context;return g("p-dropdown-panel p-component",{"p-input-filled":n&&"filled"===n.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===t.ripple})},item:function(e){var t=e.label;return g("p-dropdown-item",{"p-highlight":e.selected&&e.highlightOnSelect,"p-disabled":e.disabled,"p-focus":e.index===e.focusedOptionIndex,"p-dropdown-item-empty":!t||0===t.length})},itemLabel:"p-dropdown-item-label",checkIcon:"p-dropdown-check-icon",blankIcon:"p-dropdown-blank-icon",wrapper:"p-dropdown-items-wrapper",header:"p-dropdown-header",footer:"p-dropdown-footer",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n input.p-dropdown-label {\n cursor: default;\n }\n \n .p-dropdown .p-dropdown-panel {\n min-width: 100%;\n }\n \n .p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-dropdown-items-wrapper {\n overflow: auto;\n }\n \n .p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-dropdown-filter {\n width: 100%;\n }\n \n .p-dropdown-filter-container {\n position: relative;\n }\n \n .p-dropdown-clear-icon,\n .p-dropdown-filter-icon,\n .p-dropdown-filter-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-dropdown {\n display: flex;\n }\n \n .p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n }\n}\n",inlineStyles:{wrapper:function(e){return{maxHeight:e.props.scrollHeight||"auto"}},panel:function(e){}}}}),H=e.memo(e.forwardRef((function(t,n){var r=C.getPTI(t);return e.createElement("svg",D({ref:n,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),e.createElement("rect",{width:"1",height:"1",fill:"currentColor",fillOpacity:"0"}))})));H.displayName="BlankIcon";var B=e.memo((function(t){var n=a(),r=t.ptm,o=t.cx,l=t.selected,i=t.disabled,u=t.option,c=t.label,p=t.index,s=t.focusedOptionIndex,d=t.checkmark,f=t.highlightOnSelect,m=function(e){return r(e,{context:{selected:l,disabled:i}})},v=t.template?h.getJSXElement(t.template,t.option):t.label,b=n({role:"option",key:t.label,className:g(u.className,o("item",{selected:l,disabled:i,label:c,index:p,focusedOptionIndex:s,highlightOnSelect:f})),style:t.style,onClick:function(e){return n=e,void(t.onClick&&t.onClick({originalEvent:n,option:u}));var n},onMouseMove:function(e){return null==t?void 0:t.onMouseMove(e,p)},"aria-label":c,"aria-selected":l,"data-p-highlight":l,"data-p-focused":s===p,"data-p-disabled":i},m("item")),y=n({className:o("itemLabel")},m("itemLabel"));return e.createElement("li",b,d&&function(){if(l){var t=n({className:o("checkIcon")},m("checIcon"));return e.createElement(k,t)}var r=n({className:o("blankIcon")},m("blankIcon"));return e.createElement(H,r)}(),e.createElement("span",y,v),e.createElement(F,null))}));function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}B.displayName="DropdownItem";var _=e.memo(e.forwardRef((function(t,o){var l,i,u,c,p,s=a(),d=t.ptm,f=t.cx,v=t.sx,b=e.useContext(n),E=e.useRef(null),F=!(t.visibleOptions&&t.visibleOptions.length)&&t.hasFilter,k={filter:function(e){return P(e)},reset:function(){return t.resetFilter()}},C=function(e,n){return d(e,X({hostName:t.hostName},n))},N=function(){t.onEnter((function(){if(t.virtualScrollerRef.current){var e=t.getSelectedOptionIndex();-1!==e&&setTimeout((function(){return t.virtualScrollerRef.current.scrollToIndex(e)}),0)}}))},L=function(){t.onEntered((function(){t.filter&&t.filterInputAutoFocus&&y.focus(E.current,!1)}))},P=function(e){t.virtualScrollerRef.current&&t.virtualScrollerRef.current.scrollToIndex(0),t.onFilterInputChange&&t.onFilterInputChange(e)},R=function(){if(t.panelFooterTemplate){var n=h.getJSXElement(t.panelFooterTemplate,t,t.onOverlayHide),r=s({className:f("footer")},C("footer"));return e.createElement("div",r,n)}return null},T=function(e,n){var r;t.focusOnHover&&(null==t||null===(r=t.changeFocusedOptionIndex)||void 0===r||r.call(t,e,n))},j=function(n,o){var l=h.getJSXElement(n,t)||r(o?"emptyFilterMessage":"emptyMessage"),i=s({className:f("emptyMessage")},C("emptyMessage"));return e.createElement("li",i,l)},M=function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l={height:o.props?o.props.itemSize:void 0};if(l=X(X({},l),n.style),n.group&&t.optionGroupLabel){var i=t.optionGroupLabel,a=t.optionGroupTemplate?h.getJSXElement(t.optionGroupTemplate,n,r):t.getOptionGroupLabel(n),u=r+"_"+t.getOptionGroupRenderKey(n),c=s({className:f("itemGroup",{optionGroupLabel:i}),style:l,"data-p-highlight":t.selected},C("itemGroup")),p=s({className:f("itemGroupLabel")},C("itemGroupLabel"));return e.createElement("li",D({key:u},c),e.createElement("span",p,a))}var m=t.getOptionRenderKey(n)+"_"+r,v=t.getOptionLabel(n),b=t.isOptionDisabled(n);return e.createElement(B,{key:m,label:v,index:r,focusedOptionIndex:t.focusedOptionIndex,option:n,style:l,template:t.itemTemplate,selected:t.isSelected(n),highlightOnSelect:t.highlightOnSelect,disabled:b,onClick:t.onOptionClick,onMouseMove:T,ptm:d,cx:f,checkmark:t.checkmark})},G=function(){if(t.showFilterClear&&t.filterValue){var n=r("clear"),o=s({className:f("filterClearIcon"),"aria-label":n,onClick:function(){return t.onFilterClearIconClick((function(){return y.focus(E.current)}))}},C("filterClearIcon"));return w.getJSXIcon(t.filterClearIcon||e.createElement(m,o),X({},o),{props:t})}return null},A=function(){if(t.filter){var n=G(),r=s({className:f("filterIcon")},C("filterIcon")),o=w.getJSXIcon(t.filterIcon||e.createElement(O,r),X({},r),{props:t}),l=s({className:f("filterContainer",{clearIcon:n})},C("filterContainer")),i=s({ref:E,type:"text",autoComplete:"off",className:f("filterInput",{context:b}),placeholder:t.filterPlaceholder,onKeyDown:t.onFilterInputKeyDown,onChange:function(e){return P(e)},value:t.filterValue},C("filterInput")),a=e.createElement("div",l,e.createElement("input",i),n,o);if(t.filterTemplate){var u={className:g("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n}),element:a,filterOptions:k,filterInputKeyDown:t.onFilterInputKeyDown,filterInputChange:P,filterIconClassName:"p-dropdown-filter-icon",clearIcon:n,props:t};a=h.getJSXElement(t.filterTemplate,u)}var c=s({className:f("header")},C("header"));return e.createElement("div",c,a)}return null},K=function(){if(t.virtualScrollerOptions){var n=X(X({},t.virtualScrollerOptions),{style:X(X({},t.virtualScrollerOptions.style),{height:t.scrollHeight}),className:g("p-dropdown-items-wrapper",t.virtualScrollerOptions.className),items:t.visibleOptions,autoSize:!0,onLazyLoad:function(e){return t.virtualScrollerOptions.onLazyLoad(X(X({},e),{filter:t.filterValue}))},itemTemplate:function(e,t){return e&&M(e,t.index,t)},contentTemplate:function(n){var r=F?j(t.hasFilter?t.emptyFilterMessage:t.emptyMessage):n.children,o=s({ref:n.contentRef,style:n.style,className:g(n.className,f("list",{virtualScrollerProps:t.virtualScrollerOptions})),role:"listbox"},C("list"));return e.createElement("ul",o,r)}});return e.createElement(S,D({ref:t.virtualScrollerRef},n,{pt:d("virtualScroller")}))}var r=h.isNotEmpty(t.visibleOptions)?t.visibleOptions.map(M):t.hasFilter?j(t.emptyFilterMessage,!0):j(t.emptyMessage),o=s({className:f("wrapper"),style:v("wrapper")},C("wrapper")),l=s({className:f("list"),role:"listbox"},C("list"));return e.createElement("div",o,e.createElement("ul",l,r))},V=(l=A(),i=K(),u=R(),c=s({className:g(t.panelClassName,f("panel",{context:b})),style:v("panel"),onClick:t.onClick},C("panel")),p=s({classNames:f("transition"),in:t.in,timeout:{enter:120,exit:100},options:t.transitionOptions,unmountOnExit:!0,onEnter:N,onEntered:L,onExit:t.onExit,onExited:t.onExited},C("transition")),e.createElement(I,D({nodeRef:o},p),e.createElement("div",D({ref:o},c),t.firstFocusableElement,l,i,u,t.lastFocusableElement)));return e.createElement(x,{element:V,appendTo:t.appendTo})})));function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=q(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 l,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,l=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw l}}}}function q(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}_.displayName="DropdownPanel";var $=e.memo(e.forwardRef((function(l,I){var O=a(),x=e.useContext(n),S=V.getProps(l,x),F=K(e.useState(""),2),k=F[0],C=F[1],L=K(e.useState(!1),2),P=L[0],T=L[1],j=K(e.useState(-1),2),M=j[0],G=j[1],A=K(e.useState(!1),2),H=A[0],B=A[1],J=e.useRef(!1),X=e.useRef(null),q=e.useRef(null),z=e.useRef(null),W=e.useRef(null),$=e.useRef(S.inputRef),Y=e.useRef(S.focusInputRef),Q=e.useRef(null),ee=e.useRef(null),te=e.useRef(null);e.useRef(null);var ne=S.virtualScrollerOptions&&S.virtualScrollerOptions.lazy,re=h.isNotEmpty(k),oe=S.appendTo||x&&x.appendTo||t.appendTo,le=V.setMetaData(Z(Z({props:S},S.__parentMetadata),{},{state:{filter:k,focused:P,overlayVisible:H}})),ie=le.ptm,ae=le.cx,ue=le.sx;i(V.css.styles,le.isUnstyled,{name:"dropdown"});var ce=K(u({target:X,overlay:q,listener:function(e,t){t.valid&&("outside"===t.type?!fe(e)&&Ze():Ze())},when:H}),2),pe=ce[0],se=ce[1],de=function(e){return(e||[]).reduce((function(e,t,n){e.push({optionGroup:t,group:!0,index:n,code:t.code,label:t.label});var r=ot(t);return r&&r.forEach((function(t){return e.push(t)})),e}),[])},fe=function(e){return y.isAttributeEquals(e.target,"data-pc-section","clearicon")||y.isAttributeEquals(e.target.parentElement||e.target,"data-pc-section","filterclearicon")},me=function(e){S.showOnFocus&&!H&&We(),T(!0),S.onFocus&&S.onFocus(e)},ve=function(e){T(!1),S.onBlur&&setTimeout((function(){var t=$.current?$.current.value:void 0;S.onBlur({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:t}})}),200)},be=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=tt(t);Xe({originalEvent:e,option:r}),n&&Ze()},ge=function(e){if(S.disabled||y.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":Ce(e);break;case"ArrowUp":De(e);break;case"ArrowLeft":case"ArrowRight":Ne(e,S.editable);break;case"Home":Le(e);break;case"End":Pe(e);break;case"PageDown":Te(e);break;case"PageUp":Re(e);break;case"Space":je(e,S.editable);break;case"NumpadEnter":case"Enter":Me(e);break;case"Escape":Ge(e);break;case"Tab":Ae(e);break;case"Backspace":Ke(e,S.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&h.isPrintableCharacter(e.key)&&(!H&&!S.editable&&We(),!S.editable&&xe(e,e.key))}J.current=!1}},he=function(e){var t;return ye(e)&&(null===(t=et(e))||void 0===t?void 0:t.toLocaleLowerCase(S.filterLocale).startsWith(te.current.toLocaleLowerCase(S.filterLocale)))},ye=function(e){return h.isNotEmpty(e)&&!(rt(e)||nt(e))},we=function(){return h.isNotEmpty(S.value)},Ee=function(e){return ye(e)&&ze(e)},Ie=function(){return we?dt.findIndex((function(e){return Ee(e)})):-1},Oe=function(){var e=Ie();return e<0?Se():e},xe=function(e,t){te.current=(te.current||"")+t;var n=-1,r=!1;return h.isNotEmpty(te.current)&&(-1!==(n=-1!==M?-1===(n=dt.slice(M).findIndex((function(e){return he(e)})))?dt.slice(0,M).findIndex((function(e){return he(e)})):n+M:dt.findIndex((function(e){return he(e)})))&&(r=!0),-1===n&&-1===M&&(n=Oe()),-1!==n&&ke(e,n)),ee.current&&clearTimeout(ee.current),ee.current=setTimeout((function(){te.current="",ee.current=null}),500),r},Se=function(){return dt.findIndex((function(e){return ye(e)}))},Fe=function(){return h.findLastIndex(dt,(function(e){return ye(e)}))},ke=function(e,t){M!==t&&(G(t),S.selectOnFocus&&be(e,dt[t],!1))},Ce=function(e){if(H){var t=-1!==M?(r=(n=M)<dt.length-1?dt.slice(n+1).findIndex((function(e){return ye(e)})):-1)>-1?r+n+1:n:J.current?Se():Oe();ke(e,t)}else We(),S.editable&&ke(e,Ie());var n,r;e.preventDefault()},De=function(e){var t,n,r;if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==M&&be(e,dt[M]),state.overlayVisible&&Ze(),e.preventDefault();else{var o=-1!==M?(r=(n=M)>0?h.findLastIndex(dt.slice(0,n),(function(e){return ye(e)})):-1)>-1?r:n:J.current?Fe():(t=Ie())<0?Fe():t;ke(e,o),!H&&We(),e.preventDefault()}},Ne=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&G(-1)},Le=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),G(-1)):(ke(e,Se()),!H&&We()),e.preventDefault()},Pe=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n),G(-1)}else ke(e,Fe()),!H&&We();e.preventDefault()},Re=function(e){e.preventDefault()},Te=function(e){e.preventDefault()},je=function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&Me(e)},Me=function(e){H?(-1!==M&&be(e,dt[M]),Ze()):(G(-1),Ce(e)),e.preventDefault()},Ge=function(e){H&&Ze(),e.preventDefault()},Ae=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(!H||y.getFocusableElements(q.current,':not([data-p-hidden-focusable="true"])').length>0?(-1!==M&&be(e,dt[M]),H&&Ze()):(y.focus(z.current),e.preventDefault()))},Ke=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!H&&We()},Ve=function(e){var t=null;e.target.value&&(t=dt.findIndex((function(t){return et(t).toLocaleLowerCase().startsWith(e.target.value.toLocaleLowerCase())}))),G(t),S.onChange&&S.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:e.target.value}})},He=function(e){T(!0),Ze(),S.onFocus&&S.onFocus(e)},Be=function(e){C(""),S.onFilter&&S.onFilter({filter:""}),e&&e()},Je=function(e){S.onChange&&S.onChange({originalEvent:e,value:void 0,stopPropagation:function(){null==e||e.stopPropagation()},preventDefault:function(){null==e||e.preventDefault()},target:{name:S.name,id:S.id,value:void 0}}),S.filter&&Be(),Qe()},Xe=function(e){if(ft!==e.option){Qe(e.option),G(-1);var t=tt(e.option),n=qe(e.option,dt);S.onChange&&S.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:t}}),ke(e.originalEvent,n)}},_e=function(e){if(e=e||dt,null!=S.value&&e){if(!S.optionGroupLabel)return qe(S.value,e);for(var t=0;t<e.length;t++){var n=qe(S.value,ot(e[t]));if(-1!==n)return{group:t,option:n}}}return-1},Ue=function(){return S.optionValue?null:S.dataKey},qe=function(e,t){var n=Ue();return t.findIndex((function(t){return h.equals(e,tt(t),n)}))},ze=function(e){return h.equals(S.value,tt(e),Ue())},We=function(){G(-1!==M?M:S.autoOptionFocus?Oe():S.editable?-1:Ie()),B(!0)},Ze=function(){B(!1),J.current=!1},$e=function(){y.alignOverlay(q.current,$.current.parentElement,S.appendTo||x&&x.appendTo||t.appendTo)},Ye=function(){var e=y.findSingle(q.current,'li[data-p-focused="true"]');if(e&&e.scrollIntoView)e.scrollIntoView({block:"nearest",inline:"nearest"});else{var t=y.findSingle(q.current,'li[data-p-highlight="true"]');t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}},Qe=function(e){$.current&&($.current.value=e?et(e):S.value||"",Y.current&&(Y.current.value=$.current.value))},et=function(e){return h.resolveFieldData(e,S.optionLabel?S.optionLabel:"label")},tt=function(e){return S.optionValue?h.resolveFieldData(e,S.optionValue):h.resolveFieldData(e,"value")||e},nt=function(e){return S.optionGroupLabel&&e.optionGroup&&e.group},rt=function(e){return S.optionDisabled?h.isFunction(S.optionDisabled)?S.optionDisabled(e):h.resolveFieldData(e,S.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},ot=function(e){return h.resolveFieldData(e,S.optionGroupChildren)},lt=function(){if(S.editable&&$.current){var e=(ft?et(ft):null)||S.value||"";$.current.value=e,Y.current&&(Y.current.value=e)}};e.useImperativeHandle(I,(function(){return{props:S,show:We,hide:Ze,clear:Je,focus:function(){return y.focus(Y.current)},getElement:function(){return X.current},getOverlay:function(){return q.current},getInput:function(){return $.current},getFocusInput:function(){return Y.current},getVirtualScroller:function(){return Q.current}}})),e.useEffect((function(){h.combinedRefs($,S.inputRef),h.combinedRefs(Y,S.focusInputRef)}),[$,S.inputRef,Y,S.focusInputRef]),c((function(){S.autoFocus&&y.focus(Y.current,S.autoFocus),$e()})),p((function(){H&&(S.value||M>=0)&&Ye()}),[H,S.value,M]),p((function(){H&&k&&S.filter&&$e()}),[H,k,S.filter]),p((function(){!k||S.options&&0!==S.options.length||C(""),lt(),$.current&&($.current.selectedIndex=1)})),s((function(){E.clear(q.current)}));var it,at,ut,ct,pt,st=function(e){"Enter"!==e.key&&"Space"!==e.code||(Je(e),e.preventDefault())},dt=function(){var e=S.optionGroupLabel?de(S.options):S.options;if(re&&!ne){var t=k.trim().toLocaleLowerCase(S.filterLocale),n=S.filterBy?S.filterBy.split(","):[S.optionLabel||"label"];if(S.optionGroupLabel){var r,l=[],i=U(S.options);try{for(i.s();!(r=i.n()).done;){var a=r.value,u=o.filter(ot(a),n,t,S.filterMatchMode,S.filterLocale);u&&u.length&&l.push(Z(Z({},a),R({},"".concat(S.optionGroupChildren),u)))}}catch(e){i.e(e)}finally{i.f()}return de(l)}return o.filter(e,n,t,S.filterMatchMode,S.filterLocale)}return e}(),ft=-1!==(it=_e(S.options))?S.optionGroupLabel?ot(S.options[it.group])[it.option]:S.options[it]:null,mt=h.isNotEmpty(S.tooltip),vt=V.getOtherProps(S),bt=h.reduceKeys(vt,y.ARIA_PROPS),gt=function(){var t={value:"",label:S.placeholder};if(ft){var n=tt(ft);t={value:"object"===N(n)?S.options.findIndex((function(e){return e===n})):n,label:et(ft)}}var r=O({className:"p-hidden-accessible p-dropdown-hidden-select"},ie("hiddenSelectedMessage")),o=O({ref:$,required:S.required,defaultValue:t.value,name:S.name,tabIndex:-1,"aria-hidden":"true"},ie("select")),l=O({value:t.value},ie("option"));return e.createElement("div",r,e.createElement("select",o,e.createElement("option",l,t.label)))}(),ht=function(){var t=h.isNotEmpty(ft)?et(ft):null;S.editable&&(t=t||S.value||"");var n=O({className:"p-hidden-accessible"},ie("hiddenSelectedMessage")),r=O(Z({ref:Y,id:S.inputId,defaultValue:t,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:me,onBlur:ve,onKeyDown:ge,disabled:S.disabled,tabIndex:S.disabled?-1:S.tabIndex||0},bt),ie("input"));return e.createElement("div",n,e.createElement("input",r))}(),yt=function(){var t=h.isNotEmpty(ft)?et(ft):null;if(S.editable){var n=O(Z({ref:$,type:"text",defaultValue:t||S.value||"",className:ae("input",{label:t}),disabled:S.disabled,placeholder:S.placeholder,maxLength:S.maxLength,onInput:Ve,onFocus:He,onKeyDown:ge,onBlur:ve,tabIndex:S.disabled?-1:S.tabIndex||0,"aria-haspopup":"listbox"},bt),ie("input"));return e.createElement("input",n)}var r=S.valueTemplate?h.getJSXElement(S.valueTemplate,ft,S):t||S.placeholder||"empty",o=O({ref:$,className:ae("input",{label:t}),tabIndex:"-1"},ie("input"));return e.createElement("span",o,r)}(),wt=S.loading?(at=O({className:ae("loadingIcon"),"data-pr-overlay-visible":H},ie("loadingIcon")),ut=w.getJSXIcon(S.loadingIcon||e.createElement(f,{spin:!0}),Z({},at),{props:S}),ct=S.placeholder||S.ariaLabel,pt=O({className:ae("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":H,"aria-label":ct},ie("trigger")),e.createElement("div",pt,ut)):function(){var t=O({className:ae("dropdownIcon"),"data-pr-overlay-visible":H},ie("dropdownIcon")),n=w.getJSXIcon(S.dropdownIcon||e.createElement(d,t),Z({},t),{props:S}),r=S.placeholder||S.ariaLabel,o=O({className:ae("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":H,"aria-label":r},ie("trigger"));return e.createElement("div",o,n)}(),Et=function(){if(null!=S.value&&S.showClear&&!S.disabled){var t=O({className:ae("clearIcon"),onPointerUp:Je,tabIndex:S.tabIndex||"0",onKeyDown:st,"aria-label":r("clear")},ie("clearIcon"));return w.getJSXIcon(S.clearIcon||e.createElement(m,t),Z({},t),{props:S})}return null}(),It=O({id:S.id,ref:X,className:g(S.className,ae("root",{context:x,focusedState:P,overlayVisibleState:H})),style:S.style,onClick:function(e){return t=e,void(S.disabled||S.loading||(S.onClick&&S.onClick(t),t.defaultPrevented||fe(t)||"INPUT"===t.target.tagName||(q.current&&q.current&&q.current.contains(t.target)||(y.focus(Y.current),H?Ze():We()),J.current=!0)));var t},onMouseDown:S.onMouseDown,onContextMenu:S.onContextMenu,onFocus:function(){S.editable&&!H&&!1===J.current&&y.focus($.current)},"data-p-disabled":S.disabled,"data-p-focus":P},vt,ie("root")),Ot=O({ref:z,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===Y.current?y.getFirstFocusableElement(q.current,':not([data-p-hidden-focusable="true"])'):Y.current;y.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},ie("hiddenFirstFocusableEl")),xt=O({ref:W,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===Y.current?y.getLastFocusableElement(q.current,':not([data-p-hidden-focusable="true"])'):Y.current;y.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},ie("hiddenLastFocusableEl"));return e.createElement(e.Fragment,null,e.createElement("div",It,ht,gt,yt,Et,wt,e.createElement(_,D({hostName:"Dropdown",ref:q,visibleOptions:dt,virtualScrollerRef:Q},S,{appendTo:oe,cx:ae,filterValue:k,focusedOptionIndex:M,getOptionGroupChildren:ot,getOptionGroupLabel:function(e){return h.resolveFieldData(e,S.optionGroupLabel)},getOptionGroupRenderKey:function(e){return h.resolveFieldData(e,S.optionGroupLabel)},getOptionLabel:et,getOptionRenderKey:function(e){return S.dataKey?h.resolveFieldData(e,S.dataKey):et(e)},getSelectedOptionIndex:_e,hasFilter:re,in:H,isOptionDisabled:rt,isSelected:ze,onClick:function(e){v.emit("overlay-click",{originalEvent:e,target:X.current})},onEnter:function(e){E.set("overlay",q.current,x&&x.autoZIndex||t.autoZIndex,x&&x.zIndex.overlay||t.zIndex.overlay),y.addStyles(q.current,{position:"absolute",top:"0",left:"0"}),$e(),e&&e()},onEntered:function(e){e&&e(),pe(),S.onShow&&S.onShow()},onExit:function(){se()},onExited:function(){S.filter&&S.resetFilterOnHide&&Be(),E.clear(q.current),S.onHide&&S.onHide()},onFilterClearIconClick:function(e){Be(e)},onFilterInputChange:function(e){var t=e.target.value;C(t),S.onFilter&&S.onFilter({originalEvent:e,filter:t})},onFilterInputKeyDown:function(e){switch(e.code){case"ArrowDown":Ce(e);break;case"ArrowUp":De(e);break;case"ArrowLeft":case"ArrowRight":Ne(e,!0);break;case"Escape":case"Enter":case"NumpadEnter":Me(e),e.preventDefault()}},onOptionClick:function(e){e.option.disabled||(Xe(e),y.focus(Y.current)),Ze()},ptm:ie,resetFilter:Be,changeFocusedOptionIndex:ke,firstFocusableElement:e.createElement("span",Ot),lastFocusableElement:e.createElement("span",xt),sx:ue}))),mt&&e.createElement(b,D({target:X,content:S.tooltip,pt:ie("tooltip")},S.tooltipOptions)))})));$.displayName="Dropdown";export{$ as Dropdown};
|
|
1
|
+
import*as e from"react";import t,{PrimeReactContext as n,localeOption as r,FilterService as o}from"primereact/api";import{ComponentBase as l,useHandleStyle as i}from"primereact/componentbase";import{useMergeProps as a,useOverlayListener as u,useMountEffect as c,useUpdateEffect as p,useUnmountEffect as s}from"primereact/hooks";import{ChevronDownIcon as d}from"primereact/icons/chevrondown";import{SpinnerIcon as f}from"primereact/icons/spinner";import{TimesIcon as m}from"primereact/icons/times";import{OverlayService as v}from"primereact/overlayservice";import{Tooltip as b}from"primereact/tooltip";import{classNames as g,ObjectUtils as h,DomHandler as y,IconUtils as w,ZIndexUtils as E}from"primereact/utils";import{CSSTransition as I}from"primereact/csstransition";import{SearchIcon as O}from"primereact/icons/search";import{Portal as x}from"primereact/portal";import{VirtualScroller as S}from"primereact/virtualscroller";import{Ripple as F}from"primereact/ripple";import{CheckIcon as k}from"primereact/icons/check";import{IconBase as C}from"primereact/iconbase";function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function L(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function P(e){var t=L(e,"string");return"symbol"===N(t)?t:String(t)}function R(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){if(Array.isArray(e))return e}function j(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function G(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function A(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,t){return T(e)||j(e,t)||G(e,t)||A()}var V=l.extend({defaultProps:{__TYPE:"Dropdown",__parentMetadata:null,appendTo:null,ariaLabel:null,ariaLabelledBy:null,autoFocus:!1,children:void 0,className:null,clearIcon:null,dataKey:null,disabled:!1,dropdownIcon:null,editable:!1,emptyFilterMessage:null,highlightOnSelect:!0,checkmark:!1,emptyMessage:null,filter:!1,filterBy:null,filterClearIcon:null,filterIcon:null,filterInputAutoFocus:!1,filterLocale:void 0,filterMatchMode:"contains",filterPlaceholder:null,filterTemplate:null,focusInputRef:null,id:null,inputId:null,inputRef:null,invalid:!1,variant:null,itemTemplate:null,loading:!1,loadingIcon:null,maxLength:null,name:null,onBlur:null,onChange:null,onContextMenu:null,onFilter:null,onFocus:null,onHide:null,onMouseDown:null,onShow:null,optionDisabled:null,optionGroupChildren:"items",selectOnFocus:!1,focusOnHover:!0,autoOptionFocus:!1,optionGroupLabel:null,optionGroupTemplate:null,optionLabel:null,optionValue:null,options:null,panelClassName:null,panelFooterTemplate:null,panelStyle:null,placeholder:null,required:!1,resetFilterOnHide:!1,scrollHeight:"200px",showClear:!1,showFilterClear:!1,showOnFocus:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,value:null,valueTemplate:null,virtualScrollerOptions:null},css:{classes:{root:function(e){var t=e.props,n=e.focusedState,r=e.overlayVisibleState,o=e.context;return g("p-dropdown p-component p-inputwrapper",{"p-disabled":t.disabled,"p-invalid":t.invalid,"p-focus":n,"p-variant-filled":t.variant?"filled"===t.variant:o&&"filled"===o.inputStyle,"p-dropdown-clearable":t.showClear&&!t.disabled,"p-inputwrapper-filled":h.isNotEmpty(t.value),"p-inputwrapper-focus":n||r})},input:function(e){var t=e.props,n=e.label;return t.editable?"p-dropdown-label p-inputtext":g("p-dropdown-label p-inputtext",{"p-placeholder":null===n&&t.placeholder,"p-dropdown-label-empty":null===n&&!t.placeholder})},trigger:"p-dropdown-trigger",emptyMessage:"p-dropdown-empty-message",itemGroup:function(e){var t=e.optionGroupLabel;return g("p-dropdown-item-group",{"p-dropdown-item-empty":!t||0===t.length})},itemGroupLabel:"p-dropdown-item-group-label",dropdownIcon:"p-dropdown-trigger-icon p-clickable",loadingIcon:"p-dropdown-trigger-icon p-clickable",clearIcon:"p-dropdown-clear-icon p-clickable",filterIcon:"p-dropdown-filter-icon",filterClearIcon:"p-dropdown-filter-clear-icon",filterContainer:function(e){return g("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!e.clearIcon})},filterInput:function(e){var t=e.props,n=e.context;return g("p-dropdown-filter p-inputtext p-component",{"p-variant-filled":t.variant?"filled"===t.variant:n&&"filled"===n.inputStyle})},list:function(e){return"p-dropdown-items"},panel:function(e){var n=e.context;return g("p-dropdown-panel p-component",{"p-input-filled":n&&"filled"===n.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===t.ripple})},item:function(e){var t=e.label;return g("p-dropdown-item",{"p-highlight":e.selected&&e.highlightOnSelect,"p-disabled":e.disabled,"p-focus":e.index===e.focusedOptionIndex,"p-dropdown-item-empty":!t||0===t.length})},itemLabel:"p-dropdown-item-label",checkIcon:"p-dropdown-check-icon",blankIcon:"p-dropdown-blank-icon",wrapper:"p-dropdown-items-wrapper",header:"p-dropdown-header",footer:"p-dropdown-footer",transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n }\n \n .p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n }\n \n .p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n }\n \n input.p-dropdown-label {\n cursor: default;\n }\n \n .p-dropdown .p-dropdown-panel {\n min-width: 100%;\n }\n \n .p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-dropdown-items-wrapper {\n overflow: auto;\n }\n \n .p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-dropdown-filter {\n width: 100%;\n }\n \n .p-dropdown-filter-container {\n position: relative;\n }\n \n .p-dropdown-clear-icon,\n .p-dropdown-filter-icon,\n .p-dropdown-filter-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-fluid .p-dropdown {\n display: flex;\n }\n \n .p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n }\n}\n",inlineStyles:{wrapper:function(e){return{maxHeight:e.props.scrollHeight||"auto"}},panel:function(e){}}}}),H=e.memo(e.forwardRef((function(t,n){var r=C.getPTI(t);return e.createElement("svg",D({ref:n,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),e.createElement("rect",{width:"1",height:"1",fill:"currentColor",fillOpacity:"0"}))})));H.displayName="BlankIcon";var B=e.memo((function(t){var n=a(),r=t.ptm,o=t.cx,l=t.selected,i=t.disabled,u=t.option,c=t.label,p=t.index,s=t.focusedOptionIndex,d=t.checkmark,f=t.highlightOnSelect,m=function(e){return r(e,{context:{selected:l,disabled:i}})},v=t.template?h.getJSXElement(t.template,t.option):t.label,b=n({role:"option",key:t.label,className:g(u.className,o("item",{selected:l,disabled:i,label:c,index:p,focusedOptionIndex:s,highlightOnSelect:f})),style:t.style,onClick:function(e){return n=e,void(t.onClick&&t.onClick({originalEvent:n,option:u}));var n},onMouseMove:function(e){return null==t?void 0:t.onMouseMove(e,p)},"aria-label":c,"aria-selected":l,"data-p-highlight":l,"data-p-focused":s===p,"data-p-disabled":i},m("item")),y=n({className:o("itemLabel")},m("itemLabel"));return e.createElement("li",b,d&&function(){if(l){var t=n({className:o("checkIcon")},m("checkIcon"));return e.createElement(k,t)}var r=n({className:o("blankIcon")},m("blankIcon"));return e.createElement(H,r)}(),e.createElement("span",y,v),e.createElement(F,null))}));function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}B.displayName="DropdownItem";var _=e.memo(e.forwardRef((function(t,o){var l,i,u,c,p,s=a(),d=t.ptm,f=t.cx,v=t.sx,b=e.useContext(n),E=e.useRef(null),F=!(t.visibleOptions&&t.visibleOptions.length)&&t.hasFilter,k={filter:function(e){return P(e)},reset:function(){return t.resetFilter()}},C=function(e,n){return d(e,X({hostName:t.hostName},n))},N=function(){t.onEnter((function(){if(t.virtualScrollerRef.current){var e=t.getSelectedOptionIndex();-1!==e&&setTimeout((function(){return t.virtualScrollerRef.current.scrollToIndex(e)}),0)}}))},L=function(){t.onEntered((function(){t.filter&&t.filterInputAutoFocus&&y.focus(E.current,!1)}))},P=function(e){t.virtualScrollerRef.current&&t.virtualScrollerRef.current.scrollToIndex(0),t.onFilterInputChange&&t.onFilterInputChange(e)},R=function(){if(t.panelFooterTemplate){var n=h.getJSXElement(t.panelFooterTemplate,t,t.onOverlayHide),r=s({className:f("footer")},C("footer"));return e.createElement("div",r,n)}return null},T=function(e,n){var r;t.focusOnHover&&(null==t||null===(r=t.changeFocusedOptionIndex)||void 0===r||r.call(t,e,n))},j=function(n,o){var l=h.getJSXElement(n,t)||r(o?"emptyFilterMessage":"emptyMessage"),i=s({className:f("emptyMessage")},C("emptyMessage"));return e.createElement("li",i,l)},M=function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l={height:o.props?o.props.itemSize:void 0};if(l=X(X({},l),n.style),n.group&&n.optionGroup&&t.optionGroupLabel){var i=t.optionGroupLabel,a=t.optionGroupTemplate?h.getJSXElement(t.optionGroupTemplate,n,r):t.getOptionGroupLabel(n),u=r+"_"+t.getOptionGroupRenderKey(n),c=s({className:f("itemGroup",{optionGroupLabel:i}),style:l,"data-p-highlight":t.selected},C("itemGroup")),p=s({className:f("itemGroupLabel")},C("itemGroupLabel"));return e.createElement("li",D({key:u},c),e.createElement("span",p,a))}var m=t.getOptionRenderKey(n)+"_"+r,v=t.getOptionLabel(n),b=t.isOptionDisabled(n);return e.createElement(B,{key:m,label:v,index:r,focusedOptionIndex:t.focusedOptionIndex,option:n,style:l,template:t.itemTemplate,selected:t.isSelected(n),highlightOnSelect:t.highlightOnSelect,disabled:b,onClick:t.onOptionClick,onMouseMove:T,ptm:d,cx:f,checkmark:t.checkmark})},G=function(){if(t.showFilterClear&&t.filterValue){var n=r("clear"),o=s({className:f("filterClearIcon"),"aria-label":n,onClick:function(){return t.onFilterClearIconClick((function(){return y.focus(E.current)}))}},C("filterClearIcon"));return w.getJSXIcon(t.filterClearIcon||e.createElement(m,o),X({},o),{props:t})}return null},A=function(){if(t.filter){var n=G(),r=s({className:f("filterIcon")},C("filterIcon")),o=w.getJSXIcon(t.filterIcon||e.createElement(O,r),X({},r),{props:t}),l=s({className:f("filterContainer",{clearIcon:n})},C("filterContainer")),i=s({ref:E,type:"text",autoComplete:"off",className:f("filterInput",{context:b}),placeholder:t.filterPlaceholder,onKeyDown:t.onFilterInputKeyDown,onChange:function(e){return P(e)},value:t.filterValue},C("filterInput")),a=e.createElement("div",l,e.createElement("input",i),n,o);if(t.filterTemplate){var u={className:g("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!n}),element:a,filterOptions:k,filterInputKeyDown:t.onFilterInputKeyDown,filterInputChange:P,filterIconClassName:"p-dropdown-filter-icon",clearIcon:n,props:t};a=h.getJSXElement(t.filterTemplate,u)}var c=s({className:f("header")},C("header"));return e.createElement("div",c,a)}return null},K=function(){if(t.virtualScrollerOptions){var n=X(X({},t.virtualScrollerOptions),{style:X(X({},t.virtualScrollerOptions.style),{height:t.scrollHeight}),className:g("p-dropdown-items-wrapper",t.virtualScrollerOptions.className),items:t.visibleOptions,autoSize:!0,onLazyLoad:function(e){return t.virtualScrollerOptions.onLazyLoad(X(X({},e),{filter:t.filterValue}))},itemTemplate:function(e,t){return e&&M(e,t.index,t)},contentTemplate:function(n){var r=F?j(t.hasFilter?t.emptyFilterMessage:t.emptyMessage):n.children,o=s({ref:n.contentRef,style:n.style,className:g(n.className,f("list",{virtualScrollerProps:t.virtualScrollerOptions})),role:"listbox"},C("list"));return e.createElement("ul",o,r)}});return e.createElement(S,D({ref:t.virtualScrollerRef},n,{pt:d("virtualScroller")}))}var r=h.isNotEmpty(t.visibleOptions)?t.visibleOptions.map(M):t.hasFilter?j(t.emptyFilterMessage,!0):j(t.emptyMessage),o=s({className:f("wrapper"),style:v("wrapper")},C("wrapper")),l=s({className:f("list"),role:"listbox"},C("list"));return e.createElement("div",o,e.createElement("ul",l,r))},V=(l=A(),i=K(),u=R(),c=s({className:g(t.panelClassName,f("panel",{context:b})),style:v("panel"),onClick:t.onClick},C("panel")),p=s({classNames:f("transition"),in:t.in,timeout:{enter:120,exit:100},options:t.transitionOptions,unmountOnExit:!0,onEnter:N,onEntered:L,onExit:t.onExit,onExited:t.onExited},C("transition")),e.createElement(I,D({nodeRef:o},p),e.createElement("div",D({ref:o},c),t.firstFocusableElement,l,i,u,t.lastFocusableElement)));return e.createElement(x,{element:V,appendTo:t.appendTo})})));function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=q(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 l,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,l=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw l}}}}function q(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}_.displayName="DropdownPanel";var $=e.memo(e.forwardRef((function(l,I){var O=a(),x=e.useContext(n),S=V.getProps(l,x),F=K(e.useState(""),2),k=F[0],C=F[1],L=K(e.useState(!1),2),P=L[0],T=L[1],j=K(e.useState(-1),2),M=j[0],G=j[1],A=K(e.useState(!1),2),H=A[0],B=A[1],J=e.useRef(!1),X=e.useRef(null),q=e.useRef(null),z=e.useRef(null),W=e.useRef(null),$=e.useRef(S.inputRef),Y=e.useRef(S.focusInputRef),Q=e.useRef(null),ee=e.useRef(null),te=e.useRef(null);e.useRef(null);var ne=S.virtualScrollerOptions&&S.virtualScrollerOptions.lazy,re=h.isNotEmpty(k),oe=S.appendTo||x&&x.appendTo||t.appendTo,le=V.setMetaData(Z(Z({props:S},S.__parentMetadata),{},{state:{filter:k,focused:P,overlayVisible:H}})),ie=le.ptm,ae=le.cx,ue=le.sx;i(V.css.styles,le.isUnstyled,{name:"dropdown"});var ce=K(u({target:X,overlay:q,listener:function(e,t){t.valid&&("outside"===t.type?!fe(e)&&Ze():Ze())},when:H}),2),pe=ce[0],se=ce[1],de=function(e){return(e||[]).reduce((function(e,t,n){e.push({optionGroup:t,group:!0,index:n,code:t.code,label:t.label});var r=ot(t);return r&&r.forEach((function(t){return e.push(t)})),e}),[])},fe=function(e){return y.isAttributeEquals(e.target,"data-pc-section","clearicon")||y.isAttributeEquals(e.target.parentElement||e.target,"data-pc-section","filterclearicon")},me=function(e){S.showOnFocus&&!H&&We(),T(!0),S.onFocus&&S.onFocus(e)},ve=function(e){T(!1),S.onBlur&&setTimeout((function(){var t=$.current?$.current.value:void 0;S.onBlur({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:t}})}),200)},be=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Xe({originalEvent:e,option:t}),n&&Ze()},ge=function(e){if(S.disabled||y.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":Ce(e);break;case"ArrowUp":De(e);break;case"ArrowLeft":case"ArrowRight":Ne(e,S.editable);break;case"Home":Le(e);break;case"End":Pe(e);break;case"PageDown":Te(e);break;case"PageUp":Re(e);break;case"Space":je(e,S.editable);break;case"NumpadEnter":case"Enter":Me(e);break;case"Escape":Ge(e);break;case"Tab":Ae(e);break;case"Backspace":Ke(e,S.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&h.isPrintableCharacter(e.key)&&(!H&&!S.editable&&We(),!S.editable&&xe(e,e.key))}J.current=!1}},he=function(e){var t;return ye(e)&&(null===(t=et(e))||void 0===t?void 0:t.toLocaleLowerCase(S.filterLocale).startsWith(te.current.toLocaleLowerCase(S.filterLocale)))},ye=function(e){return h.isNotEmpty(e)&&!(rt(e)||nt(e))},we=function(){return h.isNotEmpty(S.value)},Ee=function(e){return ye(e)&&ze(e)},Ie=function(){return we?dt.findIndex((function(e){return Ee(e)})):-1},Oe=function(){var e=Ie();return e<0?Se():e},xe=function(e,t){te.current=(te.current||"")+t;var n=-1,r=!1;return h.isNotEmpty(te.current)&&(-1!==(n=-1!==M?-1===(n=dt.slice(M).findIndex((function(e){return he(e)})))?dt.slice(0,M).findIndex((function(e){return he(e)})):n+M:dt.findIndex((function(e){return he(e)})))&&(r=!0),-1===n&&-1===M&&(n=Oe()),-1!==n&&ke(e,n)),ee.current&&clearTimeout(ee.current),ee.current=setTimeout((function(){te.current="",ee.current=null}),500),r},Se=function(){return dt.findIndex((function(e){return ye(e)}))},Fe=function(){return h.findLastIndex(dt,(function(e){return ye(e)}))},ke=function(e,t){M!==t&&(G(t),S.selectOnFocus&&be(e,dt[t],!1))},Ce=function(e){if(H){var t=-1!==M?(r=(n=M)<dt.length-1?dt.slice(n+1).findIndex((function(e){return ye(e)})):-1)>-1?r+n+1:n:J.current?Se():Oe();ke(e,t)}else We(),S.editable&&ke(e,Ie());var n,r;e.preventDefault()},De=function(e){var t,n,r;if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==M&&be(e,dt[M]),state.overlayVisible&&Ze(),e.preventDefault();else{var o=-1!==M?(r=(n=M)>0?h.findLastIndex(dt.slice(0,n),(function(e){return ye(e)})):-1)>-1?r:n:J.current?Fe():(t=Ie())<0?Fe():t;ke(e,o),!H&&We(),e.preventDefault()}},Ne=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&G(-1)},Le=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),G(-1)):(ke(e,Se()),!H&&We()),e.preventDefault()},Pe=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n),G(-1)}else ke(e,Fe()),!H&&We();e.preventDefault()},Re=function(e){e.preventDefault()},Te=function(e){e.preventDefault()},je=function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&Me(e)},Me=function(e){H?(-1!==M&&be(e,dt[M]),Ze()):(G(-1),Ce(e)),e.preventDefault()},Ge=function(e){H&&Ze(),e.preventDefault()},Ae=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(!H||y.getFocusableElements(q.current,':not([data-p-hidden-focusable="true"])').length>0?(-1!==M&&be(e,dt[M]),H&&Ze()):(y.focus(z.current),e.preventDefault()))},Ke=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!H&&We()},Ve=function(e){!H&&We();var t=null;e.target.value&&dt&&(t=dt.findIndex((function(t){return et(t).toLocaleLowerCase().startsWith(e.target.value.toLocaleLowerCase())}))),G(t),S.onChange&&S.onChange({originalEvent:e.originalEvent,value:e.target.value,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:e.target.value}})},He=function(e){T(!0),Ze(),S.onFocus&&S.onFocus(e)},Be=function(e){C(""),S.onFilter&&S.onFilter({filter:""}),e&&e()},Je=function(e){S.onChange&&S.onChange({originalEvent:e,value:void 0,stopPropagation:function(){null==e||e.stopPropagation()},preventDefault:function(){null==e||e.preventDefault()},target:{name:S.name,id:S.id,value:void 0}}),S.filter&&Be(),Qe()},Xe=function(e){if(ft!==e.option){Qe(e.option),G(-1);var t=tt(e.option),n=qe(e.option,dt);S.onChange&&S.onChange({originalEvent:e.originalEvent,value:t,stopPropagation:function(){e.originalEvent.stopPropagation()},preventDefault:function(){e.originalEvent.preventDefault()},target:{name:S.name,id:S.id,value:t}}),ke(e.originalEvent,n)}},_e=function(e){if(e=e||dt,null!=S.value&&e){if(!S.optionGroupLabel)return qe(S.value,e);for(var t=0;t<e.length;t++){var n=qe(S.value,ot(e[t]));if(-1!==n)return{group:t,option:n}}}return-1},Ue=function(){return S.optionValue?null:S.dataKey},qe=function(e,t){var n=Ue();return t.findIndex((function(t){return h.equals(e,tt(t),n)}))},ze=function(e){return h.equals(S.value,tt(e),Ue())},We=function(){G(-1!==M?M:S.autoOptionFocus?Oe():S.editable?-1:Ie()),B(!0)},Ze=function(){B(!1),J.current=!1},$e=function(){y.alignOverlay(q.current,$.current.parentElement,S.appendTo||x&&x.appendTo||t.appendTo)},Ye=function(){var e=y.findSingle(q.current,'li[data-p-focused="true"]');if(e&&e.scrollIntoView)e.scrollIntoView({block:"nearest",inline:"nearest"});else{var t=y.findSingle(q.current,'li[data-p-highlight="true"]');t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}},Qe=function(e){$.current&&($.current.value=e?et(e):S.value||"",Y.current&&(Y.current.value=$.current.value))},et=function(e){var t=h.resolveFieldData(e,S.optionLabel?S.optionLabel:"label");return h.isNotEmpty(t)?t:e},tt=function(e){var t=h.resolveFieldData(e,S.OptionValue?S.optionValue:"value");return h.isNotEmpty(t)?t:e},nt=function(e){return S.optionGroupLabel&&e.optionGroup&&e.group},rt=function(e){return S.optionDisabled?h.isFunction(S.optionDisabled)?S.optionDisabled(e):h.resolveFieldData(e,S.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled},ot=function(e){return h.resolveFieldData(e,S.optionGroupChildren)},lt=function(){if(S.editable&&$.current){var e=(ft?et(ft):null)||S.value||"";$.current.value=e,Y.current&&(Y.current.value=e)}};e.useImperativeHandle(I,(function(){return{props:S,show:We,hide:Ze,clear:Je,focus:function(){return y.focus(Y.current)},getElement:function(){return X.current},getOverlay:function(){return q.current},getInput:function(){return $.current},getFocusInput:function(){return Y.current},getVirtualScroller:function(){return Q.current}}})),e.useEffect((function(){h.combinedRefs($,S.inputRef),h.combinedRefs(Y,S.focusInputRef)}),[$,S.inputRef,Y,S.focusInputRef]),c((function(){S.autoFocus&&y.focus(Y.current,S.autoFocus),$e()})),p((function(){H&&(S.value||M>=0)&&Ye()}),[H,S.value,M]),p((function(){H&&k&&S.filter&&$e()}),[H,k,S.filter]),p((function(){!k||S.options&&0!==S.options.length||C(""),lt(),$.current&&($.current.selectedIndex=1)})),s((function(){E.clear(q.current)}));var it,at,ut,ct,pt,st=function(e){"Enter"!==e.key&&"Space"!==e.code||(Je(e),e.preventDefault())},dt=function(){var e=S.optionGroupLabel?de(S.options):S.options;if(re&&!ne){var t=k.trim().toLocaleLowerCase(S.filterLocale),n=S.filterBy?S.filterBy.split(","):[S.optionLabel||"label"];if(S.optionGroupLabel){var r,l=[],i=U(S.options);try{for(i.s();!(r=i.n()).done;){var a=r.value,u=o.filter(ot(a),n,t,S.filterMatchMode,S.filterLocale);u&&u.length&&l.push(Z(Z({},a),R({},"".concat(S.optionGroupChildren),u)))}}catch(e){i.e(e)}finally{i.f()}return de(l)}return o.filter(e,n,t,S.filterMatchMode,S.filterLocale)}return e}(),ft=-1!==(it=_e(S.options))?S.optionGroupLabel?ot(S.options[it.group])[it.option]:S.options[it]:null,mt=h.isNotEmpty(S.tooltip),vt=V.getOtherProps(S),bt=h.reduceKeys(vt,y.ARIA_PROPS),gt=function(){var t={value:"",label:S.placeholder};if(ft){var n=tt(ft);t={value:"object"===N(n)?S.options.findIndex((function(e){return e===n})):n,label:et(ft)}}var r=O({className:"p-hidden-accessible p-dropdown-hidden-select"},ie("hiddenSelectedMessage")),o=O({ref:$,required:S.required,defaultValue:t.value,name:S.name,tabIndex:-1,"aria-hidden":"true"},ie("select")),l=O({value:t.value},ie("option"));return e.createElement("div",r,e.createElement("select",o,e.createElement("option",l,t.label)))}(),ht=function(){var t=h.isNotEmpty(ft)?et(ft):null;S.editable&&(t=t||S.value||"");var n=O({className:"p-hidden-accessible"},ie("hiddenSelectedMessage")),r=O(Z({ref:Y,id:S.inputId,defaultValue:t,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:me,onBlur:ve,onKeyDown:ge,disabled:S.disabled,tabIndex:S.disabled?-1:S.tabIndex||0},bt),ie("input"));return e.createElement("div",n,e.createElement("input",r))}(),yt=function(){var t=h.isNotEmpty(ft)?et(ft):null;if(S.editable){var n=O(Z({ref:$,type:"text",defaultValue:t||S.value||"",className:ae("input",{label:t}),disabled:S.disabled,placeholder:S.placeholder,maxLength:S.maxLength,onInput:Ve,onFocus:He,onKeyDown:ge,onBlur:ve,tabIndex:S.disabled?-1:S.tabIndex||0,"aria-haspopup":"listbox"},bt),ie("input"));return e.createElement("input",n)}var r=S.valueTemplate?h.getJSXElement(S.valueTemplate,ft,S):t||S.placeholder||S.emptyMessage||e.createElement(e.Fragment,null," "),o=O({ref:$,className:ae("input",{label:t}),tabIndex:"-1"},ie("input"));return e.createElement("span",o,r)}(),wt=S.loading?(at=O({className:ae("loadingIcon"),"data-pr-overlay-visible":H},ie("loadingIcon")),ut=w.getJSXIcon(S.loadingIcon||e.createElement(f,{spin:!0}),Z({},at),{props:S}),ct=S.placeholder||S.ariaLabel,pt=O({className:ae("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":H,"aria-label":ct},ie("trigger")),e.createElement("div",pt,ut)):function(){var t=O({className:ae("dropdownIcon"),"data-pr-overlay-visible":H},ie("dropdownIcon")),n=w.getJSXIcon(S.dropdownIcon||e.createElement(d,t),Z({},t),{props:S}),r=S.placeholder||S.ariaLabel,o=O({className:ae("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":H,"aria-label":r},ie("trigger"));return e.createElement("div",o,n)}(),Et=function(){if(null!=S.value&&S.showClear&&!S.disabled){var t=O({className:ae("clearIcon"),onPointerUp:Je,tabIndex:S.tabIndex||"0",onKeyDown:st,"aria-label":r("clear")},ie("clearIcon"));return w.getJSXIcon(S.clearIcon||e.createElement(m,t),Z({},t),{props:S})}return null}(),It=O({id:S.id,ref:X,className:g(S.className,ae("root",{context:x,focusedState:P,overlayVisibleState:H})),style:S.style,onClick:function(e){return t=e,void(S.disabled||S.loading||(S.onClick&&S.onClick(t),t.defaultPrevented||fe(t)||"INPUT"===t.target.tagName||(q.current&&q.current&&q.current.contains(t.target)||(y.focus(Y.current),H?Ze():We()),J.current=!0)));var t},onMouseDown:S.onMouseDown,onContextMenu:S.onContextMenu,onFocus:function(){S.editable&&!H&&!1===J.current&&y.focus($.current)},"data-p-disabled":S.disabled,"data-p-focus":P},vt,ie("root")),Ot=O({ref:z,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===Y.current?y.getFirstFocusableElement(q.current,':not([data-p-hidden-focusable="true"])'):Y.current;y.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},ie("hiddenFirstFocusableEl")),xt=O({ref:W,role:"presentation","aria-hidden":"true",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:function(e){var t=e.relatedTarget===Y.current?y.getLastFocusableElement(q.current,':not([data-p-hidden-focusable="true"])'):Y.current;y.focus(t)},"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},ie("hiddenLastFocusableEl"));return e.createElement(e.Fragment,null,e.createElement("div",It,ht,gt,yt,Et,wt,e.createElement(_,D({hostName:"Dropdown",ref:q,visibleOptions:dt,virtualScrollerRef:Q},S,{appendTo:oe,cx:ae,filterValue:k,focusedOptionIndex:M,getOptionGroupChildren:ot,getOptionGroupLabel:function(e){return h.resolveFieldData(e,S.optionGroupLabel)},getOptionGroupRenderKey:function(e){return h.resolveFieldData(e,S.optionGroupLabel)},getOptionLabel:et,getOptionRenderKey:function(e){return S.dataKey?h.resolveFieldData(e,S.dataKey):et(e)},getSelectedOptionIndex:_e,hasFilter:re,in:H,isOptionDisabled:rt,isSelected:ze,onClick:function(e){v.emit("overlay-click",{originalEvent:e,target:X.current})},onEnter:function(e){E.set("overlay",q.current,x&&x.autoZIndex||t.autoZIndex,x&&x.zIndex.overlay||t.zIndex.overlay),y.addStyles(q.current,{position:"absolute",top:"0",left:"0"}),$e(),e&&e()},onEntered:function(e){e&&e(),pe(),S.onShow&&S.onShow()},onExit:function(){se()},onExited:function(){S.filter&&S.resetFilterOnHide&&Be(),E.clear(q.current),S.onHide&&S.onHide()},onFilterClearIconClick:function(e){Be(e)},onFilterInputChange:function(e){var t=e.target.value;C(t),S.onFilter&&S.onFilter({originalEvent:e,filter:t})},onFilterInputKeyDown:function(e){switch(e.code){case"ArrowDown":Ce(e);break;case"ArrowUp":De(e);break;case"ArrowLeft":case"ArrowRight":Ne(e,!0);break;case"Escape":case"Enter":case"NumpadEnter":Me(e),e.preventDefault()}},onOptionClick:function(e){e.option.disabled||(Xe(e),y.focus(Y.current)),Ze()},ptm:ie,resetFilter:Be,changeFocusedOptionIndex:ke,firstFocusableElement:e.createElement("span",Ot),lastFocusableElement:e.createElement("span",xt),sx:ue}))),mt&&e.createElement(b,D({target:X,content:S.tooltip,pt:ie("tooltip")},S.tooltipOptions)))})));$.displayName="Dropdown";export{$ as Dropdown};
|