@heartlandone/vega 2.34.1 → 2.35.0-RTE-preview
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-48582633.js → app-globals-fb3693cc.js} +22 -21
- package/dist/cjs/{change-manager-bda1d107.js → change-manager-a297e4d2.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-e1a6e5ad.js → child-nodes-event-prevent-slimmer-96c3c4ae.js} +3 -3
- package/dist/cjs/{child-nodes-notify-observer-slimmer-03a3f79e.js → child-nodes-notify-observer-slimmer-be92f366.js} +5 -5
- package/dist/cjs/{component-63af66ea.js → component-73a88c4e.js} +1 -1
- package/dist/cjs/{component-global-style-slimmer-6b64a26c.js → component-global-style-slimmer-6749808c.js} +1 -1
- package/dist/cjs/{component-usage-runtime-metrics-019d3c00.js → component-usage-runtime-metrics-dcb32c24.js} +1 -1
- package/dist/cjs/content-state-3e4467a3.js +134 -0
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-8c6a8fb7.js → create-public-api-runtime-metrics-slimmer-54c3f73b.js} +2 -2
- package/dist/cjs/{date-ffe382a4.js → date-0a6bb035.js} +1 -1
- package/dist/cjs/{deprecated-property-slimmer-f36e3779.js → deprecated-property-slimmer-fc729fd9.js} +2 -2
- package/dist/cjs/{design-token-908e3f69.js → design-token-30c069c1.js} +3 -3
- package/dist/cjs/{dom-node-subject-observer-factory-093462f1.js → dom-node-subject-factory-3ec114b8.js} +1 -41
- package/dist/cjs/dom-node-subject-observer-factory-5f0eae19.js +44 -0
- package/dist/cjs/{dynamic-slimmer-dc30600a.js → dynamic-slimmer-f31fdfd7.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-0dd70e61.js → element-appender-slimmer-700b7004.js} +6 -6
- package/dist/cjs/{event-emit-slimmer-a46bb411.js → event-emit-slimmer-9c223f73.js} +7 -6
- package/dist/cjs/{feature-flag-controller-e97b5f29.js → feature-flag-controller-7b22e598.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-9aeabcdc.js → form-field-controller-slimmer-7ef32059.js} +16 -15
- package/dist/cjs/global-slimmer-registry-b3bce7e0.js +297 -0
- package/dist/cjs/{icon-manager-36dcfb65.js → icon-manager-edc2400b.js} +2 -2
- package/dist/cjs/{text-color-toolbar-button-slimmer-21a166e4.js → image-annotation-action-d3e1699c.js} +78 -27
- package/dist/cjs/{global-slimmer-registry-dd2691b8.js → index-09acd3c9.js} +282 -296
- package/dist/cjs/index.cjs.js +27 -28
- package/dist/cjs/{inject-keyboard-manager-af37c861.js → inject-keyboard-manager-4a5c27a2.js} +1 -1
- package/dist/cjs/{internal-icon-manager-2282a62f.js → internal-icon-manager-5ccb9443.js} +1 -1
- package/dist/cjs/{internal-vega-event-manager-d7643ec6.js → internal-vega-event-manager-e5e4bcf4.js} +72 -72
- package/dist/cjs/{internal-vega-z-index-manager-e24e4309.js → internal-vega-z-index-manager-f03ddb37.js} +1 -1
- package/dist/cjs/{keyboard-manager-5afbc8f1.js → keyboard-manager-2df53b2f.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-9be2a880.js → keyboard-manager-slimmer-feba3a83.js} +2 -2
- package/dist/cjs/{content-state-6a5b9736.js → list-block-91116257.js} +1346 -402
- package/dist/cjs/loader.cjs.js +21 -21
- package/dist/cjs/{mutation-observer-slimmer-98bbbdf0.js → mutation-observer-slimmer-895b3d3e.js} +1 -1
- package/dist/cjs/{node.abstract-f8075f84.js → node-annotation.abstract-e5d3a859.js} +37 -48
- package/dist/cjs/{page-resize-observer-slimmer-e54fa9d4.js → page-resize-observer-slimmer-bb1eaebe.js} +1 -1
- package/dist/cjs/{remote-invocation-registry-71a45468.js → remote-invocation-registry-ff9af278.js} +3 -3
- package/dist/cjs/{responsive-format-facade-74079f1b.js → responsive-format-facade-4363a00d.js} +1 -1
- package/dist/cjs/{state-background-color-formatter-d32a1098.js → state-background-color-formatter-e585a027.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-297765c0.js → string-input-formatter-slimmer-6155c9f5.js} +1 -1
- package/dist/cjs/{style-formatter-5deb065f.js → style-formatter-63218b76.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-73201c53.js → sub-state-notify-slimmer-c2e08e06.js} +8 -8
- package/dist/cjs/{sub-state-observer-slimmer-10c0d402.js → sub-state-observer-slimmer-b97e46b5.js} +8 -8
- package/dist/cjs/{translation-f6b7ee84.js → translation-b9be41e0.js} +3 -3
- package/dist/cjs/{translation-slimmer-90f9f71f.js → translation-slimmer-ec76c5a2.js} +2 -2
- package/dist/cjs/{ui-b5906704.js → ui-5fd9b267.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +41 -39
- package/dist/cjs/vega-app-footer.cjs.entry.js +13 -12
- package/dist/cjs/vega-app-header-button.cjs.entry.js +42 -40
- package/dist/cjs/vega-backdrop.cjs.entry.js +9 -8
- package/dist/cjs/vega-banner.cjs.entry.js +36 -34
- package/dist/cjs/vega-bar-chart.cjs.entry.js +6 -5
- package/dist/cjs/vega-box.cjs.entry.js +13 -12
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +34 -32
- package/dist/cjs/vega-button-circle.cjs.entry.js +25 -23
- package/dist/cjs/vega-button-group_2.cjs.entry.js +32 -30
- package/dist/cjs/vega-button-link.cjs.entry.js +26 -24
- package/dist/cjs/vega-button.cjs.entry.js +26 -24
- package/dist/cjs/vega-calendar_3.cjs.entry.js +135 -133
- package/dist/cjs/vega-card.cjs.entry.js +11 -10
- package/dist/cjs/vega-carousel.cjs.entry.js +25 -23
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +46 -44
- package/dist/cjs/vega-chip.cjs.entry.js +36 -34
- package/dist/cjs/vega-color-picker.cjs.entry.js +26 -24
- package/dist/cjs/vega-combo-box.cjs.entry.js +46 -44
- package/dist/cjs/vega-counter-badge.cjs.entry.js +10 -9
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +56 -54
- package/dist/cjs/{vega-dialog-controller-aaf1f43e.js → vega-dialog-controller-fe610705.js} +2 -2
- package/dist/cjs/vega-dialog_2.cjs.entry.js +47 -45
- package/dist/cjs/vega-divider.cjs.entry.js +11 -10
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +132 -130
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-error.cjs.entry.js +8 -7
- package/dist/cjs/vega-field-label.cjs.entry.js +22 -20
- package/dist/cjs/vega-file-uploader.cjs.entry.js +67 -65
- package/dist/cjs/vega-flex.cjs.entry.js +14 -13
- package/dist/cjs/vega-font.cjs.entry.js +14 -13
- package/dist/cjs/vega-form.cjs.entry.js +38 -36
- package/dist/cjs/vega-grid.cjs.entry.js +11 -10
- package/dist/cjs/vega-hint.cjs.entry.js +7 -6
- package/dist/cjs/vega-icon.cjs.entry.js +16 -15
- package/dist/cjs/vega-image-uploader.cjs.entry.js +51 -49
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +37 -35
- package/dist/cjs/vega-input-numeric.cjs.entry.js +30 -28
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +49 -47
- package/dist/cjs/vega-input-range.cjs.entry.js +40 -38
- package/dist/cjs/vega-input-select.cjs.entry.js +62 -60
- package/dist/cjs/vega-input.cjs.entry.js +46 -44
- package/dist/cjs/vega-item-toggle.cjs.entry.js +21 -19
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +102 -100
- package/dist/cjs/vega-line-chart.cjs.entry.js +7 -6
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -15
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +20 -18
- package/dist/cjs/vega-pagination.cjs.entry.js +52 -50
- package/dist/cjs/vega-pie-chart.cjs.entry.js +7 -6
- package/dist/cjs/vega-popover_2.cjs.entry.js +34 -32
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +29 -27
- package/dist/cjs/vega-radio_2.cjs.entry.js +50 -48
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +321 -23
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +336 -334
- package/dist/cjs/vega-section-title.cjs.entry.js +15 -14
- package/dist/cjs/vega-segment-control.cjs.entry.js +24 -22
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +49 -47
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +61 -59
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +46 -44
- package/dist/cjs/vega-signature-capture.cjs.entry.js +40 -38
- package/dist/cjs/{block-annotation.abstract-4d88b939.js → vega-skeleton-loader-controller-7dac484f.js} +7 -21
- package/dist/cjs/vega-skeleton.cjs.entry.js +26 -25
- package/dist/cjs/vega-slot-container.cjs.entry.js +6 -5
- package/dist/cjs/vega-stepper.cjs.entry.js +34 -32
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +54 -52
- package/dist/cjs/vega-table_8.cjs.entry.js +184 -182
- package/dist/cjs/vega-text.cjs.entry.js +9 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +34 -32
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +83 -81
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +23 -21
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +20 -19
- package/dist/cjs/vega.cjs.js +21 -21
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +22 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/link-group-annotation.js +0 -90
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +0 -24
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +67 -13
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +45 -12
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +68 -8
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +111 -36
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +23 -50
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +0 -25
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +95 -19
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +13 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.js +123 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.js +48 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.js +26 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +0 -48
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +0 -40
- package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +0 -39
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/image-node.test.js +0 -14
- package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +0 -34
- package/dist/esm/{app-globals-48531a04.js → app-globals-5b154b6d.js} +13 -12
- package/dist/esm/{change-manager-8f5b72c2.js → change-manager-6a7eb88c.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-8ceabe63.js → child-nodes-event-prevent-slimmer-97aae8a8.js} +3 -3
- package/dist/esm/{child-nodes-notify-observer-slimmer-afc15e00.js → child-nodes-notify-observer-slimmer-289caacc.js} +4 -4
- package/dist/esm/{component-051a594c.js → component-cae24190.js} +1 -1
- package/dist/esm/{component-global-style-slimmer-631f956f.js → component-global-style-slimmer-000e0c11.js} +1 -1
- package/dist/esm/{component-usage-runtime-metrics-21813c36.js → component-usage-runtime-metrics-385c7124.js} +1 -1
- package/dist/esm/content-state-f39c4bbf.js +132 -0
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-14cb4599.js → create-public-api-runtime-metrics-slimmer-9ab05523.js} +2 -2
- package/dist/esm/{date-655c0af8.js → date-732bc749.js} +1 -1
- package/dist/esm/{deprecated-property-slimmer-9ea5019c.js → deprecated-property-slimmer-43d184b3.js} +2 -2
- package/dist/esm/{design-token-20fdba82.js → design-token-d06bc718.js} +3 -3
- package/dist/esm/{dom-node-subject-observer-factory-80358591.js → dom-node-subject-factory-5831cdd4.js} +2 -41
- package/dist/esm/dom-node-subject-observer-factory-dc486a8b.js +42 -0
- package/dist/esm/{dynamic-slimmer-85746483.js → dynamic-slimmer-90b8af32.js} +1 -1
- package/dist/esm/{element-appender-slimmer-4dfa326d.js → element-appender-slimmer-d71e3109.js} +6 -6
- package/dist/esm/{event-emit-slimmer-c03cf145.js → event-emit-slimmer-f285e3ac.js} +6 -5
- package/dist/esm/{feature-flag-controller-dfde0cfa.js → feature-flag-controller-4b3fe6f8.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-de5fe574.js → form-field-controller-slimmer-af969d03.js} +10 -9
- package/dist/esm/global-slimmer-registry-17c4efd4.js +283 -0
- package/dist/esm/{icon-manager-3cef32e7.js → icon-manager-b889176b.js} +2 -2
- package/dist/esm/{text-color-toolbar-button-slimmer-b2270b64.js → image-annotation-action-a8e00f28.js} +55 -6
- package/dist/esm/{global-slimmer-registry-6887a59f.js → index-187f71d1.js} +283 -284
- package/dist/esm/index.js +20 -21
- package/dist/esm/{inject-keyboard-manager-45309420.js → inject-keyboard-manager-b0135018.js} +1 -1
- package/dist/esm/{internal-icon-manager-7fc7535a.js → internal-icon-manager-900a5bb4.js} +1 -1
- package/dist/esm/{internal-vega-event-manager-3a3815d3.js → internal-vega-event-manager-07e1b3d9.js} +2 -2
- package/dist/esm/{internal-vega-z-index-manager-89e8b6f5.js → internal-vega-z-index-manager-7d2b54c3.js} +1 -1
- package/dist/esm/{keyboard-manager-2c06eafe.js → keyboard-manager-4c898a0d.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-fd177285.js → keyboard-manager-slimmer-f80d6835.js} +2 -2
- package/dist/esm/{content-state-4b036bf1.js → list-block-ba82c846.js} +1225 -299
- package/dist/esm/loader.js +19 -19
- package/dist/esm/{mutation-observer-slimmer-ca2cb2e8.js → mutation-observer-slimmer-6cef9549.js} +1 -1
- package/dist/esm/{node.abstract-93746055.js → node-annotation.abstract-d7d52bce.js} +35 -47
- package/dist/esm/{page-resize-observer-slimmer-8589ebc8.js → page-resize-observer-slimmer-beb7b0bd.js} +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{remote-invocation-registry-2ec6936d.js → remote-invocation-registry-d97fa3bc.js} +2 -2
- package/dist/esm/{responsive-format-facade-559ec469.js → responsive-format-facade-c2ab9c87.js} +1 -1
- package/dist/esm/{state-background-color-formatter-16031a43.js → state-background-color-formatter-121ae7d3.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-c9fb1fa1.js → string-input-formatter-slimmer-73fa06e6.js} +1 -1
- package/dist/esm/{style-formatter-51845b6d.js → style-formatter-f91471e8.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-6e97a58a.js → sub-state-notify-slimmer-48bad548.js} +4 -4
- package/dist/esm/{sub-state-observer-slimmer-0968ce04.js → sub-state-observer-slimmer-403cc4e7.js} +4 -4
- package/dist/esm/{translation-b3fe8e74.js → translation-a98970d8.js} +3 -3
- package/dist/esm/{translation-slimmer-860cd766.js → translation-slimmer-5ee9912b.js} +2 -2
- package/dist/esm/{ui-5600b48f.js → ui-62e4be97.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +17 -15
- package/dist/esm/vega-app-footer.entry.js +4 -3
- package/dist/esm/vega-app-header-button.entry.js +20 -18
- package/dist/esm/vega-backdrop.entry.js +5 -4
- package/dist/esm/vega-banner.entry.js +15 -13
- package/dist/esm/vega-bar-chart.entry.js +3 -2
- package/dist/esm/vega-box.entry.js +10 -9
- package/dist/esm/vega-breadcrumb.entry.js +13 -11
- package/dist/esm/vega-button-circle.entry.js +16 -14
- package/dist/esm/vega-button-group_2.entry.js +15 -13
- package/dist/esm/vega-button-link.entry.js +13 -11
- package/dist/esm/vega-button.entry.js +15 -13
- package/dist/esm/vega-calendar_3.entry.js +23 -21
- package/dist/esm/vega-card.entry.js +8 -7
- package/dist/esm/vega-carousel.entry.js +14 -12
- package/dist/esm/vega-checkbox_2.entry.js +19 -17
- package/dist/esm/vega-chip.entry.js +17 -15
- package/dist/esm/vega-color-picker.entry.js +16 -14
- package/dist/esm/vega-combo-box.entry.js +20 -18
- package/dist/esm/vega-counter-badge.entry.js +4 -3
- package/dist/esm/vega-date-picker_2.entry.js +31 -29
- package/dist/esm/{vega-dialog-controller-5b23f68c.js → vega-dialog-controller-34eb8967.js} +2 -2
- package/dist/esm/vega-dialog_2.entry.js +20 -18
- package/dist/esm/vega-divider.entry.js +8 -7
- package/dist/esm/vega-dropdown_5.entry.js +27 -25
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-error.entry.js +5 -4
- package/dist/esm/vega-field-label.entry.js +11 -9
- package/dist/esm/vega-file-uploader.entry.js +19 -17
- package/dist/esm/vega-flex.entry.js +11 -10
- package/dist/esm/vega-font.entry.js +9 -8
- package/dist/esm/vega-form.entry.js +19 -17
- package/dist/esm/vega-grid.entry.js +8 -7
- package/dist/esm/vega-hint.entry.js +4 -3
- package/dist/esm/vega-icon.entry.js +11 -10
- package/dist/esm/vega-image-uploader.entry.js +21 -19
- package/dist/esm/vega-input-credit-card.entry.js +20 -18
- package/dist/esm/vega-input-numeric.entry.js +21 -19
- package/dist/esm/vega-input-phone-number.entry.js +21 -19
- package/dist/esm/vega-input-range.entry.js +19 -17
- package/dist/esm/vega-input-select.entry.js +22 -20
- package/dist/esm/vega-input.entry.js +18 -16
- package/dist/esm/vega-item-toggle.entry.js +12 -10
- package/dist/esm/vega-left-nav_5.entry.js +24 -22
- package/dist/esm/vega-line-chart.entry.js +4 -3
- package/dist/esm/vega-loader-wrapper_2.entry.js +7 -6
- package/dist/esm/vega-page-notification_2.entry.js +8 -6
- package/dist/esm/vega-pagination.entry.js +16 -14
- package/dist/esm/vega-pie-chart.entry.js +4 -3
- package/dist/esm/vega-popover_2.entry.js +18 -16
- package/dist/esm/vega-progress-tracker.entry.js +12 -10
- package/dist/esm/vega-radio_2.entry.js +21 -19
- package/dist/esm/vega-rich-text-content.entry.js +315 -17
- package/dist/esm/vega-rich-text-editor_4.entry.js +31 -29
- package/dist/esm/vega-section-title.entry.js +4 -3
- package/dist/esm/vega-segment-control.entry.js +12 -10
- package/dist/esm/vega-selection-chip_2.entry.js +21 -19
- package/dist/esm/vega-selection-tile_2.entry.js +21 -19
- package/dist/esm/vega-sidenav_3.entry.js +19 -17
- package/dist/esm/vega-signature-capture.entry.js +22 -20
- package/dist/esm/{block-annotation.abstract-b0554e2b.js → vega-skeleton-loader-controller-0aaaf1fa.js} +8 -21
- package/dist/esm/vega-skeleton.entry.js +4 -3
- package/dist/esm/vega-slot-container.entry.js +3 -2
- package/dist/esm/vega-stepper.entry.js +18 -16
- package/dist/esm/vega-tab-group_2.entry.js +14 -12
- package/dist/esm/vega-table_8.entry.js +25 -23
- package/dist/esm/vega-text.entry.js +5 -4
- package/dist/esm/vega-textarea.entry.js +18 -16
- package/dist/esm/vega-time-picker_2.entry.js +25 -23
- package/dist/esm/vega-toggle-switch.entry.js +16 -14
- package/dist/esm/vega-tooltip_2.entry.js +13 -12
- package/dist/esm/vega.js +19 -19
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/link-group-annotation.d.ts +0 -6
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +2 -15
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +68 -4
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +45 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +68 -3
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +110 -5
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +21 -5
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +1 -14
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +86 -2
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/block-renderer.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/text-block-renderer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/image-node-renderer.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/node-renderer.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/nodes/text-node-renderer.d.ts +10 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-000b3ab0.js +1 -0
- package/dist/vega/p-00738ae9.entry.js +1 -0
- package/dist/vega/p-01d0dbe6.entry.js +1 -0
- package/dist/vega/{p-b3f9cc3a.entry.js → p-0283712e.entry.js} +2 -2
- package/dist/vega/p-032df16f.js +1 -0
- package/dist/vega/p-05f5e22b.entry.js +1 -0
- package/dist/vega/p-0945a58d.entry.js +1 -0
- package/dist/vega/p-09c5de7f.entry.js +1 -0
- package/dist/vega/p-0a8b91f5.entry.js +1 -0
- package/dist/vega/{p-f763e2eb.js → p-0af4bda9.js} +1 -1
- package/dist/vega/p-0bd9b1d9.entry.js +1 -0
- package/dist/vega/p-0c2eb135.entry.js +1 -0
- package/dist/vega/p-0da2de05.entry.js +1 -0
- package/dist/vega/p-0ee10fd7.js +1 -0
- package/dist/vega/p-12ad8ada.entry.js +1 -0
- package/dist/vega/p-14514252.entry.js +1 -0
- package/dist/vega/{p-11a19ca0.js → p-149d2801.js} +1 -1
- package/dist/vega/p-14f85e30.entry.js +1 -0
- package/dist/vega/p-19556584.entry.js +1 -0
- package/dist/vega/p-1b3e0a9f.entry.js +1 -0
- package/dist/vega/p-1c298d5a.js +2 -0
- package/dist/vega/p-1d805cc0.entry.js +1 -0
- package/dist/vega/p-1dd9f841.entry.js +1 -0
- package/dist/vega/p-211df22a.entry.js +1 -0
- package/dist/vega/p-2205ee4c.js +1 -0
- package/dist/vega/p-29b09aad.js +1 -0
- package/dist/vega/{p-443ad3b3.js → p-2d0d575f.js} +1 -1
- package/dist/vega/p-2f32a9ba.js +1 -0
- package/dist/vega/{p-368d0060.js → p-2fbda931.js} +1 -1
- package/dist/vega/p-33b62194.js +1 -0
- package/dist/vega/p-36db2554.entry.js +1 -0
- package/dist/vega/p-3a6c9b9d.entry.js +1 -0
- package/dist/vega/p-42df8a42.js +1 -0
- package/dist/vega/{p-8f93242a.js → p-4387d550.js} +1 -1
- package/dist/vega/p-45c88f7f.entry.js +1 -0
- package/dist/vega/p-45dd4698.entry.js +1 -0
- package/dist/vega/p-465fa96d.entry.js +1 -0
- package/dist/vega/{p-3b4bde3e.js → p-4b500240.js} +1 -1
- package/dist/vega/{p-e0b25eaf.js → p-4f0b56fc.js} +1 -1
- package/dist/vega/p-5298fd92.entry.js +1 -0
- package/dist/vega/p-5915634b.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-70151c27.js → p-5f589974.js} +1 -1
- package/dist/vega/p-61116634.entry.js +1 -0
- package/dist/vega/p-618b35e4.entry.js +1 -0
- package/dist/vega/p-625771d7.entry.js +1 -0
- package/dist/vega/p-6661a462.entry.js +1 -0
- package/dist/vega/{p-62774231.js → p-6705c68a.js} +1 -1
- package/dist/vega/p-68f0aa72.entry.js +1 -0
- package/dist/vega/{p-59bdf9b8.js → p-6a334573.js} +1 -1
- package/dist/vega/p-6a3989dd.js +1 -0
- package/dist/vega/{p-0e0c47ad.js → p-6a5a5c7b.js} +1 -1
- package/dist/vega/p-6c09b79a.entry.js +1 -0
- package/dist/vega/p-6d23c08b.entry.js +1 -0
- package/dist/vega/p-6d43b123.entry.js +1 -0
- package/dist/vega/p-6e1ab235.js +1 -0
- package/dist/vega/p-71eeb279.entry.js +1 -0
- package/dist/vega/p-72eee5e2.js +1 -0
- package/dist/vega/{p-eac38d87.js → p-781fd6e0.js} +1 -1
- package/dist/vega/{p-1995e98e.js → p-79ec5d69.js} +1 -1
- package/dist/vega/p-8067bd31.entry.js +1 -0
- package/dist/vega/{p-3f1b542a.js → p-81dbada7.js} +1 -1
- package/dist/vega/{p-a6a7d0c9.js → p-8284a445.js} +1 -1
- package/dist/vega/p-84113217.entry.js +1 -0
- package/dist/vega/p-843b13e6.entry.js +1 -0
- package/dist/vega/p-84f2f342.js +1 -0
- package/dist/vega/p-85365f8b.js +1 -0
- package/dist/vega/p-8ab356e8.entry.js +1 -0
- package/dist/vega/p-8ba43640.entry.js +1 -0
- package/dist/vega/p-8be7b62c.entry.js +1 -0
- package/dist/vega/p-8d69f9ef.entry.js +1 -0
- package/dist/vega/p-91aa058f.entry.js +1 -0
- package/dist/vega/{p-8c26227e.js → p-926596cc.js} +1 -1
- package/dist/vega/p-92707b74.entry.js +1 -0
- package/dist/vega/p-96f0ef53.entry.js +1 -0
- package/dist/vega/p-97453cd8.entry.js +1 -0
- package/dist/vega/{p-843a0c1c.js → p-987fbbd0.js} +1 -1
- package/dist/vega/{p-296cc56b.js → p-9b797118.js} +1 -1
- package/dist/vega/p-a01f149d.entry.js +1 -0
- package/dist/vega/p-a0e90d5d.entry.js +1 -0
- package/dist/vega/{p-3953c705.js → p-af7a3154.js} +1 -1
- package/dist/vega/p-b2bca332.entry.js +1 -0
- package/dist/vega/p-b450bf46.entry.js +1 -0
- package/dist/vega/p-b5990090.js +1 -0
- package/dist/vega/p-b64981de.entry.js +1 -0
- package/dist/vega/p-b6815874.js +1 -0
- package/dist/vega/p-b688a71b.js +1 -0
- package/dist/vega/p-b9a09a76.js +1 -0
- package/dist/vega/p-bcb10ae3.entry.js +1 -0
- package/dist/vega/{p-39836361.js → p-be12fa36.js} +1 -1
- package/dist/vega/p-c02f650e.entry.js +1 -0
- package/dist/vega/p-c2b276f7.entry.js +1 -0
- package/dist/vega/p-c51a3e3c.entry.js +1 -0
- package/dist/vega/p-c88acd87.entry.js +1 -0
- package/dist/vega/p-cb8f8458.entry.js +1 -0
- package/dist/vega/p-cda26bdf.entry.js +1 -0
- package/dist/vega/p-d09d153f.entry.js +1 -0
- package/dist/vega/p-d994874a.entry.js +1 -0
- package/dist/vega/p-dbec03ed.entry.js +1 -0
- package/dist/vega/p-dcdac4d0.entry.js +1 -0
- package/dist/vega/p-de13b747.entry.js +1 -0
- package/dist/vega/p-de25326f.js +1 -0
- package/dist/vega/{p-e1e1fcf0.js → p-de664bdd.js} +1 -1
- package/dist/vega/p-e04d4ba3.entry.js +1 -0
- package/dist/vega/p-e8f540d8.js +1 -0
- package/dist/vega/p-e923637d.entry.js +1 -0
- package/dist/vega/p-efbea85a.entry.js +1 -0
- package/dist/vega/{p-81ead59a.js → p-f31bb1fd.js} +1 -1
- package/dist/vega/p-f690539e.entry.js +1 -0
- package/dist/vega/p-f6b89936.entry.js +1 -0
- package/dist/vega/p-f84fd31c.js +1 -0
- package/dist/vega/p-fe388812.entry.js +1 -0
- package/dist/vega/{p-acf7f903.js → p-ff4bafa3.js} +1 -1
- package/dist/vega/p-ff50c204.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/text-node-494856f3.js +0 -955
- package/dist/esm/text-node-a652ca87.js +0 -933
- package/dist/vega/p-0190095c.entry.js +0 -1
- package/dist/vega/p-034e6348.entry.js +0 -1
- package/dist/vega/p-0cd2b50f.entry.js +0 -1
- package/dist/vega/p-10393104.js +0 -1
- package/dist/vega/p-109a00cf.entry.js +0 -1
- package/dist/vega/p-11cb477b.js +0 -1
- package/dist/vega/p-1564cc4d.entry.js +0 -1
- package/dist/vega/p-18886765.entry.js +0 -1
- package/dist/vega/p-19b26168.entry.js +0 -1
- package/dist/vega/p-21992602.entry.js +0 -1
- package/dist/vega/p-22563151.entry.js +0 -1
- package/dist/vega/p-23795da1.entry.js +0 -1
- package/dist/vega/p-29277e41.entry.js +0 -1
- package/dist/vega/p-2a7e9422.entry.js +0 -1
- package/dist/vega/p-2ca6d977.entry.js +0 -1
- package/dist/vega/p-2e419309.entry.js +0 -1
- package/dist/vega/p-3039bef8.js +0 -1
- package/dist/vega/p-34939c97.entry.js +0 -1
- package/dist/vega/p-3897bb2d.entry.js +0 -1
- package/dist/vega/p-390c5236.entry.js +0 -1
- package/dist/vega/p-3ce31dc3.js +0 -1
- package/dist/vega/p-452e284a.js +0 -1
- package/dist/vega/p-4c41dd64.js +0 -1
- package/dist/vega/p-55beac7f.entry.js +0 -1
- package/dist/vega/p-57405834.entry.js +0 -1
- package/dist/vega/p-584dcd9b.js +0 -1
- package/dist/vega/p-589e6041.entry.js +0 -1
- package/dist/vega/p-5e95402a.entry.js +0 -1
- package/dist/vega/p-5eee21b4.entry.js +0 -1
- package/dist/vega/p-62cea2e7.entry.js +0 -1
- package/dist/vega/p-65b79fd7.js +0 -1
- package/dist/vega/p-6741e2b9.entry.js +0 -1
- package/dist/vega/p-6a084fe1.entry.js +0 -1
- package/dist/vega/p-6b286226.entry.js +0 -1
- package/dist/vega/p-6b722905.entry.js +0 -1
- package/dist/vega/p-6e4b2752.entry.js +0 -1
- package/dist/vega/p-7209d03b.js +0 -1
- package/dist/vega/p-734ea281.entry.js +0 -1
- package/dist/vega/p-76fc408e.entry.js +0 -1
- package/dist/vega/p-7a9f453e.entry.js +0 -1
- package/dist/vega/p-80ccd894.entry.js +0 -1
- package/dist/vega/p-84c597c8.entry.js +0 -1
- package/dist/vega/p-8836c1b9.js +0 -1
- package/dist/vega/p-8b78c6a3.entry.js +0 -1
- package/dist/vega/p-8be45a45.entry.js +0 -1
- package/dist/vega/p-8d7b45f7.entry.js +0 -1
- package/dist/vega/p-8e17b9dd.entry.js +0 -1
- package/dist/vega/p-8f004647.entry.js +0 -1
- package/dist/vega/p-925a2137.js +0 -1
- package/dist/vega/p-92f88033.entry.js +0 -1
- package/dist/vega/p-94de7a02.entry.js +0 -1
- package/dist/vega/p-9968e71d.entry.js +0 -1
- package/dist/vega/p-9c1eeff2.js +0 -2
- package/dist/vega/p-9d1b9e70.entry.js +0 -1
- package/dist/vega/p-9e732a26.entry.js +0 -1
- package/dist/vega/p-9f39dd10.js +0 -1
- package/dist/vega/p-a5ffe912.js +0 -1
- package/dist/vega/p-a6104aa7.js +0 -1
- package/dist/vega/p-a6169ad6.entry.js +0 -1
- package/dist/vega/p-a8bf559a.js +0 -1
- package/dist/vega/p-afec17ad.entry.js +0 -1
- package/dist/vega/p-b693c1ac.entry.js +0 -1
- package/dist/vega/p-b9e2add4.entry.js +0 -1
- package/dist/vega/p-bd894860.entry.js +0 -1
- package/dist/vega/p-c0d6a587.entry.js +0 -1
- package/dist/vega/p-c26e6820.entry.js +0 -1
- package/dist/vega/p-c34487e1.entry.js +0 -1
- package/dist/vega/p-c532b132.entry.js +0 -1
- package/dist/vega/p-ca2fb711.js +0 -1
- package/dist/vega/p-cebf93f1.entry.js +0 -1
- package/dist/vega/p-cfdc148a.entry.js +0 -1
- package/dist/vega/p-d0351d71.entry.js +0 -1
- package/dist/vega/p-d2ab6096.entry.js +0 -1
- package/dist/vega/p-d35643c5.entry.js +0 -1
- package/dist/vega/p-d400a1d9.entry.js +0 -1
- package/dist/vega/p-d6732a72.entry.js +0 -1
- package/dist/vega/p-d720b06a.entry.js +0 -1
- package/dist/vega/p-d987e404.entry.js +0 -1
- package/dist/vega/p-d9b86108.entry.js +0 -1
- package/dist/vega/p-e27e115d.entry.js +0 -1
- package/dist/vega/p-e65c8ac7.entry.js +0 -1
- package/dist/vega/p-e79057cc.js +0 -1
- package/dist/vega/p-e89e9769.entry.js +0 -1
- package/dist/vega/p-ecd64c7f.entry.js +0 -1
- package/dist/vega/p-f5b2e72a.entry.js +0 -1
- package/dist/vega/p-f6af3749.js +0 -1
- package/dist/vega/p-fc622a75.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as i,H as s,g as o}from"./p-1c298d5a.js";import{s as r}from"./p-9b797118.js";import{c as a,V as n,M as p,I as l}from"./p-6e1ab235.js";import{V as c,I as f}from"./p-4387d550.js";import{D as h}from"./p-29b09aad.js";import{f as m}from"./p-6a3989dd.js";import{C as d}from"./p-be12fa36.js";import{c as u}from"./p-e8f540d8.js";import{b as v}from"./p-d057999f.js";import{C as b}from"./p-2d0d575f.js";import{K as j}from"./p-de25326f.js";import{c as w,b as x}from"./p-262ec334.js";import{F as y}from"./p-2f32a9ba.js";import{R}from"./p-3152031c.js";import{c as C}from"./p-85365f8b.js";import"./p-79ec5d69.js";import"./p-0af4bda9.js";import"./p-5f377954.js";import"./p-ff4bafa3.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";import"./p-6a5a5c7b.js";import"./p-0bb29d98.js";import"./p-33b62194.js";import"./p-f357cf46.js";import"./p-de664bdd.js";import"./p-5f589974.js";import"./p-4bcd6612.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-a9354a5c.js";import"./p-b0502d01.js";var g=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class I extends n{constructor(){super(...arguments),this.onInputChange=t=>{this.valueController.updateValue(t.detail)}}getInputRef(){return this.vegaInputRef.shadowRoot.querySelector("input")}getContainerRef(){return this.vegaInputRef.shadowRoot.querySelector(".vega-input-container")}render(){const e={thousandComma:this.thousandComma};return this.integerOnly&&(e.precision=0),t("vega-input",{value:this.value||"",showClearIcon:!0,disabled:this.disabled,label:this.label,hint:this.hint,required:this.required,type:"number",placeholder:this.placeholder,size:"small"===this.size?"small":"default",prefixIcon:this.prefixIcon,ref:t=>{this.vegaInputRef=t,h.addUniqueObserverToNode(t,m,(t=>this.onInputChange(t)))},maskConfig:{type:"number",options:e}})}}g([a()],I.prototype,"prefixIcon",void 0),g([a()],I.prototype,"value",void 0),g([a()],I.prototype,"size",void 0),g([a()],I.prototype,"disabled",void 0),g([a()],I.prototype,"placeholder",void 0),g([a()],I.prototype,"label",void 0),g([a()],I.prototype,"hint",void 0),g([a()],I.prototype,"required",void 0),g([a()],I.prototype,"thousandComma",void 0),g([a()],I.prototype,"integerOnly",void 0),g([a()],I.prototype,"valueController",void 0);var T=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class V extends n{watchValue(){this.changeEventEmitter.emit(this.value),b.notify(v,{host:this.host,detail:this.value})}updateValue(t){this.value=t}}T([a()],V.prototype,"host",void 0),T([a({writable:!0})],V.prototype,"value",void 0),T([a()],V.prototype,"changeEventEmitter",void 0),T([p("watchValue")],V.prototype,"watchValue",null);var S=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class O extends j{constructor(){super((t=>[{keyCode:["ArrowUp","ArrowDown"],activeElementInScope:[t.host],callback:t.onArrowUpOrDown},{keyCode:["ArrowUp"],eventName:"keydown",activeElementInScope:[t.host],callback:t=>{t.preventDefault()}}])),this.onArrowUpOrDown=t=>{const e=t.shiftKey?this.majorIncrement:this.minorIncrement,i=w(this.value.replace(/,/g,""))||0,s=Math.max(x(i),x(e));"ArrowUp"===t.code?this.valueController.updateValue(`${(i+e).toFixed(s)}`):"ArrowDown"===t.code&&this.valueController.updateValue(`${(i-e).toFixed(s)}`)}}}S([a()],O.prototype,"host",void 0),S([a()],O.prototype,"value",void 0),S([a()],O.prototype,"minorIncrement",void 0),S([a()],O.prototype,"majorIncrement",void 0),S([a()],O.prototype,"valueController",void 0);var k=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const E=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.valueController=new V,this.keyboardController=new O,this.renderer=new I,this.changeEventEmitter=u(E,m),this.inputEventPrevent=new d([m],(()=>this.host),{useCapture:!0}),this.formFieldController=new y({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new R:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getContainerRef(),touchableAreaGetter:()=>[this.renderer.getInputRef()],defaultValue:"",attributeGetter:t=>this[t]}),this.prefixTextNotifySlimmer=C(E,"prefixText","watchPrefixText"),this.suffixTextNotifySlimmer=C(E,"suffixText","watchSuffixText"),this.isCompactInputWidthNotifySlimmer=C(E,"isCompactInputWidth"),this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.isCompactInputWidth=!0,this.prefixText="",this.value="",this.size="medium",this.thousandComma=!1,this.integerOnly=!1,this.disabled=!1,this.minorIncrement=1,this.majorIncrement=10,this.label="",this.validationRules=[],this.isValid=null,this.autoValidation=!0}watchPrefixText(){}watchSuffixText(){}watchValue(){}watchValidationRules(){}render(){return r(t(s,null,this.renderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{prefixText:["watchPrefixText"],suffixText:["watchSuffixText"],value:["watchValue"],validationRules:["watchValidationRules"]}}};k([f()],E.prototype,"globalSlimmers",void 0),k([l()],E.prototype,"valueController",void 0),k([l()],E.prototype,"keyboardController",void 0),k([l()],E.prototype,"renderer",void 0),k([l()],E.prototype,"changeEventEmitter",void 0),k([l()],E.prototype,"inputEventPrevent",void 0),k([l()],E.prototype,"formFieldController",void 0),k([l()],E.prototype,"prefixTextNotifySlimmer",void 0),k([l()],E.prototype,"suffixTextNotifySlimmer",void 0),k([l()],E.prototype,"isCompactInputWidthNotifySlimmer",void 0),k([l()],E.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),E.style=":host{display:inline-block;width:100%}";export{E as vega_input_numeric}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as n,H as i,g as a}from"./p-1c298d5a.js";import{s as o}from"./p-9b797118.js";import{I as r}from"./p-6e1ab235.js";import{V as l,I as s}from"./p-4387d550.js";import{c as v}from"./p-e8f540d8.js";import{a as g}from"./p-6a3989dd.js";import{C as b}from"./p-be12fa36.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-29b09aad.js";import"./p-0af4bda9.js";import"./p-79ec5d69.js";import"./p-5f377954.js";import"./p-ff4bafa3.js";import"./p-7a40e033.js";import"./p-112455b1.js";const d=[{payloadKey:"EVENTFUL_IS_TRUE",payloadDescription:"@deprecated Specifies whether the button link will emit a vegaClick event when clicked. If set to true, the event will be emitted.",payloadValue:t=>!0===t.eventful},{payloadKey:"EVENTFUL_IS_FALSE",payloadDescription:"@deprecated Specifies whether the button link will emit a vegaClick event when clicked. If set to false, the component will function as a regular link to another page or URL, and no events will be emitted.",payloadValue:t=>!1===t.eventful}];var c=function(t,e,n,i){var a,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(r=(o<3?a(r):o>3?a(e,n,r):a(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};const h=class{constructor(n){t(this,n),this.vegaClick=e(this,"vegaClick",7),this.click=e(this,"click",7),this.globalSlimmers={},this.clickEventEmitter=v(h,g),this.eventPrevent=new b([g],(()=>this.host)),this.vegaComponentUsageRuntimeMetricsSlimmer=new l(d),this.link=h.defaultLink,this.size="default",this.iconType="icon",this.iconAlign="left",this.label="",this.disabled=!1,this.danger=!1,this.eventful=!0,this.target="_self",this.onClick=t=>{this.disabled?t.preventDefault():this.clickEventEmitter.emit(this.host.dataset.key,t)}}componentWillLoad(){this.label||(this.label=this.host.textContent),this.host.innerHTML=""}render(){const t=this.isEventLink(),e=t?h.defaultLink:this.link;return o(n(i,{class:{"vega-button-link-disabled":this.disabled}},n("a",{tabIndex:this.disabled?-1:0,role:t?"button":"link","aria-label":this.label.trim()||"No label defined",href:e,onClick:t&&this.onClick,class:{"vega-button-link":!0,[`vega-button-link-size-${this.size}`]:!0,"vega-button-link-left-button":this.hasIconButton("left"),"vega-button-link-right-button":this.hasIconButton("right"),"vega-button-link-danger":this.danger},rel:"noopener noreferrer",target:this.target},n("div",{class:"vega-button-link-content"},this.renderContent()),n("div",{class:"vega-button-link-outer-border",part:"link-border"}))),this.host)}hasIconButton(t){return this.icon&&"button"===this.iconType&&this.iconAlign===t}renderContent(){return this.icon?n("vega-flex",{alignItems:"center",gap:this.getGapByButtonSize(),justifyContent:"center"},"left"===this.iconAlign&&this.renderIcon(),this.renderLabel(),"right"===this.iconAlign&&this.renderIcon()):this.renderLabel()}getGapByButtonSize(){return"large"===this.size?"size-16":"small"===this.size?"size-8":"default"===this.size?"icon"===this.iconType?"size-8":"size-12":void 0}renderLabel(){return this.label&&n("span",{class:"vega-button-link-label",part:"label-container"},n("vega-text",{part:"label-text"},this.label))}renderIcon(){return n("div",{class:`vega-button-link-${this.iconType} vega-flex-shrink-0 v-min-w-min`},"icon"===this.iconType?this.renderVegaIcon():n("div",{class:"vega-button-link-button-container"},this.renderVegaIcon()))}renderVegaIcon(){return n("vega-icon",{icon:this.icon,size:"large"===this.size?"size-24":"size-16"})}isEventLink(){return!this.link||this.link===h.defaultLink}get host(){return a(this)}};h.defaultLink="javascript:void(0);",c([s()],h.prototype,"globalSlimmers",void 0),c([r()],h.prototype,"clickEventEmitter",void 0),c([r()],h.prototype,"eventPrevent",void 0),c([r()],h.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),h.style=':host{display:inline-block;position:relative;margin:0px;line-height:normal}a{text-decoration:none;color:rgba(var(--v-text-link, 19, 98, 226, 1));background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));outline:none}a:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}a:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}a:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}a:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}a:not(.vega-button-link-danger):visited vega-icon svg *[fill=currentColor]{fill:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}a:not(.vega-button-link-danger):visited vega-icon svg *[stroke=currentColor]{stroke:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}a:not(.vega-button-link-danger):hover vega-icon svg *[fill=currentColor]{fill:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}a:not(.vega-button-link-danger):hover vega-icon svg *[stroke=currentColor]{stroke:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}a:not(.vega-button-link-danger):active vega-icon svg *[fill=currentColor]{fill:rgba(var(--v-text-link-active, 29, 65, 195, 1))}a:not(.vega-button-link-danger):active vega-icon svg *[stroke=currentColor]{stroke:rgba(var(--v-text-link-active, 29, 65, 195, 1))}a:not(.vega-button-link-danger):focus-visible vega-icon svg *[fill=currentColor]{fill:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}a:not(.vega-button-link-danger):focus-visible vega-icon svg *[stroke=currentColor]{stroke:rgba(var(--v-text-link-focus, 4, 112, 236, 1))}:host>a:hover .vega-button-link-label,:host>a:focus-visible .vega-button-link-label{text-decoration:underline}a:active{text-decoration:none}a:active:hover .vega-button-link-label{text-decoration:none}a.vega-button-link-danger{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1))}a.vega-button-link-danger:visited{color:rgba(var(--v-text-danger-link-visited, 230, 50, 87, 1))}a.vega-button-link-danger:hover{color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}a.vega-button-link-danger:active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1))}a.vega-button-link-danger:focus-visible{color:rgba(var(--v-text-danger-link-focus, 240, 52, 91, 1))}a .vega-button-link-button-container{border-radius:9999px;cursor:pointer;background-color:rgba(var(--v-bg-action-secondary, 252, 252, 252, 1));color:rgba(var(--v-text-link, 19, 98, 226, 1));box-sizing:border-box;border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}a:visited .vega-button-link-button-container{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1));border-color:var(--v-text-link-visited)}a:hover .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-btn-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-action-secondary-hover, 4, 112, 236, 0.1));color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}a:focus .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}a:active .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-btn-active, 29, 65, 195, 1));background-color:rgba(var(--v-bg-action-secondary-active, 29, 65, 195, 0.1));color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}a.vega-button-link-danger .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-danger-btn, 230, 50, 87, 1));color:rgba(var(--v-text-danger-link, 230, 50, 87, 1))}a.vega-button-link-danger:hover .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-danger-btn-hover, 255, 87, 114, 1));background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}a.vega-button-link-danger:focus .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-danger-btn, 230, 50, 87, 1))}a.vega-button-link-danger:active .vega-button-link-button-container{border:2px solid rgba(var(--v-border-secondary-danger-btn-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2));color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1))}a.vega-button-link-size-default .vega-button-link-button-container{width:40px;height:40px;padding:10px}a.vega-button-link-size-large .vega-button-link-button-container{width:56px;height:56px;padding:14px}a.vega-button-link-size-small .vega-button-link-button-container{width:32px;height:32px;padding:6px}a.vega-button-link-size-default .vega-button-link-icon,a.vega-button-link-size-small .vega-button-link-icon{width:16px;height:16px;line-height:16px}a.vega-button-link-size-large .vega-button-link-icon{width:24px;height:24px;line-height:24px}a .vega-button-link-label{min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content}a.vega-button-link-size-small .vega-button-link-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){a.vega-button-link-size-small .vega-button-link-label{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){a.vega-button-link-size-small .vega-button-link-label{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){a.vega-button-link-size-small .vega-button-link-label{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px;letter-spacing:0px}}a.vega-button-link-size-default .vega-button-link-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){a.vega-button-link-size-default .vega-button-link-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){a.vega-button-link-size-default .vega-button-link-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){a.vega-button-link-size-default .vega-button-link-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:700;line-height:24px;letter-spacing:0px}}a.vega-button-link-size-large .vega-button-link-label{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){a.vega-button-link-size-large .vega-button-link-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){a.vega-button-link-size-large .vega-button-link-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){a.vega-button-link-size-large .vega-button-link-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:24px;letter-spacing:0px}}a:focus-visible>.vega-button-link-outer-border{position:absolute;pointer-events:none;border-radius:9999px;box-shadow:0 0 0 4px rgba(var(--v-ring-action-focus, 19, 98, 226, 0.25));display:inline-block;top:-4px;left:-8px;height:calc(100% + 8px);width:calc(100% + 16px);visibility:visible !important}a.vega-button-link-left-button:focus>.vega-button-link-outer-border{left:-4px}a.vega-button-link-right-button:focus>.vega-button-link-outer-border{width:calc(100% + 12px)}a.vega-button-link-danger:focus-visible>.vega-button-link-outer-border{box-shadow:0 0 0 4px rgba(var(--v-ring-action-danger-focus, 230, 50, 87, 0.25))}:host(.vega-button-link-disabled){pointer-events:none}:host(.vega-button-link-disabled) a{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));text-decoration:none;background-color:rgba(var(--v-bg-action-secondary, 252, 252, 252, 1))}:host(.vega-button-link-disabled) a.vega-button-link .vega-button-link-button-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));border:2px solid rgba(var(--v-border-secondary-btn-disabled, 176, 180, 181, 1));background-color:rgba(var(--v-bg-action-secondary, 252, 252, 252, 1))}:host(.vega-button-link-disabled) a:focus>.vega-button-link-content{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.vega-button-link-disabled) a:focus>.vega-button-link-outer-border{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0, 0, 0, 0))}';export{h as vega_button_link}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t,I as e,V as i,L as s,M as o}from"./p-9c1eeff2.js";import{f as n,c as h,i as r}from"./p-1995e98e.js";import{I as c}from"./p-eac38d87.js";import{c as l}from"./p-59bdf9b8.js";import{P as a}from"./p-70151c27.js";import{P as u,A as d}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-62774231.js";class v{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],v.prototype,"showConfig",void 0);class m{canRetrieve(){return!this.showConfig.isScreenPosition}}class g extends m{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],g.prototype,"showConfig",void 0);class b extends m{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],b.prototype,"showConfig",void 0);class w extends m{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],w.prototype,"showConfig",void 0);var R=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class j extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new g,this.vegaPopoverWrapper=new w,this.vegaModalWrapper=new b,this.defaultWrapper=new v}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}R([t({writable:!0})],j.prototype,"container",void 0),R([t({writable:!0})],j.prototype,"showConfig",void 0),R([e()],j.prototype,"positionRelativeToWrapper",void 0),R([e()],j.prototype,"vegaPopoverWrapper",void 0),R([e()],j.prototype,"vegaModalWrapper",void 0),R([e()],j.prototype,"defaultWrapper",void 0);class y extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var x=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class C extends y{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}x([t()],C.prototype,"container",void 0),x([t()],C.prototype,"showConfig",void 0);class O extends y{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new C,this.screenPositionStrategy=new O}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}S([t()],E.prototype,"container",void 0),S([t()],E.prototype,"showConfig",void 0),S([e()],E.prototype,"bodyPositionStrategy",void 0),S([e()],E.prototype,"screenPositionStrategy",void 0);var A=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class P{constructor(t,e){var i;this.resizeObserverSlimmer=l(P,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new j,this.positionCalculationController=new E,this.showConfigCallback=t,this.showConfigCallbackTarget=e,null===(i=this.getShowConfig().appendableElement)||void 0===i||i.classList.add("vega-force-hidden")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=P.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=P.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=P.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,P.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){const t=window.getComputedStyle(this.container).position;P.containerMap.has(this.container)||P.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative"),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}P.containerMap=new Map,A([e()],P.prototype,"resizeObserverSlimmer",void 0),A([e()],P.prototype,"elementAppenderContainerController",void 0),A([e()],P.prototype,"positionCalculationController",void 0);var k=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class T extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0})},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;t.relatedTarget!==(null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)&&this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),T.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1}destroy(){this.elementAppender=null,this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new P(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler)}}T.DELAY_HIDE_TIME=100,k([o("connectedCallback")],T.prototype,"connectedCallback",null),k([o("disconnectedCallback")],T.prototype,"disconnectedCallback",null),k([o("componentDidLoad")],T.prototype,"componentDidLoad",null);export{T as E}
|
|
1
|
+
import{c as t,I as e,V as i,L as s,M as o}from"./p-6e1ab235.js";import{f as n,c as h,i as r}from"./p-79ec5d69.js";import{I as c}from"./p-781fd6e0.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-5f589974.js";import{P as u,A as d}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-6705c68a.js";class v{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],v.prototype,"showConfig",void 0);class m{canRetrieve(){return!this.showConfig.isScreenPosition}}class g extends m{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],g.prototype,"showConfig",void 0);class b extends m{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],b.prototype,"showConfig",void 0);class w extends m{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],w.prototype,"showConfig",void 0);var R=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class j extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new g,this.vegaPopoverWrapper=new w,this.vegaModalWrapper=new b,this.defaultWrapper=new v}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}R([t({writable:!0})],j.prototype,"container",void 0),R([t({writable:!0})],j.prototype,"showConfig",void 0),R([e()],j.prototype,"positionRelativeToWrapper",void 0),R([e()],j.prototype,"vegaPopoverWrapper",void 0),R([e()],j.prototype,"vegaModalWrapper",void 0),R([e()],j.prototype,"defaultWrapper",void 0);class y extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var x=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class C extends y{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}x([t()],C.prototype,"container",void 0),x([t()],C.prototype,"showConfig",void 0);class O extends y{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new C,this.screenPositionStrategy=new O}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}S([t()],E.prototype,"container",void 0),S([t()],E.prototype,"showConfig",void 0),S([e()],E.prototype,"bodyPositionStrategy",void 0),S([e()],E.prototype,"screenPositionStrategy",void 0);var A=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class P{constructor(t,e){var i;this.resizeObserverSlimmer=l(P,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new j,this.positionCalculationController=new E,this.showConfigCallback=t,this.showConfigCallbackTarget=e,null===(i=this.getShowConfig().appendableElement)||void 0===i||i.classList.add("vega-force-hidden")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=P.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=P.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=P.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,P.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){const t=window.getComputedStyle(this.container).position;P.containerMap.has(this.container)||P.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative"),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}P.containerMap=new Map,A([e()],P.prototype,"resizeObserverSlimmer",void 0),A([e()],P.prototype,"elementAppenderContainerController",void 0),A([e()],P.prototype,"positionCalculationController",void 0);var k=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class T extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0})},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;t.relatedTarget!==(null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)&&this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),T.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1}destroy(){this.elementAppender=null,this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new P(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler)}}T.DELAY_HIDE_TIME=100,k([o("connectedCallback")],T.prototype,"connectedCallback",null),k([o("disconnectedCallback")],T.prototype,"disconnectedCallback",null),k([o("componentDidLoad")],T.prototype,"componentDidLoad",null);export{T as E}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,g as e,H as i}from"./p-1c298d5a.js";import{B as r,a,L as o,P as n,b as c,c as h}from"./p-d171cf44.js";import{t as l,a as p,s as u,b as d,c as m,d as f,e as w,f as b,g as v,X as y,Y as j,h as g,i as S}from"./p-1ec4b319.js";import{f as x,c as O,s as A,a as k}from"./p-b0502d01.js";import{s as R}from"./p-9b797118.js";import{I as T}from"./p-6e1ab235.js";import{V as C,I as H}from"./p-4387d550.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-262ec334.js";class I extends r{addInteractionSupport(){}draw(){const{positions:t,colors:s}=this.options.renderOptions;let e=t;t&&t[0]&&!Array.isArray(t[0])&&(e=[t]),e.forEach(((t,e)=>{const i=this.getColorByIndex(e,s);this.renderer.drawLinePath(t,this.getColorFromToken(i)),t.forEach((t=>{this.renderer.drawCircle(t,4,this.getColorFromToken("bg-primary"),2,this.getColorFromToken(i))}))}))}}class P{process(t,s){const{dataSource:e,colors:i}=t,{xScale:r,yScale:a}=s;return{positions:this.getPathPositions(e,r,a),colors:i}}getPathPositions(t,s,e){let i=[];const r=x(t).map((({x:t,y:i})=>({x:s(t),y:e(i)})));let a=[];return t&&Array.isArray(t[0])?(i=t.map((t=>t.length)),a=O(r,i)):a=[r],a}}class L{process(t){const{dataSource:s,xAxis:e}=t;let i=s;return"time"===((null==e?void 0:e.type)||"value")&&(i=this.formatTimePositionArray(s)),t.dataSource=i,t}formatTimePositionArray(t){let s=[],e=[];const i=function(t,s){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t,(t=>s(t)))}(x(t),(t=>({x:"string"==typeof t.x?l("%Y-%m-%d")(t.x):t.x,y:t.y})));return t&&Array.isArray(t[0])?(e=t.map((t=>t.length)),s=O(i,e)):s=i,s}}class Y{process(t){const{dataSource:s,xAxis:e}=t;let i=s;switch((null==e?void 0:e.type)||"value"){case"time":i=k(s,(t=>t.x.valueOf()));break;case"value":i=k(s,(t=>t.x));break;case"category":i=A(s,(t=>t.x),e.sorter)}return t.dataSource=i,t}}class M{constructor(){this.formatMillisecond=p(".%L"),this.formatSecond=p(":%S"),this.formatMinute=p("%I:%M"),this.formatHour=p("%H:00"),this.formatDay=p("%d"),this.formatWeek=p("%b %d"),this.formatMonth=p("%b"),this.formatYear=p("%Y")}process(t,s){const{xAxis:e}=t;return"time"===((null==e?void 0:e.type)||"value")&&"function"!=typeof s.labelFormatter&&(s.scale.tickFormat=()=>this.timeFormatter.bind(this)),s}timeFormatter(t){return(u(t)<t?this.formatMillisecond:d(t)<t?this.formatSecond:m(t)<t?this.formatMinute:f(t)<t?this.formatHour:w(t)<t?b(t)<t?this.formatDay:this.formatWeek:v(t)<t?this.formatMonth:this.formatYear)(t)}}class _ extends a{constructor(){super(...arguments),this.layoutInputProcessor=new o,this.lineDataSourceInputProcessorChain=new n([new L,new Y]),this.xAxisInputProcessorChain=new n([this.layoutInputProcessor,new y,new M]),this.yAxisInputProcessorChain=new n([this.layoutInputProcessor,new j]),this.legendInputProcessorChain=new n([this.layoutInputProcessor,new c]),this.linePathInputProcessor=new P}createDrawerChain(t,s){const e=this.lineDataSourceInputProcessorChain.process(this.options),i=this.xAxisInputProcessorChain.process(e),r=this.yAxisInputProcessorChain.process(e);return[new g(t,s,{renderOptions:i}),new S(t,s,{renderOptions:r}),new h(t,s,{renderOptions:this.legendInputProcessorChain.process(this.options)}),new I(t,s,{renderOptions:this.linePathInputProcessor.process(e,{xScale:i.scale,yScale:r.scale})})]}}var B=function(t,s,e,i){var r,a=arguments.length,o=a<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(a<3?r(o):a>3?r(s,e,o):r(s,e))||o);return a>3&&o&&Object.defineProperty(s,e,o),o};const D=class{constructor(s){t(this,s),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new C}watchOptionsHandel(t){this.updateChart(t)}disconnectedCallback(){this.chart=null,this.reRenderTimer&&clearTimeout(this.reRenderTimer)}componentWillLoad(){this.updateChart(this.options)}async reRender(){this.reRenderTimer&&clearTimeout(this.reRenderTimer),this.reRenderTimer=setTimeout((()=>{this.chart.reRender()}),0)}render(){return R(s(i,null),this.host)}updateChart(t){if(!t)return;const{mode:s="svg",dataSource:e}=t,i=function(t,s){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&s.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)s.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(e[i[r]]=t[i[r]])}return e}(t,["mode","dataSource"]),r=Object.assign(Object.assign({},i),{mode:s,container:this.host,dataSource:e||[]});this.chart?this.chart.updateOptions(r):(this.chart=new _(r),this.chart.render())}get host(){return e(this)}static get watchers(){return{options:["watchOptionsHandel"]}}};B([H()],D.prototype,"globalSlimmers",void 0),B([T()],D.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),D.style=".vega-chart-legend-item{cursor:pointer}.vega-chart-line-path:hover{stroke-width:5}:host{display:block}";export{D as vega_line_chart}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,H as o,g as a}from"./p-1c298d5a.js";import{s as r}from"./p-9b797118.js";import{I as i}from"./p-000b3ab0.js";import{c as n,M as p,I as l}from"./p-6e1ab235.js";import{V as s,I as c}from"./p-4387d550.js";import{E as g}from"./p-f31bb1fd.js";import{c as d}from"./p-5915634b.js";import"./p-6a5a5c7b.js";import"./p-79ec5d69.js";import"./p-781fd6e0.js";import"./p-262ec334.js";import"./p-6a334573.js";import"./p-5f589974.js";import"./p-4bcd6612.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b1f65b13.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-6705c68a.js";import"./p-0c667d6a.js";import"./p-47a4c625.js";var h=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};class m extends g{constructor(){super((()=>({target:this.host,appendableElement:this.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef(),positionRelativeTo:this.positionRelativeTo,matchTargetWidth:!1,size:this.size,minWidth:this.minWidth,maxWidth:this.maxWidth,placement:this.placement,alignment:this.alignment})),(()=>this.trigger),"isTooltipShow",(()=>this.disableInteractive))}watchTrigger(){"none"===this.trigger&&this.hide()}watchToShowTooltip(){this.isTooltipShow&&this.show()}}h([n()],m.prototype,"host",void 0),h([n()],m.prototype,"positionRelativeTo",void 0),h([n()],m.prototype,"size",void 0),h([n()],m.prototype,"minWidth",void 0),h([n()],m.prototype,"maxWidth",void 0),h([n()],m.prototype,"placement",void 0),h([n()],m.prototype,"alignment",void 0),h([n()],m.prototype,"trigger",void 0),h([n()],m.prototype,"disableInteractive",void 0),h([n({writable:!0})],m.prototype,"isTooltipShow",void 0),h([n()],m.prototype,"vegaTooltipContentBoxRenderer",void 0),h([p("watchTrigger")],m.prototype,"watchTrigger",null),h([p("watchToShowTooltip")],m.prototype,"watchToShowTooltip",null);class v{getTooltipContentBoxRef(){return this.tooltip}render(){return t("vega-tooltip-content-box",{ref:t=>this.tooltip=t,text:this.deprecatedPropertySlimmer.getValue()})}}!function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);i>3&&n&&Object.defineProperty(e,o,n)}([n()],v.prototype,"deprecatedPropertySlimmer",void 0);const f=[{payloadKey:"CONTENT_IS_EMPTY",payloadDescription:"@deprecated Specifies the content that is displayed inside the tooltip.",payloadValue:t=>void 0===t.content||""===t.content},{payloadKey:"CONTENT_IS_NOT_EMPTY",payloadDescription:"@deprecated Specifies the content that is displayed inside the tooltip.",payloadValue:t=>void 0!==t.content&&""!==t.content}];var b=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};const x=class{constructor(t){e(this,t),this.globalSlimmers={},this.vegaTooltipElementAppenderController=new m,this.vegaTooltipContentBoxRenderer=new v,this.deprecatedPropertySlimmer=d(x,"text","content",void 0),this.vegaComponentUsageRuntimeMetricsSlimmer=new s(f),this.isTooltipShow=!1,this.trigger="hover",this.placement="top",this.alignment="center",this.disableInteractive=!1}watchTrigger(){}watchToShowTooltip(){}render(){return r(t(o,null,t("slot",null),this.vegaTooltipContentBoxRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{trigger:["watchTrigger"],size:["watchToShowTooltip"],placement:["watchToShowTooltip"],alignment:["watchToShowTooltip"]}}};b([c()],x.prototype,"globalSlimmers",void 0),b([l()],x.prototype,"vegaTooltipElementAppenderController",void 0),b([l()],x.prototype,"vegaTooltipContentBoxRenderer",void 0),b([i((t=>[{keyCode:"Tab",activeElementInScope:[t.host],callback:()=>"hover"===t.trigger&&t.vegaTooltipElementAppenderController.show()},{keyCode:"Escape",activeElementInScope:[t.host,t.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef()],callback:()=>t.vegaTooltipElementAppenderController.hide()},{keyCode:"Tab",activeElementOutScope:[t.host,t.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef()],callback:()=>t.isTooltipShow&&t.vegaTooltipElementAppenderController.hide()}])),l()],x.prototype,"deprecatedPropertySlimmer",void 0),b([l()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),x.style=":host{display:inline-block}";var w=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};const u=class{constructor(t){e(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new s}render(){return r(t(o,{class:"vega-tooltip",role:"tooltip"},t("div",{class:"vega-tooltip-content"},this.text)),this.host)}get host(){return a(this)}};w([c()],u.prototype,"globalSlimmers",void 0),w([l()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u.style=':host{position:absolute}:host(.vega-force-hidden){display:none !important}:host(.vega-placement-bottom){margin-top:8px}:host(.vega-placement-left){margin-left:-8px}:host(.vega-placement-right){margin-left:8px}:host(.vega-placement-top){margin-top:-8px}.vega-tooltip-content{border-radius:4px;padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;overflow-wrap:break-word;background-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-tooltip-content{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-tooltip-content{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-tooltip-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-tooltip-content::after{content:"";position:absolute;border-style:solid}:host(.vega-placement-bottom) .vega-tooltip-content::after{top:-4px;border-width:0 5px 4px 5px;border-bottom-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-left-color:transparent;border-right-color:transparent}:host(.vega-placement-left) .vega-tooltip-content::after{left:100%;border-width:5px 0 5px 4px;border-left-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-bottom-color:transparent;border-right-color:transparent}:host(.vega-placement-right) .vega-tooltip-content::after{left:-4px;border-width:5px 4px 5px 0;border-right-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent}:host(.vega-placement-top) .vega-tooltip-content::after{bottom:-4px;border-width:4px 5px 0px 5px;border-top-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-bottom-color:transparent;border-left-color:transparent;border-right-color:transparent}:host(.vega-placement-bottom.vega-alignment-start) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-start) .vega-tooltip-content::after{left:8px}:host(.vega-placement-bottom.vega-alignment-center) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-center) .vega-tooltip-content::after{left:calc(50% - 5px)}:host(.vega-placement-bottom.vega-alignment-end) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-end) .vega-tooltip-content::after{right:8px}:host(.vega-placement-left.vega-alignment-start) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-start) .vega-tooltip-content::after{top:8px}:host(.vega-placement-left.vega-alignment-center) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-center) .vega-tooltip-content::after{top:calc(50% - 5px)}:host(.vega-placement-left.vega-alignment-end) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-end) .vega-tooltip-content::after{bottom:8px}';export{x as vega_tooltip,u as vega_tooltip_content_box}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as t,B as s,a as e,M as i,b as n,s as r,N as h,c as o,R as a,d as c,A as u,I as l,V as d}from"./p-926596cc.js";import{O as p,d as f}from"./p-6a3989dd.js";import{C as w}from"./p-2d0d575f.js";import{a as b,V as k,b as m}from"./p-f357cf46.js";import{i as g}from"./p-b1f65b13.js";import"./p-6e1ab235.js";import{g as x}from"./p-33b62194.js";const y=async()=>t.handle(),N=async t=>new Promise((s=>{const e=new p(A.bind(null),(()=>{w.unregister(f.getSubject(t,b),e),s(null)}));w.register(f.getSubject(t,b),e)})),A=()=>!0;class O extends s{constructor(t){super(),this.type=e.ALIGNMENT,this.textAlign=t}static from(t){return[e.ALIGNMENT,new O(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}render(){return null}}class S extends s{constructor(t){super(),this.type=e.INDENT,this.indent=Math.max(0,t)}static from(t){return[e.INDENT,new S(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class B{replaceBlockWithBlocks(t,s){this.blocks&&(s.forEach((t=>{t.parent=this})),this.blocks=this.blocks.flatMap((e=>e===t?s:e)))}appendChildBlocks(t){this.blocks&&(t.forEach((t=>{t.parent=this})),this.blocks=this.blocks.concat(t))}removeChildBlock(t){this.blocks&&(this.blocks=this.blocks.filter((s=>s!==t)))}}class j extends i{constructor(t){super(),this.type=n.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class C extends i{constructor(t){super(),this.type=n.DELETE_CHILD,this.entityToBeRemoved=t}}const v=[{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"}],M="";class I extends B{constructor(t){super(),this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,s){switch(t){case"textAlign":return O.from(s);case"indent":return S.from(s)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof s)).reduce(((t,s)=>Object.assign(Object.assign({},t),s.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(t){if(this.doApply(t),t.isFlushable){const t=r.getDOMByEntity(this);if(t){const s=f.getSubjectFromParentNodeByEventId(t,k);s&&w.notify(s,{})}}}doApply(t){t instanceof i?this.doModifyActionApply(t):this.applyAnnotationAction(t)}applyAnnotationAction(t){const s=t.toAnnotation();this.annotationMap.set(s.type,s),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}appendChildNodes(t){t.forEach((t=>{t.parentBlock=this})),this.nodes=this.nodes.concat(t)}mergeTwoBlocksNodes(t){if(this.type===t.type||"image"!==this.type&&"image"!==t.type){let s=t.nodes;"image"!==this.type&&(s=t.nodes.filter((t=>t.text&&""!==t.text))),this.apply(new j(s)),t.parent.apply(new C(t))}}concatBlocksNodes(t){const s=[];return t.map((t=>{"image"!==t.type&&(s.push(...t.nodes),t.parent.apply(new C(t)))})),s}getPreviousNode(t){const s=t.parentBlock,e=s.nodes.indexOf(t);if(e>0)return s.nodes[e-1];if(s.parent){const t=this.getPreviousBlock(s);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const s=t.parentBlock,e=s.nodes.indexOf(t);if(s.nodes[e+1])return s.nodes[e+1];if(s.parent){const t=this.getNextBlock(s);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const s=t.parentBlock,e=s.nodes.indexOf(t),i=s.parent;if("list-item"===s.type){const t=i.parent;return 0===e&&Array.isArray(i.blocks)&&i.blocks[0]===s&&"list-item"!==t.type&&Array.isArray(t.blocks)&&t.blocks[0]===i}return 0===e&&Array.isArray(i.blocks)&&i.blocks[0]===s}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){if(t.blocks)return this.getBlockLastNode(t.blocks[t.blocks.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]}getPreviousBlock(t){if(t&&t.parent&&t.parent.blocks){const s=t.parent.blocks.indexOf(t);if(s>0)return t.parent.blocks[s-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===s)return this.getPreviousBlock(t.parent)}}getNextBlock(t){if(t&&t.parent&&t.parent.blocks){const s=t.parent.blocks.indexOf(t);if(t.parent.blocks[s+1])return t.parent.blocks[s+1];if("list-item"===t.type&&t.parent.blocks.length===s+1)return this.getNextBlock(t.parent)}}replaceNodeWithNodes(t,s){this.nodes&&(s.forEach((t=>{t.parentBlock=this})),this.nodes=this.nodes.flatMap((e=>e===t?s:e)))}}class L extends h{constructor(t="md",s){super(),this.type=o.IMAGE,this.size=t,this.alt=s}static from(t,s){return[o.IMAGE,new L(t,s)]}toJSON(){return g(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class E extends a{constructor(t,s,e,i){super(t,i),this.type=c.IMAGE,this.url=s,this.parentBlock=e}static from(t,s){const e=new E(t.id,t.url,s);let i;return i=t.annotations&&0!==Object.keys(t.annotations).length?t.annotations:{size:"md"},e.annotationMap=new Map(Object.keys(i).map((()=>L.from(i.size,i.alt))).filter(g)),e}toJSON(){const t=this.annotationMap.get(o.IMAGE),s={};return(null==t?void 0:t.size)&&(s.size=t.size),(null==t?void 0:t.alt)&&(s.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(s).length>0?{annotations:s}:{}),{type:"image",url:this.url})}doAnnotationActionApply(t){const s=t.toAnnotation();this.annotationMap.set(s.type,s)}doModifyActionApply(t){}}class J extends i{constructor(t){super(),this.type=n.REPLACE_CHILD_NODES,this.newChildNodes=t}}class T extends i{constructor(t,...s){super(),this.type=n.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=s}}class F extends i{constructor(t,s){super(),this.type=n.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=s}}class W{}class P extends W{constructor(){super(...arguments),this.doSplit=!0}}class z extends u{constructor(t){super(),this.type=l.SELECTION_RANGE,this.range=t}}class H extends h{constructor(t){super(),this.type=o.STRIKETHROUGH,this.strikethrough=t}static from(t){return[o.STRIKETHROUGH,new H(t)]}toJSON(){return{strikethrough:this.strikethrough}}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class D extends h{constructor(t){super(),this.type=o.UNDERLINE,this.underline=t}static from(t){return[o.UNDERLINE,new D(t)]}toJSON(){return{underline:this.underline}}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class K extends h{constructor(t){super(),this.type=o.ITALIC,this.italic=t}static from(t){return[o.ITALIC,new K(t)]}toJSON(){return{italic:this.italic}}render(){return this.italic?{"font-style":"italic"}:null}}class q extends h{constructor(t){super(),this.type=o.BOLD,this.bold=t}static from(t){return[o.BOLD,new q(t)]}toJSON(){return{bold:this.bold}}render(){return this.bold?{"font-weight":"700"}:null}}class R extends u{constructor(){super(...arguments),this.type=l.CLEAR_FORMATTING,this.items=[o.BOLD,o.ITALIC,o.UNDERLINE,o.STRIKETHROUGH,o.TEXT_COLOR,o.CODE]}}class U extends h{constructor(t){super(),this.type=o.CODE,this.code=t}static from(t){return[o.CODE,new U(t)]}toJSON(){return{code:this.code}}renderClass(){return this.code?"v-rte--code":null}render(){return null}}class V extends h{constructor(t){super(),this.type=o.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[o.TEXT_COLOR,new V(t)]}toJSON(){return{textColor:this.textColor.key}}renderClass(){return null}render(){return{color:d.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return v.find((s=>s.key===t))||v[0]}}class Z extends h{constructor(t){super(),this.type=o.LINK,this.link=t}static from(t){return[o.LINK,new Z({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class $ extends P{constructor({link:t,newText:s,needMergeNode:e,doSplit:i}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=e,this.newText=s,g(i)&&(this.doSplit=i)}toAnnotation(){return new Z(this.link)}}class G extends P{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new U(this.code)}}class Q extends P{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new R}}class X extends i{constructor(t){super(),this.type=n.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Y extends u{constructor(t){super(),this.type=l.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}}class _ extends W{constructor(t,s){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=s}toAnnotation(){return new Y(this.groupKey)}}class tt extends W{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class st extends W{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class et extends a{constructor(t,s,e,i){super(t,i),this.type=c.TEXT,this.parentBlock=e,this.text=s}static from(t,s){const e=new et(t.id,t.text,s),{annotations:i}=t;return i&&(e.annotationMap=new Map(Object.keys(i).map((t=>(i.link&&s.apply(new _(i.link.groupKey,[e])),this.createAnnotationEntity(t,i[t])))).filter(g))),e}static createAnnotationEntity(t,s){switch(t){case"bold":return q.from(s);case"italic":return K.from(s);case"underline":return D.from(s);case"strikethrough":return H.from(s);case"code":return U.from(s);case"textColor":return V.from(s);case"link":return Z.from(s)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof h)).reduce(((t,s)=>Object.assign(Object.assign({},t),s.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 et(x(),t,this.parentBlock,new Map(this.annotationMap))}isEmpty(){return!this.text||""===this.text||"\n"===this.text}doAnnotationActionApply(t){const s=this.getAnnotationByType(l.SELECTION_RANGE);if(t instanceof P&&t.doSplit&&s){const{startContainer:e,endContainer:i,startOffset:n,endOffset:r}=s.range,h=e===i&&n===r;this.parentBlock.nodes=this.parentBlock.nodes.flatMap((e=>e.id===this.id?h?this.insertNewNode(n,t):this.shouldSplitSelection(s.range)?this.splitTextNode(t,s.range):(this.applyActionToNode(this,t),this):e))}else this.applyActionToNode(this,t);this.parentBlock.mergeNodes(t)}doModifyActionApply(t){switch(t.type){case n.UPDATE_TEXT:this.updateText(t.newTextContent);break;case n.REPLACE_SELECTED_TEXT:this.replaceSelectedText(t.textToBeInsert,t.currentRange)}}splitTextNode(t,s){const{startContainer:e,endContainer:i,startOffset:n}=s,h=e.parentElement,o=i.parentElement,a=(t,s,e)=>{const i=t.substring(0,s),n=t.substring(s,e),r=t.substring(e);return[this.cloneWithText(i),this.cloneWithText(n),this.cloneWithText(r)]},c=h&&r.getEntityByDOM(h),u=o&&r.getEntityByDOM(o);if(c&&c.id===this.id){const r=e===i?s.endOffset:this.text.length,[h,o,c]=a(this.text,n,r);return this.applyActionToNode(o,t),[h,o,c].filter((t=>!!t.text))}if(u&&u.id===this.id){const[e,i,n]=a(this.text,0,s.endOffset);return this.applyActionToNode(i,t),[e,i,n].filter((t=>!!t.text))}return this.applyActionToNode(this,t),this}applyActionToNode(t,s){const e=s.toAnnotation();if(s instanceof tt)this.syncUpSelectedNodes(t);else if(e instanceof z||this.syncUpSelectedNodes(t),s instanceof st)this.annotationMap.delete(s.annotationType);else{if(!(e instanceof R))return e instanceof h||e instanceof z?(s instanceof $&&(g(s.newText)&&(t.text=s.newText),this.parentBlock.apply(new _(s.link.groupKey,[t]))),s instanceof G&&this.applyActionToNode(t,new Q),void t.annotationMap.set(e.type,e)):void 0;e.items.forEach((s=>{t.deleteAnnotationByType(s)}))}}replaceSelectedText(t,s){if(s&&s.startContainer&&s.endContainer){const{startContainer:e,endContainer:i,startOffset:n,endOffset:h}=s,o=e.parentElement,a=i.parentElement,c=o&&r.getEntityByDOM(o),u=a&&r.getEntityByDOM(a);let l=0,d=this.text.length;c&&c===this?(l=n,d=e===i?h:d):u&&u===this&&(d=h),this.apply(new X(this.text.slice(0,l)+t+this.text.slice(d)))}}updateText(t){this.text=t,!this.text&&this.isLinkNode()&&this.annotationMap.delete(o.LINK)}isLinkNode(){return this.annotationMap.has("LINK")}shouldSplitSelection(t){const{startContainer:s,endContainer:e,startOffset:i,endOffset:n}=t;return s!==e||i>0||n<(e.textContent?e.textContent.length:0)}syncUpSelectedNodes(t){const s=r.getDOMByEntity(this);if(s){const e=f.getSubjectFromParentNodeByEventId(s,m);e&&w.notify(e,{node:t})}}insertNewNode(t,s){if(0===t){const t=this.cloneWithText("");return this.applyActionToNode(t,s),[t,this]}if(t===this.text.length){const t=this.cloneWithText("");return this.applyActionToNode(t,s),[this,t]}const e=this.cloneWithText(this.text.substring(0,t)),i=this.cloneWithText(""),n=this.cloneWithText(this.text.substring(t));return this.applyActionToNode(i,s),[e,i,n]}}class it extends s{constructor(t){super(),this.type=e.TEXT_STYLE,this.textStyle=t}static from(t){return[e.TEXT_STYLE,new it(t)]}toJSON(){return{textStyle: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 nt extends W{constructor(t,s){super(),this.isFlushable=!0,this.textStyle=t,this.bold=s}toAnnotation(){return new it(this.textStyle)}}class rt extends P{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new q(this.bold)}}class ht extends i{constructor(t){super(),this.type=n.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class ot extends i{constructor(t,...s){super(),this.type=n.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=s}}class at extends I{constructor(t,s){super(t),this.nodes=[],this.type=s,this.annotationMap=at.isAcceptableTextStyle(s)?new Map([it.from(s)]):new Map([it.from("paragraph")])}static from(t){const s=new at(t.id,t.type),{annotations:e}=t;return s.nodes=t.nodes.map((t=>et.from(t,s))),e&&Object.entries(e).forEach((([t,e])=>{const i=this.createAnnotationEntity(t,e);g(i)&&s.annotationMap.set(...i)})),s}static createAnnotationEntity(t,s){return"textStyle"===t?it.from(s):super.createAnnotationEntity(t,s)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3"].includes(t)}mergeNodes(t){this.nodes=this.nodes.reduce(((s,e)=>{const i=s.at(-1);if(t instanceof $&&t.needMergeNode){const t=null==i?void 0:i.getAnnotationByType(o.LINK),n=e.getAnnotationByType(o.LINK);if(t&&n&&t.toEqual(n))return s}return[...s,e]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.nodes.map((t=>t.toJSON()))})}cloneWithNodes(t){const s=new at(x(),this.type);return s.nodes=[],s.apply(new j(t)),s}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((t=>!t.isEmpty()))}getLastNode(){return this.nodes[this.nodes.length-1]}doAnnotationActionApply(t){if(t instanceof nt)return"list-item"!==this.type&&(this.type=t.textStyle),void this.nodes.forEach(t.bold?t=>{const s=new rt(!0);s.doSplit=!1,t.apply(s)}:t=>{t.apply(new st(o.BOLD))});if(t instanceof _){const s=this.getAnnotationByType(l.LINK_GROUP);if(s){const e=s.linkGroups.get(t.groupKey);s.linkGroups.set(t.groupKey,[...e,...t.nodes]),this.annotationMap.set(l.LINK_GROUP,s)}}}doModifyActionApply(t){switch(t.type){case n.DELETE_CHILD:this.removeChildNode(t);break;case n.APPEND_CHILD_NODES:this.appendChildNodes(t.entityToBeAppended);break;case n.CLEAR_CHILD_NODES:this.nodes=[];break;case n.SPLIT_BLOCK_WITH_NODE:t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode);break;case n.REPLACE_CHILD_NODES:this.nodes=[],this.appendChildNodes(t.newChildNodes);break;case n.MERGE_TWO_BLOCKS_NODES:this.mergeTwoBlocksNodes(t.blockNeedToBeMerged);break;case n.BREAK_SINGLE_BLOCK:t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_SINGLE_BLOCK:t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_MULTIPLE_BLOCKS:t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks);break;case n.TRANSFORM_LIST_BLOCK:this.convertParagraphToList(t);break;case n.DELETE_BLOCK_CONTENT:this.deleteNodeContent(t);break;case n.INSERT_IMAGE_TO_BLOCK:this.insertImage(t);break;case n.INSERT_NODES_BEFORE:this.replaceNodeWithNodes(t.referNode,[...t.nodesToBeInserted,t.referNode])}}splitTextNodeBlock(t,s){if(t){const e=t.text.slice(0,s),i=t.text.slice(s),n=this.nodes.indexOf(t);if(n>-1){const s=this.nodes.slice(0,n),r=this.nodes.slice(n+1);e&&s.push(t.cloneWithText(e)),i&&r.unshift(t.cloneWithText(i)),this.apply(new J(s));const h=this.cloneWithNodes(r);return this.parent.apply(new T(this,h)),h}}}isCaretPositionAtStart(t,s){return t===this.nodes[0]&&0===s}isCaretPositionAtEnd(t,s){const e=this.nodes[this.nodes.length-1];return t===e&&(t.isEmpty()||s===e.text.length)}lineBreakSingleBlock(t,s){if(t){const e=new et(x(),"\n",this),i=t.text.slice(0,s),n=t.text.slice(s),r=this.nodes.indexOf(t);if(r>-1){const s=this.nodes.slice(0,r),h=this.nodes.slice(r+1);i&&s.push(t.cloneWithText(i)),n&&h.unshift(t.cloneWithText(n)),this.mergeLineBreakNodes(s,e,h)}return e}}lineBreakMultipleBlocks(t){const s=this.nodes,e=new et(x(),"\n",this),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,e,i),e}deleteNodeContent(t){const s=t.startContainerNode,e=t.startOffset;if(0!==e&&!s.isEmpty()){const i=s.text.slice(0,e-1)+s.text.slice(e);if(s.apply(new X(i)),i)return void(t.previousNode=s);{const e=this.getPreviousNode(s);return e&&e.parentBlock===this&&"\n"===e.text||1===this.nodes.length?void(t.previousNode=s):(this.apply(new C(s)),void(t.previousNode=e))}}{let e=this.getPreviousNode(s),i=null;if(this.nodes.length&&e&&e.parentBlock!==this)s.isEmpty()&&this.apply(new C(s)),e.parentBlock.apply(new ht(this));else if(this.isContentFirstNode(s)&&s.isEmpty()&&(i=this.getNextNode(s)),s.isEmpty()&&this.apply(new C(s)),e instanceof et&&e.isEmpty()){const t=e;e=this.getPreviousNode(e),t.parentBlock.apply(new C(t)),e||(i=s)}0===this.nodes.length&&this.parent.apply(new C(this)),e?t.previousNode=e:i&&(t.nextNode=i)}}removeChildNode(t){this.nodes=this.nodes.filter((s=>s!==t.entityToBeRemoved)),0===this.nodes.length&&this.parent.apply(new C(this))}mergeLineBreakNodes(t,s,e){(0===e.length||e[0]&&""===e[0].text)&&e.push(new et(x(),"\n",this,t[t.length-1]&&t[t.length-1].annotationMap)),this.apply(new J([...t,s,...e]))}breakSingleTextBlock(t,s){const e=this.copyInlineStyleToNewParagraph(t);if(this.isCaretPositionAtEnd(t,s))this.parent.apply(new T(this,e));else{if(!this.isCaretPositionAtStart(t,s)){const e=new F(t,s);return this.apply(e),e.newBlock}this.parent.apply(new ot(this,e))}return e}convertParagraphToList(t){const s=this.parent.createList(t.listType),e=t.selectedBlocks.map((t=>this.parent.toListItem(t)));s.apply(new j(e)),this.parent.apply(new T(t.selectedBlocks[0],s)),t.selectedBlocks.forEach((t=>{t.parent.apply(new C(t))}))}insertImage(t){const s=t.splitPointNode,e=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtEnd(s,e))this.parent.apply(new T(this,i));else if(this.isCaretPositionAtStart(s,e))this.parent.apply(new ot(this,i));else{const t=new F(s,e);this.apply(t),this.parent.apply(new T(this,i))}}copyInlineStyleToNewParagraph(t){const s=t.cloneWithText("");s.annotationMap.delete(o.LINK);const e=new at(x(),"paragraph");return e.apply(new j([s])),e}}class ct extends I{constructor(t){super(t),this.type="image",this.nodes=[]}static from(t){const s=new ct(t.id),{annotations:e}=t;return s.nodes=t.nodes.map((t=>E.from(t,s))),e&&Object.entries(e).forEach((([t,e])=>{const i=this.createAnnotationEntity(t,e);g(i)&&s.annotationMap.set(...i)})),s}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]}doModifyActionApply(t){switch(t.type){case n.DELETE_CHILD:this.removeChildNode(t);break;case n.CLEAR_CHILD_NODES:this.nodes=[];break;case n.APPEND_CHILD_NODES:this.appendChildNodes(t.entityToBeAppended);break;case n.REPLACE_CHILD_NODES:this.nodes=[],this.appendChildNodes(t.newChildNodes);break;case n.SPLIT_BLOCK_WITH_NODE:t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode);break;case n.MERGE_TWO_BLOCKS_NODES:this.mergeTwoBlocksNodes(t.blockNeedToBeMerged);break;case n.BREAK_SINGLE_BLOCK:t.newBlock=this.breakSingleBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_SINGLE_BLOCK:t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_MULTIPLE_BLOCKS:t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks);break;case n.DELETE_BLOCK_CONTENT:this.deleteNodeContent(t);break;case n.INSERT_IMAGE_TO_BLOCK:this.insertImage(t);break;case n.INSERT_NODES_AFTER:this.replaceNodeWithNodes(t.referNode,[t.referNode,...t.nodesToBeInserted]);break;case n.INSERT_NODES_BEFORE:this.replaceNodeWithNodes(t.referNode,[...t.nodesToBeInserted,t.referNode])}}removeChildNode(t){this.nodes=this.nodes.filter((s=>s!==t.entityToBeRemoved)),0===this.nodes.length&&this.parent.apply(new C(this))}splitImageNodes(t,s){const e=this.nodes.indexOf(t);if(e>-1){const t=this.nodes.slice(0,e+s),i=this.nodes.slice(e+s);this.apply(new J(t));const n=this.cloneWithNodes(i);return this.parent.apply(new T(this,n)),n}}cloneWithNodes(t){const s=new ct(x());return s.nodes=[],s.apply(new j(t)),s}breakSingleBlock(t,s){const e=at.from({id:x(),type:"paragraph",nodes:[{id:x(),type:"text",text:""}]});if(this.isCaretPositionAtEnd(t,s))this.parent.apply(new T(this,e));else{if(!this.isCaretPositionAtStart(t,s)){const e=new F(t,s);return this.apply(e),e.newBlock}this.parent.apply(new ot(this,e))}return e}lineBreakSingleBlock(t,s){const e=this.breakSingleBlock(t,s);if(e)return e.nodes[0]}isCaretPositionAtStart(t,s){return t===this.nodes[0]&&0===s}isCaretPositionAtEnd(t,s){return t===this.nodes[this.nodes.length-1]&&1===s}lineBreakMultipleBlocks(t){const s=at.from({id:x(),type:"paragraph",nodes:[{id:x(),type:"text",text:"\n"}]});this.parent.apply(new T(this,s));const e=this.concatBlocksNodes(t.slice(1));return(0===e.length||e[0]&&""===e[0].text)&&e.push(new et(x(),"\n",s)),s.apply(new j(e)),s.nodes[0]}deleteNodeContent(t){const s=t.startContainerNode,e=t.startOffset;let i=this.getPreviousNode(s),n=null;if(1===e){const t=s.parentBlock;this.isContentFirstNode(s)&&(n=this.getNextNode(s)),1===t.nodes.length?t.parent.apply(new C(t)):s.parentBlock.apply(new C(s))}else{const e=i;e&&e instanceof E&&(i=this.getPreviousNode(e),e.parentBlock.apply(new C(e)),i||(t.nextNode=s))}i?t.previousNode=i:n&&(t.nextNode=n)}insertImage(t){const s=t.splitPointNode,e=t.startOffsetOfNode,i=t.imageBlockToBeInserted;this.nodes.length<1?this.apply(new j(t.imageBlockToBeInserted.nodes)):this.isCaretPositionAtEnd(s,e)?this.parent.apply(new T(this,i)):this.isCaretPositionAtStart(s,e)?this.parent.apply(new ot(this,i)):(this.apply(new F(s,e)),this.parent.apply(new T(this,i)))}}class ut extends at{constructor(t,s){super(t,"list-item"),this.children=[],this.children=s}static from(t){const s=new ut(t.id);s.nodes=t.nodes.map((t=>et.from(t,s))),t.children&&(s.children=t.children.map((t=>{const e=dt.from(t);return e.parent=s,e})));const{annotations:e}=t;return e&&Object.entries(e).forEach((([t,e])=>{const i=this.createAnnotationEntity(t,e);g(i)&&s.annotationMap.set(...i)})),s}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 s=new ut(x());return s.nodes=[],s.apply(new j(t)),s}isNotEmpty(){return this.children?super.isNotEmpty()||this.children.some((t=>t.isNotEmpty())):super.isNotEmpty()}getLastNode(){return this.children&&this.children.length>0?this.children[this.children.length-1].getLastNode():super.getLastNode()}doModifyActionApply(t){switch(t.type){case n.DELETE_CHILD:this.removeListChildNode(t);break;case n.DELETE_NEST_LIST:this.removeNestList(t);break;case n.APPEND_CHILD_NODES:this.appendChildNodes(t.entityToBeAppended);break;case n.CLEAR_CHILD_NODES:this.nodes=[];break;case n.SPLIT_BLOCK_WITH_NODE:this.splitListItemBlock(t);break;case n.REPLACE_CHILD_NODES:this.nodes=[],this.appendChildNodes(t.newChildNodes);break;case n.REPLACE_NEST_LIST:this.replaceNestList(t.newList);break;case n.MERGE_TWO_BLOCKS_NODES:this.mergeTwoBlocksNodes(t.blockNeedToBeMerged);break;case n.BREAK_SINGLE_BLOCK:t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_SINGLE_BLOCK:t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset);break;case n.LINE_BREAK_MULTIPLE_BLOCKS:t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks);break;case n.DELETE_BLOCK_CONTENT:this.deleteListNodeContent(t);break;case n.INSERT_IMAGE_TO_BLOCK:this.parent.apply(t);break;case n.INSERT_NODES_BEFORE:this.replaceNodeWithNodes(t.referNode,[...t.nodesToBeInserted,t.referNode])}}removeListChildNode(t){this.nodes=this.nodes.filter((s=>s!==t.entityToBeRemoved)),0!==this.nodes.length||this.children&&this.children.length||this.parent.apply(new C(this))}removeNestList(t){this.children&&(this.children=this.children.length>1?this.children.filter((s=>s!==t.nestListBlockToBeRemoved)):void 0)}replaceNestList(t){t.forEach((t=>{t.parent=this})),this.children=t}splitListItemBlock(t){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode)}breakSingleListItemBlock(t,s){const e=new ut(x()),i=this.copyInlineStyleToNewNode(t);if(e.apply(new j([i])),this.isCaretPositionAtEnd(t,s))return this.breakListItemAtEnd(e);if(!this.isCaretPositionAtStart(t,s)){const e=new F(t,s);return this.apply(e),e.newBlock}return this.parent.apply(new ot(this,e)),e}breakListItemAtEnd(t){const s=this.parent.blocks[this.parent.blocks.length-1],e=1===this.nodes.length&&this.nodes[0].isEmpty();if(this===s&&e){const s=this.parent.parent;if("list-item"!==s.type){const e=at.from({id:x(),type:"paragraph",nodes:[]});return e.apply(new j(t.nodes)),s.apply(new T(this.parent,e)),this.parent.apply(new C(this)),e}s.parent.apply(new T(s,t)),this.parent.apply(new C(this))}else this.parent.apply(new T(this,t));return t}deleteListNodeContent(t){const s=t.startContainerNode.parentBlock.parent;this.deleteNodeContent(t),0===s.blocks.length&&s.parent.apply(new C(s))}copyInlineStyleToNewNode(t){const s=t.cloneWithText("");return s.annotationMap.delete(o.LINK),s}}class lt extends i{constructor(t){super(),this.type=n.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class dt extends I{constructor(t,s){super(t),this.type="bullet-list",this.blocks=[],this.type=s}static from(t){const s=new dt(t.id,t.type);return s.blocks=t.blocks.map((t=>{const e=ut.from(t);return e.parent=s,e})),s}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&&this.blocks.some((t=>t.isNotEmpty()))}getLastNode(){return this.blocks[this.blocks.length-1].getLastNode()}doModifyActionApply(t){switch(t.type){case n.DELETE_CHILD:this.removeListItemBlock(t.entityToBeRemoved);break;case n.INSERT_BLOCKS_AFTER:this.replaceBlockWithBlocks(t.referBlock,[t.referBlock,...t.blocksToBeInserted]);break;case n.INSERT_BLOCKS_BEFORE:this.replaceBlockWithBlocks(t.referBlock,[...t.blocksToBeInserted,t.referBlock]);break;case n.APPEND_CHILD_NODES:this.appendChildBlocks(t.entityToBeAppended);break;case n.TRANSFORM_LIST_BLOCK:this.convertToList(t);break;case n.TRANSFORM_PARAGRAPH_BLOCK:this.convertToParagraph(t);break;case n.INSERT_IMAGE_TO_BLOCK:this.insertImage(t)}}toParagraph(t){const s=new at(x(),"paragraph");return s.apply(new j(t.nodes)),s.annotationMap=t.annotationMap,s}convertToList(t){const s=t.selectedBlocks,e=this.parent.createList(t.listType);if(s.every((t=>t.parent===this)))e.apply(new j(this.blocks)),this.parent.apply(new T(this,e)),this.parent.apply(new C(this)),s.forEach((t=>t.nodes.map((t=>t.apply(new tt)))));else{const s=t.selectedBlocks.map((t=>this.parent.toListItem(t)));e.apply(new j(s)),this.parent.apply(new T(this,e)),t.selectedBlocks.forEach((t=>{t.parent.apply(new C(t))})),0===this.blocks.length&&this.parent.apply(new C(this))}}convertToParagraph(t){let s=!1,e=!1;const i=t.selectedBlocks,n=i.map((t=>(t.nodes.map((t=>t.apply(new tt))),t===this.blocks[0]&&(s=!0),t===this.blocks[this.blocks.length-1]&&(e=!0),this.toParagraph(t))));if(s)this.parent.apply(new ot(this,...n));else if(e)this.parent.apply(new T(this,...n));else{const t=this.blocks.indexOf(i[0]),s=this.blocks.indexOf(i[i.length-1]),e=this.parent.createList(this.type);e.apply(new j(this.blocks.slice(0,t)));const r=this.parent.createList(this.type);r.apply(new j(this.blocks.slice(s+1))),this.parent.apply(new ot(this,e,...n,r)),this.parent.apply(new C(this))}i.map((t=>{this.apply(new C(t))})),0===this.blocks.length&&this.parent.apply(new C(this))}insertImage(t){this.parent.apply("list-item"!==this.parent.type?new T(this,t.imageBlockToBeInserted):t)}removeListItemBlock(t){super.removeChildBlock(t),0===this.blocks.length&&this.parent&&this.parent.apply(this.parent instanceof ut?new lt(this):new C(this))}}export{j as A,B,Q as C,O as H,L as I,$ as L,ht as M,dt as R,tt as S,P as T,D as U,M as Z,ct as a,at as b,ut as c,N as d,V as e,v as f,et as g,W as h,rt as i,K as j,nt as k,it as l,q as m,G as n,H as o,z as p,S as q,E as r,X as s,C as t,ot as u,F as v,y as w,J as x,T as y}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,H as t,r as i,c as s,g as o}from"./p-1c298d5a.js";import{R as r}from"./p-3152031c.js";import{s as a}from"./p-9b797118.js";import{g as n}from"./p-4bcd6612.js";import{c as l,V as p,M as d,L as h,I as c}from"./p-6e1ab235.js";import{a as v}from"./p-79ec5d69.js";import{R as f}from"./p-6705c68a.js";import{V as g,I as u}from"./p-4387d550.js";import{D as m}from"./p-29b09aad.js";import{m as x,n as b,b as w,o as y,p as j,f as I,l as S,C as R,D}from"./p-6a3989dd.js";import{e as z,f as O}from"./p-f357cf46.js";import{i as C}from"./p-b0502d01.js";import{C as E}from"./p-2d0d575f.js";import{b as L}from"./p-d057999f.js";import{c as T}from"./p-86194314.js";import{c as V}from"./p-1ec763ab.js";import{c as k}from"./p-613ddaab.js";import{V as A}from"./p-8284a445.js";import{F as _}from"./p-2f32a9ba.js";import{P as N}from"./p-5f589974.js";import{c as G}from"./p-e8f540d8.js";import{C as P}from"./p-be12fa36.js";import{N as U,P as F}from"./p-b1f65b13.js";import{M as K}from"./p-987fbbd0.js";import{T as M}from"./p-a9354a5c.js";import{T as q}from"./p-b688a71b.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-032df16f.js";import"./p-33b62194.js";import"./p-6a334573.js";import"./p-0bb29d98.js";import"./p-de664bdd.js";import"./p-0af4bda9.js";import"./p-5f377954.js";import"./p-ff4bafa3.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";var B=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class H extends p{constructor(){super(...arguments),this.renderLabel=()=>this.label&&e("div",{class:"vega-input-select-label"},e("span",null,this.label),this.required&&e("span",{class:"vega-input-select-required"},"*")),this.renderErrorMessage=()=>e("div",{class:"vega-input-select-error-message"}),this.renderHelpMessage=()=>e("div",{class:"vega-input-select-hint"},this.hint)}render(){return e(t,{class:v([this.disabled?"vega-input-select-disabled":"",f.formatCustom(this.size)])},this.renderLabel(),this.dropdownRenderer.render(),this.renderErrorMessage(),this.hint&&this.renderHelpMessage())}}B([l()],H.prototype,"disabled",void 0),B([l()],H.prototype,"size",void 0),B([l()],H.prototype,"hint",void 0),B([l()],H.prototype,"label",void 0),B([l()],H.prototype,"required",void 0),B([l({componentFieldName:"vegaInputSelectDropdownRenderer"})],H.prototype,"dropdownRenderer",void 0);var W=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class $ extends p{constructor(){super(...arguments),this.onDropdownShow=()=>{this.isDropdownShow=!0},this.onDropdownHide=()=>{this.isDropdownShow=!1}}addDropdownObserver(e){m.addUniqueObserverToNode(e,x,(e=>{this.onDropdownShow(),this.showEventEmitter.emit(e.detail)})),m.addUniqueObserverToNode(e,b,(e=>{this.onDropdownHide(),this.hideEventEmitter.emit(e.detail)})),m.addUniqueObserverToNode(e,w,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection())})),m.addUniqueObserverToNode(e,y,(e=>{this.searchEventEmitter.emit(e.detail)})),m.addUniqueObserverToNode(e,j,(e=>{this.searchTriggerEventEmitter.emit(e.detail)})),m.addUniqueObserverToNode(e,z,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.id===e.itemKey)))).map((e=>({id:e.itemKey,displayName:e.label})));this.sourceController.appendSourceItems(t)}))}}W([l({writable:!0})],$.prototype,"isDropdownShow",void 0),W([l()],$.prototype,"vegaSearch",void 0),W([l()],$.prototype,"searchEventEmitter",void 0),W([l()],$.prototype,"searchTriggerEventEmitter",void 0),W([l()],$.prototype,"vegaInputSelectValueController",void 0),W([l()],$.prototype,"sourceController",void 0),W([l()],$.prototype,"source",void 0),W([l()],$.prototype,"showEventEmitter",void 0),W([l()],$.prototype,"hideEventEmitter",void 0);var J=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class Q extends p{constructor(){super(...arguments),this.handleValueChange=(e,t)=>{if("multiple"===this.selectType){t=t;const i=(e=e)?e.filter((e=>this.sourceController.getItem(e))):[];C(i,t,!0)?C(i,e,!0)||this.setValue(i):(this.setValue(i),this.changeEventEmitter.emit(i),E.notify(L,{host:this.host,detail:i}))}else if(e!==t){const t=this.sourceController.getItem(e);this.setValue(t?t.id:""),this.changeEventEmitter.emit(this.value),E.notify(L,{host:this.host,detail:this.value})}}}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"single":return null===e||"string"==typeof e;case"multiple":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return h.warn(`Invalid input select value ${e} for ${this.selectType} mode`),!1}}}J([l({writable:!0})],Q.prototype,"value",void 0),J([l()],Q.prototype,"selectType",void 0),J([l()],Q.prototype,"changeEventEmitter",void 0),J([l()],Q.prototype,"host",void 0),J([l()],Q.prototype,"sourceController",void 0),J([d("watchValue")],Q.prototype,"handleValueChange",void 0);var X=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class Y extends p{constructor(){super(...arguments),this.renderContainer=()=>e("div",{role:"button",class:"vega-input-select-container",ref:e=>this.inputSelectContainer=e,tabIndex:0,onKeyDown:T(),onBlur:this.preventBlur},this.renderPrefixIcon(),this.renderSelectContainer(),this.renderToggleIcon()),this.renderPrefixIcon=()=>this.prefixIcon&&e("div",{class:"vega-input-select-prefix-icon"},e("vega-icon",{icon:this.prefixIcon,size:"size-16"})),this.renderToggleIcon=()=>e("div",{class:"vega-input-select-toggle-icon"},e("vega-icon",{icon:A.getIconKey(this.isDropdownShow?"chevron-up":"chevron-down")})),this.renderSelectContainer=()=>e("div",{class:"vega-input-select-select-container"},e("div",{class:"vega-input-select-selected-box"},"multiple"===this.selectType?this.renderMultipleSelected():this.renderSingleSelected())),this.renderMultipleSelected=()=>this.value.length>0?e("span",{class:"vega-input-select-selected"},this.selectedLabel(this.value)):e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder)),this.renderSingleSelected=()=>{const t=this.sourceController.getItem(this.value);return t?e("span",{class:"vega-input-select-selected"},t.displayName):e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder))},this.getVegaDropdownProperties=()=>Object.assign({searchable:!0,caseSensitive:!1},this.vegaDropdownProps)}show(){return this.dropdown.show()}hide(){return this.dropdown.hide()}getDropdownRef(){return this.dropdown}getInputSelectContainerRef(){return this.inputSelectContainer}getItemsSlotRef(){return this.itemsSlotRef}render(){return e("vega-dropdown",Object.assign({trigger:"click",source:this.getDropdownSource(),selectType:this.selectType,selectedSourceKey:this.value,matchTargetWidth:!0},this.getVegaDropdownProperties(),{ref:e=>{this.dropdown=e,this.vegaInputSelectDropdownController.addDropdownObserver(e)},isLazyLoading:this.isLazyLoading}),this.renderContainer(),this.renderItemsSlot())}renderItemsSlot(){return this.host.querySelector("[slot=items]")&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}preventBlur(e){e.stopImmediatePropagation()}getDropdownSource(){return this.source.map((e=>({key:e.id,label:e.displayName})))}}A.register({"chevron-up":V,"chevron-down":k}),X([l()],Y.prototype,"value",void 0),X([l()],Y.prototype,"source",void 0),X([l()],Y.prototype,"host",void 0),X([l()],Y.prototype,"selectType",void 0),X([l()],Y.prototype,"isDropdownShow",void 0),X([l()],Y.prototype,"vegaDropdownProps",void 0),X([l()],Y.prototype,"prefixIcon",void 0),X([l()],Y.prototype,"placeholder",void 0),X([l()],Y.prototype,"selectedLabel",void 0),X([l()],Y.prototype,"isLazyLoading",void 0),X([l()],Y.prototype,"vegaInputSelectDropdownController",void 0),X([l()],Y.prototype,"sourceController",void 0),X([l()],Y.prototype,"translationSlimmer",void 0);var Z=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class ee extends p{constructor(){super(...arguments),this.hasMore=!0}componentDidLoad(){const e=this.getVirtualScroll();e&&m.addUniqueObserverToNode(e,O,this.onScrollToBottom.bind(this))}getVirtualScroll(){var e,t,i;return null===(i=null===(t=null===(e=this.vegaInputSelectDropdownRenderer.getDropdownRef().shadowRoot)||void 0===e?void 0:e.querySelector("vega-dropdown-content-box"))||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("vega-virtual-scroll")}async onScrollToBottom(e){if(this.sourceLazyLoadCallback&&this.hasMore){this.isLazyLoading=!0;const t=await this.sourceLazyLoadCallback(e.endIndex);this.hasMore=t.hasMore,t.items.length>0&&this.sourceController.appendSourceItems(t.items),this.isLazyLoading=!1}}}Z([l()],ee.prototype,"sourceLazyLoadCallback",void 0),Z([l({writable:!0})],ee.prototype,"isLazyLoading",void 0),Z([l()],ee.prototype,"sourceController",void 0),Z([l()],ee.prototype,"vegaInputSelectDropdownRenderer",void 0),Z([d("componentDidLoad")],ee.prototype,"componentDidLoad",null);const te=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!1===e.autoValidation},{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>e.source.length>0}];var ie=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class se extends p{constructor(){super(...arguments),this.handleSourceChange=()=>{this.source=U(this.source,F)?this.source:[]}}appendSourceItems(e){this.source=[...this.source,...e]}getItem(e){return this.source.find((t=>t.id===e))}}ie([l({writable:!0})],se.prototype,"source",void 0),ie([d("watchSource")],se.prototype,"handleSourceChange",void 0);var oe=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class re extends p{constructor(){super(...arguments),this.mutationObserver=new K({mutationFilter:M("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){const e=this.host.querySelector("[slot=items]"),t=this.vegaInputSelectDropdownRenderer.getItemsSlotRef();e&&t&&(t.remove(),this.vegaInputSelectDropdownRenderer.getDropdownRef().append(e))}}oe([c()],re.prototype,"mutationObserver",void 0),oe([l()],re.prototype,"host",void 0),oe([l()],re.prototype,"vegaInputSelectDropdownRenderer",void 0),oe([d("componentDidLoad")],re.prototype,"componentDidLoad",null);var ae=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};const ne=class{constructor(e){i(this,e),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaSearch=s(this,"vegaSearch",7),this.search=s(this,"search",7),this.vegaSearchTrigger=s(this,"vegaSearchTrigger",7),this.searchTrigger=s(this,"searchTrigger",7),this.vegaShow=s(this,"vegaShow",7),this.vegaHide=s(this,"vegaHide",7),this.globalSlimmers={},this.translationSlimmer=new q,this.sourceController=new se,this.vegaInputSelectRenderer=new H,this.vegaInputSelectDropdownController=new $,this.vegaInputSelectValueController=new Q,this.vegaInputSelectDropdownRenderer=new Y,this.vegaInputSelectItemsSlotController=new re,this.formFieldControllerSlimmer=new _({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new r:null}],validationRulesName:"validationRules",defaultValue:e=>"multiple"===e.selectType?[]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaInputSelectDropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.vegaInputSelectDropdownRenderer.getInputSelectContainerRef()]}),this.pageResizeObserverSlimmer=new N,this.lazyLoadController=new ee,this.changeEventEmitter=G(ne,I),this.searchEventEmitter=G(ne,S),this.searchTriggerEventEmitter=G(ne,j),this.showEventEmitter=G(ne,R),this.hideEventEmitter=G(ne,D),this.eventPrevent=new P([S,j,R,D],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new g(te),this.isDropdownShow=!1,this.currentBreakpoint=n(),this.isLazyLoading=!1,this.label="",this.required=!1,this.selectedLabel=e=>`${e.length} Selected`,this.selectType="single",this.source=[],this.value="multiple"===this.selectType?[]:"",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="Please select",this.vegaDropdownProps={},this.size="default"}watchSource(){}watchValue(e,t){}watchValidationRules(){}componentWillLoad(){}async doClose(){await this.vegaInputSelectDropdownRenderer.hide()}async doOpen(){await this.vegaInputSelectDropdownRenderer.show()}async doChange(e){this.vegaInputSelectValueController.setValue(e)}render(){return a(this.vegaInputSelectRenderer.render(),this.host)}get host(){return o(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"]}}};ae([u()],ne.prototype,"globalSlimmers",void 0),ae([c()],ne.prototype,"translationSlimmer",void 0),ae([c()],ne.prototype,"sourceController",void 0),ae([c()],ne.prototype,"vegaInputSelectRenderer",void 0),ae([c()],ne.prototype,"vegaInputSelectDropdownController",void 0),ae([c()],ne.prototype,"vegaInputSelectValueController",void 0),ae([c()],ne.prototype,"vegaInputSelectDropdownRenderer",void 0),ae([c()],ne.prototype,"vegaInputSelectItemsSlotController",void 0),ae([c()],ne.prototype,"formFieldControllerSlimmer",void 0),ae([c()],ne.prototype,"pageResizeObserverSlimmer",void 0),ae([c()],ne.prototype,"lazyLoadController",void 0),ae([c()],ne.prototype,"changeEventEmitter",void 0),ae([c()],ne.prototype,"searchEventEmitter",void 0),ae([c()],ne.prototype,"searchTriggerEventEmitter",void 0),ae([c()],ne.prototype,"showEventEmitter",void 0),ae([c()],ne.prototype,"hideEventEmitter",void 0),ae([c()],ne.prototype,"eventPrevent",void 0),ae([c()],ne.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ne.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));padding-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-input-select-label .vega-input-select-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host(.vega-input-select-disabled) .vega-input-select-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}:host(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.vega-input-select-disabled) .vega-input-select-selected{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-select-prefix-icon{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}:host .vega-input-select-toggle-icon{width:16px;height:16px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;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}:host .vega-input-select-hint{padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-hint{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-input-select-hint{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-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-dropdown{display:block}';export{ne as vega_input_select}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e}from"./p-
|
|
1
|
+
import{L as e}from"./p-6e1ab235.js";import t from"./p-7a40e033.js";const r=Object.freeze({"VEGA_DATE_PICKER.COMPONENT_LOAD_REQUIRED_DECORATOR":{description:"Feature flag to enable the required decorator for the date picker component. <br/> <b>Note: This feature flag is for demonstration purpose and will be persisted permanently.</b>",createdTimestamp:1660330561422,createdAtVersion:"1.2.0",removedAfterVersion:"1.11.1"},"VEGA_COMPONENT.SANITIZE_VEGA_COMPONENT":{description:"Feature flag to enable sanitize vega components.",createdTimestamp:1664262689486,createdAtVersion:"1.8.1",removedAfterVersion:"2.0.0"},"VEGA_TEXT.LABEL_OR_CONTENT_NESTED_VEGA_TEXT_COMPONENT":{description:"Feature flag to enable the label or content of other component nested vega-text component.",createdTimestamp:1665218525140,createdAtVersion:"1.8.1",removedAfterVersion:"1.9.1"},"VEGA_FLEX.ENABLE_DIRECTION_ONLY":{description:"Feature flag to make direction take effect only regardless of breakpoint for vega-flex component.",createdTimestamp:1665639912117,createdAtVersion:"1.9.0"},"VEGA_FIELD_LABEL.SHOW_LABEL":{description:"Feature flag to enable the vega-field-label component for vega-input, vega-input-select and vega-date-picker.",createdTimestamp:1666184962131,createdAtVersion:"1.9.0",removedAfterVersion:"2.0.0"},"VEGA_FLEX.USE_NATIVE_FLEX_BEHAVIOR":{description:"Feature flag to enable the **default** use of native flex behavior for vega-flex component.",createdTimestamp:1668059639449,createdAtVersion:"1.11.1",removedAfterVersion:"2.0.0"},"VEGA_TABLE.DEPRECATED_ROW_SELECTION_CHANGE_PROP":{description:"Feature flag to deprecate the rowSelection.onSelectChange and rowSelection.onSelectAllChange",createdTimestamp:1673321949321,createdAtVersion:"1.18.0",removedAfterVersion:"2.0.0"},"VEGA_ICON.USE_SIZE_PROP_FOR_THIRD_PARTY_ICONS":{description:"Feature flag to make size prop of vega-icon to take effect for third party icons.",createdTimestamp:1675752744795,createdAtVersion:"1.20.0",removedAfterVersion:"2.0.0"},"VEGA_INJECT_FORM_FIELD_CONTROLLER.ADD_DATA_VEGA_FORM_FILTER":{description:"Feature flag to deprecate the form field should validate only have data-vega-from attribute",createdTimestamp:1676017004107,createdAtVersion:"1.19.0",removedAfterVersion:"2.0.0"},"VEGA_FORM_FIELD.CHANGE_BLOCK_TO_INLINE_BLOCK":{description:"Feature flag to deprecate the form fields like input/datePicker/timePicker should use inline block",createdTimestamp:1676512727310,createdAtVersion:"1.20.0",removedAfterVersion:"2.0.0"},"VEGA_CHECKBOX_RADIO_GROUP.FLEX_DIRECTION_COL_DEFAULT":{description:"Feature flag to make the checkbox group and radio group prop vegaFlexProp default direction to col",createdTimestamp:16811712e5,createdAtVersion:"1.27.3",removedAfterVersion:"2.0.0"},"VEGA_REACT.PREVENT_SSR":{description:"Feature flag to prevent the SSR in vega-react",createdTimestamp:1679450185124,createdAtVersion:"1.25.0",disabledByDefault:!0},"VEGA_STEPPER.INPUT_DISABLED":{description:"Feature flag to rename the prop input-editable to input-disabled ",createdTimestamp:1683252081350,createdAtVersion:"1.30.0",removedAfterVersion:"2.0.0"},"VEGA_FLEX.ALIGNITEM_JUSTIFYCONTENT_USE_PREFIX_V_INSTEAD_OF_VEGA":{description:"Feature flag to render vega-flex prop alignItems and justifyContent classes by using v- instead of vega-",createdTimestamp:1684128467390,createdAtVersion:"1.32.0",removedAfterVersion:"1.48.3"},"VEGA_ANGULAR.USE_JUGGLE_RESIZE_OBSERVER":{description:"Feature flag to enable the @juggle/resizeObserver to instead window resizeObserver",createdTimestamp:1684203399089,createdAtVersion:"1.31.0"},"VEGA_INPUT.FOCUS_ON_INPUT_BY_CLICK_CLEAR_BUTTON":{description:"Feature flag to keep the input focused whenever click the clear button",createdTimestamp:1685513925082,createdAtVersion:"1.34.0",removedAfterVersion:"1.38.2"},"VEGA_VUE.EMIT_CAMEL_CASE_EVENT_NAME":{description:"Feature flag to emit camel case event name for Vue framework",createdTimestamp:1688971026741,createdAtVersion:"1.37.0"},VEGA_ITEM_TOGGLE_ISERROR_DEPRECATED:{description:"Feature flag to deprecated the component vega-item-toggle property isError",createdTimestamp:1687934508330,createdAtVersion:"1.36.0",removedAfterVersion:"2.0.0"},"VEGA_BUTTON_LINK.DEPRECATED_EVENTFUL":{description:"Feature flag to deprecated eventful property",createdTimestamp:1689313658898,createdAtVersion:"1.36.1",removedAfterVersion:"2.0.0"},"VEGA_DROPDOWN.RENAME_PREFIX_TO_PREFIX_ICON":{description:"Feature flag to rename prefix to prefixIcon",createdTimestamp:1689576347049,createdAtVersion:"1.37.0",removedAfterVersion:"2.0.0"},"VEGA_REACT.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD":{description:"Feature flag to prevent call watch method before componnentDidLoad",createdTimestamp:1706598728908,createdAtVersion:"2.0.0"},"VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD":{description:"Feature flag to prevent call watch method before componnentDidLoad in all framework",createdTimestamp:1708495728180,createdAtVersion:"2.0.0"},"VEGA_REACT.ENABLE_ON_CHANGE_HANDLE_UNDER_LOW_VERSION":{description:"Feature flag to enable the onChange event handle under react version 19 or below",createdTimestamp:1709603823660,createdAtVersion:"2.0.0"},"VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD":{description:"Feature flag to enable the hide card number mask upon initial loading of the credit card.",createdTimestamp:1715932781059,createdAtVersion:"2.9.0"},"VEGA_TABLE.ENABLE_NEW_CELL_BREAK_WORDS_STYLE":{description:"Feature flag to enable the new cell words break style",createdTimestamp:1719282763075,createdAtVersion:"2.11.2"},"VEGA_TELEMETRY.ENABLE_COLLECT_COMPONENTS_USAGE":{description:"Feature flag to enable the collection of component usage.",createdTimestamp:1717468723384,createdAtVersion:"2.11.3"},"VEGA_TELEMETRY.ENABLE_COLLECT_FEATURE_FLAG_OVERRIDDEN":{description:"Feature flag to enable the feature flag overridden.",createdTimestamp:1717468723384,createdAtVersion:"2.11.3"},"VEGA_REACT.ENABLE_ON_CLOSE_HANDLE_UNDER_LOW_VERSION":{description:"Feature flag to enable the onClose event handle under react version 19 or below",createdTimestamp:1719910557333,createdAtVersion:"2.12.0"},VEGA_BANNER_DEPRECATED_ACTION_BUTTON_PROP_VEGA_CLICK:{description:"Feature flag to deprecated the vega-banner component property actionButtons property vegaClick",createdTimestamp:1723449433833,createdAtVersion:"2.18.0"},"VEGA_REACT.SKIP_NATIVE_EVENT_PREVENT_BY_DEFAULT":{description:"Feature flag to skip the native event prevent logic in default",createdTimestamp:17239968e5,createdAtVersion:"2.18.1",disabledByDefault:!0},"VEGA_TELEMETRY.ENABLE_COLLECT_PUBLIC_API":{description:"Feature flag to enable the collection of public api.",createdTimestamp:1727232497961,createdAtVersion:"2.21.0"},"VEGA_LEFT_NAV.DISABLE_ANIMATION_ON_LOAD":{description:"Feature flag that disables the transition animation of the left nav.",createdTimestamp:1730361348399,createdAtVersion:"2.26.0"},"VEGA_DATE_PICKER.ENABLE_CALCULATION_POSITION_BY_SCREEN":{description:"Feature flag that enable use screen to calculation position.",createdTimestamp:1733293586535,createdAtVersion:"2.29.0"},"VEGA_TABLE.REVERSE_SORT_ORDER":{description:"Feature flag that reverses table column sorting order from default>asc>desc to default>desc>asc",createdTimestamp:1737521148363,createdAtVersion:"2.32.0",disabledByDefault:!1}}),a=new class{constructor(){this.enabledFeatureFlagKeySet=new Set,this.init()}enable(...e){e.forEach((e=>{this.versionGuard(e)&&(this.enabledFeatureFlagKeySet.add(e),this.sendFeatureFlagKeyToTelemetry(e,!0))}))}disable(...e){e.forEach((e=>{this.versionGuard(e)&&(this.enabledFeatureFlagKeySet.delete(e),this.sendFeatureFlagKeyToTelemetry(e,!1))}))}isEnabled(e){return this.enabledFeatureFlagKeySet.has(e)}init(){Object.keys(r).map((e=>{r[e].disabledByDefault||this.isRemoved(e)||this.enabledFeatureFlagKeySet.add(e)}))}versionGuard(t){return!this.isRemoved(t)||(e.error(`The feature flag key '${t}' has been removed after v${r[t].removedAfterVersion}`),!1)}isRemoved(e){return!!r[e].removedAfterVersion}sendFeatureFlagKeyToTelemetry(e,r){this.canSendFeatureFlagsToTelemetry(e,r)&&t.emit("featureFlagOverridden",{featureFlagName:e,featureFlagOverriddenValue:r})}canSendFeatureFlagsToTelemetry(e,t){return!!r[e].disabledByDefault===t}};export{a as F}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as i,H as a,g as n}from"./p-1c298d5a.js";import{s}from"./p-9b797118.js";import{n as o,c as r}from"./p-262ec334.js";import{D as g}from"./p-29b09aad.js";import{v as p,A as h,f as l,a as m,K as c}from"./p-6a3989dd.js";import{a as f}from"./p-79ec5d69.js";import{C as d}from"./p-be12fa36.js";import{c as v}from"./p-e8f540d8.js";import{I as u}from"./p-6e1ab235.js";import{V as x,I as w}from"./p-4387d550.js";import{T as b}from"./p-b688a71b.js";import"./p-2d0d575f.js";import"./p-0af4bda9.js";import"./p-5f377954.js";import"./p-ff4bafa3.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";import"./p-de664bdd.js";import"./p-d057999f.js";import"./p-33b62194.js";const y=({pageSize:e,current:i,total:a,translationSlimmer:n})=>{const s=a>0?e*(i-1)+1:0,o=Math.min(i*e,a);return t("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",s,o,a)})},z=({onChange:e,pageCount:i,translationSlimmer:a})=>{let n;const s=()=>{if(n.value){const t=o(r(n.value,1),1,i);e(t),n.value=""}},l=t=>{t.stopPropagation()};return t("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},t("vega-field-label",{label:a.t("Go To")}),t("vega-form",{ref:t=>{g.addUniqueObserverToNode(t,p,s)}},t("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:l,onChange:l,ref:t=>{n=t,g.addUniqueObserverToNode(t,h,s)}})))},S=({pageSize:e,pageSizeSelectorOptions:i,onChange:a,translationSlimmer:n})=>{const s=i.sort(((t,e)=>t-e)),o=t=>{const e=Number(t.detail);a(e)};return t("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},t("vega-field-label",{label:n.t("Show")}),t("div",null,t("vega-input-select",{size:"small",source:s.map((t=>({id:t.toString(),displayName:t.toString()}))),value:e.toString(),placeholder:"Page Size",vegaDropdownProps:{matchTargetWidth:!1,searchable:!1},ref:t=>{g.addUniqueObserverToNode(t,l,o)}})))},C=({total:e,current:i,onChange:a,pageCount:n})=>{const s=e=>{const n=i!==e;return t("li",{key:e,class:f(["vega-pagination-item",i===e?"active":""])},t("button",{onClick:()=>n&&a(e)},e))},o=(e,i,a)=>t("li",{class:f(["vega-pagination-button",i&&"disabled"])},t("vega-button-circle",{variant:"icon-only",icon:e,iconColor:"text-link",size:"small",disabled:i,ref:t=>{g.addUniqueObserverToNode(t,m,a)}}));return t("ul",{class:"vega-pagination"},o("chevron-left",0===e||1===i,(()=>{a(i-1)})),0===e?[s(1)]:((t,e,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(e<i)return Array(e).fill(0).map(((t,e)=>e+1));const a=Math.max(1,Math.min(e-i+1,t-Math.floor(i/2))),n=new Array(i);for(let t=0;t<i;t+=1)n[t]=t+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=e-1&&(n[n.length-1]=e,n[n.length-2]="..."),n})(i,n).map((e=>"string"==typeof e?t("li",{class:"vega-pagination-item pager-ellipsis"},"..."):s(e))),o("chevron-right",0===e||i===n,(()=>{a(i+1)})))};var j=function(t,e,i,a){var n,s=arguments.length,o=s<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,a);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const I=class{constructor(a){e(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 b,this.childEventPrevent=new d([p],(()=>this.host)),this.childValueChangePrevent=new d([l],(()=>this.host),!0),this.vegaChangeEventEmitter=v(I,l),this.vegaPageSizeChangeEventEmitter=v(I,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new x,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo"],this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=[["pageSelector"]],this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=e=>t("vega-flex",{gap:"size-24",alignItems:"center",key:this.generateWrapperKey(e)},e.map((e=>t("div",{key:e},this.renderPaginationItem(e))))),this.renderPaginationItem=e=>{switch(e){case"currentPageLabel":return t(y,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const e=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return t(S,{pageSize:this.pageSize,pageSizeSelectorOptions:e,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return t(C,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return t(z,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer})}},this.handlePaginationGoToChange=t=>{this.current=t},this.onPageSizeSelectorChange=t=>{this.pageSize=t},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=t=>{this.current=t},this.removeDuplicateItems=t=>{const e=[...this.vegaPaginationItemTypes];return[...t].map((t=>t.filter(((i,a)=>{const n=e.indexOf(i);return n>=0?(e.splice(n,1),!0):(t.splice(a,1),!1)})))).filter((t=>t.length>0))},this.generateWrapperKey=t=>t.map(String).reduce(((t,e)=>`${t}-${e}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}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()}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){return s(t(a,null,this.removeDuplicateItems(this.extensions).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"]}}};j([w()],I.prototype,"globalSlimmers",void 0),j([u()],I.prototype,"translationSlimmer",void 0),j([u()],I.prototype,"childEventPrevent",void 0),j([u()],I.prototype,"childValueChangePrevent",void 0),j([u()],I.prototype,"vegaChangeEventEmitter",void 0),j([u()],I.prototype,"vegaPageSizeChangeEventEmitter",void 0),j([u()],I.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),I.style=':host{display:flex;align-items:center;justify-content:space-between;gap:20px;line-height:normal}.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{box-shadow:0 0 0 4px rgba(var(--v-ring-action-focus, 19, 98, 226, 0.25));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{I as vega_pagination}
|