@cupra/ui-kit 2.0.0-canary.100 → 2.0.0-canary.102
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/components/ds-accordion/ds-accordion.cjs +1 -1
- package/dist/cjs/components/ds-button/ds-button.cjs +13 -13
- package/dist/cjs/components/ds-calendar/ds-calendar.cjs +9 -5
- package/dist/cjs/components/ds-calendar/styles/common.styles.cjs +4 -0
- package/dist/cjs/components/ds-calendar-day/ds-calendar-day.cjs +1 -0
- package/dist/cjs/components/ds-checkbox/ds-checkbox.cjs +3 -2
- package/dist/cjs/components/ds-chip/ds-chip.cjs +4 -4
- package/dist/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
- package/dist/cjs/components/ds-drawer/ds-drawer.cjs +1 -1
- package/dist/cjs/components/ds-list-item/ds-list-item.cjs +1 -1
- package/dist/cjs/components/ds-radio-button/ds-radio-button.cjs +2 -2
- package/dist/cjs/components/ds-secondary-navigation/ds-secondary-navigation.cjs +3 -1
- package/dist/cjs/components/ds-select/ds-select.cjs +2 -2
- package/dist/cjs/components/ds-slider/ds-slider.cjs +2 -2
- package/dist/cjs/components/ds-static-box/ds-static-box.cjs +1 -1
- package/dist/cjs/components/ds-tabs/ds-tabs.cjs +1 -1
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +1 -1
- package/dist/cjs/components/ds-tooltip/ds-tooltip.cjs +3 -3
- package/dist/cjs/mixins/inputStatesMixin.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/arrayConverter.cjs +1 -1
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/esm/components/ds-accordion/ds-accordion.js +2 -4
- package/dist/esm/components/ds-button/ds-button.js +50 -51
- package/dist/esm/components/ds-calendar/ds-calendar.js +33 -26
- package/dist/esm/components/ds-calendar/styles/common.styles.js +4 -0
- package/dist/esm/components/ds-calendar-day/ds-calendar-day.js +1 -0
- package/dist/esm/components/ds-checkbox/ds-checkbox.js +6 -2
- package/dist/esm/components/ds-chip/ds-chip.js +23 -25
- package/dist/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +9 -5
- package/dist/esm/components/ds-drawer/ds-drawer.js +1 -1
- package/dist/esm/components/ds-list-item/ds-list-item.js +1 -1
- package/dist/esm/components/ds-radio-button/ds-radio-button.js +2 -2
- package/dist/esm/components/ds-secondary-navigation/ds-secondary-navigation.js +3 -1
- package/dist/esm/components/ds-select/ds-select.js +2 -2
- package/dist/esm/components/ds-slider/ds-slider.js +7 -4
- package/dist/esm/components/ds-static-box/ds-static-box.js +1 -1
- package/dist/esm/components/ds-tabs/ds-tabs.js +1 -1
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/components/ds-toggle-switch/ds-toggle-switch.js +4 -4
- package/dist/esm/components/ds-tooltip/ds-tooltip.js +3 -3
- package/dist/esm/mixins/inputStatesMixin.js +5 -2
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/arrayConverter.js +2 -3
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/types/components/ds-button/ds-button.d.ts +2 -2
- package/dist/types/components/ds-calendar/ds-calendar.d.ts +6 -4
- package/dist/types/components/ds-calendar/ds-calendar.types.d.ts +2 -13
- package/dist/types/components/ds-checkbox/ds-checkbox.d.ts +1 -0
- package/dist/types/components/ds-chip/ds-chip.d.ts +2 -3
- package/dist/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +3 -2
- package/dist/types/components/ds-slider/ds-slider.d.ts +3 -1
- package/dist/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +2 -2
- package/dist/types/utils/arrayConverter.d.ts +1 -1
- package/dist-react/cjs/components/ds-accordion/ds-accordion.cjs +1 -1
- package/dist-react/cjs/components/ds-button/ds-button.cjs +13 -13
- package/dist-react/cjs/components/ds-calendar/ds-calendar.cjs +9 -5
- package/dist-react/cjs/components/ds-calendar/styles/common.styles.cjs +4 -0
- package/dist-react/cjs/components/ds-calendar-day/ds-calendar-day.cjs +1 -0
- package/dist-react/cjs/components/ds-checkbox/ds-checkbox.cjs +3 -2
- package/dist-react/cjs/components/ds-chip/ds-chip.cjs +4 -4
- package/dist-react/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
- package/dist-react/cjs/components/ds-drawer/ds-drawer.cjs +1 -1
- package/dist-react/cjs/components/ds-list-item/ds-list-item.cjs +1 -1
- package/dist-react/cjs/components/ds-radio-button/ds-radio-button.cjs +2 -2
- package/dist-react/cjs/components/ds-secondary-navigation/ds-secondary-navigation.cjs +3 -1
- package/dist-react/cjs/components/ds-select/ds-select.cjs +2 -2
- package/dist-react/cjs/components/ds-slider/ds-slider.cjs +2 -2
- package/dist-react/cjs/components/ds-static-box/ds-static-box.cjs +1 -1
- package/dist-react/cjs/components/ds-tabs/ds-tabs.cjs +1 -1
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +1 -1
- package/dist-react/cjs/components/ds-tooltip/ds-tooltip.cjs +3 -3
- package/dist-react/cjs/mixins/inputStatesMixin.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/arrayConverter.cjs +1 -1
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/esm/components/ds-accordion/ds-accordion.js +2 -4
- package/dist-react/esm/components/ds-button/ds-button.js +50 -51
- package/dist-react/esm/components/ds-calendar/ds-calendar.js +33 -26
- package/dist-react/esm/components/ds-calendar/styles/common.styles.js +4 -0
- package/dist-react/esm/components/ds-calendar-day/ds-calendar-day.js +1 -0
- package/dist-react/esm/components/ds-checkbox/ds-checkbox.js +6 -2
- package/dist-react/esm/components/ds-chip/ds-chip.js +23 -25
- package/dist-react/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +9 -5
- package/dist-react/esm/components/ds-drawer/ds-drawer.js +1 -1
- package/dist-react/esm/components/ds-list-item/ds-list-item.js +1 -1
- package/dist-react/esm/components/ds-radio-button/ds-radio-button.js +2 -2
- package/dist-react/esm/components/ds-secondary-navigation/ds-secondary-navigation.js +3 -1
- package/dist-react/esm/components/ds-select/ds-select.js +2 -2
- package/dist-react/esm/components/ds-slider/ds-slider.js +7 -4
- package/dist-react/esm/components/ds-static-box/ds-static-box.js +1 -1
- package/dist-react/esm/components/ds-tabs/ds-tabs.js +1 -1
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/components/ds-toggle-switch/ds-toggle-switch.js +4 -4
- package/dist-react/esm/components/ds-tooltip/ds-tooltip.js +3 -3
- package/dist-react/esm/mixins/inputStatesMixin.js +5 -2
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/arrayConverter.js +2 -3
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/types/components/ds-button/ds-button.d.ts +2 -2
- package/dist-react/types/components/ds-calendar/ds-calendar.d.ts +6 -4
- package/dist-react/types/components/ds-calendar/ds-calendar.types.d.ts +2 -13
- package/dist-react/types/components/ds-checkbox/ds-checkbox.d.ts +1 -0
- package/dist-react/types/components/ds-chip/ds-chip.d.ts +2 -3
- package/dist-react/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +3 -2
- package/dist-react/types/components/ds-slider/ds-slider.d.ts +3 -1
- package/dist-react/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +2 -2
- package/dist-react/types/utils/arrayConverter.d.ts +1 -1
- package/package.json +17 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`),r=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs`),i=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const a=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),o=require(`../base/UiKitElement.cjs`),s=require(`../../decorators/customUiKitElement.cjs`),c=require(`../../utils/booleanConverter.cjs`),l=require(`../../utils/htmlWithTokens.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const d=require(`../../utils/debounce.cjs`),f=require(`../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs`),p=require(`./styles/common.styles.cjs`);var m=class extends o.UiKitElement{constructor(...e){super(...e),this.mode=`light`,this.show=!1,this.disableHoverListener=!1,this.disableFocusListener=!1,this.disablePressListener=!1,this.tooltipId=`ds-tooltip-${Date.now()}-${Math.floor(Math.random()*1e6)}`,this.usingKeyboard=!1,this.handleKeyDown=()=>{this.usingKeyboard=!0},this.handlePointerDown=()=>{this.usingKeyboard=!1},this.handleTooltipPointerDown=e=>{e.stopImmediatePropagation()},this.handleResize=d.debounce({func:()=>this.requestUpdate()}),this.handleClose=()=>{this.show=!1},this.handleAnchorPointerDown=e=>{this.disablePressListener||e.button===0&&(this.show=!this.show)},this.handleAnchorMouseOver=()=>{this.disableHoverListener||(this.show=!0)},this.handleAnchorMouseOut=()=>{this.disableHoverListener||setTimeout(()=>{!this.container?.matches?.(`:hover`)&&!this.arrow?.matches?.(`:hover`)&&!this?.matches?.(`:hover`)&&(this.show=!1)},150)},this.handleAnchorFocusIn=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!0))},this.handleAnchorFocusOut=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!1))},this.handlePressOutside=e=>{if(this.disablePressListener||e.button!==0)return;let t=e.target;t===this||this.contains(t)||this.shadowRoot?.contains(t)||this.anchorElements[0]===t||this.anchorElements[0].contains(t)||(this.show=!1)}}static{this.styles=[p.commonStyles]}disconnectedCallback(){super.disconnectedCallback(),this.container?.matches(`:popover-open`)&&this.container.hidePopover(),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`pointerdown`,this.handlePressOutside),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`pointerdown`,this.handlePointerDown)}updated(e){document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`pointerdown`,this.handlePointerDown),this.show&&this.container&&!this.container.matches(`:popover-open`)?this.container.showPopover():!this.show&&this.container?.matches(`:popover-open`)&&this.container.hidePopover(),this.updatePosition(),e.has(`show`)&&(this.show?(window.addEventListener(`resize`,this.handleResize),document.addEventListener(`pointerdown`,this.handlePressOutside)):(window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`pointerdown`,this.handlePressOutside)))}updatePosition(){requestAnimationFrame(()=>{!this.anchorContainer||!this.container||!this.show||!this.anchorElements?.[0]||!(this.anchorContainer instanceof Element)||!(this.container instanceof Element)||!(this.arrow instanceof Element)||(f.computePosition(this.anchorContainer,this.container,{strategy:`fixed`,placement:`bottom-start`,middleware:[f.flip(),f.shift(),f.offset({mainAxis:8,crossAxis:-8}),f.arrow({element:this.arrow}),f.size({apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{maxWidth:`${Math.min(240,e-8)}px`,maxHeight:`${Math.max(0,t-8)}px`})}})]}).then(e=>{let{x:t,y:n,middlewareData:r,placement:i}=e;if(this.tooltopPlacement=i,Object.assign(this.container.style,{left:`${t??0}px`,top:`${n??0}px`}),r.arrow){let{x:e,y:t}=r.arrow;Object.assign(this.arrow.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`})}}),this.requestUpdate())})}get arrowClasses(){return{arrow:!0,[this.mode]:!0,"not-positionable":this?.offsetWidth>this.container?.offsetWidth}}get containerClasses(){return{container:!0,[this.tooltopPlacement]:!!this.tooltopPlacement,[this.mode]:!0}}get headerClasses(){return{"header-container":!0,hidden:this.headerElements?.length===0&&this.closeButtonElements?.length===0}}get contentClasses(){return{"content-container":!0,"ds-scroll":!0,"ds-scroll--size-s":!0,hidden:this.contentElements?.length===0}}get arrowTemplate(){return e.x`
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`),r=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs`),i=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const a=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),o=require(`../base/UiKitElement.cjs`),s=require(`../../decorators/customUiKitElement.cjs`),c=require(`../../utils/booleanConverter.cjs`),l=require(`../../utils/htmlWithTokens.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const d=require(`../../utils/debounce.cjs`),f=require(`../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs`),p=require(`./styles/common.styles.cjs`);var m=class extends o.UiKitElement{constructor(...e){super(...e),this.mode=`light`,this.show=!1,this.disableHoverListener=!1,this.disableFocusListener=!1,this.disablePressListener=!1,this.tooltipId=`ds-tooltip-${Date.now()}-${Math.floor(Math.random()*1e6)}`,this.usingKeyboard=!1,this.handleKeyDown=()=>{this.usingKeyboard=!0},this.handlePointerDown=()=>{this.usingKeyboard=!1},this.handleTooltipPointerDown=e=>{e.stopImmediatePropagation()},this.handleResize=d.debounce({func:()=>this.requestUpdate()}),this.handleClose=()=>{this.show=!1},this.handleAnchorPointerDown=e=>{this.disablePressListener||e.button===0&&(this.show=!this.show)},this.handleAnchorMouseOver=()=>{this.disableHoverListener||(this.show=!0)},this.handleAnchorMouseOut=()=>{this.disableHoverListener||setTimeout(()=>{!this.container?.matches?.(`:hover`)&&!this.arrow?.matches?.(`:hover`)&&!this?.matches?.(`:hover`)&&(this.show=!1)},150)},this.handleAnchorFocusIn=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!0))},this.handleAnchorFocusOut=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!1))},this.handlePressOutside=e=>{if(this.disablePressListener||e.button!==0)return;let t=e.target;t===this||this.contains(t)||this.shadowRoot?.contains(t)||this.anchorElements[0]===t||this.anchorElements[0].contains(t)||(this.show=!1)}}static{this.styles=[p.commonStyles]}disconnectedCallback(){super.disconnectedCallback(),this.container?.matches(`:popover-open`)&&this.container.hidePopover(),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`pointerdown`,this.handlePressOutside),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`pointerdown`,this.handlePointerDown)}updated(e){document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`pointerdown`,this.handlePointerDown),this.show&&this.container?.isConnected&&!this.container.matches(`:popover-open`)?this.container.showPopover():!this.show&&this.container?.isConnected&&this.container.matches(`:popover-open`)&&this.container.hidePopover(),this.updatePosition(),e.has(`show`)&&(this.show?(window.addEventListener(`resize`,this.handleResize),document.addEventListener(`pointerdown`,this.handlePressOutside)):(window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`pointerdown`,this.handlePressOutside)))}updatePosition(){requestAnimationFrame(()=>{!this.anchorContainer||!this.container||!this.show||!this.anchorElements?.[0]||!(this.anchorContainer instanceof Element)||!(this.container instanceof Element)||!(this.arrow instanceof Element)||(f.computePosition(this.anchorContainer,this.container,{strategy:`fixed`,placement:`bottom-start`,middleware:[f.flip(),f.shift(),f.offset({mainAxis:8,crossAxis:-8}),f.arrow({element:this.arrow}),f.size({apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{maxWidth:`${Math.min(240,e-8)}px`,maxHeight:`${Math.max(0,t-8)}px`})}})]}).then(e=>{let{x:t,y:n,middlewareData:r,placement:i}=e;if(this.tooltopPlacement=i,Object.assign(this.container.style,{left:`${t??0}px`,top:`${n??0}px`}),r.arrow){let{x:e,y:t}=r.arrow;Object.assign(this.arrow.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`})}}),this.requestUpdate())})}get arrowClasses(){return{arrow:!0,[this.mode]:!0,"not-positionable":this?.offsetWidth>this.container?.offsetWidth}}get containerClasses(){return{container:!0,[this.tooltopPlacement]:!!this.tooltopPlacement,[this.mode]:!0}}get headerClasses(){return{"header-container":!0,hidden:this.headerElements?.length===0&&this.closeButtonElements?.length===0}}get contentClasses(){return{"content-container":!0,"ds-scroll":!0,"ds-scroll--size-s":!0,hidden:this.contentElements?.length===0}}get arrowTemplate(){return e.x`
|
|
2
2
|
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${u.e(this.arrowClasses)} @mouseout="${this.handleAnchorMouseOut}" aria-hidden="true" focusable="false">
|
|
3
3
|
<path d="M5.77946 4.38048L0.5 9L16 9L11.1427 4.46656C9.88663 3.29419 9.25858 2.708 8.48883 2.69565C7.71909 2.68329 7.07255 3.24902 5.77946 4.38048Z" class="ds-tooltip-arrow-background"/>
|
|
4
4
|
<path d="M0.5 8.5L5.89467 4.11683C7.1398 3.10516 7.76236 2.59933 8.49029 2.6109C9.21822 2.62246 9.8244 3.14782 11.0368 4.19853L16 8.5" stroke-opacity="1" stroke-linecap="round" class="ds-tooltip-arrow-border"/>
|
|
@@ -40,10 +40,10 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
40
40
|
class="anchor"
|
|
41
41
|
tabindex="0"
|
|
42
42
|
role=${this.disablePressListener?e.E:`button`}
|
|
43
|
-
aria-controls=${this.tooltipId}
|
|
43
|
+
aria-controls=${this.disablePressListener?e.E:this.tooltipId}
|
|
44
44
|
aria-expanded=${this.disablePressListener?e.E:String(this.show)}
|
|
45
45
|
aria-describedby=${this.show?this.tooltipId:e.E}
|
|
46
|
-
aria-label
|
|
46
|
+
aria-label=${this.disablePressListener?e.E:`open tooltip`}
|
|
47
47
|
@mouseover="${this.handleAnchorMouseOver}"
|
|
48
48
|
@mouseout="${this.handleAnchorMouseOut}"
|
|
49
49
|
@pointerdown="${this.handleAnchorPointerDown}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=e=>class extends e{constructor(...e){super(...e),this.inputStates={currentValue:``,focus:!1,focusVisible:!1,invalid:!1,filled:!1,disabled:!1,readonly:!1},this.keyboardMode=!1,this._updateStates=()=>{this.
|
|
1
|
+
var e=e=>class extends e{constructor(...e){super(...e),this.inputStates={currentValue:``,focus:!1,focusVisible:!1,invalid:!1,filled:!1,disabled:!1,readonly:!1},this.keyboardMode=!1,this._updateStates=()=>{this._syncInputStates(),this.requestUpdate()},this._handleKeydown=()=>{this.keyboardMode=!0},this._handleMousedown=()=>{this.keyboardMode=!1},this._handlePointerdown=()=>{this.keyboardMode=!1},this._handleFocusIn=e=>{e.target===this.nativeInput&&(this.inputStates.focus=!0,this.inputStates.focusVisible=!!this.keyboardMode,this.requestUpdate())},this._handleFocusOut=()=>{this.inputStates.focus=!1,this.inputStates.focusVisible=!1,this.requestUpdate()}}onInputReady(e){}firstUpdated(e){super.firstUpdated(e),window?.addEventListener(`keydown`,this._handleKeydown),window?.addEventListener(`mousedown`,this._handleMousedown),window?.addEventListener(`pointerdown`,this._handlePointerdown);let t=()=>{let e=this.querySelector(`input`)||this.querySelector(`textarea`)||this.shadowRoot?.querySelector(`input`)||this.shadowRoot?.querySelector(`textarea`);e&&(this.nativeInput=e,this._setupInputObservers(),this.onInputReady(e),this.hostMutationObserver?.disconnect())};t(),this.hostMutationObserver=new MutationObserver(t),this.hostMutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0})}_setupInputObservers(){this.nativeInput.addEventListener(`input`,this._updateStates),this.nativeInput.addEventListener(`focusin`,this._handleFocusIn),this.nativeInput.addEventListener(`focusout`,this._handleFocusOut),this.inputMutationObserver=new MutationObserver(this._updateStates),this.inputMutationObserver.observe(this.nativeInput,{attributes:!0}),this._syncInputStates(),queueMicrotask(()=>this.requestUpdate())}_syncInputStates(){this.inputStates.currentValue=this.nativeInput?.value,this.inputStates.invalid=!this.nativeInput?.validity.valid,this.inputStates.focus=document.activeElement===this.nativeInput,this.inputStates.disabled=this.nativeInput?.disabled,this.inputStates.readonly=this.nativeInput?.readOnly??!1,this.inputStates.filled=this.nativeInput?.value?.length>0}disconnectedCallback(){super.disconnectedCallback(),window?.removeEventListener(`keydown`,this._handleKeydown),window?.removeEventListener(`mousedown`,this._handleMousedown),window?.removeEventListener(`pointerdown`,this._handlePointerdown),this.hostMutationObserver?.disconnect(),this.inputMutationObserver?.disconnect(),this.nativeInput&&(this.nativeInput.removeEventListener(`input`,this._updateStates),this.nativeInput.removeEventListener(`focusin`,this._handleFocusIn),this.nativeInput.removeEventListener(`focusout`,this._handleFocusOut))}};exports.inputStatesMixin=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.102`),i=globalThis,a=i[r];a||(a=new n,Object.defineProperty(i,r,{value:a,writable:!1,configurable:!1,enumerable:!1}));var o=a;exports.iconsManager=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.102`),n=globalThis,r=n[t];r||(r=new e,Object.defineProperty(n,t,{value:r,writable:!1,configurable:!1,enumerable:!1}));var i=r;exports.pubSub=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.102/styles/${n}/components/${t}.css`,i=this.getCachedStyleSheetPromise({url:r});if(i)return i;let a=e(()=>this.fetchStyle({url:r})).then(e=>(e||this.stylePromises.delete(r),e));return this.stylePromises.set(r,a),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>`u`)return;let t=await fetch(e,{cache:`force-cache`});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return t.instance||=new t,t.instance}}.getInstance();exports.stylesRegistry=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={fromAttribute(e){if(!e)return[];try{let t=JSON.parse(e);
|
|
1
|
+
var e={fromAttribute(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{return e.split(`,`).map(e=>e.trim()).filter(Boolean)}},toAttribute(e){return JSON.stringify(e)}};exports.arrayConverter=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-102`))}`}exports.cssWithTokens=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-102`))}`}exports.htmlWithTokens=n;
|
|
@@ -43,8 +43,7 @@ var f = class extends a {
|
|
|
43
43
|
let t = s[this.theme]?.["icon-names"];
|
|
44
44
|
return this.componentFactory.createIcon({
|
|
45
45
|
class: "icon open-icon",
|
|
46
|
-
role: "
|
|
47
|
-
"aria-hidden": "true",
|
|
46
|
+
role: "presentation",
|
|
48
47
|
"icon-name": t?.open || "minus"
|
|
49
48
|
});
|
|
50
49
|
}
|
|
@@ -53,8 +52,7 @@ var f = class extends a {
|
|
|
53
52
|
let t = s[this.theme]?.["icon-names"];
|
|
54
53
|
return this.componentFactory.createIcon({
|
|
55
54
|
class: "icon close-icon",
|
|
56
|
-
role: "
|
|
57
|
-
"aria-hidden": "true",
|
|
55
|
+
role: "presentation",
|
|
58
56
|
"icon-name": t?.close || "plus"
|
|
59
57
|
});
|
|
60
58
|
}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { E as e, x as t } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
2
2
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
import { n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
4
|
-
import { r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
5
4
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
|
|
6
|
-
import { __decorate as
|
|
7
|
-
import { UiKitElement as
|
|
8
|
-
import { customUiKitElement as
|
|
9
|
-
import { booleanConverter as
|
|
10
|
-
import { htmlWithTokens as
|
|
11
|
-
import { e as
|
|
5
|
+
import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
6
|
+
import { UiKitElement as i } from "../base/UiKitElement.js";
|
|
7
|
+
import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
|
|
8
|
+
import { booleanConverter as o } from "../../utils/booleanConverter.js";
|
|
9
|
+
import { htmlWithTokens as s } from "../../utils/htmlWithTokens.js";
|
|
10
|
+
import { e as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
12
11
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
13
|
-
import { ViewportMixin as
|
|
14
|
-
import { objectConverter as
|
|
15
|
-
import { r as
|
|
16
|
-
import { n as
|
|
17
|
-
import { buttonStyles as
|
|
12
|
+
import { ViewportMixin as l } from "../../mixins/ViewportMixin.js";
|
|
13
|
+
import { objectConverter as u } from "../../utils/objectConverter.js";
|
|
14
|
+
import { r as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js";
|
|
15
|
+
import { n as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
16
|
+
import { buttonStyles as p, loadingDotsStyles as m, textStyles as h } from "./styles/common.styles.js";
|
|
18
17
|
//#region src/components/ds-button/ds-button.ts
|
|
19
|
-
var
|
|
18
|
+
var g = class extends l(i) {
|
|
20
19
|
constructor(...e) {
|
|
21
20
|
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1;
|
|
22
21
|
}
|
|
23
22
|
static {
|
|
24
23
|
this.styles = [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
p,
|
|
25
|
+
h,
|
|
26
|
+
m
|
|
28
27
|
];
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
this.closestForm = this.closest("form");
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
super.connectedCallback(), this.closestForm = this.closest("form");
|
|
32
31
|
}
|
|
33
32
|
get classes() {
|
|
34
33
|
let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
@@ -73,7 +72,7 @@ var _ = class extends u(a) {
|
|
|
73
72
|
return this.loading && this.textLoading ? t`${this.textLoading}` : t`<slot></slot>`;
|
|
74
73
|
}
|
|
75
74
|
get cssTokens() {
|
|
76
|
-
return
|
|
75
|
+
return s`
|
|
77
76
|
<style>
|
|
78
77
|
:host{
|
|
79
78
|
color-scheme: ${this.mode};
|
|
@@ -88,9 +87,9 @@ var _ = class extends u(a) {
|
|
|
88
87
|
render() {
|
|
89
88
|
return t`
|
|
90
89
|
${this.cssTokens}
|
|
91
|
-
${
|
|
90
|
+
${d(this.htmlTagName || "button", [
|
|
92
91
|
["button", () => t`
|
|
93
|
-
<div class=${
|
|
92
|
+
<div class=${c(this.classes)}>
|
|
94
93
|
<button
|
|
95
94
|
class="inner"
|
|
96
95
|
aria-label=${this.textContent?.replace(/^\s+|\s+$/g, "")}
|
|
@@ -98,17 +97,17 @@ var _ = class extends u(a) {
|
|
|
98
97
|
@click=${this.handleClick}
|
|
99
98
|
?disabled=${this.disabled}
|
|
100
99
|
>
|
|
101
|
-
${
|
|
100
|
+
${f(this.iconPosition === "left", () => t` ${this.iconTemplate} `)}
|
|
102
101
|
<span class="container">
|
|
103
102
|
${this.contentTemplate}
|
|
104
103
|
${this.loadingTemplate}
|
|
105
104
|
</span>
|
|
106
|
-
${
|
|
105
|
+
${f(this.iconPosition === "right", () => t` ${this.iconTemplate} `)}
|
|
107
106
|
</button>
|
|
108
107
|
</div>
|
|
109
108
|
`],
|
|
110
109
|
["a", () => t`
|
|
111
|
-
<div class=${
|
|
110
|
+
<div class=${c(this.classes)}>
|
|
112
111
|
<a
|
|
113
112
|
class="inner"
|
|
114
113
|
aria-label=${this.textContent?.replace(/^\s+|\s+$/g, "")}
|
|
@@ -117,69 +116,69 @@ var _ = class extends u(a) {
|
|
|
117
116
|
target=${this.target}
|
|
118
117
|
@click=${this.handleClick}
|
|
119
118
|
>
|
|
120
|
-
${
|
|
119
|
+
${f(this.iconPosition === "left", () => t`${this.iconTemplate}`)}
|
|
121
120
|
<span class="container">
|
|
122
121
|
${this.contentTemplate}
|
|
123
122
|
${this.loadingTemplate}
|
|
124
123
|
</span>
|
|
125
|
-
${
|
|
124
|
+
${f(this.iconPosition === "right", () => t`${this.iconTemplate}`)}
|
|
126
125
|
</a>
|
|
127
126
|
</div>
|
|
128
127
|
`],
|
|
129
128
|
["custom", () => t`
|
|
130
|
-
<div class=${
|
|
131
|
-
${
|
|
129
|
+
<div class=${c(this.classes)}>
|
|
130
|
+
${f(this.iconPosition === "left", () => t`${this.iconTemplate}`)}
|
|
132
131
|
${this.loading && this.textLoading ? t`<span class="container">${this.textLoading}${this.loadingTemplate}</span>` : t`<slot></slot>${this.loadingTemplate}`}
|
|
133
|
-
${
|
|
132
|
+
${f(this.iconPosition === "right", () => t`${this.iconTemplate}`)}
|
|
134
133
|
</div>
|
|
135
134
|
`]
|
|
136
135
|
])}
|
|
137
136
|
`;
|
|
138
137
|
}
|
|
139
138
|
};
|
|
140
|
-
|
|
139
|
+
r([n({ type: String })], g.prototype, "variant", void 0), r([n({
|
|
141
140
|
type: String,
|
|
142
141
|
reflect: !0
|
|
143
|
-
})],
|
|
142
|
+
})], g.prototype, "mode", void 0), r([n({
|
|
144
143
|
type: String,
|
|
145
|
-
converter:
|
|
146
|
-
})],
|
|
144
|
+
converter: u
|
|
145
|
+
})], g.prototype, "size", void 0), r([n({
|
|
147
146
|
type: Boolean,
|
|
148
|
-
converter:
|
|
149
|
-
})],
|
|
147
|
+
converter: o
|
|
148
|
+
})], g.prototype, "disabled", void 0), r([n({
|
|
150
149
|
type: Boolean,
|
|
151
|
-
converter:
|
|
152
|
-
})],
|
|
150
|
+
converter: o
|
|
151
|
+
})], g.prototype, "destructive", void 0), r([n({
|
|
153
152
|
type: String,
|
|
154
153
|
attribute: "icon-name"
|
|
155
|
-
})],
|
|
154
|
+
})], g.prototype, "iconName", void 0), r([n({
|
|
156
155
|
type: String,
|
|
157
156
|
attribute: "html-tag-name"
|
|
158
|
-
})],
|
|
157
|
+
})], g.prototype, "htmlTagName", void 0), r([n({
|
|
159
158
|
type: String,
|
|
160
159
|
reflect: !0
|
|
161
|
-
})],
|
|
160
|
+
})], g.prototype, "href", void 0), r([n({
|
|
162
161
|
type: String,
|
|
163
162
|
reflect: !0
|
|
164
|
-
})],
|
|
163
|
+
})], g.prototype, "rel", void 0), r([n({
|
|
165
164
|
type: String,
|
|
166
165
|
reflect: !0
|
|
167
|
-
})],
|
|
166
|
+
})], g.prototype, "target", void 0), r([n({ type: String })], g.prototype, "type", void 0), r([n({
|
|
168
167
|
type: String,
|
|
169
168
|
attribute: "icon-position"
|
|
170
|
-
})],
|
|
169
|
+
})], g.prototype, "iconPosition", void 0), r([n({
|
|
171
170
|
type: Boolean,
|
|
172
|
-
converter:
|
|
173
|
-
})],
|
|
171
|
+
converter: o
|
|
172
|
+
})], g.prototype, "rounded", void 0), r([n({
|
|
174
173
|
type: Boolean,
|
|
175
|
-
converter:
|
|
174
|
+
converter: o,
|
|
176
175
|
attribute: "full-width"
|
|
177
|
-
})],
|
|
176
|
+
})], g.prototype, "fullWidth", void 0), r([n({
|
|
178
177
|
type: Boolean,
|
|
179
|
-
converter:
|
|
180
|
-
})],
|
|
178
|
+
converter: o
|
|
179
|
+
})], g.prototype, "loading", void 0), r([n({
|
|
181
180
|
type: String,
|
|
182
181
|
attribute: "text-loading"
|
|
183
|
-
})],
|
|
182
|
+
})], g.prototype, "textLoading", void 0), g = r([a("ds-button")], g);
|
|
184
183
|
//#endregion
|
|
185
|
-
export {
|
|
184
|
+
export { g as DsButton };
|
|
@@ -9,14 +9,15 @@ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js"
|
|
|
9
9
|
import { e as o } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
10
10
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
11
11
|
import "../ds-calendar-day/ds-calendar-day.js";
|
|
12
|
-
import {
|
|
12
|
+
import { arrayConverter as s } from "../../utils/arrayConverter.js";
|
|
13
|
+
import { commonStyles as c } from "./styles/common.styles.js";
|
|
13
14
|
//#region src/components/ds-calendar/ds-calendar.ts
|
|
14
|
-
var
|
|
15
|
+
var l = class extends i {
|
|
15
16
|
constructor(...e) {
|
|
16
|
-
super(...e), this.variant = "plane", this.size = "large", this.locale = "en-US", this.firstDayOfWeek = 1, this.disabledDates = [], this.disabledWeekdays = [], this._viewDate = /* @__PURE__ */ new Date(), this._value = null, this._initialValueApplied = !1;
|
|
17
|
+
super(...e), this.variant = "plane", this.size = "large", this.locale = "en-US", this.firstDayOfWeek = 1, this.disabledDates = [], this.disabledWeekdays = [], this._viewDate = /* @__PURE__ */ new Date(), this._value = null, this._initialValueApplied = !1, this._viewDateInitialized = !1;
|
|
17
18
|
}
|
|
18
19
|
static {
|
|
19
|
-
this.styles = [
|
|
20
|
+
this.styles = [c];
|
|
20
21
|
}
|
|
21
22
|
get selectedDate() {
|
|
22
23
|
if (this.value) {
|
|
@@ -29,10 +30,10 @@ var c = class extends i {
|
|
|
29
30
|
return this._viewDate;
|
|
30
31
|
}
|
|
31
32
|
connectedCallback() {
|
|
32
|
-
super.connectedCallback(), this.applyInitialValue()
|
|
33
|
+
super.connectedCallback(), this.applyInitialValue();
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
super.
|
|
35
|
+
willUpdate(e) {
|
|
36
|
+
super.willUpdate(e), (!this._viewDateInitialized || e.has("value") || e.has("viewDateAttr")) && (this._viewDateInitialized = !0, this.initializeViewDate());
|
|
36
37
|
}
|
|
37
38
|
applyInitialValue() {
|
|
38
39
|
if (!this._initialValueApplied && (this._initialValueApplied = !0, this.initialValue)) {
|
|
@@ -133,10 +134,10 @@ var c = class extends i {
|
|
|
133
134
|
}
|
|
134
135
|
if (this.disabledWeekdays && this.disabledWeekdays.length > 0) {
|
|
135
136
|
let t = e.getDay();
|
|
136
|
-
if (this.disabledWeekdays.
|
|
137
|
+
if (this.disabledWeekdays.some((e) => Number(e) === t)) return !0;
|
|
137
138
|
}
|
|
138
139
|
if (this.disabledDates && this.disabledDates.length > 0) {
|
|
139
|
-
let t = e.
|
|
140
|
+
let t = `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
140
141
|
if (this.disabledDates.includes(t)) return !0;
|
|
141
142
|
}
|
|
142
143
|
return !1;
|
|
@@ -201,9 +202,13 @@ var c = class extends i {
|
|
|
201
202
|
`;
|
|
202
203
|
}
|
|
203
204
|
get daysTemplate() {
|
|
205
|
+
let t = this.calendarDays, n = [];
|
|
206
|
+
for (let e = 0; e < t.length; e += 7) n.push(t.slice(e, e + 7));
|
|
204
207
|
return e`
|
|
205
|
-
<div class="days-grid" @ds-calendar-day-change=${this.handleDayChange}>
|
|
206
|
-
${
|
|
208
|
+
<div class="days-grid" role="grid" @ds-calendar-day-change=${this.handleDayChange}>
|
|
209
|
+
${n.map((t) => e`
|
|
210
|
+
<div class="days-row" role="row">
|
|
211
|
+
${t.map((e) => this.componentFactory.createCalendarDay({
|
|
207
212
|
day: e.day,
|
|
208
213
|
size: this.size,
|
|
209
214
|
disabled: e.isDisabled,
|
|
@@ -211,6 +216,8 @@ var c = class extends i {
|
|
|
211
216
|
today: e.isToday,
|
|
212
217
|
"outside-month": !e.isCurrentMonth
|
|
213
218
|
}))}
|
|
219
|
+
</div>
|
|
220
|
+
`)}
|
|
214
221
|
</div>
|
|
215
222
|
`;
|
|
216
223
|
}
|
|
@@ -230,39 +237,39 @@ var c = class extends i {
|
|
|
230
237
|
r([t({
|
|
231
238
|
type: String,
|
|
232
239
|
reflect: !0
|
|
233
|
-
})],
|
|
240
|
+
})], l.prototype, "value", void 0), r([t({
|
|
234
241
|
type: String,
|
|
235
242
|
reflect: !0
|
|
236
|
-
})],
|
|
243
|
+
})], l.prototype, "variant", void 0), r([t({
|
|
237
244
|
type: String,
|
|
238
245
|
reflect: !0
|
|
239
|
-
})],
|
|
246
|
+
})], l.prototype, "size", void 0), r([t({
|
|
240
247
|
type: String,
|
|
241
248
|
reflect: !0
|
|
242
|
-
})],
|
|
249
|
+
})], l.prototype, "locale", void 0), r([t({
|
|
243
250
|
type: Number,
|
|
244
251
|
reflect: !0,
|
|
245
252
|
attribute: "first-day-of-week"
|
|
246
|
-
})],
|
|
253
|
+
})], l.prototype, "firstDayOfWeek", void 0), r([t({
|
|
247
254
|
type: String,
|
|
248
255
|
reflect: !0,
|
|
249
256
|
attribute: "min-date"
|
|
250
|
-
})],
|
|
257
|
+
})], l.prototype, "minDate", void 0), r([t({
|
|
251
258
|
type: String,
|
|
252
259
|
reflect: !0,
|
|
253
260
|
attribute: "max-date"
|
|
254
|
-
})],
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
})],
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
})],
|
|
261
|
+
})], l.prototype, "maxDate", void 0), r([t({
|
|
262
|
+
attribute: "disabled-dates",
|
|
263
|
+
converter: s
|
|
264
|
+
})], l.prototype, "disabledDates", void 0), r([t({
|
|
265
|
+
attribute: "disabled-weekdays",
|
|
266
|
+
converter: s
|
|
267
|
+
})], l.prototype, "disabledWeekdays", void 0), r([t({
|
|
261
268
|
type: String,
|
|
262
269
|
reflect: !0,
|
|
263
270
|
attribute: "view-date"
|
|
264
|
-
})],
|
|
271
|
+
})], l.prototype, "viewDateAttr", void 0), r([t({
|
|
265
272
|
type: String,
|
|
266
273
|
attribute: "initial-value"
|
|
267
|
-
})],
|
|
274
|
+
})], l.prototype, "initialValue", void 0), r([n()], l.prototype, "_viewDate", void 0), r([n()], l.prototype, "_value", void 0), l = r([a("ds-calendar")], l);
|
|
268
275
|
//#endregion
|
|
@@ -47,6 +47,7 @@ var c = class extends r {
|
|
|
47
47
|
class=${o(this.classes)}
|
|
48
48
|
?disabled=${this.disabled}
|
|
49
49
|
aria-label=${this.day ? `Day ${this.day}` : ""}
|
|
50
|
+
role="gridcell"
|
|
50
51
|
aria-selected=${this.selected}
|
|
51
52
|
aria-current=${this.today ? "date" : "false"}
|
|
52
53
|
tabindex=${this.disabled ? -1 : 0}
|
|
@@ -17,7 +17,7 @@ import { commonStyles as h } from "./styles/common.styles.js";
|
|
|
17
17
|
//#region src/components/ds-checkbox/ds-checkbox.ts
|
|
18
18
|
var g = class extends m(o) {
|
|
19
19
|
constructor(...e) {
|
|
20
|
-
super(...e), this.inputPlacement = "left", this.checked = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1;
|
|
20
|
+
super(...e), this.inputPlacement = "left", this.checked = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1, this.dataAriaLabel = "";
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.styles = [h];
|
|
@@ -128,6 +128,7 @@ var g = class extends m(o) {
|
|
|
128
128
|
type="checkbox"
|
|
129
129
|
name=${this.name}
|
|
130
130
|
value=${this.value}
|
|
131
|
+
aria-label=${this.dataAriaLabel || t}
|
|
131
132
|
?required=${this.required}
|
|
132
133
|
?checked=${this.checked}
|
|
133
134
|
?disabled=${this.disabled}
|
|
@@ -184,5 +185,8 @@ a([r({ type: String })], g.prototype, "name", void 0), a([r({ type: String })],
|
|
|
184
185
|
})], g.prototype, "invalidError", void 0), a([r({
|
|
185
186
|
type: Boolean,
|
|
186
187
|
converter: c
|
|
187
|
-
})], g.prototype, "indeterminate", void 0), a([
|
|
188
|
+
})], g.prototype, "indeterminate", void 0), a([r({
|
|
189
|
+
type: String,
|
|
190
|
+
attribute: "data-aria-label"
|
|
191
|
+
})], g.prototype, "dataAriaLabel", void 0), a([i()], g.prototype, "disabledGroup", void 0), a([i()], g.prototype, "errorGroup", void 0), a([i()], g.prototype, "sizeGroup", void 0), g = a([s("ds-checkbox")], g);
|
|
188
192
|
//#endregion
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import { E as e, x as t } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
2
2
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
import { n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
4
|
-
import { r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
5
4
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
|
|
6
|
-
import { __decorate as
|
|
7
|
-
import { UiKitElement as
|
|
8
|
-
import { customUiKitElement as
|
|
9
|
-
import { booleanConverter as
|
|
10
|
-
import { htmlWithTokens as
|
|
11
|
-
import { e as
|
|
5
|
+
import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
6
|
+
import { UiKitElement as i } from "../base/UiKitElement.js";
|
|
7
|
+
import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
|
|
8
|
+
import { booleanConverter as o } from "../../utils/booleanConverter.js";
|
|
9
|
+
import { htmlWithTokens as s } from "../../utils/htmlWithTokens.js";
|
|
10
|
+
import { e as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
12
11
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
13
|
-
import { commonStyles as
|
|
12
|
+
import { commonStyles as l } from "./styles/common.styles.js";
|
|
14
13
|
//#region src/components/ds-chip/ds-chip.ts
|
|
15
|
-
var
|
|
14
|
+
var u = class extends i {
|
|
16
15
|
constructor(...e) {
|
|
17
|
-
super(...e), this.mode = "light", this.size = "large", this.selected = !1, this.deselectable = !1, this.slottedText = ""
|
|
16
|
+
super(...e), this.mode = "light", this.size = "large", this.selected = !1, this.deselectable = !1, this.slottedText = "", this.handleSlotChange = (e) => {
|
|
17
|
+
this.slottedText = e.target.assignedNodes({ flatten: !0 }).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent.trim()).join(" "), this.requestUpdate();
|
|
18
|
+
};
|
|
18
19
|
}
|
|
19
20
|
static {
|
|
20
|
-
this.styles = [
|
|
21
|
-
}
|
|
22
|
-
firstUpdated(e) {
|
|
23
|
-
super.firstUpdated(e), this.slottedText = this.shadowRoot.querySelector("slot").assignedNodes({ flatten: !0 }).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent.trim()).join(" ");
|
|
21
|
+
this.styles = [l];
|
|
24
22
|
}
|
|
25
23
|
get classes() {
|
|
26
24
|
return {
|
|
@@ -33,7 +31,7 @@ var d = class extends a {
|
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
get styleTokens() {
|
|
36
|
-
return
|
|
34
|
+
return s`
|
|
37
35
|
<style>
|
|
38
36
|
:host{
|
|
39
37
|
color-scheme: ${this.mode};
|
|
@@ -91,32 +89,32 @@ var d = class extends a {
|
|
|
91
89
|
aria-label=${`chip ${this.slottedText}`}
|
|
92
90
|
tabindex="0"
|
|
93
91
|
data-testid="ds-chip-container"
|
|
94
|
-
class=${
|
|
92
|
+
class=${c(this.classes)}
|
|
95
93
|
@click=${this.handleClick}
|
|
96
94
|
@keydown=${this.handleKeyDown}
|
|
97
95
|
>
|
|
98
96
|
${this.leadingIconTemplate}
|
|
99
|
-
<slot></slot>
|
|
97
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
100
98
|
${this.iconTemplate}
|
|
101
99
|
</div>
|
|
102
100
|
`;
|
|
103
101
|
}
|
|
104
102
|
};
|
|
105
|
-
|
|
103
|
+
r([n({ type: String })], u.prototype, "value", void 0), r([n({
|
|
106
104
|
type: String,
|
|
107
105
|
reflect: !0
|
|
108
|
-
})],
|
|
106
|
+
})], u.prototype, "mode", void 0), r([n({
|
|
109
107
|
type: String,
|
|
110
108
|
reflect: !0
|
|
111
|
-
})],
|
|
109
|
+
})], u.prototype, "size", void 0), r([n({
|
|
112
110
|
type: Boolean,
|
|
113
|
-
converter:
|
|
111
|
+
converter: o,
|
|
114
112
|
reflect: !0
|
|
115
|
-
})],
|
|
113
|
+
})], u.prototype, "selected", void 0), r([n({
|
|
116
114
|
type: Boolean,
|
|
117
|
-
converter:
|
|
118
|
-
})],
|
|
115
|
+
converter: o
|
|
116
|
+
})], u.prototype, "deselectable", void 0), r([n({
|
|
119
117
|
type: String,
|
|
120
118
|
attribute: "icon-name"
|
|
121
|
-
})],
|
|
119
|
+
})], u.prototype, "iconName", void 0), u = r([a("ds-chip")], u);
|
|
122
120
|
//#endregion
|
|
@@ -15,15 +15,18 @@ import { commonStyles as d } from "./styles/common.styles.js";
|
|
|
15
15
|
//#region src/components/ds-dialog-fullscreen/ds-dialog-fullscreen.ts
|
|
16
16
|
var f = class extends o {
|
|
17
17
|
constructor(...e) {
|
|
18
|
-
super(...e), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.
|
|
18
|
+
super(...e), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.hasScroll = !1, this.hasBeenOpened = !1, this.debouncedCheckScroll = u({ func: () => this.checkScroll() }), this.handleKeyDown = (e) => {
|
|
19
19
|
this.open && e.key === "Escape" && this.handleClose();
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.styles = [d];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
super.
|
|
25
|
+
willUpdate(e) {
|
|
26
|
+
super.willUpdate(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0);
|
|
27
|
+
}
|
|
28
|
+
updated(e) {
|
|
29
|
+
super.updated(e), e.has("open") && this.handleResizeObserver();
|
|
27
30
|
}
|
|
28
31
|
async handleResizeObserver() {
|
|
29
32
|
this.lockScroll && (document.getElementById("storybook-root") || (document.body.style.overflow = this.open ? "hidden" : "")), this.resizeObserver?.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
|
|
@@ -48,7 +51,8 @@ var f = class extends o {
|
|
|
48
51
|
super.disconnectedCallback(), window.removeEventListener("keydown", this.handleKeyDown), this.lockScroll && (document.getElementById("storybook-root") || (document.body.style.overflow = "")), this.resizeObserver?.disconnect();
|
|
49
52
|
}
|
|
50
53
|
checkScroll() {
|
|
51
|
-
|
|
54
|
+
let e = this.content?.scrollHeight > this.content?.clientHeight;
|
|
55
|
+
e !== this.hasScroll && (this.hasScroll = e);
|
|
52
56
|
}
|
|
53
57
|
render() {
|
|
54
58
|
return !this.hasBeenOpened && !this.open ? e : t`
|
|
@@ -81,5 +85,5 @@ a([n({
|
|
|
81
85
|
})], f.prototype, "lockScroll", void 0), a([n({
|
|
82
86
|
type: Boolean,
|
|
83
87
|
converter: c
|
|
84
|
-
})], f.prototype, "open", void 0), a([r()], f.prototype, "
|
|
88
|
+
})], f.prototype, "open", void 0), a([r()], f.prototype, "hasScroll", void 0), a([i(".content")], f.prototype, "content", void 0), f = a([s("ds-dialog-fullscreen")], f);
|
|
85
89
|
//#endregion
|