@dialpad/dialtone 9.65.0 → 9.66.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/dist/chunks/tokens-base-dark--ozK7f0P.js +4 -0
- package/dist/chunks/tokens-base-dark-V8E4WaJI.js +1 -0
- package/dist/chunks/tokens-base-light-LYlvM3eZ.js +1 -0
- package/dist/chunks/tokens-base-light-ljPrpLe2.js +4 -0
- package/dist/css/dialtone-default-theme.css +57 -55
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +8 -6
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/tokens/tokens-base-dark.css +5 -5
- package/dist/css/tokens/tokens-base-light.css +5 -5
- package/dist/css/tokens/tokens-dp-dark.css +44 -44
- package/dist/css/tokens/tokens-dp-light.css +44 -44
- package/dist/css/tokens/tokens-expressive-dark.css +50 -50
- package/dist/css/tokens/tokens-expressive-light.css +50 -50
- package/dist/css/tokens/tokens-expressive-sm-dark.css +50 -50
- package/dist/css/tokens/tokens-expressive-sm-light.css +50 -50
- package/dist/css/tokens/tokens-tmo-dark.css +44 -44
- package/dist/css/tokens/tokens-tmo-light.css +44 -44
- package/dist/themes/dp-dark.cjs +1 -1
- package/dist/themes/dp-dark.js +2 -2
- package/dist/themes/dp-light.cjs +1 -1
- package/dist/themes/dp-light.js +2 -2
- package/dist/themes/expressive-dark.cjs +1 -1
- package/dist/themes/expressive-dark.js +2 -2
- package/dist/themes/expressive-light.cjs +1 -1
- package/dist/themes/expressive-light.js +2 -2
- package/dist/themes/expressive-sm-dark.cjs +1 -1
- package/dist/themes/expressive-sm-dark.js +2 -2
- package/dist/themes/expressive-sm-light.cjs +1 -1
- package/dist/themes/expressive-sm-light.js +2 -2
- package/dist/themes/tmo-dark.cjs +1 -1
- package/dist/themes/tmo-dark.js +2 -2
- package/dist/themes/tmo-light.cjs +1 -1
- package/dist/themes/tmo-light.js +2 -2
- package/dist/tokens/css/tokens-base-dark.css +5 -5
- package/dist/tokens/css/tokens-base-light.css +5 -5
- package/dist/tokens/css/tokens-dp-dark.css +44 -44
- package/dist/tokens/css/tokens-dp-light.css +44 -44
- package/dist/tokens/css/tokens-expressive-dark.css +50 -50
- package/dist/tokens/css/tokens-expressive-light.css +50 -50
- package/dist/tokens/css/tokens-expressive-sm-dark.css +50 -50
- package/dist/tokens/css/tokens-expressive-sm-light.css +50 -50
- package/dist/tokens/css/tokens-tmo-dark.css +44 -44
- package/dist/tokens/css/tokens-tmo-light.css +44 -44
- package/dist/tokens/doc.json +14285 -14285
- package/dist/tokens/less/tokens-base-dark.less +5 -5
- package/dist/tokens/less/tokens-base-light.less +5 -5
- package/dist/tokens/less/tokens-dp-dark.less +44 -44
- package/dist/tokens/less/tokens-dp-light.less +44 -44
- package/dist/tokens/less/tokens-expressive-dark.less +50 -50
- package/dist/tokens/less/tokens-expressive-light.less +50 -50
- package/dist/tokens/less/tokens-expressive-sm-dark.less +50 -50
- package/dist/tokens/less/tokens-expressive-sm-light.less +50 -50
- package/dist/tokens/less/tokens-tmo-dark.less +44 -44
- package/dist/tokens/less/tokens-tmo-light.less +44 -44
- package/dist/tokens/tokens-base-dark.json +5 -5
- package/dist/tokens/tokens-base-light.json +5 -5
- package/dist/tokens/tokens-dp-dark.json +44 -44
- package/dist/tokens/tokens-dp-light.json +44 -44
- package/dist/tokens/tokens-expressive-dark.json +50 -50
- package/dist/tokens/tokens-expressive-light.json +50 -50
- package/dist/tokens/tokens-expressive-sm-dark.json +50 -50
- package/dist/tokens/tokens-expressive-sm-light.json +50 -50
- package/dist/tokens/tokens-tmo-dark.json +44 -44
- package/dist/tokens/tokens-tmo-light.json +44 -44
- package/dist/vue2/chunks/{dropdown-6UoczdUY.js → dropdown-YdCyJ5Dq.js} +77 -41
- package/dist/vue2/chunks/{dropdown-pHxnQPzT.js.map → dropdown-YdCyJ5Dq.js.map} +1 -1
- package/dist/vue2/chunks/{dropdown-pHxnQPzT.js → dropdown-mjrYu_mK.js} +77 -41
- package/dist/vue2/chunks/{dropdown-6UoczdUY.js.map → dropdown-mjrYu_mK.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-Dy4MEUJL.js → icon_constants-TdxqLsS2.js} +3 -2
- package/dist/vue2/chunks/icon_constants-TdxqLsS2.js.map +1 -0
- package/dist/vue2/chunks/{icon_constants-QYpmdE0R.js → icon_constants-VEA0wI5C.js} +3 -2
- package/dist/vue2/chunks/icon_constants-VEA0wI5C.js.map +1 -0
- package/dist/vue2/chunks/{index-gj1jEXP4.js → index-DyqUqjvI.js} +122 -87
- package/dist/vue2/chunks/{index-eJ-WWRdf.js.map → index-DyqUqjvI.js.map} +1 -1
- package/dist/vue2/chunks/{index-anN_sx1F.js → index-NYFNZeHH.js} +5 -13
- package/dist/vue2/chunks/{index-anN_sx1F.js.map → index-NYFNZeHH.js.map} +1 -1
- package/dist/vue2/chunks/{index-ODod4Oj_.js → index-i65YVk-U.js} +5 -13
- package/dist/vue2/chunks/{index-ODod4Oj_.js.map → index-i65YVk-U.js.map} +1 -1
- package/dist/vue2/chunks/{index-eJ-WWRdf.js → index-mBWay1Qb.js} +122 -87
- package/dist/vue2/chunks/{index-gj1jEXP4.js.map → index-mBWay1Qb.js.map} +1 -1
- package/dist/vue2/chunks/{input-Axw-wFj2.js → input-Hqw33WBe.js} +3 -9
- package/dist/vue2/chunks/{input-Axw-wFj2.js.map → input-Hqw33WBe.js.map} +1 -1
- package/dist/vue2/chunks/{input-6kbd8Pju.js → input-PhJeBN6r.js} +3 -9
- package/dist/vue2/chunks/{input-6kbd8Pju.js.map → input-PhJeBN6r.js.map} +1 -1
- package/dist/vue2/chunks/{input_group-qVZaS5Bb.js → input_group-ZI7aVGEp.js} +4 -2
- package/dist/vue2/chunks/{input_group-m3cWYUfI.js.map → input_group-ZI7aVGEp.js.map} +1 -1
- package/dist/vue2/chunks/{input_group-m3cWYUfI.js → input_group-pE6ec9R3.js} +4 -2
- package/dist/vue2/chunks/{input_group-qVZaS5Bb.js.map → input_group-pE6ec9R3.js.map} +1 -1
- package/dist/vue2/chunks/{keyboard_list_navigation-ScXhrxya.js → keyboard_list_navigation-YIqTuw1W.js} +6 -5
- package/dist/{vue3/chunks/keyboard_list_navigation-fJnl_Iox.js.map → vue2/chunks/keyboard_list_navigation-YIqTuw1W.js.map} +1 -1
- package/dist/vue2/chunks/{keyboard_list_navigation-fJnl_Iox.js → keyboard_list_navigation-x3D6RcC7.js} +6 -5
- package/dist/vue2/chunks/{keyboard_list_navigation-ScXhrxya.js.map → keyboard_list_navigation-x3D6RcC7.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-XOr4kiNZ.js → modal-8X6poIZW.js} +4 -2
- package/dist/{vue3/chunks/modal-XOr4kiNZ.js.map → vue2/chunks/modal-8X6poIZW.js.map} +1 -1
- package/dist/vue2/chunks/{modal-VgxXAQFP.js → modal-OaWxzqNt.js} +4 -2
- package/dist/vue2/chunks/{modal-VgxXAQFP.js.map → modal-OaWxzqNt.js.map} +1 -1
- package/dist/vue2/chunks/{notice_action-IRUoLX2d.js → notice_action-qQr3K2TC.js} +71 -46
- package/dist/vue2/chunks/{notice_action-IRUoLX2d.js.map → notice_action-qQr3K2TC.js.map} +1 -1
- package/dist/vue2/chunks/{notice_action-P6uDyE9x.js → notice_action-tEvvMg7Q.js} +71 -46
- package/dist/vue2/chunks/{notice_action-P6uDyE9x.js.map → notice_action-tEvvMg7Q.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-WsOUIY-m.js → popover_constants-6YkPPbnk.js} +26 -47
- package/dist/vue2/chunks/{popover_constants-WsOUIY-m.js.map → popover_constants-6YkPPbnk.js.map} +1 -1
- package/dist/vue2/chunks/{popover_constants-XnGWXaxX.js → popover_constants-h9MD6WUt.js} +26 -47
- package/dist/{vue3/chunks/popover_constants-WsOUIY-m.js.map → vue2/chunks/popover_constants-h9MD6WUt.js.map} +1 -1
- package/dist/vue2/chunks/{sr_only_close_button-ZaGdAHz7.js → sr_only_close_button-2Q9Ny1Nc.js} +24 -18
- package/dist/vue2/chunks/{sr_only_close_button-ZaGdAHz7.js.map → sr_only_close_button-2Q9Ny1Nc.js.map} +1 -1
- package/dist/vue2/chunks/{sr_only_close_button-81bHIpPu.js → sr_only_close_button-IjMVfBDE.js} +24 -18
- package/dist/vue2/chunks/{sr_only_close_button-81bHIpPu.js.map → sr_only_close_button-IjMVfBDE.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-FcsV5VmK.js → tab-79yMX6m6.js} +86 -68
- package/dist/vue2/chunks/{tab-V4cb44Ry.js.map → tab-79yMX6m6.js.map} +1 -1
- package/dist/vue2/chunks/{tab-V4cb44Ry.js → tab-muPOS7JE.js} +86 -68
- package/dist/vue2/chunks/{tab-FcsV5VmK.js.map → tab-muPOS7JE.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 +3 -1
- package/dist/vue2/common/dates.cjs.map +1 -1
- package/dist/vue2/common/dates.js +3 -1
- 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 +8 -44
- package/dist/vue2/common/utils.cjs.map +1 -1
- package/dist/vue2/common/utils.js +8 -44
- 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 +172 -48
- package/dist/vue2/lib/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel.js +172 -48
- package/dist/vue2/lib/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/avatar.cjs +75 -58
- package/dist/vue2/lib/avatar.cjs.map +1 -1
- package/dist/vue2/lib/avatar.js +75 -58
- package/dist/vue2/lib/avatar.js.map +1 -1
- package/dist/vue2/lib/badge.cjs +31 -20
- package/dist/vue2/lib/badge.cjs.map +1 -1
- package/dist/vue2/lib/badge.js +31 -20
- package/dist/vue2/lib/badge.js.map +1 -1
- package/dist/vue2/lib/banner.cjs +53 -29
- package/dist/vue2/lib/banner.cjs.map +1 -1
- package/dist/vue2/lib/banner.js +53 -29
- package/dist/vue2/lib/banner.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs.cjs +36 -30
- package/dist/vue2/lib/breadcrumbs.cjs.map +1 -1
- package/dist/vue2/lib/breadcrumbs.js +36 -30
- package/dist/vue2/lib/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button-group.cjs +7 -14
- package/dist/vue2/lib/button-group.cjs.map +1 -1
- package/dist/vue2/lib/button-group.js +7 -14
- package/dist/vue2/lib/button-group.js.map +1 -1
- package/dist/vue2/lib/button.cjs +55 -62
- package/dist/vue2/lib/button.cjs.map +1 -1
- package/dist/vue2/lib/button.js +55 -62
- package/dist/vue2/lib/button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover.cjs +91 -23
- package/dist/vue2/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover.js +91 -23
- package/dist/vue2/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/callbar-button.cjs +49 -33
- package/dist/vue2/lib/callbar-button.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button.js +49 -33
- package/dist/vue2/lib/callbar-button.js.map +1 -1
- package/dist/vue2/lib/callbox.cjs +78 -15
- package/dist/vue2/lib/callbox.cjs.map +1 -1
- package/dist/vue2/lib/callbox.js +78 -15
- package/dist/vue2/lib/callbox.js.map +1 -1
- package/dist/vue2/lib/card.cjs +16 -23
- package/dist/vue2/lib/card.cjs.map +1 -1
- package/dist/vue2/lib/card.js +16 -23
- package/dist/vue2/lib/card.js.map +1 -1
- package/dist/vue2/lib/checkbox-group.cjs +3 -15
- package/dist/vue2/lib/checkbox-group.cjs.map +1 -1
- package/dist/vue2/lib/checkbox-group.js +3 -15
- package/dist/vue2/lib/checkbox-group.js.map +1 -1
- package/dist/vue2/lib/checkbox.cjs +52 -16
- package/dist/vue2/lib/checkbox.cjs.map +1 -1
- package/dist/vue2/lib/checkbox.js +52 -16
- package/dist/vue2/lib/checkbox.js.map +1 -1
- package/dist/vue2/lib/chip.cjs +58 -26
- package/dist/vue2/lib/chip.cjs.map +1 -1
- package/dist/vue2/lib/chip.js +58 -26
- package/dist/vue2/lib/chip.js.map +1 -1
- package/dist/vue2/lib/codeblock.cjs +4 -11
- package/dist/vue2/lib/codeblock.cjs.map +1 -1
- package/dist/vue2/lib/codeblock.js +4 -11
- package/dist/vue2/lib/codeblock.js.map +1 -1
- package/dist/vue2/lib/collapsible.cjs +91 -34
- package/dist/vue2/lib/collapsible.cjs.map +1 -1
- package/dist/vue2/lib/collapsible.js +91 -34
- package/dist/vue2/lib/collapsible.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select.cjs +131 -38
- package/dist/vue2/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select.js +131 -38
- package/dist/vue2/lib/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover.cjs +130 -39
- package/dist/vue2/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/combobox-with-popover.js +130 -39
- 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 +86 -29
- package/dist/vue2/lib/contact-centers-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-centers-row.js +86 -29
- package/dist/vue2/lib/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-info.cjs +95 -24
- package/dist/vue2/lib/contact-info.cjs.map +1 -1
- package/dist/vue2/lib/contact-info.js +95 -24
- package/dist/vue2/lib/contact-info.js.map +1 -1
- package/dist/vue2/lib/contact-row.cjs +61 -18
- package/dist/vue2/lib/contact-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-row.js +61 -18
- package/dist/vue2/lib/contact-row.js.map +1 -1
- package/dist/vue2/lib/datepicker.cjs +361 -102
- package/dist/vue2/lib/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker.js +361 -102
- package/dist/vue2/lib/datepicker.js.map +1 -1
- package/dist/vue2/lib/description-list.cjs +11 -12
- package/dist/vue2/lib/description-list.cjs.map +1 -1
- package/dist/vue2/lib/description-list.js +11 -12
- package/dist/vue2/lib/description-list.js.map +1 -1
- package/dist/vue2/lib/dropdown.cjs +13 -17
- package/dist/vue2/lib/dropdown.cjs.map +1 -1
- package/dist/vue2/lib/dropdown.js +13 -17
- package/dist/vue2/lib/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor.cjs +409 -109
- package/dist/vue2/lib/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor.js +409 -109
- package/dist/vue2/lib/editor.js.map +1 -1
- package/dist/vue2/lib/emoji-picker.cjs +512 -234
- package/dist/vue2/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker.js +512 -234
- package/dist/vue2/lib/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row.cjs +69 -31
- package/dist/vue2/lib/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row.js +69 -31
- package/dist/vue2/lib/emoji-row.js.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper.cjs +14 -22
- package/dist/vue2/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper.js +14 -22
- package/dist/vue2/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/vue2/lib/emoji.cjs +40 -13
- package/dist/vue2/lib/emoji.cjs.map +1 -1
- package/dist/vue2/lib/emoji.js +40 -13
- package/dist/vue2/lib/emoji.js.map +1 -1
- package/dist/vue2/lib/empty-state.cjs +27 -12
- package/dist/vue2/lib/empty-state.cjs.map +1 -1
- package/dist/vue2/lib/empty-state.js +27 -12
- package/dist/vue2/lib/empty-state.js.map +1 -1
- package/dist/vue2/lib/feed-item-row.cjs +106 -27
- package/dist/vue2/lib/feed-item-row.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-row.js +106 -27
- package/dist/vue2/lib/feed-item-row.js.map +1 -1
- package/dist/vue2/lib/feed-pill.cjs +90 -35
- package/dist/vue2/lib/feed-pill.cjs.map +1 -1
- package/dist/vue2/lib/feed-pill.js +90 -35
- package/dist/vue2/lib/feed-pill.js.map +1 -1
- package/dist/vue2/lib/general-row.cjs +184 -75
- package/dist/vue2/lib/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row.js +184 -75
- package/dist/vue2/lib/general-row.js.map +1 -1
- package/dist/vue2/lib/group-row.cjs +27 -16
- package/dist/vue2/lib/group-row.cjs.map +1 -1
- package/dist/vue2/lib/group-row.js +27 -16
- package/dist/vue2/lib/group-row.js.map +1 -1
- package/dist/vue2/lib/grouped-chip.cjs +68 -20
- package/dist/vue2/lib/grouped-chip.cjs.map +1 -1
- package/dist/vue2/lib/grouped-chip.js +68 -20
- package/dist/vue2/lib/grouped-chip.js.map +1 -1
- package/dist/vue2/lib/hovercard.cjs +71 -41
- package/dist/vue2/lib/hovercard.cjs.map +1 -1
- package/dist/vue2/lib/hovercard.js +71 -41
- package/dist/vue2/lib/hovercard.js.map +1 -1
- package/dist/vue2/lib/icon.cjs +10 -12
- package/dist/vue2/lib/icon.cjs.map +1 -1
- package/dist/vue2/lib/icon.js +10 -12
- package/dist/vue2/lib/icon.js.map +1 -1
- package/dist/vue2/lib/illustration.cjs +9 -12
- package/dist/vue2/lib/illustration.cjs.map +1 -1
- package/dist/vue2/lib/illustration.js +9 -12
- package/dist/vue2/lib/illustration.js.map +1 -1
- package/dist/vue2/lib/image-viewer.cjs +98 -23
- package/dist/vue2/lib/image-viewer.cjs.map +1 -1
- package/dist/vue2/lib/image-viewer.js +98 -23
- package/dist/vue2/lib/image-viewer.js.map +1 -1
- package/dist/vue2/lib/input-group.cjs +24 -14
- package/dist/vue2/lib/input-group.cjs.map +1 -1
- package/dist/vue2/lib/input-group.js +24 -14
- package/dist/vue2/lib/input-group.js.map +1 -1
- package/dist/vue2/lib/input.cjs +108 -40
- package/dist/vue2/lib/input.cjs.map +1 -1
- package/dist/vue2/lib/input.js +108 -40
- package/dist/vue2/lib/input.js.map +1 -1
- package/dist/vue2/lib/item-layout.cjs +42 -11
- package/dist/vue2/lib/item-layout.cjs.map +1 -1
- package/dist/vue2/lib/item-layout.js +42 -11
- package/dist/vue2/lib/item-layout.js.map +1 -1
- package/dist/vue2/lib/ivr-node.cjs +135 -47
- package/dist/vue2/lib/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node.js +135 -47
- package/dist/vue2/lib/ivr-node.js.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.cjs +35 -23
- package/dist/vue2/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.js +35 -23
- package/dist/vue2/lib/keyboard-shortcut.js.map +1 -1
- package/dist/vue2/lib/lazy-show.cjs +15 -11
- package/dist/vue2/lib/lazy-show.cjs.map +1 -1
- package/dist/vue2/lib/lazy-show.js +15 -11
- package/dist/vue2/lib/lazy-show.js.map +1 -1
- package/dist/vue2/lib/link.cjs +9 -15
- package/dist/vue2/lib/link.cjs.map +1 -1
- package/dist/vue2/lib/link.js +9 -15
- package/dist/vue2/lib/link.js.map +1 -1
- package/dist/vue2/lib/list-item-group.cjs +17 -11
- package/dist/vue2/lib/list-item-group.cjs.map +1 -1
- package/dist/vue2/lib/list-item-group.js +17 -11
- package/dist/vue2/lib/list-item-group.js.map +1 -1
- package/dist/vue2/lib/list-item.cjs +42 -23
- package/dist/vue2/lib/list-item.cjs.map +1 -1
- package/dist/vue2/lib/list-item.js +42 -23
- package/dist/vue2/lib/list-item.js.map +1 -1
- package/dist/vue2/lib/message-input.cjs +367 -97
- package/dist/vue2/lib/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input.js +367 -97
- package/dist/vue2/lib/message-input.js.map +1 -1
- package/dist/vue2/lib/modal.cjs +94 -36
- package/dist/vue2/lib/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal.js +94 -36
- package/dist/vue2/lib/modal.js.map +1 -1
- package/dist/vue2/lib/notice.cjs +40 -21
- package/dist/vue2/lib/notice.cjs.map +1 -1
- package/dist/vue2/lib/notice.js +40 -21
- package/dist/vue2/lib/notice.js.map +1 -1
- package/dist/vue2/lib/pagination.cjs +81 -20
- package/dist/vue2/lib/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination.js +81 -20
- package/dist/vue2/lib/pagination.js.map +1 -1
- package/dist/vue2/lib/popover.cjs +194 -75
- package/dist/vue2/lib/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover.js +195 -76
- package/dist/vue2/lib/popover.js.map +1 -1
- package/dist/vue2/lib/presence.cjs +23 -22
- package/dist/vue2/lib/presence.cjs.map +1 -1
- package/dist/vue2/lib/presence.js +23 -22
- package/dist/vue2/lib/presence.js.map +1 -1
- package/dist/vue2/lib/radio-group.cjs +2 -11
- package/dist/vue2/lib/radio-group.cjs.map +1 -1
- package/dist/vue2/lib/radio-group.js +2 -11
- package/dist/vue2/lib/radio-group.js.map +1 -1
- package/dist/vue2/lib/radio.cjs +47 -15
- package/dist/vue2/lib/radio.cjs.map +1 -1
- package/dist/vue2/lib/radio.js +47 -15
- package/dist/vue2/lib/radio.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor.cjs +340 -327
- package/dist/vue2/lib/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor.js +340 -327
- package/dist/vue2/lib/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/root-layout.cjs +33 -15
- package/dist/vue2/lib/root-layout.cjs.map +1 -1
- package/dist/vue2/lib/root-layout.js +33 -15
- package/dist/vue2/lib/root-layout.js.map +1 -1
- package/dist/vue2/lib/scrollbar-directive.cjs.map +1 -1
- package/dist/vue2/lib/scrollbar-directive.js.map +1 -1
- package/dist/vue2/lib/select-menu.cjs +52 -33
- package/dist/vue2/lib/select-menu.cjs.map +1 -1
- package/dist/vue2/lib/select-menu.js +52 -33
- package/dist/vue2/lib/select-menu.js.map +1 -1
- package/dist/vue2/lib/settings-menu-button.cjs +42 -16
- package/dist/vue2/lib/settings-menu-button.cjs.map +1 -1
- package/dist/vue2/lib/settings-menu-button.js +42 -16
- package/dist/vue2/lib/settings-menu-button.js.map +1 -1
- package/dist/vue2/lib/skeleton.cjs +118 -93
- package/dist/vue2/lib/skeleton.cjs.map +1 -1
- package/dist/vue2/lib/skeleton.js +118 -93
- package/dist/vue2/lib/skeleton.js.map +1 -1
- package/dist/vue2/lib/split-button.cjs +164 -64
- package/dist/vue2/lib/split-button.cjs.map +1 -1
- package/dist/vue2/lib/split-button.js +164 -64
- package/dist/vue2/lib/split-button.js.map +1 -1
- package/dist/vue2/lib/stack.cjs +21 -33
- package/dist/vue2/lib/stack.cjs.map +1 -1
- package/dist/vue2/lib/stack.js +21 -33
- package/dist/vue2/lib/stack.js.map +1 -1
- package/dist/vue2/lib/tabs.cjs +20 -13
- package/dist/vue2/lib/tabs.cjs.map +1 -1
- package/dist/vue2/lib/tabs.js +20 -13
- package/dist/vue2/lib/tabs.js.map +1 -1
- package/dist/vue2/lib/time-pill.cjs +8 -11
- package/dist/vue2/lib/time-pill.cjs.map +1 -1
- package/dist/vue2/lib/time-pill.js +8 -11
- package/dist/vue2/lib/time-pill.js.map +1 -1
- package/dist/vue2/lib/toast.cjs +42 -21
- package/dist/vue2/lib/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast.js +42 -21
- package/dist/vue2/lib/toast.js.map +1 -1
- package/dist/vue2/lib/toggle.cjs +28 -24
- package/dist/vue2/lib/toggle.cjs.map +1 -1
- package/dist/vue2/lib/toggle.js +28 -24
- package/dist/vue2/lib/toggle.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive.cjs +32 -26
- package/dist/vue2/lib/tooltip-directive.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive.js +32 -26
- package/dist/vue2/lib/tooltip-directive.js.map +1 -1
- package/dist/vue2/lib/tooltip.cjs +31 -21
- package/dist/vue2/lib/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip.js +32 -22
- package/dist/vue2/lib/tooltip.js.map +1 -1
- package/dist/vue2/lib/top-banner-info.cjs +18 -21
- package/dist/vue2/lib/top-banner-info.cjs.map +1 -1
- package/dist/vue2/lib/top-banner-info.js +18 -21
- package/dist/vue2/lib/top-banner-info.js.map +1 -1
- package/dist/vue2/lib/unread-pill.cjs +18 -12
- package/dist/vue2/lib/unread-pill.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill.js +18 -12
- package/dist/vue2/lib/unread-pill.js.map +1 -1
- package/dist/vue2/lib/validation-messages.cjs +23 -16
- package/dist/vue2/lib/validation-messages.cjs.map +1 -1
- package/dist/vue2/lib/validation-messages.js +23 -16
- package/dist/vue2/lib/validation-messages.js.map +1 -1
- package/dist/vue2/style.css +5 -0
- package/dist/vue2/types/common/emoji/index.d.ts +2 -59236
- 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/image_viewer/image_viewer.vue.d.ts +21 -0
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/input/input.vue.d.ts +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/custom_link/custom_link.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +5 -3
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +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/conversation_view/message_input/message_input.vue.d.ts +1 -1
- package/dist/vue3/chunks/{dropdown-oA-_Gotg.js → dropdown-6HXkh24e.js} +40 -45
- package/dist/vue3/chunks/{dropdown-p-Azgwov.js.map → dropdown-6HXkh24e.js.map} +1 -1
- package/dist/vue3/chunks/{dropdown-p-Azgwov.js → dropdown-QNvAb160.js} +40 -45
- package/dist/vue3/chunks/{dropdown-oA-_Gotg.js.map → dropdown-QNvAb160.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-QYpmdE0R.js → icon_constants-bvhFNOPu.js} +3 -2
- package/dist/vue3/chunks/icon_constants-bvhFNOPu.js.map +1 -0
- package/dist/vue3/chunks/{icon_constants-Dy4MEUJL.js → icon_constants-gIQj4mf7.js} +3 -2
- package/dist/vue3/chunks/icon_constants-gIQj4mf7.js.map +1 -0
- package/dist/vue3/chunks/{index-b_MgDylR.js → index-T15rAIdX.js} +71 -84
- package/dist/vue3/chunks/{index-4qgKeErp.js.map → index-T15rAIdX.js.map} +1 -1
- package/dist/vue3/chunks/{index-GVD15GIB.js → index-dfdrE-3M.js} +3 -12
- package/dist/vue3/chunks/{index-GVD15GIB.js.map → index-dfdrE-3M.js.map} +1 -1
- package/dist/vue3/chunks/{index-lu2o2f4r.js → index-fEp0B-5Z.js} +3 -12
- package/dist/vue3/chunks/{index-lu2o2f4r.js.map → index-fEp0B-5Z.js.map} +1 -1
- package/dist/vue3/chunks/{index-4qgKeErp.js → index-ouh7Bvm-.js} +71 -84
- package/dist/vue3/chunks/{index-b_MgDylR.js.map → index-ouh7Bvm-.js.map} +1 -1
- package/dist/vue3/chunks/{input-NmYDD5bn.js → input-HIysg24t.js} +3 -9
- package/dist/vue3/chunks/{input-NmYDD5bn.js.map → input-HIysg24t.js.map} +1 -1
- package/dist/vue3/chunks/{input-ttnte8zB.js → input-dLLo3Wtg.js} +3 -9
- package/dist/vue3/chunks/{input-ttnte8zB.js.map → input-dLLo3Wtg.js.map} +1 -1
- package/dist/vue3/chunks/{input_group-jWnq2DJT.js → input_group-hV1WT2it.js} +4 -2
- package/dist/vue3/chunks/{input_group-jWnq2DJT.js.map → input_group-hV1WT2it.js.map} +1 -1
- package/dist/vue3/chunks/{input_group-M-D25pOJ.js → input_group-rE6nhye8.js} +4 -2
- package/dist/vue3/chunks/{input_group-M-D25pOJ.js.map → input_group-rE6nhye8.js.map} +1 -1
- package/dist/vue3/chunks/{keyboard_list_navigation-ScXhrxya.js → keyboard_list_navigation-YIqTuw1W.js} +6 -5
- package/dist/{vue2/chunks/keyboard_list_navigation-fJnl_Iox.js.map → vue3/chunks/keyboard_list_navigation-YIqTuw1W.js.map} +1 -1
- package/dist/vue3/chunks/{keyboard_list_navigation-fJnl_Iox.js → keyboard_list_navigation-x3D6RcC7.js} +6 -5
- package/dist/vue3/chunks/{keyboard_list_navigation-ScXhrxya.js.map → keyboard_list_navigation-x3D6RcC7.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-XOr4kiNZ.js → modal-8X6poIZW.js} +4 -2
- package/dist/vue3/chunks/{modal-VgxXAQFP.js.map → modal-8X6poIZW.js.map} +1 -1
- package/dist/vue3/chunks/{modal-VgxXAQFP.js → modal-OaWxzqNt.js} +4 -2
- package/dist/{vue2/chunks/modal-XOr4kiNZ.js.map → vue3/chunks/modal-OaWxzqNt.js.map} +1 -1
- package/dist/vue3/chunks/{notice_action-WTucGhvr.js → notice_action-3ed0uIMN.js} +40 -61
- package/dist/vue3/chunks/{notice_action-p-ePanW_.js.map → notice_action-3ed0uIMN.js.map} +1 -1
- package/dist/vue3/chunks/{notice_action-p-ePanW_.js → notice_action-e08Lw5W6.js} +40 -61
- package/dist/vue3/chunks/{notice_action-WTucGhvr.js.map → notice_action-e08Lw5W6.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-WsOUIY-m.js → popover_constants-6YkPPbnk.js} +26 -47
- package/dist/{vue2/chunks/popover_constants-XnGWXaxX.js.map → vue3/chunks/popover_constants-6YkPPbnk.js.map} +1 -1
- package/dist/vue3/chunks/{popover_constants-XnGWXaxX.js → popover_constants-h9MD6WUt.js} +26 -47
- package/dist/vue3/chunks/{popover_constants-XnGWXaxX.js.map → popover_constants-h9MD6WUt.js.map} +1 -1
- package/dist/vue3/chunks/{sr_only_close_button-3EdsV-dH.js → sr_only_close_button-Ji3Zlts6.js} +4 -4
- package/dist/vue3/chunks/{sr_only_close_button-3EdsV-dH.js.map → sr_only_close_button-Ji3Zlts6.js.map} +1 -1
- package/dist/vue3/chunks/{sr_only_close_button-xGrHFjwA.js → sr_only_close_button-gKr0Vlbz.js} +4 -4
- package/dist/vue3/chunks/{sr_only_close_button-xGrHFjwA.js.map → sr_only_close_button-gKr0Vlbz.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-qc3f42Yp.js → tab-X7IvNGTl.js} +46 -49
- package/dist/vue3/chunks/{tab-qc3f42Yp.js.map → tab-X7IvNGTl.js.map} +1 -1
- package/dist/vue3/chunks/{tab-RTDgnD9-.js → tab-aD6t0MNo.js} +46 -49
- package/dist/vue3/chunks/{tab-RTDgnD9-.js.map → tab-aD6t0MNo.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 +3 -1
- package/dist/vue3/common/dates.cjs.map +1 -1
- package/dist/vue3/common/dates.js +3 -1
- 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 +11 -45
- package/dist/vue3/common/utils.cjs.map +1 -1
- package/dist/vue3/common/utils.js +11 -45
- 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 +87 -108
- package/dist/vue3/lib/attachment-carousel.cjs.map +1 -1
- package/dist/vue3/lib/attachment-carousel.js +87 -108
- package/dist/vue3/lib/attachment-carousel.js.map +1 -1
- package/dist/vue3/lib/avatar.cjs +56 -88
- package/dist/vue3/lib/avatar.cjs.map +1 -1
- package/dist/vue3/lib/avatar.js +56 -88
- package/dist/vue3/lib/avatar.js.map +1 -1
- package/dist/vue3/lib/badge.cjs +15 -31
- package/dist/vue3/lib/badge.cjs.map +1 -1
- package/dist/vue3/lib/badge.js +15 -31
- package/dist/vue3/lib/badge.js.map +1 -1
- package/dist/vue3/lib/banner.cjs +38 -56
- package/dist/vue3/lib/banner.cjs.map +1 -1
- package/dist/vue3/lib/banner.js +38 -56
- package/dist/vue3/lib/banner.js.map +1 -1
- package/dist/vue3/lib/breadcrumbs.cjs +25 -36
- package/dist/vue3/lib/breadcrumbs.cjs.map +1 -1
- package/dist/vue3/lib/breadcrumbs.js +25 -36
- package/dist/vue3/lib/breadcrumbs.js.map +1 -1
- package/dist/vue3/lib/button-group.cjs +2 -7
- package/dist/vue3/lib/button-group.cjs.map +1 -1
- package/dist/vue3/lib/button-group.js +2 -7
- package/dist/vue3/lib/button-group.js.map +1 -1
- package/dist/vue3/lib/button.cjs +44 -69
- package/dist/vue3/lib/button.cjs.map +1 -1
- package/dist/vue3/lib/button.js +44 -69
- package/dist/vue3/lib/button.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover.cjs +68 -81
- package/dist/vue3/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover.js +68 -81
- package/dist/vue3/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/vue3/lib/callbar-button.cjs +32 -45
- package/dist/vue3/lib/callbar-button.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button.js +32 -45
- package/dist/vue3/lib/callbar-button.js.map +1 -1
- package/dist/vue3/lib/callbox.cjs +38 -57
- package/dist/vue3/lib/callbox.cjs.map +1 -1
- package/dist/vue3/lib/callbox.js +38 -57
- package/dist/vue3/lib/callbox.js.map +1 -1
- package/dist/vue3/lib/card.cjs +13 -33
- package/dist/vue3/lib/card.cjs.map +1 -1
- package/dist/vue3/lib/card.js +13 -33
- package/dist/vue3/lib/card.js.map +1 -1
- package/dist/vue3/lib/checkbox-group.cjs +2 -5
- package/dist/vue3/lib/checkbox-group.cjs.map +1 -1
- package/dist/vue3/lib/checkbox-group.js +2 -5
- package/dist/vue3/lib/checkbox-group.js.map +1 -1
- package/dist/vue3/lib/checkbox.cjs +41 -45
- package/dist/vue3/lib/checkbox.cjs.map +1 -1
- package/dist/vue3/lib/checkbox.js +41 -45
- package/dist/vue3/lib/checkbox.js.map +1 -1
- package/dist/vue3/lib/chip.cjs +38 -53
- package/dist/vue3/lib/chip.cjs.map +1 -1
- package/dist/vue3/lib/chip.js +38 -53
- package/dist/vue3/lib/chip.js.map +1 -1
- package/dist/vue3/lib/codeblock.cjs +4 -6
- package/dist/vue3/lib/codeblock.cjs.map +1 -1
- package/dist/vue3/lib/codeblock.js +4 -6
- package/dist/vue3/lib/codeblock.js.map +1 -1
- package/dist/vue3/lib/collapsible.cjs +62 -76
- package/dist/vue3/lib/collapsible.cjs.map +1 -1
- package/dist/vue3/lib/collapsible.js +62 -76
- package/dist/vue3/lib/collapsible.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.cjs +75 -88
- package/dist/vue3/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select.js +75 -88
- package/dist/vue3/lib/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.cjs +77 -85
- package/dist/vue3/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/combobox-with-popover.js +77 -85
- 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 +65 -89
- package/dist/vue3/lib/contact-centers-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-centers-row.js +65 -89
- package/dist/vue3/lib/contact-centers-row.js.map +1 -1
- package/dist/vue3/lib/contact-info.cjs +58 -73
- package/dist/vue3/lib/contact-info.cjs.map +1 -1
- package/dist/vue3/lib/contact-info.js +58 -73
- package/dist/vue3/lib/contact-info.js.map +1 -1
- package/dist/vue3/lib/contact-row.cjs +37 -47
- package/dist/vue3/lib/contact-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-row.js +37 -47
- package/dist/vue3/lib/contact-row.js.map +1 -1
- package/dist/vue3/lib/datepicker.cjs +267 -263
- package/dist/vue3/lib/datepicker.cjs.map +1 -1
- package/dist/vue3/lib/datepicker.js +267 -263
- package/dist/vue3/lib/datepicker.js.map +1 -1
- package/dist/vue3/lib/description-list.cjs +9 -14
- package/dist/vue3/lib/description-list.cjs.map +1 -1
- package/dist/vue3/lib/description-list.js +9 -14
- 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 +312 -249
- package/dist/vue3/lib/editor.cjs.map +1 -1
- package/dist/vue3/lib/editor.js +312 -249
- package/dist/vue3/lib/editor.js.map +1 -1
- package/dist/vue3/lib/emoji-picker.cjs +387 -419
- package/dist/vue3/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker.js +387 -419
- package/dist/vue3/lib/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/emoji-row.cjs +59 -69
- package/dist/vue3/lib/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row.js +59 -69
- package/dist/vue3/lib/emoji-row.js.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper.cjs +13 -12
- package/dist/vue3/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper.js +13 -12
- package/dist/vue3/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/vue3/lib/emoji.cjs +19 -23
- package/dist/vue3/lib/emoji.cjs.map +1 -1
- package/dist/vue3/lib/emoji.js +19 -23
- package/dist/vue3/lib/emoji.js.map +1 -1
- package/dist/vue3/lib/empty-state.cjs +20 -30
- package/dist/vue3/lib/empty-state.cjs.map +1 -1
- package/dist/vue3/lib/empty-state.js +20 -30
- package/dist/vue3/lib/empty-state.js.map +1 -1
- package/dist/vue3/lib/feed-item-row.cjs +43 -74
- package/dist/vue3/lib/feed-item-row.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-row.js +43 -74
- package/dist/vue3/lib/feed-item-row.js.map +1 -1
- package/dist/vue3/lib/feed-pill.cjs +45 -55
- package/dist/vue3/lib/feed-pill.cjs.map +1 -1
- package/dist/vue3/lib/feed-pill.js +45 -55
- package/dist/vue3/lib/feed-pill.js.map +1 -1
- package/dist/vue3/lib/general-row.cjs +115 -165
- package/dist/vue3/lib/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row.js +115 -165
- package/dist/vue3/lib/general-row.js.map +1 -1
- package/dist/vue3/lib/group-row.cjs +7 -9
- package/dist/vue3/lib/group-row.cjs.map +1 -1
- package/dist/vue3/lib/group-row.js +7 -9
- package/dist/vue3/lib/group-row.js.map +1 -1
- package/dist/vue3/lib/grouped-chip.cjs +27 -48
- package/dist/vue3/lib/grouped-chip.cjs.map +1 -1
- package/dist/vue3/lib/grouped-chip.js +27 -48
- package/dist/vue3/lib/grouped-chip.js.map +1 -1
- package/dist/vue3/lib/hovercard.cjs +25 -33
- package/dist/vue3/lib/hovercard.cjs.map +1 -1
- package/dist/vue3/lib/hovercard.js +25 -33
- 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 +2 -1
- package/dist/vue3/lib/illustration.cjs.map +1 -1
- package/dist/vue3/lib/illustration.js +2 -1
- package/dist/vue3/lib/illustration.js.map +1 -1
- package/dist/vue3/lib/image-viewer.cjs +62 -66
- package/dist/vue3/lib/image-viewer.cjs.map +1 -1
- package/dist/vue3/lib/image-viewer.js +62 -66
- package/dist/vue3/lib/image-viewer.js.map +1 -1
- package/dist/vue3/lib/input-group.cjs +15 -19
- package/dist/vue3/lib/input-group.cjs.map +1 -1
- package/dist/vue3/lib/input-group.js +15 -19
- package/dist/vue3/lib/input-group.js.map +1 -1
- package/dist/vue3/lib/input.cjs +76 -104
- package/dist/vue3/lib/input.cjs.map +1 -1
- package/dist/vue3/lib/input.js +76 -104
- package/dist/vue3/lib/input.js.map +1 -1
- package/dist/vue3/lib/item-layout.cjs +10 -27
- package/dist/vue3/lib/item-layout.cjs.map +1 -1
- package/dist/vue3/lib/item-layout.js +10 -27
- package/dist/vue3/lib/item-layout.js.map +1 -1
- package/dist/vue3/lib/ivr-node.cjs +80 -89
- package/dist/vue3/lib/ivr-node.cjs.map +1 -1
- package/dist/vue3/lib/ivr-node.js +80 -89
- package/dist/vue3/lib/ivr-node.js.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.cjs +26 -31
- package/dist/vue3/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.js +26 -31
- package/dist/vue3/lib/keyboard-shortcut.js.map +1 -1
- package/dist/vue3/lib/lazy-show.cjs +6 -8
- package/dist/vue3/lib/lazy-show.cjs.map +1 -1
- package/dist/vue3/lib/lazy-show.js +6 -8
- package/dist/vue3/lib/lazy-show.js.map +1 -1
- package/dist/vue3/lib/link.cjs +2 -7
- package/dist/vue3/lib/link.cjs.map +1 -1
- package/dist/vue3/lib/link.js +2 -7
- package/dist/vue3/lib/link.js.map +1 -1
- package/dist/vue3/lib/list-item-group.cjs +7 -14
- package/dist/vue3/lib/list-item-group.cjs.map +1 -1
- package/dist/vue3/lib/list-item-group.js +7 -14
- package/dist/vue3/lib/list-item-group.js.map +1 -1
- package/dist/vue3/lib/list-item.cjs +24 -25
- package/dist/vue3/lib/list-item.cjs.map +1 -1
- package/dist/vue3/lib/list-item.js +24 -25
- package/dist/vue3/lib/list-item.js.map +1 -1
- package/dist/vue3/lib/message-input.cjs +239 -277
- package/dist/vue3/lib/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input.js +240 -278
- package/dist/vue3/lib/message-input.js.map +1 -1
- package/dist/vue3/lib/modal.cjs +59 -99
- package/dist/vue3/lib/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal.js +59 -99
- package/dist/vue3/lib/modal.js.map +1 -1
- package/dist/vue3/lib/notice.cjs +33 -46
- package/dist/vue3/lib/notice.cjs.map +1 -1
- package/dist/vue3/lib/notice.js +33 -46
- package/dist/vue3/lib/notice.js.map +1 -1
- package/dist/vue3/lib/pagination.cjs +49 -61
- package/dist/vue3/lib/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination.js +49 -61
- package/dist/vue3/lib/pagination.js.map +1 -1
- package/dist/vue3/lib/popover.cjs +133 -156
- package/dist/vue3/lib/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover.js +134 -157
- package/dist/vue3/lib/popover.js.map +1 -1
- package/dist/vue3/lib/presence.cjs +9 -17
- package/dist/vue3/lib/presence.cjs.map +1 -1
- package/dist/vue3/lib/presence.js +9 -17
- 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 +34 -41
- package/dist/vue3/lib/radio.cjs.map +1 -1
- package/dist/vue3/lib/radio.js +34 -41
- package/dist/vue3/lib/radio.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor.cjs +297 -298
- package/dist/vue3/lib/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor.js +297 -298
- package/dist/vue3/lib/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/root-layout.cjs +24 -39
- package/dist/vue3/lib/root-layout.cjs.map +1 -1
- package/dist/vue3/lib/root-layout.js +24 -39
- package/dist/vue3/lib/root-layout.js.map +1 -1
- package/dist/vue3/lib/scrollbar-directive.cjs.map +1 -1
- package/dist/vue3/lib/scrollbar-directive.js.map +1 -1
- package/dist/vue3/lib/scroller.cjs +100 -83
- package/dist/vue3/lib/scroller.cjs.map +1 -1
- package/dist/vue3/lib/scroller.js +100 -83
- package/dist/vue3/lib/scroller.js.map +1 -1
- package/dist/vue3/lib/select-menu.cjs +40 -67
- package/dist/vue3/lib/select-menu.cjs.map +1 -1
- package/dist/vue3/lib/select-menu.js +40 -67
- package/dist/vue3/lib/select-menu.js.map +1 -1
- package/dist/vue3/lib/settings-menu-button.cjs +10 -16
- package/dist/vue3/lib/settings-menu-button.cjs.map +1 -1
- package/dist/vue3/lib/settings-menu-button.js +10 -16
- package/dist/vue3/lib/settings-menu-button.js.map +1 -1
- package/dist/vue3/lib/skeleton.cjs +74 -93
- package/dist/vue3/lib/skeleton.cjs.map +1 -1
- package/dist/vue3/lib/skeleton.js +74 -93
- package/dist/vue3/lib/skeleton.js.map +1 -1
- package/dist/vue3/lib/split-button.cjs +68 -74
- package/dist/vue3/lib/split-button.cjs.map +1 -1
- package/dist/vue3/lib/split-button.js +68 -74
- package/dist/vue3/lib/split-button.js.map +1 -1
- package/dist/vue3/lib/stack.cjs +18 -26
- package/dist/vue3/lib/stack.cjs.map +1 -1
- package/dist/vue3/lib/stack.js +18 -26
- package/dist/vue3/lib/stack.js.map +1 -1
- package/dist/vue3/lib/tabs.cjs +3 -7
- package/dist/vue3/lib/tabs.cjs.map +1 -1
- package/dist/vue3/lib/tabs.js +3 -7
- 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 +35 -51
- package/dist/vue3/lib/toast.cjs.map +1 -1
- package/dist/vue3/lib/toast.js +35 -51
- package/dist/vue3/lib/toast.js.map +1 -1
- package/dist/vue3/lib/toggle.cjs +24 -34
- package/dist/vue3/lib/toggle.cjs.map +1 -1
- package/dist/vue3/lib/toggle.js +24 -34
- package/dist/vue3/lib/toggle.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive.cjs +26 -19
- package/dist/vue3/lib/tooltip-directive.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive.js +26 -19
- package/dist/vue3/lib/tooltip-directive.js.map +1 -1
- package/dist/vue3/lib/tooltip.cjs +21 -32
- package/dist/vue3/lib/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip.js +22 -33
- package/dist/vue3/lib/tooltip.js.map +1 -1
- package/dist/vue3/lib/top-banner-info.cjs +8 -23
- package/dist/vue3/lib/top-banner-info.cjs.map +1 -1
- package/dist/vue3/lib/top-banner-info.js +8 -23
- package/dist/vue3/lib/top-banner-info.js.map +1 -1
- package/dist/vue3/lib/unread-pill.cjs +8 -11
- package/dist/vue3/lib/unread-pill.cjs.map +1 -1
- package/dist/vue3/lib/unread-pill.js +8 -11
- package/dist/vue3/lib/unread-pill.js.map +1 -1
- package/dist/vue3/lib/validation-messages.cjs +14 -17
- package/dist/vue3/lib/validation-messages.cjs.map +1 -1
- package/dist/vue3/lib/validation-messages.js +14 -17
- package/dist/vue3/lib/validation-messages.js.map +1 -1
- package/dist/vue3/style.css +5 -0
- 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/image_viewer/image_viewer.vue.d.ts +21 -0
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/input/input.vue.d.ts +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/extensions/custom_link/custom_link.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +5 -3
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +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/conversation_view/message_input/message_input.vue.d.ts +1 -1
- package/package.json +3 -3
- package/dist/chunks/tokens-base-dark-BC3U5KoN.js +0 -4
- package/dist/chunks/tokens-base-dark-zbBpWlfP.js +0 -1
- package/dist/chunks/tokens-base-light-PCrr7t8W.js +0 -4
- package/dist/chunks/tokens-base-light-dvWvBHbM.js +0 -1
- package/dist/vue2/chunks/icon_constants-Dy4MEUJL.js.map +0 -1
- package/dist/vue2/chunks/icon_constants-QYpmdE0R.js.map +0 -1
- package/dist/vue3/chunks/icon_constants-Dy4MEUJL.js.map +0 -1
- package/dist/vue3/chunks/icon_constants-QYpmdE0R.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":["format","formatDuration","formatDistance","intervalToDuration","capitalizeFirstLetter","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;;;AAYA,
|
|
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":["dialtoneLocale","_baseFormat","date","formatString","_checkLocaleSet","format","locale","_baseFormatDuration","duration","formatDuration","_baseFormatDistance","baseDate","formatDistance","_isLocaleSet","undefined","Error","setDateLocale","getDateMedium","durationInHHMM","durationInSeconds","intervalToDuration","start","end","_getRelativeDaysText","days","rtl","Intl","RelativeTimeFormat","code","numeric","capitalizeFirstLetter","formatToParts","value","relativeDate","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;;;AAYA,IAAIA;AAIJ,SAASC,YAAaC,MAAMC,cAAc;AACxCC;AACA,SAAOC,QAAM,OAACH,MAAMC,cAAc;AAAA,IAChCG,QAAQN;AAAAA,EACV,CAAC;AACH;AAEA,SAASO,oBAAqBC,UAAUL,cAAc;AACpDC;AACA,SAAOK,QAAAA,eAAeD,UAAU;AAAA,IAC9BF,QAAQN;AAAAA,IACRK,QAAQF;AAAAA,EACV,CAAC;AACH;AAEA,SAASO,oBAAqBR,MAAMS,UAAU;AAC5CP;AACA,SAAOQ,QAAc,eAACV,MAAMS,UAAU;AAAA,IACpCL,QAAQN;AAAAA,EACV,CAAC;AACH;AAEA,SAASa,eAAgB;AACvB,SAAOb,mBAAmBc;AAC5B;AAEA,SAASV,kBAAmB;AAC1B,MAAI,CAACS,aAAY,GAAI;AACnB,UAAM,IAAIE,MAAM,wIAC6D;AAAA,EAC/E;AACF;AAMO,SAASC,cAAeV,QAAQ;AACrCN,mBAAiBM;AACnB;AAQO,SAASW,cAAef,MAAM;AACnC,SAAOD,YAAYC,MAAM,WAAW;AACtC;AAQO,SAASgB,eAAgBC,mBAAmB;AACjD,MAAIA,oBAAoB,IAAI;AAG1B,WAAOT,oBAAoB,GAAG,KAAK,GAAI;AAAA,EACzC;AACA,QAAMF,WAAWY,QAAAA,mBAAmB;AAAA,IAClCC,OAAO;AAAA,IACPC,KAAKH,oBAAoB;AAAA,EAC3B,CAAC;AACD,SAAOZ,oBAAoBC,UAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAASe,qBAAsBC,MAAM;AACnC,QAAMC,MAAM,IAAIC,KAAKC,mBAAmB3B,eAAe4B,MAAM;AAAA,IAAEC,SAAS;AAAA,EAAO,CAAC;AAChF,SAAOC,mCAAsBL,IAAIM,cAAcP,MAAM,KAAK,EAAE,CAAC,EAAEQ,OAAOhC,eAAe4B,IAAI;AAC3F;AA8BO,SAASK,aAAc/B,MAAM;AAClC,MAAIgC,QAAAA,QAAQhC,IAAI,GAAG;AACjB,WAAOqB,qBAAqB,CAAC;AAAA,EAC/B,WAAWY,QAAAA,YAAYjC,IAAI,GAAG;AAC5B,WAAOqB,qBAAqB,EAAE;AAAA,EAChC,WAAWa,QAAAA,WAAWlC,IAAI,GAAG;AAC3B,WAAOD,YAAYC,MAAM,MAAM;AAAA,EACjC,WAAWmC,QAAAA,WAAWnC,IAAI,GAAG;AAC3B,WAAOD,YAAYC,MAAM,cAAc;AAAA,EACzC,OAAO;AACL,WAAOD,YAAYC,MAAM,WAAW;AAAA,EACtC;AACF;;;;;"}
|
|
@@ -47,7 +47,9 @@ 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, {
|
|
50
|
+
const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, {
|
|
51
|
+
numeric: "auto"
|
|
52
|
+
});
|
|
51
53
|
return capitalizeFirstLetter(rtl.formatToParts(days, "day")[0].value, dialtoneLocale.code);
|
|
52
54
|
}
|
|
53
55
|
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":[],"mappings":";;;;AAYA,
|
|
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":["dialtoneLocale","_baseFormat","date","formatString","_checkLocaleSet","format","locale","_baseFormatDuration","duration","formatDuration","_baseFormatDistance","baseDate","formatDistance","_isLocaleSet","undefined","Error","setDateLocale","getDateMedium","durationInHHMM","durationInSeconds","intervalToDuration","start","end","_getRelativeDaysText","days","rtl","Intl","RelativeTimeFormat","code","numeric","capitalizeFirstLetter","formatToParts","value","relativeDate","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;AAYA,IAAIA;AAIJ,SAASC,YAAaC,MAAMC,cAAc;AACxCC;AACA,SAAOC,OAAOH,MAAMC,cAAc;AAAA,IAChCG,QAAQN;AAAAA,EACV,CAAC;AACH;AAEA,SAASO,oBAAqBC,UAAUL,cAAc;AACpDC;AACA,SAAOK,eAAeD,UAAU;AAAA,IAC9BF,QAAQN;AAAAA,IACRK,QAAQF;AAAAA,EACV,CAAC;AACH;AAEA,SAASO,oBAAqBR,MAAMS,UAAU;AAC5CP;AACA,SAAOQ,eAAeV,MAAMS,UAAU;AAAA,IACpCL,QAAQN;AAAAA,EACV,CAAC;AACH;AAEA,SAAS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const common_emoji = require("../chunks/index-
|
|
3
|
+
const common_emoji = require("../chunks/index-fEp0B-5Z.js");
|
|
4
4
|
require("@dialpad/dialtone-emojis");
|
|
5
5
|
exports.codeToEmojiData = common_emoji.codeToEmojiData;
|
|
6
6
|
Object.defineProperty(exports, "customEmojiAssetUrl", {
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-dfdrE-3M.js";
|
|
2
2
|
import "@dialpad/dialtone-emojis";
|
|
3
3
|
export {
|
|
4
4
|
codeToEmojiData,
|
|
@@ -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-dLLo3Wtg.js");
|
|
4
|
+
const input_group = require("../chunks/input_group-rE6nhye8.js");
|
|
5
|
+
const keyboard_list_navigation = require("../chunks/keyboard_list_navigation-x3D6RcC7.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-HIysg24t.js";
|
|
2
|
+
import { InputGroupMixin } from "../chunks/input_group-hV1WT2it.js";
|
|
3
|
+
import { KeyboardNavigation } from "../chunks/keyboard_list_navigation-YIqTuw1W.js";
|
|
4
4
|
import "vue";
|
|
5
5
|
import "./constants.js";
|
|
6
6
|
import "./validators.js";
|
|
@@ -76,7 +76,9 @@ function findFirstFocusableNode(element) {
|
|
|
76
76
|
return element == null ? void 0 : element.querySelector(FOCUSABLE_SELECTOR);
|
|
77
77
|
}
|
|
78
78
|
const htmlFragment = (props) => {
|
|
79
|
-
return vue.h("div", {
|
|
79
|
+
return vue.h("div", {
|
|
80
|
+
innerHTML: props.html
|
|
81
|
+
});
|
|
80
82
|
};
|
|
81
83
|
const flushPromises = () => {
|
|
82
84
|
return new Promise((resolve) => {
|
|
@@ -121,60 +123,24 @@ function isOutOfViewPort(element) {
|
|
|
121
123
|
return isOut;
|
|
122
124
|
}
|
|
123
125
|
const domainNameRegex = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/;
|
|
124
|
-
const tldRegerx = new RegExp(
|
|
125
|
-
|
|
126
|
-
);
|
|
127
|
-
const ipv4Regex = new RegExp(
|
|
128
|
-
"(?:(?:[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])"
|
|
129
|
-
);
|
|
130
|
-
const hostnameOrIpRegex = new RegExp(
|
|
131
|
-
"(?:" + [
|
|
132
|
-
[
|
|
133
|
-
domainNameRegex.source,
|
|
134
|
-
tldRegerx.source
|
|
135
|
-
].join("+"),
|
|
136
|
-
ipv4Regex.source
|
|
137
|
-
].join("|") + ")"
|
|
138
|
-
);
|
|
126
|
+
const tldRegerx = new RegExp("(?: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)");
|
|
127
|
+
const ipv4Regex = new RegExp("(?:(?:[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])");
|
|
128
|
+
const hostnameOrIpRegex = new RegExp("(?:" + [[domainNameRegex.source, tldRegerx.source].join("+"), ipv4Regex.source].join("|") + ")");
|
|
139
129
|
const urlPathRegex = /(?:(?:[;/][^#?<>\s]*)?)/;
|
|
140
130
|
const urlQueryOrFragmentRegex = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/;
|
|
141
|
-
const urlWithoutProtocolRegex = new RegExp(
|
|
142
|
-
"\\b" + [
|
|
143
|
-
hostnameOrIpRegex.source,
|
|
144
|
-
urlPathRegex.source,
|
|
145
|
-
urlQueryOrFragmentRegex.source,
|
|
146
|
-
"(?!\\w)"
|
|
147
|
-
].join("+")
|
|
148
|
-
);
|
|
131
|
+
const urlWithoutProtocolRegex = new RegExp("\\b" + [hostnameOrIpRegex.source, urlPathRegex.source, urlQueryOrFragmentRegex.source, "(?!\\w)"].join("+"));
|
|
149
132
|
const urlWithProtocolRegex = /\b[a-z\d.-]+:\/\/[^<>\s]+/;
|
|
150
|
-
const emailAddressRegex = new RegExp(
|
|
151
|
-
"(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [
|
|
152
|
-
hostnameOrIpRegex.source,
|
|
153
|
-
urlQueryOrFragmentRegex.source
|
|
154
|
-
].join("+") + "(?!\\w)"
|
|
155
|
-
);
|
|
133
|
+
const emailAddressRegex = new RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [hostnameOrIpRegex.source, urlQueryOrFragmentRegex.source].join("+") + "(?!\\w)");
|
|
156
134
|
function getPhoneNumberRegex(minLength = 7, maxLength = 15) {
|
|
157
135
|
try {
|
|
158
|
-
return new RegExp(
|
|
159
|
-
`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
160
|
-
);
|
|
136
|
+
return new RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`);
|
|
161
137
|
} catch (e) {
|
|
162
138
|
console.warn("This browser doesn't support regex lookahead/lookbehind");
|
|
163
139
|
}
|
|
164
|
-
return new RegExp(
|
|
165
|
-
`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
166
|
-
);
|
|
140
|
+
return new RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`);
|
|
167
141
|
}
|
|
168
142
|
const phoneNumberRegex = getPhoneNumberRegex();
|
|
169
|
-
const linkRegex = new RegExp(
|
|
170
|
-
[
|
|
171
|
-
urlWithoutProtocolRegex.source,
|
|
172
|
-
urlWithProtocolRegex.source,
|
|
173
|
-
emailAddressRegex.source,
|
|
174
|
-
phoneNumberRegex.source
|
|
175
|
-
].join("|"),
|
|
176
|
-
"gi"
|
|
177
|
-
);
|
|
143
|
+
const linkRegex = new RegExp([urlWithoutProtocolRegex.source, urlWithProtocolRegex.source, emailAddressRegex.source, phoneNumberRegex.source].join("|"), "gi");
|
|
178
144
|
function isPhoneNumber(input) {
|
|
179
145
|
var _a;
|
|
180
146
|
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 {\n h,\n Comment,\n Text,\n} 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 = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n // eslint-disable-next-line complexity\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\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\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.startsWith('on'));\n return Object.fromEntries(listeners);\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:9011\" 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 extractVueListeners,\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","h","Comment","Text"],"mappings":";;;;AAWA,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;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,S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O,KAAK;AAAI,WAAO;AACrE,UAAQ,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;AAAA,EACA;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 {\n h,\n Comment,\n Text,\n} 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 = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n // eslint-disable-next-line complexity\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\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\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.startsWith('on'));\n return Object.fromEntries(listeners);\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:9011\" 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 extractVueListeners,\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","props","innerHTML","html","flushPromises","Promise","resolve","hasSlotContent","slot","slotProps","vnode","Comment","Array","isArray","children","Text","trim","kebabCaseToPascalCase","string","toLowerCase","split","word","charAt","toUpperCase","slice","join","pascalCaseToKebabCase","replace","x","y","extractVueListeners","attrs","listeners","Object","entries","key","startsWith","fromEntries","debounce","func","timeout","clearTimeout","isOutOfViewPort","bounding","getBoundingClientRect","isOut","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","any","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":";;;;AAWA,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,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A,EACAY;AAAAA,EACAI;AAAAA,EACAa;AAAAA,EACAa;AAAAA,EACAQ;AAAAA,EACAI;AAAAA,EACA+B;AAAAA,EACAO;AAAAA,EACAO;AAAAA,EACAN;AAAAA,EACAK;AAAAA,EACAE;AAAAA,EACAE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -74,7 +74,9 @@ function findFirstFocusableNode(element) {
|
|
|
74
74
|
return element == null ? void 0 : element.querySelector(FOCUSABLE_SELECTOR);
|
|
75
75
|
}
|
|
76
76
|
const htmlFragment = (props) => {
|
|
77
|
-
return h("div", {
|
|
77
|
+
return h("div", {
|
|
78
|
+
innerHTML: props.html
|
|
79
|
+
});
|
|
78
80
|
};
|
|
79
81
|
const flushPromises = () => {
|
|
80
82
|
return new Promise((resolve) => {
|
|
@@ -119,60 +121,24 @@ function isOutOfViewPort(element) {
|
|
|
119
121
|
return isOut;
|
|
120
122
|
}
|
|
121
123
|
const domainNameRegex = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/;
|
|
122
|
-
const tldRegerx = new RegExp(
|
|
123
|
-
|
|
124
|
-
);
|
|
125
|
-
const ipv4Regex = new RegExp(
|
|
126
|
-
"(?:(?:[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])"
|
|
127
|
-
);
|
|
128
|
-
const hostnameOrIpRegex = new RegExp(
|
|
129
|
-
"(?:" + [
|
|
130
|
-
[
|
|
131
|
-
domainNameRegex.source,
|
|
132
|
-
tldRegerx.source
|
|
133
|
-
].join("+"),
|
|
134
|
-
ipv4Regex.source
|
|
135
|
-
].join("|") + ")"
|
|
136
|
-
);
|
|
124
|
+
const tldRegerx = new RegExp("(?: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)");
|
|
125
|
+
const ipv4Regex = new RegExp("(?:(?:[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
|
+
const hostnameOrIpRegex = new RegExp("(?:" + [[domainNameRegex.source, tldRegerx.source].join("+"), ipv4Regex.source].join("|") + ")");
|
|
137
127
|
const urlPathRegex = /(?:(?:[;/][^#?<>\s]*)?)/;
|
|
138
128
|
const urlQueryOrFragmentRegex = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/;
|
|
139
|
-
const urlWithoutProtocolRegex = new RegExp(
|
|
140
|
-
"\\b" + [
|
|
141
|
-
hostnameOrIpRegex.source,
|
|
142
|
-
urlPathRegex.source,
|
|
143
|
-
urlQueryOrFragmentRegex.source,
|
|
144
|
-
"(?!\\w)"
|
|
145
|
-
].join("+")
|
|
146
|
-
);
|
|
129
|
+
const urlWithoutProtocolRegex = new RegExp("\\b" + [hostnameOrIpRegex.source, urlPathRegex.source, urlQueryOrFragmentRegex.source, "(?!\\w)"].join("+"));
|
|
147
130
|
const urlWithProtocolRegex = /\b[a-z\d.-]+:\/\/[^<>\s]+/;
|
|
148
|
-
const emailAddressRegex = new RegExp(
|
|
149
|
-
"(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [
|
|
150
|
-
hostnameOrIpRegex.source,
|
|
151
|
-
urlQueryOrFragmentRegex.source
|
|
152
|
-
].join("+") + "(?!\\w)"
|
|
153
|
-
);
|
|
131
|
+
const emailAddressRegex = new RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [hostnameOrIpRegex.source, urlQueryOrFragmentRegex.source].join("+") + "(?!\\w)");
|
|
154
132
|
function getPhoneNumberRegex(minLength = 7, maxLength = 15) {
|
|
155
133
|
try {
|
|
156
|
-
return new RegExp(
|
|
157
|
-
`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
158
|
-
);
|
|
134
|
+
return new RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`);
|
|
159
135
|
} catch (e) {
|
|
160
136
|
console.warn("This browser doesn't support regex lookahead/lookbehind");
|
|
161
137
|
}
|
|
162
|
-
return new RegExp(
|
|
163
|
-
`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
|
|
164
|
-
);
|
|
138
|
+
return new RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${minLength},${maxLength}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`);
|
|
165
139
|
}
|
|
166
140
|
const phoneNumberRegex = getPhoneNumberRegex();
|
|
167
|
-
const linkRegex = new RegExp(
|
|
168
|
-
[
|
|
169
|
-
urlWithoutProtocolRegex.source,
|
|
170
|
-
urlWithProtocolRegex.source,
|
|
171
|
-
emailAddressRegex.source,
|
|
172
|
-
phoneNumberRegex.source
|
|
173
|
-
].join("|"),
|
|
174
|
-
"gi"
|
|
175
|
-
);
|
|
141
|
+
const linkRegex = new RegExp([urlWithoutProtocolRegex.source, urlWithProtocolRegex.source, emailAddressRegex.source, phoneNumberRegex.source].join("|"), "gi");
|
|
176
142
|
function isPhoneNumber(input) {
|
|
177
143
|
var _a;
|
|
178
144
|
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 {\n h,\n Comment,\n Text,\n} 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 = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n // eslint-disable-next-line complexity\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\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\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.startsWith('on'));\n return Object.fromEntries(listeners);\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:9011\" 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 extractVueListeners,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStr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AAE,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;AAAA,EACA;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 {\n h,\n Comment,\n Text,\n} 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 = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n // eslint-disable-next-line complexity\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\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\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.startsWith('on'));\n return Object.fromEntries(listeners);\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:9011\" 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 extractVueListeners,\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","props","innerHTML","html","flushPromises","Promise","resolve","hasSlotContent","slot","slotProps","vnode","Comment","Array","isArray","children","Text","trim","kebabCaseToPascalCase","string","toLowerCase","split","word","charAt","toUpperCase","slice","join","pascalCaseToKebabCase","replace","x","y","extractVueListeners","attrs","listeners","Object","entries","key","startsWith","fromEntries","debounce","func","timeout","clearTimeout","isOutOfViewPort","bounding","getBoundingClientRect","isOut","top","left","bottom","window","innerHeight","document","documentElement","clientHeight","right","innerWidth","clientWidth","any","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":";;AAWA,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,IAAAA,KAAIL,KAAKO,KAAK,IAAIF,EAAC,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,WAAO;EACT;AAEA,SAAOA,SAASC,IAAIC,aAAW;AAC7B,QAAI,OAAOA,YAAY,UAAU;AAC/B,aAAO;AAAA,QACLA;AAAAA,QACAC,MAAMC;AAAAA;IAEV;AAEA,WAAOF;AAAAA,EACT,CA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AU,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,SAASpG,OAAOlB,SAAO,CAAC,CAACA,GAAG,EAAEsD,KAAK,GAAG;AAC/C;AAQO,SAASiE,sBAAuBvH,KAAKwH,SAAS,SAAS;AAC5D,SAAOxH,IAAIwD,QAAQ,2BAAW,GAAEiE,UAAQA,KAAKC,kBAAkBF,MAAM,CAAC;AACxE;AAEA,MAAe,QAAA;AAAA,EACbpI;AAAAA,EACAG;AAAAA,EACAQ;AAAAA,EACAS;AAAAA,EACAM;AAAAA,EACAK;AAAAA,EACAF;AAAAA,EACAY;AAAAA,EACAI;AAAAA,EACAa;AAAAA,EACAa;AAAAA,EACAQ;AAAAA,EACAI;AAAAA,EACA+B;AAAAA,EACAO;AAAAA,EACAO;AAAAA,EACAN;AAAAA,EACAK;AAAAA,EACAE;AAAAA,EACAE;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":["VALIDATION_MESSAGE_TYPES"],"mappings":";;;AAIO,
|
|
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":["validationMessageValidator","rawMessages","every","message","Object","values","VALIDATION_MESSAGE_TYPES","includes","type"],"mappings":";;;AAIO,SAASA,2BAA4BC,aAAa;AACvD,MAAI,CAACA,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SAAOA,YAAYC,MAAMC,aAAW;AAClC,QAAI,OAAOA,YAAY,UAAU;AAC/B,aAAO;AAAA,IACT;AAEA,QAAI,OAAOA,YAAY,UAAU;AAC/B,aAAOC,OAAOC,OAAOC,iBAAwB,wBAAA,EAAEC,SAASJ,mCAASK,IAAI;AAAA,IACvE;AAEA,WAAO;AAAA,EACT,CAAC;AACH;AAEA,MAAe,QAAA;AAAA,EACbR;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":[],"mappings":";AAIO,
|
|
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":["validationMessageValidator","rawMessages","every","message","Object","values","VALIDATION_MESSAGE_TYPES","includes","type"],"mappings":";AAIO,SAASA,2BAA4BC,aAAa;AACvD,MAAI,CAACA,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,SAAOA,YAAYC,MAAMC,aAAW;AAClC,QAAI,OAAOA,YAAY,UAAU;AAC/B,aAAO;AAAA,IACT;AAEA,QAAI,OAAOA,YAAY,UAAU;AAC/B,aAAOC,OAAOC,OAAOC,wBAAwB,EAAEC,SAASJ,mCAASK,IAAI;AAAA,IACvE;AAEA,WAAO;AAAA,EACT,CAAC;AACH;AAEA,MAAe,QAAA;AAAA,EACbR;AACF;"}
|