linear-react-components-ui 0.4.77-beta.25 → 0.4.77-beta.26
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/.eslintrc.json +2 -0
- package/.vscode/settings.json +2 -2
- package/babel.config.json +11 -0
- package/dist/main.js +14 -0
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +1 -1
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/alert.spec.js +27 -54
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +5 -3
- package/lib/avatar/avatar.spec.js +38 -72
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/types.d.ts +31 -0
- package/lib/badge/badge.spec.js +29 -51
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/types.d.ts +13 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +5 -3
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/buttons.spec.js +135 -209
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +22 -2
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +1 -1
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/calendar.spec.js +27 -60
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/types.d.ts +25 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/checkbox.spec.js +14 -56
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +4 -4
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/dialog.spec.js +60 -138
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/types.d.ts +68 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +1 -1
- package/lib/drawer/Drawer.spec.js +35 -81
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/types.d.ts +34 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +4 -2
- package/lib/dropdown/dropdown.spec.js +11 -47
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +3 -1
- package/lib/fieldset/fieldset.spec.js +77 -123
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +1 -1
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +11 -38
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +18 -48
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +2 -26
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +18 -40
- package/lib/form/form.spec.js +43 -87
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +10 -16
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +50 -85
- package/lib/form/types.d.ts +168 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +38 -118
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +13 -34
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/gridLayout.spec.js +41 -68
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/icons.spec.js +19 -35
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +35 -0
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +2 -2
- package/lib/inputs/base/base.spec.js +154 -270
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +1 -1
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/color/color_input.spec.js +29 -63
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/date.spec.js +70 -149
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +3 -1
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +5 -2
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +9 -10
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/input_mask.spec.js +128 -218
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +13 -6
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/number/BaseNumber.d.ts +12 -0
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/Currency.d.ts +12 -0
- package/lib/inputs/number/Decimal.d.ts +12 -0
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +14 -0
- package/lib/inputs/number/numberfield.spec.js +40 -82
- package/lib/inputs/number/types.d.ts +30 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +7 -5
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +0 -3
- package/lib/inputs/search/search_input.spec.js +36 -82
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +3 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/select.spec.js +74 -142
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/types.d.ts +94 -0
- package/lib/inputs/text/index.d.ts +11 -0
- package/lib/inputs/text/textfield.spec.js +40 -81
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/textarea/index.d.ts +9 -0
- package/lib/inputs/textarea/textarea.spec.js +10 -23
- package/lib/inputs/textarea/types.d.ts +13 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/labelMessages.spec.js +28 -61
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/label.spec.js +40 -67
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/types.d.ts +24 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +8 -6
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +8 -3
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +87 -18
- package/lib/list/list.spec.js +167 -284
- package/lib/list/types.d.ts +64 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/float-menu.spec.js +4 -44
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/sidenav.spec.js +16 -69
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +1 -1
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/panel.spec.js +63 -100
- package/lib/panel/types.d.ts +4 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/popover.spec.js +29 -59
- package/lib/popover/types.d.ts +21 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/progress.spec.js +18 -34
- package/lib/progress/types.d.ts +37 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio.spec.js +34 -63
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +0 -13
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +6 -25
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/spinner.spec.js +38 -64
- package/lib/spinner/types.d.ts +20 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/index.d.ts +5 -0
- package/lib/split/split.spec.js +17 -47
- package/lib/split/types.d.ts +34 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +34 -6
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +4 -9
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +2 -2
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/index.d.ts +11 -0
- package/lib/table/table.spec.js +72 -128
- package/lib/table/types.d.ts +84 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +1 -1
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +1 -1
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabs.spec.js +81 -137
- package/lib/tabs/types.d.ts +63 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +1 -1
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +2 -3
- package/lib/toolbar/toolbar.spec.js +123 -171
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/tooltip.spec.js +3 -37
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/treetable/Body.js +7 -25
- package/lib/treetable/Header.js +1 -11
- package/lib/treetable/Row.js +47 -103
- package/lib/treetable/helpers.js +0 -10
- package/lib/treetable/index.js +0 -11
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +30 -18
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +0 -1
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +28 -21
- package/lib/treeview/treeview.spec.js +34 -81
- package/lib/treeview/types.d.ts +104 -0
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +11 -28
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/lib/uitour/uitour.spec.js +54 -76
- package/package.json +15 -5
- package/tsconfig.json +24 -9
- package/tsup.config.ts +10 -0
- package/images.d.ts +0 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { KeyboardEvent, MutableRefObject } from 'react';
|
|
2
|
+
import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
|
+
import { CustomInputEvent } from '../base/types.js';
|
|
4
|
+
import '../../@types/Period.js';
|
|
5
|
+
|
|
6
|
+
interface IBaseMaskProps {
|
|
7
|
+
value?: string;
|
|
8
|
+
onBlur?: (e: CustomInputEvent) => void;
|
|
9
|
+
onKeyDown?: (e: KeyboardEvent<Element>) => void;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
mask?: string | NumberConstructor;
|
|
12
|
+
isNumeric?: boolean;
|
|
13
|
+
scale?: number;
|
|
14
|
+
radix?: string;
|
|
15
|
+
thousandsSeparator?: string;
|
|
16
|
+
rightElements?: JSX.Element | JSX.Element[];
|
|
17
|
+
leftElements?: JSX.Element | JSX.Element[];
|
|
18
|
+
handlerSetOnDenied?: (onDeniedValue: OnDenied) => void;
|
|
19
|
+
onChange?: (e: CustomInputEvent, maskValue?: string, date?: string | {
|
|
20
|
+
initial: string;
|
|
21
|
+
final: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
padFractionalZeros?: boolean;
|
|
24
|
+
onComplete?: (e: CustomInputEvent, maskValue?: string, date?: string) => void;
|
|
25
|
+
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
26
|
+
permissionAttr?: PermissionAttr;
|
|
27
|
+
errorMessages?: string[];
|
|
28
|
+
rounded?: boolean;
|
|
29
|
+
textAlign?: string;
|
|
30
|
+
customClassForInputContent?: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
customClassForLabel?: string;
|
|
34
|
+
customClass?: string;
|
|
35
|
+
gridLayout?: string;
|
|
36
|
+
placeHolder?: string;
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
labelUppercase?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
unmask?: boolean;
|
|
41
|
+
lazy?: boolean;
|
|
42
|
+
placeholderChar?: string;
|
|
43
|
+
onFocus?: (e: CustomInputEvent) => void;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface ICnpjFieldProps extends IBaseMaskProps {
|
|
47
|
+
value?: string;
|
|
48
|
+
enableValidation?: boolean;
|
|
49
|
+
handlerSetComponentValidator?: (validator: () => void) => void;
|
|
50
|
+
onChange?: (e?: CustomInputEvent) => void;
|
|
51
|
+
}
|
|
52
|
+
interface ICpfProps extends IBaseMaskProps {
|
|
53
|
+
value?: string;
|
|
54
|
+
enableValidation?: boolean;
|
|
55
|
+
handlerSetComponentValidator?: (validator: () => void) => void;
|
|
56
|
+
onChange?: (e?: CustomInputEvent) => void;
|
|
57
|
+
}
|
|
58
|
+
interface IPhoneFieldProps extends IBaseMaskProps {
|
|
59
|
+
value?: string;
|
|
60
|
+
cellNumber?: boolean;
|
|
61
|
+
}
|
|
62
|
+
interface IZipCode extends IBaseMaskProps {
|
|
63
|
+
value?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { IBaseMaskProps, ICnpjFieldProps, ICpfProps, IPhoneFieldProps, IZipCode };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IActionButtonsProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../@types/DataCombo.js';
|
|
4
|
+
import '../base/types.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
|
|
8
|
+
declare const ActionButtons: ({ disabled, dropdownOpened, handleOpenClose, handleCheckAll, handleUncheckAll, }: IActionButtonsProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { ActionButtons as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDropdownMultiSelectProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../@types/DataCombo.js';
|
|
4
|
+
import '../base/types.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
|
|
8
|
+
declare const Dropdown: (props: IDropdownMultiSelectProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Dropdown as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataCombo } from '../../@types/DataCombo.js';
|
|
2
|
+
|
|
3
|
+
declare const getFilteredDataCombo: ({ dataSource, descriptionKey, inputText, }: {
|
|
4
|
+
dataSource: DataCombo[];
|
|
5
|
+
descriptionKey: string;
|
|
6
|
+
inputText: string;
|
|
7
|
+
}) => any[];
|
|
8
|
+
|
|
9
|
+
export { getFilteredDataCombo as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IMultiSelectProps } from './types.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../@types/DataCombo.js';
|
|
4
|
+
import '../base/types.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
|
|
8
|
+
declare const MultiSelectField: (props: IMultiSelectProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { MultiSelectField as default };
|
|
@@ -108,7 +108,11 @@ var MultiSelectField = function MultiSelectField(props) {
|
|
|
108
108
|
insideComponent = _useState18[0],
|
|
109
109
|
setInsideComponent = _useState18[1];
|
|
110
110
|
|
|
111
|
-
var
|
|
111
|
+
var _useState19 = (0, _react.useState)(),
|
|
112
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
113
|
+
elementStyles = _useState20[0],
|
|
114
|
+
setElementStyles = _useState20[1];
|
|
115
|
+
|
|
112
116
|
var componentRef = (0, _react.useRef)(null);
|
|
113
117
|
var selectWrapper = (0, _react.useRef)();
|
|
114
118
|
|
|
@@ -240,7 +244,7 @@ var MultiSelectField = function MultiSelectField(props) {
|
|
|
240
244
|
(0, _react.useEffect)(function () {
|
|
241
245
|
if (gridLayout) {
|
|
242
246
|
var currentGridEl = document.querySelector("#".concat(componentId, ">.-withinput.grid-container"));
|
|
243
|
-
if (currentGridEl)
|
|
247
|
+
if (currentGridEl) setElementStyles(window.getComputedStyle(currentGridEl));
|
|
244
248
|
}
|
|
245
249
|
|
|
246
250
|
window.addEventListener('resize', onScreenResize);
|
|
@@ -253,18 +257,21 @@ var MultiSelectField = function MultiSelectField(props) {
|
|
|
253
257
|
};
|
|
254
258
|
}, []);
|
|
255
259
|
(0, _react.useEffect)(function () {
|
|
256
|
-
if (
|
|
260
|
+
if (dataSource.length > 0) {
|
|
257
261
|
var newSelecteds = dataSource.filter(function (item) {
|
|
258
262
|
return value === null || value === void 0 ? void 0 : value.includes(item[idKey]);
|
|
259
263
|
});
|
|
260
264
|
setSelecteds(newSelecteds);
|
|
261
|
-
}
|
|
265
|
+
}
|
|
266
|
+
}, [value === null || value === void 0 ? void 0 : value.length, dataSource.length]);
|
|
267
|
+
(0, _react.useEffect)(function () {
|
|
268
|
+
if (!_lodash.default.isEqual(dataSource, dataCombo)) {
|
|
262
269
|
var newDataCombo = (0, _helper.default)(_extends({}, props, {
|
|
263
270
|
inputText: inputValue
|
|
264
271
|
}));
|
|
265
272
|
setDataCombo(newDataCombo);
|
|
266
273
|
}
|
|
267
|
-
}, [
|
|
274
|
+
}, [dataSource]);
|
|
268
275
|
(0, _react.useEffect)(function () {
|
|
269
276
|
var checkAll = _lodash.default.isEqual(dataCombo, selecteds);
|
|
270
277
|
|
|
@@ -312,7 +319,7 @@ var MultiSelectField = function MultiSelectField(props) {
|
|
|
312
319
|
onFilter: handleOnFilter,
|
|
313
320
|
onFocus: _onFocus,
|
|
314
321
|
onBlur: onBlurComponent,
|
|
315
|
-
gridWrapperStyle:
|
|
322
|
+
gridWrapperStyle: elementStyles
|
|
316
323
|
})));
|
|
317
324
|
};
|
|
318
325
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ChangeEvent, RefObject } from 'react';
|
|
2
|
+
import { DataCombo } from '../../@types/DataCombo.js';
|
|
3
|
+
import { CustomInputEvent } from '../base/types.js';
|
|
4
|
+
import '../../@types/Period.js';
|
|
5
|
+
import '../../@types/PermissionAttr.js';
|
|
6
|
+
|
|
7
|
+
interface IActionButtonsProps {
|
|
8
|
+
handleOpenClose: () => void;
|
|
9
|
+
handleCheckAll: () => void;
|
|
10
|
+
handleUncheckAll: () => void;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
dropdownOpened?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface IDropdownMultiSelectProps {
|
|
15
|
+
dataCombo: DataCombo[];
|
|
16
|
+
idKey: string;
|
|
17
|
+
descriptionKey: string;
|
|
18
|
+
inputValue: string;
|
|
19
|
+
isAllChecked: boolean;
|
|
20
|
+
dropdownWidth: number;
|
|
21
|
+
onBlur: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
22
|
+
onFocus: () => void;
|
|
23
|
+
onSelect: (data: DataCombo) => void;
|
|
24
|
+
onFilter: (value: string) => void;
|
|
25
|
+
onUncheckAll: (checkAll: boolean) => void;
|
|
26
|
+
onCheckAll: (checkAll: boolean) => void;
|
|
27
|
+
opened: boolean;
|
|
28
|
+
selecteds?: DataCombo[] | null;
|
|
29
|
+
imgSrcKey?: string;
|
|
30
|
+
imageAlign?: 'left' | 'right';
|
|
31
|
+
gridWrapperStyle?: {
|
|
32
|
+
paddingLeft: string;
|
|
33
|
+
paddingRight: string;
|
|
34
|
+
};
|
|
35
|
+
selectFieldRef?: RefObject<HTMLDivElement>;
|
|
36
|
+
dropdownMaxHeight?: number;
|
|
37
|
+
}
|
|
38
|
+
interface IMultiSelectProps {
|
|
39
|
+
dataSource: DataCombo[];
|
|
40
|
+
idKey: string;
|
|
41
|
+
descriptionKey: string;
|
|
42
|
+
value?: any[];
|
|
43
|
+
gridLayout?: string;
|
|
44
|
+
onSelect: (data?: string[]) => void;
|
|
45
|
+
onBlur?: (e: CustomInputEvent) => void;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { IActionButtonsProps, IDropdownMultiSelectProps, IMultiSelectProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IBaseNumberProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
3
|
+
import '../base/types.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../types.js';
|
|
7
|
+
import '../../@types/DataCombo.js';
|
|
8
|
+
import '../select/types.js';
|
|
9
|
+
|
|
10
|
+
declare const BaseNumber: (props: IBaseNumberProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { BaseNumber as default };
|
|
@@ -19,7 +19,7 @@ var BaseNumber = function BaseNumber(props) {
|
|
|
19
19
|
var _props$returnFormatte = props.returnFormattedValueOnBlur,
|
|
20
20
|
returnFormattedValueOnBlur = _props$returnFormatte === void 0 ? true : _props$returnFormatte;
|
|
21
21
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({
|
|
22
|
-
value:
|
|
22
|
+
value: (0, _format_number.numberToPtBR)(props.value),
|
|
23
23
|
thousandsSeparator: ".",
|
|
24
24
|
radix: ",",
|
|
25
25
|
mask: Number,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICurrenceProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
3
|
+
import '../base/types.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../types.js';
|
|
7
|
+
import '../../@types/DataCombo.js';
|
|
8
|
+
import '../select/types.js';
|
|
9
|
+
|
|
10
|
+
declare const CurrencyField: (props: ICurrenceProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { CurrencyField as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IBaseNumberProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
3
|
+
import '../base/types.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../types.js';
|
|
7
|
+
import '../../@types/DataCombo.js';
|
|
8
|
+
import '../select/types.js';
|
|
9
|
+
|
|
10
|
+
declare const DecimalField: (props: IBaseNumberProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { DecimalField as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as CurrencyField } from './Currency.js';
|
|
2
|
+
export { default as DecimalField } from './Decimal.js';
|
|
3
|
+
import { INumberFieldProps } from './types.js';
|
|
4
|
+
import '../../@types/PermissionAttr.js';
|
|
5
|
+
import '../base/types.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../@types/Period.js';
|
|
8
|
+
import '../types.js';
|
|
9
|
+
import '../../@types/DataCombo.js';
|
|
10
|
+
import '../select/types.js';
|
|
11
|
+
|
|
12
|
+
declare const NumberField: (props: INumberFieldProps) => JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { NumberField as default };
|
|
@@ -1,66 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
6
|
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
-
|
|
11
7
|
var _index = _interopRequireDefault(require("./index"));
|
|
12
|
-
|
|
13
8
|
var _storageMock = _interopRequireWildcard(require("../../../../config/jest/storageMock"));
|
|
14
|
-
|
|
15
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
-
|
|
17
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
|
|
19
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
21
12
|
describe('NumberField', function () {
|
|
22
13
|
var numberField = function numberField(fieldProps) {
|
|
23
14
|
return /*#__PURE__*/_react.default.createElement(_index.default, fieldProps);
|
|
24
15
|
};
|
|
25
|
-
|
|
26
16
|
var setSessionStorageMock = function setSessionStorageMock() {
|
|
27
17
|
Object.defineProperty(window, 'sessionStorage', {
|
|
28
18
|
value: (0, _storageMock.default)()
|
|
29
19
|
});
|
|
30
20
|
};
|
|
31
|
-
|
|
32
21
|
describe('prop value should', function () {
|
|
33
22
|
it('be applied when is a numeric string', function () {
|
|
34
23
|
var value = '1';
|
|
35
|
-
|
|
36
24
|
var _render = (0, _react2.render)(numberField({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
value: value
|
|
26
|
+
})),
|
|
27
|
+
container = _render.container;
|
|
41
28
|
var inputHTML = container.querySelector('.textinput');
|
|
42
29
|
expect(inputHTML.value).toBe(value);
|
|
43
30
|
});
|
|
44
31
|
it('not be applied when is not a numeric string', function () {
|
|
45
32
|
var value = 'sus';
|
|
46
|
-
|
|
47
33
|
var _render2 = (0, _react2.render)(numberField({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
value: value
|
|
35
|
+
})),
|
|
36
|
+
container = _render2.container;
|
|
52
37
|
var inputHTML = container.querySelector('.textinput');
|
|
53
38
|
expect(inputHTML.value).toBe('');
|
|
54
39
|
});
|
|
55
40
|
});
|
|
56
41
|
it('should apply textAlign', function () {
|
|
57
42
|
var textAlign = 'left';
|
|
58
|
-
|
|
59
43
|
var _render3 = (0, _react2.render)(numberField({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
textAlign: textAlign
|
|
45
|
+
})),
|
|
46
|
+
container = _render3.container;
|
|
64
47
|
var inputHTML = container.querySelector('.textinput');
|
|
65
48
|
expect(inputHTML).toHaveClass("text-align-".concat(textAlign));
|
|
66
49
|
});
|
|
@@ -69,12 +52,10 @@ describe('NumberField', function () {
|
|
|
69
52
|
it('should render subject', function () {
|
|
70
53
|
setSessionStorageMock();
|
|
71
54
|
var permissionAttr = (0, _storageMock.permissionAttrMockAuthorized)('unvisible');
|
|
72
|
-
|
|
73
55
|
var _render4 = (0, _react2.render)(numberField({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
permissionAttr: permissionAttr
|
|
57
|
+
})),
|
|
58
|
+
container = _render4.container;
|
|
78
59
|
expect(container.querySelector('.input-base-component')).not.toBeNull();
|
|
79
60
|
});
|
|
80
61
|
});
|
|
@@ -82,12 +63,10 @@ describe('NumberField', function () {
|
|
|
82
63
|
it('onDenied.unvisible option should not render subject', function () {
|
|
83
64
|
setSessionStorageMock();
|
|
84
65
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('unvisible');
|
|
85
|
-
|
|
86
66
|
var _render5 = (0, _react2.render)(numberField({
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
67
|
+
permissionAttr: permissionAttr
|
|
68
|
+
})),
|
|
69
|
+
container = _render5.container;
|
|
91
70
|
expect(container.querySelector('.input-base-component')).toBeNull();
|
|
92
71
|
});
|
|
93
72
|
describe('onDenied.disabled option/disabled prop should', function () {
|
|
@@ -95,33 +74,27 @@ describe('NumberField', function () {
|
|
|
95
74
|
setSessionStorageMock();
|
|
96
75
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('disabled');
|
|
97
76
|
var onChange = jest.fn();
|
|
98
|
-
|
|
99
77
|
var _render6 = (0, _react2.render)(numberField({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
permissionAttr: permissionAttr,
|
|
79
|
+
onChange: onChange
|
|
80
|
+
})),
|
|
81
|
+
container = _render6.container;
|
|
105
82
|
var inputHTML = container.querySelector('.textinput');
|
|
106
|
-
|
|
107
83
|
_react2.fireEvent.change(inputHTML, {
|
|
108
84
|
target: {
|
|
109
85
|
value: 'sus'
|
|
110
86
|
}
|
|
111
87
|
});
|
|
112
|
-
|
|
113
88
|
expect(inputHTML.disabled).toBeTruthy();
|
|
114
89
|
expect(onChange).not.toBeCalled();
|
|
115
90
|
});
|
|
116
91
|
it('add -disabled css class', function () {
|
|
117
92
|
setSessionStorageMock();
|
|
118
93
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('disabled');
|
|
119
|
-
|
|
120
94
|
var _render7 = (0, _react2.render)(numberField({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
permissionAttr: permissionAttr
|
|
96
|
+
})),
|
|
97
|
+
container = _render7.container;
|
|
125
98
|
var inputWrapper = container.querySelector('.inputwrapper');
|
|
126
99
|
expect(inputWrapper).toHaveClass('-disabled');
|
|
127
100
|
});
|
|
@@ -130,12 +103,10 @@ describe('NumberField', function () {
|
|
|
130
103
|
it('apply readOnly attribute in input', function () {
|
|
131
104
|
setSessionStorageMock();
|
|
132
105
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('readOnly');
|
|
133
|
-
|
|
134
106
|
var _render8 = (0, _react2.render)(numberField({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
107
|
+
permissionAttr: permissionAttr
|
|
108
|
+
})),
|
|
109
|
+
container = _render8.container;
|
|
139
110
|
var inputHTML = container.querySelector('.textinput');
|
|
140
111
|
expect(inputHTML.readOnly).toBeTruthy();
|
|
141
112
|
});
|
|
@@ -143,21 +114,17 @@ describe('NumberField', function () {
|
|
|
143
114
|
setSessionStorageMock();
|
|
144
115
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('readOnly');
|
|
145
116
|
var onChange = jest.fn();
|
|
146
|
-
|
|
147
117
|
var _render9 = (0, _react2.render)(numberField({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
118
|
+
permissionAttr: permissionAttr,
|
|
119
|
+
onChange: onChange
|
|
120
|
+
})),
|
|
121
|
+
container = _render9.container;
|
|
153
122
|
var inputHTML = container.querySelector('.textinput');
|
|
154
|
-
|
|
155
123
|
_react2.fireEvent.change(inputHTML, {
|
|
156
124
|
target: {
|
|
157
125
|
value: 'sus'
|
|
158
126
|
}
|
|
159
127
|
});
|
|
160
|
-
|
|
161
128
|
expect(onChange).not.toBeCalled();
|
|
162
129
|
});
|
|
163
130
|
});
|
|
@@ -165,48 +132,39 @@ describe('NumberField', function () {
|
|
|
165
132
|
it('should set input value to blank', function () {
|
|
166
133
|
setSessionStorageMock();
|
|
167
134
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('hideContent');
|
|
168
|
-
|
|
169
135
|
var _render10 = (0, _react2.render)(numberField({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
136
|
+
permissionAttr: permissionAttr,
|
|
137
|
+
value: 'text'
|
|
138
|
+
})),
|
|
139
|
+
container = _render10.container;
|
|
175
140
|
var inputHTML = container.querySelector('.textinput');
|
|
176
141
|
expect(inputHTML.value).toBe('');
|
|
177
142
|
});
|
|
178
143
|
it('disable input', function () {
|
|
179
144
|
setSessionStorageMock();
|
|
180
145
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('disabled'); // CORRIGIR?
|
|
181
|
-
|
|
182
146
|
var onChange = jest.fn();
|
|
183
|
-
|
|
184
147
|
var _render11 = (0, _react2.render)(numberField({
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
148
|
+
permissionAttr: permissionAttr,
|
|
149
|
+
onChange: onChange
|
|
150
|
+
})),
|
|
151
|
+
container = _render11.container;
|
|
190
152
|
var inputHTML = container.querySelector('.textinput');
|
|
191
|
-
|
|
192
153
|
_react2.fireEvent.change(inputHTML, {
|
|
193
154
|
target: {
|
|
194
155
|
value: 'sus'
|
|
195
156
|
}
|
|
196
157
|
});
|
|
197
|
-
|
|
198
158
|
expect(onChange).not.toBeCalled();
|
|
199
159
|
expect(inputHTML.disabled).toBeTruthy();
|
|
200
160
|
});
|
|
201
161
|
it('add -disabled css class', function () {
|
|
202
162
|
setSessionStorageMock();
|
|
203
163
|
var permissionAttr = (0, _storageMock.permissionAttrMockUnauthorized)('hideContent');
|
|
204
|
-
|
|
205
164
|
var _render12 = (0, _react2.render)(numberField({
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
165
|
+
permissionAttr: permissionAttr
|
|
166
|
+
})),
|
|
167
|
+
container = _render12.container;
|
|
210
168
|
var inputWrapper = container.querySelector('.inputwrapper');
|
|
211
169
|
expect(inputWrapper).toHaveClass('-disabled');
|
|
212
170
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
2
|
+
import { CustomInputEvent } from '../base/types.js';
|
|
3
|
+
import { IMaskHOCProps } from '../types.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/DataCombo.js';
|
|
7
|
+
import '../select/types.js';
|
|
8
|
+
|
|
9
|
+
interface INumberFieldProps extends IMaskHOCProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
textAlign?: string;
|
|
12
|
+
permissionAttr?: PermissionAttr;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onChange?: (e?: CustomInputEvent, maskValue?: string, date?: string | {
|
|
15
|
+
initial: string;
|
|
16
|
+
final: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
}
|
|
19
|
+
interface IBaseNumberProps extends INumberFieldProps {
|
|
20
|
+
value?: string;
|
|
21
|
+
leftElements?: JSX.Element | JSX.Element[];
|
|
22
|
+
onBlur?: (e: CustomInputEvent) => void;
|
|
23
|
+
returnFormattedValueOnBlur?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface ICurrenceProps extends INumberFieldProps {
|
|
26
|
+
currencySymbol?: string;
|
|
27
|
+
displayCurrencySymbol?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { IBaseNumberProps, ICurrenceProps, INumberFieldProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDialogProps } from './types.js';
|
|
2
|
+
import 'moment';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../base/types.js';
|
|
8
|
+
|
|
9
|
+
declare const Dialog: ({ handlerClose, children, dialogSize }: IDialogProps) => JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Dialog as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IPeriodDropdownProps } from './types.js';
|
|
3
|
+
import 'moment';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../base/types.js';
|
|
8
|
+
|
|
9
|
+
declare const Dropdown: (props: IPeriodDropdownProps) => React.ReactPortal;
|
|
10
|
+
|
|
11
|
+
export { Dropdown as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPeriodListProps } from './types.js';
|
|
2
|
+
import 'moment';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../base/types.js';
|
|
8
|
+
|
|
9
|
+
declare const PeriodList: ({ selected, handleOnSelect }: IPeriodListProps) => JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { PeriodList as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import { DateTypes } from './types.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../base/types.js';
|
|
8
|
+
|
|
9
|
+
declare const getCalendarDropdownStyle: ({ topPosition, leftPosition, width }: {
|
|
10
|
+
topPosition: number | string;
|
|
11
|
+
leftPosition: number | string;
|
|
12
|
+
width: number | string;
|
|
13
|
+
}) => string;
|
|
14
|
+
|
|
15
|
+
declare const getDropdownItemCssClass: (selected?: boolean, disabled?: boolean, striped?: boolean) => string;
|
|
16
|
+
declare const CalcDatesByPeriod: (dateType: DateTypes) => Moment[];
|
|
17
|
+
declare const isDateValid: (date: Moment) => boolean;
|
|
18
|
+
|
|
19
|
+
export { CalcDatesByPeriod, getCalendarDropdownStyle as default, getDropdownItemCssClass, isDateValid };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPeriodPickerProps } from './types.js';
|
|
2
|
+
import 'moment';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../@types/Period.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
import '../base/types.js';
|
|
8
|
+
|
|
9
|
+
declare const PeriodPicker: (props: IPeriodPickerProps) => JSX.Element | null;
|
|
10
|
+
|
|
11
|
+
export { PeriodPicker as default };
|