@serhii.olishevskyi/docs 1.2.3 → 1.2.5
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/index.d.mts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +78 -0
- package/dist/index.mjs +84 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { TextFieldProps, SelectProps, SelectChangeEvent, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
3
|
+
import { TextFieldProps, SelectProps, SelectChangeEvent, FormControlLabelProps, SwitchProps, CheckboxProps, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
4
4
|
import { SystemProps } from '@mui/system';
|
|
5
5
|
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
6
6
|
import { SupabaseClient, User, Session } from '@supabase/supabase-js';
|
|
@@ -105,6 +105,56 @@ interface SelectComponentProps<T = string> extends Omit<SelectProps<T | T[]>, 'o
|
|
|
105
105
|
defaultValueOnClear?: T;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
type SwitchComponentProps = Omit<FormControlLabelProps, 'control' | 'label' | 'onChange'> & {
|
|
109
|
+
checked?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Стандартный обработчик изменения состояния MUI Switch
|
|
112
|
+
*/
|
|
113
|
+
onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Общая метка switch (если одинаковая для обоих состояний)
|
|
116
|
+
*/
|
|
117
|
+
label?: ReactNode;
|
|
118
|
+
/**
|
|
119
|
+
* Метка, когда Switch в состоянии checked === true
|
|
120
|
+
*/
|
|
121
|
+
checkedLabel?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Метка, когда Switch в состоянии checked === false
|
|
124
|
+
*/
|
|
125
|
+
uncheckedLabel?: ReactNode;
|
|
126
|
+
overrideNamespace?: string;
|
|
127
|
+
switchProps?: SwitchProps;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type CheckboxComponentProps = Omit<FormControlLabelProps, 'control' | 'label' | 'onChange'> & {
|
|
131
|
+
checked?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Стандартный обработчик изменения состояния MUI Checkbox
|
|
134
|
+
*/
|
|
135
|
+
onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Общая метка чекбокса (если одинаковая для обоих состояний)
|
|
138
|
+
*/
|
|
139
|
+
label?: ReactNode;
|
|
140
|
+
/**
|
|
141
|
+
* Метка, когда Checkbox в состоянии checked === true
|
|
142
|
+
*/
|
|
143
|
+
checkedLabel?: ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Метка, когда Checkbox в состоянии checked === false
|
|
146
|
+
*/
|
|
147
|
+
uncheckedLabel?: ReactNode;
|
|
148
|
+
/**
|
|
149
|
+
* Кастомный namespace для перевода метки
|
|
150
|
+
*/
|
|
151
|
+
overrideNamespace?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Дополнительные пропсы для внутреннего компонента MUI Checkbox
|
|
154
|
+
*/
|
|
155
|
+
checkboxProps?: CheckboxProps;
|
|
156
|
+
};
|
|
157
|
+
|
|
108
158
|
interface CopyClipboardButtonComponentProps extends Omit<IconButtonProps, 'onClick'> {
|
|
109
159
|
overrideNamespace?: string;
|
|
110
160
|
/** Текст, який буде скопійовано в буфер обміну */
|
|
@@ -330,6 +380,8 @@ declare const UI: {
|
|
|
330
380
|
EmailField: React$1.FC<EmailInputComponentProps>;
|
|
331
381
|
Search: React$1.FC<SearchComponentProps>;
|
|
332
382
|
Select: <T extends string | number>({ overrideNamespace, label, value, options, onChange, id, fullWidth, size, multiple, withCheckboxes, clearable, maxSelect, disabled, maxDisplayedTags, helperText, defaultValueOnClear, sx, ...restProps }: SelectComponentProps<T>) => React$1.JSX.Element;
|
|
383
|
+
Checkbox: React$1.FC<CheckboxComponentProps>;
|
|
384
|
+
Switch: React$1.FC<SwitchComponentProps>;
|
|
333
385
|
Url: typeof UrlComponent;
|
|
334
386
|
};
|
|
335
387
|
Buttons: {
|
|
@@ -692,4 +744,4 @@ declare const Hooks: {
|
|
|
692
744
|
};
|
|
693
745
|
};
|
|
694
746
|
|
|
695
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
|
747
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CheckboxComponentProps, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type SwitchComponentProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { TextFieldProps, SelectProps, SelectChangeEvent, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
3
|
+
import { TextFieldProps, SelectProps, SelectChangeEvent, FormControlLabelProps, SwitchProps, CheckboxProps, IconButtonProps, TooltipProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
4
4
|
import { SystemProps } from '@mui/system';
|
|
5
5
|
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
6
6
|
import { SupabaseClient, User, Session } from '@supabase/supabase-js';
|
|
@@ -105,6 +105,56 @@ interface SelectComponentProps<T = string> extends Omit<SelectProps<T | T[]>, 'o
|
|
|
105
105
|
defaultValueOnClear?: T;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
type SwitchComponentProps = Omit<FormControlLabelProps, 'control' | 'label' | 'onChange'> & {
|
|
109
|
+
checked?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Стандартный обработчик изменения состояния MUI Switch
|
|
112
|
+
*/
|
|
113
|
+
onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Общая метка switch (если одинаковая для обоих состояний)
|
|
116
|
+
*/
|
|
117
|
+
label?: ReactNode;
|
|
118
|
+
/**
|
|
119
|
+
* Метка, когда Switch в состоянии checked === true
|
|
120
|
+
*/
|
|
121
|
+
checkedLabel?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Метка, когда Switch в состоянии checked === false
|
|
124
|
+
*/
|
|
125
|
+
uncheckedLabel?: ReactNode;
|
|
126
|
+
overrideNamespace?: string;
|
|
127
|
+
switchProps?: SwitchProps;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type CheckboxComponentProps = Omit<FormControlLabelProps, 'control' | 'label' | 'onChange'> & {
|
|
131
|
+
checked?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Стандартный обработчик изменения состояния MUI Checkbox
|
|
134
|
+
*/
|
|
135
|
+
onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Общая метка чекбокса (если одинаковая для обоих состояний)
|
|
138
|
+
*/
|
|
139
|
+
label?: ReactNode;
|
|
140
|
+
/**
|
|
141
|
+
* Метка, когда Checkbox в состоянии checked === true
|
|
142
|
+
*/
|
|
143
|
+
checkedLabel?: ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* Метка, когда Checkbox в состоянии checked === false
|
|
146
|
+
*/
|
|
147
|
+
uncheckedLabel?: ReactNode;
|
|
148
|
+
/**
|
|
149
|
+
* Кастомный namespace для перевода метки
|
|
150
|
+
*/
|
|
151
|
+
overrideNamespace?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Дополнительные пропсы для внутреннего компонента MUI Checkbox
|
|
154
|
+
*/
|
|
155
|
+
checkboxProps?: CheckboxProps;
|
|
156
|
+
};
|
|
157
|
+
|
|
108
158
|
interface CopyClipboardButtonComponentProps extends Omit<IconButtonProps, 'onClick'> {
|
|
109
159
|
overrideNamespace?: string;
|
|
110
160
|
/** Текст, який буде скопійовано в буфер обміну */
|
|
@@ -330,6 +380,8 @@ declare const UI: {
|
|
|
330
380
|
EmailField: React$1.FC<EmailInputComponentProps>;
|
|
331
381
|
Search: React$1.FC<SearchComponentProps>;
|
|
332
382
|
Select: <T extends string | number>({ overrideNamespace, label, value, options, onChange, id, fullWidth, size, multiple, withCheckboxes, clearable, maxSelect, disabled, maxDisplayedTags, helperText, defaultValueOnClear, sx, ...restProps }: SelectComponentProps<T>) => React$1.JSX.Element;
|
|
383
|
+
Checkbox: React$1.FC<CheckboxComponentProps>;
|
|
384
|
+
Switch: React$1.FC<SwitchComponentProps>;
|
|
333
385
|
Url: typeof UrlComponent;
|
|
334
386
|
};
|
|
335
387
|
Buttons: {
|
|
@@ -692,4 +744,4 @@ declare const Hooks: {
|
|
|
692
744
|
};
|
|
693
745
|
};
|
|
694
746
|
|
|
695
|
-
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
|
747
|
+
export { type AIConfig, type AIGenerateOptions, AIProvider, type AIProviderProps, type AIProviderType, AppSettingsProvider, AuthProvider, BreadcrumbProvider, type CheckboxComponentProps, type CompanyMember, type ConfirmOptions, type ConfirmResult, ConfirmationProvider, type ConfirmationProviderProps, type CopyClipboardButtonComponentProps, type DialogSeverity, type DisplayState, type EmailInputComponentProps, type ExpandableNoteComponentProps, type FullCompanyMemberItem, Hooks, type Language, LocalizationProvider, type Membership, type MembershipRole, type MyAvatarComponentProps, type NumberInputComponentProps, type PageLink, type PageLinkWidgetProps, Providers, type SaveCompanyUserPayload, type SearchComponentProps, type SelectComponentProps, type SelectOption, Services, type SupabaseConfig, SupabaseProvider, type SupabaseProviderProps, type SwitchComponentProps, type TextFieldComponentProps, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, ToastProvider, type ToastType, type TranslatableTooltipComponentProps, TranslateProvider, TranslateText, TranslationEditProvider, type TypographyConfig, UI, type UrlComponentProps as UrlProps, type UserAvatarComponentProps, type UserGroupedSessions, type UserPopoverComponentProps, type UserProfile, type UserRoleChipComponentProps, type UserSessionItem, type UserSettings, UserSettingsProvider, type UserStatusChipComponentProps, type UserStatusType, defaultUserSettings, initI18n, useAI, useAppSettings, useAppTheme, useAuth, useBreadcrumb, useConfirmation, useLocalization, useSupabase, useToast, useTranslationEdit, useTranslationNamespace, useUserSettings };
|
package/dist/index.js
CHANGED
|
@@ -4526,6 +4526,82 @@ var PageLinkWidget = ({
|
|
|
4526
4526
|
);
|
|
4527
4527
|
};
|
|
4528
4528
|
|
|
4529
|
+
// src/UI/components/inputs/CheckboxComponent.tsx
|
|
4530
|
+
var import_material22 = require("@mui/material");
|
|
4531
|
+
init_TranslateText();
|
|
4532
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4533
|
+
var CheckboxComponent = ({
|
|
4534
|
+
checked = false,
|
|
4535
|
+
onChange,
|
|
4536
|
+
label,
|
|
4537
|
+
checkedLabel,
|
|
4538
|
+
uncheckedLabel,
|
|
4539
|
+
overrideNamespace,
|
|
4540
|
+
checkboxProps,
|
|
4541
|
+
...props
|
|
4542
|
+
}) => {
|
|
4543
|
+
const currentLabel = label ?? (checked ? checkedLabel : uncheckedLabel);
|
|
4544
|
+
const renderLabel = (node) => {
|
|
4545
|
+
if (typeof node === "string") {
|
|
4546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TranslateText, { overrideNamespace, children: node });
|
|
4547
|
+
}
|
|
4548
|
+
return node;
|
|
4549
|
+
};
|
|
4550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material22.Box, { sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4551
|
+
import_material22.FormControlLabel,
|
|
4552
|
+
{
|
|
4553
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4554
|
+
import_material22.Checkbox,
|
|
4555
|
+
{
|
|
4556
|
+
checked,
|
|
4557
|
+
onChange,
|
|
4558
|
+
...checkboxProps
|
|
4559
|
+
}
|
|
4560
|
+
),
|
|
4561
|
+
label: renderLabel(currentLabel),
|
|
4562
|
+
...props
|
|
4563
|
+
}
|
|
4564
|
+
) });
|
|
4565
|
+
};
|
|
4566
|
+
|
|
4567
|
+
// src/UI/components/inputs/SwitchComponent.tsx
|
|
4568
|
+
var import_material23 = require("@mui/material");
|
|
4569
|
+
init_TranslateText();
|
|
4570
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4571
|
+
var SwitchComponent = ({
|
|
4572
|
+
checked = false,
|
|
4573
|
+
onChange,
|
|
4574
|
+
label,
|
|
4575
|
+
checkedLabel,
|
|
4576
|
+
uncheckedLabel,
|
|
4577
|
+
overrideNamespace,
|
|
4578
|
+
switchProps,
|
|
4579
|
+
...props
|
|
4580
|
+
}) => {
|
|
4581
|
+
const currentLabel = label ?? (checked ? checkedLabel : uncheckedLabel);
|
|
4582
|
+
const renderLabel = (node) => {
|
|
4583
|
+
if (typeof node === "string") {
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TranslateText, { overrideNamespace, children: node });
|
|
4585
|
+
}
|
|
4586
|
+
return node;
|
|
4587
|
+
};
|
|
4588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material23.Box, { sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4589
|
+
import_material23.FormControlLabel,
|
|
4590
|
+
{
|
|
4591
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4592
|
+
import_material23.Switch,
|
|
4593
|
+
{
|
|
4594
|
+
checked,
|
|
4595
|
+
onChange,
|
|
4596
|
+
...switchProps
|
|
4597
|
+
}
|
|
4598
|
+
),
|
|
4599
|
+
label: renderLabel(currentLabel),
|
|
4600
|
+
...props
|
|
4601
|
+
}
|
|
4602
|
+
) });
|
|
4603
|
+
};
|
|
4604
|
+
|
|
4529
4605
|
// src/UI/index.ts
|
|
4530
4606
|
var UI = {
|
|
4531
4607
|
Inputs: {
|
|
@@ -4534,6 +4610,8 @@ var UI = {
|
|
|
4534
4610
|
EmailField: EmailInputComponent,
|
|
4535
4611
|
Search: SearchComponent,
|
|
4536
4612
|
Select: SelectComponent,
|
|
4613
|
+
Checkbox: CheckboxComponent,
|
|
4614
|
+
Switch: SwitchComponent,
|
|
4537
4615
|
Url: UrlComponent
|
|
4538
4616
|
},
|
|
4539
4617
|
Buttons: {
|
package/dist/index.mjs
CHANGED
|
@@ -1791,6 +1791,88 @@ var PageLinkWidget = ({
|
|
|
1791
1791
|
);
|
|
1792
1792
|
};
|
|
1793
1793
|
|
|
1794
|
+
// src/UI/components/inputs/CheckboxComponent.tsx
|
|
1795
|
+
import {
|
|
1796
|
+
FormControlLabel,
|
|
1797
|
+
Checkbox as Checkbox2,
|
|
1798
|
+
Box as Box6
|
|
1799
|
+
} from "@mui/material";
|
|
1800
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1801
|
+
var CheckboxComponent = ({
|
|
1802
|
+
checked = false,
|
|
1803
|
+
onChange,
|
|
1804
|
+
label,
|
|
1805
|
+
checkedLabel,
|
|
1806
|
+
uncheckedLabel,
|
|
1807
|
+
overrideNamespace,
|
|
1808
|
+
checkboxProps,
|
|
1809
|
+
...props
|
|
1810
|
+
}) => {
|
|
1811
|
+
const currentLabel = label ?? (checked ? checkedLabel : uncheckedLabel);
|
|
1812
|
+
const renderLabel = (node) => {
|
|
1813
|
+
if (typeof node === "string") {
|
|
1814
|
+
return /* @__PURE__ */ jsx12(TranslateText, { overrideNamespace, children: node });
|
|
1815
|
+
}
|
|
1816
|
+
return node;
|
|
1817
|
+
};
|
|
1818
|
+
return /* @__PURE__ */ jsx12(Box6, { sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ jsx12(
|
|
1819
|
+
FormControlLabel,
|
|
1820
|
+
{
|
|
1821
|
+
control: /* @__PURE__ */ jsx12(
|
|
1822
|
+
Checkbox2,
|
|
1823
|
+
{
|
|
1824
|
+
checked,
|
|
1825
|
+
onChange,
|
|
1826
|
+
...checkboxProps
|
|
1827
|
+
}
|
|
1828
|
+
),
|
|
1829
|
+
label: renderLabel(currentLabel),
|
|
1830
|
+
...props
|
|
1831
|
+
}
|
|
1832
|
+
) });
|
|
1833
|
+
};
|
|
1834
|
+
|
|
1835
|
+
// src/UI/components/inputs/SwitchComponent.tsx
|
|
1836
|
+
import {
|
|
1837
|
+
FormControlLabel as FormControlLabel2,
|
|
1838
|
+
Switch,
|
|
1839
|
+
Box as Box7
|
|
1840
|
+
} from "@mui/material";
|
|
1841
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1842
|
+
var SwitchComponent = ({
|
|
1843
|
+
checked = false,
|
|
1844
|
+
onChange,
|
|
1845
|
+
label,
|
|
1846
|
+
checkedLabel,
|
|
1847
|
+
uncheckedLabel,
|
|
1848
|
+
overrideNamespace,
|
|
1849
|
+
switchProps,
|
|
1850
|
+
...props
|
|
1851
|
+
}) => {
|
|
1852
|
+
const currentLabel = label ?? (checked ? checkedLabel : uncheckedLabel);
|
|
1853
|
+
const renderLabel = (node) => {
|
|
1854
|
+
if (typeof node === "string") {
|
|
1855
|
+
return /* @__PURE__ */ jsx13(TranslateText, { overrideNamespace, children: node });
|
|
1856
|
+
}
|
|
1857
|
+
return node;
|
|
1858
|
+
};
|
|
1859
|
+
return /* @__PURE__ */ jsx13(Box7, { sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ jsx13(
|
|
1860
|
+
FormControlLabel2,
|
|
1861
|
+
{
|
|
1862
|
+
control: /* @__PURE__ */ jsx13(
|
|
1863
|
+
Switch,
|
|
1864
|
+
{
|
|
1865
|
+
checked,
|
|
1866
|
+
onChange,
|
|
1867
|
+
...switchProps
|
|
1868
|
+
}
|
|
1869
|
+
),
|
|
1870
|
+
label: renderLabel(currentLabel),
|
|
1871
|
+
...props
|
|
1872
|
+
}
|
|
1873
|
+
) });
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1794
1876
|
// src/UI/index.ts
|
|
1795
1877
|
var UI = {
|
|
1796
1878
|
Inputs: {
|
|
@@ -1799,6 +1881,8 @@ var UI = {
|
|
|
1799
1881
|
EmailField: EmailInputComponent,
|
|
1800
1882
|
Search: SearchComponent,
|
|
1801
1883
|
Select: SelectComponent,
|
|
1884
|
+
Checkbox: CheckboxComponent,
|
|
1885
|
+
Switch: SwitchComponent,
|
|
1802
1886
|
Url: UrlComponent
|
|
1803
1887
|
},
|
|
1804
1888
|
Buttons: {
|