chop-logic-components 1.1.2 → 1.1.4
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/BackIcon-BYIgN9YC.js +8 -0
- package/dist/BackIcon-BYIgN9YC.js.map +1 -0
- package/dist/BackIcon-BdQui5Aa.cjs +2 -0
- package/dist/BackIcon-BdQui5Aa.cjs.map +1 -0
- package/dist/CancelIcon-BhlLqC6F.js +8 -0
- package/dist/CancelIcon-BhlLqC6F.js.map +1 -0
- package/dist/CancelIcon-Bm_iptAX.cjs +2 -0
- package/dist/CancelIcon-Bm_iptAX.cjs.map +1 -0
- package/dist/ChevronDownIcon-CUo77OHJ.js +14 -0
- package/dist/ChevronDownIcon-CUo77OHJ.js.map +1 -0
- package/dist/ChevronDownIcon-Dcu6wZF6.cjs +2 -0
- package/dist/ChevronDownIcon-Dcu6wZF6.cjs.map +1 -0
- package/dist/ChevronLeftIcon-BjZ-P9HN.js +14 -0
- package/dist/ChevronLeftIcon-BjZ-P9HN.js.map +1 -0
- package/dist/ChevronLeftIcon-lu-2-_8H.cjs +2 -0
- package/dist/ChevronLeftIcon-lu-2-_8H.cjs.map +1 -0
- package/dist/ChevronRightIcon-Bs6vV-bO.cjs +2 -0
- package/dist/ChevronRightIcon-Bs6vV-bO.cjs.map +1 -0
- package/dist/ChevronRightIcon-LzUbMOE4.js +14 -0
- package/dist/ChevronRightIcon-LzUbMOE4.js.map +1 -0
- package/dist/ChevronUpIcon-ByBUWN2S.js +8 -0
- package/dist/ChevronUpIcon-ByBUWN2S.js.map +1 -0
- package/dist/ChevronUpIcon-Dm5wukir.cjs +2 -0
- package/dist/ChevronUpIcon-Dm5wukir.cjs.map +1 -0
- package/dist/ClearIcon-D4DEbX1Q.js +11 -0
- package/dist/ClearIcon-D4DEbX1Q.js.map +1 -0
- package/dist/ClearIcon-DivVdYES.cjs +2 -0
- package/dist/ClearIcon-DivVdYES.cjs.map +1 -0
- package/dist/CopyIcon-D22c5OS-.cjs +2 -0
- package/dist/CopyIcon-D22c5OS-.cjs.map +1 -0
- package/dist/CopyIcon-NUkhTWCH.js +25 -0
- package/dist/CopyIcon-NUkhTWCH.js.map +1 -0
- package/dist/CutIcon-CglXY55h.js +27 -0
- package/dist/CutIcon-CglXY55h.js.map +1 -0
- package/dist/CutIcon-CrYDHo1s.cjs +2 -0
- package/dist/CutIcon-CrYDHo1s.cjs.map +1 -0
- package/dist/DeleteIcon-CPMkkc0h.cjs +2 -0
- package/dist/DeleteIcon-CPMkkc0h.cjs.map +1 -0
- package/dist/DeleteIcon-DJt-Jw_m.js +8 -0
- package/dist/DeleteIcon-DJt-Jw_m.js.map +1 -0
- package/dist/DownloadIcon-BcmjSwu3.js +8 -0
- package/dist/DownloadIcon-BcmjSwu3.js.map +1 -0
- package/dist/DownloadIcon-DHiPBlSa.cjs +2 -0
- package/dist/DownloadIcon-DHiPBlSa.cjs.map +1 -0
- package/dist/ForwardIcon-3blZq6dd.js +8 -0
- package/dist/ForwardIcon-3blZq6dd.js.map +1 -0
- package/dist/ForwardIcon-gOy8g4uc.cjs +2 -0
- package/dist/ForwardIcon-gOy8g4uc.cjs.map +1 -0
- package/dist/HideIcon-DIGpNz28.cjs +2 -0
- package/dist/HideIcon-DIGpNz28.cjs.map +1 -0
- package/dist/HideIcon-kx8wAtKR.js +8 -0
- package/dist/HideIcon-kx8wAtKR.js.map +1 -0
- package/dist/PasteIcon-BKnWh5CH.cjs +2 -0
- package/dist/PasteIcon-BKnWh5CH.cjs.map +1 -0
- package/dist/PasteIcon-BXKC5uP2.js +8 -0
- package/dist/PasteIcon-BXKC5uP2.js.map +1 -0
- package/dist/QuestionIcon-i6E3ATxf.js +22 -0
- package/dist/QuestionIcon-i6E3ATxf.js.map +1 -0
- package/dist/QuestionIcon-sh6GuYQj.cjs +2 -0
- package/dist/QuestionIcon-sh6GuYQj.cjs.map +1 -0
- package/dist/RemoveIcon-BMtwZqc4.js +30 -0
- package/dist/RemoveIcon-BMtwZqc4.js.map +1 -0
- package/dist/RemoveIcon-D-jlwDbA.cjs +2 -0
- package/dist/RemoveIcon-D-jlwDbA.cjs.map +1 -0
- package/dist/SaveIcon-Bt1dCazw.cjs +2 -0
- package/dist/SaveIcon-Bt1dCazw.cjs.map +1 -0
- package/dist/SaveIcon-CPSuZbnK.js +8 -0
- package/dist/SaveIcon-CPSuZbnK.js.map +1 -0
- package/dist/ShowIcon-D3HWz-2N.cjs +2 -0
- package/dist/ShowIcon-D3HWz-2N.cjs.map +1 -0
- package/dist/ShowIcon-Dl0adz4t.js +11 -0
- package/dist/ShowIcon-Dl0adz4t.js.map +1 -0
- package/dist/UploadIcon-D9WOn42G.js +11 -0
- package/dist/UploadIcon-D9WOn42G.js.map +1 -0
- package/dist/UploadIcon-s_UIC0fh.cjs +2 -0
- package/dist/UploadIcon-s_UIC0fh.cjs.map +1 -0
- package/dist/components/containers/form/Form.d.ts +1 -1
- package/dist/components/containers/form/Form.styled.d.ts +1 -1
- package/dist/components/containers/form/__docs__/{FormExample.d.ts → Form.example.d.ts} +1 -1
- package/dist/components/containers/form/__docs__/Form.stories.d.ts +1 -1
- package/dist/components/containers/form/controller.d.ts +1 -1
- package/dist/components/containers/form/helpers.d.ts +1 -1
- package/dist/components/containers/grid/Grid.d.ts +1 -1
- package/dist/components/containers/grid/Grid.styled.d.ts +1 -1
- package/dist/components/containers/grid/__docs__/{GridExample.d.ts → Grid.example.d.ts} +1 -1
- package/dist/components/containers/grid/__docs__/Grid.stories.d.ts +1 -1
- package/dist/components/containers/grid/controller.d.ts +1 -1
- package/dist/components/containers/grid/elements/Body.d.ts +1 -1
- package/dist/components/containers/grid/elements/Checkbox.d.ts +1 -1
- package/dist/components/containers/grid/elements/ColumnGroup.d.ts +1 -1
- package/dist/components/containers/grid/elements/DataCell.d.ts +1 -1
- package/dist/components/containers/grid/elements/Head.d.ts +1 -1
- package/dist/components/containers/grid/elements/HeaderCell.d.ts +1 -1
- package/dist/components/containers/grid/elements/Row.d.ts +1 -1
- package/dist/components/containers/grid/elements/SelectAllRowsCell.d.ts +1 -1
- package/dist/components/containers/grid/elements/SelectRowCell.d.ts +1 -1
- package/dist/components/containers/grid/helpers.d.ts +1 -1
- package/dist/components/containers/portal/__docs__/Portal.example.d.ts +4 -0
- package/dist/components/containers/portal/__docs__/Portal.stories.d.ts +7 -0
- package/dist/components/containers/tabs/Tabs.d.ts +1 -1
- package/dist/components/containers/tabs/Tabs.styled.d.ts +2 -1
- package/dist/components/containers/tabs/__docs__/{TabsExample.d.ts → Tabs.example.d.ts} +1 -1
- package/dist/components/containers/tabs/elements/TabButton.d.ts +2 -1
- package/dist/components/containers/tabs/elements/TabContent.d.ts +1 -1
- package/dist/components/containers/tabs/elements/TabList.d.ts +11 -1
- package/dist/components/inputs/button/Button.d.ts +2 -12
- package/dist/components/inputs/button/Button.styled.d.ts +1 -1
- package/dist/components/inputs/button/__docs__/{ButtonExample.d.ts → Button.example.d.ts} +1 -1
- package/dist/components/inputs/button/__docs__/Button.stories.d.ts +1 -1
- package/dist/components/inputs/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/inputs/checkbox/Checkbox.styled.d.ts +1 -1
- package/dist/components/inputs/checkbox/__docs__/{CheckboxExample.d.ts → Checkbox.example.d.ts} +1 -1
- package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +1 -1
- package/dist/components/inputs/checkbox/helpers.d.ts +1 -1
- package/dist/components/inputs/multi-select/MultiSelect.d.ts +1 -1
- package/dist/components/inputs/multi-select/__docs__/{MultiSelectExample.d.ts → MultiSelect.example.d.ts} +1 -1
- package/dist/components/inputs/multi-select/__docs__/MultiSelect.stories.d.ts +1 -1
- package/dist/components/inputs/multi-select/controller.d.ts +4 -4
- package/dist/components/inputs/multi-select/elements/Combobox.d.ts +13 -1
- package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +9 -1
- package/dist/components/inputs/multi-select/elements/Option.d.ts +6 -1
- package/dist/components/inputs/multi-select/helpers.d.ts +5 -5
- package/dist/components/inputs/numeric/NumericInput.d.ts +1 -1
- package/dist/components/inputs/numeric/NumericInput.styled.d.ts +1 -1
- package/dist/components/inputs/numeric/__docs__/{NumericInputExample.d.ts → NumericInput.example.d.ts} +1 -1
- package/dist/components/inputs/numeric/__docs__/NumericInput.stories.d.ts +1 -1
- package/dist/components/inputs/numeric/controller.d.ts +2 -2
- package/dist/components/inputs/numeric/helpers.d.ts +2 -2
- package/dist/components/inputs/select/Select.d.ts +1 -1
- package/dist/components/inputs/select/__docs__/{SelectExample.d.ts → Select.example.d.ts} +1 -1
- package/dist/components/inputs/select/__docs__/Select.stories.d.ts +1 -1
- package/dist/components/inputs/select/controller.d.ts +4 -4
- package/dist/components/inputs/select/elements/Combobox.d.ts +13 -1
- package/dist/components/inputs/select/elements/Dropdown.d.ts +12 -1
- package/dist/components/inputs/select/elements/Option.d.ts +8 -1
- package/dist/components/inputs/select/helpers.d.ts +3 -3
- package/dist/components/inputs/text/TextInput.d.ts +1 -1
- package/dist/components/inputs/text/TextInput.styled.d.ts +1 -1
- package/dist/components/inputs/text/__docs__/{TextInputExample.d.ts → TextInput.example.d.ts} +1 -1
- package/dist/components/inputs/text/__docs__/TextInput.stories.d.ts +1 -1
- package/dist/components/inputs/text/controller.d.ts +2 -2
- package/dist/components/inputs/text/helpers.d.ts +2 -2
- package/dist/components/modals/alert/Alert.d.ts +1 -1
- package/dist/components/modals/alert/Alert.styled.d.ts +1 -1
- package/dist/components/modals/alert/__docs__/{AlertExample.d.ts → Alert.example.d.ts} +1 -1
- package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +1 -1
- package/dist/components/modals/alert/elements/Header.d.ts +9 -1
- package/dist/components/modals/dialog/Dialog.d.ts +1 -1
- package/dist/components/modals/dialog/Dialog.styled.d.ts +1 -1
- package/dist/components/modals/dialog/__docs__/{DialogExample.d.ts → Dialog.example.d.ts} +1 -1
- package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +1 -1
- package/dist/components/modals/dialog/elements/Header.d.ts +1 -1
- package/dist/components/modals/dialog/elements/Layout.d.ts +8 -2
- package/dist/components/modals/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/modals/tooltip/Tooltip.styled.d.ts +1 -1
- package/dist/components/modals/tooltip/__docs__/{TooltipExample.d.ts → Tooltip.example.d.ts} +1 -1
- package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +1 -1
- package/dist/contexts/chop-logic-form-context.d.ts +1 -1
- package/dist/contexts/chop-logic-theme-context.d.ts +1 -8
- package/dist/css/themes.d.ts +1 -1
- package/dist/elements/error-message/ErrorMessage.d.ts +1 -1
- package/dist/elements/error-message/ErrorMessage.styled.d.ts +1 -1
- package/dist/elements/icon/Icon.d.ts +2 -4
- package/dist/elements/icon/__docs__/Icon.example.d.ts +5 -0
- package/dist/elements/icon/__docs__/Icon.stories.d.ts +7 -0
- package/dist/elements/input-inner-button/InputInnerButton.d.ts +1 -1
- package/dist/elements/input-inner-button/InputInnerButton.styled.d.ts +1 -1
- package/dist/elements/label/Label.d.ts +1 -1
- package/dist/elements/label/Label.styled.d.ts +1 -1
- package/dist/elements/styled/ExampleDivContainer.styled.d.ts +5 -0
- package/dist/elements/styled/Select.styled.d.ts +1 -1
- package/dist/enums/chop-logic-tabs-mode.d.ts +4 -0
- package/dist/enums/chop-logic-theme-mode.d.ts +4 -0
- package/dist/enums/chop-logic-tooltip-container.d.ts +7 -0
- package/dist/enums/index.d.ts +3 -0
- package/dist/hooks/use-click-outside/__docs__/useClickOutside.example.d.ts +2 -0
- package/dist/hooks/use-click-outside/__docs__/useClickOutside.stories.d.ts +3 -4
- package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.example.d.ts +2 -0
- package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.stories.d.ts +3 -4
- package/dist/hooks/use-key-press/__docs__/useKeyPress.example.d.ts +2 -0
- package/dist/hooks/use-key-press/__docs__/useKeyPress.stories.d.ts +3 -4
- package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.example.d.ts +2 -0
- package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.stories.d.ts +3 -4
- package/dist/hooks/use-mount/__docs__/useMount.example.d.ts +2 -0
- package/dist/hooks/use-mount/__docs__/useMount.stories.d.ts +3 -4
- package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.example.d.ts +2 -0
- package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.stories.d.ts +3 -4
- package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.example.d.ts +2 -0
- package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.stories.d.ts +3 -4
- package/dist/index-CKJ3Lh5y.cjs +903 -0
- package/dist/index-CKJ3Lh5y.cjs.map +1 -0
- package/dist/index-V1IMdfTA.js +4145 -0
- package/dist/index-V1IMdfTA.js.map +1 -0
- package/dist/index.cjs.js +1 -902
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +36 -4286
- package/dist/index.es.js.map +1 -1
- package/dist/{types → models}/chop-logic-theme.d.ts +8 -0
- package/dist/models/common.d.ts +30 -0
- package/dist/models/components/alert.d.ts +10 -0
- package/dist/{types → models}/components/button.d.ts +3 -3
- package/dist/{types → models}/components/checkbox.d.ts +3 -3
- package/dist/models/components/dialog.d.ts +8 -0
- package/dist/{types → models}/components/form.d.ts +7 -7
- package/dist/{types → models}/components/grid.d.ts +3 -3
- package/dist/models/components/icon.d.ts +6 -0
- package/dist/models/components/multi-select.d.ts +8 -0
- package/dist/{types → models}/components/numeric.d.ts +4 -5
- package/dist/models/components/select.d.ts +8 -0
- package/dist/models/components/tabs.d.ts +15 -0
- package/dist/{types → models}/components/text.d.ts +4 -9
- package/dist/models/components/tooltip.d.ts +9 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/utils/get-chop-logic-theme.d.ts +1 -1
- package/dist/utils/handle-dropdown-list-key-press.d.ts +2 -2
- package/package.json +1 -1
- package/dist/hooks/use-click-outside/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-container-dimensions/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-key-press/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-modal-focus-trap/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-mount/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-tooltip-position/__docs__/Example.d.ts +0 -2
- package/dist/hooks/use-window-dimensions/__docs__/Example.d.ts +0 -2
- package/dist/types/components/_common.d.ts +0 -15
- package/dist/types/components/alert.d.ts +0 -18
- package/dist/types/components/dialog.d.ts +0 -15
- package/dist/types/components/multi-select.d.ts +0 -38
- package/dist/types/components/select.d.ts +0 -45
- package/dist/types/components/tabs.d.ts +0 -25
- package/dist/types/components/tooltip.d.ts +0 -9
- package/dist/types/index.d.ts +0 -13
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ChopLogicThemeMode } from '../enums';
|
|
2
|
+
|
|
1
3
|
export interface ChopLogicTheme {
|
|
2
4
|
fontColorBase: string;
|
|
3
5
|
fontColorLight: string;
|
|
@@ -26,3 +28,9 @@ export interface ChopLogicTheme {
|
|
|
26
28
|
zIndexPopup: string;
|
|
27
29
|
zIndexModal: string;
|
|
28
30
|
}
|
|
31
|
+
export interface ChopLogicThemeContextProps {
|
|
32
|
+
mode: ChopLogicThemeMode;
|
|
33
|
+
setMode?: (mode: ChopLogicThemeMode) => void;
|
|
34
|
+
customTheme?: Partial<ChopLogicTheme>;
|
|
35
|
+
setCustomTheme?: (customTheme: ChopLogicTheme) => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ChopLogicComponentProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ChopLogicInputProps extends ChopLogicComponentProps {
|
|
11
|
+
label: string;
|
|
12
|
+
name: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type ChopLogicSelectValue = {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
} & {
|
|
20
|
+
[key in string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
export type ChopLogicMultiSelectValue = ChopLogicSelectValue & {
|
|
23
|
+
selected: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ChopLogicNumericInputValidator = (input?: number) => boolean;
|
|
26
|
+
export type ChopLogicTextInputValidator = (input: string) => boolean;
|
|
27
|
+
export type ChopLogicRegExpWithFlags = {
|
|
28
|
+
regexp: string;
|
|
29
|
+
flags?: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChopLogicAlertMode, ChopLogicIconName } from '../../enums';
|
|
2
|
+
import { ChopLogicComponentProps } from '../common.ts';
|
|
3
|
+
|
|
4
|
+
export interface ChopLogicAlertProps extends ChopLogicComponentProps {
|
|
5
|
+
isOpened: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
message: string;
|
|
8
|
+
mode?: ChopLogicAlertMode;
|
|
9
|
+
icon?: ChopLogicIconName;
|
|
10
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FocusEventHandler, MouseEventHandler } from 'react';
|
|
2
2
|
import { ChopLogicButtonView, ChopLogicIconName } from '../../enums';
|
|
3
|
-
import {
|
|
3
|
+
import { ChopLogicInputProps } from '../common.ts';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export interface ChopLogicButtonProps extends Partial<ChopLogicInputProps> {
|
|
6
6
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
7
7
|
onFocus?: FocusEventHandler<HTMLButtonElement>;
|
|
8
8
|
onBlur?: FocusEventHandler<HTMLButtonElement>;
|
|
@@ -12,4 +12,4 @@ export type ChopLogicButtonProps = Partial<CommonInputProps> & {
|
|
|
12
12
|
extended?: boolean;
|
|
13
13
|
type?: 'button' | 'reset' | 'submit';
|
|
14
14
|
tooltip?: string;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChangeEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicInputProps } from '../common.ts';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface ChopLogicCheckboxProps extends ChopLogicInputProps {
|
|
5
5
|
noLabel?: boolean;
|
|
6
6
|
iconPosition?: 'left' | 'right';
|
|
7
7
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
8
|
defaultChecked?: boolean;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { FormEventHandler, PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicComponentProps } from '../common.ts';
|
|
3
3
|
|
|
4
4
|
export type ChopLogicFormData = {
|
|
5
5
|
[key: string]: unknown;
|
|
6
6
|
};
|
|
7
7
|
export type ChopLogicFormValidationState = [string, boolean][];
|
|
8
|
-
export
|
|
8
|
+
export interface ChopLogicFormInputParams {
|
|
9
9
|
name: string;
|
|
10
10
|
value: unknown;
|
|
11
11
|
valid?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
}
|
|
13
|
+
export interface ChopLogicFormContextProps {
|
|
14
14
|
onChangeFormInput?: (params: ChopLogicFormInputParams) => void;
|
|
15
15
|
initialValues?: ChopLogicFormData;
|
|
16
16
|
resetSignal?: number;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
}
|
|
18
|
+
export interface ChopLogicFormProps extends PropsWithChildren, ChopLogicComponentProps {
|
|
19
19
|
columns?: number;
|
|
20
20
|
initialValues?: ChopLogicFormData;
|
|
21
21
|
hasReset?: boolean;
|
|
22
22
|
onClickSubmit?: (data: ChopLogicFormData) => void;
|
|
23
23
|
onReset?: FormEventHandler<HTMLFormElement>;
|
|
24
24
|
onSubmit?: FormEventHandler<HTMLFormElement>;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicComponentProps } from '../common.ts';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface ChopLogicGridProps extends ChopLogicComponentProps {
|
|
5
5
|
columns: ChopLogicGridColumn[];
|
|
6
6
|
data: ChopLogicGridItem[];
|
|
7
7
|
caption?: string;
|
|
8
8
|
selectable?: boolean;
|
|
9
9
|
renderDataItem?: RenderDataItemCallback;
|
|
10
10
|
onSelect?: (ids: string[]) => void;
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
export type ChopLogicGridColumn = {
|
|
13
13
|
field: string;
|
|
14
14
|
title?: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChopLogicInputProps, ChopLogicSelectValue } from '../common.ts';
|
|
2
|
+
|
|
3
|
+
export interface ChopLogicMultiSelectProps extends ChopLogicInputProps {
|
|
4
|
+
options: ChopLogicSelectValue[];
|
|
5
|
+
onChange?: (values?: ChopLogicSelectValue[]) => void;
|
|
6
|
+
defaultValue?: string | number | readonly string[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicInputProps, ChopLogicNumericInputValidator } from '../common.ts';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
export type ChopLogicNumericInputProps = CommonInputProps & {
|
|
4
|
+
export interface ChopLogicNumericInputProps extends ChopLogicInputProps {
|
|
6
5
|
errorMessage?: string;
|
|
7
|
-
validator?:
|
|
6
|
+
validator?: ChopLogicNumericInputValidator;
|
|
8
7
|
hasSpinButtons?: boolean;
|
|
9
8
|
min?: number;
|
|
10
9
|
max?: number;
|
|
@@ -15,4 +14,4 @@ export type ChopLogicNumericInputProps = CommonInputProps & {
|
|
|
15
14
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
16
15
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
17
16
|
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
18
|
-
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChopLogicInputProps, ChopLogicSelectValue } from '../common.ts';
|
|
2
|
+
|
|
3
|
+
export interface ChopLogicSelectProps extends ChopLogicInputProps {
|
|
4
|
+
options: ChopLogicSelectValue[];
|
|
5
|
+
onChange?: (value?: ChopLogicSelectValue) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
defaultValue?: string | number | readonly string[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ChopLogicTabsMode } from '../../enums';
|
|
3
|
+
import { ChopLogicComponentProps } from '../common.ts';
|
|
4
|
+
|
|
5
|
+
export interface ChopLogicTabsProps extends ChopLogicComponentProps {
|
|
6
|
+
tabs: ChopLogicTabItem[];
|
|
7
|
+
defaultTabId?: string;
|
|
8
|
+
mode?: ChopLogicTabsMode;
|
|
9
|
+
}
|
|
10
|
+
export interface ChopLogicTabItem {
|
|
11
|
+
content: ReactElement;
|
|
12
|
+
title: string;
|
|
13
|
+
id: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { ChangeEventHandler, FocusEventHandler, HTMLInputAutoCompleteAttribute } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicInputProps, ChopLogicRegExpWithFlags, ChopLogicTextInputValidator } from '../common.ts';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
regexp: string;
|
|
6
|
-
flags?: string;
|
|
7
|
-
};
|
|
8
|
-
export type TextValidationFunction = (input: string) => boolean;
|
|
9
|
-
export type ChopLogicTextInputProps = CommonInputProps & {
|
|
4
|
+
export interface ChopLogicTextInputProps extends ChopLogicInputProps {
|
|
10
5
|
errorMessage?: string;
|
|
11
6
|
clearable?: boolean;
|
|
12
7
|
readOnly?: boolean;
|
|
13
8
|
type?: 'text' | 'email' | 'password';
|
|
14
|
-
validator?:
|
|
9
|
+
validator?: ChopLogicRegExpWithFlags | ChopLogicTextInputValidator;
|
|
15
10
|
maxLength?: number;
|
|
16
11
|
placeholder?: string;
|
|
17
12
|
defaultValue?: string;
|
|
@@ -20,4 +15,4 @@ export type ChopLogicTextInputProps = CommonInputProps & {
|
|
|
20
15
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
21
16
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
22
17
|
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
23
|
-
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { ChopLogicTooltipContainer } from '../../enums';
|
|
3
|
+
import { ChopLogicComponentProps } from '../common.ts';
|
|
4
|
+
|
|
5
|
+
export interface ChopLogicTooltipProps extends PropsWithChildren, ChopLogicComponentProps {
|
|
6
|
+
tooltipContent: string | ReactElement;
|
|
7
|
+
containerTag?: ChopLogicTooltipContainer;
|
|
8
|
+
visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { ChopLogicTheme, ChopLogicThemeContextProps } from './chop-logic-theme.ts';
|
|
2
|
+
export type { ChopLogicComponentProps, ChopLogicInputProps, ChopLogicMultiSelectValue, ChopLogicNumericInputValidator, ChopLogicRegExpWithFlags, ChopLogicSelectValue, ChopLogicTextInputValidator, } from './common.ts';
|
|
3
|
+
export type { ChopLogicAlertProps } from './components/alert.ts';
|
|
4
|
+
export type { ChopLogicButtonProps } from './components/button.ts';
|
|
5
|
+
export type { ChopLogicCheckboxProps } from './components/checkbox.ts';
|
|
6
|
+
export type { ChopLogicDialogProps } from './components/dialog.ts';
|
|
7
|
+
export type { ChopLogicFormContextProps, ChopLogicFormData, ChopLogicFormInputParams, ChopLogicFormProps, ChopLogicFormValidationState, } from './components/form.ts';
|
|
8
|
+
export type { ChopLogicGridColumn, ChopLogicGridItem, ChopLogicGridProps, RenderDataItemCallback } from './components/grid.ts';
|
|
9
|
+
export type { ChopLogicIconProps } from './components/icon.ts';
|
|
10
|
+
export type { ChopLogicMultiSelectProps } from './components/multi-select.ts';
|
|
11
|
+
export type { ChopLogicNumericInputProps } from './components/numeric.ts';
|
|
12
|
+
export type { ChopLogicSelectProps } from './components/select.ts';
|
|
13
|
+
export type { ChopLogicTabItem, ChopLogicTabsProps } from './components/tabs.ts';
|
|
14
|
+
export type { ChopLogicTextInputProps } from './components/text.ts';
|
|
15
|
+
export type { ChopLogicTooltipProps } from './components/tooltip.ts';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { KeyboardEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChopLogicSelectValue } from '../models';
|
|
3
3
|
|
|
4
4
|
export declare function handleDropdownListKeyPress({ e, options, onClose, }: {
|
|
5
5
|
e: KeyboardEvent<HTMLUListElement>;
|
|
6
|
-
options:
|
|
6
|
+
options: ChopLogicSelectValue[];
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
}): void;
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
|
|
3
|
-
export type CommonInputProps = CommonComponentProps & {
|
|
4
|
-
label: string;
|
|
5
|
-
name: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type CommonComponentProps = {
|
|
10
|
-
id?: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
tabIndex?: number;
|
|
14
|
-
title?: string;
|
|
15
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ChopLogicAlertMode, ChopLogicIconName } from '../../enums';
|
|
2
|
-
import { ChopLogicTheme } from '..';
|
|
3
|
-
import { CommonComponentProps } from './_common';
|
|
4
|
-
|
|
5
|
-
export type ChopLogicAlertProps = CommonComponentProps & {
|
|
6
|
-
isOpened: boolean;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
message: string;
|
|
9
|
-
mode?: ChopLogicAlertMode;
|
|
10
|
-
icon?: ChopLogicIconName;
|
|
11
|
-
};
|
|
12
|
-
export type ChopLogicAlertHeaderProps = {
|
|
13
|
-
onClose: () => void;
|
|
14
|
-
theme: ChopLogicTheme;
|
|
15
|
-
mode: ChopLogicAlertMode;
|
|
16
|
-
title?: string;
|
|
17
|
-
icon?: ChopLogicIconName;
|
|
18
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
-
import { ChopLogicTheme } from '..';
|
|
3
|
-
import { CommonComponentProps } from './_common';
|
|
4
|
-
|
|
5
|
-
export type ChopLogicDialogProps = CommonComponentProps & PropsWithChildren & {
|
|
6
|
-
isOpened: boolean;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
title: string;
|
|
9
|
-
};
|
|
10
|
-
export type DialogLayoutProps = PropsWithChildren & HTMLAttributes<HTMLDivElement> & {
|
|
11
|
-
title: string;
|
|
12
|
-
onClose: () => void;
|
|
13
|
-
isOpened: boolean;
|
|
14
|
-
theme: ChopLogicTheme;
|
|
15
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ChopLogicTheme } from '..';
|
|
2
|
-
import { CommonInputProps } from './_common';
|
|
3
|
-
import { SelectValue } from './select';
|
|
4
|
-
|
|
5
|
-
export type MultiSelectValue = SelectValue & {
|
|
6
|
-
selected: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type ChopLogicMultiSelectProps = CommonInputProps & {
|
|
9
|
-
options: SelectValue[];
|
|
10
|
-
onChange?: (values?: SelectValue[]) => void;
|
|
11
|
-
defaultValue?: string | number | readonly string[];
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
};
|
|
14
|
-
export type MultiSelectDropdownProps = {
|
|
15
|
-
options: MultiSelectValue[];
|
|
16
|
-
opened: boolean;
|
|
17
|
-
dropdownId: string;
|
|
18
|
-
onClose: () => void;
|
|
19
|
-
onSelect: (id: string) => void;
|
|
20
|
-
theme: ChopLogicTheme;
|
|
21
|
-
};
|
|
22
|
-
export type MultiSelectComboboxProps = {
|
|
23
|
-
opened: boolean;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
required: boolean;
|
|
26
|
-
onClick: () => void;
|
|
27
|
-
comboboxId: string;
|
|
28
|
-
dropdownId: string;
|
|
29
|
-
values?: MultiSelectValue[];
|
|
30
|
-
placeholder?: string;
|
|
31
|
-
name: string;
|
|
32
|
-
theme: ChopLogicTheme;
|
|
33
|
-
};
|
|
34
|
-
export type MultiSelectOptionProps = {
|
|
35
|
-
value: MultiSelectValue;
|
|
36
|
-
onSelect: (id: string) => void;
|
|
37
|
-
theme: ChopLogicTheme;
|
|
38
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ChopLogicTheme } from '..';
|
|
2
|
-
import { CommonInputProps } from './_common';
|
|
3
|
-
|
|
4
|
-
export type SelectValue = {
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
} & {
|
|
8
|
-
[key in string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
export type ChopLogicSelectProps = CommonInputProps & {
|
|
11
|
-
options: SelectValue[];
|
|
12
|
-
onChange?: (value?: SelectValue) => void;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
defaultValue?: string | number | readonly string[];
|
|
15
|
-
};
|
|
16
|
-
export type SelectOptionProps = {
|
|
17
|
-
value: SelectValue;
|
|
18
|
-
selected: boolean;
|
|
19
|
-
onSelect: (id: string) => void;
|
|
20
|
-
onClear: () => void;
|
|
21
|
-
theme: ChopLogicTheme;
|
|
22
|
-
};
|
|
23
|
-
export type SelectComboboxProps = {
|
|
24
|
-
opened: boolean;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
required: boolean;
|
|
27
|
-
onClick: () => void;
|
|
28
|
-
comboboxId: string;
|
|
29
|
-
dropdownId: string;
|
|
30
|
-
selected?: SelectValue;
|
|
31
|
-
placeholder?: string;
|
|
32
|
-
name: string;
|
|
33
|
-
theme: ChopLogicTheme;
|
|
34
|
-
};
|
|
35
|
-
export type SelectDropdownProps = {
|
|
36
|
-
options: SelectValue[];
|
|
37
|
-
opened: boolean;
|
|
38
|
-
dropdownId: string;
|
|
39
|
-
comboboxId: string;
|
|
40
|
-
onClose: () => void;
|
|
41
|
-
selected?: SelectValue;
|
|
42
|
-
onSelect: (id: string) => void;
|
|
43
|
-
onClear: () => void;
|
|
44
|
-
theme: ChopLogicTheme;
|
|
45
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ChopLogicTheme } from '..';
|
|
3
|
-
import { CommonComponentProps } from './_common';
|
|
4
|
-
|
|
5
|
-
export type ChopLogicTabsProps = CommonComponentProps & {
|
|
6
|
-
tabs: ChopLogicTabItem[];
|
|
7
|
-
defaultTabId?: string;
|
|
8
|
-
mode?: ChopLogicTabsMode;
|
|
9
|
-
};
|
|
10
|
-
export type ChopLogicTabListProps = {
|
|
11
|
-
tabs: ChopLogicTabItem[];
|
|
12
|
-
tabIds: string[];
|
|
13
|
-
onTabSelect: (id: string) => void;
|
|
14
|
-
selectedTabId: string;
|
|
15
|
-
tabPanelIds: string[];
|
|
16
|
-
mode: ChopLogicTabsMode;
|
|
17
|
-
theme: ChopLogicTheme;
|
|
18
|
-
};
|
|
19
|
-
export type ChopLogicTabItem = {
|
|
20
|
-
content: ReactElement;
|
|
21
|
-
title: string;
|
|
22
|
-
id: string;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type ChopLogicTabsMode = 'vertical' | 'horizontal';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { CommonComponentProps } from './_common';
|
|
3
|
-
|
|
4
|
-
export type ChopLogicTooltipProps = PropsWithChildren & CommonComponentProps & {
|
|
5
|
-
tooltipContent: string | ReactElement;
|
|
6
|
-
containerTag?: TooltipContainerTag;
|
|
7
|
-
visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
|
|
8
|
-
};
|
|
9
|
-
export type TooltipContainerTag = 'span' | 'div' | 'p' | 'strong' | 'em';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type { ChopLogicTheme } from './chop-logic-theme.ts';
|
|
2
|
-
export * from './components/alert.ts';
|
|
3
|
-
export * from './components/button.ts';
|
|
4
|
-
export * from './components/checkbox.ts';
|
|
5
|
-
export * from './components/dialog.ts';
|
|
6
|
-
export * from './components/form.ts';
|
|
7
|
-
export * from './components/grid.ts';
|
|
8
|
-
export * from './components/multi-select.ts';
|
|
9
|
-
export * from './components/numeric.ts';
|
|
10
|
-
export * from './components/select.ts';
|
|
11
|
-
export * from './components/tabs.ts';
|
|
12
|
-
export * from './components/text.ts';
|
|
13
|
-
export * from './components/tooltip.ts';
|