@onehat/ui 0.3.381 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +37 -9
- package/src/Components/Accordion/Accordion.js +22 -17
- package/src/Components/Blank.js +1 -3
- package/src/Components/Buttons/BackButton.js +21 -12
- package/src/Components/Buttons/Button.js +65 -13
- package/src/Components/Buttons/CartButtonWithBadge.js +14 -6
- package/src/Components/Buttons/IconButton.js +31 -74
- package/src/Components/Buttons/PlusMinusButton.js +34 -21
- package/src/Components/Buttons/ReloadButton.js +7 -8
- package/src/Components/Buttons/SquareButton.js +41 -55
- package/src/Components/Container/Container.js +55 -16
- package/src/Components/Container/ScreenContainer.js +26 -16
- package/src/Components/Container/Splitter.js +38 -25
- package/src/Components/Editor/Editor.js +3 -2
- package/src/Components/Editor/InlineEditor.js +38 -32
- package/src/Components/Filter/DateRange.js +37 -18
- package/src/Components/Filter/NumberRange.js +87 -83
- package/src/Components/Form/Field/CKEditor/CKEditor.js +4 -4
- package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +9 -6
- package/src/Components/Form/Field/Color.js +95 -86
- package/src/Components/Form/Field/Combo/Combo.js +347 -284
- package/src/Components/Form/Field/Combo/PageSizeCombo.js +4 -7
- package/src/Components/Form/Field/Date.js +276 -312
- package/src/Components/Form/Field/DisplayField.js +11 -5
- package/src/Components/Form/Field/File.js +26 -32
- package/src/Components/Form/Field/FormikForm.js +1018 -0
- package/src/Components/Form/Field/Input.js +91 -41
- package/src/Components/Form/Field/Json.js +25 -21
- package/src/Components/Form/Field/Number.js +70 -51
- package/src/Components/Form/Field/RadioGroup/RadioGroup.js +4 -6
- package/src/Components/Form/Field/Select/PageSizeSelect.js +33 -0
- package/src/Components/Form/Field/Select/Select.js +109 -0
- package/src/Components/Form/Field/Slider.js +38 -30
- package/src/Components/Form/Field/Tag/Tag.js +88 -72
- package/src/Components/Form/Field/Tag/ValueBox.js +25 -20
- package/src/Components/Form/Field/Text.js +21 -12
- package/src/Components/Form/Field/TextArea.js +32 -15
- package/src/Components/Form/Field/Toggle.js +42 -24
- package/src/Components/Form/FieldSet.js +77 -54
- package/src/Components/Form/Form.js +491 -268
- package/src/Components/Form/Label.js +28 -17
- package/src/Components/Gluestack/accordion/index.tsx +394 -0
- package/src/Components/Gluestack/actionsheet/index.tsx +619 -0
- package/src/Components/Gluestack/alert/index.tsx +310 -0
- package/src/Components/Gluestack/alert-dialog/index.tsx +295 -0
- package/src/Components/Gluestack/avatar/index.tsx +190 -0
- package/src/Components/Gluestack/badge/index.tsx +272 -0
- package/src/Components/Gluestack/bottomsheet/index.tsx +294 -0
- package/src/Components/Gluestack/box/index.tsx +19 -0
- package/src/Components/Gluestack/box/index.web.tsx +18 -0
- package/src/Components/Gluestack/box/styles.tsx +10 -0
- package/src/Components/Gluestack/button/index.tsx +494 -0
- package/src/Components/Gluestack/card/index.tsx +23 -0
- package/src/Components/Gluestack/card/index.web.tsx +22 -0
- package/src/Components/Gluestack/card/styles.tsx +20 -0
- package/src/Components/Gluestack/center/index.tsx +22 -0
- package/src/Components/Gluestack/center/index.web.tsx +19 -0
- package/src/Components/Gluestack/center/styles.tsx +8 -0
- package/src/Components/Gluestack/checkbox/index.tsx +305 -0
- package/src/Components/Gluestack/divider/index.tsx +44 -0
- package/src/Components/Gluestack/drawer/index.tsx +354 -0
- package/src/Components/Gluestack/fab/index.tsx +286 -0
- package/src/Components/Gluestack/flat-list/index.tsx +2 -0
- package/src/Components/Gluestack/form-control/index.tsx +527 -0
- package/src/Components/Gluestack/gluestack-ui-provider/config.ts +332 -0
- package/src/Components/Gluestack/gluestack-ui-provider/index.tsx +47 -0
- package/src/Components/Gluestack/gluestack-ui-provider/index.web.tsx +94 -0
- package/src/Components/Gluestack/gluestack-ui-provider/script.ts +19 -0
- package/src/Components/Gluestack/grid/index.tsx +341 -0
- package/src/Components/Gluestack/grid/index.web.tsx +65 -0
- package/src/Components/Gluestack/grid/styles.tsx +15 -0
- package/src/Components/Gluestack/heading/index.tsx +212 -0
- package/src/Components/Gluestack/heading/index.web.tsx +203 -0
- package/src/Components/Gluestack/heading/styles.tsx +43 -0
- package/src/Components/Gluestack/hstack/index.tsx +23 -0
- package/src/Components/Gluestack/hstack/index.web.tsx +22 -0
- package/src/Components/Gluestack/hstack/styles.tsx +25 -0
- package/src/Components/Gluestack/image/index.tsx +52 -0
- package/src/Components/Gluestack/image-background/index.tsx +21 -0
- package/src/Components/Gluestack/index.js +116 -0
- package/src/Components/Gluestack/input/index.tsx +287 -0
- package/src/Components/Gluestack/input-accessory-view/index.tsx +2 -0
- package/src/Components/Gluestack/keyboard-avoiding-view/index.tsx +2 -0
- package/src/Components/Gluestack/link/index.tsx +107 -0
- package/src/Components/Gluestack/menu/index.tsx +210 -0
- package/src/Components/Gluestack/modal/index.tsx +279 -0
- package/src/Components/Gluestack/popover/index.tsx +352 -0
- package/src/Components/Gluestack/portal/index.tsx +13 -0
- package/src/Components/Gluestack/pressable/index.tsx +46 -0
- package/src/Components/Gluestack/progress/index.tsx +164 -0
- package/src/Components/Gluestack/radio/index.tsx +304 -0
- package/src/Components/Gluestack/refresh-control/index.tsx +2 -0
- package/src/Components/Gluestack/safe-area-view/index.tsx +2 -0
- package/src/Components/Gluestack/scroll-view/index.tsx +2 -0
- package/src/Components/Gluestack/section-list/index.tsx +2 -0
- package/src/Components/Gluestack/select/index.tsx +335 -0
- package/src/Components/Gluestack/select/select-actionsheet.tsx +584 -0
- package/src/Components/Gluestack/skeleton/index.tsx +138 -0
- package/src/Components/Gluestack/skeleton/index.web.tsx +103 -0
- package/src/Components/Gluestack/skeleton/styles.tsx +35 -0
- package/src/Components/Gluestack/slider/index.tsx +283 -0
- package/src/Components/Gluestack/spinner/index.tsx +34 -0
- package/src/Components/Gluestack/status-bar/index.tsx +2 -0
- package/src/Components/Gluestack/switch/index.tsx +55 -0
- package/src/Components/Gluestack/table/index.tsx +200 -0
- package/src/Components/Gluestack/table/index.web.tsx +142 -0
- package/src/Components/Gluestack/table/styles.tsx +44 -0
- package/src/Components/Gluestack/text/index.tsx +48 -0
- package/src/Components/Gluestack/text/index.web.tsx +45 -0
- package/src/Components/Gluestack/text/styles.tsx +47 -0
- package/src/Components/Gluestack/textarea/index.tsx +108 -0
- package/src/Components/Gluestack/toast/index.tsx +225 -0
- package/src/Components/Gluestack/tooltip/index.tsx +125 -0
- package/src/Components/Gluestack/utils/use-break-point-value.ts +101 -0
- package/src/Components/Gluestack/view/index.tsx +2 -0
- package/src/Components/Gluestack/virtualized-list/index.tsx +2 -0
- package/src/Components/Gluestack/vstack/index.tsx +24 -0
- package/src/Components/Gluestack/vstack/index.web.tsx +23 -0
- package/src/Components/Gluestack/vstack/styles.tsx +25 -0
- package/src/Components/Grid/Grid.js +192 -135
- package/src/Components/Grid/GridHeaderRow.js +51 -59
- package/src/Components/Grid/GridRow.js +152 -58
- package/src/Components/Grid/HeaderColumnSelectorHandle.js +16 -10
- package/src/Components/Grid/HeaderReorderHandle.js +17 -13
- package/src/Components/Grid/HeaderResizeHandle.js +17 -13
- package/src/Components/Grid/NoRecordsFound.js +15 -18
- package/src/Components/Grid/RowDragHandle.js +9 -13
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +14 -9
- package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +14 -11
- package/src/Components/Hoc/withAlert.js +150 -200
- package/src/Components/Hoc/withBlank.js +4 -6
- package/src/Components/Hoc/withCollapsible.js +4 -3
- package/src/Components/Hoc/withComponent.js +33 -6
- package/src/Components/Hoc/withContextMenu.js +133 -141
- package/src/Components/Hoc/withData.js +5 -4
- package/src/Components/Hoc/withDnd.js +11 -9
- package/src/Components/Hoc/withDraggable.js +10 -10
- package/src/Components/Hoc/withEditor.js +18 -13
- package/src/Components/Hoc/withEvents.js +4 -6
- package/src/Components/Hoc/withFilters.js +524 -498
- package/src/Components/Hoc/withInlineEditor.js +7 -5
- package/src/Components/Hoc/withModal.js +79 -137
- package/src/Components/Hoc/withMultiSelection.js +4 -2
- package/src/Components/Hoc/withPdfButtons.js +109 -111
- package/src/Components/Hoc/withPresetButtons.js +49 -53
- package/src/Components/Hoc/withSelection.js +6 -5
- package/src/Components/Hoc/withSideEditor.js +12 -6
- package/src/Components/Hoc/withTooltip.js +18 -12
- package/src/Components/Hoc/withValue.js +6 -5
- package/src/Components/Hoc/withWindowedEditor.js +13 -11
- package/src/Components/Icons/AddressBook.js +7 -10
- package/src/Components/Icons/Alt.js +8 -15
- package/src/Components/Icons/AngleLeft.js +7 -14
- package/src/Components/Icons/AngleRight.js +7 -14
- package/src/Components/Icons/AnglesLeft.js +7 -14
- package/src/Components/Icons/AnglesRight.js +7 -14
- package/src/Components/Icons/Asterisk.js +7 -10
- package/src/Components/Icons/Ban.js +9 -14
- package/src/Components/Icons/Bars.js +7 -10
- package/src/Components/Icons/BarsStaggered.js +7 -10
- package/src/Components/Icons/Bell.js +7 -19
- package/src/Components/Icons/BigCircle.js +7 -14
- package/src/Components/Icons/Book.js +7 -10
- package/src/Components/Icons/BookOpen.js +7 -10
- package/src/Components/Icons/Bookmark.js +8 -17
- package/src/Components/Icons/Bug.js +7 -10
- package/src/Components/Icons/Building.js +7 -10
- package/src/Components/Icons/Calendar.js +7 -14
- package/src/Components/Icons/Calendar2.js +7 -14
- package/src/Components/Icons/CalendarDays.js +7 -14
- package/src/Components/Icons/Camera.js +7 -14
- package/src/Components/Icons/CaretDown.js +7 -14
- package/src/Components/Icons/CaretUp.js +7 -14
- package/src/Components/Icons/CartPlus.js +7 -10
- package/src/Components/Icons/CartShopping.js +7 -10
- package/src/Components/Icons/CashRegister.js +7 -10
- package/src/Components/Icons/Certificate.js +7 -10
- package/src/Components/Icons/ChartLine.js +7 -10
- package/src/Components/Icons/ChartPie.js +7 -10
- package/src/Components/Icons/Check.js +7 -10
- package/src/Components/Icons/CheckDouble.js +7 -10
- package/src/Components/Icons/ChevronDown.js +7 -10
- package/src/Components/Icons/ChevronLeft.js +7 -10
- package/src/Components/Icons/ChevronRight.js +7 -10
- package/src/Components/Icons/ChevronUp.js +7 -10
- package/src/Components/Icons/Circle.js +7 -10
- package/src/Components/Icons/CircleArrowRight.js +7 -10
- package/src/Components/Icons/CircleExclamation.js +7 -14
- package/src/Components/Icons/CircleInfo.js +7 -10
- package/src/Components/Icons/CircleQuestion.js +7 -10
- package/src/Components/Icons/CircleXmark.js +7 -10
- package/src/Components/Icons/CircleXmarkRegular.js +7 -10
- package/src/Components/Icons/Clipboard.js +7 -14
- package/src/Components/Icons/ClipboardCheck.js +7 -17
- package/src/Components/Icons/ClipboardList.js +7 -16
- package/src/Components/Icons/Clock.js +7 -10
- package/src/Components/Icons/ClockRegular.js +7 -10
- package/src/Components/Icons/ClockRotateLeft.js +7 -10
- package/src/Components/Icons/Clone.js +7 -10
- package/src/Components/Icons/Collapse.js +7 -14
- package/src/Components/Icons/Comment.js +7 -10
- package/src/Components/Icons/CommentDots.js +7 -10
- package/src/Components/Icons/CommentRegular.js +7 -10
- package/src/Components/Icons/Comments.js +7 -10
- package/src/Components/Icons/CommentsRegular.js +7 -10
- package/src/Components/Icons/Copyright.js +7 -10
- package/src/Components/Icons/Dot.js +10 -15
- package/src/Components/Icons/Download.js +11 -0
- package/src/Components/Icons/Duplicate.js +7 -14
- package/src/Components/Icons/Edit.js +7 -14
- package/src/Components/Icons/EllipsisHorizontal.js +7 -16
- package/src/Components/Icons/EllipsisVertical.js +7 -14
- package/src/Components/Icons/Envelope.js +7 -10
- package/src/Components/Icons/EnvelopeRegular.js +7 -10
- package/src/Components/Icons/Excel.js +7 -10
- package/src/Components/Icons/Exclamation.js +7 -10
- package/src/Components/Icons/Expand.js +7 -10
- package/src/Components/Icons/Eye.js +7 -14
- package/src/Components/Icons/EyeSlash.js +7 -10
- package/src/Components/Icons/File.js +7 -14
- package/src/Components/Icons/FloppyDiskRegular.js +7 -10
- package/src/Components/Icons/Folder.js +7 -10
- package/src/Components/Icons/FolderClosed.js +7 -10
- package/src/Components/Icons/FolderOpen.js +7 -10
- package/src/Components/Icons/FolderTree.js +7 -10
- package/src/Components/Icons/FullWidth.js +10 -25
- package/src/Components/Icons/Gauge.js +7 -17
- package/src/Components/Icons/Gear.js +7 -14
- package/src/Components/Icons/Gears.js +7 -10
- package/src/Components/Icons/Gift.js +7 -10
- package/src/Components/Icons/Grip.js +7 -14
- package/src/Components/Icons/GripLines.js +7 -14
- package/src/Components/Icons/GripLinesVertical.js +7 -14
- package/src/Components/Icons/GripVertical.js +7 -14
- package/src/Components/Icons/Hammer.js +7 -10
- package/src/Components/Icons/Hand.js +7 -10
- package/src/Components/Icons/HighPriority.js +7 -17
- package/src/Components/Icons/House.js +7 -10
- package/src/Components/Icons/Images.js +7 -10
- package/src/Components/Icons/Info.js +7 -10
- package/src/Components/Icons/ItunesNote.js +7 -10
- package/src/Components/Icons/Js.js +7 -16
- package/src/Components/Icons/Leaf.js +7 -10
- package/src/Components/Icons/Link.js +7 -9
- package/src/Components/Icons/List.js +7 -10
- package/src/Components/Icons/ListCheck.js +7 -10
- package/src/Components/Icons/LocationDot.js +7 -10
- package/src/Components/Icons/Loop.js +7 -14
- package/src/Components/Icons/Loop1.js +8 -13
- package/src/Components/Icons/LoopAll.js +8 -13
- package/src/Components/Icons/LowPriority.js +7 -17
- package/src/Components/Icons/MagnifyingGlass.js +7 -10
- package/src/Components/Icons/Maximize.js +7 -10
- package/src/Components/Icons/MedPriority.js +7 -17
- package/src/Components/Icons/Microphone.js +7 -10
- package/src/Components/Icons/Minimize.js +7 -10
- package/src/Components/Icons/Minus.js +7 -14
- package/src/Components/Icons/MobileScreenButton.js +7 -10
- package/src/Components/Icons/MoneyBill.js +7 -10
- package/src/Components/Icons/MoneyBillWave.js +7 -10
- package/src/Components/Icons/Mouth.js +10 -21
- package/src/Components/Icons/Music.js +7 -10
- package/src/Components/Icons/Na.js +7 -14
- package/src/Components/Icons/NoLoop.js +11 -13
- package/src/Components/Icons/NoReorderRows.js +17 -22
- package/src/Components/Icons/ObjectGroupRegular.js +7 -10
- package/src/Components/Icons/Pause.js +7 -10
- package/src/Components/Icons/Pdf.js +7 -10
- package/src/Components/Icons/Pencil.js +7 -14
- package/src/Components/Icons/Phone.js +7 -10
- package/src/Components/Icons/Play.js +7 -10
- package/src/Components/Icons/Plus.js +7 -14
- package/src/Components/Icons/Presentation.js +7 -16
- package/src/Components/Icons/Print.js +7 -14
- package/src/Components/Icons/Question.js +7 -10
- package/src/Components/Icons/Rate-.25x.js +12 -17
- package/src/Components/Icons/Rate-.5x.js +11 -16
- package/src/Components/Icons/Rate-.75x.js +8 -13
- package/src/Components/Icons/Rate-1.25x.js +8 -13
- package/src/Components/Icons/Rate-1.5x.js +8 -13
- package/src/Components/Icons/Rate-1.75x.js +8 -13
- package/src/Components/Icons/Rate-1x.js +11 -16
- package/src/Components/Icons/Rate-2x.js +8 -13
- package/src/Components/Icons/RateIcon-.25x.js +8 -13
- package/src/Components/Icons/RateIcon-.5x.js +11 -16
- package/src/Components/Icons/RateIcon-.75x.js +8 -13
- package/src/Components/Icons/RateIcon-1.25x.js +8 -13
- package/src/Components/Icons/RateIcon-1.5x.js +8 -13
- package/src/Components/Icons/RateIcon-1.75x.js +8 -13
- package/src/Components/Icons/RateIcon-1x.js +8 -13
- package/src/Components/Icons/RateIcon-2x.js +8 -13
- package/src/Components/Icons/RectangleXmark.js +7 -10
- package/src/Components/Icons/RectangleXmarkRegular.js +7 -10
- package/src/Components/Icons/ReorderRows.js +8 -13
- package/src/Components/Icons/RightFromBracket.js +7 -10
- package/src/Components/Icons/RightLeft.js +7 -10
- package/src/Components/Icons/RightToBracket.js +7 -10
- package/src/Components/Icons/Rotate.js +7 -14
- package/src/Components/Icons/RotateLeft.js +7 -10
- package/src/Components/Icons/RotateRight.js +7 -14
- package/src/Components/Icons/ScrewdriverWrench.js +7 -10
- package/src/Components/Icons/Scroll.js +7 -10
- package/src/Components/Icons/Share.js +7 -10
- package/src/Components/Icons/Shop.js +7 -10
- package/src/Components/Icons/SideBySide.js +7 -20
- package/src/Components/Icons/SortDown.js +7 -10
- package/src/Components/Icons/SortDownAlt.js +7 -10
- package/src/Components/Icons/SortUp.js +7 -10
- package/src/Components/Icons/SortUpAlt.js +7 -14
- package/src/Components/Icons/Square.js +7 -10
- package/src/Components/Icons/SquareCheck.js +7 -10
- package/src/Components/Icons/SquareCheckRegular.js +7 -10
- package/src/Components/Icons/SquareMinus.js +7 -14
- package/src/Components/Icons/SquareRegular.js +7 -10
- package/src/Components/Icons/Store.js +7 -10
- package/src/Components/Icons/Table.js +7 -16
- package/src/Components/Icons/ThumbsDown.js +7 -10
- package/src/Components/Icons/ThumbsDownRegular.js +7 -10
- package/src/Components/Icons/ThumbsUp.js +7 -10
- package/src/Components/Icons/ThumbsUpRegular.js +7 -10
- package/src/Components/Icons/Trash.js +7 -14
- package/src/Components/Icons/TrashCan.js +7 -14
- package/src/Components/Icons/TriangleExclamation.js +7 -14
- package/src/Components/Icons/Truck.js +7 -10
- package/src/Components/Icons/TruckFast.js +7 -10
- package/src/Components/Icons/Upload.js +11 -0
- package/src/Components/Icons/UploadDownload.js +11 -11
- package/src/Components/Icons/User.js +7 -10
- package/src/Components/Icons/UserGroup.js +7 -10
- package/src/Components/Icons/UserPlus.js +7 -10
- package/src/Components/Icons/UserSecret.js +7 -10
- package/src/Components/Icons/Video.js +7 -16
- package/src/Components/Icons/X.js +7 -10
- package/src/Components/Icons/Xmark.js +7 -10
- package/src/Components/Layout/CenterBox.js +13 -9
- package/src/Components/Layout/Footer.js +20 -13
- package/src/Components/Messages/ConfirmationMessage.js +30 -13
- package/src/Components/Messages/ErrorMessage.js +29 -23
- package/src/Components/Messages/Loading.js +10 -8
- package/src/Components/Messages/OkMessage.js +30 -13
- package/src/Components/Messages/Unauthorized.js +5 -8
- package/src/Components/Messages/WaitMessage.js +37 -73
- package/src/Components/Panel/AccordionGridPanel.js +6 -6
- package/src/Components/Panel/FormPanel.js +7 -3
- package/src/Components/Panel/Header.js +132 -94
- package/src/Components/Panel/Mask.js +4 -4
- package/src/Components/Panel/Panel.js +55 -72
- package/src/Components/Panel/TabPanel.js +1 -1
- package/src/Components/Picker/Picker.js +10 -9
- package/src/Components/Report/Report.js +17 -14
- package/src/Components/Screens/Manager.js +22 -22
- package/src/Components/Tab/TabBar.js +293 -225
- package/src/Components/Toolbar/FilterToolbar.js +15 -11
- package/src/Components/Toolbar/Pagination.js +51 -46
- package/src/Components/Toolbar/PaginationToolbar.js +25 -19
- package/src/Components/Toolbar/Toolbar.js +26 -13
- package/src/Components/Tooltip/Tooltip.js +35 -0
- package/src/Components/Tree/Tree.js +134 -140
- package/src/Components/Tree/TreeNode.js +75 -36
- package/src/Components/Viewer/Viewer.js +203 -80
- package/src/Components/Window/Editor.js +0 -5
- package/src/Components/Window/UploadsDownloadsWindow.js +40 -22
- package/src/Components/index.js +11 -8
- package/src/Constants/Alert.js +0 -0
- package/src/Constants/AppStates.js +0 -0
- package/src/Constants/Colors.js +13 -0
- package/src/Constants/Commands.js +0 -0
- package/src/Constants/Date.js +0 -0
- package/src/Constants/Dates.js +16 -0
- package/src/Constants/Directions.js +0 -0
- package/src/Constants/Editor.js +0 -0
- package/src/Constants/EditorModes.js +2 -0
- package/src/Constants/File.js +0 -0
- package/src/Constants/Filters.js +0 -0
- package/src/Constants/Grid.js +0 -0
- package/src/Constants/Input.js +1 -0
- package/src/Constants/MimeTypes.js +0 -0
- package/src/Constants/Selection.js +0 -0
- package/src/Constants/Styles.js +119 -108
- package/src/Constants/Tasks.js +3 -0
- package/src/Constants/Tree.js +0 -0
- package/src/Constants/UiModes.js +4 -3
- package/src/Functions/BankersRound.js +0 -0
- package/src/Functions/Cypress/button_functions.js +0 -0
- package/src/Functions/Cypress/crud_functions.js +0 -0
- package/src/Functions/Cypress/dom_functions.js +0 -0
- package/src/Functions/Cypress/grid_functions.js +0 -0
- package/src/Functions/Cypress/navigation_functions.js +0 -0
- package/src/Functions/Cypress/tree_functions.js +0 -0
- package/src/Functions/Cypress/utilities.js +0 -0
- package/src/Functions/PlatformDetector.js +0 -0
- package/src/Functions/Timer.js +0 -0
- package/src/Functions/buildAdditionalButtons.js +5 -5
- package/src/Functions/chunkArray.js +0 -0
- package/src/Functions/colorConversions.js +74 -0
- package/src/Functions/delay.js +0 -0
- package/src/Functions/delayUntil.js +0 -0
- package/src/Functions/deleteSaved.js +0 -0
- package/src/Functions/deleteSecure.js +0 -0
- package/src/Functions/downloadInBackground.js +0 -0
- package/src/Functions/downloadWithFetch.js +0 -0
- package/src/Functions/emptyFn.js +0 -0
- package/src/Functions/getComponentFromType.js +0 -0
- package/src/Functions/getIconButtonFromConfig.js +5 -9
- package/src/Functions/getIsMobile.js +0 -0
- package/src/Functions/getNodeIcon.js +28 -0
- package/src/Functions/getPref.js +0 -0
- package/src/Functions/getSaved.js +0 -0
- package/src/Functions/getSecure.js +0 -0
- package/src/Functions/getTokenHeaders.js +0 -0
- package/src/Functions/gsToHex.js +205 -0
- package/src/Functions/ignoreWanings.js +46 -0
- package/src/Functions/inArray.js +0 -0
- package/src/Functions/isJson.js +0 -0
- package/src/Functions/isSerializable.js +0 -0
- package/src/Functions/isVideo.js +0 -0
- package/src/Functions/jsonValidator.js +0 -0
- package/src/Functions/nbToRgb.js +1 -1
- package/src/Functions/objectToClassName.js +72 -0
- package/src/Functions/parseNotification.js +0 -0
- package/src/Functions/processImage.js +0 -0
- package/src/Functions/registerReactNativeComponents.js +0 -0
- package/src/Functions/registerWebComponents.js +0 -0
- package/src/Functions/setCustomInflector.js +0 -0
- package/src/Functions/setPref.js +0 -0
- package/src/Functions/setProgress.js +0 -0
- package/src/Functions/setSaved.js +0 -0
- package/src/Functions/setSecure.js +0 -0
- package/src/Functions/setThemeOverrides.js +0 -0
- package/src/Functions/setUiSavesRepo.js +0 -0
- package/src/Functions/sleep.js +0 -0
- package/src/Functions/tailwindFunctions.js +384 -0
- package/src/Functions/testProps.js +0 -0
- package/src/Functions/trackEngagementHit.js +0 -0
- package/src/Functions/verifyCompleted.js +0 -0
- package/src/Functions/waitFor.js +2 -2
- package/src/PlatformImports/Web/Attachments.js +32 -38
- package/src/PlatformImports/Web/File.js +38 -31
- package/src/UiGlobals.js +8 -1
- package/src/Components/Grid/ColumnSelectorWindow.js +0 -125
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useRef, useState, useEffect, } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
Box,
|
|
4
|
-
Column,
|
|
5
|
-
FlatList,
|
|
6
|
-
Icon,
|
|
7
|
-
Modal,
|
|
8
|
-
Pressable,
|
|
9
|
-
Row,
|
|
10
|
-
Spacer,
|
|
11
3
|
Text,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
CURRENT_MODE,
|
|
16
|
-
} from '../../Constants/UiModes.js';
|
|
4
|
+
VStack,
|
|
5
|
+
} from '../Gluestack';
|
|
6
|
+
import Button from '../Buttons/Button.js';
|
|
17
7
|
import testProps from '../../Functions/testProps.js';
|
|
18
8
|
import _ from 'lodash';
|
|
19
9
|
|
|
20
|
-
const
|
|
10
|
+
const
|
|
11
|
+
CONTEXT_MENU_WIDTH = 180,
|
|
12
|
+
CONTEXT_MENU_ITEM_HEIGHT = 30;
|
|
21
13
|
|
|
22
14
|
export default function withContextMenu(WrappedComponent) {
|
|
23
|
-
return (props) => {
|
|
15
|
+
return forwardRef((props, ref) => {
|
|
24
16
|
const {
|
|
25
17
|
// extract and pass
|
|
26
18
|
disableContextMenu = false,
|
|
@@ -30,14 +22,18 @@ export default function withContextMenu(WrappedComponent) {
|
|
|
30
22
|
{
|
|
31
23
|
// for local use
|
|
32
24
|
selection,
|
|
33
|
-
setSelection,
|
|
25
|
+
setSelection,
|
|
26
|
+
|
|
27
|
+
// withModal
|
|
28
|
+
showModal,
|
|
29
|
+
hideModal,
|
|
30
|
+
isModalShown,
|
|
31
|
+
whichModal,
|
|
34
32
|
} = props,
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
|
|
39
|
-
[contextMenuItemComponents, setContextMenuItemComponents] = useState([]),
|
|
40
|
-
onContextMenu = (entity, e, selection, setSelection) => {
|
|
33
|
+
[doShowContextMenu, setDoShowContextMenu] = useState(false),
|
|
34
|
+
[left, setLeft] = useState(0),
|
|
35
|
+
[top, setTop] = useState(0),
|
|
36
|
+
onContextMenu = (entity, e, selection) => {
|
|
41
37
|
if (disableContextMenu) {
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
@@ -45,133 +41,129 @@ export default function withContextMenu(WrappedComponent) {
|
|
|
45
41
|
// No current selections, so select this row so operations apply to it
|
|
46
42
|
setSelection([entity]);
|
|
47
43
|
}
|
|
48
|
-
|
|
49
|
-
setIsContextMenuShown(true);
|
|
50
|
-
setContextMenuX(e.nativeEvent.pageX);
|
|
51
|
-
setContextMenuY(e.nativeEvent.pageY);
|
|
52
|
-
},
|
|
53
|
-
onLayout = (e) => {
|
|
54
|
-
if (CURRENT_MODE !== UI_MODE_WEB) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
{
|
|
60
|
-
top,
|
|
61
|
-
left,
|
|
62
|
-
// width,
|
|
63
|
-
height,
|
|
64
|
-
} = e.nativeEvent.layout,
|
|
65
|
-
screenWidth = window.innerWidth,
|
|
66
|
-
screenHeight = window.innerHeight,
|
|
67
|
-
width = CONTEXT_MENU_WIDTH;
|
|
68
44
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
setDoShowContextMenu(true);
|
|
46
|
+
setLeft(e.nativeEvent.pageX);
|
|
47
|
+
setTop(e.nativeEvent.pageY);
|
|
48
|
+
},
|
|
49
|
+
createContextMenuItemComponents = () => {
|
|
50
|
+
const contextMenuItemComponents = _.map(contextMenuItems, (config, ix) => {
|
|
51
|
+
let {
|
|
52
|
+
text,
|
|
53
|
+
handler,
|
|
54
|
+
icon = null,
|
|
55
|
+
isDisabled = false,
|
|
56
|
+
} = config;
|
|
57
|
+
|
|
58
|
+
return <Button
|
|
59
|
+
{...testProps('contextMenuBtn-' + text)}
|
|
60
|
+
key={ix}
|
|
61
|
+
onPress={() => {
|
|
62
|
+
hideModal();
|
|
63
|
+
handler(selection);
|
|
64
|
+
}}
|
|
65
|
+
isDisabled={isDisabled}
|
|
66
|
+
icon={icon}
|
|
67
|
+
_icon={{
|
|
68
|
+
className: `
|
|
69
|
+
ml-2
|
|
70
|
+
self-center
|
|
71
|
+
`,
|
|
72
|
+
}}
|
|
73
|
+
text={text}
|
|
74
|
+
_text={{
|
|
75
|
+
className: `
|
|
76
|
+
flex-1
|
|
77
|
+
select-none
|
|
78
|
+
text-black
|
|
79
|
+
`,
|
|
80
|
+
}}
|
|
81
|
+
className={`
|
|
82
|
+
flex-row
|
|
83
|
+
border-b-2
|
|
84
|
+
border-b-grey-200
|
|
85
|
+
py-2
|
|
86
|
+
px-4
|
|
87
|
+
select-none
|
|
88
|
+
rounded-none
|
|
89
|
+
`}
|
|
90
|
+
variant="outline"
|
|
91
|
+
action="secondary"
|
|
92
|
+
/>;
|
|
93
|
+
});
|
|
94
|
+
const showId = true; // TODO: This should only be for local dev
|
|
95
|
+
if (showId) {
|
|
96
|
+
contextMenuItemComponents.push(<Text key="idViewer" className="flex-1 py-2 px-4 select-none">id: {selection?.[0]?.id}</Text>);
|
|
74
97
|
}
|
|
98
|
+
return contextMenuItemComponents;
|
|
75
99
|
};
|
|
76
|
-
|
|
100
|
+
|
|
77
101
|
useEffect(() => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
alignSelf: 'center',
|
|
89
|
-
size: 'sm',
|
|
90
|
-
color: isDisabled ? 'disabled' : 'trueGray.800',
|
|
91
|
-
h: 20,
|
|
92
|
-
w: 20,
|
|
93
|
-
mr: 2,
|
|
94
|
-
};
|
|
95
|
-
if (React.isValidElement(icon)) {
|
|
96
|
-
icon = React.cloneElement(icon, {...iconProps});
|
|
97
|
-
} else {
|
|
98
|
-
icon = <Icon as={icon} {...iconProps} />;
|
|
99
|
-
}
|
|
102
|
+
// First time after onContextMenu is called, doShowContextMenu will be true.
|
|
103
|
+
// Next times, it will be false, whichModal will be 'contextMenu'
|
|
104
|
+
if (!doShowContextMenu) {
|
|
105
|
+
if (!isModalShown) {
|
|
106
|
+
// Do not update if no modal is shown
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (whichModal !== 'contextMenu') {
|
|
110
|
+
// Do not update the contextMenu when other types of modals are shown
|
|
111
|
+
return;
|
|
100
112
|
}
|
|
113
|
+
}
|
|
101
114
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
// useEffect() will be called once when doShowContextMenu is set,
|
|
116
|
+
// (this will show the context menu), and then again if the
|
|
117
|
+
// contextMenuItems change. This is necessary because they
|
|
118
|
+
// may change based on the selection; and this is why we're using
|
|
119
|
+
// useEffect to show the context menu instead of onContextMenu.
|
|
106
120
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
userSelect: 'none',
|
|
125
|
-
}}
|
|
126
|
-
userSelect="none"
|
|
127
|
-
>
|
|
128
|
-
{icon}
|
|
129
|
-
<Text
|
|
130
|
-
flex={1}
|
|
131
|
-
color={isDisabled ? 'disabled' : 'trueGray.800'}
|
|
132
|
-
numberOfLines={1}
|
|
133
|
-
ellipsizeMode="head"
|
|
134
|
-
style={{
|
|
135
|
-
userSelect: 'none',
|
|
136
|
-
}}
|
|
137
|
-
userSelect="none"
|
|
138
|
-
>{text}</Text>
|
|
139
|
-
</Pressable>;
|
|
140
|
-
});
|
|
141
|
-
const showId = true; // TODO: This should only be for local dev
|
|
142
|
-
if (showId) {
|
|
143
|
-
contextMenuItemComponents.push(<Text
|
|
144
|
-
key="idViewer"
|
|
145
|
-
flex={1}
|
|
146
|
-
py={2}
|
|
147
|
-
px={4}
|
|
148
|
-
userSelect="none"
|
|
149
|
-
>id: {selection?.[0]?.id}</Text>);
|
|
121
|
+
// show context menu
|
|
122
|
+
const
|
|
123
|
+
contextMenuItemComponents = createContextMenuItemComponents(),
|
|
124
|
+
className = `
|
|
125
|
+
context-menu-container
|
|
126
|
+
absolute
|
|
127
|
+
border
|
|
128
|
+
border-grey-400
|
|
129
|
+
shadow-lg
|
|
130
|
+
bg-white
|
|
131
|
+
`,
|
|
132
|
+
screenWidth = window.innerWidth,
|
|
133
|
+
screenHeight = window.innerHeight;
|
|
134
|
+
let l = left,
|
|
135
|
+
t = top;
|
|
136
|
+
if (screenWidth - CONTEXT_MENU_WIDTH < l) {
|
|
137
|
+
l = screenWidth - CONTEXT_MENU_WIDTH;
|
|
150
138
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (!isReady) {
|
|
154
|
-
setIsReady(true);
|
|
139
|
+
if (screenHeight - (contextMenuItemComponents.length * CONTEXT_MENU_ITEM_HEIGHT) < t) {
|
|
140
|
+
t = screenHeight - (contextMenuItemComponents.length * CONTEXT_MENU_ITEM_HEIGHT);
|
|
155
141
|
}
|
|
156
|
-
|
|
142
|
+
const style = {
|
|
143
|
+
left: l,
|
|
144
|
+
top: t,
|
|
145
|
+
width: CONTEXT_MENU_WIDTH,
|
|
146
|
+
};
|
|
157
147
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
148
|
+
showModal({
|
|
149
|
+
body: <VStack
|
|
150
|
+
className={className}
|
|
151
|
+
style={style}
|
|
152
|
+
>{contextMenuItemComponents}</VStack>,
|
|
153
|
+
onCancel: hideModal,
|
|
154
|
+
whichModal: 'contextMenu',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (doShowContextMenu) {
|
|
158
|
+
setDoShowContextMenu(false);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}, [doShowContextMenu, isModalShown, whichModal]); // don't include contextMenuItems, as it will cause infinite loop
|
|
161
162
|
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
isOpen={isContextMenuShown && !disableContextMenu}
|
|
169
|
-
onClose={() => setIsContextMenuShown(false)}
|
|
170
|
-
>
|
|
171
|
-
<Column bg="#fff" w={CONTEXT_MENU_WIDTH} position="absolute" top={contextMenuY} left={contextMenuX} onLayout={onLayout}>
|
|
172
|
-
{contextMenuItemComponents}
|
|
173
|
-
</Column>
|
|
174
|
-
</Modal>
|
|
175
|
-
</>;
|
|
176
|
-
};
|
|
163
|
+
return <WrappedComponent
|
|
164
|
+
{...propsToPass}
|
|
165
|
+
ref={ref}
|
|
166
|
+
onContextMenu={onContextMenu}
|
|
167
|
+
/>;
|
|
168
|
+
});
|
|
177
169
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect, } from 'react';
|
|
1
|
+
import { forwardRef, useState, useEffect, } from 'react';
|
|
2
2
|
import oneHatData from '@onehat/data';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
|
|
@@ -10,10 +10,10 @@ import _ from 'lodash';
|
|
|
10
10
|
// This is the primary link between @onehat/data and the UI components
|
|
11
11
|
|
|
12
12
|
export default function withData(WrappedComponent) {
|
|
13
|
-
return (props) => {
|
|
13
|
+
return forwardRef((props, ref) => {
|
|
14
14
|
|
|
15
15
|
if (props.disableWithData) {
|
|
16
|
-
return <WrappedComponent {...props} />;
|
|
16
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const
|
|
@@ -106,6 +106,7 @@ export default function withData(WrappedComponent) {
|
|
|
106
106
|
|
|
107
107
|
return <WrappedComponent
|
|
108
108
|
{...props}
|
|
109
|
+
ref={ref}
|
|
109
110
|
disableWithData={false}
|
|
110
111
|
Repository={LocalRepository}
|
|
111
112
|
fields={fields}
|
|
@@ -114,5 +115,5 @@ export default function withData(WrappedComponent) {
|
|
|
114
115
|
idIx={localIdIx}
|
|
115
116
|
displayIx={localDisplayIx}
|
|
116
117
|
/>;
|
|
117
|
-
};
|
|
118
|
+
});
|
|
118
119
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef, } from 'react';
|
|
1
|
+
import { forwardRef, useEffect, useRef, } from 'react';
|
|
2
2
|
import { useDrag, useDrop, useDragLayer } from 'react-dnd'; // https://react-dnd.github.io/react-dnd/about don't forget the wrapping <DndProvider /> as shown here: https://react-dnd.github.io/react-dnd/docs/api/dnd-provider
|
|
3
3
|
|
|
4
4
|
|
|
@@ -9,10 +9,10 @@ import { useDrag, useDrop, useDragLayer } from 'react-dnd'; // https://react-dnd
|
|
|
9
9
|
// but it will lag behind, compared to what the native drag layer can do
|
|
10
10
|
|
|
11
11
|
export function withDragSource(WrappedComponent) {
|
|
12
|
-
return (props) => {
|
|
12
|
+
return forwardRef((props, ref) => {
|
|
13
13
|
|
|
14
14
|
if (!props.isDragSource) {
|
|
15
|
-
return <WrappedComponent {...props} />;
|
|
15
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (!props.dragSourceType) {
|
|
@@ -105,23 +105,24 @@ export function withDragSource(WrappedComponent) {
|
|
|
105
105
|
}, [layer]);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
return <WrappedComponent
|
|
108
|
+
return <WrappedComponent
|
|
109
109
|
{...props}
|
|
110
|
+
ref={ref}
|
|
110
111
|
canDrag={stateCanDrag}
|
|
111
112
|
isDragging={stateIsDragging}
|
|
112
113
|
dragSourceRef={dragSourceRef}
|
|
113
114
|
dragPreviewRef={dragPreviewRef}
|
|
114
115
|
dragState={dragState}
|
|
115
116
|
/>;
|
|
116
|
-
};
|
|
117
|
+
});
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
|
|
120
121
|
export function withDropTarget(WrappedComponent) {
|
|
121
|
-
return (props) => {
|
|
122
|
+
return forwardRef((props, ref) => {
|
|
122
123
|
|
|
123
124
|
if (!props.isDropTarget) {
|
|
124
|
-
return <WrappedComponent {...props} />;
|
|
125
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
if (!props.dropTargetAccept) {
|
|
@@ -181,13 +182,14 @@ export function withDropTarget(WrappedComponent) {
|
|
|
181
182
|
|
|
182
183
|
dropTargetRef(localTargetRef); // register DOM node with react-dnd
|
|
183
184
|
|
|
184
|
-
return <WrappedComponent
|
|
185
|
+
return <WrappedComponent
|
|
185
186
|
canDrop={stateCanDrop}
|
|
187
|
+
ref={ref}
|
|
186
188
|
isOver={isOver}
|
|
187
189
|
dropTargetRef={localTargetRef}
|
|
188
190
|
{...props}
|
|
189
191
|
/>;
|
|
190
|
-
};
|
|
192
|
+
});
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useState, } from 'react';
|
|
1
|
+
import { forwardRef, useState, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
HORIZONTAL,
|
|
4
4
|
VERTICAL,
|
|
5
5
|
} from '../../Constants/Directions.js';
|
|
6
6
|
import {
|
|
7
7
|
UI_MODE_WEB,
|
|
8
|
-
|
|
8
|
+
UI_MODE_NATIVE,
|
|
9
9
|
CURRENT_MODE,
|
|
10
10
|
} from '../../Constants/UiModes.js';
|
|
11
11
|
import useBlocking from '../../Hooks/useBlocking.js';
|
|
@@ -21,10 +21,10 @@ import getComponentFromType from '../../Functions/getComponentFromType.js';
|
|
|
21
21
|
// VERTICAL means the component moves along the Y axis.
|
|
22
22
|
|
|
23
23
|
export default function withDraggable(WrappedComponent) {
|
|
24
|
-
return (props) => {
|
|
24
|
+
return forwardRef((props, ref) => {
|
|
25
25
|
|
|
26
26
|
if (!props.isDraggable) {
|
|
27
|
-
return <WrappedComponent {...props} />;
|
|
27
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const {
|
|
@@ -235,7 +235,7 @@ export default function withDraggable(WrappedComponent) {
|
|
|
235
235
|
{...draggableProps}
|
|
236
236
|
>
|
|
237
237
|
<div className="nsResize">
|
|
238
|
-
<WrappedComponent {...propsToPass} />
|
|
238
|
+
<WrappedComponent {...propsToPass} ref={ref} />
|
|
239
239
|
</div>
|
|
240
240
|
</Draggable>;
|
|
241
241
|
} else if (mode === HORIZONTAL) {
|
|
@@ -249,7 +249,7 @@ export default function withDraggable(WrappedComponent) {
|
|
|
249
249
|
{...draggableProps}
|
|
250
250
|
>
|
|
251
251
|
<div className="ewResize" style={{ height: '100%', }}>
|
|
252
|
-
<WrappedComponent {...propsToPass} />
|
|
252
|
+
<WrappedComponent {...propsToPass} ref={ref} />
|
|
253
253
|
</div>
|
|
254
254
|
</Draggable>;
|
|
255
255
|
}
|
|
@@ -264,15 +264,15 @@ export default function withDraggable(WrappedComponent) {
|
|
|
264
264
|
handle={handle}
|
|
265
265
|
{...draggableProps}
|
|
266
266
|
>
|
|
267
|
-
<WrappedComponent {...propsToPass} />
|
|
267
|
+
<WrappedComponent {...propsToPass} ref={ref} />
|
|
268
268
|
</Draggable>;
|
|
269
|
-
} else if (CURRENT_MODE ===
|
|
269
|
+
} else if (CURRENT_MODE === UI_MODE_NATIVE) {
|
|
270
270
|
|
|
271
271
|
// NOT YET IMPLEMENTED
|
|
272
272
|
// Really need to replace most of this, as much of it is web-centric.
|
|
273
273
|
|
|
274
|
-
return <WrappedComponent {...propsToPass} />; // TEMP
|
|
274
|
+
return <WrappedComponent {...propsToPass} ref={ref} />; // TEMP
|
|
275
275
|
|
|
276
276
|
}
|
|
277
|
-
};
|
|
277
|
+
});
|
|
278
278
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState, useRef, } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
} from 'native-base';
|
|
1
|
+
import { forwardRef, useEffect, useState, useRef, } from 'react';
|
|
5
2
|
import {
|
|
6
3
|
ADD,
|
|
7
4
|
EDIT,
|
|
@@ -16,14 +13,15 @@ import {
|
|
|
16
13
|
EDITOR_TYPE__SIDE,
|
|
17
14
|
EDITOR_TYPE__INLINE,
|
|
18
15
|
} from '../../Constants/Editor.js';
|
|
16
|
+
import Button from '../Buttons/Button.js';
|
|
19
17
|
import UiGlobals from '../../UiGlobals.js';
|
|
20
18
|
import _ from 'lodash';
|
|
21
19
|
|
|
22
20
|
export default function withEditor(WrappedComponent, isTree = false) {
|
|
23
|
-
return (props) => {
|
|
21
|
+
return forwardRef((props, ref) => {
|
|
24
22
|
|
|
25
23
|
if (props.disableWithEditor) {
|
|
26
|
-
return <WrappedComponent {...props} isTree={isTree} />;
|
|
24
|
+
return <WrappedComponent {...props} ref={ref} isTree={isTree} />;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
let [editorMode, setEditorMode] = useState(EDITOR_MODE__VIEW); // Can change below, so use 'let'
|
|
@@ -266,12 +264,18 @@ export default function withEditor(WrappedComponent, isTree = false) {
|
|
|
266
264
|
message: 'The node you have selected for deletion has children. ' +
|
|
267
265
|
'Should these children be moved up to this node\'s parent, or be deleted?',
|
|
268
266
|
buttons: [
|
|
269
|
-
<Button
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
267
|
+
<Button
|
|
268
|
+
key="moveBtn"
|
|
269
|
+
colorScheme="danger"
|
|
270
|
+
onPress={() => doMoveChildren(cb)}
|
|
271
|
+
text="Move Children"
|
|
272
|
+
/>,
|
|
273
|
+
<Button
|
|
274
|
+
key="deleteBtn"
|
|
275
|
+
colorScheme="danger"
|
|
276
|
+
onPress={() => doDeleteChildren(cb)}
|
|
277
|
+
text="Delete Children"
|
|
278
|
+
/>
|
|
275
279
|
],
|
|
276
280
|
includeCancel: true,
|
|
277
281
|
});
|
|
@@ -598,6 +602,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
|
|
|
598
602
|
|
|
599
603
|
return <WrappedComponent
|
|
600
604
|
{...props}
|
|
605
|
+
ref={ref}
|
|
601
606
|
disableWithEditor={false}
|
|
602
607
|
currentRecord={currentRecord}
|
|
603
608
|
setCurrentRecord={setCurrentRecord}
|
|
@@ -631,5 +636,5 @@ export default function withEditor(WrappedComponent, isTree = false) {
|
|
|
631
636
|
setSelection={setSelectionDecorated}
|
|
632
637
|
isTree={isTree}
|
|
633
638
|
/>;
|
|
634
|
-
};
|
|
639
|
+
});
|
|
635
640
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
} from 'native-base';
|
|
3
|
-
import _ from 'lodash';
|
|
1
|
+
import { forwardRef } from 'react';
|
|
4
2
|
|
|
5
3
|
export default function withEvents(WrappedComponent) {
|
|
6
|
-
return (props) => {
|
|
4
|
+
return forwardRef((props, ref) => {
|
|
7
5
|
const {
|
|
8
6
|
onEvent,
|
|
9
7
|
} = props;
|
|
10
|
-
return <WrappedComponent fireEvent={onEvent} {...props} />;
|
|
11
|
-
};
|
|
8
|
+
return <WrappedComponent fireEvent={onEvent} {...props} ref={ref} />;
|
|
9
|
+
});
|
|
12
10
|
}
|