@flipdish/portal-library 1.0.32 → 1.0.34
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/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/ui/Form/GenericTextField.cjs.js +1 -1
- package/dist/components/ui/Form/GenericTextField.cjs.js.map +1 -1
- package/dist/components/ui/Form/GenericTextField.d.ts +4 -1
- package/dist/components/ui/Form/GenericTextField.js +1 -1
- package/dist/components/ui/Form/GenericTextField.js.map +1 -1
- package/dist/components/ui/Switch/Switch.cjs.js +2 -0
- package/dist/components/ui/Switch/Switch.cjs.js.map +1 -0
- package/dist/components/ui/Switch/Switch.d.ts +15 -0
- package/dist/components/ui/Switch/Switch.js +2 -0
- package/dist/components/ui/Switch/Switch.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),r=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),i=require("./ui/PageLayout/PageLayout.cjs.js"),o=require("./ui/PortalMock/PortalMock.cjs.js"),s=require("./ui/LazyComponent/LazyComponent.cjs.js"),t=require("./ui/Spacer/Spacer.cjs.js"),
|
|
1
|
+
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),r=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),i=require("./ui/PageLayout/PageLayout.cjs.js"),o=require("./ui/PortalMock/PortalMock.cjs.js"),s=require("./ui/LazyComponent/LazyComponent.cjs.js"),t=require("./ui/Spacer/Spacer.cjs.js"),c=require("./ui/Chip/Chip.cjs.js"),a=require("./ui/Switch/Switch.cjs.js"),u=require("./ui/Form/utilities/formValidation.cjs.js"),j=require("./ui/Form/GenericFormContainer.cjs.js"),n=require("./ui/Form/GenericTextField.cjs.js"),l=require("./ui/GenericTable/GenericTable.cjs.js"),p=require("./ui/GenericTableBody/GenericTableBody.cjs.js"),T=require("./ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js"),d=require("./ui/GenericTableTitle/GenericTableTitle.cjs.js");require("react/jsx-runtime"),require("react"),require("../providers/TranslationProvider.cjs.js"),exports.flipdishPublicTheme=e,exports.NotFoundPage=r,exports.PageLayout=i.default,exports.PortalMock=o,exports.LazyComponent=s,exports.Spacer=t,exports.Chip=c,exports.Switch=a,exports.formikValidate=u.formikValidate,exports.GenericFormContainer=j,exports.GenericTextField=n,exports.GenericTable=l,exports.GenericTableBody=p,exports.GenericTableBodyRow=T,exports.GenericTableTitle=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -5,6 +5,7 @@ export { default as PortalMock } from './ui/PortalMock/PortalMock.js';
|
|
|
5
5
|
export { default as LazyComponent } from './ui/LazyComponent/LazyComponent.js';
|
|
6
6
|
export { default as Spacer } from './ui/Spacer/Spacer.js';
|
|
7
7
|
export { default as Chip } from './ui/Chip/Chip.js';
|
|
8
|
+
export { default as Switch } from './ui/Switch/Switch.js';
|
|
8
9
|
export { formikValidate } from './ui/Form/utilities/formValidation.js';
|
|
9
10
|
export { default as GenericFormContainer } from './ui/Form/GenericFormContainer.js';
|
|
10
11
|
export { default as GenericTextField } from './ui/Form/GenericTextField.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";import"react/jsx-runtime";import"react";import"../providers/TranslationProvider.js";
|
|
1
|
+
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";export{default as Switch}from"./ui/Switch/Switch.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";import"react/jsx-runtime";import"react";import"../providers/TranslationProvider.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("formik"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("formik"),i=require("@mui/material/TextField"),t=require("../../custom-hooks/useRenderValidText.cjs.js"),a=require("./FormItemLayout.cjs.js"),l=require("@mui/material/Typography");module.exports=({label:o,fieldName:d,placeholder:n,validation:s,multiline:u,minRows:m,maxRows:h,layout:c="horizontal",variant:v="standard",disabled:x=!1,required:p=!1})=>{const g=()=>e.jsx(r.Field,{name:d,validate:s,children:({field:r,form:a})=>{const{errors:l,touched:s,isSubmitting:g}=a,j=l[r.name],f=!!j&&s[r.name],q=t({fieldError:j,showError:f,touched:!!s[r.name],value:r.value});return e.jsx(i,{label:"standard"===v?void 0:o,variant:v,value:r.value,"data-testid":`text-field-${d}`,autoComplete:"off",fullWidth:!0,multiline:!0,minRows:m??(u?3:void 0),maxRows:h??(u?10:void 0),style:{paddingRight:"horizontal"===c?16:0},placeholder:n||void 0,disabled:g||x,required:p,error:f,helperText:q,FormHelperTextProps:{children:" ",style:{textAlign:"right"}},inputProps:{style:{paddingTop:0,height:"1.1876em"}},onChange:e=>{a.setFieldValue(r.name,e.target.value)}})}});return"vertical"===c?e.jsxs(e.Fragment,{children:["standard"===v&&e.jsx(l,{variant:"subtitle1",component:"h3",color:"textPrimary",children:o}),g()]}):e.jsx(a,{label:o,children:g()})};
|
|
2
2
|
//# sourceMappingURL=GenericTextField.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTextField.cjs.js","sources":["../../../../src/components/ui/Form/GenericTextField.tsx"],"sourcesContent":["import { ChangeEvent } from 'react';\n\nimport { type FieldProps, Field } from 'formik';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport FormItemLayout from './FormItemLayout';\nimport Typography from '@mui/material/Typography';\n\ntype Props = {\n label: string;\n fieldName: string;\n placeholder?: string;\n validation?: (value: string) => string | undefined;\n multiline?: boolean;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n};\n\nconst GenericTextField = ({\n label,\n fieldName,\n placeholder,\n validation,\n multiline,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n}: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {({ field, form }: FieldProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={field.value}\n data-testid={`text-field-${fieldName}`}\n autoComplete=\"off\"\n fullWidth\n multiline\n minRows={multiline ? 3 :
|
|
1
|
+
{"version":3,"file":"GenericTextField.cjs.js","sources":["../../../../src/components/ui/Form/GenericTextField.tsx"],"sourcesContent":["import { ChangeEvent } from 'react';\n\nimport { type FieldProps, Field } from 'formik';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport FormItemLayout from './FormItemLayout';\nimport Typography from '@mui/material/Typography';\n\ntype Props = {\n label: string;\n fieldName: string;\n placeholder?: string;\n validation?: (value: string) => string | undefined;\n multiline?: boolean;\n minRows?: number;\n maxRows?: number;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n required?: boolean;\n};\n\nconst GenericTextField = ({\n label,\n fieldName,\n placeholder,\n validation,\n multiline,\n minRows,\n maxRows,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n required = false,\n}: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {({ field, form }: FieldProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={field.value}\n data-testid={`text-field-${fieldName}`}\n autoComplete=\"off\"\n fullWidth\n multiline\n minRows={minRows ?? (multiline ? 3 : undefined)}\n maxRows={maxRows ?? (multiline ? 10 : undefined)}\n style={{ paddingRight: layout === 'horizontal' ? 16 : 0 }}\n placeholder={placeholder ? placeholder : undefined}\n disabled={isSubmitting || disabled}\n required={required}\n error={showError}\n helperText={helperText}\n FormHelperTextProps={{\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n }}\n inputProps={{\n style: {\n paddingTop: 0,\n height: '1.1876em',\n },\n }}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(field.name, e.target.value);\n }}\n />\n );\n }}\n </Field>\n );\n };\n\n if (layout === 'vertical') {\n return (\n <>\n {variant === 'standard' && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericTextField;\n"],"names":["label","fieldName","placeholder","validation","multiline","minRows","maxRows","layout","variant","disabled","required","renderField","_jsx","Field","name","validate","children","field","form","errors","touched","isSubmitting","fieldError","showError","helperText","useRenderValidText","value","jsx","TextField","undefined","autoComplete","fullWidth","style","paddingRight","error","FormHelperTextProps","textAlign","inputProps","paddingTop","height","onChange","e","setFieldValue","target","_jsxs","jsxs","_Fragment","Typography","component","color","FormItemLayout"],"mappings":"6PAsByB,EACrBA,QACAC,YACAC,cACAC,aACAC,YACAC,UACAC,UACAC,SAAS,aACTC,UAAU,WACVC,YAAW,EACXC,YAAW,MAEX,MAAMC,EAAc,IAEZC,MAACC,EAAAA,OAAMC,KAAMb,EAAWc,SAAUZ,EAAUa,SACvC,EAAGC,QAAOC,WACP,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBH,EACpCI,EAAaH,EAAOF,EAAMH,MAC1BS,IAAcD,GAAeF,EAAQH,EAAMH,MAC3CU,EAAaC,EAAmB,CAClCH,aACAC,YACAH,UAAWA,EAAQH,EAAMH,MACzBY,MAAOT,EAAMS,QAGjB,OACId,EAACe,IAAAC,EACG,CAAA5B,MAAmB,aAAZQ,OAAyBqB,EAAY7B,EAC5CQ,QAASA,EACTkB,MAAOT,EAAMS,MACA,cAAA,cAAczB,IAC3B6B,aAAa,MACbC,WAAS,EACT3B,WAAS,EACTC,QAASA,IAAYD,EAAY,OAAIyB,GACrCvB,QAASA,IAAYF,EAAY,QAAKyB,GACtCG,MAAO,CAAEC,aAAyB,eAAX1B,EAA0B,GAAK,GACtDL,YAAaA,QAA4B2B,EACzCpB,SAAUY,GAAgBZ,EAC1BC,SAAUA,EACVwB,MAAOX,EACPC,WAAYA,EACZW,oBAAqB,CACjBnB,SAAU,IACVgB,MAAO,CAAEI,UAAW,UAExBC,WAAY,CACRL,MAAO,CACHM,WAAY,EACZC,OAAQ,aAGhBC,SAAWC,IAEPvB,EAAKwB,cAAczB,EAAMH,KAAM2B,EAAEE,OAAOjB,MAAM,GAGxD,IAMlB,MAAe,aAAXnB,EAEIqC,EAAAC,KAAAC,WAAA,CAAA9B,SAAA,CACiB,aAAZR,GACGI,EAAAe,IAACoB,EAAU,CAACvC,QAAQ,YAAYwC,UAAU,KAAKC,MAAM,cAChDjC,SAAAhB,IAGRW,OAKNC,EAAAe,IAACuB,EAAc,CAAClD,MAAOA,EAAQgB,SAAAL,KAA+B"}
|
|
@@ -7,10 +7,13 @@ type Props = {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
validation?: (value: string) => string | undefined;
|
|
9
9
|
multiline?: boolean;
|
|
10
|
+
minRows?: number;
|
|
11
|
+
maxRows?: number;
|
|
10
12
|
layout?: 'horizontal' | 'vertical';
|
|
11
13
|
variant?: TextFieldProps['variant'];
|
|
12
14
|
disabled?: boolean;
|
|
15
|
+
required?: boolean;
|
|
13
16
|
};
|
|
14
|
-
declare const GenericTextField: ({ label, fieldName, placeholder, validation, multiline, layout, variant, disabled, }: Props) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare const GenericTextField: ({ label, fieldName, placeholder, validation, multiline, minRows, maxRows, layout, variant, disabled, required, }: Props) => react_jsx_runtime.JSX.Element;
|
|
15
18
|
|
|
16
19
|
export { GenericTextField as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{Field as i}from"formik";import a from"@mui/material/TextField";import o from"../../custom-hooks/useRenderValidText.js";import l from"./FormItemLayout.js";import d from"@mui/material/Typography";const m=({label:m,fieldName:n,placeholder:s,validation:u,multiline:h,minRows:p,maxRows:c,layout:f="horizontal",variant:v="standard",disabled:x=!1,required:g=!1})=>{const y=()=>t(i,{name:n,validate:u,children:({field:e,form:r})=>{const{errors:i,touched:l,isSubmitting:d}=r,u=i[e.name],y=!!u&&l[e.name],b=o({fieldError:u,showError:y,touched:!!l[e.name],value:e.value});return t(a,{label:"standard"===v?void 0:m,variant:v,value:e.value,"data-testid":`text-field-${n}`,autoComplete:"off",fullWidth:!0,multiline:!0,minRows:p??(h?3:void 0),maxRows:c??(h?10:void 0),style:{paddingRight:"horizontal"===f?16:0},placeholder:s||void 0,disabled:d||x,required:g,error:y,helperText:b,FormHelperTextProps:{children:" ",style:{textAlign:"right"}},inputProps:{style:{paddingTop:0,height:"1.1876em"}},onChange:t=>{r.setFieldValue(e.name,t.target.value)}})}});return"vertical"===f?e(r,{children:["standard"===v&&t(d,{variant:"subtitle1",component:"h3",color:"textPrimary",children:m}),y()]}):t(l,{label:m,children:y()})};export{m as default};
|
|
2
2
|
//# sourceMappingURL=GenericTextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTextField.js","sources":["../../../../src/components/ui/Form/GenericTextField.tsx"],"sourcesContent":["import { ChangeEvent } from 'react';\n\nimport { type FieldProps, Field } from 'formik';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport FormItemLayout from './FormItemLayout';\nimport Typography from '@mui/material/Typography';\n\ntype Props = {\n label: string;\n fieldName: string;\n placeholder?: string;\n validation?: (value: string) => string | undefined;\n multiline?: boolean;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n};\n\nconst GenericTextField = ({\n label,\n fieldName,\n placeholder,\n validation,\n multiline,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n}: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {({ field, form }: FieldProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={field.value}\n data-testid={`text-field-${fieldName}`}\n autoComplete=\"off\"\n fullWidth\n multiline\n minRows={multiline ? 3 :
|
|
1
|
+
{"version":3,"file":"GenericTextField.js","sources":["../../../../src/components/ui/Form/GenericTextField.tsx"],"sourcesContent":["import { ChangeEvent } from 'react';\n\nimport { type FieldProps, Field } from 'formik';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport FormItemLayout from './FormItemLayout';\nimport Typography from '@mui/material/Typography';\n\ntype Props = {\n label: string;\n fieldName: string;\n placeholder?: string;\n validation?: (value: string) => string | undefined;\n multiline?: boolean;\n minRows?: number;\n maxRows?: number;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n required?: boolean;\n};\n\nconst GenericTextField = ({\n label,\n fieldName,\n placeholder,\n validation,\n multiline,\n minRows,\n maxRows,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n required = false,\n}: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {({ field, form }: FieldProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={field.value}\n data-testid={`text-field-${fieldName}`}\n autoComplete=\"off\"\n fullWidth\n multiline\n minRows={minRows ?? (multiline ? 3 : undefined)}\n maxRows={maxRows ?? (multiline ? 10 : undefined)}\n style={{ paddingRight: layout === 'horizontal' ? 16 : 0 }}\n placeholder={placeholder ? placeholder : undefined}\n disabled={isSubmitting || disabled}\n required={required}\n error={showError}\n helperText={helperText}\n FormHelperTextProps={{\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n }}\n inputProps={{\n style: {\n paddingTop: 0,\n height: '1.1876em',\n },\n }}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(field.name, e.target.value);\n }}\n />\n );\n }}\n </Field>\n );\n };\n\n if (layout === 'vertical') {\n return (\n <>\n {variant === 'standard' && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericTextField;\n"],"names":["GenericTextField","label","fieldName","placeholder","validation","multiline","minRows","maxRows","layout","variant","disabled","required","renderField","_jsx","Field","name","validate","children","field","form","errors","touched","isSubmitting","fieldError","showError","helperText","useRenderValidText","value","TextField","undefined","autoComplete","fullWidth","style","paddingRight","error","FormHelperTextProps","textAlign","inputProps","paddingTop","height","onChange","e","setFieldValue","target","_jsxs","_Fragment","Typography","component","color","FormItemLayout"],"mappings":"yQAsBA,MAAMA,EAAmB,EACrBC,QACAC,YACAC,cACAC,aACAC,YACAC,UACAC,UACAC,SAAS,aACTC,UAAU,WACVC,YAAW,EACXC,YAAW,MAEX,MAAMC,EAAc,IAEZC,EAACC,GAAMC,KAAMb,EAAWc,SAAUZ,EAAUa,SACvC,EAAGC,QAAOC,WACP,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBH,EACpCI,EAAaH,EAAOF,EAAMH,MAC1BS,IAAcD,GAAeF,EAAQH,EAAMH,MAC3CU,EAAaC,EAAmB,CAClCH,aACAC,YACAH,UAAWA,EAAQH,EAAMH,MACzBY,MAAOT,EAAMS,QAGjB,OACId,EAACe,EACG,CAAA3B,MAAmB,aAAZQ,OAAyBoB,EAAY5B,EAC5CQ,QAASA,EACTkB,MAAOT,EAAMS,MACA,cAAA,cAAczB,IAC3B4B,aAAa,MACbC,WAAS,EACT1B,WAAS,EACTC,QAASA,IAAYD,EAAY,OAAIwB,GACrCtB,QAASA,IAAYF,EAAY,QAAKwB,GACtCG,MAAO,CAAEC,aAAyB,eAAXzB,EAA0B,GAAK,GACtDL,YAAaA,QAA4B0B,EACzCnB,SAAUY,GAAgBZ,EAC1BC,SAAUA,EACVuB,MAAOV,EACPC,WAAYA,EACZU,oBAAqB,CACjBlB,SAAU,IACVe,MAAO,CAAEI,UAAW,UAExBC,WAAY,CACRL,MAAO,CACHM,WAAY,EACZC,OAAQ,aAGhBC,SAAWC,IAEPtB,EAAKuB,cAAcxB,EAAMH,KAAM0B,EAAEE,OAAOhB,MAAM,GAGxD,IAMlB,MAAe,aAAXnB,EAEIoC,EAAAC,EAAA,CAAA5B,SAAA,CACiB,aAAZR,GACGI,EAACiC,EAAU,CAACrC,QAAQ,YAAYsC,UAAU,KAAKC,MAAM,cAChD/B,SAAAhB,IAGRW,OAKNC,EAACoC,EAAc,CAAChD,MAAOA,EAAQgB,SAAAL,KAA+B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material"),a=require("@mui/material/Switch");module.exports=({label:l,checked:i,onChange:t,labelPlacement:m="start",size:c="medium",disabled:o=!1})=>e.jsx(r.FormControlLabel,{label:l,labelPlacement:m,control:e.jsx(a,{checked:i,onChange:t,color:"primary",size:c,disabled:o})});
|
|
2
|
+
//# sourceMappingURL=Switch.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.cjs.js","sources":["../../../../src/components/ui/Switch/Switch.tsx"],"sourcesContent":["import { FormControlLabel, FormControlLabelProps } from '@mui/material';\nimport MuiSwitch, { SwitchProps as MuiSwitchProps } from '@mui/material/Switch';\n\nexport type SwitchProps = {\n label: string;\n labelPlacement?: FormControlLabelProps['labelPlacement'];\n checked?: boolean;\n onChange?: MuiSwitchProps['onChange'];\n size?: MuiSwitchProps['size'];\n disabled?: boolean;\n};\n\nconst Switch = ({ label, checked, onChange, labelPlacement = 'start', size = 'medium', disabled = false }: SwitchProps) => {\n return (\n <FormControlLabel\n label={label}\n labelPlacement={labelPlacement}\n control={<MuiSwitch checked={checked} onChange={onChange} color=\"primary\" size={size} disabled={disabled} />}\n />\n );\n};\n\nexport default Switch;\n"],"names":["label","checked","onChange","labelPlacement","size","disabled","_jsx","FormControlLabel","control","MuiSwitch","color"],"mappings":"4HAYe,EAAGA,QAAOC,UAASC,WAAUC,iBAAiB,QAASC,OAAO,SAAUC,YAAW,KAE1FC,MAACC,EAAAA,iBACG,CAAAP,MAAOA,EACPG,eAAgBA,EAChBK,QAASF,MAACG,GAAUR,QAASA,EAASC,SAAUA,EAAUQ,MAAM,UAAUN,KAAMA,EAAMC,SAAUA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FormControlLabelProps } from '@mui/material';
|
|
3
|
+
import { SwitchProps as SwitchProps$1 } from '@mui/material/Switch';
|
|
4
|
+
|
|
5
|
+
type SwitchProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
labelPlacement?: FormControlLabelProps['labelPlacement'];
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
onChange?: SwitchProps$1['onChange'];
|
|
10
|
+
size?: SwitchProps$1['size'];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const Switch: ({ label, checked, onChange, labelPlacement, size, disabled }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { type SwitchProps, Switch as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormControlLabel as a}from"@mui/material";import l from"@mui/material/Switch";const m=({label:m,checked:r,onChange:t,labelPlacement:i="start",size:o="medium",disabled:c=!1})=>e(a,{label:m,labelPlacement:i,control:e(l,{checked:r,onChange:t,color:"primary",size:o,disabled:c})});export{m as default};
|
|
2
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../../src/components/ui/Switch/Switch.tsx"],"sourcesContent":["import { FormControlLabel, FormControlLabelProps } from '@mui/material';\nimport MuiSwitch, { SwitchProps as MuiSwitchProps } from '@mui/material/Switch';\n\nexport type SwitchProps = {\n label: string;\n labelPlacement?: FormControlLabelProps['labelPlacement'];\n checked?: boolean;\n onChange?: MuiSwitchProps['onChange'];\n size?: MuiSwitchProps['size'];\n disabled?: boolean;\n};\n\nconst Switch = ({ label, checked, onChange, labelPlacement = 'start', size = 'medium', disabled = false }: SwitchProps) => {\n return (\n <FormControlLabel\n label={label}\n labelPlacement={labelPlacement}\n control={<MuiSwitch checked={checked} onChange={onChange} color=\"primary\" size={size} disabled={disabled} />}\n />\n );\n};\n\nexport default Switch;\n"],"names":["Switch","label","checked","onChange","labelPlacement","size","disabled","_jsx","FormControlLabel","control","MuiSwitch","color"],"mappings":"6HAYM,MAAAA,EAAS,EAAGC,QAAOC,UAASC,WAAUC,iBAAiB,QAASC,OAAO,SAAUC,YAAW,KAE1FC,EAACC,EACG,CAAAP,MAAOA,EACPG,eAAgBA,EAChBK,QAASF,EAACG,GAAUR,QAASA,EAASC,SAAUA,EAAUQ,MAAM,UAAUN,KAAMA,EAAMC,SAAUA"}
|