@dialpad/dialtone 9.66.0 → 9.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/tokens/doc.json +13063 -13063
- package/dist/vue2/chunks/{dropdown-YdCyJ5Dq.js → dropdown-6UoczdUY.js} +41 -77
- package/dist/vue2/chunks/{dropdown-YdCyJ5Dq.js.map → dropdown-6UoczdUY.js.map} +1 -1
- package/dist/vue2/chunks/{dropdown-mjrYu_mK.js → dropdown-pHxnQPzT.js} +41 -77
- package/dist/vue2/chunks/{dropdown-mjrYu_mK.js.map → dropdown-pHxnQPzT.js.map} +1 -1
- package/dist/vue2/chunks/dropdown_constants-2pGCXy7m.js.map +1 -1
- package/dist/vue2/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -1
- package/dist/vue2/chunks/{icon_constants-TdxqLsS2.js → icon_constants-Dy4MEUJL.js} +2 -3
- package/dist/vue2/chunks/icon_constants-Dy4MEUJL.js.map +1 -0
- package/dist/vue2/chunks/{icon_constants-VEA0wI5C.js → icon_constants-QYpmdE0R.js} +2 -3
- package/dist/vue2/chunks/icon_constants-QYpmdE0R.js.map +1 -0
- package/dist/vue2/chunks/{index-i65YVk-U.js → index-ODod4Oj_.js} +13 -5
- package/dist/vue2/chunks/{index-i65YVk-U.js.map → index-ODod4Oj_.js.map} +1 -1
- package/dist/vue2/chunks/{index-NYFNZeHH.js → index-anN_sx1F.js} +13 -5
- package/dist/vue2/chunks/{index-NYFNZeHH.js.map → index-anN_sx1F.js.map} +1 -1
- package/dist/vue2/chunks/{index-mBWay1Qb.js → index-eJ-WWRdf.js} +87 -122
- package/dist/vue2/chunks/{index-mBWay1Qb.js.map → index-eJ-WWRdf.js.map} +1 -1
- package/dist/vue2/chunks/{index-DyqUqjvI.js → index-gj1jEXP4.js} +87 -122
- package/dist/vue2/chunks/{index-DyqUqjvI.js.map → index-gj1jEXP4.js.map} +1 -1
- package/dist/vue2/chunks/{input-PhJeBN6r.js → input-6kbd8Pju.js} +9 -3
- package/dist/vue2/chunks/{input-PhJeBN6r.js.map → input-6kbd8Pju.js.map} +1 -1
- package/dist/vue2/chunks/{input-Hqw33WBe.js → input-Axw-wFj2.js} +9 -3
- package/dist/vue2/chunks/{input-Hqw33WBe.js.map → input-Axw-wFj2.js.map} +1 -1
- package/dist/vue2/chunks/{input_group-pE6ec9R3.js → input_group-m3cWYUfI.js} +2 -4
- package/dist/vue2/chunks/{input_group-ZI7aVGEp.js.map → input_group-m3cWYUfI.js.map} +1 -1
- package/dist/vue2/chunks/{input_group-ZI7aVGEp.js → input_group-qVZaS5Bb.js} +2 -4
- package/dist/vue2/chunks/{input_group-pE6ec9R3.js.map → input_group-qVZaS5Bb.js.map} +1 -1
- package/dist/vue2/chunks/{keyboard_list_navigation-YIqTuw1W.js → keyboard_list_navigation-ScXhrxya.js} +5 -6
- package/dist/{vue3/chunks/keyboard_list_navigation-x3D6RcC7.js.map → vue2/chunks/keyboard_list_navigation-ScXhrxya.js.map} +1 -1
- package/dist/vue2/chunks/{keyboard_list_navigation-x3D6RcC7.js → keyboard_list_navigation-fJnl_Iox.js} +5 -6
- package/dist/{vue3/chunks/keyboard_list_navigation-YIqTuw1W.js.map → vue2/chunks/keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
- package/dist/vue2/chunks/link_constants-AfTWrr-n.js.map +1 -1
- package/dist/vue2/chunks/link_constants-x8NwdqmA.js.map +1 -1
- package/dist/vue2/chunks/list_item_constants-EiqkqZvP.js.map +1 -1
- package/dist/vue2/chunks/list_item_constants-u1xcN9Dd.js.map +1 -1
- package/dist/vue2/chunks/{modal-OaWxzqNt.js → modal-VgxXAQFP.js} +2 -4
- package/dist/vue2/chunks/{modal-OaWxzqNt.js.map → modal-VgxXAQFP.js.map} +1 -1
- package/dist/vue2/chunks/{modal-8X6poIZW.js → modal-XOr4kiNZ.js} +2 -4
- package/dist/{vue3/chunks/modal-OaWxzqNt.js.map → vue2/chunks/modal-XOr4kiNZ.js.map} +1 -1
- package/dist/vue2/chunks/{notice_action-qQr3K2TC.js → notice_action-IRUoLX2d.js} +46 -71
- package/dist/vue2/chunks/{notice_action-qQr3K2TC.js.map → notice_action-IRUoLX2d.js.map} +1 -1
- package/dist/vue2/chunks/{notice_action-tEvvMg7Q.js → notice_action-P6uDyE9x.js} +46 -71
- package/dist/vue2/chunks/{notice_action-tEvvMg7Q.js.map → notice_action-P6uDyE9x.js.map} +1 -1
- package/dist/vue2/chunks/notice_constants-7Qt2CQEY.js.map +1 -1
- package/dist/vue2/chunks/notice_constants-UXo9e3bS.js.map +1 -1
- package/dist/vue2/chunks/{popover_constants-6YkPPbnk.js → popover_constants-WsOUIY-m.js} +47 -26
- package/dist/{vue3/chunks/popover_constants-6YkPPbnk.js.map → vue2/chunks/popover_constants-WsOUIY-m.js.map} +1 -1
- package/dist/{vue3/chunks/popover_constants-h9MD6WUt.js → vue2/chunks/popover_constants-XnGWXaxX.js} +47 -26
- package/dist/vue2/chunks/{popover_constants-6YkPPbnk.js.map → popover_constants-XnGWXaxX.js.map} +1 -1
- package/dist/vue2/chunks/{sr_only_close_button-IjMVfBDE.js → sr_only_close_button-81bHIpPu.js} +18 -24
- package/dist/vue2/chunks/{sr_only_close_button-IjMVfBDE.js.map → sr_only_close_button-81bHIpPu.js.map} +1 -1
- package/dist/vue2/chunks/{sr_only_close_button-2Q9Ny1Nc.js → sr_only_close_button-ZaGdAHz7.js} +18 -24
- package/dist/vue2/chunks/{sr_only_close_button-2Q9Ny1Nc.js.map → sr_only_close_button-ZaGdAHz7.js.map} +1 -1
- package/dist/vue2/chunks/stack_constants-HraCekPm.js.map +1 -1
- package/dist/vue2/chunks/stack_constants-SMzMWnAQ.js.map +1 -1
- package/dist/vue2/chunks/{tab-79yMX6m6.js → tab-FcsV5VmK.js} +68 -86
- package/dist/vue2/chunks/{tab-muPOS7JE.js.map → tab-FcsV5VmK.js.map} +1 -1
- package/dist/vue2/chunks/{tab-muPOS7JE.js → tab-V4cb44Ry.js} +68 -86
- package/dist/vue2/chunks/{tab-79yMX6m6.js.map → tab-V4cb44Ry.js.map} +1 -1
- package/dist/vue2/common/constants.cjs.map +1 -1
- package/dist/vue2/common/constants.js.map +1 -1
- package/dist/vue2/common/dates.cjs +1 -3
- package/dist/vue2/common/dates.cjs.map +1 -1
- package/dist/vue2/common/dates.js +1 -3
- package/dist/vue2/common/dates.js.map +1 -1
- package/dist/vue2/common/emoji.cjs +1 -1
- package/dist/vue2/common/emoji.js +1 -1
- package/dist/vue2/common/mixins.cjs +3 -3
- package/dist/vue2/common/mixins.js +3 -3
- package/dist/vue2/common/utils.cjs +44 -8
- package/dist/vue2/common/utils.cjs.map +1 -1
- package/dist/vue2/common/utils.js +44 -8
- package/dist/vue2/common/utils.js.map +1 -1
- package/dist/vue2/common/validators.cjs.map +1 -1
- package/dist/vue2/common/validators.js.map +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/dialtone-vue.cjs +12 -12
- package/dist/vue2/dialtone-vue.js +12 -12
- package/dist/vue2/lib/attachment-carousel.cjs +48 -172
- package/dist/vue2/lib/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel.js +48 -172
- package/dist/vue2/lib/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/avatar.cjs +58 -75
- package/dist/vue2/lib/avatar.cjs.map +1 -1
- package/dist/vue2/lib/avatar.js +58 -75
- package/dist/vue2/lib/avatar.js.map +1 -1
- package/dist/vue2/lib/badge.cjs +20 -31
- package/dist/vue2/lib/badge.cjs.map +1 -1
- package/dist/vue2/lib/badge.js +20 -31
- package/dist/vue2/lib/badge.js.map +1 -1
- package/dist/vue2/lib/banner.cjs +29 -53
- package/dist/vue2/lib/banner.cjs.map +1 -1
- package/dist/vue2/lib/banner.js +29 -53
- package/dist/vue2/lib/banner.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs.cjs +30 -36
- package/dist/vue2/lib/breadcrumbs.cjs.map +1 -1
- package/dist/vue2/lib/breadcrumbs.js +30 -36
- package/dist/vue2/lib/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button-group.cjs +14 -7
- package/dist/vue2/lib/button-group.cjs.map +1 -1
- package/dist/vue2/lib/button-group.js +14 -7
- package/dist/vue2/lib/button-group.js.map +1 -1
- package/dist/vue2/lib/button.cjs +62 -55
- package/dist/vue2/lib/button.cjs.map +1 -1
- package/dist/vue2/lib/button.js +62 -55
- package/dist/vue2/lib/button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover.cjs +23 -91
- package/dist/vue2/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover.js +23 -91
- package/dist/vue2/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/callbar-button.cjs +33 -49
- package/dist/vue2/lib/callbar-button.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button.js +33 -49
- package/dist/vue2/lib/callbar-button.js.map +1 -1
- package/dist/vue2/lib/callbox.cjs +15 -78
- package/dist/vue2/lib/callbox.cjs.map +1 -1
- package/dist/vue2/lib/callbox.js +15 -78
- package/dist/vue2/lib/callbox.js.map +1 -1
- package/dist/vue2/lib/card.cjs +23 -16
- package/dist/vue2/lib/card.cjs.map +1 -1
- package/dist/vue2/lib/card.js +23 -16
- package/dist/vue2/lib/card.js.map +1 -1
- package/dist/vue2/lib/checkbox-group.cjs +15 -3
- package/dist/vue2/lib/checkbox-group.cjs.map +1 -1
- package/dist/vue2/lib/checkbox-group.js +15 -3
- package/dist/vue2/lib/checkbox-group.js.map +1 -1
- package/dist/vue2/lib/checkbox.cjs +16 -52
- package/dist/vue2/lib/checkbox.cjs.map +1 -1
- package/dist/vue2/lib/checkbox.js +16 -52
- package/dist/vue2/lib/checkbox.js.map +1 -1
- package/dist/vue2/lib/chip.cjs +26 -58
- package/dist/vue2/lib/chip.cjs.map +1 -1
- package/dist/vue2/lib/chip.js +26 -58
- package/dist/vue2/lib/chip.js.map +1 -1
- package/dist/vue2/lib/codeblock.cjs +11 -4
- package/dist/vue2/lib/codeblock.cjs.map +1 -1
- package/dist/vue2/lib/codeblock.js +11 -4
- package/dist/vue2/lib/codeblock.js.map +1 -1
- package/dist/vue2/lib/collapsible.cjs +34 -91
- package/dist/vue2/lib/collapsible.cjs.map +1 -1
- package/dist/vue2/lib/collapsible.js +34 -91
- package/dist/vue2/lib/collapsible.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select.cjs +38 -131
- package/dist/vue2/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select.js +38 -131
- package/dist/vue2/lib/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover.cjs +39 -130
- package/dist/vue2/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/combobox-with-popover.js +39 -130
- package/dist/vue2/lib/combobox-with-popover.js.map +1 -1
- package/dist/vue2/lib/combobox.cjs +3 -3
- package/dist/vue2/lib/combobox.js +3 -3
- package/dist/vue2/lib/contact-centers-row.cjs +29 -86
- package/dist/vue2/lib/contact-centers-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-centers-row.js +29 -86
- package/dist/vue2/lib/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-info.cjs +31 -95
- package/dist/vue2/lib/contact-info.cjs.map +1 -1
- package/dist/vue2/lib/contact-info.js +31 -95
- package/dist/vue2/lib/contact-info.js.map +1 -1
- package/dist/vue2/lib/contact-row.cjs +18 -61
- package/dist/vue2/lib/contact-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-row.js +18 -61
- package/dist/vue2/lib/contact-row.js.map +1 -1
- package/dist/vue2/lib/datepicker.cjs +102 -361
- package/dist/vue2/lib/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker.js +102 -361
- package/dist/vue2/lib/datepicker.js.map +1 -1
- package/dist/vue2/lib/description-list.cjs +12 -11
- package/dist/vue2/lib/description-list.cjs.map +1 -1
- package/dist/vue2/lib/description-list.js +12 -11
- package/dist/vue2/lib/description-list.js.map +1 -1
- package/dist/vue2/lib/dropdown.cjs +17 -13
- package/dist/vue2/lib/dropdown.cjs.map +1 -1
- package/dist/vue2/lib/dropdown.js +17 -13
- package/dist/vue2/lib/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor.cjs +109 -409
- package/dist/vue2/lib/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor.js +109 -409
- package/dist/vue2/lib/editor.js.map +1 -1
- package/dist/vue2/lib/emoji-picker.cjs +234 -512
- package/dist/vue2/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker.js +234 -512
- package/dist/vue2/lib/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row.cjs +31 -69
- package/dist/vue2/lib/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row.js +31 -69
- package/dist/vue2/lib/emoji-row.js.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper.cjs +22 -14
- package/dist/vue2/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper.js +22 -14
- package/dist/vue2/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/vue2/lib/emoji.cjs +13 -40
- package/dist/vue2/lib/emoji.cjs.map +1 -1
- package/dist/vue2/lib/emoji.js +13 -40
- package/dist/vue2/lib/emoji.js.map +1 -1
- package/dist/vue2/lib/empty-state.cjs +12 -27
- package/dist/vue2/lib/empty-state.cjs.map +1 -1
- package/dist/vue2/lib/empty-state.js +12 -27
- package/dist/vue2/lib/empty-state.js.map +1 -1
- package/dist/vue2/lib/feed-item-row.cjs +27 -106
- package/dist/vue2/lib/feed-item-row.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-row.js +27 -106
- package/dist/vue2/lib/feed-item-row.js.map +1 -1
- package/dist/vue2/lib/feed-pill.cjs +35 -90
- package/dist/vue2/lib/feed-pill.cjs.map +1 -1
- package/dist/vue2/lib/feed-pill.js +35 -90
- package/dist/vue2/lib/feed-pill.js.map +1 -1
- package/dist/vue2/lib/general-row.cjs +75 -184
- package/dist/vue2/lib/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row.js +75 -184
- package/dist/vue2/lib/general-row.js.map +1 -1
- package/dist/vue2/lib/group-row.cjs +16 -27
- package/dist/vue2/lib/group-row.cjs.map +1 -1
- package/dist/vue2/lib/group-row.js +16 -27
- package/dist/vue2/lib/group-row.js.map +1 -1
- package/dist/vue2/lib/grouped-chip.cjs +20 -68
- package/dist/vue2/lib/grouped-chip.cjs.map +1 -1
- package/dist/vue2/lib/grouped-chip.js +20 -68
- package/dist/vue2/lib/grouped-chip.js.map +1 -1
- package/dist/vue2/lib/hovercard.cjs +41 -71
- package/dist/vue2/lib/hovercard.cjs.map +1 -1
- package/dist/vue2/lib/hovercard.js +41 -71
- package/dist/vue2/lib/hovercard.js.map +1 -1
- package/dist/vue2/lib/icon.cjs +12 -10
- package/dist/vue2/lib/icon.cjs.map +1 -1
- package/dist/vue2/lib/icon.js +12 -10
- package/dist/vue2/lib/icon.js.map +1 -1
- package/dist/vue2/lib/illustration.cjs +12 -9
- package/dist/vue2/lib/illustration.cjs.map +1 -1
- package/dist/vue2/lib/illustration.js +12 -9
- package/dist/vue2/lib/illustration.js.map +1 -1
- package/dist/vue2/lib/image-viewer.cjs +23 -88
- package/dist/vue2/lib/image-viewer.cjs.map +1 -1
- package/dist/vue2/lib/image-viewer.js +23 -88
- package/dist/vue2/lib/image-viewer.js.map +1 -1
- package/dist/vue2/lib/input-group.cjs +14 -24
- package/dist/vue2/lib/input-group.cjs.map +1 -1
- package/dist/vue2/lib/input-group.js +14 -24
- package/dist/vue2/lib/input-group.js.map +1 -1
- package/dist/vue2/lib/input.cjs +47 -109
- package/dist/vue2/lib/input.cjs.map +1 -1
- package/dist/vue2/lib/input.js +47 -109
- package/dist/vue2/lib/input.js.map +1 -1
- package/dist/vue2/lib/item-layout.cjs +11 -42
- package/dist/vue2/lib/item-layout.cjs.map +1 -1
- package/dist/vue2/lib/item-layout.js +11 -42
- package/dist/vue2/lib/item-layout.js.map +1 -1
- package/dist/vue2/lib/ivr-node.cjs +47 -135
- package/dist/vue2/lib/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node.js +47 -135
- package/dist/vue2/lib/ivr-node.js.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.cjs +23 -35
- package/dist/vue2/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.js +23 -35
- package/dist/vue2/lib/keyboard-shortcut.js.map +1 -1
- package/dist/vue2/lib/lazy-show.cjs +11 -15
- package/dist/vue2/lib/lazy-show.cjs.map +1 -1
- package/dist/vue2/lib/lazy-show.js +11 -15
- package/dist/vue2/lib/lazy-show.js.map +1 -1
- package/dist/vue2/lib/link.cjs +15 -9
- package/dist/vue2/lib/link.cjs.map +1 -1
- package/dist/vue2/lib/link.js +15 -9
- package/dist/vue2/lib/link.js.map +1 -1
- package/dist/vue2/lib/list-item-group.cjs +11 -17
- package/dist/vue2/lib/list-item-group.cjs.map +1 -1
- package/dist/vue2/lib/list-item-group.js +11 -17
- package/dist/vue2/lib/list-item-group.js.map +1 -1
- package/dist/vue2/lib/list-item.cjs +23 -42
- package/dist/vue2/lib/list-item.cjs.map +1 -1
- package/dist/vue2/lib/list-item.js +23 -42
- package/dist/vue2/lib/list-item.js.map +1 -1
- package/dist/vue2/lib/message-input.cjs +97 -360
- package/dist/vue2/lib/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input.js +97 -360
- package/dist/vue2/lib/message-input.js.map +1 -1
- package/dist/vue2/lib/modal.cjs +36 -94
- package/dist/vue2/lib/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal.js +36 -94
- package/dist/vue2/lib/modal.js.map +1 -1
- package/dist/vue2/lib/notice.cjs +21 -40
- package/dist/vue2/lib/notice.cjs.map +1 -1
- package/dist/vue2/lib/notice.js +21 -40
- package/dist/vue2/lib/notice.js.map +1 -1
- package/dist/vue2/lib/pagination.cjs +20 -81
- package/dist/vue2/lib/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination.js +20 -81
- package/dist/vue2/lib/pagination.js.map +1 -1
- package/dist/vue2/lib/popover.cjs +75 -194
- package/dist/vue2/lib/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover.js +76 -195
- package/dist/vue2/lib/popover.js.map +1 -1
- package/dist/vue2/lib/presence.cjs +22 -23
- package/dist/vue2/lib/presence.cjs.map +1 -1
- package/dist/vue2/lib/presence.js +22 -23
- package/dist/vue2/lib/presence.js.map +1 -1
- package/dist/vue2/lib/radio-group.cjs +11 -2
- package/dist/vue2/lib/radio-group.cjs.map +1 -1
- package/dist/vue2/lib/radio-group.js +11 -2
- package/dist/vue2/lib/radio-group.js.map +1 -1
- package/dist/vue2/lib/radio.cjs +15 -47
- package/dist/vue2/lib/radio.cjs.map +1 -1
- package/dist/vue2/lib/radio.js +15 -47
- package/dist/vue2/lib/radio.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor.cjs +317 -336
- package/dist/vue2/lib/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor.js +317 -336
- package/dist/vue2/lib/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/root-layout.cjs +15 -33
- package/dist/vue2/lib/root-layout.cjs.map +1 -1
- package/dist/vue2/lib/root-layout.js +15 -33
- package/dist/vue2/lib/root-layout.js.map +1 -1
- package/dist/vue2/lib/scrollbar-directive.cjs +422 -388
- package/dist/vue2/lib/scrollbar-directive.cjs.map +1 -1
- package/dist/vue2/lib/scrollbar-directive.js +422 -388
- package/dist/vue2/lib/scrollbar-directive.js.map +1 -1
- package/dist/vue2/lib/select-menu.cjs +33 -52
- package/dist/vue2/lib/select-menu.cjs.map +1 -1
- package/dist/vue2/lib/select-menu.js +33 -52
- package/dist/vue2/lib/select-menu.js.map +1 -1
- package/dist/vue2/lib/settings-menu-button.cjs +16 -42
- package/dist/vue2/lib/settings-menu-button.cjs.map +1 -1
- package/dist/vue2/lib/settings-menu-button.js +16 -42
- package/dist/vue2/lib/settings-menu-button.js.map +1 -1
- package/dist/vue2/lib/skeleton.cjs +93 -118
- package/dist/vue2/lib/skeleton.cjs.map +1 -1
- package/dist/vue2/lib/skeleton.js +93 -118
- package/dist/vue2/lib/skeleton.js.map +1 -1
- package/dist/vue2/lib/split-button.cjs +64 -164
- package/dist/vue2/lib/split-button.cjs.map +1 -1
- package/dist/vue2/lib/split-button.js +64 -164
- package/dist/vue2/lib/split-button.js.map +1 -1
- package/dist/vue2/lib/stack.cjs +33 -21
- package/dist/vue2/lib/stack.cjs.map +1 -1
- package/dist/vue2/lib/stack.js +33 -21
- package/dist/vue2/lib/stack.js.map +1 -1
- package/dist/vue2/lib/tabs.cjs +13 -20
- package/dist/vue2/lib/tabs.cjs.map +1 -1
- package/dist/vue2/lib/tabs.js +13 -20
- package/dist/vue2/lib/tabs.js.map +1 -1
- package/dist/vue2/lib/time-pill.cjs +11 -8
- package/dist/vue2/lib/time-pill.cjs.map +1 -1
- package/dist/vue2/lib/time-pill.js +11 -8
- package/dist/vue2/lib/time-pill.js.map +1 -1
- package/dist/vue2/lib/toast.cjs +21 -42
- package/dist/vue2/lib/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast.js +21 -42
- package/dist/vue2/lib/toast.js.map +1 -1
- package/dist/vue2/lib/toggle.cjs +24 -28
- package/dist/vue2/lib/toggle.cjs.map +1 -1
- package/dist/vue2/lib/toggle.js +24 -28
- package/dist/vue2/lib/toggle.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive.cjs +26 -32
- package/dist/vue2/lib/tooltip-directive.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive.js +26 -32
- package/dist/vue2/lib/tooltip-directive.js.map +1 -1
- package/dist/vue2/lib/tooltip.cjs +21 -31
- package/dist/vue2/lib/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip.js +22 -32
- package/dist/vue2/lib/tooltip.js.map +1 -1
- package/dist/vue2/lib/top-banner-info.cjs +21 -18
- package/dist/vue2/lib/top-banner-info.cjs.map +1 -1
- package/dist/vue2/lib/top-banner-info.js +21 -18
- package/dist/vue2/lib/top-banner-info.js.map +1 -1
- package/dist/vue2/lib/unread-pill.cjs +12 -18
- package/dist/vue2/lib/unread-pill.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill.js +12 -18
- package/dist/vue2/lib/unread-pill.js.map +1 -1
- package/dist/vue2/lib/validation-messages.cjs +16 -23
- package/dist/vue2/lib/validation-messages.cjs.map +1 -1
- package/dist/vue2/lib/validation-messages.js +16 -23
- package/dist/vue2/lib/validation-messages.js.map +1 -1
- package/dist/vue2/style.css +9 -9
- package/dist/vue2/types/common/emoji/index.d.ts +59236 -2
- package/dist/vue2/types/common/emoji/index.d.ts.map +1 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +1 -1
- package/dist/vue2/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue2/types/components/combobox/combobox.vue.d.ts +1 -1
- package/dist/vue2/types/components/icon/icon.vue.d.ts +2 -2
- package/dist/vue2/types/components/icon/icon_constants.d.ts +1 -1
- package/dist/vue2/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/illustration/illustration.vue.d.ts +2 -2
- package/dist/vue2/types/components/illustration/illustration_constants.d.ts +1 -1
- package/dist/vue2/types/components/illustration/illustration_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/input/input.vue.d.ts +3 -2
- package/dist/vue2/types/components/input/input.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +1 -1
- package/dist/vue2/types/components/split_button/split_button-alpha.vue.d.ts +1 -1
- package/dist/vue2/types/components/toast/toast.vue.d.ts +1 -1
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +15 -0
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue3/chunks/{dropdown-6HXkh24e.js → dropdown-oA-_Gotg.js} +45 -40
- package/dist/vue3/chunks/{dropdown-6HXkh24e.js.map → dropdown-oA-_Gotg.js.map} +1 -1
- package/dist/vue3/chunks/{dropdown-QNvAb160.js → dropdown-p-Azgwov.js} +45 -40
- package/dist/vue3/chunks/{dropdown-QNvAb160.js.map → dropdown-p-Azgwov.js.map} +1 -1
- package/dist/vue3/chunks/dropdown_constants-2pGCXy7m.js.map +1 -1
- package/dist/vue3/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -1
- package/dist/vue3/chunks/{icon_constants-gIQj4mf7.js → icon_constants-Dy4MEUJL.js} +2 -3
- package/dist/vue3/chunks/icon_constants-Dy4MEUJL.js.map +1 -0
- package/dist/vue3/chunks/{icon_constants-bvhFNOPu.js → icon_constants-QYpmdE0R.js} +2 -3
- package/dist/vue3/chunks/icon_constants-QYpmdE0R.js.map +1 -0
- package/dist/vue3/chunks/{index-ouh7Bvm-.js → index-4qgKeErp.js} +84 -71
- package/dist/vue3/chunks/{index-T15rAIdX.js.map → index-4qgKeErp.js.map} +1 -1
- package/dist/vue3/chunks/{index-dfdrE-3M.js → index-GVD15GIB.js} +12 -3
- package/dist/vue3/chunks/{index-dfdrE-3M.js.map → index-GVD15GIB.js.map} +1 -1
- package/dist/vue3/chunks/{index-T15rAIdX.js → index-b_MgDylR.js} +84 -71
- package/dist/vue3/chunks/{index-ouh7Bvm-.js.map → index-b_MgDylR.js.map} +1 -1
- package/dist/vue3/chunks/{index-fEp0B-5Z.js → index-lu2o2f4r.js} +12 -3
- package/dist/vue3/chunks/{index-fEp0B-5Z.js.map → index-lu2o2f4r.js.map} +1 -1
- package/dist/vue3/chunks/{input-HIysg24t.js → input-NmYDD5bn.js} +9 -3
- package/dist/vue3/chunks/{input-HIysg24t.js.map → input-NmYDD5bn.js.map} +1 -1
- package/dist/vue3/chunks/{input-dLLo3Wtg.js → input-ttnte8zB.js} +9 -3
- package/dist/vue3/chunks/{input-dLLo3Wtg.js.map → input-ttnte8zB.js.map} +1 -1
- package/dist/vue3/chunks/{input_group-rE6nhye8.js → input_group-M-D25pOJ.js} +2 -4
- package/dist/vue3/chunks/{input_group-hV1WT2it.js.map → input_group-M-D25pOJ.js.map} +1 -1
- package/dist/vue3/chunks/{input_group-hV1WT2it.js → input_group-jWnq2DJT.js} +2 -4
- package/dist/vue3/chunks/{input_group-rE6nhye8.js.map → input_group-jWnq2DJT.js.map} +1 -1
- package/dist/vue3/chunks/{keyboard_list_navigation-YIqTuw1W.js → keyboard_list_navigation-ScXhrxya.js} +5 -6
- package/dist/{vue2/chunks/keyboard_list_navigation-x3D6RcC7.js.map → vue3/chunks/keyboard_list_navigation-ScXhrxya.js.map} +1 -1
- package/dist/vue3/chunks/{keyboard_list_navigation-x3D6RcC7.js → keyboard_list_navigation-fJnl_Iox.js} +5 -6
- package/dist/{vue2/chunks/keyboard_list_navigation-YIqTuw1W.js.map → vue3/chunks/keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
- package/dist/vue3/chunks/link_constants-AfTWrr-n.js.map +1 -1
- package/dist/vue3/chunks/link_constants-x8NwdqmA.js.map +1 -1
- package/dist/vue3/chunks/list_item_constants-EiqkqZvP.js.map +1 -1
- package/dist/vue3/chunks/list_item_constants-u1xcN9Dd.js.map +1 -1
- package/dist/vue3/chunks/{modal-OaWxzqNt.js → modal-VgxXAQFP.js} +2 -4
- package/dist/{vue2/chunks/modal-8X6poIZW.js.map → vue3/chunks/modal-VgxXAQFP.js.map} +1 -1
- package/dist/vue3/chunks/{modal-8X6poIZW.js → modal-XOr4kiNZ.js} +2 -4
- package/dist/vue3/chunks/{modal-8X6poIZW.js.map → modal-XOr4kiNZ.js.map} +1 -1
- package/dist/vue3/chunks/{notice_action-3ed0uIMN.js → notice_action-WTucGhvr.js} +61 -40
- package/dist/vue3/chunks/{notice_action-e08Lw5W6.js.map → notice_action-WTucGhvr.js.map} +1 -1
- package/dist/vue3/chunks/{notice_action-e08Lw5W6.js → notice_action-p-ePanW_.js} +61 -40
- package/dist/vue3/chunks/{notice_action-3ed0uIMN.js.map → notice_action-p-ePanW_.js.map} +1 -1
- package/dist/vue3/chunks/notice_constants-7Qt2CQEY.js.map +1 -1
- package/dist/vue3/chunks/notice_constants-UXo9e3bS.js.map +1 -1
- package/dist/vue3/chunks/{popover_constants-6YkPPbnk.js → popover_constants-WsOUIY-m.js} +47 -26
- package/dist/vue3/chunks/{popover_constants-h9MD6WUt.js.map → popover_constants-WsOUIY-m.js.map} +1 -1
- package/dist/{vue2/chunks/popover_constants-h9MD6WUt.js → vue3/chunks/popover_constants-XnGWXaxX.js} +47 -26
- package/dist/{vue2/chunks/popover_constants-h9MD6WUt.js.map → vue3/chunks/popover_constants-XnGWXaxX.js.map} +1 -1
- package/dist/vue3/chunks/{sr_only_close_button-Ji3Zlts6.js → sr_only_close_button-3EdsV-dH.js} +4 -4
- package/dist/vue3/chunks/{sr_only_close_button-Ji3Zlts6.js.map → sr_only_close_button-3EdsV-dH.js.map} +1 -1
- package/dist/vue3/chunks/{sr_only_close_button-gKr0Vlbz.js → sr_only_close_button-xGrHFjwA.js} +4 -4
- package/dist/vue3/chunks/{sr_only_close_button-gKr0Vlbz.js.map → sr_only_close_button-xGrHFjwA.js.map} +1 -1
- package/dist/vue3/chunks/stack_constants-HraCekPm.js.map +1 -1
- package/dist/vue3/chunks/stack_constants-SMzMWnAQ.js.map +1 -1
- package/dist/vue3/chunks/{tab-aD6t0MNo.js → tab-RTDgnD9-.js} +49 -46
- package/dist/vue3/chunks/{tab-aD6t0MNo.js.map → tab-RTDgnD9-.js.map} +1 -1
- package/dist/vue3/chunks/{tab-X7IvNGTl.js → tab-qc3f42Yp.js} +49 -46
- package/dist/vue3/chunks/{tab-X7IvNGTl.js.map → tab-qc3f42Yp.js.map} +1 -1
- package/dist/vue3/common/constants.cjs.map +1 -1
- package/dist/vue3/common/constants.js.map +1 -1
- package/dist/vue3/common/dates.cjs +1 -3
- package/dist/vue3/common/dates.cjs.map +1 -1
- package/dist/vue3/common/dates.js +1 -3
- package/dist/vue3/common/dates.js.map +1 -1
- package/dist/vue3/common/emoji.cjs +1 -1
- package/dist/vue3/common/emoji.js +1 -1
- package/dist/vue3/common/mixins.cjs +3 -3
- package/dist/vue3/common/mixins.js +3 -3
- package/dist/vue3/common/utils.cjs +45 -11
- package/dist/vue3/common/utils.cjs.map +1 -1
- package/dist/vue3/common/utils.js +45 -11
- package/dist/vue3/common/utils.js.map +1 -1
- package/dist/vue3/common/validators.cjs.map +1 -1
- package/dist/vue3/common/validators.js.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/dialtone-vue.cjs +12 -12
- package/dist/vue3/dialtone-vue.js +12 -12
- package/dist/vue3/lib/attachment-carousel.cjs +108 -87
- package/dist/vue3/lib/attachment-carousel.cjs.map +1 -1
- package/dist/vue3/lib/attachment-carousel.js +108 -87
- package/dist/vue3/lib/attachment-carousel.js.map +1 -1
- package/dist/vue3/lib/avatar.cjs +88 -56
- package/dist/vue3/lib/avatar.cjs.map +1 -1
- package/dist/vue3/lib/avatar.js +88 -56
- package/dist/vue3/lib/avatar.js.map +1 -1
- package/dist/vue3/lib/badge.cjs +31 -15
- package/dist/vue3/lib/badge.cjs.map +1 -1
- package/dist/vue3/lib/badge.js +31 -15
- package/dist/vue3/lib/badge.js.map +1 -1
- package/dist/vue3/lib/banner.cjs +56 -38
- package/dist/vue3/lib/banner.cjs.map +1 -1
- package/dist/vue3/lib/banner.js +56 -38
- package/dist/vue3/lib/banner.js.map +1 -1
- package/dist/vue3/lib/breadcrumbs.cjs +36 -25
- package/dist/vue3/lib/breadcrumbs.cjs.map +1 -1
- package/dist/vue3/lib/breadcrumbs.js +36 -25
- package/dist/vue3/lib/breadcrumbs.js.map +1 -1
- package/dist/vue3/lib/button-group.cjs +7 -2
- package/dist/vue3/lib/button-group.cjs.map +1 -1
- package/dist/vue3/lib/button-group.js +7 -2
- package/dist/vue3/lib/button-group.js.map +1 -1
- package/dist/vue3/lib/button.cjs +69 -44
- package/dist/vue3/lib/button.cjs.map +1 -1
- package/dist/vue3/lib/button.js +69 -44
- package/dist/vue3/lib/button.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover.cjs +81 -68
- package/dist/vue3/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover.js +81 -68
- package/dist/vue3/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/vue3/lib/callbar-button.cjs +45 -32
- package/dist/vue3/lib/callbar-button.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button.js +45 -32
- package/dist/vue3/lib/callbar-button.js.map +1 -1
- package/dist/vue3/lib/callbox.cjs +57 -38
- package/dist/vue3/lib/callbox.cjs.map +1 -1
- package/dist/vue3/lib/callbox.js +57 -38
- package/dist/vue3/lib/callbox.js.map +1 -1
- package/dist/vue3/lib/card.cjs +33 -13
- package/dist/vue3/lib/card.cjs.map +1 -1
- package/dist/vue3/lib/card.js +33 -13
- package/dist/vue3/lib/card.js.map +1 -1
- package/dist/vue3/lib/checkbox-group.cjs +5 -2
- package/dist/vue3/lib/checkbox-group.cjs.map +1 -1
- package/dist/vue3/lib/checkbox-group.js +5 -2
- package/dist/vue3/lib/checkbox-group.js.map +1 -1
- package/dist/vue3/lib/checkbox.cjs +45 -41
- package/dist/vue3/lib/checkbox.cjs.map +1 -1
- package/dist/vue3/lib/checkbox.js +45 -41
- package/dist/vue3/lib/checkbox.js.map +1 -1
- package/dist/vue3/lib/chip.cjs +53 -38
- package/dist/vue3/lib/chip.cjs.map +1 -1
- package/dist/vue3/lib/chip.js +53 -38
- package/dist/vue3/lib/chip.js.map +1 -1
- package/dist/vue3/lib/codeblock.cjs +6 -4
- package/dist/vue3/lib/codeblock.cjs.map +1 -1
- package/dist/vue3/lib/codeblock.js +6 -4
- package/dist/vue3/lib/codeblock.js.map +1 -1
- package/dist/vue3/lib/collapsible.cjs +76 -62
- package/dist/vue3/lib/collapsible.cjs.map +1 -1
- package/dist/vue3/lib/collapsible.js +76 -62
- package/dist/vue3/lib/collapsible.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.cjs +88 -75
- package/dist/vue3/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.js +88 -75
- package/dist/vue3/lib/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.cjs +85 -77
- package/dist/vue3/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.js +85 -77
- package/dist/vue3/lib/combobox-with-popover.js.map +1 -1
- package/dist/vue3/lib/combobox.cjs +3 -3
- package/dist/vue3/lib/combobox.js +3 -3
- package/dist/vue3/lib/contact-centers-row.cjs +89 -65
- package/dist/vue3/lib/contact-centers-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-centers-row.js +89 -65
- package/dist/vue3/lib/contact-centers-row.js.map +1 -1
- package/dist/vue3/lib/contact-info.cjs +82 -59
- package/dist/vue3/lib/contact-info.cjs.map +1 -1
- package/dist/vue3/lib/contact-info.js +82 -59
- package/dist/vue3/lib/contact-info.js.map +1 -1
- package/dist/vue3/lib/contact-row.cjs +47 -37
- package/dist/vue3/lib/contact-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-row.js +47 -37
- package/dist/vue3/lib/contact-row.js.map +1 -1
- package/dist/vue3/lib/datepicker.cjs +263 -267
- package/dist/vue3/lib/datepicker.cjs.map +1 -1
- package/dist/vue3/lib/datepicker.js +263 -267
- package/dist/vue3/lib/datepicker.js.map +1 -1
- package/dist/vue3/lib/description-list.cjs +14 -9
- package/dist/vue3/lib/description-list.cjs.map +1 -1
- package/dist/vue3/lib/description-list.js +14 -9
- package/dist/vue3/lib/description-list.js.map +1 -1
- package/dist/vue3/lib/dropdown.cjs +6 -6
- package/dist/vue3/lib/dropdown.cjs.map +1 -1
- package/dist/vue3/lib/dropdown.js +6 -6
- package/dist/vue3/lib/dropdown.js.map +1 -1
- package/dist/vue3/lib/editor.cjs +249 -312
- package/dist/vue3/lib/editor.cjs.map +1 -1
- package/dist/vue3/lib/editor.js +249 -312
- package/dist/vue3/lib/editor.js.map +1 -1
- package/dist/vue3/lib/emoji-picker.cjs +419 -387
- package/dist/vue3/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker.js +419 -387
- package/dist/vue3/lib/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/emoji-row.cjs +69 -59
- package/dist/vue3/lib/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row.js +69 -59
- package/dist/vue3/lib/emoji-row.js.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper.cjs +12 -13
- package/dist/vue3/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper.js +12 -13
- package/dist/vue3/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/vue3/lib/emoji.cjs +23 -19
- package/dist/vue3/lib/emoji.cjs.map +1 -1
- package/dist/vue3/lib/emoji.js +23 -19
- package/dist/vue3/lib/emoji.js.map +1 -1
- package/dist/vue3/lib/empty-state.cjs +30 -20
- package/dist/vue3/lib/empty-state.cjs.map +1 -1
- package/dist/vue3/lib/empty-state.js +30 -20
- package/dist/vue3/lib/empty-state.js.map +1 -1
- package/dist/vue3/lib/feed-item-row.cjs +74 -43
- package/dist/vue3/lib/feed-item-row.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-row.js +74 -43
- package/dist/vue3/lib/feed-item-row.js.map +1 -1
- package/dist/vue3/lib/feed-pill.cjs +55 -45
- package/dist/vue3/lib/feed-pill.cjs.map +1 -1
- package/dist/vue3/lib/feed-pill.js +55 -45
- package/dist/vue3/lib/feed-pill.js.map +1 -1
- package/dist/vue3/lib/general-row.cjs +165 -115
- package/dist/vue3/lib/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row.js +165 -115
- package/dist/vue3/lib/general-row.js.map +1 -1
- package/dist/vue3/lib/group-row.cjs +9 -7
- package/dist/vue3/lib/group-row.cjs.map +1 -1
- package/dist/vue3/lib/group-row.js +9 -7
- package/dist/vue3/lib/group-row.js.map +1 -1
- package/dist/vue3/lib/grouped-chip.cjs +48 -27
- package/dist/vue3/lib/grouped-chip.cjs.map +1 -1
- package/dist/vue3/lib/grouped-chip.js +48 -27
- package/dist/vue3/lib/grouped-chip.js.map +1 -1
- package/dist/vue3/lib/hovercard.cjs +33 -25
- package/dist/vue3/lib/hovercard.cjs.map +1 -1
- package/dist/vue3/lib/hovercard.js +33 -25
- package/dist/vue3/lib/hovercard.js.map +1 -1
- package/dist/vue3/lib/icon.cjs +1 -1
- package/dist/vue3/lib/icon.cjs.map +1 -1
- package/dist/vue3/lib/icon.js +1 -1
- package/dist/vue3/lib/icon.js.map +1 -1
- package/dist/vue3/lib/illustration.cjs +1 -2
- package/dist/vue3/lib/illustration.cjs.map +1 -1
- package/dist/vue3/lib/illustration.js +1 -2
- package/dist/vue3/lib/illustration.js.map +1 -1
- package/dist/vue3/lib/image-viewer.cjs +66 -52
- package/dist/vue3/lib/image-viewer.cjs.map +1 -1
- package/dist/vue3/lib/image-viewer.js +66 -52
- package/dist/vue3/lib/image-viewer.js.map +1 -1
- package/dist/vue3/lib/input-group.cjs +19 -15
- package/dist/vue3/lib/input-group.cjs.map +1 -1
- package/dist/vue3/lib/input-group.js +19 -15
- package/dist/vue3/lib/input-group.js.map +1 -1
- package/dist/vue3/lib/input.cjs +114 -77
- package/dist/vue3/lib/input.cjs.map +1 -1
- package/dist/vue3/lib/input.js +114 -77
- package/dist/vue3/lib/input.js.map +1 -1
- package/dist/vue3/lib/item-layout.cjs +27 -10
- package/dist/vue3/lib/item-layout.cjs.map +1 -1
- package/dist/vue3/lib/item-layout.js +27 -10
- package/dist/vue3/lib/item-layout.js.map +1 -1
- package/dist/vue3/lib/ivr-node.cjs +89 -80
- package/dist/vue3/lib/ivr-node.cjs.map +1 -1
- package/dist/vue3/lib/ivr-node.js +89 -80
- package/dist/vue3/lib/ivr-node.js.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.cjs +31 -26
- package/dist/vue3/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.js +31 -26
- package/dist/vue3/lib/keyboard-shortcut.js.map +1 -1
- package/dist/vue3/lib/lazy-show.cjs +8 -6
- package/dist/vue3/lib/lazy-show.cjs.map +1 -1
- package/dist/vue3/lib/lazy-show.js +8 -6
- package/dist/vue3/lib/lazy-show.js.map +1 -1
- package/dist/vue3/lib/link.cjs +7 -2
- package/dist/vue3/lib/link.cjs.map +1 -1
- package/dist/vue3/lib/link.js +7 -2
- package/dist/vue3/lib/link.js.map +1 -1
- package/dist/vue3/lib/list-item-group.cjs +14 -7
- package/dist/vue3/lib/list-item-group.cjs.map +1 -1
- package/dist/vue3/lib/list-item-group.js +14 -7
- package/dist/vue3/lib/list-item-group.js.map +1 -1
- package/dist/vue3/lib/list-item.cjs +25 -24
- package/dist/vue3/lib/list-item.cjs.map +1 -1
- package/dist/vue3/lib/list-item.js +25 -24
- package/dist/vue3/lib/list-item.js.map +1 -1
- package/dist/vue3/lib/message-input.cjs +264 -227
- package/dist/vue3/lib/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input.js +264 -227
- package/dist/vue3/lib/message-input.js.map +1 -1
- package/dist/vue3/lib/modal.cjs +99 -59
- package/dist/vue3/lib/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal.js +99 -59
- package/dist/vue3/lib/modal.js.map +1 -1
- package/dist/vue3/lib/notice.cjs +46 -33
- package/dist/vue3/lib/notice.cjs.map +1 -1
- package/dist/vue3/lib/notice.js +46 -33
- package/dist/vue3/lib/notice.js.map +1 -1
- package/dist/vue3/lib/pagination.cjs +61 -49
- package/dist/vue3/lib/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination.js +61 -49
- package/dist/vue3/lib/pagination.js.map +1 -1
- package/dist/vue3/lib/popover.cjs +156 -133
- package/dist/vue3/lib/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover.js +157 -134
- package/dist/vue3/lib/popover.js.map +1 -1
- package/dist/vue3/lib/presence.cjs +17 -9
- package/dist/vue3/lib/presence.cjs.map +1 -1
- package/dist/vue3/lib/presence.js +17 -9
- package/dist/vue3/lib/presence.js.map +1 -1
- package/dist/vue3/lib/radio-group.cjs +1 -1
- package/dist/vue3/lib/radio-group.cjs.map +1 -1
- package/dist/vue3/lib/radio-group.js +1 -1
- package/dist/vue3/lib/radio-group.js.map +1 -1
- package/dist/vue3/lib/radio.cjs +41 -34
- package/dist/vue3/lib/radio.cjs.map +1 -1
- package/dist/vue3/lib/radio.js +41 -34
- package/dist/vue3/lib/radio.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor.cjs +288 -292
- package/dist/vue3/lib/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor.js +288 -292
- package/dist/vue3/lib/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/root-layout.cjs +39 -24
- package/dist/vue3/lib/root-layout.cjs.map +1 -1
- package/dist/vue3/lib/root-layout.js +39 -24
- package/dist/vue3/lib/root-layout.js.map +1 -1
- package/dist/vue3/lib/scrollbar-directive.cjs +422 -388
- package/dist/vue3/lib/scrollbar-directive.cjs.map +1 -1
- package/dist/vue3/lib/scrollbar-directive.js +422 -388
- package/dist/vue3/lib/scrollbar-directive.js.map +1 -1
- package/dist/vue3/lib/scroller.cjs +83 -100
- package/dist/vue3/lib/scroller.cjs.map +1 -1
- package/dist/vue3/lib/scroller.js +83 -100
- package/dist/vue3/lib/scroller.js.map +1 -1
- package/dist/vue3/lib/select-menu.cjs +67 -40
- package/dist/vue3/lib/select-menu.cjs.map +1 -1
- package/dist/vue3/lib/select-menu.js +67 -40
- package/dist/vue3/lib/select-menu.js.map +1 -1
- package/dist/vue3/lib/settings-menu-button.cjs +16 -10
- package/dist/vue3/lib/settings-menu-button.cjs.map +1 -1
- package/dist/vue3/lib/settings-menu-button.js +16 -10
- package/dist/vue3/lib/settings-menu-button.js.map +1 -1
- package/dist/vue3/lib/skeleton.cjs +93 -74
- package/dist/vue3/lib/skeleton.cjs.map +1 -1
- package/dist/vue3/lib/skeleton.js +93 -74
- package/dist/vue3/lib/skeleton.js.map +1 -1
- package/dist/vue3/lib/split-button.cjs +74 -68
- package/dist/vue3/lib/split-button.cjs.map +1 -1
- package/dist/vue3/lib/split-button.js +74 -68
- package/dist/vue3/lib/split-button.js.map +1 -1
- package/dist/vue3/lib/stack.cjs +26 -18
- package/dist/vue3/lib/stack.cjs.map +1 -1
- package/dist/vue3/lib/stack.js +26 -18
- package/dist/vue3/lib/stack.js.map +1 -1
- package/dist/vue3/lib/tabs.cjs +7 -3
- package/dist/vue3/lib/tabs.cjs.map +1 -1
- package/dist/vue3/lib/tabs.js +7 -3
- package/dist/vue3/lib/tabs.js.map +1 -1
- package/dist/vue3/lib/time-pill.cjs.map +1 -1
- package/dist/vue3/lib/time-pill.js.map +1 -1
- package/dist/vue3/lib/toast.cjs +51 -35
- package/dist/vue3/lib/toast.cjs.map +1 -1
- package/dist/vue3/lib/toast.js +51 -35
- package/dist/vue3/lib/toast.js.map +1 -1
- package/dist/vue3/lib/toggle.cjs +34 -24
- package/dist/vue3/lib/toggle.cjs.map +1 -1
- package/dist/vue3/lib/toggle.js +34 -24
- package/dist/vue3/lib/toggle.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive.cjs +19 -26
- package/dist/vue3/lib/tooltip-directive.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive.js +19 -26
- package/dist/vue3/lib/tooltip-directive.js.map +1 -1
- package/dist/vue3/lib/tooltip.cjs +32 -21
- package/dist/vue3/lib/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip.js +33 -22
- package/dist/vue3/lib/tooltip.js.map +1 -1
- package/dist/vue3/lib/top-banner-info.cjs +23 -8
- package/dist/vue3/lib/top-banner-info.cjs.map +1 -1
- package/dist/vue3/lib/top-banner-info.js +23 -8
- package/dist/vue3/lib/top-banner-info.js.map +1 -1
- package/dist/vue3/lib/unread-pill.cjs +11 -8
- package/dist/vue3/lib/unread-pill.cjs.map +1 -1
- package/dist/vue3/lib/unread-pill.js +11 -8
- package/dist/vue3/lib/unread-pill.js.map +1 -1
- package/dist/vue3/lib/validation-messages.cjs +17 -14
- package/dist/vue3/lib/validation-messages.cjs.map +1 -1
- package/dist/vue3/lib/validation-messages.js +17 -14
- package/dist/vue3/lib/validation-messages.js.map +1 -1
- package/dist/vue3/style.css +9 -9
- package/dist/vue3/types/components/button/button.vue.d.ts +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue3/types/components/combobox/combobox.vue.d.ts +1 -1
- package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts +1 -1
- package/dist/vue3/types/components/icon/icon.vue.d.ts +2 -2
- package/dist/vue3/types/components/icon/icon_constants.d.ts +1 -1
- package/dist/vue3/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/illustration/illustration_constants.d.ts +1 -1
- package/dist/vue3/types/components/illustration/illustration_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/input/input.vue.d.ts +3 -2
- package/dist/vue3/types/components/input/input.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/modal/modal.vue.d.ts +1 -1
- package/dist/vue3/types/components/notice/notice.vue.d.ts +1 -1
- package/dist/vue3/types/components/radio/radio.vue.d.ts +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +1 -1
- package/dist/vue3/types/components/scroller/modules/scroller_item.vue.d.ts +1 -1
- package/dist/vue3/types/components/split_button/split_button-alpha.vue.d.ts +1 -1
- package/dist/vue3/types/components/tabs/tab.vue.d.ts +1 -1
- package/dist/vue3/types/components/toast/toast.vue.d.ts +2 -2
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +15 -0
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/vue2/chunks/icon_constants-TdxqLsS2.js.map +0 -1
- package/dist/vue2/chunks/icon_constants-VEA0wI5C.js.map +0 -1
- package/dist/vue3/chunks/icon_constants-bvhFNOPu.js.map +0 -1
- package/dist/vue3/chunks/icon_constants-gIQj4mf7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.cjs","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"dates.cjs","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["format","formatDuration","formatDistance","intervalToDuration","capitalizeFirstLetter","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;;;AAYA,IAAI;AAIJ,SAAS,YAAa,MAAM,cAAc;AACxC;AACA,SAAOA,QAAM,OAAC,MAAM,cAAc;AAAA,IAChC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,UAAU,cAAc;AACpD;AACA,SAAOC,QAAAA,eAAe,UAAU;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,MAAM,UAAU;AAC5C;AACA,SAAOC,QAAc,eAAC,MAAM,UAAU;AAAA,IACpC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,eAAgB;AACvB,SAAO,mBAAmB;AAC5B;AAEA,SAAS,kBAAmB;AAC1B,MAAI,CAAC,aAAY,GAAI;AACnB,UAAM,IAAI,MAAM,wIAC6D;AAAA,EAC9E;AACH;AAMO,SAAS,cAAe,QAAQ;AACrC,mBAAiB;AACnB;AAQO,SAAS,cAAe,MAAM;AACnC,SAAO,YAAY,MAAM,WAAW;AACtC;AAQO,SAAS,eAAgB,mBAAmB;AACjD,MAAI,oBAAoB,IAAI;AAG1B,WAAO,oBAAoB,GAAG,KAAK,GAAI;AAAA,EACxC;AACD,QAAM,WAAWC,QAAAA,mBAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAK,oBAAoB;AAAA,EAC7B,CAAG;AACD,SAAO,oBAAoB,UAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAAS,qBAAsB,MAAM;AACnC,QAAM,MAAM,IAAI,KAAK,mBAAmB,eAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAOC,mCAAsB,IAAI,cAAc,MAAM,KAAK,EAAE,CAAC,EAAE,OAAO,eAAe,IAAI;AAC3F;AA8BO,SAAS,aAAc,MAAM;AAClC,MAAIC,QAAAA,QAAQ,IAAI,GAAG;AACjB,WAAO,qBAAqB,CAAC;AAAA,EACjC,WAAaC,QAAAA,YAAY,IAAI,GAAG;AAC5B,WAAO,qBAAqB,EAAE;AAAA,EAClC,WAAaC,QAAAA,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,MAAM;AAAA,EACnC,WAAaC,QAAAA,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,cAAc;AAAA,EAC3C,OAAS;AACL,WAAO,YAAY,MAAM,WAAW;AAAA,EACrC;AACH;;;;;"}
|
|
@@ -47,9 +47,7 @@ function durationInHHMM(durationInSeconds) {
|
|
|
47
47
|
return _baseFormatDuration(duration, ["hours", "minutes"]);
|
|
48
48
|
}
|
|
49
49
|
function _getRelativeDaysText(days) {
|
|
50
|
-
const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, {
|
|
51
|
-
numeric: "auto"
|
|
52
|
-
});
|
|
50
|
+
const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: "auto" });
|
|
53
51
|
return capitalizeFirstLetter(rtl.formatToParts(days, "day")[0].value, dialtoneLocale.code);
|
|
54
52
|
}
|
|
55
53
|
function relativeDate(date) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"dates.js","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":[],"mappings":";;;;AAYA,IAAI;AAIJ,SAAS,YAAa,MAAM,cAAc;AACxC;AACA,SAAO,OAAO,MAAM,cAAc;AAAA,IAChC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,UAAU,cAAc;AACpD;AACA,SAAO,eAAe,UAAU;AAAA,IAC9B,QAAQ;AAAA,IACR,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,oBAAqB,MAAM,UAAU;AAC5C;AACA,SAAO,eAAe,MAAM,UAAU;AAAA,IACpC,QAAQ;AAAA,EACZ,CAAG;AACH;AAEA,SAAS,eAAgB;AACvB,SAAO,mBAAmB;AAC5B;AAEA,SAAS,kBAAmB;AAC1B,MAAI,CAAC,aAAY,GAAI;AACnB,UAAM,IAAI,MAAM,wIAC6D;AAAA,EAC9E;AACH;AAMO,SAAS,cAAe,QAAQ;AACrC,mBAAiB;AACnB;AAQO,SAAS,cAAe,MAAM;AACnC,SAAO,YAAY,MAAM,WAAW;AACtC;AAQO,SAAS,eAAgB,mBAAmB;AACjD,MAAI,oBAAoB,IAAI;AAG1B,WAAO,oBAAoB,GAAG,KAAK,GAAI;AAAA,EACxC;AACD,QAAM,WAAW,mBAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAK,oBAAoB;AAAA,EAC7B,CAAG;AACD,SAAO,oBAAoB,UAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAAS,qBAAsB,MAAM;AACnC,QAAM,MAAM,IAAI,KAAK,mBAAmB,eAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAO,sBAAsB,IAAI,cAAc,MAAM,KAAK,EAAE,CAAC,EAAE,OAAO,eAAe,IAAI;AAC3F;AA8BO,SAAS,aAAc,MAAM;AAClC,MAAI,QAAQ,IAAI,GAAG;AACjB,WAAO,qBAAqB,CAAC;AAAA,EACjC,WAAa,YAAY,IAAI,GAAG;AAC5B,WAAO,qBAAqB,EAAE;AAAA,EAClC,WAAa,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,MAAM;AAAA,EACnC,WAAa,WAAW,IAAI,GAAG;AAC3B,WAAO,YAAY,MAAM,cAAc;AAAA,EAC3C,OAAS;AACL,WAAO,YAAY,MAAM,WAAW;AAAA,EACrC;AACH;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const common_emoji = require("../chunks/index-anN_sx1F.js");
|
|
3
4
|
require("emoji-toolkit/emoji_strategy.json");
|
|
4
|
-
const common_emoji = require("../chunks/index-NYFNZeHH.js");
|
|
5
5
|
exports.codeToEmojiData = common_emoji.codeToEmojiData;
|
|
6
6
|
Object.defineProperty(exports, "customEmojiAssetUrl", {
|
|
7
7
|
enumerable: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { codeToEmojiData, customEmojiAssetUrl, defaultEmojiAssetUrl, emojiFileExtensionLarge, emojiFileExtensionSmall, emojiImageUrlLarge, emojiImageUrlSmall, emojiJson, emojiRegex, emojiShortCodeRegex, emojiVersion, filterValidShortCodes, findEmojis, findShortCodes, getEmojiData, setCustomEmojiJson, setCustomEmojiUrl, setEmojiAssetUrlLarge, setEmojiAssetUrlSmall, shortcodeToEmojiData, stringToUnicode, unicodeToString, validateCustomEmojiJson } from "../chunks/index-ODod4Oj_.js";
|
|
1
2
|
import "emoji-toolkit/emoji_strategy.json";
|
|
2
|
-
import { codeToEmojiData, customEmojiAssetUrl, defaultEmojiAssetUrl, emojiFileExtensionLarge, emojiFileExtensionSmall, emojiImageUrlLarge, emojiImageUrlSmall, emojiJson, emojiRegex, emojiShortCodeRegex, emojiVersion, filterValidShortCodes, findEmojis, findShortCodes, getEmojiData, setCustomEmojiJson, setCustomEmojiUrl, setEmojiAssetUrlLarge, setEmojiAssetUrlSmall, shortcodeToEmojiData, stringToUnicode, unicodeToString, validateCustomEmojiJson } from "../chunks/index-i65YVk-U.js";
|
|
3
3
|
export {
|
|
4
4
|
codeToEmojiData,
|
|
5
5
|
customEmojiAssetUrl,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const input = require("../chunks/input-
|
|
4
|
-
const input_group = require("../chunks/input_group-
|
|
5
|
-
const keyboard_list_navigation = require("../chunks/keyboard_list_navigation-
|
|
3
|
+
const input = require("../chunks/input-Axw-wFj2.js");
|
|
4
|
+
const input_group = require("../chunks/input_group-m3cWYUfI.js");
|
|
5
|
+
const keyboard_list_navigation = require("../chunks/keyboard_list_navigation-fJnl_Iox.js");
|
|
6
6
|
require("vue");
|
|
7
7
|
require("./constants.cjs");
|
|
8
8
|
require("./validators.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CheckableMixin, GroupableMixin, InputMixin } from "../chunks/input-
|
|
2
|
-
import { InputGroupMixin } from "../chunks/input_group-
|
|
3
|
-
import { KeyboardNavigation } from "../chunks/keyboard_list_navigation-
|
|
1
|
+
import { CheckableMixin, GroupableMixin, InputMixin } from "../chunks/input-6kbd8Pju.js";
|
|
2
|
+
import { InputGroupMixin } from "../chunks/input_group-qVZaS5Bb.js";
|
|
3
|
+
import { KeyboardNavigation } from "../chunks/keyboard_list_navigation-ScXhrxya.js";
|
|
4
4
|
import "vue";
|
|
5
5
|
import "./constants.js";
|
|
6
6
|
import "./validators.js";
|
|
@@ -118,24 +118,60 @@ function isOutOfViewPort(element) {
|
|
|
118
118
|
return isOut;
|
|
119
119
|
}
|
|
120
120
|
const domainNameRegex = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/;
|
|
121
|
-
const tldRegerx = new RegExp(
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
const tldRegerx = new RegExp(
|
|
122
|
+
"(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)"
|
|
123
|
+
);
|
|
124
|
+
const ipv4Regex = new RegExp(
|
|
125
|
+
"(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])"
|
|
126
|
+
);
|
|
127
|
+
const hostnameOrIpRegex = new RegExp(
|
|
128
|
+
"(?:" + [
|
|
129
|
+
[
|
|
130
|
+
domainNameRegex.source,
|
|
131
|
+
tldRegerx.source
|
|
132
|
+
].join("+"),
|
|
133
|
+
ipv4Regex.source
|
|
134
|
+
].join("|") + ")"
|
|
135
|
+
);
|
|
124
136
|
const urlPathRegex = /(?:(?:[;/][^#?<>\s]*)?)/;
|
|
125
137
|
const urlQueryOrFragmentRegex = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/;
|
|
126
|
-
const urlWithoutProtocolRegex = new RegExp(
|
|
138
|
+
const urlWithoutProtocolRegex = new RegExp(
|
|
139
|
+
"\\b" + [
|
|
140
|
+
hostnameOrIpRegex.source,
|
|
141
|
+
urlPathRegex.source,
|
|
142
|
+
urlQueryOrFragmentRegex.source,
|
|
143
|
+
"(?!\\w)"
|
|
144
|
+
].join("+")
|
|
145
|
+
);
|
|
127
146
|
const urlWithProtocolRegex = /\b[a-z\d.-]+:\/\/[^<>\s]+/;
|
|
128
|
-
const emailAddressRegex = new RegExp(
|
|
147
|
+
const emailAddressRegex = new RegExp(
|
|
148
|
+
"(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [
|
|
149
|
+
hostnameOrIpRegex.source,
|
|
150
|
+
urlQueryOrFragmentRegex.source
|
|
151
|
+
].join("+") + "(?!\\w)"
|
|
152
|
+
);
|
|
129
153
|
function getPhoneNumberRegex(minLength = 7, maxLength = 15) {
|
|
130
154
|
try {
|
|
131
|
-
return new RegExp(
|
|
155
|
+
return new RegExp(
|
|
156
|
+
`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
157
|
+
);
|
|
132
158
|
} catch (e) {
|
|
133
159
|
console.warn("This browser doesn't support regex lookahead/lookbehind");
|
|
134
160
|
}
|
|
135
|
-
return new RegExp(
|
|
161
|
+
return new RegExp(
|
|
162
|
+
`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
163
|
+
);
|
|
136
164
|
}
|
|
137
165
|
const phoneNumberRegex = getPhoneNumberRegex();
|
|
138
|
-
const linkRegex = new RegExp(
|
|
166
|
+
const linkRegex = new RegExp(
|
|
167
|
+
[
|
|
168
|
+
urlWithoutProtocolRegex.source,
|
|
169
|
+
urlWithProtocolRegex.source,
|
|
170
|
+
emailAddressRegex.source,
|
|
171
|
+
phoneNumberRegex.source
|
|
172
|
+
].join("|"),
|
|
173
|
+
"gi"
|
|
174
|
+
);
|
|
139
175
|
function isPhoneNumber(input) {
|
|
140
176
|
var _a;
|
|
141
177
|
if (!input || !["string", "number"].includes(typeof input))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\nimport Vue from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9010\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(' ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","setImmediate","setTimeout","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","Math","abs","length","getRandomInt","str","h","i","imul","charCodeAt","max","floor","random","formatMessages","messages","map","message","type","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","filter","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","ERROR","WARNING","SUCCESS","messageType","some","findFirstFocusableNode","element","querySelector","htmlFragment","name","functional","props","render","ctx","Vue","beforeCreate","$createElement","template","html","$mount","_vnode","children","flushPromises","Promise","resolve","kebabCaseToPascalCase","string","toLowerCase","split","word","charAt","toUpperCase","slice","join","pascalCaseToKebabCase","replace","x","y","debounce","func","timeout","clearTimeout","isOutOfViewPort","bounding","getBoundingClientRect","isOut","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","any","Object","values","val","all","every","domainNameRegex","tldRegerx","RegExp","ipv4Regex","hostnameOrIpRegex","source","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","e","console","warn","phoneNumberRegex","linkRegex","isPhoneNumber","input","includes","toString","exec","isURL","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","toLocaleUpperCase"],"mappings":";;;;AAOA,IAAIA,oBAAoB;AACxB,IAAIC;AAGJ,MAAMC,gCAAgC;AAEtC,MAAMC,kCAAkC;AAExC,MAAMC,yCAAyC,GAAGF,6BAA6B,IAAIC,+BAA+B;AAElH,MAAME,qBAAqB,kBAAkBD,sCAAsC;AAEnF,MAAME,YAAY,OAAOC,iBAAiB,aAAaA,eAAeC;AAE/D,SAASC,gBAAiBC,SAASC,iCAAgB;AACxD,SAAO,GAAGD,MAAM,GAAGV,mBAAmB;AACxC;AASO,SAASY,iBAAkBC,OAAOC,MAAM;AAC7C,MAAIA,MAAM;AACR,UAAMC,OAAOC,aAAaF,IAAI;AAC9B,WAAOD,MAAMI,KAAKC,IAAIH,IAAI,IAAIF,MAAMM,MAAM;AAAA,EAC5C,OAAO;AACL,WAAON,MAAMO,aAAaP,MAAMM,MAAM,CAAC;AAAA,EACzC;AACF;AAiBO,SAASH,aAAcK,KAAK;AACjC,MAAIC;AACJ,WAASC,IAAI,GAAGA,IAAIF,IAAIF,QAAQI,KAAK;AACnCD,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,MAAME;AACd,WAAOL,sBAAiBM,KAAKH,KAAK,MAA3BH,mBAA+B,QAAOG;AAC/C;AAOO,SAASI,MAAOJ,OAAO;;AAC5B,MAAI,CAACA,SAAS,OAAOA,UAAU;AAAU,WAAO;AAChD,WAAOZ,6BAAwBe,KAAKH,KAAK,MAAlCZ,mBAAsC,QAAOY,WAClDX,0BAAqBc,KAAKH,KAAK,MAA/BX,mBAAmC,QAAOW;AAC9C;AAOO,SAASK,eAAgBL,OAAO;;AACrC,MAAI,CAACA,SAAS,OAAOA,UAAU;AAAU,WAAO;AAChD,WAAOV,uBAAkBa,KAAKH,KAAK,MAA5BV,mBAAgC,QAAOU;AAChD;AAQO,SAASM,kBAAmBC,UAAU;AAC3C,SAAOA,SAAS7F,OAAOlB,SAAO,CAAC,CAACA,GAAG,EAAEsD,KAAK,GAAG;AAC/C;AAQO,SAAS0D,sBAAuBhH,KAAKiH,SAAS,SAAS;AAC5D,SAAOjH,IAAIwD,QAAQ,2BAAW,GAAE0D,UAAQA,KAAKC,kBAAkBF,MAAM,CAAC;AACxE;AAEA,MAAe,QAAA;AAAA,EACb7H;AAAAA,EACAG;AAAAA,EACAQ;AAAAA,EACAS;AAAAA,EACAM;AAAAA,EACAK;AAAAA,EACAF;AAAAA,EACAY;AAAAA,EACAc;AAAAA,EACAG;AAAAA,EACAa;AAAAA,EACAI;AAAAA,EACAgC;AAAAA,EACAO;AAAAA,EACAO;AAAAA,EACAN;AAAAA,EACAK;AAAAA,EACAE;AAAAA,EACAE;AACF;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\nimport Vue from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9010\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(' ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n};\n"],"names":["DEFAULT_PREFIX","DEFAULT_VALIDATION_MESSAGE_TYPE","VALIDATION_MESSAGE_TYPES"],"mappings":";;;;AAOA,IAAI,oBAAoB;AACxB,IAAI;AAGJ,MAAM,gCAAgC;AAEtC,MAAM,kCAAkC;AAExC,MAAM,yCAAyC,GAAG,6BAA6B,IAAI,+BAA+B;AAElH,MAAM,qBAAqB,kBAAkB,sCAAsC;AAEnF,MAAM,YAAY,OAAO,iBAAiB,aAAa,eAAe;AAE/D,SAAS,gBAAiB,SAASA,iCAAgB;AACxD,SAAO,GAAG,MAAM,GAAG,mBAAmB;AACxC;AASO,SAAS,iBAAkB,OAAO,MAAM;AAC7C,MAAI,MAAM;AACR,UAAM,OAAO,aAAa,IAAI;AAC9B,WAAO,MAAM,KAAK,IAAI,IAAI,IAAI,MAAM,MAAM;AAAA,EAC9C,OAAS;AACL,WAAO,MAAM,aAAa,MAAM,MAAM,CAAC;AAAA,EACxC;AACH;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AAQ,MAAM;AACd,WAAO,sBAAiB,KAAK,KAAK,MAA3B,mBAA+B,QAAO;AAC/C;AAOO,SAAS,MAAO,OAAO;;AAC5B,MAAI,CAAC,SAAS,OAAO,UAAU;AAAU,WAAO;AAChD,WAAO,6BAAwB,KAAK,KAAK,MAAlC,mBAAsC,QAAO,WAClD,0BAAqB,KAAK,KAAK,MAA/B,mBAAmC,QAAO;AAC9C;AAOO,SAAS,eAAgB,OAAO;;AACrC,MAAI,CAAC,SAAS,OAAO,UAAU;AAAU,WAAO;AAChD,WAAO,uBAAkB,KAAK,KAAK,MAA5B,mBAAgC,QAAO;AAChD;AAQO,SAAS,kBAAmB,UAAU;AAC3C,SAAO,SAAS,OAAO,SAAO,CAAC,CAAC,GAAG,EAAE,KAAK,GAAG;AAC/C;AAQO,SAAS,sBAAuB,KAAK,SAAS,SAAS;AAC5D,SAAO,IAAI,QAAQ,2BAAW,GAAE,UAAQ,KAAK,kBAAkB,MAAM,CAAC;AACxE;AAEA,MAAe,QAAA;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -116,24 +116,60 @@ function isOutOfViewPort(element) {
|
|
|
116
116
|
return isOut;
|
|
117
117
|
}
|
|
118
118
|
const domainNameRegex = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/;
|
|
119
|
-
const tldRegerx = new RegExp(
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
const tldRegerx = new RegExp(
|
|
120
|
+
"(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)"
|
|
121
|
+
);
|
|
122
|
+
const ipv4Regex = new RegExp(
|
|
123
|
+
"(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])"
|
|
124
|
+
);
|
|
125
|
+
const hostnameOrIpRegex = new RegExp(
|
|
126
|
+
"(?:" + [
|
|
127
|
+
[
|
|
128
|
+
domainNameRegex.source,
|
|
129
|
+
tldRegerx.source
|
|
130
|
+
].join("+"),
|
|
131
|
+
ipv4Regex.source
|
|
132
|
+
].join("|") + ")"
|
|
133
|
+
);
|
|
122
134
|
const urlPathRegex = /(?:(?:[;/][^#?<>\s]*)?)/;
|
|
123
135
|
const urlQueryOrFragmentRegex = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/;
|
|
124
|
-
const urlWithoutProtocolRegex = new RegExp(
|
|
136
|
+
const urlWithoutProtocolRegex = new RegExp(
|
|
137
|
+
"\\b" + [
|
|
138
|
+
hostnameOrIpRegex.source,
|
|
139
|
+
urlPathRegex.source,
|
|
140
|
+
urlQueryOrFragmentRegex.source,
|
|
141
|
+
"(?!\\w)"
|
|
142
|
+
].join("+")
|
|
143
|
+
);
|
|
125
144
|
const urlWithProtocolRegex = /\b[a-z\d.-]+:\/\/[^<>\s]+/;
|
|
126
|
-
const emailAddressRegex = new RegExp(
|
|
145
|
+
const emailAddressRegex = new RegExp(
|
|
146
|
+
"(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [
|
|
147
|
+
hostnameOrIpRegex.source,
|
|
148
|
+
urlQueryOrFragmentRegex.source
|
|
149
|
+
].join("+") + "(?!\\w)"
|
|
150
|
+
);
|
|
127
151
|
function getPhoneNumberRegex(minLength = 7, maxLength = 15) {
|
|
128
152
|
try {
|
|
129
|
-
return new RegExp(
|
|
153
|
+
return new RegExp(
|
|
154
|
+
`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
155
|
+
);
|
|
130
156
|
} catch (e) {
|
|
131
157
|
console.warn("This browser doesn't support regex lookahead/lookbehind");
|
|
132
158
|
}
|
|
133
|
-
return new RegExp(
|
|
159
|
+
return new RegExp(
|
|
160
|
+
`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
161
|
+
);
|
|
134
162
|
}
|
|
135
163
|
const phoneNumberRegex = getPhoneNumberRegex();
|
|
136
|
-
const linkRegex = new RegExp(
|
|
164
|
+
const linkRegex = new RegExp(
|
|
165
|
+
[
|
|
166
|
+
urlWithoutProtocolRegex.source,
|
|
167
|
+
urlWithProtocolRegex.source,
|
|
168
|
+
emailAddressRegex.source,
|
|
169
|
+
phoneNumberRegex.source
|
|
170
|
+
].join("|"),
|
|
171
|
+
"gi"
|
|
172
|
+
);
|
|
137
173
|
function isPhoneNumber(input) {
|
|
138
174
|
var _a;
|
|
139
175
|
if (!input || !["string", "number"].includes(typeof input))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\nimport Vue from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9010\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(' ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","setImmediate","setTimeout","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","Math","abs","length","getRandomInt","str","h","i","imul","charCodeAt","max","floor","random","formatMessages","messages","map","message","type","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","filter","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","ERROR","WARNING","SUCCESS","messageType","some","findFirstFocusableNode","element","querySelector","htmlFragment","name","functional","props","render","ctx","Vue","beforeCreate","$createElement","template","html","$mount","_vnode","children","flushPromises","Promise","resolve","kebabCaseToPascalCase","string","toLowerCase","split","word","charAt","toUpperCase","slice","join","pascalCaseToKebabCase","replace","x","y","debounce","func","timeout","clearTimeout","isOutOfViewPort","bounding","getBoundingClientRect","isOut","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","any","Object","values","val","all","every","domainNameRegex","tldRegerx","RegExp","ipv4Regex","hostnameOrIpRegex","source","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","e","console","warn","phoneNumberRegex","linkRegex","isPhoneNumber","input","includes","toString","exec","isURL","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","toLocaleUpperCase"],"mappings":";;AAOA,IAAIA,oBAAoB;AACxB,IAAIC;AAGJ,MAAMC,gCAAgC;AAEtC,MAAMC,kCAAkC;AAExC,MAAMC,yCAAyC,GAAGF,6BAA6B,IAAIC,+BAA+B;AAElH,MAAME,qBAAqB,kBAAkBD,sCAAsC;AAEnF,MAAME,YAAY,OAAOC,iBAAiB,aAAaA,eAAeC;AAE/D,SAASC,gBAAiBC,SAASC,gBAAgB;AACxD,SAAO,GAAGD,MAAM,GAAGV,mBAAmB;AACxC;AASO,SAASY,iBAAkBC,OAAOC,MAAM;AAC7C,MAAIA,MAAM;AACR,UAAMC,OAAOC,aAAaF,IAAI;AAC9B,WAAOD,MAAMI,KAAKC,IAAIH,IAAI,IAAIF,MAAMM,MAAM;AAAA,EAC5C,OAAO;AACL,WAAON,MAAMO,aAAaP,MAAMM,MAAM,CAAC;AAAA,EACzC;AACF;AAiBO,SAASH,aAAcK,KAAK;AACjC,MAAIC;AACJ,WAASC,IAAI,GAAGA,IAAIF,IAAIF,QAAQI,KAAK;AACnCD,QAAIL,KAAKO,KAAK,IAAIF,CAAC,IAAID,IAAII,WAAWF,CAAC,IAAI;AAAA,EAC7C;AAEA,SAAOD;AACT;AAOO,SAASF,aAAcM,KAAK;AACjC,SAAOT,KAAKU,MAAMV,KAAKW,OAAQ,IAAGF,GAAG;AACvC;AAEO,SAASG,eAAgBC,UAAU;AACxC,MAAI,CAACA,UAAU;AACb,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AgBL,OAAO;;AACrC,MAAI,CAACA,SAAS,OAAOA,UAAU;AAAU,WAAO;AAChD,WAAOV,uBAAkBa,KAAKH,KAAK,MAA5BV,mBAAgC,QAAOU;AAChD;AAQO,SAASM,kBAAmBC,UAAU;AAC3C,SAAOA,SAAS7F,OAAOlB,SAAO,CAAC,CAACA,GAAG,EAAEsD,KAAK,GAAG;AAC/C;AAQO,SAAS0D,sBAAuBhH,KAAKiH,SAAS,SAAS;AAC5D,SAAOjH,IAAIwD,QAAQ,2BAAW,GAAE0D,UAAQA,KAAKC,kBAAkBF,MAAM,CAAC;AACxE;AAEA,MAAe,QAAA;AAAA,EACb7H;AAAAA,EACAG;AAAAA,EACAQ;AAAAA,EACAS;AAAAA,EACAM;AAAAA,EACAK;AAAAA,EACAF;AAAAA,EACAY;AAAAA,EACAc;AAAAA,EACAG;AAAAA,EACAa;AAAAA,EACAI;AAAAA,EACAgC;AAAAA,EACAO;AAAAA,EACAO;AAAAA,EACAN;AAAAA,EACAK;AAAAA,EACAE;AAAAA,EACAE;AACF;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\nimport Vue from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9010\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(' ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n};\n"],"names":[],"mappings":";;AAOA,IAAI,oBAAoB;AACxB,IAAI;AAGJ,MAAM,gCAAgC;AAEtC,MAAM,kCAAkC;AAExC,MAAM,yCAAyC,GAAG,6BAA6B,IAAI,+BAA+B;AAElH,MAAM,qBAAqB,kBAAkB,sCAAsC;AAEnF,MAAM,YAAY,OAAO,iBAAiB,aAAa,eAAe;AAE/D,SAAS,gBAAiB,SAAS,gBAAgB;AACxD,SAAO,GAAG,MAAM,GAAG,mBAAmB;AACxC;AASO,SAAS,iBAAkB,OAAO,MAAM;AAC7C,MAAI,MAAM;AACR,UAAM,OAAO,aAAa,IAAI;AAC9B,WAAO,MAAM,KAAK,IAAI,IAAI,IAAI,MAAM,MAAM;AAAA,EAC9C,OAAS;AACL,WAAO,MAAM,aAAa,MAAM,MAAM,CAAC;AAAA,EACxC;AACH;AAiBO,SAAS,aAAc,KAAK;AACjC,MAAI;AACJ,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,QAAI,KAAK,KAAK,IAAI,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI;AAAA,EAC5C;AAED,SAAO;AACT;AAOO,SAAS,aAAc,KAAK;AACjC,SAAO,KAAK,MAAM,KAAK,OAAQ,IAAG,GAAG;AACvC;AAEO,SAAS,eAAgB,UAAU;AACxC,MAAI,CAAC,UAAU;AACb,WAAO;EACR;AAED,SAAO,SAAS,IAAI,aAAW;AAC7B,QAAI,OAAO,YAAY,UAAU;AAC/B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C,GAAG,EAAE,KAAK,GAAG;AAC/C;AAQO,SAAS,sBAAuB,KAAK,SAAS,SAAS;AAC5D,SAAO,IAAI,QAAQ,2BAAW,GAAE,UAAQ,KAAK,kBAAkB,MAAM,CAAC;AACxE;AAEA,MAAe,QAAA;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.cjs","sources":["../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"validators.cjs","sources":["../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["VALIDATION_MESSAGE_TYPES"],"mappings":";;;AAIO,SAAS,2BAA4B,aAAa;AACvD,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACR;AAED,SAAO,YAAY,MAAM,aAAW;AAClC,QAAI,OAAO,YAAY,UAAU;AAC/B,aAAO;AAAA,IACR;AAED,QAAI,OAAO,YAAY,UAAU;AAC/B,aAAO,OAAO,OAAOA,iBAAwB,wBAAA,EAAE,SAAS,mCAAS,IAAI;AAAA,IACtE;AAED,WAAO;AAAA,EACX,CAAG;AACH;AAEA,MAAe,QAAA;AAAA,EACb;AACF;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sources":["../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"validators.js","sources":["../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '../constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":[],"mappings":";AAIO,SAAS,2BAA4B,aAAa;AACvD,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACR;AAED,SAAO,YAAY,MAAM,aAAW;AAClC,QAAI,OAAO,YAAY,UAAU;AAC/B,aAAO;AAAA,IACR;AAED,QAAI,OAAO,YAAY,UAAU;AAC/B,aAAO,OAAO,OAAO,wBAAwB,EAAE,SAAS,mCAAS,IAAI;AAAA,IACtE;AAED,WAAO;AAAA,EACX,CAAG;AACH;AAEA,MAAe,QAAA;AAAA,EACb;AACF;"}
|