@globalpayments/vega 2.13.0 → 2.13.1
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-641bb215.js → app-globals-9633dc88.js} +3 -3
- package/dist/cjs/{componentUsageRuntimeMetrics-0fbcd33f.js → componentUsageRuntimeMetrics-b21c694f.js} +1 -1
- package/dist/cjs/{featureFlagController-da4c779b.js → featureFlagController-44d5e755.js} +1 -1
- package/dist/cjs/{index-5a81786f.js → index-1aa6f0c9.js} +3 -2
- package/dist/cjs/{index-55e89877.js → index-672f20ec.js} +38 -33
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/vega-accordion.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +1 -1
- package/dist/cjs/vega-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/vega-banner.cjs.entry.js +1 -1
- package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-box.cjs.entry.js +1 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/vega-button-circle.cjs.entry.js +1 -1
- package/dist/cjs/vega-button-group_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-button-link.cjs.entry.js +1 -1
- package/dist/cjs/vega-button.cjs.entry.js +1 -1
- package/dist/cjs/vega-card.cjs.entry.js +1 -1
- package/dist/cjs/vega-carousel.cjs.entry.js +1 -1
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-chip.cjs.entry.js +1 -1
- package/dist/cjs/vega-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/vega-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-divider.cjs.entry.js +1 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +46 -3
- package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
- package/dist/cjs/vega-field-label.cjs.entry.js +1 -1
- package/dist/cjs/vega-flex.cjs.entry.js +3 -3
- package/dist/cjs/vega-font.cjs.entry.js +1 -1
- package/dist/cjs/vega-form.cjs.entry.js +1 -1
- package/dist/cjs/vega-grid.cjs.entry.js +1 -1
- package/dist/cjs/vega-icon.cjs.entry.js +1 -1
- package/dist/cjs/vega-image-uploader.cjs.entry.js +1 -1
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +1 -1
- package/dist/cjs/vega-input-select.cjs.entry.js +1 -1
- package/dist/cjs/vega-input.cjs.entry.js +1 -1
- package/dist/cjs/vega-item-toggle.cjs.entry.js +1 -1
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +57 -3
- package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +1 -1
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +1 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
- package/dist/cjs/vega-segment-control.cjs.entry.js +1 -1
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-table_8.cjs.entry.js +5 -5
- package/dist/cjs/vega-text.cjs.entry.js +1 -1
- package/dist/cjs/vega-textarea.cjs.entry.js +1 -1
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +1 -1
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +30 -8
- package/dist/cjs/vega.cjs.js +4 -4
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +17 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +2 -1
- package/dist/collection/components/vega-nav/vega-left-nav/vega-left-nav.js +2 -1
- package/dist/collection/components/vega-nav/vega-nav-card/vega-nav-card.js +2 -1
- package/dist/collection/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.js +23 -1
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +12 -8
- package/dist/collection/constants/runtime-metrics-payload-definition/vega-dropdown/runtime-metrics-payload-definition.js +26 -0
- package/dist/collection/constants/runtime-metrics-payload-definition/vega-left-nav/runtime-metrics-payload-definition.js +26 -0
- package/dist/collection/constants/runtime-metrics-payload-definition/vega-nav-card/runtime-metrics-payload-definition.js +26 -0
- package/dist/collection/constants/runtime-metrics-payload-definition/vega-stepper/runtime-metrics-payload-definition.js +1 -1
- package/dist/collection/constants/runtime-metrics-payload-definition/vega-table/runtime-metrics-payload-definition.js +2 -2
- package/dist/collection/helpers/vega-telemetry-helper/test/vegaEnvManager.test.js +1 -2
- package/dist/collection/helpers/vega-telemetry-helper/vegaEnvManager.js +3 -2
- package/dist/esm/{app-globals-6bb63482.js → app-globals-f49e68bc.js} +3 -3
- package/dist/esm/{componentUsageRuntimeMetrics-6bc153ea.js → componentUsageRuntimeMetrics-9f888049.js} +1 -1
- package/dist/esm/{featureFlagController-fdb8cf0e.js → featureFlagController-9df5a1a3.js} +1 -1
- package/dist/esm/{index-1d242e89.js → index-27e4eb43.js} +38 -33
- package/dist/esm/{index-8584d77d.js → index-41dc8dc1.js} +3 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/vega-accordion.entry.js +1 -1
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +1 -1
- package/dist/esm/vega-backdrop.entry.js +1 -1
- package/dist/esm/vega-banner.entry.js +1 -1
- package/dist/esm/vega-bar-chart.entry.js +1 -1
- package/dist/esm/vega-box.entry.js +1 -1
- package/dist/esm/vega-breadcrumb.entry.js +1 -1
- package/dist/esm/vega-button-circle.entry.js +1 -1
- package/dist/esm/vega-button-group_2.entry.js +1 -1
- package/dist/esm/vega-button-link.entry.js +1 -1
- package/dist/esm/vega-button.entry.js +1 -1
- package/dist/esm/vega-card.entry.js +1 -1
- package/dist/esm/vega-carousel.entry.js +1 -1
- package/dist/esm/vega-checkbox_2.entry.js +1 -1
- package/dist/esm/vega-chip.entry.js +1 -1
- package/dist/esm/vega-color-picker.entry.js +1 -1
- package/dist/esm/vega-combo-box.entry.js +1 -1
- package/dist/esm/vega-counter-badge.entry.js +1 -1
- package/dist/esm/vega-date-picker_2.entry.js +1 -1
- package/dist/esm/vega-dialog_2.entry.js +1 -1
- package/dist/esm/vega-divider.entry.js +1 -1
- package/dist/esm/vega-dropdown_5.entry.js +46 -3
- package/dist/esm/vega-field-error.entry.js +1 -1
- package/dist/esm/vega-field-label.entry.js +1 -1
- package/dist/esm/vega-flex.entry.js +3 -3
- package/dist/esm/vega-font.entry.js +1 -1
- package/dist/esm/vega-form.entry.js +1 -1
- package/dist/esm/vega-grid.entry.js +1 -1
- package/dist/esm/vega-icon.entry.js +1 -1
- package/dist/esm/vega-image-uploader.entry.js +1 -1
- package/dist/esm/vega-input-credit-card.entry.js +3 -3
- package/dist/esm/vega-input-range.entry.js +1 -1
- package/dist/esm/vega-input-select.entry.js +1 -1
- package/dist/esm/vega-input.entry.js +1 -1
- package/dist/esm/vega-item-toggle.entry.js +1 -1
- package/dist/esm/vega-left-nav_5.entry.js +57 -3
- package/dist/esm/vega-line-chart.entry.js +1 -1
- package/dist/esm/vega-loader-wrapper_2.entry.js +1 -1
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +1 -1
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +1 -1
- package/dist/esm/vega-progress-tracker.entry.js +1 -1
- package/dist/esm/vega-radio_2.entry.js +1 -1
- package/dist/esm/vega-section-title.entry.js +1 -1
- package/dist/esm/vega-segment-control.entry.js +1 -1
- package/dist/esm/vega-selection-tile_2.entry.js +1 -1
- package/dist/esm/vega-slot-container.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +1 -1
- package/dist/esm/vega-table_8.entry.js +5 -5
- package/dist/esm/vega-text.entry.js +1 -1
- package/dist/esm/vega-textarea.entry.js +1 -1
- package/dist/esm/vega-time-picker_2.entry.js +1 -1
- package/dist/esm/vega-toggle-switch.entry.js +1 -1
- package/dist/esm/vega-tooltip_2.entry.js +31 -9
- package/dist/esm/vega.js +4 -4
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.d.ts +10 -0
- package/dist/types/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.d.ts +8 -0
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +2 -1
- package/dist/types/constants/runtime-metrics-payload-definition/vega-dropdown/runtime-metrics-payload-definition.d.ts +2 -0
- package/dist/types/constants/runtime-metrics-payload-definition/vega-left-nav/runtime-metrics-payload-definition.d.ts +2 -0
- package/dist/types/constants/runtime-metrics-payload-definition/vega-nav-card/runtime-metrics-payload-definition.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-a1673ea4.entry.js → p-07abc29b.entry.js} +1 -1
- package/dist/vega/{p-95eff660.entry.js → p-08b48e61.entry.js} +1 -1
- package/dist/vega/{p-7fa146a2.entry.js → p-0d51b10e.entry.js} +1 -1
- package/dist/vega/{p-7db505ba.entry.js → p-0ee347fd.entry.js} +1 -1
- package/dist/vega/{p-c9320565.entry.js → p-194a3f8f.entry.js} +1 -1
- package/dist/vega/{p-2ddc3071.js → p-210737f2.js} +1 -1
- package/dist/vega/{p-92ead254.entry.js → p-22101a5f.entry.js} +1 -1
- package/dist/vega/p-2d38dcab.entry.js +1 -0
- package/dist/vega/{p-49a730d5.entry.js → p-2ea7b083.entry.js} +1 -1
- package/dist/vega/{p-17d55440.entry.js → p-3185ee03.entry.js} +1 -1
- package/dist/vega/{p-f970a737.entry.js → p-31ec4b52.entry.js} +1 -1
- package/dist/vega/{p-e5bcd681.entry.js → p-3205e6ec.entry.js} +1 -1
- package/dist/vega/{p-0b32651a.entry.js → p-33ac74cb.entry.js} +1 -1
- package/dist/vega/{p-85cd20e0.js → p-3d220905.js} +1 -1
- package/dist/vega/{p-13e506c1.entry.js → p-41413ea4.entry.js} +1 -1
- package/dist/vega/{p-dcc9b865.entry.js → p-4aaa9e0d.entry.js} +1 -1
- package/dist/vega/p-5abced5e.entry.js +1 -0
- package/dist/vega/{p-e85d0765.entry.js → p-5b5625a0.entry.js} +1 -1
- package/dist/vega/{p-8c52a064.entry.js → p-5df33dea.entry.js} +1 -1
- package/dist/vega/{p-4e0baf1a.entry.js → p-60dbd035.entry.js} +1 -1
- package/dist/vega/{p-abb2f489.js → p-629acb2e.js} +1 -1
- package/dist/vega/{p-cbe4adc3.entry.js → p-64020a69.entry.js} +1 -1
- package/dist/vega/{p-52eaf169.entry.js → p-6cb26711.entry.js} +1 -1
- package/dist/vega/{p-7752a460.entry.js → p-761c458e.entry.js} +1 -1
- package/dist/vega/{p-9c69703d.js → p-7653f0c2.js} +1 -1
- package/dist/vega/{p-e24344c7.entry.js → p-797b24d3.entry.js} +1 -1
- package/dist/vega/{p-3053fef7.entry.js → p-79ccf076.entry.js} +1 -1
- package/dist/vega/{p-9a92cc18.entry.js → p-7d2ed978.entry.js} +1 -1
- package/dist/vega/{p-8bf617af.entry.js → p-86002ca4.entry.js} +1 -1
- package/dist/vega/{p-0ab8a349.entry.js → p-8bdb7c1d.entry.js} +1 -1
- package/dist/vega/{p-0994a7a3.entry.js → p-9745f18f.entry.js} +1 -1
- package/dist/vega/{p-2b04b732.entry.js → p-9820bd52.entry.js} +1 -1
- package/dist/vega/{p-fb565e6e.entry.js → p-9c726541.entry.js} +1 -1
- package/dist/vega/p-a022bf87.entry.js +1 -0
- package/dist/vega/{p-fa460bce.entry.js → p-a03b1bad.entry.js} +1 -1
- package/dist/vega/{p-f43b8a7e.entry.js → p-a09efd3b.entry.js} +1 -1
- package/dist/vega/{p-d2d89e6d.entry.js → p-a62f4fbf.entry.js} +1 -1
- package/dist/vega/{p-9f8f7c85.js → p-ac23cfa6.js} +1 -1
- package/dist/vega/{p-55eaa4ae.entry.js → p-ad2d02c5.entry.js} +1 -1
- package/dist/vega/{p-c3089dea.entry.js → p-ade08379.entry.js} +1 -1
- package/dist/vega/{p-6bb6bf50.entry.js → p-b7a0f473.entry.js} +1 -1
- package/dist/vega/{p-6e8cbf86.entry.js → p-bbbcfd09.entry.js} +1 -1
- package/dist/vega/{p-b6a086a7.entry.js → p-bbc8b4f5.entry.js} +1 -1
- package/dist/vega/{p-9973baa8.entry.js → p-bd350fb7.entry.js} +1 -1
- package/dist/vega/{p-6bad54fd.entry.js → p-bf877997.entry.js} +1 -1
- package/dist/vega/{p-9f1e74ed.entry.js → p-c902a586.entry.js} +1 -1
- package/dist/vega/{p-8f9a7718.entry.js → p-cb06eb1c.entry.js} +1 -1
- package/dist/vega/{p-e93861a9.entry.js → p-cffd96c9.entry.js} +1 -1
- package/dist/vega/{p-3cf2c509.entry.js → p-d3605b1a.entry.js} +1 -1
- package/dist/vega/p-da12b2da.entry.js +1 -0
- package/dist/vega/{p-9a8165a9.entry.js → p-db6e73fc.entry.js} +1 -1
- package/dist/vega/{p-ef72e1e6.entry.js → p-e0d2c9f6.entry.js} +1 -1
- package/dist/vega/{p-f275ec4b.entry.js → p-e49ec016.entry.js} +1 -1
- package/dist/vega/{p-24bce1b6.entry.js → p-e6848e33.entry.js} +1 -1
- package/dist/vega/{p-303e35ae.entry.js → p-e89db39c.entry.js} +1 -1
- package/dist/vega/{p-f3b35323.entry.js → p-f27998de.entry.js} +1 -1
- package/dist/vega/{p-7896719f.entry.js → p-f5f0545e.entry.js} +1 -1
- package/dist/vega/{p-b10c9d7d.entry.js → p-fa38e1c8.entry.js} +1 -1
- package/dist/vega/{p-218f1334.entry.js → p-fbc0c261.entry.js} +1 -1
- package/dist/vega/p-fc30b986.entry.js +1 -0
- package/dist/vega/{p-72aff5a0.entry.js → p-ff3ae862.entry.js} +1 -1
- package/dist/vega/{p-c90eb07d.entry.js → p-ffa25bf2.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -3
- package/dist/vega/p-0e77df41.entry.js +0 -1
- package/dist/vega/p-3221000e.entry.js +0 -1
- package/dist/vega/p-56bfc2ac.entry.js +0 -1
- package/dist/vega/p-8f472cdd.entry.js +0 -1
- package/dist/vega/p-cc30efbc.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as h,g as s}from"./p-9777b1c1.js";import{F as l}from"./p-abb2f489.js";import{V as r,M as a,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-d962b340.js";import{V as d}from"./p-8054bb18.js";import{s as n}from"./p-b81bd0bb.js";import{I as v}from"./p-018d77cc.js";import{V as m,I as f}from"./p-2ddc3071.js";import{F as u}from"./p-b7c51304.js";import{b as g}from"./p-2fa3841b.js";import{C as _}from"./p-bf95b189.js";import{c as A}from"./p-d942a746.js";import{C as b}from"./p-6ff07396.js";import{D as M}from"./p-0fd9f03f.js";import{e as E,p as w,q as Z}from"./p-9e70473b.js";import{V as I}from"./p-4e5c06ae.js";import"./p-9f8f7c85.js";import"./p-112455b1.js";import"./p-344ee7cb.js";import"./p-0bb29d98.js";import"./p-320642bd.js";import"./p-469bc36e.js";import"./p-d3f1d3dd.js";import"./p-aeef2799.js";import"./p-cb13b4e6.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-4949df06.js";import"./p-69b28805.js";import"./p-1fe9e4b3.js";import"./p-9d426517.js";const D=[{type:"visa",iconName:"visa",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var j=function(t,i,e,h){var s,l=arguments.length,r=l<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,e,h);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(l<3?s(r):l>3?s(i,e,r):s(i,e))||r);return l>3&&r&&Object.defineProperty(i,e,r),r};const y=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(y,E),this.blurEventEmitter=A(y,Z),this.focusEventEmitter=A(y,w),this.inputCreditCardEventPrevent=new b([E,w,Z],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:I.getIconKey(i),maskConfig:this.getMaskConfig(),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,M.addUniqueObserverToNode(t,E,(t=>{this.handleVegaChange(t)})),M.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaBlur()})),M.addUniqueObserverToNode(t,w,(()=>{this.handleVegaFocus()}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(){const t=[],i=this.getCreditCardType(this.value);return i&&(t.push(i.maskConfig),this.hideCardNumberOnBlur&&this.value.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),t.push(this.maskConfig))),t}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};I.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),j([f()],y.prototype,"globalSlimmers",void 0),j([v()],y.prototype,"formFieldController",void 0),j([v()],y.prototype,"changeEventEmitter",void 0),j([v()],y.prototype,"blurEventEmitter",void 0),j([v()],y.prototype,"focusEventEmitter",void 0),j([v()],y.prototype,"inputCreditCardEventPrevent",void 0),j([v()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),y.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{y as vega_input_credit_card}
|
|
1
|
+
import{r as t,c as i,h as e,H as h,g as s}from"./p-9777b1c1.js";import{F as l}from"./p-629acb2e.js";import{V as r,M as a,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-d962b340.js";import{V as d}from"./p-8054bb18.js";import{s as n}from"./p-b81bd0bb.js";import{I as v}from"./p-018d77cc.js";import{V as m,I as f}from"./p-210737f2.js";import{F as u}from"./p-b7c51304.js";import{b as g}from"./p-2fa3841b.js";import{C as _}from"./p-bf95b189.js";import{c as A}from"./p-d942a746.js";import{C as M}from"./p-6ff07396.js";import{D as b}from"./p-0fd9f03f.js";import{e as E,p as w,q as Z}from"./p-9e70473b.js";import{V as I}from"./p-4e5c06ae.js";import"./p-ac23cfa6.js";import"./p-112455b1.js";import"./p-344ee7cb.js";import"./p-0bb29d98.js";import"./p-320642bd.js";import"./p-469bc36e.js";import"./p-d3f1d3dd.js";import"./p-aeef2799.js";import"./p-cb13b4e6.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-4949df06.js";import"./p-69b28805.js";import"./p-1fe9e4b3.js";import"./p-9d426517.js";const D=[{type:"visa",iconName:"visa",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var j=function(t,i,e,h){var s,l=arguments.length,r=l<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,e,h);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(l<3?s(r):l>3?s(i,e,r):s(i,e))||r);return l>3&&r&&Object.defineProperty(i,e,r),r};const y=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(y,E),this.blurEventEmitter=A(y,Z),this.focusEventEmitter=A(y,w),this.inputCreditCardEventPrevent=new M([E,w,Z],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:I.getIconKey(i),maskConfig:this.getMaskConfig(),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,b.addUniqueObserverToNode(t,E,(t=>{this.handleVegaChange(t)})),b.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaBlur()})),b.addUniqueObserverToNode(t,w,(()=>{this.handleVegaFocus()}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){l.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(){const t=[],i=this.getCreditCardType(this.value);return i&&(t.push(i.maskConfig),this.hideCardNumberOnBlur&&this.value.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),t.push(this.maskConfig))),t}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};I.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),j([f()],y.prototype,"globalSlimmers",void 0),j([v()],y.prototype,"formFieldController",void 0),j([v()],y.prototype,"changeEventEmitter",void 0),j([v()],y.prototype,"blurEventEmitter",void 0),j([v()],y.prototype,"focusEventEmitter",void 0),j([v()],y.prototype,"inputCreditCardEventPrevent",void 0),j([v()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),y.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{y as vega_input_credit_card}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e}from"./p-018d77cc.js";import t from"./p-
|
|
1
|
+
import{L as e}from"./p-018d77cc.js";import t from"./p-ac23cfa6.js";const r=Object.freeze({"VEGA_DATE_PICKER.COMPONENT_LOAD_REQUIRED_DECORATOR":{description:"Feature flag to enable the required decorator for the date picker component. <br/> <b>Note: This feature flag is for demonstration purpose and will be persisted permanently.</b>",createdTimestamp:1660330561422,createdAtVersion:"1.2.0",removedAfterVersion:"1.11.1"},"VEGA_COMPONENT.SANITIZE_VEGA_COMPONENT":{description:"Feature flag to enable sanitize vega components.",createdTimestamp:1664262689486,createdAtVersion:"1.8.1",removedAfterVersion:"2.0.0"},"VEGA_TEXT.LABEL_OR_CONTENT_NESTED_VEGA_TEXT_COMPONENT":{description:"Feature flag to enable the label or content of other component nested vega-text component.",createdTimestamp:1665218525140,createdAtVersion:"1.8.1",removedAfterVersion:"1.9.1"},"VEGA_FLEX.ENABLE_DIRECTION_ONLY":{description:"Feature flag to make direction take effect only regardless of breakpoint for vega-flex component.",createdTimestamp:1665639912117,createdAtVersion:"1.9.0"},"VEGA_FIELD_LABEL.SHOW_LABEL":{description:"Feature flag to enable the vega-field-label component for vega-input, vega-input-select and vega-date-picker.",createdTimestamp:1666184962131,createdAtVersion:"1.9.0",removedAfterVersion:"2.0.0"},"VEGA_FLEX.USE_NATIVE_FLEX_BEHAVIOR":{description:"Feature flag to enable the **default** use of native flex behavior for vega-flex component.",createdTimestamp:1668059639449,createdAtVersion:"1.11.1",removedAfterVersion:"2.0.0"},"VEGA_TABLE.DEPRECATED_ROW_SELECTION_CHANGE_PROP":{description:"Feature flag to deprecate the rowSelection.onSelectChange and rowSelection.onSelectAllChange",createdTimestamp:1673321949321,createdAtVersion:"1.18.0",removedAfterVersion:"2.0.0"},"VEGA_ICON.USE_SIZE_PROP_FOR_THIRD_PARTY_ICONS":{description:"Feature flag to make size prop of vega-icon to take effect for third party icons.",createdTimestamp:1675752744795,createdAtVersion:"1.20.0",removedAfterVersion:"2.0.0"},"VEGA_INJECT_FORM_FIELD_CONTROLLER.ADD_DATA_VEGA_FORM_FILTER":{description:"Feature flag to deprecate the form field should validate only have data-vega-from attribute",createdTimestamp:1676017004107,createdAtVersion:"1.19.0",removedAfterVersion:"2.0.0"},"VEGA_FORM_FIELD.CHANGE_BLOCK_TO_INLINE_BLOCK":{description:"Feature flag to deprecate the form fields like input/datePicker/timePicker should use inline block",createdTimestamp:1676512727310,createdAtVersion:"1.20.0",removedAfterVersion:"2.0.0"},"VEGA_CHECKBOX_RADIO_GROUP.FLEX_DIRECTION_COL_DEFAULT":{description:"Feature flag to make the checkbox group and radio group prop vegaFlexProp default direction to col",createdTimestamp:16811712e5,createdAtVersion:"1.27.3",removedAfterVersion:"2.0.0"},"VEGA_REACT.PREVENT_SSR":{description:"Feature flag to prevent the SSR in vega-react",createdTimestamp:1679450185124,createdAtVersion:"1.25.0",disabledByDefault:!0},"VEGA_STEPPER.INPUT_DISABLED":{description:"Feature flag to rename the prop input-editable to input-disabled ",createdTimestamp:1683252081350,createdAtVersion:"1.30.0",removedAfterVersion:"2.0.0"},"VEGA_FLEX.ALIGNITEM_JUSTIFYCONTENT_USE_PREFIX_V_INSTEAD_OF_VEGA":{description:"Feature flag to render vega-flex prop alignItems and justifyContent classes by using v- instead of vega-",createdTimestamp:1684128467390,createdAtVersion:"1.32.0",removedAfterVersion:"1.48.3"},"VEGA_ANGULAR.USE_JUGGLE_RESIZE_OBSERVER":{description:"Feature flag to enable the @juggle/resizeObserver to instead window resizeObserver",createdTimestamp:1684203399089,createdAtVersion:"1.31.0"},"VEGA_INPUT.FOCUS_ON_INPUT_BY_CLICK_CLEAR_BUTTON":{description:"Feature flag to keep the input focused whenever click the clear button",createdTimestamp:1685513925082,createdAtVersion:"1.34.0",removedAfterVersion:"1.38.2"},"VEGA_VUE.EMIT_CAMEL_CASE_EVENT_NAME":{description:"Feature flag to emit camel case event name for Vue framework",createdTimestamp:1688971026741,createdAtVersion:"1.37.0"},VEGA_ITEM_TOGGLE_ISERROR_DEPRECATED:{description:"Feature flag to deprecated the component vega-item-toggle property isError",createdTimestamp:1687934508330,createdAtVersion:"1.36.0",removedAfterVersion:"2.0.0"},"VEGA_BUTTON_LINK.DEPRECATED_EVENTFUL":{description:"Feature flag to deprecated eventful property",createdTimestamp:1689313658898,createdAtVersion:"1.36.1",removedAfterVersion:"2.0.0"},"VEGA_DROPDOWN.RENAME_PREFIX_TO_PREFIX_ICON":{description:"Feature flag to rename prefix to prefixIcon",createdTimestamp:1689576347049,createdAtVersion:"1.37.0",removedAfterVersion:"2.0.0"},"VEGA_REACT.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD":{description:"Feature flag to prevent call watch method before componnentDidLoad",createdTimestamp:1706598728908,createdAtVersion:"2.0.0"},"VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD":{description:"Feature flag to prevent call watch method before componnentDidLoad in all framework",createdTimestamp:1708495728180,createdAtVersion:"2.0.0"},"VEGA_REACT.ENABLE_ON_CHANGE_HANDLE_UNDER_LOW_VERSION":{description:"Feature flag to enable the onChange event handle under react version 19 or below",createdTimestamp:1709603823660,createdAtVersion:"2.0.0"},"VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD":{description:"Feature flag to enable the hide card number mask upon initial loading of the credit card.",createdTimestamp:1715932781059,createdAtVersion:"2.9.0"},"VEGA_TABLE.ENABLE_NEW_CELL_BREAK_WORDS_STYLE":{description:"Feature flag to enable the new cell words break style",createdTimestamp:1719282763075,createdAtVersion:"2.11.2"},"VEGA_TELEMETRY.ENABLE_COLLECT_COMPONENTS_USAGE":{description:"Feature flag to enable the collection of component usage.",createdTimestamp:1717468723384,createdAtVersion:"2.11.3"},"VEGA_TELEMETRY.ENABLE_COLLECT_FEATURE_FLAG_OVERRIDDEN":{description:"Feature flag to enable the feature flag overridden.",createdTimestamp:1717468723384,createdAtVersion:"2.11.3"},"VEGA_REACT.ENABLE_ON_CLOSE_HANDLE_UNDER_LOW_VERSION":{description:"Feature flag to enable the onClose event handle under react version 19 or below",createdTimestamp:1719910557333,createdAtVersion:"2.12.0"}}),a=new class{constructor(){this.enabledFeatureFlagKeySet=new Set,this.init()}enable(...e){e.forEach((e=>{this.versionGuard(e)&&(this.enabledFeatureFlagKeySet.add(e),this.sendFeatureFlagKeyToTelemetry(e,!0))}))}disable(...e){e.forEach((e=>{this.versionGuard(e)&&(this.enabledFeatureFlagKeySet.delete(e),this.sendFeatureFlagKeyToTelemetry(e,!1))}))}isEnabled(e){return this.enabledFeatureFlagKeySet.has(e)}init(){Object.keys(r).map((e=>{r[e].disabledByDefault||this.isRemoved(e)||this.enabledFeatureFlagKeySet.add(e)}))}versionGuard(t){return!this.isRemoved(t)||(e.error(`The feature flag key '${t}' has been removed after v${r[t].removedAfterVersion}`),!1)}isRemoved(e){return!!r[e].removedAfterVersion}sendFeatureFlagKeyToTelemetry(e,r){this.canSendFeatureFlagsToTelemetry(e,r)&&t.emit("featureFlagOverridden",{featureFlagName:e,featureFlagOverriddenValue:r})}canSendFeatureFlagsToTelemetry(e,t){return!!r[e].disabledByDefault===t}};export{a as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,F as t,r as a,c as i,H as n,g as o}from"./p-9777b1c1.js";import{s as r}from"./p-b81bd0bb.js";import{a as s,V as l,M as c,I as d}from"./p-018d77cc.js";import{s as h}from"./p-6bd5c49b.js";import{V as b,I as g}from"./p-2ddc3071.js";import{P as v}from"./p-cb13b4e6.js";import{c as p}from"./p-86194314.js";import{D as u,O as f}from"./p-0fd9f03f.js";import{b as m,a as y}from"./p-9e70473b.js";import{C as x}from"./p-bf95b189.js";import{T}from"./p-2fa3841b.js";import{f as C}from"./p-320642bd.js";import{C as w}from"./p-6ff07396.js";import{c as R}from"./p-d942a746.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-1fe9e4b3.js";import"./p-d3f1d3dd.js";var j=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class D 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},ref:e=>this.tabMenuContainer=e},this.directionButtonRenderer.render("left"),this.tabListRenderer.render(),this.directionButtonRenderer.render("right")),e("div",{class:"horizontal-divider"}),this.contentRenderer.render())}}j([s()],D.prototype,"tabPages",void 0),j([s()],D.prototype,"variant",void 0),j([s({componentFieldName:"vegaTabGroupTabListRenderer"})],D.prototype,"tabListRenderer",void 0),j([s({componentFieldName:"vegaTabGroupDirectionButtonRenderer"})],D.prototype,"directionButtonRenderer",void 0),j([s({componentFieldName:"vegaTabGroupContentRenderer"})],D.prototype,"contentRenderer",void 0);var P=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class k extends l{handleSelectedDataTargetChange(){this.clickEventEmitter.emit(this.selectedTabDataTarget)}setSelectedDataTarget(e){this.selectedTabDataTarget=e}}P([s()],k.prototype,"clickEventEmitter",void 0),P([s({writable:!0})],k.prototype,"selectedTabDataTarget",void 0),P([c("watchSelectedTabDataTargetChange")],k.prototype,"handleSelectedDataTargetChange",null);class I{paginate(e,t,a){const i=e.map(t);return this.doPaginateByCapacity(e,i,a)}doPaginateByCapacity(e,t,a){const i=[];let n=0;for(;n<t.length;){const o=this.valueSum(n,t,a);if(0===o)break;i.push(e.slice(n,n+o)),n+=o}return i}valueSum(e,t,a){let i=0,n=!1,o=0;const r="function"==typeof a?a(e,t):a;return t.slice(e).forEach(((e,t)=>{i+=e,i>r&&!n&&(n=!0,o=t)})),n||(o=t.slice(e).length),o}}var S=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class G 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 I,this.initTabPagesWithDebounce=((e,t,a)=>{let i;return function(...t){i&&clearTimeout(i),i=setTimeout((function(){e.apply(a,t)}),80)}})(this.initTabPages,0,this),this.getTabContainerSpace=(e,t)=>{const a=this.host.getBoundingClientRect().width;let i="secondary"===this.variant?a:a-48;return 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()}setTabItems(e){this.tabItems=e}setTabWidthArray(e){this.tabWidthArray=e}initTabPages(){this.tabItems&&(this.tabPages=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])}}}S([s()],G.prototype,"host",void 0),S([s()],G.prototype,"gap",void 0),S([s({writable:!0})],G.prototype,"tabPages",void 0),S([s({writable:!0})],G.prototype,"tabWidthArray",void 0),S([s({writable:!0})],G.prototype,"tabItems",void 0),S([s()],G.prototype,"variant",void 0),S([s({componentFieldName:"vegaTabGroupSliderStateController"})],G.prototype,"sliderStateController",void 0),S([c("componentDidLoad")],G.prototype,"componentDidLoad",null),S([c("componentDidRender")],G.prototype,"componentDidRender",null),S([c("watchGapChange")],G.prototype,"handleGapChange",null),S([c("watchTabWidthArrayChange")],G.prototype,"handleTabWidthArrayChange",null);var A=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class O extends l{handleTabPagesChange(){this.setCurrentPageIndexWhenTabPagesChange()}handleSelectedDataTargetChange(){this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget)}setPageIndex(e){this.currentPageIndex=e}setCurrentPageIndexWhenTabPagesChange(){this.tabPages&&this.tabPages.length&&!this.tabPages[this.currentPageIndex]&&(this.currentPageIndex=this.tabPages.length-1)}setCurrentPageIndexBySelectedTab(e){let t=-1;this.tabPages.forEach(((a,i)=>{-1!==a.findIndex((t=>t.dataTarget===e))&&(t=i)})),t>=0&&(this.currentPageIndex=t)}}A([s()],O.prototype,"tabPages",void 0),A([s({writable:!0})],O.prototype,"currentPageIndex",void 0),A([s()],O.prototype,"selectedTabDataTarget",void 0),A([c("watchTabPagesChange")],O.prototype,"handleTabPagesChange",null),A([c("watchSelectedTabDataTargetChange")],O.prototype,"handleSelectedDataTargetChange",null);var z=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class L 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 n=this.tabWidthArray.slice(0,a).concat(this.tabWidthArray.slice(a+1));this.tabPagesController.setTabWidthArray(n),e.stopPropagation()}}render(){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:0,onKeyDown:p(),"aria-label":"Close Button"},e("vega-icon",{icon:"close",size:"size-12"}))}}z([s()],L.prototype,"tabWidthArray",void 0),z([s()],L.prototype,"showCloseButton",void 0),z([s()],L.prototype,"tabItems",void 0),z([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],L.prototype,"selectedTargetController",void 0),z([s({componentFieldName:"vegaTabGroupPagesController"})],L.prototype,"tabPagesController",void 0);var N=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class B 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})}));const i="left"===t?"chevron-backward-rounded":"chevron-forward-rounded";return e("div",{class:{"tab-left-button":"left"===t,"tab-right-button":"right"===t,"vega-hidden":"left"===t?0===this.currentPageIndex:this.currentPageIndex+1===this.tabPages.length||this.tabPages.length<=1},onClick:()=>this.onDirectionButtonClick(t),"aria-label":"No label defined",role:"button",tabIndex:0,onKeyDown:p()},e("vega-dropdown",{source:a,translocation:{X:0,Y:16},selectType:"single",selectedSourceKey:this.selectedTabDataTarget,"position-relative-to":this.positionRelativeTo,ref:e=>{this.dropdownRef=e,u.addUniqueObserverToNode(e,m,(e=>{this.vegaTabGroupSelectedTargetController.setSelectedDataTarget(e.detail)}))}},e("vega-icon",{size:"size-12",icon:i})))}}N([s()],B.prototype,"tabPages",void 0),N([s()],B.prototype,"currentPageIndex",void 0),N([s()],B.prototype,"selectedTabDataTarget",void 0),N([s()],B.prototype,"positionRelativeTo",void 0),N([s({componentFieldName:"vegaTabGroupPageIndexController"})],B.prototype,"pageIndexController",void 0),N([s()],B.prototype,"vegaTabGroupSelectedTargetController",void 0);var F=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class W 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 f(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}))}}F([s()],W.prototype,"host",void 0),F([s()],W.prototype,"selectedTabDataTarget",void 0),F([s()],W.prototype,"tabItems",void 0),F([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],W.prototype,"selectTargetController",void 0),F([c("connectedCallback")],W.prototype,"connectedCallback",null),F([c("disconnectedCallback")],W.prototype,"disconnectedCallback",null),F([c("componentDidLoad")],W.prototype,"componentDidLoad",null),F([c("watchSelectedTabDataTargetChange")],W.prototype,"watchSelectedTabDataTargetChange",null);var E=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class _ extends l{constructor(){super(...arguments),this.TAB_LABEL_MAX_SIZE=32,this.getCarouselDomRef=()=>this.carouselDom}render(){return e("div",{class:"tab-list"},e("vega-carousel",{showSlider:!1,ref:e=>this.carouselDom=e},this.tabPages.length>0?this.tabPages.map((t=>e("div",null,this.renderTabList(t)))):e("div",null,this.renderTabList(this.tabItems))))}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},"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.tabItemClick(t.dataTarget),"aria-label":t.dataTarget,role:"button",tabIndex:0,onKeyDown:p()},this.renderPrefixIconDom(t),this.renderTabLabelDom(t)),this.closeButtonRenderer.render())))))}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}tabItemClick(e){this.selectedTargetController.setSelectedDataTarget(e)}}E([s()],_.prototype,"tabPages",void 0),E([s()],_.prototype,"currentPageIndex",void 0),E([s()],_.prototype,"selectedTabDataTarget",void 0),E([s()],_.prototype,"gap",void 0),E([s()],_.prototype,"showCloseButton",void 0),E([s()],_.prototype,"tabItems",void 0),E([s()],_.prototype,"positionRelativeTo",void 0),E([s({componentFieldName:"vegaTabGroupCloseButtonRenderer"})],_.prototype,"closeButtonRenderer",void 0),E([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],_.prototype,"selectedTargetController",void 0);class V 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 n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);o>3&&r&&Object.defineProperty(t,a,r)}([s()],V.prototype,"variant",void 0);var K=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class M extends l{constructor(){super(...arguments),this.UPDATE_ANIMATION_FLAG_DELAY=32,this.pendingCarouselActionCount=0}async handlePageIndexChange(e){const t=this.tabListRenderer.getCarouselDomRef();t&&(this.pendingCarouselActionCount+=1,await t.goToPage(e+1),setTimeout((()=>{this&&"number"==typeof this.pendingCarouselActionCount&&(this.pendingCarouselActionCount-=1)}),this.UPDATE_ANIMATION_FLAG_DELAY))}isAnimationInProgress(){return this.pendingCarouselActionCount>0}}K([s({componentFieldName:"vegaTabGroupTabListRenderer"})],M.prototype,"tabListRenderer",void 0),K([c("watchCurrentPageIndexChange")],M.prototype,"handlePageIndexChange",null);const U=[{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 Y=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};const q=class{constructor(e){a(this,e),this.vegaClick=i(this,"vegaClick",7),this.click=i(this,"click",7),this.globalSlimmers={},this.vegaTabGroupRenderer=new D,this.vegaTabGroupDirectionButtonRenderer=new B,this.vegaTabGroupTabListRenderer=new _,this.vegaTabGroupCloseButtonRenderer=new L,this.vegaTabGroupPagesController=new G,this.vegaTabGroupSelectedTargetController=new k,this.vegaTabGroupPageIndexController=new O,this.vegaTabGroupPanelController=new W,this.vegaTabGroupContentRenderer=new V,this.vegaTabGroupSliderStateController=new M,this.clickEventEmitter=R(q,y),this.dropdownEventPrevent=new w([y],(()=>this.vegaTabGroupRenderer.getTabMenuContainer())),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(U),this.tabPages=[],this.tabWidthArray=[],this.currentPageIndex=0,this.selectedTabDataTarget="",this.gap="size-8",this.showCloseButton=!1,this.tabItems=[],this.variant="primary"}watchTabPagesChange(){}watchTabWidthArrayChange(){}async watchCurrentPageIndexChange(e){}watchSelectedTabDataTargetChange(){}watchGapChange(){}componentDidLoad(){}componentDidRender(){}render(){return h(e("slot",null)),r(e(n,null,this.vegaTabGroupRenderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{tabPages:["watchTabPagesChange"],tabWidthArray:["watchTabWidthArrayChange"],currentPageIndex:["watchCurrentPageIndexChange"],selectedTabDataTarget:["watchSelectedTabDataTargetChange"],gap:["watchGapChange"]}}};Y([g()],q.prototype,"globalSlimmers",void 0),Y([d()],q.prototype,"vegaTabGroupRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupDirectionButtonRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupTabListRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupCloseButtonRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupPagesController",void 0),Y([d()],q.prototype,"vegaTabGroupSelectedTargetController",void 0),Y([d()],q.prototype,"vegaTabGroupPageIndexController",void 0),Y([d()],q.prototype,"vegaTabGroupPanelController",void 0),Y([d()],q.prototype,"vegaTabGroupContentRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupSliderStateController",void 0),Y([d()],q.prototype,"clickEventEmitter",void 0),Y([d()],q.prototype,"dropdownEventPrevent",void 0),Y([d()],q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q.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.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-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-inverted-secondary, 188, 186, 213, 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 H=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};const X=class{constructor(e){a(this,e),this.globalSlimmers={},this.clickEventPrevent=new w([y],(()=>this.host)),this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.isActive=!1}connectedCallback(){this.notifyGroupAddOrDelPanel("ADD")}disconnectedCallback(){this.notifyGroupAddOrDelPanel("DEL")}componentWillLoad(){this.notifyGroupAddOrDelPanel("ADD")}render(){return r(e(n,{class:this.isActive?"active":""},e("slot",null)),this.host)}notifyGroupAddOrDelPanel(e){x.notify(T,{host:this.host,type:e})}get host(){return o(this)}};H([g()],X.prototype,"globalSlimmers",void 0),H([d()],X.prototype,"clickEventPrevent",void 0),H([d()],X.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),X.style=":host{display:none}:host(.active){display:block}";export{q as vega_tab_group,X as vega_tab_group_panel}
|
|
1
|
+
import{h as e,F as t,r as a,c as i,H as n,g as o}from"./p-9777b1c1.js";import{s as r}from"./p-b81bd0bb.js";import{a as s,V as l,M as c,I as d}from"./p-018d77cc.js";import{s as h}from"./p-6bd5c49b.js";import{V as b,I as g}from"./p-210737f2.js";import{P as v}from"./p-cb13b4e6.js";import{c as p}from"./p-86194314.js";import{D as u,O as f}from"./p-0fd9f03f.js";import{b as m,a as y}from"./p-9e70473b.js";import{C as x}from"./p-bf95b189.js";import{T}from"./p-2fa3841b.js";import{f as C}from"./p-320642bd.js";import{C as w}from"./p-6ff07396.js";import{c as R}from"./p-d942a746.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-1fe9e4b3.js";import"./p-d3f1d3dd.js";var j=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class D 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},ref:e=>this.tabMenuContainer=e},this.directionButtonRenderer.render("left"),this.tabListRenderer.render(),this.directionButtonRenderer.render("right")),e("div",{class:"horizontal-divider"}),this.contentRenderer.render())}}j([s()],D.prototype,"tabPages",void 0),j([s()],D.prototype,"variant",void 0),j([s({componentFieldName:"vegaTabGroupTabListRenderer"})],D.prototype,"tabListRenderer",void 0),j([s({componentFieldName:"vegaTabGroupDirectionButtonRenderer"})],D.prototype,"directionButtonRenderer",void 0),j([s({componentFieldName:"vegaTabGroupContentRenderer"})],D.prototype,"contentRenderer",void 0);var P=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class k extends l{handleSelectedDataTargetChange(){this.clickEventEmitter.emit(this.selectedTabDataTarget)}setSelectedDataTarget(e){this.selectedTabDataTarget=e}}P([s()],k.prototype,"clickEventEmitter",void 0),P([s({writable:!0})],k.prototype,"selectedTabDataTarget",void 0),P([c("watchSelectedTabDataTargetChange")],k.prototype,"handleSelectedDataTargetChange",null);class I{paginate(e,t,a){const i=e.map(t);return this.doPaginateByCapacity(e,i,a)}doPaginateByCapacity(e,t,a){const i=[];let n=0;for(;n<t.length;){const o=this.valueSum(n,t,a);if(0===o)break;i.push(e.slice(n,n+o)),n+=o}return i}valueSum(e,t,a){let i=0,n=!1,o=0;const r="function"==typeof a?a(e,t):a;return t.slice(e).forEach(((e,t)=>{i+=e,i>r&&!n&&(n=!0,o=t)})),n||(o=t.slice(e).length),o}}var S=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class G 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 I,this.initTabPagesWithDebounce=((e,t,a)=>{let i;return function(...t){i&&clearTimeout(i),i=setTimeout((function(){e.apply(a,t)}),80)}})(this.initTabPages,0,this),this.getTabContainerSpace=(e,t)=>{const a=this.host.getBoundingClientRect().width;let i="secondary"===this.variant?a:a-48;return 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()}setTabItems(e){this.tabItems=e}setTabWidthArray(e){this.tabWidthArray=e}initTabPages(){this.tabItems&&(this.tabPages=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])}}}S([s()],G.prototype,"host",void 0),S([s()],G.prototype,"gap",void 0),S([s({writable:!0})],G.prototype,"tabPages",void 0),S([s({writable:!0})],G.prototype,"tabWidthArray",void 0),S([s({writable:!0})],G.prototype,"tabItems",void 0),S([s()],G.prototype,"variant",void 0),S([s({componentFieldName:"vegaTabGroupSliderStateController"})],G.prototype,"sliderStateController",void 0),S([c("componentDidLoad")],G.prototype,"componentDidLoad",null),S([c("componentDidRender")],G.prototype,"componentDidRender",null),S([c("watchGapChange")],G.prototype,"handleGapChange",null),S([c("watchTabWidthArrayChange")],G.prototype,"handleTabWidthArrayChange",null);var A=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class O extends l{handleTabPagesChange(){this.setCurrentPageIndexWhenTabPagesChange()}handleSelectedDataTargetChange(){this.setCurrentPageIndexBySelectedTab(this.selectedTabDataTarget)}setPageIndex(e){this.currentPageIndex=e}setCurrentPageIndexWhenTabPagesChange(){this.tabPages&&this.tabPages.length&&!this.tabPages[this.currentPageIndex]&&(this.currentPageIndex=this.tabPages.length-1)}setCurrentPageIndexBySelectedTab(e){let t=-1;this.tabPages.forEach(((a,i)=>{-1!==a.findIndex((t=>t.dataTarget===e))&&(t=i)})),t>=0&&(this.currentPageIndex=t)}}A([s()],O.prototype,"tabPages",void 0),A([s({writable:!0})],O.prototype,"currentPageIndex",void 0),A([s()],O.prototype,"selectedTabDataTarget",void 0),A([c("watchTabPagesChange")],O.prototype,"handleTabPagesChange",null),A([c("watchSelectedTabDataTargetChange")],O.prototype,"handleSelectedDataTargetChange",null);var z=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class L 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 n=this.tabWidthArray.slice(0,a).concat(this.tabWidthArray.slice(a+1));this.tabPagesController.setTabWidthArray(n),e.stopPropagation()}}render(){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:0,onKeyDown:p(),"aria-label":"Close Button"},e("vega-icon",{icon:"close",size:"size-12"}))}}z([s()],L.prototype,"tabWidthArray",void 0),z([s()],L.prototype,"showCloseButton",void 0),z([s()],L.prototype,"tabItems",void 0),z([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],L.prototype,"selectedTargetController",void 0),z([s({componentFieldName:"vegaTabGroupPagesController"})],L.prototype,"tabPagesController",void 0);var N=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class B 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})}));const i="left"===t?"chevron-backward-rounded":"chevron-forward-rounded";return e("div",{class:{"tab-left-button":"left"===t,"tab-right-button":"right"===t,"vega-hidden":"left"===t?0===this.currentPageIndex:this.currentPageIndex+1===this.tabPages.length||this.tabPages.length<=1},onClick:()=>this.onDirectionButtonClick(t),"aria-label":"No label defined",role:"button",tabIndex:0,onKeyDown:p()},e("vega-dropdown",{source:a,translocation:{X:0,Y:16},selectType:"single",selectedSourceKey:this.selectedTabDataTarget,"position-relative-to":this.positionRelativeTo,ref:e=>{this.dropdownRef=e,u.addUniqueObserverToNode(e,m,(e=>{this.vegaTabGroupSelectedTargetController.setSelectedDataTarget(e.detail)}))}},e("vega-icon",{size:"size-12",icon:i})))}}N([s()],B.prototype,"tabPages",void 0),N([s()],B.prototype,"currentPageIndex",void 0),N([s()],B.prototype,"selectedTabDataTarget",void 0),N([s()],B.prototype,"positionRelativeTo",void 0),N([s({componentFieldName:"vegaTabGroupPageIndexController"})],B.prototype,"pageIndexController",void 0),N([s()],B.prototype,"vegaTabGroupSelectedTargetController",void 0);var F=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class W 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 f(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}))}}F([s()],W.prototype,"host",void 0),F([s()],W.prototype,"selectedTabDataTarget",void 0),F([s()],W.prototype,"tabItems",void 0),F([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],W.prototype,"selectTargetController",void 0),F([c("connectedCallback")],W.prototype,"connectedCallback",null),F([c("disconnectedCallback")],W.prototype,"disconnectedCallback",null),F([c("componentDidLoad")],W.prototype,"componentDidLoad",null),F([c("watchSelectedTabDataTargetChange")],W.prototype,"watchSelectedTabDataTargetChange",null);var E=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class _ extends l{constructor(){super(...arguments),this.TAB_LABEL_MAX_SIZE=32,this.getCarouselDomRef=()=>this.carouselDom}render(){return e("div",{class:"tab-list"},e("vega-carousel",{showSlider:!1,ref:e=>this.carouselDom=e},this.tabPages.length>0?this.tabPages.map((t=>e("div",null,this.renderTabList(t)))):e("div",null,this.renderTabList(this.tabItems))))}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},"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.tabItemClick(t.dataTarget),"aria-label":t.dataTarget,role:"button",tabIndex:0,onKeyDown:p()},this.renderPrefixIconDom(t),this.renderTabLabelDom(t)),this.closeButtonRenderer.render())))))}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}tabItemClick(e){this.selectedTargetController.setSelectedDataTarget(e)}}E([s()],_.prototype,"tabPages",void 0),E([s()],_.prototype,"currentPageIndex",void 0),E([s()],_.prototype,"selectedTabDataTarget",void 0),E([s()],_.prototype,"gap",void 0),E([s()],_.prototype,"showCloseButton",void 0),E([s()],_.prototype,"tabItems",void 0),E([s()],_.prototype,"positionRelativeTo",void 0),E([s({componentFieldName:"vegaTabGroupCloseButtonRenderer"})],_.prototype,"closeButtonRenderer",void 0),E([s({componentFieldName:"vegaTabGroupSelectedTargetController"})],_.prototype,"selectedTargetController",void 0);class V 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 n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);o>3&&r&&Object.defineProperty(t,a,r)}([s()],V.prototype,"variant",void 0);var K=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};class M extends l{constructor(){super(...arguments),this.UPDATE_ANIMATION_FLAG_DELAY=32,this.pendingCarouselActionCount=0}async handlePageIndexChange(e){const t=this.tabListRenderer.getCarouselDomRef();t&&(this.pendingCarouselActionCount+=1,await t.goToPage(e+1),setTimeout((()=>{this&&"number"==typeof this.pendingCarouselActionCount&&(this.pendingCarouselActionCount-=1)}),this.UPDATE_ANIMATION_FLAG_DELAY))}isAnimationInProgress(){return this.pendingCarouselActionCount>0}}K([s({componentFieldName:"vegaTabGroupTabListRenderer"})],M.prototype,"tabListRenderer",void 0),K([c("watchCurrentPageIndexChange")],M.prototype,"handlePageIndexChange",null);const U=[{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 Y=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};const q=class{constructor(e){a(this,e),this.vegaClick=i(this,"vegaClick",7),this.click=i(this,"click",7),this.globalSlimmers={},this.vegaTabGroupRenderer=new D,this.vegaTabGroupDirectionButtonRenderer=new B,this.vegaTabGroupTabListRenderer=new _,this.vegaTabGroupCloseButtonRenderer=new L,this.vegaTabGroupPagesController=new G,this.vegaTabGroupSelectedTargetController=new k,this.vegaTabGroupPageIndexController=new O,this.vegaTabGroupPanelController=new W,this.vegaTabGroupContentRenderer=new V,this.vegaTabGroupSliderStateController=new M,this.clickEventEmitter=R(q,y),this.dropdownEventPrevent=new w([y],(()=>this.vegaTabGroupRenderer.getTabMenuContainer())),this.vegaComponentUsageRuntimeMetricsSlimmer=new b(U),this.tabPages=[],this.tabWidthArray=[],this.currentPageIndex=0,this.selectedTabDataTarget="",this.gap="size-8",this.showCloseButton=!1,this.tabItems=[],this.variant="primary"}watchTabPagesChange(){}watchTabWidthArrayChange(){}async watchCurrentPageIndexChange(e){}watchSelectedTabDataTargetChange(){}watchGapChange(){}componentDidLoad(){}componentDidRender(){}render(){return h(e("slot",null)),r(e(n,null,this.vegaTabGroupRenderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{tabPages:["watchTabPagesChange"],tabWidthArray:["watchTabWidthArrayChange"],currentPageIndex:["watchCurrentPageIndexChange"],selectedTabDataTarget:["watchSelectedTabDataTargetChange"],gap:["watchGapChange"]}}};Y([g()],q.prototype,"globalSlimmers",void 0),Y([d()],q.prototype,"vegaTabGroupRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupDirectionButtonRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupTabListRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupCloseButtonRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupPagesController",void 0),Y([d()],q.prototype,"vegaTabGroupSelectedTargetController",void 0),Y([d()],q.prototype,"vegaTabGroupPageIndexController",void 0),Y([d()],q.prototype,"vegaTabGroupPanelController",void 0),Y([d()],q.prototype,"vegaTabGroupContentRenderer",void 0),Y([d()],q.prototype,"vegaTabGroupSliderStateController",void 0),Y([d()],q.prototype,"clickEventEmitter",void 0),Y([d()],q.prototype,"dropdownEventPrevent",void 0),Y([d()],q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q.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.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-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-inverted-secondary, 188, 186, 213, 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 H=function(e,t,a,i){var n,o=arguments.length,r=o<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--)(n=e[s])&&(r=(o<3?n(r):o>3?n(t,a,r):n(t,a))||r);return o>3&&r&&Object.defineProperty(t,a,r),r};const X=class{constructor(e){a(this,e),this.globalSlimmers={},this.clickEventPrevent=new w([y],(()=>this.host)),this.vegaComponentUsageRuntimeMetricsSlimmer=new b,this.isActive=!1}connectedCallback(){this.notifyGroupAddOrDelPanel("ADD")}disconnectedCallback(){this.notifyGroupAddOrDelPanel("DEL")}componentWillLoad(){this.notifyGroupAddOrDelPanel("ADD")}render(){return r(e(n,{class:this.isActive?"active":""},e("slot",null)),this.host)}notifyGroupAddOrDelPanel(e){x.notify(T,{host:this.host,type:e})}get host(){return o(this)}};H([g()],X.prototype,"globalSlimmers",void 0),H([d()],X.prototype,"clickEventPrevent",void 0),H([d()],X.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),X.style=":host{display:none}:host(.active){display:block}";export{q as vega_tab_group,X as vega_tab_group_panel}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as a}from"./p-9777b1c1.js";import{c as r}from"./p-86194314.js";import{s as o}from"./p-b81bd0bb.js";import{r as n,e as h}from"./p-ecfa7534.js";import{R as c}from"./p-eb6c9578.js";import{I as d}from"./p-018d77cc.js";import{V as l,I as p}from"./p-2ddc3071.js";import{P as u}from"./p-cb13b4e6.js";import{c as v}from"./p-d942a746.js";import{d as m}from"./p-9e70473b.js";import{c as g}from"./p-58e79f0e.js";import"./p-d361ef78.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-3a0a4d15.js";import"./p-c59042c0.js";import"./p-344ee7cb.js";import"./p-d3f1d3dd.js";import"./p-bf95b189.js";import"./p-0fd9f03f.js";import"./p-1fe9e4b3.js";import"./p-47a4c625.js";class b{constructor(){this.queue=[]}async enqueue(t){const s=0===this.queue.length;this.queue.push(t),s&&await this.runTask()}async runTask(){const t=this.queue[0];await t.run(),this.queue.shift(),this.queue.length>0&&await this.runTask()}}var f;!function(t){t.RIGHT="TOUCH_DIR_RIGHT",t.LEFT="TOUCH_DIR_LEFT",t.UP="TOUCH_DIR_UP",t.DOWN="TOUCH_DIR_DOWN"}(f||(f={}));class y{constructor(t){this.touchStart=this.onTouchStart.bind(this),this.touchMove=this.onTouchMove.bind(this),this.touchEnd=this.onTouchEnd.bind(this),this.touchableParams=t,this.attachListeners()}static init(t){return new y(t)}static getTouchDirectionAndDistance(t,s,i,e){const a=i-t,r=e-s;return Math.abs(a)>Math.abs(r)?{direction:a>0?f.RIGHT:f.LEFT,distance:Math.abs(a)}:{direction:r>0?f.UP:f.DOWN,distance:Math.abs(r)}}static getTouchEventCoordinates(t){return{x:t.changedTouches[0].screenX,y:t.changedTouches[0].screenY}}destroy(){this.touchableParams.touchable.removeEventListener("touchstart",this.touchStart),this.touchableParams.touchable.removeEventListener("touchmove",this.touchMove),this.touchableParams.touchable.removeEventListener("touchend",this.touchEnd)}attachListeners(){this.touchableParams.touchable.addEventListener("touchstart",this.touchStart),this.touchableParams.touchable.addEventListener("touchmove",this.touchMove),this.touchableParams.touchable.addEventListener("touchend",this.touchEnd)}onTouchStart(t){var s,i;this.touchStartState=y.getTouchEventCoordinates(t),null===(i=(s=this.touchableParams).onTouchStart)||void 0===i||i.call(s,this.touchStartState.x,this.touchStartState.y)}onTouchMove(t){var s,i;const{x:e,y:a}=y.getTouchEventCoordinates(t),{direction:r,distance:o}=y.getTouchDirectionAndDistance(this.touchStartState.x,this.touchStartState.y,e,a);null===(i=(s=this.touchableParams).onTouchMove)||void 0===i||i.call(s,r,o)}onTouchEnd(t){var s,i;const{x:e,y:a}=y.getTouchEventCoordinates(t),{direction:r}=y.getTouchDirectionAndDistance(this.touchStartState.x,this.touchStartState.y,e,a);null===(i=(s=this.touchableParams).onTouchEnd)||void 0===i||i.call(s,r),this.resetStartState()}resetStartState(){this.touchStartState={x:0,y:0}}}const w=[{payloadKey:"PER_PAGE_IS_ONE",payloadDescription:"@deprecated Specifies the number of elements displayed per page in the carousel.",payloadValue:t=>1===t.perPage},{payloadKey:"PER_PAGE_IS_NOT_ONE",payloadDescription:"@deprecated Specifies the number of elements displayed per page in the carousel.",payloadValue:t=>1!==t.perPage}];var P=function(t,s,i,e){var a,r=arguments.length,o=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,i,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(r<3?a(o):r>3?a(s,i,o):a(s,i))||o);return r>3&&o&&Object.defineProperty(s,i,o),o};const j=class{constructor(i){t(this,i),this.vegaPageUpdate=s(this,"vegaPageUpdate",7),this.pageUpdate=s(this,"pageUpdate",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new l(w),this.pageResizeObserverSlimmer=new u({callback:()=>{this.getCarouselItemsPerPage()!==this.currentItemsPerPage&&this.updatePageLayout()}}),this.pageUpdateEventEmitter=v(j,m),this.deprecatedPropertySlimmer=g(j,"itemsPerPage","perPage",1),this.carouselContentElements=[],this.slideTaskQueue=new b,this.currentItemsPerPage=1,this.page=1,this.perPage=1,this.itemsPerPage=1,this.showSlider=!0,this.spacing="size-16",this.canSwipe=!0,this.onClickIndicators=async t=>{const s=Number(t.currentTarget.dataset.page);await this.goToPage(s)},this.getTotalPage=()=>Math.ceil(this.carouselContentElements.length/this.currentItemsPerPage),this.updatePageLayout=()=>{this.currentItemsPerPage=this.getCarouselItemsPerPage(),this.totalPages=this.getTotalPage(),this.page=1,this.wrapChildContentAsCarouselItem()},this.initMutationObserver=()=>{this.mutationObserver=new MutationObserver((async()=>{await this.updateContentByObserverSlotChange()})),this.mutationObserver.observe(this.host,{childList:!0})},this.initTouchEvent=()=>{this.touchListener=y.init({touchable:this.listContainer,onTouchEnd:async t=>{const s=this.page+(t===f.RIGHT?-1:t===f.LEFT?1:0);await this.goToPage(s)}})}}watchPage(){this.pageUpdateEventEmitter.emit(this.page)}watchPerPage(){this.updatePageLayout()}watchItemsPerPage(){this.updatePageLayout()}onSpacingPropsChange(){this.host.querySelectorAll("vega-grid").forEach((t=>{t.gap=this.spacing}))}async disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect(),this.touchListener&&this.touchListener.destroy()}componentDidLoad(){this.carouselContentElements=Array.from(this.host.children),this.updatePageLayout(),this.initMutationObserver(),this.initTouchEvent()}async nextPage(){const t=this.page<this.totalPages?this.page+1:this.page;await this.goToPage(t)}async prevPage(){const t=this.page>1?this.page-1:this.page;await this.goToPage(t)}async goToPage(t){await this.goToPageInternal(t)}render(){return o(i(e,null,i("div",{class:{"carousel-inner":!0,"carousel-stop-swipe":!this.canSwipe},ref:t=>this.listContainer=t},i("slot",null)),this.renderIndicatorDom()),this.host)}async goToPageInternal(t,s=!0){t>=1&&t<=this.totalPages&&t!==this.page&&(this.page=t,await this.slideTaskQueue.enqueue({run:()=>this.doSlide(t,s)}))}renderIndicatorDom(){return this.showSlider&&i("div",{class:"vega-carousel-indicators-container"},new Array(this.totalPages).fill("").map(((t,s)=>i("div",{key:s,class:{"vega-carousel-indicator-active":s+1===this.page},"data-page":s+1,role:"button","aria-label":"No label defined",tabIndex:0,onKeyDown:r(),onClick:this.onClickIndicators}))))}async updateContentByObserverSlotChange(){const t=this.page,s=Array.from(this.host.children).filter((t=>!t.classList.contains("carousel-item"))),i=Array.from(this.host.querySelectorAll(".carousel-item vega-grid > div > *"));(i.length!==this.carouselContentElements.length||s.length>0)&&(this.carouselContentElements=i.concat(s),this.updatePageLayout()),await this.goToPageInternal(t,!1)}wrapChildContentAsCarouselItem(){const t=[],s=this.carouselContentElements;for(let i=0;i<this.totalPages;i++){const e=document.createElement("vega-grid");e.setAttribute("gap",this.spacing),e.setAttribute("column",this.currentItemsPerPage.toString()),e.setAttribute("row","1");for(let t=i*this.currentItemsPerPage;t<s.length&&t<this.currentItemsPerPage*(i+1);t++){const i=document.createElement("div");i.appendChild(s[t]),e.appendChild(i)}const a=document.createElement("div");a.classList.add("carousel-item"),0===i&&a.classList.add("active"),a.appendChild(e),t.push(a)}this.host.replaceChildren(...t)}doSlide(t,s){return new Promise(((i,e)=>{const a=this.host.querySelector(".active"),r=t-1>Array.from(this.host.children).indexOf(a),o=this.host.children[t-1],c=r?"carousel-item-start":"carousel-item-end",d=r?"carousel-item-next":"carousel-item-prev";a&&o?s?(o.classList.add(d),n(o),o.classList.add(c),a.classList.add(c),h((()=>{o.classList.remove(c,d),a.classList.remove("active",c),o.classList.add("active"),i()}),a,600)):(a.classList.remove("active"),n(o),o.classList.add("active"),i()):e("Cannot find active and target item in carousel list")}))}getCarouselItemsPerPage(){const t=c.formatCustom(this.deprecatedPropertySlimmer.getValue());return t?Math.max(1,Math.min(4,t,this.carouselContentElements.length)):1}get host(){return a(this)}static get watchers(){return{page:["watchPage"],perPage:["watchPerPage"],itemsPerPage:["watchItemsPerPage"],spacing:["onSpacingPropsChange"]}}};P([p()],j.prototype,"globalSlimmers",void 0),P([d()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),P([d()],j.prototype,"pageResizeObserverSlimmer",void 0),P([d()],j.prototype,"pageUpdateEventEmitter",void 0),P([d()],j.prototype,"deprecatedPropertySlimmer",void 0),j.style=":host{display:block}:host .vega-carousel-indicators-container{display:flex;justify-content:center;align-items:center;margin-top:24px}:host .vega-carousel-indicators-container>div{border-radius:9999px;width:16px;height:16px;border-width:2px;border-style:solid;margin-right:24px;cursor:pointer;border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div:focus{border:2px solid rgba(var(--v-border-secondary-btn-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));box-shadow:0 0 0 4px rgba(var(--v-ring-action-focus, 19, 98, 226, 0.25))}:host .vega-carousel-indicators-container>div:hover{border:2px solid rgba(var(--v-border-secondary-btn-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host .vega-carousel-indicators-container>div.vega-carousel-indicator-active{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div.vega-carousel-indicator-active:hover{border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div:last-child{margin-right:0px}:host .carousel-inner{position:relative;width:100%;overflow:hidden}:host .carousel-inner.carousel-stop-swipe{pointer-events:none}:host ::slotted(.carousel-item){width:100%;position:relative;display:none;float:left;transition:transform 0.6s ease;margin-right:-100%}:host ::slotted(.carousel-item.active),:host ::slotted(.carousel-item-next),:host ::slotted(.carousel-item-prev){display:block}:host ::slotted(.carousel-item-next:not(.carousel-item-start)),:host ::slotted(.active.carousel-item-end){transform:translateX(100%)}:host ::slotted(.carousel-item-prev:not(.carousel-item-end)),:host ::slotted(.active.carousel-item-start){transform:translateX(-100%)}";export{j as vega_carousel}
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as a}from"./p-9777b1c1.js";import{c as r}from"./p-86194314.js";import{s as o}from"./p-b81bd0bb.js";import{r as n,e as h}from"./p-ecfa7534.js";import{R as c}from"./p-eb6c9578.js";import{I as d}from"./p-018d77cc.js";import{V as l,I as p}from"./p-210737f2.js";import{P as u}from"./p-cb13b4e6.js";import{c as v}from"./p-d942a746.js";import{d as m}from"./p-9e70473b.js";import{c as g}from"./p-58e79f0e.js";import"./p-d361ef78.js";import"./p-3542f8fe.js";import"./p-3c8b2105.js";import"./p-3a0a4d15.js";import"./p-c59042c0.js";import"./p-344ee7cb.js";import"./p-d3f1d3dd.js";import"./p-bf95b189.js";import"./p-0fd9f03f.js";import"./p-1fe9e4b3.js";import"./p-47a4c625.js";class b{constructor(){this.queue=[]}async enqueue(t){const s=0===this.queue.length;this.queue.push(t),s&&await this.runTask()}async runTask(){const t=this.queue[0];await t.run(),this.queue.shift(),this.queue.length>0&&await this.runTask()}}var f;!function(t){t.RIGHT="TOUCH_DIR_RIGHT",t.LEFT="TOUCH_DIR_LEFT",t.UP="TOUCH_DIR_UP",t.DOWN="TOUCH_DIR_DOWN"}(f||(f={}));class y{constructor(t){this.touchStart=this.onTouchStart.bind(this),this.touchMove=this.onTouchMove.bind(this),this.touchEnd=this.onTouchEnd.bind(this),this.touchableParams=t,this.attachListeners()}static init(t){return new y(t)}static getTouchDirectionAndDistance(t,s,i,e){const a=i-t,r=e-s;return Math.abs(a)>Math.abs(r)?{direction:a>0?f.RIGHT:f.LEFT,distance:Math.abs(a)}:{direction:r>0?f.UP:f.DOWN,distance:Math.abs(r)}}static getTouchEventCoordinates(t){return{x:t.changedTouches[0].screenX,y:t.changedTouches[0].screenY}}destroy(){this.touchableParams.touchable.removeEventListener("touchstart",this.touchStart),this.touchableParams.touchable.removeEventListener("touchmove",this.touchMove),this.touchableParams.touchable.removeEventListener("touchend",this.touchEnd)}attachListeners(){this.touchableParams.touchable.addEventListener("touchstart",this.touchStart),this.touchableParams.touchable.addEventListener("touchmove",this.touchMove),this.touchableParams.touchable.addEventListener("touchend",this.touchEnd)}onTouchStart(t){var s,i;this.touchStartState=y.getTouchEventCoordinates(t),null===(i=(s=this.touchableParams).onTouchStart)||void 0===i||i.call(s,this.touchStartState.x,this.touchStartState.y)}onTouchMove(t){var s,i;const{x:e,y:a}=y.getTouchEventCoordinates(t),{direction:r,distance:o}=y.getTouchDirectionAndDistance(this.touchStartState.x,this.touchStartState.y,e,a);null===(i=(s=this.touchableParams).onTouchMove)||void 0===i||i.call(s,r,o)}onTouchEnd(t){var s,i;const{x:e,y:a}=y.getTouchEventCoordinates(t),{direction:r}=y.getTouchDirectionAndDistance(this.touchStartState.x,this.touchStartState.y,e,a);null===(i=(s=this.touchableParams).onTouchEnd)||void 0===i||i.call(s,r),this.resetStartState()}resetStartState(){this.touchStartState={x:0,y:0}}}const w=[{payloadKey:"PER_PAGE_IS_ONE",payloadDescription:"@deprecated Specifies the number of elements displayed per page in the carousel.",payloadValue:t=>1===t.perPage},{payloadKey:"PER_PAGE_IS_NOT_ONE",payloadDescription:"@deprecated Specifies the number of elements displayed per page in the carousel.",payloadValue:t=>1!==t.perPage}];var P=function(t,s,i,e){var a,r=arguments.length,o=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,i,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(r<3?a(o):r>3?a(s,i,o):a(s,i))||o);return r>3&&o&&Object.defineProperty(s,i,o),o};const j=class{constructor(i){t(this,i),this.vegaPageUpdate=s(this,"vegaPageUpdate",7),this.pageUpdate=s(this,"pageUpdate",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new l(w),this.pageResizeObserverSlimmer=new u({callback:()=>{this.getCarouselItemsPerPage()!==this.currentItemsPerPage&&this.updatePageLayout()}}),this.pageUpdateEventEmitter=v(j,m),this.deprecatedPropertySlimmer=g(j,"itemsPerPage","perPage",1),this.carouselContentElements=[],this.slideTaskQueue=new b,this.currentItemsPerPage=1,this.page=1,this.perPage=1,this.itemsPerPage=1,this.showSlider=!0,this.spacing="size-16",this.canSwipe=!0,this.onClickIndicators=async t=>{const s=Number(t.currentTarget.dataset.page);await this.goToPage(s)},this.getTotalPage=()=>Math.ceil(this.carouselContentElements.length/this.currentItemsPerPage),this.updatePageLayout=()=>{this.currentItemsPerPage=this.getCarouselItemsPerPage(),this.totalPages=this.getTotalPage(),this.page=1,this.wrapChildContentAsCarouselItem()},this.initMutationObserver=()=>{this.mutationObserver=new MutationObserver((async()=>{await this.updateContentByObserverSlotChange()})),this.mutationObserver.observe(this.host,{childList:!0})},this.initTouchEvent=()=>{this.touchListener=y.init({touchable:this.listContainer,onTouchEnd:async t=>{const s=this.page+(t===f.RIGHT?-1:t===f.LEFT?1:0);await this.goToPage(s)}})}}watchPage(){this.pageUpdateEventEmitter.emit(this.page)}watchPerPage(){this.updatePageLayout()}watchItemsPerPage(){this.updatePageLayout()}onSpacingPropsChange(){this.host.querySelectorAll("vega-grid").forEach((t=>{t.gap=this.spacing}))}async disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect(),this.touchListener&&this.touchListener.destroy()}componentDidLoad(){this.carouselContentElements=Array.from(this.host.children),this.updatePageLayout(),this.initMutationObserver(),this.initTouchEvent()}async nextPage(){const t=this.page<this.totalPages?this.page+1:this.page;await this.goToPage(t)}async prevPage(){const t=this.page>1?this.page-1:this.page;await this.goToPage(t)}async goToPage(t){await this.goToPageInternal(t)}render(){return o(i(e,null,i("div",{class:{"carousel-inner":!0,"carousel-stop-swipe":!this.canSwipe},ref:t=>this.listContainer=t},i("slot",null)),this.renderIndicatorDom()),this.host)}async goToPageInternal(t,s=!0){t>=1&&t<=this.totalPages&&t!==this.page&&(this.page=t,await this.slideTaskQueue.enqueue({run:()=>this.doSlide(t,s)}))}renderIndicatorDom(){return this.showSlider&&i("div",{class:"vega-carousel-indicators-container"},new Array(this.totalPages).fill("").map(((t,s)=>i("div",{key:s,class:{"vega-carousel-indicator-active":s+1===this.page},"data-page":s+1,role:"button","aria-label":"No label defined",tabIndex:0,onKeyDown:r(),onClick:this.onClickIndicators}))))}async updateContentByObserverSlotChange(){const t=this.page,s=Array.from(this.host.children).filter((t=>!t.classList.contains("carousel-item"))),i=Array.from(this.host.querySelectorAll(".carousel-item vega-grid > div > *"));(i.length!==this.carouselContentElements.length||s.length>0)&&(this.carouselContentElements=i.concat(s),this.updatePageLayout()),await this.goToPageInternal(t,!1)}wrapChildContentAsCarouselItem(){const t=[],s=this.carouselContentElements;for(let i=0;i<this.totalPages;i++){const e=document.createElement("vega-grid");e.setAttribute("gap",this.spacing),e.setAttribute("column",this.currentItemsPerPage.toString()),e.setAttribute("row","1");for(let t=i*this.currentItemsPerPage;t<s.length&&t<this.currentItemsPerPage*(i+1);t++){const i=document.createElement("div");i.appendChild(s[t]),e.appendChild(i)}const a=document.createElement("div");a.classList.add("carousel-item"),0===i&&a.classList.add("active"),a.appendChild(e),t.push(a)}this.host.replaceChildren(...t)}doSlide(t,s){return new Promise(((i,e)=>{const a=this.host.querySelector(".active"),r=t-1>Array.from(this.host.children).indexOf(a),o=this.host.children[t-1],c=r?"carousel-item-start":"carousel-item-end",d=r?"carousel-item-next":"carousel-item-prev";a&&o?s?(o.classList.add(d),n(o),o.classList.add(c),a.classList.add(c),h((()=>{o.classList.remove(c,d),a.classList.remove("active",c),o.classList.add("active"),i()}),a,600)):(a.classList.remove("active"),n(o),o.classList.add("active"),i()):e("Cannot find active and target item in carousel list")}))}getCarouselItemsPerPage(){const t=c.formatCustom(this.deprecatedPropertySlimmer.getValue());return t?Math.max(1,Math.min(4,t,this.carouselContentElements.length)):1}get host(){return a(this)}static get watchers(){return{page:["watchPage"],perPage:["watchPerPage"],itemsPerPage:["watchItemsPerPage"],spacing:["onSpacingPropsChange"]}}};P([p()],j.prototype,"globalSlimmers",void 0),P([d()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),P([d()],j.prototype,"pageResizeObserverSlimmer",void 0),P([d()],j.prototype,"pageUpdateEventEmitter",void 0),P([d()],j.prototype,"deprecatedPropertySlimmer",void 0),j.style=":host{display:block}:host .vega-carousel-indicators-container{display:flex;justify-content:center;align-items:center;margin-top:24px}:host .vega-carousel-indicators-container>div{border-radius:9999px;width:16px;height:16px;border-width:2px;border-style:solid;margin-right:24px;cursor:pointer;border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div:focus{border:2px solid rgba(var(--v-border-secondary-btn-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));box-shadow:0 0 0 4px rgba(var(--v-ring-action-focus, 19, 98, 226, 0.25))}:host .vega-carousel-indicators-container>div:hover{border:2px solid rgba(var(--v-border-secondary-btn-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host .vega-carousel-indicators-container>div.vega-carousel-indicator-active{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div.vega-carousel-indicator-active:hover{border:2px solid rgba(var(--v-border-secondary-btn, 19, 98, 226, 1))}:host .vega-carousel-indicators-container>div:last-child{margin-right:0px}:host .carousel-inner{position:relative;width:100%;overflow:hidden}:host .carousel-inner.carousel-stop-swipe{pointer-events:none}:host ::slotted(.carousel-item){width:100%;position:relative;display:none;float:left;transition:transform 0.6s ease;margin-right:-100%}:host ::slotted(.carousel-item.active),:host ::slotted(.carousel-item-next),:host ::slotted(.carousel-item-prev){display:block}:host ::slotted(.carousel-item-next:not(.carousel-item-start)),:host ::slotted(.active.carousel-item-end){transform:translateX(100%)}:host ::slotted(.carousel-item-prev:not(.carousel-item-end)),:host ::slotted(.active.carousel-item-start){transform:translateX(-100%)}";export{j as vega_carousel}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,H as n,g as a}from"./p-9777b1c1.js";import{s}from"./p-b81bd0bb.js";import{n as o,c as r}from"./p-344ee7cb.js";import{D as g}from"./p-0fd9f03f.js";import{k as h,q as p,e as l,a as c,x as f}from"./p-9e70473b.js";import{a as m}from"./p-320642bd.js";import{C as v}from"./p-6ff07396.js";import{c as d}from"./p-d942a746.js";import{I as u}from"./p-018d77cc.js";import{V as x,I as w}from"./p-
|
|
1
|
+
import{h as e,r as t,c as i,H as n,g as a}from"./p-9777b1c1.js";import{s}from"./p-b81bd0bb.js";import{n as o,c as r}from"./p-344ee7cb.js";import{D as g}from"./p-0fd9f03f.js";import{k as h,q as p,e as l,a as c,x as f}from"./p-9e70473b.js";import{a as m}from"./p-320642bd.js";import{C as v}from"./p-6ff07396.js";import{c as d}from"./p-d942a746.js";import{I as u}from"./p-018d77cc.js";import{V as x,I as w}from"./p-210737f2.js";import"./p-bf95b189.js";import"./p-1fe9e4b3.js";import"./p-d3f1d3dd.js";const b=({pageSize:t,current:i,total:n})=>{const a=n>0?t*(i-1)+1:0,s=Math.min(i*t,n);return e("vega-field-label",{label:`Viewing ${a}-${s} of ${n}`})},y=({onChange:t,pageCount:i})=>{let n;const a=()=>{if(n.value){const e=o(r(n.value,1),1,i);t(e),n.value=""}},s=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:"Go To"}),e("vega-form",{ref:e=>{g.addUniqueObserverToNode(e,h,a)}},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:s,onChange:s,ref:e=>{n=e,g.addUniqueObserverToNode(e,p,a)}})))},z=({pageSize:t,pageSizeSelectorOptions:i,onChange:n})=>{const a=i.sort(((e,t)=>e-t)),s=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:"Show"}),e("div",null,e("vega-input-select",{size:"small",source:a.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:{matchTargetWidth:!1,searchable:!1},ref:e=>{g.addUniqueObserverToNode(e,l,s)}})))},C=({total:t,current:i,onChange:n,pageCount:a})=>{const s=t=>{const a=i!==t;return e("li",{key:t,class:m(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>a&&n(t)},t))},o=(t,i,n)=>e("li",{class:m(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{g.addUniqueObserverToNode(e,c,n)}}));return e("ul",{class:"vega-pagination"},o("chevron-left",0===t||1===i,(()=>{n(i-1)})),0===t?[s(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 n=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),a=new Array(i);for(let e=0;e<i;e+=1)a[e]=e+n;return a[0]>1&&(a[0]=1,a[1]="..."),a[a.length-1]<=t-1&&(a[a.length-1]=t,a[a.length-2]="..."),a})(i,a).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):s(t))),o("chevron-right",0===t||i===a,(()=>{n(i+1)})))};var S=function(e,t,i,n){var a,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(o=(s<3?a(o):s>3?a(t,i,o):a(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o};const j=class{constructor(n){t(this,n),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.childEventPrevent=new v([h],(()=>this.host)),this.childValueChangePrevent=new v([l],(()=>this.host),!0),this.vegaChangeEventEmitter=d(j,l),this.vegaPageSizeChangeEventEmitter=d(j,f),this.vegaComponentUsageRuntimeMetricsSlimmer=new x,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo"],this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=[["pageSelector"]],this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:"size-24",alignItems:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(b,{total:this.total,current:this.current,pageSize:this.pageSize});case"pageSizeSelector":return e(z,{pageSize:this.pageSize,pageSizeSelectorOptions:this.pageSizeSelectorOptions,onChange:this.onPageSizeSelectorChange});case"pageSelector":return e(C,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(y,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e,this.vegaPageSizeChangeEventEmitter.emit(this.pageSize)},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,n)=>{const a=t.indexOf(i);return a>=0?(t.splice(a,1),!0):(e.splice(n,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)}}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchPageSize(){this.pageCount=this.calculatePages()}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){return s(e(n,null,this.removeDuplicateItems(this.extensions).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return a(this)}static get watchers(){return{pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchPageSize"],pageSize:["watchPageSize"]}}};S([w()],j.prototype,"globalSlimmers",void 0),S([u()],j.prototype,"childEventPrevent",void 0),S([u()],j.prototype,"childValueChangePrevent",void 0),S([u()],j.prototype,"vegaChangeEventEmitter",void 0),S([u()],j.prototype,"vegaPageSizeChangeEventEmitter",void 0),S([u()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),j.style=':host{display:flex;align-items:center;justify-content:space-between;gap:20px;line-height:normal}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{box-shadow:0 0 0 4px rgba(var(--v-ring-action-focus, 19, 98, 226, 0.25));border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{j as vega_pagination}
|