linear-react-components-ui 0.4.77-beta.9 → 1.0.0-rc.1
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 +99 -0
- package/.gitlab-ci.yml +19 -0
- package/.husky/pre-push +4 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +5 -2
- package/babel.config.json +11 -0
- package/config/getHttpsConfig.js +56 -0
- package/config/paths.js +140 -0
- package/config/webpackDevServer.config.js +128 -0
- package/jest.config.js +3 -3
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/Align.js +5 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ButtonTypes.js +5 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/ColorStyles.js +5 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/DataCombo.js +5 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/Icon.js +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/Period.js +5 -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/PositionAlert.js +5 -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/@types/StorageMock.js +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertContainer.js +16 -21
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +13 -18
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/BaseAlert.js +8 -11
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/Message.js +41 -50
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/helpers.js +4 -7
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/types.js +5 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +8 -8
- package/lib/assets/styles/commons.scss +0 -10
- package/lib/assets/styles/dropdown.scss +0 -1
- package/lib/assets/styles/list.scss +0 -8
- package/lib/assets/styles/sidenav.scss +42 -93
- package/lib/assets/styles/table.scss +7 -2
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/index.js +21 -66
- package/lib/avatar/types.d.ts +31 -0
- package/lib/avatar/types.js +5 -0
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/index.js +11 -27
- package/lib/badge/types.d.ts +13 -0
- package/lib/badge/types.js +5 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/ActivateButton.js +6 -6
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/AddButton.js +6 -6
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/Button.js +22 -14
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/ButtonGroups.js +4 -9
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/CancelButton.js +19 -6
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DangerButton.js +16 -21
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +73 -135
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/DestroyButton.js +16 -7
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/EditButton.js +6 -6
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.js +6 -6
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/InfoButton.js +16 -21
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.js +16 -21
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.js +6 -6
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SaveButton.js +18 -5
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.js +15 -20
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/WarningButton.js +15 -20
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/button_container/index.js +10 -23
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/index.js +18 -18
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +18 -35
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/DangerCalendar.js +15 -6
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.js +15 -6
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.js +15 -6
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.js +15 -6
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.js +15 -6
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Day.js +8 -14
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Month.js +5 -10
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/Week.js +5 -11
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +9 -9
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/base/index.js +44 -47
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/index.js +9 -9
- package/lib/calendar/types.d.ts +25 -0
- package/lib/calendar/types.js +5 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/Label.js +7 -17
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +52 -89
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Alert.js +9 -14
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +26 -34
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Error.js +7 -12
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Information.js +7 -12
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Question.js +14 -25
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/Warning.js +7 -12
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Content.js +4 -13
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Footer.js +6 -12
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/Header.js +17 -31
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/base/index.js +13 -35
- package/lib/dialog/base/style.js +2 -2
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/form/index.js +34 -44
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/index.js +10 -10
- package/lib/dialog/types.d.ts +68 -0
- package/lib/dialog/types.js +5 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Content.js +7 -16
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +36 -57
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/Header.js +28 -47
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/index.js +6 -6
- package/lib/drawer/types.d.ts +34 -0
- package/lib/drawer/types.js +5 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +36 -20
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/helper.js +2 -2
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +22 -47
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +19 -50
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/fieldset/types.js +5 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +22 -49
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +27 -57
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +10 -32
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +29 -51
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +11 -17
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +68 -103
- package/lib/form/types.d.ts +167 -0
- package/lib/form/types.js +5 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +45 -125
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +20 -41
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridCol.js +7 -22
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/GridRow.js +8 -28
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/index.js +5 -5
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/gridlayout/types.js +5 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/helper.js +560 -563
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/index.js +28 -45
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +50 -0
- package/lib/index.js +140 -14
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +54 -163
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +9 -9
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/base/types.js +5 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/index.js +40 -38
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/color/types.js +5 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dialog.js +4 -11
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/Dropdown.js +21 -73
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/helpers.js +4 -4
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/index.js +259 -415
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/date/types.js +5 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/inputHOC.js +48 -100
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/BaseMask.js +6 -20
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +17 -24
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +18 -26
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/Phone.js +5 -13
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.js +5 -5
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/helpers.js +21 -36
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +188 -257
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/index.js +8 -8
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/mask/types.js +5 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/ActionButtons.js +9 -21
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.js +60 -87
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/helper.js +2 -2
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +67 -90
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/multiSelect/types.js +5 -0
- package/lib/inputs/number/BaseNumber.d.ts +9 -0
- package/lib/inputs/number/BaseNumber.js +15 -27
- package/lib/inputs/number/Currency.d.ts +9 -0
- package/lib/inputs/number/Currency.js +8 -18
- package/lib/inputs/number/Decimal.d.ts +9 -0
- package/lib/inputs/number/Decimal.js +4 -4
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +11 -0
- package/lib/inputs/number/index.js +14 -20
- package/lib/inputs/number/types.d.ts +27 -0
- package/lib/inputs/number/types.js +5 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dialog.js +4 -11
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/Dropdown.js +19 -73
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/PeriodList.js +12 -25
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/helper.js +33 -74
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +136 -186
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/period/types.js +5 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +133 -265
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/ActionButtons.js +19 -25
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/Dropdown.js +42 -75
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/helper.js +18 -14
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +15 -16
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/Selecteds.js +9 -17
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/multiple/index.js +293 -418
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +310 -463
- package/lib/inputs/select/types.d.ts +97 -0
- package/lib/inputs/select/types.js +5 -0
- package/lib/inputs/text/index.d.ts +9 -0
- package/lib/inputs/text/index.js +5 -4
- package/lib/inputs/text/types.d.ts +22 -0
- package/lib/inputs/text/types.js +5 -0
- package/lib/inputs/textarea/index.d.ts +5 -0
- package/lib/inputs/textarea/index.js +9 -19
- package/lib/inputs/textarea/types.d.ts +8 -0
- package/lib/inputs/textarea/types.js +5 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/inputs/types.js +5 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/colorStyles.js +2 -2
- 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/internals/withTooltip.js +32 -40
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/index.js +34 -52
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DangerLabel.js +16 -7
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +31 -63
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/InfoLabel.js +16 -7
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.js +16 -7
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.js +16 -7
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.js +16 -7
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/index.js +10 -10
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/label_container/index.js +7 -17
- package/lib/labels/types.d.ts +24 -0
- package/lib/labels/types.js +5 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Header.js +5 -18
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +39 -77
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/Separator.js +4 -4
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +2 -2
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +47 -66
- package/lib/list/types.d.ts +64 -0
- package/lib/list/types.js +5 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/MenuItem.js +17 -37
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/index.js +17 -37
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/float/types.js +5 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/index.js +4 -4
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/ExpandMenu.js +6 -18
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/MenuLink.js +5 -19
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuGroup.js +6 -17
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +30 -56
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +10 -21
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/helpers.js +5 -5
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/index.js +39 -69
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +9 -18
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.js +25 -24
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/menus/sidenav/types.js +5 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/noPermission/index.js +7 -7
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/Content.js +14 -26
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/DangerPanel.js +6 -6
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +25 -52
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/Header.js +18 -40
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/InfoPanel.js +6 -6
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.js +6 -6
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.js +6 -6
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/ToolBar.js +4 -9
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/WarningPanel.js +6 -6
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/helpers.js +9 -5
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/index.js +11 -11
- package/lib/panel/types.d.ts +4 -0
- package/lib/panel/types.js +5 -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/PopoverText.js +4 -9
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/PopoverTitle.js +4 -9
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/index.js +35 -49
- package/lib/popover/types.d.ts +21 -0
- package/lib/popover/types.js +5 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/Bar.js +42 -52
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/index.js +14 -24
- package/lib/progress/types.d.ts +37 -0
- package/lib/progress/types.js +5 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +28 -52
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +4 -17
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +13 -32
- 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/SpinnerLoading.js +45 -53
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/index.js +28 -33
- package/lib/spinner/types.d.ts +20 -0
- package/lib/spinner/types.js +5 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/Split.js +52 -69
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/SplitSide.js +7 -27
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.d.ts +5 -0
- package/lib/split/index.js +5 -5
- package/lib/split/types.d.ts +34 -0
- package/lib/split/types.js +5 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Body.js +21 -28
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +18 -25
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +13 -27
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +13 -34
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +18 -36
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/helpers.js +5 -5
- package/lib/table/index.d.ts +11 -0
- package/lib/table/index.js +19 -57
- package/lib/table/types.d.ts +77 -0
- package/lib/table/types.js +5 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/DropdownItems.js +20 -30
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/Menu.js +21 -25
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +33 -47
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +24 -57
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/index.js +89 -83
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/tabHelpers.js +10 -9
- package/lib/tabs/types.d.ts +63 -0
- package/lib/tabs/types.js +5 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/ButtonBar.js +51 -32
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +42 -29
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/Separator.js +4 -4
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/ToolBarGroup.js +10 -16
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +26 -34
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/toolbar/types.js +5 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/index.js +34 -43
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/tooltip/types.js +5 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Header.js +5 -17
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +265 -391
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +369 -554
- package/lib/treeview/types.d.ts +104 -0
- package/lib/treeview/types.js +5 -0
- package/lib/treeview_old/Header.js +7 -7
- package/lib/treeview_old/Node.js +18 -18
- package/lib/treeview_old/index.js +9 -9
- 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 +28 -45
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +57 -18
- package/scripts/start.js +135 -0
- package/tsconfig.json +32 -0
- package/tsup.config.ts +10 -0
- package/.eslintrc.js +0 -26
- package/.husky/pre-commit +0 -4
- package/lib/alerts/alert.spec.js +0 -133
- package/lib/avatar/avatar.spec.js +0 -190
- package/lib/badge/badge.spec.js +0 -127
- package/lib/buttons/SpinnerLoading.js +0 -230
- package/lib/buttons/buttons.spec.js +0 -504
- package/lib/calendar/calendar.spec.js +0 -171
- package/lib/checkbox/checkbox.spec.js +0 -215
- package/lib/dialog/dialog.spec.js +0 -488
- package/lib/drawer/Drawer.spec.js +0 -258
- package/lib/dropdown/dropdown.spec.js +0 -168
- package/lib/fieldset/fieldset.spec.js +0 -329
- package/lib/form/form.spec.js +0 -293
- package/lib/gridlayout/gridLayout.spec.js +0 -169
- package/lib/icons/icons.spec.js +0 -86
- package/lib/inputs/base/base.spec.js +0 -690
- package/lib/inputs/base/index.js +0 -1
- package/lib/inputs/color/color_input.spec.js +0 -174
- package/lib/inputs/date/date.spec.js +0 -354
- package/lib/inputs/mask/input_mask.spec.js +0 -607
- package/lib/inputs/number/numberfield.spec.js +0 -215
- package/lib/inputs/search/search_input.spec.js +0 -209
- package/lib/inputs/select/select.spec.js +0 -391
- package/lib/inputs/text/textfield.spec.js +0 -215
- package/lib/inputs/textarea/textarea.spec.js +0 -59
- package/lib/labelMessages/labelMessages.spec.js +0 -176
- package/lib/labels/label.spec.js +0 -162
- package/lib/list/list.spec.js +0 -768
- package/lib/menus/float/float-menu.spec.js +0 -221
- package/lib/menus/sidenav/sidenav.spec.js +0 -379
- package/lib/panel/panel.spec.js +0 -216
- package/lib/popover/popover.spec.js +0 -146
- package/lib/progress/progress.spec.js +0 -86
- package/lib/radio/radio.spec.js +0 -189
- package/lib/spinner/spinner.spec.js +0 -152
- package/lib/split/split.spec.js +0 -151
- package/lib/table/table.spec.js +0 -352
- package/lib/tabs/tabs.spec.js +0 -349
- package/lib/toolbar/toolbar.spec.js +0 -394
- package/lib/tooltip/tooltip.spec.js +0 -203
- package/lib/treeview/treeview.spec.js +0 -279
- package/lib/uitour/uitour.spec.js +0 -176
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "airbnb",
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": true,
|
|
5
|
+
"jest": true
|
|
6
|
+
},
|
|
7
|
+
"parser": "babel-eslint",
|
|
8
|
+
"rules": {
|
|
9
|
+
"indent": "off",
|
|
10
|
+
"no-undef": "off",
|
|
11
|
+
"radix": "off",
|
|
12
|
+
"prefer-destructuring": ["error", {"object": true, "array": false}],
|
|
13
|
+
"react/forbid-prop-types": ["error", { "forbid": ["array"] }],
|
|
14
|
+
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
|
15
|
+
"react/jsx-closing-bracket-location": ["error", "after-props"],
|
|
16
|
+
"react/no-unused-prop-types": [0],
|
|
17
|
+
"jsx-a11y/anchor-is-valid": [ "error", {
|
|
18
|
+
"components": [ "Link" ],
|
|
19
|
+
"specialLink": [ "hrefLeft", "hrefRight" ],
|
|
20
|
+
"aspects": ["preferButton" ]
|
|
21
|
+
}],
|
|
22
|
+
"jsx-a11y/no-autofocus": [0],
|
|
23
|
+
"object-curly-newline": [0],
|
|
24
|
+
"jsx-a11y/label-has-for": [0],
|
|
25
|
+
"import/extensions": [
|
|
26
|
+
"error",
|
|
27
|
+
"ignorePackages",
|
|
28
|
+
{
|
|
29
|
+
"ts": "never",
|
|
30
|
+
"tsx": "never",
|
|
31
|
+
"js": "never",
|
|
32
|
+
"jsx": "never"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"settings": {
|
|
37
|
+
"import/resolver": {
|
|
38
|
+
"node": {
|
|
39
|
+
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"plugins": [
|
|
44
|
+
"react",
|
|
45
|
+
"class-property"
|
|
46
|
+
],
|
|
47
|
+
"overrides": [
|
|
48
|
+
{
|
|
49
|
+
"files": ["**/*.ts", "**/*.tsx"],
|
|
50
|
+
"env": {
|
|
51
|
+
"browser": true,
|
|
52
|
+
"jest": true
|
|
53
|
+
},
|
|
54
|
+
"extends": [
|
|
55
|
+
"eslint:recommended",
|
|
56
|
+
"airbnb",
|
|
57
|
+
"airbnb-typescript/base",
|
|
58
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
59
|
+
"plugin:@typescript-eslint/recommended"
|
|
60
|
+
],
|
|
61
|
+
"parser": "@typescript-eslint/parser",
|
|
62
|
+
"parserOptions": {
|
|
63
|
+
"ecmaFeatures": { "jsx": true },
|
|
64
|
+
"ecmaVersion": 2021,
|
|
65
|
+
"sourceType": "module",
|
|
66
|
+
"project": ["./tsconfig.json", "./images.d.ts"]
|
|
67
|
+
},
|
|
68
|
+
"plugins": ["react", "@typescript-eslint", "class-property"],
|
|
69
|
+
"rules": {
|
|
70
|
+
"react/jsx-indent": "off",
|
|
71
|
+
"react/jsx-uses-react": "off",
|
|
72
|
+
"react/react-in-jsx-scope": "off",
|
|
73
|
+
"@typescript-eslint/indent": ["error", 2],
|
|
74
|
+
"import/prefer-default-export": [0],
|
|
75
|
+
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
|
|
76
|
+
"prefer-destructuring": ["error", {"object": true, "array": false}],
|
|
77
|
+
"react/forbid-prop-types": ["error", { "forbid": ["array"] }],
|
|
78
|
+
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
|
79
|
+
"react/jsx-closing-bracket-location": ["error", "after-props"],
|
|
80
|
+
"react/no-unused-prop-types": [0],
|
|
81
|
+
"jsx-a11y/heading-has-content": "off",
|
|
82
|
+
"jsx-a11y/anchor-has-content": "off",
|
|
83
|
+
"jsx-a11y/anchor-is-valid": [ "error", {
|
|
84
|
+
"components": [ "Link" ],
|
|
85
|
+
"specialLink": [ "hrefLeft", "hrefRight" ],
|
|
86
|
+
"aspects": ["preferButton" ]
|
|
87
|
+
}],
|
|
88
|
+
"jsx-a11y/no-autofocus": [0],
|
|
89
|
+
"object-curly-newline": [0],
|
|
90
|
+
"jsx-a11y/label-has-for": [0]
|
|
91
|
+
},
|
|
92
|
+
"settings": {
|
|
93
|
+
"import/resolver": {
|
|
94
|
+
"typescript": {}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- lint
|
|
3
|
+
- tests-units
|
|
4
|
+
|
|
5
|
+
lint:
|
|
6
|
+
stage: lint
|
|
7
|
+
image: node:12.17
|
|
8
|
+
before_script:
|
|
9
|
+
- npm install
|
|
10
|
+
script:
|
|
11
|
+
- npm run check:js
|
|
12
|
+
|
|
13
|
+
units:
|
|
14
|
+
stage: tests-units
|
|
15
|
+
image: node:12.17
|
|
16
|
+
before_script:
|
|
17
|
+
- npm install
|
|
18
|
+
script:
|
|
19
|
+
- npm run test
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "pwa-chrome",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Launch Chrome against localhost",
|
|
11
|
+
"url": "http://localhost:3001",
|
|
12
|
+
"webRoot": "${workspaceFolder}"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
package/.vscode/settings.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files.exclude": {
|
|
3
|
-
"config": true,
|
|
3
|
+
// "config": true,
|
|
4
4
|
"coverage": true,
|
|
5
5
|
"node_modules": true,
|
|
6
6
|
"scripts": true,
|
|
7
7
|
"yarn.lock": true,
|
|
8
8
|
".eslintrc.js": true,
|
|
9
|
-
".gitignore": true,
|
|
9
|
+
// ".gitignore": true,
|
|
10
|
+
},
|
|
11
|
+
"editor.codeActionsOnSave": {
|
|
12
|
+
"source.fixAll.eslint": true
|
|
10
13
|
}
|
|
11
14
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
const chalk = require('react-dev-utils/chalk');
|
|
5
|
+
const paths = require('./paths');
|
|
6
|
+
|
|
7
|
+
// Ensure the certificate and key provided are valid and if not
|
|
8
|
+
// throw an easy to debug error
|
|
9
|
+
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
|
|
10
|
+
let encrypted;
|
|
11
|
+
try {
|
|
12
|
+
// publicEncrypt will throw an error with an invalid cert
|
|
13
|
+
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
|
|
14
|
+
} catch (err) {
|
|
15
|
+
throw new Error(`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// privateDecrypt will throw an error with an invalid key
|
|
20
|
+
crypto.privateDecrypt(key, encrypted);
|
|
21
|
+
} catch (err) {
|
|
22
|
+
throw new Error(`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
|
|
23
|
+
err.message
|
|
24
|
+
}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Read file and throw an error if it doesn't exist
|
|
29
|
+
function readEnvFile(file, type) {
|
|
30
|
+
if (!fs.existsSync(file)) {
|
|
31
|
+
throw new Error(`You specified ${chalk.cyan(type)} in your env, but the file "${chalk.yellow(file)}" can't be found.`);
|
|
32
|
+
}
|
|
33
|
+
return fs.readFileSync(file);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Get the https config
|
|
37
|
+
// Return cert files if provided in env, otherwise just true or false
|
|
38
|
+
function getHttpsConfig() {
|
|
39
|
+
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
|
|
40
|
+
const isHttps = HTTPS === 'true';
|
|
41
|
+
|
|
42
|
+
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
|
|
43
|
+
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
|
|
44
|
+
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
|
|
45
|
+
const config = {
|
|
46
|
+
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
|
|
47
|
+
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
validateKeyAndCerts({ ...config, keyFile, crtFile });
|
|
51
|
+
return config;
|
|
52
|
+
}
|
|
53
|
+
return isHttps;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = getHttpsConfig;
|
package/config/paths.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* eslint-disable import/no-dynamic-require */
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
// Make sure any symlinks in the project folder are resolved:
|
|
7
|
+
// https://github.com/facebook/create-react-app/issues/637
|
|
8
|
+
const appDirectory = fs.realpathSync(process.cwd());
|
|
9
|
+
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
10
|
+
|
|
11
|
+
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
|
|
12
|
+
// "public path" at which the app is served.
|
|
13
|
+
// webpack needs to know it to put the right <script> hrefs into HTML even in
|
|
14
|
+
// single-page apps that may serve index.html for nested URLs like /todos/42.
|
|
15
|
+
// We can't use a relative path in HTML because we don't want to load something
|
|
16
|
+
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
|
|
17
|
+
const publicUrlOrPath = '/';
|
|
18
|
+
|
|
19
|
+
const buildPath = process.env.BUILD_PATH || 'build';
|
|
20
|
+
|
|
21
|
+
const moduleFileExtensions = [
|
|
22
|
+
'web.mjs',
|
|
23
|
+
'mjs',
|
|
24
|
+
'web.js',
|
|
25
|
+
'js',
|
|
26
|
+
'web.ts',
|
|
27
|
+
'ts',
|
|
28
|
+
'web.tsx',
|
|
29
|
+
'tsx',
|
|
30
|
+
'json',
|
|
31
|
+
'web.jsx',
|
|
32
|
+
'jsx',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
// Resolve file paths in the same order as webpack
|
|
36
|
+
const resolveModule = (resolveFn, filePath) => {
|
|
37
|
+
const extension = moduleFileExtensions.find(ext =>
|
|
38
|
+
fs.existsSync(resolveFn(`${filePath}.${ext}`)));
|
|
39
|
+
|
|
40
|
+
if (extension) {
|
|
41
|
+
return resolveFn(`${filePath}.${extension}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return resolveFn(`${filePath}.js`);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// config after eject: we're in ./config/
|
|
48
|
+
module.exports = {
|
|
49
|
+
dotenv: resolveApp('.env'),
|
|
50
|
+
appPath: resolveApp('.'),
|
|
51
|
+
appBuild: resolveApp(buildPath),
|
|
52
|
+
appPublic: resolveApp('src/demo'),
|
|
53
|
+
appHtml: resolveApp('src/demo/index.html'),
|
|
54
|
+
appIndexJs: resolveModule(resolveApp, 'src/demo/index'),
|
|
55
|
+
appPackageJson: resolveApp('package.json'),
|
|
56
|
+
appSrc: resolveApp('src'),
|
|
57
|
+
appTsConfig: resolveApp('tsconfig.json'),
|
|
58
|
+
appJsConfig: resolveApp('jsconfig.json'),
|
|
59
|
+
yarnLockFile: resolveApp('yarn.lock'),
|
|
60
|
+
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
|
|
61
|
+
proxySetup: resolveApp('src/setupProxy.js'),
|
|
62
|
+
appNodeModules: resolveApp('node_modules'),
|
|
63
|
+
appWebpackCache: resolveApp('node_modules/.cache'),
|
|
64
|
+
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
|
|
65
|
+
swSrc: resolveModule(resolveApp, 'src/service-worker'),
|
|
66
|
+
publicUrlOrPath,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// @remove-on-eject-begin
|
|
70
|
+
const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath);
|
|
71
|
+
|
|
72
|
+
// config before eject: we're in ./node_modules/react-scripts/config/
|
|
73
|
+
module.exports = {
|
|
74
|
+
dotenv: resolveApp('.env'),
|
|
75
|
+
appPath: resolveApp('.'),
|
|
76
|
+
appBuild: resolveApp(buildPath),
|
|
77
|
+
appPublic: resolveApp('src/demo'),
|
|
78
|
+
appHtml: resolveApp('src/demo/index.html'),
|
|
79
|
+
appIndexJs: resolveModule(resolveApp, 'src/demo/index'),
|
|
80
|
+
appPackageJson: resolveApp('package.json'),
|
|
81
|
+
appSrc: resolveApp('src'),
|
|
82
|
+
appTsConfig: resolveApp('tsconfig.json'),
|
|
83
|
+
appJsConfig: resolveApp('jsconfig.json'),
|
|
84
|
+
yarnLockFile: resolveApp('yarn.lock'),
|
|
85
|
+
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
|
|
86
|
+
proxySetup: resolveApp('src/setupProxy.js'),
|
|
87
|
+
appNodeModules: resolveApp('node_modules'),
|
|
88
|
+
appWebpackCache: resolveApp('node_modules/.cache'),
|
|
89
|
+
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
|
|
90
|
+
swSrc: resolveModule(resolveApp, 'src/service-worker'),
|
|
91
|
+
publicUrlOrPath,
|
|
92
|
+
// These properties only exist before ejecting:
|
|
93
|
+
ownPath: resolveOwn('.'),
|
|
94
|
+
ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
|
|
95
|
+
appTypeDeclarations: resolveApp('src/react-app-env.d.ts'),
|
|
96
|
+
ownTypeDeclarations: resolveOwn('lib/react-app.d.ts'),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const ownPackageJson = require('../package.json');
|
|
100
|
+
|
|
101
|
+
const reactScriptsPath = resolveApp(`node_modules/${ownPackageJson.name}`);
|
|
102
|
+
const reactScriptsLinked =
|
|
103
|
+
fs.existsSync(reactScriptsPath) &&
|
|
104
|
+
fs.lstatSync(reactScriptsPath).isSymbolicLink();
|
|
105
|
+
|
|
106
|
+
// config before publish: we're in ./packages/react-scripts/config/
|
|
107
|
+
if (
|
|
108
|
+
!reactScriptsLinked &&
|
|
109
|
+
__dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1
|
|
110
|
+
) {
|
|
111
|
+
const templatePath = '../cra-template/template';
|
|
112
|
+
module.exports = {
|
|
113
|
+
dotenv: resolveOwn(`${templatePath}/.env`),
|
|
114
|
+
appPath: resolveApp('.'),
|
|
115
|
+
appBuild: resolveOwn(path.join('../..', buildPath)),
|
|
116
|
+
appPublic: resolveOwn(`${templatePath}/public`),
|
|
117
|
+
appHtml: resolveOwn(`${templatePath}/public/index.html`),
|
|
118
|
+
appIndexJs: resolveModule(resolveOwn, `${templatePath}/src/index`),
|
|
119
|
+
appPackageJson: resolveOwn('package.json'),
|
|
120
|
+
appSrc: resolveOwn(`${templatePath}/src`),
|
|
121
|
+
appTsConfig: resolveOwn(`${templatePath}/tsconfig.json`),
|
|
122
|
+
appJsConfig: resolveOwn(`${templatePath}/jsconfig.json`),
|
|
123
|
+
yarnLockFile: resolveOwn(`${templatePath}/yarn.lock`),
|
|
124
|
+
testsSetup: resolveModule(resolveOwn, `${templatePath}/src/setupTests`),
|
|
125
|
+
proxySetup: resolveOwn(`${templatePath}/src/setupProxy.js`),
|
|
126
|
+
appNodeModules: resolveOwn('node_modules'),
|
|
127
|
+
appWebpackCache: resolveOwn('node_modules/.cache'),
|
|
128
|
+
appTsBuildInfoFile: resolveOwn('node_modules/.cache/tsconfig.tsbuildinfo'),
|
|
129
|
+
swSrc: resolveModule(resolveOwn, `${templatePath}/src/service-worker`),
|
|
130
|
+
publicUrlOrPath,
|
|
131
|
+
// These properties only exist before ejecting:
|
|
132
|
+
ownPath: resolveOwn('.'),
|
|
133
|
+
ownNodeModules: resolveOwn('node_modules'),
|
|
134
|
+
appTypeDeclarations: resolveOwn(`${templatePath}/src/react-app-env.d.ts`),
|
|
135
|
+
ownTypeDeclarations: resolveOwn('lib/react-app.d.ts'),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// @remove-on-eject-end
|
|
139
|
+
|
|
140
|
+
module.exports.moduleFileExtensions = moduleFileExtensions;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* eslint-disable global-require */
|
|
2
|
+
/* eslint-disable import/no-dynamic-require */
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
|
|
6
|
+
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
|
|
7
|
+
const ignoredFiles = require('react-dev-utils/ignoredFiles');
|
|
8
|
+
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
|
|
9
|
+
const paths = require('./paths');
|
|
10
|
+
const getHttpsConfig = require('./getHttpsConfig');
|
|
11
|
+
|
|
12
|
+
const host = process.env.HOST || '0.0.0.0';
|
|
13
|
+
const sockHost = process.env.WDS_SOCKET_HOST;
|
|
14
|
+
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
|
|
15
|
+
const sockPort = process.env.WDS_SOCKET_PORT;
|
|
16
|
+
|
|
17
|
+
module.exports = function (proxy, allowedHost) {
|
|
18
|
+
const disableFirewall =
|
|
19
|
+
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
|
|
20
|
+
return {
|
|
21
|
+
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
|
|
22
|
+
// websites from potentially accessing local content through DNS rebinding:
|
|
23
|
+
// https://github.com/webpack/webpack-dev-server/issues/887
|
|
24
|
+
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
|
|
25
|
+
// However, it made several existing use cases such as development in cloud
|
|
26
|
+
// environment or subdomains in development significantly more complicated:
|
|
27
|
+
// https://github.com/facebook/create-react-app/issues/2271
|
|
28
|
+
// https://github.com/facebook/create-react-app/issues/2233
|
|
29
|
+
// While we're investigating better solutions, for now we will take a
|
|
30
|
+
// compromise. Since our WDS configuration only serves files in the `public`
|
|
31
|
+
// folder we won't consider accessing them a vulnerability. However, if you
|
|
32
|
+
// use the `proxy` feature, it gets more dangerous because it can expose
|
|
33
|
+
// remote code execution vulnerabilities in backends like Django and Rails.
|
|
34
|
+
// So we will disable the host check normally, but enable it if you have
|
|
35
|
+
// specified the `proxy` setting. Finally, we let you override it if you
|
|
36
|
+
// really know what you're doing with a special environment variable.
|
|
37
|
+
// Note: ["localhost", ".localhost"] will support subdomains - but we might
|
|
38
|
+
// want to allow setting the allowedHosts manually for more complex setups
|
|
39
|
+
allowedHosts: disableFirewall ? 'all' : [allowedHost],
|
|
40
|
+
headers: {
|
|
41
|
+
'Access-Control-Allow-Origin': '*',
|
|
42
|
+
'Access-Control-Allow-Methods': '*',
|
|
43
|
+
'Access-Control-Allow-Headers': '*',
|
|
44
|
+
},
|
|
45
|
+
// Enable gzip compression of generated files.
|
|
46
|
+
compress: true,
|
|
47
|
+
static: {
|
|
48
|
+
// By default WebpackDevServer serves physical files from current directory
|
|
49
|
+
// in addition to all the virtual build products that it serves from memory.
|
|
50
|
+
// This is confusing because those files won’t automatically be available in
|
|
51
|
+
// production build folder unless we copy them. However, copying the whole
|
|
52
|
+
// project directory is dangerous because we may expose sensitive files.
|
|
53
|
+
// Instead, we establish a convention that only files in `public` directory
|
|
54
|
+
// get served. Our build script will copy `public` into the `build` folder.
|
|
55
|
+
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
|
|
56
|
+
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
|
|
57
|
+
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
|
|
58
|
+
// Note that we only recommend to use `public` folder as an escape hatch
|
|
59
|
+
// for files like `favicon.ico`, `manifest.json`, and libraries that are
|
|
60
|
+
// for some reason broken when imported through webpack. If you just want to
|
|
61
|
+
// use an image, put it in `src` and `import` it from JavaScript instead.
|
|
62
|
+
directory: paths.appPublic,
|
|
63
|
+
publicPath: [paths.publicUrlOrPath],
|
|
64
|
+
// By default files from `contentBase` will not trigger a page reload.
|
|
65
|
+
watch: {
|
|
66
|
+
// Reportedly, this avoids CPU overload on some systems.
|
|
67
|
+
// https://github.com/facebook/create-react-app/issues/293
|
|
68
|
+
// src/node_modules is not ignored to support absolute imports
|
|
69
|
+
// https://github.com/facebook/create-react-app/issues/1065
|
|
70
|
+
ignored: ignoredFiles(paths.appSrc),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
client: {
|
|
74
|
+
webSocketURL: {
|
|
75
|
+
// Enable custom sockjs pathname for websocket connection to hot reloading server.
|
|
76
|
+
// Enable custom sockjs hostname, pathname and port for websocket connection
|
|
77
|
+
// to hot reloading server.
|
|
78
|
+
hostname: sockHost,
|
|
79
|
+
pathname: sockPath,
|
|
80
|
+
port: sockPort,
|
|
81
|
+
},
|
|
82
|
+
overlay: {
|
|
83
|
+
errors: true,
|
|
84
|
+
warnings: false,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
devMiddleware: {
|
|
88
|
+
// It is important to tell WebpackDevServer to use the same "publicPath" path as
|
|
89
|
+
// we specified in the webpack config. When homepage is '.', default to serving
|
|
90
|
+
// from the root.
|
|
91
|
+
// remove last slash so user can land on `/test` instead of `/test/`
|
|
92
|
+
publicPath: paths.publicUrlOrPath.slice(0, -1),
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
https: getHttpsConfig(),
|
|
96
|
+
host,
|
|
97
|
+
historyApiFallback: {
|
|
98
|
+
// Paths with dots should still use the history fallback.
|
|
99
|
+
// See https://github.com/facebook/create-react-app/issues/387.
|
|
100
|
+
disableDotRule: true,
|
|
101
|
+
index: paths.publicUrlOrPath,
|
|
102
|
+
},
|
|
103
|
+
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
|
|
104
|
+
proxy,
|
|
105
|
+
onBeforeSetupMiddleware(devServer) {
|
|
106
|
+
// Keep `evalSourceMapMiddleware`
|
|
107
|
+
// middlewares before `redirectServedPath` otherwise will not have any effect
|
|
108
|
+
// This lets us fetch source contents from webpack for the error overlay
|
|
109
|
+
devServer.app.use(evalSourceMapMiddleware(devServer));
|
|
110
|
+
|
|
111
|
+
if (fs.existsSync(paths.proxySetup)) {
|
|
112
|
+
// This registers user provided middleware for proxy reasons
|
|
113
|
+
require(paths.proxySetup)(devServer.app);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
onAfterSetupMiddleware(devServer) {
|
|
117
|
+
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
|
|
118
|
+
devServer.app.use(redirectServedPath(paths.publicUrlOrPath));
|
|
119
|
+
|
|
120
|
+
// This service worker file is effectively a 'no-op' that will reset any
|
|
121
|
+
// previous service worker registered for the same host:port combination.
|
|
122
|
+
// We do this in development to avoid hitting the production cache if
|
|
123
|
+
// it used the same host and port.
|
|
124
|
+
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
|
125
|
+
devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
};
|
package/jest.config.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
roots: ['<rootDir>'],
|
|
3
3
|
transform: {
|
|
4
|
-
'\\.(js|jsx)?$': 'babel-jest',
|
|
4
|
+
'\\.(js|jsx|tsx|ts)?$': 'babel-jest',
|
|
5
5
|
},
|
|
6
6
|
testMatch: [
|
|
7
|
-
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}',
|
|
7
|
+
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}',
|
|
8
8
|
],
|
|
9
|
-
moduleFileExtensions: ['js', 'jsx', 'json', 'node'],
|
|
9
|
+
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
|
|
10
10
|
testPathIgnorePatterns: ['/node_modules/', '/public/'],
|
|
11
11
|
setupFilesAfterEnv: [
|
|
12
12
|
'@testing-library/jest-dom/extend-expect',
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare type PermissionAttr = {
|
|
2
|
+
module?: string;
|
|
3
|
+
feature?: string;
|
|
4
|
+
operation?: string;
|
|
5
|
+
onDenied?: string;
|
|
6
|
+
};
|
|
7
|
+
declare type OnDenied = {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
unvisible?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
hideContent?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { OnDenied, PermissionAttr };
|