@skedulo/sked-ui 0.0.0-preview-react-18
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/README.md +107 -0
- package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.d.ts +39 -0
- package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.stories.d.ts +1 -0
- package/dist/components/avatar/Avatar.d.ts +46 -0
- package/dist/components/avatar/Avatar.stories.d.ts +1 -0
- package/dist/components/avatar/AvatarDetail.d.ts +18 -0
- package/dist/components/avatar/AvatarGroup.d.ts +27 -0
- package/dist/components/avatar/Slot.d.ts +42 -0
- package/dist/components/avatar/__tests__/Avatar.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/AvatarDetail.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/GroupAvatars.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/Slot.spec.d.ts +1 -0
- package/dist/components/badge/Badge.d.ts +18 -0
- package/dist/components/badge/Badge.stories.d.ts +17 -0
- package/dist/components/badge/__tests__/Badge.spec.d.ts +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +6 -0
- package/dist/components/button-group/ButtonGroup.stories.d.ts +1 -0
- package/dist/components/button-group/__tests__/ButtonGroup.spec.d.ts +1 -0
- package/dist/components/buttons/Buttons.stories.d.ts +1 -0
- package/dist/components/buttons/button/Button.d.ts +60 -0
- package/dist/components/buttons/button/__tests__/Button.spec.d.ts +1 -0
- package/dist/components/buttons/button-dropdown/ButtonDropdown.d.ts +14 -0
- package/dist/components/buttons/button-dropdown/__tests__/ButtonDropdown.spec.d.ts +1 -0
- package/dist/components/buttons/icon-button/IconButton.d.ts +13 -0
- package/dist/components/buttons/icon-button/__tests__/IconButton.spec.d.ts +1 -0
- package/dist/components/buttons/icon-button-dropdown/IconButtonDropdown.d.ts +5 -0
- package/dist/components/buttons/icon-button-dropdown/__tests__/IconButtonDropdown.spec.d.ts +1 -0
- package/dist/components/buttons/interfaces.d.ts +10 -0
- package/dist/components/calendar-controls/CalendarControls-utils.d.ts +7 -0
- package/dist/components/calendar-controls/CalendarControls.d.ts +30 -0
- package/dist/components/calendar-controls/CalendarControls.stories.d.ts +1 -0
- package/dist/components/calendar-controls/elements/DateSelector.d.ts +47 -0
- package/dist/components/calendar-controls/elements/NavigationButtons.d.ts +6 -0
- package/dist/components/calendar-controls/elements/RangePicker.d.ts +21 -0
- package/dist/components/calendar-controls/elements/TodayButton.d.ts +5 -0
- package/dist/components/datepicker/DateTime.d.ts +51 -0
- package/dist/components/datepicker/DateTime.stories.d.ts +1 -0
- package/dist/components/datepicker/Datepicker.d.ts +125 -0
- package/dist/components/datepicker/Datepicker.stories.d.ts +1 -0
- package/dist/components/datepicker/Time.d.ts +43 -0
- package/dist/components/datepicker/Time.stories.d.ts +1 -0
- package/dist/components/datepicker/__tests__/DateTime.spec.d.ts +1 -0
- package/dist/components/datepicker/__tests__/Datepicker.spec.d.ts +1 -0
- package/dist/components/datepicker/__tests__/Time.spec.d.ts +1 -0
- package/dist/components/dynamic-table/DynamicTable-utils.d.ts +45 -0
- package/dist/components/dynamic-table/DynamicTable.d.ts +79 -0
- package/dist/components/dynamic-table/DynamicTable.stories.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-renders.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-test-utils.d.ts +3 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-utils.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/__mocks__/table-data.d.ts +16 -0
- package/dist/components/dynamic-table/interfaces.d.ts +52 -0
- package/dist/components/emptystate/EmptyState.d.ts +9 -0
- package/dist/components/emptystate/EmptyState.spec.d.ts +1 -0
- package/dist/components/emptystate/EmptyState.stories.d.ts +1 -0
- package/dist/components/filter-bar/FilterBar.d.ts +54 -0
- package/dist/components/filter-bar/FilterBar.stories.d.ts +1 -0
- package/dist/components/filter-bar/__tests__/FilterBar.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/FilterList.d.ts +10 -0
- package/dist/components/filter-bar/filter-list/FilterListWithApply.d.ts +24 -0
- package/dist/components/filter-bar/filter-list/FilterSearch.d.ts +21 -0
- package/dist/components/filter-bar/filter-list/RemoteSearch.d.ts +25 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterList.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterListWithApply.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterSearch.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/RemoteSearch.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-pill/FilterPill.d.ts +23 -0
- package/dist/components/filter-bar/filter-pill/__tests__/FilterPill.spec.d.ts +1 -0
- package/dist/components/filter-bar/interfaces.d.ts +43 -0
- package/dist/components/forms/Forms.stories.d.ts +1 -0
- package/dist/components/forms/ReadOnly.d.ts +11 -0
- package/dist/components/forms/SkedFormValidation.d.ts +98 -0
- package/dist/components/forms/SkedFormValidation.spec.d.ts +1 -0
- package/dist/components/forms/__tests__/ReadOnly.spec.d.ts +1 -0
- package/dist/components/forms/elements/AsyncMultiSearchSelect.d.ts +3 -0
- package/dist/components/forms/elements/AsyncSearchSelect.d.ts +6 -0
- package/dist/components/forms/elements/AsyncSelectSearch.stories.d.ts +1 -0
- package/dist/components/forms/elements/FormElements.d.ts +54 -0
- package/dist/components/forms/elements/MultiSearchSelect.d.ts +3 -0
- package/dist/components/forms/elements/MultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/NumberInput.d.ts +17 -0
- package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.d.ts +8 -0
- package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/PlainMultiSearchSelect.d.ts +24 -0
- package/dist/components/forms/elements/PlainMultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/SearchSelect.d.ts +6 -0
- package/dist/components/forms/elements/SearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/TextArea.d.ts +25 -0
- package/dist/components/forms/elements/TextArea.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/AsyncMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/AsyncSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/FormElements.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/MultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/NumberInput.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/PlainAsyncMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/PlainMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/SearchSelect-renders.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/SearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/__mocks__/searchData.d.ts +11 -0
- package/dist/components/forms/elements/interfaces.d.ts +105 -0
- package/dist/components/forms/elements/select-components.d.ts +38 -0
- package/dist/components/forms/elements/select-hooks.d.ts +38 -0
- package/dist/components/forms/elements/select-utils.d.ts +22 -0
- package/dist/components/icon/Icon.d.ts +26 -0
- package/dist/components/icon/Icon.spec.d.ts +1 -0
- package/dist/components/icon/Icon.stories.d.ts +1 -0
- package/dist/components/icon/iconPaths.d.ts +131 -0
- package/dist/components/info-card/InfoCard.d.ts +5 -0
- package/dist/components/info-card/InfoCard.stories.d.ts +1 -0
- package/dist/components/info-card/InfoCardBody.d.ts +13 -0
- package/dist/components/info-card/InfoCardFooter.d.ts +2 -0
- package/dist/components/info-card/InfoCardHeader.d.ts +11 -0
- package/dist/components/info-card/index.d.ts +4 -0
- package/dist/components/inline-banner/InlineBanner.d.ts +9 -0
- package/dist/components/inline-banner/InlineBanner.spec.d.ts +1 -0
- package/dist/components/inline-banner/InlineBanner.stories.d.ts +1 -0
- package/dist/components/link/Link.d.ts +5 -0
- package/dist/components/link/Link.spec.d.ts +1 -0
- package/dist/components/link/Link.stories.d.ts +17 -0
- package/dist/components/loader/Loading.d.ts +16 -0
- package/dist/components/loader/Loading.stories.d.ts +1 -0
- package/dist/components/loader/__tests__/Loading.spec.d.ts +1 -0
- package/dist/components/loader/spinner/LoadingSpinner.d.ts +21 -0
- package/dist/components/lozenge/CustomLozenge.d.ts +21 -0
- package/dist/components/lozenge/Lozenge.d.ts +22 -0
- package/dist/components/lozenge/Lozenge.stories.d.ts +1 -0
- package/dist/components/lozenge/__tests__/Lozenge.spec.d.ts +1 -0
- package/dist/components/menus/Menus.stories.d.ts +1 -0
- package/dist/components/menus/actionmenu/ActionMenu.d.ts +13 -0
- package/dist/components/menus/cardactionmenu/CardActionMenu.d.ts +10 -0
- package/dist/components/menus/index.d.ts +2 -0
- package/dist/components/menus/menu/Menu.d.ts +18 -0
- package/dist/components/modals/Modal.spec.d.ts +1 -0
- package/dist/components/modals/Modal.stories.d.ts +1 -0
- package/dist/components/modals/Modals.d.ts +33 -0
- package/dist/components/pagination/Pagination-utils.d.ts +1 -0
- package/dist/components/pagination/Pagination-utils.spec.d.ts +1 -0
- package/dist/components/pagination/Pagination.d.ts +3 -0
- package/dist/components/pagination/Pagination.spec.d.ts +1 -0
- package/dist/components/pagination/Pagination.stories.d.ts +1 -0
- package/dist/components/pagination/PaginationCount/PaginationCount.d.ts +3 -0
- package/dist/components/pagination/PaginationCount/PaginationCount.spec.d.ts +1 -0
- package/dist/components/pagination/PaginationPages/PaginationPages.d.ts +14 -0
- package/dist/components/pagination/PaginationPages/PaginationPages.spec.d.ts +1 -0
- package/dist/components/pagination/interfaces.d.ts +18 -0
- package/dist/components/pill/Pill.d.ts +25 -0
- package/dist/components/pill/Pill.spec.d.ts +1 -0
- package/dist/components/pill/Pill.stories.d.ts +1 -0
- package/dist/components/popout/PopOut.d.ts +61 -0
- package/dist/components/popout/PopOut.stories.d.ts +1 -0
- package/dist/components/popout/PopOutBase.d.ts +39 -0
- package/dist/components/popout/useClickAway.d.ts +2 -0
- package/dist/components/popout/usePopOut.d.ts +9 -0
- package/dist/components/popups/info-window/InfoWindow.d.ts +45 -0
- package/dist/components/popups/info-window/InfoWindow.spec.d.ts +1 -0
- package/dist/components/popups/info-window/InfoWindow.stories.d.ts +1 -0
- package/dist/components/popups/info-window/InfoWindowOld.d.ts +160 -0
- package/dist/components/popups/info-window/InfoWindowPopOut.d.ts +84 -0
- package/dist/components/popups/info-window/LegacyInfoWindow.d.ts +159 -0
- package/dist/components/popups/info-window/PortalWrapper.d.ts +6 -0
- package/dist/components/popups/info-window/info-window-utils.d.ts +43 -0
- package/dist/components/popups/info-window/info-window-utils.spec.d.ts +1 -0
- package/dist/components/popups/info-window/useClickAway.d.ts +25 -0
- package/dist/components/popups/info-window/useInfoWindowModifiers.d.ts +2 -0
- package/dist/components/popups/overflow-tooltip/OverflowTooltip.d.ts +30 -0
- package/dist/components/popups/tooltip/LegacyInfoWindow.d.ts +154 -0
- package/dist/components/popups/tooltip/Tooltip.d.ts +21 -0
- package/dist/components/popups/tooltip/Tooltip.spec.d.ts +1 -0
- package/dist/components/popups/tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/popups/tooltip/info-window-utils.d.ts +43 -0
- package/dist/components/popups/tooltip/info-window-utils.spec.d.ts +1 -0
- package/dist/components/portal/Portal.d.ts +22 -0
- package/dist/components/search-box/SearchBox.d.ts +9 -0
- package/dist/components/search-box/SearchBox.spec.d.ts +1 -0
- package/dist/components/status-icon/StatusIcon.d.ts +11 -0
- package/dist/components/status-icon/StatusIcon.spec.d.ts +1 -0
- package/dist/components/status-icon/StatusIcon.stories.d.ts +1 -0
- package/dist/components/table/Table.d.ts +16 -0
- package/dist/components/table/Table.spec.d.ts +1 -0
- package/dist/components/table/Table.stories.d.ts +1 -0
- package/dist/components/tabs/Tabs/Tabs.d.ts +36 -0
- package/dist/components/tabs/Tabs/TabsMenuItem.d.ts +22 -0
- package/dist/components/tabs/Tabs/TabsRoutingUtils.d.ts +28 -0
- package/dist/components/tabs/Tabs/__tests__/Tabs.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/__tests__/TabsMenuItem.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/__tests__/TabsRoutingUtils.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/interfaces.d.ts +64 -0
- package/dist/components/tabs/Tabs.stories.d.ts +1 -0
- package/dist/components/text/MultilineContent.d.ts +6 -0
- package/dist/components/text/MultilineContent.spec.d.ts +1 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +66690 -0
- package/dist/utils/Option.d.ts +58 -0
- package/dist/utils/Option.spec.d.ts +1 -0
- package/dist/utils/Route.d.ts +4 -0
- package/dist/utils/Strings.d.ts +1 -0
- package/dist/utils/Types.d.ts +6 -0
- package/dist/utils/__tests__/Route.spec.d.ts +1 -0
- package/dist/utils/testing-utils.d.ts +7 -0
- package/package.json +179 -0
- package/yarn.lock +17865 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
value: string;
|
|
4
|
+
name: string;
|
|
5
|
+
locked?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
placeholderValue?: string;
|
|
8
|
+
maxContentLength?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const ReadOnly: React.SFC<IProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FormContext, FormProps, ValidationContext, Transforms, FieldsConfig, CustomValidatorFunction, ValueValidatorConfig } from 'calidation';
|
|
3
|
+
export { Dirty, Errors, Fields, Transform, Transforms, FieldsConfig, Validator, FormContext, CustomValidatorFunction, SimpleValidator, SimpleValidatorConfig, FieldConfig, ValueValidatorConfig, ValueValidator, ValidatorContext } from 'calidation';
|
|
4
|
+
export declare type FormSubmission<T extends object> = FormContext<T>;
|
|
5
|
+
export declare type FormConfig<T extends object> = FieldsConfig<T>;
|
|
6
|
+
export declare type CustomValueValidatorFunction<T extends object, P = any> = (config: ValueValidatorConfig<P, T>) => (value: P) => string | null;
|
|
7
|
+
interface IBehaviourOptions {
|
|
8
|
+
clickToEdit: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare type SkedFormChildren<T extends object> = Omit<ValidationContext<T>, 'dirty'> & {
|
|
11
|
+
isFormReadonly: boolean;
|
|
12
|
+
fieldsModified: Set<keyof T>;
|
|
13
|
+
setFormReadonly: (event?: React.FormEvent<HTMLElement>) => void;
|
|
14
|
+
resetFieldsToInitialValues: () => void;
|
|
15
|
+
customFieldUpdate: <K extends keyof T>(fieldName: K, runOnUpdate?: (fields: T) => T) => (value: T[K]) => void;
|
|
16
|
+
isValidOnSubmit: (fieldName: keyof T) => {
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
isValidAfterModified: (fieldName: keyof T) => {
|
|
21
|
+
isValid: boolean;
|
|
22
|
+
error: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export interface SkedFormValidationProps<T extends object> {
|
|
26
|
+
/**
|
|
27
|
+
* The configuraton object for the fields in your form.
|
|
28
|
+
* It should include all your fields and any validations
|
|
29
|
+
* associated with them.
|
|
30
|
+
*
|
|
31
|
+
* Eg:
|
|
32
|
+
*
|
|
33
|
+
* const config = {
|
|
34
|
+
* name: {
|
|
35
|
+
* isRequired: 'Name must be provided
|
|
36
|
+
* },
|
|
37
|
+
* address: {},
|
|
38
|
+
* age: {
|
|
39
|
+
* isRequired: 'Age must be provided',
|
|
40
|
+
* isGreaterThan: {
|
|
41
|
+
* message: 'You must be at least 18 to use this site',
|
|
42
|
+
* value: 17
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
config: FieldsConfig<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Any starting values for fields defined in the config
|
|
50
|
+
*/
|
|
51
|
+
initialValues?: T;
|
|
52
|
+
onSubmit: FormProps<T>['onSubmit'];
|
|
53
|
+
children: (args: SkedFormChildren<T>) => JSX.Element;
|
|
54
|
+
options?: IBehaviourOptions;
|
|
55
|
+
/**
|
|
56
|
+
* Define any custom validations that aren't available in
|
|
57
|
+
* calidation here
|
|
58
|
+
*/
|
|
59
|
+
customValidators?: Record<string, CustomValidatorFunction<T> | CustomValueValidatorFunction<T>>;
|
|
60
|
+
/**
|
|
61
|
+
* Transform a value before it is saved to form state.
|
|
62
|
+
*/
|
|
63
|
+
transforms?: Transforms<T>;
|
|
64
|
+
}
|
|
65
|
+
export interface SkedFormValidationState<T> {
|
|
66
|
+
fieldsModified: Set<keyof T>;
|
|
67
|
+
isFormReadonly: boolean;
|
|
68
|
+
initialValues: T;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* This component is just a wrapper for FormValidation that extends the functionality
|
|
72
|
+
* of the calidation library for our project, such as providing custom functions that allow us to update the form state
|
|
73
|
+
* from widgets.
|
|
74
|
+
*/
|
|
75
|
+
export declare class SkedFormValidation<T extends object> extends React.PureComponent<SkedFormValidationProps<T>, SkedFormValidationState<T>> {
|
|
76
|
+
private _form;
|
|
77
|
+
static defaultProps: {
|
|
78
|
+
options: {
|
|
79
|
+
clickToEdit: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
constructor(props: SkedFormValidationProps<T>);
|
|
83
|
+
componentDidUpdate(prevProps: SkedFormValidationProps<T>): void;
|
|
84
|
+
onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
85
|
+
setModifiedField: (fieldName: keyof T) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Used for widget updates that don't emit an onChange event (Autocomplete list selection
|
|
88
|
+
* for instance - input has onchange and will bubble up, needs a way of adding name)
|
|
89
|
+
*/
|
|
90
|
+
customFormFieldUpdate: (setField: SkedFormChildren<T>['setField'], fields: T, setModified?: (name: keyof T) => void) => (fieldName: keyof T, runOnUpdate?: (fields: T) => T) => (value: any) => void;
|
|
91
|
+
wrapInValidatorProvider: (customValidators: SkedFormValidationProps<T>['customValidators']) => JSX.Element;
|
|
92
|
+
handleClick: (evt: React.FormEvent<HTMLElement>) => void;
|
|
93
|
+
handleFormSubmit: (formData: FormContext<T>) => Promise<void>;
|
|
94
|
+
setFormReadonly: (event?: React.FormEvent<HTMLElement>) => void;
|
|
95
|
+
resetFieldsToInitialValues: () => void;
|
|
96
|
+
renderFormValidation: () => JSX.Element;
|
|
97
|
+
render(): JSX.Element;
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISelectItem, AsyncMultiSearchSelectBox } from './interfaces';
|
|
3
|
+
export declare const AsyncMultiSearchSelect: <T extends ISelectItem<any>>({ fetchItems, debounceTime, fetchStrategy, useCache, minChars, onSelectedItemsChange, disabled, ...rest }: AsyncMultiSearchSelectBox<T>) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISelectItem, AsyncSelectBox } from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Asynchronous version of SearchSelect for use with remote fetching
|
|
5
|
+
*/
|
|
6
|
+
export declare const AsyncSearchSelect: <T extends ISelectItem<any>>({ fetchItems, debounceTime, fetchStrategy, useCache, minChars, icon, id, name, placeholder, autoFocus, className, onSelectedItemChange, disabled, itemToString, ItemRenderer, ...rest }: AsyncSelectBox<T>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface InputFormValidationProps {
|
|
3
|
+
inlineLabel?: string | JSX.Element;
|
|
4
|
+
inlineLabelStatus?: LabelStatus;
|
|
5
|
+
inlineLabelClassName?: string;
|
|
6
|
+
inputAndInlineLabelWrapperClassName?: string;
|
|
7
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
8
|
+
}
|
|
9
|
+
declare type InputSize = 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'full';
|
|
10
|
+
interface FormElementWrapperProps {
|
|
11
|
+
readOnlyValue?: string;
|
|
12
|
+
isReadOnly?: boolean;
|
|
13
|
+
readOnlyPlaceholder?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
locked?: boolean;
|
|
16
|
+
size?: InputSize;
|
|
17
|
+
}
|
|
18
|
+
export interface ValidationProps {
|
|
19
|
+
validation?: {
|
|
20
|
+
isValid?: boolean;
|
|
21
|
+
error?: string | null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare type FormElementProps = InputFormValidationProps & React.InputHTMLAttributes<HTMLInputElement>;
|
|
25
|
+
/**
|
|
26
|
+
* Standard form inputs should be created using FormElement. It is responsible for creating the type of input you need as well as
|
|
27
|
+
* displaying validation errors. Radio’s and Checkboxes can utilise the inlineLabel prop to show a label inline with the input.
|
|
28
|
+
* The id of the input will be used as the ‘for’ attribute on the label for accessibility.
|
|
29
|
+
*/
|
|
30
|
+
export declare class FormInputElement extends React.PureComponent<FormElementProps, {}> {
|
|
31
|
+
private _inputClassNames;
|
|
32
|
+
isOfTextType: () => boolean;
|
|
33
|
+
withInlineLabel: (inputComponent: React.ReactElement, props: FormElementProps) => JSX.Element;
|
|
34
|
+
render(): JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
declare type LabelStatus = 'required' | 'optional';
|
|
37
|
+
/**
|
|
38
|
+
* Will render a form label and apply ‘required’ styling if required
|
|
39
|
+
*/
|
|
40
|
+
export declare const FormLabel: React.FunctionComponent<{
|
|
41
|
+
status?: LabelStatus;
|
|
42
|
+
inline?: boolean;
|
|
43
|
+
} & React.LabelHTMLAttributes<HTMLLabelElement>>;
|
|
44
|
+
/**
|
|
45
|
+
* FormElementWrapper should be used to wrap custom input components (such as Autocomplete). It will ensure that errors
|
|
46
|
+
* are displayed in a consistent fashion. The resulting input will need to have the class form-element__outline applied
|
|
47
|
+
* to it for us to hook into it to apply appropriate styling.
|
|
48
|
+
*/
|
|
49
|
+
export declare const FormElementWrapper: React.SFC<FormElementWrapperProps & ValidationProps & React.HTMLAttributes<HTMLDivElement>>;
|
|
50
|
+
/**
|
|
51
|
+
* Use when a validation error isn’t tied to a particular field
|
|
52
|
+
*/
|
|
53
|
+
export declare const FormValidationCallout: React.FunctionComponent<ValidationProps & React.HTMLAttributes<HTMLDivElement>>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISelectItem, MultiSearchSelectBox } from './interfaces';
|
|
3
|
+
export declare const MultiSearchSelect: <T extends ISelectItem<any>>({ initialSelectedItems, items, id, name, placeholder, autoFocus, className, onSelectedItemsChange, disabled, loading, itemToString, ItemRenderer, MenuItemsRenderer, selectAll, onInputValueChange, onMenuToggle, getKey, ...rest }: MultiSearchSelectBox<T>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* NumberInput is a HTML5 number input underneath with the added benefit of
|
|
4
|
+
* handling precision in float numbers.
|
|
5
|
+
* When using with SkedFormValidation, use the validators to set min and max
|
|
6
|
+
* For convenience for users who aren't using a form library, you can pass
|
|
7
|
+
* through these values and it will behave native to the browser (tool tip for
|
|
8
|
+
* invalid data before submit, message on submit)
|
|
9
|
+
*/
|
|
10
|
+
interface INumberInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
11
|
+
value: number | string;
|
|
12
|
+
onValueChange: (value: number | string) => void;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
precision?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const NumberInput: React.FunctionComponent<INumberInputProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ISelectItem } from './interfaces';
|
|
3
|
+
export interface IPlainAsyncMultiSearchSelectProps {
|
|
4
|
+
initialSelectedItems?: ISelectItem[];
|
|
5
|
+
fetchItems: (searchTerm: string) => Promise<ISelectItem[]>;
|
|
6
|
+
onSelectedItemsChange: (items: ISelectItem[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const PlainAsyncMultiSearchSelect: React.FC<IPlainAsyncMultiSearchSelectProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IMenuProps } from '../../menus/menu/Menu';
|
|
3
|
+
interface ISelectItem {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface IPlainMultiSelectProps {
|
|
9
|
+
items: ISelectItem[];
|
|
10
|
+
initialSelectedItems?: ISelectItem[];
|
|
11
|
+
onSearchInputChange: (inputValue: string) => void;
|
|
12
|
+
onSelectedItemsChange: (items: ISelectItem[]) => void;
|
|
13
|
+
itemToString?: (item: ISelectItem) => string;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const PlainMultiSearchSelect: React.FC<IPlainMultiSelectProps>;
|
|
17
|
+
export interface IPlainMenuRendererProps extends IMenuProps {
|
|
18
|
+
items: ISelectItem[];
|
|
19
|
+
isItemSelected: (item: ISelectItem) => boolean;
|
|
20
|
+
handleItemSelection: (item: ISelectItem, isSelected: boolean) => void;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const PlainMenuRenderer: React.ForwardRefExoticComponent<IPlainMenuRendererProps & React.RefAttributes<HTMLUListElement>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISelectItem, SelectBox } from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* A searchable select component. Just like it's native counterpart, only a valid listed option is allowed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SearchSelect: <T extends ISelectItem<any>>({ id, name, items, placeholder, autoFocus, className, icon, onSelectedItemChange, disabled, onMenuToggle, loading, itemToString, ItemRenderer, filterHandler, itemIsValid, getNewItemData, ...rest }: SelectBox<T>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ITextArea extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Is this a controlled component? If so then provide the value
|
|
5
|
+
*/
|
|
6
|
+
value?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Minimum rows
|
|
9
|
+
*/
|
|
10
|
+
minRows?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Maximum rows
|
|
13
|
+
*/
|
|
14
|
+
maxRows?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Disable Content Length
|
|
17
|
+
*/
|
|
18
|
+
disableContentLength?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* onChange listener
|
|
21
|
+
*/
|
|
22
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const TextArea: React.FunctionComponent<ITextArea>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISelectItem, AsyncSelectBox } from '../../interfaces';
|
|
2
|
+
export declare const selectItems: ({
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
} | {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: undefined;
|
|
10
|
+
})[];
|
|
11
|
+
export declare const loadItems: AsyncSelectBox<ISelectItem>['fetchItems'];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
3
|
+
import { IconNames } from '../../icon/Icon';
|
|
4
|
+
export interface ISelectItem<T = any> {
|
|
5
|
+
value: T;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ISearchSelect<T extends ISelectItem> {
|
|
10
|
+
/**
|
|
11
|
+
* name for the input
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
items: T[];
|
|
15
|
+
/**
|
|
16
|
+
* Defaults to name. Will be used for the id of the input
|
|
17
|
+
* and for generating the associated aria attributes.
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Class names to apply to SearchSelect wrapper
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Defaults to using itemToString
|
|
29
|
+
*/
|
|
30
|
+
ItemRenderer?: (item: T) => React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Defaults to item => item.label
|
|
33
|
+
*/
|
|
34
|
+
itemToString?: UseComboboxProps<T>['itemToString'];
|
|
35
|
+
}
|
|
36
|
+
interface IAsyncSearchSelect<T extends ISelectItem> {
|
|
37
|
+
fetchItems: (inputValue: string) => Promise<T[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Defaults to 300
|
|
40
|
+
* Milliseconds before input value is sent to fetchItems. Will respect minChars.
|
|
41
|
+
*/
|
|
42
|
+
debounceTime?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Default onMenuOpen
|
|
45
|
+
* fetchStrategy determines when fetchItems is called
|
|
46
|
+
* onMount will call fetchItems immediately once the component is mounted and then whenever the input value changes.
|
|
47
|
+
* onMenuOpen will call fetchItems every time the menu is opened and then whenever the input value changes.
|
|
48
|
+
* onMinChars will call fetchItems only when the minChars value is met
|
|
49
|
+
*/
|
|
50
|
+
fetchStrategy?: 'onMount' | 'onMenuOpen' | 'onMinChars';
|
|
51
|
+
/**
|
|
52
|
+
* Only takes effect when fetching strategy is onMinChars
|
|
53
|
+
*/
|
|
54
|
+
minChars?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Defaults to true
|
|
57
|
+
* Caches responses from fetchItems
|
|
58
|
+
*/
|
|
59
|
+
useCache?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare type CommonComboBoxTypes<T extends ISelectItem> = Pick<UseComboboxProps<T>, 'initialIsOpen' | 'isOpen' | 'initialHighlightedIndex' | 'highlightedIndex'>;
|
|
62
|
+
interface ISelectBox<T extends ISelectItem> extends ISearchSelect<T> {
|
|
63
|
+
onSelectedItemChange: (item: T) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Defaults to chevronDown
|
|
66
|
+
* Icon to use in input
|
|
67
|
+
*/
|
|
68
|
+
icon?: IconNames;
|
|
69
|
+
/**
|
|
70
|
+
* Should we include the value according to the filter provided
|
|
71
|
+
*/
|
|
72
|
+
filterHandler?: (input: string, item: T) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* To allow selections that don't match a list of items,
|
|
75
|
+
* supply a function that will check if it's acceptable input
|
|
76
|
+
*/
|
|
77
|
+
itemIsValid?: (inputValue: string) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Default to inputValue => ({ value: inputValue, label: inputValue })
|
|
80
|
+
*/
|
|
81
|
+
getNewItemData?: (inputValue: string) => T[];
|
|
82
|
+
}
|
|
83
|
+
export declare type SelectBox<T extends ISelectItem> = ISelectBox<T> & CommonComboBoxTypes<T> & Pick<UseComboboxProps<T>, 'initialSelectedItem' | 'selectedItem'> & {
|
|
84
|
+
onMenuToggle?: (isOpen: boolean) => void;
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
};
|
|
87
|
+
export declare type AsyncSelectBox<T extends ISelectItem> = Omit<SelectBox<T>, 'items' | 'itemIsValid' | 'getNewItemData'> & IAsyncSearchSelect<T>;
|
|
88
|
+
export interface IMultiSearchSelect<T extends ISelectItem> extends ISearchSelect<T> {
|
|
89
|
+
selectAll?: 'enabled' | 'disabled';
|
|
90
|
+
onMenuToggle?: (isOpen: boolean) => void;
|
|
91
|
+
MenuItemsRenderer?: React.FC<{
|
|
92
|
+
items: T[];
|
|
93
|
+
MenuItemRenderer: (item: T, index: number) => JSX.Element;
|
|
94
|
+
inputValue: string;
|
|
95
|
+
}>;
|
|
96
|
+
onInputValueChange?: UseComboboxProps<T>['onInputValueChange'];
|
|
97
|
+
onSelectedItemsChange: (items: T[]) => void;
|
|
98
|
+
}
|
|
99
|
+
export declare type MultiSearchSelectBox<T extends ISelectItem> = IMultiSearchSelect<T> & CommonComboBoxTypes<T> & Pick<UseMultipleSelectionProps<T>, 'initialSelectedItems' | 'selectedItems'> & {
|
|
100
|
+
loading?: boolean;
|
|
101
|
+
} & {
|
|
102
|
+
getKey?: (item: T) => string;
|
|
103
|
+
};
|
|
104
|
+
export declare type AsyncMultiSearchSelectBox<T extends ISelectItem> = Omit<MultiSearchSelectBox<T>, 'items'> & IAsyncSearchSelect<T>;
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UseComboboxGetItemPropsOptions } from 'downshift';
|
|
3
|
+
import { IconNames, IPillProps, IMenuProps } from '../../..';
|
|
4
|
+
import { ISelectItem, ISearchSelect } from './interfaces';
|
|
5
|
+
export interface ISelectMenuItem<T extends ISelectItem> {
|
|
6
|
+
item: T;
|
|
7
|
+
ItemRenderer: ISearchSelect<T>['ItemRenderer'];
|
|
8
|
+
index: number;
|
|
9
|
+
highlightedIndex: number;
|
|
10
|
+
getItemProps: (options: UseComboboxGetItemPropsOptions<T>) => React.HTMLAttributes<HTMLLIElement>;
|
|
11
|
+
}
|
|
12
|
+
interface ISearchSelectTrigger {
|
|
13
|
+
comboboxProps: React.HTMLAttributes<HTMLDivElement>;
|
|
14
|
+
toggleButtonProps: React.HTMLAttributes<HTMLButtonElement>;
|
|
15
|
+
inputProps: React.HTMLAttributes<HTMLInputElement>;
|
|
16
|
+
className?: string;
|
|
17
|
+
icon?: IconNames;
|
|
18
|
+
}
|
|
19
|
+
export declare const SearchSelectTrigger: React.FC<ISearchSelectTrigger & React.InputHTMLAttributes<HTMLInputElement>>;
|
|
20
|
+
export declare const SelectMenu: React.ForwardRefExoticComponent<IMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
21
|
+
export declare const SelectMenuItem: <T extends ISelectItem<any>>({ item, ItemRenderer, index, highlightedIndex, getItemProps }: ISelectMenuItem<T>) => JSX.Element;
|
|
22
|
+
export interface IPlainMultiSelectMenuItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
23
|
+
item: ISelectItem;
|
|
24
|
+
isSelected: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const PlainMultiSelectMenuItem: React.FC<IPlainMultiSelectMenuItemProps>;
|
|
27
|
+
export declare const MultiSelectMenuItem: <T extends ISelectItem<any>>({ item, ItemRenderer, isSelected, index, highlightedIndex, getItemProps }: ISelectMenuItem<T> & {
|
|
28
|
+
isSelected: boolean;
|
|
29
|
+
}) => JSX.Element;
|
|
30
|
+
export declare const SelectEmptyState: React.FC;
|
|
31
|
+
interface IMultiSearchSelectTriggerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
hasItems: boolean;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
className: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const MultiSearchSelectTrigger: React.ForwardRefExoticComponent<IMultiSearchSelectTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export declare const MultiSelectPill: React.ForwardRefExoticComponent<IPillProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Modifier, StrictModifier } from 'react-popper';
|
|
3
|
+
declare type MatchTriggerWidthModifer = Modifier<'matchTriggerWidth', {}>;
|
|
4
|
+
declare type CustomModifiers = MatchTriggerWidthModifer;
|
|
5
|
+
interface IUseSelectPopperConfigReturnType {
|
|
6
|
+
selectPopperModifiers: (StrictModifier | CustomModifiers)[];
|
|
7
|
+
}
|
|
8
|
+
export declare const useSelectPopperConfig: (updatePositionWhenChanged: any) => IUseSelectPopperConfigReturnType;
|
|
9
|
+
export declare const usePromise: <T extends unknown, P>(fn: (args?: P) => T | Promise<T>, initialValue?: T, callOnMount?: boolean, args?: P[]) => {
|
|
10
|
+
response: T;
|
|
11
|
+
pending: boolean;
|
|
12
|
+
error: any;
|
|
13
|
+
};
|
|
14
|
+
interface IUseAutoExpandingInput {
|
|
15
|
+
inputProps: React.InputHTMLAttributes<HTMLInputElement>;
|
|
16
|
+
defaultInputWidth?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const useAutoExpandingInput: ({ defaultInputWidth, inputProps, className }: IUseAutoExpandingInput) => {
|
|
20
|
+
inputScrollRef: React.MutableRefObject<HTMLDivElement>;
|
|
21
|
+
placeholderRef: React.MutableRefObject<HTMLDivElement>;
|
|
22
|
+
defaultInputWidth: number;
|
|
23
|
+
inputValueWidth: number;
|
|
24
|
+
updateInputWidth: () => void;
|
|
25
|
+
setInputValueWidth: React.Dispatch<React.SetStateAction<number>>;
|
|
26
|
+
AutoExpandingInput: JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export declare function useOnClickOutside(refs: React.RefObject<HTMLElement>[], handler: (event: MouseEvent) => void): void;
|
|
29
|
+
export interface UseRunPromiseState<D> {
|
|
30
|
+
data: D | undefined;
|
|
31
|
+
error: Error | undefined;
|
|
32
|
+
pending: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface UseRunPromiseRes<D, A extends any[]> extends UseRunPromiseState<D> {
|
|
35
|
+
run: (...args: A) => void;
|
|
36
|
+
}
|
|
37
|
+
export declare function useRunPromise<D, A extends any[]>(func: (...args: A) => Promise<D>): UseRunPromiseRes<D, A>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UseMultipleSelectionState, UseMultipleSelectionStateChangeOptions, UseComboboxState, UseComboboxStateChangeOptions } from 'downshift';
|
|
3
|
+
import { ISelectItem } from './interfaces';
|
|
4
|
+
export declare const formatReadonlySelect: <T extends ISelectItem<any>>(items: T[]) => string;
|
|
5
|
+
export declare const defaultItemToStringFn: <T extends ISelectItem<any>>(item: T) => string;
|
|
6
|
+
export declare const searchFilterFn: (value: string, item: string) => boolean;
|
|
7
|
+
export declare const usePluralIf: (usePlural: boolean, singular: string, plural: string) => string;
|
|
8
|
+
export declare const environmentAwareLayoutEffect: typeof React.useEffect;
|
|
9
|
+
export declare const multiStateReducer: (focusInput: () => void) => <T extends ISelectItem<any>>(_state: UseMultipleSelectionState<T>, { type, changes }: UseMultipleSelectionStateChangeOptions<T>) => UseMultipleSelectionState<T>;
|
|
10
|
+
export declare const SELECT_ALL_ID = "sked-select-all";
|
|
11
|
+
interface IMultiComboboxStateReducer<T extends ISelectItem> {
|
|
12
|
+
resetDisplayItems: () => void;
|
|
13
|
+
setSelectedItems: (items: T[]) => void;
|
|
14
|
+
addSelectedItem: (item: T) => void;
|
|
15
|
+
removeSelectedItem: (item: T) => void;
|
|
16
|
+
items: T[];
|
|
17
|
+
validItems: T[];
|
|
18
|
+
selectedItems: T[];
|
|
19
|
+
selectAll: 'enabled' | 'disabled';
|
|
20
|
+
}
|
|
21
|
+
export declare const multiComboboxStateReducer: <T extends ISelectItem<any>>({ resetDisplayItems, setSelectedItems, addSelectedItem, removeSelectedItem, items, validItems, selectedItems, selectAll }: IMultiComboboxStateReducer<T>) => (state: UseComboboxState<T>, { type, changes }: UseComboboxStateChangeOptions<T>) => UseComboboxState<T>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import icons from './iconPaths';
|
|
3
|
+
export declare type IconNames = keyof typeof icons;
|
|
4
|
+
interface IProps extends React.SVGAttributes<SVGElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the icon
|
|
7
|
+
*/
|
|
8
|
+
name: IconNames;
|
|
9
|
+
/**
|
|
10
|
+
* className applied to the containing div
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Size of the icon to override the default (pixels)
|
|
15
|
+
*/
|
|
16
|
+
size?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Function to call on click
|
|
19
|
+
*/
|
|
20
|
+
onClick?: (event?: React.MouseEvent<SVGElement>) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The Icon component should be used whenever an icon needs to be displayed. It will naturally inherit any text colour but this can be changed by supplied a class directly. Default size of 18px/18px.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Icon: ({ name, className, size, onClick, ...otherProps }: IProps) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|