primeng 18.0.0 → 18.0.2-patch.1
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.d.ts +7 -7
- package/autocomplete/autocomplete.d.ts +21 -8
- package/badge/badge.d.ts +1 -3
- package/basecomponent/basecomponent.d.ts +2 -5
- package/blockui/blockui.d.ts +10 -5
- package/breadcrumb/breadcrumb.d.ts +9 -6
- package/button/button.d.ts +10 -4
- package/calendar/calendar.d.ts +29 -15
- package/card/card.d.ts +12 -5
- package/carousel/carousel.d.ts +10 -4
- package/cascadeselect/cascadeselect.d.ts +18 -8
- package/checkbox/checkbox.d.ts +8 -4
- package/chip/chip.d.ts +9 -7
- package/chips/chips.d.ts +237 -0
- package/chips/chips.interface.d.ts +66 -0
- package/chips/index.d.ts +5 -0
- package/chips/public_api.d.ts +2 -0
- package/chips/style/chipsstyle.d.ts +69 -0
- package/confirmdialog/confirmdialog.d.ts +14 -5
- package/confirmpopup/confirmpopup.d.ts +11 -5
- package/contextmenu/contextmenu.d.ts +10 -6
- package/datepicker/datepicker.d.ts +113 -33
- package/dialog/dialog.d.ts +15 -4
- package/divider/divider.d.ts +1 -1
- package/dock/dock.d.ts +7 -4
- package/drawer/drawer.d.ts +18 -10
- package/dropdown/dropdown.d.ts +4 -3
- package/dynamicdialog/dynamicdialog.d.ts +1 -0
- package/editor/editor.d.ts +7 -3
- package/esm2022/accordion/accordion.mjs +58 -43
- package/esm2022/autocomplete/autocomplete.mjs +153 -92
- package/esm2022/badge/badge.mjs +39 -32
- package/esm2022/basecomponent/basecomponent.mjs +3 -26
- package/esm2022/blockui/blockui.mjs +38 -18
- package/esm2022/breadcrumb/breadcrumb.mjs +50 -32
- package/esm2022/button/button.mjs +55 -28
- package/esm2022/calendar/calendar.mjs +207 -143
- package/esm2022/card/card.mjs +96 -46
- package/esm2022/carousel/carousel.mjs +74 -42
- package/esm2022/cascadeselect/cascadeselect.mjs +100 -62
- package/esm2022/checkbox/checkbox.mjs +32 -14
- package/esm2022/chip/chip.mjs +117 -96
- package/esm2022/chips/chips.interface.mjs +2 -0
- package/esm2022/chips/chips.mjs +827 -0
- package/esm2022/chips/primeng-chips.mjs +5 -0
- package/esm2022/chips/public_api.mjs +3 -0
- package/esm2022/chips/style/chipsstyle.mjs +175 -0
- package/esm2022/confirmdialog/confirmdialog.mjs +96 -57
- package/esm2022/confirmpopup/confirmpopup.mjs +57 -29
- package/esm2022/contextmenu/contextmenu.mjs +51 -20
- package/esm2022/datepicker/datepicker.mjs +198 -156
- package/esm2022/dialog/dialog.mjs +98 -52
- package/esm2022/divider/divider.mjs +2 -4
- package/esm2022/dock/dock.mjs +31 -13
- package/esm2022/drawer/drawer.mjs +112 -70
- package/esm2022/dropdown/dropdown.mjs +13 -5
- package/esm2022/dynamicdialog/dynamicdialog-config.mjs +13 -13
- package/esm2022/dynamicdialog/dynamicdialog.mjs +9 -5
- package/esm2022/editor/editor.mjs +27 -11
- package/esm2022/fieldset/fieldset.mjs +61 -33
- package/esm2022/fileupload/fileupload.mjs +139 -89
- package/esm2022/galleria/galleria.mjs +18 -9
- package/esm2022/image/image.mjs +113 -66
- package/esm2022/imagecompare/imagecompare.mjs +31 -11
- package/esm2022/inplace/inplace.mjs +49 -24
- package/esm2022/inputmask/inputmask.mjs +30 -14
- package/esm2022/inputmask/style/inputmaskstyle.mjs +2 -2
- package/esm2022/inputnumber/inputnumber.mjs +55 -47
- package/esm2022/inputotp/inputotp.mjs +30 -11
- package/esm2022/listbox/listbox.mjs +137 -78
- package/esm2022/megamenu/megamenu.mjs +105 -59
- package/esm2022/menu/menu.mjs +26 -26
- package/esm2022/menubar/menubar.mjs +70 -35
- package/esm2022/message/message.mjs +50 -26
- package/esm2022/messages/messages.mjs +13 -4
- package/esm2022/metergroup/metergroup.mjs +63 -31
- package/esm2022/multiselect/multiselect.mjs +247 -156
- package/esm2022/orderlist/orderlist.mjs +125 -70
- package/esm2022/organizationchart/organizationchart.mjs +30 -14
- package/esm2022/overlay/overlay.mjs +27 -7
- package/esm2022/overlaypanel/overlaypanel.mjs +33 -10
- package/esm2022/paginator/paginator.mjs +92 -60
- package/esm2022/panel/panel.mjs +160 -100
- package/esm2022/panelmenu/panelmenu.mjs +55 -32
- package/esm2022/password/password.mjs +88 -49
- package/esm2022/picklist/picklist.mjs +363 -259
- package/esm2022/popover/popover.mjs +29 -12
- package/esm2022/progressbar/progressbar.mjs +27 -9
- package/esm2022/rating/rating.mjs +46 -22
- package/esm2022/scroller/scroller.mjs +47 -37
- package/esm2022/scrollpanel/scrollpanel.mjs +28 -9
- package/esm2022/scrolltop/scrolltop.mjs +17 -10
- package/esm2022/select/select.mjs +198 -119
- package/esm2022/selectbutton/selectbutton.mjs +26 -11
- package/esm2022/sidebar/sidebar.mjs +82 -60
- package/esm2022/speeddial/speeddial.mjs +54 -29
- package/esm2022/splitbutton/splitbutton.mjs +41 -18
- package/esm2022/splitter/splitter.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +27 -13
- package/esm2022/table/table.mjs +107 -96
- package/esm2022/tabmenu/tabmenu.mjs +54 -27
- package/esm2022/tabs/tablist.mjs +28 -20
- package/esm2022/tabview/tabview.mjs +106 -54
- package/esm2022/tag/tag.mjs +68 -44
- package/esm2022/tieredmenu/tieredmenu.mjs +44 -21
- package/esm2022/timeline/timeline.mjs +41 -17
- package/esm2022/toast/toast.mjs +31 -9
- package/esm2022/togglebutton/togglebutton.mjs +45 -30
- package/esm2022/toggleswitch/toggleswitch.mjs +28 -9
- package/esm2022/toolbar/toolbar.mjs +47 -21
- package/esm2022/tooltip/tooltip.mjs +35 -70
- package/esm2022/tree/tree.mjs +114 -97
- package/esm2022/treeselect/treeselect.mjs +156 -89
- package/esm2022/treetable/treetable.mjs +31 -12
- package/esm2022/usestyle/usestyle.mjs +2 -2
- package/fesm2022/primeng-accordion.mjs +59 -44
- package/fesm2022/primeng-accordion.mjs.map +1 -1
- package/fesm2022/primeng-animateonscroll.mjs +1 -1
- package/fesm2022/primeng-api.mjs +1 -1
- package/fesm2022/primeng-autocomplete.mjs +152 -91
- package/fesm2022/primeng-autocomplete.mjs.map +1 -1
- package/fesm2022/primeng-avatar.mjs +1 -1
- package/fesm2022/primeng-avatargroup.mjs +1 -1
- package/fesm2022/primeng-badge.mjs +40 -33
- package/fesm2022/primeng-badge.mjs.map +1 -1
- package/fesm2022/primeng-basecomponent.mjs +2 -25
- package/fesm2022/primeng-basecomponent.mjs.map +1 -1
- package/fesm2022/primeng-blockui.mjs +37 -17
- package/fesm2022/primeng-blockui.mjs.map +1 -1
- package/fesm2022/primeng-breadcrumb.mjs +49 -31
- package/fesm2022/primeng-breadcrumb.mjs.map +1 -1
- package/fesm2022/primeng-button.mjs +54 -27
- package/fesm2022/primeng-button.mjs.map +1 -1
- package/fesm2022/primeng-buttongroup.mjs +1 -1
- package/fesm2022/primeng-calendar.mjs +207 -143
- package/fesm2022/primeng-calendar.mjs.map +1 -1
- package/fesm2022/primeng-card.mjs +95 -45
- package/fesm2022/primeng-card.mjs.map +1 -1
- package/fesm2022/primeng-carousel.mjs +73 -41
- package/fesm2022/primeng-carousel.mjs.map +1 -1
- package/fesm2022/primeng-cascadeselect.mjs +99 -61
- package/fesm2022/primeng-cascadeselect.mjs.map +1 -1
- package/fesm2022/primeng-chart.mjs +1 -1
- package/fesm2022/primeng-checkbox.mjs +31 -13
- package/fesm2022/primeng-checkbox.mjs.map +1 -1
- package/fesm2022/primeng-chip.mjs +116 -95
- package/fesm2022/primeng-chip.mjs.map +1 -1
- package/fesm2022/primeng-chips.mjs +1006 -0
- package/fesm2022/primeng-chips.mjs.map +1 -0
- package/fesm2022/primeng-colorpicker.mjs +1 -1
- package/fesm2022/primeng-confirmdialog.mjs +95 -56
- package/fesm2022/primeng-confirmdialog.mjs.map +1 -1
- package/fesm2022/primeng-confirmpopup.mjs +57 -29
- package/fesm2022/primeng-confirmpopup.mjs.map +1 -1
- package/fesm2022/primeng-contextmenu.mjs +50 -19
- package/fesm2022/primeng-contextmenu.mjs.map +1 -1
- package/fesm2022/primeng-dataview.mjs +2 -2
- package/fesm2022/primeng-datepicker.mjs +198 -156
- package/fesm2022/primeng-datepicker.mjs.map +1 -1
- package/fesm2022/primeng-defer.mjs +1 -1
- package/fesm2022/primeng-dialog.mjs +97 -51
- package/fesm2022/primeng-dialog.mjs.map +1 -1
- package/fesm2022/primeng-divider.mjs +2 -4
- package/fesm2022/primeng-divider.mjs.map +1 -1
- package/fesm2022/primeng-dock.mjs +30 -12
- package/fesm2022/primeng-dock.mjs.map +1 -1
- package/fesm2022/primeng-dragdrop.mjs +1 -1
- package/fesm2022/primeng-drawer.mjs +111 -69
- package/fesm2022/primeng-drawer.mjs.map +1 -1
- package/fesm2022/primeng-dropdown.mjs +12 -4
- package/fesm2022/primeng-dropdown.mjs.map +1 -1
- package/fesm2022/primeng-dynamicdialog.mjs +21 -17
- package/fesm2022/primeng-dynamicdialog.mjs.map +1 -1
- package/fesm2022/primeng-editor.mjs +26 -10
- package/fesm2022/primeng-editor.mjs.map +1 -1
- package/fesm2022/primeng-fieldset.mjs +61 -33
- package/fesm2022/primeng-fieldset.mjs.map +1 -1
- package/fesm2022/primeng-fileupload.mjs +138 -88
- package/fesm2022/primeng-fileupload.mjs.map +1 -1
- package/fesm2022/primeng-floatlabel.mjs +1 -1
- package/fesm2022/primeng-fluid.mjs +1 -1
- package/fesm2022/primeng-galleria.mjs +17 -8
- package/fesm2022/primeng-galleria.mjs.map +1 -1
- package/fesm2022/primeng-iconfield.mjs +1 -1
- package/fesm2022/primeng-icons-baseicon.mjs +1 -1
- package/fesm2022/primeng-iftalabel.mjs +1 -1
- package/fesm2022/primeng-image.mjs +112 -65
- package/fesm2022/primeng-image.mjs.map +1 -1
- package/fesm2022/primeng-imagecompare.mjs +30 -10
- package/fesm2022/primeng-imagecompare.mjs.map +1 -1
- package/fesm2022/primeng-inplace.mjs +48 -23
- package/fesm2022/primeng-inplace.mjs.map +1 -1
- package/fesm2022/primeng-inputgroupaddon.mjs +1 -1
- package/fesm2022/primeng-inputicon.mjs +1 -1
- package/fesm2022/primeng-inputmask.mjs +30 -14
- package/fesm2022/primeng-inputmask.mjs.map +1 -1
- package/fesm2022/primeng-inputnumber.mjs +54 -46
- package/fesm2022/primeng-inputnumber.mjs.map +1 -1
- package/fesm2022/primeng-inputotp.mjs +29 -10
- package/fesm2022/primeng-inputotp.mjs.map +1 -1
- package/fesm2022/primeng-inputswitch.mjs +1 -1
- package/fesm2022/primeng-inputtext.mjs +1 -1
- package/fesm2022/primeng-inputtextarea.mjs +1 -1
- package/fesm2022/primeng-keyfilter.mjs +1 -1
- package/fesm2022/primeng-knob.mjs +1 -1
- package/fesm2022/primeng-listbox.mjs +136 -77
- package/fesm2022/primeng-listbox.mjs.map +1 -1
- package/fesm2022/primeng-megamenu.mjs +104 -58
- package/fesm2022/primeng-megamenu.mjs.map +1 -1
- package/fesm2022/primeng-menu.mjs +26 -26
- package/fesm2022/primeng-menu.mjs.map +1 -1
- package/fesm2022/primeng-menubar.mjs +69 -34
- package/fesm2022/primeng-menubar.mjs.map +1 -1
- package/fesm2022/primeng-message.mjs +49 -25
- package/fesm2022/primeng-message.mjs.map +1 -1
- package/fesm2022/primeng-messages.mjs +12 -3
- package/fesm2022/primeng-messages.mjs.map +1 -1
- package/fesm2022/primeng-metergroup.mjs +62 -30
- package/fesm2022/primeng-metergroup.mjs.map +1 -1
- package/fesm2022/primeng-multiselect.mjs +246 -155
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-orderlist.mjs +124 -69
- package/fesm2022/primeng-orderlist.mjs.map +1 -1
- package/fesm2022/primeng-organizationchart.mjs +30 -14
- package/fesm2022/primeng-organizationchart.mjs.map +1 -1
- package/fesm2022/primeng-overlay.mjs +26 -6
- package/fesm2022/primeng-overlay.mjs.map +1 -1
- package/fesm2022/primeng-overlaybadge.mjs +1 -1
- package/fesm2022/primeng-overlaypanel.mjs +33 -10
- package/fesm2022/primeng-overlaypanel.mjs.map +1 -1
- package/fesm2022/primeng-paginator.mjs +91 -59
- package/fesm2022/primeng-paginator.mjs.map +1 -1
- package/fesm2022/primeng-panel.mjs +160 -100
- package/fesm2022/primeng-panel.mjs.map +1 -1
- package/fesm2022/primeng-panelmenu.mjs +55 -32
- package/fesm2022/primeng-panelmenu.mjs.map +1 -1
- package/fesm2022/primeng-password.mjs +87 -48
- package/fesm2022/primeng-password.mjs.map +1 -1
- package/fesm2022/primeng-picklist.mjs +362 -258
- package/fesm2022/primeng-picklist.mjs.map +1 -1
- package/fesm2022/primeng-popover.mjs +29 -12
- package/fesm2022/primeng-popover.mjs.map +1 -1
- package/fesm2022/primeng-progressbar.mjs +26 -8
- package/fesm2022/primeng-progressbar.mjs.map +1 -1
- package/fesm2022/primeng-progressspinner.mjs +1 -1
- package/fesm2022/primeng-radiobutton.mjs +1 -1
- package/fesm2022/primeng-rating.mjs +45 -21
- package/fesm2022/primeng-rating.mjs.map +1 -1
- package/fesm2022/primeng-scroller.mjs +46 -36
- package/fesm2022/primeng-scroller.mjs.map +1 -1
- package/fesm2022/primeng-scrollpanel.mjs +27 -8
- package/fesm2022/primeng-scrollpanel.mjs.map +1 -1
- package/fesm2022/primeng-scrolltop.mjs +17 -10
- package/fesm2022/primeng-scrolltop.mjs.map +1 -1
- package/fesm2022/primeng-select.mjs +197 -118
- package/fesm2022/primeng-select.mjs.map +1 -1
- package/fesm2022/primeng-selectbutton.mjs +25 -10
- package/fesm2022/primeng-selectbutton.mjs.map +1 -1
- package/fesm2022/primeng-sidebar.mjs +81 -59
- package/fesm2022/primeng-sidebar.mjs.map +1 -1
- package/fesm2022/primeng-skeleton.mjs +1 -1
- package/fesm2022/primeng-slider.mjs +1 -1
- package/fesm2022/primeng-speeddial.mjs +53 -28
- package/fesm2022/primeng-speeddial.mjs.map +1 -1
- package/fesm2022/primeng-splitbutton.mjs +40 -17
- package/fesm2022/primeng-splitbutton.mjs.map +1 -1
- package/fesm2022/primeng-splitter.mjs +6 -6
- package/fesm2022/primeng-splitter.mjs.map +1 -1
- package/fesm2022/primeng-stepper.mjs +27 -13
- package/fesm2022/primeng-stepper.mjs.map +1 -1
- package/fesm2022/primeng-steps.mjs +1 -1
- package/fesm2022/primeng-styleclass.mjs +1 -1
- package/fesm2022/primeng-table.mjs +107 -96
- package/fesm2022/primeng-table.mjs.map +1 -1
- package/fesm2022/primeng-tabmenu.mjs +53 -26
- package/fesm2022/primeng-tabmenu.mjs.map +1 -1
- package/fesm2022/primeng-tabs.mjs +27 -19
- package/fesm2022/primeng-tabs.mjs.map +1 -1
- package/fesm2022/primeng-tabview.mjs +106 -54
- package/fesm2022/primeng-tabview.mjs.map +1 -1
- package/fesm2022/primeng-tag.mjs +67 -43
- package/fesm2022/primeng-tag.mjs.map +1 -1
- package/fesm2022/primeng-terminal.mjs +1 -1
- package/fesm2022/primeng-textarea.mjs +1 -1
- package/fesm2022/primeng-tieredmenu.mjs +43 -20
- package/fesm2022/primeng-tieredmenu.mjs.map +1 -1
- package/fesm2022/primeng-timeline.mjs +40 -16
- package/fesm2022/primeng-timeline.mjs.map +1 -1
- package/fesm2022/primeng-toast.mjs +31 -9
- package/fesm2022/primeng-toast.mjs.map +1 -1
- package/fesm2022/primeng-togglebutton.mjs +44 -29
- package/fesm2022/primeng-togglebutton.mjs.map +1 -1
- package/fesm2022/primeng-toggleswitch.mjs +27 -8
- package/fesm2022/primeng-toggleswitch.mjs.map +1 -1
- package/fesm2022/primeng-toolbar.mjs +46 -20
- package/fesm2022/primeng-toolbar.mjs.map +1 -1
- package/fesm2022/primeng-tooltip.mjs +35 -70
- package/fesm2022/primeng-tooltip.mjs.map +1 -1
- package/fesm2022/primeng-tree.mjs +114 -97
- package/fesm2022/primeng-tree.mjs.map +1 -1
- package/fesm2022/primeng-treeselect.mjs +155 -88
- package/fesm2022/primeng-treeselect.mjs.map +1 -1
- package/fesm2022/primeng-treetable.mjs +30 -11
- package/fesm2022/primeng-treetable.mjs.map +1 -1
- package/fesm2022/primeng-usestyle.mjs +1 -1
- package/fesm2022/primeng-usestyle.mjs.map +1 -1
- package/fieldset/fieldset.d.ts +12 -6
- package/fileupload/fileupload.d.ts +19 -8
- package/galleria/galleria.d.ts +3 -2
- package/image/image.d.ts +18 -7
- package/imagecompare/imagecompare.d.ts +7 -2
- package/inplace/inplace.d.ts +12 -6
- package/inputmask/inputmask.d.ts +8 -4
- package/inputnumber/inputnumber.d.ts +11 -6
- package/inputotp/inputotp.d.ts +7 -2
- package/listbox/listbox.d.ts +17 -4
- package/megamenu/megamenu.d.ts +16 -7
- package/menu/menu.d.ts +6 -6
- package/menubar/menubar.d.ts +13 -6
- package/message/message.d.ts +10 -4
- package/messages/messages.d.ts +4 -3
- package/metergroup/metergroup.d.ts +11 -3
- package/multiselect/multiselect.d.ts +36 -17
- package/orderlist/orderlist.d.ts +23 -11
- package/organizationchart/organizationchart.d.ts +6 -4
- package/overlay/overlay.d.ts +6 -3
- package/overlaypanel/overlaypanel.d.ts +6 -3
- package/package.json +171 -165
- package/paginator/paginator.d.ts +15 -8
- package/panel/panel.d.ts +14 -5
- package/panelmenu/panelmenu.d.ts +8 -4
- package/password/password.d.ts +15 -7
- package/picklist/picklist.d.ts +23 -3
- package/popover/popover.d.ts +8 -5
- package/progressbar/progressbar.d.ts +7 -3
- package/rating/rating.d.ts +11 -5
- package/scroller/scroller.d.ts +9 -4
- package/scrollpanel/scrollpanel.d.ts +7 -3
- package/scrolltop/scrolltop.d.ts +7 -4
- package/select/select.d.ts +31 -13
- package/selectbutton/selectbutton.d.ts +7 -3
- package/sidebar/sidebar.d.ts +9 -2
- package/speeddial/speeddial.d.ts +9 -4
- package/splitbutton/splitbutton.d.ts +9 -5
- package/splitter/splitter.d.ts +4 -4
- package/stepper/stepper.d.ts +8 -3
- package/table/table.d.ts +2 -2
- package/tabmenu/tabmenu.d.ts +12 -7
- package/tabs/tablist.d.ts +6 -2
- package/tabview/tabview.d.ts +16 -7
- package/tag/tag.d.ts +8 -9
- package/tieredmenu/tieredmenu.d.ts +10 -6
- package/timeline/timeline.d.ts +7 -2
- package/toast/toast.d.ts +7 -3
- package/togglebutton/togglebutton.d.ts +8 -3
- package/toggleswitch/toggleswitch.d.ts +6 -2
- package/toolbar/toolbar.d.ts +9 -4
- package/tooltip/tooltip.d.ts +2 -1
- package/tree/tree.d.ts +23 -10
- package/treeselect/treeselect.d.ts +26 -12
- package/treetable/treetable.d.ts +7 -5
@@ -0,0 +1,1006 @@
|
|
1
|
+
import * as i2 from '@angular/common';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { Injectable, forwardRef, EventEmitter, inject, booleanAttribute, numberAttribute, ViewEncapsulation, ChangeDetectionStrategy, Component, ContentChildren, ViewChild, Output, Input, NgModule } from '@angular/core';
|
5
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
6
|
+
import { SharedModule, PrimeTemplate } from 'primeng/api';
|
7
|
+
import * as i3 from 'primeng/autofocus';
|
8
|
+
import { AutoFocusModule } from 'primeng/autofocus';
|
9
|
+
import { TimesIcon } from 'primeng/icons/times';
|
10
|
+
import { TimesCircleIcon } from 'primeng/icons/timescircle';
|
11
|
+
import { InputTextModule } from 'primeng/inputtext';
|
12
|
+
import { UniqueComponentId } from 'primeng/utils';
|
13
|
+
import { BaseStyle } from 'primeng/base';
|
14
|
+
import { BaseComponent } from 'primeng/basecomponent';
|
15
|
+
import * as i4 from 'primeng/chip';
|
16
|
+
import { ChipModule } from 'primeng/chip';
|
17
|
+
import * as i1 from 'primeng/config';
|
18
|
+
|
19
|
+
const theme = ({ dt }) => `
|
20
|
+
.p-inputchips {
|
21
|
+
display: inline-flex;
|
22
|
+
}
|
23
|
+
|
24
|
+
.p-inputchips-input {
|
25
|
+
margin: 0;
|
26
|
+
list-style-type: none;
|
27
|
+
cursor: text;
|
28
|
+
overflow: hidden;
|
29
|
+
display: flex;
|
30
|
+
position: relative;
|
31
|
+
align-items: center;
|
32
|
+
flex-wrap: wrap;
|
33
|
+
padding: calc(${dt('inputchips.padding.y')} / 2) ${dt('inputchips.padding.x')};
|
34
|
+
gap: calc(${dt('inputchips.padding.y')} / 2);
|
35
|
+
color: ${dt('inputchips.color')};
|
36
|
+
background: ${dt('inputchips.background')};
|
37
|
+
border: 1px solid ${dt('inputchips.border.color')};
|
38
|
+
border-radius: ${dt('inputchips.border.radius')};
|
39
|
+
width: 100%;
|
40
|
+
transition: background ${dt('inputchips.transition.duration')}, color ${dt('inputchips.transition.duration')}, border-color ${dt('inputchips.transition.duration')}, outline-color ${dt('inputchips.transition.duration')}, box-shadow ${dt('inputchips.transition.duration')};
|
41
|
+
outline-color: transparent;
|
42
|
+
box-shadow: ${dt('inputchips.shadow')};
|
43
|
+
}
|
44
|
+
|
45
|
+
.p-inputchips:not(.p-disabled):hover .p-inputchips-input {
|
46
|
+
border-color: ${dt('inputchips.hover.border.color')};
|
47
|
+
}
|
48
|
+
|
49
|
+
.p-inputchips:not(.p-disabled).p-focus .p-inputchips-input {
|
50
|
+
border-color: ${dt('inputchips.focus.border.color')};
|
51
|
+
box-shadow: ${dt('inputchips.focus.ring.shadow')};
|
52
|
+
outline: ${dt('inputchips.focus.ring.width')} ${dt('inputchips.focus.ring.style')} ${dt('inputchips.focus.ring.color')};
|
53
|
+
outline-offset: ${dt('inputchips.focus.ring.offset')};
|
54
|
+
}
|
55
|
+
|
56
|
+
.p-inputchips.p-invalid .p-inputchips-input {
|
57
|
+
border-color: ${dt('inputchips.invalid.border.color')};
|
58
|
+
}
|
59
|
+
|
60
|
+
.p-variant-filled.p-inputchips-input {
|
61
|
+
background: ${dt('inputchips.filled.background')};
|
62
|
+
}
|
63
|
+
|
64
|
+
.p-inputchips:not(.p-disabled).p-focus .p-variant-filled.p-inputchips-input {
|
65
|
+
background: ${dt('inputchips.filled.focus.background')};
|
66
|
+
}
|
67
|
+
|
68
|
+
.p-inputchips.p-disabled .p-inputchips-input {
|
69
|
+
opacity: 1;
|
70
|
+
background: ${dt('inputchips.disabled.background')};
|
71
|
+
color: ${dt('inputchips.disabled.color')};
|
72
|
+
}
|
73
|
+
|
74
|
+
.p-inputchips-chip.p-chip {
|
75
|
+
padding-top: calc(${dt('inputchips.padding.y')} / 2);
|
76
|
+
padding-bottom: calc(${dt('inputchips.padding.y')} / 2);
|
77
|
+
border-radius: ${dt('inputchips.chip.border.radius')};
|
78
|
+
transition: background ${dt('inputchips.transition.duration')}, color ${dt('inputchips.transition.duration')};
|
79
|
+
}
|
80
|
+
|
81
|
+
.p-inputchips-chip-item.p-focus .p-inputchips-chip {
|
82
|
+
background: ${dt('inputchips.chip.focus.background')};
|
83
|
+
color: ${dt('inputchips.chip.focus.color')};
|
84
|
+
}
|
85
|
+
|
86
|
+
.p-inputchips-input:has(.p-inputchips-chip) {
|
87
|
+
padding-left: calc(${dt('inputchips.padding.y')} / 2);
|
88
|
+
padding-right: calc(${dt('inputchips.padding.y')} / 2);
|
89
|
+
}
|
90
|
+
|
91
|
+
.p-inputchips-input-item {
|
92
|
+
flex: 1 1 auto;
|
93
|
+
display: inline-flex;
|
94
|
+
padding-top: calc(${dt('inputchips.padding.y')} / 2);
|
95
|
+
padding-bottom: calc(${dt('inputchips.padding.y')} / 2);
|
96
|
+
}
|
97
|
+
|
98
|
+
.p-inputchips-input-item input {
|
99
|
+
border: 0 none;
|
100
|
+
outline: 0 none;
|
101
|
+
background: transparent;
|
102
|
+
margin: 0;
|
103
|
+
padding: 0;
|
104
|
+
box-shadow: none;
|
105
|
+
border-radius: 0;
|
106
|
+
width: 100%;
|
107
|
+
font-family: inherit;
|
108
|
+
font-feature-settings: inherit;
|
109
|
+
font-size: 1rem;
|
110
|
+
color: inherit;
|
111
|
+
}
|
112
|
+
|
113
|
+
.p-inputchips-input-item input::placeholder {
|
114
|
+
color: ${dt('inputchips.placeholder.color')};
|
115
|
+
}
|
116
|
+
|
117
|
+
/* For PrimeNG */
|
118
|
+
|
119
|
+
.p-chips-clear-icon {
|
120
|
+
position: absolute;
|
121
|
+
top: 50%;
|
122
|
+
margin-top: -0.5rem;
|
123
|
+
cursor: pointer;
|
124
|
+
right: ${dt('inputchips.padding.x')};
|
125
|
+
}
|
126
|
+
`;
|
127
|
+
const classes = {
|
128
|
+
root: ({ instance, props }) => [
|
129
|
+
'p-inputchips p-component p-inputwrapper',
|
130
|
+
{
|
131
|
+
'p-disabled': props.disabled,
|
132
|
+
'p-invalid': props.invalid,
|
133
|
+
'p-focus': instance.focused,
|
134
|
+
'p-inputwrapper-filled': (props.modelValue && props.modelValue.length) || (instance.inputValue && instance.inputValue.length),
|
135
|
+
'p-inputwrapper-focus': instance.focused
|
136
|
+
}
|
137
|
+
],
|
138
|
+
input: ({ props, instance }) => [
|
139
|
+
'p-inputchips-input',
|
140
|
+
{
|
141
|
+
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.config.inputStyle === 'filled' || instance.config.inputVariant === 'filled'
|
142
|
+
}
|
143
|
+
],
|
144
|
+
chipItem: ({ state, index }) => ['p-inputchips-chip-item', { 'p-focus': state.focusedIndex === index }],
|
145
|
+
pcChip: 'p-inputchips-chip',
|
146
|
+
chipIcon: 'p-inputchips-chip-icon',
|
147
|
+
inputItem: 'p-inputchips-input-item'
|
148
|
+
};
|
149
|
+
class ChipsStyle extends BaseStyle {
|
150
|
+
name = 'inputchips';
|
151
|
+
theme = theme;
|
152
|
+
classes = classes;
|
153
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵChipsStyle_BaseFactory; return function ChipsStyle_Factory(__ngFactoryType__) { return (ɵChipsStyle_BaseFactory || (ɵChipsStyle_BaseFactory = i0.ɵɵgetInheritedFactory(ChipsStyle)))(__ngFactoryType__ || ChipsStyle); }; })();
|
154
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ChipsStyle, factory: ChipsStyle.ɵfac });
|
155
|
+
}
|
156
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChipsStyle, [{
|
157
|
+
type: Injectable
|
158
|
+
}], null, null); })();
|
159
|
+
/**
|
160
|
+
*
|
161
|
+
* Chips is used to enter multiple values on an input field.
|
162
|
+
*
|
163
|
+
*
|
164
|
+
* @module chipsstyle
|
165
|
+
*
|
166
|
+
*/
|
167
|
+
var ChipsClasses;
|
168
|
+
(function (ChipsClasses) {
|
169
|
+
/**
|
170
|
+
* Class name of the root element
|
171
|
+
*/
|
172
|
+
ChipsClasses["root"] = "p-chip";
|
173
|
+
/**
|
174
|
+
* Class name of the image element
|
175
|
+
*/
|
176
|
+
ChipsClasses["image"] = "p-chip-image";
|
177
|
+
/**
|
178
|
+
* Class name of the icon element
|
179
|
+
*/
|
180
|
+
ChipsClasses["icon"] = "p-chip-icon";
|
181
|
+
/**
|
182
|
+
* Class name of the label element
|
183
|
+
*/
|
184
|
+
ChipsClasses["label"] = "p-chip-label";
|
185
|
+
/**
|
186
|
+
* Class name of the remove icon element
|
187
|
+
*/
|
188
|
+
ChipsClasses["removeIcon"] = "p-chip-remove-icon";
|
189
|
+
})(ChipsClasses || (ChipsClasses = {}));
|
190
|
+
|
191
|
+
const _c0 = ["inputtext"];
|
192
|
+
const _c1 = ["container"];
|
193
|
+
const _c2 = (a0, a1, a2, a3) => ({ "p-inputchips p-component p-input-wrapper": true, "p-disabled": a0, "p-focus": a1, "p-inputwrapper-filled": a2, "p-inputwrapper-focus": a3 });
|
194
|
+
const _c3 = a0 => ({ "p-chips-clearable": a0 });
|
195
|
+
const _c4 = a0 => ({ "p-inputchips-chip-item": true, "p-focus": a0 });
|
196
|
+
const _c5 = a0 => ({ $implicit: a0 });
|
197
|
+
const _c6 = a0 => ({ removeItem: a0 });
|
198
|
+
function Chips_li_3_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
199
|
+
i0.ɵɵelementContainer(0);
|
200
|
+
} }
|
201
|
+
function Chips_li_3_p_chip_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
202
|
+
i0.ɵɵelementContainer(0);
|
203
|
+
} }
|
204
|
+
function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_TimesCircleIcon_1_Template(rf, ctx) { if (rf & 1) {
|
205
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
206
|
+
i0.ɵɵelementStart(0, "TimesCircleIcon", 16);
|
207
|
+
i0.ɵɵlistener("click", function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_TimesCircleIcon_1_Template_TimesCircleIcon_click_0_listener($event) { i0.ɵɵrestoreView(_r7); const i_r6 = i0.ɵɵnextContext(4).index; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.removeItem($event, i_r6)); });
|
208
|
+
i0.ɵɵelementEnd();
|
209
|
+
} if (rf & 2) {
|
210
|
+
i0.ɵɵproperty("styleClass", "p-chips-token-icon");
|
211
|
+
i0.ɵɵattribute("data-pc-section", "removeTokenIcon")("aria-hidden", true);
|
212
|
+
} }
|
213
|
+
function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_1_ng_template_0_Template(rf, ctx) { }
|
214
|
+
function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_1_Template(rf, ctx) { if (rf & 1) {
|
215
|
+
i0.ɵɵtemplate(0, Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_1_ng_template_0_Template, 0, 0, "ng-template");
|
216
|
+
} }
|
217
|
+
function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_Template(rf, ctx) { if (rf & 1) {
|
218
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
219
|
+
i0.ɵɵelementStart(0, "span", 17);
|
220
|
+
i0.ɵɵlistener("click", function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_Template_span_click_0_listener($event) { i0.ɵɵrestoreView(_r8); const i_r6 = i0.ɵɵnextContext(4).index; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.removeItem($event, i_r6)); });
|
221
|
+
i0.ɵɵtemplate(1, Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_1_Template, 1, 0, null, 11);
|
222
|
+
i0.ɵɵelementEnd();
|
223
|
+
} if (rf & 2) {
|
224
|
+
const ctx_r3 = i0.ɵɵnextContext(5);
|
225
|
+
i0.ɵɵattribute("data-pc-section", "removeTokenIcon")("aria-hidden", true);
|
226
|
+
i0.ɵɵadvance();
|
227
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.removeTokenIconTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c6, ctx_r3.removeItem.bind(ctx_r3)));
|
228
|
+
} }
|
229
|
+
function Chips_li_3_p_chip_3_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
230
|
+
i0.ɵɵelementContainerStart(0);
|
231
|
+
i0.ɵɵtemplate(1, Chips_li_3_p_chip_3_ng_template_2_ng_container_0_TimesCircleIcon_1_Template, 1, 3, "TimesCircleIcon", 14)(2, Chips_li_3_p_chip_3_ng_template_2_ng_container_0_span_2_Template, 2, 6, "span", 15);
|
232
|
+
i0.ɵɵelementContainerEnd();
|
233
|
+
} if (rf & 2) {
|
234
|
+
const ctx_r3 = i0.ɵɵnextContext(4);
|
235
|
+
i0.ɵɵadvance();
|
236
|
+
i0.ɵɵproperty("ngIf", !ctx_r3.removeTokenIconTemplate);
|
237
|
+
i0.ɵɵadvance();
|
238
|
+
i0.ɵɵproperty("ngIf", ctx_r3.removeTokenIconTemplate);
|
239
|
+
} }
|
240
|
+
function Chips_li_3_p_chip_3_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
241
|
+
i0.ɵɵtemplate(0, Chips_li_3_p_chip_3_ng_template_2_ng_container_0_Template, 3, 2, "ng-container", 9);
|
242
|
+
} if (rf & 2) {
|
243
|
+
const ctx_r3 = i0.ɵɵnextContext(3);
|
244
|
+
i0.ɵɵproperty("ngIf", !ctx_r3.disabled);
|
245
|
+
} }
|
246
|
+
function Chips_li_3_p_chip_3_Template(rf, ctx) { if (rf & 1) {
|
247
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
248
|
+
i0.ɵɵelementStart(0, "p-chip", 13);
|
249
|
+
i0.ɵɵlistener("onRemove", function Chips_li_3_p_chip_3_Template_p_chip_onRemove_0_listener($event) { i0.ɵɵrestoreView(_r5); const i_r6 = i0.ɵɵnextContext().index; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.removeItem($event, i_r6)); });
|
250
|
+
i0.ɵɵtemplate(1, Chips_li_3_p_chip_3_ng_container_1_Template, 1, 0, "ng-container", 11)(2, Chips_li_3_p_chip_3_ng_template_2_Template, 1, 1, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
|
251
|
+
i0.ɵɵelementEnd();
|
252
|
+
} if (rf & 2) {
|
253
|
+
const item_r3 = i0.ɵɵnextContext().$implicit;
|
254
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
255
|
+
i0.ɵɵproperty("label", ctx_r3.field ? ctx_r3.resolveFieldData(item_r3, ctx_r3.field) : item_r3)("removeIcon", ctx_r3.chipIcon);
|
256
|
+
i0.ɵɵadvance();
|
257
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.itemTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(4, _c5, item_r3));
|
258
|
+
} }
|
259
|
+
function Chips_li_3_Template(rf, ctx) { if (rf & 1) {
|
260
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
261
|
+
i0.ɵɵelementStart(0, "li", 10, 2);
|
262
|
+
i0.ɵɵlistener("click", function Chips_li_3_Template_li_click_0_listener($event) { const item_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.onItemClick($event, item_r3)); })("contextmenu", function Chips_li_3_Template_li_contextmenu_0_listener($event) { const item_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.onItemContextMenu($event, item_r3)); });
|
263
|
+
i0.ɵɵtemplate(2, Chips_li_3_ng_container_2_Template, 1, 0, "ng-container", 11)(3, Chips_li_3_p_chip_3_Template, 4, 6, "p-chip", 12);
|
264
|
+
i0.ɵɵelementEnd();
|
265
|
+
} if (rf & 2) {
|
266
|
+
const item_r3 = ctx.$implicit;
|
267
|
+
const i_r6 = ctx.index;
|
268
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
269
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c4, ctx_r3.focusedIndex === i_r6));
|
270
|
+
i0.ɵɵattribute("id", ctx_r3.id + "_chips_item_" + i_r6)("ariaLabel", item_r3)("aria-selected", true)("aria-setsize", ctx_r3.value.length)("aria-posinset", i_r6 + 1)("data-p-focused", ctx_r3.focusedIndex === i_r6)("data-pc-section", "token");
|
271
|
+
i0.ɵɵadvance(2);
|
272
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.itemTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(13, _c5, item_r3));
|
273
|
+
i0.ɵɵadvance();
|
274
|
+
i0.ɵɵproperty("ngIf", !ctx_r3.itemTemplate);
|
275
|
+
} }
|
276
|
+
function Chips_li_7_TimesIcon_1_Template(rf, ctx) { if (rf & 1) {
|
277
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
278
|
+
i0.ɵɵelementStart(0, "TimesIcon", 16);
|
279
|
+
i0.ɵɵlistener("click", function Chips_li_7_TimesIcon_1_Template_TimesIcon_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.clear()); });
|
280
|
+
i0.ɵɵelementEnd();
|
281
|
+
} if (rf & 2) {
|
282
|
+
i0.ɵɵproperty("styleClass", "p-chips-clear-icon");
|
283
|
+
} }
|
284
|
+
function Chips_li_7_span_2_1_ng_template_0_Template(rf, ctx) { }
|
285
|
+
function Chips_li_7_span_2_1_Template(rf, ctx) { if (rf & 1) {
|
286
|
+
i0.ɵɵtemplate(0, Chips_li_7_span_2_1_ng_template_0_Template, 0, 0, "ng-template");
|
287
|
+
} }
|
288
|
+
function Chips_li_7_span_2_Template(rf, ctx) { if (rf & 1) {
|
289
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
290
|
+
i0.ɵɵelementStart(0, "span", 19);
|
291
|
+
i0.ɵɵlistener("click", function Chips_li_7_span_2_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.clear()); });
|
292
|
+
i0.ɵɵtemplate(1, Chips_li_7_span_2_1_Template, 1, 0, null, 20);
|
293
|
+
i0.ɵɵelementEnd();
|
294
|
+
} if (rf & 2) {
|
295
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
296
|
+
i0.ɵɵadvance();
|
297
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.clearIconTemplate);
|
298
|
+
} }
|
299
|
+
function Chips_li_7_Template(rf, ctx) { if (rf & 1) {
|
300
|
+
i0.ɵɵelementStart(0, "li");
|
301
|
+
i0.ɵɵtemplate(1, Chips_li_7_TimesIcon_1_Template, 1, 1, "TimesIcon", 14)(2, Chips_li_7_span_2_Template, 2, 1, "span", 18);
|
302
|
+
i0.ɵɵelementEnd();
|
303
|
+
} if (rf & 2) {
|
304
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
305
|
+
i0.ɵɵadvance();
|
306
|
+
i0.ɵɵproperty("ngIf", !ctx_r3.clearIconTemplate);
|
307
|
+
i0.ɵɵadvance();
|
308
|
+
i0.ɵɵproperty("ngIf", ctx_r3.clearIconTemplate);
|
309
|
+
} }
|
310
|
+
const CHIPS_VALUE_ACCESSOR = {
|
311
|
+
provide: NG_VALUE_ACCESSOR,
|
312
|
+
useExisting: forwardRef(() => Chips),
|
313
|
+
multi: true
|
314
|
+
};
|
315
|
+
/**
|
316
|
+
* Chips groups a collection of contents in tabs.
|
317
|
+
* @group Components
|
318
|
+
*/
|
319
|
+
class Chips extends BaseComponent {
|
320
|
+
el;
|
321
|
+
cd;
|
322
|
+
config;
|
323
|
+
/**
|
324
|
+
* Inline style of the element.
|
325
|
+
* @group Props
|
326
|
+
*/
|
327
|
+
style;
|
328
|
+
/**
|
329
|
+
* Style class of the element.
|
330
|
+
* @group Props
|
331
|
+
*/
|
332
|
+
styleClass;
|
333
|
+
/**
|
334
|
+
* When present, it specifies that the element should be disabled.
|
335
|
+
* @group Props
|
336
|
+
*/
|
337
|
+
disabled;
|
338
|
+
/**
|
339
|
+
* Name of the property to display on a chip.
|
340
|
+
* @group Props
|
341
|
+
*/
|
342
|
+
field;
|
343
|
+
/**
|
344
|
+
* Advisory information to display on input.
|
345
|
+
* @group Props
|
346
|
+
*/
|
347
|
+
placeholder;
|
348
|
+
/**
|
349
|
+
* Maximum number of entries allowed.
|
350
|
+
* @group Props
|
351
|
+
*/
|
352
|
+
max;
|
353
|
+
/**
|
354
|
+
* Maximum length of a chip.
|
355
|
+
* @group Props
|
356
|
+
*/
|
357
|
+
maxLength;
|
358
|
+
/**
|
359
|
+
* Defines a string that labels the input for accessibility.
|
360
|
+
* @group Props
|
361
|
+
*/
|
362
|
+
ariaLabel;
|
363
|
+
/**
|
364
|
+
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
365
|
+
* @group Props
|
366
|
+
*/
|
367
|
+
ariaLabelledBy;
|
368
|
+
/**
|
369
|
+
* Index of the element in tabbing order.
|
370
|
+
* @group Props
|
371
|
+
*/
|
372
|
+
tabindex;
|
373
|
+
/**
|
374
|
+
* Identifier of the focus input to match a label defined for the component.
|
375
|
+
* @group Props
|
376
|
+
*/
|
377
|
+
inputId;
|
378
|
+
/**
|
379
|
+
* Whether to allow duplicate values or not.
|
380
|
+
* @group Props
|
381
|
+
*/
|
382
|
+
allowDuplicate = true;
|
383
|
+
/**
|
384
|
+
* Defines whether duplication check should be case-sensitive
|
385
|
+
* @group Props
|
386
|
+
*/
|
387
|
+
caseSensitiveDuplication = true;
|
388
|
+
/**
|
389
|
+
* Inline style of the input field.
|
390
|
+
* @group Props
|
391
|
+
*/
|
392
|
+
inputStyle;
|
393
|
+
/**
|
394
|
+
* Style class of the input field.
|
395
|
+
* @group Props
|
396
|
+
*/
|
397
|
+
inputStyleClass;
|
398
|
+
/**
|
399
|
+
* Icon to display in chip remove action..
|
400
|
+
* @group Props
|
401
|
+
*/
|
402
|
+
chipIcon;
|
403
|
+
/**
|
404
|
+
* Whether to add an item on tab key press.
|
405
|
+
* @group Props
|
406
|
+
*/
|
407
|
+
addOnTab;
|
408
|
+
/**
|
409
|
+
* Whether to add an item when the input loses focus.
|
410
|
+
* @group Props
|
411
|
+
*/
|
412
|
+
addOnBlur;
|
413
|
+
/**
|
414
|
+
* Separator char to add an item when pressed in addition to the enter key.
|
415
|
+
* @group Props
|
416
|
+
*/
|
417
|
+
separator;
|
418
|
+
/**
|
419
|
+
* When enabled, a clear icon is displayed to clear the value.
|
420
|
+
* @group Props
|
421
|
+
*/
|
422
|
+
showClear = false;
|
423
|
+
/**
|
424
|
+
* When present, it specifies that the component should automatically get focus on load.
|
425
|
+
* @group Props
|
426
|
+
*/
|
427
|
+
autofocus;
|
428
|
+
/**
|
429
|
+
* Specifies the input variant of the component.
|
430
|
+
* @group Props
|
431
|
+
*/
|
432
|
+
variant = 'outlined';
|
433
|
+
/**
|
434
|
+
* Callback to invoke on chip add.
|
435
|
+
* @param {ChipsAddEvent} event - Custom chip add event.
|
436
|
+
* @group Emits
|
437
|
+
*/
|
438
|
+
onAdd = new EventEmitter();
|
439
|
+
/**
|
440
|
+
* Callback to invoke on chip remove.
|
441
|
+
* @param {ChipsRemoveEvent} event - Custom chip remove event.
|
442
|
+
* @group Emits
|
443
|
+
*/
|
444
|
+
onRemove = new EventEmitter();
|
445
|
+
/**
|
446
|
+
* Callback to invoke on focus of input field.
|
447
|
+
* @param {Event} event - Browser event.
|
448
|
+
* @group Emits
|
449
|
+
*/
|
450
|
+
onFocus = new EventEmitter();
|
451
|
+
/**
|
452
|
+
* Callback to invoke on blur of input field.
|
453
|
+
* @param {Event} event - Browser event.
|
454
|
+
* @group Emits
|
455
|
+
*/
|
456
|
+
onBlur = new EventEmitter();
|
457
|
+
/**
|
458
|
+
* Callback to invoke on chip clicked.
|
459
|
+
* @param {ChipsClickEvent} event - Custom chip click event.
|
460
|
+
* @group Emits
|
461
|
+
*/
|
462
|
+
onChipClick = new EventEmitter();
|
463
|
+
/**
|
464
|
+
* Callback to invoke on chip contextmenu.
|
465
|
+
* @param {ChipsClickEvent} event - Custom chip contextmenu event.
|
466
|
+
* @group Emits
|
467
|
+
*/
|
468
|
+
onChipContextMenu = new EventEmitter();
|
469
|
+
/**
|
470
|
+
* Callback to invoke on clear token clicked.
|
471
|
+
* @group Emits
|
472
|
+
*/
|
473
|
+
onClear = new EventEmitter();
|
474
|
+
inputViewChild;
|
475
|
+
containerViewChild;
|
476
|
+
templates;
|
477
|
+
itemTemplate;
|
478
|
+
removeTokenIconTemplate;
|
479
|
+
clearIconTemplate;
|
480
|
+
value;
|
481
|
+
onModelChange = () => { };
|
482
|
+
onModelTouched = () => { };
|
483
|
+
valueChanged;
|
484
|
+
id = UniqueComponentId();
|
485
|
+
focused;
|
486
|
+
focusedIndex;
|
487
|
+
filled;
|
488
|
+
_componentStyle = inject(ChipsStyle);
|
489
|
+
get focusedOptionId() {
|
490
|
+
return this.focusedIndex !== null ? `${this.id}_chips_item_${this.focusedIndex}` : null;
|
491
|
+
}
|
492
|
+
get isMaxedOut() {
|
493
|
+
return this.max && this.value && this.max === this.value.length;
|
494
|
+
}
|
495
|
+
constructor(el, cd, config) {
|
496
|
+
super();
|
497
|
+
this.el = el;
|
498
|
+
this.cd = cd;
|
499
|
+
this.config = config;
|
500
|
+
console.log('Deprecated since v18. Use AutoComplete component instead with its typeahead property.');
|
501
|
+
}
|
502
|
+
ngAfterContentInit() {
|
503
|
+
this.templates.forEach((item) => {
|
504
|
+
switch (item.getType()) {
|
505
|
+
case 'item':
|
506
|
+
this.itemTemplate = item.template;
|
507
|
+
break;
|
508
|
+
case 'removetokenicon':
|
509
|
+
this.removeTokenIconTemplate = item.template;
|
510
|
+
break;
|
511
|
+
case 'clearicon':
|
512
|
+
this.clearIconTemplate = item.template;
|
513
|
+
break;
|
514
|
+
default:
|
515
|
+
this.itemTemplate = item.template;
|
516
|
+
break;
|
517
|
+
}
|
518
|
+
});
|
519
|
+
this.updateFilledState();
|
520
|
+
}
|
521
|
+
onWrapperClick() {
|
522
|
+
this.inputViewChild?.nativeElement.focus();
|
523
|
+
}
|
524
|
+
onContainerFocus() {
|
525
|
+
this.focused = true;
|
526
|
+
}
|
527
|
+
onContainerBlur() {
|
528
|
+
this.focusedIndex = -1;
|
529
|
+
this.focused = false;
|
530
|
+
}
|
531
|
+
onContainerKeyDown(event) {
|
532
|
+
switch (event.code) {
|
533
|
+
case 'ArrowLeft':
|
534
|
+
this.onArrowLeftKeyOn();
|
535
|
+
break;
|
536
|
+
case 'ArrowRight':
|
537
|
+
this.onArrowRightKeyOn();
|
538
|
+
break;
|
539
|
+
case 'Backspace':
|
540
|
+
this.onBackspaceKeyOn(event);
|
541
|
+
break;
|
542
|
+
case 'Space':
|
543
|
+
if (this.focusedIndex !== null && this.value && this.value.length > 0) {
|
544
|
+
this.onItemClick(event, this.value[this.focusedIndex]);
|
545
|
+
}
|
546
|
+
break;
|
547
|
+
default:
|
548
|
+
break;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
onArrowLeftKeyOn() {
|
552
|
+
if (this.inputViewChild.nativeElement.value.length === 0 && this.value && this.value.length > 0) {
|
553
|
+
this.focusedIndex = this.focusedIndex === null ? this.value.length - 1 : this.focusedIndex - 1;
|
554
|
+
if (this.focusedIndex < 0)
|
555
|
+
this.focusedIndex = 0;
|
556
|
+
}
|
557
|
+
}
|
558
|
+
onArrowRightKeyOn() {
|
559
|
+
if (this.inputViewChild.nativeElement.value.length === 0 && this.value && this.value.length > 0) {
|
560
|
+
if (this.focusedIndex === this.value.length - 1) {
|
561
|
+
this.focusedIndex = null;
|
562
|
+
this.inputViewChild?.nativeElement.focus();
|
563
|
+
}
|
564
|
+
else {
|
565
|
+
this.focusedIndex++;
|
566
|
+
}
|
567
|
+
}
|
568
|
+
}
|
569
|
+
onBackspaceKeyOn(event) {
|
570
|
+
if (this.focusedIndex !== null) {
|
571
|
+
this.removeItem(event, this.focusedIndex);
|
572
|
+
}
|
573
|
+
}
|
574
|
+
onInput() {
|
575
|
+
this.updateFilledState();
|
576
|
+
this.focusedIndex = null;
|
577
|
+
}
|
578
|
+
onPaste(event) {
|
579
|
+
if (!this.disabled) {
|
580
|
+
if (this.separator) {
|
581
|
+
const pastedData = (event.clipboardData || this.document.defaultView['clipboardData']).getData('Text');
|
582
|
+
pastedData.split(this.separator).forEach((val) => {
|
583
|
+
this.addItem(event, val, true);
|
584
|
+
});
|
585
|
+
this.inputViewChild.nativeElement.value = '';
|
586
|
+
}
|
587
|
+
this.updateFilledState();
|
588
|
+
}
|
589
|
+
}
|
590
|
+
updateFilledState() {
|
591
|
+
if (!this.value || this.value.length === 0) {
|
592
|
+
this.filled = this.inputViewChild && this.inputViewChild.nativeElement && this.inputViewChild.nativeElement.value != '';
|
593
|
+
}
|
594
|
+
else {
|
595
|
+
this.filled = true;
|
596
|
+
}
|
597
|
+
}
|
598
|
+
onItemClick(event, item) {
|
599
|
+
this.onChipClick.emit({
|
600
|
+
originalEvent: event,
|
601
|
+
value: item
|
602
|
+
});
|
603
|
+
}
|
604
|
+
onItemContextMenu(event, item) {
|
605
|
+
this.onChipContextMenu.emit({
|
606
|
+
originalEvent: event,
|
607
|
+
value: item
|
608
|
+
});
|
609
|
+
}
|
610
|
+
writeValue(value) {
|
611
|
+
this.value = value;
|
612
|
+
this.updateMaxedOut();
|
613
|
+
this.updateFilledState();
|
614
|
+
this.cd.markForCheck();
|
615
|
+
}
|
616
|
+
registerOnChange(fn) {
|
617
|
+
this.onModelChange = fn;
|
618
|
+
}
|
619
|
+
registerOnTouched(fn) {
|
620
|
+
this.onModelTouched = fn;
|
621
|
+
}
|
622
|
+
setDisabledState(val) {
|
623
|
+
this.disabled = val;
|
624
|
+
this.cd.markForCheck();
|
625
|
+
}
|
626
|
+
resolveFieldData(data, field) {
|
627
|
+
if (data && field) {
|
628
|
+
if (field.indexOf('.') == -1) {
|
629
|
+
return data[field];
|
630
|
+
}
|
631
|
+
else {
|
632
|
+
let fields = field.split('.');
|
633
|
+
let value = data;
|
634
|
+
for (var i = 0, len = fields.length; i < len; ++i) {
|
635
|
+
value = value[fields[i]];
|
636
|
+
}
|
637
|
+
return value;
|
638
|
+
}
|
639
|
+
}
|
640
|
+
else {
|
641
|
+
return null;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
onInputFocus(event) {
|
645
|
+
this.focused = true;
|
646
|
+
this.focusedIndex = null;
|
647
|
+
this.onFocus.emit(event);
|
648
|
+
}
|
649
|
+
onInputBlur(event) {
|
650
|
+
this.focused = false;
|
651
|
+
this.focusedIndex = null;
|
652
|
+
if (this.addOnBlur && this.inputViewChild.nativeElement.value) {
|
653
|
+
this.addItem(event, this.inputViewChild.nativeElement.value, false);
|
654
|
+
}
|
655
|
+
this.onModelTouched();
|
656
|
+
this.onBlur.emit(event);
|
657
|
+
}
|
658
|
+
removeItem(event, index) {
|
659
|
+
if (this.disabled) {
|
660
|
+
return;
|
661
|
+
}
|
662
|
+
let removedItem = this.value[index];
|
663
|
+
this.value = this.value.filter((val, i) => i != index);
|
664
|
+
this.focusedIndex = null;
|
665
|
+
this.inputViewChild.nativeElement.focus();
|
666
|
+
this.onModelChange(this.value);
|
667
|
+
this.onRemove.emit({
|
668
|
+
originalEvent: event,
|
669
|
+
value: removedItem
|
670
|
+
});
|
671
|
+
this.updateFilledState();
|
672
|
+
this.updateMaxedOut();
|
673
|
+
}
|
674
|
+
addItem(event, item, preventDefault) {
|
675
|
+
this.value = this.value || [];
|
676
|
+
if (item && item.trim().length) {
|
677
|
+
const newItemIsDuplicate = this.caseSensitiveDuplication ? this.value.includes(item) : this.value.some((val) => val.toLowerCase() === item.toLowerCase());
|
678
|
+
if ((this.allowDuplicate || !newItemIsDuplicate) && !this.isMaxedOut) {
|
679
|
+
this.value = [...this.value, item];
|
680
|
+
this.onModelChange(this.value);
|
681
|
+
this.onAdd.emit({
|
682
|
+
originalEvent: event,
|
683
|
+
value: item
|
684
|
+
});
|
685
|
+
}
|
686
|
+
}
|
687
|
+
this.updateFilledState();
|
688
|
+
this.updateMaxedOut();
|
689
|
+
this.inputViewChild.nativeElement.value = '';
|
690
|
+
if (preventDefault) {
|
691
|
+
event.preventDefault();
|
692
|
+
}
|
693
|
+
}
|
694
|
+
/**
|
695
|
+
* Callback to invoke on filter reset.
|
696
|
+
* @group Method
|
697
|
+
*/
|
698
|
+
clear() {
|
699
|
+
this.value = null;
|
700
|
+
this.updateFilledState();
|
701
|
+
this.onModelChange(this.value);
|
702
|
+
this.updateMaxedOut();
|
703
|
+
this.onClear.emit();
|
704
|
+
}
|
705
|
+
onKeyDown(event) {
|
706
|
+
const inputValue = event.target.value;
|
707
|
+
switch (event.code) {
|
708
|
+
case 'Backspace':
|
709
|
+
if (inputValue.length === 0 && this.value && this.value.length > 0) {
|
710
|
+
if (this.focusedIndex !== null) {
|
711
|
+
this.removeItem(event, this.focusedIndex);
|
712
|
+
}
|
713
|
+
else
|
714
|
+
this.removeItem(event, this.value.length - 1);
|
715
|
+
}
|
716
|
+
break;
|
717
|
+
case 'Enter':
|
718
|
+
case 'NumpadEnter':
|
719
|
+
if (inputValue && inputValue.trim().length && !this.isMaxedOut) {
|
720
|
+
this.addItem(event, inputValue, true);
|
721
|
+
}
|
722
|
+
break;
|
723
|
+
case 'Tab':
|
724
|
+
if (this.addOnTab && inputValue && inputValue.trim().length && !this.isMaxedOut) {
|
725
|
+
this.addItem(event, inputValue, true);
|
726
|
+
event.preventDefault();
|
727
|
+
}
|
728
|
+
break;
|
729
|
+
case 'ArrowLeft':
|
730
|
+
if (inputValue.length === 0 && this.value && this.value.length > 0) {
|
731
|
+
this.containerViewChild?.nativeElement.focus();
|
732
|
+
}
|
733
|
+
break;
|
734
|
+
case 'ArrowRight':
|
735
|
+
event.stopPropagation();
|
736
|
+
break;
|
737
|
+
default:
|
738
|
+
if (this.separator) {
|
739
|
+
if (this.separator === event.key || event.key.match(this.separator)) {
|
740
|
+
this.addItem(event, inputValue, true);
|
741
|
+
}
|
742
|
+
}
|
743
|
+
break;
|
744
|
+
}
|
745
|
+
}
|
746
|
+
updateMaxedOut() {
|
747
|
+
if (this.inputViewChild && this.inputViewChild.nativeElement) {
|
748
|
+
if (this.isMaxedOut) {
|
749
|
+
// Calling `blur` is necessary because firefox does not call `onfocus` events
|
750
|
+
// for disabled inputs, unlike chromium browsers.
|
751
|
+
this.inputViewChild.nativeElement.blur();
|
752
|
+
this.inputViewChild.nativeElement.disabled = true;
|
753
|
+
}
|
754
|
+
else {
|
755
|
+
if (this.disabled) {
|
756
|
+
this.inputViewChild.nativeElement.blur();
|
757
|
+
}
|
758
|
+
this.inputViewChild.nativeElement.disabled = this.disabled || false;
|
759
|
+
}
|
760
|
+
}
|
761
|
+
}
|
762
|
+
static ɵfac = function Chips_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Chips)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.PrimeNG)); };
|
763
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Chips, selectors: [["p-chips"]], contentQueries: function Chips_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
764
|
+
i0.ɵɵcontentQuery(dirIndex, PrimeTemplate, 4);
|
765
|
+
} if (rf & 2) {
|
766
|
+
let _t;
|
767
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templates = _t);
|
768
|
+
} }, viewQuery: function Chips_Query(rf, ctx) { if (rf & 1) {
|
769
|
+
i0.ɵɵviewQuery(_c0, 5);
|
770
|
+
i0.ɵɵviewQuery(_c1, 5);
|
771
|
+
} if (rf & 2) {
|
772
|
+
let _t;
|
773
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputViewChild = _t.first);
|
774
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.containerViewChild = _t.first);
|
775
|
+
} }, hostAttrs: [1, "p-element", "p-inputwrapper"], hostVars: 6, hostBindings: function Chips_HostBindings(rf, ctx) { if (rf & 2) {
|
776
|
+
i0.ɵɵclassProp("p-inputwrapper-filled", ctx.filled)("p-inputwrapper-focus", ctx.focused)("p-chips-clearable", ctx.showClear);
|
777
|
+
} }, inputs: { style: "style", styleClass: "styleClass", disabled: [2, "disabled", "disabled", booleanAttribute], field: "field", placeholder: "placeholder", max: [2, "max", "max", numberAttribute], maxLength: "maxLength", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", tabindex: [2, "tabindex", "tabindex", numberAttribute], inputId: "inputId", allowDuplicate: [2, "allowDuplicate", "allowDuplicate", booleanAttribute], caseSensitiveDuplication: [2, "caseSensitiveDuplication", "caseSensitiveDuplication", booleanAttribute], inputStyle: "inputStyle", inputStyleClass: "inputStyleClass", chipIcon: "chipIcon", addOnTab: [2, "addOnTab", "addOnTab", booleanAttribute], addOnBlur: [2, "addOnBlur", "addOnBlur", booleanAttribute], separator: "separator", showClear: [2, "showClear", "showClear", booleanAttribute], autofocus: [2, "autofocus", "autofocus", booleanAttribute], variant: "variant" }, outputs: { onAdd: "onAdd", onRemove: "onRemove", onFocus: "onFocus", onBlur: "onBlur", onChipClick: "onChipClick", onChipContextMenu: "onChipContextMenu", onClear: "onClear" }, standalone: true, features: [i0.ɵɵProvidersFeature([CHIPS_VALUE_ACCESSOR, ChipsStyle]), i0.ɵɵInputTransformsFeature, i0.ɵɵInheritDefinitionFeature, i0.ɵɵStandaloneFeature], decls: 8, vars: 31, consts: [["container", ""], ["inputtext", ""], ["token", ""], ["removeicon", ""], [3, "ngClass", "ngStyle"], ["tabindex", "-1", "role", "listbox", 1, "p-inputchips-input", 3, "click", "focus", "blur", "keydown"], ["role", "option", 3, "ngClass", "click", "contextmenu", 4, "ngFor", "ngForOf"], ["role", "option", 1, "p-inputchips-input-item", 3, "ngClass"], ["type", "text", "pAutoFocus", "", 1, "test", 3, "keydown", "input", "paste", "focus", "blur", "disabled", "ngStyle", "autofocus"], [4, "ngIf"], ["role", "option", 3, "click", "contextmenu", "ngClass"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], ["class", "p-inputchips-chip", "removable", "", 3, "label", "removeIcon", "onRemove", 4, "ngIf"], ["removable", "", 1, "p-inputchips-chip", 3, "onRemove", "label", "removeIcon"], [3, "styleClass", "click", 4, "ngIf"], ["class", "p-chips-token-icon", 3, "click", 4, "ngIf"], [3, "click", "styleClass"], [1, "p-chips-token-icon", 3, "click"], ["class", "p-chips-clear-icon", 3, "click", 4, "ngIf"], [1, "p-chips-clear-icon", 3, "click"], [4, "ngTemplateOutlet"]], template: function Chips_Template(rf, ctx) { if (rf & 1) {
|
778
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
779
|
+
i0.ɵɵelementStart(0, "div", 4)(1, "ul", 5, 0);
|
780
|
+
i0.ɵɵlistener("click", function Chips_Template_ul_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onWrapperClick()); })("focus", function Chips_Template_ul_focus_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onContainerFocus()); })("blur", function Chips_Template_ul_blur_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onContainerBlur()); })("keydown", function Chips_Template_ul_keydown_1_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onContainerKeyDown($event)); });
|
781
|
+
i0.ɵɵtemplate(3, Chips_li_3_Template, 4, 15, "li", 6);
|
782
|
+
i0.ɵɵelementStart(4, "li", 7)(5, "input", 8, 1);
|
783
|
+
i0.ɵɵlistener("keydown", function Chips_Template_input_keydown_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onKeyDown($event)); })("input", function Chips_Template_input_input_5_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onInput()); })("paste", function Chips_Template_input_paste_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onPaste($event)); })("focus", function Chips_Template_input_focus_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onInputFocus($event)); })("blur", function Chips_Template_input_blur_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onInputBlur($event)); });
|
784
|
+
i0.ɵɵelementEnd()();
|
785
|
+
i0.ɵɵtemplate(7, Chips_li_7_Template, 3, 2, "li", 9);
|
786
|
+
i0.ɵɵelementEnd()();
|
787
|
+
} if (rf & 2) {
|
788
|
+
i0.ɵɵclassMap(ctx.styleClass);
|
789
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction4(24, _c2, ctx.disabled, ctx.focused, ctx.value && ctx.value.length || (ctx.inputViewChild == null ? null : ctx.inputViewChild.nativeElement.value) && (ctx.inputViewChild == null ? null : ctx.inputViewChild.nativeElement.value.length), ctx.focused))("ngStyle", ctx.style);
|
790
|
+
i0.ɵɵattribute("data-pc-name", "chips")("data-pc-section", "root");
|
791
|
+
i0.ɵɵadvance();
|
792
|
+
i0.ɵɵattribute("aria-labelledby", ctx.ariaLabelledBy)("aria-label", ctx.ariaLabel)("aria-activedescendant", ctx.focused ? ctx.focusedOptionId : undefined)("aria-orientation", "horizontal")("data-pc-section", "container");
|
793
|
+
i0.ɵɵadvance(2);
|
794
|
+
i0.ɵɵproperty("ngForOf", ctx.value);
|
795
|
+
i0.ɵɵadvance();
|
796
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(29, _c3, ctx.showClear && !ctx.disabled));
|
797
|
+
i0.ɵɵattribute("data-pc-section", "inputToken");
|
798
|
+
i0.ɵɵadvance();
|
799
|
+
i0.ɵɵclassMap(ctx.inputStyleClass);
|
800
|
+
i0.ɵɵproperty("disabled", ctx.disabled || ctx.isMaxedOut)("ngStyle", ctx.inputStyle)("autofocus", ctx.autofocus);
|
801
|
+
i0.ɵɵattribute("id", ctx.inputId)("maxlength", ctx.maxLength)("placeholder", ctx.value && ctx.value.length ? null : ctx.placeholder)("tabindex", ctx.tabindex);
|
802
|
+
i0.ɵɵadvance(2);
|
803
|
+
i0.ɵɵproperty("ngIf", ctx.value != null && ctx.filled && !ctx.disabled && ctx.showClear);
|
804
|
+
} }, dependencies: [CommonModule, i2.NgClass, i2.NgForOf, i2.NgIf, i2.NgTemplateOutlet, i2.NgStyle, InputTextModule, SharedModule, AutoFocusModule, i3.AutoFocus, TimesCircleIcon, TimesIcon, ChipModule, i4.Chip], encapsulation: 2, changeDetection: 0 });
|
805
|
+
}
|
806
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Chips, [{
|
807
|
+
type: Component,
|
808
|
+
args: [{
|
809
|
+
selector: 'p-chips',
|
810
|
+
standalone: true,
|
811
|
+
imports: [CommonModule, InputTextModule, SharedModule, AutoFocusModule, TimesCircleIcon, TimesIcon, ChipModule],
|
812
|
+
template: `
|
813
|
+
<div
|
814
|
+
[ngClass]="{
|
815
|
+
'p-inputchips p-component p-input-wrapper': true,
|
816
|
+
'p-disabled': disabled,
|
817
|
+
'p-focus': focused,
|
818
|
+
'p-inputwrapper-filled': (value && value.length) || (this.inputViewChild?.nativeElement.value && this.inputViewChild?.nativeElement.value.length),
|
819
|
+
'p-inputwrapper-focus': focused
|
820
|
+
}"
|
821
|
+
[ngStyle]="style"
|
822
|
+
[class]="styleClass"
|
823
|
+
[attr.data-pc-name]="'chips'"
|
824
|
+
[attr.data-pc-section]="'root'"
|
825
|
+
>
|
826
|
+
<ul
|
827
|
+
#container
|
828
|
+
class="p-inputchips-input"
|
829
|
+
tabindex="-1"
|
830
|
+
role="listbox"
|
831
|
+
[attr.aria-labelledby]="ariaLabelledBy"
|
832
|
+
[attr.aria-label]="ariaLabel"
|
833
|
+
[attr.aria-activedescendant]="focused ? focusedOptionId : undefined"
|
834
|
+
[attr.aria-orientation]="'horizontal'"
|
835
|
+
(click)="onWrapperClick()"
|
836
|
+
(focus)="onContainerFocus()"
|
837
|
+
(blur)="onContainerBlur()"
|
838
|
+
(keydown)="onContainerKeyDown($event)"
|
839
|
+
[attr.data-pc-section]="'container'"
|
840
|
+
>
|
841
|
+
<li
|
842
|
+
#token
|
843
|
+
*ngFor="let item of value; let i = index"
|
844
|
+
[attr.id]="id + '_chips_item_' + i"
|
845
|
+
role="option"
|
846
|
+
[attr.ariaLabel]="item"
|
847
|
+
[attr.aria-selected]="true"
|
848
|
+
[attr.aria-setsize]="value.length"
|
849
|
+
[attr.aria-posinset]="i + 1"
|
850
|
+
[attr.data-p-focused]="focusedIndex === i"
|
851
|
+
[ngClass]="{ 'p-inputchips-chip-item': true, 'p-focus': focusedIndex === i }"
|
852
|
+
(click)="onItemClick($event, item)"
|
853
|
+
(contextmenu)="onItemContextMenu($event, item)"
|
854
|
+
[attr.data-pc-section]="'token'"
|
855
|
+
>
|
856
|
+
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
|
857
|
+
<p-chip *ngIf="!itemTemplate" class="p-inputchips-chip" [label]="field ? resolveFieldData(item, field) : item" [removeIcon]="chipIcon" removable (onRemove)="removeItem($event, i)">
|
858
|
+
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
|
859
|
+
<ng-template #removeicon>
|
860
|
+
<ng-container *ngIf="!disabled">
|
861
|
+
<TimesCircleIcon [styleClass]="'p-chips-token-icon'" *ngIf="!removeTokenIconTemplate" (click)="removeItem($event, i)" [attr.data-pc-section]="'removeTokenIcon'" [attr.aria-hidden]="true" />
|
862
|
+
<span *ngIf="removeTokenIconTemplate" class="p-chips-token-icon" (click)="removeItem($event, i)" [attr.data-pc-section]="'removeTokenIcon'" [attr.aria-hidden]="true">
|
863
|
+
<ng-template *ngTemplateOutlet="removeTokenIconTemplate; context: { removeItem: removeItem.bind(this) }"></ng-template>
|
864
|
+
</span>
|
865
|
+
</ng-container>
|
866
|
+
</ng-template>
|
867
|
+
</p-chip>
|
868
|
+
</li>
|
869
|
+
<li class="p-inputchips-input-item" [ngClass]="{ 'p-chips-clearable': showClear && !disabled }" [attr.data-pc-section]="'inputToken'" role="option">
|
870
|
+
<input
|
871
|
+
#inputtext
|
872
|
+
type="text"
|
873
|
+
[attr.id]="inputId"
|
874
|
+
[attr.maxlength]="maxLength"
|
875
|
+
[attr.placeholder]="value && value.length ? null : placeholder"
|
876
|
+
[attr.tabindex]="tabindex"
|
877
|
+
(keydown)="onKeyDown($event)"
|
878
|
+
(input)="onInput()"
|
879
|
+
(paste)="onPaste($event)"
|
880
|
+
(focus)="onInputFocus($event)"
|
881
|
+
(blur)="onInputBlur($event)"
|
882
|
+
[disabled]="disabled || isMaxedOut"
|
883
|
+
[ngStyle]="inputStyle"
|
884
|
+
[class]="inputStyleClass"
|
885
|
+
pAutoFocus
|
886
|
+
[autofocus]="autofocus"
|
887
|
+
class="test"
|
888
|
+
/>
|
889
|
+
</li>
|
890
|
+
<li *ngIf="value != null && filled && !disabled && showClear">
|
891
|
+
<TimesIcon *ngIf="!clearIconTemplate" [styleClass]="'p-chips-clear-icon'" (click)="clear()" />
|
892
|
+
<span *ngIf="clearIconTemplate" class="p-chips-clear-icon" (click)="clear()">
|
893
|
+
<ng-template *ngTemplateOutlet="clearIconTemplate"></ng-template>
|
894
|
+
</span>
|
895
|
+
</li>
|
896
|
+
</ul>
|
897
|
+
</div>
|
898
|
+
`,
|
899
|
+
host: {
|
900
|
+
class: 'p-element p-inputwrapper',
|
901
|
+
'[class.p-inputwrapper-filled]': 'filled',
|
902
|
+
'[class.p-inputwrapper-focus]': 'focused',
|
903
|
+
'[class.p-chips-clearable]': 'showClear'
|
904
|
+
},
|
905
|
+
providers: [CHIPS_VALUE_ACCESSOR, ChipsStyle],
|
906
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
907
|
+
encapsulation: ViewEncapsulation.None
|
908
|
+
}]
|
909
|
+
}], () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.PrimeNG }], { style: [{
|
910
|
+
type: Input
|
911
|
+
}], styleClass: [{
|
912
|
+
type: Input
|
913
|
+
}], disabled: [{
|
914
|
+
type: Input,
|
915
|
+
args: [{ transform: booleanAttribute }]
|
916
|
+
}], field: [{
|
917
|
+
type: Input
|
918
|
+
}], placeholder: [{
|
919
|
+
type: Input
|
920
|
+
}], max: [{
|
921
|
+
type: Input,
|
922
|
+
args: [{ transform: numberAttribute }]
|
923
|
+
}], maxLength: [{
|
924
|
+
type: Input
|
925
|
+
}], ariaLabel: [{
|
926
|
+
type: Input
|
927
|
+
}], ariaLabelledBy: [{
|
928
|
+
type: Input
|
929
|
+
}], tabindex: [{
|
930
|
+
type: Input,
|
931
|
+
args: [{ transform: numberAttribute }]
|
932
|
+
}], inputId: [{
|
933
|
+
type: Input
|
934
|
+
}], allowDuplicate: [{
|
935
|
+
type: Input,
|
936
|
+
args: [{ transform: booleanAttribute }]
|
937
|
+
}], caseSensitiveDuplication: [{
|
938
|
+
type: Input,
|
939
|
+
args: [{ transform: booleanAttribute }]
|
940
|
+
}], inputStyle: [{
|
941
|
+
type: Input
|
942
|
+
}], inputStyleClass: [{
|
943
|
+
type: Input
|
944
|
+
}], chipIcon: [{
|
945
|
+
type: Input
|
946
|
+
}], addOnTab: [{
|
947
|
+
type: Input,
|
948
|
+
args: [{ transform: booleanAttribute }]
|
949
|
+
}], addOnBlur: [{
|
950
|
+
type: Input,
|
951
|
+
args: [{ transform: booleanAttribute }]
|
952
|
+
}], separator: [{
|
953
|
+
type: Input
|
954
|
+
}], showClear: [{
|
955
|
+
type: Input,
|
956
|
+
args: [{ transform: booleanAttribute }]
|
957
|
+
}], autofocus: [{
|
958
|
+
type: Input,
|
959
|
+
args: [{ transform: booleanAttribute }]
|
960
|
+
}], variant: [{
|
961
|
+
type: Input
|
962
|
+
}], onAdd: [{
|
963
|
+
type: Output
|
964
|
+
}], onRemove: [{
|
965
|
+
type: Output
|
966
|
+
}], onFocus: [{
|
967
|
+
type: Output
|
968
|
+
}], onBlur: [{
|
969
|
+
type: Output
|
970
|
+
}], onChipClick: [{
|
971
|
+
type: Output
|
972
|
+
}], onChipContextMenu: [{
|
973
|
+
type: Output
|
974
|
+
}], onClear: [{
|
975
|
+
type: Output
|
976
|
+
}], inputViewChild: [{
|
977
|
+
type: ViewChild,
|
978
|
+
args: ['inputtext']
|
979
|
+
}], containerViewChild: [{
|
980
|
+
type: ViewChild,
|
981
|
+
args: ['container']
|
982
|
+
}], templates: [{
|
983
|
+
type: ContentChildren,
|
984
|
+
args: [PrimeTemplate]
|
985
|
+
}] }); })();
|
986
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Chips, { className: "Chips" }); })();
|
987
|
+
class ChipsModule {
|
988
|
+
static ɵfac = function ChipsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChipsModule)(); };
|
989
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ChipsModule });
|
990
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Chips, SharedModule, SharedModule] });
|
991
|
+
}
|
992
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChipsModule, [{
|
993
|
+
type: NgModule,
|
994
|
+
args: [{
|
995
|
+
imports: [Chips, SharedModule],
|
996
|
+
exports: [Chips, SharedModule]
|
997
|
+
}]
|
998
|
+
}], null, null); })();
|
999
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ChipsModule, { imports: [Chips, SharedModule], exports: [Chips, SharedModule] }); })();
|
1000
|
+
|
1001
|
+
/**
|
1002
|
+
* Generated bundle index. Do not edit.
|
1003
|
+
*/
|
1004
|
+
|
1005
|
+
export { CHIPS_VALUE_ACCESSOR, Chips, ChipsModule };
|
1006
|
+
//# sourceMappingURL=primeng-chips.mjs.map
|