@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,21 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useState, useRef, useEffect, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
HStack,
|
|
5
|
+
HStackNative,
|
|
6
|
+
Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
|
|
7
|
+
Popover, PopoverBackdrop, PopoverContent, PopoverBody,
|
|
7
8
|
Pressable,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Tooltip,
|
|
11
|
-
} from 'native-base';
|
|
9
|
+
TextNative,
|
|
10
|
+
} from '../../Gluestack';
|
|
12
11
|
import {
|
|
13
12
|
DATE,
|
|
14
13
|
TIME,
|
|
15
14
|
DATETIME,
|
|
16
15
|
} from '../../../Constants/Date.js';
|
|
17
16
|
import {
|
|
18
|
-
|
|
17
|
+
UI_MODE_NATIVE,
|
|
19
18
|
UI_MODE_WEB,
|
|
20
19
|
} from '../../../Constants/UiModes.js';
|
|
21
20
|
import UiGlobals from '../../../UiGlobals.js';
|
|
@@ -25,6 +24,7 @@ import Input from '../Field/Input.js';
|
|
|
25
24
|
import IconButton from '../../Buttons/IconButton.js';
|
|
26
25
|
import Xmark from '../../Icons/Xmark.js';
|
|
27
26
|
import withComponent from '../../Hoc/withComponent.js';
|
|
27
|
+
import withTooltip from '../../Hoc/withTooltip.js';
|
|
28
28
|
import withValue from '../../Hoc/withValue.js';
|
|
29
29
|
import emptyFn from '../../../Functions/emptyFn.js';
|
|
30
30
|
import testProps from '../../../Functions/testProps.js';
|
|
@@ -34,22 +34,22 @@ import moment from 'moment';
|
|
|
34
34
|
import _ from 'lodash';
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
export
|
|
37
|
+
export const DateElement = forwardRef((props, ref) => {
|
|
38
|
+
|
|
38
39
|
const {
|
|
39
40
|
format,
|
|
40
41
|
mode = DATE,
|
|
41
42
|
|
|
42
43
|
additionalButtons,
|
|
43
|
-
|
|
44
|
-
tooltip = null,
|
|
45
|
-
menuMinWidth = 150,
|
|
44
|
+
menuMinWidth = 200,
|
|
46
45
|
disableDirectEntry = false,
|
|
47
46
|
hideMenuOnSelection = true,
|
|
48
47
|
showXButton = false,
|
|
49
48
|
_input = {},
|
|
50
49
|
isDisabled = false,
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
limitWidth = false,
|
|
51
|
+
minValue,
|
|
52
|
+
maxValue,
|
|
53
53
|
testID,
|
|
54
54
|
|
|
55
55
|
// withComponent
|
|
@@ -58,19 +58,16 @@ export function DateElement(props) {
|
|
|
58
58
|
// withValue
|
|
59
59
|
value,
|
|
60
60
|
setValue,
|
|
61
|
-
...propsToPass
|
|
62
61
|
} = props,
|
|
63
62
|
styles = UiGlobals.styles,
|
|
64
63
|
Datetime = getComponentFromType('Datetime'),
|
|
65
|
-
inputRef = useRef(),
|
|
64
|
+
inputRef = ref || useRef(),
|
|
66
65
|
triggerRef = useRef(),
|
|
67
66
|
pickerRef = useRef(),
|
|
68
67
|
[isPickerShown, setIsPickerShown] = useState(false),
|
|
69
68
|
[isRendered, setIsRendered] = useState(false),
|
|
70
69
|
[localValue, setLocalValue] = useState(value),
|
|
71
70
|
[textInputValue, setTextInputValue] = useState(value),
|
|
72
|
-
[isTranslateX, setIsTranslateX] = useState(false),
|
|
73
|
-
[isTranslateY, setIsTranslateY] = useState(false),
|
|
74
71
|
[top, setTop] = useState(0),
|
|
75
72
|
[left, setLeft] = useState(0),
|
|
76
73
|
setBothValues = (value) => {
|
|
@@ -105,24 +102,12 @@ export function DateElement(props) {
|
|
|
105
102
|
if (UiGlobals.mode === UI_MODE_WEB && triggerRef.current?.getBoundingClientRect) {
|
|
106
103
|
// For web, ensure it's in the proper place
|
|
107
104
|
const
|
|
108
|
-
triggerRect = triggerRef.current.getBoundingClientRect(),
|
|
109
|
-
inputRect = inputRef.current.getBoundingClientRect()
|
|
110
|
-
|
|
111
|
-
isLower = triggerRect.top > (bodyRect.height / 2),
|
|
112
|
-
isRight = triggerRect.left > (bodyRect.width / 2);
|
|
113
|
-
|
|
105
|
+
// triggerRect = triggerRef.current.getBoundingClientRect(),
|
|
106
|
+
inputRect = inputRef.current.getBoundingClientRect();
|
|
107
|
+
|
|
114
108
|
setLeft(inputRect.left);
|
|
115
|
-
|
|
116
|
-
setTop(inputRect.top);
|
|
117
|
-
setIsTranslateY(true);
|
|
118
|
-
} else {
|
|
119
|
-
setTop(inputRect.top + inputRect.height);
|
|
120
|
-
}
|
|
121
|
-
if (isRight) {
|
|
122
|
-
// setIsTranslateX(true);
|
|
123
|
-
}
|
|
109
|
+
setTop(inputRect.top + inputRect.height);
|
|
124
110
|
}
|
|
125
|
-
|
|
126
111
|
setIsPickerShown(true);
|
|
127
112
|
},
|
|
128
113
|
hidePicker = () => {
|
|
@@ -248,30 +233,39 @@ export function DateElement(props) {
|
|
|
248
233
|
}, [value]);
|
|
249
234
|
|
|
250
235
|
// Format the display date/time/datetime
|
|
251
|
-
let
|
|
236
|
+
let placeholder = 'Select';
|
|
252
237
|
pickerValue = null,
|
|
253
|
-
height =
|
|
254
|
-
width =
|
|
238
|
+
height = null,
|
|
239
|
+
width = null;
|
|
255
240
|
switch(mode) {
|
|
241
|
+
case DATETIME:
|
|
242
|
+
placeholder = 'Select Date/Time';
|
|
243
|
+
if (!_.isNil(value)) {
|
|
244
|
+
title = format ? Formatters.FormatDateTime(value, format) : Formatters.FormatDateTime(value);
|
|
245
|
+
pickerValue = Parsers.ParseDate(value, 'YYYY-MM-DD HH:mm:ss');
|
|
246
|
+
}
|
|
247
|
+
if (limitWidth) {
|
|
248
|
+
width = 200;
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
256
251
|
case DATE:
|
|
257
|
-
|
|
252
|
+
placeholder = 'Select Date';
|
|
258
253
|
if (!_.isNil(value)) {
|
|
259
254
|
title = format ? Formatters.FormatDate(value, format) : Formatters.FormatDate(value);
|
|
260
255
|
pickerValue = Parsers.ParseDate(value, 'YYYY-MM-DD');
|
|
261
256
|
}
|
|
257
|
+
if (limitWidth) {
|
|
258
|
+
width = 150;
|
|
259
|
+
}
|
|
262
260
|
break;
|
|
263
261
|
case TIME:
|
|
264
|
-
|
|
265
|
-
width = 150;
|
|
262
|
+
placeholder = 'Select Time';
|
|
266
263
|
if (!_.isNil(value)) {
|
|
267
264
|
title = format ? Formatters.FormatTime(value, format) : Formatters.FormatTime(value);
|
|
268
265
|
pickerValue = Parsers.ParseDate(value, 'HH:mm:ss');
|
|
269
266
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
if (!_.isNil(value)) {
|
|
273
|
-
title = format ? Formatters.FormatDateTime(value, format) : Formatters.FormatDateTime(value);
|
|
274
|
-
pickerValue = Parsers.ParseDate(value, 'YYYY-MM-DD HH:mm:ss');
|
|
267
|
+
if (limitWidth) {
|
|
268
|
+
width = 150;
|
|
275
269
|
}
|
|
276
270
|
break;
|
|
277
271
|
default:
|
|
@@ -282,217 +276,174 @@ export function DateElement(props) {
|
|
|
282
276
|
}
|
|
283
277
|
|
|
284
278
|
let xButton = null,
|
|
285
|
-
|
|
286
|
-
|
|
279
|
+
trigger = null,
|
|
280
|
+
input = null,
|
|
287
281
|
dropdownMenu = null,
|
|
288
282
|
assembledComponents = null;
|
|
289
283
|
|
|
290
284
|
if (showXButton && !_.isNil(value)) {
|
|
291
285
|
xButton = <IconButton
|
|
292
286
|
{...testProps('xBtn')}
|
|
287
|
+
icon={Xmark}
|
|
293
288
|
_icon={{
|
|
294
|
-
as: Xmark,
|
|
295
|
-
color: 'trueGray.600',
|
|
296
289
|
size: 'sm',
|
|
290
|
+
className: 'text-grey-600',
|
|
297
291
|
}}
|
|
298
292
|
isDisabled={isDisabled}
|
|
299
293
|
onPress={onClearBtn}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
294
|
+
className={`
|
|
295
|
+
h-full
|
|
296
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
297
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
298
|
+
`}
|
|
305
299
|
/>;
|
|
306
300
|
}
|
|
301
|
+
trigger = <IconButton
|
|
302
|
+
{...testProps('trigger')}
|
|
303
|
+
ref={triggerRef}
|
|
304
|
+
icon={Calendar}
|
|
305
|
+
_icon={{
|
|
306
|
+
size: 'sm',
|
|
307
|
+
className: styles.FORM_DATE_ICON_COLOR,
|
|
308
|
+
}}
|
|
309
|
+
onPress={onTriggerPress}
|
|
310
|
+
onBlur={onTriggerBlur}
|
|
311
|
+
isDisabled={isDisabled}
|
|
312
|
+
className={`
|
|
313
|
+
h-10
|
|
314
|
+
w-10
|
|
315
|
+
border
|
|
316
|
+
border-grey-400
|
|
317
|
+
rounded-l-md
|
|
318
|
+
rounded-r-none
|
|
319
|
+
${styles.FORM_DATE_ICON_BG}
|
|
320
|
+
${styles.FORM_DATE_ICON_BG_HOVER}
|
|
321
|
+
`}
|
|
322
|
+
/>;
|
|
307
323
|
|
|
308
324
|
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
isDisabled={isDisabled}
|
|
371
|
-
// onLayout={(e) => {
|
|
372
|
-
// const {
|
|
373
|
-
// height,
|
|
374
|
-
// width,
|
|
375
|
-
// } = e.nativeEvent.layout;
|
|
376
|
-
// setWidth(Math.round(width));
|
|
377
|
-
// setTop(Math.round(height));
|
|
378
|
-
// }}
|
|
379
|
-
flex={1}
|
|
380
|
-
h="100%"
|
|
381
|
-
m={0}
|
|
382
|
-
autoSubmitDelay={1000}
|
|
383
|
-
borderTopRightRadius={0}
|
|
384
|
-
borderBottomRightRadius={0}
|
|
385
|
-
fontSize={styles.FORM_DATE_READOUT_FONTSIZE}
|
|
386
|
-
color={_.isEmpty(textInputValue) ? 'trueGray.400' : '#000'}
|
|
387
|
-
bg={styles.FORM_DATE_INPUT_BG}
|
|
388
|
-
_focus={{
|
|
389
|
-
bg: styles.FORM_DATE_INPUT_FOCUS_BG,
|
|
390
|
-
}}
|
|
391
|
-
placeholder={placeholder}
|
|
392
|
-
{..._input}
|
|
393
|
-
/>}
|
|
394
|
-
</>;
|
|
325
|
+
input = disableDirectEntry ?
|
|
326
|
+
<Pressable
|
|
327
|
+
{...testProps('togglePickerBtn')}
|
|
328
|
+
onPress={togglePicker}
|
|
329
|
+
className="flex-1 h-full"
|
|
330
|
+
>
|
|
331
|
+
<TextNative
|
|
332
|
+
ref={inputRef}
|
|
333
|
+
numberOfLines={1}
|
|
334
|
+
ellipsizeMode="head"
|
|
335
|
+
className={`
|
|
336
|
+
flex-1
|
|
337
|
+
h-full
|
|
338
|
+
m-0
|
|
339
|
+
p-2
|
|
340
|
+
border
|
|
341
|
+
border-grey-400
|
|
342
|
+
border-l-[0px]
|
|
343
|
+
rounded-l-none
|
|
344
|
+
rounded-r-md
|
|
345
|
+
${_.isEmpty(textInputValue) ? "text-grey-400" : "text-black"}
|
|
346
|
+
${styles.FORM_DATE_INPUT_BG}
|
|
347
|
+
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
348
|
+
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
349
|
+
`}
|
|
350
|
+
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</TextNative>
|
|
351
|
+
</Pressable> :
|
|
352
|
+
<Input
|
|
353
|
+
testID={testID}
|
|
354
|
+
ref={inputRef}
|
|
355
|
+
value={textInputValue}
|
|
356
|
+
// setValue={onInputSetValue}
|
|
357
|
+
onChangeValue={onInputChangeValue}
|
|
358
|
+
onKeyPress={onInputKeyPress}
|
|
359
|
+
onBlur={onInputBlur}
|
|
360
|
+
onFocus={onInputFocus}
|
|
361
|
+
autoSubmit={true}
|
|
362
|
+
isDisabled={isDisabled}
|
|
363
|
+
// onLayout={(e) => {
|
|
364
|
+
// const {
|
|
365
|
+
// height,
|
|
366
|
+
// width,
|
|
367
|
+
// } = e.nativeEvent.layout;
|
|
368
|
+
// setWidth(Math.round(width));
|
|
369
|
+
// setTop(Math.round(height));
|
|
370
|
+
// }}
|
|
371
|
+
className={`
|
|
372
|
+
flex-1
|
|
373
|
+
h-full
|
|
374
|
+
m-0
|
|
375
|
+
rounded-tr-none
|
|
376
|
+
rounded-br-none
|
|
377
|
+
${styles.FORM_DATE_INPUT_BG}
|
|
378
|
+
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
379
|
+
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
380
|
+
${_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black'}
|
|
381
|
+
`}
|
|
382
|
+
autoSubmitDelay={1000}
|
|
383
|
+
placeholder={placeholder}
|
|
384
|
+
{..._input}
|
|
385
|
+
/>;
|
|
395
386
|
}
|
|
396
|
-
|
|
397
|
-
|
|
387
|
+
if (UiGlobals.mode === UI_MODE_NATIVE) {
|
|
388
|
+
throw new Error('Migration to Gluestack not yet implemented for Native mode');
|
|
398
389
|
// This input and trigger are for show
|
|
399
390
|
// The just show the current value and open the menu
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
{...testProps('togglePickerBtn')}
|
|
426
|
-
onPress={togglePicker}
|
|
427
|
-
flex={1}
|
|
428
|
-
>
|
|
429
|
-
<Text
|
|
430
|
-
flex={1}
|
|
431
|
-
h="100%"
|
|
432
|
-
numberOfLines={1}
|
|
433
|
-
ellipsizeMode="head"
|
|
434
|
-
m={0}
|
|
435
|
-
p={2}
|
|
436
|
-
borderWidth={1}
|
|
437
|
-
borderColor="trueGray.400"
|
|
438
|
-
borderLeftWidth={0}
|
|
439
|
-
borderLeftRadius={0}
|
|
440
|
-
borderRightRadius="md"
|
|
441
|
-
fontSize={styles.FORM_DATE_READOUT_FONTSIZE}
|
|
442
|
-
color={_.isEmpty(textInputValue) ? 'trueGray.400' : '#000'}
|
|
443
|
-
bg={styles.FORM_DATE_INPUT_BG}
|
|
444
|
-
_focus={{
|
|
445
|
-
bg: styles.FORM_DATE_INPUT_FOCUS_BG,
|
|
446
|
-
}}
|
|
447
|
-
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</Text>
|
|
448
|
-
</Pressable>
|
|
449
|
-
</>;
|
|
391
|
+
input = <Pressable
|
|
392
|
+
{...testProps('togglePickerBtn')}
|
|
393
|
+
onPress={togglePicker}
|
|
394
|
+
className="flex-1"
|
|
395
|
+
>
|
|
396
|
+
<TextNative
|
|
397
|
+
numberOfLines={1}
|
|
398
|
+
ellipsizeMode="head"
|
|
399
|
+
className={`
|
|
400
|
+
flex-1
|
|
401
|
+
h-full
|
|
402
|
+
m-0
|
|
403
|
+
p-2
|
|
404
|
+
border
|
|
405
|
+
border-grey-400
|
|
406
|
+
border-l-[0px]
|
|
407
|
+
rounded-l-none
|
|
408
|
+
rounded-r-md
|
|
409
|
+
${_.isEmpty(textInputValue) ? "text-grey-400" : "text-black"}
|
|
410
|
+
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
411
|
+
${styles.FORM_DATE_INPUT_BG}
|
|
412
|
+
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
413
|
+
`}
|
|
414
|
+
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</TextNative>
|
|
415
|
+
</Pressable>;
|
|
450
416
|
}
|
|
451
417
|
|
|
452
418
|
if (isPickerShown) {
|
|
453
419
|
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
454
|
-
|
|
455
|
-
// place the picker in a convenient spot
|
|
456
|
-
const
|
|
457
|
-
translateParts = [],
|
|
458
|
-
translateProps = {};
|
|
459
|
-
if (isTranslateX) {
|
|
460
|
-
translateParts.push('translateX(-100%)');
|
|
461
|
-
}
|
|
462
|
-
if (isTranslateY) {
|
|
463
|
-
translateParts.push('translateY(-100%)');
|
|
464
|
-
}
|
|
465
|
-
if (!_.isEmpty(translateParts)) {
|
|
466
|
-
translateProps.style = {
|
|
467
|
-
transform: translateParts.join(' '),
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
420
|
dropdownMenu = <Popover
|
|
471
421
|
isOpen={isPickerShown}
|
|
472
422
|
onClose={() => {
|
|
473
423
|
hidePicker();
|
|
474
424
|
}}
|
|
475
425
|
trigger={emptyFn}
|
|
476
|
-
|
|
477
|
-
placement={'auto'}
|
|
478
|
-
{...props}
|
|
426
|
+
className="block"
|
|
479
427
|
>
|
|
480
|
-
<
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
428
|
+
<PopoverBackdrop className="PopoverBackdrop bg-[#000]" />
|
|
429
|
+
<PopoverContent
|
|
430
|
+
ref={pickerRef}
|
|
431
|
+
className={`
|
|
432
|
+
PopoverContent
|
|
433
|
+
`}
|
|
434
|
+
style={{
|
|
435
|
+
top,
|
|
436
|
+
left,
|
|
437
|
+
width,
|
|
438
|
+
height,
|
|
439
|
+
minWidth: menuMinWidth,
|
|
440
|
+
}}
|
|
489
441
|
>
|
|
490
|
-
<
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
p={0}
|
|
442
|
+
<PopoverBody
|
|
443
|
+
className={`
|
|
444
|
+
PopoverBody
|
|
445
|
+
overflow-hidden
|
|
446
|
+
`}
|
|
496
447
|
>
|
|
497
448
|
<Datetime
|
|
498
449
|
{...testProps('picker')}
|
|
@@ -504,13 +455,13 @@ export function DateElement(props) {
|
|
|
504
455
|
timeFormat={mode === TIME || mode === DATETIME ? 'HH:mm:ss' : false}
|
|
505
456
|
onChange={onPickerChange}
|
|
506
457
|
/>
|
|
507
|
-
</
|
|
508
|
-
</
|
|
458
|
+
</PopoverBody>
|
|
459
|
+
</PopoverContent>
|
|
509
460
|
</Popover>;
|
|
510
461
|
}
|
|
511
|
-
if (UiGlobals.mode ===
|
|
462
|
+
if (UiGlobals.mode === UI_MODE_NATIVE) {
|
|
512
463
|
const inputAndTriggerClone = // for RN, this is the actual input and trigger, as we need them to appear up above in the modal
|
|
513
|
-
<
|
|
464
|
+
<HStack className="h-[10px]">
|
|
514
465
|
<IconButton
|
|
515
466
|
{...testProps('hidePickerBtn')}
|
|
516
467
|
_icon={{
|
|
@@ -520,39 +471,38 @@ export function DateElement(props) {
|
|
|
520
471
|
}}
|
|
521
472
|
isDisabled={isDisabled}
|
|
522
473
|
onPress={() => hidePicker()}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}}
|
|
474
|
+
className={`
|
|
475
|
+
h-full
|
|
476
|
+
w-10
|
|
477
|
+
border
|
|
478
|
+
border-grey-400
|
|
479
|
+
rounded-l-md
|
|
480
|
+
rounded-r-none
|
|
481
|
+
${styles.FORM_DATE_ICON_BG}
|
|
482
|
+
${styles.FORM_DATE_ICON_BG_HOVER}
|
|
483
|
+
`}
|
|
534
484
|
/>
|
|
535
485
|
{disableDirectEntry ?
|
|
536
|
-
<
|
|
486
|
+
<TextNative
|
|
537
487
|
ref={inputRef}
|
|
538
|
-
flex={1}
|
|
539
|
-
h="100%"
|
|
540
488
|
numberOfLines={1}
|
|
541
489
|
ellipsizeMode="head"
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
490
|
+
className={`
|
|
491
|
+
flex-1
|
|
492
|
+
h-full
|
|
493
|
+
m-0
|
|
494
|
+
p-2
|
|
495
|
+
border
|
|
496
|
+
border-grey-400
|
|
497
|
+
border-l-0
|
|
498
|
+
rounded-l-none
|
|
499
|
+
rounded-r-md
|
|
500
|
+
${_.isEmpty(textInputValue) ? "text-grey-400" : "text-black"}
|
|
501
|
+
${styles.FORM_DATE_INPUT_BG}
|
|
502
|
+
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
503
|
+
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
504
|
+
`}
|
|
505
|
+
>{textInputValue}</TextNative> :
|
|
556
506
|
<Input
|
|
557
507
|
{...testProps('input')}
|
|
558
508
|
ref={inputRef}
|
|
@@ -563,77 +513,91 @@ export function DateElement(props) {
|
|
|
563
513
|
onKeyPress={onInputKeyPress}
|
|
564
514
|
onFocus={onInputFocus}
|
|
565
515
|
onBlur={onInputBlur}
|
|
566
|
-
flex={1}
|
|
567
|
-
h="100%"
|
|
568
|
-
m={0}
|
|
569
516
|
autoSubmitDelay={1000}
|
|
570
|
-
borderTopRightRadius={0}
|
|
571
|
-
borderBottomRightRadius={0}
|
|
572
|
-
fontSize={styles.FORM_DATE_READOUT_FONTSIZE}
|
|
573
|
-
color={_.isEmpty(textInputValue) ? 'trueGray.400' : '#000'}
|
|
574
|
-
bg={styles.FORM_DATE_INPUT_BG}
|
|
575
|
-
_focus={{
|
|
576
|
-
bg: styles.FORM_DATE_INPUT_FOCUS_BG,
|
|
577
|
-
}}
|
|
578
517
|
placeholder={placeholder}
|
|
518
|
+
className={`
|
|
519
|
+
flex-1
|
|
520
|
+
h-full
|
|
521
|
+
m-0
|
|
522
|
+
rounded-tr-none
|
|
523
|
+
rounded-br-none
|
|
524
|
+
${_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black'}
|
|
525
|
+
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
526
|
+
${styles.FORM_DATE_INPUT_BG}
|
|
527
|
+
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
528
|
+
`}
|
|
579
529
|
{..._input}
|
|
580
530
|
/>}
|
|
581
|
-
</
|
|
531
|
+
</HStack>;
|
|
582
532
|
dropdownMenu = <Modal
|
|
583
533
|
isOpen={true}
|
|
584
534
|
safeAreaTop={true}
|
|
585
535
|
onClose={() => setIsPickerShown(false)}
|
|
586
|
-
|
|
587
|
-
mb="auto"
|
|
588
|
-
w="100%"
|
|
589
|
-
h={400}
|
|
590
|
-
p={5}
|
|
536
|
+
className="mt-auto mb-auto w-full h-[400px] p-[5px]"
|
|
591
537
|
>
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
538
|
+
<ModalBackdrop />
|
|
539
|
+
<ModalContent>
|
|
540
|
+
<ModalBody>
|
|
541
|
+
{inputAndTriggerClone}
|
|
542
|
+
{/* <Datetime
|
|
543
|
+
open={true}
|
|
544
|
+
input={false}
|
|
545
|
+
mode={mode === DATE ? 'date' : mode === TIME ? 'time' : mode === DATETIME ? 'datetime' : null}
|
|
546
|
+
closeOnClickOutside={false}
|
|
547
|
+
value={pickerValue}
|
|
548
|
+
dateFormat={mode === DATE || mode === DATETIME ? 'YYYY-MM-DD' : false}
|
|
549
|
+
timeFormat={mode === TIME || mode === DATETIME ? 'HH:mm:ss' : false}
|
|
550
|
+
onChange={onPickerChange}
|
|
551
|
+
/> */}
|
|
552
|
+
<Box className="bg-white">
|
|
553
|
+
<Datetime
|
|
554
|
+
{...testProps('picker')}
|
|
555
|
+
initialDate={moment(value).toDate()}
|
|
556
|
+
selectedStartDate={moment(value).toDate()}
|
|
557
|
+
onDateChange={onPickerChange}
|
|
558
|
+
todayBackgroundColor="#eee"
|
|
559
|
+
selectedDayColor="#f00"
|
|
560
|
+
selectedDayTextColor="#fff"
|
|
561
|
+
/>
|
|
562
|
+
</Box>
|
|
563
|
+
</ModalBody>
|
|
564
|
+
</ModalContent>
|
|
614
565
|
</Modal>;
|
|
615
566
|
}
|
|
616
567
|
}
|
|
617
568
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
569
|
+
let className = `
|
|
570
|
+
Date-HStackNative
|
|
571
|
+
flex-1
|
|
572
|
+
justify-center
|
|
573
|
+
items-center
|
|
574
|
+
${styles.FORM_COMBO_HEIGHT}
|
|
575
|
+
`;
|
|
576
|
+
if (props.className) {
|
|
577
|
+
className += props.className;
|
|
621
578
|
}
|
|
622
|
-
|
|
579
|
+
const style = props.style || {};
|
|
580
|
+
if (!_.isNil(height)) {
|
|
581
|
+
style.height = height;
|
|
582
|
+
}
|
|
583
|
+
if (!_.isNil(width)) {
|
|
584
|
+
style.width = width;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
assembledComponents = <HStackNative
|
|
588
|
+
onLayout={() => setIsRendered(true)}
|
|
589
|
+
className={className}
|
|
590
|
+
style={style}
|
|
591
|
+
>
|
|
623
592
|
{xButton}
|
|
624
|
-
{
|
|
593
|
+
{trigger}
|
|
594
|
+
{input}
|
|
625
595
|
{additionalButtons}
|
|
626
596
|
{dropdownMenu}
|
|
627
|
-
</
|
|
628
|
-
|
|
629
|
-
if (tooltip) {
|
|
630
|
-
assembledComponents = <Tooltip label={tooltip} placement={tooltipPlacement}>
|
|
631
|
-
{assembledComponents}
|
|
632
|
-
</Tooltip>;
|
|
633
|
-
}
|
|
597
|
+
</HStackNative>;
|
|
634
598
|
|
|
635
599
|
return assembledComponents;
|
|
636
600
|
|
|
637
|
-
};
|
|
601
|
+
});
|
|
638
602
|
|
|
639
|
-
export default withComponent(withValue(DateElement));
|
|
603
|
+
export default withComponent(withValue(withTooltip(DateElement)));
|