primevue 3.23.0 → 3.25.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/LICENSE.md +1 -1
- package/README.md +18 -12
- package/accordion/Accordion.d.ts +53 -21
- package/accordiontab/AccordionTab.d.ts +33 -12
- package/api/Api.d.ts +284 -284
- package/autocomplete/AutoComplete.d.ts +116 -89
- package/autocomplete/AutoComplete.vue +5 -5
- package/autocomplete/autocomplete.cjs.js +5 -5
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +5 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +5 -5
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +38 -25
- package/avatar/Avatar.vue +1 -1
- package/avatar/avatar.cjs.js +2 -1
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -1
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -1
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +30 -14
- package/badge/Badge.d.ts +34 -20
- package/badge/Badge.vue +16 -5
- package/badge/badge.cjs.js +15 -5
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +15 -5
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +16 -7
- package/badge/badge.min.js +1 -1
- package/badgedirective/BadgeDirective.d.ts +60 -1
- package/blockui/BlockUI.d.ts +38 -16
- package/breadcrumb/Breadcrumb.d.ts +37 -20
- package/button/Button.d.ts +74 -17
- package/button/Button.vue +51 -8
- package/button/button.cjs.js +51 -8
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +51 -8
- package/button/button.esm.min.js +1 -1
- package/button/button.js +51 -8
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +116 -81
- package/calendar/Calendar.vue +71 -17
- package/calendar/calendar.cjs.js +58 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +58 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +58 -20
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +35 -15
- package/carousel/Carousel.d.ts +47 -29
- package/cascadeselect/CascadeSelect.d.ts +74 -63
- package/cascadeselect/CascadeSelect.vue +4 -4
- package/cascadeselect/cascadeselect.cjs.js +4 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +4 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +4 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +41 -23
- package/checkbox/Checkbox.d.ts +41 -17
- package/checkbox/Checkbox.vue +3 -3
- package/checkbox/checkbox.cjs.js +3 -3
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +3 -3
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +3 -3
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +35 -14
- package/chips/Chips.d.ts +48 -22
- package/chips/Chips.vue +2 -2
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +46 -28
- package/column/Column.d.ts +90 -65
- package/columngroup/ColumnGroup.d.ts +29 -13
- package/config/config.cjs.js +20 -1
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +20 -1
- package/config/config.esm.min.js +1 -1
- package/config/config.js +20 -1
- package/config/config.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +16 -6
- package/confirmationservice/ConfirmationService.d.ts +11 -0
- package/confirmdialog/ConfirmDialog.d.ts +35 -17
- package/confirmpopup/ConfirmPopup.d.ts +32 -17
- package/confirmpopup/ConfirmPopup.vue +3 -0
- package/confirmpopup/confirmpopup.cjs.js +3 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +3 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +3 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +51 -35
- package/core/core.js +360 -118
- package/core/core.min.js +9 -9
- package/datatable/DataTable.d.ts +249 -206
- package/datatable/DataTable.vue +72 -111
- package/datatable/FooterCell.vue +2 -2
- package/datatable/TableBody.vue +9 -18
- package/datatable/datatable.cjs.js +71 -60
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +71 -60
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +71 -60
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +65 -47
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +33 -13
- package/deferredcontent/DeferredContent.d.ts +30 -13
- package/dialog/Dialog.d.ts +67 -46
- package/dialog/Dialog.vue +24 -7
- package/dialog/dialog.cjs.js +14 -7
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -7
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +14 -7
- package/dialog/dialog.min.js +1 -1
- package/dialogservice/DialogService.d.ts +13 -2
- package/divider/Divider.d.ts +35 -30
- package/dock/Dock.d.ts +49 -36
- package/dropdown/Dropdown.d.ts +100 -86
- package/dropdown/Dropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.d.ts +30 -10
- package/dynamicdialog/DynamicDialog.vue +3 -3
- package/dynamicdialog/dynamicdialog.cjs.js +4 -4
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +4 -4
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +4 -4
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/dynamicdialogoptions/DynamicDialogOptions.d.ts +28 -8
- package/editor/Editor.d.ts +49 -17
- package/fieldset/Fieldset.d.ts +43 -16
- package/fileupload/FileUpload.d.ts +101 -47
- package/focustrap/FocusTrap.d.ts +42 -3
- package/fullcalendar/FullCalendar.d.ts +1 -1
- package/galleria/Galleria.d.ts +64 -40
- package/image/Image.d.ts +33 -14
- package/inlinemessage/InlineMessage.d.ts +31 -17
- package/inplace/Inplace.d.ts +41 -18
- package/inputmask/InputMask.d.ts +41 -17
- package/inputmask/InputMask.vue +59 -49
- package/inputmask/inputmask.cjs.js +59 -49
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +59 -49
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +59 -49
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +62 -43
- package/inputnumber/InputNumber.vue +2 -2
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +38 -17
- package/inputswitch/InputSwitch.vue +3 -2
- package/inputswitch/inputswitch.cjs.js +3 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +32 -12
- package/knob/Knob.d.ts +47 -21
- package/listbox/Listbox.d.ts +81 -60
- package/megamenu/MegaMenu.d.ts +42 -27
- package/megamenu/MegaMenu.vue +17 -0
- package/megamenu/megamenu.cjs.js +1 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +1 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +1 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +51 -30
- package/menubar/Menubar.d.ts +36 -19
- package/menuitem/MenuItem.d.ts +22 -10
- package/message/Message.d.ts +40 -21
- package/multiselect/MultiSelect.d.ts +111 -90
- package/orderlist/OrderList.d.ts +51 -23
- package/organizationchart/OrganizationChart.d.ts +46 -28
- package/overlaypanel/OverlayPanel.d.ts +46 -26
- package/package.json +2 -2
- package/paginator/Paginator.d.ts +49 -24
- package/panel/Panel.d.ts +41 -14
- package/panelmenu/PanelMenu.d.ts +49 -21
- package/password/Password.d.ts +51 -32
- package/password/Password.vue +4 -4
- package/password/password.cjs.js +4 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +4 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +4 -4
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +74 -33
- package/portal/Portal.d.ts +1 -0
- package/progressbar/ProgressBar.d.ts +34 -17
- package/progressspinner/ProgressSpinner.d.ts +32 -13
- package/radiobutton/RadioButton.d.ts +35 -16
- package/radiobutton/RadioButton.vue +2 -2
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +51 -25
- package/resources/themes/arya-blue/theme.css +34 -11
- package/resources/themes/arya-green/theme.css +34 -11
- package/resources/themes/arya-orange/theme.css +34 -11
- package/resources/themes/arya-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-light-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-light-purple/theme.css +34 -11
- package/resources/themes/fluent-light/theme.css +34 -11
- package/resources/themes/lara-dark-blue/theme.css +34 -11
- package/resources/themes/lara-dark-indigo/theme.css +34 -11
- package/resources/themes/lara-dark-purple/theme.css +34 -11
- package/resources/themes/lara-dark-teal/theme.css +34 -11
- package/resources/themes/lara-light-blue/theme.css +34 -11
- package/resources/themes/lara-light-indigo/theme.css +34 -11
- package/resources/themes/lara-light-purple/theme.css +34 -11
- package/resources/themes/lara-light-teal/theme.css +34 -11
- package/resources/themes/luna-amber/theme.css +34 -11
- package/resources/themes/luna-blue/theme.css +34 -11
- package/resources/themes/luna-green/theme.css +34 -11
- package/resources/themes/luna-pink/theme.css +34 -11
- package/resources/themes/md-dark-deeppurple/theme.css +34 -11
- package/resources/themes/md-dark-indigo/theme.css +34 -11
- package/resources/themes/md-light-deeppurple/theme.css +34 -11
- package/resources/themes/md-light-indigo/theme.css +34 -11
- package/resources/themes/mdc-dark-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-dark-indigo/theme.css +34 -11
- package/resources/themes/mdc-light-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-light-indigo/theme.css +34 -11
- package/resources/themes/mira/theme.css +34 -11
- package/resources/themes/nano/theme.css +34 -11
- package/resources/themes/nova/theme.css +34 -11
- package/resources/themes/nova-accent/theme.css +34 -11
- package/resources/themes/nova-alt/theme.css +34 -11
- package/resources/themes/nova-vue/theme.css +34 -11
- package/resources/themes/rhea/theme.css +34 -11
- package/resources/themes/saga-blue/theme.css +34 -11
- package/resources/themes/saga-green/theme.css +34 -11
- package/resources/themes/saga-orange/theme.css +34 -11
- package/resources/themes/saga-purple/theme.css +34 -11
- package/resources/themes/soho-dark/theme.css +34 -11
- package/resources/themes/soho-light/theme.css +34 -11
- package/resources/themes/tailwind-light/theme.css +34 -11
- package/resources/themes/vela-blue/theme.css +34 -11
- package/resources/themes/vela-green/theme.css +34 -11
- package/resources/themes/vela-orange/theme.css +34 -11
- package/resources/themes/vela-purple/theme.css +34 -11
- package/resources/themes/viva-dark/theme.css +34 -11
- package/resources/themes/viva-light/theme.css +34 -11
- package/ripple/Ripple.d.ts +24 -1
- package/row/Row.d.ts +28 -10
- package/scrollpanel/ScrollPanel.d.ts +29 -11
- package/scrolltop/ScrollTop.d.ts +35 -18
- package/selectbutton/SelectButton.d.ts +47 -27
- package/selectbutton/SelectButton.vue +2 -2
- package/selectbutton/selectbutton.cjs.js +2 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/sidebar/Sidebar.d.ts +46 -27
- package/skeleton/Skeleton.d.ts +36 -22
- package/slider/Slider.d.ts +46 -23
- package/speeddial/SpeedDial.d.ts +64 -51
- package/splitbutton/SplitButton.d.ts +73 -24
- package/splitbutton/SplitButton.vue +41 -1
- package/splitbutton/splitbutton.cjs.js +43 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +43 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +43 -3
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +49 -30
- package/splitterpanel/SplitterPanel.d.ts +28 -10
- package/steps/Steps.d.ts +36 -15
- package/styleclass/StyleClass.d.ts +72 -1
- package/tabmenu/TabMenu.d.ts +41 -16
- package/tabmenu/TabMenu.vue +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -0
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -0
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -0
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabpanel/TabPanel.d.ts +29 -11
- package/tabview/TabView.d.ts +47 -19
- package/tag/Tag.d.ts +33 -15
- package/terminal/Terminal.d.ts +30 -14
- package/terminalservice/TerminalService.d.ts +24 -5
- package/textarea/Textarea.d.ts +34 -11
- package/tieredmenu/TieredMenu.d.ts +47 -31
- package/timeline/Timeline.d.ts +41 -32
- package/toast/Toast.d.ts +63 -35
- package/toast/Toast.vue +4 -2
- package/toast/ToastMessage.vue +4 -4
- package/toast/toast.cjs.js +8 -6
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +8 -6
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +8 -6
- package/toast/toast.min.js +1 -1
- package/toastservice/ToastService.d.ts +16 -3
- package/togglebutton/ToggleButton.d.ts +44 -24
- package/togglebutton/ToggleButton.vue +2 -2
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/Toolbar.d.ts +34 -14
- package/tooltip/Tooltip.d.ts +99 -1
- package/tooltip/tooltip.cjs.js +1 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +58 -36
- package/treeselect/TreeSelect.d.ts +65 -57
- package/treeselect/TreeSelect.vue +3 -3
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -3
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -3
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +123 -107
- package/tristatecheckbox/TriStateCheckbox.d.ts +35 -12
- package/ts-helpers.d.ts +2 -2
- package/utils/utils.cjs.js +18 -15
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +18 -15
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +18 -15
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +90 -30
- package/vetur-tags.json +17 -2
- package/virtualscroller/VirtualScroller.d.ts +99 -43
- package/virtualscroller/VirtualScroller.vue +248 -72
- package/virtualscroller/virtualscroller.cjs.js +234 -72
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +234 -72
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +235 -74
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1951 -1773
package/image/Image.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Displays an image with preview and tranformation options. For multiple image, see Galleria.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/image/)
|
|
6
|
+
*
|
|
7
|
+
* @module image
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { VNode } from 'vue';
|
|
2
11
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Defines valid properties in Image component.
|
|
15
|
+
*/
|
|
4
16
|
export interface ImageProps {
|
|
5
17
|
/**
|
|
6
18
|
* Controls the preview functionality.
|
|
19
|
+
* @defaultValue false
|
|
7
20
|
*/
|
|
8
21
|
preview?: boolean | undefined;
|
|
9
22
|
/**
|
|
@@ -16,34 +29,49 @@ export interface ImageProps {
|
|
|
16
29
|
imageClass?: any;
|
|
17
30
|
}
|
|
18
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Defines valid slots in Image slots.
|
|
34
|
+
*/
|
|
19
35
|
export interface ImageSlots {
|
|
20
36
|
/**
|
|
21
37
|
* Custom indicator template.
|
|
22
38
|
*/
|
|
23
|
-
indicator
|
|
39
|
+
indicator(): VNode[];
|
|
24
40
|
}
|
|
25
41
|
|
|
26
|
-
export
|
|
42
|
+
export interface ImageEmits {}
|
|
27
43
|
|
|
44
|
+
/**
|
|
45
|
+
* **PrimeVue - Image**
|
|
46
|
+
*
|
|
47
|
+
* _Displays an image with preview and tranformation options. For multiple image, see Galleria._
|
|
48
|
+
*
|
|
49
|
+
* [Live Demo](https://www.primevue.org/image/)
|
|
50
|
+
* --- ---
|
|
51
|
+
* 
|
|
52
|
+
*
|
|
53
|
+
* @group Component
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
28
56
|
declare class Image extends ClassComponent<ImageProps, ImageSlots, ImageEmits> {
|
|
29
57
|
/**
|
|
30
58
|
* Triggered when the preview overlay is shown.
|
|
31
59
|
*
|
|
32
60
|
* @memberof Image
|
|
33
61
|
*/
|
|
34
|
-
show
|
|
62
|
+
show(): void;
|
|
35
63
|
/**
|
|
36
64
|
* Triggered when the preview overlay is hidden.
|
|
37
65
|
*
|
|
38
66
|
* @memberof Image
|
|
39
67
|
*/
|
|
40
|
-
hide
|
|
68
|
+
hide(): void;
|
|
41
69
|
/**
|
|
42
70
|
* Triggered when an error occurs while loading an image file.
|
|
43
71
|
*
|
|
44
72
|
* @memberof Image
|
|
45
73
|
*/
|
|
46
|
-
error
|
|
74
|
+
error(): void;
|
|
47
75
|
}
|
|
48
76
|
|
|
49
77
|
declare module '@vue/runtime-core' {
|
|
@@ -52,13 +80,4 @@ declare module '@vue/runtime-core' {
|
|
|
52
80
|
}
|
|
53
81
|
}
|
|
54
82
|
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* Displays an image with preview and tranformation options. For multiple image, see Galleria.
|
|
58
|
-
*
|
|
59
|
-
* Demos:
|
|
60
|
-
*
|
|
61
|
-
* - [Image](https://www.primefaces.org/primevue/image)
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
83
|
export default Image;
|
|
@@ -1,26 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* InlineMessage component is useful in cases where a single message needs to be displayed related to an element such as forms. It has one property, severity of the message.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/inlinemessage/)
|
|
6
|
+
*
|
|
7
|
+
* @module inlinemessage
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { VNode } from 'vue';
|
|
2
11
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
12
|
|
|
4
|
-
|
|
5
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Defines valid properties in InlineMessage component.
|
|
15
|
+
*/
|
|
6
16
|
export interface InlineMessageProps {
|
|
7
17
|
/**
|
|
8
18
|
* Severity level of the message.
|
|
9
|
-
* @
|
|
10
|
-
* Default value is 'info'.
|
|
19
|
+
* @defaultValue info
|
|
11
20
|
*/
|
|
12
|
-
severity?:
|
|
21
|
+
severity?: 'success' | 'info' | 'warn' | 'error' | undefined;
|
|
13
22
|
}
|
|
14
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Defines valid slots in InlineMessage slots.
|
|
25
|
+
*/
|
|
15
26
|
export interface InlineMessageSlots {
|
|
16
27
|
/**
|
|
17
28
|
* Default custom slot.
|
|
18
29
|
*/
|
|
19
|
-
default
|
|
30
|
+
default(): VNode[];
|
|
20
31
|
}
|
|
21
32
|
|
|
22
|
-
export
|
|
33
|
+
export interface InlineMessageEmits {}
|
|
23
34
|
|
|
35
|
+
/**
|
|
36
|
+
* **PrimeVue - InlineMessage**
|
|
37
|
+
*
|
|
38
|
+
* _InlineMessage component is useful in cases where a single message needs to be displayed related to an element such as forms. It has one property, severity of the message._
|
|
39
|
+
*
|
|
40
|
+
* [Live Demo](https://www.primevue.org/inlinemessage/)
|
|
41
|
+
* --- ---
|
|
42
|
+
* 
|
|
43
|
+
*
|
|
44
|
+
* @group Component
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
24
47
|
declare class InlineMessage extends ClassComponent<InlineMessageProps, InlineMessageSlots, InlineMessageEmits> {}
|
|
25
48
|
|
|
26
49
|
declare module '@vue/runtime-core' {
|
|
@@ -29,13 +52,4 @@ declare module '@vue/runtime-core' {
|
|
|
29
52
|
}
|
|
30
53
|
}
|
|
31
54
|
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* InlineMessage component is useful in cases where a single message needs to be displayed related to an element such as forms. It has one property, severity of the message.
|
|
35
|
-
*
|
|
36
|
-
* Demos:
|
|
37
|
-
*
|
|
38
|
-
* - [InlineMessage](https://www.primefaces.org/primevue/message)
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
55
|
export default InlineMessage;
|
package/inplace/Inplace.d.ts
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/inplace)
|
|
6
|
+
*
|
|
7
|
+
* @module inplace
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
import { ButtonHTMLAttributes, HTMLAttributes, VNode } from 'vue';
|
|
2
11
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Defines valid properties in Inplace component.
|
|
15
|
+
*/
|
|
4
16
|
export interface InplaceProps {
|
|
5
17
|
/**
|
|
6
18
|
* Displays a button to switch back to display mode.
|
|
19
|
+
* @defaultValue false
|
|
7
20
|
*/
|
|
8
21
|
closable?: boolean | undefined;
|
|
9
22
|
/**
|
|
10
23
|
* Whether the content is displayed or not.
|
|
24
|
+
* @defaultValue false
|
|
11
25
|
*/
|
|
12
26
|
active?: boolean | undefined;
|
|
13
27
|
/**
|
|
14
28
|
* When present, it specifies that the element should be disabled.
|
|
29
|
+
* @defaultValue false
|
|
15
30
|
*/
|
|
16
31
|
disabled?: boolean | undefined;
|
|
17
32
|
/**
|
|
18
33
|
* Icon to display in the close button.
|
|
19
|
-
*
|
|
34
|
+
* @defaultValue pi pi-times
|
|
20
35
|
*/
|
|
21
36
|
closeIcon?: string | undefined;
|
|
22
37
|
/**
|
|
@@ -29,35 +44,52 @@ export interface InplaceProps {
|
|
|
29
44
|
closeButtonProps?: ButtonHTMLAttributes | undefined;
|
|
30
45
|
}
|
|
31
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Defines valid slots in Inplace component.
|
|
49
|
+
*/
|
|
32
50
|
export interface InplaceSlots {
|
|
33
51
|
/**
|
|
34
52
|
* Custom display template.
|
|
35
53
|
*/
|
|
36
|
-
display
|
|
54
|
+
display(): VNode[];
|
|
37
55
|
/**
|
|
38
56
|
* Custom content template.
|
|
39
57
|
*/
|
|
40
|
-
content
|
|
58
|
+
content(): VNode[];
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Defines valid emits in Inplace component.
|
|
63
|
+
*/
|
|
64
|
+
export interface InplaceEmits {
|
|
44
65
|
/**
|
|
45
66
|
* Emitted when the active changes.
|
|
46
67
|
* @param {boolean} value - New value.
|
|
47
68
|
*/
|
|
48
|
-
'update:active'
|
|
69
|
+
'update:active'(value: boolean): void;
|
|
49
70
|
/**
|
|
50
71
|
* Callback to invoke when inplace is opened.
|
|
51
72
|
* @param {Event} event - Browser event.
|
|
52
73
|
*/
|
|
53
|
-
open
|
|
74
|
+
open(event: Event): void;
|
|
54
75
|
/**
|
|
55
76
|
* Callback to invoke when inplace is closed.
|
|
56
77
|
* @param {Event} event - Browser event.
|
|
57
78
|
*/
|
|
58
|
-
close
|
|
59
|
-
}
|
|
79
|
+
close(event: Event): void;
|
|
80
|
+
}
|
|
60
81
|
|
|
82
|
+
/**
|
|
83
|
+
* **PrimeVue - Inplace**
|
|
84
|
+
*
|
|
85
|
+
* _Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content._
|
|
86
|
+
*
|
|
87
|
+
* [Live Demo](https://www.primevue.org/inplace/)
|
|
88
|
+
* --- ---
|
|
89
|
+
* 
|
|
90
|
+
*
|
|
91
|
+
* @group Component
|
|
92
|
+
*/
|
|
61
93
|
declare class Inplace extends ClassComponent<InplaceProps, InplaceSlots, InplaceEmits> {}
|
|
62
94
|
|
|
63
95
|
declare module '@vue/runtime-core' {
|
|
@@ -66,13 +98,4 @@ declare module '@vue/runtime-core' {
|
|
|
66
98
|
}
|
|
67
99
|
}
|
|
68
100
|
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.
|
|
72
|
-
*
|
|
73
|
-
* Demos:
|
|
74
|
-
*
|
|
75
|
-
* - [Inplace](https://www.primefaces.org/primevue/inplace)
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
101
|
export default Inplace;
|
package/inputmask/InputMask.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/inputmask/)
|
|
6
|
+
*
|
|
7
|
+
* @module inputmask
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
2
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Defines valid properties in InputMask component.
|
|
14
|
+
*/
|
|
3
15
|
export interface InputMaskProps {
|
|
4
16
|
/**
|
|
5
17
|
* Value of the component.
|
|
@@ -7,7 +19,7 @@ export interface InputMaskProps {
|
|
|
7
19
|
modelValue?: string | undefined;
|
|
8
20
|
/**
|
|
9
21
|
* Placeholder character in mask, default is underscore.
|
|
10
|
-
*
|
|
22
|
+
* @defaultValue _
|
|
11
23
|
*/
|
|
12
24
|
slotChar?: string | undefined;
|
|
13
25
|
/**
|
|
@@ -16,35 +28,44 @@ export interface InputMaskProps {
|
|
|
16
28
|
mask?: string | undefined;
|
|
17
29
|
/**
|
|
18
30
|
* Clears the incomplete value on blur.
|
|
19
|
-
*
|
|
31
|
+
* @defaultValue true
|
|
20
32
|
*/
|
|
21
33
|
autoClear?: boolean | undefined;
|
|
22
34
|
/**
|
|
23
35
|
* Defines if model sets the raw unmasked value to bound value or the formatted mask value.
|
|
36
|
+
* @defaultValue false
|
|
24
37
|
*/
|
|
25
38
|
unmask?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the items are clickable or not.
|
|
41
|
+
* @defaultValue false
|
|
42
|
+
*/
|
|
43
|
+
readonly?: boolean | undefined;
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
export interface InputMaskSlots {}
|
|
29
47
|
|
|
30
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Defines valid emits in InputMask component.
|
|
50
|
+
*/
|
|
51
|
+
export interface InputMaskEmits {
|
|
31
52
|
/**
|
|
32
53
|
* Emitted when the value changes.
|
|
33
54
|
* @param {string} value - New value.
|
|
34
55
|
*/
|
|
35
|
-
'update:modelValue'
|
|
56
|
+
'update:modelValue'(value: string): void;
|
|
36
57
|
/**
|
|
37
58
|
* Callback to invoke when the component receives focus.
|
|
38
59
|
*/
|
|
39
|
-
focus
|
|
60
|
+
focus(event: Event): void;
|
|
40
61
|
/**
|
|
41
62
|
* Callback to invoke when the component loses focus.
|
|
42
63
|
*/
|
|
43
|
-
blur
|
|
64
|
+
blur(event: Event): void;
|
|
44
65
|
/**
|
|
45
66
|
* Callback to invoke when a key is pressed.
|
|
46
67
|
*/
|
|
47
|
-
keydown
|
|
68
|
+
keydown(event: Event): void;
|
|
48
69
|
/**
|
|
49
70
|
* Callback to invoke when a key that produces a character value is pressed down.
|
|
50
71
|
*/
|
|
@@ -57,8 +78,20 @@ export declare type InputMaskEmits = {
|
|
|
57
78
|
* Callback to invoke when the mask is completed.
|
|
58
79
|
*/
|
|
59
80
|
complete: (event: Event) => void;
|
|
60
|
-
}
|
|
81
|
+
}
|
|
61
82
|
|
|
83
|
+
/**
|
|
84
|
+
* **PrimeVue - InputMask**
|
|
85
|
+
*
|
|
86
|
+
* _InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone._
|
|
87
|
+
*
|
|
88
|
+
* [Live Demo](https://www.primevue.org/inputmask/)
|
|
89
|
+
* --- ---
|
|
90
|
+
* 
|
|
91
|
+
*
|
|
92
|
+
* @group Component
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
62
95
|
declare class InputMask extends ClassComponent<InputMaskProps, InputMaskSlots, InputMaskEmits> {}
|
|
63
96
|
|
|
64
97
|
declare module '@vue/runtime-core' {
|
|
@@ -67,13 +100,4 @@ declare module '@vue/runtime-core' {
|
|
|
67
100
|
}
|
|
68
101
|
}
|
|
69
102
|
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.
|
|
73
|
-
*
|
|
74
|
-
* Demos:
|
|
75
|
-
*
|
|
76
|
-
* - [InputMask](https://www.primefaces.org/primevue/inputmask)
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
103
|
export default InputMask;
|
package/inputmask/InputMask.vue
CHANGED
|
@@ -31,57 +31,15 @@ export default {
|
|
|
31
31
|
default: false
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.firstNonMaskPos = null;
|
|
39
|
-
this.defs = {
|
|
40
|
-
9: '[0-9]',
|
|
41
|
-
a: '[A-Za-z]',
|
|
42
|
-
'*': '[A-Za-z0-9]'
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
let ua = DomHandler.getUserAgent();
|
|
46
|
-
|
|
47
|
-
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
48
|
-
|
|
49
|
-
let maskTokens = this.mask.split('');
|
|
50
|
-
|
|
51
|
-
for (let i = 0; i < maskTokens.length; i++) {
|
|
52
|
-
let c = maskTokens[i];
|
|
53
|
-
|
|
54
|
-
if (c === '?') {
|
|
55
|
-
this.len--;
|
|
56
|
-
this.partialPosition = i;
|
|
57
|
-
} else if (this.defs[c]) {
|
|
58
|
-
this.tests.push(new RegExp(this.defs[c]));
|
|
59
|
-
|
|
60
|
-
if (this.firstNonMaskPos === null) {
|
|
61
|
-
this.firstNonMaskPos = this.tests.length - 1;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (i < this.partialPosition) {
|
|
65
|
-
this.lastRequiredNonMaskPos = this.tests.length - 1;
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
this.tests.push(null);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this.buffer = [];
|
|
73
|
-
|
|
74
|
-
for (let i = 0; i < maskTokens.length; i++) {
|
|
75
|
-
let c = maskTokens[i];
|
|
76
|
-
|
|
77
|
-
if (c !== '?') {
|
|
78
|
-
if (this.defs[c]) this.buffer.push(this.getPlaceholder(i));
|
|
79
|
-
else this.buffer.push(c);
|
|
34
|
+
watch: {
|
|
35
|
+
mask(newMask, oldMask) {
|
|
36
|
+
if (oldMask !== newMask) {
|
|
37
|
+
this.initMask();
|
|
80
38
|
}
|
|
81
39
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
40
|
+
},
|
|
41
|
+
mounted() {
|
|
42
|
+
this.initMask();
|
|
85
43
|
},
|
|
86
44
|
updated() {
|
|
87
45
|
if (this.isValueUpdated()) {
|
|
@@ -500,6 +458,58 @@ export default {
|
|
|
500
458
|
this.focusText = this.$el.value;
|
|
501
459
|
}
|
|
502
460
|
},
|
|
461
|
+
initMask() {
|
|
462
|
+
this.tests = [];
|
|
463
|
+
this.partialPosition = this.mask.length;
|
|
464
|
+
this.len = this.mask.length;
|
|
465
|
+
this.firstNonMaskPos = null;
|
|
466
|
+
this.defs = {
|
|
467
|
+
9: '[0-9]',
|
|
468
|
+
a: '[A-Za-z]',
|
|
469
|
+
'*': '[A-Za-z0-9]'
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
let ua = DomHandler.getUserAgent();
|
|
473
|
+
|
|
474
|
+
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
475
|
+
|
|
476
|
+
let maskTokens = this.mask.split('');
|
|
477
|
+
|
|
478
|
+
for (let i = 0; i < maskTokens.length; i++) {
|
|
479
|
+
let c = maskTokens[i];
|
|
480
|
+
|
|
481
|
+
if (c === '?') {
|
|
482
|
+
this.len--;
|
|
483
|
+
this.partialPosition = i;
|
|
484
|
+
} else if (this.defs[c]) {
|
|
485
|
+
this.tests.push(new RegExp(this.defs[c]));
|
|
486
|
+
|
|
487
|
+
if (this.firstNonMaskPos === null) {
|
|
488
|
+
this.firstNonMaskPos = this.tests.length - 1;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (i < this.partialPosition) {
|
|
492
|
+
this.lastRequiredNonMaskPos = this.tests.length - 1;
|
|
493
|
+
}
|
|
494
|
+
} else {
|
|
495
|
+
this.tests.push(null);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
this.buffer = [];
|
|
500
|
+
|
|
501
|
+
for (let i = 0; i < maskTokens.length; i++) {
|
|
502
|
+
let c = maskTokens[i];
|
|
503
|
+
|
|
504
|
+
if (c !== '?') {
|
|
505
|
+
if (this.defs[c]) this.buffer.push(this.getPlaceholder(i));
|
|
506
|
+
else this.buffer.push(c);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
this.defaultBuffer = this.buffer.join('');
|
|
511
|
+
this.updateValue(false);
|
|
512
|
+
},
|
|
503
513
|
isValueUpdated() {
|
|
504
514
|
return this.unmask ? this.modelValue != this.getUnmaskedValue() : this.defaultBuffer !== this.$el.value && this.$el.value !== this.modelValue;
|
|
505
515
|
}
|
|
@@ -29,57 +29,15 @@ var script = {
|
|
|
29
29
|
default: false
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.firstNonMaskPos = null;
|
|
37
|
-
this.defs = {
|
|
38
|
-
9: '[0-9]',
|
|
39
|
-
a: '[A-Za-z]',
|
|
40
|
-
'*': '[A-Za-z0-9]'
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
let ua = utils.DomHandler.getUserAgent();
|
|
44
|
-
|
|
45
|
-
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
46
|
-
|
|
47
|
-
let maskTokens = this.mask.split('');
|
|
48
|
-
|
|
49
|
-
for (let i = 0; i < maskTokens.length; i++) {
|
|
50
|
-
let c = maskTokens[i];
|
|
51
|
-
|
|
52
|
-
if (c === '?') {
|
|
53
|
-
this.len--;
|
|
54
|
-
this.partialPosition = i;
|
|
55
|
-
} else if (this.defs[c]) {
|
|
56
|
-
this.tests.push(new RegExp(this.defs[c]));
|
|
57
|
-
|
|
58
|
-
if (this.firstNonMaskPos === null) {
|
|
59
|
-
this.firstNonMaskPos = this.tests.length - 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (i < this.partialPosition) {
|
|
63
|
-
this.lastRequiredNonMaskPos = this.tests.length - 1;
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
this.tests.push(null);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
this.buffer = [];
|
|
71
|
-
|
|
72
|
-
for (let i = 0; i < maskTokens.length; i++) {
|
|
73
|
-
let c = maskTokens[i];
|
|
74
|
-
|
|
75
|
-
if (c !== '?') {
|
|
76
|
-
if (this.defs[c]) this.buffer.push(this.getPlaceholder(i));
|
|
77
|
-
else this.buffer.push(c);
|
|
32
|
+
watch: {
|
|
33
|
+
mask(newMask, oldMask) {
|
|
34
|
+
if (oldMask !== newMask) {
|
|
35
|
+
this.initMask();
|
|
78
36
|
}
|
|
79
37
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.
|
|
38
|
+
},
|
|
39
|
+
mounted() {
|
|
40
|
+
this.initMask();
|
|
83
41
|
},
|
|
84
42
|
updated() {
|
|
85
43
|
if (this.isValueUpdated()) {
|
|
@@ -498,6 +456,58 @@ var script = {
|
|
|
498
456
|
this.focusText = this.$el.value;
|
|
499
457
|
}
|
|
500
458
|
},
|
|
459
|
+
initMask() {
|
|
460
|
+
this.tests = [];
|
|
461
|
+
this.partialPosition = this.mask.length;
|
|
462
|
+
this.len = this.mask.length;
|
|
463
|
+
this.firstNonMaskPos = null;
|
|
464
|
+
this.defs = {
|
|
465
|
+
9: '[0-9]',
|
|
466
|
+
a: '[A-Za-z]',
|
|
467
|
+
'*': '[A-Za-z0-9]'
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
let ua = utils.DomHandler.getUserAgent();
|
|
471
|
+
|
|
472
|
+
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
|
|
473
|
+
|
|
474
|
+
let maskTokens = this.mask.split('');
|
|
475
|
+
|
|
476
|
+
for (let i = 0; i < maskTokens.length; i++) {
|
|
477
|
+
let c = maskTokens[i];
|
|
478
|
+
|
|
479
|
+
if (c === '?') {
|
|
480
|
+
this.len--;
|
|
481
|
+
this.partialPosition = i;
|
|
482
|
+
} else if (this.defs[c]) {
|
|
483
|
+
this.tests.push(new RegExp(this.defs[c]));
|
|
484
|
+
|
|
485
|
+
if (this.firstNonMaskPos === null) {
|
|
486
|
+
this.firstNonMaskPos = this.tests.length - 1;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (i < this.partialPosition) {
|
|
490
|
+
this.lastRequiredNonMaskPos = this.tests.length - 1;
|
|
491
|
+
}
|
|
492
|
+
} else {
|
|
493
|
+
this.tests.push(null);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
this.buffer = [];
|
|
498
|
+
|
|
499
|
+
for (let i = 0; i < maskTokens.length; i++) {
|
|
500
|
+
let c = maskTokens[i];
|
|
501
|
+
|
|
502
|
+
if (c !== '?') {
|
|
503
|
+
if (this.defs[c]) this.buffer.push(this.getPlaceholder(i));
|
|
504
|
+
else this.buffer.push(c);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
this.defaultBuffer = this.buffer.join('');
|
|
509
|
+
this.updateValue(false);
|
|
510
|
+
},
|
|
501
511
|
isValueUpdated() {
|
|
502
512
|
return this.unmask ? this.modelValue != this.getUnmaskedValue() : this.defaultBuffer !== this.$el.value && this.$el.value !== this.modelValue;
|
|
503
513
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("vue"),s={name:"InputMask",emits:["update:modelValue","focus","blur","keydown","complete","keypress","paste"],props:{modelValue:null,slotChar:{type:String,default:"_"},mask:{type:String,default:null},autoClear:{type:Boolean,default:!0},unmask:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("vue"),s={name:"InputMask",emits:["update:modelValue","focus","blur","keydown","complete","keypress","paste"],props:{modelValue:null,slotChar:{type:String,default:"_"},mask:{type:String,default:null},autoClear:{type:Boolean,default:!0},unmask:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},watch:{mask(e,t){t!==e&&this.initMask()}},mounted(){this.initMask()},updated(){this.isValueUpdated()&&this.updateValue()},methods:{onInput(e){this.androidChrome?this.handleAndroidInput(e):this.handleInputChange(e),this.$emit("update:modelValue",e.target.value)},onFocus(e){if(this.readonly)return;let t;this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.$el.value,t=this.checkVal(),this.caretTimeoutId=setTimeout((()=>{this.$el===document.activeElement&&(this.writeBuffer(),t===this.mask.replace("?","").length?this.caret(0,t):this.caret(t))}),10),this.$emit("focus",e)},onBlur(e){if(this.focus=!1,this.checkVal(),this.updateModel(e),this.$el.value!==this.focusText){let e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.$el.dispatchEvent(e)}this.$emit("blur",e)},onKeyDown(t){if(this.readonly)return;let s,i,h,l=t.which||t.keyCode,a=/iphone/i.test(e.DomHandler.getUserAgent());this.oldVal=this.$el.value,8===l||46===l||a&&127===l?(s=this.caret(),i=s.begin,h=s.end,h-i==0&&(i=46!==l?this.seekPrev(i):h=this.seekNext(i-1),h=46===l?this.seekNext(h):h),this.clearBuffer(i,h),this.shiftL(i,h-1),this.updateModel(t),t.preventDefault()):13===l?(this.$el.blur(),this.updateModel(t)):27===l&&(this.$el.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault()),this.$emit("keydown",t)},onKeyPress(t){if(!this.readonly){var s,i,h,l,a=t.which||t.keyCode,n=this.caret();if(!(t.ctrlKey||t.altKey||t.metaKey||a<32)){if(a&&13!==a){if(n.end-n.begin!=0&&(this.clearBuffer(n.begin,n.end),this.shiftL(n.begin,n.end-1)),(s=this.seekNext(n.begin-1))<this.len&&(i=String.fromCharCode(a),this.tests[s].test(i))){if(this.shiftR(s),this.buffer[s]=i,this.writeBuffer(),h=this.seekNext(s),/android/i.test(e.DomHandler.getUserAgent())){setTimeout((()=>{this.caret(h)}),0)}else this.caret(h);n.begin<=this.lastRequiredNonMaskPos&&(l=this.isCompleted())}t.preventDefault()}this.updateModel(t),l&&this.$emit("complete",t),this.$emit("keypress",t)}}},onPaste(e){this.handleInputChange(e),this.$emit("paste",e)},caret(e,t){let s,i,h;if(this.$el.offsetParent&&this.$el===document.activeElement)return"number"!=typeof e?(this.$el.setSelectionRange?(i=this.$el.selectionStart,h=this.$el.selectionEnd):document.selection&&document.selection.createRange&&(s=document.selection.createRange(),i=0-s.duplicate().moveStart("character",-1e5),h=i+s.text.length),{begin:i,end:h}):(i=e,h="number"==typeof t?t:i,void(this.$el.setSelectionRange?this.$el.setSelectionRange(i,h):this.$el.createTextRange&&(s=this.$el.createTextRange(),s.collapse(!0),s.moveEnd("character",h),s.moveStart("character",i),s.select())))},isCompleted(){for(let e=this.firstNonMaskPos;e<=this.lastRequiredNonMaskPos;e++)if(this.tests[e]&&this.buffer[e]===this.getPlaceholder(e))return!1;return!0},getPlaceholder(e){return e<this.slotChar.length?this.slotChar.charAt(e):this.slotChar.charAt(0)},seekNext(e){for(;++e<this.len&&!this.tests[e];);return e},seekPrev(e){for(;--e>=0&&!this.tests[e];);return e},shiftL(e,t){let s,i;if(!(e<0)){for(s=e,i=this.seekNext(t);s<this.len;s++)if(this.tests[s]){if(!(i<this.len&&this.tests[s].test(this.buffer[i])))break;this.buffer[s]=this.buffer[i],this.buffer[i]=this.getPlaceholder(i),i=this.seekNext(i)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,e))}},shiftR(e){let t,s,i,h;for(t=e,s=this.getPlaceholder(e);t<this.len;t++)if(this.tests[t]){if(i=this.seekNext(t),h=this.buffer[t],this.buffer[t]=s,!(i<this.len&&this.tests[i].test(h)))break;s=h}},handleAndroidInput(e){var t=this.$el.value,s=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>t.length){for(this.checkVal(!0);s.begin>0&&!this.tests[s.begin-1];)s.begin--;if(0===s.begin)for(;s.begin<this.firstNonMaskPos&&!this.tests[s.begin];)s.begin++;this.caret(s.begin,s.begin)}else{for(this.checkVal(!0);s.begin<this.len&&!this.tests[s.begin];)s.begin++;this.caret(s.begin,s.begin)}this.isCompleted()&&this.$emit("complete",e)},clearBuffer(e,t){let s;for(s=e;s<t&&s<this.len;s++)this.tests[s]&&(this.buffer[s]=this.getPlaceholder(s))},writeBuffer(){this.$el.value=this.buffer.join("")},checkVal(e){this.isValueChecked=!0;let t,s,i,h=this.$el.value,l=-1;for(t=0,i=0;t<this.len;t++)if(this.tests[t]){for(this.buffer[t]=this.getPlaceholder(t);i++<h.length;)if(s=h.charAt(i-1),this.tests[t].test(s)){this.buffer[t]=s,l=t;break}if(i>h.length){this.clearBuffer(t+1,this.len);break}}else this.buffer[t]===h.charAt(i)&&i++,t<this.partialPosition&&(l=t);return e?this.writeBuffer():l+1<this.partialPosition?this.autoClear||this.buffer.join("")===this.defaultBuffer?(this.$el.value&&(this.$el.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.$el.value=this.$el.value.substring(0,l+1)),this.partialPosition?t:this.firstNonMaskPos},handleInputChange(e){if(!this.readonly){var t=this.checkVal(!0);this.caret(t),this.updateModel(e),this.isCompleted()&&this.$emit("complete",e)}},getUnmaskedValue(){let e=[];for(let t=0;t<this.buffer.length;t++){let s=this.buffer[t];this.tests[t]&&s!==this.getPlaceholder(t)&&e.push(s)}return e.join("")},updateModel(e){let t=this.unmask?this.getUnmaskedValue():e.target.value;this.$emit("update:modelValue",this.defaultBuffer!==t?t:"")},updateValue(e=!0){this.$el&&(null==this.modelValue?(this.$el.value="",e&&this.$emit("update:modelValue","")):(this.$el.value=this.modelValue,this.checkVal(),setTimeout((()=>{if(this.$el&&(this.writeBuffer(),this.checkVal(),e)){let e=this.unmask?this.getUnmaskedValue():this.$el.value;this.$emit("update:modelValue",this.defaultBuffer!==e?e:"")}}),10)),this.focusText=this.$el.value)},initMask(){this.tests=[],this.partialPosition=this.mask.length,this.len=this.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};let t=e.DomHandler.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);let s=this.mask.split("");for(let e=0;e<s.length;e++){let t=s[e];"?"===t?(this.len--,this.partialPosition=e):this.defs[t]?(this.tests.push(new RegExp(this.defs[t])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),e<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(let e=0;e<s.length;e++){let t=s[e];"?"!==t&&(this.defs[t]?this.buffer.push(this.getPlaceholder(e)):this.buffer.push(t))}this.defaultBuffer=this.buffer.join(""),this.updateValue(!1)},isValueUpdated(){return this.unmask?this.modelValue!=this.getUnmaskedValue():this.defaultBuffer!==this.$el.value&&this.$el.value!==this.modelValue}},computed:{filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},inputClass(){return["p-inputmask p-inputtext p-component",{"p-filled":this.filled}]}}};const i=["readonly"];s.render=function(e,s,h,l,a,n){return t.openBlock(),t.createElementBlock("input",{class:t.normalizeClass(n.inputClass),readonly:h.readonly,onInput:s[0]||(s[0]=(...e)=>n.onInput&&n.onInput(...e)),onFocus:s[1]||(s[1]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:s[2]||(s[2]=(...e)=>n.onBlur&&n.onBlur(...e)),onKeydown:s[3]||(s[3]=(...e)=>n.onKeyDown&&n.onKeyDown(...e)),onKeypress:s[4]||(s[4]=(...e)=>n.onKeyPress&&n.onKeyPress(...e)),onPaste:s[5]||(s[5]=(...e)=>n.onPaste&&n.onPaste(...e))},null,42,i)},module.exports=s;
|