@warp-ds/elements 2.2.0-next.27 → 2.2.0-next.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +106 -124
- package/dist/index.d.ts +31 -31
- package/dist/packages/attention/index.d.ts +0 -1
- package/dist/packages/attention/index.js +27 -18
- package/dist/packages/attention/index.js.map +3 -3
- package/dist/packages/button/button.stories.d.ts +4 -0
- package/dist/packages/button/button.stories.js +33 -1
- package/dist/packages/modal/index.js +18 -35
- package/dist/packages/modal/index.js.map +2 -2
- package/dist/packages/modal/modal-header.js +13 -30
- package/dist/packages/modal/modal-header.js.map +2 -2
- package/dist/packages/modal/modal.stories.js +1 -1
- package/dist/packages/slider/index.js +155 -95
- package/dist/packages/slider/index.js.map +3 -3
- package/dist/packages/slider/slider-thumb.js +108 -66
- package/dist/packages/slider/slider-thumb.js.map +3 -3
- package/dist/packages/slider/slider.js +45 -27
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.react.stories.js +2 -3
- package/dist/packages/slider/slider.stories.d.ts +1 -0
- package/dist/packages/slider/slider.stories.js +6 -12
- package/dist/packages/slider/styles/w-slider-thumb.styles.js +62 -27
- package/dist/packages/slider/styles/w-slider.styles.js +32 -16
- package/dist/packages/textfield/index.js +12 -3
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/textfield/styles/w-textfield.styles.js +9 -0
- package/dist/packages/toast/index.js +3 -3
- package/dist/packages/toast/index.js.map +2 -2
- package/dist/packages/toast/toast.js +3 -3
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/vscode.html-custom-data.json +20 -20
- package/dist/web-types.json +39 -39
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var H=s=>{throw TypeError(s)};var d=(s,e,o,n)=>{for(var t=n>1?void 0:n?ne(e,o):e,b=s.length-1,m;b>=0;b--)(m=s[b])&&(t=(n?m(e,o,t):m(t))||t);return n&&t&&ie(e,o,t),t};var se=(s,e,o)=>e.has(s)||H("Cannot "+o);var B=(s,e,o)=>e.has(s)?H("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,o);var f=(s,e,o)=>(se(s,e,"access private method"),o);var i=function(s,e,o,n){if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?n:o==="a"?n.call(s):n?n.value:e.get(s)},h=function(s,e,o,n,t){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!t)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!t:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?t.call(s,o):t?t.value=o:e.set(s,o),o};function W(s){var e,o,n,t,b,m,x,E,k,_,z,L,j,$,I,y,S,T,Z;class ae extends s{constructor(...r){var a,c,p;super(...r),e.add(this),this.internals=this.attachInternals(),o.set(this,!1),n.set(this,!1),t.set(this,!1),b.set(this,void 0),m.set(this,void 0),x.set(this,!0),k.set(this,""),_.set(this,()=>{h(this,t,!0,"f"),h(this,o,!0,"f"),i(this,e,"m",y).call(this)}),z.set(this,()=>{h(this,o,!1,"f"),i(this,e,"m",S).call(this,this.shouldFormValueUpdate()?i(this,k,"f"):""),!this.validity.valid&&i(this,t,"f")&&h(this,n,!0,"f");let w=i(this,e,"m",y).call(this);this.validationMessageCallback&&this.validationMessageCallback(w?this.internals.validationMessage:"")}),L.set(this,()=>{var w;i(this,x,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,x,!1,"f")),h(this,t,!0,"f"),h(this,n,!0,"f"),i(this,e,"m",y).call(this),(w=this===null||this===void 0?void 0:this.validationMessageCallback)===null||w===void 0||w.call(this,this.showError?this.internals.validationMessage:"")}),j.set(this,void 0),$.set(this,!1),I.set(this,Promise.resolve()),(a=this.addEventListener)===null||a===void 0||a.call(this,"focus",i(this,_,"f")),(c=this.addEventListener)===null||c===void 0||c.call(this,"blur",i(this,z,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",i(this,L,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let r=this.validators.map(p=>p.attribute).flat(),a=super.observedAttributes||[];return[...new Set([...a,...r])]}static getValidator(r){return this.validators.find(a=>a.attribute===r)||null}static getValidators(r){return this.validators.filter(a=>{var c;if(a.attribute===r||!((c=a.attribute)===null||c===void 0)&&c.includes(r))return!0})}get form(){return this.internals.form}get showError(){return i(this,e,"m",y).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(r,a,c){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,r,a,c);let M=this.constructor.getValidators(r);M!=null&&M.length&&this.validationTarget&&this.setValue(i(this,k,"f"))}setValue(r){var a;h(this,n,!1,"f"),(a=this.validationMessageCallback)===null||a===void 0||a.call(this,""),h(this,k,r,"f");let p=this.shouldFormValueUpdate()?r:null;this.internals.setFormValue(p),i(this,e,"m",S).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),i(this,e,"m",y).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(r=>r(i(this,I,"f")))}formResetCallback(){var r,a;h(this,t,!1,"f"),h(this,n,!1,"f"),i(this,e,"m",y).call(this),(r=this.resetFormControl)===null||r===void 0||r.call(this),(a=this.validationMessageCallback)===null||a===void 0||a.call(this,i(this,e,"m",y).call(this)?this.validationMessage:"")}}return o=new WeakMap,n=new WeakMap,t=new WeakMap,b=new WeakMap,m=new WeakMap,x=new WeakMap,k=new WeakMap,_=new WeakMap,z=new WeakMap,L=new WeakMap,j=new WeakMap,$=new WeakMap,I=new WeakMap,e=new WeakSet,E=function(){let r=this.getRootNode(),a=`${this.localName}[name="${this.getAttribute("name")}"]`;return r.querySelectorAll(a)},y=function(){if(this.hasAttribute("disabled"))return!1;let r=i(this,n,"f")||i(this,t,"f")&&!this.validity.valid&&!i(this,o,"f");return r&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),r},S=function(r){let a=this.constructor,c={},p=a.validators,w=[],M=p.some(u=>u.isValid instanceof Promise);i(this,$,"f")||(h(this,I,new Promise(u=>{h(this,j,u,"f")}),"f"),h(this,$,!0,"f")),i(this,b,"f")&&(i(this,b,"f").abort(),h(this,m,i(this,b,"f"),"f"));let Y=new AbortController;h(this,b,Y,"f");let P,G=!1;p.length&&(p.forEach(u=>{let D=u.key||"customError",C=u.isValid(this,r,Y.signal);C instanceof Promise?(w.push(C),C.then(R=>{R!=null&&(c[D]=!R,P=i(this,e,"m",Z).call(this,u,r),i(this,e,"m",T).call(this,c,P))})):(c[D]=!C,this.validity[D]!==!C&&(G=!0),!C&&!P&&(P=i(this,e,"m",Z).call(this,u,r)))}),Promise.allSettled(w).then(()=>{var u;Y!=null&&Y.signal.aborted||(h(this,$,!1,"f"),(u=i(this,j,"f"))===null||u===void 0||u.call(this))}),(G||!M)&&i(this,e,"m",T).call(this,c,P))},T=function(r,a){if(this.validationTarget)this.internals.setValidity(r,a,this.validationTarget),h(this,x,!1,"f");else{if(this.internals.setValidity(r,a),this.internals.validity.valid)return;h(this,x,!0,"f")}},Z=function(r,a){if(this.validityCallback){let c=this.validityCallback(r.key||"customError");if(c)return c}return r.message instanceof Function?r.message(this,a):r.message},ae}import{html as X,LitElement as re,nothing as U}from"lit";import{property as F,query as oe,state as v}from"lit/decorators.js";import{ifDefined as q}from"lit/directives/if-defined.js";import{css as J}from"lit";var K=J`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -2454,6 +2454,7 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2454
2454
|
background-color: transparent;
|
|
2455
2455
|
grid-area: slider;
|
|
2456
2456
|
height: 44px; /* touch target */
|
|
2457
|
+
margin-left: 0;
|
|
2457
2458
|
pointer-events: none; /* let clicks pass through for range slider where we place two inputs over each other */
|
|
2458
2459
|
}
|
|
2459
2460
|
|
|
@@ -2463,14 +2464,6 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2463
2464
|
height: var(--w-slider-track-height);
|
|
2464
2465
|
}
|
|
2465
2466
|
|
|
2466
|
-
.w-slider-thumb__range:hover::-webkit-slider-thumb {
|
|
2467
|
-
background: var(--w-s-color-background-primary-hover);
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
.w-slider-thumb__range:hover::-moz-range-thumb {
|
|
2471
|
-
background: var(--w-s-color-background-primary-hover);
|
|
2472
|
-
}
|
|
2473
|
-
|
|
2474
2467
|
/*
|
|
2475
2468
|
Use anchor positioning to place the tooltip target in relation to the slider thumb.
|
|
2476
2469
|
We use a polyfill to bring support to older Safari, Firefox at time of writing.
|
|
@@ -2479,11 +2472,12 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2479
2472
|
anchor-name: --thumb;
|
|
2480
2473
|
|
|
2481
2474
|
appearance: none;
|
|
2475
|
+
cursor: pointer;
|
|
2482
2476
|
background: var(--w-s-color-background-primary);
|
|
2483
2477
|
border-radius: 50%;
|
|
2484
2478
|
height: var(--w-slider-thumb-size);
|
|
2485
2479
|
margin-top: calc(-1 * calc(var(--w-slider-thumb-offset) - calc(var(--w-slider-track-height) / 2)));
|
|
2486
|
-
pointer-events:
|
|
2480
|
+
pointer-events: initial;
|
|
2487
2481
|
width: var(--w-slider-thumb-size);
|
|
2488
2482
|
z-index: 1;
|
|
2489
2483
|
}
|
|
@@ -2492,6 +2486,7 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2492
2486
|
anchor-name: --thumb;
|
|
2493
2487
|
|
|
2494
2488
|
appearance: none;
|
|
2489
|
+
cursor: pointer;
|
|
2495
2490
|
background: var(--w-s-color-background-primary);
|
|
2496
2491
|
border-radius: 50%;
|
|
2497
2492
|
border-color: transparent;
|
|
@@ -2500,32 +2495,54 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2500
2495
|
pointer-events: initial;
|
|
2501
2496
|
width: var(--w-slider-thumb-size);
|
|
2502
2497
|
z-index: 1;
|
|
2498
|
+
|
|
2499
|
+
box-shadow: none;
|
|
2503
2500
|
}
|
|
2504
2501
|
|
|
2505
|
-
.w-slider-
|
|
2506
|
-
|
|
2507
|
-
|
|
2502
|
+
.w-slider-thumb__range:active::-webkit-slider-thumb,
|
|
2503
|
+
.w-slider-thumb__range:hover::-webkit-slider-thumb {
|
|
2504
|
+
background: var(--w-s-color-background-primary-hover);
|
|
2505
|
+
box-shadow: var(--w-shadow-slider-handle-hover);
|
|
2506
|
+
}
|
|
2508
2507
|
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2508
|
+
.w-slider-thumb__range:focus,
|
|
2509
|
+
.w-slider-thumb__range:focus-visible {
|
|
2510
|
+
outline: none;
|
|
2511
|
+
}
|
|
2512
2512
|
|
|
2513
|
-
|
|
2514
|
-
border-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2513
|
+
.w-slider-thumb__range:focus-visible::-webkit-slider-thumb {
|
|
2514
|
+
outline: 2px solid var(--w-s-color-border-focus);
|
|
2515
|
+
outline-offset: var(--w-outline-offset, 1px);
|
|
2516
|
+
box-shadow: none;
|
|
2517
|
+
}
|
|
2518
2518
|
|
|
2519
|
-
|
|
2519
|
+
.w-slider-thumb__range:active::-moz-range-thumb,
|
|
2520
|
+
.w-slider-thumb__range:hover::-moz-range-thumb {
|
|
2521
|
+
background: var(--w-s-color-background-primary-hover);
|
|
2522
|
+
box-shadow: var(--w-shadow-slider-handle-hover);
|
|
2523
|
+
}
|
|
2520
2524
|
|
|
2521
|
-
|
|
2522
|
-
|
|
2525
|
+
.w-slider-thumb__range:focus-visible::-moz-range-thumb {
|
|
2526
|
+
outline: 2px solid var(--w-s-color-border-focus);
|
|
2527
|
+
outline-offset: var(--w-outline-offset, 1px);
|
|
2528
|
+
box-shadow: none;
|
|
2523
2529
|
}
|
|
2524
2530
|
|
|
2525
|
-
.w-slider-thumb__tooltip
|
|
2531
|
+
.w-slider-thumb__tooltip-target {
|
|
2526
2532
|
display: block;
|
|
2533
|
+
pointer-events: none;
|
|
2534
|
+
position: absolute;
|
|
2535
|
+
border: 2px solid transparent;
|
|
2536
|
+
border-radius: 20px;
|
|
2537
|
+
width: 8px;
|
|
2538
|
+
height: 8px;
|
|
2539
|
+
position-anchor: --thumb;
|
|
2540
|
+
position-area: center; /* Position the tooltip target right on the range thumb */
|
|
2527
2541
|
}
|
|
2528
2542
|
|
|
2543
|
+
/* Uncomment this to debug the invisible anchor target */
|
|
2544
|
+
/* .w-slider-thumb__tooltip-target { border-color: lime; } */
|
|
2545
|
+
|
|
2529
2546
|
.w-slider-thumb__from-marker,
|
|
2530
2547
|
.w-slider-thumb__to-marker {
|
|
2531
2548
|
margin-inline: 2px; /* visual alignment with input border, slider thumb */
|
|
@@ -2554,8 +2571,21 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2554
2571
|
grid-column: 1 / 2; /* Range sliders should leave the gap empty. */
|
|
2555
2572
|
}
|
|
2556
2573
|
|
|
2557
|
-
:host([name='from']) .w-slider-thumb__range
|
|
2558
|
-
margin-left:
|
|
2574
|
+
:host([name='from']) .w-slider-thumb__range {
|
|
2575
|
+
margin-left: var(--w-slider-thumb-size);
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
:host([name='to']) .w-slider-thumb__range {
|
|
2579
|
+
margin-right: var(--w-slider-thumb-size);
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
:host([name='from']) .w-slider-thumb__range::-webkit-slider-thumb,
|
|
2583
|
+
:host([name='from']) .w-slider-thumb__tooltip-target {
|
|
2584
|
+
transform: translateX(calc(-1 * var(--w-slider-thumb-size) - 1px));
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
:host([name='from']) .w-slider-thumb__range::-moz-range-thumb {
|
|
2588
|
+
transform: translateX(calc(-1 * var(--w-slider-thumb-size) - 1px));
|
|
2559
2589
|
}
|
|
2560
2590
|
|
|
2561
2591
|
:host([name='to']) .w-slider-thumb__textfield {
|
|
@@ -2563,58 +2593,67 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2563
2593
|
grid-column: 3 / 4;
|
|
2564
2594
|
}
|
|
2565
2595
|
|
|
2596
|
+
:host([name='to']) .w-slider-thumb__tooltip-target,
|
|
2566
2597
|
:host([name='to']) .w-slider-thumb__range::-webkit-slider-thumb {
|
|
2567
|
-
|
|
2598
|
+
transform: translateX(calc(var(--w-slider-thumb-size) - 1px));
|
|
2568
2599
|
}
|
|
2569
|
-
|
|
2600
|
+
|
|
2601
|
+
:host([name='to']) .w-slider-thumb__range::-moz-range-thumb {
|
|
2602
|
+
transform: translateX(calc(var(--w-slider-thumb-size) - 1px));
|
|
2603
|
+
}
|
|
2604
|
+
`;import{css as de}from"lit";var ee=de`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;var te={};var g,N,A,O,l=class extends W(re){constructor(){super(...arguments);B(this,g);this._invalid=!1;this._showTooltip=!1;this.anchorPositioningStyleElement=null}async connectedCallback(){var o;if(super.connectedCallback(),"anchorName"in document.documentElement.style)await this.updateComplete;else{let n=te.url.substring(0,te.url.lastIndexOf("/"));try{let[{default:t}]=await Promise.all([import(`${n}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
|
|
2570
2605
|
/*
|
|
2571
|
-
* The polyfill can only anchor to ::before and ::after pseudo elements.
|
|
2606
|
+
* The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
|
|
2572
2607
|
* We work around that by recreating a transparent version of the active range
|
|
2573
2608
|
* so that we can position relative to that, without crossing the shadow root boundary.
|
|
2574
2609
|
*/
|
|
2575
|
-
|
|
2576
|
-
anchor-name: --polyfilled-thumb;
|
|
2577
|
-
|
|
2578
|
-
/* We have to compensate for the width of the thumb inside the track to find its center. */
|
|
2579
|
-
--_value: var(--_to-as-percent-of-max);
|
|
2580
|
-
--_offset-origin: 50; /* at this point the offset is zero */
|
|
2581
|
-
--_thumb-offset-percent: calc(var(--_value) - var(--_offset-origin));
|
|
2582
|
-
--_thumb-offset-pixels: calc(var(--w-slider-thumb-size) * calc(var(--_thumb-offset-percent) / 100));
|
|
2583
|
-
|
|
2610
|
+
.polyfill-range {
|
|
2584
2611
|
align-self: center;
|
|
2585
2612
|
background: transparent;
|
|
2613
|
+
height: var(--w-slider-track-active-height);
|
|
2586
2614
|
position: absolute;
|
|
2615
|
+
padding-inline-start: var(--active-range-inline-start-padding, 0);
|
|
2616
|
+
padding-inline-end: var(--active-range-inline-end-padding, 0);
|
|
2587
2617
|
top: var(--_range-top);
|
|
2588
|
-
height: var(--w-slider-track-active-height);
|
|
2589
2618
|
left: 0;
|
|
2590
2619
|
right: 0;
|
|
2591
2620
|
grid-area: slider;
|
|
2592
|
-
margin-left: calc(var(--_blank-values-before) * 1%);
|
|
2593
|
-
width: calc(calc(var(--_filled-values) * 1%) - var(--_thumb-offset-pixels));
|
|
2594
2621
|
}
|
|
2595
2622
|
|
|
2596
|
-
|
|
2597
|
-
|
|
2623
|
+
.polyfill-active-range {
|
|
2624
|
+
anchor-name: --polyfilled-thumb;
|
|
2598
2625
|
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2626
|
+
box-sizing: content-box;
|
|
2627
|
+
background: transparent;
|
|
2628
|
+
height: var(--w-slider-track-active-height);
|
|
2629
|
+
|
|
2630
|
+
border-start-start-radius: var(--active-range-border-radius, 0);
|
|
2631
|
+
border-end-start-radius: var(--active-range-border-radius, 0);
|
|
2632
|
+
|
|
2633
|
+
margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
|
|
2634
|
+
width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
|
|
2602
2635
|
}
|
|
2603
2636
|
|
|
2604
|
-
|
|
2605
|
-
|
|
2637
|
+
#target {
|
|
2638
|
+
position: absolute;
|
|
2639
|
+
top: anchor(--polyfilled-thumb top);
|
|
2640
|
+
right: anchor(--polyfilled-thumb right);
|
|
2641
|
+
margin-right: 12px;
|
|
2642
|
+
}
|
|
2606
2643
|
|
|
2607
|
-
|
|
2608
|
-
|
|
2644
|
+
:host([name='from']) .polyfill-active-range {
|
|
2645
|
+
margin-left: calc(calc(var(--_blank-values-before) * 1%) - var(--active-range-inline-start-padding, 0px));
|
|
2646
|
+
width: calc(calc(var(--_filled-values) * 1%) + var(--active-range-inline-end-padding, 0px));
|
|
2609
2647
|
}
|
|
2610
2648
|
|
|
2611
2649
|
:host([name='from']) #target {
|
|
2612
2650
|
left: anchor(--polyfilled-thumb left);
|
|
2651
|
+
margin-left: 38px;
|
|
2613
2652
|
}
|
|
2614
|
-
`,await
|
|
2653
|
+
`,await t({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(t){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:t}))}}this.range.value=(o=this.value)!=null?o:this.max}updated(o){o.has("value")&&this.setValue(this.value),o.has("_invalid")&&this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:this._invalid}}))}render(){return X`
|
|
2615
2654
|
<div class="w-slider-thumb">
|
|
2616
2655
|
<label for="range">${this.label}</label>
|
|
2617
|
-
${"anchorName"in document.documentElement.style?U:
|
|
2656
|
+
${"anchorName"in document.documentElement.style?U:X`<div class="polyfill-range"><div class="polyfill-active-range"></div></div>`}
|
|
2618
2657
|
<input
|
|
2619
2658
|
id="range"
|
|
2620
2659
|
aria-label="${this.ariaLabel}"
|
|
@@ -2627,13 +2666,13 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2627
2666
|
name="${this.name}"
|
|
2628
2667
|
step="${q(this.step?this.step:void 0)}"
|
|
2629
2668
|
?disabled="${this.disabled||this.forceDisabled}"
|
|
2630
|
-
@mousedown="${
|
|
2631
|
-
@mouseup="${
|
|
2632
|
-
@touchstart="${
|
|
2633
|
-
@touchend="${
|
|
2634
|
-
@focus="${
|
|
2635
|
-
@blur="${
|
|
2636
|
-
@input="${
|
|
2669
|
+
@mousedown="${f(this,g,N)}"
|
|
2670
|
+
@mouseup="${f(this,g,A)}"
|
|
2671
|
+
@touchstart="${f(this,g,N)}"
|
|
2672
|
+
@touchend="${f(this,g,A)}"
|
|
2673
|
+
@focus="${f(this,g,N)}"
|
|
2674
|
+
@blur="${f(this,g,A)}"
|
|
2675
|
+
@input="${f(this,g,O)}" />
|
|
2637
2676
|
|
|
2638
2677
|
<span class="w-slider-thumb__from-marker">${this.formatter?this.formatter(this.min):this.min} ${this.suffix}</span>
|
|
2639
2678
|
<span class="w-slider-thumb__to-marker">${this.formatter?this.formatter(this.max):this.max} ${this.suffix}</span>
|
|
@@ -2648,16 +2687,19 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var G=s=>{th
|
|
|
2648
2687
|
.formatter=${this.formatter}
|
|
2649
2688
|
.value="${this.value}"
|
|
2650
2689
|
?invalid="${this.forceInvalid||this._invalid}"
|
|
2651
|
-
@input="${
|
|
2652
|
-
${this.suffix?
|
|
2690
|
+
@input="${f(this,g,O)}">
|
|
2691
|
+
${this.suffix?X`<w-affix slot="suffix" label="${this.suffix}"></w-affix>`:U}
|
|
2653
2692
|
</w-textfield>
|
|
2654
2693
|
|
|
2655
|
-
<
|
|
2656
|
-
|
|
2657
|
-
|
|
2694
|
+
<w-attention tooltip placement="top" flip distance="24" .show="${this._showTooltip}">
|
|
2695
|
+
<output id="target" class="w-slider-thumb__tooltip-target" slot="target"></output>
|
|
2696
|
+
<span slot="message">
|
|
2697
|
+
${this.value?this.formatter?this.formatter(this.value):this.value:0}${this.suffix?X` ${this.suffix}`:U}
|
|
2698
|
+
</span>
|
|
2699
|
+
</w-attention>
|
|
2658
2700
|
|
|
2659
2701
|
<!-- aria-description is still not recommended for general use, so make a visually hidden element and refer to it with aria-describedby -->
|
|
2660
2702
|
<span class="sr-only" id="aria-description">${this.ariaDescription}</span>
|
|
2661
2703
|
</div>
|
|
2662
|
-
`}};
|
|
2704
|
+
`}};g=new WeakSet,N=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},A=function(){this._showTooltip=!1},O=function(o){let n=o.currentTarget.tagName==="W-TEXTFIELD";if(o instanceof CustomEvent)return;let t=o.currentTarget.value;if(t==="")return this.required&&(this._invalid=!0),!1;this._invalid&&(this._invalid=!1);let b=Number.parseInt(t),m=Number.parseInt(this.max),x=Number.parseInt(this.min);(b>m||b<x)&&(this._invalid=!0);let E=!1;if(this.slot){let k=getComputedStyle(this),_=k.getPropertyValue("--to"),z=k.getPropertyValue("--from");if(n&&(b>Number.parseInt(_)||b<Number.parseInt(z)))return this._invalid=!0,!1;this.slot==="from"?b>Number.parseInt(_)&&(E=!0,this.value=_):b<Number.parseInt(z)&&(E=!0,this.value=z)}return E?(o.preventDefault(),this.range.value=this.value,!1):(this.value=t,this.shadowRoot.querySelector("w-attention").handleDone(),!0)},l.shadowRootOptions={...re.shadowRootOptions,delegatesFocus:!0},l.styles=[K,ee,Q],d([F({attribute:"aria-label",reflect:!0})],l.prototype,"ariaLabel",2),d([F({attribute:"aria-description",reflect:!0})],l.prototype,"ariaDescription",2),d([F({reflect:!0})],l.prototype,"label",2),d([F({reflect:!0})],l.prototype,"name",2),d([F({reflect:!0})],l.prototype,"value",2),d([F({type:Boolean,reflect:!0})],l.prototype,"disabled",2),d([v()],l.prototype,"markers",2),d([v()],l.prototype,"required",2),d([v()],l.prototype,"step",2),d([v()],l.prototype,"min",2),d([v()],l.prototype,"max",2),d([v()],l.prototype,"suffix",2),d([v()],l.prototype,"forceDisabled",2),d([v()],l.prototype,"forceInvalid",2),d([v()],l.prototype,"formatter",2),d([oe('input[type="range"]')],l.prototype,"range",2),d([oe("w-textfield")],l.prototype,"textfield",2),d([v()],l.prototype,"_invalid",2),d([v()],l.prototype,"_showTooltip",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",l);export{l as WarpSliderThumb};
|
|
2663
2705
|
//# sourceMappingURL=slider-thumb.js.map
|