@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
1 lines • 7.9 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{l(n.next(t))}catch(e){a(e)}}function s(t){try{l(n["throw"](t))}catch(e){a(e)}}function l(t){t.done?i(t.value):r(t.value).then(o,s)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(s){o=[6,s];r=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-c97dd66b.system.js","./p-466a0799.system.js","./p-597da005.system.js","./p-482ec054.system.js","./p-94d2ed32.system.js","./p-808ee633.system.js","./p-17866377.system.js"],(function(t){"use strict";var e,i,n,r,a,o,s,l,c,f,u,p,d,h,m,b,y,g,v,w,x;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.g},function(){},function(){},function(t){a=t.g},function(){},function(t){o=t.m;s=t.d;l=t.s;c=t.h;f=t.g;u=t.k;p=t.i;d=t.a;h=t.c;m=t.r;b=t.b;y=t.e;g=t.f;v=t.j;w=t.L},function(t){x=t.S}],execute:function(){var k={container:"container",handle:"handle"};var D;(function(t){t["grip"]="grip"})(D||(D={}));var _="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host{--calcite-icon-size:1rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{-ms-flex-align:stretch;align-items:stretch;background-color:transparent;display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:column;flex-flow:column;position:relative}calcite-value-list-item:last-of-type{-webkit-box-shadow:none;box-shadow:none}header{background-color:var(--calcite-ui-foreground-1);display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;margin-bottom:var(--calcite-spacing-quarter);-webkit-box-shadow:0 1px 0 var(--calcite-ui-border-3);box-shadow:0 1px 0 var(--calcite-ui-border-3)}header.sticky{position:-webkit-sticky;position:sticky;top:0;z-index:1}calcite-filter{margin-bottom:1px}calcite-scrim{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:column;flex-flow:column;pointer-events:none}";var A=t("calcite_value_list",function(){function t(t){var n=this;e(this,t);this.calciteListChange=i(this,"calciteListChange",7);this.calciteListOrderChange=i(this,"calciteListOrderChange",7);this.disabled=false;this.dragEnabled=false;this.filterEnabled=false;this.loading=false;this.multiple=false;this.selectedValues=new Map;this.dataForFilter=[];this.lastSelectedItem=null;this.observer=new MutationObserver(o.bind(this));this.deselectSiblingItems=s.bind(this);this.selectSiblings=l.bind(this);this.handleFilter=c.bind(this);this.getItemData=f.bind(this);this.keyDownHandler=function(t){var e=t.composedPath().find((function(t){var e;return((e=t.dataset)===null||e===void 0?void 0:e.jsHandle)!==undefined}));var i=t.composedPath().find((function(t){var e;return((e=t.tagName)===null||e===void 0?void 0:e.toLowerCase())==="calcite-value-list-item"}));if(!e||!i.handleActivated){u.call(n,t);return}if(t.key!=="ArrowUp"&&t.key!=="ArrowDown"){return}t.preventDefault();var r=n,o=r.el,s=r.items;var l=t.key==="ArrowDown"?1:-1;var c=s.indexOf(i);var f=a(c+l,s.length);if(f===s.length-1){o.appendChild(i)}else{var p=o.children[f];var d=p===i.nextElementSibling?p.nextElementSibling:p;o.insertBefore(i,d)}requestAnimationFrame((function(){return e.focus()}));i.handleActivated=true}}t.prototype.connectedCallback=function(){p.call(this);d.call(this)};t.prototype.componentDidLoad=function(){this.setUpDragAndDrop()};t.prototype.disconnectedCallback=function(){h.call(this);this.cleanUpDragAndDrop()};t.prototype.calciteListItemRemoveHandler=function(t){m.call(this,t)};t.prototype.calciteListItemChangeHandler=function(t){b.call(this,t)};t.prototype.calciteListItemPropsChangeHandler=function(t){t.stopPropagation();this.setUpFilter()};t.prototype.calciteListItemValueChangeHandler=function(t){y.call(this,t)};t.prototype.setUpItems=function(){g.call(this,"calcite-value-list-item")};t.prototype.setUpFilter=function(){if(this.filterEnabled){this.dataForFilter=this.getItemData()}};t.prototype.setUpDragAndDrop=function(){var t=this;if(!this.dragEnabled){return}this.sortable=x.create(this.el,{handle:"."+k.handle,draggable:"calcite-value-list-item",group:this.group,onSort:function(){t.items=Array.from(t.el.querySelectorAll("calcite-value-list-item"));var e=t.items.map((function(t){return t.value}));t.calciteListOrderChange.emit(e)}})};t.prototype.cleanUpDragAndDrop=function(){if(!this.dragEnabled){return}this.sortable.destroy()};t.prototype.getSelectedItems=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.selectedValues]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,v.call(this)]}))}))};t.prototype.getIconType=function(){var t=null;if(this.dragEnabled){t=D.grip}return t};t.prototype.render=function(){return n(w,{onKeyDown:this.keyDownHandler,props:this})};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());A.style=_}}}));