alchemy_cms 8.1.8 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/app/assets/builds/alchemy/admin.css +1 -1
- data/app/assets/builds/alchemy/alchemy_admin.min.js +2 -0
- data/app/assets/builds/alchemy/alchemy_admin.min.js.map +1 -0
- data/app/assets/builds/alchemy/dark-theme.css +1 -1
- data/app/assets/builds/alchemy/light-theme.css +1 -1
- data/app/assets/builds/alchemy/theme.css +1 -1
- data/app/assets/builds/alchemy/welcome.css +1 -1
- data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
- data/app/assets/builds/tinymce/skins/content/alchemy-dark/content.min.css +1 -1
- data/app/assets/images/alchemy/icons-sprite.svg +1 -1
- data/app/components/alchemy/admin/current_user_name.rb +34 -0
- data/app/components/alchemy/admin/locale_select.rb +12 -8
- data/app/components/alchemy/admin/page_node.html.erb +3 -2
- data/app/components/alchemy/admin/picture_thumbnail.rb +1 -1
- data/app/components/alchemy/admin/preview_time_select.rb +55 -0
- data/app/components/alchemy/admin/publish_element_button.html.erb +41 -0
- data/app/components/alchemy/admin/publish_element_button.rb +13 -0
- data/app/components/alchemy/admin/timezone_select.rb +47 -0
- data/app/components/alchemy/ingredients/base_editor.rb +1 -1
- data/app/components/alchemy/ingredients/select_editor.rb +6 -1
- data/app/controllers/alchemy/admin/base_controller.rb +1 -0
- data/app/controllers/alchemy/admin/elements_controller.rb +54 -34
- data/app/controllers/alchemy/admin/languages_controller.rb +3 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -0
- data/app/controllers/alchemy/admin/resources_controller.rb +11 -6
- data/app/controllers/alchemy/pages_controller.rb +1 -2
- data/app/decorators/alchemy/ingredient_editor.rb +1 -1
- data/app/helpers/alchemy/admin/base_helper.rb +4 -7
- data/app/helpers/alchemy/url_helper.rb +2 -10
- data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +28 -27
- data/app/javascript/alchemy_admin/components/element_editor.js +11 -2
- data/app/javascript/alchemy_admin/components/message.js +5 -1
- data/app/javascript/alchemy_admin/components/uploader/file_upload.js +5 -5
- data/app/javascript/alchemy_admin/image_cropper.js +10 -6
- data/app/javascript/alchemy_admin/initializer.js +6 -33
- data/app/javascript/alchemy_admin/shoelace_theme.js +6 -2
- data/app/javascript/alchemy_admin/templates/compiled.js +1 -1
- data/app/javascript/alchemy_admin.js +12 -2
- data/app/models/alchemy/attachment.rb +1 -1
- data/app/models/alchemy/current.rb +5 -1
- data/app/models/alchemy/element/element_ingredients.rb +11 -3
- data/app/models/alchemy/element.rb +10 -0
- data/app/models/alchemy/ingredient.rb +2 -0
- data/app/models/alchemy/ingredients/select.rb +1 -2
- data/app/models/alchemy/language/code.rb +1 -0
- data/app/models/alchemy/page/etag_generator.rb +21 -0
- data/app/models/alchemy/page/url_path.rb +11 -2
- data/app/models/alchemy/page.rb +12 -2
- data/app/models/alchemy/page_version.rb +5 -5
- data/app/models/alchemy/picture.rb +19 -2
- data/app/models/alchemy/storage_adapter/active_storage.rb +9 -0
- data/app/models/alchemy/storage_adapter/dragonfly.rb +9 -0
- data/app/models/alchemy/storage_adapter.rb +1 -0
- data/app/models/concerns/alchemy/publishable.rb +20 -12
- data/app/models/concerns/alchemy/relatable_resource.rb +16 -2
- data/app/models/concerns/alchemy/touch_elements.rb +3 -3
- data/app/services/alchemy/element_preloader.rb +107 -0
- data/app/services/alchemy/update_checks/alchemy_app.rb +1 -1
- data/app/stylesheets/alchemy/_custom-properties.scss +1 -0
- data/app/stylesheets/alchemy/_mixins.scss +1 -1
- data/app/stylesheets/alchemy/_themes.scss +2 -0
- data/app/stylesheets/alchemy/admin/base.scss +2 -1
- data/app/stylesheets/alchemy/admin/elements.scss +22 -19
- data/app/stylesheets/alchemy/admin/form_fields.scss +3 -0
- data/app/stylesheets/alchemy/admin/forms.scss +14 -1
- data/app/stylesheets/alchemy/admin/frame.scss +9 -8
- data/app/stylesheets/alchemy/admin/notices.scss +1 -1
- data/app/stylesheets/alchemy/admin/popover.scss +37 -0
- data/app/stylesheets/alchemy/admin/selects.scss +4 -0
- data/app/stylesheets/alchemy/admin/shoelace.scss +16 -4
- data/app/stylesheets/alchemy/admin/toolbar.scss +8 -0
- data/app/stylesheets/alchemy/admin.scss +1 -0
- data/app/views/alchemy/admin/_header.html.erb +4 -0
- data/app/views/alchemy/admin/_left_menu.html.erb +24 -0
- data/app/views/alchemy/admin/_main_navi.html.erb +6 -0
- data/app/views/alchemy/admin/_top_menu.html.erb +6 -0
- data/app/views/alchemy/admin/_user_info.html.erb +5 -0
- data/app/views/alchemy/admin/crop.html.erb +6 -11
- data/app/views/alchemy/admin/elements/_header.html.erb +16 -6
- data/app/views/alchemy/admin/elements/_schedule.html.erb +62 -0
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +1 -15
- data/app/views/alchemy/admin/elements/publish.turbo_stream.erb +28 -0
- data/app/views/alchemy/admin/nodes/index.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_locked_pages.html.erb +5 -0
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_table.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +6 -2
- data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +10 -10
- data/app/views/alchemy/admin/partials/_site_select.html.erb +6 -3
- data/app/views/alchemy/admin/pictures/index.html.erb +2 -2
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +9 -16
- data/app/views/alchemy/admin/uploader/_setup.html.erb +1 -6
- data/app/views/alchemy/language_links/_language.html.erb +1 -2
- data/app/views/layouts/alchemy/admin.html.erb +2 -45
- data/config/importmap.rb +7 -2
- data/config/locales/alchemy.en.yml +35 -5
- data/lib/alchemy/admin/preview_time.rb +23 -0
- data/lib/alchemy/admin/preview_url.rb +13 -2
- data/lib/alchemy/admin/timezone.rb +56 -0
- data/lib/alchemy/configuration.rb +2 -0
- data/lib/alchemy/configurations/main.rb +13 -1
- data/lib/alchemy/controller_actions.rb +2 -1
- data/lib/alchemy/tasks/tidy.rb +6 -7
- data/lib/alchemy/test_support/factories/element_factory.rb +2 -2
- data/lib/alchemy/test_support/relatable_resource_examples.rb +2 -2
- data/lib/alchemy/test_support/shared_publishable_examples.rb +44 -2
- data/lib/alchemy/upgrader.rb +3 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +2 -0
- data/lib/generators/alchemy/install/install_generator.rb +2 -1
- data/vendor/javascript/handlebars.min.js +4 -4
- data/vendor/javascript/shoelace.min.js +1419 -1323
- data/vendor/javascript/sortable.min.js +2 -2
- data/vendor/javascript/tinymce.min.js +1 -1
- metadata +35 -1
|
@@ -1,1094 +1,801 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=Object.defineProperties,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),l=t=>{throw TypeError(t)},c=(e,o,r)=>o in e?t(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,h=(t,e)=>{for(var o in e||(e={}))s.call(e,o)&&c(t,o,e[o]);if(i)for(var o of i(e))n.call(e,o)&&c(t,o,e[o]);return t},d=(t,o)=>e(t,r(o)),u=(e,r,i,s)=>{for(var n,a=s>1?void 0:s?o(r,i):r,l=e.length-1;l>=0;l--)(n=e[l])&&(a=(s?n(r,i,a):n(a))||a);return s&&a&&t(r,i,a),a},p=(t,e,o)=>e.has(t)||l("Cannot "+o),b=function(t,e){this[0]=t,this[1]=e},f=t=>{var e,o=t[a("asyncIterator")],r=!1,i={};return null==o?(o=t[a("iterator")](),e=t=>i[t]=e=>o[t](e)):(o=o.call(t),e=t=>i[t]=e=>{if(r){if(r=!1,"throw"===t)throw e;return e}return r=!0,{done:!1,value:new b(new Promise((r=>{var i=o[t](e);i instanceof Object||l("Object expected"),r(i)})),1)}}),i[a("iterator")]=()=>i,e("next"),"throw"in o?e("throw"):i.throw=t=>{throw t},"return"in o&&e("return"),i},g=new Map,m=new WeakMap;function v(t,e){return"rtl"===e.toLowerCase()?{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}:t}function y(t,e){g.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function w(t,e,o){const r=m.get(t);if(null==r?void 0:r[e])return v(r[e],o.dir);const i=g.get(e);return i?v(i,o.dir):{keyframes:[],options:{duration:0}}}
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright 2019 Google LLC
|
|
5
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/
|
|
5
|
+
*/
|
|
6
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),i=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const o=this.t;if(e&&void 0===t){const e=void 0!==o&&1===o.length;e&&(t=i.get(o)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(o,t))}return t}toString(){return this.cssText}};const s=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,o,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[i+1]),t[0]);return new r(i,t,o)},n=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const o of t.cssRules)e+=o.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,o))(e)})(t):t
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/,{is:
|
|
11
|
+
*/,{is:a,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:d,getPrototypeOf:u}=Object,p=globalThis,b=p.trustedTypes,f=b?b.emptyScript:"",g=p.reactiveElementPolyfillSupport,m=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},y=(t,e)=>!a(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(t,o,e);void 0!==i&&l(this.prototype,t,i)}}static getPropertyDescriptor(t,e,o){const{get:i,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const s=i?.call(this);r?.call(this,e),this.requestUpdate(t,s,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...h(t),...d(t)];for(const o of e)this.createProperty(o,t[o])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,o]of e)this.elementProperties.set(t,o)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const o=this._$Eu(t,e);void 0!==o&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Eu(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const o=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((o,i)=>{if(e)o.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,o.appendChild(i)}})(o,this.constructor.elementStyles),o}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){const o=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,o);if(void 0!==i&&!0===o.reflect){const r=(void 0!==o.converter?.toAttribute?o.converter:v).toAttribute(e,o.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const o=this.constructor,i=o._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=o.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=i;const s=r.fromAttribute(e,t.type);this[i]=s??this._$Ej?.get(i)??s,this._$Em=null}}requestUpdate(t,e,o){if(void 0!==t){const i=this.constructor,r=this[t];if(o??=i.getPropertyOptions(t),!((o.hasChanged??y)(r,e)||o.useDefault&&o.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:i,wrapped:r},s){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==r||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,o]of t){const{wrapped:t}=o,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,o,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[m("elementProperties")]=new Map,_[m("finalized")]=new Map,g?.({ReactiveElement:_}),(p.reactiveElementVersions??=[]).push("2.1.1");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const x=globalThis,k=x.trustedTypes,$=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+A,S=`<${E}>`,z=document,T=()=>z.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,P="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,F=/>/g,R=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,N=/"/g,U=/^(?:script|style|textarea|title)$/i,H=(t=>(e,...o)=>({_$litType$:t,strings:e,values:o}))(1),I=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),W=new WeakMap,j=z.createTreeWalker(z,129);function q(t,e){if(!O(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(e):e}const K=(t,e)=>{const o=t.length-1,i=[];let r,s=2===e?"<svg>":3===e?"<math>":"",n=D;for(let e=0;e<o;e++){const o=t[e];let a,l,c=-1,h=0;for(;h<o.length&&(n.lastIndex=h,l=n.exec(o),null!==l);)h=n.lastIndex,n===D?"!--"===l[1]?n=B:void 0!==l[1]?n=F:void 0!==l[2]?(U.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=R):void 0!==l[3]&&(n=R):n===R?">"===l[0]?(n=r??D,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?R:'"'===l[3]?N:M):n===N||n===M?n=R:n===B||n===F?n=D:(n=R,r=void 0);const d=n===R&&t[e+1].startsWith("/>")?" ":"";s+=n===D?o+S:c>=0?(i.push(a),o.slice(0,c)+C+o.slice(c)+A+d):o+A+(-2===c?e:d)}return[q(t,s+(t[o]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class Z{constructor({strings:t,_$litType$:e},o){let i;this.parts=[];let r=0,s=0;const n=t.length-1,a=this.parts,[l,c]=K(t,e);if(this.el=Z.createElement(l,o),j.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=j.nextNode())&&a.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(C)){const e=c[s++],o=i.getAttribute(t).split(A),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:n[2],strings:o,ctor:"."===n[1]?Q:"?"===n[1]?tt:"@"===n[1]?et:J}),i.removeAttribute(t)}else t.startsWith(A)&&(a.push({type:6,index:r}),i.removeAttribute(t));if(U.test(i.tagName)){const t=i.textContent.split(A),e=t.length-1;if(e>0){i.textContent=k?k.emptyScript:"";for(let o=0;o<e;o++)i.append(t[o],T()),j.nextNode(),a.push({type:2,index:++r});i.append(t[e],T())}}}else if(8===i.nodeType)if(i.data===E)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(A,t+1));)a.push({type:7,index:r}),t+=A.length-1}r++}}static createElement(t,e){const o=z.createElement("template");return o.innerHTML=t,o}}function G(t,e,o=t,i){if(e===I)return e;let r=void 0!==i?o._$Co?.[i]:o._$Cl;const s=L(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(t),r._$AT(t,o,i)),void 0!==i?(o._$Co??=[])[i]=r:o._$Cl=r),void 0!==r&&(e=G(t,r._$AS(t,e.values),r,i)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:o}=this._$AD,i=(t?.creationScope??z).importNode(e,!0);j.currentNode=i;let r=j.nextNode(),s=0,n=0,a=o[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new Y(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new ot(r,this,t)),this._$AV.push(e),a=o[++n]}s!==a?.index&&(r=j.nextNode(),s++)}return j.currentNode=z,i}p(t){let e=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,i){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),L(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>O(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==V&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:o}=t,i="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Z.createElement(q(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new X(i,this),o=t.u(this.options);t.p(e),this.T(o),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Z(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let o,i=0;for(const r of t)i===e.length?e.push(o=new Y(this.O(T()),this.O(T()),this,this.options)):o=e[i],o._$AI(r),i++;i<e.length&&(this._$AR(o&&o._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,i,r){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=V}_$AI(t,e=this,o,i){const r=this.strings;let s=!1;if(void 0===r)t=G(this,t,e,0),s=!L(t)||t!==this._$AH&&t!==I,s&&(this._$AH=t);else{const i=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=G(this,i[o+n],e,n),a===I&&(a=this._$AH[n]),s||=!L(a)||a!==this._$AH[n],a===V?t=V:t!==V&&(t+=(a??"")+r[n+1]),this._$AH[n]=a}s&&!i&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Q extends J{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}class tt extends J{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==V)}}class et extends J{constructor(t,e,o,i,r){super(t,e,o,i,r),this.type=5}_$AI(t,e=this){if((t=G(this,t,e,0)??V)===I)return;const o=this._$AH,i=t===V&&o!==V||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==V&&(o===V||i);i&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const it=x.litHtmlPolyfillSupport;it?.(Z,Y),(x.litHtmlVersions??=[]).push("3.3.1");const rt=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let
|
|
22
|
+
*/let st=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,o)=>{const i=o?.renderBefore??e;let r=i._$litPart$;if(void 0===r){const t=o?.renderBefore??null;i._$litPart$=r=new Y(e.insertBefore(T(),t),t,void 0,o??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};st._$litElement$=!0,st.finalized=!0,rt.litElementHydrateSupport?.({LitElement:st});const nt=rt.litElementPolyfillSupport;nt?.({LitElement:st}),(rt.litElementVersions??=[]).push("4.2.1");var at=s`
|
|
23
23
|
:host {
|
|
24
|
-
|
|
24
|
+
--track-width: 2px;
|
|
25
|
+
--track-color: rgb(128 128 128 / 25%);
|
|
26
|
+
--indicator-color: var(--sl-color-primary-600);
|
|
27
|
+
--speed: 2s;
|
|
28
|
+
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
width: 1em;
|
|
31
|
+
height: 1em;
|
|
32
|
+
flex: none;
|
|
25
33
|
}
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
.spinner {
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
height: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
.spinner__track,
|
|
42
|
+
.spinner__indicator {
|
|
43
|
+
fill: none;
|
|
44
|
+
stroke-width: var(--track-width);
|
|
45
|
+
r: calc(0.5em - var(--track-width) / 2);
|
|
46
|
+
cx: 0.5em;
|
|
47
|
+
cy: 0.5em;
|
|
48
|
+
transform-origin: 50% 50%;
|
|
33
49
|
}
|
|
34
50
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
51
|
+
.spinner__track {
|
|
52
|
+
stroke: var(--track-color);
|
|
53
|
+
transform-origin: 0% 0%;
|
|
54
|
+
}
|
|
39
55
|
|
|
40
|
-
|
|
56
|
+
.spinner__indicator {
|
|
57
|
+
stroke: var(--indicator-color);
|
|
58
|
+
stroke-linecap: round;
|
|
59
|
+
stroke-dasharray: 150% 75%;
|
|
60
|
+
animation: spin var(--speed) linear infinite;
|
|
41
61
|
}
|
|
42
62
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
@keyframes spin {
|
|
64
|
+
0% {
|
|
65
|
+
transform: rotate(0deg);
|
|
66
|
+
stroke-dasharray: 0.05em, 3em;
|
|
67
|
+
}
|
|
47
68
|
|
|
48
|
-
|
|
69
|
+
50% {
|
|
70
|
+
transform: rotate(450deg);
|
|
71
|
+
stroke-dasharray: 1.375em, 1.375em;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
100% {
|
|
75
|
+
transform: rotate(1080deg);
|
|
76
|
+
stroke-dasharray: 0.05em, 3em;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;const lt=new Set,ct=new Map;let ht,dt="ltr",ut="en";const pt="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(pt){const t=new MutationObserver(ft);dt=document.documentElement.dir||"ltr",ut=document.documentElement.lang||navigator.language,t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function bt(...t){t.map((t=>{const e=t.$code.toLowerCase();ct.has(e)?ct.set(e,Object.assign(Object.assign({},ct.get(e)),t)):ct.set(e,t),ht||(ht=t)})),ft()}function ft(){pt&&(dt=document.documentElement.dir||"ltr",ut=document.documentElement.lang||navigator.language),[...lt.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}let gt=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){lt.add(this.host)}hostDisconnected(){lt.delete(this.host)}dir(){return`${this.host.dir||dt}`.toLowerCase()}lang(){return`${this.host.lang||ut}`.toLowerCase()}getTranslationData(t){var e,o;const i=new Intl.Locale(t.replace(/_/g,"-")),r=null==i?void 0:i.language.toLowerCase(),s=null!==(o=null===(e=null==i?void 0:i.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==o?o:"";return{locale:i,language:r,region:s,primary:ct.get(`${r}-${s}`),secondary:ct.get(r)}}exists(t,e){var o;const{primary:i,secondary:r}=this.getTranslationData(null!==(o=e.lang)&&void 0!==o?o:this.lang());return e=Object.assign({includeFallback:!1},e),!!(i&&i[t]||r&&r[t]||e.includeFallback&&ht&&ht[t])}term(t,...e){const{primary:o,secondary:i}=this.getTranslationData(this.lang());let r;if(o&&o[t])r=o[t];else if(i&&i[t])r=i[t];else{if(!ht||!ht[t])return console.error(`No translation found for: ${String(t)}`),String(t);r=ht[t]}return"function"==typeof r?r(...e):r}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,o){return new Intl.RelativeTimeFormat(this.lang(),o).format(t,e)}};var mt={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};bt(mt);var vt=mt,yt=class extends gt{};bt(vt);var wt=s`
|
|
80
|
+
:host {
|
|
81
|
+
box-sizing: border-box;
|
|
49
82
|
}
|
|
50
83
|
|
|
51
|
-
|
|
84
|
+
:host *,
|
|
85
|
+
:host *::before,
|
|
86
|
+
:host *::after {
|
|
87
|
+
box-sizing: inherit;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[hidden] {
|
|
91
|
+
display: none !important;
|
|
92
|
+
}
|
|
93
|
+
`,_t=Object.defineProperty,xt=Object.defineProperties,kt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,St=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),zt=t=>{throw TypeError(t)},Tt=(t,e,o)=>e in t?_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Lt=(t,e)=>{for(var o in e||(e={}))At.call(e,o)&&Tt(t,o,e[o]);if(Ct)for(var o of Ct(e))Et.call(e,o)&&Tt(t,o,e[o]);return t},Ot=(t,e)=>xt(t,$t(e)),Pt=(t,e,o,i)=>{for(var r,s=i>1?void 0:i?kt(e,o):e,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(i?r(e,o,s):r(s))||s);return i&&s&&_t(e,o,s),s},Dt=(t,e,o)=>e.has(t)||zt("Cannot "+o),Bt=function(t,e){this[0]=t,this[1]=e},Ft=t=>{var e,o=t[St("asyncIterator")],i=!1,r={};return null==o?(o=t[St("iterator")](),e=t=>r[t]=e=>o[t](e)):(o=o.call(t),e=t=>r[t]=e=>{if(i){if(i=!1,"throw"===t)throw e;return e}return i=!0,{done:!1,value:new Bt(new Promise((i=>{var r=o[t](e);r instanceof Object||zt("Object expected"),i(r)})),1)}}),r[St("iterator")]=()=>r,e("next"),"throw"in o?e("throw"):r.throw=t=>{throw t},"return"in o&&e("return"),r};
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright 2017 Google LLC
|
|
97
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
+
*/
|
|
99
|
+
const Rt={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},Mt=(t=Rt,e,o)=>{const{kind:i,metadata:r}=o;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),s.set(o.name,t),"accessor"===i){const{name:i}=o;return{set(o){const r=e.get.call(this);e.set.call(this,o),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=o;return function(o){const r=this[i];e.call(this,o),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function Nt(t){return(e,o)=>"object"==typeof o?Mt(t,e,o):((t,e,o)=>{const i=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),i?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)
|
|
100
|
+
/**
|
|
101
|
+
* @license
|
|
102
|
+
* Copyright 2017 Google LLC
|
|
103
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
|
+
*/}function Ut(t){return Nt({...t,state:!0,attribute:!1})}
|
|
105
|
+
/**
|
|
106
|
+
* @license
|
|
107
|
+
* Copyright 2017 Google LLC
|
|
108
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @license
|
|
112
|
+
* Copyright 2017 Google LLC
|
|
113
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
+
*/
|
|
115
|
+
function Ht(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o))(e,o,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var It,Vt=class extends st{constructor(){var t,e,o;super(),t=this,o=!1,(e=It).has(t)?zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const o=new CustomEvent(t,Lt({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(o),o}static define(t,e=this,o={}){const i=customElements.get(t);if(!i){try{customElements.define(t,e,o)}catch(i){customElements.define(t,class extends e{},o)}return}let r=" (unknown version)",s=r;"version"in e&&e.version&&(r=" v"+e.version),"version"in i&&i.version&&(s=" v"+i.version),r&&s&&r===s||console.warn(`Attempted to register <${t}>${r}, but <${t}>${s} has already been registered.`)}attributeChangedCallback(t,e,o){var i,r;Dt(i=this,r=It,"read from private field"),r.get(i)||(this.constructor.elementProperties.forEach(((t,e)=>{t.reflect&&null!=this[e]&&this.initialReflectedProperties.set(e,this[e])})),((t,e,o)=>{Dt(t,e,"write to private field"),e.set(t,o)})(this,It,!0)),super.attributeChangedCallback(t,e,o)}willUpdate(t){super.willUpdate(t),this.initialReflectedProperties.forEach(((e,o)=>{t.has(o)&&null==this[o]&&(this[o]=e)}))}};It=new WeakMap,Vt.version="2.20.1",Vt.dependencies={},Pt([Nt()],Vt.prototype,"dir",2),Pt([Nt()],Vt.prototype,"lang",2);var Wt=class extends Vt{constructor(){super(...arguments),this.localize=new yt(this)}render(){return H`
|
|
116
|
+
<svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
|
|
117
|
+
<circle class="spinner__track"></circle>
|
|
118
|
+
<circle class="spinner__indicator"></circle>
|
|
119
|
+
</svg>
|
|
120
|
+
`}};Wt.styles=[wt,at];var jt=new WeakMap,qt=new WeakMap,Kt=new WeakMap,Zt=new WeakSet,Gt=new WeakMap,Xt=class{constructor(t,e){this.handleFormData=t=>{const e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),r="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!e&&!r&&"string"==typeof o&&o.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach((e=>{t.formData.append(o,e.toString())})):t.formData.append(o,i.toString()))},this.handleFormSubmit=t=>{var e;const o=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=jt.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),!this.form||this.form.noValidate||o||i(this.host)||(t.preventDefault(),t.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Gt.set(this.host,[])},this.handleInteraction=t=>{const e=Gt.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.checkValidity&&!e.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0},(this.host=t).addController(this),this.options=Lt({form:t=>{const e=t.form;if(e){const o=t.getRootNode().querySelector(`#${e}`);if(o)return o}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>{var e;return null!=(e=t.disabled)&&e},reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),checkValidity:t=>"function"!=typeof t.checkValidity||t.checkValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sl-input"]},e)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),Gt.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),Gt.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,jt.has(this.form)?jt.get(this.form).add(this.host):jt.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),qt.has(this.form)||(qt.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),Kt.has(this.form)||(Kt.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const t=jt.get(this.form);t&&(t.delete(this.host),t.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),qt.has(this.form)&&(this.form.reportValidity=qt.get(this.form),qt.delete(this.form)),Kt.has(this.form)&&(this.form.checkValidity=Kt.get(this.form),Kt.delete(this.form)),this.form=void 0))}setUserInteracted(t,e){e?Zt.add(t):Zt.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&o.setAttribute(t,e.getAttribute(t))}))),this.form.append(o),o.click(),o.remove()}}getForm(){var t;return null!=(t=this.form)?t:null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,o=Boolean(Zt.has(e)),i=Boolean(e.required);e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||null==t||t.preventDefault()}},Yt=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze(Ot(Lt({},Yt),{valid:!1,valueMissing:!0})),Object.freeze(Ot(Lt({},Yt),{valid:!1,customError:!0}));var Jt=s`
|
|
121
|
+
:host {
|
|
122
|
+
display: inline-block;
|
|
52
123
|
position: relative;
|
|
53
|
-
|
|
54
|
-
align-items: center;
|
|
55
|
-
font-family: var(--sl-input-font-family);
|
|
56
|
-
font-size: inherit;
|
|
57
|
-
font-weight: var(--sl-input-font-weight);
|
|
58
|
-
color: var(--sl-input-label-color);
|
|
59
|
-
vertical-align: middle;
|
|
124
|
+
width: auto;
|
|
60
125
|
cursor: pointer;
|
|
61
126
|
}
|
|
62
127
|
|
|
63
|
-
.
|
|
64
|
-
flex: 0 0 auto;
|
|
65
|
-
position: relative;
|
|
128
|
+
.button {
|
|
66
129
|
display: inline-flex;
|
|
67
|
-
align-items:
|
|
130
|
+
align-items: stretch;
|
|
68
131
|
justify-content: center;
|
|
69
|
-
width:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
132
|
+
width: 100%;
|
|
133
|
+
border-style: solid;
|
|
134
|
+
border-width: var(--sl-input-border-width);
|
|
135
|
+
font-family: var(--sl-input-font-family);
|
|
136
|
+
font-weight: var(--sl-font-weight-semibold);
|
|
137
|
+
text-decoration: none;
|
|
138
|
+
user-select: none;
|
|
139
|
+
-webkit-user-select: none;
|
|
140
|
+
white-space: nowrap;
|
|
141
|
+
vertical-align: middle;
|
|
142
|
+
padding: 0;
|
|
74
143
|
transition:
|
|
75
|
-
var(--sl-transition-fast)
|
|
76
|
-
var(--sl-transition-fast)
|
|
144
|
+
var(--sl-transition-x-fast) background-color,
|
|
145
|
+
var(--sl-transition-x-fast) color,
|
|
146
|
+
var(--sl-transition-x-fast) border,
|
|
147
|
+
var(--sl-transition-x-fast) box-shadow;
|
|
148
|
+
cursor: inherit;
|
|
77
149
|
}
|
|
78
150
|
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
height: var(--thumb-size);
|
|
82
|
-
background-color: var(--sl-color-neutral-0);
|
|
83
|
-
border-radius: 50%;
|
|
84
|
-
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
|
85
|
-
translate: calc((var(--width) - var(--height)) / -2);
|
|
86
|
-
transition:
|
|
87
|
-
var(--sl-transition-fast) translate ease,
|
|
88
|
-
var(--sl-transition-fast) background-color,
|
|
89
|
-
var(--sl-transition-fast) border-color,
|
|
90
|
-
var(--sl-transition-fast) box-shadow;
|
|
151
|
+
.button::-moz-focus-inner {
|
|
152
|
+
border: 0;
|
|
91
153
|
}
|
|
92
154
|
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
155
|
+
.button:focus {
|
|
156
|
+
outline: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.button:focus-visible {
|
|
160
|
+
outline: var(--sl-focus-ring);
|
|
161
|
+
outline-offset: var(--sl-focus-ring-offset);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.button--disabled {
|
|
165
|
+
opacity: 0.5;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* When disabled, prevent mouse events from bubbling up from children */
|
|
170
|
+
.button--disabled * {
|
|
98
171
|
pointer-events: none;
|
|
99
172
|
}
|
|
100
173
|
|
|
101
|
-
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
|
|
174
|
+
.button__prefix,
|
|
175
|
+
.button__suffix {
|
|
176
|
+
flex: 0 0 auto;
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
pointer-events: none;
|
|
105
180
|
}
|
|
106
181
|
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
border-color: var(--sl-color-neutral-400);
|
|
182
|
+
.button__label {
|
|
183
|
+
display: inline-block;
|
|
110
184
|
}
|
|
111
185
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
background-color: var(--sl-color-neutral-400);
|
|
115
|
-
border-color: var(--sl-color-neutral-400);
|
|
186
|
+
.button__label::slotted(sl-icon) {
|
|
187
|
+
vertical-align: -2px;
|
|
116
188
|
}
|
|
117
189
|
|
|
118
|
-
|
|
190
|
+
/*
|
|
191
|
+
* Standard buttons
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
/* Default */
|
|
195
|
+
.button--standard.button--default {
|
|
119
196
|
background-color: var(--sl-color-neutral-0);
|
|
120
|
-
border-color: var(--sl-
|
|
121
|
-
|
|
122
|
-
outline-offset: var(--sl-focus-ring-offset);
|
|
197
|
+
border-color: var(--sl-input-border-color);
|
|
198
|
+
color: var(--sl-color-neutral-700);
|
|
123
199
|
}
|
|
124
200
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
201
|
+
.button--standard.button--default:hover:not(.button--disabled) {
|
|
202
|
+
background-color: var(--sl-color-primary-50);
|
|
203
|
+
border-color: var(--sl-color-primary-300);
|
|
204
|
+
color: var(--sl-color-primary-700);
|
|
129
205
|
}
|
|
130
206
|
|
|
131
|
-
.
|
|
132
|
-
background-color: var(--sl-color-
|
|
133
|
-
border-color: var(--sl-color-primary-
|
|
134
|
-
|
|
207
|
+
.button--standard.button--default:active:not(.button--disabled) {
|
|
208
|
+
background-color: var(--sl-color-primary-100);
|
|
209
|
+
border-color: var(--sl-color-primary-400);
|
|
210
|
+
color: var(--sl-color-primary-700);
|
|
135
211
|
}
|
|
136
212
|
|
|
137
|
-
/*
|
|
138
|
-
.
|
|
213
|
+
/* Primary */
|
|
214
|
+
.button--standard.button--primary {
|
|
139
215
|
background-color: var(--sl-color-primary-600);
|
|
140
216
|
border-color: var(--sl-color-primary-600);
|
|
217
|
+
color: var(--sl-color-neutral-0);
|
|
141
218
|
}
|
|
142
219
|
|
|
143
|
-
.
|
|
144
|
-
background-color: var(--sl-color-
|
|
145
|
-
border-color: var(--sl-color-primary-
|
|
220
|
+
.button--standard.button--primary:hover:not(.button--disabled) {
|
|
221
|
+
background-color: var(--sl-color-primary-500);
|
|
222
|
+
border-color: var(--sl-color-primary-500);
|
|
223
|
+
color: var(--sl-color-neutral-0);
|
|
146
224
|
}
|
|
147
225
|
|
|
148
|
-
|
|
149
|
-
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
226
|
+
.button--standard.button--primary:active:not(.button--disabled) {
|
|
150
227
|
background-color: var(--sl-color-primary-600);
|
|
151
228
|
border-color: var(--sl-color-primary-600);
|
|
229
|
+
color: var(--sl-color-neutral-0);
|
|
152
230
|
}
|
|
153
231
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
232
|
+
/* Success */
|
|
233
|
+
.button--standard.button--success {
|
|
234
|
+
background-color: var(--sl-color-success-600);
|
|
235
|
+
border-color: var(--sl-color-success-600);
|
|
236
|
+
color: var(--sl-color-neutral-0);
|
|
159
237
|
}
|
|
160
238
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
239
|
+
.button--standard.button--success:hover:not(.button--disabled) {
|
|
240
|
+
background-color: var(--sl-color-success-500);
|
|
241
|
+
border-color: var(--sl-color-success-500);
|
|
242
|
+
color: var(--sl-color-neutral-0);
|
|
165
243
|
}
|
|
166
244
|
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
user-select: none;
|
|
172
|
-
-webkit-user-select: none;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
:host([required]) .switch__label::after {
|
|
176
|
-
content: var(--sl-input-required-content);
|
|
177
|
-
color: var(--sl-input-required-content-color);
|
|
178
|
-
margin-inline-start: var(--sl-input-required-content-offset);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
@media (forced-colors: active) {
|
|
182
|
-
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,
|
|
183
|
-
.switch--checked .switch__control .switch__thumb {
|
|
184
|
-
background-color: ButtonText;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
`,zt=A`
|
|
188
|
-
.form-control .form-control__label {
|
|
189
|
-
display: none;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.form-control .form-control__help-text {
|
|
193
|
-
display: none;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/* Label */
|
|
197
|
-
.form-control--has-label .form-control__label {
|
|
198
|
-
display: inline-block;
|
|
199
|
-
color: var(--sl-input-label-color);
|
|
200
|
-
margin-bottom: var(--sl-spacing-3x-small);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.form-control--has-label.form-control--small .form-control__label {
|
|
204
|
-
font-size: var(--sl-input-label-font-size-small);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.form-control--has-label.form-control--medium .form-control__label {
|
|
208
|
-
font-size: var(--sl-input-label-font-size-medium);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.form-control--has-label.form-control--large .form-control__label {
|
|
212
|
-
font-size: var(--sl-input-label-font-size-large);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
:host([required]) .form-control--has-label .form-control__label::after {
|
|
216
|
-
content: var(--sl-input-required-content);
|
|
217
|
-
margin-inline-start: var(--sl-input-required-content-offset);
|
|
218
|
-
color: var(--sl-input-required-content-color);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/* Help text */
|
|
222
|
-
.form-control--has-help-text .form-control__help-text {
|
|
223
|
-
display: block;
|
|
224
|
-
color: var(--sl-input-help-text-color);
|
|
225
|
-
margin-top: var(--sl-spacing-3x-small);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.form-control--has-help-text.form-control--small .form-control__help-text {
|
|
229
|
-
font-size: var(--sl-input-help-text-font-size-small);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.form-control--has-help-text.form-control--medium .form-control__help-text {
|
|
233
|
-
font-size: var(--sl-input-help-text-font-size-medium);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.form-control--has-help-text.form-control--large .form-control__help-text {
|
|
237
|
-
font-size: var(--sl-input-help-text-font-size-large);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.form-control--has-help-text.form-control--radio-group .form-control__help-text {
|
|
241
|
-
margin-top: var(--sl-spacing-2x-small);
|
|
242
|
-
}
|
|
243
|
-
`,Tt=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,Ot=new WeakSet,Bt=new WeakMap,Ft=class{constructor(t,e){this.handleFormData=t=>{const e=this.options.disabled(this.host),o=this.options.name(this.host),r=this.options.value(this.host),i="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!e&&!i&&"string"==typeof o&&o.length>0&&void 0!==r&&(Array.isArray(r)?r.forEach((e=>{t.formData.append(o,e.toString())})):t.formData.append(o,r.toString()))},this.handleFormSubmit=t=>{var e;const o=this.options.disabled(this.host),r=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=Tt.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),!this.form||this.form.noValidate||o||r(this.host)||(t.preventDefault(),t.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Bt.set(this.host,[])},this.handleInteraction=t=>{const e=Bt.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.checkValidity&&!e.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0},(this.host=t).addController(this),this.options=h({form:t=>{const e=t.form;if(e){const o=t.getRootNode().querySelector(`#${e}`);if(o)return o}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>{var e;return null!=(e=t.disabled)&&e},reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),checkValidity:t=>"function"!=typeof t.checkValidity||t.checkValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sl-input"]},e)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),Bt.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),Bt.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,Tt.has(this.form)?Tt.get(this.form).add(this.host):Tt.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),Pt.has(this.form)||(Pt.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),Lt.has(this.form)||(Lt.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const t=Tt.get(this.form);t&&(t.delete(this.host),t.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),Pt.has(this.form)&&(this.form.reportValidity=Pt.get(this.form),Pt.delete(this.form)),Lt.has(this.form)&&(this.form.checkValidity=Lt.get(this.form),Lt.delete(this.form)),this.form=void 0))}setUserInteracted(t,e){e?Ot.add(t):Ot.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&o.setAttribute(t,e.getAttribute(t))}))),this.form.append(o),o.click(),o.remove()}}getForm(){var t;return null!=(t=this.form)?t:null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,o=Boolean(Ot.has(e)),r=Boolean(e.required);e.toggleAttribute("data-required",r),e.toggleAttribute("data-optional",!r),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||null==t||t.preventDefault()}},Dt=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze(d(h({},Dt),{valid:!1,valueMissing:!0})),Object.freeze(d(h({},Dt),{valid:!1,customError:!0}));var Rt=class{constructor(t,...e){this.slotNames=[],this.handleSlotChange=t=>{const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()},(this.host=t).addController(this),this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function Mt(t,e){const o=h({waitUntilFirstUpdate:!1},e);return(e,r)=>{const{update:i}=e,s=Array.isArray(t)?t:[t];e.update=function(t){s.forEach((e=>{const i=e;if(t.has(i)){const e=t.get(i),s=this[i];e!==s&&(o.waitUntilFirstUpdate&&!this.hasUpdated||this[r](e,s))}})),i.call(this,t)}}}var Nt=A`
|
|
244
|
-
:host {
|
|
245
|
-
box-sizing: border-box;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
:host *,
|
|
249
|
-
:host *::before,
|
|
250
|
-
:host *::after {
|
|
251
|
-
box-sizing: inherit;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
[hidden] {
|
|
255
|
-
display: none !important;
|
|
256
|
-
}
|
|
257
|
-
`
|
|
258
|
-
/**
|
|
259
|
-
* @license
|
|
260
|
-
* Copyright 2017 Google LLC
|
|
261
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
262
|
-
*/;const Ht={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:H},Ut=(t=Ht,e,o)=>{const{kind:r,metadata:i}=o;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),s.set(o.name,t),"accessor"===r){const{name:r}=o;return{set(o){const i=e.get.call(this);e.set.call(this,o),this.requestUpdate(r,i,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=o;return function(o){const i=this[r];e.call(this,o),this.requestUpdate(r,i,t)}}throw Error("Unsupported decorator location: "+r)};function It(t){return(e,o)=>"object"==typeof o?Ut(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)
|
|
263
|
-
/**
|
|
264
|
-
* @license
|
|
265
|
-
* Copyright 2017 Google LLC
|
|
266
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
267
|
-
*/}function Vt(t){return It({...t,state:!0,attribute:!1})}
|
|
268
|
-
/**
|
|
269
|
-
* @license
|
|
270
|
-
* Copyright 2017 Google LLC
|
|
271
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
272
|
-
*/
|
|
273
|
-
/**
|
|
274
|
-
* @license
|
|
275
|
-
* Copyright 2017 Google LLC
|
|
276
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
277
|
-
*/
|
|
278
|
-
function Wt(t,e){return(e,o,r)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o))(e,o,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var jt,qt=class extends At{constructor(){var t,e,o;super(),t=this,o=!1,(e=jt).has(t)?l("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const o=new CustomEvent(t,h({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(o),o}static define(t,e=this,o={}){const r=customElements.get(t);if(!r){try{customElements.define(t,e,o)}catch(r){customElements.define(t,class extends e{},o)}return}let i=" (unknown version)",s=i;"version"in e&&e.version&&(i=" v"+e.version),"version"in r&&r.version&&(s=" v"+r.version),i&&s&&i===s||console.warn(`Attempted to register <${t}>${i}, but <${t}>${s} has already been registered.`)}attributeChangedCallback(t,e,o){var r,i;p(r=this,i=jt,"read from private field"),i.get(r)||(this.constructor.elementProperties.forEach(((t,e)=>{t.reflect&&null!=this[e]&&this.initialReflectedProperties.set(e,this[e])})),((t,e,o)=>{p(t,e,"write to private field"),e.set(t,o)})(this,jt,!0)),super.attributeChangedCallback(t,e,o)}willUpdate(t){super.willUpdate(t),this.initialReflectedProperties.forEach(((e,o)=>{t.has(o)&&null==this[o]&&(this[o]=e)}))}};jt=new WeakMap,qt.version="2.20.1",qt.dependencies={},u([It()],qt.prototype,"dir",2),u([It()],qt.prototype,"lang",2);
|
|
279
|
-
/**
|
|
280
|
-
* @license
|
|
281
|
-
* Copyright 2017 Google LLC
|
|
282
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
283
|
-
*/
|
|
284
|
-
const Kt=1,Zt=3,Gt=4,Xt=t=>(...e)=>({_$litDirective$:t,values:e});let Yt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
285
|
-
/**
|
|
286
|
-
* @license
|
|
287
|
-
* Copyright 2018 Google LLC
|
|
288
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
289
|
-
*/const Jt=Xt(class extends Yt{constructor(t){if(super(t),t.type!==Kt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const o=t.element.classList;for(const t of this.st)t in e||(o.remove(t),this.st.delete(t));for(const t in e){const r=!!e[t];r===this.st.has(t)||this.nt?.has(t)||(r?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return ct}}),Qt=t=>t??ht
|
|
290
|
-
/**
|
|
291
|
-
* @license
|
|
292
|
-
* Copyright 2020 Google LLC
|
|
293
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
294
|
-
*/,te={},ee=Xt(class extends Yt{constructor(t){if(super(t),t.type!==Zt&&t.type!==Kt&&t.type!==Gt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===ct||e===ht)return e;const o=t.element,r=t.name;if(t.type===Zt){if(e===o[r])return ct}else if(t.type===Gt){if(!!e===o.hasAttribute(r))return ct}else if(t.type===Kt&&o.getAttribute(r)===e+"")return ct;return((t,e=te)=>{t._$AH=e;
|
|
295
|
-
/**
|
|
296
|
-
* @license
|
|
297
|
-
* Copyright 2020 Google LLC
|
|
298
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
299
|
-
*/})(t),e}});
|
|
300
|
-
/**
|
|
301
|
-
* @license
|
|
302
|
-
* Copyright 2018 Google LLC
|
|
303
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
304
|
-
*/var oe=class extends qt{constructor(){super(...arguments),this.formControlController=new Ft(this,{value:t=>t.checked?t.value||"on":void 0,defaultValue:t=>t.defaultChecked,setValue:(t,e)=>t.checked=e}),this.hasSlotController=new Rt(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(t){"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("help-text"),e=!!this.helpText||!!t;return lt`
|
|
305
|
-
<div
|
|
306
|
-
class=${Jt({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":e})}
|
|
307
|
-
>
|
|
308
|
-
<label
|
|
309
|
-
part="base"
|
|
310
|
-
class=${Jt({switch:!0,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus,"switch--small":"small"===this.size,"switch--medium":"medium"===this.size,"switch--large":"large"===this.size})}
|
|
311
|
-
>
|
|
312
|
-
<input
|
|
313
|
-
class="switch__input"
|
|
314
|
-
type="checkbox"
|
|
315
|
-
title=${this.title}
|
|
316
|
-
name=${this.name}
|
|
317
|
-
value=${Qt(this.value)}
|
|
318
|
-
.checked=${ee(this.checked)}
|
|
319
|
-
.disabled=${this.disabled}
|
|
320
|
-
.required=${this.required}
|
|
321
|
-
role="switch"
|
|
322
|
-
aria-checked=${this.checked?"true":"false"}
|
|
323
|
-
aria-describedby="help-text"
|
|
324
|
-
@click=${this.handleClick}
|
|
325
|
-
@input=${this.handleInput}
|
|
326
|
-
@invalid=${this.handleInvalid}
|
|
327
|
-
@blur=${this.handleBlur}
|
|
328
|
-
@focus=${this.handleFocus}
|
|
329
|
-
@keydown=${this.handleKeyDown}
|
|
330
|
-
/>
|
|
331
|
-
|
|
332
|
-
<span part="control" class="switch__control">
|
|
333
|
-
<span part="thumb" class="switch__thumb"></span>
|
|
334
|
-
</span>
|
|
335
|
-
|
|
336
|
-
<div part="label" class="switch__label">
|
|
337
|
-
<slot></slot>
|
|
338
|
-
</div>
|
|
339
|
-
</label>
|
|
340
|
-
|
|
341
|
-
<div
|
|
342
|
-
aria-hidden=${e?"false":"true"}
|
|
343
|
-
class="form-control__help-text"
|
|
344
|
-
id="help-text"
|
|
345
|
-
part="form-control-help-text"
|
|
346
|
-
>
|
|
347
|
-
<slot name="help-text">${this.helpText}</slot>
|
|
348
|
-
</div>
|
|
349
|
-
</div>
|
|
350
|
-
`}};oe.styles=[Nt,zt,St],u([Wt('input[type="checkbox"]')],oe.prototype,"input",2),u([Vt()],oe.prototype,"hasFocus",2),u([It()],oe.prototype,"title",2),u([It()],oe.prototype,"name",2),u([It()],oe.prototype,"value",2),u([It({reflect:!0})],oe.prototype,"size",2),u([It({type:Boolean,reflect:!0})],oe.prototype,"disabled",2),u([It({type:Boolean,reflect:!0})],oe.prototype,"checked",2),u([((t="value")=>(e,o)=>{const r=e.constructor,i=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(e,s,n){var a;const l=r.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t)){const e=l.converter||N,r=("function"==typeof e?e:null!=(a=null==e?void 0:e.fromAttribute)?a:N.fromAttribute)(n,l.type);this[t]!==r&&(this[o]=r)}i.call(this,e,s,n)}})("checked")],oe.prototype,"defaultChecked",2),u([It({reflect:!0})],oe.prototype,"form",2),u([It({type:Boolean,reflect:!0})],oe.prototype,"required",2),u([It({attribute:"help-text"})],oe.prototype,"helpText",2),u([Mt("checked",{waitUntilFirstUpdate:!0})],oe.prototype,"handleCheckedChange",1),u([Mt("disabled",{waitUntilFirstUpdate:!0})],oe.prototype,"handleDisabledChange",1),oe.define("sl-switch");var re=A`
|
|
351
|
-
:host {
|
|
352
|
-
display: inline-block;
|
|
245
|
+
.button--standard.button--success:active:not(.button--disabled) {
|
|
246
|
+
background-color: var(--sl-color-success-600);
|
|
247
|
+
border-color: var(--sl-color-success-600);
|
|
248
|
+
color: var(--sl-color-neutral-0);
|
|
353
249
|
}
|
|
354
250
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
font-weight: var(--sl-font-weight-semibold);
|
|
361
|
-
border-radius: var(--sl-border-radius-medium);
|
|
362
|
-
color: var(--sl-color-neutral-600);
|
|
363
|
-
padding: var(--sl-spacing-medium) var(--sl-spacing-large);
|
|
364
|
-
white-space: nowrap;
|
|
365
|
-
user-select: none;
|
|
366
|
-
-webkit-user-select: none;
|
|
367
|
-
cursor: pointer;
|
|
368
|
-
transition:
|
|
369
|
-
var(--transition-speed) box-shadow,
|
|
370
|
-
var(--transition-speed) color;
|
|
251
|
+
/* Neutral */
|
|
252
|
+
.button--standard.button--neutral {
|
|
253
|
+
background-color: var(--sl-color-neutral-600);
|
|
254
|
+
border-color: var(--sl-color-neutral-600);
|
|
255
|
+
color: var(--sl-color-neutral-0);
|
|
371
256
|
}
|
|
372
257
|
|
|
373
|
-
.
|
|
374
|
-
color: var(--sl-color-
|
|
258
|
+
.button--standard.button--neutral:hover:not(.button--disabled) {
|
|
259
|
+
background-color: var(--sl-color-neutral-500);
|
|
260
|
+
border-color: var(--sl-color-neutral-500);
|
|
261
|
+
color: var(--sl-color-neutral-0);
|
|
375
262
|
}
|
|
376
263
|
|
|
377
|
-
:
|
|
378
|
-
|
|
264
|
+
.button--standard.button--neutral:active:not(.button--disabled) {
|
|
265
|
+
background-color: var(--sl-color-neutral-600);
|
|
266
|
+
border-color: var(--sl-color-neutral-600);
|
|
267
|
+
color: var(--sl-color-neutral-0);
|
|
379
268
|
}
|
|
380
269
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
270
|
+
/* Warning */
|
|
271
|
+
.button--standard.button--warning {
|
|
272
|
+
background-color: var(--sl-color-warning-600);
|
|
273
|
+
border-color: var(--sl-color-warning-600);
|
|
274
|
+
color: var(--sl-color-neutral-0);
|
|
385
275
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
color: var(--sl-color-
|
|
276
|
+
.button--standard.button--warning:hover:not(.button--disabled) {
|
|
277
|
+
background-color: var(--sl-color-warning-500);
|
|
278
|
+
border-color: var(--sl-color-warning-500);
|
|
279
|
+
color: var(--sl-color-neutral-0);
|
|
389
280
|
}
|
|
390
281
|
|
|
391
|
-
.
|
|
392
|
-
|
|
282
|
+
.button--standard.button--warning:active:not(.button--disabled) {
|
|
283
|
+
background-color: var(--sl-color-warning-600);
|
|
284
|
+
border-color: var(--sl-color-warning-600);
|
|
285
|
+
color: var(--sl-color-neutral-0);
|
|
393
286
|
}
|
|
394
287
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
288
|
+
/* Danger */
|
|
289
|
+
.button--standard.button--danger {
|
|
290
|
+
background-color: var(--sl-color-danger-600);
|
|
291
|
+
border-color: var(--sl-color-danger-600);
|
|
292
|
+
color: var(--sl-color-neutral-0);
|
|
398
293
|
}
|
|
399
294
|
|
|
400
|
-
.
|
|
401
|
-
|
|
402
|
-
|
|
295
|
+
.button--standard.button--danger:hover:not(.button--disabled) {
|
|
296
|
+
background-color: var(--sl-color-danger-500);
|
|
297
|
+
border-color: var(--sl-color-danger-500);
|
|
298
|
+
color: var(--sl-color-neutral-0);
|
|
403
299
|
}
|
|
404
300
|
|
|
405
|
-
.
|
|
406
|
-
|
|
301
|
+
.button--standard.button--danger:active:not(.button--disabled) {
|
|
302
|
+
background-color: var(--sl-color-danger-600);
|
|
303
|
+
border-color: var(--sl-color-danger-600);
|
|
304
|
+
color: var(--sl-color-neutral-0);
|
|
407
305
|
}
|
|
408
306
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
outline-offset: -3px;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
`,ie=A`
|
|
416
|
-
:host {
|
|
417
|
-
display: inline-block;
|
|
418
|
-
color: var(--sl-color-neutral-600);
|
|
419
|
-
}
|
|
307
|
+
/*
|
|
308
|
+
* Outline buttons
|
|
309
|
+
*/
|
|
420
310
|
|
|
421
|
-
.
|
|
422
|
-
flex: 0 0 auto;
|
|
423
|
-
display: flex;
|
|
424
|
-
align-items: center;
|
|
311
|
+
.button--outline {
|
|
425
312
|
background: none;
|
|
426
|
-
border:
|
|
427
|
-
border-radius: var(--sl-border-radius-medium);
|
|
428
|
-
font-size: inherit;
|
|
429
|
-
color: inherit;
|
|
430
|
-
padding: var(--sl-spacing-x-small);
|
|
431
|
-
cursor: pointer;
|
|
432
|
-
transition: var(--sl-transition-x-fast) color;
|
|
433
|
-
-webkit-appearance: none;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.icon-button:hover:not(.icon-button--disabled),
|
|
437
|
-
.icon-button:focus-visible:not(.icon-button--disabled) {
|
|
438
|
-
color: var(--sl-color-primary-600);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.icon-button:active:not(.icon-button--disabled) {
|
|
442
|
-
color: var(--sl-color-primary-700);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
.icon-button:focus {
|
|
446
|
-
outline: none;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.icon-button--disabled {
|
|
450
|
-
opacity: 0.5;
|
|
451
|
-
cursor: not-allowed;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.icon-button:focus-visible {
|
|
455
|
-
outline: var(--sl-focus-ring);
|
|
456
|
-
outline-offset: var(--sl-focus-ring-offset);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.icon-button__icon {
|
|
460
|
-
pointer-events: none;
|
|
461
|
-
}
|
|
462
|
-
`,se="";function ne(t){se=t}var ae={name:"default",resolver:t=>function(t=""){if(!se){const t=[...document.getElementsByTagName("script")],e=t.find((t=>t.hasAttribute("data-shoelace")));if(e)ne(e.getAttribute("data-shoelace"));else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let o="";e&&(o=e.getAttribute("src")),ne(o.split("/").slice(0,-1).join("/"))}}return se.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}(`assets/icons/${t}.svg`)},le={caret:'\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n ',check:'\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',"chevron-left":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n ',"chevron-right":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',copy:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n ',"eye-slash":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n ',eyedropper:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n ',"grip-vertical":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n ',indeterminate:'\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"person-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n ',"play-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n ',"pause-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n ',radio:'\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n ',"star-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n ',"x-lg":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n ',"x-circle-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n '},ce=[ae,{name:"system",resolver:t=>t in le?`data:image/svg+xml,${encodeURIComponent(le[t])}`:""}],he=[];function de(t){return ce.find((e=>e.name===t))}function ue(t,e){!function(t){ce=ce.filter((e=>e.name!==t))}(t),ce.push({name:t,resolver:e.resolver,mutator:e.mutator,spriteSheet:e.spriteSheet}),he.forEach((e=>{e.library===t&&e.setIcon()}))}var pe,be=A`
|
|
463
|
-
:host {
|
|
464
|
-
display: inline-block;
|
|
465
|
-
width: 1em;
|
|
466
|
-
height: 1em;
|
|
467
|
-
box-sizing: content-box !important;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
svg {
|
|
471
|
-
display: block;
|
|
472
|
-
height: 100%;
|
|
473
|
-
width: 100%;
|
|
474
|
-
}
|
|
475
|
-
`,fe=Symbol(),ge=Symbol(),me=new Map,ve=class extends qt{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var o;let r;if(null==e?void 0:e.spriteSheet)return this.svg=lt`<svg part="svg">
|
|
476
|
-
<use part="use" href="${t}"></use>
|
|
477
|
-
</svg>`,this.svg;try{if(r=await fetch(t,{mode:"cors"}),!r.ok)return 410===r.status?fe:ge}catch(t){return ge}try{const t=document.createElement("div");t.innerHTML=await r.text();const e=t.firstElementChild;if("svg"!==(null==(o=null==e?void 0:e.tagName)?void 0:o.toLowerCase()))return fe;pe||(pe=new DOMParser);const i=pe.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return i?(i.part.add("svg"),document.adoptNode(i)):fe}catch(t){return fe}}connectedCallback(){var t;super.connectedCallback(),t=this,he.push(t)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,he=he.filter((e=>e!==t))}getIconSource(){const t=de(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:o}=this.getIconSource(),r=o?de(this.library):void 0;if(!e)return void(this.svg=null);let i=me.get(e);if(i||(i=this.resolveIcon(e,r),me.set(e,i)),!this.initialRender)return;const s=await i;if(s===ge&&me.delete(e),e===this.getIconSource().url)if((t=>void 0!==t?._$litType$)(s)){if(this.svg=s,r){await this.updateComplete;const t=this.shadowRoot.querySelector("[part='svg']");"function"==typeof r.mutator&&t&&r.mutator(t)}}else switch(s){case ge:case fe:this.svg=null,this.emit("sl-error");break;default:this.svg=s.cloneNode(!0),null==(t=null==r?void 0:r.mutator)||t.call(r,this.svg),this.emit("sl-load")}}render(){return this.svg}};ve.styles=[Nt,be],u([Vt()],ve.prototype,"svg",2),u([It({reflect:!0})],ve.prototype,"name",2),u([It()],ve.prototype,"src",2),u([It()],ve.prototype,"label",2),u([It({reflect:!0})],ve.prototype,"library",2),u([Mt("label")],ve.prototype,"handleLabelChange",1),u([Mt(["name","src","library"])],ve.prototype,"setIcon",1);
|
|
478
|
-
/**
|
|
479
|
-
* @license
|
|
480
|
-
* Copyright 2020 Google LLC
|
|
481
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
482
|
-
*/
|
|
483
|
-
const ye=Symbol.for(""),we=t=>{if(t?.r===ye)return t?._$litStatic$},_e=(t,...e)=>({_$litStatic$:e.reduce(((e,o,r)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[r+1]),t[0]),r:ye}),xe=new Map,ke=(t=>(e,...o)=>{const r=o.length;let i,s;const n=[],a=[];let l,c=0,h=!1;for(;c<r;){for(l=e[c];c<r&&void 0!==(s=o[c],i=we(s));)l+=i+e[++c],h=!0;c!==r&&a.push(s),n.push(l),c++}if(c===r&&n.push(e[r]),h){const t=n.join("$$lit$$");void 0===(e=xe.get(t))&&(n.raw=n,xe.set(t,e=n)),o=a}return t(e,...o)})(lt);var $e=class extends qt{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t=!!this.href,e=t?_e`a`:_e`button`;return ke`
|
|
484
|
-
<${e}
|
|
485
|
-
part="base"
|
|
486
|
-
class=${Jt({"icon-button":!0,"icon-button--disabled":!t&&this.disabled,"icon-button--focused":this.hasFocus})}
|
|
487
|
-
?disabled=${Qt(t?void 0:this.disabled)}
|
|
488
|
-
type=${Qt(t?void 0:"button")}
|
|
489
|
-
href=${Qt(t?this.href:void 0)}
|
|
490
|
-
target=${Qt(t?this.target:void 0)}
|
|
491
|
-
download=${Qt(t?this.download:void 0)}
|
|
492
|
-
rel=${Qt(t&&this.target?"noreferrer noopener":void 0)}
|
|
493
|
-
role=${Qt(t?void 0:"button")}
|
|
494
|
-
aria-disabled=${this.disabled?"true":"false"}
|
|
495
|
-
aria-label="${this.label}"
|
|
496
|
-
tabindex=${this.disabled?"-1":"0"}
|
|
497
|
-
@blur=${this.handleBlur}
|
|
498
|
-
@focus=${this.handleFocus}
|
|
499
|
-
@click=${this.handleClick}
|
|
500
|
-
>
|
|
501
|
-
<sl-icon
|
|
502
|
-
class="icon-button__icon"
|
|
503
|
-
name=${Qt(this.name)}
|
|
504
|
-
library=${Qt(this.library)}
|
|
505
|
-
src=${Qt(this.src)}
|
|
506
|
-
aria-hidden="true"
|
|
507
|
-
></sl-icon>
|
|
508
|
-
</${e}>
|
|
509
|
-
`}};$e.styles=[Nt,ie],$e.dependencies={"sl-icon":ve},u([Wt(".icon-button")],$e.prototype,"button",2),u([Vt()],$e.prototype,"hasFocus",2),u([It()],$e.prototype,"name",2),u([It()],$e.prototype,"library",2),u([It()],$e.prototype,"src",2),u([It()],$e.prototype,"href",2),u([It()],$e.prototype,"target",2),u([It()],$e.prototype,"download",2),u([It()],$e.prototype,"label",2),u([It({type:Boolean,reflect:!0})],$e.prototype,"disabled",2);const Ce=new Set,Ae=new Map;let Ee,Se="ltr",ze="en";const Te="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(Te){const t=new MutationObserver(Le);Se=document.documentElement.dir||"ltr",ze=document.documentElement.lang||navigator.language,t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function Pe(...t){t.map((t=>{const e=t.$code.toLowerCase();Ae.has(e)?Ae.set(e,Object.assign(Object.assign({},Ae.get(e)),t)):Ae.set(e,t),Ee||(Ee=t)})),Le()}function Le(){Te&&(Se=document.documentElement.dir||"ltr",ze=document.documentElement.lang||navigator.language),[...Ce.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}let Oe=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){Ce.add(this.host)}hostDisconnected(){Ce.delete(this.host)}dir(){return`${this.host.dir||Se}`.toLowerCase()}lang(){return`${this.host.lang||ze}`.toLowerCase()}getTranslationData(t){var e,o;const r=new Intl.Locale(t.replace(/_/g,"-")),i=null==r?void 0:r.language.toLowerCase(),s=null!==(o=null===(e=null==r?void 0:r.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==o?o:"";return{locale:r,language:i,region:s,primary:Ae.get(`${i}-${s}`),secondary:Ae.get(i)}}exists(t,e){var o;const{primary:r,secondary:i}=this.getTranslationData(null!==(o=e.lang)&&void 0!==o?o:this.lang());return e=Object.assign({includeFallback:!1},e),!!(r&&r[t]||i&&i[t]||e.includeFallback&&Ee&&Ee[t])}term(t,...e){const{primary:o,secondary:r}=this.getTranslationData(this.lang());let i;if(o&&o[t])i=o[t];else if(r&&r[t])i=r[t];else{if(!Ee||!Ee[t])return console.error(`No translation found for: ${String(t)}`),String(t);i=Ee[t]}return"function"==typeof i?i(...e):i}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,o){return new Intl.RelativeTimeFormat(this.lang(),o).format(t,e)}};var Be={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};Pe(Be);var Fe=Be,De=class extends Oe{};Pe(Fe);var Re=0,Me=class extends qt{constructor(){super(...arguments),this.localize=new De(this),this.attrId=++Re,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled&&!this.active?this.tabIndex=-1:this.tabIndex=0}render(){return this.id=this.id.length>0?this.id:this.componentId,lt`
|
|
510
|
-
<div
|
|
511
|
-
part="base"
|
|
512
|
-
class=${Jt({tab:!0,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})}
|
|
513
|
-
>
|
|
514
|
-
<slot></slot>
|
|
515
|
-
${this.closable?lt`
|
|
516
|
-
<sl-icon-button
|
|
517
|
-
part="close-button"
|
|
518
|
-
exportparts="base:close-button__base"
|
|
519
|
-
name="x-lg"
|
|
520
|
-
library="system"
|
|
521
|
-
label=${this.localize.term("close")}
|
|
522
|
-
class="tab__close-button"
|
|
523
|
-
@click=${this.handleCloseClick}
|
|
524
|
-
tabindex="-1"
|
|
525
|
-
></sl-icon-button>
|
|
526
|
-
`:""}
|
|
527
|
-
</div>
|
|
528
|
-
`}};Me.styles=[Nt,re],Me.dependencies={"sl-icon-button":$e},u([Wt(".tab")],Me.prototype,"tab",2),u([It({reflect:!0})],Me.prototype,"panel",2),u([It({type:Boolean,reflect:!0})],Me.prototype,"active",2),u([It({type:Boolean,reflect:!0})],Me.prototype,"closable",2),u([It({type:Boolean,reflect:!0})],Me.prototype,"disabled",2),u([It({type:Number,reflect:!0})],Me.prototype,"tabIndex",2),u([Mt("active")],Me.prototype,"handleActiveChange",1),u([Mt("disabled")],Me.prototype,"handleDisabledChange",1),Me.define("sl-tab");var Ne=A`
|
|
529
|
-
:host {
|
|
530
|
-
--indicator-color: var(--sl-color-primary-600);
|
|
531
|
-
--track-color: var(--sl-color-neutral-200);
|
|
532
|
-
--track-width: 2px;
|
|
533
|
-
|
|
534
|
-
display: block;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.tab-group {
|
|
538
|
-
display: flex;
|
|
539
|
-
border-radius: 0;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.tab-group__tabs {
|
|
543
|
-
display: flex;
|
|
544
|
-
position: relative;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.tab-group__indicator {
|
|
548
|
-
position: absolute;
|
|
549
|
-
transition:
|
|
550
|
-
var(--sl-transition-fast) translate ease,
|
|
551
|
-
var(--sl-transition-fast) width ease;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.tab-group--has-scroll-controls .tab-group__nav-container {
|
|
555
|
-
position: relative;
|
|
556
|
-
padding: 0 var(--sl-spacing-x-large);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
.tab-group--has-scroll-controls .tab-group__scroll-button--start--hidden,
|
|
560
|
-
.tab-group--has-scroll-controls .tab-group__scroll-button--end--hidden {
|
|
561
|
-
visibility: hidden;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
.tab-group__body {
|
|
565
|
-
display: block;
|
|
566
|
-
overflow: auto;
|
|
313
|
+
border: solid 1px;
|
|
567
314
|
}
|
|
568
315
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
position: absolute;
|
|
574
|
-
top: 0;
|
|
575
|
-
bottom: 0;
|
|
576
|
-
width: var(--sl-spacing-x-large);
|
|
316
|
+
/* Default */
|
|
317
|
+
.button--outline.button--default {
|
|
318
|
+
border-color: var(--sl-input-border-color);
|
|
319
|
+
color: var(--sl-color-neutral-700);
|
|
577
320
|
}
|
|
578
321
|
|
|
579
|
-
.
|
|
580
|
-
|
|
322
|
+
.button--outline.button--default:hover:not(.button--disabled),
|
|
323
|
+
.button--outline.button--default.button--checked:not(.button--disabled) {
|
|
324
|
+
border-color: var(--sl-color-primary-600);
|
|
325
|
+
background-color: var(--sl-color-primary-600);
|
|
326
|
+
color: var(--sl-color-neutral-0);
|
|
581
327
|
}
|
|
582
328
|
|
|
583
|
-
.
|
|
584
|
-
|
|
329
|
+
.button--outline.button--default:active:not(.button--disabled) {
|
|
330
|
+
border-color: var(--sl-color-primary-700);
|
|
331
|
+
background-color: var(--sl-color-primary-700);
|
|
332
|
+
color: var(--sl-color-neutral-0);
|
|
585
333
|
}
|
|
586
334
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
335
|
+
/* Primary */
|
|
336
|
+
.button--outline.button--primary {
|
|
337
|
+
border-color: var(--sl-color-primary-600);
|
|
338
|
+
color: var(--sl-color-primary-600);
|
|
590
339
|
}
|
|
591
340
|
|
|
592
|
-
.
|
|
593
|
-
|
|
594
|
-
|
|
341
|
+
.button--outline.button--primary:hover:not(.button--disabled),
|
|
342
|
+
.button--outline.button--primary.button--checked:not(.button--disabled) {
|
|
343
|
+
background-color: var(--sl-color-primary-600);
|
|
344
|
+
color: var(--sl-color-neutral-0);
|
|
595
345
|
}
|
|
596
346
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
.tab-group--top {
|
|
602
|
-
flex-direction: column;
|
|
347
|
+
.button--outline.button--primary:active:not(.button--disabled) {
|
|
348
|
+
border-color: var(--sl-color-primary-700);
|
|
349
|
+
background-color: var(--sl-color-primary-700);
|
|
350
|
+
color: var(--sl-color-neutral-0);
|
|
603
351
|
}
|
|
604
352
|
|
|
605
|
-
|
|
606
|
-
|
|
353
|
+
/* Success */
|
|
354
|
+
.button--outline.button--success {
|
|
355
|
+
border-color: var(--sl-color-success-600);
|
|
356
|
+
color: var(--sl-color-success-600);
|
|
607
357
|
}
|
|
608
358
|
|
|
609
|
-
.
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
/* Hide scrollbar in Firefox */
|
|
614
|
-
scrollbar-width: none;
|
|
359
|
+
.button--outline.button--success:hover:not(.button--disabled),
|
|
360
|
+
.button--outline.button--success.button--checked:not(.button--disabled) {
|
|
361
|
+
background-color: var(--sl-color-success-600);
|
|
362
|
+
color: var(--sl-color-neutral-0);
|
|
615
363
|
}
|
|
616
364
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
365
|
+
.button--outline.button--success:active:not(.button--disabled) {
|
|
366
|
+
border-color: var(--sl-color-success-700);
|
|
367
|
+
background-color: var(--sl-color-success-700);
|
|
368
|
+
color: var(--sl-color-neutral-0);
|
|
621
369
|
}
|
|
622
370
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
border-bottom: solid var(--track-width) var(--track-color);
|
|
371
|
+
/* Neutral */
|
|
372
|
+
.button--outline.button--neutral {
|
|
373
|
+
border-color: var(--sl-color-neutral-600);
|
|
374
|
+
color: var(--sl-color-neutral-600);
|
|
628
375
|
}
|
|
629
376
|
|
|
630
|
-
.
|
|
631
|
-
|
|
632
|
-
|
|
377
|
+
.button--outline.button--neutral:hover:not(.button--disabled),
|
|
378
|
+
.button--outline.button--neutral.button--checked:not(.button--disabled) {
|
|
379
|
+
background-color: var(--sl-color-neutral-600);
|
|
380
|
+
color: var(--sl-color-neutral-0);
|
|
633
381
|
}
|
|
634
382
|
|
|
635
|
-
.
|
|
636
|
-
|
|
383
|
+
.button--outline.button--neutral:active:not(.button--disabled) {
|
|
384
|
+
border-color: var(--sl-color-neutral-700);
|
|
385
|
+
background-color: var(--sl-color-neutral-700);
|
|
386
|
+
color: var(--sl-color-neutral-0);
|
|
637
387
|
}
|
|
638
388
|
|
|
639
|
-
|
|
640
|
-
|
|
389
|
+
/* Warning */
|
|
390
|
+
.button--outline.button--warning {
|
|
391
|
+
border-color: var(--sl-color-warning-600);
|
|
392
|
+
color: var(--sl-color-warning-600);
|
|
641
393
|
}
|
|
642
394
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
395
|
+
.button--outline.button--warning:hover:not(.button--disabled),
|
|
396
|
+
.button--outline.button--warning.button--checked:not(.button--disabled) {
|
|
397
|
+
background-color: var(--sl-color-warning-600);
|
|
398
|
+
color: var(--sl-color-neutral-0);
|
|
399
|
+
}
|
|
646
400
|
|
|
647
|
-
.
|
|
648
|
-
|
|
401
|
+
.button--outline.button--warning:active:not(.button--disabled) {
|
|
402
|
+
border-color: var(--sl-color-warning-700);
|
|
403
|
+
background-color: var(--sl-color-warning-700);
|
|
404
|
+
color: var(--sl-color-neutral-0);
|
|
649
405
|
}
|
|
650
406
|
|
|
651
|
-
|
|
652
|
-
|
|
407
|
+
/* Danger */
|
|
408
|
+
.button--outline.button--danger {
|
|
409
|
+
border-color: var(--sl-color-danger-600);
|
|
410
|
+
color: var(--sl-color-danger-600);
|
|
653
411
|
}
|
|
654
412
|
|
|
655
|
-
.
|
|
656
|
-
|
|
657
|
-
|
|
413
|
+
.button--outline.button--danger:hover:not(.button--disabled),
|
|
414
|
+
.button--outline.button--danger.button--checked:not(.button--disabled) {
|
|
415
|
+
background-color: var(--sl-color-danger-600);
|
|
416
|
+
color: var(--sl-color-neutral-0);
|
|
417
|
+
}
|
|
658
418
|
|
|
659
|
-
|
|
660
|
-
|
|
419
|
+
.button--outline.button--danger:active:not(.button--disabled) {
|
|
420
|
+
border-color: var(--sl-color-danger-700);
|
|
421
|
+
background-color: var(--sl-color-danger-700);
|
|
422
|
+
color: var(--sl-color-neutral-0);
|
|
661
423
|
}
|
|
662
424
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
425
|
+
@media (forced-colors: active) {
|
|
426
|
+
.button.button--outline.button--checked:not(.button--disabled) {
|
|
427
|
+
outline: solid 2px transparent;
|
|
428
|
+
}
|
|
667
429
|
}
|
|
668
430
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
431
|
+
/*
|
|
432
|
+
* Text buttons
|
|
433
|
+
*/
|
|
434
|
+
|
|
435
|
+
.button--text {
|
|
436
|
+
background-color: transparent;
|
|
437
|
+
border-color: transparent;
|
|
438
|
+
color: var(--sl-color-primary-600);
|
|
674
439
|
}
|
|
675
440
|
|
|
676
|
-
.
|
|
677
|
-
|
|
678
|
-
border-
|
|
441
|
+
.button--text:hover:not(.button--disabled) {
|
|
442
|
+
background-color: transparent;
|
|
443
|
+
border-color: transparent;
|
|
444
|
+
color: var(--sl-color-primary-500);
|
|
679
445
|
}
|
|
680
446
|
|
|
681
|
-
.
|
|
682
|
-
|
|
447
|
+
.button--text:focus-visible:not(.button--disabled) {
|
|
448
|
+
background-color: transparent;
|
|
449
|
+
border-color: transparent;
|
|
450
|
+
color: var(--sl-color-primary-500);
|
|
683
451
|
}
|
|
684
452
|
|
|
685
|
-
.
|
|
686
|
-
|
|
453
|
+
.button--text:active:not(.button--disabled) {
|
|
454
|
+
background-color: transparent;
|
|
455
|
+
border-color: transparent;
|
|
456
|
+
color: var(--sl-color-primary-700);
|
|
687
457
|
}
|
|
688
458
|
|
|
689
459
|
/*
|
|
690
|
-
*
|
|
460
|
+
* Size modifiers
|
|
691
461
|
*/
|
|
692
462
|
|
|
693
|
-
.
|
|
694
|
-
|
|
463
|
+
.button--small {
|
|
464
|
+
height: auto;
|
|
465
|
+
min-height: var(--sl-input-height-small);
|
|
466
|
+
font-size: var(--sl-button-font-size-small);
|
|
467
|
+
line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
|
|
468
|
+
border-radius: var(--sl-input-border-radius-small);
|
|
695
469
|
}
|
|
696
470
|
|
|
697
|
-
.
|
|
698
|
-
|
|
471
|
+
.button--medium {
|
|
472
|
+
height: auto;
|
|
473
|
+
min-height: var(--sl-input-height-medium);
|
|
474
|
+
font-size: var(--sl-button-font-size-medium);
|
|
475
|
+
line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
|
|
476
|
+
border-radius: var(--sl-input-border-radius-medium);
|
|
699
477
|
}
|
|
700
478
|
|
|
701
|
-
.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
479
|
+
.button--large {
|
|
480
|
+
height: auto;
|
|
481
|
+
min-height: var(--sl-input-height-large);
|
|
482
|
+
font-size: var(--sl-button-font-size-large);
|
|
483
|
+
line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
|
|
484
|
+
border-radius: var(--sl-input-border-radius-large);
|
|
705
485
|
}
|
|
706
486
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
487
|
+
/*
|
|
488
|
+
* Pill modifier
|
|
489
|
+
*/
|
|
711
490
|
|
|
712
|
-
.
|
|
713
|
-
|
|
714
|
-
left: calc(-1 * var(--track-width));
|
|
491
|
+
.button--pill.button--small {
|
|
492
|
+
border-radius: var(--sl-input-height-small);
|
|
715
493
|
}
|
|
716
494
|
|
|
717
|
-
.
|
|
718
|
-
|
|
719
|
-
order: 2;
|
|
495
|
+
.button--pill.button--medium {
|
|
496
|
+
border-radius: var(--sl-input-height-medium);
|
|
720
497
|
}
|
|
721
498
|
|
|
722
|
-
.
|
|
723
|
-
|
|
499
|
+
.button--pill.button--large {
|
|
500
|
+
border-radius: var(--sl-input-height-large);
|
|
724
501
|
}
|
|
725
502
|
|
|
726
503
|
/*
|
|
727
|
-
*
|
|
504
|
+
* Circle modifier
|
|
728
505
|
*/
|
|
729
506
|
|
|
730
|
-
.
|
|
731
|
-
|
|
507
|
+
.button--circle {
|
|
508
|
+
padding-left: 0;
|
|
509
|
+
padding-right: 0;
|
|
732
510
|
}
|
|
733
511
|
|
|
734
|
-
.
|
|
735
|
-
|
|
512
|
+
.button--circle.button--small {
|
|
513
|
+
width: var(--sl-input-height-small);
|
|
514
|
+
border-radius: 50%;
|
|
736
515
|
}
|
|
737
516
|
|
|
738
|
-
.
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
border-left: solid var(--track-width) var(--track-color);
|
|
517
|
+
.button--circle.button--medium {
|
|
518
|
+
width: var(--sl-input-height-medium);
|
|
519
|
+
border-radius: 50%;
|
|
742
520
|
}
|
|
743
521
|
|
|
744
|
-
.
|
|
745
|
-
|
|
746
|
-
border-
|
|
522
|
+
.button--circle.button--large {
|
|
523
|
+
width: var(--sl-input-height-large);
|
|
524
|
+
border-radius: 50%;
|
|
747
525
|
}
|
|
748
526
|
|
|
749
|
-
.
|
|
750
|
-
|
|
751
|
-
|
|
527
|
+
.button--circle .button__prefix,
|
|
528
|
+
.button--circle .button__suffix,
|
|
529
|
+
.button--circle .button__caret {
|
|
530
|
+
display: none;
|
|
752
531
|
}
|
|
753
532
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
533
|
+
/*
|
|
534
|
+
* Caret modifier
|
|
535
|
+
*/
|
|
758
536
|
|
|
759
|
-
.
|
|
760
|
-
|
|
537
|
+
.button--caret .button__suffix {
|
|
538
|
+
display: none;
|
|
761
539
|
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
540
|
+
|
|
541
|
+
.button--caret .button__caret {
|
|
542
|
+
height: auto;
|
|
765
543
|
}
|
|
766
|
-
`,Ue=class extends qt{constructor(){super(...arguments),this.observedElements=[],this.disabled=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((t=>{this.emit("sl-resize",{detail:{entries:t}})})),this.disabled||this.startObserver()}disconnectedCallback(){super.disconnectedCallback(),this.stopObserver()}handleSlotChange(){this.disabled||this.startObserver()}startObserver(){const t=this.shadowRoot.querySelector("slot");if(null!==t){const e=t.assignedElements({flatten:!0});this.observedElements.forEach((t=>this.resizeObserver.unobserve(t))),this.observedElements=[],e.forEach((t=>{this.resizeObserver.observe(t),this.observedElements.push(t)}))}}stopObserver(){this.resizeObserver.disconnect()}handleDisabledChange(){this.disabled?this.stopObserver():this.startObserver()}render(){return lt` <slot @slotchange=${this.handleSlotChange}></slot> `}};Ue.styles=[Nt,He],u([It({type:Boolean,reflect:!0})],Ue.prototype,"disabled",2),u([Mt("disabled",{waitUntilFirstUpdate:!0})],Ue.prototype,"handleDisabledChange",1);var Ie=new Set;function Ve(t){if(Ie.add(t),!document.documentElement.classList.contains("sl-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",e),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${t}px`)}}function We(t){Ie.delete(t),0===Ie.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function je(t,e,o="vertical",r="smooth"){const i=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),s=i.top+e.scrollTop,n=i.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(n<a?e.scrollTo({left:n,behavior:r}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:r})),"vertical"!==o&&"both"!==o||(s<c?e.scrollTo({top:s,behavior:r}):s+t.clientHeight>h&&e.scrollTo({top:s-e.offsetHeight+t.clientHeight,behavior:r}))}var qe=class extends qt{constructor(){super(...arguments),this.tabs=[],this.focusableTabs=[],this.panels=[],this.localize=new De(this),this.hasScrollControls=!1,this.shouldHideScrollStartButton=!1,this.shouldHideScrollEndButton=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1,this.fixedScrollControls=!1,this.scrollOffset=1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator(),this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{const e=t.filter((({target:t})=>{if(t===this)return!0;if(t.closest("sl-tab-group")!==this)return!1;const e=t.tagName.toLowerCase();return"sl-tab"===e||"sl-tab-panel"===e}));if(0!==e.length)if(e.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),e.some((t=>"disabled"===t.attributeName)))this.syncTabsAndPanels();else if(e.some((t=>"active"===t.attributeName))){const t=e.filter((t=>"active"===t.attributeName&&"sl-tab"===t.target.tagName.toLowerCase())).map((t=>t.target)),o=t.find((t=>t.active));o&&this.setActiveTab(o)}})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,attributeFilter:["active","disabled","name","panel"],childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{var o;t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(null!=(o=this.getActiveTab())?o:this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){var t,e;super.disconnectedCallback(),null==(t=this.mutationObserver)||t.disconnect(),this.nav&&(null==(e=this.resizeObserver)||e.unobserve(this.nav))}getAllTabs(){return this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sl-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target.closest("sl-tab");(null==e?void 0:e.closest("sl-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sl-tab");if((null==e?void 0:e.closest("sl-tab-group"))===this&&(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key))){const e=this.tabs.find((t=>t.matches(":focus"))),o="rtl"===this.localize.dir();let r=null;if("sl-tab"===(null==e?void 0:e.tagName.toLowerCase())){if("Home"===t.key)r=this.focusableTabs[0];else if("End"===t.key)r=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key){const t=this.tabs.findIndex((t=>t===e));r=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key){const t=this.tabs.findIndex((t=>t===e));r=this.findNextFocusableTab(t,"forward")}if(!r)return;r.tabIndex=0,r.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(r,{scrollBehavior:"smooth"}):this.tabs.forEach((t=>{t.tabIndex=t===r?0:-1})),["top","bottom"].includes(this.placement)&&je(r,this.nav,"horizontal"),t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e=h({emitEvents:!0,scrollBehavior:"auto"},e),t!==this.activeTab&&!t.disabled){const o=this.activeTab;this.activeTab=t,this.tabs.forEach((t=>{t.active=t===this.activeTab,t.tabIndex=t===this.activeTab?0:-1})),this.panels.forEach((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),this.syncIndicator(),["top","bottom"].includes(this.placement)&&je(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(o&&this.emit("sl-tab-hide",{detail:{name:o.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}repositionIndicator(){const t=this.getActiveTab();if(!t)return;const e=t.clientWidth,o=t.clientHeight,r="rtl"===this.localize.dir(),i=this.getAllTabs(),s=i.slice(0,i.indexOf(t)).reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`,this.indicator.style.height="auto",this.indicator.style.translate=r?-1*s.left+"px":`${s.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${o}px`,this.indicator.style.translate=`0 ${s.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter((t=>!t.disabled)),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then((()=>this.updateScrollControls()))}findNextFocusableTab(t,e){let o=null;const r="forward"===e?1:-1;let i=t+r;for(;t<this.tabs.length;){if(o=this.tabs[i]||null,null===o){o="forward"===e?this.focusableTabs[0]:this.focusableTabs[this.focusableTabs.length-1];break}if(!o.disabled)break;i+=r}return o}updateScrollButtons(){this.hasScrollControls&&!this.fixedScrollControls&&(this.shouldHideScrollStartButton=this.scrollFromStart()<=this.scrollOffset,this.shouldHideScrollEndButton=this.isScrolledToEnd())}isScrolledToEnd(){return this.scrollFromStart()+this.nav.clientWidth>=this.nav.scrollWidth-this.scrollOffset}scrollFromStart(){return"rtl"===this.localize.dir()?-this.nav.scrollLeft:this.nav.scrollLeft}updateScrollControls(){this.noScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth+1,this.updateScrollButtons()}syncIndicator(){this.getActiveTab()?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return lt`
|
|
767
|
-
<div
|
|
768
|
-
part="base"
|
|
769
|
-
class=${Jt({"tab-group":!0,"tab-group--top":"top"===this.placement,"tab-group--bottom":"bottom"===this.placement,"tab-group--start":"start"===this.placement,"tab-group--end":"end"===this.placement,"tab-group--rtl":"rtl"===this.localize.dir(),"tab-group--has-scroll-controls":this.hasScrollControls})}
|
|
770
|
-
@click=${this.handleClick}
|
|
771
|
-
@keydown=${this.handleKeyDown}
|
|
772
|
-
>
|
|
773
|
-
<div class="tab-group__nav-container" part="nav">
|
|
774
|
-
${this.hasScrollControls?lt`
|
|
775
|
-
<sl-icon-button
|
|
776
|
-
part="scroll-button scroll-button--start"
|
|
777
|
-
exportparts="base:scroll-button__base"
|
|
778
|
-
class=${Jt({"tab-group__scroll-button":!0,"tab-group__scroll-button--start":!0,"tab-group__scroll-button--start--hidden":this.shouldHideScrollStartButton})}
|
|
779
|
-
name=${t?"chevron-right":"chevron-left"}
|
|
780
|
-
library="system"
|
|
781
|
-
tabindex="-1"
|
|
782
|
-
aria-hidden="true"
|
|
783
|
-
label=${this.localize.term("scrollToStart")}
|
|
784
|
-
@click=${this.handleScrollToStart}
|
|
785
|
-
></sl-icon-button>
|
|
786
|
-
`:""}
|
|
787
544
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
<sl-resize-observer @sl-resize=${this.syncIndicator}>
|
|
792
|
-
<slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot>
|
|
793
|
-
</sl-resize-observer>
|
|
794
|
-
</div>
|
|
795
|
-
</div>
|
|
545
|
+
/*
|
|
546
|
+
* Loading modifier
|
|
547
|
+
*/
|
|
796
548
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
class=${Jt({"tab-group__scroll-button":!0,"tab-group__scroll-button--end":!0,"tab-group__scroll-button--end--hidden":this.shouldHideScrollEndButton})}
|
|
802
|
-
name=${t?"chevron-left":"chevron-right"}
|
|
803
|
-
library="system"
|
|
804
|
-
tabindex="-1"
|
|
805
|
-
aria-hidden="true"
|
|
806
|
-
label=${this.localize.term("scrollToEnd")}
|
|
807
|
-
@click=${this.handleScrollToEnd}
|
|
808
|
-
></sl-icon-button>
|
|
809
|
-
`:""}
|
|
810
|
-
</div>
|
|
549
|
+
.button--loading {
|
|
550
|
+
position: relative;
|
|
551
|
+
cursor: wait;
|
|
552
|
+
}
|
|
811
553
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
819
|
-
*/({passive:!0})],qe.prototype,"updateScrollButtons",1),u([Mt("noScrollControls",{waitUntilFirstUpdate:!0})],qe.prototype,"updateScrollControls",1),u([Mt("placement",{waitUntilFirstUpdate:!0})],qe.prototype,"syncIndicator",1),qe.define("sl-tab-group");var Ke=(t,e)=>{let o=0;return function(...r){window.clearTimeout(o),o=window.setTimeout((()=>{t.call(this,...r)}),e)}},Ze=(t,e,o)=>{const r=t[e];t[e]=function(...t){r.call(this,...t),o.call(this,r,...t)}};(()=>{if("undefined"==typeof window)return;if(!("onscrollend"in window)){const t=new Set,e=new WeakMap,o=e=>{for(const o of e.changedTouches)t.add(o.identifier)},r=e=>{for(const o of e.changedTouches)t.delete(o.identifier)};document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",r,!0),document.addEventListener("touchcancel",r,!0),Ze(EventTarget.prototype,"addEventListener",(function(o,r){if("scrollend"!==r)return;const i=Ke((()=>{t.size?i():this.dispatchEvent(new Event("scrollend"))}),100);o.call(this,"scroll",i,{passive:!0}),e.set(this,i)})),Ze(EventTarget.prototype,"removeEventListener",(function(t,o){if("scrollend"!==o)return;const r=e.get(this);r&&t.call(this,"scroll",r,{passive:!0})}))}})();var Ge=A`
|
|
820
|
-
:host {
|
|
821
|
-
--padding: 0;
|
|
554
|
+
.button--loading .button__prefix,
|
|
555
|
+
.button--loading .button__label,
|
|
556
|
+
.button--loading .button__suffix,
|
|
557
|
+
.button--loading .button__caret {
|
|
558
|
+
visibility: hidden;
|
|
559
|
+
}
|
|
822
560
|
|
|
823
|
-
|
|
561
|
+
.button--loading sl-spinner {
|
|
562
|
+
--indicator-color: currentColor;
|
|
563
|
+
position: absolute;
|
|
564
|
+
font-size: 1em;
|
|
565
|
+
height: 1em;
|
|
566
|
+
width: 1em;
|
|
567
|
+
top: calc(50% - 0.5em);
|
|
568
|
+
left: calc(50% - 0.5em);
|
|
824
569
|
}
|
|
825
570
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
571
|
+
/*
|
|
572
|
+
* Badges
|
|
573
|
+
*/
|
|
829
574
|
|
|
830
|
-
.
|
|
831
|
-
|
|
832
|
-
|
|
575
|
+
.button ::slotted(sl-badge) {
|
|
576
|
+
position: absolute;
|
|
577
|
+
top: 0;
|
|
578
|
+
right: 0;
|
|
579
|
+
translate: 50% -50%;
|
|
580
|
+
pointer-events: none;
|
|
833
581
|
}
|
|
834
|
-
`,Xe=0,Ye=class extends qt{constructor(){super(...arguments),this.attrId=++Xe,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return lt`
|
|
835
|
-
<slot
|
|
836
|
-
part="base"
|
|
837
|
-
class=${Jt({"tab-panel":!0,"tab-panel--active":this.active})}
|
|
838
|
-
></slot>
|
|
839
|
-
`}};Ye.styles=[Nt,Ge],u([It({reflect:!0})],Ye.prototype,"name",2),u([It({type:Boolean,reflect:!0})],Ye.prototype,"active",2),u([Mt("active")],Ye.prototype,"handleActiveChange",1),Ye.define("sl-tab-panel");var Je=A`
|
|
840
|
-
:host {
|
|
841
|
-
--max-width: 20rem;
|
|
842
|
-
--hide-delay: 0ms;
|
|
843
|
-
--show-delay: 150ms;
|
|
844
582
|
|
|
845
|
-
|
|
583
|
+
.button--rtl ::slotted(sl-badge) {
|
|
584
|
+
right: auto;
|
|
585
|
+
left: 0;
|
|
586
|
+
translate: -50% -50%;
|
|
846
587
|
}
|
|
847
588
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
}
|
|
589
|
+
/*
|
|
590
|
+
* Button spacing
|
|
591
|
+
*/
|
|
852
592
|
|
|
853
|
-
.
|
|
854
|
-
|
|
593
|
+
.button--has-label.button--small .button__label {
|
|
594
|
+
padding: 0 var(--sl-spacing-small);
|
|
855
595
|
}
|
|
856
596
|
|
|
857
|
-
.
|
|
858
|
-
|
|
597
|
+
.button--has-label.button--medium .button__label {
|
|
598
|
+
padding: 0 var(--sl-spacing-medium);
|
|
859
599
|
}
|
|
860
600
|
|
|
861
|
-
.
|
|
862
|
-
|
|
601
|
+
.button--has-label.button--large .button__label {
|
|
602
|
+
padding: 0 var(--sl-spacing-large);
|
|
863
603
|
}
|
|
864
604
|
|
|
865
|
-
.
|
|
866
|
-
|
|
605
|
+
.button--has-prefix.button--small {
|
|
606
|
+
padding-inline-start: var(--sl-spacing-x-small);
|
|
867
607
|
}
|
|
868
608
|
|
|
869
|
-
.
|
|
870
|
-
|
|
609
|
+
.button--has-prefix.button--small .button__label {
|
|
610
|
+
padding-inline-start: var(--sl-spacing-x-small);
|
|
871
611
|
}
|
|
872
612
|
|
|
873
|
-
.
|
|
874
|
-
|
|
875
|
-
width: max-content;
|
|
876
|
-
max-width: var(--max-width);
|
|
877
|
-
border-radius: var(--sl-tooltip-border-radius);
|
|
878
|
-
background-color: var(--sl-tooltip-background-color);
|
|
879
|
-
font-family: var(--sl-tooltip-font-family);
|
|
880
|
-
font-size: var(--sl-tooltip-font-size);
|
|
881
|
-
font-weight: var(--sl-tooltip-font-weight);
|
|
882
|
-
line-height: var(--sl-tooltip-line-height);
|
|
883
|
-
text-align: start;
|
|
884
|
-
white-space: normal;
|
|
885
|
-
color: var(--sl-tooltip-color);
|
|
886
|
-
padding: var(--sl-tooltip-padding);
|
|
887
|
-
pointer-events: none;
|
|
888
|
-
user-select: none;
|
|
889
|
-
-webkit-user-select: none;
|
|
613
|
+
.button--has-prefix.button--medium {
|
|
614
|
+
padding-inline-start: var(--sl-spacing-small);
|
|
890
615
|
}
|
|
891
|
-
`,Qe=A`
|
|
892
|
-
:host {
|
|
893
|
-
--arrow-color: var(--sl-color-neutral-1000);
|
|
894
|
-
--arrow-size: 6px;
|
|
895
616
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
*/
|
|
900
|
-
--arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
|
|
901
|
-
--arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
|
|
617
|
+
.button--has-prefix.button--medium .button__label {
|
|
618
|
+
padding-inline-start: var(--sl-spacing-small);
|
|
619
|
+
}
|
|
902
620
|
|
|
903
|
-
|
|
621
|
+
.button--has-prefix.button--large {
|
|
622
|
+
padding-inline-start: var(--sl-spacing-small);
|
|
904
623
|
}
|
|
905
624
|
|
|
906
|
-
.
|
|
907
|
-
|
|
908
|
-
isolation: isolate;
|
|
909
|
-
max-width: var(--auto-size-available-width, none);
|
|
910
|
-
max-height: var(--auto-size-available-height, none);
|
|
625
|
+
.button--has-prefix.button--large .button__label {
|
|
626
|
+
padding-inline-start: var(--sl-spacing-small);
|
|
911
627
|
}
|
|
912
628
|
|
|
913
|
-
.
|
|
914
|
-
|
|
629
|
+
.button--has-suffix.button--small,
|
|
630
|
+
.button--caret.button--small {
|
|
631
|
+
padding-inline-end: var(--sl-spacing-x-small);
|
|
915
632
|
}
|
|
916
633
|
|
|
917
|
-
.
|
|
918
|
-
|
|
634
|
+
.button--has-suffix.button--small .button__label,
|
|
635
|
+
.button--caret.button--small .button__label {
|
|
636
|
+
padding-inline-end: var(--sl-spacing-x-small);
|
|
919
637
|
}
|
|
920
638
|
|
|
921
|
-
.
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
height: calc(var(--arrow-size-diagonal) * 2);
|
|
925
|
-
rotate: 45deg;
|
|
926
|
-
background: var(--arrow-color);
|
|
927
|
-
z-index: -1;
|
|
639
|
+
.button--has-suffix.button--medium,
|
|
640
|
+
.button--caret.button--medium {
|
|
641
|
+
padding-inline-end: var(--sl-spacing-small);
|
|
928
642
|
}
|
|
929
643
|
|
|
930
|
-
|
|
931
|
-
.
|
|
932
|
-
|
|
644
|
+
.button--has-suffix.button--medium .button__label,
|
|
645
|
+
.button--caret.button--medium .button__label {
|
|
646
|
+
padding-inline-end: var(--sl-spacing-small);
|
|
933
647
|
}
|
|
934
648
|
|
|
935
|
-
.
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
top: 0;
|
|
939
|
-
right: 0;
|
|
940
|
-
bottom: 0;
|
|
941
|
-
left: 0;
|
|
942
|
-
clip-path: polygon(
|
|
943
|
-
var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
|
|
944
|
-
var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
|
|
945
|
-
var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
|
|
946
|
-
var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
|
|
947
|
-
);
|
|
649
|
+
.button--has-suffix.button--large,
|
|
650
|
+
.button--caret.button--large {
|
|
651
|
+
padding-inline-end: var(--sl-spacing-small);
|
|
948
652
|
}
|
|
949
|
-
`;const to=Math.min,eo=Math.max,oo=Math.round,ro=Math.floor,io=t=>({x:t,y:t}),so={left:"right",right:"left",bottom:"top",top:"bottom"},no={start:"end",end:"start"};function ao(t,e,o){return eo(t,to(e,o))}function lo(t,e){return"function"==typeof t?t(e):t}function co(t){return t.split("-")[0]}function ho(t){return t.split("-")[1]}function uo(t){return"x"===t?"y":"x"}function po(t){return"y"===t?"height":"width"}const bo=new Set(["top","bottom"]);function fo(t){return bo.has(co(t))?"y":"x"}function go(t){return uo(fo(t))}function mo(t){return t.replace(/start|end/g,(t=>no[t]))}const vo=["left","right"],yo=["right","left"],wo=["top","bottom"],_o=["bottom","top"];function xo(t,e,o,r){const i=ho(t);let s=function(t,e,o){switch(t){case"top":case"bottom":return o?e?yo:vo:e?vo:yo;case"left":case"right":return e?wo:_o;default:return[]}}(co(t),"start"===o,r);return i&&(s=s.map((t=>t+"-"+i)),e&&(s=s.concat(s.map(mo)))),s}function ko(t){return t.replace(/left|right|bottom|top/g,(t=>so[t]))}function $o(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Co(t){const{x:e,y:o,width:r,height:i}=t;return{width:r,height:i,top:o,left:e,right:e+r,bottom:o+i,x:e,y:o}}function Ao(t,e,o){let{reference:r,floating:i}=t;const s=fo(e),n=go(e),a=po(n),l=co(e),c="y"===s,h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,u=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:h,y:r.y-i.height};break;case"bottom":p={x:h,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ho(e)){case"start":p[n]-=u*(o&&c?-1:1);break;case"end":p[n]+=u*(o&&c?-1:1)}return p}async function Eo(t,e){var o;void 0===e&&(e={});const{x:r,y:i,platform:s,rects:n,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=lo(e,t),b=$o(p),f=a[u?"floating"===d?"reference":"floating":d],g=Co(await s.getClippingRect({element:null==(o=await(null==s.isElement?void 0:s.isElement(f)))||o?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),m="floating"===d?{x:r,y:i,width:n.floating.width,height:n.floating.height}:n.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},w=Co(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:l}):m);return{top:(g.top-w.top+b.top)/y.y,bottom:(w.bottom-g.bottom+b.bottom)/y.y,left:(g.left-w.left+b.left)/y.x,right:(w.right-g.right+b.right)/y.x}}const So=new Set(["left","top"]);function zo(){return"undefined"!=typeof window}function To(t){return Oo(t)?(t.nodeName||"").toLowerCase():"#document"}function Po(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Lo(t){var e;return null==(e=(Oo(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Oo(t){return!!zo()&&(t instanceof Node||t instanceof Po(t).Node)}function Bo(t){return!!zo()&&(t instanceof Element||t instanceof Po(t).Element)}function Fo(t){return!!zo()&&(t instanceof HTMLElement||t instanceof Po(t).HTMLElement)}function Do(t){return!(!zo()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Po(t).ShadowRoot)}const Ro=new Set(["inline","contents"]);function Mo(t){const{overflow:e,overflowX:o,overflowY:r,display:i}=Xo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+o)&&!Ro.has(i)}const No=new Set(["table","td","th"]);function Ho(t){return No.has(To(t))}const Uo=[":popover-open",":modal"];function Io(t){return Uo.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const Vo=["transform","translate","scale","rotate","perspective"],Wo=["transform","translate","scale","rotate","perspective","filter"],jo=["paint","layout","strict","content"];function qo(t){const e=Ko(),o=Bo(t)?Xo(t):t;return Vo.some((t=>!!o[t]&&"none"!==o[t]))||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||Wo.some((t=>(o.willChange||"").includes(t)))||jo.some((t=>(o.contain||"").includes(t)))}function Ko(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Zo=new Set(["html","body","#document"]);function Go(t){return Zo.has(To(t))}function Xo(t){return Po(t).getComputedStyle(t)}function Yo(t){return Bo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Jo(t){if("html"===To(t))return t;const e=t.assignedSlot||t.parentNode||Do(t)&&t.host||Lo(t);return Do(e)?e.host:e}function Qo(t){const e=Jo(t);return Go(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fo(e)&&Mo(e)?e:Qo(e)}function tr(t,e,o){var r;void 0===e&&(e=[]),void 0===o&&(o=!0);const i=Qo(t),s=i===(null==(r=t.ownerDocument)?void 0:r.body),n=Po(i);if(s){const t=er(n);return e.concat(n,n.visualViewport||[],Mo(i)?i:[],t&&o?tr(t):[])}return e.concat(i,tr(i,[],o))}function er(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function or(t){const e=Xo(t);let o=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Fo(t),s=i?t.offsetWidth:o,n=i?t.offsetHeight:r,a=oo(o)!==s||oo(r)!==n;return a&&(o=s,r=n),{width:o,height:r,$:a}}function rr(t){return Bo(t)?t:t.contextElement}function ir(t){const e=rr(t);if(!Fo(e))return io(1);const o=e.getBoundingClientRect(),{width:r,height:i,$:s}=or(e);let n=(s?oo(o.width):o.width)/r,a=(s?oo(o.height):o.height)/i;return n&&Number.isFinite(n)||(n=1),a&&Number.isFinite(a)||(a=1),{x:n,y:a}}const sr=io(0);function nr(t){const e=Po(t);return Ko()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:sr}function ar(t,e,o,r){void 0===e&&(e=!1),void 0===o&&(o=!1);const i=t.getBoundingClientRect(),s=rr(t);let n=io(1);e&&(r?Bo(r)&&(n=ir(r)):n=ir(t));const a=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==Po(t))&&e}(s,o,r)?nr(s):io(0);let l=(i.left+a.x)/n.x,c=(i.top+a.y)/n.y,h=i.width/n.x,d=i.height/n.y;if(s){const t=Po(s),e=r&&Bo(r)?Po(r):r;let o=t,i=er(o);for(;i&&r&&e!==o;){const t=ir(i),e=i.getBoundingClientRect(),r=Xo(i),s=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,n=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=s,c+=n,o=Po(i),i=er(o)}}return Co({width:h,height:d,x:l,y:c})}function lr(t,e){const o=Yo(t).scrollLeft;return e?e.left+o:ar(Lo(t)).left+o}function cr(t,e){const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-lr(t,o),y:o.top+e.scrollTop}}const hr=25;const dr=new Set(["absolute","fixed"]);function ur(t,e,o){let r;if("viewport"===e)r=function(t,e){const o=Po(t),r=Lo(t),i=o.visualViewport;let s=r.clientWidth,n=r.clientHeight,a=0,l=0;if(i){s=i.width,n=i.height;const t=Ko();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop)}const c=lr(r);if(c<=0){const t=r.ownerDocument,e=t.body,o=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(o.marginLeft)+parseFloat(o.marginRight)||0,n=Math.abs(r.clientWidth-e.clientWidth-i);n<=hr&&(s-=n)}else c<=hr&&(s+=c);return{width:s,height:n,x:a,y:l}}(t,o);else if("document"===e)r=function(t){const e=Lo(t),o=Yo(t),r=t.ownerDocument.body,i=eo(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=eo(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let n=-o.scrollLeft+lr(t);const a=-o.scrollTop;return"rtl"===Xo(r).direction&&(n+=eo(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:n,y:a}}(Lo(t));else if(Bo(e))r=function(t,e){const o=ar(t,!0,"fixed"===e),r=o.top+t.clientTop,i=o.left+t.clientLeft,s=Fo(t)?ir(t):io(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:r*s.y}}(e,o);else{const o=nr(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Co(r)}function pr(t,e){const o=Jo(t);return!(o===e||!Bo(o)||Go(o))&&("fixed"===Xo(o).position||pr(o,e))}function br(t,e,o){const r=Fo(e),i=Lo(e),s="fixed"===o,n=ar(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=io(0);function c(){l.x=lr(i)}if(r||!r&&!s)if(("body"!==To(e)||Mo(i))&&(a=Yo(e)),r){const t=ar(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&c();s&&!r&&i&&c();const h=!i||r||s?io(0):cr(i,a);return{x:n.left+a.scrollLeft-l.x-h.x,y:n.top+a.scrollTop-l.y-h.y,width:n.width,height:n.height}}function fr(t){return"static"===Xo(t).position}function gr(t,e){if(!Fo(t)||"fixed"===Xo(t).position)return null;if(e)return e(t);let o=t.offsetParent;return Lo(t)===o&&(o=o.ownerDocument.body),o}function mr(t,e){const o=Po(t);if(Io(t))return o;if(!Fo(t)){let e=Jo(t);for(;e&&!Go(e);){if(Bo(e)&&!fr(e))return e;e=Jo(e)}return o}let r=gr(t,e);for(;r&&Ho(r)&&fr(r);)r=gr(r,e);return r&&Go(r)&&fr(r)&&!qo(r)?o:r||function(t){let e=Jo(t);for(;Fo(e)&&!Go(e);){if(qo(e))return e;if(Io(e))return null;e=Jo(e)}return null}(t)||o}const vr={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:r,strategy:i}=t;const s="fixed"===i,n=Lo(r),a=!!e&&Io(e.floating);if(r===n||a&&s)return o;let l={scrollLeft:0,scrollTop:0},c=io(1);const h=io(0),d=Fo(r);if((d||!d&&!s)&&(("body"!==To(r)||Mo(n))&&(l=Yo(r)),Fo(r))){const t=ar(r);c=ir(r),h.x=t.x+r.clientLeft,h.y=t.y+r.clientTop}const u=!n||d||s?io(0):cr(n,l);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+h.x+u.x,y:o.y*c.y-l.scrollTop*c.y+h.y+u.y}},getDocumentElement:Lo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:i}=t;const s=[..."clippingAncestors"===o?Io(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let r=tr(t,[],!1).filter((t=>Bo(t)&&"body"!==To(t))),i=null;const s="fixed"===Xo(t).position;let n=s?Jo(t):t;for(;Bo(n)&&!Go(n);){const e=Xo(n),o=qo(n);o||"fixed"!==e.position||(i=null),(s?!o&&!i:!o&&"static"===e.position&&i&&dr.has(i.position)||Mo(n)&&!o&&pr(t,n))?r=r.filter((t=>t!==n)):i=e,n=Jo(n)}return e.set(t,r),r}(e,this._c):[].concat(o),r],n=s[0],a=s.reduce(((t,o)=>{const r=ur(e,o,i);return t.top=eo(r.top,t.top),t.right=to(r.right,t.right),t.bottom=to(r.bottom,t.bottom),t.left=eo(r.left,t.left),t}),ur(e,n,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:mr,getElementRects:async function(t){const e=this.getOffsetParent||mr,o=this.getDimensions,r=await o(t.floating);return{reference:br(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=or(t);return{width:e,height:o}},getScale:ir,isElement:Bo,isRTL:function(t){return"rtl"===Xo(t).direction}};function yr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wr(t,e,o,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=rr(t),h=i||s?[...c?tr(c):[],...tr(e)]:[];h.forEach((t=>{i&&t.addEventListener("scroll",o,{passive:!0}),s&&t.addEventListener("resize",o)}));const d=c&&a?function(t,e){let o,r=null;const i=Lo(t);function s(){var t;clearTimeout(o),null==(t=r)||t.disconnect(),r=null}return function n(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();const c=t.getBoundingClientRect(),{left:h,top:d,width:u,height:p}=c;if(a||e(),!u||!p)return;const b={rootMargin:-ro(d)+"px "+-ro(i.clientWidth-(h+u))+"px "+-ro(i.clientHeight-(d+p))+"px "+-ro(h)+"px",threshold:eo(0,to(1,l))||1};let f=!0;function g(e){const r=e[0].intersectionRatio;if(r!==l){if(!f)return n();r?n(!1,r):o=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==r||yr(c,t.getBoundingClientRect())||n(),f=!1}try{r=new IntersectionObserver(g,{...b,root:i.ownerDocument})}catch(t){r=new IntersectionObserver(g,b)}r.observe(t)}(!0),s}(c,o):null;let u,p=-1,b=null;n&&(b=new ResizeObserver((t=>{let[r]=t;r&&r.target===c&&b&&(b.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=b)||t.observe(e)}))),o()})),c&&!l&&b.observe(c),b.observe(e));let f=l?ar(t):null;return l&&function e(){const r=ar(t);f&&!yr(f,r)&&o();f=r,u=requestAnimationFrame(e)}(),o(),()=>{var t;h.forEach((t=>{i&&t.removeEventListener("scroll",o),s&&t.removeEventListener("resize",o)})),null==d||d(),null==(t=b)||t.disconnect(),b=null,l&&cancelAnimationFrame(u)}}const _r=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,r;const{x:i,y:s,placement:n,middlewareData:a}=e,l=await async function(t,e){const{placement:o,platform:r,elements:i}=t,s=await(null==r.isRTL?void 0:r.isRTL(i.floating)),n=co(o),a=ho(o),l="y"===fo(o),c=So.has(n)?-1:1,h=s&&l?-1:1,d=lo(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:b}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof b&&(p="end"===a?-1*b:b),l?{x:p*h,y:u*c}:{x:u*c,y:p*h}}(e,t);return n===(null==(o=a.offset)?void 0:o.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:n}}}}},xr=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:n=!1,limiter:a={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=lo(t,e),c={x:o,y:r},h=await Eo(e,l),d=fo(co(i)),u=uo(d);let p=c[u],b=c[d];if(s){const t="y"===u?"bottom":"right";p=ao(p+h["y"===u?"top":"left"],p,p-h[t])}if(n){const t="y"===d?"bottom":"right";b=ao(b+h["y"===d?"top":"left"],b,b-h[t])}const f=a.fn({...e,[u]:p,[d]:b});return{...f,data:{x:f.x-o,y:f.y-r,enabled:{[u]:s,[d]:n}}}}}},kr=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,r;const{placement:i,middlewareData:s,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...g}=lo(t,e);if(null!=(o=s.arrow)&&o.alignmentOffset)return{};const m=co(i),v=fo(a),y=co(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=u||(y||!f?[ko(a)]:function(t){const e=ko(t);return[mo(t),e,mo(e)]}(a)),x="none"!==b;!u&&x&&_.push(...xo(a,f,b,w));const k=[a,..._],$=await Eo(e,g),C=[];let A=(null==(r=s.flip)?void 0:r.overflows)||[];if(h&&C.push($[m]),d){const t=function(t,e,o){void 0===o&&(o=!1);const r=ho(t),i=go(t),s=po(i);let n="x"===i?r===(o?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[s]>e.floating[s]&&(n=ko(n)),[n,ko(n)]}(i,n,w);C.push($[t[0]],$[t[1]])}if(A=[...A,{placement:i,overflows:C}],!C.every((t=>t<=0))){var E,S;const t=((null==(E=s.flip)?void 0:E.index)||0)+1,e=k[t];if(e){if(!("alignment"===d&&v!==fo(e))||A.every((t=>fo(t.placement)!==v||t.overflows[0]>0)))return{data:{index:t,overflows:A},reset:{placement:e}}}let o=null==(S=A.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var z;const t=null==(z=A.filter((t=>{if(x){const e=fo(t.placement);return e===v||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:z[0];t&&(o=t);break}case"initialPlacement":o=a}if(i!==o)return{reset:{placement:o}}}return{}}}},$r=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var o,r;const{placement:i,rects:s,platform:n,elements:a}=e,{apply:l=()=>{},...c}=lo(t,e),h=await Eo(e,c),d=co(i),u=ho(i),p="y"===fo(i),{width:b,height:f}=s.floating;let g,m;"top"===d||"bottom"===d?(g=d,m=u===(await(null==n.isRTL?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,g="end"===u?"top":"bottom");const v=f-h.top-h.bottom,y=b-h.left-h.right,w=to(f-h[g],v),_=to(b-h[m],y),x=!e.middlewareData.shift;let k=w,$=_;if(null!=(o=e.middlewareData.shift)&&o.enabled.x&&($=y),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(k=v),x&&!u){const t=eo(h.left,0),e=eo(h.right,0),o=eo(h.top,0),r=eo(h.bottom,0);p?$=b-2*(0!==t||0!==e?t+e:eo(h.left,h.right)):k=f-2*(0!==o||0!==r?o+r:eo(h.top,h.bottom))}await l({...e,availableWidth:$,availableHeight:k});const C=await n.getDimensions(a.floating);return b!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},Cr=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:r,placement:i,rects:s,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=lo(t,e)||{};if(null==c)return{};const d=$o(h),u={x:o,y:r},p=go(i),b=po(p),f=await n.getDimensions(c),g="y"===p,m=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[p]-u[p]-s.floating[b],_=u[p]-s.reference[p],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let k=x?x[y]:0;k&&await(null==n.isElement?void 0:n.isElement(x))||(k=a.floating[y]||s.floating[b]);const $=w/2-_/2,C=k/2-f[b]/2-1,A=to(d[m],C),E=to(d[v],C),S=A,z=k-f[b]-E,T=k/2-f[b]/2+$,P=ao(S,T,z),L=!l.arrow&&null!=ho(i)&&T!==P&&s.reference[b]/2-(T<S?A:E)-f[b]/2<0,O=L?T<S?T-S:T-z:0;return{[p]:u[p]+O,data:{[p]:P,centerOffset:T-P-O,...L&&{alignmentOffset:O}},reset:L}}}),Ar=(t,e,o)=>{const r=new Map,i={platform:vr,...o},s={...i.platform,_c:r};return(async(t,e,o)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:n}=o,a=s.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=Ao(c,r,l),u=r,p={},b=0;for(let o=0;o<a.length;o++){const{name:s,fn:f}=a[o],{x:g,y:m,data:v,reset:y}=await f({x:h,y:d,initialPlacement:r,placement:u,strategy:i,middlewareData:p,rects:c,platform:n,elements:{reference:t,floating:e}});h=null!=g?g:h,d=null!=m?m:d,p={...p,[s]:{...p[s],...v}},y&&b<=50&&(b++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await n.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:h,y:d}=Ao(c,u,l))),o=-1)}return{x:h,y:d,placement:u,strategy:i,middlewareData:p}})(t,e,{...i,platform:s})};function Er(t){return function(t){for(let e=t;e;e=Sr(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Sr(t);e;e=Sr(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||qo(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Sr(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var zr=class extends qt{constructor(){super(...arguments),this.localize=new De(this),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,r=0,i=0,s=0,n=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top<e.top?(o=t.left,r=t.bottom,i=t.right,s=t.bottom,n=e.left,a=e.top,l=e.right,c=e.top):(o=e.left,r=e.bottom,i=e.right,s=e.bottom,n=t.left,a=t.top,l=t.right,c=t.top):t.left<e.left?(o=t.right,r=t.top,i=e.left,s=e.top,n=t.right,a=t.bottom,l=e.left,c=e.bottom):(o=e.right,r=e.top,i=t.left,s=t.top,n=e.right,a=e.bottom,l=t.left,c=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${o}px`),this.style.setProperty("--hover-bridge-top-left-y",`${r}px`),this.style.setProperty("--hover-bridge-top-right-x",`${i}px`),this.style.setProperty("--hover-bridge-top-right-y",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${a}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${c}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||function(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t&&(!("contextElement"in t)||t.contextElement instanceof Element)}(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.active&&this.start()}start(){this.anchorEl&&this.active&&(this.cleanup=wr(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[_r({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push($r({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(kr({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(xr({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push($r({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Cr({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>vr.getOffsetParent(t,Er):vr.getOffsetParent;Ar(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:d(h({},vr),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:o,placement:r})=>{const i="rtl"===this.localize.dir(),s={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let r="",n="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";r="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=i?o:"",l=i?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=i?"":o,l=i?o:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",r="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",r="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:r,right:n,bottom:a,left:l,[s]:"calc(var(--arrow-size-diagonal) * -1)"})}})),requestAnimationFrame((()=>this.updateHoverBridge())),this.emit("sl-reposition")}render(){return lt`
|
|
950
|
-
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
951
653
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
654
|
+
.button--has-suffix.button--large .button__label,
|
|
655
|
+
.button--caret.button--large .button__label {
|
|
656
|
+
padding-inline-end: var(--sl-spacing-small);
|
|
657
|
+
}
|
|
956
658
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
</div>
|
|
964
|
-
`}};function Tr(t,e){return new Promise((o=>{t.addEventListener(e,(function r(i){i.target===t&&(t.removeEventListener(e,r),o())}))}))}function Pr(t,e,o){return new Promise((r=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const i=t.animate(e,d(h({},o),{duration:Or()?0:o.duration}));i.addEventListener("cancel",r,{once:!0}),i.addEventListener("finish",r,{once:!0})}))}function Lr(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function Or(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Br(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel(),requestAnimationFrame(e)})))))}zr.styles=[Nt,Qe],u([Wt(".popup")],zr.prototype,"popup",2),u([Wt(".popup__arrow")],zr.prototype,"arrowEl",2),u([It()],zr.prototype,"anchor",2),u([It({type:Boolean,reflect:!0})],zr.prototype,"active",2),u([It({reflect:!0})],zr.prototype,"placement",2),u([It({reflect:!0})],zr.prototype,"strategy",2),u([It({type:Number})],zr.prototype,"distance",2),u([It({type:Number})],zr.prototype,"skidding",2),u([It({type:Boolean})],zr.prototype,"arrow",2),u([It({attribute:"arrow-placement"})],zr.prototype,"arrowPlacement",2),u([It({attribute:"arrow-padding",type:Number})],zr.prototype,"arrowPadding",2),u([It({type:Boolean})],zr.prototype,"flip",2),u([It({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],zr.prototype,"flipFallbackPlacements",2),u([It({attribute:"flip-fallback-strategy"})],zr.prototype,"flipFallbackStrategy",2),u([It({type:Object})],zr.prototype,"flipBoundary",2),u([It({attribute:"flip-padding",type:Number})],zr.prototype,"flipPadding",2),u([It({type:Boolean})],zr.prototype,"shift",2),u([It({type:Object})],zr.prototype,"shiftBoundary",2),u([It({attribute:"shift-padding",type:Number})],zr.prototype,"shiftPadding",2),u([It({attribute:"auto-size"})],zr.prototype,"autoSize",2),u([It()],zr.prototype,"sync",2),u([It({type:Object})],zr.prototype,"autoSizeBoundary",2),u([It({attribute:"auto-size-padding",type:Number})],zr.prototype,"autoSizePadding",2),u([It({attribute:"hover-bridge",type:Boolean})],zr.prototype,"hoverBridge",2);var Fr=class extends qt{constructor(){super(),this.localize=new De(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=Lr(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=Lr(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await Br(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=w(this,"tooltip.show",{dir:this.localize.dir()});await Pr(this.popup.popup,e,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await Br(this.body);const{keyframes:t,options:o}=w(this,"tooltip.hide",{dir:this.localize.dir()});await Pr(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,Tr(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Tr(this,"sl-after-hide")}render(){return lt`
|
|
965
|
-
<sl-popup
|
|
966
|
-
part="base"
|
|
967
|
-
exportparts="
|
|
968
|
-
popup:base__popup,
|
|
969
|
-
arrow:base__arrow
|
|
970
|
-
"
|
|
971
|
-
class=${Jt({tooltip:!0,"tooltip--open":this.open})}
|
|
972
|
-
placement=${this.placement}
|
|
973
|
-
distance=${this.distance}
|
|
974
|
-
skidding=${this.skidding}
|
|
975
|
-
strategy=${this.hoist?"fixed":"absolute"}
|
|
976
|
-
flip
|
|
977
|
-
shift
|
|
978
|
-
arrow
|
|
979
|
-
hover-bridge
|
|
980
|
-
>
|
|
981
|
-
${""}
|
|
982
|
-
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
|
659
|
+
/*
|
|
660
|
+
* Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
|
|
661
|
+
* This means buttons aren't always direct descendants of the button group, thus we can't target them with the
|
|
662
|
+
* ::slotted selector. To work around this, the button group component does some magic to add these special classes to
|
|
663
|
+
* buttons and we style them here instead.
|
|
664
|
+
*/
|
|
983
665
|
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
</sl-popup>
|
|
989
|
-
`}};Fr.styles=[Nt,Je],Fr.dependencies={"sl-popup":zr},u([Wt("slot:not([name])")],Fr.prototype,"defaultSlot",2),u([Wt(".tooltip__body")],Fr.prototype,"body",2),u([Wt("sl-popup")],Fr.prototype,"popup",2),u([It()],Fr.prototype,"content",2),u([It()],Fr.prototype,"placement",2),u([It({type:Boolean,reflect:!0})],Fr.prototype,"disabled",2),u([It({type:Number})],Fr.prototype,"distance",2),u([It({type:Boolean,reflect:!0})],Fr.prototype,"open",2),u([It({type:Number})],Fr.prototype,"skidding",2),u([It()],Fr.prototype,"trigger",2),u([It({type:Boolean})],Fr.prototype,"hoist",2),u([Mt("open",{waitUntilFirstUpdate:!0})],Fr.prototype,"handleOpenChange",1),u([Mt(["content","distance","hoist","placement","skidding"])],Fr.prototype,"handleOptionsChange",1),u([Mt("disabled")],Fr.prototype,"handleDisabledChange",1),y("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),y("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),Fr.define("sl-tooltip");var Dr=A`
|
|
990
|
-
:host {
|
|
991
|
-
--height: 1rem;
|
|
992
|
-
--track-color: var(--sl-color-neutral-200);
|
|
993
|
-
--indicator-color: var(--sl-color-primary-600);
|
|
994
|
-
--label-color: var(--sl-color-neutral-0);
|
|
666
|
+
:host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button {
|
|
667
|
+
border-start-end-radius: 0;
|
|
668
|
+
border-end-end-radius: 0;
|
|
669
|
+
}
|
|
995
670
|
|
|
996
|
-
|
|
671
|
+
:host([data-sl-button-group__button--inner]) .button {
|
|
672
|
+
border-radius: 0;
|
|
997
673
|
}
|
|
998
674
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
height: var(--height);
|
|
1003
|
-
border-radius: var(--sl-border-radius-pill);
|
|
1004
|
-
box-shadow: inset var(--sl-shadow-small);
|
|
1005
|
-
overflow: hidden;
|
|
675
|
+
:host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button {
|
|
676
|
+
border-start-start-radius: 0;
|
|
677
|
+
border-end-start-radius: 0;
|
|
1006
678
|
}
|
|
1007
679
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
font-size: 12px;
|
|
1012
|
-
font-weight: var(--sl-font-weight-normal);
|
|
1013
|
-
background-color: var(--indicator-color);
|
|
1014
|
-
color: var(--label-color);
|
|
1015
|
-
text-align: center;
|
|
1016
|
-
line-height: var(--height);
|
|
1017
|
-
white-space: nowrap;
|
|
1018
|
-
overflow: hidden;
|
|
1019
|
-
transition:
|
|
1020
|
-
400ms width,
|
|
1021
|
-
400ms background-color;
|
|
1022
|
-
user-select: none;
|
|
1023
|
-
-webkit-user-select: none;
|
|
680
|
+
/* All except the first */
|
|
681
|
+
:host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) {
|
|
682
|
+
margin-inline-start: calc(-1 * var(--sl-input-border-width));
|
|
1024
683
|
}
|
|
1025
684
|
|
|
1026
|
-
/*
|
|
1027
|
-
|
|
685
|
+
/* Add a visual separator between solid buttons */
|
|
686
|
+
:host(
|
|
687
|
+
[data-sl-button-group__button]:not(
|
|
688
|
+
[data-sl-button-group__button--first],
|
|
689
|
+
[data-sl-button-group__button--radio],
|
|
690
|
+
[variant='default']
|
|
691
|
+
):not(:hover)
|
|
692
|
+
)
|
|
693
|
+
.button:after {
|
|
694
|
+
content: '';
|
|
1028
695
|
position: absolute;
|
|
1029
|
-
|
|
696
|
+
top: 0;
|
|
697
|
+
inset-inline-start: 0;
|
|
698
|
+
bottom: 0;
|
|
699
|
+
border-left: solid 1px rgb(128 128 128 / 33%);
|
|
700
|
+
mix-blend-mode: multiply;
|
|
1030
701
|
}
|
|
1031
702
|
|
|
1032
|
-
|
|
1033
|
-
|
|
703
|
+
/* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
|
|
704
|
+
:host([data-sl-button-group__button--hover]) {
|
|
705
|
+
z-index: 1;
|
|
1034
706
|
}
|
|
1035
707
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
.progress-bar__indicator {
|
|
1043
|
-
outline: solid 1px SelectedItem;
|
|
1044
|
-
background-color: SelectedItem;
|
|
1045
|
-
}
|
|
708
|
+
/* Focus and checked are always on top */
|
|
709
|
+
:host([data-sl-button-group__button--focus]),
|
|
710
|
+
:host([data-sl-button-group__button][checked]) {
|
|
711
|
+
z-index: 2;
|
|
1046
712
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
75%,
|
|
1054
|
-
100% {
|
|
1055
|
-
left: 100%;
|
|
1056
|
-
width: 50%;
|
|
1057
|
-
}
|
|
713
|
+
`,Qt=class{constructor(t,...e){this.slotNames=[],this.handleSlotChange=t=>{const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()},(this.host=t).addController(this),this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}},te="";function ee(t){te=t}var oe={name:"default",resolver:t=>function(t=""){if(!te){const t=[...document.getElementsByTagName("script")],e=t.find((t=>t.hasAttribute("data-shoelace")));if(e)ee(e.getAttribute("data-shoelace"));else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let o="";e&&(o=e.getAttribute("src")),ee(o.split("/").slice(0,-1).join("/"))}}return te.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}(`assets/icons/${t}.svg`)},ie={caret:'\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n ',check:'\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',"chevron-left":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n ',"chevron-right":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n ',copy:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n ',"eye-slash":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n ',eyedropper:'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n ',"grip-vertical":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n ',indeterminate:'\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n ',"person-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n ',"play-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n ',"pause-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n ',radio:'\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n ',"star-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n ',"x-lg":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n ',"x-circle-fill":'\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n '},re=[oe,{name:"system",resolver:t=>t in ie?`data:image/svg+xml,${encodeURIComponent(ie[t])}`:""}],se=[];function ne(t){return re.find((e=>e.name===t))}function ae(t,e){!function(t){re=re.filter((e=>e.name!==t))}(t),re.push({name:t,resolver:e.resolver,mutator:e.mutator,spriteSheet:e.spriteSheet}),se.forEach((e=>{e.library===t&&e.setIcon()}))}var le=s`
|
|
714
|
+
:host {
|
|
715
|
+
display: inline-block;
|
|
716
|
+
width: 1em;
|
|
717
|
+
height: 1em;
|
|
718
|
+
box-sizing: content-box !important;
|
|
1058
719
|
}
|
|
1059
720
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1065
|
-
75%,
|
|
1066
|
-
100% {
|
|
1067
|
-
right: 100%;
|
|
1068
|
-
width: 50%;
|
|
1069
|
-
}
|
|
721
|
+
svg {
|
|
722
|
+
display: block;
|
|
723
|
+
height: 100%;
|
|
724
|
+
width: 100%;
|
|
1070
725
|
}
|
|
1071
|
-
|
|
726
|
+
`;function ce(t,e){const o=Lt({waitUntilFirstUpdate:!1},e);return(e,i)=>{const{update:r}=e,s=Array.isArray(t)?t:[t];e.update=function(t){s.forEach((e=>{const r=e;if(t.has(r)){const e=t.get(r),s=this[r];e!==s&&(o.waitUntilFirstUpdate&&!this.hasUpdated||this[i](e,s))}})),r.call(this,t)}}}
|
|
727
|
+
/**
|
|
728
|
+
* @license
|
|
729
|
+
* Copyright 2020 Google LLC
|
|
730
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
731
|
+
*/const he={};var de,ue=Symbol(),pe=Symbol(),be=new Map,fe=class extends Vt{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var o;let i;if(null==e?void 0:e.spriteSheet)return this.svg=H`<svg part="svg">
|
|
732
|
+
<use part="use" href="${t}"></use>
|
|
733
|
+
</svg>`,this.svg;try{if(i=await fetch(t,{mode:"cors"}),!i.ok)return 410===i.status?ue:pe}catch(t){return pe}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if("svg"!==(null==(o=null==e?void 0:e.tagName)?void 0:o.toLowerCase()))return ue;de||(de=new DOMParser);const r=de.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return r?(r.part.add("svg"),document.adoptNode(r)):ue}catch(t){return ue}}connectedCallback(){var t;super.connectedCallback(),t=this,se.push(t)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,se=se.filter((e=>e!==t))}getIconSource(){const t=ne(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:o}=this.getIconSource(),i=o?ne(this.library):void 0;if(!e)return void(this.svg=null);let r=be.get(e);if(r||(r=this.resolveIcon(e,i),be.set(e,r)),!this.initialRender)return;const s=await r;if(s===pe&&be.delete(e),e===this.getIconSource().url)if((t=>void 0!==t?._$litType$)(s)){if(this.svg=s,i){await this.updateComplete;const t=this.shadowRoot.querySelector("[part='svg']");"function"==typeof i.mutator&&t&&i.mutator(t)}}else switch(s){case pe:case ue:this.svg=null,this.emit("sl-error");break;default:this.svg=s.cloneNode(!0),null==(t=null==i?void 0:i.mutator)||t.call(i,this.svg),this.emit("sl-load")}}render(){return this.svg}};fe.styles=[wt,le],Pt([Ut()],fe.prototype,"svg",2),Pt([Nt({reflect:!0})],fe.prototype,"name",2),Pt([Nt()],fe.prototype,"src",2),Pt([Nt()],fe.prototype,"label",2),Pt([Nt({reflect:!0})],fe.prototype,"library",2),Pt([ce("label")],fe.prototype,"handleLabelChange",1),Pt([ce(["name","src","library"])],fe.prototype,"setIcon",1);
|
|
734
|
+
/**
|
|
735
|
+
* @license
|
|
736
|
+
* Copyright 2017 Google LLC
|
|
737
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
738
|
+
*/
|
|
739
|
+
const ge=1,me=3,ve=4,ye=t=>(...e)=>({_$litDirective$:t,values:e});let we=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
1072
740
|
/**
|
|
1073
741
|
* @license
|
|
1074
742
|
* Copyright 2018 Google LLC
|
|
1075
743
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1076
|
-
|
|
744
|
+
*/const _e=ye(class extends we{constructor(t){if(super(t),t.type!==ge||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const o=t.element.classList;for(const t of this.st)t in e||(o.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return I}}),xe=Symbol.for(""),ke=t=>{if(t?.r===xe)return t?._$litStatic$},$e=(t,...e)=>({_$litStatic$:e.reduce(((e,o,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[i+1]),t[0]),r:xe}),Ce=new Map,Ae=(t=>(e,...o)=>{const i=o.length;let r,s;const n=[],a=[];let l,c=0,h=!1;for(;c<i;){for(l=e[c];c<i&&void 0!==(s=o[c],r=ke(s));)l+=r+e[++c],h=!0;c!==i&&a.push(s),n.push(l),c++}if(c===i&&n.push(e[i]),h){const t=n.join("$$lit$$");void 0===(e=Ce.get(t))&&(n.raw=n,Ce.set(t,e=n)),o=a}return t(e,...o)})(H),Ee=t=>t??V;
|
|
745
|
+
/**
|
|
746
|
+
* @license
|
|
747
|
+
* Copyright 2020 Google LLC
|
|
748
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
749
|
+
*/var Se=class extends Vt{constructor(){super(...arguments),this.formControlController=new Xt(this,{assumeInteractionOn:["click"]}),this.hasSlotController=new Qt(this,"[default]","prefix","suffix"),this.localize=new yt(this),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="default",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener"}get validity(){return this.isButton()?this.button.validity:Yt}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(){"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){const t=this.isLink(),e=t?$e`a`:$e`button`;return Ae`
|
|
750
|
+
<${e}
|
|
751
|
+
part="base"
|
|
752
|
+
class=${_e({button:!0,"button--default":"default"===this.variant,"button--primary":"primary"===this.variant,"button--success":"success"===this.variant,"button--neutral":"neutral"===this.variant,"button--warning":"warning"===this.variant,"button--danger":"danger"===this.variant,"button--text":"text"===this.variant,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--caret":this.caret,"button--circle":this.circle,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--loading":this.loading,"button--standard":!this.outline,"button--outline":this.outline,"button--pill":this.pill,"button--rtl":"rtl"===this.localize.dir(),"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
|
|
753
|
+
?disabled=${Ee(t?void 0:this.disabled)}
|
|
754
|
+
type=${Ee(t?void 0:this.type)}
|
|
755
|
+
title=${this.title}
|
|
756
|
+
name=${Ee(t?void 0:this.name)}
|
|
757
|
+
value=${Ee(t?void 0:this.value)}
|
|
758
|
+
href=${Ee(t&&!this.disabled?this.href:void 0)}
|
|
759
|
+
target=${Ee(t?this.target:void 0)}
|
|
760
|
+
download=${Ee(t?this.download:void 0)}
|
|
761
|
+
rel=${Ee(t?this.rel:void 0)}
|
|
762
|
+
role=${Ee(t?void 0:"button")}
|
|
763
|
+
aria-disabled=${this.disabled?"true":"false"}
|
|
764
|
+
tabindex=${this.disabled?"-1":"0"}
|
|
765
|
+
@blur=${this.handleBlur}
|
|
766
|
+
@focus=${this.handleFocus}
|
|
767
|
+
@invalid=${this.isButton()?this.handleInvalid:null}
|
|
768
|
+
@click=${this.handleClick}
|
|
769
|
+
>
|
|
770
|
+
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
771
|
+
<slot part="label" class="button__label"></slot>
|
|
772
|
+
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
773
|
+
${this.caret?Ae` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> `:""}
|
|
774
|
+
${this.loading?Ae`<sl-spinner part="spinner"></sl-spinner>`:""}
|
|
775
|
+
</${e}>
|
|
776
|
+
`}};Se.styles=[wt,Jt],Se.dependencies={"sl-icon":fe,"sl-spinner":Wt},Pt([Ht(".button")],Se.prototype,"button",2),Pt([Ut()],Se.prototype,"hasFocus",2),Pt([Ut()],Se.prototype,"invalid",2),Pt([Nt()],Se.prototype,"title",2),Pt([Nt({reflect:!0})],Se.prototype,"variant",2),Pt([Nt({reflect:!0})],Se.prototype,"size",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"caret",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"disabled",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"loading",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"outline",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"pill",2),Pt([Nt({type:Boolean,reflect:!0})],Se.prototype,"circle",2),Pt([Nt()],Se.prototype,"type",2),Pt([Nt()],Se.prototype,"name",2),Pt([Nt()],Se.prototype,"value",2),Pt([Nt()],Se.prototype,"href",2),Pt([Nt()],Se.prototype,"target",2),Pt([Nt()],Se.prototype,"rel",2),Pt([Nt()],Se.prototype,"download",2),Pt([Nt()],Se.prototype,"form",2),Pt([Nt({attribute:"formaction"})],Se.prototype,"formAction",2),Pt([Nt({attribute:"formenctype"})],Se.prototype,"formEnctype",2),Pt([Nt({attribute:"formmethod"})],Se.prototype,"formMethod",2),Pt([Nt({attribute:"formnovalidate",type:Boolean})],Se.prototype,"formNoValidate",2),Pt([Nt({attribute:"formtarget"})],Se.prototype,"formTarget",2),Pt([ce("disabled",{waitUntilFirstUpdate:!0})],Se.prototype,"handleDisabledChange",1),Se.define("sl-button");var ze=s`
|
|
777
|
+
:host {
|
|
778
|
+
display: inline-block;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.button-group {
|
|
782
|
+
display: flex;
|
|
783
|
+
flex-wrap: nowrap;
|
|
784
|
+
}
|
|
785
|
+
`,Te=class extends Vt{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=Le(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--focus",!0)}handleBlur(t){const e=Le(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--focus",!1)}handleMouseOver(t){const e=Le(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--hover",!0)}handleMouseOut(t){const e=Le(t.target);null==e||e.toggleAttribute("data-sl-button-group__button--hover",!1)}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),i=Le(e);i&&(i.toggleAttribute("data-sl-button-group__button",!0),i.toggleAttribute("data-sl-button-group__button--first",0===o),i.toggleAttribute("data-sl-button-group__button--inner",o>0&&o<t.length-1),i.toggleAttribute("data-sl-button-group__button--last",o===t.length-1),i.toggleAttribute("data-sl-button-group__button--radio","sl-radio-button"===i.tagName.toLowerCase()))}))}render(){return H`
|
|
1077
786
|
<div
|
|
1078
787
|
part="base"
|
|
1079
|
-
class
|
|
1080
|
-
role="
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
788
|
+
class="button-group"
|
|
789
|
+
role="${this.disableRole?"presentation":"group"}"
|
|
790
|
+
aria-label=${this.label}
|
|
791
|
+
@focusout=${this.handleBlur}
|
|
792
|
+
@focusin=${this.handleFocus}
|
|
793
|
+
@mouseover=${this.handleMouseOver}
|
|
794
|
+
@mouseout=${this.handleMouseOut}
|
|
1086
795
|
>
|
|
1087
|
-
<
|
|
1088
|
-
${this.indeterminate?"":lt` <slot part="label" class="progress-bar__label"></slot> `}
|
|
1089
|
-
</div>
|
|
796
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
1090
797
|
</div>
|
|
1091
|
-
`}};function*
|
|
798
|
+
`}};function Le(t){var e;const o="sl-button, sl-radio-button";return null!=(e=t.closest(o))?e:t.querySelector(o)}function*Oe(t=document.activeElement){null!=t&&(yield t,"shadowRoot"in t&&t.shadowRoot&&"closed"!==t.shadowRoot.mode&&(yield*Ft(Oe(t.shadowRoot.activeElement))))}function Pe(){return[...Oe()].pop()}Te.styles=[wt,ze],Pt([Ht("slot")],Te.prototype,"defaultSlot",2),Pt([Ut()],Te.prototype,"disableRole",2),Pt([Nt()],Te.prototype,"label",2),Te.define("sl-button-group");var De=new WeakMap;function Be(t){let e=De.get(t);return e||(e=window.getComputedStyle(t,null),De.set(t,e)),e}function Fe(t){const e=t.tagName.toLowerCase(),o=Number(t.getAttribute("tabindex"));if(t.hasAttribute("tabindex")&&(isNaN(o)||o<=-1))return!1;if(t.hasAttribute("disabled"))return!1;if(t.closest("[inert]"))return!1;if("input"===e&&"radio"===t.getAttribute("type")){const e=t.getRootNode(),o=`input[type='radio'][name="${t.getAttribute("name")}"]`,i=e.querySelector(`${o}:checked`);if(i)return i===t;return e.querySelector(o)===t}if(!function(t){if("function"==typeof t.checkVisibility)return t.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const e=Be(t);return"hidden"!==e.visibility&&"none"!==e.display}(t))return!1;if(("audio"===e||"video"===e)&&t.hasAttribute("controls"))return!0;if(t.hasAttribute("tabindex"))return!0;if(t.hasAttribute("contenteditable")&&"false"!==t.getAttribute("contenteditable"))return!0;return!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e)||function(t){const e=Be(t),{overflowY:o,overflowX:i}=e;return"scroll"===o||"scroll"===i||"auto"===o&&"auto"===i&&(t.scrollHeight>t.clientHeight&&"auto"===o||!(!(t.scrollWidth>t.clientWidth)||"auto"!==i))}(t)}function Re(t){const e=new WeakMap,o=[];return function i(r){if(r instanceof Element){if(r.hasAttribute("inert")||r.closest("[inert]"))return;if(e.has(r))return;e.set(r,!0),!o.includes(r)&&Fe(r)&&o.push(r),r instanceof HTMLSlotElement&&function(t,e){var o;return(null==(o=t.getRootNode({composed:!0}))?void 0:o.host)!==e}(r,t)&&r.assignedElements({flatten:!0}).forEach((t=>{i(t)})),null!==r.shadowRoot&&"open"===r.shadowRoot.mode&&i(r.shadowRoot)}for(const t of r.children)i(t)}(t),o.sort(((t,e)=>{const o=Number(t.getAttribute("tabindex"))||0;return(Number(e.getAttribute("tabindex"))||0)-o}))}var Me=[],Ne=class{constructor(t){this.tabDirection="forward",this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=t=>{var e;if("Tab"!==t.key||this.isExternalActivated)return;if(!this.isActive())return;const o=Pe();if(this.previousFocus=o,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;t.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const i=Re(this.element);let r=i.findIndex((t=>t===o));this.previousFocus=this.currentFocus;const s="forward"===this.tabDirection?1:-1;for(;;){r+s>=i.length?r=0:r+s<0?r=i.length-1:r+=s,this.previousFocus=this.currentFocus;const o=i[r];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(o&&this.possiblyHasTabbableChildren(o))return;t.preventDefault(),this.currentFocus=o,null==(e=this.currentFocus)||e.focus({preventScroll:!1});const n=[...Oe()];if(n.includes(this.currentFocus)||!n.includes(this.previousFocus))break}setTimeout((()=>this.checkFocus()))},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=t,this.elementsWithTabbableControls=["iframe"]}activate(){Me.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Me=Me.filter((t=>t!==this.element)),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Me[Me.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const t=Re(this.element);if(!this.element.matches(":focus-within")){const e=t[0],o=t[t.length-1],i="forward"===this.tabDirection?e:o;"function"==typeof(null==i?void 0:i.focus)&&(this.currentFocus=i,i.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(t){return this.elementsWithTabbableControls.includes(t.tagName.toLowerCase())||t.hasAttribute("controls")}};var Ue=new Set;function He(t){if(Ue.add(t),!document.documentElement.classList.contains("sl-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",e),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${t}px`)}}function Ie(t){Ue.delete(t),0===Ue.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function Ve(t,e,o="vertical",i="smooth"){const r=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),s=r.top+e.scrollTop,n=r.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(n<a?e.scrollTo({left:n,behavior:i}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(s<c?e.scrollTo({top:s,behavior:i}):s+t.clientHeight>h&&e.scrollTo({top:s-e.offsetHeight+t.clientHeight,behavior:i}))}var We=s`
|
|
1092
799
|
:host {
|
|
1093
800
|
--width: 31rem;
|
|
1094
801
|
--header-spacing: var(--sl-spacing-large);
|
|
@@ -1205,10 +912,83 @@ const ye=Symbol.for(""),we=t=>{if(t?.r===ye)return t?._$litStatic$},_e=(t,...e)=
|
|
|
1205
912
|
border: solid 1px var(--sl-color-neutral-0);
|
|
1206
913
|
}
|
|
1207
914
|
}
|
|
1208
|
-
`,
|
|
915
|
+
`,je=s`
|
|
916
|
+
:host {
|
|
917
|
+
display: inline-block;
|
|
918
|
+
color: var(--sl-color-neutral-600);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.icon-button {
|
|
922
|
+
flex: 0 0 auto;
|
|
923
|
+
display: flex;
|
|
924
|
+
align-items: center;
|
|
925
|
+
background: none;
|
|
926
|
+
border: none;
|
|
927
|
+
border-radius: var(--sl-border-radius-medium);
|
|
928
|
+
font-size: inherit;
|
|
929
|
+
color: inherit;
|
|
930
|
+
padding: var(--sl-spacing-x-small);
|
|
931
|
+
cursor: pointer;
|
|
932
|
+
transition: var(--sl-transition-x-fast) color;
|
|
933
|
+
-webkit-appearance: none;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.icon-button:hover:not(.icon-button--disabled),
|
|
937
|
+
.icon-button:focus-visible:not(.icon-button--disabled) {
|
|
938
|
+
color: var(--sl-color-primary-600);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.icon-button:active:not(.icon-button--disabled) {
|
|
942
|
+
color: var(--sl-color-primary-700);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.icon-button:focus {
|
|
946
|
+
outline: none;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.icon-button--disabled {
|
|
950
|
+
opacity: 0.5;
|
|
951
|
+
cursor: not-allowed;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.icon-button:focus-visible {
|
|
955
|
+
outline: var(--sl-focus-ring);
|
|
956
|
+
outline-offset: var(--sl-focus-ring-offset);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.icon-button__icon {
|
|
960
|
+
pointer-events: none;
|
|
961
|
+
}
|
|
962
|
+
`,qe=class extends Vt{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t=!!this.href,e=t?$e`a`:$e`button`;return Ae`
|
|
963
|
+
<${e}
|
|
964
|
+
part="base"
|
|
965
|
+
class=${_e({"icon-button":!0,"icon-button--disabled":!t&&this.disabled,"icon-button--focused":this.hasFocus})}
|
|
966
|
+
?disabled=${Ee(t?void 0:this.disabled)}
|
|
967
|
+
type=${Ee(t?void 0:"button")}
|
|
968
|
+
href=${Ee(t?this.href:void 0)}
|
|
969
|
+
target=${Ee(t?this.target:void 0)}
|
|
970
|
+
download=${Ee(t?this.download:void 0)}
|
|
971
|
+
rel=${Ee(t&&this.target?"noreferrer noopener":void 0)}
|
|
972
|
+
role=${Ee(t?void 0:"button")}
|
|
973
|
+
aria-disabled=${this.disabled?"true":"false"}
|
|
974
|
+
aria-label="${this.label}"
|
|
975
|
+
tabindex=${this.disabled?"-1":"0"}
|
|
976
|
+
@blur=${this.handleBlur}
|
|
977
|
+
@focus=${this.handleFocus}
|
|
978
|
+
@click=${this.handleClick}
|
|
979
|
+
>
|
|
980
|
+
<sl-icon
|
|
981
|
+
class="icon-button__icon"
|
|
982
|
+
name=${Ee(this.name)}
|
|
983
|
+
library=${Ee(this.library)}
|
|
984
|
+
src=${Ee(this.src)}
|
|
985
|
+
aria-hidden="true"
|
|
986
|
+
></sl-icon>
|
|
987
|
+
</${e}>
|
|
988
|
+
`}};qe.styles=[wt,je],qe.dependencies={"sl-icon":fe},Pt([Ht(".icon-button")],qe.prototype,"button",2),Pt([Ut()],qe.prototype,"hasFocus",2),Pt([Nt()],qe.prototype,"name",2),Pt([Nt()],qe.prototype,"library",2),Pt([Nt()],qe.prototype,"src",2),Pt([Nt()],qe.prototype,"href",2),Pt([Nt()],qe.prototype,"target",2),Pt([Nt()],qe.prototype,"download",2),Pt([Nt()],qe.prototype,"label",2),Pt([Nt({type:Boolean,reflect:!0})],qe.prototype,"disabled",2);var Ke=new Map,Ze=new WeakMap;function Ge(t,e){return"rtl"===e.toLowerCase()?{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}:t}function Xe(t,e){Ke.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function Ye(t,e,o){const i=Ze.get(t);if(null==i?void 0:i[e])return Ge(i[e],o.dir);const r=Ke.get(e);return r?Ge(r,o.dir):{keyframes:[],options:{duration:0}}}function Je(t,e){return new Promise((o=>{t.addEventListener(e,(function i(r){r.target===t&&(t.removeEventListener(e,i),o())}))}))}function Qe(t,e,o){return new Promise((i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const r=t.animate(e,Ot(Lt({},o),{duration:eo()?0:o.duration}));r.addEventListener("cancel",i,{once:!0}),r.addEventListener("finish",i,{once:!0})}))}function to(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function eo(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function oo(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel(),requestAnimationFrame(e)})))))}var io=class extends Vt{constructor(){super(...arguments),this.hasSlotController=new Qt(this,"footer"),this.localize=new yt(this),this.modal=new Ne(this),this.open=!1,this.label="",this.noHeader=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.modal.isActive()&&this.open&&(t.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),He(this))}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate(),Ie(this),this.removeOpenListeners()}requestClose(t){if(this.emit("sl-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=Ye(this,"dialog.denyClose",{dir:this.localize.dir()});Qe(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){var t;"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard")):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),He(this);const t=this.querySelector("[autofocus]");t&&t.removeAttribute("autofocus"),await Promise.all([oo(this.dialog),oo(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame((()=>{this.emit("sl-initial-focus",{cancelable:!0}).defaultPrevented||(t?t.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),t&&t.setAttribute("autofocus","")}));const e=Ye(this,"dialog.show",{dir:this.localize.dir()}),o=Ye(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([Qe(this.panel,e.keyframes,e.options),Qe(this.overlay,o.keyframes,o.options)]),this.emit("sl-after-show")}else{(t=>{var e;const{activeElement:o}=document;o&&t.contains(o)&&(null==(e=document.activeElement)||e.blur())})(this),this.emit("sl-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([oo(this.dialog),oo(this.overlay)]);const t=Ye(this,"dialog.hide",{dir:this.localize.dir()}),e=Ye(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([Qe(this.overlay,e.keyframes,e.options).then((()=>{this.overlay.hidden=!0})),Qe(this.panel,t.keyframes,t.options).then((()=>{this.panel.hidden=!0}))]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,Ie(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sl-after-hide")}}async show(){if(!this.open)return this.open=!0,Je(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Je(this,"sl-after-hide")}render(){return H`
|
|
1209
989
|
<div
|
|
1210
990
|
part="base"
|
|
1211
|
-
class=${
|
|
991
|
+
class=${_e({dialog:!0,"dialog--open":this.open,"dialog--has-footer":this.hasSlotController.test("footer")})}
|
|
1212
992
|
>
|
|
1213
993
|
<div part="overlay" class="dialog__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div>
|
|
1214
994
|
|
|
@@ -1218,11 +998,11 @@ const ye=Symbol.for(""),we=t=>{if(t?.r===ye)return t?._$litStatic$},_e=(t,...e)=
|
|
|
1218
998
|
role="dialog"
|
|
1219
999
|
aria-modal="true"
|
|
1220
1000
|
aria-hidden=${this.open?"false":"true"}
|
|
1221
|
-
aria-label=${
|
|
1222
|
-
aria-labelledby=${
|
|
1001
|
+
aria-label=${Ee(this.noHeader?this.label:void 0)}
|
|
1002
|
+
aria-labelledby=${Ee(this.noHeader?void 0:"title")}
|
|
1223
1003
|
tabindex="-1"
|
|
1224
1004
|
>
|
|
1225
|
-
${this.noHeader?"":
|
|
1005
|
+
${this.noHeader?"":H`
|
|
1226
1006
|
<header part="header" class="dialog__header">
|
|
1227
1007
|
<h2 part="title" class="dialog__title" id="title">
|
|
1228
1008
|
<slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(65279)} </slot>
|
|
@@ -1249,686 +1029,1002 @@ const ye=Symbol.for(""),we=t=>{if(t?.r===ye)return t?._$litStatic$},_e=(t,...e)=
|
|
|
1249
1029
|
</footer>
|
|
1250
1030
|
</div>
|
|
1251
1031
|
</div>
|
|
1252
|
-
`}};
|
|
1032
|
+
`}};io.styles=[wt,We],io.dependencies={"sl-icon-button":qe},Pt([Ht(".dialog")],io.prototype,"dialog",2),Pt([Ht(".dialog__panel")],io.prototype,"panel",2),Pt([Ht(".dialog__overlay")],io.prototype,"overlay",2),Pt([Nt({type:Boolean,reflect:!0})],io.prototype,"open",2),Pt([Nt({reflect:!0})],io.prototype,"label",2),Pt([Nt({attribute:"no-header",type:Boolean,reflect:!0})],io.prototype,"noHeader",2),Pt([ce("open",{waitUntilFirstUpdate:!0})],io.prototype,"handleOpenChange",1),Xe("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),Xe("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),Xe("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),Xe("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),Xe("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),io.define("sl-dialog");var ro=s`
|
|
1253
1033
|
:host {
|
|
1254
|
-
|
|
1255
|
-
|
|
1034
|
+
display: inline-block;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.dropdown::part(popup) {
|
|
1038
|
+
z-index: var(--sl-z-index-dropdown);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.dropdown[data-current-placement^='top']::part(popup) {
|
|
1042
|
+
transform-origin: bottom;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.dropdown[data-current-placement^='bottom']::part(popup) {
|
|
1046
|
+
transform-origin: top;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.dropdown[data-current-placement^='left']::part(popup) {
|
|
1050
|
+
transform-origin: right;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.dropdown[data-current-placement^='right']::part(popup) {
|
|
1054
|
+
transform-origin: left;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.dropdown__trigger {
|
|
1058
|
+
display: block;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.dropdown__panel {
|
|
1062
|
+
font-family: var(--sl-font-sans);
|
|
1063
|
+
font-size: var(--sl-font-size-medium);
|
|
1064
|
+
font-weight: var(--sl-font-weight-normal);
|
|
1065
|
+
box-shadow: var(--sl-shadow-large);
|
|
1066
|
+
border-radius: var(--sl-border-radius-medium);
|
|
1067
|
+
pointer-events: none;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
.dropdown--open .dropdown__panel {
|
|
1071
|
+
display: block;
|
|
1072
|
+
pointer-events: all;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/* When users slot a menu, make sure it conforms to the popup's auto-size */
|
|
1076
|
+
::slotted(sl-menu) {
|
|
1077
|
+
max-width: var(--auto-size-available-width) !important;
|
|
1078
|
+
max-height: var(--auto-size-available-height) !important;
|
|
1079
|
+
}
|
|
1080
|
+
`,so=s`
|
|
1081
|
+
:host {
|
|
1082
|
+
--arrow-color: var(--sl-color-neutral-1000);
|
|
1083
|
+
--arrow-size: 6px;
|
|
1084
|
+
|
|
1085
|
+
/*
|
|
1086
|
+
* These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant
|
|
1087
|
+
* 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating.
|
|
1088
|
+
*/
|
|
1089
|
+
--arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
|
|
1090
|
+
--arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
|
|
1091
|
+
|
|
1092
|
+
display: contents;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.popup {
|
|
1096
|
+
position: absolute;
|
|
1097
|
+
isolation: isolate;
|
|
1098
|
+
max-width: var(--auto-size-available-width, none);
|
|
1099
|
+
max-height: var(--auto-size-available-height, none);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.popup--fixed {
|
|
1103
|
+
position: fixed;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.popup:not(.popup--active) {
|
|
1107
|
+
display: none;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
.popup__arrow {
|
|
1111
|
+
position: absolute;
|
|
1112
|
+
width: calc(var(--arrow-size-diagonal) * 2);
|
|
1113
|
+
height: calc(var(--arrow-size-diagonal) * 2);
|
|
1114
|
+
rotate: 45deg;
|
|
1115
|
+
background: var(--arrow-color);
|
|
1116
|
+
z-index: -1;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/* Hover bridge */
|
|
1120
|
+
.popup-hover-bridge:not(.popup-hover-bridge--visible) {
|
|
1121
|
+
display: none;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
.popup-hover-bridge {
|
|
1125
|
+
position: fixed;
|
|
1126
|
+
z-index: calc(var(--sl-z-index-dropdown) - 1);
|
|
1127
|
+
top: 0;
|
|
1128
|
+
right: 0;
|
|
1129
|
+
bottom: 0;
|
|
1130
|
+
left: 0;
|
|
1131
|
+
clip-path: polygon(
|
|
1132
|
+
var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
|
|
1133
|
+
var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
|
|
1134
|
+
var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
|
|
1135
|
+
var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
`;const no=Math.min,ao=Math.max,lo=Math.round,co=Math.floor,ho=t=>({x:t,y:t}),uo={left:"right",right:"left",bottom:"top",top:"bottom"},po={start:"end",end:"start"};function bo(t,e,o){return ao(t,no(e,o))}function fo(t,e){return"function"==typeof t?t(e):t}function go(t){return t.split("-")[0]}function mo(t){return t.split("-")[1]}function vo(t){return"x"===t?"y":"x"}function yo(t){return"y"===t?"height":"width"}const wo=new Set(["top","bottom"]);function _o(t){return wo.has(go(t))?"y":"x"}function xo(t){return vo(_o(t))}function ko(t){return t.replace(/start|end/g,(t=>po[t]))}const $o=["left","right"],Co=["right","left"],Ao=["top","bottom"],Eo=["bottom","top"];function So(t,e,o,i){const r=mo(t);let s=function(t,e,o){switch(t){case"top":case"bottom":return o?e?Co:$o:e?$o:Co;case"left":case"right":return e?Ao:Eo;default:return[]}}(go(t),"start"===o,i);return r&&(s=s.map((t=>t+"-"+r)),e&&(s=s.concat(s.map(ko)))),s}function zo(t){return t.replace(/left|right|bottom|top/g,(t=>uo[t]))}function To(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Lo(t){const{x:e,y:o,width:i,height:r}=t;return{width:i,height:r,top:o,left:e,right:e+i,bottom:o+r,x:e,y:o}}function Oo(t,e,o){let{reference:i,floating:r}=t;const s=_o(e),n=xo(e),a=yo(n),l=go(e),c="y"===s,h=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,u=i[a]/2-r[a]/2;let p;switch(l){case"top":p={x:h,y:i.y-r.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-r.width,y:d};break;default:p={x:i.x,y:i.y}}switch(mo(e)){case"start":p[n]-=u*(o&&c?-1:1);break;case"end":p[n]+=u*(o&&c?-1:1)}return p}async function Po(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:s,rects:n,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=fo(e,t),b=To(p),f=a[u?"floating"===d?"reference":"floating":d],g=Lo(await s.getClippingRect({element:null==(o=await(null==s.isElement?void 0:s.isElement(f)))||o?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),m="floating"===d?{x:i,y:r,width:n.floating.width,height:n.floating.height}:n.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},w=Lo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:l}):m);return{top:(g.top-w.top+b.top)/y.y,bottom:(w.bottom-g.bottom+b.bottom)/y.y,left:(g.left-w.left+b.left)/y.x,right:(w.right-g.right+b.right)/y.x}}const Do=new Set(["left","top"]);function Bo(){return"undefined"!=typeof window}function Fo(t){return No(t)?(t.nodeName||"").toLowerCase():"#document"}function Ro(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Mo(t){var e;return null==(e=(No(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function No(t){return!!Bo()&&(t instanceof Node||t instanceof Ro(t).Node)}function Uo(t){return!!Bo()&&(t instanceof Element||t instanceof Ro(t).Element)}function Ho(t){return!!Bo()&&(t instanceof HTMLElement||t instanceof Ro(t).HTMLElement)}function Io(t){return!(!Bo()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Ro(t).ShadowRoot)}const Vo=new Set(["inline","contents"]);function Wo(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=oi(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!Vo.has(r)}const jo=new Set(["table","td","th"]);function qo(t){return jo.has(Fo(t))}const Ko=[":popover-open",":modal"];function Zo(t){return Ko.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const Go=["transform","translate","scale","rotate","perspective"],Xo=["transform","translate","scale","rotate","perspective","filter"],Yo=["paint","layout","strict","content"];function Jo(t){const e=Qo(),o=Uo(t)?oi(t):t;return Go.some((t=>!!o[t]&&"none"!==o[t]))||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||Xo.some((t=>(o.willChange||"").includes(t)))||Yo.some((t=>(o.contain||"").includes(t)))}function Qo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ti=new Set(["html","body","#document"]);function ei(t){return ti.has(Fo(t))}function oi(t){return Ro(t).getComputedStyle(t)}function ii(t){return Uo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ri(t){if("html"===Fo(t))return t;const e=t.assignedSlot||t.parentNode||Io(t)&&t.host||Mo(t);return Io(e)?e.host:e}function si(t){const e=ri(t);return ei(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ho(e)&&Wo(e)?e:si(e)}function ni(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=si(t),s=r===(null==(i=t.ownerDocument)?void 0:i.body),n=Ro(r);if(s){const t=ai(n);return e.concat(n,n.visualViewport||[],Wo(r)?r:[],t&&o?ni(t):[])}return e.concat(r,ni(r,[],o))}function ai(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function li(t){const e=oi(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Ho(t),s=r?t.offsetWidth:o,n=r?t.offsetHeight:i,a=lo(o)!==s||lo(i)!==n;return a&&(o=s,i=n),{width:o,height:i,$:a}}function ci(t){return Uo(t)?t:t.contextElement}function hi(t){const e=ci(t);if(!Ho(e))return ho(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:s}=li(e);let n=(s?lo(o.width):o.width)/i,a=(s?lo(o.height):o.height)/r;return n&&Number.isFinite(n)||(n=1),a&&Number.isFinite(a)||(a=1),{x:n,y:a}}const di=ho(0);function ui(t){const e=Ro(t);return Qo()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:di}function pi(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),s=ci(t);let n=ho(1);e&&(i?Uo(i)&&(n=hi(i)):n=hi(t));const a=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==Ro(t))&&e}(s,o,i)?ui(s):ho(0);let l=(r.left+a.x)/n.x,c=(r.top+a.y)/n.y,h=r.width/n.x,d=r.height/n.y;if(s){const t=Ro(s),e=i&&Uo(i)?Ro(i):i;let o=t,r=ai(o);for(;r&&i&&e!==o;){const t=hi(r),e=r.getBoundingClientRect(),i=oi(r),s=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=s,c+=n,o=Ro(r),r=ai(o)}}return Lo({width:h,height:d,x:l,y:c})}function bi(t,e){const o=ii(t).scrollLeft;return e?e.left+o:pi(Mo(t)).left+o}function fi(t,e){const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-bi(t,o),y:o.top+e.scrollTop}}const gi=25;const mi=new Set(["absolute","fixed"]);function vi(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=Ro(t),i=Mo(t),r=o.visualViewport;let s=i.clientWidth,n=i.clientHeight,a=0,l=0;if(r){s=r.width,n=r.height;const t=Qo();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}const c=bi(i);if(c<=0){const t=i.ownerDocument,e=t.body,o=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(o.marginLeft)+parseFloat(o.marginRight)||0,n=Math.abs(i.clientWidth-e.clientWidth-r);n<=gi&&(s-=n)}else c<=gi&&(s+=c);return{width:s,height:n,x:a,y:l}}(t,o);else if("document"===e)i=function(t){const e=Mo(t),o=ii(t),i=t.ownerDocument.body,r=ao(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=ao(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let n=-o.scrollLeft+bi(t);const a=-o.scrollTop;return"rtl"===oi(i).direction&&(n+=ao(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:n,y:a}}(Mo(t));else if(Uo(e))i=function(t,e){const o=pi(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,s=Ho(t)?hi(t):ho(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:r*s.x,y:i*s.y}}(e,o);else{const o=ui(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Lo(i)}function yi(t,e){const o=ri(t);return!(o===e||!Uo(o)||ei(o))&&("fixed"===oi(o).position||yi(o,e))}function wi(t,e,o){const i=Ho(e),r=Mo(e),s="fixed"===o,n=pi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=ho(0);function c(){l.x=bi(r)}if(i||!i&&!s)if(("body"!==Fo(e)||Wo(r))&&(a=ii(e)),i){const t=pi(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&c();s&&!i&&r&&c();const h=!r||i||s?ho(0):fi(r,a);return{x:n.left+a.scrollLeft-l.x-h.x,y:n.top+a.scrollTop-l.y-h.y,width:n.width,height:n.height}}function _i(t){return"static"===oi(t).position}function xi(t,e){if(!Ho(t)||"fixed"===oi(t).position)return null;if(e)return e(t);let o=t.offsetParent;return Mo(t)===o&&(o=o.ownerDocument.body),o}function ki(t,e){const o=Ro(t);if(Zo(t))return o;if(!Ho(t)){let e=ri(t);for(;e&&!ei(e);){if(Uo(e)&&!_i(e))return e;e=ri(e)}return o}let i=xi(t,e);for(;i&&qo(i)&&_i(i);)i=xi(i,e);return i&&ei(i)&&_i(i)&&!Jo(i)?o:i||function(t){let e=ri(t);for(;Ho(e)&&!ei(e);){if(Jo(e))return e;if(Zo(e))return null;e=ri(e)}return null}(t)||o}const $i={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:i,strategy:r}=t;const s="fixed"===r,n=Mo(i),a=!!e&&Zo(e.floating);if(i===n||a&&s)return o;let l={scrollLeft:0,scrollTop:0},c=ho(1);const h=ho(0),d=Ho(i);if((d||!d&&!s)&&(("body"!==Fo(i)||Wo(n))&&(l=ii(i)),Ho(i))){const t=pi(i);c=hi(i),h.x=t.x+i.clientLeft,h.y=t.y+i.clientTop}const u=!n||d||s?ho(0):fi(n,l);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+h.x+u.x,y:o.y*c.y-l.scrollTop*c.y+h.y+u.y}},getDocumentElement:Mo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const s=[..."clippingAncestors"===o?Zo(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let i=ni(t,[],!1).filter((t=>Uo(t)&&"body"!==Fo(t))),r=null;const s="fixed"===oi(t).position;let n=s?ri(t):t;for(;Uo(n)&&!ei(n);){const e=oi(n),o=Jo(n);o||"fixed"!==e.position||(r=null),(s?!o&&!r:!o&&"static"===e.position&&r&&mi.has(r.position)||Wo(n)&&!o&&yi(t,n))?i=i.filter((t=>t!==n)):r=e,n=ri(n)}return e.set(t,i),i}(e,this._c):[].concat(o),i],n=s[0],a=s.reduce(((t,o)=>{const i=vi(e,o,r);return t.top=ao(i.top,t.top),t.right=no(i.right,t.right),t.bottom=no(i.bottom,t.bottom),t.left=ao(i.left,t.left),t}),vi(e,n,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ki,getElementRects:async function(t){const e=this.getOffsetParent||ki,o=this.getDimensions,i=await o(t.floating);return{reference:wi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=li(t);return{width:e,height:o}},getScale:hi,isElement:Uo,isRTL:function(t){return"rtl"===oi(t).direction}};function Ci(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ai(t,e,o,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=ci(t),h=r||s?[...c?ni(c):[],...ni(e)]:[];h.forEach((t=>{r&&t.addEventListener("scroll",o,{passive:!0}),s&&t.addEventListener("resize",o)}));const d=c&&a?function(t,e){let o,i=null;const r=Mo(t);function s(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}return function n(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();const c=t.getBoundingClientRect(),{left:h,top:d,width:u,height:p}=c;if(a||e(),!u||!p)return;const b={rootMargin:-co(d)+"px "+-co(r.clientWidth-(h+u))+"px "+-co(r.clientHeight-(d+p))+"px "+-co(h)+"px",threshold:ao(0,no(1,l))||1};let f=!0;function g(e){const i=e[0].intersectionRatio;if(i!==l){if(!f)return n();i?n(!1,i):o=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==i||Ci(c,t.getBoundingClientRect())||n(),f=!1}try{i=new IntersectionObserver(g,{...b,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(g,b)}i.observe(t)}(!0),s}(c,o):null;let u,p=-1,b=null;n&&(b=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&b&&(b.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=b)||t.observe(e)}))),o()})),c&&!l&&b.observe(c),b.observe(e));let f=l?pi(t):null;return l&&function e(){const i=pi(t);f&&!Ci(f,i)&&o();f=i,u=requestAnimationFrame(e)}(),o(),()=>{var t;h.forEach((t=>{r&&t.removeEventListener("scroll",o),s&&t.removeEventListener("resize",o)})),null==d||d(),null==(t=b)||t.disconnect(),b=null,l&&cancelAnimationFrame(u)}}const Ei=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,i;const{x:r,y:s,placement:n,middlewareData:a}=e,l=await async function(t,e){const{placement:o,platform:i,elements:r}=t,s=await(null==i.isRTL?void 0:i.isRTL(r.floating)),n=go(o),a=mo(o),l="y"===_o(o),c=Do.has(n)?-1:1,h=s&&l?-1:1,d=fo(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:b}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof b&&(p="end"===a?-1*b:b),l?{x:p*h,y:u*c}:{x:u*c,y:p*h}}(e,t);return n===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:n}}}}},Si=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:n=!1,limiter:a={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=fo(t,e),c={x:o,y:i},h=await Po(e,l),d=_o(go(r)),u=vo(d);let p=c[u],b=c[d];if(s){const t="y"===u?"bottom":"right";p=bo(p+h["y"===u?"top":"left"],p,p-h[t])}if(n){const t="y"===d?"bottom":"right";b=bo(b+h["y"===d?"top":"left"],b,b-h[t])}const f=a.fn({...e,[u]:p,[d]:b});return{...f,data:{x:f.x-o,y:f.y-i,enabled:{[u]:s,[d]:n}}}}}},zi=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,i;const{placement:r,middlewareData:s,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...g}=fo(t,e);if(null!=(o=s.arrow)&&o.alignmentOffset)return{};const m=go(r),v=_o(a),y=go(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=u||(y||!f?[zo(a)]:function(t){const e=zo(t);return[ko(t),e,ko(e)]}(a)),x="none"!==b;!u&&x&&_.push(...So(a,f,b,w));const k=[a,..._],$=await Po(e,g),C=[];let A=(null==(i=s.flip)?void 0:i.overflows)||[];if(h&&C.push($[m]),d){const t=function(t,e,o){void 0===o&&(o=!1);const i=mo(t),r=xo(t),s=yo(r);let n="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(n=zo(n)),[n,zo(n)]}(r,n,w);C.push($[t[0]],$[t[1]])}if(A=[...A,{placement:r,overflows:C}],!C.every((t=>t<=0))){var E,S;const t=((null==(E=s.flip)?void 0:E.index)||0)+1,e=k[t];if(e){if(!("alignment"===d&&v!==_o(e))||A.every((t=>_o(t.placement)!==v||t.overflows[0]>0)))return{data:{index:t,overflows:A},reset:{placement:e}}}let o=null==(S=A.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var z;const t=null==(z=A.filter((t=>{if(x){const e=_o(t.placement);return e===v||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:z[0];t&&(o=t);break}case"initialPlacement":o=a}if(r!==o)return{reset:{placement:o}}}return{}}}},Ti=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var o,i;const{placement:r,rects:s,platform:n,elements:a}=e,{apply:l=()=>{},...c}=fo(t,e),h=await Po(e,c),d=go(r),u=mo(r),p="y"===_o(r),{width:b,height:f}=s.floating;let g,m;"top"===d||"bottom"===d?(g=d,m=u===(await(null==n.isRTL?void 0:n.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,g="end"===u?"top":"bottom");const v=f-h.top-h.bottom,y=b-h.left-h.right,w=no(f-h[g],v),_=no(b-h[m],y),x=!e.middlewareData.shift;let k=w,$=_;if(null!=(o=e.middlewareData.shift)&&o.enabled.x&&($=y),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(k=v),x&&!u){const t=ao(h.left,0),e=ao(h.right,0),o=ao(h.top,0),i=ao(h.bottom,0);p?$=b-2*(0!==t||0!==e?t+e:ao(h.left,h.right)):k=f-2*(0!==o||0!==i?o+i:ao(h.top,h.bottom))}await l({...e,availableWidth:$,availableHeight:k});const C=await n.getDimensions(a.floating);return b!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},Li=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:s,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=fo(t,e)||{};if(null==c)return{};const d=To(h),u={x:o,y:i},p=xo(r),b=yo(p),f=await n.getDimensions(c),g="y"===p,m=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[p]-u[p]-s.floating[b],_=u[p]-s.reference[p],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let k=x?x[y]:0;k&&await(null==n.isElement?void 0:n.isElement(x))||(k=a.floating[y]||s.floating[b]);const $=w/2-_/2,C=k/2-f[b]/2-1,A=no(d[m],C),E=no(d[v],C),S=A,z=k-f[b]-E,T=k/2-f[b]/2+$,L=bo(S,T,z),O=!l.arrow&&null!=mo(r)&&T!==L&&s.reference[b]/2-(T<S?A:E)-f[b]/2<0,P=O?T<S?T-S:T-z:0;return{[p]:u[p]+P,data:{[p]:L,centerOffset:T-L-P,...O&&{alignmentOffset:P}},reset:O}}}),Oi=(t,e,o)=>{const i=new Map,r={platform:$i,...o},s={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:n}=o,a=s.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:d}=Oo(c,i,l),u=i,p={},b=0;for(let o=0;o<a.length;o++){const{name:s,fn:f}=a[o],{x:g,y:m,data:v,reset:y}=await f({x:h,y:d,initialPlacement:i,placement:u,strategy:r,middlewareData:p,rects:c,platform:n,elements:{reference:t,floating:e}});h=null!=g?g:h,d=null!=m?m:d,p={...p,[s]:{...p[s],...v}},y&&b<=50&&(b++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await n.getElementRects({reference:t,floating:e,strategy:r}):y.rects),({x:h,y:d}=Oo(c,u,l))),o=-1)}return{x:h,y:d,placement:u,strategy:r,middlewareData:p}})(t,e,{...r,platform:s})};function Pi(t){return function(t){for(let e=t;e;e=Di(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Di(t);e;e=Di(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||Jo(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Di(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var Bi=class extends Vt{constructor(){super(...arguments),this.localize=new yt(this),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,i=0,r=0,s=0,n=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top<e.top?(o=t.left,i=t.bottom,r=t.right,s=t.bottom,n=e.left,a=e.top,l=e.right,c=e.top):(o=e.left,i=e.bottom,r=e.right,s=e.bottom,n=t.left,a=t.top,l=t.right,c=t.top):t.left<e.left?(o=t.right,i=t.top,r=e.left,s=e.top,n=t.right,a=t.bottom,l=e.left,c=e.bottom):(o=e.right,i=e.top,r=t.left,s=t.top,n=e.right,a=e.bottom,l=t.left,c=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${o}px`),this.style.setProperty("--hover-bridge-top-left-y",`${i}px`),this.style.setProperty("--hover-bridge-top-right-x",`${r}px`),this.style.setProperty("--hover-bridge-top-right-y",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${a}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${c}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||function(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t&&(!("contextElement"in t)||t.contextElement instanceof Element)}(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.active&&this.start()}start(){this.anchorEl&&this.active&&(this.cleanup=Ai(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[Ei({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(Ti({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(zi({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Si({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(Ti({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Li({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>$i.getOffsetParent(t,Pi):$i.getOffsetParent;Oi(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:Ot(Lt({},$i),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:o,placement:i})=>{const r="rtl"===this.localize.dir(),s={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let i="",n="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=r?o:"",l=r?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=r?"":o,l=r?o:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:n,bottom:a,left:l,[s]:"calc(var(--arrow-size-diagonal) * -1)"})}})),requestAnimationFrame((()=>this.updateHoverBridge())),this.emit("sl-reposition")}render(){return H`
|
|
1139
|
+
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
1140
|
+
|
|
1141
|
+
<span
|
|
1142
|
+
part="hover-bridge"
|
|
1143
|
+
class=${_e({"popup-hover-bridge":!0,"popup-hover-bridge--visible":this.hoverBridge&&this.active})}
|
|
1144
|
+
></span>
|
|
1145
|
+
|
|
1146
|
+
<div
|
|
1147
|
+
part="popup"
|
|
1148
|
+
class=${_e({popup:!0,"popup--active":this.active,"popup--fixed":"fixed"===this.strategy,"popup--has-arrow":this.arrow})}
|
|
1149
|
+
>
|
|
1150
|
+
<slot></slot>
|
|
1151
|
+
${this.arrow?H`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
|
|
1152
|
+
</div>
|
|
1153
|
+
`}};Bi.styles=[wt,so],Pt([Ht(".popup")],Bi.prototype,"popup",2),Pt([Ht(".popup__arrow")],Bi.prototype,"arrowEl",2),Pt([Nt()],Bi.prototype,"anchor",2),Pt([Nt({type:Boolean,reflect:!0})],Bi.prototype,"active",2),Pt([Nt({reflect:!0})],Bi.prototype,"placement",2),Pt([Nt({reflect:!0})],Bi.prototype,"strategy",2),Pt([Nt({type:Number})],Bi.prototype,"distance",2),Pt([Nt({type:Number})],Bi.prototype,"skidding",2),Pt([Nt({type:Boolean})],Bi.prototype,"arrow",2),Pt([Nt({attribute:"arrow-placement"})],Bi.prototype,"arrowPlacement",2),Pt([Nt({attribute:"arrow-padding",type:Number})],Bi.prototype,"arrowPadding",2),Pt([Nt({type:Boolean})],Bi.prototype,"flip",2),Pt([Nt({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],Bi.prototype,"flipFallbackPlacements",2),Pt([Nt({attribute:"flip-fallback-strategy"})],Bi.prototype,"flipFallbackStrategy",2),Pt([Nt({type:Object})],Bi.prototype,"flipBoundary",2),Pt([Nt({attribute:"flip-padding",type:Number})],Bi.prototype,"flipPadding",2),Pt([Nt({type:Boolean})],Bi.prototype,"shift",2),Pt([Nt({type:Object})],Bi.prototype,"shiftBoundary",2),Pt([Nt({attribute:"shift-padding",type:Number})],Bi.prototype,"shiftPadding",2),Pt([Nt({attribute:"auto-size"})],Bi.prototype,"autoSize",2),Pt([Nt()],Bi.prototype,"sync",2),Pt([Nt({type:Object})],Bi.prototype,"autoSizeBoundary",2),Pt([Nt({attribute:"auto-size-padding",type:Number})],Bi.prototype,"autoSizePadding",2),Pt([Nt({attribute:"hover-bridge",type:Boolean})],Bi.prototype,"hoverBridge",2);var Fi=class extends Vt{constructor(){super(...arguments),this.localize=new yt(this),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.sync=void 0,this.handleKeyDown=t=>{this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger())},this.handleDocumentKeyDown=t=>{var e;if("Escape"===t.key&&this.open&&!this.closeWatcher)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===t.key){if(this.open&&"sl-menu-item"===(null==(e=document.activeElement)?void 0:e.tagName.toLowerCase()))return t.preventDefault(),this.hide(),void this.focusOnTrigger();const o=(t,e)=>{if(!t)return null;const i=t.closest(e);if(i)return i;const r=t.getRootNode();return r instanceof ShadowRoot?o(r.host,e):null};setTimeout((()=>{var t;const e=(null==(t=this.containingElement)?void 0:t.getRootNode())instanceof ShadowRoot?Pe():document.activeElement;this.containingElement&&o(e,this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this.containingElement&&!e.includes(this.containingElement)&&this.hide()},this.handlePanelSelect=t=>{const e=t.target;this.stayOpenOnSelect||"sl-menu"!==e.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}}connectedCallback(){super.connectedCallback(),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==t?void 0:t.focus)&&t.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((t=>"sl-menu"===t.tagName.toLowerCase()))}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key))return t.preventDefault(),void this.handleTriggerClick();const e=this.getMenu();if(e){const o=e.getAllItems(),i=o[0],r=o[o.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||(this.show(),await this.updateComplete),o.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==t.key&&"Home"!==t.key||(e.setCurrentItem(i),i.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(e.setCurrentItem(r),r.focus())})))}}handleTriggerKeyUp(t){" "===t.key&&t.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const t=this.trigger.assignedElements({flatten:!0}).find((t=>function(t){var e,o;const i=Re(t);return{start:null!=(e=i[0])?e:null,end:null!=(o=i[i.length-1])?o:null}}(t).start));let e;if(t){switch(t.tagName.toLowerCase()){case"sl-button":case"sl-icon-button":e=t.button;break;default:e=t}e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,Je(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Je(this,"sl-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){var t;this.panel.addEventListener("sl-select",this.handlePanelSelect),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide(),this.focusOnTrigger()}):this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){var t;this.panel&&(this.panel.removeEventListener("sl-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),null==(t=this.closeWatcher)||t.destroy()}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sl-show"),this.addOpenListeners(),await oo(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:t,options:e}=Ye(this,"dropdown.show",{dir:this.localize.dir()});await Qe(this.popup.popup,t,e),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),await oo(this);const{keyframes:t,options:e}=Ye(this,"dropdown.hide",{dir:this.localize.dir()});await Qe(this.popup.popup,t,e),this.panel.hidden=!0,this.popup.active=!1,this.emit("sl-after-hide")}}render(){return H`
|
|
1154
|
+
<sl-popup
|
|
1155
|
+
part="base"
|
|
1156
|
+
exportparts="popup:base__popup"
|
|
1157
|
+
id="dropdown"
|
|
1158
|
+
placement=${this.placement}
|
|
1159
|
+
distance=${this.distance}
|
|
1160
|
+
skidding=${this.skidding}
|
|
1161
|
+
strategy=${this.hoist?"fixed":"absolute"}
|
|
1162
|
+
flip
|
|
1163
|
+
shift
|
|
1164
|
+
auto-size="vertical"
|
|
1165
|
+
auto-size-padding="10"
|
|
1166
|
+
sync=${Ee(this.sync?this.sync:void 0)}
|
|
1167
|
+
class=${_e({dropdown:!0,"dropdown--open":this.open})}
|
|
1168
|
+
>
|
|
1169
|
+
<slot
|
|
1170
|
+
name="trigger"
|
|
1171
|
+
slot="anchor"
|
|
1172
|
+
part="trigger"
|
|
1173
|
+
class="dropdown__trigger"
|
|
1174
|
+
@click=${this.handleTriggerClick}
|
|
1175
|
+
@keydown=${this.handleTriggerKeyDown}
|
|
1176
|
+
@keyup=${this.handleTriggerKeyUp}
|
|
1177
|
+
@slotchange=${this.handleTriggerSlotChange}
|
|
1178
|
+
></slot>
|
|
1179
|
+
|
|
1180
|
+
<div aria-hidden=${this.open?"false":"true"} aria-labelledby="dropdown">
|
|
1181
|
+
<slot part="panel" class="dropdown__panel"></slot>
|
|
1182
|
+
</div>
|
|
1183
|
+
</sl-popup>
|
|
1184
|
+
`}};Fi.styles=[wt,ro],Fi.dependencies={"sl-popup":Bi},Pt([Ht(".dropdown")],Fi.prototype,"popup",2),Pt([Ht(".dropdown__trigger")],Fi.prototype,"trigger",2),Pt([Ht(".dropdown__panel")],Fi.prototype,"panel",2),Pt([Nt({type:Boolean,reflect:!0})],Fi.prototype,"open",2),Pt([Nt({reflect:!0})],Fi.prototype,"placement",2),Pt([Nt({type:Boolean,reflect:!0})],Fi.prototype,"disabled",2),Pt([Nt({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Fi.prototype,"stayOpenOnSelect",2),Pt([Nt({attribute:!1})],Fi.prototype,"containingElement",2),Pt([Nt({type:Number})],Fi.prototype,"distance",2),Pt([Nt({type:Number})],Fi.prototype,"skidding",2),Pt([Nt({type:Boolean})],Fi.prototype,"hoist",2),Pt([Nt({reflect:!0})],Fi.prototype,"sync",2),Pt([ce("open",{waitUntilFirstUpdate:!0})],Fi.prototype,"handleOpenChange",1),Xe("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),Xe("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}}),Fi.define("sl-dropdown"),fe.define("sl-icon");var Ri=s`
|
|
1185
|
+
:host {
|
|
1186
|
+
--height: 1rem;
|
|
1187
|
+
--track-color: var(--sl-color-neutral-200);
|
|
1256
1188
|
--indicator-color: var(--sl-color-primary-600);
|
|
1257
|
-
--
|
|
1189
|
+
--label-color: var(--sl-color-neutral-0);
|
|
1258
1190
|
|
|
1259
|
-
display:
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1191
|
+
display: block;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.progress-bar {
|
|
1195
|
+
position: relative;
|
|
1196
|
+
background-color: var(--track-color);
|
|
1197
|
+
height: var(--height);
|
|
1198
|
+
border-radius: var(--sl-border-radius-pill);
|
|
1199
|
+
box-shadow: inset var(--sl-shadow-small);
|
|
1200
|
+
overflow: hidden;
|
|
1263
1201
|
}
|
|
1264
1202
|
|
|
1265
|
-
.
|
|
1266
|
-
flex: 1 1 auto;
|
|
1203
|
+
.progress-bar__indicator {
|
|
1267
1204
|
height: 100%;
|
|
1268
|
-
|
|
1205
|
+
font-family: var(--sl-font-sans);
|
|
1206
|
+
font-size: 12px;
|
|
1207
|
+
font-weight: var(--sl-font-weight-normal);
|
|
1208
|
+
background-color: var(--indicator-color);
|
|
1209
|
+
color: var(--label-color);
|
|
1210
|
+
text-align: center;
|
|
1211
|
+
line-height: var(--height);
|
|
1212
|
+
white-space: nowrap;
|
|
1213
|
+
overflow: hidden;
|
|
1214
|
+
transition:
|
|
1215
|
+
400ms width,
|
|
1216
|
+
400ms background-color;
|
|
1217
|
+
user-select: none;
|
|
1218
|
+
-webkit-user-select: none;
|
|
1269
1219
|
}
|
|
1270
1220
|
|
|
1271
|
-
|
|
1272
|
-
.
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
r: calc(0.5em - var(--track-width) / 2);
|
|
1276
|
-
cx: 0.5em;
|
|
1277
|
-
cy: 0.5em;
|
|
1278
|
-
transform-origin: 50% 50%;
|
|
1221
|
+
/* Indeterminate */
|
|
1222
|
+
.progress-bar--indeterminate .progress-bar__indicator {
|
|
1223
|
+
position: absolute;
|
|
1224
|
+
animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);
|
|
1279
1225
|
}
|
|
1280
1226
|
|
|
1281
|
-
.
|
|
1282
|
-
|
|
1283
|
-
transform-origin: 0% 0%;
|
|
1227
|
+
.progress-bar--indeterminate.progress-bar--rtl .progress-bar__indicator {
|
|
1228
|
+
animation-name: indeterminate-rtl;
|
|
1284
1229
|
}
|
|
1285
1230
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1231
|
+
@media (forced-colors: active) {
|
|
1232
|
+
.progress-bar {
|
|
1233
|
+
outline: solid 1px SelectedItem;
|
|
1234
|
+
background-color: var(--sl-color-neutral-0);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
.progress-bar__indicator {
|
|
1238
|
+
outline: solid 1px SelectedItem;
|
|
1239
|
+
background-color: SelectedItem;
|
|
1240
|
+
}
|
|
1291
1241
|
}
|
|
1292
1242
|
|
|
1293
|
-
@keyframes
|
|
1243
|
+
@keyframes indeterminate {
|
|
1294
1244
|
0% {
|
|
1295
|
-
|
|
1296
|
-
|
|
1245
|
+
left: -50%;
|
|
1246
|
+
width: 50%;
|
|
1297
1247
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1248
|
+
75%,
|
|
1249
|
+
100% {
|
|
1250
|
+
left: 100%;
|
|
1251
|
+
width: 50%;
|
|
1302
1252
|
}
|
|
1253
|
+
}
|
|
1303
1254
|
|
|
1255
|
+
@keyframes indeterminate-rtl {
|
|
1256
|
+
0% {
|
|
1257
|
+
right: -50%;
|
|
1258
|
+
width: 50%;
|
|
1259
|
+
}
|
|
1260
|
+
75%,
|
|
1304
1261
|
100% {
|
|
1305
|
-
|
|
1306
|
-
|
|
1262
|
+
right: 100%;
|
|
1263
|
+
width: 50%;
|
|
1307
1264
|
}
|
|
1308
1265
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1266
|
+
`
|
|
1267
|
+
/**
|
|
1268
|
+
* @license
|
|
1269
|
+
* Copyright 2018 Google LLC
|
|
1270
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1271
|
+
*/;const Mi="important",Ni=" !"+Mi,Ui=ye(class extends we{constructor(t){if(super(t),t.type!==ge||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?o.removeProperty(t):o[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(Ni);t.includes("-")||e?o.setProperty(t,e?i.slice(0,-11):i,e?Mi:""):o[t]=i}}return I}});var Hi=class extends Vt{constructor(){super(...arguments),this.localize=new yt(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return H`
|
|
1272
|
+
<div
|
|
1273
|
+
part="base"
|
|
1274
|
+
class=${_e({"progress-bar":!0,"progress-bar--indeterminate":this.indeterminate,"progress-bar--rtl":"rtl"===this.localize.dir()})}
|
|
1275
|
+
role="progressbar"
|
|
1276
|
+
title=${Ee(this.title)}
|
|
1277
|
+
aria-label=${this.label.length>0?this.label:this.localize.term("progress")}
|
|
1278
|
+
aria-valuemin="0"
|
|
1279
|
+
aria-valuemax="100"
|
|
1280
|
+
aria-valuenow=${this.indeterminate?0:this.value}
|
|
1281
|
+
>
|
|
1282
|
+
<div part="indicator" class="progress-bar__indicator" style=${Ui({width:`${this.value}%`})}>
|
|
1283
|
+
${this.indeterminate?"":H` <slot part="label" class="progress-bar__label"></slot> `}
|
|
1284
|
+
</div>
|
|
1285
|
+
</div>
|
|
1286
|
+
`}};Hi.styles=[wt,Ri],Pt([Nt({type:Number,reflect:!0})],Hi.prototype,"value",2),Pt([Nt({type:Boolean,reflect:!0})],Hi.prototype,"indeterminate",2),Pt([Nt()],Hi.prototype,"label",2),Hi.define("sl-progress-bar");var Ii=s`
|
|
1315
1287
|
:host {
|
|
1316
1288
|
display: inline-block;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
:host([size='small']) {
|
|
1292
|
+
--height: var(--sl-toggle-size-small);
|
|
1293
|
+
--thumb-size: calc(var(--sl-toggle-size-small) + 4px);
|
|
1294
|
+
--width: calc(var(--height) * 2);
|
|
1295
|
+
|
|
1296
|
+
font-size: var(--sl-input-font-size-small);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
:host([size='medium']) {
|
|
1300
|
+
--height: var(--sl-toggle-size-medium);
|
|
1301
|
+
--thumb-size: calc(var(--sl-toggle-size-medium) + 4px);
|
|
1302
|
+
--width: calc(var(--height) * 2);
|
|
1303
|
+
|
|
1304
|
+
font-size: var(--sl-input-font-size-medium);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
:host([size='large']) {
|
|
1308
|
+
--height: var(--sl-toggle-size-large);
|
|
1309
|
+
--thumb-size: calc(var(--sl-toggle-size-large) + 4px);
|
|
1310
|
+
--width: calc(var(--height) * 2);
|
|
1311
|
+
|
|
1312
|
+
font-size: var(--sl-input-font-size-large);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.switch {
|
|
1317
1316
|
position: relative;
|
|
1318
|
-
|
|
1317
|
+
display: inline-flex;
|
|
1318
|
+
align-items: center;
|
|
1319
|
+
font-family: var(--sl-input-font-family);
|
|
1320
|
+
font-size: inherit;
|
|
1321
|
+
font-weight: var(--sl-input-font-weight);
|
|
1322
|
+
color: var(--sl-input-label-color);
|
|
1323
|
+
vertical-align: middle;
|
|
1319
1324
|
cursor: pointer;
|
|
1320
1325
|
}
|
|
1321
1326
|
|
|
1322
|
-
.
|
|
1327
|
+
.switch__control {
|
|
1328
|
+
flex: 0 0 auto;
|
|
1329
|
+
position: relative;
|
|
1323
1330
|
display: inline-flex;
|
|
1324
|
-
align-items:
|
|
1331
|
+
align-items: center;
|
|
1325
1332
|
justify-content: center;
|
|
1326
|
-
width:
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
text-decoration: none;
|
|
1332
|
-
user-select: none;
|
|
1333
|
-
-webkit-user-select: none;
|
|
1334
|
-
white-space: nowrap;
|
|
1335
|
-
vertical-align: middle;
|
|
1336
|
-
padding: 0;
|
|
1333
|
+
width: var(--width);
|
|
1334
|
+
height: var(--height);
|
|
1335
|
+
background-color: var(--sl-color-neutral-400);
|
|
1336
|
+
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
|
1337
|
+
border-radius: var(--height);
|
|
1337
1338
|
transition:
|
|
1338
|
-
var(--sl-transition-
|
|
1339
|
-
var(--sl-transition-
|
|
1340
|
-
var(--sl-transition-x-fast) border,
|
|
1341
|
-
var(--sl-transition-x-fast) box-shadow;
|
|
1342
|
-
cursor: inherit;
|
|
1339
|
+
var(--sl-transition-fast) border-color,
|
|
1340
|
+
var(--sl-transition-fast) background-color;
|
|
1343
1341
|
}
|
|
1344
1342
|
|
|
1345
|
-
.
|
|
1346
|
-
|
|
1343
|
+
.switch__control .switch__thumb {
|
|
1344
|
+
width: var(--thumb-size);
|
|
1345
|
+
height: var(--thumb-size);
|
|
1346
|
+
background-color: var(--sl-color-neutral-0);
|
|
1347
|
+
border-radius: 50%;
|
|
1348
|
+
border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
|
|
1349
|
+
translate: calc((var(--width) - var(--height)) / -2);
|
|
1350
|
+
transition:
|
|
1351
|
+
var(--sl-transition-fast) translate ease,
|
|
1352
|
+
var(--sl-transition-fast) background-color,
|
|
1353
|
+
var(--sl-transition-fast) border-color,
|
|
1354
|
+
var(--sl-transition-fast) box-shadow;
|
|
1347
1355
|
}
|
|
1348
1356
|
|
|
1349
|
-
.
|
|
1350
|
-
|
|
1357
|
+
.switch__input {
|
|
1358
|
+
position: absolute;
|
|
1359
|
+
opacity: 0;
|
|
1360
|
+
padding: 0;
|
|
1361
|
+
margin: 0;
|
|
1362
|
+
pointer-events: none;
|
|
1351
1363
|
}
|
|
1352
1364
|
|
|
1353
|
-
|
|
1365
|
+
/* Hover */
|
|
1366
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
|
|
1367
|
+
background-color: var(--sl-color-neutral-400);
|
|
1368
|
+
border-color: var(--sl-color-neutral-400);
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
1372
|
+
background-color: var(--sl-color-neutral-0);
|
|
1373
|
+
border-color: var(--sl-color-neutral-400);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
/* Focus */
|
|
1377
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
1378
|
+
background-color: var(--sl-color-neutral-400);
|
|
1379
|
+
border-color: var(--sl-color-neutral-400);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
.switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
1383
|
+
background-color: var(--sl-color-neutral-0);
|
|
1384
|
+
border-color: var(--sl-color-primary-600);
|
|
1354
1385
|
outline: var(--sl-focus-ring);
|
|
1355
1386
|
outline-offset: var(--sl-focus-ring-offset);
|
|
1356
1387
|
}
|
|
1357
1388
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1389
|
+
/* Checked */
|
|
1390
|
+
.switch--checked .switch__control {
|
|
1391
|
+
background-color: var(--sl-color-primary-600);
|
|
1392
|
+
border-color: var(--sl-color-primary-600);
|
|
1361
1393
|
}
|
|
1362
1394
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1395
|
+
.switch--checked .switch__control .switch__thumb {
|
|
1396
|
+
background-color: var(--sl-color-neutral-0);
|
|
1397
|
+
border-color: var(--sl-color-primary-600);
|
|
1398
|
+
translate: calc((var(--width) - var(--height)) / 2);
|
|
1366
1399
|
}
|
|
1367
1400
|
|
|
1368
|
-
|
|
1369
|
-
.
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
align-items: center;
|
|
1373
|
-
pointer-events: none;
|
|
1401
|
+
/* Checked + hover */
|
|
1402
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover {
|
|
1403
|
+
background-color: var(--sl-color-primary-600);
|
|
1404
|
+
border-color: var(--sl-color-primary-600);
|
|
1374
1405
|
}
|
|
1375
1406
|
|
|
1376
|
-
.
|
|
1377
|
-
|
|
1407
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {
|
|
1408
|
+
background-color: var(--sl-color-neutral-0);
|
|
1409
|
+
border-color: var(--sl-color-primary-600);
|
|
1378
1410
|
}
|
|
1379
1411
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1412
|
+
/* Checked + focus */
|
|
1413
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
|
|
1414
|
+
background-color: var(--sl-color-primary-600);
|
|
1415
|
+
border-color: var(--sl-color-primary-600);
|
|
1382
1416
|
}
|
|
1383
1417
|
|
|
1384
|
-
|
|
1385
|
-
* Standard buttons
|
|
1386
|
-
*/
|
|
1387
|
-
|
|
1388
|
-
/* Default */
|
|
1389
|
-
.button--standard.button--default {
|
|
1418
|
+
.switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
|
|
1390
1419
|
background-color: var(--sl-color-neutral-0);
|
|
1391
|
-
border-color: var(--sl-
|
|
1392
|
-
|
|
1420
|
+
border-color: var(--sl-color-primary-600);
|
|
1421
|
+
outline: var(--sl-focus-ring);
|
|
1422
|
+
outline-offset: var(--sl-focus-ring-offset);
|
|
1393
1423
|
}
|
|
1394
1424
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1425
|
+
/* Disabled */
|
|
1426
|
+
.switch--disabled {
|
|
1427
|
+
opacity: 0.5;
|
|
1428
|
+
cursor: not-allowed;
|
|
1399
1429
|
}
|
|
1400
1430
|
|
|
1401
|
-
.
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1431
|
+
.switch__label {
|
|
1432
|
+
display: inline-block;
|
|
1433
|
+
line-height: var(--height);
|
|
1434
|
+
margin-inline-start: 0.5em;
|
|
1435
|
+
user-select: none;
|
|
1436
|
+
-webkit-user-select: none;
|
|
1405
1437
|
}
|
|
1406
1438
|
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
color: var(--sl-color-neutral-0);
|
|
1439
|
+
:host([required]) .switch__label::after {
|
|
1440
|
+
content: var(--sl-input-required-content);
|
|
1441
|
+
color: var(--sl-input-required-content-color);
|
|
1442
|
+
margin-inline-start: var(--sl-input-required-content-offset);
|
|
1412
1443
|
}
|
|
1413
1444
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1445
|
+
@media (forced-colors: active) {
|
|
1446
|
+
.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,
|
|
1447
|
+
.switch--checked .switch__control .switch__thumb {
|
|
1448
|
+
background-color: ButtonText;
|
|
1449
|
+
}
|
|
1418
1450
|
}
|
|
1419
|
-
|
|
1420
|
-
.
|
|
1421
|
-
|
|
1422
|
-
border-color: var(--sl-color-primary-600);
|
|
1423
|
-
color: var(--sl-color-neutral-0);
|
|
1451
|
+
`,Vi=s`
|
|
1452
|
+
.form-control .form-control__label {
|
|
1453
|
+
display: none;
|
|
1424
1454
|
}
|
|
1425
1455
|
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
background-color: var(--sl-color-success-600);
|
|
1429
|
-
border-color: var(--sl-color-success-600);
|
|
1430
|
-
color: var(--sl-color-neutral-0);
|
|
1456
|
+
.form-control .form-control__help-text {
|
|
1457
|
+
display: none;
|
|
1431
1458
|
}
|
|
1432
1459
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
color: var(--sl-
|
|
1460
|
+
/* Label */
|
|
1461
|
+
.form-control--has-label .form-control__label {
|
|
1462
|
+
display: inline-block;
|
|
1463
|
+
color: var(--sl-input-label-color);
|
|
1464
|
+
margin-bottom: var(--sl-spacing-3x-small);
|
|
1437
1465
|
}
|
|
1438
1466
|
|
|
1439
|
-
.
|
|
1440
|
-
|
|
1441
|
-
border-color: var(--sl-color-success-600);
|
|
1442
|
-
color: var(--sl-color-neutral-0);
|
|
1467
|
+
.form-control--has-label.form-control--small .form-control__label {
|
|
1468
|
+
font-size: var(--sl-input-label-font-size-small);
|
|
1443
1469
|
}
|
|
1444
1470
|
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
background-color: var(--sl-color-neutral-600);
|
|
1448
|
-
border-color: var(--sl-color-neutral-600);
|
|
1449
|
-
color: var(--sl-color-neutral-0);
|
|
1471
|
+
.form-control--has-label.form-control--medium .form-control__label {
|
|
1472
|
+
font-size: var(--sl-input-label-font-size-medium);
|
|
1450
1473
|
}
|
|
1451
1474
|
|
|
1452
|
-
.
|
|
1453
|
-
|
|
1454
|
-
border-color: var(--sl-color-neutral-500);
|
|
1455
|
-
color: var(--sl-color-neutral-0);
|
|
1475
|
+
.form-control--has-label.form-control--large .form-control__label {
|
|
1476
|
+
font-size: var(--sl-input-label-font-size-large);
|
|
1456
1477
|
}
|
|
1457
1478
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
color: var(--sl-
|
|
1479
|
+
:host([required]) .form-control--has-label .form-control__label::after {
|
|
1480
|
+
content: var(--sl-input-required-content);
|
|
1481
|
+
margin-inline-start: var(--sl-input-required-content-offset);
|
|
1482
|
+
color: var(--sl-input-required-content-color);
|
|
1462
1483
|
}
|
|
1463
1484
|
|
|
1464
|
-
/*
|
|
1465
|
-
.
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
}
|
|
1470
|
-
.button--standard.button--warning:hover:not(.button--disabled) {
|
|
1471
|
-
background-color: var(--sl-color-warning-500);
|
|
1472
|
-
border-color: var(--sl-color-warning-500);
|
|
1473
|
-
color: var(--sl-color-neutral-0);
|
|
1485
|
+
/* Help text */
|
|
1486
|
+
.form-control--has-help-text .form-control__help-text {
|
|
1487
|
+
display: block;
|
|
1488
|
+
color: var(--sl-input-help-text-color);
|
|
1489
|
+
margin-top: var(--sl-spacing-3x-small);
|
|
1474
1490
|
}
|
|
1475
1491
|
|
|
1476
|
-
.
|
|
1477
|
-
|
|
1478
|
-
border-color: var(--sl-color-warning-600);
|
|
1479
|
-
color: var(--sl-color-neutral-0);
|
|
1492
|
+
.form-control--has-help-text.form-control--small .form-control__help-text {
|
|
1493
|
+
font-size: var(--sl-input-help-text-font-size-small);
|
|
1480
1494
|
}
|
|
1481
1495
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
background-color: var(--sl-color-danger-600);
|
|
1485
|
-
border-color: var(--sl-color-danger-600);
|
|
1486
|
-
color: var(--sl-color-neutral-0);
|
|
1496
|
+
.form-control--has-help-text.form-control--medium .form-control__help-text {
|
|
1497
|
+
font-size: var(--sl-input-help-text-font-size-medium);
|
|
1487
1498
|
}
|
|
1488
1499
|
|
|
1489
|
-
.
|
|
1490
|
-
|
|
1491
|
-
border-color: var(--sl-color-danger-500);
|
|
1492
|
-
color: var(--sl-color-neutral-0);
|
|
1500
|
+
.form-control--has-help-text.form-control--large .form-control__help-text {
|
|
1501
|
+
font-size: var(--sl-input-help-text-font-size-large);
|
|
1493
1502
|
}
|
|
1494
1503
|
|
|
1495
|
-
.
|
|
1496
|
-
|
|
1497
|
-
border-color: var(--sl-color-danger-600);
|
|
1498
|
-
color: var(--sl-color-neutral-0);
|
|
1504
|
+
.form-control--has-help-text.form-control--radio-group .form-control__help-text {
|
|
1505
|
+
margin-top: var(--sl-spacing-2x-small);
|
|
1499
1506
|
}
|
|
1507
|
+
`
|
|
1508
|
+
/**
|
|
1509
|
+
* @license
|
|
1510
|
+
* Copyright 2020 Google LLC
|
|
1511
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1512
|
+
*/;const Wi=ye(class extends we{constructor(t){if(super(t),t.type!==me&&t.type!==ge&&t.type!==ve)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===I||e===V)return e;const o=t.element,i=t.name;if(t.type===me){if(e===o[i])return I}else if(t.type===ve){if(!!e===o.hasAttribute(i))return I}else if(t.type===ge&&o.getAttribute(i)===e+"")return I;return((t,e=he)=>{t._$AH=e})(t),e}});var ji=class extends Vt{constructor(){super(...arguments),this.formControlController=new Xt(this,{value:t=>t.checked?t.value||"on":void 0,defaultValue:t=>t.defaultChecked,setValue:(t,e)=>t.checked=e}),this.hasSlotController=new Qt(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(t){"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("help-text"),e=!!this.helpText||!!t;return H`
|
|
1513
|
+
<div
|
|
1514
|
+
class=${_e({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":e})}
|
|
1515
|
+
>
|
|
1516
|
+
<label
|
|
1517
|
+
part="base"
|
|
1518
|
+
class=${_e({switch:!0,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus,"switch--small":"small"===this.size,"switch--medium":"medium"===this.size,"switch--large":"large"===this.size})}
|
|
1519
|
+
>
|
|
1520
|
+
<input
|
|
1521
|
+
class="switch__input"
|
|
1522
|
+
type="checkbox"
|
|
1523
|
+
title=${this.title}
|
|
1524
|
+
name=${this.name}
|
|
1525
|
+
value=${Ee(this.value)}
|
|
1526
|
+
.checked=${Wi(this.checked)}
|
|
1527
|
+
.disabled=${this.disabled}
|
|
1528
|
+
.required=${this.required}
|
|
1529
|
+
role="switch"
|
|
1530
|
+
aria-checked=${this.checked?"true":"false"}
|
|
1531
|
+
aria-describedby="help-text"
|
|
1532
|
+
@click=${this.handleClick}
|
|
1533
|
+
@input=${this.handleInput}
|
|
1534
|
+
@invalid=${this.handleInvalid}
|
|
1535
|
+
@blur=${this.handleBlur}
|
|
1536
|
+
@focus=${this.handleFocus}
|
|
1537
|
+
@keydown=${this.handleKeyDown}
|
|
1538
|
+
/>
|
|
1500
1539
|
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1540
|
+
<span part="control" class="switch__control">
|
|
1541
|
+
<span part="thumb" class="switch__thumb"></span>
|
|
1542
|
+
</span>
|
|
1504
1543
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1544
|
+
<div part="label" class="switch__label">
|
|
1545
|
+
<slot></slot>
|
|
1546
|
+
</div>
|
|
1547
|
+
</label>
|
|
1548
|
+
|
|
1549
|
+
<div
|
|
1550
|
+
aria-hidden=${e?"false":"true"}
|
|
1551
|
+
class="form-control__help-text"
|
|
1552
|
+
id="help-text"
|
|
1553
|
+
part="form-control-help-text"
|
|
1554
|
+
>
|
|
1555
|
+
<slot name="help-text">${this.helpText}</slot>
|
|
1556
|
+
</div>
|
|
1557
|
+
</div>
|
|
1558
|
+
`}};ji.styles=[wt,Vi,Ii],Pt([Ht('input[type="checkbox"]')],ji.prototype,"input",2),Pt([Ut()],ji.prototype,"hasFocus",2),Pt([Nt()],ji.prototype,"title",2),Pt([Nt()],ji.prototype,"name",2),Pt([Nt()],ji.prototype,"value",2),Pt([Nt({reflect:!0})],ji.prototype,"size",2),Pt([Nt({type:Boolean,reflect:!0})],ji.prototype,"disabled",2),Pt([Nt({type:Boolean,reflect:!0})],ji.prototype,"checked",2),Pt([((t="value")=>(e,o)=>{const i=e.constructor,r=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(e,s,n){var a;const l=i.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t)){const e=l.converter||v,i=("function"==typeof e?e:null!=(a=null==e?void 0:e.fromAttribute)?a:v.fromAttribute)(n,l.type);this[t]!==i&&(this[o]=i)}r.call(this,e,s,n)}})("checked")],ji.prototype,"defaultChecked",2),Pt([Nt({reflect:!0})],ji.prototype,"form",2),Pt([Nt({type:Boolean,reflect:!0})],ji.prototype,"required",2),Pt([Nt({attribute:"help-text"})],ji.prototype,"helpText",2),Pt([ce("checked",{waitUntilFirstUpdate:!0})],ji.prototype,"handleCheckedChange",1),Pt([ce("disabled",{waitUntilFirstUpdate:!0})],ji.prototype,"handleDisabledChange",1),ji.define("sl-switch");var qi=s`
|
|
1559
|
+
:host {
|
|
1560
|
+
--indicator-color: var(--sl-color-primary-600);
|
|
1561
|
+
--track-color: var(--sl-color-neutral-200);
|
|
1562
|
+
--track-width: 2px;
|
|
1563
|
+
|
|
1564
|
+
display: block;
|
|
1508
1565
|
}
|
|
1509
1566
|
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
border-
|
|
1513
|
-
color: var(--sl-color-neutral-700);
|
|
1567
|
+
.tab-group {
|
|
1568
|
+
display: flex;
|
|
1569
|
+
border-radius: 0;
|
|
1514
1570
|
}
|
|
1515
1571
|
|
|
1516
|
-
.
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
background-color: var(--sl-color-primary-600);
|
|
1520
|
-
color: var(--sl-color-neutral-0);
|
|
1572
|
+
.tab-group__tabs {
|
|
1573
|
+
display: flex;
|
|
1574
|
+
position: relative;
|
|
1521
1575
|
}
|
|
1522
1576
|
|
|
1523
|
-
.
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1577
|
+
.tab-group__indicator {
|
|
1578
|
+
position: absolute;
|
|
1579
|
+
transition:
|
|
1580
|
+
var(--sl-transition-fast) translate ease,
|
|
1581
|
+
var(--sl-transition-fast) width ease;
|
|
1527
1582
|
}
|
|
1528
1583
|
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
color: var(--sl-color-primary-600);
|
|
1584
|
+
.tab-group--has-scroll-controls .tab-group__nav-container {
|
|
1585
|
+
position: relative;
|
|
1586
|
+
padding: 0 var(--sl-spacing-x-large);
|
|
1533
1587
|
}
|
|
1534
1588
|
|
|
1535
|
-
.
|
|
1536
|
-
.
|
|
1537
|
-
|
|
1538
|
-
color: var(--sl-color-neutral-0);
|
|
1589
|
+
.tab-group--has-scroll-controls .tab-group__scroll-button--start--hidden,
|
|
1590
|
+
.tab-group--has-scroll-controls .tab-group__scroll-button--end--hidden {
|
|
1591
|
+
visibility: hidden;
|
|
1539
1592
|
}
|
|
1540
1593
|
|
|
1541
|
-
.
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
color: var(--sl-color-neutral-0);
|
|
1594
|
+
.tab-group__body {
|
|
1595
|
+
display: block;
|
|
1596
|
+
overflow: auto;
|
|
1545
1597
|
}
|
|
1546
1598
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1599
|
+
.tab-group__scroll-button {
|
|
1600
|
+
display: flex;
|
|
1601
|
+
align-items: center;
|
|
1602
|
+
justify-content: center;
|
|
1603
|
+
position: absolute;
|
|
1604
|
+
top: 0;
|
|
1605
|
+
bottom: 0;
|
|
1606
|
+
width: var(--sl-spacing-x-large);
|
|
1551
1607
|
}
|
|
1552
1608
|
|
|
1553
|
-
.button--
|
|
1554
|
-
|
|
1555
|
-
background-color: var(--sl-color-success-600);
|
|
1556
|
-
color: var(--sl-color-neutral-0);
|
|
1609
|
+
.tab-group__scroll-button--start {
|
|
1610
|
+
left: 0;
|
|
1557
1611
|
}
|
|
1558
1612
|
|
|
1559
|
-
.button--
|
|
1560
|
-
|
|
1561
|
-
background-color: var(--sl-color-success-700);
|
|
1562
|
-
color: var(--sl-color-neutral-0);
|
|
1613
|
+
.tab-group__scroll-button--end {
|
|
1614
|
+
right: 0;
|
|
1563
1615
|
}
|
|
1564
1616
|
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
color: var(--sl-color-neutral-600);
|
|
1617
|
+
.tab-group--rtl .tab-group__scroll-button--start {
|
|
1618
|
+
left: auto;
|
|
1619
|
+
right: 0;
|
|
1569
1620
|
}
|
|
1570
1621
|
|
|
1571
|
-
.
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
color: var(--sl-color-neutral-0);
|
|
1622
|
+
.tab-group--rtl .tab-group__scroll-button--end {
|
|
1623
|
+
left: 0;
|
|
1624
|
+
right: auto;
|
|
1575
1625
|
}
|
|
1576
1626
|
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1627
|
+
/*
|
|
1628
|
+
* Top
|
|
1629
|
+
*/
|
|
1630
|
+
|
|
1631
|
+
.tab-group--top {
|
|
1632
|
+
flex-direction: column;
|
|
1581
1633
|
}
|
|
1582
1634
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
border-color: var(--sl-color-warning-600);
|
|
1586
|
-
color: var(--sl-color-warning-600);
|
|
1635
|
+
.tab-group--top .tab-group__nav-container {
|
|
1636
|
+
order: 1;
|
|
1587
1637
|
}
|
|
1588
1638
|
|
|
1589
|
-
.
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1639
|
+
.tab-group--top .tab-group__nav {
|
|
1640
|
+
display: flex;
|
|
1641
|
+
overflow-x: auto;
|
|
1642
|
+
|
|
1643
|
+
/* Hide scrollbar in Firefox */
|
|
1644
|
+
scrollbar-width: none;
|
|
1593
1645
|
}
|
|
1594
1646
|
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1647
|
+
/* Hide scrollbar in Chrome/Safari */
|
|
1648
|
+
.tab-group--top .tab-group__nav::-webkit-scrollbar {
|
|
1649
|
+
width: 0;
|
|
1650
|
+
height: 0;
|
|
1599
1651
|
}
|
|
1600
1652
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1653
|
+
.tab-group--top .tab-group__tabs {
|
|
1654
|
+
flex: 1 1 auto;
|
|
1655
|
+
position: relative;
|
|
1656
|
+
flex-direction: row;
|
|
1657
|
+
border-bottom: solid var(--track-width) var(--track-color);
|
|
1605
1658
|
}
|
|
1606
1659
|
|
|
1607
|
-
.
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
color: var(--sl-color-neutral-0);
|
|
1660
|
+
.tab-group--top .tab-group__indicator {
|
|
1661
|
+
bottom: calc(-1 * var(--track-width));
|
|
1662
|
+
border-bottom: solid var(--track-width) var(--indicator-color);
|
|
1611
1663
|
}
|
|
1612
1664
|
|
|
1613
|
-
.
|
|
1614
|
-
|
|
1615
|
-
background-color: var(--sl-color-danger-700);
|
|
1616
|
-
color: var(--sl-color-neutral-0);
|
|
1665
|
+
.tab-group--top .tab-group__body {
|
|
1666
|
+
order: 2;
|
|
1617
1667
|
}
|
|
1618
1668
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
outline: solid 2px transparent;
|
|
1622
|
-
}
|
|
1669
|
+
.tab-group--top ::slotted(sl-tab-panel) {
|
|
1670
|
+
--padding: var(--sl-spacing-medium) 0;
|
|
1623
1671
|
}
|
|
1624
1672
|
|
|
1625
1673
|
/*
|
|
1626
|
-
*
|
|
1674
|
+
* Bottom
|
|
1627
1675
|
*/
|
|
1628
1676
|
|
|
1629
|
-
.
|
|
1630
|
-
|
|
1631
|
-
border-color: transparent;
|
|
1632
|
-
color: var(--sl-color-primary-600);
|
|
1677
|
+
.tab-group--bottom {
|
|
1678
|
+
flex-direction: column;
|
|
1633
1679
|
}
|
|
1634
1680
|
|
|
1635
|
-
.
|
|
1636
|
-
|
|
1637
|
-
border-color: transparent;
|
|
1638
|
-
color: var(--sl-color-primary-500);
|
|
1681
|
+
.tab-group--bottom .tab-group__nav-container {
|
|
1682
|
+
order: 2;
|
|
1639
1683
|
}
|
|
1640
1684
|
|
|
1641
|
-
.
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1685
|
+
.tab-group--bottom .tab-group__nav {
|
|
1686
|
+
display: flex;
|
|
1687
|
+
overflow-x: auto;
|
|
1688
|
+
|
|
1689
|
+
/* Hide scrollbar in Firefox */
|
|
1690
|
+
scrollbar-width: none;
|
|
1645
1691
|
}
|
|
1646
1692
|
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1693
|
+
/* Hide scrollbar in Chrome/Safari */
|
|
1694
|
+
.tab-group--bottom .tab-group__nav::-webkit-scrollbar {
|
|
1695
|
+
width: 0;
|
|
1696
|
+
height: 0;
|
|
1651
1697
|
}
|
|
1652
1698
|
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1699
|
+
.tab-group--bottom .tab-group__tabs {
|
|
1700
|
+
flex: 1 1 auto;
|
|
1701
|
+
position: relative;
|
|
1702
|
+
flex-direction: row;
|
|
1703
|
+
border-top: solid var(--track-width) var(--track-color);
|
|
1704
|
+
}
|
|
1656
1705
|
|
|
1657
|
-
.
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
font-size: var(--sl-button-font-size-small);
|
|
1661
|
-
line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
|
|
1662
|
-
border-radius: var(--sl-input-border-radius-small);
|
|
1706
|
+
.tab-group--bottom .tab-group__indicator {
|
|
1707
|
+
top: calc(-1 * var(--track-width));
|
|
1708
|
+
border-top: solid var(--track-width) var(--indicator-color);
|
|
1663
1709
|
}
|
|
1664
1710
|
|
|
1665
|
-
.
|
|
1666
|
-
|
|
1667
|
-
min-height: var(--sl-input-height-medium);
|
|
1668
|
-
font-size: var(--sl-button-font-size-medium);
|
|
1669
|
-
line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
|
|
1670
|
-
border-radius: var(--sl-input-border-radius-medium);
|
|
1711
|
+
.tab-group--bottom .tab-group__body {
|
|
1712
|
+
order: 1;
|
|
1671
1713
|
}
|
|
1672
1714
|
|
|
1673
|
-
.
|
|
1674
|
-
|
|
1675
|
-
min-height: var(--sl-input-height-large);
|
|
1676
|
-
font-size: var(--sl-button-font-size-large);
|
|
1677
|
-
line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
|
|
1678
|
-
border-radius: var(--sl-input-border-radius-large);
|
|
1715
|
+
.tab-group--bottom ::slotted(sl-tab-panel) {
|
|
1716
|
+
--padding: var(--sl-spacing-medium) 0;
|
|
1679
1717
|
}
|
|
1680
1718
|
|
|
1681
1719
|
/*
|
|
1682
|
-
*
|
|
1720
|
+
* Start
|
|
1683
1721
|
*/
|
|
1684
1722
|
|
|
1685
|
-
.
|
|
1686
|
-
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
.button--pill.button--medium {
|
|
1690
|
-
border-radius: var(--sl-input-height-medium);
|
|
1723
|
+
.tab-group--start {
|
|
1724
|
+
flex-direction: row;
|
|
1691
1725
|
}
|
|
1692
1726
|
|
|
1693
|
-
.
|
|
1694
|
-
|
|
1727
|
+
.tab-group--start .tab-group__nav-container {
|
|
1728
|
+
order: 1;
|
|
1695
1729
|
}
|
|
1696
1730
|
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
.button--circle {
|
|
1702
|
-
padding-left: 0;
|
|
1703
|
-
padding-right: 0;
|
|
1731
|
+
.tab-group--start .tab-group__tabs {
|
|
1732
|
+
flex: 0 0 auto;
|
|
1733
|
+
flex-direction: column;
|
|
1734
|
+
border-inline-end: solid var(--track-width) var(--track-color);
|
|
1704
1735
|
}
|
|
1705
1736
|
|
|
1706
|
-
.
|
|
1707
|
-
|
|
1708
|
-
border-
|
|
1737
|
+
.tab-group--start .tab-group__indicator {
|
|
1738
|
+
right: calc(-1 * var(--track-width));
|
|
1739
|
+
border-right: solid var(--track-width) var(--indicator-color);
|
|
1709
1740
|
}
|
|
1710
1741
|
|
|
1711
|
-
.
|
|
1712
|
-
|
|
1713
|
-
|
|
1742
|
+
.tab-group--start.tab-group--rtl .tab-group__indicator {
|
|
1743
|
+
right: auto;
|
|
1744
|
+
left: calc(-1 * var(--track-width));
|
|
1714
1745
|
}
|
|
1715
1746
|
|
|
1716
|
-
.
|
|
1717
|
-
|
|
1718
|
-
|
|
1747
|
+
.tab-group--start .tab-group__body {
|
|
1748
|
+
flex: 1 1 auto;
|
|
1749
|
+
order: 2;
|
|
1719
1750
|
}
|
|
1720
1751
|
|
|
1721
|
-
.
|
|
1722
|
-
|
|
1723
|
-
.button--circle .button__caret {
|
|
1724
|
-
display: none;
|
|
1752
|
+
.tab-group--start ::slotted(sl-tab-panel) {
|
|
1753
|
+
--padding: 0 var(--sl-spacing-medium);
|
|
1725
1754
|
}
|
|
1726
1755
|
|
|
1727
1756
|
/*
|
|
1728
|
-
*
|
|
1757
|
+
* End
|
|
1729
1758
|
*/
|
|
1730
1759
|
|
|
1731
|
-
.
|
|
1732
|
-
|
|
1760
|
+
.tab-group--end {
|
|
1761
|
+
flex-direction: row;
|
|
1733
1762
|
}
|
|
1734
1763
|
|
|
1735
|
-
.
|
|
1736
|
-
|
|
1764
|
+
.tab-group--end .tab-group__nav-container {
|
|
1765
|
+
order: 2;
|
|
1737
1766
|
}
|
|
1738
1767
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
.button--loading {
|
|
1744
|
-
position: relative;
|
|
1745
|
-
cursor: wait;
|
|
1768
|
+
.tab-group--end .tab-group__tabs {
|
|
1769
|
+
flex: 0 0 auto;
|
|
1770
|
+
flex-direction: column;
|
|
1771
|
+
border-left: solid var(--track-width) var(--track-color);
|
|
1746
1772
|
}
|
|
1747
1773
|
|
|
1748
|
-
.
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
.button--loading .button__caret {
|
|
1752
|
-
visibility: hidden;
|
|
1774
|
+
.tab-group--end .tab-group__indicator {
|
|
1775
|
+
left: calc(-1 * var(--track-width));
|
|
1776
|
+
border-inline-start: solid var(--track-width) var(--indicator-color);
|
|
1753
1777
|
}
|
|
1754
1778
|
|
|
1755
|
-
.
|
|
1756
|
-
--
|
|
1757
|
-
|
|
1758
|
-
font-size: 1em;
|
|
1759
|
-
height: 1em;
|
|
1760
|
-
width: 1em;
|
|
1761
|
-
top: calc(50% - 0.5em);
|
|
1762
|
-
left: calc(50% - 0.5em);
|
|
1779
|
+
.tab-group--end.tab-group--rtl .tab-group__indicator {
|
|
1780
|
+
right: calc(-1 * var(--track-width));
|
|
1781
|
+
left: auto;
|
|
1763
1782
|
}
|
|
1764
1783
|
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1784
|
+
.tab-group--end .tab-group__body {
|
|
1785
|
+
flex: 1 1 auto;
|
|
1786
|
+
order: 1;
|
|
1787
|
+
}
|
|
1768
1788
|
|
|
1769
|
-
.
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1789
|
+
.tab-group--end ::slotted(sl-tab-panel) {
|
|
1790
|
+
--padding: 0 var(--sl-spacing-medium);
|
|
1791
|
+
}
|
|
1792
|
+
`,Ki=s`
|
|
1793
|
+
:host {
|
|
1794
|
+
display: contents;
|
|
1775
1795
|
}
|
|
1796
|
+
`,Zi=class extends Vt{constructor(){super(...arguments),this.observedElements=[],this.disabled=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((t=>{this.emit("sl-resize",{detail:{entries:t}})})),this.disabled||this.startObserver()}disconnectedCallback(){super.disconnectedCallback(),this.stopObserver()}handleSlotChange(){this.disabled||this.startObserver()}startObserver(){const t=this.shadowRoot.querySelector("slot");if(null!==t){const e=t.assignedElements({flatten:!0});this.observedElements.forEach((t=>this.resizeObserver.unobserve(t))),this.observedElements=[],e.forEach((t=>{this.resizeObserver.observe(t),this.observedElements.push(t)}))}}stopObserver(){this.resizeObserver.disconnect()}handleDisabledChange(){this.disabled?this.stopObserver():this.startObserver()}render(){return H` <slot @slotchange=${this.handleSlotChange}></slot> `}};Zi.styles=[wt,Ki],Pt([Nt({type:Boolean,reflect:!0})],Zi.prototype,"disabled",2),Pt([ce("disabled",{waitUntilFirstUpdate:!0})],Zi.prototype,"handleDisabledChange",1);var Gi=class extends Vt{constructor(){super(...arguments),this.tabs=[],this.focusableTabs=[],this.panels=[],this.localize=new yt(this),this.hasScrollControls=!1,this.shouldHideScrollStartButton=!1,this.shouldHideScrollEndButton=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1,this.fixedScrollControls=!1,this.scrollOffset=1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator(),this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{const e=t.filter((({target:t})=>{if(t===this)return!0;if(t.closest("sl-tab-group")!==this)return!1;const e=t.tagName.toLowerCase();return"sl-tab"===e||"sl-tab-panel"===e}));if(0!==e.length)if(e.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),e.some((t=>"disabled"===t.attributeName)))this.syncTabsAndPanels();else if(e.some((t=>"active"===t.attributeName))){const t=e.filter((t=>"active"===t.attributeName&&"sl-tab"===t.target.tagName.toLowerCase())).map((t=>t.target)),o=t.find((t=>t.active));o&&this.setActiveTab(o)}})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,attributeFilter:["active","disabled","name","panel"],childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{var o;t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(null!=(o=this.getActiveTab())?o:this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){var t,e;super.disconnectedCallback(),null==(t=this.mutationObserver)||t.disconnect(),this.nav&&(null==(e=this.resizeObserver)||e.unobserve(this.nav))}getAllTabs(){return this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sl-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target.closest("sl-tab");(null==e?void 0:e.closest("sl-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sl-tab");if((null==e?void 0:e.closest("sl-tab-group"))===this&&(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key))){const e=this.tabs.find((t=>t.matches(":focus"))),o="rtl"===this.localize.dir();let i=null;if("sl-tab"===(null==e?void 0:e.tagName.toLowerCase())){if("Home"===t.key)i=this.focusableTabs[0];else if("End"===t.key)i=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"forward")}if(!i)return;i.tabIndex=0,i.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(i,{scrollBehavior:"smooth"}):this.tabs.forEach((t=>{t.tabIndex=t===i?0:-1})),["top","bottom"].includes(this.placement)&&Ve(i,this.nav,"horizontal"),t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e=Lt({emitEvents:!0,scrollBehavior:"auto"},e),t!==this.activeTab&&!t.disabled){const o=this.activeTab;this.activeTab=t,this.tabs.forEach((t=>{t.active=t===this.activeTab,t.tabIndex=t===this.activeTab?0:-1})),this.panels.forEach((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),this.syncIndicator(),["top","bottom"].includes(this.placement)&&Ve(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(o&&this.emit("sl-tab-hide",{detail:{name:o.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}repositionIndicator(){const t=this.getActiveTab();if(!t)return;const e=t.clientWidth,o=t.clientHeight,i="rtl"===this.localize.dir(),r=this.getAllTabs(),s=r.slice(0,r.indexOf(t)).reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`,this.indicator.style.height="auto",this.indicator.style.translate=i?-1*s.left+"px":`${s.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${o}px`,this.indicator.style.translate=`0 ${s.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter((t=>!t.disabled)),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then((()=>this.updateScrollControls()))}findNextFocusableTab(t,e){let o=null;const i="forward"===e?1:-1;let r=t+i;for(;t<this.tabs.length;){if(o=this.tabs[r]||null,null===o){o="forward"===e?this.focusableTabs[0]:this.focusableTabs[this.focusableTabs.length-1];break}if(!o.disabled)break;r+=i}return o}updateScrollButtons(){this.hasScrollControls&&!this.fixedScrollControls&&(this.shouldHideScrollStartButton=this.scrollFromStart()<=this.scrollOffset,this.shouldHideScrollEndButton=this.isScrolledToEnd())}isScrolledToEnd(){return this.scrollFromStart()+this.nav.clientWidth>=this.nav.scrollWidth-this.scrollOffset}scrollFromStart(){return"rtl"===this.localize.dir()?-this.nav.scrollLeft:this.nav.scrollLeft}updateScrollControls(){this.noScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth+1,this.updateScrollButtons()}syncIndicator(){this.getActiveTab()?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return H`
|
|
1797
|
+
<div
|
|
1798
|
+
part="base"
|
|
1799
|
+
class=${_e({"tab-group":!0,"tab-group--top":"top"===this.placement,"tab-group--bottom":"bottom"===this.placement,"tab-group--start":"start"===this.placement,"tab-group--end":"end"===this.placement,"tab-group--rtl":"rtl"===this.localize.dir(),"tab-group--has-scroll-controls":this.hasScrollControls})}
|
|
1800
|
+
@click=${this.handleClick}
|
|
1801
|
+
@keydown=${this.handleKeyDown}
|
|
1802
|
+
>
|
|
1803
|
+
<div class="tab-group__nav-container" part="nav">
|
|
1804
|
+
${this.hasScrollControls?H`
|
|
1805
|
+
<sl-icon-button
|
|
1806
|
+
part="scroll-button scroll-button--start"
|
|
1807
|
+
exportparts="base:scroll-button__base"
|
|
1808
|
+
class=${_e({"tab-group__scroll-button":!0,"tab-group__scroll-button--start":!0,"tab-group__scroll-button--start--hidden":this.shouldHideScrollStartButton})}
|
|
1809
|
+
name=${t?"chevron-right":"chevron-left"}
|
|
1810
|
+
library="system"
|
|
1811
|
+
tabindex="-1"
|
|
1812
|
+
aria-hidden="true"
|
|
1813
|
+
label=${this.localize.term("scrollToStart")}
|
|
1814
|
+
@click=${this.handleScrollToStart}
|
|
1815
|
+
></sl-icon-button>
|
|
1816
|
+
`:""}
|
|
1776
1817
|
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1818
|
+
<div class="tab-group__nav" @scrollend=${this.updateScrollButtons}>
|
|
1819
|
+
<div part="tabs" class="tab-group__tabs" role="tablist">
|
|
1820
|
+
<div part="active-tab-indicator" class="tab-group__indicator"></div>
|
|
1821
|
+
<sl-resize-observer @sl-resize=${this.syncIndicator}>
|
|
1822
|
+
<slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot>
|
|
1823
|
+
</sl-resize-observer>
|
|
1824
|
+
</div>
|
|
1825
|
+
</div>
|
|
1782
1826
|
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1827
|
+
${this.hasScrollControls?H`
|
|
1828
|
+
<sl-icon-button
|
|
1829
|
+
part="scroll-button scroll-button--end"
|
|
1830
|
+
exportparts="base:scroll-button__base"
|
|
1831
|
+
class=${_e({"tab-group__scroll-button":!0,"tab-group__scroll-button--end":!0,"tab-group__scroll-button--end--hidden":this.shouldHideScrollEndButton})}
|
|
1832
|
+
name=${t?"chevron-left":"chevron-right"}
|
|
1833
|
+
library="system"
|
|
1834
|
+
tabindex="-1"
|
|
1835
|
+
aria-hidden="true"
|
|
1836
|
+
label=${this.localize.term("scrollToEnd")}
|
|
1837
|
+
@click=${this.handleScrollToEnd}
|
|
1838
|
+
></sl-icon-button>
|
|
1839
|
+
`:""}
|
|
1840
|
+
</div>
|
|
1786
1841
|
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1842
|
+
<slot part="body" class="tab-group__body" @slotchange=${this.syncTabsAndPanels}></slot>
|
|
1843
|
+
</div>
|
|
1844
|
+
`}};Gi.styles=[wt,qi],Gi.dependencies={"sl-icon-button":qe,"sl-resize-observer":Zi},Pt([Ht(".tab-group")],Gi.prototype,"tabGroup",2),Pt([Ht(".tab-group__body")],Gi.prototype,"body",2),Pt([Ht(".tab-group__nav")],Gi.prototype,"nav",2),Pt([Ht(".tab-group__indicator")],Gi.prototype,"indicator",2),Pt([Ut()],Gi.prototype,"hasScrollControls",2),Pt([Ut()],Gi.prototype,"shouldHideScrollStartButton",2),Pt([Ut()],Gi.prototype,"shouldHideScrollEndButton",2),Pt([Nt()],Gi.prototype,"placement",2),Pt([Nt()],Gi.prototype,"activation",2),Pt([Nt({attribute:"no-scroll-controls",type:Boolean})],Gi.prototype,"noScrollControls",2),Pt([Nt({attribute:"fixed-scroll-controls",type:Boolean})],Gi.prototype,"fixedScrollControls",2),Pt([function(t){return(e,o)=>{const i="function"==typeof e?e:e[o];Object.assign(i,t)}}
|
|
1845
|
+
/**
|
|
1846
|
+
* @license
|
|
1847
|
+
* Copyright 2017 Google LLC
|
|
1848
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1849
|
+
*/({passive:!0})],Gi.prototype,"updateScrollButtons",1),Pt([ce("noScrollControls",{waitUntilFirstUpdate:!0})],Gi.prototype,"updateScrollControls",1),Pt([ce("placement",{waitUntilFirstUpdate:!0})],Gi.prototype,"syncIndicator",1),Gi.define("sl-tab-group");var Xi=(t,e)=>{let o=0;return function(...i){window.clearTimeout(o),o=window.setTimeout((()=>{t.call(this,...i)}),e)}},Yi=(t,e,o)=>{const i=t[e];t[e]=function(...t){i.call(this,...t),o.call(this,i,...t)}};(()=>{if("undefined"==typeof window)return;if(!("onscrollend"in window)){const t=new Set,e=new WeakMap,o=e=>{for(const o of e.changedTouches)t.add(o.identifier)},i=e=>{for(const o of e.changedTouches)t.delete(o.identifier)};document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),Yi(EventTarget.prototype,"addEventListener",(function(o,i){if("scrollend"!==i)return;const r=Xi((()=>{t.size?r():this.dispatchEvent(new Event("scrollend"))}),100);o.call(this,"scroll",r,{passive:!0}),e.set(this,r)})),Yi(EventTarget.prototype,"removeEventListener",(function(t,o){if("scrollend"!==o)return;const i=e.get(this);i&&t.call(this,"scroll",i,{passive:!0})}))}})();var Ji=s`
|
|
1850
|
+
:host {
|
|
1851
|
+
--padding: 0;
|
|
1790
1852
|
|
|
1791
|
-
|
|
1792
|
-
padding: 0 var(--sl-spacing-medium);
|
|
1853
|
+
display: none;
|
|
1793
1854
|
}
|
|
1794
1855
|
|
|
1795
|
-
|
|
1796
|
-
|
|
1856
|
+
:host([active]) {
|
|
1857
|
+
display: block;
|
|
1797
1858
|
}
|
|
1798
1859
|
|
|
1799
|
-
.
|
|
1800
|
-
|
|
1860
|
+
.tab-panel {
|
|
1861
|
+
display: block;
|
|
1862
|
+
padding: var(--padding);
|
|
1801
1863
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1864
|
+
`,Qi=0,tr=class extends Vt{constructor(){super(...arguments),this.attrId=++Qi,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return H`
|
|
1865
|
+
<slot
|
|
1866
|
+
part="base"
|
|
1867
|
+
class=${_e({"tab-panel":!0,"tab-panel--active":this.active})}
|
|
1868
|
+
></slot>
|
|
1869
|
+
`}};tr.styles=[wt,Ji],Pt([Nt({reflect:!0})],tr.prototype,"name",2),Pt([Nt({type:Boolean,reflect:!0})],tr.prototype,"active",2),Pt([ce("active")],tr.prototype,"handleActiveChange",1),tr.define("sl-tab-panel");var er=s`
|
|
1870
|
+
:host {
|
|
1871
|
+
display: inline-block;
|
|
1805
1872
|
}
|
|
1806
1873
|
|
|
1807
|
-
.
|
|
1808
|
-
|
|
1874
|
+
.tab {
|
|
1875
|
+
display: inline-flex;
|
|
1876
|
+
align-items: center;
|
|
1877
|
+
font-family: var(--sl-font-sans);
|
|
1878
|
+
font-size: var(--sl-font-size-small);
|
|
1879
|
+
font-weight: var(--sl-font-weight-semibold);
|
|
1880
|
+
border-radius: var(--sl-border-radius-medium);
|
|
1881
|
+
color: var(--sl-color-neutral-600);
|
|
1882
|
+
padding: var(--sl-spacing-medium) var(--sl-spacing-large);
|
|
1883
|
+
white-space: nowrap;
|
|
1884
|
+
user-select: none;
|
|
1885
|
+
-webkit-user-select: none;
|
|
1886
|
+
cursor: pointer;
|
|
1887
|
+
transition:
|
|
1888
|
+
var(--transition-speed) box-shadow,
|
|
1889
|
+
var(--transition-speed) color;
|
|
1809
1890
|
}
|
|
1810
1891
|
|
|
1811
|
-
.
|
|
1812
|
-
|
|
1892
|
+
.tab:hover:not(.tab--disabled) {
|
|
1893
|
+
color: var(--sl-color-primary-600);
|
|
1813
1894
|
}
|
|
1814
1895
|
|
|
1815
|
-
|
|
1816
|
-
|
|
1896
|
+
:host(:focus) {
|
|
1897
|
+
outline: transparent;
|
|
1817
1898
|
}
|
|
1818
1899
|
|
|
1819
|
-
|
|
1820
|
-
|
|
1900
|
+
:host(:focus-visible) {
|
|
1901
|
+
color: var(--sl-color-primary-600);
|
|
1902
|
+
outline: var(--sl-focus-ring);
|
|
1903
|
+
outline-offset: calc(-1 * var(--sl-focus-ring-width) - var(--sl-focus-ring-offset));
|
|
1821
1904
|
}
|
|
1822
1905
|
|
|
1823
|
-
.
|
|
1824
|
-
|
|
1825
|
-
padding-inline-end: var(--sl-spacing-x-small);
|
|
1906
|
+
.tab.tab--active:not(.tab--disabled) {
|
|
1907
|
+
color: var(--sl-color-primary-600);
|
|
1826
1908
|
}
|
|
1827
1909
|
|
|
1828
|
-
.
|
|
1829
|
-
|
|
1830
|
-
padding-inline-end: var(--sl-spacing-x-small);
|
|
1910
|
+
.tab.tab--closable {
|
|
1911
|
+
padding-inline-end: var(--sl-spacing-small);
|
|
1831
1912
|
}
|
|
1832
1913
|
|
|
1833
|
-
.
|
|
1834
|
-
|
|
1835
|
-
|
|
1914
|
+
.tab.tab--disabled {
|
|
1915
|
+
opacity: 0.5;
|
|
1916
|
+
cursor: not-allowed;
|
|
1836
1917
|
}
|
|
1837
1918
|
|
|
1838
|
-
.
|
|
1839
|
-
|
|
1840
|
-
|
|
1919
|
+
.tab__close-button {
|
|
1920
|
+
font-size: var(--sl-font-size-small);
|
|
1921
|
+
margin-inline-start: var(--sl-spacing-small);
|
|
1841
1922
|
}
|
|
1842
1923
|
|
|
1843
|
-
.
|
|
1844
|
-
|
|
1845
|
-
padding-inline-end: var(--sl-spacing-small);
|
|
1924
|
+
.tab__close-button::part(base) {
|
|
1925
|
+
padding: var(--sl-spacing-3x-small);
|
|
1846
1926
|
}
|
|
1847
1927
|
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1928
|
+
@media (forced-colors: active) {
|
|
1929
|
+
.tab.tab--active:not(.tab--disabled) {
|
|
1930
|
+
outline: solid 1px transparent;
|
|
1931
|
+
outline-offset: -3px;
|
|
1932
|
+
}
|
|
1851
1933
|
}
|
|
1934
|
+
`,or=0,ir=class extends Vt{constructor(){super(...arguments),this.localize=new yt(this),this.attrId=++or,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled&&!this.active?this.tabIndex=-1:this.tabIndex=0}render(){return this.id=this.id.length>0?this.id:this.componentId,H`
|
|
1935
|
+
<div
|
|
1936
|
+
part="base"
|
|
1937
|
+
class=${_e({tab:!0,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})}
|
|
1938
|
+
>
|
|
1939
|
+
<slot></slot>
|
|
1940
|
+
${this.closable?H`
|
|
1941
|
+
<sl-icon-button
|
|
1942
|
+
part="close-button"
|
|
1943
|
+
exportparts="base:close-button__base"
|
|
1944
|
+
name="x-lg"
|
|
1945
|
+
library="system"
|
|
1946
|
+
label=${this.localize.term("close")}
|
|
1947
|
+
class="tab__close-button"
|
|
1948
|
+
@click=${this.handleCloseClick}
|
|
1949
|
+
tabindex="-1"
|
|
1950
|
+
></sl-icon-button>
|
|
1951
|
+
`:""}
|
|
1952
|
+
</div>
|
|
1953
|
+
`}};ir.styles=[wt,er],ir.dependencies={"sl-icon-button":qe},Pt([Ht(".tab")],ir.prototype,"tab",2),Pt([Nt({reflect:!0})],ir.prototype,"panel",2),Pt([Nt({type:Boolean,reflect:!0})],ir.prototype,"active",2),Pt([Nt({type:Boolean,reflect:!0})],ir.prototype,"closable",2),Pt([Nt({type:Boolean,reflect:!0})],ir.prototype,"disabled",2),Pt([Nt({type:Number,reflect:!0})],ir.prototype,"tabIndex",2),Pt([ce("active")],ir.prototype,"handleActiveChange",1),Pt([ce("disabled")],ir.prototype,"handleDisabledChange",1),ir.define("sl-tab");var rr=s`
|
|
1954
|
+
:host {
|
|
1955
|
+
--max-width: 20rem;
|
|
1956
|
+
--hide-delay: 0ms;
|
|
1957
|
+
--show-delay: 150ms;
|
|
1852
1958
|
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
* This means buttons aren't always direct descendants of the button group, thus we can't target them with the
|
|
1856
|
-
* ::slotted selector. To work around this, the button group component does some magic to add these special classes to
|
|
1857
|
-
* buttons and we style them here instead.
|
|
1858
|
-
*/
|
|
1959
|
+
display: contents;
|
|
1960
|
+
}
|
|
1859
1961
|
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1962
|
+
.tooltip {
|
|
1963
|
+
--arrow-size: var(--sl-tooltip-arrow-size);
|
|
1964
|
+
--arrow-color: var(--sl-tooltip-background-color);
|
|
1863
1965
|
}
|
|
1864
1966
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1967
|
+
.tooltip::part(popup) {
|
|
1968
|
+
z-index: var(--sl-z-index-tooltip);
|
|
1867
1969
|
}
|
|
1868
1970
|
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
border-end-start-radius: 0;
|
|
1971
|
+
.tooltip[placement^='top']::part(popup) {
|
|
1972
|
+
transform-origin: bottom;
|
|
1872
1973
|
}
|
|
1873
1974
|
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
margin-inline-start: calc(-1 * var(--sl-input-border-width));
|
|
1975
|
+
.tooltip[placement^='bottom']::part(popup) {
|
|
1976
|
+
transform-origin: top;
|
|
1877
1977
|
}
|
|
1878
1978
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
[data-sl-button-group__button]:not(
|
|
1882
|
-
[data-sl-button-group__button--first],
|
|
1883
|
-
[data-sl-button-group__button--radio],
|
|
1884
|
-
[variant='default']
|
|
1885
|
-
):not(:hover)
|
|
1886
|
-
)
|
|
1887
|
-
.button:after {
|
|
1888
|
-
content: '';
|
|
1889
|
-
position: absolute;
|
|
1890
|
-
top: 0;
|
|
1891
|
-
inset-inline-start: 0;
|
|
1892
|
-
bottom: 0;
|
|
1893
|
-
border-left: solid 1px rgb(128 128 128 / 33%);
|
|
1894
|
-
mix-blend-mode: multiply;
|
|
1979
|
+
.tooltip[placement^='left']::part(popup) {
|
|
1980
|
+
transform-origin: right;
|
|
1895
1981
|
}
|
|
1896
1982
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
z-index: 1;
|
|
1983
|
+
.tooltip[placement^='right']::part(popup) {
|
|
1984
|
+
transform-origin: left;
|
|
1900
1985
|
}
|
|
1901
1986
|
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1987
|
+
.tooltip__body {
|
|
1988
|
+
display: block;
|
|
1989
|
+
width: max-content;
|
|
1990
|
+
max-width: var(--max-width);
|
|
1991
|
+
border-radius: var(--sl-tooltip-border-radius);
|
|
1992
|
+
background-color: var(--sl-tooltip-background-color);
|
|
1993
|
+
font-family: var(--sl-tooltip-font-family);
|
|
1994
|
+
font-size: var(--sl-tooltip-font-size);
|
|
1995
|
+
font-weight: var(--sl-tooltip-font-weight);
|
|
1996
|
+
line-height: var(--sl-tooltip-line-height);
|
|
1997
|
+
text-align: start;
|
|
1998
|
+
white-space: normal;
|
|
1999
|
+
color: var(--sl-tooltip-color);
|
|
2000
|
+
padding: var(--sl-tooltip-padding);
|
|
2001
|
+
pointer-events: none;
|
|
2002
|
+
user-select: none;
|
|
2003
|
+
-webkit-user-select: none;
|
|
1906
2004
|
}
|
|
1907
|
-
`,
|
|
1908
|
-
|
|
2005
|
+
`,sr=class extends Vt{constructor(){super(),this.localize=new yt(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=to(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=to(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await oo(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=Ye(this,"tooltip.show",{dir:this.localize.dir()});await Qe(this.popup.popup,e,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await oo(this.body);const{keyframes:t,options:o}=Ye(this,"tooltip.hide",{dir:this.localize.dir()});await Qe(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,Je(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Je(this,"sl-after-hide")}render(){return H`
|
|
2006
|
+
<sl-popup
|
|
1909
2007
|
part="base"
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
@blur=${this.handleBlur}
|
|
1924
|
-
@focus=${this.handleFocus}
|
|
1925
|
-
@invalid=${this.isButton()?this.handleInvalid:null}
|
|
1926
|
-
@click=${this.handleClick}
|
|
2008
|
+
exportparts="
|
|
2009
|
+
popup:base__popup,
|
|
2010
|
+
arrow:base__arrow
|
|
2011
|
+
"
|
|
2012
|
+
class=${_e({tooltip:!0,"tooltip--open":this.open})}
|
|
2013
|
+
placement=${this.placement}
|
|
2014
|
+
distance=${this.distance}
|
|
2015
|
+
skidding=${this.skidding}
|
|
2016
|
+
strategy=${this.hoist?"fixed":"absolute"}
|
|
2017
|
+
flip
|
|
2018
|
+
shift
|
|
2019
|
+
arrow
|
|
2020
|
+
hover-bridge
|
|
1927
2021
|
>
|
|
1928
|
-
|
|
1929
|
-
<slot
|
|
1930
|
-
|
|
1931
|
-
${
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2022
|
+
${""}
|
|
2023
|
+
<slot slot="anchor" aria-describedby="tooltip"></slot>
|
|
2024
|
+
|
|
2025
|
+
${""}
|
|
2026
|
+
<div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open?"polite":"off"}>
|
|
2027
|
+
<slot name="content">${this.content}</slot>
|
|
2028
|
+
</div>
|
|
2029
|
+
</sl-popup>
|
|
2030
|
+
`}};sr.styles=[wt,rr],sr.dependencies={"sl-popup":Bi},Pt([Ht("slot:not([name])")],sr.prototype,"defaultSlot",2),Pt([Ht(".tooltip__body")],sr.prototype,"body",2),Pt([Ht("sl-popup")],sr.prototype,"popup",2),Pt([Nt()],sr.prototype,"content",2),Pt([Nt()],sr.prototype,"placement",2),Pt([Nt({type:Boolean,reflect:!0})],sr.prototype,"disabled",2),Pt([Nt({type:Number})],sr.prototype,"distance",2),Pt([Nt({type:Boolean,reflect:!0})],sr.prototype,"open",2),Pt([Nt({type:Number})],sr.prototype,"skidding",2),Pt([Nt()],sr.prototype,"trigger",2),Pt([Nt({type:Boolean})],sr.prototype,"hoist",2),Pt([ce("open",{waitUntilFirstUpdate:!0})],sr.prototype,"handleOpenChange",1),Pt([ce(["content","distance","hoist","placement","skidding"])],sr.prototype,"handleOptionsChange",1),Pt([ce("disabled")],sr.prototype,"handleDisabledChange",1),Xe("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),Xe("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),sr.define("sl-tooltip");export{ae as registerIconLibrary,Xe as setDefaultAnimation};
|