@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.39 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{loadCalciteComponents as e}from"./componentsUtils.js";import"./widgetUtils.js";import{tsx as i}from"./jsxFactory.js";const t=()=>e({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),n="esri-labeled-switch",c={label:`${n}__label`,labelContent:`${n}__label-content`,iconInfo:`${n}__icon_info`,iconWarning:`${n}__icon_warning`,tooltip:`${n}__tooltip`};function o({checked:e,disabled:t,hint:n,key:o,label:l,onChange:a,hintIcon:s,hintKind:r}){return i("calcite-label",{class:c.label,disabled:t,key:o,layout:"inline-space-between",scale:"s"},n?i("div",{class:c.labelContent,key:"label-content"},i("div",null,l),i("calcite-icon",{class:"warning"!==r?c.iconInfo:c.iconWarning,icon:s??"information",id:o,scale:"s",tabIndex:0}),i("calcite-tooltip",{class:c.tooltip,overlayPositioning:"fixed",referenceElement:o},n)):l,i("calcite-switch",{checked:e,disabled:t,scale:"s",onCalciteSwitchChange:e=>a(e.currentTarget.checked)}))}export{o as LabeledSwitch,t as loadLabeledSwitchComponents};