-
Notifications
You must be signed in to change notification settings - Fork 0
/
chunk.35.ee3f412c69f09da7e60d.js
29 lines (28 loc) · 16.7 KB
/
chunk.35.ee3f412c69f09da7e60d.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[35],{68:function(e,t,o){"use strict"
o.r(t),o.d(t,"market_list",(function(){return r})),o.d(t,"market_row",(function(){return a}))
var s=o(9),i=o(12)
function l(e){return""===e||null==e}const r=class{constructor(e){Object(s.g)(this,e),this.marketListSelectionsDidChange=Object(s.c)(this,"marketListSelectionsDidChange",7),this.marketListSlotChange=Object(s.c)(this,"marketListSlotChange",7),this.value="",this.interactive=!1,this.transient=!1,this.multiselect=!1,this.selections=new Set}valueWatcher(){this.setSelectionsFromValue()}rowSelectedEventHandler(e){this.handleItemSelectedEvent(e.detail.element)}rowDeselectedEventHandler(e){this.handleItemDeselectedEvent(e.detail.element)}cardSelectedEventHandler(e){this.handleItemSelectedEvent(e.detail.element)}cardDeselectedEventHandler(e){this.handleItemDeselectedEvent(e.detail.element)}handleItemSelectedEvent(e){this.selectItem(e)
const t=[...this.selections].map((e=>e.value)).filter((e=>!l(e)))
this.value=t.join(","),this.marketListSelectionsDidChange.emit({newSelection:e,newSelectionValue:e.value,newDeselection:null,newDeselectionValue:null,currentSelections:[...this.selections],currentSelectionValues:t})}handleItemDeselectedEvent(e){if(this.selections.has(e)){this.selections.delete(e)
const t=[...this.selections].map((e=>e.value)).filter((e=>!l(e)))
this.value=t.join(","),this.marketListSelectionsDidChange.emit({newSelection:null,newSelectionValue:null,newDeselection:e,newDeselectionValue:e.value,currentSelections:[...this.selections],currentSelectionValues:t})}}selectItem(e){this.interactive&&(this.multiselect?this.selections.add(e):(this.deselectItems([e]),this.selections=new Set([e])))}deselectItem(e){this.selections.delete(e)}deselectItems(e){this.items&&this.items.forEach((t=>{!e.includes(t)&&t.selected&&t.deselect()}))}syncListInteractiveWithItems(){this.items.length>0&&(this.items[0].tagName===Object(i.a)("MARKET-ACTION-CARD").toUpperCase()||this.items[0].tagName===Object(i.a)("MARKET-ROW").toUpperCase()&&!0===this.items[0].interactive)&&!this.interactive&&(this.interactive=!0)}processItems(){this.items.forEach((e=>{if(e.tagName===Object(i.a)("MARKET-ACTION-CARD").toUpperCase()){e.transient=this.transient
const t=e.querySelector(Object(i.a)("market-row"))
t&&this.setRowProperties(t)}else this.setRowProperties(e)}))}getCurrentSelectionValues(){return Array.isArray(this.value)?new Set(this.value):new Set(this.multiselect?this.value.split(","):[this.value])}setRowProperties(e){e.interactive=this.interactive,e.transient=this.transient,e.togglable=this.multiselect}setSelectionsFromValue(){var e
if(this.value||""===this.value){const t=this.getCurrentSelectionValues()
null===(e=this.items)||void 0===e||e.forEach((e=>{!l(this.value)&&t.has(e.value)?(e.silentlySelect(),this.selectItem(e)):(e.silentlyDeselect(),this.deselectItem(e))}))}}setSelectionsFromRowAttributes(){const e=new Set
this.items.forEach((t=>{t.selected&&e.add(t)})),this.selections=e}setInternalState(){this.items=this.el.querySelectorAll(`:scope > ${Object(i.a)("market-row")}, :scope > ${Object(i.a)("market-action-card")}`),this.syncListInteractiveWithItems(),this.processItems(),this.items.length>0&&(this.value?this.setSelectionsFromValue():this.setSelectionsFromRowAttributes())}slotChangeHandler(){this.setInternalState(),this.marketListSlotChange.emit()}componentWillLoad(){this.setInternalState()}componentWillRender(){this.syncListInteractiveWithItems(),this.processItems()}handleKeydown(e){switch(e.key){case"ArrowDown":this.handleArrowDown(e)
break
case"ArrowUp":this.handleArrowUp(e)}}handleArrowDown(e){const t=[...this.items].findIndex((e=>e.classList.contains("focus-visible")))
if(-1!==t){for(let e=t+1;e<this.items.length;e++)if(!this.items[e].disabled){this.items[e].focus()
break}e.preventDefault()}}handleArrowUp(e){const t=[...this.items].findIndex((e=>e.classList.contains("focus-visible")))
if(-1!==t){for(let e=t-1;e>=0;e--)if(!this.items[e].disabled){this.items[e].focus()
break}e.preventDefault()}}render(){return Object(s.e)(s.a,{class:"market-list",role:this.interactive?"listbox":"list","aria-labelledby":this.name,"aria-multiselectable":this.multiselect,onKeydown:e=>this.handleKeydown(e)},Object(s.e)("slot",{onSlotchange:()=>this.slotChangeHandler()}))}get el(){return Object(s.d)(this)}static get watchers(){return{value:["valueWatcher"]}}}
r.style=":host,::slotted(*),*{box-sizing:border-box}:host([disabled]){cursor:not-allowed !important}:host([disabled]) *,:host([disabled]) ::slotted(*){cursor:not-allowed !important;pointer-events:none !important}::slotted(.market-action-card){margin-bottom:var(--action-card-spacing)}"
const a=class{constructor(e){Object(s.g)(this,e),this.marketRowSelected=Object(s.c)(this,"marketRowSelected",7),this.marketRowDeselected=Object(s.c)(this,"marketRowDeselected",7),this.selected=!1,this.disabled=!1,this.size="medium",this.interactive=!1,this.transient=!1,this.togglable=!0,this.variant="regular",this.controlPosition="trailing"}selectedChangeHandler(){this.slottedControl&&this.slottedControl.setValue(this.selected)}disabledChangeHandler(){this.slottedControl&&this.slottedControl.setDisabled(this.disabled)}async silentlySelect(){this.selected=!0}async silentlyDeselect(){this.selected=!1}async deselect(){const e={element:this.el,value:this.value}
this.selected=!1,this.marketRowDeselected.emit(e)}async toggle(){this.selected=!this.selected}registerSlottedControl(){this.slottedControl=this.el.querySelector(Object(i.a)("market-checkbox"))||this.el.querySelector(Object(i.a)("market-radio"))||this.el.querySelector(Object(i.a)("market-toggle")),this.slottedControl&&(this.interactive=!0,this.selectedChangeHandler())}connectedCallback(){"drill"===this.variant&&(this.interactive=!0),this.href&&(this.transient=!0)}setControlActive(e){this.slottedControl&&this.slottedControl.setActive(e)}setControlHover(e){this.slottedControl&&this.slottedControl.setHover(e)}handleClick(e){if("A"!==e.target.tagName&&e.target.tagName!==Object(i.a)("MARKET-LINK").toUpperCase()&&this.interactive&&!this.transient){const e={element:this.el,value:this.value}
this.togglable?(this.toggle(),this.selected?this.marketRowSelected.emit(e):this.marketRowDeselected.emit(e)):this.selected||(this.selected=!0,this.marketRowSelected.emit(e))}}handleKeydown(e){if(e.target===this.el)switch(e.key){case"Enter":this.handleClick(e)
break
case" ":this.handleClick(e),e.preventDefault()}}render(){const{interactive:e,disabled:t,href:o,target:i,controlPosition:l,slottedControl:r,selected:a}=this,n=!e||t||o?null:"0",c=void 0===o?"div":"a",d="a"===c?{href:o,target:i}:{},h="leading"===l,m=[r?"has-slotted-control":"",h?"has-leading-control":""].join(" ")
return Object(s.e)(s.a,{role:e?"option":"listitem",tabindex:n,"aria-selected":a,class:"market-row "+m,onMouseDown:()=>this.setControlActive(!0),onMouseUp:()=>this.setControlActive(!1),onMouseEnter:()=>this.setControlHover(!0),onMouseLeave:()=>this.setControlHover(!1),onClick:e=>this.handleClick(e),onKeydown:e=>this.handleKeydown(e)},Object(s.e)(c,Object.assign({part:"container",class:"container"},d),Object(s.e)("slot",{name:"leading-accessory"}),h&&Object(s.e)("slot",{name:"control",onSlotchange:()=>this.registerSlottedControl()}),Object(s.e)("div",{class:"main",part:"main"},Object(s.e)("slot",{name:"label"}),Object(s.e)("slot",{name:"subtext"}),Object(s.e)("slot",null)),Object(s.e)("div",{class:"side",part:"side"},Object(s.e)("slot",{name:"side-label"}),Object(s.e)("slot",{name:"side-subtext"})),Object(s.e)("slot",{name:"trailing-accessory"}),"regular"===this.variant?!h&&Object(s.e)("slot",{name:"control",onSlotchange:()=>this.registerSlottedControl()}):Object(s.e)("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(s.e)("path",{d:"M1 11L6 6L1 1",stroke:"#000","stroke-width":"2","stroke-linejoin":"round"}))))}get el(){return Object(s.d)(this)}static get watchers(){return{selected:["selectedChangeHandler"],disabled:["disabledChangeHandler"]}}}
a.style=":host,::slotted(*),*{box-sizing:border-box}:host([disabled]){cursor:not-allowed !important}:host([disabled]) *,:host([disabled]) ::slotted(*){cursor:not-allowed !important;pointer-events:none !important}:host{--transition-duration:0.2s;position:relative;margin:0 calc(-1 * var(--row-background-horizontal-outset-padding));display:block;background-color:var(--row-normal-state-background-color);transition:background-color var(--transition-duration);position:relative;outline:none}:host([size='small']){min-height:40px;min-height:var(--row-small-size-min-height, 40px);}:host([size='medium']){min-height:56px;min-height:var(--row-medium-size-min-height, 56px);}:host{}:host([role=\"option\"]){cursor:pointer;border-radius:var(--row-focus-ring-radius)}:host([role=\"option\"][selected]:not([disabled]):not(.has-slotted-control)){background-color:var(--row-selected-state-background-color)}@media (hover: hover){:host{}:host([role=\"option\"]:not(.has-leading-control):hover){background-color:var(--row-hover-state-background-color)}}:host([role=\"option\"]:not(.has-leading-control):active),:host([role=\"option\"][selected]:not([disabled]):not(.has-leading-control):active){background-color:var(--row-pressed-state-background-color)}:host([role=\"option\"]:focus){outline:none;}:host([role=\"option\"][selected]:not([disabled]):not(.has-slotted-control):focus){background-color:var(--row-focus-state-background-color)}:host([disabled]){background-color:transparent;color:var(--row-disabled-state-text-color);pointer-events:none}:host{}:host::before{content:'';display:block;position:absolute;left:var(--row-background-horizontal-outset-padding);right:var(--row-background-horizontal-outset-padding);bottom:0;height:var(--row-separator-height);background-color:var(--row-normal-state-separator-color)}:host([role=\"option\"]:hover)::before,:host([role=\"option\"]:active)::before,:host(:last-of-type)::before{content:none}:host{}:host::after{content:'';display:block;position:absolute;content:'';display:block;position:absolute;pointer-events:none;border:var(--row-focus-ring-border-size) solid var(--row-focus-ring-color);opacity:0;transition:opacity 0.2s;border-radius:calc(var(--row-focus-ring-radius) + var(--row-focus-ring-buffer-size) * 2);--focus-ring-position:calc(-1 * (var(--row-focus-ring-border-size) + var(--row-focus-ring-buffer-size) + var(--row-focus-ring-border-size)));top:var(--focus-ring-position);right:var(--focus-ring-position);bottom:var(--focus-ring-position);left:var(--focus-ring-position);top:0;right:0;bottom:0;left:0}:host(.focus-visible)::after{opacity:0.5}.container{display:flex;justify-content:space-between;align-items:center;grid-column-gap:var(--row-horizontal-spacing);-moz-column-gap:var(--row-horizontal-spacing);column-gap:var(--row-horizontal-spacing);text-decoration:none;outline:none}:host([size='small']) .container{padding:var(--row-small-size-vertical-padding) var(--row-horizontal-spacing)}:host([size='medium']) .container{padding:var(--row-medium-size-vertical-padding) var(--row-horizontal-spacing)}:host([slot=\"displayed-selection\"]) .container{padding:0;min-height:var(--field-input-leading)}.main{flex-grow:2;min-width:0}.side{text-align:right}::slotted(*){cursor:inherit}::slotted([slot='label']){color:var(--row-normal-state-text-color)}:host([role='option'][selected]:not([disabled]):not(.has-slotted-control)) ::slotted([slot='label']){color:var(--row-selected-state-text-color)}@media (hover: hover){:host([role=\"option\"]:hover) ::slotted([slot='label']){color:var(--row-hover-state-text-color)}}:host([role=\"option\"]:not([disabled]):active) ::slotted([slot='label']){color:var(--row-pressed-state-text-color)}:host([role=\"option\"]:focus) ::slotted([slot='label']){color:var(--row-focus-state-text-color)}:host([disabled]) ::slotted([slot='label']){color:var(--row-disabled-state-text-color)}:host([size='small']) ::slotted([slot='label']){font-size:var(--row-small-size-text-size);font-weight:var(--row-small-size-text-weight);line-height:var(--row-small-size-text-leading);letter-spacing:var(--row-small-size-text-tracking)}:host([size='medium']) ::slotted([slot='label']){font-size:var(--row-medium-size-text-size);font-weight:var(--row-medium-size-text-weight);line-height:var(--row-medium-size-text-leading);letter-spacing:var(--row-medium-size-text-tracking)}::slotted([slot='subtext']){color:var(--row-normal-state-subtext-color);margin:0}:host([role='option'][selected]:not([disabled]):not(.has-slotted-control)) ::slotted([slot='subtext']){color:var(--row-selected-state-subtext-color)}@media (hover: hover){:host([role=\"option\"]:hover) ::slotted([slot='subtext']){color:var(--row-hover-state-subtext-color)}}:host([role=\"option\"]:not([disabled]):active) ::slotted([slot='subtext']){color:var(--row-pressed-state-subtext-color)}:host([role=\"option\"]:focus) ::slotted([slot='subtext']){color:var(--row-focus-state-subtext-color)}:host([disabled]) ::slotted([slot='subtext']){color:var(--row-disabled-state-subtext-color)}:host([size='small']) ::slotted([slot='subtext']){font-size:var(--row-small-size-subtext-size);font-weight:var(--row-small-size-subtext-weight);line-height:var(--row-small-size-subtext-leading);letter-spacing:var(--row-small-size-subtext-tracking)}:host([size='medium']) ::slotted([slot='subtext']){font-size:var(--row-medium-size-subtext-size);font-weight:var(--row-medium-size-subtext-weight);line-height:var(--row-medium-size-subtext-leading);letter-spacing:var(--row-medium-size-subtext-tracking)}::slotted([slot='side-label']){color:var(--row-normal-state-side-text-primary-color)}:host([role='option'][selected]:not([disabled]):not(.has-slotted-control)) ::slotted([slot='side-label']){color:var(--row-selected-state-side-text-primary-color)}@media (hover: hover){:host([role=\"option\"]:hover) ::slotted([slot='side-label']){color:var(--row-hover-state-side-text-primary-color)}}:host([role=\"option\"]:not([disabled]):active) ::slotted([slot='side-label']){color:var(--row-pressed-state-side-text-primary-color)}::slotted([slot='side-label']) :host([role=\"option\"]:focus){color:var(--row-focus-state-side-text-primary-color)}:host([disabled]) ::slotted([slot='side-label']){color:var(--row-disabled-state-side-text-primary-color)}:host([size='small']) ::slotted([slot='side-label']){font-size:var(--row-small-size-side-text-primary-size);font-weight:var(--row-small-size-side-text-primary-weight);line-height:var(--row-small-size-side-text-primary-leading);letter-spacing:var(--row-small-size-side-text-primary-tracking)}:host([size='medium']) ::slotted([slot='side-label']){font-size:var(--row-medium-size-side-text-primary-size);line-height:var(--row-medium-size-side-text-primary-leading);font-weight:var(--row-medium-size-side-text-primary-weight);letter-spacing:var(--row-medium-size-side-text-primary-tracking)}::slotted([slot='side-subtext']){color:var(--row-normal-state-side-text-secondary-color);margin:0}:host([role='option'][selected]:not([disabled]):not(.has-slotted-control)) ::slotted([slot='side-subtext']){color:var(--row-selected-state-side-text-secondary-color)}@media (hover: hover){:host([role=\"option\"]:hover) ::slotted([slot='side-subtext']){color:var(--row-hover-state-side-text-secondary-color)}}:host([role=\"option\"]:not([disabled]):active) ::slotted([slot='side-subtext']){color:var(--row-pressed-state-side-text-secondary-color)}::slotted([slot='side-subtext']) :host([role=\"option\"]:focus){color:var(--row-focus-state-side-text-secondary-color)}:host([disabled]) ::slotted([slot='side-subtext']){color:var(--row-disabled-state-side-text-secondary-color)}:host([size='small']) ::slotted([slot='side-subtext']){font-size:var(--row-small-size-side-text-secondary-size);line-height:var(--row-small-size-side-text-secondary-leading);font-weight:var(--row-small-size-side-text-secondary-weight);letter-spacing:var(--row-small-size-side-text-secondary-tracking)}:host([size='medium']) ::slotted([slot='side-subtext']){font-size:var(--row-medium-size-side-text-secondary-size);line-height:var(--row-medium-size-side-text-secondary-leading);font-weight:var(--row-medium-size-side-text-secondary-weight);letter-spacing:var(--row-medium-size-side-text-secondary-tracking)}::slotted([slot='control']){flex-shrink:0}:host svg{margin-right:5px;flex-shrink:0}:host path{stroke:var(--row-normal-state-drill-color)}:host([slot='displayed-selection']){pointer-events:none}:host([slot='displayed-selection']) ::slotted([slot='label']){font-weight:var(--field-input-weight)}:host([slot='displayed-selection']) ::slotted([slot='subtext']),:host([slot='displayed-selection']) ::slotted([slot='side-label']),:host([slot='displayed-selection']) ::slotted([slot='side-subtext']),:host([slot='displayed-selection']) ::slotted([slot='leading-accessory']),:host([slot='displayed-selection']) ::slotted([slot='trailing-accessory']),:host([slot='displayed-selection']) ::slotted([slot='control']){display:none}"}}])
//# sourceMappingURL=https://multipassui-production-c.squarecdn.com/assets/chunk.35.ee3f412c69f09da7e60d-72420b6e9322e1b71bd842b547935e70.map