@globalpayments/vega 2.53.0 → 2.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-4ecf85bb.js → app-globals-f1ff47e3.js} +1 -1
- package/dist/cjs/{selection-controller-1d7c0999.js → component-value-history-controller-slimmer.abstract-6bfb9145.js} +82 -0
- package/dist/cjs/{design-token-3f4f0bc3.js → design-token-d15e60fa.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-1946ff07.js → element-appender-slimmer-2f16891f.js} +3 -3
- package/dist/cjs/{form-field-controller-slimmer-e721359b.js → form-field-controller-slimmer-dc6d0fe1.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/{inject-keyboard-manager-dd628ccc.js → inject-keyboard-manager-11df8296.js} +1 -1
- package/dist/cjs/{keyboard-manager-8c74eeb9.js → keyboard-manager-1843112c.js} +6 -0
- package/dist/cjs/{keyboard-manager-slimmer-eb364bee.js → keyboard-manager-slimmer-0a5f5770.js} +1 -1
- package/dist/cjs/loader.cjs.js +5 -4
- package/dist/cjs/{page-resize-observer-slimmer-efa79728.js → page-resize-observer-slimmer-11937d6f.js} +3 -3
- package/dist/cjs/{responsive-format-facade-6b81192d.js → responsive-format-facade-4a19e115.js} +2 -2
- package/dist/cjs/{style-formatter-497d0fa4.js → style-formatter-b8cea5ee.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +5 -5
- package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-box.cjs.entry.js +6 -5
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-calendar_3.cjs.entry.js +1 -1
- package/dist/cjs/vega-card.cjs.entry.js +5 -4
- package/dist/cjs/vega-carousel.cjs.entry.js +22 -23
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +210 -94
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +5 -5
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -4
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +24 -9
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -4
- package/dist/cjs/vega-flex.cjs.entry.js +6 -5
- package/dist/cjs/vega-font.cjs.entry.js +5 -4
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-grid.cjs.entry.js +5 -4
- package/dist/cjs/vega-icon.cjs.entry.js +4 -4
- package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +2 -2
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +6 -6
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +28 -4
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +37 -75
- package/dist/cjs/vega-segment-control.cjs.entry.js +1 -1
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +4 -4
- package/dist/cjs/vega-signature-capture.cjs.entry.js +5 -5
- package/dist/cjs/{vega-skeleton-loader-controller-ae2ab090.js → vega-skeleton-loader-controller-3833c813.js} +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -3
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_8.cjs.entry.js +4 -4
- package/dist/cjs/vega-text.cjs.entry.js +2 -1
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -6
- package/dist/cjs/vega.cjs.js +5 -4
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +43 -3
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +1 -1
- package/dist/collection/components/vega-box/vega-box.js +4 -4
- package/dist/collection/components/vega-carousel/vega-carousel.js +19 -19
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-history-controller.js +88 -0
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +36 -23
- package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.js +11 -1
- package/dist/collection/components/vega-code-block/vega-code-block.js +5 -0
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +4 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +29 -0
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.css +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +28 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +28 -67
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +2 -2
- package/dist/collection/components/vega-virtual-scroll/slimmers/controllers/vega-virtual-scroll-mode-controller.js +4 -1
- package/dist/collection/components/vega-virtual-scroll/vega-virtual-scroll.js +2 -1
- package/dist/collection/helpers/keyboard/keyboard-manager.js +6 -0
- package/dist/collection/helpers/keyboard/test/keyboard-manager.test.js +31 -0
- package/dist/collection/helpers/slimmers/component-value-history-controller-slimmer.abstract.js +81 -0
- package/dist/collection/helpers/slimmers/page-resize-observer-slimmer.js +3 -3
- package/dist/collection/helpers/slimmers/test/page-resize-observer-slimmer.test.js +56 -0
- package/dist/esm/{app-globals-d96d623d.js → app-globals-4881974a.js} +1 -1
- package/dist/esm/{selection-controller-3d6dfc87.js → component-value-history-controller-slimmer.abstract-0a0ef33f.js} +82 -1
- package/dist/esm/{design-token-2060cd0d.js → design-token-9bbefd23.js} +1 -1
- package/dist/esm/{element-appender-slimmer-dbdad1df.js → element-appender-slimmer-8652e8d7.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-846cda92.js → form-field-controller-slimmer-6f49d396.js} +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/{inject-keyboard-manager-e39c0fd9.js → inject-keyboard-manager-a15cf43c.js} +1 -1
- package/dist/esm/{keyboard-manager-9564ad83.js → keyboard-manager-f496a623.js} +6 -0
- package/dist/esm/{keyboard-manager-slimmer-2218e6ba.js → keyboard-manager-slimmer-a4cc9593.js} +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/{page-resize-observer-slimmer-c51f1912.js → page-resize-observer-slimmer-0bf7fbf3.js} +3 -3
- package/dist/esm/{responsive-format-facade-8c0ce819.js → responsive-format-facade-bcc2fd21.js} +2 -2
- package/dist/esm/{style-formatter-1eca1299.js → style-formatter-00d6c32f.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-footer.entry.js +2 -2
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-box.entry.js +6 -5
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-calendar_3.entry.js +1 -1
- package/dist/esm/vega-card.entry.js +5 -4
- package/dist/esm/vega-carousel.entry.js +22 -23
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +207 -91
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +5 -5
- package/dist/esm/vega-date-picker_2.entry.js +8 -8
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -4
- package/dist/esm/vega-dropdown_5.entry.js +24 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +5 -4
- package/dist/esm/vega-flex.entry.js +6 -5
- package/dist/esm/vega-font.entry.js +5 -4
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-grid.entry.js +5 -4
- package/dist/esm/vega-icon.entry.js +4 -4
- package/dist/esm/vega-image-uploader.entry.js +5 -5
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-numeric.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +2 -2
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +2 -2
- package/dist/esm/vega-left-nav_5.entry.js +6 -6
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -3
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +4 -4
- package/dist/esm/vega-rich-text-content.entry.js +28 -4
- package/dist/esm/vega-rich-text-editor_4.entry.js +35 -73
- package/dist/esm/vega-segment-control.entry.js +1 -1
- package/dist/esm/vega-selection-chip_2.entry.js +5 -5
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +4 -4
- package/dist/esm/vega-signature-capture.entry.js +5 -5
- package/dist/esm/{vega-skeleton-loader-controller-06f48dd2.js → vega-skeleton-loader-controller-9d1ffa6c.js} +1 -1
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-tab-group_2.entry.js +2 -2
- package/dist/esm/vega-table_8.entry.js +4 -4
- package/dist/esm/vega-text.entry.js +2 -1
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +8 -8
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +7 -6
- package/dist/esm/vega.js +5 -4
- package/dist/types/components/vega-app-footer/types.d.ts +1 -0
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +12 -0
- package/dist/types/components/vega-app-header-button/types.d.ts +1 -0
- package/dist/types/components/vega-box/vega-box.d.ts +4 -4
- package/dist/types/components/vega-carousel/vega-carousel.d.ts +1 -1
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-history-controller.d.ts +47 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-value-controller.d.ts +8 -1
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +2 -0
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/history-controller.d.ts +8 -19
- package/dist/types/components/vega-virtual-scroll/vega-virtual-scroll.d.ts +1 -0
- package/dist/types/components.d.ts +40 -10
- package/dist/types/helpers/slimmers/component-value-history-controller-slimmer.abstract.d.ts +48 -0
- package/dist/types/utils/timer.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-05588c85.entry.js → p-002062c3.entry.js} +1 -1
- package/dist/vega/{p-2490a391.entry.js → p-063d0bee.entry.js} +1 -1
- package/dist/vega/{p-029300db.entry.js → p-0e8324f2.entry.js} +1 -1
- package/dist/vega/{p-62734ef7.entry.js → p-13ca73c7.entry.js} +1 -1
- package/dist/vega/p-1b165fbb.entry.js +1 -0
- package/dist/vega/{p-2a4c313e.entry.js → p-1d41f551.entry.js} +1 -1
- package/dist/vega/p-1e4b6f0a.entry.js +1 -0
- package/dist/vega/{p-abac6b00.entry.js → p-23064067.entry.js} +1 -1
- package/dist/vega/{p-a2d47741.entry.js → p-246090cf.entry.js} +1 -1
- package/dist/vega/{p-5f594deb.entry.js → p-29262ad6.entry.js} +1 -1
- package/dist/vega/p-327be043.js +1 -0
- package/dist/vega/p-43ba9a8a.entry.js +1 -0
- package/dist/vega/{p-685939dc.entry.js → p-468bf93a.entry.js} +1 -1
- package/dist/vega/{p-310f0791.entry.js → p-4df90a1b.entry.js} +1 -1
- package/dist/vega/p-4f5079bc.entry.js +1 -0
- package/dist/vega/p-547692bf.entry.js +1 -0
- package/dist/vega/{p-e00da6d4.entry.js → p-56dc1345.entry.js} +1 -1
- package/dist/vega/{p-06db5a2e.entry.js → p-57005931.entry.js} +1 -1
- package/dist/vega/p-5a6b8846.entry.js +1 -0
- package/dist/vega/p-5e8e4aba.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-888e3f52.entry.js → p-61e1e356.entry.js} +1 -1
- package/dist/vega/p-6bd7114d.entry.js +1 -0
- package/dist/vega/{p-10edaab7.entry.js → p-72e14f49.entry.js} +1 -1
- package/dist/vega/p-73821eba.entry.js +1 -0
- package/dist/vega/{p-75855aaf.entry.js → p-7704a608.entry.js} +1 -1
- package/dist/vega/{p-7f2c98df.entry.js → p-78937642.entry.js} +1 -1
- package/dist/vega/{p-ca0294c9.entry.js → p-79370ad4.entry.js} +1 -1
- package/dist/vega/p-7cb11f3f.entry.js +1 -0
- package/dist/vega/p-7d9cd9c8.js +1 -0
- package/dist/vega/{p-40577e8e.js → p-822cd8e5.js} +1 -1
- package/dist/vega/{p-517615af.entry.js → p-8270bb8f.entry.js} +1 -1
- package/dist/vega/{p-c22c628b.entry.js → p-84a31a31.entry.js} +1 -1
- package/dist/vega/{p-092c87b5.entry.js → p-9a0d3d2d.entry.js} +1 -1
- package/dist/vega/p-9dc9fcf3.js +1 -0
- package/dist/vega/{p-fb306e0e.entry.js → p-a2c4c241.entry.js} +1 -1
- package/dist/vega/p-a46ac2eb.js +1 -0
- package/dist/vega/{p-adadb1a1.entry.js → p-a63e2fee.entry.js} +1 -1
- package/dist/vega/p-ad858290.entry.js +1 -0
- package/dist/vega/{p-3e8a8aa5.entry.js → p-b6e0d996.entry.js} +1 -1
- package/dist/vega/{p-33bd7e31.js → p-b89a9760.js} +1 -1
- package/dist/vega/{p-72eb8998.entry.js → p-bbdc6170.entry.js} +1 -1
- package/dist/vega/{p-35c9cd1d.entry.js → p-c10b4f47.entry.js} +1 -1
- package/dist/vega/{p-eeab4167.entry.js → p-c212a1e3.entry.js} +1 -1
- package/dist/vega/{p-e1ba6325.entry.js → p-c48a8510.entry.js} +1 -1
- package/dist/vega/{p-ab2a6d14.entry.js → p-c5afd9aa.entry.js} +1 -1
- package/dist/vega/{p-efb06a25.entry.js → p-c7e2a155.entry.js} +1 -1
- package/dist/vega/p-c8a87f06.entry.js +1 -0
- package/dist/vega/p-c990e249.js +1 -0
- package/dist/vega/{p-8d3764d3.entry.js → p-ca91268b.entry.js} +1 -1
- package/dist/vega/p-cae183fd.entry.js +1 -0
- package/dist/vega/p-cb36ccf0.entry.js +1 -0
- package/dist/vega/{p-55563f5f.js → p-cc6410e6.js} +1 -1
- package/dist/vega/{p-eb832119.js → p-d5f1794e.js} +1 -1
- package/dist/vega/{p-72e64237.js → p-da1d0c02.js} +1 -1
- package/dist/vega/{p-812b9d6d.entry.js → p-da95668c.entry.js} +1 -1
- package/dist/vega/p-e66f6b59.entry.js +9 -0
- package/dist/vega/p-e8b56d3f.entry.js +1 -0
- package/dist/vega/p-ec3495de.entry.js +1 -0
- package/dist/vega/{p-44dee180.entry.js → p-ecd9a973.entry.js} +1 -1
- package/dist/vega/p-f17c9093.entry.js +1 -0
- package/dist/vega/{p-b13fff4d.entry.js → p-f50cd6c3.entry.js} +1 -1
- package/dist/vega/{p-b4a1a8e1.entry.js → p-f7062473.entry.js} +1 -1
- package/dist/vega/{p-a0dab2d0.js → p-f9cf7e36.js} +1 -1
- package/dist/vega/{p-d8eec0bb.entry.js → p-fc790de5.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-06fb002a.js +0 -1
- package/dist/vega/p-0f034db5.entry.js +0 -1
- package/dist/vega/p-0fb26be0.entry.js +0 -9
- package/dist/vega/p-1df029c2.js +0 -1
- package/dist/vega/p-2f5d9aab.js +0 -1
- package/dist/vega/p-32a24ef1.entry.js +0 -1
- package/dist/vega/p-3a6b4208.entry.js +0 -1
- package/dist/vega/p-3b34389d.js +0 -1
- package/dist/vega/p-52905c68.entry.js +0 -1
- package/dist/vega/p-642da014.entry.js +0 -1
- package/dist/vega/p-65cca90f.js +0 -1
- package/dist/vega/p-7f0def5a.entry.js +0 -1
- package/dist/vega/p-834434d5.js +0 -1
- package/dist/vega/p-8a0d7805.entry.js +0 -1
- package/dist/vega/p-90954fe4.entry.js +0 -1
- package/dist/vega/p-afc49b98.entry.js +0 -1
- package/dist/vega/p-b7594b78.entry.js +0 -1
- package/dist/vega/p-c91190df.entry.js +0 -1
- package/dist/vega/p-cb643d8d.entry.js +0 -1
- package/dist/vega/p-e16e23b7.entry.js +0 -1
- package/dist/vega/p-e5f1fd0b.entry.js +0 -1
- package/dist/vega/p-f2f31686.entry.js +0 -1
- package/dist/vega/p-f41ae5e0.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,M as t,V as s}from"./p-6e1ab235.js";import{B as n}from"./p-74168615.js";import{B as r}from"./p-ed45b3b6.js";import{t as i}from"./p-b75ee3ba.js";const o=()=>{let e=n.length-1;const t=window.innerWidth;for(;e>=0;e--){const s=n[e];if("default"===s)break;if(t>=r[s])return s}return"default"},c=e=>{let t;return n.forEach((s=>{Object.prototype.hasOwnProperty.call(e,s)?t=e[s]:e[s]=t})),e};var l=function(e,t,s,n){var r,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,n);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(o=(i<3?r(o):i>3?r(t,s,o):r(t,s))||o);return i>3&&o&&Object.defineProperty(t,s,o),o};class a extends s{constructor(e){super(),this.observerEntry=e}reconnectResizeObserver(){null===this.resizeObserver&&this.createResizeObserver()}disconnectResizeObserver(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.resizeObserver=null}connectResizeObserver(){this.createResizeObserver()}createResizeObserver(){var e;const t=this.observerEntry;null===(e=this.resizeObserver)||void 0===e||e.disconnect();const s=window.VegaResizeObserver||window.ResizeObserver;s&&(this.resizeObserver=new s(((e,s)=>{if(!t||"function"!=typeof t.shouldTrigger||t.shouldTrigger())if(t&&"function"==typeof t.callback){const n=()=>{t.callback(e,s)};t.isDeferred?setTimeout(n):n()}else this.currentBreakpoint=o()}))),this.observerResizeObserver()}observerResizeObserver(){var e;if(this.resizeObserver&&i()){const t=this.resizeObserver;let s=null;(null===(e=this.observerEntry)||void 0===e?void 0:e.target)&&(s=this.observerEntry.target()),Array.isArray(s)?s.forEach((e=>{t.observe(e)})):t.observe(s||i().body)}}}l([e({writable:!0,isOptional:!0})],a.prototype,"currentBreakpoint",void 0),l([t("connectedCallback")],a.prototype,"reconnectResizeObserver",null),l([t("disconnectedCallback")],a.prototype,"disconnectResizeObserver",null),l([t("componentDidLoad")],a.prototype,"connectResizeObserver",null);export{a as P,c,o as g}
|
|
@@ -1 +1 @@
|
|
|
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-d5776087.js";import{I as c}from"./p-eb832119.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-834434d5.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-06fb002a.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as b}from"./p-6e01f0a2.js";import{q as w}from"./p-425ba7d6.js";import{D as j}from"./p-e7b00bf0.js";class R{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()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{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()],C.prototype,"showConfig",void 0);class x extends y{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})],x.prototype,"showConfig",void 0);class O extends y{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()],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.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}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]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A 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=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}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 P=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 k extends A{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}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{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()],T.prototype,"showConfig",void 0);var $=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 D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}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&&!this.showConfig.isScreenPosition){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`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=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 L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,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 E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}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),this.resetContainerPosition(),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=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.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(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}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}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=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};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(b.getSubject(e,w),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,w,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=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 F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),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.listenShadowRootElementScrolling()},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;r(t.relatedTarget,null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)||this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&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)}),F.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.destroyElementAppender()}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,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(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),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F 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-d5776087.js";import{I as c}from"./p-d5f1794e.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-7d9cd9c8.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-327be043.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as b}from"./p-6e01f0a2.js";import{q as w}from"./p-425ba7d6.js";import{D as j}from"./p-e7b00bf0.js";class R{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()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{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()],C.prototype,"showConfig",void 0);class x extends y{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})],x.prototype,"showConfig",void 0);class O extends y{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()],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.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}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]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A 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=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}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 P=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 k extends A{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}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{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()],T.prototype,"showConfig",void 0);var $=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 D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}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&&!this.showConfig.isScreenPosition){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`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=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 L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,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 E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}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),this.resetContainerPosition(),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=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.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(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}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}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=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};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(b.getSubject(e,w),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,w,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=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 F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),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.listenShadowRootElementScrolling()},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;r(t.relatedTarget,null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)||this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&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)}),F.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.destroyElementAppender()}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,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(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),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F as E}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,H as a,g as n}from"./p-21d26bb4.js";import{s as o}from"./p-519a7d55.js";import{n as s,c as r}from"./p-262ec334.js";import{D as p}from"./p-e7b00bf0.js";import{w as g,B as l,f as h,a as c,L as m}from"./p-6e01f0a2.js";import{a as f}from"./p-d5776087.js";import{C as u}from"./p-6b7dca3e.js";import{c as v}from"./p-012cbd8f.js";import{c as d,M as b,V as x,I as w}from"./p-6e1ab235.js";import{V as S,I as j}from"./p-4387d550.js";import{T as y}from"./p-d64b20c2.js";import{R as C}from"./p-06fb002a.js";import{P as z,g as P}from"./p-834434d5.js";import{k as O,l as k}from"./p-425ba7d6.js";import"./p-5f377954.js";import"./p-eb832119.js";import{F as I}from"./p-4d793cb0.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-613ee009.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-37b05e0b.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-7a40e033.js";import"./p-3eb2d433.js";const L=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},M=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{p.addUniqueObserverToNode(e,g,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,p.addUniqueObserverToNode(e,l,o)}})))},E=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o})=>{const s=i.sort(((e,t)=>e-t)),r=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:s.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{p.addUniqueObserverToNode(e,h,r)}})))},R=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:f(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:f(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{p.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var T=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class N extends x{registerPaginationPageSizeChangeObserver(){p.addUniqueObserverToNode(this.host,O,(e=>{this.pageSize=Number(e.detail)}))}unregisterPaginationPageSizeChangeObserver(){p.removeUniqueObserverFromNode(this.host,O)}}T([d()],N.prototype,"host",void 0),T([d({writable:!0})],N.prototype,"pageSize",void 0),T([b("connectedCallback")],N.prototype,"registerPaginationPageSizeChangeObserver",null),T([b("disconnectedCallback")],N.prototype,"unregisterPaginationPageSizeChangeObserver",null);var _=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class A extends x{registerPaginationCurrentChangeObserver(){p.addUniqueObserverToNode(this.host,k,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){p.removeUniqueObserverFromNode(this.host,k)}}_([d()],A.prototype,"host",void 0),_([d({writable:!0})],A.prototype,"current",void 0),_([b("connectedCallback")],A.prototype,"registerPaginationCurrentChangeObserver",null),_([b("disconnectedCallback")],A.prototype,"unregisterPaginationCurrentChangeObserver",null);var V=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class B extends z{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=C.formatCustom(this.layout)}}V([d()],B.prototype,"host",void 0),V([d()],B.prototype,"layout",void 0),V([b("componentWillLoad")],B.prototype,"componentWillLoad",null),V([b("watchCurrentBreakpoint")],B.prototype,"watchCurrentBreakpoint",null),V([b("watchLayout")],B.prototype,"watchLayout",null);var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const G=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new y,this.childEventPrevent=new u([g],(()=>this.host)),this.childValueChangePrevent=new u([h],(()=>this.host),!0),this.vegaChangeEventEmitter=v(G,h),this.vegaPageSizeChangeEventEmitter=v(G,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new S,this.vegaPaginationPageSizeObserverController=new N,this.vegaPaginationCurrentPageObserverController=new A,this.breakpointPageResizeObserverSlimmer=new z,this.vegaPaginationLayoutController=new B,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=P(),this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=I.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(L,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(E,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return e(R,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(M,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(){this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=C.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};W([j()],G.prototype,"globalSlimmers",void 0),W([w()],G.prototype,"translationSlimmer",void 0),W([w()],G.prototype,"childEventPrevent",void 0),W([w()],G.prototype,"childValueChangePrevent",void 0),W([w()],G.prototype,"vegaChangeEventEmitter",void 0),W([w()],G.prototype,"vegaPageSizeChangeEventEmitter",void 0),W([w()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W([w()],G.prototype,"vegaPaginationPageSizeObserverController",void 0),W([w()],G.prototype,"vegaPaginationCurrentPageObserverController",void 0),W([w()],G.prototype,"breakpointPageResizeObserverSlimmer",void 0),W([w()],G.prototype,"vegaPaginationLayoutController",void 0),G.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{G as vega_pagination}
|
|
1
|
+
import{h as e,r as t,c as i,H as a,g as n}from"./p-21d26bb4.js";import{s as o}from"./p-519a7d55.js";import{n as s,c as r}from"./p-262ec334.js";import{D as p}from"./p-e7b00bf0.js";import{w as g,B as l,f as h,a as c,L as m}from"./p-6e01f0a2.js";import{a as f}from"./p-d5776087.js";import{C as u}from"./p-6b7dca3e.js";import{c as v}from"./p-012cbd8f.js";import{c as d,M as b,V as x,I as w}from"./p-6e1ab235.js";import{V as S,I as j}from"./p-4387d550.js";import{T as y}from"./p-d64b20c2.js";import{R as C}from"./p-327be043.js";import{P as z,g as P}from"./p-7d9cd9c8.js";import{k as O,l as k}from"./p-425ba7d6.js";import"./p-5f377954.js";import"./p-d5f1794e.js";import{F as I}from"./p-4d793cb0.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-613ee009.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-37b05e0b.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-7a40e033.js";import"./p-3eb2d433.js";const L=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},M=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{p.addUniqueObserverToNode(e,g,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,p.addUniqueObserverToNode(e,l,o)}})))},E=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o})=>{const s=i.sort(((e,t)=>e-t)),r=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:s.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{p.addUniqueObserverToNode(e,h,r)}})))},R=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:f(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:f(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{p.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var T=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class N extends x{registerPaginationPageSizeChangeObserver(){p.addUniqueObserverToNode(this.host,O,(e=>{this.pageSize=Number(e.detail)}))}unregisterPaginationPageSizeChangeObserver(){p.removeUniqueObserverFromNode(this.host,O)}}T([d()],N.prototype,"host",void 0),T([d({writable:!0})],N.prototype,"pageSize",void 0),T([b("connectedCallback")],N.prototype,"registerPaginationPageSizeChangeObserver",null),T([b("disconnectedCallback")],N.prototype,"unregisterPaginationPageSizeChangeObserver",null);var _=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class A extends x{registerPaginationCurrentChangeObserver(){p.addUniqueObserverToNode(this.host,k,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){p.removeUniqueObserverFromNode(this.host,k)}}_([d()],A.prototype,"host",void 0),_([d({writable:!0})],A.prototype,"current",void 0),_([b("connectedCallback")],A.prototype,"registerPaginationCurrentChangeObserver",null),_([b("disconnectedCallback")],A.prototype,"unregisterPaginationCurrentChangeObserver",null);var V=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class B extends z{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=C.formatCustom(this.layout)}}V([d()],B.prototype,"host",void 0),V([d()],B.prototype,"layout",void 0),V([b("componentWillLoad")],B.prototype,"componentWillLoad",null),V([b("watchCurrentBreakpoint")],B.prototype,"watchCurrentBreakpoint",null),V([b("watchLayout")],B.prototype,"watchLayout",null);var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const G=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new y,this.childEventPrevent=new u([g],(()=>this.host)),this.childValueChangePrevent=new u([h],(()=>this.host),!0),this.vegaChangeEventEmitter=v(G,h),this.vegaPageSizeChangeEventEmitter=v(G,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new S,this.vegaPaginationPageSizeObserverController=new N,this.vegaPaginationCurrentPageObserverController=new A,this.breakpointPageResizeObserverSlimmer=new z,this.vegaPaginationLayoutController=new B,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=P(),this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=I.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(L,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(E,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return e(R,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(M,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(){this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=C.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};W([j()],G.prototype,"globalSlimmers",void 0),W([w()],G.prototype,"translationSlimmer",void 0),W([w()],G.prototype,"childEventPrevent",void 0),W([w()],G.prototype,"childValueChangePrevent",void 0),W([w()],G.prototype,"vegaChangeEventEmitter",void 0),W([w()],G.prototype,"vegaPageSizeChangeEventEmitter",void 0),W([w()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W([w()],G.prototype,"vegaPaginationPageSizeObserverController",void 0),W([w()],G.prototype,"vegaPaginationCurrentPageObserverController",void 0),W([w()],G.prototype,"breakpointPageResizeObserverSlimmer",void 0),W([w()],G.prototype,"vegaPaginationLayoutController",void 0),G.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{G as vega_pagination}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,H as t,r as i,c as o,g as r}from"./p-21d26bb4.js";import{s}from"./p-519a7d55.js";import{c as a,M as l,V as n,I as d,L as c}from"./p-6e1ab235.js";import{V as h,I as p}from"./p-4387d550.js";import{R as v}from"./p-06fb002a.js";import{c as b}from"./p-86194314.js";import{S as g}from"./p-138fcf6e.js";import{O as f}from"./p-331a62d5.js";import{d as m,f as u}from"./p-6e01f0a2.js";import{c as x}from"./p-425ba7d6.js";import{f as w}from"./p-d5776087.js";import{C as j}from"./p-2d0d575f.js";import{P as y,g as k}from"./p-834434d5.js";import{c as C}from"./p-012cbd8f.js";import{b as R}from"./p-5773a9a3.js";import{M as z}from"./p-78a57a17.js";import{a as S}from"./p-52b8f2d2.js";import{i as O}from"./p-d27ae9ff.js";import{c as E}from"./p-8e31e7ea.js";import{C as T}from"./p-6b7dca3e.js";import{F as I}from"./p-72e64237.js";import{R as V}from"./p-280cbcdb.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-eb832119.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";import"./p-e7b00bf0.js";import"./p-b75ee3ba.js";import"./p-0bb29d98.js";import"./p-abd7aeaa.js";var N=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class L extends n{componentWillRender(){this.currentSize=v.formatCustom(this.size)}render(){return e(t,{class:{block:this.block}},this.renderTooltip())}renderTooltip(){return e("vega-tooltip",Object.assign({trigger:this.disabled&&this.disabledTooltip?"hover":"none",alignment:"center"},this.disabledTooltip),this.renderSelectionChip())}renderSelectionChip(){return e("vega-box",{corners:"rounded-full",class:{"vega-selection-chip":!0,[`size-${this.currentSize}`]:!0,[`variant-${this.variant||"text"}`]:!0,checked:this.checked,error:this.showError,disabled:this.disabled},"aria-label":this.label||"No label defined",onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:b(),tabIndex:this.disabled?-1:0},this.renderContent())}renderContent(){return e("vega-flex",{gap:L.gapSizeMap[this.currentSize],"align-items":"center","justify-content":"text"===this.variant?"center":"start"},"swatch"===this.variant&&this.renderSwatch(),this.renderLabel())}renderLabel(){return e("vega-font",{color:"text-primary",class:"label vega-flex-grow",variant:L.labelFontMap[this.currentSize]},this.label)}renderSwatch(){return e("vega-box",{"background-color":"bg-primary",corners:"rounded-full",class:"swatch vega-flex-shrink-0"},e("vega-box",{"background-color":this.swatchColor,corners:"rounded-full"}))}}L.gapSizeMap={"extra-small":"size-4",small:"size-4",medium:"size-8",large:"size-8"},L.labelFontMap={"extra-small":"font-field-label-xs",small:"font-field-label-sm",medium:"font-field-label",large:"font-field-label-lg"},N([a()],L.prototype,"host",void 0),N([a()],L.prototype,"label",void 0),N([a()],L.prototype,"block",void 0),N([a()],L.prototype,"size",void 0),N([a()],L.prototype,"variant",void 0),N([a()],L.prototype,"swatchColor",void 0),N([a()],L.prototype,"disabledTooltip",void 0),N([a()],L.prototype,"disabled",void 0),N([a()],L.prototype,"selectType",void 0),N([a()],L.prototype,"checked",void 0),N([a()],L.prototype,"checkedController",void 0),N([a()],L.prototype,"showError",void 0),N([l("componentWillRender")],L.prototype,"componentWillRender",null);var A=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class F extends n{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.setChecked(e),this.changeEventEmitter.emit(t)}}A([a()],F.prototype,"host",void 0),A([a({writable:!0})],F.prototype,"checked",void 0),A([a()],F.prototype,"changeEventEmitter",void 0),A([a()],F.prototype,"value",void 0);var D=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class G extends g{constructor(){super({parent:"vega-selection-chip-group",subStates:[{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"selectType",parentStateName:"selectType",callback:e=>{this.selectType="checkbox"===e?"checkbox":"radio"}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}}]})}}D([a()],G.prototype,"host",void 0),D([a({writable:!0})],G.prototype,"disabled",void 0),D([a({writable:!0})],G.prototype,"selectType",void 0),D([a()],G.prototype,"value",void 0),D([a()],G.prototype,"checkedController",void 0);var W=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class M extends n{connectedCallback(){this.selectionChipGroup=w(this.host,"vega-selection-chip-group"),this.selectionChipGroup&&(this.fieldErrorObserver=new f(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),j.register(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver))}disconnectedCallback(){this.selectionChipGroup&&j.unregister(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}W([a({writable:!0})],M.prototype,"showError",void 0),W([a()],M.prototype,"host",void 0),W([l("connectedCallback")],M.prototype,"connectedCallback",null),W([l("disconnectedCallback")],M.prototype,"disconnectedCallback",null);var _=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const H=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.checkedController=new F,this.stateController=new G,this.showErrorController=new M,this.pageResizeObserverSlimmer=new y,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(H,u),this.showError=!1,this.currentBreakpoint=k(),this.label="",this.size="medium",this.variant="text",this.disabled=!1,this.block=!1,this.swatchColor="bg-status-info"}watchSize(){}componentWillRender(){}render(){return s(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{size:["watchSize"]}}};_([p()],H.prototype,"globalSlimmers",void 0),_([d()],H.prototype,"renderer",void 0),_([d()],H.prototype,"checkedController",void 0),_([d()],H.prototype,"stateController",void 0),_([d()],H.prototype,"showErrorController",void 0),_([d()],H.prototype,"pageResizeObserverSlimmer",void 0),_([d()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_([d()],H.prototype,"changeEventEmitter",void 0),H.style=":host(.block){display:block}:host(.block) vega-tooltip{display:block}:host{max-width:100%;display:inline-block;vertical-align:middle;line-height:0}:host vega-tooltip{max-width:100%}:host .swatch{margin:2px;padding:1px;box-sizing:border-box}:host .swatch vega-box{width:100%;height:100%}:host .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .vega-selection-chip{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));cursor:pointer;margin:1px}:host .variant-text .label{text-align:center}:host .size-extra-small.variant-swatch.vega-selection-chip{padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:12px}:host .size-extra-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:2px;padding-bottom:2px}:host .size-extra-small vega-flex{height:16px}:host .size-extra-small .swatch{width:12px;height:12px}:host .size-small.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:12px}:host .size-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px}:host .size-small vega-flex{height:24px}:host .size-small .swatch{width:20px;height:20px}:host .size-medium.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:16px}:host .size-medium.variant-text.vega-selection-chip{padding-left:16px;padding-right:16px;padding-top:4px;padding-bottom:4px}:host .size-medium vega-flex{height:32px}:host .size-medium .swatch{width:28px;height:28px}:host .size-large.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:20px}:host .size-large.variant-text.vega-selection-chip{padding-left:20px;padding-right:20px;padding-top:4px;padding-bottom:4px}:host .size-large vega-flex{height:40px}:host .size-large .swatch{width:36px;height:36px}:host .vega-selection-chip:not(.disabled){background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-tile, 171, 198, 216, 1))}:host .vega-selection-chip:not(.disabled):hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-tile-hover, 115, 160, 190, 1))}:host .vega-selection-chip:not(.disabled):focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-tile-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .vega-selection-chip:not(.disabled).checked:hover{background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1))}:host .vega-selection-chip:not(.disabled).checked:focus-visible{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).error{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-selection-chip:not(.disabled).error:hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-selection-chip:not(.disabled).error:focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}:host .vega-selection-chip.disabled{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));pointer-events:none;color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled:focus-visible{outline:none}:host .vega-selection-chip.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled .swatch{opacity:0.5}";var P=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class $ extends n{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("slot",null))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([a()],$.prototype,"host",void 0),P([a()],$.prototype,"label",void 0),P([a()],$.prototype,"required",void 0),P([a()],$.prototype,"hint",void 0),P([a()],$.prototype,"disabled",void 0);var q=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class U extends n{watchValue(){this.changeEventEmitter.emit(this.value),j.notify(R,{host:this.host,detail:this.value})}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"radio":return"string"==typeof e;case"checkbox":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return c.warn(`Invalid selection chip group value ${e} for ${this.selectType} mode`),!1}}}q([a()],U.prototype,"host",void 0),q([a({writable:!0})],U.prototype,"value",void 0),q([a()],U.prototype,"changeEventEmitter",void 0),q([a()],U.prototype,"selectType",void 0),q([l("watchValue")],U.prototype,"watchValue",null);var K=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class B extends n{constructor(){super(...arguments),this.mutationObserver=new z({target:()=>this.host,options:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["checked"]},mutationFilter:S("VEGA-SELECTION-CHIP"),callback:this.syncChipArrayAndValue.bind(this)}),this.selectionChipArray=[]}disconnectedCallback(){}componentWillLoad(){this.value&&0!==this.value.length||this.syncChipArrayAndValue()}componentDidLoad(){}watchSelectType(){this.syncChipArrayAndValue()}getSelectionChipArray(){return this.selectionChipArray}syncChipArrayAndValue(e){this.selectionChipArray=Array.from(this.host.querySelectorAll("vega-selection-chip")),"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems(e)}setValueFromCheckboxItems(){const e=this.selectionChipArray.filter((e=>e.checked)).map((e=>e.value));O(this.value,e,!0)||this.valueController.setValue(e)}setValueFromRadioItems(e){const t=this.findAttributeMutation(e);if(t){const e=this.getCurrentChip(t);e&&e.checked&&this.valueController.setValue(e.value)}else{const e=this.getFirstCheckedChip();this.valueController.setValue(e?e.value:"")}}findAttributeMutation(e){return e&&e.find((e=>e.attributeName))}getCurrentChip(e){if(e&&"VEGA-SELECTION-CHIP"===e.target.tagName&&"checked"===e.attributeName)return e.target}getFirstCheckedChip(){return this.selectionChipArray.find((e=>e.checked))}}K([a()],B.prototype,"host",void 0),K([a()],B.prototype,"selectType",void 0),K([a()],B.prototype,"valueController",void 0),K([a()],B.prototype,"value",void 0),K([d()],B.prototype,"mutationObserver",void 0),K([l("disconnectedCallback")],B.prototype,"disconnectedCallback",null),K([l("componentWillLoad")],B.prototype,"componentWillLoad",null),K([l("componentDidLoad")],B.prototype,"componentDidLoad",null),K([l("watchSelectType")],B.prototype,"watchSelectType",null);var J=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const Q=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new $,this.itemsController=new B,this.valueController=new U,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new V:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.getSelectionChipArray(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(Q,u),this.valueNotifySlimmer=E(Q,"value","watchValue"),this.disabledNotifySlimmer=E(Q,"disabled","watchDisabled"),this.selectTypeNotifySlimmer=E(Q,"selectType","watchSelectType"),this.changeEventPrevent=new T([u],(()=>this.host),!0),this.label="",this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.validationRules=[],this.isValid=null}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return s(e(t,null,this.renderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};J([p()],Q.prototype,"globalSlimmers",void 0),J([d()],Q.prototype,"renderer",void 0),J([d()],Q.prototype,"itemsController",void 0),J([d()],Q.prototype,"valueController",void 0),J([d()],Q.prototype,"formFieldController",void 0),J([d()],Q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J([d()],Q.prototype,"changeEventEmitter",void 0),J([d()],Q.prototype,"valueNotifySlimmer",void 0),J([d()],Q.prototype,"disabledNotifySlimmer",void 0),J([d()],Q.prototype,"selectTypeNotifySlimmer",void 0),J([d()],Q.prototype,"changeEventPrevent",void 0),Q.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host .vega-hint{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));padding-top:4px;padding-left:8px;padding-right:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-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-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-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:block;margin-top:12px;margin-left:8px;margin-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{H as vega_selection_chip,Q as vega_selection_chip_group}
|
|
1
|
+
import{h as e,H as t,r as i,c as o,g as r}from"./p-21d26bb4.js";import{s}from"./p-519a7d55.js";import{c as a,M as l,V as n,I as d,L as c}from"./p-6e1ab235.js";import{V as h,I as p}from"./p-4387d550.js";import{R as v}from"./p-327be043.js";import{c as b}from"./p-86194314.js";import{S as g}from"./p-138fcf6e.js";import{O as f}from"./p-331a62d5.js";import{d as m,f as u}from"./p-6e01f0a2.js";import{c as x}from"./p-425ba7d6.js";import{f as w}from"./p-d5776087.js";import{C as j}from"./p-2d0d575f.js";import{P as y,g as k}from"./p-7d9cd9c8.js";import{c as C}from"./p-012cbd8f.js";import{b as R}from"./p-5773a9a3.js";import{M as z}from"./p-78a57a17.js";import{a as S}from"./p-52b8f2d2.js";import{i as O}from"./p-d27ae9ff.js";import{c as E}from"./p-8e31e7ea.js";import{C as T}from"./p-6b7dca3e.js";import{F as I}from"./p-da1d0c02.js";import{R as V}from"./p-280cbcdb.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-d5f1794e.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";import"./p-b75ee3ba.js";import"./p-e7b00bf0.js";import"./p-0bb29d98.js";import"./p-abd7aeaa.js";var N=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class L extends n{componentWillRender(){this.currentSize=v.formatCustom(this.size)}render(){return e(t,{class:{block:this.block}},this.renderTooltip())}renderTooltip(){return e("vega-tooltip",Object.assign({trigger:this.disabled&&this.disabledTooltip?"hover":"none",alignment:"center"},this.disabledTooltip),this.renderSelectionChip())}renderSelectionChip(){return e("vega-box",{corners:"rounded-full",class:{"vega-selection-chip":!0,[`size-${this.currentSize}`]:!0,[`variant-${this.variant||"text"}`]:!0,checked:this.checked,error:this.showError,disabled:this.disabled},"aria-label":this.label||"No label defined",onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:b(),tabIndex:this.disabled?-1:0},this.renderContent())}renderContent(){return e("vega-flex",{gap:L.gapSizeMap[this.currentSize],"align-items":"center","justify-content":"text"===this.variant?"center":"start"},"swatch"===this.variant&&this.renderSwatch(),this.renderLabel())}renderLabel(){return e("vega-font",{color:"text-primary",class:"label vega-flex-grow",variant:L.labelFontMap[this.currentSize]},this.label)}renderSwatch(){return e("vega-box",{"background-color":"bg-primary",corners:"rounded-full",class:"swatch vega-flex-shrink-0"},e("vega-box",{"background-color":this.swatchColor,corners:"rounded-full"}))}}L.gapSizeMap={"extra-small":"size-4",small:"size-4",medium:"size-8",large:"size-8"},L.labelFontMap={"extra-small":"font-field-label-xs",small:"font-field-label-sm",medium:"font-field-label",large:"font-field-label-lg"},N([a()],L.prototype,"host",void 0),N([a()],L.prototype,"label",void 0),N([a()],L.prototype,"block",void 0),N([a()],L.prototype,"size",void 0),N([a()],L.prototype,"variant",void 0),N([a()],L.prototype,"swatchColor",void 0),N([a()],L.prototype,"disabledTooltip",void 0),N([a()],L.prototype,"disabled",void 0),N([a()],L.prototype,"selectType",void 0),N([a()],L.prototype,"checked",void 0),N([a()],L.prototype,"checkedController",void 0),N([a()],L.prototype,"showError",void 0),N([l("componentWillRender")],L.prototype,"componentWillRender",null);var A=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class F extends n{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.setChecked(e),this.changeEventEmitter.emit(t)}}A([a()],F.prototype,"host",void 0),A([a({writable:!0})],F.prototype,"checked",void 0),A([a()],F.prototype,"changeEventEmitter",void 0),A([a()],F.prototype,"value",void 0);var D=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class G extends g{constructor(){super({parent:"vega-selection-chip-group",subStates:[{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"selectType",parentStateName:"selectType",callback:e=>{this.selectType="checkbox"===e?"checkbox":"radio"}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}}]})}}D([a()],G.prototype,"host",void 0),D([a({writable:!0})],G.prototype,"disabled",void 0),D([a({writable:!0})],G.prototype,"selectType",void 0),D([a()],G.prototype,"value",void 0),D([a()],G.prototype,"checkedController",void 0);var W=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class M extends n{connectedCallback(){this.selectionChipGroup=w(this.host,"vega-selection-chip-group"),this.selectionChipGroup&&(this.fieldErrorObserver=new f(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),j.register(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver))}disconnectedCallback(){this.selectionChipGroup&&j.unregister(m.getSubject(this.selectionChipGroup,x),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}W([a({writable:!0})],M.prototype,"showError",void 0),W([a()],M.prototype,"host",void 0),W([l("connectedCallback")],M.prototype,"connectedCallback",null),W([l("disconnectedCallback")],M.prototype,"disconnectedCallback",null);var _=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const H=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.checkedController=new F,this.stateController=new G,this.showErrorController=new M,this.pageResizeObserverSlimmer=new y,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(H,u),this.showError=!1,this.currentBreakpoint=k(),this.label="",this.size="medium",this.variant="text",this.disabled=!1,this.block=!1,this.swatchColor="bg-status-info"}watchSize(){}componentWillRender(){}render(){return s(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{size:["watchSize"]}}};_([p()],H.prototype,"globalSlimmers",void 0),_([d()],H.prototype,"renderer",void 0),_([d()],H.prototype,"checkedController",void 0),_([d()],H.prototype,"stateController",void 0),_([d()],H.prototype,"showErrorController",void 0),_([d()],H.prototype,"pageResizeObserverSlimmer",void 0),_([d()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_([d()],H.prototype,"changeEventEmitter",void 0),H.style=":host(.block){display:block}:host(.block) vega-tooltip{display:block}:host{max-width:100%;display:inline-block;vertical-align:middle;line-height:0}:host vega-tooltip{max-width:100%}:host .swatch{margin:2px;padding:1px;box-sizing:border-box}:host .swatch vega-box{width:100%;height:100%}:host .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .vega-selection-chip{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));cursor:pointer;margin:1px}:host .variant-text .label{text-align:center}:host .size-extra-small.variant-swatch.vega-selection-chip{padding-top:2px;padding-bottom:2px;padding-left:2px;padding-right:12px}:host .size-extra-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:2px;padding-bottom:2px}:host .size-extra-small vega-flex{height:16px}:host .size-extra-small .swatch{width:12px;height:12px}:host .size-small.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:12px}:host .size-small.variant-text.vega-selection-chip{padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px}:host .size-small vega-flex{height:24px}:host .size-small .swatch{width:20px;height:20px}:host .size-medium.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:16px}:host .size-medium.variant-text.vega-selection-chip{padding-left:16px;padding-right:16px;padding-top:4px;padding-bottom:4px}:host .size-medium vega-flex{height:32px}:host .size-medium .swatch{width:28px;height:28px}:host .size-large.variant-swatch.vega-selection-chip{padding-top:4px;padding-bottom:4px;padding-left:4px;padding-right:20px}:host .size-large.variant-text.vega-selection-chip{padding-left:20px;padding-right:20px;padding-top:4px;padding-bottom:4px}:host .size-large vega-flex{height:40px}:host .size-large .swatch{width:36px;height:36px}:host .vega-selection-chip:not(.disabled){background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-tile, 171, 198, 216, 1))}:host .vega-selection-chip:not(.disabled):hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-tile-hover, 115, 160, 190, 1))}:host .vega-selection-chip:not(.disabled):focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-tile-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .vega-selection-chip:not(.disabled).checked:hover{background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1))}:host .vega-selection-chip:not(.disabled).checked:focus-visible{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected-focus, 19, 98, 226, 1))}:host .vega-selection-chip:not(.disabled).error{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-selection-chip:not(.disabled).error:hover{background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-selection-chip:not(.disabled).error:focus-visible{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}:host .vega-selection-chip.disabled{background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));pointer-events:none;color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled:focus-visible{outline:none}:host .vega-selection-chip.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-selection-chip.disabled .swatch{opacity:0.5}";var P=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class $ extends n{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("slot",null))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([a()],$.prototype,"host",void 0),P([a()],$.prototype,"label",void 0),P([a()],$.prototype,"required",void 0),P([a()],$.prototype,"hint",void 0),P([a()],$.prototype,"disabled",void 0);var q=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class U extends n{watchValue(){this.changeEventEmitter.emit(this.value),j.notify(R,{host:this.host,detail:this.value})}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"radio":return"string"==typeof e;case"checkbox":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return c.warn(`Invalid selection chip group value ${e} for ${this.selectType} mode`),!1}}}q([a()],U.prototype,"host",void 0),q([a({writable:!0})],U.prototype,"value",void 0),q([a()],U.prototype,"changeEventEmitter",void 0),q([a()],U.prototype,"selectType",void 0),q([l("watchValue")],U.prototype,"watchValue",null);var K=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class B extends n{constructor(){super(...arguments),this.mutationObserver=new z({target:()=>this.host,options:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["checked"]},mutationFilter:S("VEGA-SELECTION-CHIP"),callback:this.syncChipArrayAndValue.bind(this)}),this.selectionChipArray=[]}disconnectedCallback(){}componentWillLoad(){this.value&&0!==this.value.length||this.syncChipArrayAndValue()}componentDidLoad(){}watchSelectType(){this.syncChipArrayAndValue()}getSelectionChipArray(){return this.selectionChipArray}syncChipArrayAndValue(e){this.selectionChipArray=Array.from(this.host.querySelectorAll("vega-selection-chip")),"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems(e)}setValueFromCheckboxItems(){const e=this.selectionChipArray.filter((e=>e.checked)).map((e=>e.value));O(this.value,e,!0)||this.valueController.setValue(e)}setValueFromRadioItems(e){const t=this.findAttributeMutation(e);if(t){const e=this.getCurrentChip(t);e&&e.checked&&this.valueController.setValue(e.value)}else{const e=this.getFirstCheckedChip();this.valueController.setValue(e?e.value:"")}}findAttributeMutation(e){return e&&e.find((e=>e.attributeName))}getCurrentChip(e){if(e&&"VEGA-SELECTION-CHIP"===e.target.tagName&&"checked"===e.attributeName)return e.target}getFirstCheckedChip(){return this.selectionChipArray.find((e=>e.checked))}}K([a()],B.prototype,"host",void 0),K([a()],B.prototype,"selectType",void 0),K([a()],B.prototype,"valueController",void 0),K([a()],B.prototype,"value",void 0),K([d()],B.prototype,"mutationObserver",void 0),K([l("disconnectedCallback")],B.prototype,"disconnectedCallback",null),K([l("componentWillLoad")],B.prototype,"componentWillLoad",null),K([l("componentDidLoad")],B.prototype,"componentDidLoad",null),K([l("watchSelectType")],B.prototype,"watchSelectType",null);var J=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const Q=class{constructor(e){i(this,e),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.globalSlimmers={},this.renderer=new $,this.itemsController=new B,this.valueController=new U,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new V:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.getSelectionChipArray(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.changeEventEmitter=C(Q,u),this.valueNotifySlimmer=E(Q,"value","watchValue"),this.disabledNotifySlimmer=E(Q,"disabled","watchDisabled"),this.selectTypeNotifySlimmer=E(Q,"selectType","watchSelectType"),this.changeEventPrevent=new T([u],(()=>this.host),!0),this.label="",this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.validationRules=[],this.isValid=null}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return s(e(t,null,this.renderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};J([p()],Q.prototype,"globalSlimmers",void 0),J([d()],Q.prototype,"renderer",void 0),J([d()],Q.prototype,"itemsController",void 0),J([d()],Q.prototype,"valueController",void 0),J([d()],Q.prototype,"formFieldController",void 0),J([d()],Q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J([d()],Q.prototype,"changeEventEmitter",void 0),J([d()],Q.prototype,"valueNotifySlimmer",void 0),J([d()],Q.prototype,"disabledNotifySlimmer",void 0),J([d()],Q.prototype,"selectTypeNotifySlimmer",void 0),J([d()],Q.prototype,"changeEventPrevent",void 0),Q.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host .vega-hint{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));padding-top:4px;padding-left:8px;padding-right:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-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-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-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:block;margin-top:12px;margin-left:8px;margin-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{H as vega_selection_chip,Q as vega_selection_chip_group}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as o,H as r,g as a}from"./p-21d26bb4.js";import{s as p}from"./p-519a7d55.js";import{I as s}from"./p-
|
|
1
|
+
import{h as e,r as t,c as o,H as r,g as a}from"./p-21d26bb4.js";import{s as p}from"./p-519a7d55.js";import{I as s}from"./p-c990e249.js";import{c as i,M as n,V as c,I as l}from"./p-6e1ab235.js";import{V as v,I as h}from"./p-4387d550.js";import{c as m}from"./p-012cbd8f.js";import{d as g,M as d,N as b}from"./p-6e01f0a2.js";import{E as f}from"./p-822cd8e5.js";import{r as w}from"./p-77e64f26.js";import{r as x}from"./p-425ba7d6.js";import"./p-a46ac2eb.js";import"./p-d5776087.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-e7b00bf0.js";import"./p-331a62d5.js";import"./p-613ee009.js";import"./p-b75ee3ba.js";import"./p-d5f1794e.js";import"./p-37b05e0b.js";import"./p-7d9cd9c8.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-262ec334.js";import"./p-327be043.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";var j=function(e,t,o,r){var a,p=arguments.length,s=p<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(p<3?a(s):p>3?a(t,o,s):a(t,o))||s);return p>3&&s&&Object.defineProperty(t,o,s),s};class u extends c{appendPopoverSlotContent(){const e=this.host.querySelector("[slot='popover']");e&&this.popoverContentBox.appendChild(e)}getPopoverContentBox(){return this.popoverContentBox}render(){return e("vega-popover-content-box",{ref:e=>this.popoverContentBox=e,showArrow:this.showArrow})}}j([i()],u.prototype,"host",void 0),j([i()],u.prototype,"showArrow",void 0),j([n("componentDidRender")],u.prototype,"appendPopoverSlotContent",null);var R=function(e,t,o,r){var a,p=arguments.length,s=p<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(p<3?a(s):p>3?a(t,o,s):a(t,o))||s);return p>3&&s&&Object.defineProperty(t,o,s),s};class y extends f{constructor(){super((()=>this.generateShowConfigFactory()),(()=>this.trigger),"isPopoverShow")}connectedCallback(){this.registerRemoteMethod()}disconnectedCallback(){w.unRegister(g.getSubject(this.host,x))}generateShowConfigFactory(){return{target:this.target||this.host,appendableElement:this.appenderRenderer.getPopoverContentBox(),positionRelativeTo:this.positionRelativeTo,matchTargetWidth:!1,size:this.size,placement:this.placement,alignment:this.alignment,isScreenPosition:this.isScreenPosition}}registerRemoteMethod(){w.register(g.getSubject(this.host,x),(e=>{this.target=e,super.updateShowConfigFactory(this.generateShowConfigFactory.bind(this))}))}}R([i()],y.prototype,"host",void 0),R([i()],y.prototype,"trigger",void 0),R([i()],y.prototype,"positionRelativeTo",void 0),R([i()],y.prototype,"placement",void 0),R([i()],y.prototype,"alignment",void 0),R([i()],y.prototype,"size",void 0),R([i()],y.prototype,"isScreenPosition",void 0),R([i({writable:!0})],y.prototype,"isPopoverShow",void 0),R([i()],y.prototype,"appenderRenderer",void 0),R([n("connectedCallback")],y.prototype,"connectedCallback",null),R([n("disconnectedCallback")],y.prototype,"disconnectedCallback",null);var S=function(e,t,o,r){var a,p=arguments.length,s=p<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(p<3?a(s):p>3?a(t,o,s):a(t,o))||s);return p>3&&s&&Object.defineProperty(t,o,s),s};const k=class{constructor(e){t(this,e),this.vegaPopoverShow=o(this,"vegaPopoverShow",7),this.popoverShow=o(this,"popoverShow",7),this.vegaPopoverHide=o(this,"vegaPopoverHide",7),this.popoverHide=o(this,"popoverHide",7),this.globalSlimmers={},this.appenderRenderer=new u,this.appenderController=new y,this.popoverShowEventEmitter=m(k,d),this.popoverHideEventEmitter=m(k,b),this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.isPopoverShow=!1,this.placement="top",this.alignment="center",this.trigger="click",this.showArrow=!0,this.isScreenPosition=!1,this.showPopover=()=>{this.appenderController.show()},this.hidePopover=()=>{this.appenderController.hide()}}async watchIsPopoverShow(){this.isPopoverShow?this.popoverShowEventEmitter.emit():this.popoverHideEventEmitter.emit()}watchToRefreshPopover(){this.isPopoverShow&&this.appenderController.show()}componentDidRender(){}async show(){this.isPopoverShow||this.showPopover()}async hide(){this.isPopoverShow&&this.hidePopover()}render(){return p(e(r,null,e("slot",{name:"popover-content"}),this.appenderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{isPopoverShow:["watchIsPopoverShow"],size:["watchToRefreshPopover"],placement:["watchToRefreshPopover"],alignment:["watchToRefreshPopover"]}}};S([h()],k.prototype,"globalSlimmers",void 0),S([l()],k.prototype,"appenderRenderer",void 0),S([l()],k.prototype,"appenderController",void 0),S([l()],k.prototype,"popoverShowEventEmitter",void 0),S([l()],k.prototype,"popoverHideEventEmitter",void 0),S([l()],k.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),S([s((e=>[{keyCode:"Escape",activeElementInScope:[e.host],callback:e.hidePopover},{keyCode:"Tab",activeElementOutScope:[e.host,e.appenderRenderer.getPopoverContentBox()],callback:e.hidePopover},{keyCode:"Tab",activeElementInScope:[e.host],callback:()=>{"hover"===e.trigger&&e.showPopover()}}]))],k.prototype,"host",void 0),k.style=":host{display:inline-block}";var C=function(e,t,o,r){var a,p=arguments.length,s=p<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(p<3?a(s):p>3?a(t,o,s):a(t,o))||s);return p>3&&s&&Object.defineProperty(t,o,s),s};const P=class{constructor(e){t(this,e),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.showArrow=!0}render(){return p(e(r,{class:{"vega-popover":!0,"no-arrow":!this.showArrow},role:"tooltip"},e("div",{class:"vega-popover-content"},e("slot",{name:"popover"}),this.showArrow&&e("div",{class:"vega-arrow"})),e("slot",null)),this.host)}get host(){return a(this)}};C([h()],P.prototype,"globalSlimmers",void 0),C([l()],P.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),P.style=':host{position:absolute}:host(.vega-force-hidden){display:none !important}.vega-popover-content{border-radius:8px;padding:16px;position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));box-shadow:var(--v-shadow-popover, 0px 0px 88px 0px rgba(2, 2, 15, 0.01), 0px 0px 32px 0px rgba(2, 2, 15, 0.02), 0px 4px 72px 0px rgba(2, 2, 15, 0.06))}.vega-popover-content .vega-arrow{position:absolute}.vega-popover-content .vega-arrow::after{display:inline-block;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));content:"";border-right-width:0px;border-bottom-width:0px;border-radius:4px 1px 0 1px;transform:skewX(18deg);width:18px;height:17.12px;border-right-color:transparent;border-bottom-color:transparent}:host(.vega-placement-left) .vega-arrow{transform:rotate(144deg);right:-9px}:host(.vega-placement-left.vega-alignment-start) .vega-arrow{top:8px}:host(.vega-placement-left.vega-alignment-center) .vega-arrow{top:calc(50% - 14px)}:host(.vega-placement-left.vega-alignment-end) .vega-arrow{bottom:12px}:host(.vega-placement-right) .vega-arrow{transform:rotate(324deg);left:-9px}:host(.vega-placement-right.vega-alignment-start) .vega-arrow{top:12px}:host(.vega-placement-right.vega-alignment-center) .vega-arrow{top:calc(50% - 10px)}:host(.vega-placement-right.vega-alignment-end) .vega-arrow{bottom:8px}:host(.vega-placement-top) .vega-arrow{transform:rotate(234deg);bottom:-10.65px}:host(.vega-placement-top.vega-alignment-start) .vega-arrow{left:24px}:host(.vega-placement-top.vega-alignment-center) .vega-arrow{left:calc(50% - 9px)}:host(.vega-placement-top.vega-alignment-end) .vega-arrow{right:18px}:host(.vega-placement-bottom) .vega-arrow{transform:rotate(54deg);top:-10.65px}:host(.vega-placement-bottom.vega-alignment-start) .vega-arrow{left:18px}:host(.vega-placement-bottom.vega-alignment-center) .vega-arrow{left:calc(50% - 14px)}:host(.vega-placement-bottom.vega-alignment-end) .vega-arrow{right:24px}:host(.vega-placement-top){margin-top:-20px}:host(.vega-placement-bottom){margin-top:20px}:host(.vega-placement-right){margin-left:20px}:host(.vega-placement-left){margin-left:-20px}:host(.no-arrow.vega-placement-top){margin-top:-8px}:host(.no-arrow.vega-placement-bottom){margin-top:8px}:host(.no-arrow.vega-placement-right){margin-left:8px}:host(.no-arrow.vega-placement-left){margin-left:-8px}';export{k as vega_popover,P as vega_popover_content_box}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as t,V as e,L as s,c as i}from"./p-6e1ab235.js";import{d as n}from"./p-1bc5b3bc.js";import{v as o,w as h,a as r,G as a,g as c,Z as d,D as f,z as l,u}from"./p-3eb2d433.js";import{g as p}from"./p-519a7d55.js";import{C as g}from"./p-2d0d575f.js";import{d as m}from"./p-6e01f0a2.js";import{b as w}from"./p-425ba7d6.js";import{O}from"./p-331a62d5.js";import{f as b}from"./p-d5776087.js";import{S as v}from"./p-1fb56e14.js";import{K as R}from"./p-cc6410e6.js";let C=!1;class S{constructor(){this.rangeCount=0,this.ranges=[]}getRangeAt(t){return this.ranges[t]}addRange(t){if(this.ranges.push(t),this.rangeCount=this.ranges.length,!C){const e=window.getSelection();e.removeAllRanges(),e.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}}removeAllRanges(){this.ranges=[],this.rangeCount=0}}const y=new class{constructor(){this.supportShadowSelection="function"==typeof window.ShadowRoot.prototype.getSelection,this.supportBeforeInput="function"==typeof window.InputEvent.prototype.getTargetRanges,this.isFirefox=window.navigator.userAgent.toLowerCase().indexOf("firefox")>0,this.listen()}getSelection(t){return this.supportShadowSelection?t.getSelection():this.isFirefox?this.getFirefoxSelection():this.polyfilledShadowSelection}getFirefoxSelection(){const t=document.getSelection(),e=t.getRangeAt(0),s=e.startContainer,i=e.endContainer;if(s!==i&&s.textContent.length===e.startOffset){const t=s.nodeType===Node.TEXT_NODE?s.parentNode.nextSibling:s.nextSibling;e.setStart(t.firstChild,0)}if(i!==s&&0===e.endOffset){const t=i.nodeType===Node.TEXT_NODE?i.parentNode.previousSibling:i.previousSibling;e.setEnd(t.lastChild,t.lastChild.textContent.length)}return t}listen(){this.isFirefox||this.supportShadowSelection||!this.supportBeforeInput||(this.polyfilledShadowSelection=new S,window.addEventListener("selectionchange",(()=>{if(!C){C=!0;const t=p();t&&t.hasAttribute("contenteditable")?document.execCommand("indent"):this.polyfilledShadowSelection.removeAllRanges(),C=!1}}),!0),window.addEventListener("beforeinput",(t=>{if(C){const e=t.getTargetRanges()[0],s=new Range;s.setStart(e.startContainer,e.startOffset),s.setEnd(e.endContainer,e.endOffset),this.polyfilledShadowSelection.removeAllRanges(),this.polyfilledShadowSelection.addRange(s),t.preventDefault(),t.stopImmediatePropagation()}}),!0))}};class N extends e{constructor(t){super(),this.autoRunTaskQueue=new v(t)}async executeTaskHook(){this.autoRunTaskQueue.queue.length&&await this.autoRunTaskQueue.runTask()}enqueueTheTaskIntoQueue(t=!1){this.autoRunTaskQueue.enqueue({run:async()=>{try{await this.doTask()}catch(t){s.error("The auto task run failed.",t)}}},t)}}!function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);o>3&&h&&Object.defineProperty(e,s,h)}([t("componentDidUpdate")],N.prototype,"executeTaskHook",null);class j{constructor(t,e,s=0,i=0,n,o,h){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=e,this._startOffset=s,this._endOffset=i,this._startNode=n,this._endNode=o,h&&(this._oldNativeRange=h)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(t,e){const{startOffset:s,endOffset:i}=t;this._startOffset=s,this._endOffset=i;const n=t.startNode,h=t.endNode;if(n instanceof o){this._startNode=n,this._endNode=h;const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode);t&&(this._startContainer=t,this._endContainer=e)}else this._startContainer=n,this._endContainer=h,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),e&&(this._oldNativeRange=e);return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode),s=new Range;return t&&e?(s.setStart(t,this._startOffset),s.setEnd(e,this._endOffset),this._startContainer=t,this._endContainer=e,this._oldNativeRange=s,s):this._oldNativeRange?this._oldNativeRange:void 0}getElementByRTENode(t){if(t){const e=h.getDOMByEntity(t);if(e)return t instanceof r?b(e,"vega-rich-text-image-editor"):e.firstChild}}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:"VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t;return h.getEntityByDOM(e)}}}class k{constructor(t){this.range=t}clone(){const t=this.range.clone();return new k(t)}}var E=function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);return o>3&&h&&Object.defineProperty(e,s,h),h};class T extends N{constructor(){super(1),this.currentRange=new j,this.handleSelectionWithDebounce=n(this.handleSelectionChange,T.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.pendingRestoreSelectionNodes=[],this.doTask=async()=>{await Promise.resolve();const t=this.currentRange.toNativeRange();t&&this.setSelectionRange(t)}}connectedCallback(){this.registerSelectionRangeChangeObserver()}disconnectedCallback(){g.unregister(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}componentDidLoad(){document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}watchValueUpdate(){this.prepareRestoreSelectionState(),this.restoreSelection()}getCurrentRange(){return this.currentRange}getSelectedNodes(){return Array.from(this.selectionMap.values()).flat()}getSelectedBlocks(){return Array.from(this.selectionMap.keys())}setSelectionState(t){this.selectionState=t}enqueueSelectionRangeFutureState(t,e,s,i,n=!1){t instanceof a?this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(t,e,n):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:s=s||t,startOffset:e,endOffset:i=i||0===i?i:e}),super.enqueueTheTaskIntoQueue(n))}setSelectionRange(t){const e=this.getSelection();e&&(e.removeAllRanges(),e.addRange(t),this.saveSelection())}getSelection(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();return y.getSelection(t.shadowRoot)}saveSelection(){const t=this.getSelection();if(t&&t.rangeCount>0&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:s,endContainer:i,startOffset:n,endOffset:o}=e;this.currentRange=this.currentRange.updateRTERange({startNode:s,endNode:i,startOffset:n,endOffset:o},e)}}restoreSelection(){if(this.selectionState){const{startNode:t,endNode:e,startOffset:s,endOffset:i}=this.selectionState.range;t instanceof c&&t===e&&0===t.text.length?this.enqueueSelectionRangeFutureState(t,d.length):this.enqueueSelectionRangeFutureState(t,s,e,i),this.selectionState=null}}handleSelectionChange(){if(this.disabled)return;const t=this.getSelection();if(!t||0===t.rangeCount)return;this.clearSelectionMap(),this.saveSelection();const e=t.getRangeAt(0),s=[],i=t=>{if(e.intersectsNode(t)){if(t.nodeType===Node.TEXT_NODE){const e=h.getEntityByDOM(t.parentElement);if(e instanceof o)return void s.push(e)}if(t.nodeType===Node.ELEMENT_NODE){const i="VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t,n=h.getEntityByDOM(i);if(n instanceof u)return void(this.internalCodeBlockSelectionController.isCodeBlockSelected(n,e)&&s.push(n.nodes[0]));if(n instanceof o)return void s.push(n)}t.childNodes.forEach(i)}};i(e.commonAncestorContainer),s.forEach((t=>{this.selectionMap.has(t.parentBlock)?this.selectionMap.get(t.parentBlock).push(t):this.selectionMap.set(t.parentBlock,[t])})),this.getSelectedNodes().forEach((t=>t.apply(new f(e))))}clearSelectionMap(){this.getSelectedNodes().filter((t=>"CODE_BLOCK_NODE"!==t.type)).forEach((t=>{t.annotationMap.delete(l.SELECTION_RANGE)})),this.selectionMap=new Map}isAcceptableSelectionRangeChange(){return!0}registerSelectionRangeChangeObserver(){this.selectionRangeChangeObserver=new O(this.isAcceptableSelectionRangeChange.bind(this),(t=>{t.updateDirectly?this.enqueueSelectionRangeFutureState(t.node,t.offset):this.pendingRestoreSelectionNodes.push(t.node)})),g.register(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}prepareRestoreSelectionState(){if(this.pendingRestoreSelectionNodes.length>0){const t=this.pendingRestoreSelectionNodes[0],e=this.pendingRestoreSelectionNodes.length>1?this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length-1]:t,{startOffset:s,endOffset:i,endContainer:n,startContainer:o}=this.currentRange;o&&h.getDOMByEntity(t)===o.parentElement&&n&&h.getDOMByEntity(e)===n.parentElement?(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:s,endOffset:i}),this.selectionState=new k(this.currentRange)):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:0,endOffset:e.text.length}),this.selectionState=new k(this.currentRange)),this.pendingRestoreSelectionNodes=[]}}}T.SELECTION_CHANGE_DEBOUNCE_TIME=50,E([i()],T.prototype,"vegaRichTextEditorRenderer",void 0),E([i({writable:!0})],T.prototype,"selectionMap",void 0),E([i()],T.prototype,"host",void 0),E([i()],T.prototype,"value",void 0),E([i()],T.prototype,"disabled",void 0),E([i()],T.prototype,"valueController",void 0),E([i()],T.prototype,"insertCompositionTextController",void 0),E([i()],T.prototype,"historyController",void 0),E([i()],T.prototype,"internalCodeBlockSelectionController",void 0),E([t("connectedCallback")],T.prototype,"connectedCallback",null),E([t("disconnectedCallback")],T.prototype,"disconnectedCallback",null),E([t("componentDidLoad")],T.prototype,"componentDidLoad",null),E([t("watchValueUpdate")],T.prototype,"watchValueUpdate",null);class x extends R{constructor(){super((()=>this.getKeyboardShortcutOptions.call(this))),this.redoStack=[],this.undoStack=[],this.registerHistoryDelay=300,this.registerHistoryDebounced=n((t=>{this.internalRegisterHistory(t)}),this.registerHistoryDelay,this)}registerHistory(t,e=!1){e?this.internalRegisterHistory(t):this.registerHistoryDebounced(t)}internalRegisterHistory(t){this.redoStack=[],this.undoStack.push(t)}getKeyboardShortcutOptions(){const t={keyCode:"KeyZ",activeElementInScope:this.getEffectiveTargets(),activeElementOutScope:this.getIneffectiveTargets.bind(this),eventName:"keydown",modifierPressed:!0};return[Object.assign(Object.assign({},t),{shiftKey:!1,callback:t=>{t.preventDefault(),this.undoStack.length>0&&this.undo()}}),Object.assign(Object.assign({},t),{shiftKey:!0,callback:t=>{t.preventDefault(),this.redoStack.length>0&&this.redo()}})]}}export{N as A,x as C,k as R,y as S,T as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,F as t,r as a,c as i,H as o,g as n}from"./p-21d26bb4.js";import{s as r}from"./p-519a7d55.js";import{c as s,V as l,M as d,I as c}from"./p-6e1ab235.js";import{s as h}from"./p-6bd5c49b.js";import{V as b,I as g}from"./p-4387d550.js";import{P as v}from"./p-834434d5.js";import{d as p}from"./p-1bc5b3bc.js";import{c as u}from"./p-86194314.js";import{D as f}from"./p-e7b00bf0.js";import{b as m,a as y}from"./p-6e01f0a2.js";import{C as x}from"./p-2d0d575f.js";import{O as w}from"./p-331a62d5.js";import{T}from"./p-5773a9a3.js";import{f as C}from"./p-d5776087.js";import{S as R}from"./p-1fb56e14.js";import{C as j}from"./p-6b7dca3e.js";import{c as D}from"./p-012cbd8f.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-613ee009.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";var I=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class P extends l{getTabMenuContainer(){return this.tabMenuContainer}render(){return e(t,null,e("div",{class:{"tab-content-container":!0,"more-tab":this.tabPages.length>1,"tab-style-secondary":"secondary"===this.variant,"tab-style-primary":"secondary"!==this.variant,"swipe-more-tabs":"scroll"===this.overflow},ref:e=>this.tabMenuContainer=e},"menu"===this.overflow&&this.directionButtonRenderer.render("left"),this.tabListRenderer.render(),"menu"===this.overflow&&this.directionButtonRenderer.render("right")),e("div",{class:"horizontal-divider"}),this.contentRenderer.render())}}I([s()],P.prototype,"tabPages",void 0),I([s()],P.prototype,"variant",void 0),I([s()],P.prototype,"overflow",void 0),I([s({componentFieldName:"vegaTabGroupTabListRenderer"})],P.prototype,"tabListRenderer",void 0),I([s({componentFieldName:"vegaTabGroupDirectionButtonRenderer"})],P.prototype,"directionButtonRenderer",void 0),I([s({componentFieldName:"vegaTabGroupContentRenderer"})],P.prototype,"contentRenderer",void 0);var k=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class S extends l{setSelectedDataTarget(e){this.selectedTabDataTarget=e}handleTabItemClick(e){const t=this.clickEventEmitter.emit(e);t&&!t.defaultPrevented&&(e===this.selectedTabDataTarget?this.vegaTabGroupPageIndexController.setCurrentPageIndexBySelectedTab(e):this.setSelectedDataTarget(e))}}k([s()],S.prototype,"clickEventEmitter",void 0),k([s({writable:!0})],S.prototype,"selectedTabDataTarget",void 0),k([s()],S.prototype,"vegaTabGroupPageIndexController",void 0);class G{paginate(e,t,a){const i=e.map(t);return this.doPaginateByCapacity(e,i,a)}doPaginateByCapacity(e,t,a){const i=[];let o=0;for(;o<t.length;){const n=this.valueSum(o,t,a);if(0===n)break;i.push(e.slice(o,o+n)),o+=n}return i}valueSum(e,t,a){let i=0,o=!1,n=0;const r="function"==typeof a?a(e,t):a;return t.slice(e).forEach(((e,t)=>{i+=e,i>r&&!o&&(o=!0,n=t)})),o||(n=t.slice(e).length),n}}var O=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class A extends v{constructor(){super({callback:()=>{this.initTabPagesWithDebounce()},target:()=>this.host,shouldTrigger:()=>!this.sliderStateController.isAnimationInProgress()}),this.TAB_SIDE_BUTTON_WIDTH=37,this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE=8,this.valuePaginator=new G,this.initTabPagesWithDebounce=p(this.initTabPages,80,this),this.getTabContainerSpace=(e,t)=>{const a=this.host.getBoundingClientRect().width;let i="secondary"===this.variant?a:a-48;return"menu"===this.overflow&&(e>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH+this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE),t.length>0&&t.slice(e).reduce(((e,t)=>e+t))>i&&i>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH)),i},this.emptySourceAndHiddenDropdown=()=>{Array.from(this.host.shadowRoot.querySelectorAll("vega-dropdown")).forEach((async e=>{0===e.source.length&&await e.hide()}))}}componentDidLoad(){this.initTabPages()}componentDidRender(){this.initTabsWidthArray(),this.emptySourceAndHiddenDropdown()}handleGapChange(){this.initTabPages()}handleTabWidthArrayChange(){this.tabWidthArray.length>0&&this.initTabPages()}handleTabItemsChange(){this.initTabPagesWithDebounce()}setTabItems(e){this.tabItems=e}setTabWidthArray(e){this.tabWidthArray=e}initTabPages(){this.tabItems&&(this.tabPages="scroll"===this.overflow?[[...this.tabItems]]:this.valuePaginator.paginate(this.tabItems,((e,t)=>this.tabWidthArray[t]>0?this.tabWidthArray[t]+Number(this.formatAndValidGap(this.gap)):this.tabWidthArray[t]),this.getTabContainerSpace))}formatAndValidGap(e){return e.replace("size-","")}initTabsWidthArray(){if(0===this.tabWidthArray.length||this.tabWidthArray.some((e=>0===e))){const e=[];this.tabItems.forEach((t=>{const a=this.host.shadowRoot.querySelector(`.vega-tab[data-target='${t.dataTarget}']`);if(a){const t=a.getBoundingClientRect().width;e.push(t)}})),e.length>0&&!e.some((e=>0===e))&&(this.tabWidthArray=[...e])}}}O([s()],A.prototype,"host",void 0),O([s()],A.prototype,"gap",void 0),O([s({writable:!0})],A.prototype,"tabPages",void 0),O([s({writable:!0})],A.prototype,"tabWidthArray",void 0),O([s({writable:!0})],A.prototype,"tabItems",void 0),O([s()],A.prototype,"variant",void 0),O([s()],A.prototype,"overflow",void 0),O([s({componentFieldName:"vegaTabGroupSliderStateController"})],A.prototype,"sliderStateController",void 0),O([d("componentDidLoad")],A.prototype,"componentDidLoad",null),O([d("componentDidRender")],A.prototype,"componentDidRender",null),O([d("watchGapChange")],A.prototype,"handleGapChange",null),O([d("watchTabWidthArrayChange")],A.prototype,"handleTabWidthArrayChange",null),O([d("watchTabItemsChange")],A.prototype,"handleTabItemsChange",null);var L=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class z extends l{handleTabPagesChange(){this.selectedTabDataTarget?this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget):this.setCurrentPageIndexWhenTabPagesChange()}handleSelectedDataTargetChange(){this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget)}setCurrentPageIndexBySelectedTab(e){let t=-1;this.tabPages.forEach(((a,i)=>{-1!==a.findIndex((t=>t.dataTarget===e))&&(t=i)})),t>=0&&(this.currentPageIndex=t)}setPageIndex(e){this.currentPageIndex=e}setCurrentPageIndexWhenTabPagesChange(){this.tabPages&&this.tabPages.length&&!this.tabPages[this.currentPageIndex]&&(this.currentPageIndex=this.tabPages.length-1)}}L([s()],z.prototype,"tabPages",void 0),L([s({writable:!0})],z.prototype,"currentPageIndex",void 0),L([s()],z.prototype,"selectedTabDataTarget",void 0),L([d("watchTabPagesChange")],z.prototype,"handleTabPagesChange",null),L([d("watchSelectedTabDataTargetChange")],z.prototype,"handleSelectedDataTargetChange",null);var B=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class N extends l{constructor(){super(...arguments),this.onCloseTab=e=>{const t=e.currentTarget.closest(".vega-tab"),a=this.tabItems.findIndex((e=>e.dataTarget===t.getAttribute("data-target")));t.classList.contains("selected")&&this.selectedTargetController.setSelectedDataTarget(this.tabItems[a===this.tabItems.length-1?a-1:a+1].dataTarget);const i=this.tabItems.slice(0,a).concat(this.tabItems.slice(a+1));this.tabPagesController.setTabItems(i);const o=this.tabWidthArray.slice(0,a).concat(this.tabWidthArray.slice(a+1));this.tabPagesController.setTabWidthArray(o),e.stopPropagation()}}render(t){return this.showCloseButton&&this.tabItems.length>1&&e("div",{class:this.showCloseButton?"vega-close-icon":"vega-close-icon vega-hidden",onClick:this.onCloseTab,role:"button",tabIndex:t.disabled?-1:0,onKeyDown:u(),"aria-label":"Close Button"},e("vega-icon",{icon:"close",size:"size-12"}))}}B([s()],N.prototype,"tabWidthArray",void 0),B([s()],N.prototype,"showCloseButton",void 0),B([s()],N.prototype,"tabItems",void 0),B([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],N.prototype,"selectedTargetController",void 0),B([s({componentFieldName:"vegaTabGroupPagesController"})],N.prototype,"tabPagesController",void 0);var F=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class W extends l{constructor(){super(...arguments),this.onDirectionButtonClick=e=>{this.pageIndexController.setPageIndex("left"===e?this.currentPageIndex-1:this.currentPageIndex+1)}}getDropdownRef(){return this.dropdownRef}render(t){const a=[];this.tabPages.slice("left"===t?0:this.currentPageIndex+1,"left"===t?this.currentPageIndex:this.tabPages.length).flat().map((e=>{a.push({key:e.dataTarget,label:e.label,disabled:e.disabled})}));const i="left"===t?0===this.currentPageIndex:this.currentPageIndex+1===this.tabPages.length||this.tabPages.length<=1,o="left"===t?"chevron-backward-rounded":"chevron-forward-rounded",n=a.find((e=>e.key===this.selectedTabDataTarget))?this.selectedTabDataTarget:"";return e("div",{class:{"tab-left-button":"left"===t,"tab-right-button":"right"===t,"vega-hidden":i},onClick:()=>this.onDirectionButtonClick(t),"aria-label":"No label defined",role:"button",tabIndex:0,onKeyDown:u()},e("vega-dropdown",{source:a,translocation:{X:0,Y:16},selectType:"single",selectedSourceKey:n,"position-relative-to":this.positionRelativeTo,ref:e=>{this.dropdownRef=e,f.addUniqueObserverToNode(e,m,(e=>{this.vegaTabGroupSelectedTargetController.handleTabItemClick(e.detail)}))}},e("vega-icon",{size:"size-12",icon:o})))}}F([s()],W.prototype,"tabPages",void 0),F([s()],W.prototype,"currentPageIndex",void 0),F([s()],W.prototype,"selectedTabDataTarget",void 0),F([s()],W.prototype,"positionRelativeTo",void 0),F([s({componentFieldName:"vegaTabGroupPageIndexController"})],W.prototype,"pageIndexController",void 0),F([s()],W.prototype,"vegaTabGroupSelectedTargetController",void 0);var E=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class _ extends l{constructor(){super(...arguments),this.tabPanels=[],this.handlePanelUpdate=e=>{const{host:t,type:a}=e;"ADD"===a?this.tabPanels.push(t):this.tabPanels=this.tabPanels.filter((e=>e!==t))}}connectedCallback(){this.tabPanelUpdateObserver=new w(this.canAcceptPanelUpdate.bind(this),this.handlePanelUpdate),x.register(T,this.tabPanelUpdateObserver)}disconnectedCallback(){x.unregister(T,this.tabPanelUpdateObserver),this.tabPanels=[]}componentDidLoad(){this.initSelectedTabDataTarget()}watchSelectedTabDataTargetChange(){this.updateTabPanelsStatus(this.selectedTabDataTarget)}canAcceptPanelUpdate(e){const{host:t,type:a}=e;return"ADD"===a?C(e.host,"VEGA-TAB-GROUP")===this.host&&!this.tabPanels.includes(t):this.tabPanels&&this.tabPanels.includes(t)}initSelectedTabDataTarget(){if(this.selectedTabDataTarget)this.updateTabPanelsStatus(this.selectedTabDataTarget);else{let e=this.getDefaultActivePanelId();!e&&this.tabItems&&this.tabItems.length&&(e=this.tabItems[0].dataTarget),e&&this.selectTargetController.setSelectedDataTarget(e)}}getDefaultActivePanelId(){if(this.tabPanels&&this.tabPanels.length){const e=this.tabPanels.find((e=>!0===e.isActive));return e?e.getAttribute("id"):null}}updateTabPanelsStatus(e){this.tabPanels.length&&e&&this.tabPanels.forEach((t=>{const a=t.getAttribute("id");t.isActive=a===e}))}}E([s()],_.prototype,"host",void 0),E([s()],_.prototype,"selectedTabDataTarget",void 0),E([s()],_.prototype,"tabItems",void 0),E([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],_.prototype,"selectTargetController",void 0),E([d("connectedCallback")],_.prototype,"connectedCallback",null),E([d("disconnectedCallback")],_.prototype,"disconnectedCallback",null),E([d("componentDidLoad")],_.prototype,"componentDidLoad",null),E([d("watchSelectedTabDataTargetChange")],_.prototype,"watchSelectedTabDataTargetChange",null);var V=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class K extends l{constructor(){super(...arguments),this.TAB_LABEL_MAX_SIZE=32,this.getCarouselDomRef=()=>this.carouselDom}render(){return e("div",{class:{"tab-list":!0,menu:"menu"===this.overflow,scroll:"scroll"===this.overflow}},"menu"===this.overflow&&this.renderTabListInMenuOverflow(),"scroll"===this.overflow&&this.renderTabListInScrollOverflow())}renderTabListInMenuOverflow(){return e("vega-carousel",{showSlider:!1,ref:e=>this.carouselDom=e},this.tabPages.length>0?this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))):e("div",null,this.renderTabList(this.tabItems)))}renderTabListInScrollOverflow(){return e("div",{class:"overflow-scroll"},this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))))}renderTabList(t){return e("vega-flex",{gap:this.gap},t.map((t=>e("div",{class:{"vega-tab":!0,selected:this.selectedTabDataTarget===t.dataTarget,"last-page":this.currentPageIndex+1===this.tabPages.length,"vega-flex-shrink-0":!0,"v-min-w-min":!0,disabled:Boolean(t.disabled)},"data-target":t.dataTarget,key:t.dataTarget},e("div",{class:"vega-tab-container"},e("div",{class:{label:!0,"vega-close-icon-space":this.showCloseButton},onClick:()=>this.handleTabItemClick(t.dataTarget),"aria-label":t.dataTarget,role:"button",tabIndex:t.disabled?-1:0,onKeyDown:u()},this.renderPrefixIconDom(t),this.renderTabLabelDom(t),this.renderCounterBadgeDom(t)),this.closeButtonRenderer.render(t))))))}renderPrefixIconDom(t){const a=t.prefixIcon;return a&&e("vega-icon",{icon:a})}renderTabLabelDom(t){return t.label.length>this.TAB_LABEL_MAX_SIZE?e("vega-tooltip",{text:t.label,placement:"bottom","position-relative-to":this.positionRelativeTo},e("span",null,t.label.substring(0,this.TAB_LABEL_MAX_SIZE),"...")):t.label}renderCounterBadgeDom(t){const a=t.counterBadge,i=this.getCounterBadgeClassByCount(a);return void 0!==(null==a?void 0:a.count)&&a.count>0&&e("div",{class:`vega-counter-badge ${i}`},e("vega-counter-badge",{count:a.count,color:a.color}))}getCounterBadgeClassByCount(e){if(e&&e.count){const t=e.count.toString().length;return 1===t?"one-digit":2===t?"two-digits":"multi-digits"}return""}handleTabItemClick(e){this.selectedTargetController.handleTabItemClick(e)}}V([s()],K.prototype,"tabPages",void 0),V([s()],K.prototype,"currentPageIndex",void 0),V([s()],K.prototype,"selectedTabDataTarget",void 0),V([s()],K.prototype,"gap",void 0),V([s()],K.prototype,"showCloseButton",void 0),V([s()],K.prototype,"tabItems",void 0),V([s()],K.prototype,"overflow",void 0),V([s()],K.prototype,"positionRelativeTo",void 0),V([s({componentFieldName:"vegaTabGroupCloseButtonRenderer"})],K.prototype,"closeButtonRenderer",void 0),V([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],K.prototype,"selectedTargetController",void 0);class M extends l{render(){return"secondary"===this.variant?e("div",{class:"vega-tab-group-content"},e("slot",null)):e("vega-card",{margin:"0",padding:{default:"size-24",S:"size-12"},variant:"shadow",backgroundColor:"bg-primary"},e("div",{class:"vega-tab-group-content"},e("slot",null)))}}!function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);n>3&&r&&Object.defineProperty(t,a,r)}([s()],M.prototype,"variant",void 0);var U=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class q extends l{constructor(){super(...arguments),this.UPDATE_ANIMATION_FLAG_DELAY=32,this.goToPageTaskQueue=new R,this.pendingCarouselActionCount=0}async componentDidRender(){await this.goToPageTaskQueue.runTask()}async handlePageIndexChange(){const e=this.tabListRenderer.getCarouselDomRef();e&&(this.pendingCarouselActionCount+=1,setTimeout((()=>{this&&"number"==typeof this.pendingCarouselActionCount&&(this.pendingCarouselActionCount-=1)}),this.UPDATE_ANIMATION_FLAG_DELAY),await this.goToPageTaskQueue.enqueue({run:async()=>await e.goToPage(this.currentPageIndex+1)},!1))}isAnimationInProgress(){return this.pendingCarouselActionCount>0}}U([s({componentFieldName:"vegaTabGroupTabListRenderer"})],q.prototype,"tabListRenderer",void 0),U([s()],q.prototype,"currentPageIndex",void 0),U([d("componentDidRender")],q.prototype,"componentDidRender",null),U([d("watchCurrentPageIndexChange")],q.prototype,"handlePageIndexChange",null);const Y=[{payloadKey:"VARIANT_IS_PRIMARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"primary"===e.variant},{payloadKey:"VARIANT_IS_SECONDARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"secondary"===e.variant}];var $=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const H=class{constructor(e){a(this,e),this.vegaClick=i(this,"vegaClick",7),this.click=i(this,"click",7),this.globalSlimmers={},this.vegaTabGroupRenderer=new P,this.vegaTabGroupDirectionButtonRenderer=new W,this.vegaTabGroupTabListRenderer=new K,this.vegaTabGroupCloseButtonRenderer=new N,this.vegaTabGroupPagesController=new A,this.vegaTabGroupSelectedTargetController=new S,this.vegaTabGroupPageIndexController=new z,this.vegaTabGroupPanelController=new _,this.vegaTabGroupContentRenderer=new M,this.vegaTabGroupSliderStateController=new q,this.clickEventEmitter=D(H,y),this.dropdownEventPrevent=new j([y],(()=>this.vegaTabGroupRenderer.getTabMenuContainer())),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(Y),this.tabPages=[],this.tabWidthArray=[],this.currentPageIndex=0,this.selectedTabDataTarget="",this.gap="size-8",this.showCloseButton=!1,this.tabItems=[],this.variant="primary",this.overflow="menu"}watchTabPagesChange(){}watchTabWidthArrayChange(){}async watchCurrentPageIndexChange(e){}watchSelectedTabDataTargetChange(){}watchGapChange(){}watchTabItemsChange(){}componentDidLoad(){}componentDidRender(){}render(){return h(e("slot",null)),r(e(o,null,this.vegaTabGroupRenderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{tabPages:["watchTabPagesChange"],tabWidthArray:["watchTabWidthArrayChange"],currentPageIndex:["watchCurrentPageIndexChange"],selectedTabDataTarget:["watchSelectedTabDataTargetChange"],gap:["watchGapChange"],tabItems:["watchTabItemsChange"]}}};$([g()],H.prototype,"globalSlimmers",void 0),$([c()],H.prototype,"vegaTabGroupRenderer",void 0),$([c()],H.prototype,"vegaTabGroupDirectionButtonRenderer",void 0),$([c()],H.prototype,"vegaTabGroupTabListRenderer",void 0),$([c()],H.prototype,"vegaTabGroupCloseButtonRenderer",void 0),$([c()],H.prototype,"vegaTabGroupPagesController",void 0),$([c()],H.prototype,"vegaTabGroupSelectedTargetController",void 0),$([c()],H.prototype,"vegaTabGroupPageIndexController",void 0),$([c()],H.prototype,"vegaTabGroupPanelController",void 0),$([c()],H.prototype,"vegaTabGroupContentRenderer",void 0),$([c()],H.prototype,"vegaTabGroupSliderStateController",void 0),$([c()],H.prototype,"clickEventEmitter",void 0),$([c()],H.prototype,"dropdownEventPrevent",void 0),$([c()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),H.style='.tab-content-container.tab-style-primary{margin-left:24px;margin-right:24px}.vega-tab{cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.tab-content-container .tab-list.scroll{width:100%;overflow:hidden}.tab-content-container .tab-list.scroll .overflow-scroll>div{display:flex;overflow-x:auto;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab-content-container .tab-list.scroll .overflow-scroll>div::-webkit-scrollbar{display:none}.tab-content-container.more-tab .vega-tab{flex-grow:1}.tab-content-container.more-tab .vega-tab.last-page{flex-grow:0}.vega-tab>div.vega-tab-container{display:flex;align-items:center}.vega-tab>div.vega-tab-container>div{flex-grow:1}.tab-style-primary .vega-tab:hover{background-color:rgba(var(--v-bg-tab-hover, 245, 247, 247, 1))}.tab-style-primary .vega-tab.selected,.tab-style-primary .vega-tab.selected:hover{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.vega-tab>div>.label{display:inline-flex;align-items:center;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;padding-top:8px;padding-bottom:8px;padding-left:16px;padding-right:16px;cursor:pointer;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-tab>div>.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){.vega-tab>div>.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){.vega-tab>div>.label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.vega-tab>div>.label vega-icon{padding-right:8px}.vega-tab>div>.label .vega-counter-badge{position:relative;height:20px;padding-left:8px}.vega-tab>div>.label .vega-counter-badge vega-counter-badge{position:absolute;padding-left:8px;top:10px}.vega-tab>div>.label .vega-counter-badge.one-digit{width:20px}.vega-tab>div>.label .vega-counter-badge.one-digit vega-counter-badge{left:10px}.vega-tab>div>.label .vega-counter-badge.two-digits{width:28px}.vega-tab>div>.label .vega-counter-badge.two-digits vega-counter-badge{left:14px}.vega-tab>div>.label .vega-counter-badge.multi-digits{width:32px}.vega-tab>div>.label .vega-counter-badge.multi-digits vega-counter-badge{left:16px}.vega-tab>div>.label.vega-close-icon-space{padding-right:12px}.vega-tab>div>div.vega-close-icon{padding-left:0px;flex-grow:0;padding-right:13px}.vega-tab>div>div.vega-hidden{display:none}.vega-tab>div vega-icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1));box-sizing:content-box}.vega-tab>div>div.vega-close-icon vega-icon{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-tab.disabled{pointer-events:none;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.vega-tab.disabled .label,.vega-tab.disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host{display:block;width:100%;text-align:left;line-height:normal;min-width:270px}.horizontal-divider{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));width:100%;display:none;margin-top:-1px}.tab-content-container{display:flex;gap:8px;justify-content:space-between}.tab-content-container.more-tab .tab-list{width:100%}div.tab-left-button,div.tab-right-button{display:inline-block;cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1))}div.tab-left-button.vega-hidden,div.tab-right-button.vega-hidden{display:none}div.tab-left-button vega-icon,div.tab-right-button vega-icon{box-sizing:content-box;padding:13px 13px 13px 12px}.vega-tab-group-content vega-tab-group-panel{display:none}.vega-tab-group-content vega-tab-group-panel.active{display:block}.tab-style-secondary .vega-tab>div.vega-tab-container{align-items:baseline}.tab-style-secondary+.horizontal-divider{display:block}.tab-style-secondary .vega-tab{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary .vega-tab>div>.label{padding-left:16px;padding-right:16px;padding-top:0px;padding-bottom:12px}.tab-style-secondary .vega-tab.selected>div>.label,.tab-style-secondary .vega-tab.selected>div>.label vega-icon,.tab-style-secondary .vega-tab:hover>div>.label,.tab-style-secondary .vega-tab:hover>div>.label vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.tab-style-secondary .vega-tab{border-top-width:0px;border-left-width:0px;border-right-width:0px;border-bottom-width:2px;border-style:solid;border-color:transparent}.tab-style-secondary .vega-tab.selected{border-color:rgba(var(--v-border-color-action, 19, 98, 226, 1))}.tab-style-secondary div.tab-left-button,.tab-style-secondary div.tab-right-button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary div.tab-left-button vega-icon,.tab-style-secondary div.tab-right-button vega-icon{padding:6px 13px 13px 6px}.tab-style-secondary div.tab-left-button:hover vega-icon,.tab-style-secondary div.tab-right-button:hover vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}';var X=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const J=class{constructor(e){a(this,e),this.globalSlimmers={},this.clickEventPrevent=new j([y],(()=>this.host),void 0,!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.isActive=!1}connectedCallback(){this.notifyGroupAddOrDelPanel("ADD")}disconnectedCallback(){this.notifyGroupAddOrDelPanel("DEL")}componentWillLoad(){this.notifyGroupAddOrDelPanel("ADD")}render(){return r(e(o,{class:this.isActive?"active":""},e("slot",null)),this.host)}notifyGroupAddOrDelPanel(e){x.notify(T,{host:this.host,type:e})}get host(){return n(this)}};X([g()],J.prototype,"globalSlimmers",void 0),X([c()],J.prototype,"clickEventPrevent",void 0),X([c()],J.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J.style=":host{display:none}:host(.active){display:block}";export{H as vega_tab_group,J as vega_tab_group_panel}
|
|
1
|
+
import{h as e,F as t,r as a,c as i,H as o,g as n}from"./p-21d26bb4.js";import{s as r}from"./p-519a7d55.js";import{c as s,V as l,M as d,I as c}from"./p-6e1ab235.js";import{s as h}from"./p-6bd5c49b.js";import{V as b,I as g}from"./p-4387d550.js";import{P as v}from"./p-7d9cd9c8.js";import{d as p}from"./p-1bc5b3bc.js";import{c as u}from"./p-86194314.js";import{D as f}from"./p-e7b00bf0.js";import{b as m,a as y}from"./p-6e01f0a2.js";import{C as x}from"./p-2d0d575f.js";import{O as w}from"./p-331a62d5.js";import{T}from"./p-5773a9a3.js";import{f as C}from"./p-d5776087.js";import{S as R}from"./p-1fb56e14.js";import{C as j}from"./p-6b7dca3e.js";import{c as D}from"./p-012cbd8f.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-613ee009.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";var I=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class P extends l{getTabMenuContainer(){return this.tabMenuContainer}render(){return e(t,null,e("div",{class:{"tab-content-container":!0,"more-tab":this.tabPages.length>1,"tab-style-secondary":"secondary"===this.variant,"tab-style-primary":"secondary"!==this.variant,"swipe-more-tabs":"scroll"===this.overflow},ref:e=>this.tabMenuContainer=e},"menu"===this.overflow&&this.directionButtonRenderer.render("left"),this.tabListRenderer.render(),"menu"===this.overflow&&this.directionButtonRenderer.render("right")),e("div",{class:"horizontal-divider"}),this.contentRenderer.render())}}I([s()],P.prototype,"tabPages",void 0),I([s()],P.prototype,"variant",void 0),I([s()],P.prototype,"overflow",void 0),I([s({componentFieldName:"vegaTabGroupTabListRenderer"})],P.prototype,"tabListRenderer",void 0),I([s({componentFieldName:"vegaTabGroupDirectionButtonRenderer"})],P.prototype,"directionButtonRenderer",void 0),I([s({componentFieldName:"vegaTabGroupContentRenderer"})],P.prototype,"contentRenderer",void 0);var k=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class S extends l{setSelectedDataTarget(e){this.selectedTabDataTarget=e}handleTabItemClick(e){const t=this.clickEventEmitter.emit(e);t&&!t.defaultPrevented&&(e===this.selectedTabDataTarget?this.vegaTabGroupPageIndexController.setCurrentPageIndexBySelectedTab(e):this.setSelectedDataTarget(e))}}k([s()],S.prototype,"clickEventEmitter",void 0),k([s({writable:!0})],S.prototype,"selectedTabDataTarget",void 0),k([s()],S.prototype,"vegaTabGroupPageIndexController",void 0);class G{paginate(e,t,a){const i=e.map(t);return this.doPaginateByCapacity(e,i,a)}doPaginateByCapacity(e,t,a){const i=[];let o=0;for(;o<t.length;){const n=this.valueSum(o,t,a);if(0===n)break;i.push(e.slice(o,o+n)),o+=n}return i}valueSum(e,t,a){let i=0,o=!1,n=0;const r="function"==typeof a?a(e,t):a;return t.slice(e).forEach(((e,t)=>{i+=e,i>r&&!o&&(o=!0,n=t)})),o||(n=t.slice(e).length),n}}var O=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class A extends v{constructor(){super({callback:()=>{this.initTabPagesWithDebounce()},target:()=>this.host,shouldTrigger:()=>!this.sliderStateController.isAnimationInProgress()}),this.TAB_SIDE_BUTTON_WIDTH=37,this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE=8,this.valuePaginator=new G,this.initTabPagesWithDebounce=p(this.initTabPages,80,this),this.getTabContainerSpace=(e,t)=>{const a=this.host.getBoundingClientRect().width;let i="secondary"===this.variant?a:a-48;return"menu"===this.overflow&&(e>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH+this.TAB_SIDE_BUTTON_AND_CONTENT_SPACE),t.length>0&&t.slice(e).reduce(((e,t)=>e+t))>i&&i>0&&(i-=this.TAB_SIDE_BUTTON_WIDTH)),i},this.emptySourceAndHiddenDropdown=()=>{Array.from(this.host.shadowRoot.querySelectorAll("vega-dropdown")).forEach((async e=>{0===e.source.length&&await e.hide()}))}}componentDidLoad(){this.initTabPages()}componentDidRender(){this.initTabsWidthArray(),this.emptySourceAndHiddenDropdown()}handleGapChange(){this.initTabPages()}handleTabWidthArrayChange(){this.tabWidthArray.length>0&&this.initTabPages()}handleTabItemsChange(){this.initTabPagesWithDebounce()}setTabItems(e){this.tabItems=e}setTabWidthArray(e){this.tabWidthArray=e}initTabPages(){this.tabItems&&(this.tabPages="scroll"===this.overflow?[[...this.tabItems]]:this.valuePaginator.paginate(this.tabItems,((e,t)=>this.tabWidthArray[t]>0?this.tabWidthArray[t]+Number(this.formatAndValidGap(this.gap)):this.tabWidthArray[t]),this.getTabContainerSpace))}formatAndValidGap(e){return e.replace("size-","")}initTabsWidthArray(){if(0===this.tabWidthArray.length||this.tabWidthArray.some((e=>0===e))){const e=[];this.tabItems.forEach((t=>{const a=this.host.shadowRoot.querySelector(`.vega-tab[data-target='${t.dataTarget}']`);if(a){const t=a.getBoundingClientRect().width;e.push(t)}})),e.length>0&&!e.some((e=>0===e))&&(this.tabWidthArray=[...e])}}}O([s()],A.prototype,"host",void 0),O([s()],A.prototype,"gap",void 0),O([s({writable:!0})],A.prototype,"tabPages",void 0),O([s({writable:!0})],A.prototype,"tabWidthArray",void 0),O([s({writable:!0})],A.prototype,"tabItems",void 0),O([s()],A.prototype,"variant",void 0),O([s()],A.prototype,"overflow",void 0),O([s({componentFieldName:"vegaTabGroupSliderStateController"})],A.prototype,"sliderStateController",void 0),O([d("componentDidLoad")],A.prototype,"componentDidLoad",null),O([d("componentDidRender")],A.prototype,"componentDidRender",null),O([d("watchGapChange")],A.prototype,"handleGapChange",null),O([d("watchTabWidthArrayChange")],A.prototype,"handleTabWidthArrayChange",null),O([d("watchTabItemsChange")],A.prototype,"handleTabItemsChange",null);var L=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class z extends l{handleTabPagesChange(){this.selectedTabDataTarget?this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget):this.setCurrentPageIndexWhenTabPagesChange()}handleSelectedDataTargetChange(){this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget)}setCurrentPageIndexBySelectedTab(e){let t=-1;this.tabPages.forEach(((a,i)=>{-1!==a.findIndex((t=>t.dataTarget===e))&&(t=i)})),t>=0&&(this.currentPageIndex=t)}setPageIndex(e){this.currentPageIndex=e}setCurrentPageIndexWhenTabPagesChange(){this.tabPages&&this.tabPages.length&&!this.tabPages[this.currentPageIndex]&&(this.currentPageIndex=this.tabPages.length-1)}}L([s()],z.prototype,"tabPages",void 0),L([s({writable:!0})],z.prototype,"currentPageIndex",void 0),L([s()],z.prototype,"selectedTabDataTarget",void 0),L([d("watchTabPagesChange")],z.prototype,"handleTabPagesChange",null),L([d("watchSelectedTabDataTargetChange")],z.prototype,"handleSelectedDataTargetChange",null);var B=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class N extends l{constructor(){super(...arguments),this.onCloseTab=e=>{const t=e.currentTarget.closest(".vega-tab"),a=this.tabItems.findIndex((e=>e.dataTarget===t.getAttribute("data-target")));t.classList.contains("selected")&&this.selectedTargetController.setSelectedDataTarget(this.tabItems[a===this.tabItems.length-1?a-1:a+1].dataTarget);const i=this.tabItems.slice(0,a).concat(this.tabItems.slice(a+1));this.tabPagesController.setTabItems(i);const o=this.tabWidthArray.slice(0,a).concat(this.tabWidthArray.slice(a+1));this.tabPagesController.setTabWidthArray(o),e.stopPropagation()}}render(t){return this.showCloseButton&&this.tabItems.length>1&&e("div",{class:this.showCloseButton?"vega-close-icon":"vega-close-icon vega-hidden",onClick:this.onCloseTab,role:"button",tabIndex:t.disabled?-1:0,onKeyDown:u(),"aria-label":"Close Button"},e("vega-icon",{icon:"close",size:"size-12"}))}}B([s()],N.prototype,"tabWidthArray",void 0),B([s()],N.prototype,"showCloseButton",void 0),B([s()],N.prototype,"tabItems",void 0),B([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],N.prototype,"selectedTargetController",void 0),B([s({componentFieldName:"vegaTabGroupPagesController"})],N.prototype,"tabPagesController",void 0);var F=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class W extends l{constructor(){super(...arguments),this.onDirectionButtonClick=e=>{this.pageIndexController.setPageIndex("left"===e?this.currentPageIndex-1:this.currentPageIndex+1)}}getDropdownRef(){return this.dropdownRef}render(t){const a=[];this.tabPages.slice("left"===t?0:this.currentPageIndex+1,"left"===t?this.currentPageIndex:this.tabPages.length).flat().map((e=>{a.push({key:e.dataTarget,label:e.label,disabled:e.disabled})}));const i="left"===t?0===this.currentPageIndex:this.currentPageIndex+1===this.tabPages.length||this.tabPages.length<=1,o="left"===t?"chevron-backward-rounded":"chevron-forward-rounded",n=a.find((e=>e.key===this.selectedTabDataTarget))?this.selectedTabDataTarget:"";return e("div",{class:{"tab-left-button":"left"===t,"tab-right-button":"right"===t,"vega-hidden":i},onClick:()=>this.onDirectionButtonClick(t),"aria-label":"No label defined",role:"button",tabIndex:0,onKeyDown:u()},e("vega-dropdown",{source:a,translocation:{X:0,Y:16},selectType:"single",selectedSourceKey:n,"position-relative-to":this.positionRelativeTo,ref:e=>{this.dropdownRef=e,f.addUniqueObserverToNode(e,m,(e=>{this.vegaTabGroupSelectedTargetController.handleTabItemClick(e.detail)}))}},e("vega-icon",{size:"size-12",icon:o})))}}F([s()],W.prototype,"tabPages",void 0),F([s()],W.prototype,"currentPageIndex",void 0),F([s()],W.prototype,"selectedTabDataTarget",void 0),F([s()],W.prototype,"positionRelativeTo",void 0),F([s({componentFieldName:"vegaTabGroupPageIndexController"})],W.prototype,"pageIndexController",void 0),F([s()],W.prototype,"vegaTabGroupSelectedTargetController",void 0);var E=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class _ extends l{constructor(){super(...arguments),this.tabPanels=[],this.handlePanelUpdate=e=>{const{host:t,type:a}=e;"ADD"===a?this.tabPanels.push(t):this.tabPanels=this.tabPanels.filter((e=>e!==t))}}connectedCallback(){this.tabPanelUpdateObserver=new w(this.canAcceptPanelUpdate.bind(this),this.handlePanelUpdate),x.register(T,this.tabPanelUpdateObserver)}disconnectedCallback(){x.unregister(T,this.tabPanelUpdateObserver),this.tabPanels=[]}componentDidLoad(){this.initSelectedTabDataTarget()}watchSelectedTabDataTargetChange(){this.updateTabPanelsStatus(this.selectedTabDataTarget)}canAcceptPanelUpdate(e){const{host:t,type:a}=e;return"ADD"===a?C(e.host,"VEGA-TAB-GROUP")===this.host&&!this.tabPanels.includes(t):this.tabPanels&&this.tabPanels.includes(t)}initSelectedTabDataTarget(){if(this.selectedTabDataTarget)this.updateTabPanelsStatus(this.selectedTabDataTarget);else{let e=this.getDefaultActivePanelId();!e&&this.tabItems&&this.tabItems.length&&(e=this.tabItems[0].dataTarget),e&&this.selectTargetController.setSelectedDataTarget(e)}}getDefaultActivePanelId(){if(this.tabPanels&&this.tabPanels.length){const e=this.tabPanels.find((e=>!0===e.isActive));return e?e.getAttribute("id"):null}}updateTabPanelsStatus(e){this.tabPanels.length&&e&&this.tabPanels.forEach((t=>{const a=t.getAttribute("id");t.isActive=a===e}))}}E([s()],_.prototype,"host",void 0),E([s()],_.prototype,"selectedTabDataTarget",void 0),E([s()],_.prototype,"tabItems",void 0),E([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],_.prototype,"selectTargetController",void 0),E([d("connectedCallback")],_.prototype,"connectedCallback",null),E([d("disconnectedCallback")],_.prototype,"disconnectedCallback",null),E([d("componentDidLoad")],_.prototype,"componentDidLoad",null),E([d("watchSelectedTabDataTargetChange")],_.prototype,"watchSelectedTabDataTargetChange",null);var V=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class K extends l{constructor(){super(...arguments),this.TAB_LABEL_MAX_SIZE=32,this.getCarouselDomRef=()=>this.carouselDom}render(){return e("div",{class:{"tab-list":!0,menu:"menu"===this.overflow,scroll:"scroll"===this.overflow}},"menu"===this.overflow&&this.renderTabListInMenuOverflow(),"scroll"===this.overflow&&this.renderTabListInScrollOverflow())}renderTabListInMenuOverflow(){return e("vega-carousel",{showSlider:!1,ref:e=>this.carouselDom=e},this.tabPages.length>0?this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))):e("div",null,this.renderTabList(this.tabItems)))}renderTabListInScrollOverflow(){return e("div",{class:"overflow-scroll"},this.tabPages.map(((t,a)=>e("div",{key:a},this.renderTabList(t)))))}renderTabList(t){return e("vega-flex",{gap:this.gap},t.map((t=>e("div",{class:{"vega-tab":!0,selected:this.selectedTabDataTarget===t.dataTarget,"last-page":this.currentPageIndex+1===this.tabPages.length,"vega-flex-shrink-0":!0,"v-min-w-min":!0,disabled:Boolean(t.disabled)},"data-target":t.dataTarget,key:t.dataTarget},e("div",{class:"vega-tab-container"},e("div",{class:{label:!0,"vega-close-icon-space":this.showCloseButton},onClick:()=>this.handleTabItemClick(t.dataTarget),"aria-label":t.dataTarget,role:"button",tabIndex:t.disabled?-1:0,onKeyDown:u()},this.renderPrefixIconDom(t),this.renderTabLabelDom(t),this.renderCounterBadgeDom(t)),this.closeButtonRenderer.render(t))))))}renderPrefixIconDom(t){const a=t.prefixIcon;return a&&e("vega-icon",{icon:a})}renderTabLabelDom(t){return t.label.length>this.TAB_LABEL_MAX_SIZE?e("vega-tooltip",{text:t.label,placement:"bottom","position-relative-to":this.positionRelativeTo},e("span",null,t.label.substring(0,this.TAB_LABEL_MAX_SIZE),"...")):t.label}renderCounterBadgeDom(t){const a=t.counterBadge,i=this.getCounterBadgeClassByCount(a);return void 0!==(null==a?void 0:a.count)&&a.count>0&&e("div",{class:`vega-counter-badge ${i}`},e("vega-counter-badge",{count:a.count,color:a.color}))}getCounterBadgeClassByCount(e){if(e&&e.count){const t=e.count.toString().length;return 1===t?"one-digit":2===t?"two-digits":"multi-digits"}return""}handleTabItemClick(e){this.selectedTargetController.handleTabItemClick(e)}}V([s()],K.prototype,"tabPages",void 0),V([s()],K.prototype,"currentPageIndex",void 0),V([s()],K.prototype,"selectedTabDataTarget",void 0),V([s()],K.prototype,"gap",void 0),V([s()],K.prototype,"showCloseButton",void 0),V([s()],K.prototype,"tabItems",void 0),V([s()],K.prototype,"overflow",void 0),V([s()],K.prototype,"positionRelativeTo",void 0),V([s({componentFieldName:"vegaTabGroupCloseButtonRenderer"})],K.prototype,"closeButtonRenderer",void 0),V([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],K.prototype,"selectedTargetController",void 0);class M extends l{render(){return"secondary"===this.variant?e("div",{class:"vega-tab-group-content"},e("slot",null)):e("vega-card",{margin:"0",padding:{default:"size-24",S:"size-12"},variant:"shadow",backgroundColor:"bg-primary"},e("div",{class:"vega-tab-group-content"},e("slot",null)))}}!function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);n>3&&r&&Object.defineProperty(t,a,r)}([s()],M.prototype,"variant",void 0);var U=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};class q extends l{constructor(){super(...arguments),this.UPDATE_ANIMATION_FLAG_DELAY=32,this.goToPageTaskQueue=new R,this.pendingCarouselActionCount=0}async componentDidRender(){await this.goToPageTaskQueue.runTask()}async handlePageIndexChange(){const e=this.tabListRenderer.getCarouselDomRef();e&&(this.pendingCarouselActionCount+=1,setTimeout((()=>{this&&"number"==typeof this.pendingCarouselActionCount&&(this.pendingCarouselActionCount-=1)}),this.UPDATE_ANIMATION_FLAG_DELAY),await this.goToPageTaskQueue.enqueue({run:async()=>await e.goToPage(this.currentPageIndex+1)},!1))}isAnimationInProgress(){return this.pendingCarouselActionCount>0}}U([s({componentFieldName:"vegaTabGroupTabListRenderer"})],q.prototype,"tabListRenderer",void 0),U([s()],q.prototype,"currentPageIndex",void 0),U([d("componentDidRender")],q.prototype,"componentDidRender",null),U([d("watchCurrentPageIndexChange")],q.prototype,"handlePageIndexChange",null);const Y=[{payloadKey:"VARIANT_IS_PRIMARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"primary"===e.variant},{payloadKey:"VARIANT_IS_SECONDARY",payloadDescription:"Specifies the visual style and prominence of the tab group",payloadValue:e=>"secondary"===e.variant}];var $=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const H=class{constructor(e){a(this,e),this.vegaClick=i(this,"vegaClick",7),this.click=i(this,"click",7),this.globalSlimmers={},this.vegaTabGroupRenderer=new P,this.vegaTabGroupDirectionButtonRenderer=new W,this.vegaTabGroupTabListRenderer=new K,this.vegaTabGroupCloseButtonRenderer=new N,this.vegaTabGroupPagesController=new A,this.vegaTabGroupSelectedTargetController=new S,this.vegaTabGroupPageIndexController=new z,this.vegaTabGroupPanelController=new _,this.vegaTabGroupContentRenderer=new M,this.vegaTabGroupSliderStateController=new q,this.clickEventEmitter=D(H,y),this.dropdownEventPrevent=new j([y],(()=>this.vegaTabGroupRenderer.getTabMenuContainer())),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(Y),this.tabPages=[],this.tabWidthArray=[],this.currentPageIndex=0,this.selectedTabDataTarget="",this.gap="size-8",this.showCloseButton=!1,this.tabItems=[],this.variant="primary",this.overflow="menu"}watchTabPagesChange(){}watchTabWidthArrayChange(){}async watchCurrentPageIndexChange(e){}watchSelectedTabDataTargetChange(){}watchGapChange(){}watchTabItemsChange(){}componentDidLoad(){}componentDidRender(){}render(){return h(e("slot",null)),r(e(o,null,this.vegaTabGroupRenderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{tabPages:["watchTabPagesChange"],tabWidthArray:["watchTabWidthArrayChange"],currentPageIndex:["watchCurrentPageIndexChange"],selectedTabDataTarget:["watchSelectedTabDataTargetChange"],gap:["watchGapChange"],tabItems:["watchTabItemsChange"]}}};$([g()],H.prototype,"globalSlimmers",void 0),$([c()],H.prototype,"vegaTabGroupRenderer",void 0),$([c()],H.prototype,"vegaTabGroupDirectionButtonRenderer",void 0),$([c()],H.prototype,"vegaTabGroupTabListRenderer",void 0),$([c()],H.prototype,"vegaTabGroupCloseButtonRenderer",void 0),$([c()],H.prototype,"vegaTabGroupPagesController",void 0),$([c()],H.prototype,"vegaTabGroupSelectedTargetController",void 0),$([c()],H.prototype,"vegaTabGroupPageIndexController",void 0),$([c()],H.prototype,"vegaTabGroupPanelController",void 0),$([c()],H.prototype,"vegaTabGroupContentRenderer",void 0),$([c()],H.prototype,"vegaTabGroupSliderStateController",void 0),$([c()],H.prototype,"clickEventEmitter",void 0),$([c()],H.prototype,"dropdownEventPrevent",void 0),$([c()],H.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),H.style='.tab-content-container.tab-style-primary{margin-left:24px;margin-right:24px}.vega-tab{cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.tab-content-container .tab-list.scroll{width:100%;overflow:hidden}.tab-content-container .tab-list.scroll .overflow-scroll>div{display:flex;overflow-x:auto;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab-content-container .tab-list.scroll .overflow-scroll>div::-webkit-scrollbar{display:none}.tab-content-container.more-tab .vega-tab{flex-grow:1}.tab-content-container.more-tab .vega-tab.last-page{flex-grow:0}.vega-tab>div.vega-tab-container{display:flex;align-items:center}.vega-tab>div.vega-tab-container>div{flex-grow:1}.tab-style-primary .vega-tab:hover{background-color:rgba(var(--v-bg-tab-hover, 245, 247, 247, 1))}.tab-style-primary .vega-tab.selected,.tab-style-primary .vega-tab.selected:hover{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.vega-tab>div>.label{display:inline-flex;align-items:center;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;padding-top:8px;padding-bottom:8px;padding-left:16px;padding-right:16px;cursor:pointer;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-tab>div>.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){.vega-tab>div>.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){.vega-tab>div>.label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.vega-tab>div>.label vega-icon{padding-right:8px}.vega-tab>div>.label .vega-counter-badge{position:relative;height:20px;padding-left:8px}.vega-tab>div>.label .vega-counter-badge vega-counter-badge{position:absolute;padding-left:8px;top:10px}.vega-tab>div>.label .vega-counter-badge.one-digit{width:20px}.vega-tab>div>.label .vega-counter-badge.one-digit vega-counter-badge{left:10px}.vega-tab>div>.label .vega-counter-badge.two-digits{width:28px}.vega-tab>div>.label .vega-counter-badge.two-digits vega-counter-badge{left:14px}.vega-tab>div>.label .vega-counter-badge.multi-digits{width:32px}.vega-tab>div>.label .vega-counter-badge.multi-digits vega-counter-badge{left:16px}.vega-tab>div>.label.vega-close-icon-space{padding-right:12px}.vega-tab>div>div.vega-close-icon{padding-left:0px;flex-grow:0;padding-right:13px}.vega-tab>div>div.vega-hidden{display:none}.vega-tab>div vega-icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1));box-sizing:content-box}.vega-tab>div>div.vega-close-icon vega-icon{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-tab.disabled{pointer-events:none;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}.vega-tab.disabled .label,.vega-tab.disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host{display:block;width:100%;text-align:left;line-height:normal;min-width:270px}.horizontal-divider{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));width:100%;display:none;margin-top:-1px}.tab-content-container{display:flex;gap:8px;justify-content:space-between}.tab-content-container.more-tab .tab-list{width:100%}div.tab-left-button,div.tab-right-button{display:inline-block;cursor:pointer;border-top-left-radius:8px;border-top-right-radius:8px;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1))}div.tab-left-button.vega-hidden,div.tab-right-button.vega-hidden{display:none}div.tab-left-button vega-icon,div.tab-right-button vega-icon{box-sizing:content-box;padding:13px 13px 13px 12px}.vega-tab-group-content vega-tab-group-panel{display:none}.vega-tab-group-content vega-tab-group-panel.active{display:block}.tab-style-secondary .vega-tab>div.vega-tab-container{align-items:baseline}.tab-style-secondary+.horizontal-divider{display:block}.tab-style-secondary .vega-tab{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary .vega-tab>div>.label{padding-left:16px;padding-right:16px;padding-top:0px;padding-bottom:12px}.tab-style-secondary .vega-tab.selected>div>.label,.tab-style-secondary .vega-tab.selected>div>.label vega-icon,.tab-style-secondary .vega-tab:hover>div>.label,.tab-style-secondary .vega-tab:hover>div>.label vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.tab-style-secondary .vega-tab{border-top-width:0px;border-left-width:0px;border-right-width:0px;border-bottom-width:2px;border-style:solid;border-color:transparent}.tab-style-secondary .vega-tab.selected{border-color:rgba(var(--v-border-color-action, 19, 98, 226, 1))}.tab-style-secondary div.tab-left-button,.tab-style-secondary div.tab-right-button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0))}.tab-style-secondary div.tab-left-button vega-icon,.tab-style-secondary div.tab-right-button vega-icon{padding:6px 13px 13px 6px}.tab-style-secondary div.tab-left-button:hover vega-icon,.tab-style-secondary div.tab-right-button:hover vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}';var X=function(e,t,a,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(n<3?o(r):n>3?o(t,a,r):o(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r};const J=class{constructor(e){a(this,e),this.globalSlimmers={},this.clickEventPrevent=new j([y],(()=>this.host),void 0,!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.isActive=!1}connectedCallback(){this.notifyGroupAddOrDelPanel("ADD")}disconnectedCallback(){this.notifyGroupAddOrDelPanel("DEL")}componentWillLoad(){this.notifyGroupAddOrDelPanel("ADD")}render(){return r(e(o,{class:this.isActive?"active":""},e("slot",null)),this.host)}notifyGroupAddOrDelPanel(e){x.notify(T,{host:this.host,type:e})}get host(){return n(this)}};X([g()],J.prototype,"globalSlimmers",void 0),X([c()],J.prototype,"clickEventPrevent",void 0),X([c()],J.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),J.style=":host{display:none}:host(.active){display:block}";export{H as vega_tab_group,J as vega_tab_group_panel}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,d as e}from"./p-d5776087.js";import{i as s}from"./p-b1f65b13.js";const i=new class{constructor(){this.listeners=[],this.listenKeyPress()}register(t){t.map((t=>t.eventName||(t.eventName="keyup"))),this.listeners=this.listeners.concat(t)}deregister(t){this.listeners=this.listeners.filter((e=>!t.includes(e)))}listenKeyPress(){document.addEventListener("keydown",(t=>{this.invokeListeners("keydown",t)})),document.addEventListener("keyup",(t=>{this.invokeListeners("keyup",t)}))}invokeListeners(t,e){this.listeners.filter((s=>s.eventName===t&&this.shouldInvokeListener(s,e))).forEach((t=>t.callback(e)))}shouldInvokeListener(i,o){const r=o.code;let n=[],c=[];const h=Array.isArray(i.keyCode)?i.keyCode.includes(r):i.keyCode===r;if(!h)return!1;"function"==typeof i.activeElementInScope?n=i.activeElementInScope():"object"==typeof i.activeElementInScope&&(n=i.activeElementInScope),"function"==typeof i.activeElementOutScope?c=i.activeElementOutScope():"object"==typeof i.activeElementOutScope&&(c=i.activeElementOutScope);const u=!i.activeElementInScope||n.some((s=>t(e(),s)));if(!u)return!1;const f=!i.activeElementOutScope||c.every((s=>!t(e(),s))),p=!s(i.modifierPressed)||i.modifierPressed===this.isModifierPressed(o),d=!s(i.shiftKey)||i.shiftKey===o.shiftKey;return h&&u&&f&&p&&d}isModifierPressed(t){return/Mac|iPhone|iPad/.test(navigator.userAgent)?t.metaKey:t.ctrlKey}};export{i as K}
|