primereact 9.2.3 → 9.3.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/accordion/accordion.cjs.js +13 -5
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.d.ts +0 -2
- package/accordion/accordion.esm.js +13 -5
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +13 -7
- package/accordion/accordion.min.js +1 -1
- package/autocomplete/autocomplete.cjs.js +75 -59
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.d.ts +6 -4
- package/autocomplete/autocomplete.esm.js +75 -59
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +74 -61
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/breadcrumb.cjs.js +11 -2
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.d.ts +5 -0
- package/breadcrumb/breadcrumb.esm.js +11 -2
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +12 -4
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/button.cjs.js +6 -2
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +6 -2
- package/button/button.esm.min.js +1 -1
- package/button/button.js +7 -4
- package/button/button.min.js +1 -1
- package/calendar/calendar.cjs.js +47 -38
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.d.ts +16 -1
- package/calendar/calendar.esm.js +48 -39
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +44 -40
- package/calendar/calendar.min.js +1 -1
- package/carousel/carousel.cjs.js +28 -12
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.d.ts +9 -0
- package/carousel/carousel.esm.js +29 -13
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +26 -14
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/cascadeselect.cjs.js +23 -7
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.d.ts +7 -3
- package/cascadeselect/cascadeselect.esm.js +24 -8
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +23 -9
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/checkbox.cjs.js +10 -5
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.d.ts +1 -2
- package/checkbox/checkbox.esm.js +10 -5
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +11 -7
- package/checkbox/checkbox.min.js +1 -1
- package/chip/chip.cjs.js +54 -8
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.d.ts +1 -7
- package/chip/chip.esm.js +54 -8
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +55 -10
- package/chip/chip.min.js +1 -1
- package/chips/chips.cjs.js +56 -6
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.d.ts +5 -0
- package/chips/chips.esm.js +57 -7
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +57 -8
- package/chips/chips.min.js +1 -1
- package/column/column.d.ts +2 -2
- package/contextmenu/contextmenu.cjs.js +16 -23
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.d.ts +5 -0
- package/contextmenu/contextmenu.esm.js +16 -23
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +17 -25
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +3581 -120
- package/core/core.min.js +101 -9
- package/datatable/datatable.cjs.js +186 -85
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.d.ts +32 -6
- package/datatable/datatable.esm.js +187 -86
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +172 -87
- package/datatable/datatable.min.js +1 -1
- package/dataview/dataview.cjs.js +25 -11
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.d.ts +10 -1
- package/dataview/dataview.esm.js +26 -12
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +24 -13
- package/dataview/dataview.min.js +1 -1
- package/dialog/dialog.cjs.js +74 -10
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +13 -0
- package/dialog/dialog.esm.js +75 -11
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +73 -12
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +37 -12
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.d.ts +12 -4
- package/dropdown/dropdown.esm.js +38 -13
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +36 -14
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/fieldset.cjs.js +14 -5
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.d.ts +9 -0
- package/fieldset/fieldset.esm.js +15 -6
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +14 -7
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/fileupload.cjs.js +54 -18
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.d.ts +4 -0
- package/fileupload/fileupload.esm.js +49 -13
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +53 -20
- package/fileupload/fileupload.min.js +1 -1
- package/galleria/galleria.cjs.js +113 -27
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.d.ts +21 -0
- package/galleria/galleria.esm.js +114 -28
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +110 -29
- package/galleria/galleria.min.js +1 -1
- package/iconbase/iconbase.cjs.js +35 -0
- package/iconbase/iconbase.cjs.min.js +1 -0
- package/iconbase/iconbase.d.ts +9 -0
- package/iconbase/iconbase.esm.js +31 -0
- package/iconbase/iconbase.esm.min.js +1 -0
- package/iconbase/iconbase.js +39 -0
- package/iconbase/iconbase.min.css +1 -0
- package/iconbase/iconbase.min.js +1 -0
- package/iconbase/package.json +7 -0
- package/icons/angledoubledown/index.cjs.js +61 -0
- package/icons/angledoubledown/index.cjs.min.js +1 -0
- package/icons/angledoubledown/index.d.ts +19 -0
- package/icons/angledoubledown/index.esm.js +37 -0
- package/icons/angledoubledown/index.esm.min.js +1 -0
- package/icons/angledoubledown/index.js +65 -0
- package/icons/angledoubledown/index.min.js +1 -0
- package/icons/angledoubledown/package.json +7 -0
- package/icons/angledoubleleft/index.cjs.js +61 -0
- package/icons/angledoubleleft/index.cjs.min.js +1 -0
- package/icons/angledoubleleft/index.d.ts +19 -0
- package/icons/angledoubleleft/index.esm.js +37 -0
- package/icons/angledoubleleft/index.esm.min.js +1 -0
- package/icons/angledoubleleft/index.js +65 -0
- package/icons/angledoubleleft/index.min.js +1 -0
- package/icons/angledoubleleft/package.json +7 -0
- package/icons/angledoubleright/index.cjs.js +61 -0
- package/icons/angledoubleright/index.cjs.min.js +1 -0
- package/icons/angledoubleright/index.d.ts +19 -0
- package/icons/angledoubleright/index.esm.js +37 -0
- package/icons/angledoubleright/index.esm.min.js +1 -0
- package/icons/angledoubleright/index.js +65 -0
- package/icons/angledoubleright/index.min.js +1 -0
- package/icons/angledoubleright/package.json +7 -0
- package/icons/angledoubleup/index.cjs.js +61 -0
- package/icons/angledoubleup/index.cjs.min.js +1 -0
- package/icons/angledoubleup/index.d.ts +19 -0
- package/icons/angledoubleup/index.esm.js +37 -0
- package/icons/angledoubleup/index.esm.min.js +1 -0
- package/icons/angledoubleup/index.js +65 -0
- package/icons/angledoubleup/index.min.js +1 -0
- package/icons/angledoubleup/package.json +7 -0
- package/icons/angledown/index.cjs.js +59 -0
- package/icons/angledown/index.cjs.min.js +1 -0
- package/icons/angledown/index.d.ts +19 -0
- package/icons/angledown/index.esm.js +35 -0
- package/icons/angledown/index.esm.min.js +1 -0
- package/icons/angledown/index.js +63 -0
- package/icons/angledown/index.min.js +1 -0
- package/icons/angledown/package.json +7 -0
- package/icons/angleleft/index.cjs.js +59 -0
- package/icons/angleleft/index.cjs.min.js +1 -0
- package/icons/angleleft/index.d.ts +19 -0
- package/icons/angleleft/index.esm.js +35 -0
- package/icons/angleleft/index.esm.min.js +1 -0
- package/icons/angleleft/index.js +63 -0
- package/icons/angleleft/index.min.js +1 -0
- package/icons/angleleft/package.json +7 -0
- package/icons/angleright/index.cjs.js +59 -0
- package/icons/angleright/index.cjs.min.js +1 -0
- package/icons/angleright/index.d.ts +19 -0
- package/icons/angleright/index.esm.js +35 -0
- package/icons/angleright/index.esm.min.js +1 -0
- package/icons/angleright/index.js +63 -0
- package/icons/angleright/index.min.js +1 -0
- package/icons/angleright/package.json +7 -0
- package/icons/angleup/index.cjs.js +59 -0
- package/icons/angleup/index.cjs.min.js +1 -0
- package/icons/angleup/index.d.ts +19 -0
- package/icons/angleup/index.esm.js +35 -0
- package/icons/angleup/index.esm.min.js +1 -0
- package/icons/angleup/index.js +63 -0
- package/icons/angleup/index.min.js +1 -0
- package/icons/angleup/package.json +7 -0
- package/icons/arrowdown/index.cjs.js +69 -0
- package/icons/arrowdown/index.cjs.min.js +1 -0
- package/icons/arrowdown/index.d.ts +19 -0
- package/icons/arrowdown/index.esm.js +45 -0
- package/icons/arrowdown/index.esm.min.js +1 -0
- package/icons/arrowdown/index.js +73 -0
- package/icons/arrowdown/index.min.js +1 -0
- package/icons/arrowdown/package.json +7 -0
- package/icons/arrowup/index.cjs.js +69 -0
- package/icons/arrowup/index.cjs.min.js +1 -0
- package/icons/arrowup/index.d.ts +19 -0
- package/icons/arrowup/index.esm.js +45 -0
- package/icons/arrowup/index.esm.min.js +1 -0
- package/icons/arrowup/index.js +73 -0
- package/icons/arrowup/index.min.js +1 -0
- package/icons/arrowup/package.json +7 -0
- package/icons/ban/index.cjs.js +67 -0
- package/icons/ban/index.cjs.min.js +1 -0
- package/icons/ban/index.d.ts +19 -0
- package/icons/ban/index.esm.js +43 -0
- package/icons/ban/index.esm.min.js +1 -0
- package/icons/ban/index.js +71 -0
- package/icons/ban/index.min.js +1 -0
- package/icons/ban/package.json +7 -0
- package/icons/bars/index.cjs.js +61 -0
- package/icons/bars/index.cjs.min.js +1 -0
- package/icons/bars/index.d.ts +19 -0
- package/icons/bars/index.esm.js +37 -0
- package/icons/bars/index.esm.min.js +1 -0
- package/icons/bars/index.js +65 -0
- package/icons/bars/index.min.js +1 -0
- package/icons/bars/package.json +7 -0
- package/icons/calendar/index.cjs.js +59 -0
- package/icons/calendar/index.cjs.min.js +1 -0
- package/icons/calendar/index.d.ts +19 -0
- package/icons/calendar/index.esm.js +35 -0
- package/icons/calendar/index.esm.min.js +1 -0
- package/icons/calendar/index.js +63 -0
- package/icons/calendar/index.min.js +1 -0
- package/icons/calendar/package.json +7 -0
- package/icons/check/index.cjs.js +59 -0
- package/icons/check/index.cjs.min.js +1 -0
- package/icons/check/index.d.ts +19 -0
- package/icons/check/index.esm.js +35 -0
- package/icons/check/index.esm.min.js +1 -0
- package/icons/check/index.js +63 -0
- package/icons/check/index.min.js +1 -0
- package/icons/check/package.json +7 -0
- package/icons/chevrondown/index.cjs.js +59 -0
- package/icons/chevrondown/index.cjs.min.js +1 -0
- package/icons/chevrondown/index.d.ts +19 -0
- package/icons/chevrondown/index.esm.js +35 -0
- package/icons/chevrondown/index.esm.min.js +1 -0
- package/icons/chevrondown/index.js +63 -0
- package/icons/chevrondown/index.min.js +1 -0
- package/icons/chevrondown/package.json +7 -0
- package/icons/chevronleft/index.cjs.js +59 -0
- package/icons/chevronleft/index.cjs.min.js +1 -0
- package/icons/chevronleft/index.d.ts +19 -0
- package/icons/chevronleft/index.esm.js +35 -0
- package/icons/chevronleft/index.esm.min.js +1 -0
- package/icons/chevronleft/index.js +63 -0
- package/icons/chevronleft/index.min.js +1 -0
- package/icons/chevronleft/package.json +7 -0
- package/icons/chevronright/index.cjs.js +59 -0
- package/icons/chevronright/index.cjs.min.js +1 -0
- package/icons/chevronright/index.d.ts +19 -0
- package/icons/chevronright/index.esm.js +35 -0
- package/icons/chevronright/index.esm.min.js +1 -0
- package/icons/chevronright/index.js +63 -0
- package/icons/chevronright/index.min.js +1 -0
- package/icons/chevronright/package.json +7 -0
- package/icons/chevronup/index.cjs.js +59 -0
- package/icons/chevronup/index.cjs.min.js +1 -0
- package/icons/chevronup/index.d.ts +19 -0
- package/icons/chevronup/index.esm.js +35 -0
- package/icons/chevronup/index.esm.min.js +1 -0
- package/icons/chevronup/index.js +63 -0
- package/icons/chevronup/index.min.js +1 -0
- package/icons/chevronup/package.json +7 -0
- package/icons/download/index.cjs.js +69 -0
- package/icons/download/index.cjs.min.js +1 -0
- package/icons/download/index.d.ts +19 -0
- package/icons/download/index.esm.js +45 -0
- package/icons/download/index.esm.min.js +1 -0
- package/icons/download/index.js +73 -0
- package/icons/download/index.min.js +1 -0
- package/icons/download/package.json +7 -0
- package/icons/exclamationtriangle/index.cjs.js +73 -0
- package/icons/exclamationtriangle/index.cjs.min.js +1 -0
- package/icons/exclamationtriangle/index.d.ts +19 -0
- package/icons/exclamationtriangle/index.esm.js +49 -0
- package/icons/exclamationtriangle/index.esm.min.js +1 -0
- package/icons/exclamationtriangle/index.js +77 -0
- package/icons/exclamationtriangle/index.min.js +1 -0
- package/icons/exclamationtriangle/package.json +7 -0
- package/icons/eye/index.cjs.js +61 -0
- package/icons/eye/index.cjs.min.js +1 -0
- package/icons/eye/index.d.ts +19 -0
- package/icons/eye/index.esm.js +37 -0
- package/icons/eye/index.esm.min.js +1 -0
- package/icons/eye/index.js +65 -0
- package/icons/eye/index.min.js +1 -0
- package/icons/eye/package.json +7 -0
- package/icons/eyeslash/index.cjs.js +69 -0
- package/icons/eyeslash/index.cjs.min.js +1 -0
- package/icons/eyeslash/index.d.ts +19 -0
- package/icons/eyeslash/index.esm.js +45 -0
- package/icons/eyeslash/index.esm.min.js +1 -0
- package/icons/eyeslash/index.js +73 -0
- package/icons/eyeslash/index.min.js +1 -0
- package/icons/eyeslash/package.json +7 -0
- package/icons/filter/index.cjs.js +67 -0
- package/icons/filter/index.cjs.min.js +1 -0
- package/icons/filter/index.d.ts +19 -0
- package/icons/filter/index.esm.js +43 -0
- package/icons/filter/index.esm.min.js +1 -0
- package/icons/filter/index.js +71 -0
- package/icons/filter/index.min.js +1 -0
- package/icons/filter/package.json +7 -0
- package/icons/filterslash/index.cjs.js +69 -0
- package/icons/filterslash/index.cjs.min.js +1 -0
- package/icons/filterslash/index.d.ts +19 -0
- package/icons/filterslash/index.esm.js +45 -0
- package/icons/filterslash/index.esm.min.js +1 -0
- package/icons/filterslash/index.js +73 -0
- package/icons/filterslash/index.min.js +1 -0
- package/icons/filterslash/package.json +7 -0
- package/icons/infocircle/index.cjs.js +69 -0
- package/icons/infocircle/index.cjs.min.js +1 -0
- package/icons/infocircle/index.d.ts +19 -0
- package/icons/infocircle/index.esm.js +45 -0
- package/icons/infocircle/index.esm.min.js +1 -0
- package/icons/infocircle/index.js +73 -0
- package/icons/infocircle/index.min.js +1 -0
- package/icons/infocircle/package.json +7 -0
- package/icons/minus/index.cjs.js +59 -0
- package/icons/minus/index.cjs.min.js +1 -0
- package/icons/minus/index.d.ts +19 -0
- package/icons/minus/index.esm.js +35 -0
- package/icons/minus/index.esm.min.js +1 -0
- package/icons/minus/index.js +63 -0
- package/icons/minus/index.min.js +1 -0
- package/icons/minus/package.json +7 -0
- package/icons/pencil/index.cjs.js +67 -0
- package/icons/pencil/index.cjs.min.js +1 -0
- package/icons/pencil/index.d.ts +19 -0
- package/icons/pencil/index.esm.js +43 -0
- package/icons/pencil/index.esm.min.js +1 -0
- package/icons/pencil/index.js +71 -0
- package/icons/pencil/index.min.js +1 -0
- package/icons/pencil/package.json +7 -0
- package/icons/plus/index.cjs.js +67 -0
- package/icons/plus/index.cjs.min.js +1 -0
- package/icons/plus/index.d.ts +19 -0
- package/icons/plus/index.esm.js +43 -0
- package/icons/plus/index.esm.min.js +1 -0
- package/icons/plus/index.js +71 -0
- package/icons/plus/index.min.js +1 -0
- package/icons/plus/package.json +7 -0
- package/icons/refresh/index.cjs.js +69 -0
- package/icons/refresh/index.cjs.min.js +1 -0
- package/icons/refresh/index.d.ts +19 -0
- package/icons/refresh/index.esm.js +45 -0
- package/icons/refresh/index.esm.min.js +1 -0
- package/icons/refresh/index.js +73 -0
- package/icons/refresh/index.min.js +1 -0
- package/icons/refresh/package.json +7 -0
- package/icons/search/index.cjs.js +69 -0
- package/icons/search/index.cjs.min.js +1 -0
- package/icons/search/index.d.ts +19 -0
- package/icons/search/index.esm.js +45 -0
- package/icons/search/index.esm.min.js +1 -0
- package/icons/search/index.js +73 -0
- package/icons/search/index.min.js +1 -0
- package/icons/search/package.json +7 -0
- package/icons/searchminus/index.cjs.js +69 -0
- package/icons/searchminus/index.cjs.min.js +1 -0
- package/icons/searchminus/index.d.ts +19 -0
- package/icons/searchminus/index.esm.js +45 -0
- package/icons/searchminus/index.esm.min.js +1 -0
- package/icons/searchminus/index.js +73 -0
- package/icons/searchminus/index.min.js +1 -0
- package/icons/searchminus/package.json +7 -0
- package/icons/searchplus/index.cjs.js +69 -0
- package/icons/searchplus/index.cjs.min.js +1 -0
- package/icons/searchplus/index.d.ts +19 -0
- package/icons/searchplus/index.esm.js +45 -0
- package/icons/searchplus/index.esm.min.js +1 -0
- package/icons/searchplus/index.js +73 -0
- package/icons/searchplus/index.min.js +1 -0
- package/icons/searchplus/package.json +7 -0
- package/icons/sortalt/index.cjs.js +76 -0
- package/icons/sortalt/index.cjs.min.js +1 -0
- package/icons/sortalt/index.d.ts +19 -0
- package/icons/sortalt/index.esm.js +52 -0
- package/icons/sortalt/index.esm.min.js +1 -0
- package/icons/sortalt/index.js +80 -0
- package/icons/sortalt/index.min.js +1 -0
- package/icons/sortalt/package.json +7 -0
- package/icons/sortamountdown/index.cjs.js +82 -0
- package/icons/sortamountdown/index.cjs.min.js +1 -0
- package/icons/sortamountdown/index.d.ts +19 -0
- package/icons/sortamountdown/index.esm.js +58 -0
- package/icons/sortamountdown/index.esm.min.js +1 -0
- package/icons/sortamountdown/index.js +86 -0
- package/icons/sortamountdown/index.min.js +1 -0
- package/icons/sortamountdown/package.json +7 -0
- package/icons/sortamountupalt/index.cjs.js +82 -0
- package/icons/sortamountupalt/index.cjs.min.js +1 -0
- package/icons/sortamountupalt/index.d.ts +19 -0
- package/icons/sortamountupalt/index.esm.js +58 -0
- package/icons/sortamountupalt/index.esm.min.js +1 -0
- package/icons/sortamountupalt/index.js +86 -0
- package/icons/sortamountupalt/index.min.js +1 -0
- package/icons/sortamountupalt/package.json +7 -0
- package/icons/spinner/index.cjs.js +67 -0
- package/icons/spinner/index.cjs.min.js +1 -0
- package/icons/spinner/index.d.ts +19 -0
- package/icons/spinner/index.esm.js +43 -0
- package/icons/spinner/index.esm.min.js +1 -0
- package/icons/spinner/index.js +71 -0
- package/icons/spinner/index.min.js +1 -0
- package/icons/spinner/package.json +7 -0
- package/icons/star/index.cjs.js +67 -0
- package/icons/star/index.cjs.min.js +1 -0
- package/icons/star/index.d.ts +19 -0
- package/icons/star/index.esm.js +43 -0
- package/icons/star/index.esm.min.js +1 -0
- package/icons/star/index.js +71 -0
- package/icons/star/index.min.js +1 -0
- package/icons/star/package.json +7 -0
- package/icons/starfill/index.cjs.js +67 -0
- package/icons/starfill/index.cjs.min.js +1 -0
- package/icons/starfill/index.d.ts +19 -0
- package/icons/starfill/index.esm.js +43 -0
- package/icons/starfill/index.esm.min.js +1 -0
- package/icons/starfill/index.js +71 -0
- package/icons/starfill/index.min.js +1 -0
- package/icons/starfill/package.json +7 -0
- package/icons/thlarge/index.cjs.js +69 -0
- package/icons/thlarge/index.cjs.min.js +1 -0
- package/icons/thlarge/index.d.ts +19 -0
- package/icons/thlarge/index.esm.js +45 -0
- package/icons/thlarge/index.esm.min.js +1 -0
- package/icons/thlarge/index.js +73 -0
- package/icons/thlarge/index.min.js +1 -0
- package/icons/thlarge/package.json +7 -0
- package/icons/times/index.cjs.js +59 -0
- package/icons/times/index.cjs.min.js +1 -0
- package/icons/times/index.d.ts +19 -0
- package/icons/times/index.esm.js +35 -0
- package/icons/times/index.esm.min.js +1 -0
- package/icons/times/index.js +63 -0
- package/icons/times/index.min.js +1 -0
- package/icons/times/package.json +7 -0
- package/icons/timescircle/index.cjs.js +69 -0
- package/icons/timescircle/index.cjs.min.js +1 -0
- package/icons/timescircle/index.d.ts +19 -0
- package/icons/timescircle/index.esm.js +45 -0
- package/icons/timescircle/index.esm.min.js +1 -0
- package/icons/timescircle/index.js +73 -0
- package/icons/timescircle/index.min.js +1 -0
- package/icons/timescircle/package.json +7 -0
- package/icons/trash/index.cjs.js +69 -0
- package/icons/trash/index.cjs.min.js +1 -0
- package/icons/trash/index.d.ts +19 -0
- package/icons/trash/index.esm.js +45 -0
- package/icons/trash/index.esm.min.js +1 -0
- package/icons/trash/index.js +73 -0
- package/icons/trash/index.min.js +1 -0
- package/icons/trash/package.json +7 -0
- package/icons/undo/index.cjs.js +69 -0
- package/icons/undo/index.cjs.min.js +1 -0
- package/icons/undo/index.d.ts +19 -0
- package/icons/undo/index.esm.js +45 -0
- package/icons/undo/index.esm.min.js +1 -0
- package/icons/undo/index.js +73 -0
- package/icons/undo/index.min.js +1 -0
- package/icons/undo/package.json +7 -0
- package/icons/upload/index.cjs.js +69 -0
- package/icons/upload/index.cjs.min.js +1 -0
- package/icons/upload/index.d.ts +19 -0
- package/icons/upload/index.esm.js +45 -0
- package/icons/upload/index.esm.min.js +1 -0
- package/icons/upload/index.js +73 -0
- package/icons/upload/index.min.js +1 -0
- package/icons/upload/package.json +7 -0
- package/icons/windowmaximize/index.cjs.js +69 -0
- package/icons/windowmaximize/index.cjs.min.js +1 -0
- package/icons/windowmaximize/index.d.ts +19 -0
- package/icons/windowmaximize/index.esm.js +45 -0
- package/icons/windowmaximize/index.esm.min.js +1 -0
- package/icons/windowmaximize/index.js +73 -0
- package/icons/windowmaximize/index.min.js +1 -0
- package/icons/windowmaximize/package.json +7 -0
- package/icons/windowminimize/index.cjs.js +69 -0
- package/icons/windowminimize/index.cjs.min.js +1 -0
- package/icons/windowminimize/index.d.ts +19 -0
- package/icons/windowminimize/index.esm.js +45 -0
- package/icons/windowminimize/index.esm.min.js +1 -0
- package/icons/windowminimize/index.js +73 -0
- package/icons/windowminimize/index.min.js +1 -0
- package/icons/windowminimize/package.json +7 -0
- package/image/image.cjs.js +73 -21
- package/image/image.cjs.min.js +1 -1
- package/image/image.d.ts +30 -0
- package/image/image.esm.js +74 -22
- package/image/image.esm.min.js +1 -1
- package/image/image.js +68 -23
- package/image/image.min.js +1 -1
- package/inplace/inplace.cjs.js +9 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.d.ts +5 -0
- package/inplace/inplace.esm.js +10 -3
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +10 -4
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +24 -10
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.d.ts +0 -2
- package/inputnumber/inputnumber.esm.js +25 -11
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +24 -12
- package/inputnumber/inputnumber.min.js +1 -1
- package/listbox/listbox.cjs.js +14 -4
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.d.ts +5 -0
- package/listbox/listbox.esm.js +15 -5
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +15 -6
- package/listbox/listbox.min.js +1 -1
- package/megamenu/megamenu.cjs.js +22 -10
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.d.ts +9 -0
- package/megamenu/megamenu.esm.js +22 -10
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +21 -12
- package/megamenu/megamenu.min.js +1 -1
- package/menubar/menubar.cjs.js +67 -10
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.d.ts +9 -0
- package/menubar/menubar.esm.js +67 -10
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +66 -12
- package/menubar/menubar.min.js +1 -1
- package/menuitem/menuitem.d.ts +2 -0
- package/message/message.cjs.js +32 -11
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +32 -11
- package/message/message.esm.min.js +1 -1
- package/message/message.js +30 -13
- package/message/message.min.js +1 -1
- package/messages/messages.cjs.js +86 -15
- package/messages/messages.cjs.min.js +1 -1
- package/messages/messages.d.ts +5 -1
- package/messages/messages.esm.js +86 -15
- package/messages/messages.esm.min.js +1 -1
- package/messages/messages.js +83 -17
- package/messages/messages.min.js +1 -1
- package/multiselect/multiselect.cjs.js +100 -36
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.d.ts +16 -2
- package/multiselect/multiselect.esm.js +100 -36
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +97 -38
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/orderlist.cjs.js +37 -9
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.d.ts +23 -2
- package/orderlist/orderlist.esm.js +38 -10
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +34 -11
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/organizationchart.cjs.js +23 -8
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.d.ts +5 -0
- package/organizationchart/organizationchart.esm.js +24 -9
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +23 -10
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/overlaypanel.cjs.js +55 -5
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.d.ts +5 -0
- package/overlaypanel/overlaypanel.esm.js +56 -6
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +56 -7
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +2 -3
- package/paginator/paginator.cjs.js +57 -20
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.d.ts +17 -0
- package/paginator/paginator.esm.js +58 -21
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +55 -22
- package/paginator/paginator.min.js +1 -1
- package/panel/panel.cjs.js +10 -8
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.d.ts +0 -2
- package/panel/panel.esm.js +10 -8
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +10 -10
- package/panel/panel.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +17 -14
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.d.ts +5 -0
- package/panelmenu/panelmenu.esm.js +17 -14
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +17 -16
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +22 -5
- package/password/password.cjs.min.js +1 -1
- package/password/password.d.ts +9 -0
- package/password/password.esm.js +23 -6
- package/password/password.esm.min.js +1 -1
- package/password/password.js +22 -7
- package/password/password.min.js +1 -1
- package/picklist/picklist.cjs.js +96 -18
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.d.ts +41 -0
- package/picklist/picklist.esm.js +98 -20
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +89 -20
- package/picklist/picklist.min.js +1 -1
- package/primereact.all.cjs.js +2713 -765
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2668 -766
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2713 -765
- package/primereact.all.min.js +1 -1
- package/rating/rating.cjs.js +22 -10
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.d.ts +5 -8
- package/rating/rating.esm.js +22 -10
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +21 -12
- package/rating/rating.min.js +1 -1
- package/resources/primereact.css +596 -565
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +123 -17
- package/resources/themes/arya-green/theme.css +123 -17
- package/resources/themes/arya-orange/theme.css +123 -17
- package/resources/themes/arya-purple/theme.css +123 -17
- package/resources/themes/bootstrap4-dark-blue/theme.css +123 -17
- package/resources/themes/bootstrap4-dark-purple/theme.css +123 -17
- package/resources/themes/bootstrap4-light-blue/theme.css +123 -17
- package/resources/themes/bootstrap4-light-purple/theme.css +123 -17
- package/resources/themes/fluent-light/theme.css +123 -17
- package/resources/themes/lara-dark-blue/theme.css +123 -17
- package/resources/themes/lara-dark-indigo/theme.css +123 -17
- package/resources/themes/lara-dark-purple/theme.css +123 -17
- package/resources/themes/lara-dark-teal/theme.css +123 -17
- package/resources/themes/lara-light-blue/theme.css +130 -24
- package/resources/themes/lara-light-indigo/theme.css +130 -24
- package/resources/themes/lara-light-purple/theme.css +130 -24
- package/resources/themes/lara-light-teal/theme.css +130 -24
- package/resources/themes/luna-amber/theme.css +137 -31
- package/resources/themes/luna-blue/theme.css +137 -31
- package/resources/themes/luna-green/theme.css +137 -31
- package/resources/themes/luna-pink/theme.css +137 -31
- package/resources/themes/md-dark-deeppurple/theme.css +247 -144
- package/resources/themes/md-dark-indigo/theme.css +247 -144
- package/resources/themes/md-light-deeppurple/theme.css +127 -24
- package/resources/themes/md-light-indigo/theme.css +127 -24
- package/resources/themes/mdc-dark-deeppurple/theme.css +247 -144
- package/resources/themes/mdc-dark-indigo/theme.css +247 -144
- package/resources/themes/mdc-light-deeppurple/theme.css +127 -24
- package/resources/themes/mdc-light-indigo/theme.css +127 -24
- package/resources/themes/mira/theme.css +127 -25
- package/resources/themes/nano/theme.css +123 -17
- package/resources/themes/nova/theme.css +123 -17
- package/resources/themes/nova-accent/theme.css +123 -17
- package/resources/themes/nova-alt/theme.css +123 -17
- package/resources/themes/rhea/theme.css +123 -17
- package/resources/themes/saga-blue/theme.css +123 -17
- package/resources/themes/saga-green/theme.css +123 -17
- package/resources/themes/saga-orange/theme.css +123 -17
- package/resources/themes/saga-purple/theme.css +123 -17
- package/resources/themes/soho-dark/theme.css +165 -62
- package/resources/themes/soho-light/theme.css +126 -23
- package/resources/themes/tailwind-light/theme.css +153 -52
- package/resources/themes/vela-blue/theme.css +123 -17
- package/resources/themes/vela-green/theme.css +123 -17
- package/resources/themes/vela-orange/theme.css +123 -17
- package/resources/themes/vela-purple/theme.css +123 -17
- package/resources/themes/viva-dark/theme.css +127 -25
- package/resources/themes/viva-light/theme.css +127 -25
- package/scrolltop/scrolltop.cjs.js +12 -6
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.d.ts +1 -2
- package/scrolltop/scrolltop.esm.js +12 -6
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +13 -8
- package/scrolltop/scrolltop.min.js +1 -1
- package/sidebar/sidebar.cjs.js +13 -5
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.d.ts +5 -0
- package/sidebar/sidebar.esm.js +14 -6
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +14 -7
- package/sidebar/sidebar.min.js +1 -1
- package/slidemenu/slidemenu.cjs.js +26 -9
- package/slidemenu/slidemenu.cjs.min.js +1 -1
- package/slidemenu/slidemenu.d.ts +9 -0
- package/slidemenu/slidemenu.esm.js +26 -9
- package/slidemenu/slidemenu.esm.min.js +1 -1
- package/slidemenu/slidemenu.js +26 -11
- package/slidemenu/slidemenu.min.js +1 -1
- package/speeddial/speeddial.cjs.js +16 -15
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.d.ts +2 -3
- package/speeddial/speeddial.esm.js +16 -15
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +16 -17
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/splitbutton.cjs.js +16 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.d.ts +1 -2
- package/splitbutton/splitbutton.esm.js +16 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +17 -5
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabview/tabview.cjs.js +34 -16
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +15 -2
- package/tabview/tabview.esm.js +35 -17
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +33 -18
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/tieredmenu.cjs.js +12 -4
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.d.ts +5 -0
- package/tieredmenu/tieredmenu.esm.js +12 -4
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -6
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/toast.cjs.js +53 -15
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.d.ts +9 -0
- package/toast/toast.esm.js +54 -16
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +50 -17
- package/toast/toast.min.js +1 -1
- package/tree/tree.cjs.js +56 -24
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.d.ts +18 -2
- package/tree/tree.esm.js +57 -25
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +52 -26
- package/tree/tree.min.js +1 -1
- package/treeselect/treeselect.cjs.js +37 -14
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.d.ts +11 -3
- package/treeselect/treeselect.esm.js +38 -15
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +36 -16
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/treetable.cjs.js +90 -39
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +18 -2
- package/treetable/treetable.esm.js +91 -40
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +82 -41
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +20 -6
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.d.ts +9 -0
- package/tristatecheckbox/tristatecheckbox.esm.js +21 -7
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +20 -8
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +14 -4
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.d.ts +6 -0
- package/virtualscroller/virtualscroller.esm.js +15 -5
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +15 -6
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -132,8 +132,7 @@ export interface AutoCompleteProps extends Omit<React.DetailedHTMLProps<React.HT
|
|
|
132
132
|
*/
|
|
133
133
|
dropdownAutoFocus?: boolean | undefined;
|
|
134
134
|
/**
|
|
135
|
-
* Icon
|
|
136
|
-
* @defaultValue pi pi-chevron-down
|
|
135
|
+
* Icon of the dropdown.
|
|
137
136
|
*/
|
|
138
137
|
dropdownIcon?: IconType<AutoCompleteProps> | undefined;
|
|
139
138
|
/**
|
|
@@ -171,6 +170,10 @@ export interface AutoCompleteProps extends Omit<React.DetailedHTMLProps<React.HT
|
|
|
171
170
|
* Inline style of the input field.
|
|
172
171
|
*/
|
|
173
172
|
inputStyle?: React.CSSProperties | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Icon of the loader.
|
|
175
|
+
*/
|
|
176
|
+
loadingIcon?: IconType<AutoCompleteProps> | undefined;
|
|
174
177
|
/**
|
|
175
178
|
* Template of a list item.
|
|
176
179
|
*/
|
|
@@ -228,9 +231,8 @@ export interface AutoCompleteProps extends Omit<React.DetailedHTMLProps<React.HT
|
|
|
228
231
|
readOnly?: boolean | undefined;
|
|
229
232
|
/**
|
|
230
233
|
* Icon of the remove chip element in multiple mode.
|
|
231
|
-
* @defaultValue pi pi-times-circle
|
|
232
234
|
*/
|
|
233
|
-
|
|
235
|
+
removeTokenIcon?: IconType<AutoCompleteProps> | undefined;
|
|
234
236
|
/**
|
|
235
237
|
* Maximum height of the suggestions panel.
|
|
236
238
|
* @defaultValue 200px
|
|
@@ -10,6 +10,50 @@ import { CSSTransition } from 'primereact/csstransition';
|
|
|
10
10
|
import { Portal } from 'primereact/portal';
|
|
11
11
|
import { Ripple } from 'primereact/ripple';
|
|
12
12
|
import { VirtualScroller } from 'primereact/virtualscroller';
|
|
13
|
+
import { ChevronDownIcon } from 'primereact/icons/chevrondown';
|
|
14
|
+
import { TimesCircleIcon } from 'primereact/icons/timescircle';
|
|
15
|
+
import { SpinnerIcon } from 'primereact/icons/spinner';
|
|
16
|
+
|
|
17
|
+
function _typeof(obj) {
|
|
18
|
+
"@babel/helpers - typeof";
|
|
19
|
+
|
|
20
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
21
|
+
return typeof obj;
|
|
22
|
+
} : function (obj) {
|
|
23
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
24
|
+
}, _typeof(obj);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _toPrimitive(input, hint) {
|
|
28
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
29
|
+
var prim = input[Symbol.toPrimitive];
|
|
30
|
+
if (prim !== undefined) {
|
|
31
|
+
var res = prim.call(input, hint || "default");
|
|
32
|
+
if (_typeof(res) !== "object") return res;
|
|
33
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
34
|
+
}
|
|
35
|
+
return (hint === "string" ? String : Number)(input);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _toPropertyKey(arg) {
|
|
39
|
+
var key = _toPrimitive(arg, "string");
|
|
40
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function _defineProperty(obj, key, value) {
|
|
44
|
+
key = _toPropertyKey(key);
|
|
45
|
+
if (key in obj) {
|
|
46
|
+
Object.defineProperty(obj, key, {
|
|
47
|
+
value: value,
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
obj[key] = value;
|
|
54
|
+
}
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
13
57
|
|
|
14
58
|
function _extends() {
|
|
15
59
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -111,7 +155,7 @@ var AutoCompleteBase = {
|
|
|
111
155
|
dropdown: false,
|
|
112
156
|
dropdownAriaLabel: null,
|
|
113
157
|
dropdownAutoFocus: true,
|
|
114
|
-
dropdownIcon:
|
|
158
|
+
dropdownIcon: null,
|
|
115
159
|
dropdownMode: 'blank',
|
|
116
160
|
emptyMessage: null,
|
|
117
161
|
field: null,
|
|
@@ -121,6 +165,7 @@ var AutoCompleteBase = {
|
|
|
121
165
|
inputRef: null,
|
|
122
166
|
inputStyle: null,
|
|
123
167
|
itemTemplate: null,
|
|
168
|
+
loadingIcon: null,
|
|
124
169
|
maxLength: null,
|
|
125
170
|
minLength: 1,
|
|
126
171
|
multiple: false,
|
|
@@ -147,7 +192,7 @@ var AutoCompleteBase = {
|
|
|
147
192
|
panelStyle: null,
|
|
148
193
|
placeholder: null,
|
|
149
194
|
readOnly: false,
|
|
150
|
-
|
|
195
|
+
removeTokenIcon: null,
|
|
151
196
|
scrollHeight: '200px',
|
|
152
197
|
selectedItemTemplate: null,
|
|
153
198
|
selectionLimit: null,
|
|
@@ -172,49 +217,8 @@ var AutoCompleteBase = {
|
|
|
172
217
|
}
|
|
173
218
|
};
|
|
174
219
|
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
179
|
-
return typeof obj;
|
|
180
|
-
} : function (obj) {
|
|
181
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
182
|
-
}, _typeof(obj);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function _toPrimitive(input, hint) {
|
|
186
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
187
|
-
var prim = input[Symbol.toPrimitive];
|
|
188
|
-
if (prim !== undefined) {
|
|
189
|
-
var res = prim.call(input, hint || "default");
|
|
190
|
-
if (_typeof(res) !== "object") return res;
|
|
191
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
192
|
-
}
|
|
193
|
-
return (hint === "string" ? String : Number)(input);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function _toPropertyKey(arg) {
|
|
197
|
-
var key = _toPrimitive(arg, "string");
|
|
198
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function _defineProperty(obj, key, value) {
|
|
202
|
-
key = _toPropertyKey(key);
|
|
203
|
-
if (key in obj) {
|
|
204
|
-
Object.defineProperty(obj, key, {
|
|
205
|
-
value: value,
|
|
206
|
-
enumerable: true,
|
|
207
|
-
configurable: true,
|
|
208
|
-
writable: true
|
|
209
|
-
});
|
|
210
|
-
} else {
|
|
211
|
-
obj[key] = value;
|
|
212
|
-
}
|
|
213
|
-
return obj;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
217
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
220
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
221
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
218
222
|
var AutoCompletePanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
219
223
|
var getOptionGroupRenderKey = function getOptionGroupRenderKey(optionGroup) {
|
|
220
224
|
return ObjectUtils.resolveFieldData(optionGroup, props.optionGroupLabel);
|
|
@@ -287,8 +291,8 @@ var AutoCompletePanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
|
|
|
287
291
|
}, emptyMessage));
|
|
288
292
|
}
|
|
289
293
|
if (props.virtualScrollerOptions) {
|
|
290
|
-
var virtualScrollerProps = _objectSpread(_objectSpread({}, props.virtualScrollerOptions), {
|
|
291
|
-
style: _objectSpread(_objectSpread({}, props.virtualScrollerOptions.style), {
|
|
294
|
+
var virtualScrollerProps = _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions), {
|
|
295
|
+
style: _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions.style), {
|
|
292
296
|
height: props.scrollHeight
|
|
293
297
|
}),
|
|
294
298
|
autoSize: true,
|
|
@@ -324,7 +328,7 @@ var AutoCompletePanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
|
|
|
324
328
|
'p-input-filled': PrimeReact.inputStyle === 'filled',
|
|
325
329
|
'p-ripple-disabled': PrimeReact.ripple === false
|
|
326
330
|
});
|
|
327
|
-
var style = _objectSpread({
|
|
331
|
+
var style = _objectSpread$1({
|
|
328
332
|
maxHeight: props.scrollHeight
|
|
329
333
|
}, props.panelStyle || {});
|
|
330
334
|
var content = createContent();
|
|
@@ -358,6 +362,8 @@ var AutoCompletePanel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
|
|
|
358
362
|
}));
|
|
359
363
|
AutoCompletePanel.displayName = 'AutoCompletePanel';
|
|
360
364
|
|
|
365
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
366
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
361
367
|
var AutoComplete = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
362
368
|
var props = AutoCompleteBase.getProps(inProps);
|
|
363
369
|
var _React$useState = React.useState(props.id),
|
|
@@ -812,19 +818,22 @@ var AutoComplete = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
812
818
|
if (ObjectUtils.isNotEmpty(props.value)) {
|
|
813
819
|
return props.value.map(function (val, index) {
|
|
814
820
|
var key = index + 'multi-item';
|
|
815
|
-
|
|
816
|
-
key: key,
|
|
817
|
-
className: "p-autocomplete-token p-highlight"
|
|
818
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
819
|
-
className: "p-autocomplete-token-label"
|
|
820
|
-
}, formatValue(val)), !props.disabled && IconUtils.getJSXIcon(props.removeIcon, {
|
|
821
|
+
var iconProps = {
|
|
821
822
|
className: 'p-autocomplete-token-icon',
|
|
822
823
|
onClick: function onClick(e) {
|
|
823
824
|
return removeItem(e, index);
|
|
824
825
|
}
|
|
825
|
-
}
|
|
826
|
+
};
|
|
827
|
+
var icon = props.removeTokenIcon || /*#__PURE__*/React.createElement(TimesCircleIcon, iconProps);
|
|
828
|
+
var removeTokenIcon = !props.disabled && IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
|
|
826
829
|
props: props
|
|
827
|
-
})
|
|
830
|
+
});
|
|
831
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
832
|
+
key: key,
|
|
833
|
+
className: "p-autocomplete-token p-highlight"
|
|
834
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
835
|
+
className: "p-autocomplete-token-label"
|
|
836
|
+
}, formatValue(val)), removeTokenIcon);
|
|
828
837
|
});
|
|
829
838
|
}
|
|
830
839
|
return null;
|
|
@@ -879,7 +888,7 @@ var AutoComplete = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
879
888
|
var ariaLabel = props.dropdownAriaLabel || props.placeholder || localeOption('choose');
|
|
880
889
|
return /*#__PURE__*/React.createElement(Button, {
|
|
881
890
|
type: "button",
|
|
882
|
-
icon: props.dropdownIcon,
|
|
891
|
+
icon: props.dropdownIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, null),
|
|
883
892
|
className: "p-autocomplete-dropdown",
|
|
884
893
|
disabled: props.disabled,
|
|
885
894
|
onClick: onDropdownClick,
|
|
@@ -890,9 +899,16 @@ var AutoComplete = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
890
899
|
};
|
|
891
900
|
var createLoader = function createLoader() {
|
|
892
901
|
if (searchingState) {
|
|
893
|
-
|
|
894
|
-
|
|
902
|
+
var iconClassName = 'p-autocomplete-loader p-icon-spin';
|
|
903
|
+
var icon = props.loadingIcon || /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
904
|
+
className: iconClassName
|
|
905
|
+
});
|
|
906
|
+
var loaderIcon = IconUtils.getJSXIcon(icon, {
|
|
907
|
+
className: iconClassName
|
|
908
|
+
}, {
|
|
909
|
+
props: props
|
|
895
910
|
});
|
|
911
|
+
return loaderIcon;
|
|
896
912
|
}
|
|
897
913
|
return null;
|
|
898
914
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t,{localeOption as n}from"primereact/api";import{Button as o}from"primereact/button";import{useOverlayListener as r,useMountEffect as l,useUpdateEffect as i,useUnmountEffect as u}from"primereact/hooks";import{InputText as a}from"primereact/inputtext";import{OverlayService as c}from"primereact/overlayservice";import{Tooltip as p}from"primereact/tooltip";import{ObjectUtils as s,classNames as m,UniqueComponentId as f,DomHandler as d,ZIndexUtils as g,IconUtils as v}from"primereact/utils";import{CSSTransition as y}from"primereact/csstransition";import{Portal as h}from"primereact/portal";import{Ripple as b}from"primereact/ripple";import{VirtualScroller as E}from"primereact/virtualscroller";function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},C.apply(this,arguments)}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function S(e){if(Array.isArray(e))return w(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e){if(Array.isArray(e))return e}function N(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,i,u=[],a=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=l.call(n)).done)&&(u.push(o.value),u.length!==t);a=!0);}catch(e){c=!0,r=e}finally{try{if(!a&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return u}}function D(){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 P(e,t){return I(e)||N(e,t)||x(e,t)||D()}var T={defaultProps:{__TYPE:"AutoComplete",id:null,appendTo:null,autoFocus:!1,autoHighlight:!1,className:null,completeMethod:null,delay:300,disabled:!1,dropdown:!1,dropdownAriaLabel:null,dropdownAutoFocus:!0,dropdownIcon:"pi pi-chevron-down",dropdownMode:"blank",emptyMessage:null,field:null,forceSelection:!1,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,maxLength:null,minLength:1,multiple:!1,name:null,onBlur:null,onChange:null,onClear:null,onClick:null,onContextMenu:null,onDblClick:null,onDropdownClick:null,onFocus:null,onHide:null,onKeyPress:null,onKeyUp:null,onMouseDown:null,onSelect:null,onShow:null,onUnselect:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,panelClassName:null,panelStyle:null,placeholder:null,readOnly:!1,removeIcon:"pi pi-times-circle",scrollHeight:"200px",selectedItemTemplate:null,selectionLimit:null,showEmptyMessage:!1,size:null,style:null,suggestions:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,type:"text",value:null,virtualScrollerOptions:null,children:void 0},getProps:function(e){return s.getMergedProps(e,T.defaultProps)},getOtherProps:function(e){return s.getDiffProps(e,T.defaultProps)}};function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function j(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==M(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function F(e){var t=j(e,"string");return"symbol"===M(t)?t:String(t)}function L(e,t,n){return(t=F(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function A(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){L(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}var G=e.memo(e.forwardRef((function(o,r){var l,i,u,a=function(t,n,r){return o.getOptionGroupChildren(t).map((function(t,l){var i=n+"_"+l,u=o.selectedItem===t,a=o.itemTemplate?s.getJSXElement(o.itemTemplate,t,l):o.field?s.resolveFieldData(t,o.field):t,c=m("p-autocomplete-item",{"p-disabled":t.disabled});return e.createElement("li",{key:i,role:"option","aria-selected":u,className:c,style:r,onClick:function(e){return o.onItemClick(e,t)},"data-group":n,"data-index":l},a,e.createElement(b,null))}))},c=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l={height:r.props?r.props.itemSize:void 0};if(o.optionGroupLabel){var i=o.optionGroupTemplate?s.getJSXElement(o.optionGroupTemplate,t,n):o.getOptionGroupLabel(t),u=a(t,n,l),c=n+"_"+s.resolveFieldData(t,o.optionGroupLabel);return e.createElement(e.Fragment,{key:c},e.createElement("li",{className:"p-autocomplete-item-group",style:l},i),u)}var p=o.itemTemplate?s.getJSXElement(o.itemTemplate,t,n):o.field?s.resolveFieldData(t,o.field):t,f=m("p-autocomplete-item",{"p-disabled":t.disabled});return e.createElement("li",{key:n,role:"option","aria-selected":o.selectedItem===t,className:f,style:l,onClick:function(e){return o.onItemClick(e,t)}},p,e.createElement(b,null))},p=function(){if(o.showEmptyMessage&&s.isEmpty(o.suggestions)){var t=o.emptyMessage||n("emptyMessage");return e.createElement("ul",{className:"p-autocomplete-items"},e.createElement("li",{className:"p-autocomplete-item"},t))}if(o.virtualScrollerOptions){var r=A(A({},o.virtualScrollerOptions),{style:A(A({},o.virtualScrollerOptions.style),{height:o.scrollHeight}),autoSize:!0,items:o.suggestions,itemTemplate:function(e,t){return e&&c(e,t.index,t)},contentTemplate:function(t){var n=m("p-autocomplete-items",t.className);return e.createElement("ul",{ref:t.contentRef,style:t.style,className:n,role:"listbox",id:o.listId},t.children)}});return e.createElement(E,C({ref:o.virtualScrollerRef},r))}var l=o.suggestions?o.suggestions.map(c):null;return e.createElement("ul",{className:"p-autocomplete-items",role:"listbox",id:o.listId},l)},f=(l=m("p-autocomplete-panel p-component",o.panelClassName,{"p-input-filled":"filled"===t.inputStyle,"p-ripple-disabled":!1===t.ripple}),i=A({maxHeight:o.scrollHeight},o.panelStyle||{}),u=p(),e.createElement(y,{nodeRef:r,classNames:"p-connected-overlay",in:o.in,timeout:{enter:120,exit:100},options:o.transitionOptions,unmountOnExit:!0,onEnter:o.onEnter,onEntering:o.onEntering,onEntered:o.onEntered,onExit:o.onExit,onExited:o.onExited},e.createElement("div",{ref:r,className:l,style:i,onClick:o.onClick},u)));return e.createElement(h,{element:f,appendTo:o.appendTo})})));G.displayName="AutoCompletePanel";var K=e.memo(e.forwardRef((function(y,h){var b=T.getProps(y),E=P(e.useState(b.id),2),w=E[0],I=E[1],N=P(e.useState(!1),2),D=N[0],M=N[1],j=P(e.useState(!1),2),F=j[0],L=j[1],R=P(e.useState(!1),2),A=R[0],K=R[1],U=e.useRef(null),H=e.useRef(null),_=e.useRef(b.inputRef),z=e.useRef(null),B=e.useRef(null),J=e.useRef(null),X=e.useRef(null),q=P(r({target:U,overlay:H,listener:function(e,t){t.valid&&("outside"===t.type?!Z(e)&&re():re())},when:A}),2),V=q[0],Y=q[1],Z=function(e){return b.multiple?e.target===z.current||z.current.contains(e.target):e.target===_.current},$=function(e){J.current&&clearTimeout(J.current);var t=e.target.value;b.multiple||ee(e,t),s.isEmpty(t)?(re(),b.onClear&&b.onClear(e)):t.length>=b.minLength?J.current=setTimeout((function(){Q(e,t,"input")}),b.delay):re()},Q=function(e,t,n){null!=t&&("input"===n&&0===t.trim().length||b.completeMethod&&(M(!0),b.completeMethod({originalEvent:e,query:t})))},W=function(e,t,n){if(b.multiple){if(_.current.value="",!he(t)&&(!b.value||!b.selectionLimit||b.value.length<b.selectionLimit)){var o=b.value?[].concat(S(r=b.value)||O(r)||x(r)||k(),[t]):[t];ee(e,o)}}else ne(t),ee(e,t);var r;b.onSelect&&b.onSelect({originalEvent:e,value:t}),n||(d.focus(_.current),re())},ee=function(e,t){X&&s.deepEquals(X.current,t)||(b.onChange&&b.onChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:b.name,id:w,value:t}}),X.current=t)},te=function(e){if(e){if("string"==typeof e)return e;if(b.selectedItemTemplate){var t=s.getJSXElement(b.selectedItemTemplate,e);return t||e}if(b.field){var n=s.resolveFieldData(e,b.field);return null!=n?n:e}return e}return""},ne=function(e){_.current.value=te(e)},oe=function(){K(!0)},re=function(){K(!1),M(!1)},le=function(){d.alignOverlay(H.current,b.multiple?z.current:_.current,b.appendTo||t.appendTo)},ie=function(e){b.dropdownAutoFocus&&d.focus(_.current,b.dropdownAutoFocus),"blank"===b.dropdownMode?Q(e,"","dropdown"):"current"===b.dropdownMode&&Q(e,_.current.value,"dropdown"),b.onDropdownClick&&b.onDropdownClick({originalEvent:e,query:_.current.value})},ue=function(e,t){var n=b.value[t],o=b.value.filter((function(e,n){return t!==n}));ee(e,o),b.onUnselect&&b.onUnselect({originalEvent:e,value:n})},ae=function(e){if(A){var t=d.findSingle(H.current,"li.p-highlight");switch(e.which){case 40:if(t){var n=pe(t);n&&(d.addClass(n,"p-highlight"),d.removeClass(t,"p-highlight"),d.scrollInView(be(),n))}else t=d.findSingle(H.current,"li"),d.hasClass(t,"p-autocomplete-item-group")&&(t=pe(t)),t&&d.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var o=se(t);o&&(d.addClass(o,"p-highlight"),d.removeClass(t,"p-highlight"),d.scrollInView(be(),o))}e.preventDefault();break;case 13:t&&(ce(e,t),re(),e.preventDefault());break;case 27:re(),e.preventDefault();break;case 9:t&&ce(e,t),re()}}if(b.multiple&&8===e.which)if(b.value&&b.value.length&&!_.current.value){var r=b.value[b.value.length-1],l=b.value.slice(0,-1);ee(e,l),b.onUnselect&&b.onUnselect({originalEvent:e,value:r})}},ce=function(e,t){b.optionGroupLabel?W(e,Ee(b.suggestions[t.dataset.group])[t.dataset.index]):W(e,b.suggestions[d.index(t)])},pe=function e(t){var n=t.nextElementSibling;return n?d.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},se=function e(t){var n=t.previousElementSibling;return n?d.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},me=function(e){L(!0),b.onFocus&&b.onFocus(e)},fe=function(e){var t=e.target.value.trim(),n=(b.suggestions||[]).find((function(e){var n=b.field?s.resolveFieldData(e,b.field):e;return n&&t===n.trim()}));n?W(e,n,!0):(_.current.value="",ee(e,null),b.onClear&&b.onClear(e))},de=function(e){L(!1),b.forceSelection&&fe(e),b.onBlur&&b.onBlur(e)},ge=function(e){d.focus(_.current),b.onClick&&b.onClick(e)},ve=function(e){me(e),d.addClass(z.current,"p-focus")},ye=function(e){de(e),d.removeClass(z.current,"p-focus")},he=function(e){return!!b.value&&b.value.some((function(t){return s.equals(t,e)}))},be=function(){return B.current?H.current.firstChild:H.current},Ee=function(e){return s.resolveFieldData(e,b.optionGroupChildren)};e.useEffect((function(){s.combinedRefs(_,b.inputRef)}),[_,b.inputRef]),l((function(){w||I(f()),b.autoFocus&&d.focus(_.current,b.autoFocus)})),i((function(){D&&(s.isNotEmpty(b.suggestions)||b.showEmptyMessage?oe():re(),M(!1))}),[b.suggestions]),i((function(){_.current&&!b.multiple&&ne(b.value),A&&le()})),u((function(){J.current&&clearTimeout(J.current),g.clear(H.current)})),e.useImperativeHandle(h,(function(){return{props:b,search:Q,show:oe,hide:re,focus:function(){return d.focus(_.current)},getElement:function(){return U.current},getOverlay:function(){return H.current},getInput:function(){return _.current},getVirtualScroller:function(){return B.current}}}));var Ce=function(){var t=te(b.value),n=A?w+"_list":null,o=m("p-autocomplete-input",b.inputClassName,{"p-autocomplete-dd-input":b.dropdown});return e.createElement(a,C({ref:_,id:b.inputId,type:b.type,name:b.name,defaultValue:t,role:"combobox","aria-autocomplete":"list","aria-controls":n,"aria-haspopup":"listbox","aria-expanded":A,className:o,style:b.inputStyle,autoComplete:"off",readOnly:b.readOnly,disabled:b.disabled,placeholder:b.placeholder,size:b.size,maxLength:b.maxLength,tabIndex:b.tabIndex,onBlur:de,onFocus:me,onChange:$,onMouseDown:b.onMouseDown,onKeyUp:b.onKeyUp,onKeyDown:ae,onKeyPress:b.onKeyPress,onContextMenu:b.onContextMenu,onClick:b.onClick,onDoubleClick:b.onDblClick},ke))},we=function(){var t=m("p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":b.disabled}),n=s.isNotEmpty(b.value)?b.value.map((function(t,n){return e.createElement("li",{key:n+"multi-item",className:"p-autocomplete-token p-highlight"},e.createElement("span",{className:"p-autocomplete-token-label"},te(t)),!b.disabled&&v.getJSXIcon(b.removeIcon,{className:"p-autocomplete-token-icon",onClick:function(e){return ue(e,n)}},{props:b}))})):null,o=e.createElement("li",{className:"p-autocomplete-input-token"},e.createElement("input",C({ref:_,type:b.type,disabled:b.disabled,placeholder:b.placeholder,role:"combobox","aria-autocomplete":"list","aria-controls":A?w+"_list":null,"aria-haspopup":"listbox","aria-expanded":A,autoComplete:"off",readOnly:b.readOnly,tabIndex:b.tabIndex,onChange:$,id:b.inputId,name:b.name,style:b.inputStyle,className:b.inputClassName,maxLength:b.maxLength,onKeyUp:b.onKeyUp,onKeyDown:ae,onKeyPress:b.onKeyPress,onFocus:ve,onBlur:ye},ke)));return e.createElement("ul",{ref:z,className:t,onContextMenu:b.onContextMenu,onMouseDown:b.onMouseDown,onClick:ge,onDoubleClick:b.onDblClick},n,o)},Se=w+"_list",Oe=s.isNotEmpty(b.tooltip),xe=T.getOtherProps(b),ke=s.reduceKeys(xe,d.ARIA_PROPS),Ie=m("p-autocomplete p-component p-inputwrapper",{"p-autocomplete-dd":b.dropdown,"p-autocomplete-multiple":b.multiple,"p-inputwrapper-filled":b.value,"p-inputwrapper-focus":F},b.className),Ne=D?e.createElement("i",{className:"p-autocomplete-loader pi pi-spinner pi-spin"}):null,De=b.multiple?we():Ce(),Pe=function(){if(b.dropdown){var t=b.dropdownAriaLabel||b.placeholder||n("choose");return e.createElement(o,{type:"button",icon:b.dropdownIcon,className:"p-autocomplete-dropdown",disabled:b.disabled,onClick:ie,"aria-label":t})}return null}();return e.createElement(e.Fragment,null,e.createElement("span",C({ref:U,id:w,style:b.style,className:Ie},xe),De,Ne,Pe,e.createElement(G,C({ref:H,virtualScrollerRef:B},b,{listId:Se,onItemClick:W,selectedItem:X,onClick:function(e){c.emit("overlay-click",{originalEvent:e,target:U.current})},getOptionGroupLabel:function(e){return b.optionGroupLabel?s.resolveFieldData(e,b.optionGroupLabel):e},getOptionGroupChildren:Ee,in:A,onEnter:function(){g.set("overlay",H.current,t.autoZIndex,t.zIndex.overlay),le()},onEntering:function(){if(b.autoHighlight&&b.suggestions&&b.suggestions.length){var e=be().firstChild.firstChild;d.addClass(e,"p-highlight")}},onEntered:function(){V(),b.onShow&&b.onShow()},onExit:function(){Y()},onExited:function(){g.clear(H.current),b.onHide&&b.onHide()}}))),Oe&&e.createElement(p,C({target:U,content:b.tooltip},b.tooltipOptions)))})));K.displayName="AutoComplete";export{K as AutoComplete};
|
|
1
|
+
import*as e from"react";import t,{localeOption as n}from"primereact/api";import{Button as r}from"primereact/button";import{useOverlayListener as o,useMountEffect as l,useUpdateEffect as i,useUnmountEffect as u}from"primereact/hooks";import{InputText as a}from"primereact/inputtext";import{OverlayService as c}from"primereact/overlayservice";import{Tooltip as p}from"primereact/tooltip";import{ObjectUtils as s,classNames as m,UniqueComponentId as f,DomHandler as d,ZIndexUtils as g,IconUtils as v}from"primereact/utils";import{CSSTransition as y}from"primereact/csstransition";import{Portal as b}from"primereact/portal";import{Ripple as h}from"primereact/ripple";import{VirtualScroller as E}from"primereact/virtualscroller";import{ChevronDownIcon as w}from"primereact/icons/chevrondown";import{TimesCircleIcon as C}from"primereact/icons/timescircle";import{SpinnerIcon as O}from"primereact/icons/spinner";function S(e){return S="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},S(e)}function x(e,t){if("object"!==S(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function k(e){var t=x(e,"string");return"symbol"===S(t)?t:String(t)}function I(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(){return P=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},P.apply(this,arguments)}function D(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 j(e){if(Array.isArray(e))return D(e)}function N(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function T(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function M(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e){if(Array.isArray(e))return e}function L(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,u=[],a=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=l.call(n)).done)&&(u.push(r.value),u.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}function R(){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 A(e,t){return F(e)||L(e,t)||T(e,t)||R()}var G={defaultProps:{__TYPE:"AutoComplete",id:null,appendTo:null,autoFocus:!1,autoHighlight:!1,className:null,completeMethod:null,delay:300,disabled:!1,dropdown:!1,dropdownAriaLabel:null,dropdownAutoFocus:!0,dropdownIcon:null,dropdownMode:"blank",emptyMessage:null,field:null,forceSelection:!1,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,loadingIcon:null,maxLength:null,minLength:1,multiple:!1,name:null,onBlur:null,onChange:null,onClear:null,onClick:null,onContextMenu:null,onDblClick:null,onDropdownClick:null,onFocus:null,onHide:null,onKeyPress:null,onKeyUp:null,onMouseDown:null,onSelect:null,onShow:null,onUnselect:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,panelClassName:null,panelStyle:null,placeholder:null,readOnly:!1,removeTokenIcon:null,scrollHeight:"200px",selectedItemTemplate:null,selectionLimit:null,showEmptyMessage:!1,size:null,style:null,suggestions:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,type:"text",value:null,virtualScrollerOptions:null,children:void 0},getProps:function(e){return s.getMergedProps(e,G.defaultProps)},getOtherProps:function(e){return s.getDiffProps(e,G.defaultProps)}};function K(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 U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=e.memo(e.forwardRef((function(r,o){var l,i,u,a=function(t,n,o){return r.getOptionGroupChildren(t).map((function(t,l){var i=n+"_"+l,u=r.selectedItem===t,a=r.itemTemplate?s.getJSXElement(r.itemTemplate,t,l):r.field?s.resolveFieldData(t,r.field):t,c=m("p-autocomplete-item",{"p-disabled":t.disabled});return e.createElement("li",{key:i,role:"option","aria-selected":u,className:c,style:o,onClick:function(e){return r.onItemClick(e,t)},"data-group":n,"data-index":l},a,e.createElement(h,null))}))},c=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l={height:o.props?o.props.itemSize:void 0};if(r.optionGroupLabel){var i=r.optionGroupTemplate?s.getJSXElement(r.optionGroupTemplate,t,n):r.getOptionGroupLabel(t),u=a(t,n,l),c=n+"_"+s.resolveFieldData(t,r.optionGroupLabel);return e.createElement(e.Fragment,{key:c},e.createElement("li",{className:"p-autocomplete-item-group",style:l},i),u)}var p=r.itemTemplate?s.getJSXElement(r.itemTemplate,t,n):r.field?s.resolveFieldData(t,r.field):t,f=m("p-autocomplete-item",{"p-disabled":t.disabled});return e.createElement("li",{key:n,role:"option","aria-selected":r.selectedItem===t,className:f,style:l,onClick:function(e){return r.onItemClick(e,t)}},p,e.createElement(h,null))},p=function(){if(r.showEmptyMessage&&s.isEmpty(r.suggestions)){var t=r.emptyMessage||n("emptyMessage");return e.createElement("ul",{className:"p-autocomplete-items"},e.createElement("li",{className:"p-autocomplete-item"},t))}if(r.virtualScrollerOptions){var o=U(U({},r.virtualScrollerOptions),{style:U(U({},r.virtualScrollerOptions.style),{height:r.scrollHeight}),autoSize:!0,items:r.suggestions,itemTemplate:function(e,t){return e&&c(e,t.index,t)},contentTemplate:function(t){var n=m("p-autocomplete-items",t.className);return e.createElement("ul",{ref:t.contentRef,style:t.style,className:n,role:"listbox",id:r.listId},t.children)}});return e.createElement(E,P({ref:r.virtualScrollerRef},o))}var l=r.suggestions?r.suggestions.map(c):null;return e.createElement("ul",{className:"p-autocomplete-items",role:"listbox",id:r.listId},l)},f=(l=m("p-autocomplete-panel p-component",r.panelClassName,{"p-input-filled":"filled"===t.inputStyle,"p-ripple-disabled":!1===t.ripple}),i=U({maxHeight:r.scrollHeight},r.panelStyle||{}),u=p(),e.createElement(y,{nodeRef:o,classNames:"p-connected-overlay",in:r.in,timeout:{enter:120,exit:100},options:r.transitionOptions,unmountOnExit:!0,onEnter:r.onEnter,onEntering:r.onEntering,onEntered:r.onEntered,onExit:r.onExit,onExited:r.onExited},e.createElement("div",{ref:o,className:l,style:i,onClick:r.onClick},u)));return e.createElement(b,{element:f,appendTo:r.appendTo})})));function _(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?_(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}H.displayName="AutoCompletePanel";var J=e.memo(e.forwardRef((function(y,b){var h=G.getProps(y),E=A(e.useState(h.id),2),S=E[0],x=E[1],k=A(e.useState(!1),2),I=k[0],D=k[1],F=A(e.useState(!1),2),L=F[0],R=F[1],K=A(e.useState(!1),2),U=K[0],_=K[1],J=e.useRef(null),X=e.useRef(null),B=e.useRef(h.inputRef),q=e.useRef(null),V=e.useRef(null),Y=e.useRef(null),Z=e.useRef(null),$=A(o({target:J,overlay:X,listener:function(e,t){t.valid&&("outside"===t.type?!ee(e)&&ae():ae())},when:U}),2),Q=$[0],W=$[1],ee=function(e){return h.multiple?e.target===q.current||q.current.contains(e.target):e.target===B.current},te=function(e){Y.current&&clearTimeout(Y.current);var t=e.target.value;h.multiple||oe(e,t),s.isEmpty(t)?(ae(),h.onClear&&h.onClear(e)):t.length>=h.minLength?Y.current=setTimeout((function(){ne(e,t,"input")}),h.delay):ae()},ne=function(e,t,n){null!=t&&("input"===n&&0===t.trim().length||h.completeMethod&&(D(!0),h.completeMethod({originalEvent:e,query:t})))},re=function(e,t,n){if(h.multiple){if(B.current.value="",!Ce(t)&&(!h.value||!h.selectionLimit||h.value.length<h.selectionLimit)){var r=h.value?[].concat(j(o=h.value)||N(o)||T(o)||M(),[t]):[t];oe(e,r)}}else ie(t),oe(e,t);var o;h.onSelect&&h.onSelect({originalEvent:e,value:t}),n||(d.focus(B.current),ae())},oe=function(e,t){Z&&s.deepEquals(Z.current,t)||(h.onChange&&h.onChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:h.name,id:S,value:t}}),Z.current=t)},le=function(e){if(e){if("string"==typeof e)return e;if(h.selectedItemTemplate){var t=s.getJSXElement(h.selectedItemTemplate,e);return t||e}if(h.field){var n=s.resolveFieldData(e,h.field);return null!=n?n:e}return e}return""},ie=function(e){B.current.value=le(e)},ue=function(){_(!0)},ae=function(){_(!1),D(!1)},ce=function(){d.alignOverlay(X.current,h.multiple?q.current:B.current,h.appendTo||t.appendTo)},pe=function(e){h.dropdownAutoFocus&&d.focus(B.current,h.dropdownAutoFocus),"blank"===h.dropdownMode?ne(e,"","dropdown"):"current"===h.dropdownMode&&ne(e,B.current.value,"dropdown"),h.onDropdownClick&&h.onDropdownClick({originalEvent:e,query:B.current.value})},se=function(e,t){var n=h.value[t],r=h.value.filter((function(e,n){return t!==n}));oe(e,r),h.onUnselect&&h.onUnselect({originalEvent:e,value:n})},me=function(e){if(U){var t=d.findSingle(X.current,"li.p-highlight");switch(e.which){case 40:if(t){var n=de(t);n&&(d.addClass(n,"p-highlight"),d.removeClass(t,"p-highlight"),d.scrollInView(Oe(),n))}else t=d.findSingle(X.current,"li"),d.hasClass(t,"p-autocomplete-item-group")&&(t=de(t)),t&&d.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var r=ge(t);r&&(d.addClass(r,"p-highlight"),d.removeClass(t,"p-highlight"),d.scrollInView(Oe(),r))}e.preventDefault();break;case 13:t&&(fe(e,t),ae(),e.preventDefault());break;case 27:ae(),e.preventDefault();break;case 9:t&&fe(e,t),ae()}}if(h.multiple&&8===e.which)if(h.value&&h.value.length&&!B.current.value){var o=h.value[h.value.length-1],l=h.value.slice(0,-1);oe(e,l),h.onUnselect&&h.onUnselect({originalEvent:e,value:o})}},fe=function(e,t){h.optionGroupLabel?re(e,Se(h.suggestions[t.dataset.group])[t.dataset.index]):re(e,h.suggestions[d.index(t)])},de=function e(t){var n=t.nextElementSibling;return n?d.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},ge=function e(t){var n=t.previousElementSibling;return n?d.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},ve=function(e){R(!0),h.onFocus&&h.onFocus(e)},ye=function(e){var t=e.target.value.trim(),n=(h.suggestions||[]).find((function(e){var n=h.field?s.resolveFieldData(e,h.field):e;return n&&t===n.trim()}));n?re(e,n,!0):(B.current.value="",oe(e,null),h.onClear&&h.onClear(e))},be=function(e){R(!1),h.forceSelection&&ye(e),h.onBlur&&h.onBlur(e)},he=function(e){d.focus(B.current),h.onClick&&h.onClick(e)},Ee=function(e){ve(e),d.addClass(q.current,"p-focus")},we=function(e){be(e),d.removeClass(q.current,"p-focus")},Ce=function(e){return!!h.value&&h.value.some((function(t){return s.equals(t,e)}))},Oe=function(){return V.current?X.current.firstChild:X.current},Se=function(e){return s.resolveFieldData(e,h.optionGroupChildren)};e.useEffect((function(){s.combinedRefs(B,h.inputRef)}),[B,h.inputRef]),l((function(){S||x(f()),h.autoFocus&&d.focus(B.current,h.autoFocus)})),i((function(){I&&(s.isNotEmpty(h.suggestions)||h.showEmptyMessage?ue():ae(),D(!1))}),[h.suggestions]),i((function(){B.current&&!h.multiple&&ie(h.value),U&&ce()})),u((function(){Y.current&&clearTimeout(Y.current),g.clear(X.current)})),e.useImperativeHandle(b,(function(){return{props:h,search:ne,show:ue,hide:ae,focus:function(){return d.focus(B.current)},getElement:function(){return J.current},getOverlay:function(){return X.current},getInput:function(){return B.current},getVirtualScroller:function(){return V.current}}}));var xe=function(){var t=le(h.value),n=U?S+"_list":null,r=m("p-autocomplete-input",h.inputClassName,{"p-autocomplete-dd-input":h.dropdown});return e.createElement(a,P({ref:B,id:h.inputId,type:h.type,name:h.name,defaultValue:t,role:"combobox","aria-autocomplete":"list","aria-controls":n,"aria-haspopup":"listbox","aria-expanded":U,className:r,style:h.inputStyle,autoComplete:"off",readOnly:h.readOnly,disabled:h.disabled,placeholder:h.placeholder,size:h.size,maxLength:h.maxLength,tabIndex:h.tabIndex,onBlur:be,onFocus:ve,onChange:te,onMouseDown:h.onMouseDown,onKeyUp:h.onKeyUp,onKeyDown:me,onKeyPress:h.onKeyPress,onContextMenu:h.onContextMenu,onClick:h.onClick,onDoubleClick:h.onDblClick},je))},ke=function(){var t=m("p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":h.disabled}),n=s.isNotEmpty(h.value)?h.value.map((function(t,n){var r=n+"multi-item",o={className:"p-autocomplete-token-icon",onClick:function(e){return se(e,n)}},l=!h.disabled&&v.getJSXIcon(h.removeTokenIcon||e.createElement(C,o),z({},o),{props:h});return e.createElement("li",{key:r,className:"p-autocomplete-token p-highlight"},e.createElement("span",{className:"p-autocomplete-token-label"},le(t)),l)})):null,r=e.createElement("li",{className:"p-autocomplete-input-token"},e.createElement("input",P({ref:B,type:h.type,disabled:h.disabled,placeholder:h.placeholder,role:"combobox","aria-autocomplete":"list","aria-controls":U?S+"_list":null,"aria-haspopup":"listbox","aria-expanded":U,autoComplete:"off",readOnly:h.readOnly,tabIndex:h.tabIndex,onChange:te,id:h.inputId,name:h.name,style:h.inputStyle,className:h.inputClassName,maxLength:h.maxLength,onKeyUp:h.onKeyUp,onKeyDown:me,onKeyPress:h.onKeyPress,onFocus:Ee,onBlur:we},je)));return e.createElement("ul",{ref:q,className:t,onContextMenu:h.onContextMenu,onMouseDown:h.onMouseDown,onClick:he,onDoubleClick:h.onDblClick},n,r)},Ie=S+"_list",Pe=s.isNotEmpty(h.tooltip),De=G.getOtherProps(h),je=s.reduceKeys(De,d.ARIA_PROPS),Ne=m("p-autocomplete p-component p-inputwrapper",{"p-autocomplete-dd":h.dropdown,"p-autocomplete-multiple":h.multiple,"p-inputwrapper-filled":h.value,"p-inputwrapper-focus":L},h.className),Te=function(){if(I){var t="p-autocomplete-loader p-icon-spin";return v.getJSXIcon(h.loadingIcon||e.createElement(O,{className:t}),{className:t},{props:h})}return null}(),Me=h.multiple?ke():xe(),Fe=function(){if(h.dropdown){var t=h.dropdownAriaLabel||h.placeholder||n("choose");return e.createElement(r,{type:"button",icon:h.dropdownIcon||e.createElement(w,null),className:"p-autocomplete-dropdown",disabled:h.disabled,onClick:pe,"aria-label":t})}return null}();return e.createElement(e.Fragment,null,e.createElement("span",P({ref:J,id:S,style:h.style,className:Ne},De),Me,Te,Fe,e.createElement(H,P({ref:X,virtualScrollerRef:V},h,{listId:Ie,onItemClick:re,selectedItem:Z,onClick:function(e){c.emit("overlay-click",{originalEvent:e,target:J.current})},getOptionGroupLabel:function(e){return h.optionGroupLabel?s.resolveFieldData(e,h.optionGroupLabel):e},getOptionGroupChildren:Se,in:U,onEnter:function(){g.set("overlay",X.current,t.autoZIndex,t.zIndex.overlay),ce()},onEntering:function(){if(h.autoHighlight&&h.suggestions&&h.suggestions.length){var e=Oe().firstChild.firstChild;d.addClass(e,"p-highlight")}},onEntered:function(){Q(),h.onShow&&h.onShow()},onExit:function(){W()},onExited:function(){g.clear(X.current),h.onHide&&h.onHide()}}))),Pe&&e.createElement(p,P({target:J,content:h.tooltip},h.tooltipOptions)))})));J.displayName="AutoComplete";export{J as AutoComplete};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
this.primereact = this.primereact || {};
|
|
2
|
-
this.primereact.autocomplete = (function (exports, React, PrimeReact, button, hooks, inputtext, overlayservice, tooltip, utils, csstransition, portal, ripple, virtualscroller) {
|
|
2
|
+
this.primereact.autocomplete = (function (exports, React, PrimeReact, button, hooks, inputtext, overlayservice, tooltip, utils, csstransition, portal, ripple, virtualscroller, chevrondown, timescircle, spinner) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -25,6 +25,47 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
var PrimeReact__default = /*#__PURE__*/_interopDefaultLegacy(PrimeReact);
|
|
27
27
|
|
|
28
|
+
function _typeof(obj) {
|
|
29
|
+
"@babel/helpers - typeof";
|
|
30
|
+
|
|
31
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
32
|
+
return typeof obj;
|
|
33
|
+
} : function (obj) {
|
|
34
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
35
|
+
}, _typeof(obj);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _toPrimitive(input, hint) {
|
|
39
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
40
|
+
var prim = input[Symbol.toPrimitive];
|
|
41
|
+
if (prim !== undefined) {
|
|
42
|
+
var res = prim.call(input, hint || "default");
|
|
43
|
+
if (_typeof(res) !== "object") return res;
|
|
44
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
45
|
+
}
|
|
46
|
+
return (hint === "string" ? String : Number)(input);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function _toPropertyKey(arg) {
|
|
50
|
+
var key = _toPrimitive(arg, "string");
|
|
51
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _defineProperty(obj, key, value) {
|
|
55
|
+
key = _toPropertyKey(key);
|
|
56
|
+
if (key in obj) {
|
|
57
|
+
Object.defineProperty(obj, key, {
|
|
58
|
+
value: value,
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
obj[key] = value;
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
|
|
28
69
|
function _extends() {
|
|
29
70
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
30
71
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -125,7 +166,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
125
166
|
dropdown: false,
|
|
126
167
|
dropdownAriaLabel: null,
|
|
127
168
|
dropdownAutoFocus: true,
|
|
128
|
-
dropdownIcon:
|
|
169
|
+
dropdownIcon: null,
|
|
129
170
|
dropdownMode: 'blank',
|
|
130
171
|
emptyMessage: null,
|
|
131
172
|
field: null,
|
|
@@ -135,6 +176,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
135
176
|
inputRef: null,
|
|
136
177
|
inputStyle: null,
|
|
137
178
|
itemTemplate: null,
|
|
179
|
+
loadingIcon: null,
|
|
138
180
|
maxLength: null,
|
|
139
181
|
minLength: 1,
|
|
140
182
|
multiple: false,
|
|
@@ -161,7 +203,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
161
203
|
panelStyle: null,
|
|
162
204
|
placeholder: null,
|
|
163
205
|
readOnly: false,
|
|
164
|
-
|
|
206
|
+
removeTokenIcon: null,
|
|
165
207
|
scrollHeight: '200px',
|
|
166
208
|
selectedItemTemplate: null,
|
|
167
209
|
selectionLimit: null,
|
|
@@ -186,49 +228,8 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
186
228
|
}
|
|
187
229
|
};
|
|
188
230
|
|
|
189
|
-
function
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
193
|
-
return typeof obj;
|
|
194
|
-
} : function (obj) {
|
|
195
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
196
|
-
}, _typeof(obj);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function _toPrimitive(input, hint) {
|
|
200
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
201
|
-
var prim = input[Symbol.toPrimitive];
|
|
202
|
-
if (prim !== undefined) {
|
|
203
|
-
var res = prim.call(input, hint || "default");
|
|
204
|
-
if (_typeof(res) !== "object") return res;
|
|
205
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
206
|
-
}
|
|
207
|
-
return (hint === "string" ? String : Number)(input);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function _toPropertyKey(arg) {
|
|
211
|
-
var key = _toPrimitive(arg, "string");
|
|
212
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function _defineProperty(obj, key, value) {
|
|
216
|
-
key = _toPropertyKey(key);
|
|
217
|
-
if (key in obj) {
|
|
218
|
-
Object.defineProperty(obj, key, {
|
|
219
|
-
value: value,
|
|
220
|
-
enumerable: true,
|
|
221
|
-
configurable: true,
|
|
222
|
-
writable: true
|
|
223
|
-
});
|
|
224
|
-
} else {
|
|
225
|
-
obj[key] = value;
|
|
226
|
-
}
|
|
227
|
-
return obj;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
231
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
231
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
232
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
232
233
|
var AutoCompletePanel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
233
234
|
var getOptionGroupRenderKey = function getOptionGroupRenderKey(optionGroup) {
|
|
234
235
|
return utils.ObjectUtils.resolveFieldData(optionGroup, props.optionGroupLabel);
|
|
@@ -301,8 +302,8 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
301
302
|
}, emptyMessage));
|
|
302
303
|
}
|
|
303
304
|
if (props.virtualScrollerOptions) {
|
|
304
|
-
var virtualScrollerProps = _objectSpread(_objectSpread({}, props.virtualScrollerOptions), {
|
|
305
|
-
style: _objectSpread(_objectSpread({}, props.virtualScrollerOptions.style), {
|
|
305
|
+
var virtualScrollerProps = _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions), {
|
|
306
|
+
style: _objectSpread$1(_objectSpread$1({}, props.virtualScrollerOptions.style), {
|
|
306
307
|
height: props.scrollHeight
|
|
307
308
|
}),
|
|
308
309
|
autoSize: true,
|
|
@@ -338,7 +339,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
338
339
|
'p-input-filled': PrimeReact__default["default"].inputStyle === 'filled',
|
|
339
340
|
'p-ripple-disabled': PrimeReact__default["default"].ripple === false
|
|
340
341
|
});
|
|
341
|
-
var style = _objectSpread({
|
|
342
|
+
var style = _objectSpread$1({
|
|
342
343
|
maxHeight: props.scrollHeight
|
|
343
344
|
}, props.panelStyle || {});
|
|
344
345
|
var content = createContent();
|
|
@@ -372,6 +373,8 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
372
373
|
}));
|
|
373
374
|
AutoCompletePanel.displayName = 'AutoCompletePanel';
|
|
374
375
|
|
|
376
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
377
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
375
378
|
var AutoComplete = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
|
|
376
379
|
var props = AutoCompleteBase.getProps(inProps);
|
|
377
380
|
var _React$useState = React__namespace.useState(props.id),
|
|
@@ -826,19 +829,22 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
826
829
|
if (utils.ObjectUtils.isNotEmpty(props.value)) {
|
|
827
830
|
return props.value.map(function (val, index) {
|
|
828
831
|
var key = index + 'multi-item';
|
|
829
|
-
|
|
830
|
-
key: key,
|
|
831
|
-
className: "p-autocomplete-token p-highlight"
|
|
832
|
-
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
833
|
-
className: "p-autocomplete-token-label"
|
|
834
|
-
}, formatValue(val)), !props.disabled && utils.IconUtils.getJSXIcon(props.removeIcon, {
|
|
832
|
+
var iconProps = {
|
|
835
833
|
className: 'p-autocomplete-token-icon',
|
|
836
834
|
onClick: function onClick(e) {
|
|
837
835
|
return removeItem(e, index);
|
|
838
836
|
}
|
|
839
|
-
}
|
|
837
|
+
};
|
|
838
|
+
var icon = props.removeTokenIcon || /*#__PURE__*/React__namespace.createElement(timescircle.TimesCircleIcon, iconProps);
|
|
839
|
+
var removeTokenIcon = !props.disabled && utils.IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
|
|
840
840
|
props: props
|
|
841
|
-
})
|
|
841
|
+
});
|
|
842
|
+
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
843
|
+
key: key,
|
|
844
|
+
className: "p-autocomplete-token p-highlight"
|
|
845
|
+
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
846
|
+
className: "p-autocomplete-token-label"
|
|
847
|
+
}, formatValue(val)), removeTokenIcon);
|
|
842
848
|
});
|
|
843
849
|
}
|
|
844
850
|
return null;
|
|
@@ -893,7 +899,7 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
893
899
|
var ariaLabel = props.dropdownAriaLabel || props.placeholder || PrimeReact.localeOption('choose');
|
|
894
900
|
return /*#__PURE__*/React__namespace.createElement(button.Button, {
|
|
895
901
|
type: "button",
|
|
896
|
-
icon: props.dropdownIcon,
|
|
902
|
+
icon: props.dropdownIcon || /*#__PURE__*/React__namespace.createElement(chevrondown.ChevronDownIcon, null),
|
|
897
903
|
className: "p-autocomplete-dropdown",
|
|
898
904
|
disabled: props.disabled,
|
|
899
905
|
onClick: onDropdownClick,
|
|
@@ -904,9 +910,16 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
904
910
|
};
|
|
905
911
|
var createLoader = function createLoader() {
|
|
906
912
|
if (searchingState) {
|
|
907
|
-
|
|
908
|
-
|
|
913
|
+
var iconClassName = 'p-autocomplete-loader p-icon-spin';
|
|
914
|
+
var icon = props.loadingIcon || /*#__PURE__*/React__namespace.createElement(spinner.SpinnerIcon, {
|
|
915
|
+
className: iconClassName
|
|
916
|
+
});
|
|
917
|
+
var loaderIcon = utils.IconUtils.getJSXIcon(icon, {
|
|
918
|
+
className: iconClassName
|
|
919
|
+
}, {
|
|
920
|
+
props: props
|
|
909
921
|
});
|
|
922
|
+
return loaderIcon;
|
|
910
923
|
}
|
|
911
924
|
return null;
|
|
912
925
|
};
|
|
@@ -960,4 +973,4 @@ this.primereact.autocomplete = (function (exports, React, PrimeReact, button, ho
|
|
|
960
973
|
|
|
961
974
|
return exports;
|
|
962
975
|
|
|
963
|
-
})({}, React, primereact.api, primereact.button, primereact.hooks, primereact.inputtext, primereact.overlayservice, primereact.tooltip, primereact.utils, primereact.csstransition, primereact.portal, primereact.ripple, primereact.virtualscroller);
|
|
976
|
+
})({}, React, primereact.api, primereact.button, primereact.hooks, primereact.inputtext, primereact.overlayservice, primereact.tooltip, primereact.utils, primereact.csstransition, primereact.portal, primereact.ripple, primereact.virtualscroller, primereact.icons/chevrondown, primereact.icons/timescircle, primereact.icons/spinner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.autocomplete=function(e,t,n,l,r,o,i,a,u,c,s,p,m){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=f(t),v=d(n);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},b.apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l}function h(e){if(Array.isArray(e))return y(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function C(){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 w(e){if(Array.isArray(e))return e}function S(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l,r,o,i,a=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(l=o.call(n)).done)&&(a.push(l.value),a.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}function D(){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 j(e,t){return w(e)||S(e,t)||E(e,t)||D()}var x={defaultProps:{__TYPE:"AutoComplete",id:null,appendTo:null,autoFocus:!1,autoHighlight:!1,className:null,completeMethod:null,delay:300,disabled:!1,dropdown:!1,dropdownAriaLabel:null,dropdownAutoFocus:!0,dropdownIcon:"pi pi-chevron-down",dropdownMode:"blank",emptyMessage:null,field:null,forceSelection:!1,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,maxLength:null,minLength:1,multiple:!1,name:null,onBlur:null,onChange:null,onClear:null,onClick:null,onContextMenu:null,onDblClick:null,onDropdownClick:null,onFocus:null,onHide:null,onKeyPress:null,onKeyUp:null,onMouseDown:null,onSelect:null,onShow:null,onUnselect:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,panelClassName:null,panelStyle:null,placeholder:null,readOnly:!1,removeIcon:"pi pi-times-circle",scrollHeight:"200px",selectedItemTemplate:null,selectionLimit:null,showEmptyMessage:!1,size:null,style:null,suggestions:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,type:"text",value:null,virtualScrollerOptions:null,children:void 0},getProps:function(e){return u.ObjectUtils.getMergedProps(e,x.defaultProps)},getOtherProps:function(e){return u.ObjectUtils.getDiffProps(e,x.defaultProps)}};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 k(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var l=n.call(e,t||"default");if("object"!==I(l))return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function U(e){var t=k(e,"string");return"symbol"===I(t)?t:String(t)}function N(e,t,n){return(t=U(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=g.memo(g.forwardRef((function(e,t){var l,r,o,i=function(t,n,l){return e.getOptionGroupChildren(t).map((function(t,r){var o=n+"_"+r,i=e.selectedItem===t,a=e.itemTemplate?u.ObjectUtils.getJSXElement(e.itemTemplate,t,r):e.field?u.ObjectUtils.resolveFieldData(t,e.field):t,c=u.classNames("p-autocomplete-item",{"p-disabled":t.disabled});return g.createElement("li",{key:o,role:"option","aria-selected":i,className:c,style:l,onClick:function(n){return e.onItemClick(n,t)},"data-group":n,"data-index":r},a,g.createElement(p.Ripple,null))}))},a=function(t,n){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={height:l.props?l.props.itemSize:void 0};if(e.optionGroupLabel){var o=e.optionGroupTemplate?u.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),a=i(t,n,r),c=n+"_"+u.ObjectUtils.resolveFieldData(t,e.optionGroupLabel);return g.createElement(g.Fragment,{key:c},g.createElement("li",{className:"p-autocomplete-item-group",style:r},o),a)}var s=e.itemTemplate?u.ObjectUtils.getJSXElement(e.itemTemplate,t,n):e.field?u.ObjectUtils.resolveFieldData(t,e.field):t,m=u.classNames("p-autocomplete-item",{"p-disabled":t.disabled});return g.createElement("li",{key:n,role:"option","aria-selected":e.selectedItem===t,className:m,style:r,onClick:function(n){return e.onItemClick(n,t)}},s,g.createElement(p.Ripple,null))},d=function(){if(e.showEmptyMessage&&u.ObjectUtils.isEmpty(e.suggestions)){var t=e.emptyMessage||n.localeOption("emptyMessage");return g.createElement("ul",{className:"p-autocomplete-items"},g.createElement("li",{className:"p-autocomplete-item"},t))}if(e.virtualScrollerOptions){var l=H(H({},e.virtualScrollerOptions),{style:H(H({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),autoSize:!0,items:e.suggestions,itemTemplate:function(e,t){return e&&a(e,t.index,t)},contentTemplate:function(t){var n=u.classNames("p-autocomplete-items",t.className);return g.createElement("ul",{ref:t.contentRef,style:t.style,className:n,role:"listbox",id:e.listId},t.children)}});return g.createElement(m.VirtualScroller,b({ref:e.virtualScrollerRef},l))}var r=e.suggestions?e.suggestions.map(a):null;return g.createElement("ul",{className:"p-autocomplete-items",role:"listbox",id:e.listId},r)},f=(l=u.classNames("p-autocomplete-panel p-component",e.panelClassName,{"p-input-filled":"filled"===v.default.inputStyle,"p-ripple-disabled":!1===v.default.ripple}),r=H({maxHeight:e.scrollHeight},e.panelStyle||{}),o=d(),g.createElement(c.CSSTransition,{nodeRef:t,classNames:"p-connected-overlay",in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:e.onEnter,onEntering:e.onEntering,onEntered:e.onEntered,onExit:e.onExit,onExited:e.onExited},g.createElement("div",{ref:t,className:l,style:r,onClick:e.onClick},o)));return g.createElement(s.Portal,{element:f,appendTo:e.appendTo})})));T.displayName="AutoCompletePanel";var M=g.memo(g.forwardRef((function(e,t){var c=x.getProps(e),s=j(g.useState(c.id),2),p=s[0],m=s[1],d=j(g.useState(!1),2),f=d[0],y=d[1],w=j(g.useState(!1),2),S=w[0],D=w[1],I=j(g.useState(!1),2),k=I[0],U=I[1],N=g.useRef(null),P=g.useRef(null),H=g.useRef(c.inputRef),M=g.useRef(null),R=g.useRef(null),L=g.useRef(null),A=g.useRef(null),F=j(r.useOverlayListener({target:N,overlay:P,listener:function(e,t){t.valid&&("outside"===t.type?!_(e)&&Y():Y())},when:k}),2),G=F[0],K=F[1],_=function(e){return c.multiple?e.target===M.current||M.current.contains(e.target):e.target===H.current},z=function(e){L.current&&clearTimeout(L.current);var t=e.target.value;c.multiple||J(e,t),u.ObjectUtils.isEmpty(t)?(Y(),c.onClear&&c.onClear(e)):t.length>=c.minLength?L.current=setTimeout((function(){B(e,t,"input")}),c.delay):Y()},B=function(e,t,n){null!=t&&("input"===n&&0===t.trim().length||c.completeMethod&&(y(!0),c.completeMethod({originalEvent:e,query:t})))},q=function(e,t,n){if(c.multiple){if(H.current.value="",!se(t)&&(!c.value||!c.selectionLimit||c.value.length<c.selectionLimit)){var l=c.value?[].concat(h(r=c.value)||O(r)||E(r)||C(),[t]):[t];J(e,l)}}else X(t),J(e,t);var r;c.onSelect&&c.onSelect({originalEvent:e,value:t}),n||(u.DomHandler.focus(H.current),Y())},J=function(e,t){A&&u.ObjectUtils.deepEquals(A.current,t)||(c.onChange&&c.onChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:c.name,id:p,value:t}}),A.current=t)},V=function(e){if(e){if("string"==typeof e)return e;if(c.selectedItemTemplate){var t=u.ObjectUtils.getJSXElement(c.selectedItemTemplate,e);return t||e}if(c.field){var n=u.ObjectUtils.resolveFieldData(e,c.field);return null!=n?n:e}return e}return""},X=function(e){H.current.value=V(e)},Z=function(){U(!0)},Y=function(){U(!1),y(!1)},$=function(){u.DomHandler.alignOverlay(P.current,c.multiple?M.current:H.current,c.appendTo||v.default.appendTo)},Q=function(e){c.dropdownAutoFocus&&u.DomHandler.focus(H.current,c.dropdownAutoFocus),"blank"===c.dropdownMode?B(e,"","dropdown"):"current"===c.dropdownMode&&B(e,H.current.value,"dropdown"),c.onDropdownClick&&c.onDropdownClick({originalEvent:e,query:H.current.value})},W=function(e,t){var n=c.value[t],l=c.value.filter((function(e,n){return t!==n}));J(e,l),c.onUnselect&&c.onUnselect({originalEvent:e,value:n})},ee=function(e){if(k){var t=u.DomHandler.findSingle(P.current,"li.p-highlight");switch(e.which){case 40:if(t){var n=ne(t);n&&(u.DomHandler.addClass(n,"p-highlight"),u.DomHandler.removeClass(t,"p-highlight"),u.DomHandler.scrollInView(pe(),n))}else t=u.DomHandler.findSingle(P.current,"li"),u.DomHandler.hasClass(t,"p-autocomplete-item-group")&&(t=ne(t)),t&&u.DomHandler.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var l=le(t);l&&(u.DomHandler.addClass(l,"p-highlight"),u.DomHandler.removeClass(t,"p-highlight"),u.DomHandler.scrollInView(pe(),l))}e.preventDefault();break;case 13:t&&(te(e,t),Y(),e.preventDefault());break;case 27:Y(),e.preventDefault();break;case 9:t&&te(e,t),Y()}}if(c.multiple&&8===e.which)if(c.value&&c.value.length&&!H.current.value){var r=c.value[c.value.length-1],o=c.value.slice(0,-1);J(e,o),c.onUnselect&&c.onUnselect({originalEvent:e,value:r})}},te=function(e,t){c.optionGroupLabel?q(e,me(c.suggestions[t.dataset.group])[t.dataset.index]):q(e,c.suggestions[u.DomHandler.index(t)])},ne=function e(t){var n=t.nextElementSibling;return n?u.DomHandler.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},le=function e(t){var n=t.previousElementSibling;return n?u.DomHandler.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},re=function(e){D(!0),c.onFocus&&c.onFocus(e)},oe=function(e){var t=e.target.value.trim(),n=(c.suggestions||[]).find((function(e){var n=c.field?u.ObjectUtils.resolveFieldData(e,c.field):e;return n&&t===n.trim()}));n?q(e,n,!0):(H.current.value="",J(e,null),c.onClear&&c.onClear(e))},ie=function(e){D(!1),c.forceSelection&&oe(e),c.onBlur&&c.onBlur(e)},ae=function(e){u.DomHandler.focus(H.current),c.onClick&&c.onClick(e)},ue=function(e){re(e),u.DomHandler.addClass(M.current,"p-focus")},ce=function(e){ie(e),u.DomHandler.removeClass(M.current,"p-focus")},se=function(e){return!!c.value&&c.value.some((function(t){return u.ObjectUtils.equals(t,e)}))},pe=function(){return R.current?P.current.firstChild:P.current},me=function(e){return u.ObjectUtils.resolveFieldData(e,c.optionGroupChildren)};g.useEffect((function(){u.ObjectUtils.combinedRefs(H,c.inputRef)}),[H,c.inputRef]),r.useMountEffect((function(){p||m(u.UniqueComponentId()),c.autoFocus&&u.DomHandler.focus(H.current,c.autoFocus)})),r.useUpdateEffect((function(){f&&(u.ObjectUtils.isNotEmpty(c.suggestions)||c.showEmptyMessage?Z():Y(),y(!1))}),[c.suggestions]),r.useUpdateEffect((function(){H.current&&!c.multiple&&X(c.value),k&&$()})),r.useUnmountEffect((function(){L.current&&clearTimeout(L.current),u.ZIndexUtils.clear(P.current)})),g.useImperativeHandle(t,(function(){return{props:c,search:B,show:Z,hide:Y,focus:function(){return u.DomHandler.focus(H.current)},getElement:function(){return N.current},getOverlay:function(){return P.current},getInput:function(){return H.current},getVirtualScroller:function(){return R.current}}}));var de=function(){var e=V(c.value),t=k?p+"_list":null,n=u.classNames("p-autocomplete-input",c.inputClassName,{"p-autocomplete-dd-input":c.dropdown});return g.createElement(o.InputText,b({ref:H,id:c.inputId,type:c.type,name:c.name,defaultValue:e,role:"combobox","aria-autocomplete":"list","aria-controls":t,"aria-haspopup":"listbox","aria-expanded":k,className:n,style:c.inputStyle,autoComplete:"off",readOnly:c.readOnly,disabled:c.disabled,placeholder:c.placeholder,size:c.size,maxLength:c.maxLength,tabIndex:c.tabIndex,onBlur:ie,onFocus:re,onChange:z,onMouseDown:c.onMouseDown,onKeyUp:c.onKeyUp,onKeyDown:ee,onKeyPress:c.onKeyPress,onContextMenu:c.onContextMenu,onClick:c.onClick,onDoubleClick:c.onDblClick},ye))},fe=function(){var e=u.classNames("p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":c.disabled}),t=u.ObjectUtils.isNotEmpty(c.value)?c.value.map((function(e,t){return g.createElement("li",{key:t+"multi-item",className:"p-autocomplete-token p-highlight"},g.createElement("span",{className:"p-autocomplete-token-label"},V(e)),!c.disabled&&u.IconUtils.getJSXIcon(c.removeIcon,{className:"p-autocomplete-token-icon",onClick:function(e){return W(e,t)}},{props:c}))})):null,n=g.createElement("li",{className:"p-autocomplete-input-token"},g.createElement("input",b({ref:H,type:c.type,disabled:c.disabled,placeholder:c.placeholder,role:"combobox","aria-autocomplete":"list","aria-controls":k?p+"_list":null,"aria-haspopup":"listbox","aria-expanded":k,autoComplete:"off",readOnly:c.readOnly,tabIndex:c.tabIndex,onChange:z,id:c.inputId,name:c.name,style:c.inputStyle,className:c.inputClassName,maxLength:c.maxLength,onKeyUp:c.onKeyUp,onKeyDown:ee,onKeyPress:c.onKeyPress,onFocus:ue,onBlur:ce},ye)));return g.createElement("ul",{ref:M,className:e,onContextMenu:c.onContextMenu,onMouseDown:c.onMouseDown,onClick:ae,onDoubleClick:c.onDblClick},t,n)},ge=p+"_list",ve=u.ObjectUtils.isNotEmpty(c.tooltip),be=x.getOtherProps(c),ye=u.ObjectUtils.reduceKeys(be,u.DomHandler.ARIA_PROPS),he=u.classNames("p-autocomplete p-component p-inputwrapper",{"p-autocomplete-dd":c.dropdown,"p-autocomplete-multiple":c.multiple,"p-inputwrapper-filled":c.value,"p-inputwrapper-focus":S},c.className),Oe=f?g.createElement("i",{className:"p-autocomplete-loader pi pi-spinner pi-spin"}):null,Ee=c.multiple?fe():de(),Ce=function(){if(c.dropdown){var e=c.dropdownAriaLabel||c.placeholder||n.localeOption("choose");return g.createElement(l.Button,{type:"button",icon:c.dropdownIcon,className:"p-autocomplete-dropdown",disabled:c.disabled,onClick:Q,"aria-label":e})}return null}();return g.createElement(g.Fragment,null,g.createElement("span",b({ref:N,id:p,style:c.style,className:he},be),Ee,Oe,Ce,g.createElement(T,b({ref:P,virtualScrollerRef:R},c,{listId:ge,onItemClick:q,selectedItem:A,onClick:function(e){i.OverlayService.emit("overlay-click",{originalEvent:e,target:N.current})},getOptionGroupLabel:function(e){return c.optionGroupLabel?u.ObjectUtils.resolveFieldData(e,c.optionGroupLabel):e},getOptionGroupChildren:me,in:k,onEnter:function(){u.ZIndexUtils.set("overlay",P.current,v.default.autoZIndex,v.default.zIndex.overlay),$()},onEntering:function(){if(c.autoHighlight&&c.suggestions&&c.suggestions.length){var e=pe().firstChild.firstChild;u.DomHandler.addClass(e,"p-highlight")}},onEntered:function(){G(),c.onShow&&c.onShow()},onExit:function(){K()},onExited:function(){u.ZIndexUtils.clear(P.current),c.onHide&&c.onHide()}}))),ve&&g.createElement(a.Tooltip,b({target:N,content:c.tooltip},c.tooltipOptions)))})));return M.displayName="AutoComplete",e.AutoComplete=M,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.button,primereact.hooks,primereact.inputtext,primereact.overlayservice,primereact.tooltip,primereact.utils,primereact.csstransition,primereact.portal,primereact.ripple,primereact.virtualscroller);
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.autocomplete=function(e,t,n,r,l,o,i,a,u,c,s,p,m,d,f,g){"use strict";function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function v(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=v(t),h=b(n);function O(e){return O="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},O(e)}function E(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=E(e,"string");return"symbol"===O(t)?t:String(t)}function w(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){return j=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},j.apply(this,arguments)}function S(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 D(e){if(Array.isArray(e))return S(e)}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e,t){if(e){if("string"==typeof e)return S(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)?S(e,t):void 0}}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e){if(Array.isArray(e))return e}function U(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,o,i,a=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw l}}return a}}function N(){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 H(e,t){return P(e)||U(e,t)||x(e,t)||N()}var T={defaultProps:{__TYPE:"AutoComplete",id:null,appendTo:null,autoFocus:!1,autoHighlight:!1,className:null,completeMethod:null,delay:300,disabled:!1,dropdown:!1,dropdownAriaLabel:null,dropdownAutoFocus:!0,dropdownIcon:null,dropdownMode:"blank",emptyMessage:null,field:null,forceSelection:!1,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,loadingIcon:null,maxLength:null,minLength:1,multiple:!1,name:null,onBlur:null,onChange:null,onClear:null,onClick:null,onContextMenu:null,onDblClick:null,onDropdownClick:null,onFocus:null,onHide:null,onKeyPress:null,onKeyUp:null,onMouseDown:null,onSelect:null,onShow:null,onUnselect:null,optionGroupChildren:null,optionGroupLabel:null,optionGroupTemplate:null,panelClassName:null,panelStyle:null,placeholder:null,readOnly:!1,removeTokenIcon:null,scrollHeight:"200px",selectedItemTemplate:null,selectionLimit:null,showEmptyMessage:!1,size:null,style:null,suggestions:null,tabIndex:null,tooltip:null,tooltipOptions:null,transitionOptions:null,type:"text",value:null,virtualScrollerOptions:null,children:void 0},getProps:function(e){return u.ObjectUtils.getMergedProps(e,T.defaultProps)},getOtherProps:function(e){return u.ObjectUtils.getDiffProps(e,T.defaultProps)}};function M(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=y.memo(y.forwardRef((function(e,t){var r,l,o,i=function(t,n,r){return e.getOptionGroupChildren(t).map((function(t,l){var o=n+"_"+l,i=e.selectedItem===t,a=e.itemTemplate?u.ObjectUtils.getJSXElement(e.itemTemplate,t,l):e.field?u.ObjectUtils.resolveFieldData(t,e.field):t,c=u.classNames("p-autocomplete-item",{"p-disabled":t.disabled});return y.createElement("li",{key:o,role:"option","aria-selected":i,className:c,style:r,onClick:function(n){return e.onItemClick(n,t)},"data-group":n,"data-index":l},a,y.createElement(p.Ripple,null))}))},a=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l={height:r.props?r.props.itemSize:void 0};if(e.optionGroupLabel){var o=e.optionGroupTemplate?u.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),a=i(t,n,l),c=n+"_"+u.ObjectUtils.resolveFieldData(t,e.optionGroupLabel);return y.createElement(y.Fragment,{key:c},y.createElement("li",{className:"p-autocomplete-item-group",style:l},o),a)}var s=e.itemTemplate?u.ObjectUtils.getJSXElement(e.itemTemplate,t,n):e.field?u.ObjectUtils.resolveFieldData(t,e.field):t,m=u.classNames("p-autocomplete-item",{"p-disabled":t.disabled});return y.createElement("li",{key:n,role:"option","aria-selected":e.selectedItem===t,className:m,style:l,onClick:function(n){return e.onItemClick(n,t)}},s,y.createElement(p.Ripple,null))},d=function(){if(e.showEmptyMessage&&u.ObjectUtils.isEmpty(e.suggestions)){var t=e.emptyMessage||n.localeOption("emptyMessage");return y.createElement("ul",{className:"p-autocomplete-items"},y.createElement("li",{className:"p-autocomplete-item"},t))}if(e.virtualScrollerOptions){var r=R(R({},e.virtualScrollerOptions),{style:R(R({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),autoSize:!0,items:e.suggestions,itemTemplate:function(e,t){return e&&a(e,t.index,t)},contentTemplate:function(t){var n=u.classNames("p-autocomplete-items",t.className);return y.createElement("ul",{ref:t.contentRef,style:t.style,className:n,role:"listbox",id:e.listId},t.children)}});return y.createElement(m.VirtualScroller,j({ref:e.virtualScrollerRef},r))}var l=e.suggestions?e.suggestions.map(a):null;return y.createElement("ul",{className:"p-autocomplete-items",role:"listbox",id:e.listId},l)},f=(r=u.classNames("p-autocomplete-panel p-component",e.panelClassName,{"p-input-filled":"filled"===h.default.inputStyle,"p-ripple-disabled":!1===h.default.ripple}),l=R({maxHeight:e.scrollHeight},e.panelStyle||{}),o=d(),y.createElement(c.CSSTransition,{nodeRef:t,classNames:"p-connected-overlay",in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:e.onEnter,onEntering:e.onEntering,onEntered:e.onEntered,onExit:e.onExit,onExited:e.onExited},y.createElement("div",{ref:t,className:r,style:l,onClick:e.onClick},o)));return y.createElement(s.Portal,{element:f,appendTo:e.appendTo})})));function A(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?A(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}L.displayName="AutoCompletePanel";var G=y.memo(y.forwardRef((function(e,t){var c=T.getProps(e),s=H(y.useState(c.id),2),p=s[0],m=s[1],b=H(y.useState(!1),2),v=b[0],O=b[1],E=H(y.useState(!1),2),C=E[0],w=E[1],S=H(y.useState(!1),2),P=S[0],U=S[1],N=y.useRef(null),M=y.useRef(null),R=y.useRef(c.inputRef),A=y.useRef(null),G=y.useRef(null),K=y.useRef(null),_=y.useRef(null),z=H(l.useOverlayListener({target:N,overlay:M,listener:function(e,t){t.valid&&("outside"===t.type?!X(e)&&ee():ee())},when:P}),2),B=z[0],J=z[1],X=function(e){return c.multiple?e.target===A.current||A.current.contains(e.target):e.target===R.current},q=function(e){K.current&&clearTimeout(K.current);var t=e.target.value;c.multiple||Y(e,t),u.ObjectUtils.isEmpty(t)?(ee(),c.onClear&&c.onClear(e)):t.length>=c.minLength?K.current=setTimeout((function(){V(e,t,"input")}),c.delay):ee()},V=function(e,t,n){null!=t&&("input"===n&&0===t.trim().length||c.completeMethod&&(O(!0),c.completeMethod({originalEvent:e,query:t})))},Z=function(e,t,n){if(c.multiple){if(R.current.value="",!fe(t)&&(!c.value||!c.selectionLimit||c.value.length<c.selectionLimit)){var r=c.value?[].concat(D(l=c.value)||I(l)||x(l)||k(),[t]):[t];Y(e,r)}}else Q(t),Y(e,t);var l;c.onSelect&&c.onSelect({originalEvent:e,value:t}),n||(u.DomHandler.focus(R.current),ee())},Y=function(e,t){_&&u.ObjectUtils.deepEquals(_.current,t)||(c.onChange&&c.onChange({originalEvent:e,value:t,stopPropagation:function(){},preventDefault:function(){},target:{name:c.name,id:p,value:t}}),_.current=t)},$=function(e){if(e){if("string"==typeof e)return e;if(c.selectedItemTemplate){var t=u.ObjectUtils.getJSXElement(c.selectedItemTemplate,e);return t||e}if(c.field){var n=u.ObjectUtils.resolveFieldData(e,c.field);return null!=n?n:e}return e}return""},Q=function(e){R.current.value=$(e)},W=function(){U(!0)},ee=function(){U(!1),O(!1)},te=function(){u.DomHandler.alignOverlay(M.current,c.multiple?A.current:R.current,c.appendTo||h.default.appendTo)},ne=function(e){c.dropdownAutoFocus&&u.DomHandler.focus(R.current,c.dropdownAutoFocus),"blank"===c.dropdownMode?V(e,"","dropdown"):"current"===c.dropdownMode&&V(e,R.current.value,"dropdown"),c.onDropdownClick&&c.onDropdownClick({originalEvent:e,query:R.current.value})},re=function(e,t){var n=c.value[t],r=c.value.filter((function(e,n){return t!==n}));Y(e,r),c.onUnselect&&c.onUnselect({originalEvent:e,value:n})},le=function(e){if(P){var t=u.DomHandler.findSingle(M.current,"li.p-highlight");switch(e.which){case 40:if(t){var n=ie(t);n&&(u.DomHandler.addClass(n,"p-highlight"),u.DomHandler.removeClass(t,"p-highlight"),u.DomHandler.scrollInView(ge(),n))}else t=u.DomHandler.findSingle(M.current,"li"),u.DomHandler.hasClass(t,"p-autocomplete-item-group")&&(t=ie(t)),t&&u.DomHandler.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){var r=ae(t);r&&(u.DomHandler.addClass(r,"p-highlight"),u.DomHandler.removeClass(t,"p-highlight"),u.DomHandler.scrollInView(ge(),r))}e.preventDefault();break;case 13:t&&(oe(e,t),ee(),e.preventDefault());break;case 27:ee(),e.preventDefault();break;case 9:t&&oe(e,t),ee()}}if(c.multiple&&8===e.which)if(c.value&&c.value.length&&!R.current.value){var l=c.value[c.value.length-1],o=c.value.slice(0,-1);Y(e,o),c.onUnselect&&c.onUnselect({originalEvent:e,value:l})}},oe=function(e,t){c.optionGroupLabel?Z(e,be(c.suggestions[t.dataset.group])[t.dataset.index]):Z(e,c.suggestions[u.DomHandler.index(t)])},ie=function e(t){var n=t.nextElementSibling;return n?u.DomHandler.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},ae=function e(t){var n=t.previousElementSibling;return n?u.DomHandler.hasClass(n,"p-autocomplete-item-group")?e(n):n:null},ue=function(e){w(!0),c.onFocus&&c.onFocus(e)},ce=function(e){var t=e.target.value.trim(),n=(c.suggestions||[]).find((function(e){var n=c.field?u.ObjectUtils.resolveFieldData(e,c.field):e;return n&&t===n.trim()}));n?Z(e,n,!0):(R.current.value="",Y(e,null),c.onClear&&c.onClear(e))},se=function(e){w(!1),c.forceSelection&&ce(e),c.onBlur&&c.onBlur(e)},pe=function(e){u.DomHandler.focus(R.current),c.onClick&&c.onClick(e)},me=function(e){ue(e),u.DomHandler.addClass(A.current,"p-focus")},de=function(e){se(e),u.DomHandler.removeClass(A.current,"p-focus")},fe=function(e){return!!c.value&&c.value.some((function(t){return u.ObjectUtils.equals(t,e)}))},ge=function(){return G.current?M.current.firstChild:M.current},be=function(e){return u.ObjectUtils.resolveFieldData(e,c.optionGroupChildren)};y.useEffect((function(){u.ObjectUtils.combinedRefs(R,c.inputRef)}),[R,c.inputRef]),l.useMountEffect((function(){p||m(u.UniqueComponentId()),c.autoFocus&&u.DomHandler.focus(R.current,c.autoFocus)})),l.useUpdateEffect((function(){v&&(u.ObjectUtils.isNotEmpty(c.suggestions)||c.showEmptyMessage?W():ee(),O(!1))}),[c.suggestions]),l.useUpdateEffect((function(){R.current&&!c.multiple&&Q(c.value),P&&te()})),l.useUnmountEffect((function(){K.current&&clearTimeout(K.current),u.ZIndexUtils.clear(M.current)})),y.useImperativeHandle(t,(function(){return{props:c,search:V,show:W,hide:ee,focus:function(){return u.DomHandler.focus(R.current)},getElement:function(){return N.current},getOverlay:function(){return M.current},getInput:function(){return R.current},getVirtualScroller:function(){return G.current}}}));var ve=function(){var e=$(c.value),t=P?p+"_list":null,n=u.classNames("p-autocomplete-input",c.inputClassName,{"p-autocomplete-dd-input":c.dropdown});return y.createElement(o.InputText,j({ref:R,id:c.inputId,type:c.type,name:c.name,defaultValue:e,role:"combobox","aria-autocomplete":"list","aria-controls":t,"aria-haspopup":"listbox","aria-expanded":P,className:n,style:c.inputStyle,autoComplete:"off",readOnly:c.readOnly,disabled:c.disabled,placeholder:c.placeholder,size:c.size,maxLength:c.maxLength,tabIndex:c.tabIndex,onBlur:se,onFocus:ue,onChange:q,onMouseDown:c.onMouseDown,onKeyUp:c.onKeyUp,onKeyDown:le,onKeyPress:c.onKeyPress,onContextMenu:c.onContextMenu,onClick:c.onClick,onDoubleClick:c.onDblClick},Ce))},ye=function(){var e=u.classNames("p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":c.disabled}),t=u.ObjectUtils.isNotEmpty(c.value)?c.value.map((function(e,t){var n=t+"multi-item",r={className:"p-autocomplete-token-icon",onClick:function(e){return re(e,t)}},l=!c.disabled&&u.IconUtils.getJSXIcon(c.removeTokenIcon||y.createElement(f.TimesCircleIcon,r),F({},r),{props:c});return y.createElement("li",{key:n,className:"p-autocomplete-token p-highlight"},y.createElement("span",{className:"p-autocomplete-token-label"},$(e)),l)})):null,n=y.createElement("li",{className:"p-autocomplete-input-token"},y.createElement("input",j({ref:R,type:c.type,disabled:c.disabled,placeholder:c.placeholder,role:"combobox","aria-autocomplete":"list","aria-controls":P?p+"_list":null,"aria-haspopup":"listbox","aria-expanded":P,autoComplete:"off",readOnly:c.readOnly,tabIndex:c.tabIndex,onChange:q,id:c.inputId,name:c.name,style:c.inputStyle,className:c.inputClassName,maxLength:c.maxLength,onKeyUp:c.onKeyUp,onKeyDown:le,onKeyPress:c.onKeyPress,onFocus:me,onBlur:de},Ce)));return y.createElement("ul",{ref:A,className:e,onContextMenu:c.onContextMenu,onMouseDown:c.onMouseDown,onClick:pe,onDoubleClick:c.onDblClick},t,n)},he=p+"_list",Oe=u.ObjectUtils.isNotEmpty(c.tooltip),Ee=T.getOtherProps(c),Ce=u.ObjectUtils.reduceKeys(Ee,u.DomHandler.ARIA_PROPS),we=u.classNames("p-autocomplete p-component p-inputwrapper",{"p-autocomplete-dd":c.dropdown,"p-autocomplete-multiple":c.multiple,"p-inputwrapper-filled":c.value,"p-inputwrapper-focus":C},c.className),je=function(){if(v){var e="p-autocomplete-loader p-icon-spin";return u.IconUtils.getJSXIcon(c.loadingIcon||y.createElement(g.SpinnerIcon,{className:e}),{className:e},{props:c})}return null}(),Se=c.multiple?ye():ve(),De=function(){if(c.dropdown){var e=c.dropdownAriaLabel||c.placeholder||n.localeOption("choose");return y.createElement(r.Button,{type:"button",icon:c.dropdownIcon||y.createElement(d.ChevronDownIcon,null),className:"p-autocomplete-dropdown",disabled:c.disabled,onClick:ne,"aria-label":e})}return null}();return y.createElement(y.Fragment,null,y.createElement("span",j({ref:N,id:p,style:c.style,className:we},Ee),Se,je,De,y.createElement(L,j({ref:M,virtualScrollerRef:G},c,{listId:he,onItemClick:Z,selectedItem:_,onClick:function(e){i.OverlayService.emit("overlay-click",{originalEvent:e,target:N.current})},getOptionGroupLabel:function(e){return c.optionGroupLabel?u.ObjectUtils.resolveFieldData(e,c.optionGroupLabel):e},getOptionGroupChildren:be,in:P,onEnter:function(){u.ZIndexUtils.set("overlay",M.current,h.default.autoZIndex,h.default.zIndex.overlay),te()},onEntering:function(){if(c.autoHighlight&&c.suggestions&&c.suggestions.length){var e=ge().firstChild.firstChild;u.DomHandler.addClass(e,"p-highlight")}},onEntered:function(){B(),c.onShow&&c.onShow()},onExit:function(){J()},onExited:function(){u.ZIndexUtils.clear(M.current),c.onHide&&c.onHide()}}))),Oe&&y.createElement(a.Tooltip,j({target:N,content:c.tooltip},c.tooltipOptions)))})));return G.displayName="AutoComplete",e.AutoComplete=G,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.button,primereact.hooks,primereact.inputtext,primereact.overlayservice,primereact.tooltip,primereact.utils,primereact.csstransition,primereact.portal,primereact.ripple,primereact.virtualscroller,primereact.icons/chevrondown,primereact.icons/timescircle,primereact.icons/spinner);
|