@globalpayments/vega 2.47.1 → 2.48.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/cjs/{app-globals-fdf98585.js → app-globals-22798708.js} +3 -3
- package/dist/cjs/{content-state-b1ec39e3.js → content-state-54d94562.js} +220 -4
- package/dist/cjs/{design-token-0c22ffa8.js → design-token-1abb655a.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-b3109dd1.js → element-appender-slimmer-2d4c8c18.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-2432e295.js → form-field-controller-slimmer-527c25a0.js} +2 -2
- package/dist/cjs/{image-annotation-action-becd6f24.js → image-annotation-action-b78404b8.js} +1 -1
- package/dist/cjs/{index-ec9a1f36.js → index-c4dec3aa.js} +1 -1
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/{inject-keyboard-manager-d1eac696.js → inject-keyboard-manager-b301e887.js} +1 -1
- package/dist/cjs/{keyboard-manager-97d0ddfa.js → keyboard-manager-2ccf4b16.js} +25 -5
- package/dist/cjs/{keyboard-manager-slimmer-23ce5dcf.js → keyboard-manager-slimmer-900cf2f5.js} +1 -1
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{min-number-rule-5bcccc8f.js → min-number-rule-965fc43d.js} +2 -2
- package/dist/cjs/{public-rules-3c2a69b4.js → public-rules-c4d2df9d.js} +3 -3
- package/dist/cjs/{responsive-format-facade-e48962dd.js → responsive-format-facade-38f3763e.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-f08f5891.js → rich-text-editor-required-rule-e73f2c4f.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-56a2401f.js → string-input-formatter-slimmer-50322824.js} +2 -2
- package/dist/cjs/{style-formatter-48ef74d4.js → style-formatter-ecb4d49c.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-b16c9094.js → sub-state-notify-slimmer-7f437b19.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-1b6de09f.js → sub-state-observer-slimmer-e90362cd.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +4 -4
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-box.cjs.entry.js +5 -5
- package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-card.cjs.entry.js +4 -4
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +5 -5
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-divider.cjs.entry.js +4 -4
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +8 -8
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +4 -4
- package/dist/cjs/vega-flex.cjs.entry.js +5 -5
- package/dist/cjs/vega-font.cjs.entry.js +4 -4
- package/dist/cjs/vega-form.cjs.entry.js +4 -4
- package/dist/cjs/vega-grid.cjs.entry.js +4 -4
- package/dist/cjs/vega-icon.cjs.entry.js +4 -4
- package/dist/cjs/vega-image-uploader.cjs.entry.js +16 -7
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +11 -8
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +8 -8
- package/dist/cjs/{vega-internal-event-id-dc866d43.js → vega-internal-event-id-bfea9b93.js} +4 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +447 -194
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-radio_2.cjs.entry.js +8 -5
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +12 -12
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +448 -192
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +5 -5
- package/dist/cjs/vega-signature-capture.cjs.entry.js +6 -6
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-table_8.cjs.entry.js +5 -5
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +11 -11
- package/dist/cjs/vega.cjs.js +5 -5
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.js +4 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +11 -1
- package/dist/collection/components/vega-input/vega-input.js +4 -4
- package/dist/collection/components/vega-nav/slimmers/vega-left-nav-group-hierarchy-controller.js +31 -0
- package/dist/collection/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.js +147 -0
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +42 -8
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-initialize-selected-controller.js +56 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-link-click-controller.js +70 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-open-state-controller.js +47 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-other-groups-click-controller.js +60 -0
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/renderers/vega-left-nav-group-renderer.js +10 -9
- package/dist/collection/components/vega-nav/vega-left-nav-group/vega-left-nav-group.js +21 -6
- package/dist/collection/components/vega-nav/vega-left-nav-link/slimmers/controllers/vega-left-nav-link-controller.js +21 -0
- package/dist/collection/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.js +13 -1
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/bold-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/code-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/image-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/indent-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/italic-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +7 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-color-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/text-style-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/underline-annotation.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +47 -2
- package/dist/collection/components/vega-rich-text-editor/dto/editor-state.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/dto/range.js +8 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/selection-state.js +17 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/block-to-rte-block-strategy.abstract.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +3 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-image-to-rte-image-block-strategy.js +18 -15
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +137 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +54 -15
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +13 -1
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +116 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/slimmers/renderers/vega-rich-text-image-editor-renderer.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-image-editor/vega-rich-text-image-editor.js +2 -1
- package/dist/collection/components/vega-stepper/vega-stepper.js +2 -2
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +2 -0
- package/dist/collection/helpers/keyboard/keyboard-manager.js +25 -5
- package/dist/collection/helpers/keyboard/test/keyboard-manager.test.js +204 -105
- package/dist/collection/helpers/validator/rules/max-number-rule.js +1 -1
- package/dist/collection/helpers/validator/rules/min-number-rule.js +1 -1
- package/dist/collection/helpers/validator/test/rules/max-number-rule.test.js +2 -2
- package/dist/collection/helpers/validator/test/rules/min-number-rule.test.js +2 -2
- package/dist/esm/{app-globals-53b6125a.js → app-globals-1bb57f5e.js} +3 -3
- package/dist/esm/{content-state-7437e069.js → content-state-6dba6625.js} +220 -4
- package/dist/esm/{design-token-fb43f78a.js → design-token-070b7326.js} +1 -1
- package/dist/esm/{element-appender-slimmer-0a0b20e9.js → element-appender-slimmer-d196dd21.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-2978abd4.js → form-field-controller-slimmer-e7dc3db1.js} +2 -2
- package/dist/esm/{image-annotation-action-51248df9.js → image-annotation-action-0b661259.js} +1 -1
- package/dist/esm/{index-96374234.js → index-4aa167d6.js} +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/{inject-keyboard-manager-ab0bfb8b.js → inject-keyboard-manager-f513be4a.js} +1 -1
- package/dist/esm/{keyboard-manager-8c4ef91b.js → keyboard-manager-262be5ce.js} +25 -5
- package/dist/esm/{keyboard-manager-slimmer-6f5cb52a.js → keyboard-manager-slimmer-42bf9773.js} +1 -1
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{min-number-rule-a6082418.js → min-number-rule-86421853.js} +2 -2
- package/dist/esm/{public-rules-cfc196c9.js → public-rules-f9aaa527.js} +3 -3
- package/dist/esm/{responsive-format-facade-ae799f25.js → responsive-format-facade-dfed6d94.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-baf61553.js → rich-text-editor-required-rule-42b796eb.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-8c7987ac.js → string-input-formatter-slimmer-c61f82d6.js} +2 -2
- package/dist/esm/{style-formatter-bf71b8e7.js → style-formatter-788dbacf.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-2216c7dc.js → sub-state-notify-slimmer-4e3cf09d.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-da938c88.js → sub-state-observer-slimmer-be7a6ce3.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +4 -4
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-box.entry.js +5 -5
- package/dist/esm/vega-button-circle.entry.js +4 -4
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_3.entry.js +3 -3
- package/dist/esm/vega-card.entry.js +4 -4
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +5 -5
- package/dist/esm/vega-date-picker_2.entry.js +10 -10
- package/dist/esm/vega-dialog_2.entry.js +4 -4
- package/dist/esm/vega-divider.entry.js +4 -4
- package/dist/esm/vega-dropdown_5.entry.js +8 -8
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +4 -4
- package/dist/esm/vega-flex.entry.js +5 -5
- package/dist/esm/vega-font.entry.js +4 -4
- package/dist/esm/vega-form.entry.js +4 -4
- package/dist/esm/vega-grid.entry.js +4 -4
- package/dist/esm/vega-icon.entry.js +4 -4
- package/dist/esm/vega-image-uploader.entry.js +16 -7
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +11 -8
- package/dist/esm/vega-input-phone-number.entry.js +3 -3
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-7d1ff289.js → vega-internal-event-id-85ad403f.js} +3 -1
- package/dist/esm/vega-left-nav_5.entry.js +447 -194
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-radio_2.entry.js +8 -5
- package/dist/esm/vega-rich-text-content.entry.js +12 -12
- package/dist/esm/vega-rich-text-editor_4.entry.js +448 -192
- package/dist/esm/vega-selection-chip_2.entry.js +6 -6
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +5 -5
- package/dist/esm/vega-signature-capture.entry.js +6 -6
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-table_8.entry.js +5 -5
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +8 -8
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega-tooltip_2.entry.js +11 -11
- package/dist/esm/vega.js +5 -5
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +3 -0
- package/dist/types/components/vega-input/vega-input.d.ts +2 -2
- package/dist/types/components/vega-nav/interface.d.ts +11 -0
- package/dist/types/components/vega-nav/slimmers/vega-left-nav-group-hierarchy-controller.d.ts +15 -0
- package/dist/types/components/vega-nav/vega-left-nav/test/vega-left-nav-mock-data.d.ts +4 -0
- package/dist/types/components/vega-nav/vega-left-nav/vega-left-nav.d.ts +21 -4
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-initialize-selected-controller.d.ts +20 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-link-click-controller.d.ts +25 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-open-state-controller.d.ts +27 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-other-groups-click-controller.d.ts +17 -0
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/renderers/vega-left-nav-group-renderer.d.ts +2 -1
- package/dist/types/components/vega-nav/vega-left-nav-group/vega-left-nav-group.d.ts +12 -5
- package/dist/types/components/vega-nav/vega-left-nav-link/slimmers/controllers/vega-left-nav-link-controller.d.ts +5 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/block-annotation.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/bold-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/code-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/horizontal-alignment-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/image-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/indent-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/italic-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/node-annotation.abstract.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/selection-range-annotation.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/strikethrough-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-color-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/text-style-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/underline-annotation.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +19 -1
- package/dist/types/components/vega-rich-text-editor/dto/editor-state.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/dto/range.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/selection-state.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/history-controller.d.ts +54 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +14 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +4 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +2 -0
- package/dist/types/components.d.ts +13 -11
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +2 -0
- package/dist/types/helpers/keyboard/keyboard-manager.d.ts +11 -1
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/types/ui.type.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-2c1c88c0.entry.js → p-024cccab.entry.js} +1 -1
- package/dist/vega/{p-4b1a7d31.entry.js → p-07d1c3e1.entry.js} +1 -1
- package/dist/vega/{p-96410d71.entry.js → p-09c13382.entry.js} +1 -1
- package/dist/vega/{p-343b4522.entry.js → p-09f7f841.entry.js} +1 -1
- package/dist/vega/{p-50a076d0.entry.js → p-0a18f5f6.entry.js} +1 -1
- package/dist/vega/{p-b9f48611.js → p-0d355793.js} +1 -1
- package/dist/vega/{p-b64d5c3a.entry.js → p-10f1429e.entry.js} +1 -1
- package/dist/vega/p-1b3f492f.entry.js +1 -0
- package/dist/vega/{p-b4dfa967.entry.js → p-1d0cf3ae.entry.js} +1 -1
- package/dist/vega/{p-4b541ce8.entry.js → p-2198de3e.entry.js} +1 -1
- package/dist/vega/{p-b06e5916.entry.js → p-2491d18f.entry.js} +1 -1
- package/dist/vega/{p-0073c3de.entry.js → p-24e0cdcc.entry.js} +1 -1
- package/dist/vega/{p-1c08e94a.entry.js → p-27e3825f.entry.js} +1 -1
- package/dist/vega/{p-b6caa1e2.entry.js → p-292b421a.entry.js} +1 -1
- package/dist/vega/{p-8f80b321.entry.js → p-2ecae9fe.entry.js} +1 -1
- package/dist/vega/{p-410755ca.entry.js → p-2fadef27.entry.js} +1 -1
- package/dist/vega/{p-d6620b42.entry.js → p-31ec679b.entry.js} +1 -1
- package/dist/vega/{p-d6d9c300.entry.js → p-32c68611.entry.js} +1 -1
- package/dist/vega/{p-bab6ca81.js → p-32ca74b1.js} +1 -1
- package/dist/vega/{p-f9b07b5e.entry.js → p-353d32c0.entry.js} +1 -1
- package/dist/vega/{p-aa109e80.entry.js → p-371cc8e8.entry.js} +1 -1
- package/dist/vega/{p-c86a4896.entry.js → p-38fa38dc.entry.js} +1 -1
- package/dist/vega/{p-e1a06741.entry.js → p-472727a4.entry.js} +1 -1
- package/dist/vega/{p-59e9f57a.js → p-48b7f20d.js} +1 -1
- package/dist/vega/p-4e68dfd9.js +1 -0
- package/dist/vega/{p-8c32ff75.entry.js → p-4fa94b35.entry.js} +1 -1
- package/dist/vega/{p-1e2886b5.js → p-50e80afa.js} +1 -1
- package/dist/vega/p-56a0b13d.js +1 -0
- package/dist/vega/{p-a1bdf9a0.entry.js → p-575ca599.entry.js} +1 -1
- package/dist/vega/{p-bcb43c54.entry.js → p-57e813f2.entry.js} +1 -1
- package/dist/vega/{p-324dd09a.entry.js → p-5a8f129f.entry.js} +1 -1
- package/dist/vega/p-5c1eedc5.js +1 -0
- package/dist/vega/{p-b65de502.entry.js → p-5c3da7ed.entry.js} +1 -1
- package/dist/vega/{p-b2643e88.js → p-5e3a15a1.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-611282a7.entry.js → p-65a76f19.entry.js} +1 -1
- package/dist/vega/{p-69cc3fa2.js → p-6cabdb36.js} +1 -1
- package/dist/vega/{p-79cc1f41.entry.js → p-6cc32ffa.entry.js} +1 -1
- package/dist/vega/{p-d7642125.js → p-72ecfd40.js} +1 -1
- package/dist/vega/{p-0b56725e.entry.js → p-7581d242.entry.js} +1 -1
- package/dist/vega/{p-213752bd.js → p-75c68f51.js} +1 -1
- package/dist/vega/p-7db32dc0.entry.js +1 -0
- package/dist/vega/{p-f0bc8f6d.js → p-7f6702f7.js} +1 -1
- package/dist/vega/{p-df44a712.entry.js → p-84298e28.entry.js} +1 -1
- package/dist/vega/p-8bc4c015.entry.js +1 -0
- package/dist/vega/{p-e59ff7d1.entry.js → p-971f7d3c.entry.js} +1 -1
- package/dist/vega/{p-1b731247.entry.js → p-9dba10f7.entry.js} +1 -1
- package/dist/vega/p-b1f9fca8.entry.js +1 -0
- package/dist/vega/{p-7594875a.entry.js → p-b3e1dc86.entry.js} +1 -1
- package/dist/vega/{p-d6c37085.entry.js → p-baca6dfc.entry.js} +1 -1
- package/dist/vega/p-bf1894ec.js +1 -0
- package/dist/vega/p-c5f8b3a3.entry.js +1 -0
- package/dist/vega/p-c6a3fe8a.entry.js +1 -0
- package/dist/vega/p-c754b32c.js +1 -0
- package/dist/vega/p-cc43a4ca.js +1 -0
- package/dist/vega/{p-0523efe8.entry.js → p-ccdd49be.entry.js} +1 -1
- package/dist/vega/p-cd205d96.js +1 -0
- package/dist/vega/{p-d4a61b1d.entry.js → p-d033ed44.entry.js} +1 -1
- package/dist/vega/{p-e5695801.entry.js → p-d6591d70.entry.js} +1 -1
- package/dist/vega/{p-80c86d79.js → p-d7937711.js} +1 -1
- package/dist/vega/{p-7bc3a42b.js → p-db4112af.js} +1 -1
- package/dist/vega/{p-c706de06.entry.js → p-dd33bc71.entry.js} +1 -1
- package/dist/vega/{p-4f7f93ef.entry.js → p-e8f16f1d.entry.js} +1 -1
- package/dist/vega/{p-01b4d6ba.entry.js → p-ed6cc75b.entry.js} +1 -1
- package/dist/vega/p-f4d3387c.entry.js +1 -0
- package/dist/vega/{p-bd5ca7cc.entry.js → p-f5b19d4f.entry.js} +1 -1
- package/dist/vega/{p-4f54ba1f.entry.js → p-f7423232.entry.js} +1 -1
- package/dist/vega/p-fba4bae5.js +1 -0
- package/dist/vega/p-fda0c179.entry.js +1 -0
- package/dist/vega/p-ff41dc6a.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-controller.js +0 -30
- package/dist/collection/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-sibling-observer-controller.js +0 -48
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-controller.d.ts +0 -11
- package/dist/types/components/vega-nav/vega-left-nav-group/slimmers/controllers/vega-left-nav-group-sibling-observer-controller.d.ts +0 -18
- package/dist/vega/p-08679cd9.entry.js +0 -1
- package/dist/vega/p-12d60f5f.js +0 -1
- package/dist/vega/p-214aa52e.js +0 -1
- package/dist/vega/p-2863aa51.entry.js +0 -1
- package/dist/vega/p-2e65e175.js +0 -1
- package/dist/vega/p-31de5cb4.entry.js +0 -1
- package/dist/vega/p-3d3cd394.js +0 -1
- package/dist/vega/p-3e285c35.js +0 -1
- package/dist/vega/p-8af3fc79.entry.js +0 -1
- package/dist/vega/p-8ee31f00.entry.js +0 -1
- package/dist/vega/p-952913fc.entry.js +0 -1
- package/dist/vega/p-ab26cad6.js +0 -1
- package/dist/vega/p-b07add9c.entry.js +0 -1
- package/dist/vega/p-b9051ad2.js +0 -1
- package/dist/vega/p-c2321aa8.entry.js +0 -1
- package/dist/vega/p-ceb9f5aa.entry.js +0 -1
- package/dist/vega/p-f2373487.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as t,w as e,o as r,x as a,h as s,y as o,z as n,A as i,D as u,E as d,G as l,H as m,I as c,p,J as f,B as b,K as $}from"./p-b1f65b13.js";import{L as v}from"./p-6e1ab235.js";import{g,c as h}from"./p-c0291e2e.js";import{i as x}from"./p-262ec334.js";import{F as T,b as w,c as j,d as y,e as k,T as O}from"./p-74168615.js";import{p as A}from"./p-0c667d6a.js";import{B as C}from"./p-ed45b3b6.js";import{s as E}from"./p-3647d61d.js";import"./p-5f377954.js";import"./p-8ade44bf.js";import{F as N}from"./p-1e940ce8.js";import"./p-cc63e827.js";import"./p-0fd6c35b.js";import"./p-bf953152.js";import"./p-8d283666.js";import"./p-
|
|
1
|
+
import{v as t,w as e,o as r,x as a,h as s,y as o,z as n,A as i,D as u,E as d,G as l,H as m,I as c,p,J as f,B as b,K as $}from"./p-b1f65b13.js";import{L as v}from"./p-6e1ab235.js";import{g,c as h}from"./p-c0291e2e.js";import{i as x}from"./p-262ec334.js";import{F as T,b as w,c as j,d as y,e as k,T as O}from"./p-74168615.js";import{p as A}from"./p-0c667d6a.js";import{B as C}from"./p-ed45b3b6.js";import{s as E}from"./p-3647d61d.js";import"./p-5f377954.js";import"./p-8ade44bf.js";import{F as N}from"./p-1e940ce8.js";import"./p-cc63e827.js";import"./p-0fd6c35b.js";import"./p-bf953152.js";import"./p-8d283666.js";import"./p-5c1eedc5.js";class R{format(e){return t(e)?Object.keys(e).map((t=>this.formatToken(e[t],"default"!==t?t:void 0))).join(" "):this.formatToken(e)}}const I={top:"pt",bottom:"pb",left:"pl",right:"pr",x:"px",y:"py"},D=new class extends R{formatToken(t,o){const n=e(o)?`${o}:`:"";return r(t)?`${n}v-p-${t}`:a(t)?Object.keys(t).map((e=>`${n}v-${I[e]}-${t[e]}`)).join(" "):(v.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},F={top:"mt",bottom:"mb",left:"ml",right:"mr",x:"mx",y:"my"},S=new class extends R{formatToken(t,o){const n=e(o)?`${o}:`:"";return r(t)?`${n}v-m-${t}`:a(t)?Object.keys(t).map((e=>`${n}v-${F[e]}-${t[e]}`)).join(" "):(v.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},_={x:"gap-col",y:"gap-row"},B=new class extends R{formatToken(t,o){const n=e(o)?`${o}:`:"";return r(t)?`${n}v-gap-${t}`:a(t)?Object.keys(t).map((e=>`${n}v-${_[e]}-${t[e]}`)).join(" "):(v.warn(`The gap value ${t} is invalid, it must be a value of: `,s),"")}},G=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],H=[1,2,3,4,5,6,7,8,9,10,11,12,"1-auto","2-auto","3-auto","4-auto","5-auto","6-auto","7-auto","8-auto","9-auto","10-auto","11-auto","12-auto"],z=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return o(t)?`${a}v-grid-cols-${t}`:(v.warn(`The column value ${t} is invalid, it must be a value of: `,H),"")}},J=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return n(t)?`${a}v-grid-rows-${t}`:(v.warn(`The row value ${t} is invalid, it must be a value of: `,G),"")}},K=new class{format(e){const r=g();return"number"!=typeof e&&"string"!=typeof e||isNaN(e)?"string"==typeof e&&x(e)?e:t(e)?(e=h(e))[r]:null:Number(e)}},L=new class{format(e){if(i(e))return e;if(t(e)){const t=g();return(e=h(e))[t]}return null}},V=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return"string"==typeof t&&"false"===t||!1===t?`${a}v-hidden`:"string"==typeof t&&"true"===t||!0===t?`${a}v-block`:(v.warn(`The display value ${t} is invalid, it must be a boolean`),"")}},W=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return u(t)?`${a}v-flex-${t}`:(v.warn(`The direction value ${t} is invalid, it must be a value of: `,T),"")}},M=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return d(t)?`${a}v-items-${t}`:(v.warn(`The flex alignItem value ${t} is invalid, it must be a value of: `,w),"")}},P=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return l(t)?`${a}v-justify-${this.mapInput(t)}`:(v.warn(`The flex justifyContent value ${t} is invalid, it must be a value of: `,j),"")}mapInput(t){switch(t){case"start":return"start";case"center":return"center";case"end":return"end";case"space-around":return"around";case"space-between":return"between";case"space-evenly":return"evenly"}}},U=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return m(t)?`${a}v-flex-${t}`:(v.warn(`The flex flexWrap value ${t} is invalid, it must be a value of: `,y),"")}},q=new class{format(e){const r=g();return t(e)?(e=h(e))[r]:e}},Q=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return c(t)?"none"==t?`${a}v-hidden`:`${a}v-${t}`:(v.warn(`The box display value ${t} is invalid, it must be a value of: `,k),"")}},X=new class{format(e){const r=g();return t(e)?(e=h(e),A(e[r])):A(e)}},Y={top:"t",right:"r",bottom:"b",left:"l","top-left":"tl","top-right":"tr","bottom-left":"bl","bottom-right":"br"},Z=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return p(t)?`${a}v-${this.transformRoundedNoneAndFill(t)}`:f(t)?Object.keys(t).map((e=>`${a}v-rounded-${Y[e]}-${this.transformRoundedNoneAndFill(t[e]).replace("rounded-","")}`)).join(" "):(v.warn(`The border radius value ${t} is invalid, it must be a value of: `,b),"")}transformRoundedNoneAndFill(t){return t.replace("rounded-none","rounded-0").replace("rounded-full","rounded-9999")}},tt=new class extends R{formatToken(t,r){const a=e(r)?`${r}:`:"";return $(t)?`${a}v-text-${t}`:(v.warn(`The text align value ${t} is invalid, it must be a value of: `,O),"")}};class et{format(e){return t(e)?Object.keys(e).map((t=>this.generateCssText(this.formatToken(e[t],"default"!==t?t:void 0),t))).join(" "):this.generateCssText(this.formatToken(e))}generateCssText(t,e){let r="";return t&&(r=e&&"default"!==e?`@media (min-width:${C[e]}px){:host{${t}}}`:`:host{${t}}`),r}}const rt={top:["padding-top"],bottom:["padding-bottom"],left:["padding-left"],right:["padding-right"],x:["padding-left","padding-right"],y:["padding-top","padding-bottom"]},at=new class extends et{formatToken(t){return r(t)?`padding:${s[t]}px`:a(t)?Object.keys(t).map((e=>rt[e].map((r=>`${r}:${s[t[e]]}px`)).join(";"))).join(";"):(v.warn(`The padding value ${t} is invalid, it must be a value of: `,s),"")}},st={top:["margin-top"],bottom:["margin-bottom"],left:["margin-left"],right:["margin-right"],x:["margin-left","margin-right"],y:["margin-top","margin-bottom"]},ot=new class extends et{formatToken(t){return r(t)?`margin:${s[t]}px`:a(t)?Object.keys(t).map((e=>st[e].map((r=>`${r}:${s[t[e]]}px`)).join(";"))).join(";"):(v.warn(`The margin value ${t} is invalid, it must be a value of: `,s),"")}},nt={top:["border-top-left-radius","border-top-right-radius"],right:["border-top-right-radius","border-bottom-right-radius"],bottom:["border-bottom-left-radius","border-bottom-right-radius"],left:["border-top-left-radius","border-bottom-left-radius"],"top-left":["border-top-left-radius"],"top-right":["border-top-right-radius"],"bottom-left":["border-bottom-left-radius"],"bottom-right":["border-bottom-right-radius"]},it=new class extends et{formatToken(t){return p(t)?`border-radius:${b[t]}px`:f(t)?this.getDirectionKeys(t).map((e=>nt[e].map((r=>`${r}:${b[t[e]]}px`)).join(";"))).join(";"):(v.warn(`The border radius value ${t} is invalid, it must be a value of: `,b),"")}getDirectionKeys(t){const e=Object.keys(t);return N.isEnabled("VEGA_COMPONENT.CORNERS_USE_OLD_BEHAVIOR")?E(e,(e=>t[e]),void 0,Object.keys(b)):e}},ut=new class{format(t,e){switch(e){case"padding":return D.format(t);case"margin":return S.format(t);case"gap":return B.format(t);case"gridColumn":return z.format(t);case"gridRow":return J.format(t);case"size":return K.format(t);case"translocation":return L.format(t);case"display":return V.format(t);case"flexDirection":return W.format(t);case"flexAlignItem":return M.format(t);case"flexJustifyContent":return P.format(t);case"flexWrap":return U.format(t);case"boxDisplay":return Q.format(t);case"widthAndHeight":return X.format(t);case"corners":return Z.format(t);case"textAlign":return tt.format(t);case"paddingStyle":return at.format(t);case"marginStyle":return ot.format(t);case"cornersStyle":return it.format(t);default:throw new Error(`Invalid flag ${e} passed into ResponsiveFormatFacade`)}}formatCustom(t){return q.format(t)}};export{H as G,ut as R,G as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,d as e}from"./p-bf953152.js";import{i as s}from"./p-b1f65b13.js";const i=new class{constructor(){this.listeners=[],this.listenKeyPress()}register(t){t.map((t=>t.eventName||(t.eventName="keyup"))),this.listeners=this.listeners.concat(t)}deregister(t){this.listeners=this.listeners.filter((e=>!t.includes(e)))}listenKeyPress(){document.addEventListener("keydown",(t=>{this.invokeListeners("keydown",t)})),document.addEventListener("keyup",(t=>{this.invokeListeners("keyup",t)}))}invokeListeners(t,e){this.listeners.filter((s=>s.eventName===t&&this.shouldInvokeListener(s,e))).forEach((t=>t.callback(e)))}shouldInvokeListener(i,o){const n=o.code;let r=[],c=[];const h=Array.isArray(i.keyCode)?i.keyCode.includes(n):i.keyCode===n;"function"==typeof i.activeElementInScope?r=i.activeElementInScope():"object"==typeof i.activeElementInScope&&(r=i.activeElementInScope),"function"==typeof i.activeElementOutScope?c=i.activeElementOutScope():"object"==typeof i.activeElementOutScope&&(c=i.activeElementOutScope);const p=!i.activeElementInScope||r.some((s=>t(e(),s))),f=!i.activeElementOutScope||c.every((s=>!t(e(),s))),u=!s(i.modifierPressed)||i.modifierPressed===this.isModifierPressed(o),y=!s(i.shiftKey)||i.shiftKey===o.shiftKey;return h&&p&&f&&u&&y}isModifierPressed(t){return/Mac|iPhone|iPad/.test(navigator.userAgent)?t.metaKey:t.ctrlKey}};export{i as K}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,f as e,r as s,H as o,g as i}from"./p-1c298d5a.js";import{s as r}from"./p-9b797118.js";import{c as p,V as
|
|
1
|
+
import{h as t,f as e,r as s,H as o,g as i}from"./p-1c298d5a.js";import{s as r}from"./p-9b797118.js";import{c as p,V as c,M as n,L as a,I as l}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4387d550.js";import{V as d}from"./p-c9b9322b.js";import{V as j}from"./p-cc63e827.js";import{f as h}from"./p-75c68f51.js";import{h as b}from"./p-5773a9a3.js";import{O as u}from"./p-331a62d5.js";import{C as v}from"./p-2d0d575f.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-50e80afa.js";import"./p-c0291e2e.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-3647d61d.js";import"./p-5f377954.js";import"./p-8ade44bf.js";import"./p-bf953152.js";import"./p-50677c8e.js";import"./p-112455b1.js";import"./p-804f71b3.js";import"./p-6f81fe1e.js";import"./p-1e940ce8.js";import"./p-7a40e033.js";import"./p-0fd6c35b.js";import"./p-8d283666.js";import"./p-5c1eedc5.js";import"./p-c754b32c.js";import"./p-2205ee4c.js";var g=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};class y extends c{render(){const e=d.getIconKey(this.country),s=j.hasIcon(e),o=h(this.size,"widthAndHeight"),i=`calc(${o} * 4 / 3)`;return s?t("vega-icon",{icon:e,size:this.size,style:{width:i}}):t("vega-skeleton",{type:"image",corners:"rounded-2",height:o,width:i})}}g([p()],y.prototype,"size",void 0),g([p()],y.prototype,"country",void 0);var R=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};class O extends c{constructor(){super(...arguments),this.isAcceptObserver=()=>!0,this.listenerCallback=()=>{e(this.host)}}componentWillLoad(){this.country&&(this.isFlagForCountryCodeLoaded(this.country)||this.registerObserver())}unRegisterObserver(){this.observer&&(v.unregister(b,this.observer),this.observer=null)}registerObserver(){this.observer=new u(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),v.register(b,this.observer)}isFlagForCountryCodeLoaded(t){const e=d.getIconKey(t);return d.hasIcon(e)}}!async function(){try{const t=(await import("./p-1e926324.js")).CountryFlags;d.register(t),v.notify(b,{})}catch(t){a.error("Error loading flag module:",t)}}(),R([p()],O.prototype,"host",void 0),R([p()],O.prototype,"country",void 0),R([n("componentWillLoad")],O.prototype,"componentWillLoad",null),R([n("disconnectedCallback")],O.prototype,"unRegisterObserver",null);var w=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};const C=class{constructor(t){s(this,t),this.globalSlimmers={},this.renderer=new y,this.vegaFlagIconController=new O,this.vegaComponentUsageRuntimeMetricsSlimmer=new m,this.size="size-16"}render(){return r(t(o,null,this.renderer.render()),this.host)}get host(){return i(this)}};w([f()],C.prototype,"globalSlimmers",void 0),w([l()],C.prototype,"renderer",void 0),w([l()],C.prototype,"vegaFlagIconController",void 0),w([l()],C.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),C.style=":host{display:inline-block}:host vega-icon,:host vega-skeleton,:host svg{display:block}";export{C as vega_flag_icon}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,F as t,r,c as o,H as i,g as a}from"./p-1c298d5a.js";import{s as l}from"./p-9b797118.js";import{c as s,V as n,M as c,I as d}from"./p-6e1ab235.js";import{V as v,I as h}from"./p-4387d550.js";import{V as p}from"./p-c9b9322b.js";import{D as f}from"./p-6e898779.js";import{a as g,f as u,s as b,t as m,u as x,v as w}from"./p-6f81fe1e.js";import{g as C}from"./p-37b05e0b.js";import{c as y}from"./p-86194314.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-a821bcf3.js";import{C as R}from"./p-2d0d575f.js";import{b as L}from"./p-5773a9a3.js";import{F as k}from"./p-f0bc8f6d.js";import{F as z}from"./p-0bb860cc.js";import{T as E}from"./p-1503f791.js";import"./p-cc63e827.js";import"./p-331a62d5.js";import"./p-bf953152.js";import"./p-6a334573.js";import"./p-804f71b3.js";import"./p-0bb29d98.js";import"./p-12d60f5f.js";import"./p-8d283666.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-987fbbd0.js";import"./p-b5f5a5e0.js";import"./p-3647d61d.js";import"./p-262ec334.js";import"./p-d7642125.js";import"./p-280cbcdb.js";var M=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class V extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}M([s()],V.prototype,"required",void 0),M([s()],V.prototype,"disabled",void 0),M([s()],V.prototype,"label",void 0),M([s()],V.prototype,"hint",void 0),M([s()],V.prototype,"vegaFileUploaderContainerRenderer",void 0),M([s()],V.prototype,"vegaFileUploaderFileListRenderer",void 0);var I=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const r=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(r))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:p.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:p.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const r=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,r)}return e}}p.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),I([s()],O.prototype,"variant",void 0),I([s()],O.prototype,"accept",void 0),I([s()],O.prototype,"disabled",void 0),I([s()],O.prototype,"value",void 0),I([s()],O.prototype,"selectFileChangeEventEmitter",void 0),I([s()],O.prototype,"vegaFileUploaderValueController",void 0),I([s()],O.prototype,"dropFileFilterController",void 0),I([s()],O.prototype,"translationSlimmer",void 0),I([s()],O.prototype,"fileLimitController",void 0),I([s()],O.prototype,"maxCount",void 0);var U=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class A extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:p.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:p.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}p.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),U([s()],A.prototype,"value",void 0),U([s()],A.prototype,"disabled",void 0),U([s()],A.prototype,"vegaFileUploaderFileStatusRenderer",void 0),U([s()],A.prototype,"removeEventEmitter",void 0),U([s()],A.prototype,"vegaFileUploaderValueController",void 0),U([s()],A.prototype,"retryEventEmitter",void 0),U([s()],A.prototype,"previewEventEmitter",void 0);class D extends n{render(t,r){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:r?"determinate":"indeterminate",size:"micro"},r?{percent:r}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:p.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:p.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}p.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var S=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class B extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}S([s()],B.prototype,"host",void 0),S([s({writable:!0})],B.prototype,"value",void 0),S([s()],B.prototype,"changeEventEmitter",void 0),S([c("watchValue")],B.prototype,"valueChangeHandler",null);class H extends n{process(e){const t=Array.from(e||[]);if(e&&this.accept&&"*"!==this.accept&&"/*"!==this.accept){const e=this.accept.split(",");return t.filter((t=>this.validateFileType(t,e)))}return t}validateFileType(e,t){const r=e.name,o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return t.some((e=>(e=e.trim().toLowerCase()).startsWith(".")?r.toLowerCase().endsWith(e):e.endsWith("/*")?i===e.replace(/\/.*$/,""):o===e))}}!function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);a>3&&l&&Object.defineProperty(t,r,l)}([s()],H.prototype,"accept",void 0);var N=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([c("componentDidLoad"),c("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};const G=class{constructor(e){r(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaSelectedFileChange=o(this,"vegaSelectedFileChange",7),this.selectedFileChange=o(this,"selectedFileChange",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.vegaRetry=o(this,"vegaRetry",7),this.retry=o(this,"retry",7),this.vegaPreview=o(this,"vegaPreview",7),this.preview=o(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new V,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new A,this.vegaFileUploaderFileStatusRenderer=new D,this.vegaFileUploaderValueController=new B,this.dropFileFilterController=new H,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([h()],G.prototype,"globalSlimmers",void 0),q([d()],G.prototype,"translationSlimmer",void 0),q([d()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([d()],G.prototype,"formFieldController",void 0),q([d()],G.prototype,"vegaFileUploaderRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderValueController",void 0),q([d()],G.prototype,"dropFileFilterController",void 0),q([d()],G.prototype,"fileLimitController",void 0),q([d()],G.prototype,"changeEventEmitter",void 0),q([d()],G.prototype,"selectFileChangeEventEmitter",void 0),q([d()],G.prototype,"removeEventEmitter",void 0),q([d()],G.prototype,"retryEventEmitter",void 0),q([d()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
|
|
1
|
+
import{h as e,F as t,r,c as o,H as i,g as a}from"./p-1c298d5a.js";import{s as l}from"./p-9b797118.js";import{c as s,V as n,M as c,I as d}from"./p-6e1ab235.js";import{V as v,I as h}from"./p-4387d550.js";import{V as p}from"./p-c9b9322b.js";import{D as f}from"./p-6e898779.js";import{a as g,f as u,s as b,t as m,u as x,v as w}from"./p-6f81fe1e.js";import{g as C}from"./p-37b05e0b.js";import{c as y}from"./p-86194314.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-a821bcf3.js";import{C as R}from"./p-2d0d575f.js";import{b as L}from"./p-5773a9a3.js";import{F as k}from"./p-7f6702f7.js";import{F as z}from"./p-0bb860cc.js";import{T as E}from"./p-1503f791.js";import"./p-cc63e827.js";import"./p-331a62d5.js";import"./p-bf953152.js";import"./p-6a334573.js";import"./p-804f71b3.js";import"./p-0bb29d98.js";import"./p-c754b32c.js";import"./p-8d283666.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-987fbbd0.js";import"./p-b5f5a5e0.js";import"./p-3647d61d.js";import"./p-262ec334.js";import"./p-72ecfd40.js";import"./p-280cbcdb.js";var M=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class V extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}M([s()],V.prototype,"required",void 0),M([s()],V.prototype,"disabled",void 0),M([s()],V.prototype,"label",void 0),M([s()],V.prototype,"hint",void 0),M([s()],V.prototype,"vegaFileUploaderContainerRenderer",void 0),M([s()],V.prototype,"vegaFileUploaderFileListRenderer",void 0);var I=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const r=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(r))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:p.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:p.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const r=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,r)}return e}}p.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),I([s()],O.prototype,"variant",void 0),I([s()],O.prototype,"accept",void 0),I([s()],O.prototype,"disabled",void 0),I([s()],O.prototype,"value",void 0),I([s()],O.prototype,"selectFileChangeEventEmitter",void 0),I([s()],O.prototype,"vegaFileUploaderValueController",void 0),I([s()],O.prototype,"dropFileFilterController",void 0),I([s()],O.prototype,"translationSlimmer",void 0),I([s()],O.prototype,"fileLimitController",void 0),I([s()],O.prototype,"maxCount",void 0);var U=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class A extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:p.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:p.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}p.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),U([s()],A.prototype,"value",void 0),U([s()],A.prototype,"disabled",void 0),U([s()],A.prototype,"vegaFileUploaderFileStatusRenderer",void 0),U([s()],A.prototype,"removeEventEmitter",void 0),U([s()],A.prototype,"vegaFileUploaderValueController",void 0),U([s()],A.prototype,"retryEventEmitter",void 0),U([s()],A.prototype,"previewEventEmitter",void 0);class D extends n{render(t,r){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:r?"determinate":"indeterminate",size:"micro"},r?{percent:r}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:p.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:p.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}p.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var S=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class B extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}S([s()],B.prototype,"host",void 0),S([s({writable:!0})],B.prototype,"value",void 0),S([s()],B.prototype,"changeEventEmitter",void 0),S([c("watchValue")],B.prototype,"valueChangeHandler",null);class H extends n{process(e){const t=Array.from(e||[]);if(e&&this.accept&&"*"!==this.accept&&"/*"!==this.accept){const e=this.accept.split(",");return t.filter((t=>this.validateFileType(t,e)))}return t}validateFileType(e,t){const r=e.name,o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return t.some((e=>(e=e.trim().toLowerCase()).startsWith(".")?r.toLowerCase().endsWith(e):e.endsWith("/*")?i===e.replace(/\/.*$/,""):o===e))}}!function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);a>3&&l&&Object.defineProperty(t,r,l)}([s()],H.prototype,"accept",void 0);var N=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([c("componentDidLoad"),c("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,r,o){var i,a=arguments.length,l=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,r,l):i(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l};const G=class{constructor(e){r(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaSelectedFileChange=o(this,"vegaSelectedFileChange",7),this.selectedFileChange=o(this,"selectedFileChange",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.vegaRetry=o(this,"vegaRetry",7),this.retry=o(this,"retry",7),this.vegaPreview=o(this,"vegaPreview",7),this.preview=o(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new V,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new A,this.vegaFileUploaderFileStatusRenderer=new D,this.vegaFileUploaderValueController=new B,this.dropFileFilterController=new H,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([h()],G.prototype,"globalSlimmers",void 0),q([d()],G.prototype,"translationSlimmer",void 0),q([d()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([d()],G.prototype,"formFieldController",void 0),q([d()],G.prototype,"vegaFileUploaderRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderValueController",void 0),q([d()],G.prototype,"dropFileFilterController",void 0),q([d()],G.prototype,"fileLimitController",void 0),q([d()],G.prototype,"changeEventEmitter",void 0),q([d()],G.prototype,"selectFileChangeEventEmitter",void 0),q([d()],G.prototype,"removeEventEmitter",void 0),q([d()],G.prototype,"retryEventEmitter",void 0),q([d()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as h,g as s}from"./p-1c298d5a.js";import{F as l}from"./p-1e940ce8.js";import{V as r,M as a,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-280cbcdb.js";import{V as d}from"./p-6f90d444.js";import{s as n}from"./p-9b797118.js";import{I as v}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4387d550.js";import{F as u}from"./p-f0bc8f6d.js";import{b as g}from"./p-5773a9a3.js";import{C as _}from"./p-2d0d575f.js";import{c as A}from"./p-a821bcf3.js";import{C as M}from"./p-431ab4dd.js";import{D as E}from"./p-6e898779.js";import{f as w,B as Z,A as b}from"./p-6f81fe1e.js";import{V as j}from"./p-c9b9322b.js";import{h as I}from"./p-12d60f5f.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-bf953152.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-8d283666.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-b5f5a5e0.js";import"./p-3647d61d.js";import"./p-d7642125.js";import"./p-804f71b3.js";import"./p-5f377954.js";import"./p-cc63e827.js";const D=[{type:"visa",iconName:"visa",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var y=function(t,i,e,h){var s,l=arguments.length,r=l<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,e,h);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(l<3?s(r):l>3?s(i,e,r):s(i,e))||r);return l>3&&r&&Object.defineProperty(i,e,r),r};const N=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(N,w),this.blurEventEmitter=A(N,Z),this.focusEventEmitter=A(N,b),this.inputCreditCardEventPrevent=new M([w,b,Z],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:j.getIconKey(i),maskConfig:this.getMaskConfig(this.value),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,E.addUniqueObserverToNode(t,w,(t=>{this.handleVegaChange(t)})),E.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaBlur()})),E.addUniqueObserverToNode(t,b,(()=>{this.handleVegaFocus()})),E.addUniqueObserverToNode(t,I,(t=>{const i=t.clipboardData.getData("text");this.inputRef.maskConfig=this.getMaskConfig(i)}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(t){const i=[],e=this.getCreditCardType(t);return e&&(i.push(e.maskConfig),this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),i.push(this.maskConfig))),i}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};j.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),y([f()],N.prototype,"globalSlimmers",void 0),y([v()],N.prototype,"formFieldController",void 0),y([v()],N.prototype,"changeEventEmitter",void 0),y([v()],N.prototype,"blurEventEmitter",void 0),y([v()],N.prototype,"focusEventEmitter",void 0),y([v()],N.prototype,"inputCreditCardEventPrevent",void 0),y([v()],N.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),N.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{N as vega_input_credit_card}
|
|
1
|
+
import{r as t,c as i,h as e,H as h,g as s}from"./p-1c298d5a.js";import{F as l}from"./p-1e940ce8.js";import{V as r,M as a,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-280cbcdb.js";import{V as d}from"./p-6f90d444.js";import{s as n}from"./p-9b797118.js";import{I as v}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4387d550.js";import{F as u}from"./p-7f6702f7.js";import{b as g}from"./p-5773a9a3.js";import{C as _}from"./p-2d0d575f.js";import{c as A}from"./p-a821bcf3.js";import{C as M}from"./p-431ab4dd.js";import{D as E}from"./p-6e898779.js";import{f as w,B as Z,A as b}from"./p-6f81fe1e.js";import{V as j}from"./p-c9b9322b.js";import{h as I}from"./p-c754b32c.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-bf953152.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-8d283666.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-b5f5a5e0.js";import"./p-3647d61d.js";import"./p-72ecfd40.js";import"./p-804f71b3.js";import"./p-5f377954.js";import"./p-cc63e827.js";const D=[{type:"visa",iconName:"visa",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var y=function(t,i,e,h){var s,l=arguments.length,r=l<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,e,h);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(l<3?s(r):l>3?s(i,e,r):s(i,e))||r);return l>3&&r&&Object.defineProperty(i,e,r),r};const N=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(N,w),this.blurEventEmitter=A(N,Z),this.focusEventEmitter=A(N,b),this.inputCreditCardEventPrevent=new M([w,b,Z],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:j.getIconKey(i),maskConfig:this.getMaskConfig(this.value),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,E.addUniqueObserverToNode(t,w,(t=>{this.handleVegaChange(t)})),E.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaBlur()})),E.addUniqueObserverToNode(t,b,(()=>{this.handleVegaFocus()})),E.addUniqueObserverToNode(t,I,(t=>{const i=t.clipboardData.getData("text");this.inputRef.maskConfig=this.getMaskConfig(i)}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(t){const i=[],e=this.getCreditCardType(t);return e&&(i.push(e.maskConfig),this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),i.push(this.maskConfig))),i}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};j.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),y([f()],N.prototype,"globalSlimmers",void 0),y([v()],N.prototype,"formFieldController",void 0),y([v()],N.prototype,"changeEventEmitter",void 0),y([v()],N.prototype,"blurEventEmitter",void 0),y([v()],N.prototype,"focusEventEmitter",void 0),y([v()],N.prototype,"inputCreditCardEventPrevent",void 0),y([v()],N.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),N.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{N as vega_input_credit_card}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-6f81fe1e.js";import{a as n,b as s}from"./p-c754b32c.js";import{L as i}from"./p-6e1ab235.js";import{i as r}from"./p-b1f65b13.js";import{g as o}from"./p-37b05e0b.js";import{V as c}from"./p-50677c8e.js";var a,h;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(a||(a={}));class l{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT"}(h||(h={}));class u extends l{}const d=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap}register(t,e){this.domToEntity.set(t,e),this.entityToDOM.set(e,t)}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}};var w,p,f;!function(t){t.DELETE_CHILD="DELETE_CHILD",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILD_NODES="APPEND_CHILD_NODES",t.INSERT_BLOCKS_AFTER="INSERT_BLOCKS_AFTER",t.INSERT_BLOCKS_BEFORE="INSERT_BLOCKS_BEFORE",t.INSERT_NODES_AFTER="INSERT_NODES_AFTER",t.INSERT_NODES_BEFORE="INSERT_NODES_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.BREAK_SINGLE_BLOCK="BREAK_SINGLE_BLOCK",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL"}(w||(w={}));class x{constructor(){this.isFlushable=!1}}class A extends u{constructor(t){super(),this.type=h.ALIGNMENT,this.textAlign=t}static from(t){return[h.ALIGNMENT,new A(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}clone(){return new A(this.textAlign)}render(){return null}}class N extends u{constructor(t){super(),this.type=h.INDENT,this.indent=Math.max(0,t)}static from(t){return[h.INDENT,new N(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new N(this.indent)}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class g{static register(t,e,n){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,n)}static get(t,e){const n=this.registry.get(e);if(n)return n.get(t)}static executeTheStrategy(t,e){const n=t instanceof x?t.type:t.constructor.name,s=g.get(n,e.constructor.name);if(s)return s.execute(t,e);i.error(`Type ${n} action handle strategy is not registered in class ${e.constructor.name}`)}}g.registry=new Map;class E{constructor(t){this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,e){switch(t){case"textAlign":return A.from(e);case"indent":return N.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof u)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(s){if(this.doApply(s),s.isFlushable){const s=d.getDOMByEntity(this);if(s){const i=e.getSubjectFromParentNodeByEventId(s,n);i&&t.notify(i,{})}}}doApply(t){t instanceof x?g.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE"}(p||(p={}));class O{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}doApply(t){t instanceof x?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const s=d.getDOMByEntity(this);if(s){const i=e.getSubjectFromParentNodeByEventId(s,n);i&&t.notify(i,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK"}(f||(f={}));class m extends l{}class y extends m{constructor(t="md",e){super(),this.type=f.IMAGE,this.size=t,this.alt=e}static from(t,e){return[f.IMAGE,new y(t,e)]}toJSON(){return r(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new y(this.size,this.alt)}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class S{execute(t,e){return i.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}isCaretPositionAtTextBlockEnd(t,e,n){const s=t.nodes[t.nodes.length-1];return e===s&&(e.isEmpty()||n===s.text.length)}isCaretPositionAtTextBlockStart(t,e,n){return e===t.nodes[0]&&0===n}isCaretPositionAtImageBlockStart(t,e,n){return e===t.nodes[0]&&0===n}isCaretPositionAtImageBlockEnd(t,e,n){return e===t.nodes[t.nodes.length-1]&&1===n}}class T{}class B extends O{constructor(t,e,n,s){super(t,s),this.type=p.IMAGE,this.url=e,this.parentBlock=n}static from(t,e){const n=new B(t.id,t.url,e);let s;return s=t.annotations&&0!==Object.keys(t.annotations).length?t.annotations:{size:"md"},n.annotationMap=new Map(Object.keys(s).map((()=>y.from(s.size,s.alt))).filter(r)),n}toJSON(){const t=this.annotationMap.get(f.IMAGE),e={};return(null==t?void 0:t.size)&&(e.size=t.size),(null==t?void 0:t.alt)&&(e.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new B(this.id,this.url,this.parentBlock,super.cloneAnnotations())}doAnnotationActionApply(t){const e=g.get(T.name,B.name);e&&e.execute(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(w.UPDATE_IMAGE_NODE_URL,B.name,new class extends S{handleAction(t,e){e.url=t.url}}),g.register(T.name,B.name,new class extends S{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class L extends x{constructor(t){super(),this.type=w.DELETE_CHILD,this.entityToBeRemoved=t}}class b extends S{getPreviousNode(t){const e=t.parentBlock,n=e.nodes.indexOf(t);if(n>0)return e.nodes[n-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parentBlock,n=e.nodes.indexOf(t);if(e.nodes[n+1])return e.nodes[n+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parentBlock,n=e.nodes.indexOf(t),s=e.parent;if("list-item"===e.type){const t=s.parent;return 0===n&&Array.isArray(s.blocks)&&s.blocks[0]===e&&"list-item"!==t.type&&Array.isArray(t.blocks)&&t.blocks[0]===s}return 0===n&&Array.isArray(s.blocks)&&s.blocks[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(e>0)return t.parent.blocks[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){if("list-item"===t.type)return t.children&&t.children.length>0?this.getBlockLastNode(t.children[t.children.length-1]):t.nodes[t.nodes.length-1];if("number-list"===t.type||"bullet-list"===t.type){const e=t.blocks;if(e)return this.getBlockLastNode(e[e.length-1])}else if(t.nodes)return t.nodes[t.nodes.length-1]}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.blocks)return this.getBlockFirstNode(t.blocks[0])}else if(t.nodes)return t.nodes[0]}getNextBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(t.parent.blocks[e+1])return t.parent.blocks[e+1];if("list-item"===t.type&&t.parent.blocks.length===e+1)return this.getNextBlock(t.parent)}}}class k extends x{constructor(t){super(),this.type=w.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class C extends S{handleAction(t,e){const n=t.blockNeedToBeMerged;if(e.type===n.type||"image"!==e.type&&"image"!==n.type){let t=n.nodes;"image"!==n.type&&(t=n.nodes.filter((t=>t.text))),e.apply(new k(t)),n.parent.apply(new L(n))}}}class I extends S{handleAction(t,e){e.nodes=e.nodes.filter((e=>e!==t.entityToBeRemoved)),0===e.nodes.length&&e.parent&&e.parent.apply(new L(e))}}class _ extends S{handleAction(t,e){const n=t.entityToBeAppended;n.forEach((t=>{t.parentBlock=e})),e.nodes=e.nodes.concat(n)}}class j extends S{handleAction(t,e){e.nodes=[],e.apply(new k(t.newChildNodes))}}class R extends x{constructor(t,...e){super(),this.type=w.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=e}}class M extends x{constructor(t){super(),this.type=w.REPLACE_CHILD_NODES,this.newChildNodes=t}}class D extends x{constructor(t,...e){super(),this.type=w.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=e}}class v extends x{constructor(t,e){super(),this.type=w.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class F extends T{constructor(){super(...arguments),this.doSplit=!0}}class J extends l{constructor(t){super(),this.type=a.SELECTION_RANGE,this.range=t}clone(){return new J(this.range)}}class P extends m{constructor(t){super(),this.type=f.STRIKETHROUGH,this.strikethrough=t}static from(t){return[f.STRIKETHROUGH,new P(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new P(this.strikethrough)}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class K extends m{constructor(t){super(),this.type=f.UNDERLINE,this.underline=t}static from(t){return[f.UNDERLINE,new K(t)]}toJSON(){return{underline:this.underline}}clone(){return new K(this.underline)}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class W extends m{constructor(t){super(),this.type=f.ITALIC,this.italic=t}static from(t){return[f.ITALIC,new W(t)]}toJSON(){return{italic:this.italic}}clone(){return new W(this.italic)}render(){return this.italic?{"font-style":"italic"}:null}}class G extends m{constructor(t){super(),this.type=f.BOLD,this.bold=t}static from(t){return[f.BOLD,new G(t)]}toJSON(){return{bold:this.bold}}clone(){return new G(this.bold)}render(){return this.bold?{"font-weight":"700"}:null}}class H extends m{constructor(t){super(),this.type=f.CODE,this.code=t}static from(t){return[f.CODE,new H(t)]}toJSON(){return{code:this.code}}clone(){return new H(this.code)}renderClass(){return this.code?"v-rte--code":null}render(){return null}}const z=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="";class $ extends m{constructor(t){super(),this.type=f.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[f.TEXT_COLOR,new $(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new $(this.textColor.key)}renderClass(){return null}render(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return z.find((e=>e.key===t))||z[0]}}class X extends m{constructor(t){super(),this.type=f.LINK,this.link=t}static from(t){return[f.LINK,new X({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}clone(){return new X(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class V extends l{constructor(t){super(),this.type=a.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new V("");return this.linkGroups.forEach(((e,n)=>{t.linkGroups.set(n,e.map((t=>t.clone())))})),t}}class q extends T{constructor(t,e){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e}toAnnotation(){return new V(this.groupKey)}}class Y extends T{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class Z extends x{constructor(t){super(),this.type=w.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Q extends l{constructor(){super(...arguments),this.type=a.CLEAR_FORMATTING,this.items=[f.BOLD,f.ITALIC,f.UNDERLINE,f.STRIKETHROUGH,f.TEXT_COLOR,f.CODE]}}class tt extends F{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Q}}class et extends F{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new H(this.code)}}class nt extends T{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class st extends F{constructor({link:t,newText:e,needMergeNode:n,doSplit:s}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=n,this.newText=e,r(s)&&(this.doSplit=s)}toAnnotation(){return new X(this.link)}}class it extends O{constructor(t,e,n,s){super(t,s),this.type=p.TEXT,this.parentBlock=n,this.text=e}static from(t,e){const n=new it(t.id,t.text,e),{annotations:s}=t;return s&&(n.annotationMap=new Map(Object.keys(s).map((t=>(s.link&&e.apply(new q(s.link.groupKey,[n])),this.createAnnotationEntity(t,s[t])))).filter(r))),n}static createAnnotationEntity(t,e){switch(t){case"bold":return G.from(e);case"italic":return W.from(e);case"underline":return K.from(e);case"strikethrough":return P.from(e);case"code":return H.from(e);case"textColor":return $.from(e);case"link":return X.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof m)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new it(o(),t,this.parentBlock,super.cloneAnnotations())}clone(){return new it(this.id,this.text,this.parentBlock,super.cloneAnnotations())}isEmpty(){return!this.text||""===this.text||"\n"===this.text}doAnnotationActionApply(t){const e=this.getAnnotationByType(a.SELECTION_RANGE);if(t instanceof F&&t.doSplit&&e){const e=g.get(F.name,it.name);if(e){const n=e.execute(t,this);n&&this.applyActionToNode(n,t)}}else this.applyActionToNode(this,t);this.parentBlock.mergeNodes(t)}doModifyActionApply(t){g.executeTheStrategy(t,this)}applyActionToNode(t,e){const n=e.toAnnotation();if(e instanceof Y)return void this.syncUpSelectedNodes(t);n instanceof J||this.syncUpSelectedNodes(t);const s=g.get(T.name,it.name);s&&s.execute(e,t)}syncUpSelectedNodes(n){const i=d.getDOMByEntity(this);if(i){const r=e.getSubjectFromParentNodeByEventId(i,s);r&&t.notify(r,{node:n})}}}g.register(w.UPDATE_TEXT,it.name,new class extends S{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.annotationMap.delete(f.LINK)}}),g.register(w.REPLACE_SELECTED_TEXT,it.name,new class extends S{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,n){if(e&&e.startContainer&&e.endContainer){const{startContainer:s,endContainer:i,startOffset:r,endOffset:o}=e;let c=n.text;if(s===i&&r===o&&t)c=n.text.slice(0,r)+t+n.text.slice(r);else{const e=s.parentElement,a=i.parentElement,h=e&&d.getEntityByDOM(e),l=a&&d.getEntityByDOM(a);let u=0,w=n.text.length;h&&h===n?(u=r,w=s===i?o:w):l&&l===n&&(w=o),c=n.text.slice(0,u)+t+n.text.slice(w)}n.apply(new Z(c))}}}),g.register(F.name,it.name,new class extends S{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const n=e.getAnnotationByType(a.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof F&&t.doSplit&&n){const{startContainer:t,endContainer:s,startOffset:i,endOffset:r}=n.range,o=t===s&&i===r;e.parentBlock.nodes=e.parentBlock.nodes.flatMap((t=>t.id===e.id?o?this.insertNewNode(i,e):this.shouldSplitSelection(n.range)?this.splitTextNode(n.range,e):(this.setApplyTargetNode(e),e):t))}return this.applyTargetNode}insertNewNode(t,e){const n=e.cloneWithText("");return this.setApplyTargetNode(n),0===t?[n,e]:t===e.text.length?[e,n]:[e.cloneWithText(e.text.substring(0,t)),n,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:n,startOffset:s,endOffset:i}=t;return e!==n||s>0||i<(n.textContent?n.textContent.length:0)}splitTextNode(t,e){const{startContainer:n,endContainer:s,startOffset:i}=t,r=n.parentElement,o=s.parentElement,c=(t,n,s)=>{const i=t.substring(0,n),r=t.substring(n,s),o=t.substring(s);return[e.cloneWithText(i),e.cloneWithText(r),e.cloneWithText(o)]},a=r&&d.getEntityByDOM(r),h=o&&d.getEntityByDOM(o);if(a&&a.id===e.id){const r=n===s?t.endOffset:e.text.length,[o,a,h]=c(e.text,i,r);return this.setApplyTargetNode(a),[o,a,h].filter((t=>!!t.text))}if(h&&h.id===e.id){const[n,s,i]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(s),[n,s,i].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}),g.register(T.name,it.name,new class extends S{handleAction(t,e){const n=t.toAnnotation();if(t instanceof nt)e.annotationMap.delete(t.annotationType);else{if(!(n instanceof Q))return n instanceof m||n instanceof J?(t instanceof st&&(r(t.newText)&&(e.text=t.newText),e.parentBlock.apply(new q(t.link.groupKey,[e]))),t instanceof et&&this.handleAction(new tt,e),void e.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}});class rt extends u{constructor(t){super(),this.type=h.TEXT_STYLE,this.textStyle=t}static from(t){return[h.TEXT_STYLE,new rt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new rt(this.textStyle)}render(){const t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};switch(this.textStyle){case"paragraph":return t;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500"}}}}class ot extends T{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new rt(this.textStyle)}}class ct extends F{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new G(this.bold)}}class at extends S{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,n){if(t){const s=t.text.slice(0,e),i=t.text.slice(e),r=n.nodes.indexOf(t);if(r>-1){const e=n.nodes.slice(0,r),o=n.nodes.slice(r+1);s&&e.push(t.cloneWithText(s)),i&&o.unshift(t.cloneWithText(i)),n.apply(new M(e));const c=n.cloneWithNodes(o);return n.parent.apply(new R(n,c)),c}}}}class ht extends S{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,n){if(t){const s=new it(o(),"\n",n),i=t.text.slice(0,e),r=t.text.slice(e),c=n.nodes.indexOf(t);if(c>-1){const e=n.nodes.slice(0,c),o=n.nodes.slice(c+1);i&&e.push(t.cloneWithText(i)),r&&o.unshift(t.cloneWithText(r)),this.mergeLineBreakNodes(e,s,o,n)}return s}}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new it(o(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new M([...t,e,...n]))}}class lt extends S{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=e.nodes,s=new it(o(),"\n",e),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(n,s,i,e),s}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.nodes),t.parent.apply(new L(t)))})),e}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new it(o(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new M([...t,e,...n]))}}class ut extends x{constructor(t){super(),this.type=w.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends b{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const i=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new Z(i)),i)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parentBlock===e&&"\n"===s.text||1===e.nodes.length?void(t.previousNode=n):(e.apply(new L(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),i=null;if(e.nodes.length&&s&&s.parentBlock!==e)n.isEmpty()&&e.apply(new L(n)),s.parentBlock.apply(new ut(e));else if(this.isContentFirstNode(n)&&n.isEmpty()&&(i=this.getNextNode(n)),n.isEmpty()&&e.apply(new L(n)),s instanceof it&&s.isEmpty()){const t=s;s=this.getPreviousNode(s),t.parentBlock.apply(new L(t)),s||(i=n)}0===e.nodes.length&&e.parent.apply(new L(e)),s?t.previousNode=s:i&&(t.nextNode=i)}}}class wt extends S{replaceNodeWithNodes(t,e,n){t.nodes&&(n.forEach((e=>{e.parentBlock=t})),t.nodes=t.nodes.flatMap((t=>t===e?n:t)))}}class pt extends wt{handleAction(t,e){const n=t.referNode,s=[...t.nodesToBeInserted,n];this.replaceNodeWithNodes(e,n,s)}}class ft extends E{constructor(t,e){super(t),this.nodes=[],this.type=e,this.annotationMap=ft.isAcceptableTextStyle(e)?new Map([rt.from(e)]):new Map([rt.from("paragraph")])}static from(t){const e=new ft(t.id,t.type),{annotations:n}=t;return e.nodes=t.nodes.map((t=>it.from(t,e))),n&&Object.entries(n).forEach((([t,n])=>{const s=this.createAnnotationEntity(t,n);r(s)&&e.annotationMap.set(...s)})),e}static createAnnotationEntity(t,e){return"textStyle"===t?rt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3"].includes(t)}mergeNodes(t){this.nodes=this.nodes.reduce(((e,n)=>{const s=e.at(-1);if(t instanceof st&&t.needMergeNode){const t=null==s?void 0:s.getAnnotationByType(f.LINK),i=n.getAnnotationByType(f.LINK);if(t&&i&&t.toEqual(i))return e}return[...e,n]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.nodes.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new ft(o(),this.type);return e.nodes=[],e.apply(new k(t)),e}clone(){const t=new ft(this.id,this.type);return t.nodes=this.nodes.map((e=>{const n=e.clone();return n.parentBlock=t,n})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((t=>!t.isEmpty()))}getLastNode(){return this.nodes[this.nodes.length-1]}createNewParagraph(){return new ft(o(),"paragraph")}doAnnotationActionApply(t){const e=g.get(t.constructor.name,ft.name);e&&e.execute(t,this)}}g.register(ot.name,ft.name,new class extends S{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.nodes.forEach(t.bold?t=>{const e=new ct(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new nt(f.BOLD))})}}),g.register(q.name,ft.name,new class extends S{handleAction(t,e){const n=e.getAnnotationByType(a.LINK_GROUP);if(n){const s=n.linkGroups.get(t.groupKey);n.linkGroups.set(t.groupKey,[...s,...t.nodes]),e.annotationMap.set(a.LINK_GROUP,n)}}}),g.register(w.DELETE_CHILD,ft.name,new I),g.register(w.APPEND_CHILD_NODES,ft.name,new _),g.register(w.SPLIT_BLOCK_WITH_NODE,ft.name,new at),g.register(w.REPLACE_CHILD_NODES,ft.name,new j),g.register(w.MERGE_TWO_BLOCKS_NODES,ft.name,new C),g.register(w.BREAK_SINGLE_BLOCK,ft.name,new class extends S{handleAction(t,e){t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset,e)}breakSingleTextBlock(t,e,n){const s=this.copyInlineStyleToNewParagraph(t,n);if(this.isCaretPositionAtTextBlockEnd(n,t,e))n.parent.apply(new R(n,s));else{if(!this.isCaretPositionAtTextBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}n.parent.apply(new D(n,s))}return s}copyInlineStyleToNewParagraph(t,e){const n=t.cloneWithText("");n.annotationMap.delete(f.LINK);const s=e.createNewParagraph();return s.apply(new k([n])),s}}),g.register(w.LINE_BREAK_SINGLE_BLOCK,ft.name,new ht),g.register(w.LINE_BREAK_MULTIPLE_BLOCKS,ft.name,new lt),g.register(w.DELETE_BLOCK_CONTENT,ft.name,new dt),g.register(w.INSERT_IMAGE_TO_BLOCK,ft.name,new class extends S{handleAction(t,e){const n=t.splitPointNode,s=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtTextBlockEnd(e,n,s))e.parent.apply(new R(e,i));else if(this.isCaretPositionAtTextBlockStart(e,n,s))e.parent.apply(new D(e,i));else{const t=new v(n,s);e.apply(t),e.parent.apply(new R(e,i))}}}),g.register(w.INSERT_NODES_BEFORE,ft.name,new pt),g.register(w.TRANSFORM_LIST_BLOCK,ft.name,new class extends S{handleAction(t,e){const n=e.parent,s=n.createList(t.listType),i=t.selectedBlocks,r=i.map((t=>n.toListItem(t)));s.apply(new k(r)),n.apply(new R(t.selectedBlocks[0],s)),i.forEach((t=>{t.parent.apply(new L(t))}))}});class xt extends x{constructor(t,e){super(),this.type=w.BREAK_SINGLE_BLOCK,this.startContainerNode=t,this.startOffset=e}}class At extends E{constructor(t){super(t),this.type="image",this.nodes=[]}static from(t){const e=new At(t.id),{annotations:n}=t;return e.nodes=t.nodes.map((t=>B.from(t,e))),n&&Object.entries(n).forEach((([t,n])=>{const s=this.createAnnotationEntity(t,n);r(s)&&e.annotationMap.set(...s)})),e}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.nodes.map((t=>t.toJSON()))})}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((t=>t.url.length>0))}getLastNode(){return this.nodes[this.nodes.length-1]}createNewImageBlock(){return new At(o())}clone(){const t=new At(this.id);return t.nodes=this.nodes.map((e=>{const n=e.clone();return n.parentBlock=t,n})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}}g.register(w.DELETE_BLOCK_CONTENT,At.name,new class extends b{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let i=this.getPreviousNode(n),r=null;if(1===s){const t=e;this.isContentFirstNode(n)&&(r=this.getNextNode(n)),1===t.nodes.length?t.parent.apply(new L(t)):t.apply(new L(n))}else{const e=i;e&&e instanceof B&&(i=this.getPreviousNode(e),e.parentBlock.apply(new L(e)),i||(t.nextNode=n))}i?t.previousNode=i:r&&(t.nextNode=r)}}),g.register(w.MERGE_TWO_BLOCKS_NODES,At.name,new C),g.register(w.DELETE_CHILD,At.name,new I),g.register(w.APPEND_CHILD_NODES,At.name,new _),g.register(w.REPLACE_CHILD_NODES,At.name,new j),g.register(w.SPLIT_BLOCK_WITH_NODE,At.name,new class extends S{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.nodes.indexOf(t);if(s>-1){const t=n.nodes.slice(0,s+e),i=n.nodes.slice(s+e);n.apply(new M(t));const r=this.cloneWithNodes(i,n);return n.parent.apply(new R(n,r)),r}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.nodes=[],n.apply(new k(t)),n}}),g.register(w.BREAK_SINGLE_BLOCK,At.name,new class extends S{handleAction(t,e){t.newBlock=this.breakSingleBlock(t.startContainerNode,t.startOffset,e)}breakSingleBlock(t,e,n){const s=ft.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]});if(this.isCaretPositionAtImageBlockEnd(n,t,e))n.parent.apply(new R(n,s));else{if(!this.isCaretPositionAtImageBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}n.parent.apply(new D(n,s))}return s}}),g.register(w.LINE_BREAK_SINGLE_BLOCK,At.name,new class extends S{handleAction(t,e){const n=new xt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.nodes[0])}}),g.register(w.LINE_BREAK_MULTIPLE_BLOCKS,At.name,new class extends S{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=ft.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:"\n"}]});e.parent.apply(new R(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n)),n.apply(new k(s)),n.nodes[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.nodes),t.parent.apply(new L(t)))})),e}}),g.register(w.INSERT_IMAGE_TO_BLOCK,At.name,new class extends S{handleAction(t,e){const n=t.splitPointNode,s=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.nodes.length<1?e.apply(new k(i.nodes)):this.isCaretPositionAtImageBlockEnd(e,n,s)?e.parent.apply(new R(e,i)):this.isCaretPositionAtImageBlockStart(e,n,s)?e.parent.apply(new D(e,i)):(e.apply(new v(n,s)),e.parent.apply(new R(e,i)))}}),g.register(w.INSERT_NODES_BEFORE,At.name,new pt),g.register(w.INSERT_NODES_AFTER,At.name,new class extends wt{handleAction(t,e){const n=t.referNode,s=[n,...t.nodesToBeInserted];this.replaceNodeWithNodes(e,n,s)}});class Nt extends ft{constructor(t,e){super(t,"list-item"),this.children=[],this.children=e}static from(t){const e=new Nt(t.id);e.nodes=t.nodes.map((t=>it.from(t,e))),t.children&&(e.children=t.children.map((t=>{const n=St.from(t);return n.parent=e,n})));const{annotations:n}=t;return n&&Object.entries(n).forEach((([t,n])=>{const s=this.createAnnotationEntity(t,n);r(s)&&e.annotationMap.set(...s)})),e}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.children)||void 0===t?void 0:t.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new Nt(o());return e.nodes=[],e.apply(new k(t)),e}getLastNode(){return this.children&&this.children.length>0?this.children[this.children.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new Nt(o())}clone(){var t;const e=new Nt(this.id);return e.nodes=this.nodes.map((t=>{const n=t.clone();return n.parentBlock=e,n})),e.annotationMap=super.cloneAnnotations(),e.children=null===(t=this.children)||void 0===t?void 0:t.map((t=>{const n=t.clone();return n.parent=e,n})),e.parent=this.parent,e}}g.register(w.DELETE_BLOCK_CONTENT,Nt.name,new class extends dt{handleAction(t,e){const n=e.parent;this.deleteNodeContent(t,e),0===n.blocks.length&&n.parent.apply(new L(n))}}),g.register(w.LINE_BREAK_SINGLE_BLOCK,Nt.name,new ht),g.register(w.LINE_BREAK_MULTIPLE_BLOCKS,Nt.name,new lt),g.register(w.DELETE_CHILD,Nt.name,new class extends S{handleAction(t,e){e.nodes=e.nodes.filter((e=>e!==t.entityToBeRemoved)),0!==e.nodes.length||e.children&&e.children.length||e.parent.apply(new L(e))}}),g.register(w.DELETE_NEST_LIST,Nt.name,new class extends S{handleAction(t,e){e.children&&(e.children=e.children.length>1?e.children.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),g.register(w.APPEND_CHILD_NODES,Nt.name,new _),g.register(w.SPLIT_BLOCK_WITH_NODE,Nt.name,new at),g.register(w.REPLACE_CHILD_NODES,Nt.name,new j),g.register(w.REPLACE_NEST_LIST,Nt.name,new class extends S{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.children=t.newList}}),g.register(w.MERGE_TWO_BLOCKS_NODES,Nt.name,new C),g.register(w.BREAK_SINGLE_BLOCK,Nt.name,new class extends S{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const s=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(s.apply(new k([i])),this.isCaretPositionAtTextBlockEnd(n,t,e))return this.breakListItemAtEnd(s,n);if(!this.isCaretPositionAtTextBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new D(n,s)),s}breakListItemAtEnd(t,e){const n=e.parent.blocks[e.parent.blocks.length-1],s=1===e.nodes.length&&e.nodes[0].isEmpty();if(e===n&&s){const n=e.parent.parent;if("list-item"!==n.type){const s=ft.from({id:o(),type:"paragraph",nodes:[]});return s.apply(new k(t.nodes)),n.apply(new R(e.parent,s)),e.parent.apply(new L(e)),s}n.parent.apply(new R(n,t)),e.parent.apply(new L(e))}else e.parent.apply(new R(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(f.LINK),e}}),g.register(w.INSERT_IMAGE_TO_BLOCK,Nt.name,new class extends S{handleAction(t,e){e.parent.apply(t)}}),g.register(w.INSERT_NODES_BEFORE,Nt.name,new pt);class gt extends S{handleAction(t,e){this.replaceBlockWithBlocks(e,t.referBlock,[...t.blocksToBeInserted,t.referBlock])}replaceBlockWithBlocks(t,e,n){t.blocks&&(n.forEach((e=>{e.parent=t})),t.blocks=t.blocks.flatMap((t=>t===e?n:t)))}}class Et extends gt{handleAction(t,e){this.replaceBlockWithBlocks(e,t.referBlock,[t.referBlock,...t.blocksToBeInserted])}}class Ot extends S{handleAction(t,e){const n=t.entityToBeAppended;e.blocks&&(n.forEach((t=>{t.parent=e})),e.blocks=e.blocks.concat(n))}}class mt extends x{constructor(t){super(),this.type=w.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class yt extends S{handleAction(t,e){const n=t.entityToBeRemoved;e.blocks&&(e.blocks=e.blocks.filter((t=>t!==n)))}}class St extends E{constructor(t,e){super(t),this.type="bullet-list",this.blocks=[],this.type=e}static from(t){const e=new St(t.id,t.type);return e.blocks=t.blocks.map((t=>{const n=Nt.from(t);return n.parent=e,n})),e}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.blocks.map((t=>t.toJSON()))})}isNotEmpty(){return this.blocks.length>0}getLastNode(){return this.blocks[this.blocks.length-1].getLastNode()}clone(){const t=new St(this.id,this.type);return t.blocks=this.blocks.map((e=>{const n=e.clone();return n.parent=t,n})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}}g.register(w.DELETE_CHILD,St.name,new class extends yt{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.blocks.length&&n&&n.apply("list-item"===n.type?new mt(e):new L(e))}}),g.register(w.INSERT_BLOCKS_BEFORE,St.name,new gt),g.register(w.INSERT_BLOCKS_AFTER,St.name,new Et),g.register(w.APPEND_CHILD_NODES,St.name,new Ot),g.register(w.TRANSFORM_LIST_BLOCK,St.name,new class extends S{handleAction(t,e){const n=t.selectedBlocks,s=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))s.apply(new k(e.blocks)),e.parent.apply(new R(e,s)),e.parent.apply(new L(e)),n.forEach((t=>t.nodes.map((t=>t.apply(new Y)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));s.apply(new k(n)),e.parent.apply(new R(e,s)),t.selectedBlocks.forEach((t=>{t.parent.apply(new L(t))})),0===e.blocks.length&&e.parent.apply(new L(e))}}}),g.register(w.TRANSFORM_PARAGRAPH_BLOCK,St.name,new class extends S{handleAction(t,e){let n=!1,s=!1;const i=t.selectedBlocks,r=i.map((t=>(t.nodes.map((t=>t.apply(new Y))),t===e.blocks[0]&&(n=!0),t===e.blocks[e.blocks.length-1]&&(s=!0),this.toParagraph(t))));if(n)e.parent.apply(new D(e,...r));else if(s)e.parent.apply(new R(e,...r));else{const t=e.blocks.indexOf(i[0]),n=e.blocks.indexOf(i[i.length-1]),s=e.parent.createList(e.type);s.apply(new k(e.blocks.slice(0,t)));const o=e.parent.createList(e.type);o.apply(new k(e.blocks.slice(n+1))),e.parent.apply(new D(e,s,...r,o)),e.parent.apply(new L(e))}i.map((t=>{e.apply(new L(t))})),0===e.blocks.length&&e.parent.apply(new L(e))}toParagraph(t){const e=new ft(o(),"paragraph");return e.apply(new k(t.nodes)),e.annotationMap=t.annotationMap,e}}),g.register(w.INSERT_IMAGE_TO_BLOCK,St.name,new class extends S{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new R(e,t.imageBlockToBeInserted):t)}});class Tt{constructor(t){t.forEach((t=>{t.parent=this})),this.blocks=t}static fromJSON(t){const e=t.map((t=>{switch(t.type){case"paragraph":case"title":case"subtitle":case"heading-1":case"heading-2":case"heading-3":return ft.from(t);case"image":return At.from(t);case"bullet-list":case"number-list":return St.from(t);default:throw new Error(`[Vega] Unknown block type: ${t.type}`)}}));return new Tt(e)}static createEmptyContent(){return Tt.fromJSON([{id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]}])}clone(t=!1){return new Tt(t?this.blocks.map((t=>t.clone())):[...this.blocks])}toJSON(){return this.blocks.map((t=>t.toJSON()))}apply(t){g.executeTheStrategy(t,this)}toListItem(t){t.nodes.map((t=>t.apply(new Y)));const e=new Nt(o());return e.apply(new k(t.nodes)),e.annotationMap=t.annotationMap,e}createList(t){return new St(o(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.blocks)}findNodeInBlocksById(t,e){for(const n of e){if("nodes"in n)for(const e of n.nodes)if(e.id===t)return e;if(n instanceof Nt&&n.children)for(const e of n.children){const n=this.findNodeInBlocksById(t,e.blocks);if(n)return n}if(n instanceof St&&n.blocks){const e=this.findNodeInBlocksById(t,n.blocks);if(e)return e}}return null}}g.register(w.DELETE_CHILD,Tt.name,new yt),g.register(w.APPEND_CHILD_NODES,Tt.name,new Ot),g.register(w.INSERT_BLOCKS_BEFORE,Tt.name,new gt),g.register(w.INSERT_BLOCKS_AFTER,Tt.name,new Et);export{T as A,u as B,tt as C,xt as D,L as E,M as F,D as G,A as H,a as I,R as J,st as L,x as M,m as N,ft as R,P as S,F as T,K as U,Tt as V,U as Z,At as a,Nt as b,St as c,E as d,B as e,it as f,O as g,f as h,y as i,$ as j,z as k,ct as l,W as m,ot as n,rt as o,G as p,h as q,et as r,d as s,J as t,N as u,w as v,k as w,Z as x,ut as y,v as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,H as a,g as n}from"./p-1c298d5a.js";import{s as o}from"./p-9b797118.js";import{n as s,c as r}from"./p-262ec334.js";import{D as g}from"./p-6e898779.js";import{w as p,B as l,f as h,a as c,L as m}from"./p-6f81fe1e.js";import{a as f}from"./p-bf953152.js";import{C as u}from"./p-431ab4dd.js";import{c as v}from"./p-a821bcf3.js";import{c as d,M as b,V as x,I as w}from"./p-6e1ab235.js";import{V as S,I as y}from"./p-4387d550.js";import{T as C}from"./p-1503f791.js";import{R as z}from"./p-1e2886b5.js";import{P as j,g as P}from"./p-c0291e2e.js";import{k as O,l as k}from"./p-12d60f5f.js";import"./p-5f377954.js";import"./p-8ade44bf.js";import{F as I}from"./p-1e940ce8.js";import"./p-cc63e827.js";import"./p-0fd6c35b.js";import"./p-8d283666.js";import"./p-3d3cd394.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-804f71b3.js";import"./p-6a334573.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-3647d61d.js";import"./p-37b05e0b.js";import"./p-50677c8e.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-7a40e033.js";const L=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},M=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{g.addUniqueObserverToNode(e,p,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,g.addUniqueObserverToNode(e,l,o)}})))},E=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o})=>{const s=i.sort(((e,t)=>e-t)),r=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:s.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{g.addUniqueObserverToNode(e,h,r)}})))},R=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:f(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:f(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{g.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var T=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class N extends x{registerPaginationPageSizeChangeObserver(){g.addUniqueObserverToNode(this.host,O,(e=>{this.pageSize=Number(e.detail)}))}unregisterPaginationPageSizeChangeObserver(){g.removeUniqueObserverFromNode(this.host,O)}}T([d()],N.prototype,"host",void 0),T([d({writable:!0})],N.prototype,"pageSize",void 0),T([b("connectedCallback")],N.prototype,"registerPaginationPageSizeChangeObserver",null),T([b("disconnectedCallback")],N.prototype,"unregisterPaginationPageSizeChangeObserver",null);var _=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class A extends x{registerPaginationCurrentChangeObserver(){g.addUniqueObserverToNode(this.host,k,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){g.removeUniqueObserverFromNode(this.host,k)}}_([d()],A.prototype,"host",void 0),_([d({writable:!0})],A.prototype,"current",void 0),_([b("connectedCallback")],A.prototype,"registerPaginationCurrentChangeObserver",null),_([b("disconnectedCallback")],A.prototype,"unregisterPaginationCurrentChangeObserver",null);var V=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class B extends j{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=z.formatCustom(this.layout)}}V([d()],B.prototype,"host",void 0),V([d()],B.prototype,"layout",void 0),V([b("componentWillLoad")],B.prototype,"componentWillLoad",null),V([b("watchCurrentBreakpoint")],B.prototype,"watchCurrentBreakpoint",null),V([b("watchLayout")],B.prototype,"watchLayout",null);var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const G=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new C,this.childEventPrevent=new u([p],(()=>this.host)),this.childValueChangePrevent=new u([h],(()=>this.host),!0),this.vegaChangeEventEmitter=v(G,h),this.vegaPageSizeChangeEventEmitter=v(G,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new S,this.vegaPaginationPageSizeObserverController=new N,this.vegaPaginationCurrentPageObserverController=new A,this.breakpointPageResizeObserverSlimmer=new j,this.vegaPaginationLayoutController=new B,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=P(),this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=I.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(L,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(E,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return e(R,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(M,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(){this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=z.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};W([y()],G.prototype,"globalSlimmers",void 0),W([w()],G.prototype,"translationSlimmer",void 0),W([w()],G.prototype,"childEventPrevent",void 0),W([w()],G.prototype,"childValueChangePrevent",void 0),W([w()],G.prototype,"vegaChangeEventEmitter",void 0),W([w()],G.prototype,"vegaPageSizeChangeEventEmitter",void 0),W([w()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W([w()],G.prototype,"vegaPaginationPageSizeObserverController",void 0),W([w()],G.prototype,"vegaPaginationCurrentPageObserverController",void 0),W([w()],G.prototype,"breakpointPageResizeObserverSlimmer",void 0),W([w()],G.prototype,"vegaPaginationLayoutController",void 0),G.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{G as vega_pagination}
|
|
1
|
+
import{h as e,r as t,c as i,H as a,g as n}from"./p-1c298d5a.js";import{s as o}from"./p-9b797118.js";import{n as s,c as r}from"./p-262ec334.js";import{D as g}from"./p-6e898779.js";import{w as p,B as l,f as h,a as c,L as m}from"./p-6f81fe1e.js";import{a as f}from"./p-bf953152.js";import{C as u}from"./p-431ab4dd.js";import{c as v}from"./p-a821bcf3.js";import{c as d,M as b,V as x,I as w}from"./p-6e1ab235.js";import{V as S,I as y}from"./p-4387d550.js";import{T as C}from"./p-1503f791.js";import{R as z}from"./p-50e80afa.js";import{P as j,g as P}from"./p-c0291e2e.js";import{k as O,l as k}from"./p-c754b32c.js";import"./p-5f377954.js";import"./p-8ade44bf.js";import{F as I}from"./p-1e940ce8.js";import"./p-cc63e827.js";import"./p-0fd6c35b.js";import"./p-8d283666.js";import"./p-5c1eedc5.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-804f71b3.js";import"./p-6a334573.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-3647d61d.js";import"./p-37b05e0b.js";import"./p-50677c8e.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-7a40e033.js";const L=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},M=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{g.addUniqueObserverToNode(e,p,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,g.addUniqueObserverToNode(e,l,o)}})))},E=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o})=>{const s=i.sort(((e,t)=>e-t)),r=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:s.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{g.addUniqueObserverToNode(e,h,r)}})))},R=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:f(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:f(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{g.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var T=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class N extends x{registerPaginationPageSizeChangeObserver(){g.addUniqueObserverToNode(this.host,O,(e=>{this.pageSize=Number(e.detail)}))}unregisterPaginationPageSizeChangeObserver(){g.removeUniqueObserverFromNode(this.host,O)}}T([d()],N.prototype,"host",void 0),T([d({writable:!0})],N.prototype,"pageSize",void 0),T([b("connectedCallback")],N.prototype,"registerPaginationPageSizeChangeObserver",null),T([b("disconnectedCallback")],N.prototype,"unregisterPaginationPageSizeChangeObserver",null);var _=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class A extends x{registerPaginationCurrentChangeObserver(){g.addUniqueObserverToNode(this.host,k,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){g.removeUniqueObserverFromNode(this.host,k)}}_([d()],A.prototype,"host",void 0),_([d({writable:!0})],A.prototype,"current",void 0),_([b("connectedCallback")],A.prototype,"registerPaginationCurrentChangeObserver",null),_([b("disconnectedCallback")],A.prototype,"unregisterPaginationCurrentChangeObserver",null);var V=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class B extends j{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=z.formatCustom(this.layout)}}V([d()],B.prototype,"host",void 0),V([d()],B.prototype,"layout",void 0),V([b("componentWillLoad")],B.prototype,"componentWillLoad",null),V([b("watchCurrentBreakpoint")],B.prototype,"watchCurrentBreakpoint",null),V([b("watchLayout")],B.prototype,"watchLayout",null);var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const G=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new C,this.childEventPrevent=new u([p],(()=>this.host)),this.childValueChangePrevent=new u([h],(()=>this.host),!0),this.vegaChangeEventEmitter=v(G,h),this.vegaPageSizeChangeEventEmitter=v(G,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new S,this.vegaPaginationPageSizeObserverController=new N,this.vegaPaginationCurrentPageObserverController=new A,this.breakpointPageResizeObserverSlimmer=new j,this.vegaPaginationLayoutController=new B,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=P(),this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=I.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(L,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(E,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return e(R,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(M,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(){this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=z.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};W([y()],G.prototype,"globalSlimmers",void 0),W([w()],G.prototype,"translationSlimmer",void 0),W([w()],G.prototype,"childEventPrevent",void 0),W([w()],G.prototype,"childValueChangePrevent",void 0),W([w()],G.prototype,"vegaChangeEventEmitter",void 0),W([w()],G.prototype,"vegaPageSizeChangeEventEmitter",void 0),W([w()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W([w()],G.prototype,"vegaPaginationPageSizeObserverController",void 0),W([w()],G.prototype,"vegaPaginationCurrentPageObserverController",void 0),W([w()],G.prototype,"breakpointPageResizeObserverSlimmer",void 0),W([w()],G.prototype,"vegaPaginationLayoutController",void 0),G.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{G as vega_pagination}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t}from"./p-b1f65b13.js";import{c as i,M as s,V as e}from"./p-6e1ab235.js";import{C as n}from"./p-2d0d575f.js";import{d as r}from"./p-6f81fe1e.js";import{h,V as o}from"./p-
|
|
1
|
+
import{i as t}from"./p-b1f65b13.js";import{c as i,M as s,V as e}from"./p-6e1ab235.js";import{C as n}from"./p-2d0d575f.js";import{d as r}from"./p-6f81fe1e.js";import{h,V as o}from"./p-c754b32c.js";import{a as u}from"./p-bf1894ec.js";class a{canFormat(i,s,e){if("init"===i){if("component"===s&&t(null==e?void 0:e.isBlurred))return!1;if(this.shouldTriggerAtInit())return!0}if("input"===i&&"native-input"===s)return!0;if("blur"===i&&(null==e?void 0:e.isBlurred)){if("component"===s&&this.shouldOverrideComponentValueAfterBlur())return!0;if("native-input"===s)return!0}return!1}shouldOverrideComponentValueAfterBlur(){return!1}shouldTriggerAtInit(){return!1}}class c extends a{constructor(t){super(),this.insertMode=!0,this.maskConfig=t,this.slotRegex=new RegExp(t.slot),this.acceptRegex=new RegExp(t.accept,"g"),this.insertMode=!1!==t.insertMode}format(i,s){const e=null==s?void 0:s.caretPosition;if(i.length>this.getLengthLimit()&&t(e)){const t=[...i],s=i.length-this.getLengthLimit();return t.splice(e-s,s),t.join("")}return this.replaceMaskWithMatchedInputSlots(i,this.getMatchedInputSlotValue(i))}calculateCaretPosition(i,s){if(!t(s))return null;if(i.length>this.getLengthLimit())return s-(i.length-this.getLengthLimit());const e=i.substring(0,s);return s+(this.format(e).length-e.length)}shouldOverrideComponentValueAfterBlur(){return!(!this.maskConfig||!0!==this.maskConfig.overrideValue)}shouldTriggerAtInit(){return!(!this.maskConfig||!0!==this.maskConfig.triggerAtInit)}getLengthLimit(){return this.maskConfig.mask.length}getMatchedInputSlotValue(t){return t.match(this.acceptRegex)||[]}replaceMaskWithMatchedInputSlots(t,i){const s=[];let e=-1;for(let n=0;n<this.maskConfig.mask.length;n++){const r=this.maskConfig.mask.charAt(n);if(this.slotRegex.test(r)&&i.length){const t=i.shift();t&&(s.push(t),e=n)}else this.insertMode||i.shift(),t.charAt(n)===r&&(e=n),s.push(r)}const n=this.insertMode?e+1:t.length;return s.join("").slice(0,n)}}c.PHONE_MASK=new c({mask:"(999) 999-9999",slot:"9",accept:/\d/g}),c.ZIPCODE_MASK=new c({mask:"99999",slot:"9",accept:/\d/g}),c.TAX_ID_MASK=new c({mask:"99-9999999",slot:"9",accept:/\d/g});var p=function(t,i,s,e){var n,r=arguments.length,h=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,i,s,e);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(i,s,h):n(i,s))||h);return r>3&&h&&Object.defineProperty(i,s,h),h};class l extends e{constructor(){super(...arguments),this.onFocus=t=>{if(this.host&&this.host.value){const i=this.host.value;t.target.value!==i&&(this.inputElement.value=i)}},this.onBlur=t=>{this.blurFormatStrategy&&this.formatValue(t.target.value,"blur")},this.onKeyDown=t=>{const i=t.target,s=i.value,e=i.selectionStart;this.inputFormatStrategy&&(this.formatValue(s,"input",{caretPosition:"insertFromPaste"===t.inputType?void 0:e}),this.updateInputCaretPosition(s,e))},this.onPaste=t=>{this.disableCopyPaste?t.preventDefault():n.notify(r.getSubject(this.host,h),t)}}componentDidRender(){n.notify(r.getSubject(this.host,o),{})}setup(){this.destroy();const t=this.getInputElementRef();t&&(this.inputElement=t,this.inputFormatStrategy=this.getInputModeStrategy(),this.blurFormatStrategy=this.getBlurModeStrategy(),this.formatValueAfterSetup(),this.inputFormatStrategy&&(this.inputElement.addEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.addEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.addEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.addEventListener("focus",this.onFocus,{capture:!0})))}destroy(){this.inputElement&&(this.inputFormatStrategy&&(this.inputElement.removeEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.removeEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.removeEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.removeEventListener("focus",this.onFocus,{capture:!0})))}formatValueAfterSetup(){u(this.host).then((()=>{this.formatValue(this.inputElement.value,"init")}))}isOnFocus(){return this.inputElement.matches(":focus")}updateNativeInputValue(t,i){i!==t&&(this.inputElement.value=i)}updateComponentValue(t,i){i!==t&&(this.host.value=i)}updateInputCaretPosition(i,s){var e,n,r;const h=null!==(r=null===(n=(e=this.inputFormatStrategy).calculateCaretPosition)||void 0===n?void 0:n.call(e,i,s))&&void 0!==r?r:s;t(h)&&this.inputElement.setSelectionRange(h,h)}formatValue(t,i,s){const e=!this.isOnFocus(),n=null==s?void 0:s.caretPosition;if(this.inputFormatStrategy){if(this.inputFormatStrategy.canFormat(i,"component")){const i=this.inputFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.inputFormatStrategy.canFormat(i,"native-input")){const i=this.inputFormatStrategy.format(t,{caretPosition:n});this.updateNativeInputValue(t,i)}}if(this.blurFormatStrategy&&e){if(this.blurFormatStrategy.canFormat(i,"component",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.blurFormatStrategy.canFormat(i,"native-input",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateNativeInputValue(t,i)}}}}p([i()],l.prototype,"host",void 0),p([s("componentDidRender")],l.prototype,"componentDidRender",null);export{a as S,l as a,c as b}
|
package/dist/vega/p-5f377954.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.
|
|
1
|
+
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.48.0",this.framework=t.VanillaJs}getVegaEnv(){return{version:this.vegaVersion,framework:this.framework}}setVegaFramework(t){this.framework=t}};export{t as F,s as v}
|