PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
jetpack / jetpack_vendor / automattic / jetpack-forms / dist / modules / slider-field / view.js

view.js in Jetpack – WP Security, Backup, Speed, & Growth 16.3, at jetpack_vendor/automattic/jetpack-forms/dist/modules/slider-field/view.js

1 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import*as t from"@wordpress/interactivity";var e={2833(e,r,n){e.exports=(t=>{const e={};return n.d(e,t),e})({getContext:()=>t.getContext,store:()=>t.store})},4349(t,e,r){function n(t,e,r){const n=Number(t),o=Number(e);let i=Number(r);i=Number.isNaN(i)?n:i,i=Math.max(n,Math.min(i,o));const a=100*(i-n)/(o-n);return`calc(${a}% + (${16-.32*a}px))`}r.d(e,{h:()=>n})}};const r={};function n(t){const o=r[t];if(void 0!==o)return o.exports;const i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.hasOwn(t,e);var o=n(2833),i=n(4349);function a(t){return{min:void 0!==t.min?Number(t.min):0,max:void 0!==t.max?Number(t.max):100}}(0,o.store)("jetpack/form",{state:{get getSliderValue(){const t=(0,o.getContext)(),{min:e}=a(t);return t.fieldValue??t.default??e??0},get getSliderPosition(){const t=(0,o.getContext)(),{min:e,max:r}=a(t),n=t.fieldValue??t.default??e;return(0,i.h)(e,r,n)}},actions:{onSliderChange(t){(0,o.getContext)().fieldValue=t.target.value}}});