@sqrzro/admin 2.0.0-beta.0 → 2.0.0
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/.turbo/turbo-docs.log +0 -0
- package/.turbo/turbo-lint.log +112 -0
- package/.turbo/turbo-prettier.log +215 -0
- package/.turbo/turbo-test.log +6 -0
- package/dist/components/Alert/index.d.ts +4 -26
- package/dist/components/Alert/index.js +15 -54
- package/dist/components/Allow/index.d.ts +20 -20
- package/dist/components/Allow/index.js +29 -29
- package/dist/components/AppLayout/AppLayout.stories.d.ts +5 -5
- package/dist/components/AppLayout/AppLayout.stories.js +11 -11
- package/dist/components/AppLayout/index.d.ts +6 -6
- package/dist/components/AppLayout/index.js +18 -11
- package/dist/components/AutoSuggest/index.d.ts +74 -74
- package/dist/components/AutoSuggest/index.js +143 -143
- package/dist/components/Button/Button.stories.d.ts +11 -11
- package/dist/components/Button/Button.stories.js +41 -41
- package/dist/components/Button/index.d.ts +49 -50
- package/dist/components/Button/index.js +50 -50
- package/dist/components/CalendarInput/index.d.ts +24 -24
- package/dist/components/CalendarInput/index.js +54 -56
- package/dist/components/CheckboxList/index.d.ts +17 -17
- package/dist/components/CheckboxList/index.js +25 -25
- package/dist/components/CodeInput/index.d.ts +9 -9
- package/dist/components/CodeInput/index.js +51 -57
- package/dist/components/ConnectedDropdown/index.d.ts +14 -14
- package/dist/components/ConnectedDropdown/index.js +36 -36
- package/dist/components/ConnectedList/index.d.ts +5 -5
- package/dist/components/ConnectedList/index.js +7 -7
- package/dist/components/ConnectedTable/index.d.ts +5 -5
- package/dist/components/ConnectedTable/index.js +7 -7
- package/dist/components/ContentBlock/index.d.ts +16 -16
- package/dist/components/ContentBlock/index.js +13 -13
- package/dist/components/DataPanel/index.d.ts +8 -8
- package/dist/components/DataPanel/index.js +8 -8
- package/dist/components/DateInput/index.d.ts +18 -18
- package/dist/components/DateInput/index.js +81 -81
- package/dist/components/Dropdown/index.d.ts +36 -36
- package/dist/components/Dropdown/index.js +122 -122
- package/dist/components/ErrorMessage/index.d.ts +16 -16
- package/dist/components/ErrorMessage/index.js +17 -17
- package/dist/components/Fieldset/index.d.ts +18 -18
- package/dist/components/Fieldset/index.js +19 -19
- package/dist/components/FileInput/index.d.ts +10 -10
- package/dist/components/FileInput/index.js +26 -26
- package/dist/components/FilterLink/index.d.ts +14 -14
- package/dist/components/FilterLink/index.js +15 -15
- package/dist/components/Form/index.d.ts +14 -14
- package/dist/components/Form/index.js +15 -15
- package/dist/components/FormActions/index.d.ts +18 -18
- package/dist/components/FormActions/index.js +14 -14
- package/dist/components/FormField/index.d.ts +14 -14
- package/dist/components/FormField/index.js +40 -40
- package/dist/components/FormRepeater/index.d.ts +18 -18
- package/dist/components/FormRepeater/index.js +65 -65
- package/dist/components/ImageInput/index.d.ts +13 -13
- package/dist/components/ImageInput/index.js +45 -45
- package/dist/components/InfoPanel/index.d.ts +14 -14
- package/dist/components/InfoPanel/index.js +11 -11
- package/dist/components/Link/__mocks__/index.d.ts +6 -6
- package/dist/components/Link/__mocks__/index.js +12 -12
- package/dist/components/Link/index.d.ts +23 -23
- package/dist/components/Link/index.js +21 -21
- package/dist/components/List/index.d.ts +36 -36
- package/dist/components/List/index.js +46 -46
- package/dist/components/ListActions/index.d.ts +18 -18
- package/dist/components/ListActions/index.js +14 -14
- package/dist/components/LoginForm/index.d.ts +3 -3
- package/dist/components/LoginForm/index.js +47 -47
- package/dist/components/Message/index.d.ts +14 -14
- package/dist/components/Message/index.js +14 -14
- package/dist/components/Modal/index.d.ts +4 -4
- package/dist/components/Modal/index.js +18 -18
- package/dist/components/ModalActions/index.d.ts +21 -21
- package/dist/components/ModalActions/index.js +18 -18
- package/dist/components/MoneyInput/index.d.ts +10 -10
- package/dist/components/MoneyInput/index.js +13 -13
- package/dist/components/PasswordForm/index.d.ts +35 -35
- package/dist/components/PasswordForm/index.js +21 -21
- package/dist/components/PasswordInput/index.d.ts +4 -4
- package/dist/components/PasswordInput/index.js +12 -12
- package/dist/components/RadioList/index.d.ts +9 -9
- package/dist/components/RadioList/index.js +7 -7
- package/dist/components/RootLayout/index.d.ts +6 -8
- package/dist/components/RootLayout/index.js +7 -21
- package/dist/components/SummaryList/index.d.ts +18 -18
- package/dist/components/SummaryList/index.js +15 -15
- package/dist/components/Switch/index.d.ts +21 -21
- package/dist/components/Switch/index.js +31 -31
- package/dist/components/Table/index.d.ts +28 -28
- package/dist/components/Table/index.js +55 -55
- package/dist/components/Tag/index.d.ts +15 -15
- package/dist/components/Tag/index.js +13 -13
- package/dist/components/TextArea/index.d.ts +18 -18
- package/dist/components/TextArea/index.js +26 -26
- package/dist/components/TextInput/index.d.ts +14 -14
- package/dist/components/TextInput/index.js +27 -27
- package/dist/components/WebsiteInput/index.d.ts +10 -10
- package/dist/components/WebsiteInput/index.js +13 -13
- package/dist/components/WeekCalendar/index.d.ts +24 -24
- package/dist/components/WeekCalendar/index.js +48 -48
- package/dist/core/AlertComponent/index.d.ts +26 -26
- package/dist/core/AlertComponent/index.js +35 -45
- package/dist/core/AppHeader/index.d.ts +3 -3
- package/dist/core/AppHeader/index.js +17 -17
- package/dist/core/AppLogo/index.d.ts +12 -12
- package/dist/core/AppLogo/index.js +16 -17
- package/dist/core/AppLogoImage/index.d.ts +3 -3
- package/dist/core/AppLogoImage/index.js +11 -11
- package/dist/core/AppLogoPlaceholder/index.d.ts +3 -3
- package/dist/core/AppLogoPlaceholder/index.js +10 -10
- package/dist/core/Assistive/index.d.ts +12 -12
- package/dist/core/Assistive/index.js +9 -9
- package/dist/core/AuthForm/index.d.ts +10 -10
- package/dist/core/AuthForm/index.js +13 -26
- package/dist/core/Banner/index.d.ts +3 -3
- package/dist/core/Banner/index.js +14 -14
- package/dist/core/Calendar/index.d.ts +21 -21
- package/dist/core/Calendar/index.js +69 -69
- package/dist/core/CalendarDay/index.d.ts +30 -30
- package/dist/core/CalendarDay/index.js +30 -30
- package/dist/core/CalendarMonth/index.d.ts +23 -23
- package/dist/core/CalendarMonth/index.js +45 -45
- package/dist/core/CalendarNavigation/index.d.ts +17 -17
- package/dist/core/CalendarNavigation/index.js +24 -24
- package/dist/core/CalendarWeek/index.d.ts +28 -28
- package/dist/core/CalendarWeek/index.js +46 -46
- package/dist/core/ChkRad/index.d.ts +26 -26
- package/dist/core/ChkRad/index.js +33 -33
- package/dist/core/ChkRadIcon/index.d.ts +14 -14
- package/dist/core/ChkRadIcon/index.js +12 -12
- package/dist/core/ChkRadList/index.d.ts +32 -32
- package/dist/core/ChkRadList/index.js +37 -37
- package/dist/core/CloseButton/index.d.ts +17 -17
- package/dist/core/CloseButton/index.js +12 -12
- package/dist/core/ConfirmModal/index.d.ts +3 -3
- package/dist/core/ConfirmModal/index.js +38 -38
- package/dist/core/ConnectedRepeater/index.d.ts +50 -50
- package/dist/core/ConnectedRepeater/index.js +154 -154
- package/dist/core/ConnectedRepeaterComponent/index.d.ts +24 -24
- package/dist/core/ConnectedRepeaterComponent/index.js +25 -25
- package/dist/core/Container/index.d.ts +14 -14
- package/dist/core/Container/index.js +12 -12
- package/dist/core/DataPanelItem/index.d.ts +8 -8
- package/dist/core/DataPanelItem/index.js +7 -7
- package/dist/core/DropdownPanel/index.d.ts +31 -31
- package/dist/core/DropdownPanel/index.js +32 -32
- package/dist/core/EmptyMessage/index.d.ts +21 -21
- package/dist/core/EmptyMessage/index.js +21 -21
- package/dist/core/FilterItem/index.d.ts +25 -25
- package/dist/core/FilterItem/index.js +82 -84
- package/dist/core/Filters/index.d.ts +31 -31
- package/dist/core/Filters/index.js +85 -85
- package/dist/core/FixedActions/index.d.ts +24 -24
- package/dist/core/FixedActions/index.js +22 -22
- package/dist/core/FormError/index.d.ts +12 -12
- package/dist/core/FormError/index.js +9 -9
- package/dist/core/FormLabel/index.d.ts +16 -16
- package/dist/core/FormLabel/index.js +13 -13
- package/dist/core/FormLegend/index.d.ts +12 -12
- package/dist/core/FormLegend/index.js +9 -9
- package/dist/core/Header/Header.stories.d.ts +5 -5
- package/dist/core/Header/Header.stories.js +11 -11
- package/dist/core/Header/index.d.ts +14 -14
- package/dist/core/Header/index.js +12 -12
- package/dist/core/Icon/index.d.ts +14 -14
- package/dist/core/Icon/index.js +32 -32
- package/dist/core/IconButton/index.d.ts +22 -22
- package/dist/core/IconButton/index.js +20 -20
- package/dist/core/InputPanel/index.d.ts +16 -16
- package/dist/core/InputPanel/index.js +11 -11
- package/dist/core/ListItem/index.d.ts +39 -39
- package/dist/core/ListItem/index.js +44 -44
- package/dist/core/ListItemAction/index.d.ts +11 -11
- package/dist/core/ListItemAction/index.js +13 -13
- package/dist/core/ListItemActions/index.d.ts +8 -8
- package/dist/core/ListItemActions/index.js +16 -16
- package/dist/core/ListItemMetaItem/index.d.ts +19 -19
- package/dist/core/ListItemMetaItem/index.js +29 -29
- package/dist/core/ListItemTitle/index.d.ts +19 -19
- package/dist/core/ListItemTitle/index.js +44 -44
- package/dist/core/Loader/index.d.ts +15 -15
- package/dist/core/Loader/index.js +16 -16
- package/dist/core/MeActions/index.d.ts +3 -3
- package/dist/core/MeActions/index.js +48 -48
- package/dist/core/MePanel/index.d.ts +19 -19
- package/dist/core/MePanel/index.js +29 -29
- package/dist/core/ModalComponent/index.d.ts +22 -22
- package/dist/core/ModalComponent/index.js +29 -29
- package/dist/core/Navigation/index.d.ts +3 -3
- package/dist/core/Navigation/index.js +33 -33
- package/dist/core/NavigationDivider/index.d.ts +3 -3
- package/dist/core/NavigationDivider/index.js +8 -8
- package/dist/core/NavigationItem/index.d.ts +16 -16
- package/dist/core/NavigationItem/index.js +21 -21
- package/dist/core/Pagination/index.d.ts +15 -15
- package/dist/core/Pagination/index.js +64 -64
- package/dist/core/PaginationItem/index.d.ts +10 -10
- package/dist/core/PaginationItem/index.js +17 -17
- package/dist/core/Panel/index.d.ts +17 -17
- package/dist/core/Panel/index.js +13 -16
- package/dist/core/PasswordForgotForm/index.d.ts +7 -7
- package/dist/core/PasswordForgotForm/index.js +40 -40
- package/dist/core/PasswordResetForm/index.d.ts +7 -7
- package/dist/core/PasswordResetForm/index.js +34 -34
- package/dist/core/RadialProgress/index.d.ts +16 -16
- package/dist/core/RadialProgress/index.js +23 -23
- package/dist/core/SettingsForm/index.d.ts +3 -3
- package/dist/core/SettingsForm/index.js +14 -14
- package/dist/core/StaticTextInput/index.d.ts +29 -29
- package/dist/core/StaticTextInput/index.js +39 -39
- package/dist/core/Styled/index.d.ts +6 -6
- package/dist/core/Styled/index.js +39 -39
- package/dist/core/SummaryListItem/index.d.ts +23 -23
- package/dist/core/SummaryListItem/index.js +31 -31
- package/dist/core/TabItem/index.d.ts +4 -4
- package/dist/core/TabItem/index.js +13 -13
- package/dist/core/TableActionsCell/index.d.ts +8 -8
- package/dist/core/TableActionsCell/index.js +8 -8
- package/dist/core/TableCell/index.d.ts +15 -15
- package/dist/core/TableCell/index.js +20 -20
- package/dist/core/TableHead/index.d.ts +18 -18
- package/dist/core/TableHead/index.js +18 -18
- package/dist/core/TableRow/index.d.ts +13 -13
- package/dist/core/TableRow/index.js +18 -18
- package/dist/core/Tabs/index.d.ts +7 -7
- package/dist/core/Tabs/index.js +13 -13
- package/dist/core/TextInputAncillary/index.d.ts +29 -29
- package/dist/core/TextInputAncillary/index.js +31 -31
- package/dist/core/Toast/index.d.ts +3 -3
- package/dist/core/Toast/index.js +47 -47
- package/dist/core/TwoFactor/index.d.ts +13 -13
- package/dist/core/TwoFactor/index.js +49 -49
- package/dist/core/TwoFactorAuthenticator/index.d.ts +10 -10
- package/dist/core/TwoFactorAuthenticator/index.js +9 -9
- package/dist/core/TwoFactorMethodList/index.d.ts +10 -10
- package/dist/core/TwoFactorMethodList/index.js +22 -22
- package/dist/core/TwoFactorSetup/index.d.ts +12 -12
- package/dist/core/TwoFactorSetup/index.js +43 -43
- package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +20 -20
- package/dist/core/TwoFactorSetupAuthenticator/index.js +42 -42
- package/dist/core/TwoFactorSetupYubikey/index.d.ts +16 -16
- package/dist/core/TwoFactorSetupYubikey/index.js +14 -14
- package/dist/core/TwoFactorYubikey/index.d.ts +9 -9
- package/dist/core/TwoFactorYubikey/index.js +14 -14
- package/dist/core/WeekCalendarDay/index.d.ts +27 -27
- package/dist/core/WeekCalendarDay/index.js +35 -35
- package/dist/core/YubikeyInput/index.d.ts +4 -4
- package/dist/core/YubikeyInput/index.js +14 -39
- package/dist/filters/BooleanFilter/index.d.ts +14 -14
- package/dist/filters/BooleanFilter/index.js +35 -35
- package/dist/filters/DateFilter/index.d.ts +5 -5
- package/dist/filters/DateFilter/index.js +24 -24
- package/dist/filters/DropdownFilter/index.d.ts +17 -17
- package/dist/filters/DropdownFilter/index.js +32 -32
- package/dist/filters/QuickDateFilter/index.d.ts +13 -13
- package/dist/filters/QuickDateFilter/index.js +40 -40
- package/dist/filters/interfaces.d.ts +35 -35
- package/dist/filters/interfaces.js +1 -1
- package/dist/hooks/useAlert.d.ts +12 -12
- package/dist/hooks/useAlert.js +18 -18
- package/dist/hooks/useAppConfig.d.ts +3 -0
- package/dist/hooks/useAppConfig.js +5 -0
- package/dist/hooks/useConnectedList.d.ts +7 -7
- package/dist/hooks/useConnectedList.js +6 -6
- package/dist/hooks/useConnectedRepeater.d.ts +7 -7
- package/dist/hooks/useConnectedRepeater.js +14 -14
- package/dist/hooks/useConnectedTable.d.ts +7 -7
- package/dist/hooks/useConnectedTable.js +6 -6
- package/dist/hooks/useFilters.d.ts +9 -9
- package/dist/hooks/useFilters.js +24 -24
- package/dist/hooks/useLayout.d.ts +7 -7
- package/dist/hooks/useLayout.js +10 -10
- package/dist/hooks/useLayout.spec.d.ts +1 -1
- package/dist/hooks/useLayout.spec.js +24 -24
- package/dist/hooks/useModal.d.ts +12 -12
- package/dist/hooks/useModal.js +39 -39
- package/dist/hooks/useModalOffset.d.ts +2 -2
- package/dist/hooks/useModalOffset.js +16 -16
- package/dist/hooks/useModalOffset.spec.d.ts +1 -1
- package/dist/hooks/useModalOffset.spec.js +19 -19
- package/dist/hooks/useNavigation.d.ts +7 -7
- package/dist/hooks/useNavigation.js +113 -113
- package/dist/hooks/useRemote.d.ts +7 -7
- package/dist/hooks/useRemote.js +29 -29
- package/dist/hooks/useVariant.d.ts +9 -9
- package/dist/hooks/useVariant.js +14 -14
- package/dist/index.d.ts +209 -208
- package/dist/index.js +213 -212
- package/dist/scenes/Error404Scene.d.ts +3 -3
- package/dist/scenes/Error404Scene.js +5 -5
- package/dist/services/AppService.d.ts +5 -5
- package/dist/services/AppService.js +11 -11
- package/dist/services/ConfigService.d.ts +42 -42
- package/dist/services/ConfigService.js +52 -55
- package/dist/services/ConfirmService.d.ts +12 -12
- package/dist/services/ConfirmService.js +10 -10
- package/dist/services/DateService.d.ts +26 -26
- package/dist/services/DateService.js +132 -132
- package/dist/services/DateService.spec.d.ts +1 -1
- package/dist/services/DateService.spec.js +83 -83
- package/dist/services/DownloadService.d.ts +7 -7
- package/dist/services/DownloadService.js +16 -16
- package/dist/services/DownloadService.spec.d.ts +1 -1
- package/dist/services/DownloadService.spec.js +18 -18
- package/dist/services/FilterComponentService.d.ts +25 -25
- package/dist/services/FilterComponentService.js +54 -54
- package/dist/services/FilterService.d.ts +34 -34
- package/dist/services/FilterService.js +58 -58
- package/dist/services/FilterService.spec.d.ts +1 -1
- package/dist/services/FilterService.spec.js +67 -67
- package/dist/services/FormatService.d.ts +11 -11
- package/dist/services/FormatService.js +45 -45
- package/dist/services/FormatService.spec.d.ts +1 -1
- package/dist/services/FormatService.spec.js +66 -66
- package/dist/services/ToastService.d.ts +7 -7
- package/dist/services/ToastService.js +17 -17
- package/dist/services/ToastService.spec.d.ts +1 -1
- package/dist/services/ToastService.spec.js +34 -34
- package/dist/styles.css +125 -67
- package/dist/utility/MockRouter/index.d.ts +2 -2
- package/dist/utility/MockRouter/index.js +37 -37
- package/dist/utility/StorybookPanel/index.d.ts +14 -14
- package/dist/utility/StorybookPanel/index.js +12 -12
- package/dist/utility/TestChangeHandler/index.d.ts +15 -15
- package/dist/utility/TestChangeHandler/index.js +30 -30
- package/dist/utility/icons.d.ts +3 -3
- package/dist/utility/icons.js +12 -12
- package/dist/utility/interfaces.d.ts +79 -80
- package/dist/utility/interfaces.js +18 -18
- package/dist/utility/middleware.d.ts +4 -4
- package/dist/utility/middleware.js +9 -4
- package/dist/utility/prop-types.d.ts +57 -57
- package/dist/utility/prop-types.js +77 -77
- package/dist/utility/register.d.ts +3 -3
- package/dist/utility/register.js +9 -7
- package/package.json +5 -5
- package/src/components/LoginForm/index.tsx +1 -1
- package/src/core/TwoFactor/TwoFactor.spec.tsx +4 -4
- package/src/core/TwoFactor/index.tsx +5 -5
- package/src/core/TwoFactorAuthenticator/index.tsx +1 -1
- package/src/core/TwoFactorSetup/index.tsx +1 -1
- package/src/core/TwoFactorYubikey/index.tsx +1 -1
- package/dist/hooks/useConfig.d.ts +0 -9
- package/dist/hooks/useConfig.js +0 -13
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { SummaryListObject } from '../../core/SummaryListItem';
|
|
4
|
-
interface SummaryListProps {
|
|
5
|
-
data: SummaryListObject[];
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare function SummaryList({ data, isDisabled }: SummaryListProps): React.ReactElement;
|
|
9
|
-
declare namespace SummaryList {
|
|
10
|
-
var propTypes: {
|
|
11
|
-
data: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
12
|
-
label: PropTypes.Validator<string>;
|
|
13
|
-
value: PropTypes.Validator<NonNullable<PropTypes.InferPropsInner<Pick<{}, never>> & Partial<PropTypes.InferPropsInner<Pick<{}, never>>>>>;
|
|
14
|
-
}>>[]>;
|
|
15
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export default SummaryList;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { SummaryListObject } from '../../core/SummaryListItem';
|
|
4
|
+
interface SummaryListProps {
|
|
5
|
+
data: SummaryListObject[];
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function SummaryList({ data, isDisabled }: SummaryListProps): React.ReactElement;
|
|
9
|
+
declare namespace SummaryList {
|
|
10
|
+
var propTypes: {
|
|
11
|
+
data: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
12
|
+
label: PropTypes.Validator<string>;
|
|
13
|
+
value: PropTypes.Validator<NonNullable<PropTypes.InferPropsInner<Pick<{}, never>> & Partial<PropTypes.InferPropsInner<Pick<{}, never>>>>>;
|
|
14
|
+
}>>[]>;
|
|
15
|
+
isDisabled: PropTypes.Requireable<boolean>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export default SummaryList;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import SummaryListItem from '../../core/SummaryListItem';
|
|
4
|
-
function SummaryList({ data, isDisabled }) {
|
|
5
|
-
return (React.createElement("dl", { className: "/*clsx(styles.root, styles[`rootHas${data.length`], {[styles.rootIsDisabled]: isDisabled})*/", "data-testid": "summary-list-root" }, data.map((item) => (React.createElement(SummaryListItem, { key: item.label, label: item.label, value: item.value })))));
|
|
6
|
-
}
|
|
7
|
-
SummaryList.propTypes = {
|
|
8
|
-
data: PropTypes.arrayOf(PropTypes.shape({
|
|
9
|
-
label: PropTypes.string.isRequired,
|
|
10
|
-
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.shape({})])
|
|
11
|
-
.isRequired,
|
|
12
|
-
}).isRequired).isRequired,
|
|
13
|
-
isDisabled: PropTypes.bool,
|
|
14
|
-
};
|
|
15
|
-
export default SummaryList;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import SummaryListItem from '../../core/SummaryListItem';
|
|
4
|
+
function SummaryList({ data, isDisabled }) {
|
|
5
|
+
return (React.createElement("dl", { className: "/*clsx(styles.root, styles[`rootHas${data.length`], {[styles.rootIsDisabled]: isDisabled})*/", "data-testid": "summary-list-root" }, data.map((item) => (React.createElement(SummaryListItem, { key: item.label, label: item.label, value: item.value })))));
|
|
6
|
+
}
|
|
7
|
+
SummaryList.propTypes = {
|
|
8
|
+
data: PropTypes.arrayOf(PropTypes.shape({
|
|
9
|
+
label: PropTypes.string.isRequired,
|
|
10
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.shape({})])
|
|
11
|
+
.isRequired,
|
|
12
|
+
}).isRequired).isRequired,
|
|
13
|
+
isDisabled: PropTypes.bool,
|
|
14
|
+
};
|
|
15
|
+
export default SummaryList;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { InputProps } from '../../utility/interfaces';
|
|
4
|
-
interface SwitchProps extends InputProps<boolean> {
|
|
5
|
-
extra?: string;
|
|
6
|
-
label: React.ReactNode | string;
|
|
7
|
-
isMultiline?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare function Switch({ extra, name, label, value, isDisabled, isMultiline, onChange, }: SwitchProps): React.ReactElement;
|
|
10
|
-
declare namespace Switch {
|
|
11
|
-
var propTypes: {
|
|
12
|
-
label: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
13
|
-
name: PropTypes.Validator<string>;
|
|
14
|
-
extra: PropTypes.Requireable<string>;
|
|
15
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
16
|
-
isMultiline: PropTypes.Requireable<boolean>;
|
|
17
|
-
value: PropTypes.Requireable<boolean>;
|
|
18
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export default Switch;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { InputProps } from '../../utility/interfaces';
|
|
4
|
+
interface SwitchProps extends InputProps<boolean> {
|
|
5
|
+
extra?: string;
|
|
6
|
+
label: React.ReactNode | string;
|
|
7
|
+
isMultiline?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function Switch({ extra, name, label, value, isDisabled, isMultiline, onChange, }: SwitchProps): React.ReactElement;
|
|
10
|
+
declare namespace Switch {
|
|
11
|
+
var propTypes: {
|
|
12
|
+
label: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
13
|
+
name: PropTypes.Validator<string>;
|
|
14
|
+
extra: PropTypes.Requireable<string>;
|
|
15
|
+
isDisabled: PropTypes.Requireable<boolean>;
|
|
16
|
+
isMultiline: PropTypes.Requireable<boolean>;
|
|
17
|
+
value: PropTypes.Requireable<boolean>;
|
|
18
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export default Switch;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import Assistive from '../../core/Assistive';
|
|
5
|
-
function Switch({ extra, name, label, value, isDisabled, isMultiline, onChange, }) {
|
|
6
|
-
const handleChange = (event) => {
|
|
7
|
-
if (onChange) {
|
|
8
|
-
const inputEvent = {
|
|
9
|
-
target: { name, value: event.target.checked },
|
|
10
|
-
};
|
|
11
|
-
onChange(inputEvent);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
return (React.createElement("label", { className: "/*clsx(\n styles.root,\n isDisabled && styles.rootIsDisabled,\n (isMultiline || extra) && styles.rootIsMultiline\n )*/", "data-testid": "switch-root" },
|
|
15
|
-
React.createElement("input", { "aria-checked": Boolean(value), checked: Boolean(value), className: "/*styles.input*/", disabled: isDisabled, id: name, name: name, onChange: handleChange, type: "checkbox", value: "1" }),
|
|
16
|
-
React.createElement("i", { className: "/*clsx(\n styles.icon,\n (isMultiline || extra) && styles.iconIsMultiline\n )*/", id: `${name}_icon` },
|
|
17
|
-
React.createElement(Assistive, null, "Yes")),
|
|
18
|
-
React.createElement("div", null,
|
|
19
|
-
React.createElement("span", { className: "/*clsx(styles.label, isDisabled && styles.labelIsDisabled)*/", "aria-hidden": true }, label),
|
|
20
|
-
extra ? React.createElement("small", { className: "/*styles.extra*/" }, extra) : null)));
|
|
21
|
-
}
|
|
22
|
-
Switch.propTypes = {
|
|
23
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
24
|
-
name: PropTypes.string.isRequired,
|
|
25
|
-
extra: PropTypes.string,
|
|
26
|
-
isDisabled: PropTypes.bool,
|
|
27
|
-
isMultiline: PropTypes.bool,
|
|
28
|
-
value: PropTypes.bool,
|
|
29
|
-
onChange: PropTypes.func,
|
|
30
|
-
};
|
|
31
|
-
export default Switch;
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Assistive from '../../core/Assistive';
|
|
5
|
+
function Switch({ extra, name, label, value, isDisabled, isMultiline, onChange, }) {
|
|
6
|
+
const handleChange = (event) => {
|
|
7
|
+
if (onChange) {
|
|
8
|
+
const inputEvent = {
|
|
9
|
+
target: { name, value: event.target.checked },
|
|
10
|
+
};
|
|
11
|
+
onChange(inputEvent);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement("label", { className: "/*clsx(\n styles.root,\n isDisabled && styles.rootIsDisabled,\n (isMultiline || extra) && styles.rootIsMultiline\n )*/", "data-testid": "switch-root" },
|
|
15
|
+
React.createElement("input", { "aria-checked": Boolean(value), checked: Boolean(value), className: "/*styles.input*/", disabled: isDisabled, id: name, name: name, onChange: handleChange, type: "checkbox", value: "1" }),
|
|
16
|
+
React.createElement("i", { className: "/*clsx(\n styles.icon,\n (isMultiline || extra) && styles.iconIsMultiline\n )*/", id: `${name}_icon` },
|
|
17
|
+
React.createElement(Assistive, null, "Yes")),
|
|
18
|
+
React.createElement("div", null,
|
|
19
|
+
React.createElement("span", { className: "/*clsx(styles.label, isDisabled && styles.labelIsDisabled)*/", "aria-hidden": true }, label),
|
|
20
|
+
extra ? React.createElement("small", { className: "/*styles.extra*/" }, extra) : null)));
|
|
21
|
+
}
|
|
22
|
+
Switch.propTypes = {
|
|
23
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
24
|
+
name: PropTypes.string.isRequired,
|
|
25
|
+
extra: PropTypes.string,
|
|
26
|
+
isDisabled: PropTypes.bool,
|
|
27
|
+
isMultiline: PropTypes.bool,
|
|
28
|
+
value: PropTypes.bool,
|
|
29
|
+
onChange: PropTypes.func,
|
|
30
|
+
};
|
|
31
|
+
export default Switch;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { EmptyMessageProps } from '../../core/EmptyMessage';
|
|
4
|
-
import type { Columns } from '../../core/TableCell';
|
|
5
|
-
import type { PaginationObject, SimpleObject, TransformerWithActions } from '../../utility/interfaces';
|
|
6
|
-
export interface TableProps<T extends SimpleObject> {
|
|
7
|
-
columns: Columns;
|
|
8
|
-
data?: T[];
|
|
9
|
-
empty?: EmptyMessageProps;
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
pagination?: PaginationObject;
|
|
12
|
-
totals?: Record<string, number> | null;
|
|
13
|
-
transformer?: TransformerWithActions<T>;
|
|
14
|
-
}
|
|
15
|
-
declare function Table<T extends SimpleObject>({ columns, data, empty, isDisabled, pagination, totals, transformer, }: TableProps<T>): React.ReactElement;
|
|
16
|
-
declare namespace Table {
|
|
17
|
-
var propTypes: {
|
|
18
|
-
columns: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
19
|
-
data: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{}>>[]>;
|
|
20
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
21
|
-
pagination: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
-
activePage: PropTypes.Validator<number>;
|
|
23
|
-
pageCount: PropTypes.Validator<number>;
|
|
24
|
-
}>>;
|
|
25
|
-
totals: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export default Table;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { EmptyMessageProps } from '../../core/EmptyMessage';
|
|
4
|
+
import type { Columns } from '../../core/TableCell';
|
|
5
|
+
import type { PaginationObject, SimpleObject, TransformerWithActions } from '../../utility/interfaces';
|
|
6
|
+
export interface TableProps<T extends SimpleObject> {
|
|
7
|
+
columns: Columns;
|
|
8
|
+
data?: T[];
|
|
9
|
+
empty?: EmptyMessageProps;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
pagination?: PaginationObject;
|
|
12
|
+
totals?: Record<string, number> | null;
|
|
13
|
+
transformer?: TransformerWithActions<T>;
|
|
14
|
+
}
|
|
15
|
+
declare function Table<T extends SimpleObject>({ columns, data, empty, isDisabled, pagination, totals, transformer, }: TableProps<T>): React.ReactElement;
|
|
16
|
+
declare namespace Table {
|
|
17
|
+
var propTypes: {
|
|
18
|
+
columns: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
19
|
+
data: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{}>>[]>;
|
|
20
|
+
isDisabled: PropTypes.Requireable<boolean>;
|
|
21
|
+
pagination: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
+
activePage: PropTypes.Validator<number>;
|
|
23
|
+
pageCount: PropTypes.Validator<number>;
|
|
24
|
+
}>>;
|
|
25
|
+
totals: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export default Table;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { spliceArray } from '@sqrzro/utility';
|
|
4
|
-
import EmptyMessage from '../../core/EmptyMessage';
|
|
5
|
-
import Pagination from '../../core/Pagination';
|
|
6
|
-
import Panel from '../../core/Panel';
|
|
7
|
-
import TableCell from '../../core/TableCell';
|
|
8
|
-
import TableHead from '../../core/TableHead';
|
|
9
|
-
import TableRow from '../../core/TableRow';
|
|
10
|
-
// Import styles from './Table.module.css';
|
|
11
|
-
const defaultTransformer = (item) => ({
|
|
12
|
-
...item,
|
|
13
|
-
$id: String(item.id),
|
|
14
|
-
$original: item,
|
|
15
|
-
});
|
|
16
|
-
const transformData = (data, transformer) => {
|
|
17
|
-
const [transformFn, actions] = Array.isArray(transformer)
|
|
18
|
-
? transformer
|
|
19
|
-
: [transformer || defaultTransformer];
|
|
20
|
-
return data.map((item) => ({ ...transformFn(item), $actions: actions, $original: item }));
|
|
21
|
-
};
|
|
22
|
-
const transformColumns = (columns) => Object.entries(columns).map(([key, item]) => ({
|
|
23
|
-
key,
|
|
24
|
-
title: Array.isArray(item) ? item[0] : item,
|
|
25
|
-
isRightAligned: Array.isArray(item) ? item[1] : false,
|
|
26
|
-
}));
|
|
27
|
-
function Table({ columns, data, empty, isDisabled, pagination, totals, transformer, }) {
|
|
28
|
-
if (!data?.length) {
|
|
29
|
-
return React.createElement(EmptyMessage, { ...empty });
|
|
30
|
-
}
|
|
31
|
-
const transformedColumns = transformColumns(columns);
|
|
32
|
-
const transformedData = transformData(data, transformer);
|
|
33
|
-
return (React.createElement(Fragment, null,
|
|
34
|
-
React.createElement(Panel, null,
|
|
35
|
-
React.createElement("div", { className: "/*styles.root*/" },
|
|
36
|
-
React.createElement("table", { className: "/*clsx(styles.table, isDisabled && styles.tableIsDisabled)*/" },
|
|
37
|
-
React.createElement(TableHead, { columns: transformedColumns, hasActions: Boolean(transformedData[0].$actions?.length) }),
|
|
38
|
-
React.createElement("tbody", null, transformedData.map((item) => (React.createElement(TableRow, { key: item.$id, columns: transformedColumns, data: item })))),
|
|
39
|
-
totals ? (React.createElement("tfoot", null,
|
|
40
|
-
React.createElement("tr", null,
|
|
41
|
-
React.createElement(TableCell, { value: "Totals:" }),
|
|
42
|
-
spliceArray(transformedColumns, 0, 1).map((item) => (React.createElement(TableCell, { key: item.key, isRightAligned: item.isRightAligned, value: totals[item.key].toString() })))))) : null))),
|
|
43
|
-
pagination ? React.createElement(Pagination, { isDisabled: isDisabled, ...pagination }) : null));
|
|
44
|
-
}
|
|
45
|
-
Table.propTypes = {
|
|
46
|
-
columns: PropTypes.shape({}).isRequired,
|
|
47
|
-
data: PropTypes.arrayOf(PropTypes.shape({}).isRequired),
|
|
48
|
-
isDisabled: PropTypes.bool,
|
|
49
|
-
pagination: PropTypes.shape({
|
|
50
|
-
activePage: PropTypes.number.isRequired,
|
|
51
|
-
pageCount: PropTypes.number.isRequired,
|
|
52
|
-
}),
|
|
53
|
-
totals: PropTypes.shape({}),
|
|
54
|
-
};
|
|
55
|
-
export default Table;
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { spliceArray } from '@sqrzro/utility';
|
|
4
|
+
import EmptyMessage from '../../core/EmptyMessage';
|
|
5
|
+
import Pagination from '../../core/Pagination';
|
|
6
|
+
import Panel from '../../core/Panel';
|
|
7
|
+
import TableCell from '../../core/TableCell';
|
|
8
|
+
import TableHead from '../../core/TableHead';
|
|
9
|
+
import TableRow from '../../core/TableRow';
|
|
10
|
+
// Import styles from './Table.module.css';
|
|
11
|
+
const defaultTransformer = (item) => ({
|
|
12
|
+
...item,
|
|
13
|
+
$id: String(item.id),
|
|
14
|
+
$original: item,
|
|
15
|
+
});
|
|
16
|
+
const transformData = (data, transformer) => {
|
|
17
|
+
const [transformFn, actions] = Array.isArray(transformer)
|
|
18
|
+
? transformer
|
|
19
|
+
: [transformer || defaultTransformer];
|
|
20
|
+
return data.map((item) => ({ ...transformFn(item), $actions: actions, $original: item }));
|
|
21
|
+
};
|
|
22
|
+
const transformColumns = (columns) => Object.entries(columns).map(([key, item]) => ({
|
|
23
|
+
key,
|
|
24
|
+
title: Array.isArray(item) ? item[0] : item,
|
|
25
|
+
isRightAligned: Array.isArray(item) ? item[1] : false,
|
|
26
|
+
}));
|
|
27
|
+
function Table({ columns, data, empty, isDisabled, pagination, totals, transformer, }) {
|
|
28
|
+
if (!data?.length) {
|
|
29
|
+
return React.createElement(EmptyMessage, { ...empty });
|
|
30
|
+
}
|
|
31
|
+
const transformedColumns = transformColumns(columns);
|
|
32
|
+
const transformedData = transformData(data, transformer);
|
|
33
|
+
return (React.createElement(Fragment, null,
|
|
34
|
+
React.createElement(Panel, null,
|
|
35
|
+
React.createElement("div", { className: "/*styles.root*/" },
|
|
36
|
+
React.createElement("table", { className: "/*clsx(styles.table, isDisabled && styles.tableIsDisabled)*/" },
|
|
37
|
+
React.createElement(TableHead, { columns: transformedColumns, hasActions: Boolean(transformedData[0].$actions?.length) }),
|
|
38
|
+
React.createElement("tbody", null, transformedData.map((item) => (React.createElement(TableRow, { key: item.$id, columns: transformedColumns, data: item })))),
|
|
39
|
+
totals ? (React.createElement("tfoot", null,
|
|
40
|
+
React.createElement("tr", null,
|
|
41
|
+
React.createElement(TableCell, { value: "Totals:" }),
|
|
42
|
+
spliceArray(transformedColumns, 0, 1).map((item) => (React.createElement(TableCell, { key: item.key, isRightAligned: item.isRightAligned, value: totals[item.key].toString() })))))) : null))),
|
|
43
|
+
pagination ? React.createElement(Pagination, { isDisabled: isDisabled, ...pagination }) : null));
|
|
44
|
+
}
|
|
45
|
+
Table.propTypes = {
|
|
46
|
+
columns: PropTypes.shape({}).isRequired,
|
|
47
|
+
data: PropTypes.arrayOf(PropTypes.shape({}).isRequired),
|
|
48
|
+
isDisabled: PropTypes.bool,
|
|
49
|
+
pagination: PropTypes.shape({
|
|
50
|
+
activePage: PropTypes.number.isRequired,
|
|
51
|
+
pageCount: PropTypes.number.isRequired,
|
|
52
|
+
}),
|
|
53
|
+
totals: PropTypes.shape({}),
|
|
54
|
+
};
|
|
55
|
+
export default Table;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { StyleVariant } from '../../utility/interfaces';
|
|
4
|
-
export interface TagProps {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
variant?: StyleVariant | StyleVariant[];
|
|
7
|
-
}
|
|
8
|
-
declare function Tag({ children, variant }: TagProps): React.ReactElement;
|
|
9
|
-
declare namespace Tag {
|
|
10
|
-
var propTypes: {
|
|
11
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
12
|
-
variant: PropTypes.Requireable<NonNullable<NonNullable<StyleVariant> | NonNullable<StyleVariant>[] | null | undefined>>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export default Tag;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { StyleVariant } from '../../utility/interfaces';
|
|
4
|
+
export interface TagProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
variant?: StyleVariant | StyleVariant[];
|
|
7
|
+
}
|
|
8
|
+
declare function Tag({ children, variant }: TagProps): React.ReactElement;
|
|
9
|
+
declare namespace Tag {
|
|
10
|
+
var propTypes: {
|
|
11
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
12
|
+
variant: PropTypes.Requireable<NonNullable<NonNullable<StyleVariant> | NonNullable<StyleVariant>[] | null | undefined>>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default Tag;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import useVariant from '../../hooks/useVariant';
|
|
4
|
-
import { StyleVariantPropType } from '../../utility/prop-types';
|
|
5
|
-
function Tag({ children, variant }) {
|
|
6
|
-
const { applyVariantClassName } = useVariant(variant);
|
|
7
|
-
return (React.createElement("div", { className: "/*clsx(styles.root, applyVariantClassName(styles))*/", "data-testid": "tag-root" }, children));
|
|
8
|
-
}
|
|
9
|
-
Tag.propTypes = {
|
|
10
|
-
children: PropTypes.node.isRequired,
|
|
11
|
-
variant: StyleVariantPropType,
|
|
12
|
-
};
|
|
13
|
-
export default Tag;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import useVariant from '../../hooks/useVariant';
|
|
4
|
+
import { StyleVariantPropType } from '../../utility/prop-types';
|
|
5
|
+
function Tag({ children, variant }) {
|
|
6
|
+
const { applyVariantClassName } = useVariant(variant);
|
|
7
|
+
return (React.createElement("div", { className: "/*clsx(styles.root, applyVariantClassName(styles))*/", "data-testid": "tag-root" }, children));
|
|
8
|
+
}
|
|
9
|
+
Tag.propTypes = {
|
|
10
|
+
children: PropTypes.node.isRequired,
|
|
11
|
+
variant: StyleVariantPropType,
|
|
12
|
+
};
|
|
13
|
+
export default Tag;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { TextInputProps } from '
|
|
4
|
-
declare function TextArea({ name, placeholder, value, hasError, isDisabled, onChange, onKeyDown, }: TextInputProps): React.ReactElement;
|
|
5
|
-
declare namespace TextArea {
|
|
6
|
-
var propTypes: {
|
|
7
|
-
/** The name of the field. An ID is also generated from this (`c_${name}`). */
|
|
8
|
-
name: PropTypes.Validator<string>;
|
|
9
|
-
/** If set to trute, the `TextArea` will be styled to indicate this */
|
|
10
|
-
hasError: PropTypes.Requireable<boolean>;
|
|
11
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
12
|
-
placeholder: PropTypes.Requireable<string>;
|
|
13
|
-
value: PropTypes.Requireable<string>;
|
|
14
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
-
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export default TextArea;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import type { TextInputProps } from '../../components/TextInput';
|
|
4
|
+
declare function TextArea({ name, placeholder, value, hasError, isDisabled, onChange, onKeyDown, }: TextInputProps): React.ReactElement;
|
|
5
|
+
declare namespace TextArea {
|
|
6
|
+
var propTypes: {
|
|
7
|
+
/** The name of the field. An ID is also generated from this (`c_${name}`). */
|
|
8
|
+
name: PropTypes.Validator<string>;
|
|
9
|
+
/** If set to trute, the `TextArea` will be styled to indicate this */
|
|
10
|
+
hasError: PropTypes.Requireable<boolean>;
|
|
11
|
+
isDisabled: PropTypes.Requireable<boolean>;
|
|
12
|
+
placeholder: PropTypes.Requireable<string>;
|
|
13
|
+
value: PropTypes.Requireable<string>;
|
|
14
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export default TextArea;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
// Import styles from './TextArea.module.css';
|
|
5
|
-
function TextArea({ name, placeholder, value, hasError, isDisabled, onChange, onKeyDown, }) {
|
|
6
|
-
const handleChange = (event) => {
|
|
7
|
-
const target = event.target;
|
|
8
|
-
const simpleEvent = { target: { name, value: target.value } };
|
|
9
|
-
if (onChange) {
|
|
10
|
-
onChange(simpleEvent);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
return (React.createElement("textarea", { className: "/*clsx(\n styles.root,\n hasError && styles.rootHasError,\n isDisabled && styles.rootIsDisabled\n )*/", disabled: isDisabled, id: `c_${name}`, name: name, onChange: handleChange, onKeyDown: onKeyDown, placeholder: placeholder, rows: 6, value: value?.toString() }));
|
|
14
|
-
}
|
|
15
|
-
TextArea.propTypes = {
|
|
16
|
-
/** The name of the field. An ID is also generated from this (`c_${name}`). */
|
|
17
|
-
name: PropTypes.string.isRequired,
|
|
18
|
-
/** If set to trute, the `TextArea` will be styled to indicate this */
|
|
19
|
-
hasError: PropTypes.bool,
|
|
20
|
-
isDisabled: PropTypes.bool,
|
|
21
|
-
placeholder: PropTypes.string,
|
|
22
|
-
value: PropTypes.string,
|
|
23
|
-
onChange: PropTypes.func,
|
|
24
|
-
onKeyDown: PropTypes.func,
|
|
25
|
-
};
|
|
26
|
-
export default TextArea;
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
// Import styles from './TextArea.module.css';
|
|
5
|
+
function TextArea({ name, placeholder, value, hasError, isDisabled, onChange, onKeyDown, }) {
|
|
6
|
+
const handleChange = (event) => {
|
|
7
|
+
const target = event.target;
|
|
8
|
+
const simpleEvent = { target: { name, value: target.value } };
|
|
9
|
+
if (onChange) {
|
|
10
|
+
onChange(simpleEvent);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return (React.createElement("textarea", { className: "/*clsx(\n styles.root,\n hasError && styles.rootHasError,\n isDisabled && styles.rootIsDisabled\n )*/", disabled: isDisabled, id: `c_${name}`, name: name, onChange: handleChange, onKeyDown: onKeyDown, placeholder: placeholder, rows: 6, value: value?.toString() }));
|
|
14
|
+
}
|
|
15
|
+
TextArea.propTypes = {
|
|
16
|
+
/** The name of the field. An ID is also generated from this (`c_${name}`). */
|
|
17
|
+
name: PropTypes.string.isRequired,
|
|
18
|
+
/** If set to trute, the `TextArea` will be styled to indicate this */
|
|
19
|
+
hasError: PropTypes.bool,
|
|
20
|
+
isDisabled: PropTypes.bool,
|
|
21
|
+
placeholder: PropTypes.string,
|
|
22
|
+
value: PropTypes.string,
|
|
23
|
+
onChange: PropTypes.func,
|
|
24
|
+
onKeyDown: PropTypes.func,
|
|
25
|
+
};
|
|
26
|
+
export default TextArea;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export interface TextInputProps extends InputProps<string, string, HTMLInputElement | HTMLTextAreaElement> {
|
|
4
|
-
isAutocomplete?: boolean;
|
|
5
|
-
isClearable?: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
onClear?:
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
prefix?: string | null;
|
|
10
|
-
suffix?: string | null;
|
|
11
|
-
type?: string;
|
|
12
|
-
}
|
|
13
|
-
declare function TextInput({ hasError, id, isAutocomplete, isAutoFocus, isClearable, isDisabled, isLoading, name, onChange, onClear, onKeyDown, placeholder, prefix, suffix, value, type, }: TextInputProps): React.ReactElement;
|
|
14
|
-
export default TextInput;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputEvent, InputProps } from '../../utility/interfaces';
|
|
3
|
+
export interface TextInputProps extends InputProps<string, string, HTMLInputElement | HTMLTextAreaElement> {
|
|
4
|
+
isAutocomplete?: boolean;
|
|
5
|
+
isClearable?: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
onClear?: (event: InputEvent) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
prefix?: string | null;
|
|
10
|
+
suffix?: string | null;
|
|
11
|
+
type?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function TextInput({ hasError, id, isAutocomplete, isAutoFocus, isClearable, isDisabled, isLoading, name, onChange, onClear, onKeyDown, placeholder, prefix, suffix, value, type, }: TextInputProps): React.ReactElement;
|
|
14
|
+
export default TextInput;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import TextInputAncillary from '../../core/TextInputAncillary';
|
|
4
|
-
function TextInput({ hasError, id, isAutocomplete, isAutoFocus, isClearable, isDisabled, isLoading, name, onChange, onClear, onKeyDown, placeholder, prefix, suffix, value, type, }) {
|
|
5
|
-
const handleChange = (event) => {
|
|
6
|
-
if (onChange) {
|
|
7
|
-
const target = { name, value: event.target.value };
|
|
8
|
-
onChange({ target });
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const handleClear = () => {
|
|
12
|
-
const target = { name, value: '' };
|
|
13
|
-
if (onClear) {
|
|
14
|
-
onClear({ target });
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (onChange) {
|
|
18
|
-
onChange({ target });
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return (React.createElement("div", { className: "/*clsx(\n styles.root,\n prefix && styles.rootHasPrefix,\n ((!prefix && suffix) || (isClearable && value)) && styles.rootHasSuffix,\n isDisabled && styles.rootIsDisabled\n )*/", "data-testid": "text-input-root" },
|
|
22
|
-
React.createElement("input", { autoComplete: isAutocomplete === false
|
|
23
|
-
? 'off'
|
|
24
|
-
: undefined /* eslint-disable-line no-undefined */, autoFocus: isAutoFocus, className: "
|
|
25
|
-
React.createElement(TextInputAncillary, { hasError: hasError, isClearable: isClearable, isLoading: isLoading, onClear: handleClear, prefix: prefix, suffix: suffix, value: value || '' })));
|
|
26
|
-
}
|
|
27
|
-
export default TextInput;
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import TextInputAncillary from '../../core/TextInputAncillary';
|
|
4
|
+
function TextInput({ hasError, id, isAutocomplete, isAutoFocus, isClearable, isDisabled, isLoading, name, onChange, onClear, onKeyDown, placeholder, prefix, suffix, value, type, }) {
|
|
5
|
+
const handleChange = (event) => {
|
|
6
|
+
if (onChange) {
|
|
7
|
+
const target = { name, value: event.target.value };
|
|
8
|
+
onChange({ target });
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const handleClear = () => {
|
|
12
|
+
const target = { name, value: '' };
|
|
13
|
+
if (onClear) {
|
|
14
|
+
onClear({ target });
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (onChange) {
|
|
18
|
+
onChange({ target });
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (React.createElement("div", { className: "/*clsx(\n styles.root,\n prefix && styles.rootHasPrefix,\n ((!prefix && suffix) || (isClearable && value)) && styles.rootHasSuffix,\n isDisabled && styles.rootIsDisabled\n )*/", "data-testid": "text-input-root" },
|
|
22
|
+
React.createElement("input", { autoComplete: isAutocomplete === false
|
|
23
|
+
? 'off'
|
|
24
|
+
: undefined /* eslint-disable-line no-undefined */, autoFocus: isAutoFocus, className: "/*clsx(\n styles.input,\n hasError && styles.inputHasError,\n prefix && styles.inputHasPrefix,\n ((!prefix && suffix) || (isClearable && value)) && styles.inputHasSuffix\n )*/", disabled: isDisabled, id: id || name, name: name, onChange: handleChange, onKeyDown: onKeyDown, placeholder: placeholder, type: type, value: value || '' }),
|
|
25
|
+
React.createElement(TextInputAncillary, { hasError: hasError, isClearable: isClearable, isLoading: isLoading, onClear: handleClear, prefix: prefix, suffix: suffix, value: value || '' })));
|
|
26
|
+
}
|
|
27
|
+
export default TextInput;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { TextInputProps } from '
|
|
3
|
-
/**
|
|
4
|
-
* A `TextInput` component with a pre-defined `prefix` prop set to a 'http://'. All other props are
|
|
5
|
-
* simply passed through to the TextInput. Technically, the order of the props is such that the
|
|
6
|
-
* prefix can be overridden or removed all together. If this is the case, the component is no
|
|
7
|
-
* different to a `TextInput`.
|
|
8
|
-
*/
|
|
9
|
-
declare function WebsiteInput(props: TextInputProps): React.ReactElement;
|
|
10
|
-
export default WebsiteInput;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextInputProps } from '../../components/TextInput';
|
|
3
|
+
/**
|
|
4
|
+
* A `TextInput` component with a pre-defined `prefix` prop set to a 'http://'. All other props are
|
|
5
|
+
* simply passed through to the TextInput. Technically, the order of the props is such that the
|
|
6
|
+
* prefix can be overridden or removed all together. If this is the case, the component is no
|
|
7
|
+
* different to a `TextInput`.
|
|
8
|
+
*/
|
|
9
|
+
declare function WebsiteInput(props: TextInputProps): React.ReactElement;
|
|
10
|
+
export default WebsiteInput;
|