@useloops/design-system 1.4.666 → 1.4.667
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{DragHandle as t}from"@mui/icons-material";import{useTheme as l,Stack as r,Box as n,typographyClasses as o,selectClasses as a}from"@mui/material";import{iconSizeMap as s}from"../../BrandCore/Icon/Icon.js";import{space as m,base as c}from"../../BrandCore/primitiveVariables.js";import"../SelectItem/SelectItem.js";import d from"../Select/Select.js";import p from"./RankItemContainer.js";import f from"./RankItemLabel.js";const g=({label:g="Placeholder",disabled:h,onChange:u,options:b,fullWidth:x,sizing:v="lg"})=>{const I=l(),j=b.map(e=>e.label).indexOf(g);return e(p,{disabled:h,fullWidth:x,sizing:v,children:i(r,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",sx:{position:"relative",zIndex:1},children:[i(n,{display:"flex",alignItems:"center",sx:{"& svg":{fill:I.custom.palette.icon.secondary}},children:[e(t,{"aria-label":"drag-handle",sx:{width:s.lg,height:s.lg,mr:I.custom.padding.sm}}),e(f,{align:"left",disabled:h,children:g})]}),"lg"===v?e(d,{name:"rank",sizing:"xs",selections:b.map((e,i)=>({label:`${i+1}`,value:`${i}`})),disabled:h,value:`${j}`,onChange:function(e){const i=j,t=Number(e.target.value),l=b;let r=1;const n=l.splice(i,r)[0];r=0,l.splice(t,r,n),u(l)},MenuProps:{anchorOrigin:{vertical:m[400],horizontal:"center"}},sx:{[`&.${a.root}`]:{width:6*c,textAlign:"center"},[`& .${o.root}`]:{width:"fit-content",overflow:"visible"}}}):void 0]})})};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/icons-material"),l=require("@mui/material"),r=require("../../BrandCore/Icon/Icon.js"),s=require("../../BrandCore/primitiveVariables.js");require("../SelectItem/SelectItem.js");var t=require("../Select/Select.js"),a=require("./RankItemContainer.js"),n=require("./RankItemLabel.js");module.exports=({label:o="Placeholder",disabled:c,onChange:d,options:u,fullWidth:m,sizing:g="lg"})=>{const x=l.useTheme(),h=u.map(e=>e.label).indexOf(o);return e.jsx(a,{disabled:c,fullWidth:m,sizing:g,children:e.jsxs(l.Stack,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",sx:{position:"relative",zIndex:1},children:[e.jsxs(l.Box,{display:"flex",alignItems:"center",sx:{"& svg":{fill:x.custom.palette.icon.secondary}},children:[e.jsx(i.DragHandle,{"aria-label":"drag-handle",sx:{width:r.iconSizeMap.lg,height:r.iconSizeMap.lg,mr:x.custom.padding.sm}}),e.jsx(n,{align:"left",disabled:c,children:o})]}),"lg"===g?e.jsx(t,{name:"rank",sizing:"xs",selections:u.map((e,i)=>({label:`${i+1}`,value:`${i}`})),disabled:c,value:`${h}`,onChange:function(e){const i=h,l=Number(e.target.value),r=u;let s=1;const t=r.splice(i,s)[0];s=0,r.splice(l,s,t),d(r)},MenuProps:{anchorOrigin:{vertical:s.space[400],horizontal:"center"}},sx:{[`&.${l.selectClasses.root}`]:{width:6*s.base,textAlign:"center"},[`& .${l.typographyClasses.root}`]:{width:"fit-content"}}}):void 0]})})};
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/icons-material"),l=require("@mui/material"),r=require("../../BrandCore/Icon/Icon.js"),s=require("../../BrandCore/primitiveVariables.js");require("../SelectItem/SelectItem.js");var t=require("../Select/Select.js"),a=require("./RankItemContainer.js"),n=require("./RankItemLabel.js");module.exports=({label:o="Placeholder",disabled:c,onChange:d,options:u,fullWidth:m,sizing:g="lg"})=>{const x=l.useTheme(),h=u.map(e=>e.label).indexOf(o);return e.jsx(a,{disabled:c,fullWidth:m,sizing:g,children:e.jsxs(l.Stack,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",sx:{position:"relative",zIndex:1},children:[e.jsxs(l.Box,{display:"flex",alignItems:"center",sx:{"& svg":{fill:x.custom.palette.icon.secondary}},children:[e.jsx(i.DragHandle,{"aria-label":"drag-handle",sx:{width:r.iconSizeMap.lg,height:r.iconSizeMap.lg,mr:x.custom.padding.sm}}),e.jsx(n,{align:"left",disabled:c,children:o})]}),"lg"===g?e.jsx(t,{name:"rank",sizing:"xs",selections:u.map((e,i)=>({label:`${i+1}`,value:`${i}`})),disabled:c,value:`${h}`,onChange:function(e){const i=h,l=Number(e.target.value),r=u;let s=1;const t=r.splice(i,s)[0];s=0,r.splice(l,s,t),d(r)},MenuProps:{anchorOrigin:{vertical:s.space[400],horizontal:"center"}},sx:{[`&.${l.selectClasses.root}`]:{width:6*s.base,textAlign:"center"},[`& .${l.typographyClasses.root}`]:{width:"fit-content",overflow:"visible"}}}):void 0]})})};
|