@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,29 +1,33 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
Box,
|
|
4
|
+
HStack,
|
|
5
|
+
HStackNative,
|
|
3
6
|
Icon,
|
|
4
|
-
Modal,
|
|
5
|
-
Popover,
|
|
7
|
+
Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
|
|
8
|
+
Popover, PopoverBackdrop, PopoverContent, PopoverBody,
|
|
6
9
|
Pressable,
|
|
7
|
-
Row,
|
|
8
10
|
Text,
|
|
11
|
+
TextNative,
|
|
9
12
|
Tooltip,
|
|
10
|
-
|
|
13
|
+
VStack,
|
|
14
|
+
} from '../../../Gluestack';
|
|
11
15
|
import {
|
|
12
|
-
|
|
16
|
+
UI_MODE_NATIVE,
|
|
13
17
|
UI_MODE_WEB,
|
|
14
18
|
} from '../../../../Constants/UiModes.js';
|
|
15
19
|
import {
|
|
16
20
|
EDITOR_TYPE__WINDOWED,
|
|
17
21
|
} from '../../../../Constants/Editor.js';
|
|
22
|
+
import testProps from '../../../../Functions/testProps.js';
|
|
18
23
|
import UiGlobals from '../../../../UiGlobals.js';
|
|
19
24
|
import Input from '../Input.js';
|
|
25
|
+
import { Grid, WindowedGridEditor } from '../../../Grid/Grid.js';
|
|
20
26
|
import withAlert from '../../../Hoc/withAlert.js';
|
|
21
27
|
import withComponent from '../../../Hoc/withComponent.js';
|
|
22
28
|
import withData from '../../../Hoc/withData.js';
|
|
23
29
|
import withValue from '../../../Hoc/withValue.js';
|
|
24
30
|
import emptyFn from '../../../../Functions/emptyFn.js';
|
|
25
|
-
import testProps from '../../../../Functions/testProps.js';
|
|
26
|
-
import { Grid, WindowedGridEditor } from '../../../Grid/Grid.js';
|
|
27
31
|
import IconButton from '../../../Buttons/IconButton.js';
|
|
28
32
|
import CaretDown from '../../../Icons/CaretDown.js';
|
|
29
33
|
import Check from '../../../Icons/Check.js';
|
|
@@ -34,6 +38,7 @@ import _ from 'lodash';
|
|
|
34
38
|
const FILTER_NAME = 'q';
|
|
35
39
|
|
|
36
40
|
export function ComboComponent(props) {
|
|
41
|
+
|
|
37
42
|
const {
|
|
38
43
|
additionalButtons,
|
|
39
44
|
autoFocus = false,
|
|
@@ -80,6 +85,7 @@ export function ComboComponent(props) {
|
|
|
80
85
|
} = props,
|
|
81
86
|
styles = UiGlobals.styles,
|
|
82
87
|
inputRef = useRef(),
|
|
88
|
+
inputCloneRef = useRef(),
|
|
83
89
|
triggerRef = useRef(),
|
|
84
90
|
menuRef = useRef(),
|
|
85
91
|
displayValueRef = useRef(),
|
|
@@ -96,6 +102,7 @@ export function ComboComponent(props) {
|
|
|
96
102
|
[textInputValue, setTextInputValue] = useState(''),
|
|
97
103
|
[newEntityDisplayValue, setNewEntityDisplayValue] = useState(null),
|
|
98
104
|
[filteredData, setFilteredData] = useState(data),
|
|
105
|
+
[inputHeight, setInputHeight] = useState(0),
|
|
99
106
|
[width, setWidth] = useState(0),
|
|
100
107
|
[top, setTop] = useState(0),
|
|
101
108
|
[left, setLeft] = useState(0),
|
|
@@ -107,25 +114,14 @@ export function ComboComponent(props) {
|
|
|
107
114
|
if (isMenuShown) {
|
|
108
115
|
return;
|
|
109
116
|
}
|
|
110
|
-
if (UiGlobals.mode === UI_MODE_WEB && inputRef.current
|
|
117
|
+
if (UiGlobals.mode === UI_MODE_WEB && inputRef.current?.getBoundingClientRect) {
|
|
111
118
|
// For web, ensure it's in the proper place
|
|
112
119
|
const
|
|
113
120
|
rect = inputRef.current.getBoundingClientRect(),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// Menu is below the combo
|
|
119
|
-
const rectTop = rect.top + rect.height;
|
|
120
|
-
if (rectTop !== top) {
|
|
121
|
-
setTop(rectTop);
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
// Menu is above the combo
|
|
125
|
-
const rectTop = rect.top - styles.FORM_COMBO_MENU_HEIGHT;
|
|
126
|
-
if (rectTop !== top) {
|
|
127
|
-
setTop(rectTop);
|
|
128
|
-
}
|
|
121
|
+
inputRect = inputRef.current.getBoundingClientRect();
|
|
122
|
+
|
|
123
|
+
if (rect.top !== top) {
|
|
124
|
+
setTop(rect.top);
|
|
129
125
|
}
|
|
130
126
|
if (rect.left !== left) {
|
|
131
127
|
setLeft(rect.left);
|
|
@@ -139,6 +135,8 @@ export function ComboComponent(props) {
|
|
|
139
135
|
if (widthToSet !== width) {
|
|
140
136
|
setWidth(widthToSet);
|
|
141
137
|
}
|
|
138
|
+
|
|
139
|
+
setInputHeight(inputRect.height);
|
|
142
140
|
}
|
|
143
141
|
if (Repository && !Repository.isLoaded) {
|
|
144
142
|
// await Repository.load(); // this breaks when the menu (Grid) has selectorSelected
|
|
@@ -495,186 +493,177 @@ export function ComboComponent(props) {
|
|
|
495
493
|
return null;
|
|
496
494
|
}
|
|
497
495
|
|
|
498
|
-
const inputIconElement = icon ? <Icon as={icon}
|
|
496
|
+
const inputIconElement = icon ? <Icon as={icon} size="md" className="text-grey-300 ml-1 mr-2" /> : null;
|
|
499
497
|
let xButton = null,
|
|
500
498
|
eyeButton = null,
|
|
501
|
-
|
|
499
|
+
trigger = null,
|
|
500
|
+
input = null,
|
|
501
|
+
inputClone = null,
|
|
502
502
|
checkButton = null,
|
|
503
503
|
grid = null,
|
|
504
504
|
dropdownMenu = null,
|
|
505
505
|
assembledComponents = null;
|
|
506
506
|
|
|
507
|
-
if (showXButton
|
|
507
|
+
if (showXButton) {
|
|
508
508
|
xButton = <IconButton
|
|
509
509
|
{...testProps('xBtn')}
|
|
510
|
+
icon={Xmark}
|
|
510
511
|
_icon={{
|
|
511
|
-
as: Xmark,
|
|
512
|
-
color: 'trueGray.600',
|
|
513
512
|
size: 'sm',
|
|
513
|
+
className: 'text-grey-600',
|
|
514
514
|
}}
|
|
515
|
-
isDisabled={isDisabled}
|
|
515
|
+
isDisabled={isDisabled || _.isNil(value)}
|
|
516
516
|
onPress={onXButtonPress}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
517
|
+
tooltip="Clear selection"
|
|
518
|
+
className={`
|
|
519
|
+
h-full
|
|
520
|
+
mr-1
|
|
521
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
522
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
523
|
+
`}
|
|
523
524
|
/>;
|
|
524
525
|
}
|
|
525
|
-
if (showEyeButton && Editor
|
|
526
|
+
if (showEyeButton && Editor) {
|
|
526
527
|
eyeButton = <IconButton
|
|
527
528
|
{...testProps('eyeBtn')}
|
|
529
|
+
icon={Eye}
|
|
528
530
|
_icon={{
|
|
529
|
-
as: Eye,
|
|
530
|
-
color: 'trueGray.600',
|
|
531
531
|
size: 'sm',
|
|
532
|
+
className: 'text-grey-600',
|
|
532
533
|
}}
|
|
533
|
-
isDisabled={isDisabled}
|
|
534
|
+
isDisabled={isDisabled || _.isNil(value)}
|
|
534
535
|
onPress={onEyeButtonPress}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
536
|
+
tooltip="View selected record"
|
|
537
|
+
className={`
|
|
538
|
+
h-full
|
|
539
|
+
mr-1
|
|
540
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
541
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
542
|
+
`}
|
|
541
543
|
/>;
|
|
542
544
|
}
|
|
545
|
+
trigger = <IconButton
|
|
546
|
+
{...testProps('trigger')}
|
|
547
|
+
ref={triggerRef}
|
|
548
|
+
icon={CaretDown}
|
|
549
|
+
_icon={{
|
|
550
|
+
size: 'sm',
|
|
551
|
+
className: 'text-grey-500',
|
|
552
|
+
}}
|
|
553
|
+
isDisabled={isDisabled}
|
|
554
|
+
onPress={onTriggerPress}
|
|
555
|
+
onBlur={onTriggerBlur}
|
|
556
|
+
className={`
|
|
557
|
+
trigger
|
|
558
|
+
h-full
|
|
559
|
+
border
|
|
560
|
+
border-l-0
|
|
561
|
+
border-gray-400
|
|
562
|
+
rounded-l-none
|
|
563
|
+
rounded-r-md
|
|
564
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
565
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
566
|
+
`}
|
|
567
|
+
/>;
|
|
543
568
|
|
|
544
569
|
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}}
|
|
608
|
-
isDisabled={isDisabled}
|
|
609
|
-
onPress={onTriggerPress}
|
|
610
|
-
onBlur={onTriggerBlur}
|
|
611
|
-
h="100%"
|
|
612
|
-
borderWidth={1}
|
|
613
|
-
borderColor="#bbb"
|
|
614
|
-
borderLeftWidth={0}
|
|
615
|
-
borderLeftRadius={0}
|
|
616
|
-
borderRightRadius="md"
|
|
617
|
-
bg={styles.FORM_COMBO_TRIGGER_BG}
|
|
618
|
-
_hover={{
|
|
619
|
-
bg: styles.FORM_COMBO_TRIGGER_HOVER_BG,
|
|
620
|
-
}}
|
|
621
|
-
/>
|
|
622
|
-
</>;
|
|
570
|
+
input = disableDirectEntry ?
|
|
571
|
+
<Pressable
|
|
572
|
+
{...testProps('toggleMenuBtn')}
|
|
573
|
+
onPress={toggleMenu}
|
|
574
|
+
className={`
|
|
575
|
+
toggleMenuBtn
|
|
576
|
+
h-full
|
|
577
|
+
flex-1
|
|
578
|
+
flex-row
|
|
579
|
+
justify-center
|
|
580
|
+
items-center
|
|
581
|
+
m-0
|
|
582
|
+
p-1
|
|
583
|
+
border
|
|
584
|
+
border-grey-400
|
|
585
|
+
rounded-r-none
|
|
586
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
587
|
+
`}
|
|
588
|
+
>
|
|
589
|
+
{inputIconElement}
|
|
590
|
+
<TextNative
|
|
591
|
+
ref={inputRef}
|
|
592
|
+
numberOfLines={1}
|
|
593
|
+
ellipsizeMode="head"
|
|
594
|
+
className={`
|
|
595
|
+
Text
|
|
596
|
+
h-full
|
|
597
|
+
flex-1
|
|
598
|
+
${_.isEmpty(textInputValue) ? "text-grey-400" : "text-black"}
|
|
599
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
600
|
+
`}
|
|
601
|
+
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</TextNative>
|
|
602
|
+
</Pressable> :
|
|
603
|
+
<Input
|
|
604
|
+
{...testProps('input')}
|
|
605
|
+
ref={inputRef}
|
|
606
|
+
reference="ComboInput"
|
|
607
|
+
value={textInputValue}
|
|
608
|
+
autoSubmit={true}
|
|
609
|
+
isDisabled={isDisabled}
|
|
610
|
+
onChangeValue={onInputChangeText}
|
|
611
|
+
onKeyPress={onInputKeyPress}
|
|
612
|
+
onFocus={onInputFocus}
|
|
613
|
+
onBlur={onInputBlur}
|
|
614
|
+
InputLeftElement={inputIconElement}
|
|
615
|
+
autoSubmitDelay={500}
|
|
616
|
+
placeholder={placeholder}
|
|
617
|
+
className={`
|
|
618
|
+
ComboInput
|
|
619
|
+
grow
|
|
620
|
+
h-full
|
|
621
|
+
min-h-0
|
|
622
|
+
flex-1
|
|
623
|
+
m-0
|
|
624
|
+
rounded-tr-none
|
|
625
|
+
rounded-br-none
|
|
626
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
627
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
628
|
+
${styles.FORM_COMBO_INPUT_BG_FOCUS}
|
|
629
|
+
`}
|
|
630
|
+
{..._input}
|
|
631
|
+
/>;
|
|
623
632
|
}
|
|
624
|
-
|
|
625
|
-
|
|
633
|
+
if (UiGlobals.mode === UI_MODE_NATIVE) {
|
|
634
|
+
throw new Error('Migration to Gluestack not yet implemented on Native');
|
|
626
635
|
// This input and trigger are for show
|
|
627
636
|
// They just show the current getDisplayValue and open the menu
|
|
628
637
|
const displayValue = getDisplayValue();
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
ref={triggerRef}
|
|
659
|
-
_icon={{
|
|
660
|
-
as: CaretDown,
|
|
661
|
-
color: 'primary.800',
|
|
662
|
-
size: 'sm',
|
|
663
|
-
}}
|
|
664
|
-
isDisabled={isDisabled}
|
|
665
|
-
onPress={onTriggerPress}
|
|
666
|
-
h="100%"
|
|
667
|
-
borderWidth={1}
|
|
668
|
-
borderColor="#bbb"
|
|
669
|
-
borderLeftWidth={0}
|
|
670
|
-
borderLeftRadius={0}
|
|
671
|
-
borderRightRadius="md"
|
|
672
|
-
bg={styles.FORM_COMBO_TRIGGER_BG}
|
|
673
|
-
_hover={{
|
|
674
|
-
bg: styles.FORM_COMBO_TRIGGER_HOVER_BG,
|
|
675
|
-
}}
|
|
676
|
-
/>
|
|
677
|
-
</>;
|
|
638
|
+
input = <Pressable
|
|
639
|
+
{...testProps('showMenuBtn')}
|
|
640
|
+
onPress={showMenu}
|
|
641
|
+
className={`
|
|
642
|
+
h-full
|
|
643
|
+
flex-1
|
|
644
|
+
flex-row
|
|
645
|
+
justify-center
|
|
646
|
+
items-center
|
|
647
|
+
border
|
|
648
|
+
border-grey-400
|
|
649
|
+
rounded-r-none
|
|
650
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
651
|
+
`}
|
|
652
|
+
>
|
|
653
|
+
{inputIconElement}
|
|
654
|
+
<TextNative
|
|
655
|
+
numberOfLines={1}
|
|
656
|
+
ellipsizeMode="head"
|
|
657
|
+
className={`
|
|
658
|
+
h-full
|
|
659
|
+
flex-1
|
|
660
|
+
m-0
|
|
661
|
+
p-1
|
|
662
|
+
${_.isEmpty(displayValue) ? "text-grey-400" : "text-black"}
|
|
663
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
664
|
+
`}
|
|
665
|
+
>{_.isEmpty(displayValue) ? placeholder : displayValue}</TextNative>
|
|
666
|
+
</Pressable>;
|
|
678
667
|
}
|
|
679
668
|
|
|
680
669
|
if (isMenuShown) {
|
|
@@ -698,25 +687,26 @@ export function ComboComponent(props) {
|
|
|
698
687
|
gridProps.data = filteredData;
|
|
699
688
|
}
|
|
700
689
|
const WhichGrid = isEditor ? WindowedGridEditor : Grid;
|
|
690
|
+
const gridStyle = {};
|
|
691
|
+
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
692
|
+
gridStyle.height = styles.FORM_COMBO_MENU_HEIGHT;
|
|
693
|
+
}
|
|
701
694
|
grid = <WhichGrid
|
|
702
695
|
showHeaders={false}
|
|
703
696
|
showHovers={true}
|
|
704
|
-
shadow={1}
|
|
705
697
|
getRowProps={() => {
|
|
706
698
|
return {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
699
|
+
className: `
|
|
700
|
+
w-full
|
|
701
|
+
pl-4
|
|
702
|
+
pr-2
|
|
703
|
+
py-1
|
|
704
|
+
border-b-1
|
|
705
|
+
border-grey-300
|
|
706
|
+
`,
|
|
713
707
|
};
|
|
714
708
|
}}
|
|
715
709
|
autoAdjustPageSizeToHeight={false}
|
|
716
|
-
{...gridProps}
|
|
717
|
-
reference="grid"
|
|
718
|
-
parent={self}
|
|
719
|
-
h={UiGlobals.mode === UI_MODE_WEB ? styles.FORM_COMBO_MENU_HEIGHT + 'px' : null}
|
|
720
710
|
newEntityDisplayValue={newEntityDisplayValue}
|
|
721
711
|
newEntityDisplayProperty={newEntityDisplayProperty}
|
|
722
712
|
disablePresetButtons={!isEditor}
|
|
@@ -819,87 +809,133 @@ export function ComboComponent(props) {
|
|
|
819
809
|
onInputFocus();
|
|
820
810
|
}
|
|
821
811
|
}}
|
|
812
|
+
reference="grid"
|
|
813
|
+
parent={self}
|
|
814
|
+
className={`
|
|
815
|
+
h-full
|
|
816
|
+
`}
|
|
817
|
+
style={gridStyle}
|
|
818
|
+
{...gridProps}
|
|
822
819
|
{..._editor}
|
|
823
820
|
/>;
|
|
824
821
|
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
822
|
+
if (!disableDirectEntry) {
|
|
823
|
+
inputClone = <Box
|
|
824
|
+
className="Combo-inputClone-Box"
|
|
825
|
+
style={{
|
|
826
|
+
height: inputHeight,
|
|
827
|
+
}}
|
|
828
|
+
>
|
|
829
|
+
<Input
|
|
830
|
+
{...testProps('input')}
|
|
831
|
+
ref={inputCloneRef}
|
|
832
|
+
reference="ComboInputClone"
|
|
833
|
+
value={textInputValue}
|
|
834
|
+
autoSubmit={true}
|
|
835
|
+
isDisabled={isDisabled}
|
|
836
|
+
onChangeValue={onInputChangeText}
|
|
837
|
+
onKeyPress={onInputKeyPress}
|
|
838
|
+
onFocus={onInputFocus}
|
|
839
|
+
onBlur={onInputBlur}
|
|
840
|
+
InputLeftElement={inputIconElement}
|
|
841
|
+
autoSubmitDelay={500}
|
|
842
|
+
placeholder={placeholder}
|
|
843
|
+
className={`
|
|
844
|
+
Combo-inputClone-Input
|
|
845
|
+
grow
|
|
846
|
+
h-full
|
|
847
|
+
flex-1
|
|
848
|
+
m-0
|
|
849
|
+
rounded-tr-none
|
|
850
|
+
rounded-br-none
|
|
851
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
852
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
853
|
+
${styles.FORM_COMBO_INPUT_BG_FOCUS}
|
|
854
|
+
`}
|
|
855
|
+
{..._input}
|
|
856
|
+
/>
|
|
857
|
+
</Box>;
|
|
858
|
+
}
|
|
825
859
|
dropdownMenu = <Popover
|
|
826
860
|
isOpen={isMenuShown}
|
|
827
861
|
onClose={() => {
|
|
828
862
|
hideMenu();
|
|
829
863
|
}}
|
|
830
864
|
trigger={emptyFn}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
// _fade={{
|
|
834
|
-
// entryDuration: 0, // Doesn't work, as Popover doesn't have animation controls like Modal does. See node_modules/native-base/src/components/composites/Popover/Popover.tsx line 99 (vs .../composites/Modal/Modal.tsx line 113 which has ..._fade) I added a feature request to NativeBase https://github.com/GeekyAnts/NativeBase/issues/5651
|
|
835
|
-
// }}
|
|
836
|
-
{...props}
|
|
865
|
+
className="dropdownMenu-Popover block"
|
|
866
|
+
initialFocusRef={inputCloneRef}
|
|
837
867
|
>
|
|
838
|
-
<
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
868
|
+
<PopoverBackdrop className="PopoverBackdrop bg-[#000]" />
|
|
869
|
+
<Box
|
|
870
|
+
ref={menuRef}
|
|
871
|
+
className={`
|
|
872
|
+
dropdownMenu-Box
|
|
873
|
+
flex-1
|
|
874
|
+
overflow-auto
|
|
875
|
+
p-0
|
|
876
|
+
rounded-none
|
|
877
|
+
border
|
|
878
|
+
border-grey-400
|
|
879
|
+
shadow-md
|
|
880
|
+
max-w-full
|
|
881
|
+
`}
|
|
882
|
+
style={{
|
|
883
|
+
top,
|
|
884
|
+
left,
|
|
885
|
+
width,
|
|
886
|
+
height: styles.FORM_COMBO_MENU_HEIGHT + inputHeight,
|
|
887
|
+
minWidth: 100,
|
|
888
|
+
}}
|
|
845
889
|
>
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
borderColor='trueGray.400'
|
|
850
|
-
borderTopWidth={0}
|
|
851
|
-
p={0}
|
|
852
|
-
>
|
|
853
|
-
{grid}
|
|
854
|
-
</Popover.Body>
|
|
855
|
-
</Popover.Content>
|
|
890
|
+
{inputClone}
|
|
891
|
+
{grid}
|
|
892
|
+
</Box>
|
|
856
893
|
</Popover>;
|
|
857
894
|
}
|
|
858
|
-
if (UiGlobals.mode ===
|
|
895
|
+
if (UiGlobals.mode === UI_MODE_NATIVE) {
|
|
859
896
|
if (isEditor) {
|
|
860
897
|
// in RN, an editor has no way to accept the selection of the grid, so we need to add a check button to do this
|
|
861
898
|
checkButton = <IconButton
|
|
862
899
|
{...testProps('checkBtn')}
|
|
900
|
+
icon={Check}
|
|
863
901
|
_icon={{
|
|
864
|
-
as: Check,
|
|
865
|
-
color: 'trueGray.600',
|
|
866
902
|
size: 'sm',
|
|
903
|
+
className: 'text-grey-600',
|
|
867
904
|
}}
|
|
868
905
|
onPress={onCheckButtonPress}
|
|
869
906
|
isDisabled={!value}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
907
|
+
className={`
|
|
908
|
+
h-full
|
|
909
|
+
border
|
|
910
|
+
border-grey-400
|
|
911
|
+
rounded-md
|
|
912
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
913
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
914
|
+
`}
|
|
878
915
|
/>;
|
|
879
916
|
}
|
|
880
917
|
const inputAndTriggerClone = // for RN, this is the actual input and trigger, as we need them to appear up above in the modal
|
|
881
|
-
<
|
|
918
|
+
<HStack className="h-[10px]">
|
|
882
919
|
{xButton}
|
|
883
920
|
{eyeButton}
|
|
884
921
|
{disableDirectEntry ?
|
|
885
|
-
<
|
|
922
|
+
<TextNative
|
|
886
923
|
ref={inputRef}
|
|
887
|
-
flex={1}
|
|
888
|
-
h="100%"
|
|
889
924
|
numberOfLines={1}
|
|
890
925
|
ellipsizeMode="head"
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
926
|
+
className={`
|
|
927
|
+
h-full
|
|
928
|
+
flex-1
|
|
929
|
+
m-0
|
|
930
|
+
p-1
|
|
931
|
+
border
|
|
932
|
+
border-grey-400
|
|
933
|
+
rounded-r-none
|
|
934
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
935
|
+
${styles.FORM_COMBO_INPUT_BG_FOCUS}
|
|
936
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
937
|
+
`}
|
|
938
|
+
>{textInputValue}</TextNative> :
|
|
903
939
|
<Input
|
|
904
940
|
{...testProps('input')}
|
|
905
941
|
ref={inputRef}
|
|
@@ -911,87 +947,112 @@ export function ComboComponent(props) {
|
|
|
911
947
|
onKeyPress={onInputKeyPress}
|
|
912
948
|
onFocus={onInputFocus}
|
|
913
949
|
onBlur={onInputBlur}
|
|
914
|
-
flex={1}
|
|
915
|
-
h="100%"
|
|
916
|
-
m={0}
|
|
917
950
|
InputLeftElement={inputIconElement}
|
|
918
951
|
autoSubmitDelay={500}
|
|
919
|
-
borderTopRightRadius={0}
|
|
920
|
-
borderBottomRightRadius={0}
|
|
921
|
-
fontSize={styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
922
|
-
bg={styles.FORM_COMBO_INPUT_BG}
|
|
923
|
-
_focus={{
|
|
924
|
-
bg: styles.FORM_COMBO_INPUT_FOCUS_BG,
|
|
925
|
-
}}
|
|
926
952
|
placeholder={placeholder}
|
|
953
|
+
className={`
|
|
954
|
+
h-full
|
|
955
|
+
flex-1
|
|
956
|
+
m-0
|
|
957
|
+
rounded-r-none
|
|
958
|
+
${styles.FORM_COMBO_INPUT_FONTSIZE}
|
|
959
|
+
${styles.FORM_COMBO_INPUT_BG}
|
|
960
|
+
${styles.FORM_COMBO_INPUT_BG_FOCUS}
|
|
961
|
+
`}
|
|
927
962
|
{..._input}
|
|
928
963
|
/>}
|
|
929
964
|
<IconButton
|
|
930
965
|
{...testProps('hideMenuBtn')}
|
|
966
|
+
icon={CaretDown}
|
|
931
967
|
_icon={{
|
|
932
|
-
as: CaretDown,
|
|
933
|
-
color: 'primary.800',
|
|
934
968
|
size: 'sm',
|
|
969
|
+
className: 'text-primary-800',
|
|
935
970
|
}}
|
|
936
971
|
isDisabled={isDisabled}
|
|
937
972
|
onPress={() => hideMenu()}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}}
|
|
973
|
+
className={`
|
|
974
|
+
h-full
|
|
975
|
+
border
|
|
976
|
+
border-grey-400
|
|
977
|
+
rounded-l-none
|
|
978
|
+
rounded-r-md
|
|
979
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
980
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
981
|
+
`}
|
|
948
982
|
/>
|
|
949
983
|
{checkButton}
|
|
950
|
-
</
|
|
984
|
+
</HStack>;
|
|
951
985
|
dropdownMenu = <Modal
|
|
952
986
|
isOpen={true}
|
|
953
987
|
safeAreaTop={true}
|
|
954
988
|
onClose={() => setIsMenuShown(false)}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
989
|
+
className={`
|
|
990
|
+
h-[400px]
|
|
991
|
+
w-full
|
|
992
|
+
my-auto
|
|
993
|
+
p-[5px]
|
|
994
|
+
`}
|
|
960
995
|
>
|
|
961
|
-
|
|
962
|
-
|
|
996
|
+
<ModalBackdrop />
|
|
997
|
+
<ModalContent>
|
|
998
|
+
<ModalBody>
|
|
999
|
+
{inputAndTriggerClone}
|
|
1000
|
+
{grid}
|
|
1001
|
+
</ModalBody>
|
|
1002
|
+
</ModalContent>
|
|
963
1003
|
</Modal>;
|
|
964
1004
|
}
|
|
965
1005
|
}
|
|
966
|
-
|
|
967
1006
|
const refProps = {};
|
|
968
1007
|
if (tooltipRef) {
|
|
969
1008
|
refProps.ref = tooltipRef;
|
|
970
1009
|
}
|
|
971
1010
|
|
|
1011
|
+
const className = `
|
|
1012
|
+
Combo-HStack
|
|
1013
|
+
flex-1
|
|
1014
|
+
justify-center
|
|
1015
|
+
items-center
|
|
1016
|
+
`;
|
|
1017
|
+
if (props.className) {
|
|
1018
|
+
props.className += ' ' + className;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
972
1021
|
if (isRendered && additionalButtons?.length && containerWidth < 500) {
|
|
973
1022
|
// be responsive for small screen sizes and bump additionalButtons to the next line
|
|
974
1023
|
assembledComponents =
|
|
975
|
-
<
|
|
976
|
-
|
|
1024
|
+
<VStack
|
|
1025
|
+
testID={testID}
|
|
1026
|
+
className="Combo-VStack"
|
|
1027
|
+
>
|
|
1028
|
+
<HStack
|
|
1029
|
+
{...refProps}
|
|
1030
|
+
className={className}
|
|
1031
|
+
>
|
|
977
1032
|
{xButton}
|
|
978
1033
|
{eyeButton}
|
|
979
|
-
{
|
|
1034
|
+
{input}
|
|
1035
|
+
{trigger}
|
|
980
1036
|
{dropdownMenu}
|
|
981
|
-
</
|
|
982
|
-
<
|
|
1037
|
+
</HStack>
|
|
1038
|
+
<HStack className="mt-1">
|
|
983
1039
|
{additionalButtons}
|
|
984
|
-
</
|
|
985
|
-
</
|
|
1040
|
+
</HStack>
|
|
1041
|
+
</VStack>;
|
|
986
1042
|
} else {
|
|
987
1043
|
assembledComponents =
|
|
988
|
-
<
|
|
1044
|
+
<HStackNative
|
|
1045
|
+
{...refProps}
|
|
1046
|
+
onLayout={onLayout}
|
|
1047
|
+
className={className}
|
|
1048
|
+
>
|
|
989
1049
|
{xButton}
|
|
990
1050
|
{eyeButton}
|
|
991
|
-
{
|
|
1051
|
+
{input}
|
|
1052
|
+
{trigger}
|
|
992
1053
|
{additionalButtons}
|
|
993
1054
|
{dropdownMenu}
|
|
994
|
-
</
|
|
1055
|
+
</HStackNative>;
|
|
995
1056
|
}
|
|
996
1057
|
|
|
997
1058
|
if (isViewerShown && Editor) {
|
|
@@ -1019,26 +1080,28 @@ export function ComboComponent(props) {
|
|
|
1019
1080
|
onClose={onViewerClose}
|
|
1020
1081
|
>
|
|
1021
1082
|
<Editor
|
|
1022
|
-
{...propsForViewer}
|
|
1023
1083
|
editorType={EDITOR_TYPE__WINDOWED}
|
|
1024
1084
|
isEditorViewOnly={true}
|
|
1025
|
-
{...viewerProps}
|
|
1026
|
-
px={0}
|
|
1027
|
-
py={0}
|
|
1028
|
-
w="100%"
|
|
1029
1085
|
parent={self}
|
|
1030
1086
|
reference="viewer"
|
|
1031
1087
|
selection={viewerSelection}
|
|
1032
1088
|
onEditorClose={onViewerClose}
|
|
1089
|
+
className={`
|
|
1090
|
+
w-full
|
|
1091
|
+
p-0
|
|
1092
|
+
`}
|
|
1093
|
+
{...propsForViewer}
|
|
1094
|
+
{...viewerProps}
|
|
1033
1095
|
/>
|
|
1034
1096
|
</Modal>
|
|
1035
1097
|
</>;
|
|
1036
1098
|
}
|
|
1037
1099
|
|
|
1038
1100
|
if (tooltip) {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1101
|
+
// TODO: implement withTooltip for Combo
|
|
1102
|
+
// assembledComponents = <Tooltip label={tooltip} placement={tooltipPlacement} className="h-full">
|
|
1103
|
+
// {assembledComponents}
|
|
1104
|
+
// </Tooltip>;
|
|
1042
1105
|
}
|
|
1043
1106
|
|
|
1044
1107
|
return assembledComponents;
|