@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,4 +1,4 @@
|
|
|
1
|
-
import { useState, } from 'react';
|
|
1
|
+
import { forwardRef, useState, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
EDITOR_TYPE__INLINE,
|
|
4
4
|
} from '../../Constants/Editor.js';
|
|
@@ -9,20 +9,21 @@ import _ from 'lodash';
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
function withAdditionalProps(WrappedComponent) {
|
|
12
|
-
return (props) => {
|
|
12
|
+
return forwardRef((props, ref) => {
|
|
13
13
|
// provide the editorType to withEditor
|
|
14
14
|
return <WrappedComponent
|
|
15
15
|
editorType={EDITOR_TYPE__INLINE}
|
|
16
16
|
{...props}
|
|
17
|
+
ref={ref}
|
|
17
18
|
/>;
|
|
18
|
-
};
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
// NOTE: Effectivtly, the HOC composition is:
|
|
22
23
|
// withAdditionalProps(withEditor(withInlineEditor))
|
|
23
24
|
|
|
24
25
|
export default function withInlineEditor(WrappedComponent, skipWrappers = false) {
|
|
25
|
-
const Editor = (props) => {
|
|
26
|
+
const Editor = forwardRef((props, ref) => {
|
|
26
27
|
const {
|
|
27
28
|
isEditorShown = false,
|
|
28
29
|
setIsEditorShown,
|
|
@@ -57,8 +58,9 @@ export default function withInlineEditor(WrappedComponent, skipWrappers = false)
|
|
|
57
58
|
/>}
|
|
58
59
|
|
|
59
60
|
{...props}
|
|
61
|
+
ref={ref}
|
|
60
62
|
/>;
|
|
61
|
-
};
|
|
63
|
+
});
|
|
62
64
|
if (skipWrappers) {
|
|
63
65
|
return Editor; // this is for InlineSideEditor, not yet implemented
|
|
64
66
|
}
|
|
@@ -1,69 +1,44 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef, useState, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
|
-
Button,
|
|
5
|
-
Column,
|
|
6
4
|
Icon,
|
|
7
|
-
Modal,
|
|
8
|
-
Row,
|
|
5
|
+
Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
|
|
9
6
|
Text,
|
|
10
|
-
} from '
|
|
11
|
-
import
|
|
7
|
+
} from '../Gluestack';
|
|
8
|
+
import Button from '../Buttons/Button.js';
|
|
12
9
|
import Panel from '../Panel/Panel.js';
|
|
13
|
-
import
|
|
14
|
-
import Rotate from '../Icons/Rotate.js';
|
|
15
|
-
import TriangleExclamation from '../Icons/TriangleExclamation.js';
|
|
10
|
+
import Footer from '../Layout/Footer.js';
|
|
16
11
|
import useAdjustedWindowSize from '../../Hooks/useAdjustedWindowSize.js';
|
|
17
12
|
import testProps from '../../Functions/testProps.js';
|
|
18
13
|
import _ from 'lodash';
|
|
19
14
|
|
|
20
|
-
// This HOC enables
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
// Use withAlert for simple alerts, confirmations, and custom dialogs.
|
|
15
|
+
// This HOC enables usage of more complex dialogs in the wrapped component.
|
|
16
|
+
// Use withAlert for simple alerts, confirmations, and info dialogs.
|
|
24
17
|
|
|
25
18
|
export default function withModal(WrappedComponent) {
|
|
26
|
-
return (props) => {
|
|
19
|
+
return forwardRef((props, ref) => {
|
|
27
20
|
|
|
28
21
|
if (props.disableWithModal || props.showModal) {
|
|
29
|
-
return <WrappedComponent {...props} />;
|
|
22
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
30
23
|
}
|
|
31
24
|
|
|
32
25
|
const
|
|
33
26
|
[title, setTitle] = useState(''),
|
|
34
|
-
[message, setMessage] = useState(''),
|
|
35
27
|
[canClose, setCanClose] = useState(true),
|
|
36
28
|
[includeCancel, setIncludeCancel] = useState(false),
|
|
37
|
-
[includeReset, setIncludeReset] = useState(false),
|
|
38
29
|
[isModalShown, setIsModalShown] = useState(false),
|
|
39
|
-
[isValid, setIsValid] = useState(false),
|
|
40
|
-
[isDirty, setIsDirty] = useState(false),
|
|
41
30
|
[h, setHeight] = useState(),
|
|
42
31
|
[w, setWidth] = useState(),
|
|
43
32
|
[onOk, setOnOk] = useState(),
|
|
44
33
|
[okBtnLabel, setOkBtnLabel] = useState(),
|
|
45
34
|
[onYes, setOnYes] = useState(),
|
|
46
35
|
[onNo, setOnNo] = useState(),
|
|
47
|
-
[onSubmit, setOnSubmit] = useState(),
|
|
48
|
-
[submitBtnLabel, setSubmitBtnLabel] = useState(),
|
|
49
36
|
[customButtons, setCustomButtons] = useState(),
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[color, setColor] = useState(),
|
|
53
|
-
[body, setBody] = useState(),
|
|
54
|
-
useForm = !!formProps, // convenience flag
|
|
37
|
+
[body, setBody] = useState(),
|
|
38
|
+
[whichModal, setWhichModal] = useState(),
|
|
55
39
|
autoFocusRef = useRef(null),
|
|
56
40
|
cancelRef = useRef(null),
|
|
57
|
-
[
|
|
58
|
-
onValidityChange = (isValid) => {
|
|
59
|
-
setIsValid(isValid);
|
|
60
|
-
},
|
|
61
|
-
onDirtyChange = (isDirty) => {
|
|
62
|
-
setIsDirty(isDirty);
|
|
63
|
-
},
|
|
64
|
-
onReset = () => {
|
|
65
|
-
self?.children?.ModalForm?.reset();
|
|
66
|
-
},
|
|
41
|
+
[windowWidth, windowHeight] = useAdjustedWindowSize(w, h),
|
|
67
42
|
onCancel = () => {
|
|
68
43
|
hideModal();
|
|
69
44
|
},
|
|
@@ -73,34 +48,29 @@ export default function withModal(WrappedComponent) {
|
|
|
73
48
|
showModal = (args) => {
|
|
74
49
|
let {
|
|
75
50
|
title = null,
|
|
76
|
-
message = null,
|
|
77
51
|
body = null,
|
|
78
|
-
canClose =
|
|
52
|
+
canClose = false,
|
|
79
53
|
includeCancel = false,
|
|
80
54
|
onOk = null,
|
|
81
55
|
okBtnLabel = null,
|
|
82
56
|
onYes = null,
|
|
83
57
|
onNo = null,
|
|
84
|
-
onSubmit = null,
|
|
85
|
-
submitBtnLabel = null,
|
|
86
58
|
customButtons = null,
|
|
87
|
-
includeReset = false,
|
|
88
|
-
formProps = null,
|
|
89
|
-
self = null,
|
|
90
|
-
color = null,
|
|
91
59
|
h = null,
|
|
92
60
|
w = null,
|
|
61
|
+
whichModal = null,
|
|
62
|
+
formProps = null, // deprecated
|
|
93
63
|
} = args;
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
64
|
+
|
|
65
|
+
if (formProps) {
|
|
66
|
+
// deprecated formProps bc we were getting circular dependencies
|
|
67
|
+
throw new Error('withModal: formProps is deprecated. Instead, insert the <Form> in "body" directly from the component that called showModal.');
|
|
97
68
|
}
|
|
98
|
-
if (
|
|
99
|
-
throw new Error('
|
|
69
|
+
if (!body) {
|
|
70
|
+
throw new Error('withModal: body is required for showModal');
|
|
100
71
|
}
|
|
101
72
|
|
|
102
73
|
setTitle(title);
|
|
103
|
-
setMessage(message);
|
|
104
74
|
setBody(body);
|
|
105
75
|
setCanClose(canClose);
|
|
106
76
|
setIncludeCancel(includeCancel);
|
|
@@ -108,54 +78,41 @@ export default function withModal(WrappedComponent) {
|
|
|
108
78
|
setOkBtnLabel(okBtnLabel || 'OK');
|
|
109
79
|
setOnYes(onYes ? () => onYes : null);
|
|
110
80
|
setOnNo(onNo ? () => onNo : null);
|
|
111
|
-
setOnSubmit(onSubmit ? () => onSubmit : null);
|
|
112
|
-
setSubmitBtnLabel(submitBtnLabel);
|
|
113
81
|
setCustomButtons(customButtons);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
setColor(color || '#000');
|
|
118
|
-
setHeight(h || 250);
|
|
119
|
-
setWidth(w || 400);
|
|
120
|
-
|
|
82
|
+
setHeight(h); // || 250
|
|
83
|
+
setWidth(w); // || 400
|
|
84
|
+
setWhichModal(whichModal);
|
|
121
85
|
setIsModalShown(true);
|
|
86
|
+
},
|
|
87
|
+
updateModalBody = (newBody) => {
|
|
88
|
+
setBody(newBody);
|
|
122
89
|
};
|
|
123
90
|
|
|
124
|
-
let
|
|
91
|
+
let modalBody,
|
|
92
|
+
buttons = [];
|
|
125
93
|
if (isModalShown) {
|
|
126
94
|
// assemble buttons
|
|
127
|
-
if (includeReset) {
|
|
128
|
-
buttons.push(<IconButton
|
|
129
|
-
{...testProps('resetBtn')}
|
|
130
|
-
key="resetBtn"
|
|
131
|
-
onPress={onReset}
|
|
132
|
-
icon={Rotate}
|
|
133
|
-
_icon={{
|
|
134
|
-
color: !isDirty ? 'trueGray.400' : '#000',
|
|
135
|
-
}}
|
|
136
|
-
isDisabled={!isDirty}
|
|
137
|
-
mr={2}
|
|
138
|
-
/>);
|
|
139
|
-
}
|
|
140
95
|
if (includeCancel) {
|
|
141
96
|
buttons.push(<Button
|
|
142
97
|
{...testProps('cancelBtn')}
|
|
143
98
|
key="cancelBtn"
|
|
144
99
|
onPress={onCancel}
|
|
145
100
|
colorScheme="coolGray"
|
|
146
|
-
variant="ghost" // or unstyled
|
|
147
101
|
ref={cancelRef}
|
|
148
|
-
|
|
102
|
+
className="mr-2"
|
|
103
|
+
text="Cancel"
|
|
104
|
+
variant="outline" // or unstyled
|
|
105
|
+
/>);
|
|
149
106
|
}
|
|
150
107
|
if (onNo) {
|
|
151
108
|
buttons.push(<Button
|
|
152
109
|
{...testProps('noBtn')}
|
|
153
110
|
key="noBtn"
|
|
154
111
|
onPress={onNo}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
112
|
+
className="text-grey-800 mr-2"
|
|
113
|
+
text="No"
|
|
114
|
+
variant="outline"
|
|
115
|
+
/>);
|
|
159
116
|
}
|
|
160
117
|
if (onOk) {
|
|
161
118
|
buttons.push(<Button
|
|
@@ -163,7 +120,9 @@ export default function withModal(WrappedComponent) {
|
|
|
163
120
|
key="okBtn"
|
|
164
121
|
ref={autoFocusRef}
|
|
165
122
|
onPress={onOk}
|
|
166
|
-
|
|
123
|
+
text={okBtnLabel}
|
|
124
|
+
className="text-white"
|
|
125
|
+
/>);
|
|
167
126
|
}
|
|
168
127
|
if (onYes) {
|
|
169
128
|
buttons.push(<Button
|
|
@@ -171,83 +130,66 @@ export default function withModal(WrappedComponent) {
|
|
|
171
130
|
key="yesBtn"
|
|
172
131
|
ref={autoFocusRef}
|
|
173
132
|
onPress={onYes}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
buttons.push(<Button
|
|
178
|
-
{...testProps('submitBtn')}
|
|
179
|
-
key="submitBtn"
|
|
180
|
-
onPress={onSubmit}
|
|
181
|
-
isDisabled={!isValid}
|
|
182
|
-
color="#fff"
|
|
183
|
-
>{submitBtnLabel || 'Submit'}</Button>);
|
|
133
|
+
text="Yes"
|
|
134
|
+
className="text-white"
|
|
135
|
+
/>);
|
|
184
136
|
}
|
|
185
137
|
if (customButtons) {
|
|
186
138
|
_.each(customButtons, (button) => {
|
|
187
139
|
buttons.push(button);
|
|
188
140
|
});
|
|
189
141
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
let modalBody = null;
|
|
193
|
-
if (useForm) {
|
|
194
|
-
modalBody = <Form
|
|
195
|
-
{...formProps}
|
|
196
|
-
parent={self}
|
|
197
|
-
reference="ModalForm"
|
|
198
|
-
onValidityChange={onValidityChange}
|
|
199
|
-
onDirtyChange={onDirtyChange}
|
|
200
|
-
/>;
|
|
201
|
-
} else if (body) {
|
|
142
|
+
|
|
143
|
+
// assemble body
|
|
202
144
|
modalBody = body;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
145
|
+
if (h || w || title) {
|
|
146
|
+
let footer = null;
|
|
147
|
+
if (buttons && buttons.length > 0) {
|
|
148
|
+
footer = <Footer
|
|
149
|
+
className={`
|
|
150
|
+
justify-end
|
|
151
|
+
py-2
|
|
152
|
+
pr-4
|
|
153
|
+
bg-grey-100
|
|
154
|
+
`}
|
|
155
|
+
>{buttons}</Footer>;
|
|
156
|
+
}
|
|
157
|
+
modalBody =
|
|
158
|
+
<Panel
|
|
159
|
+
title={title}
|
|
160
|
+
isCollapsible={false}
|
|
161
|
+
className="bg-white overflow-auto"
|
|
162
|
+
h={h > windowHeight ? windowHeight : h}
|
|
163
|
+
w={w > windowWidth ? windowWidth : w}
|
|
164
|
+
isWindow={true}
|
|
165
|
+
disableAutoFlex={true}
|
|
166
|
+
onClose={canClose ? hideModal : null}
|
|
167
|
+
footer={footer}
|
|
168
|
+
>{modalBody}</Panel>
|
|
169
|
+
}
|
|
210
170
|
}
|
|
211
|
-
|
|
171
|
+
|
|
212
172
|
return <>
|
|
213
173
|
<WrappedComponent
|
|
214
174
|
{...props}
|
|
215
175
|
disableWithModal={false}
|
|
216
176
|
showModal={showModal}
|
|
217
177
|
hideModal={onCancel}
|
|
178
|
+
updateModalBody={updateModalBody}
|
|
179
|
+
isModalShown={isModalShown}
|
|
180
|
+
whichModal={whichModal}
|
|
181
|
+
ref={ref}
|
|
218
182
|
/>
|
|
219
183
|
{isModalShown &&
|
|
220
184
|
<Modal
|
|
221
185
|
isOpen={true}
|
|
222
186
|
onClose={onCancel}
|
|
187
|
+
className="Modal"
|
|
223
188
|
>
|
|
224
|
-
<
|
|
225
|
-
|
|
226
|
-
isCollapsible={false}
|
|
227
|
-
bg="#fff"
|
|
228
|
-
w={width}
|
|
229
|
-
h={height}
|
|
230
|
-
flex={null}
|
|
231
|
-
>
|
|
232
|
-
{canClose && <Modal.CloseButton />}
|
|
233
|
-
{title && <Modal.Header>{title}</Modal.Header>}
|
|
234
|
-
<Modal.Body
|
|
235
|
-
borderTopWidth={0}
|
|
236
|
-
bg="#fff"
|
|
237
|
-
p={3}
|
|
238
|
-
justifyContent=" center"
|
|
239
|
-
alignItems="center"
|
|
240
|
-
borderRadius={5}
|
|
241
|
-
flexDirection="row"
|
|
242
|
-
>
|
|
243
|
-
{modalBody}
|
|
244
|
-
</Modal.Body>
|
|
245
|
-
<Modal.Footer py={2} pr={4} justifyContent="flex-end">
|
|
246
|
-
{buttons}
|
|
247
|
-
</Modal.Footer>
|
|
248
|
-
</Panel>
|
|
189
|
+
<ModalBackdrop />
|
|
190
|
+
{modalBody}
|
|
249
191
|
</Modal>}
|
|
250
192
|
|
|
251
193
|
</>;
|
|
252
|
-
};
|
|
194
|
+
});
|
|
253
195
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
SELECTION_MODE_MULTI,
|
|
3
4
|
} from '../../Constants/Selection.js';
|
|
4
5
|
|
|
5
6
|
export default function withMultiSelection(WrappedComponent) {
|
|
6
|
-
return (props) => {
|
|
7
|
+
return forwardRef((props, ref) => {
|
|
7
8
|
const
|
|
8
9
|
{
|
|
9
10
|
selectionMode = SELECTION_MODE_MULTI,
|
|
@@ -11,6 +12,7 @@ export default function withMultiSelection(WrappedComponent) {
|
|
|
11
12
|
return <WrappedComponent
|
|
12
13
|
selectionMode={selectionMode}
|
|
13
14
|
{...props}
|
|
15
|
+
ref={ref}
|
|
14
16
|
/>;
|
|
15
|
-
};
|
|
17
|
+
});
|
|
16
18
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
VIEW,
|
|
3
4
|
} from '../../Constants/Commands.js';
|
|
5
|
+
import { EDITOR_TYPE__PLAIN } from '../../Constants/Editor.js';
|
|
4
6
|
import * as yup from 'yup'; // https://github.com/jquense/yup#string
|
|
5
7
|
import Inflector from 'inflector-js';
|
|
6
8
|
import qs from 'qs';
|
|
7
|
-
import inArray from '../../Functions/inArray.js';
|
|
8
|
-
import Pdf from '../Icons/Pdf.js';
|
|
9
9
|
import withModal from './withModal.js';
|
|
10
|
-
import
|
|
10
|
+
import Form from '../Form/Form.js';
|
|
11
|
+
import Pdf from '../Icons/Pdf.js';
|
|
11
12
|
import UiGlobals from '../../UiGlobals.js';
|
|
13
|
+
import inArray from '../../Functions/inArray.js';
|
|
12
14
|
import _ from 'lodash';
|
|
13
15
|
|
|
14
16
|
export default function withPdfButtons(WrappedComponent) {
|
|
15
|
-
return withModal((props) => {
|
|
16
|
-
|
|
17
|
+
return withModal(forwardRef((props, ref) => {
|
|
17
18
|
let showButtons = true;
|
|
18
19
|
if (!props.showPdfBtns) {
|
|
19
20
|
showButtons = false;
|
|
@@ -25,7 +26,7 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
25
26
|
// bypass everything.
|
|
26
27
|
// If we don't do this, we get an infinite recursion with Form
|
|
27
28
|
// because this HOC wraps Form and uses Form itself.
|
|
28
|
-
return <WrappedComponent {...props} />;
|
|
29
|
+
return <WrappedComponent {...props} ref={ref} />;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const {
|
|
@@ -54,6 +55,7 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
54
55
|
hideModal,
|
|
55
56
|
|
|
56
57
|
} = props,
|
|
58
|
+
styles = UiGlobals.styles,
|
|
57
59
|
propertyNames = [],
|
|
58
60
|
buildModalItems = () => {
|
|
59
61
|
const modalItems = _.map(_.cloneDeep(items), (item, ix) => buildNextLayer(item, ix, columnDefaults)); // clone, as we don't want to alter the item by reference
|
|
@@ -81,8 +83,9 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
81
83
|
|
|
82
84
|
if (!_.isEmpty(ancillaryItems)) {
|
|
83
85
|
const
|
|
86
|
+
ancillaryItemsClone = _.cloneDeep(ancillaryItems),
|
|
84
87
|
items = [];
|
|
85
|
-
_.each(
|
|
88
|
+
_.each(ancillaryItemsClone, (ancillaryItem) => { // clone, as we don't want to alter the item by reference
|
|
86
89
|
let name;
|
|
87
90
|
if (ancillaryItem.pdfModel) {
|
|
88
91
|
name = ancillaryItem.pdfModel;
|
|
@@ -109,7 +112,6 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
109
112
|
items,
|
|
110
113
|
showToggleAllCheckbox: true,
|
|
111
114
|
isCollapsible: false,
|
|
112
|
-
ml: 3, // since it's not in a column, which normally adds pl: 3
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -195,117 +197,110 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
195
197
|
title: 'PDF Fields to Show',
|
|
196
198
|
includeReset: true,
|
|
197
199
|
includeCancel: true,
|
|
198
|
-
onSubmit: () => {
|
|
199
|
-
hideModal();
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
form = self.children.ModalForm,
|
|
203
|
-
data = form.formGetValues();
|
|
204
|
-
|
|
205
|
-
if (userWantsToEmail) {
|
|
206
|
-
onChooseEmailAddress(data);
|
|
207
|
-
} else {
|
|
208
|
-
getPdf(data);
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
submitBtnLabel: userWantsToEmail ? 'Choose Email' : 'Get PDF',
|
|
212
|
-
w: 530, // 510 so it's over the stack threshold
|
|
213
200
|
h: 800,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
201
|
+
w: styles.FORM_STACK_ROW_THRESHOLD + 10,
|
|
202
|
+
body: <Form
|
|
203
|
+
editorType={EDITOR_TYPE__PLAIN}
|
|
204
|
+
alert={alert}
|
|
205
|
+
columnDefaults={{
|
|
206
|
+
labelWidth: '100px',
|
|
207
|
+
}}
|
|
208
|
+
items={[
|
|
209
|
+
{
|
|
210
|
+
name: 'instructions',
|
|
211
|
+
type: 'DisplayField',
|
|
212
|
+
text: 'Please select which fields to show in the PDF.',
|
|
213
|
+
className: 'mb-3',
|
|
214
|
+
},
|
|
215
|
+
...modalItems,
|
|
216
|
+
]}
|
|
217
|
+
Repository={Repository}
|
|
218
|
+
startingValues={startingValues}
|
|
219
|
+
validator={validator}
|
|
220
|
+
submitBtnLabel={userWantsToEmail ? 'Choose Email' : 'Get PDF'}
|
|
221
|
+
onSubmit={(values)=> {
|
|
222
|
+
hideModal();
|
|
223
|
+
|
|
224
|
+
if (userWantsToEmail) {
|
|
225
|
+
onChooseEmailAddress(values);
|
|
226
|
+
} else {
|
|
227
|
+
getPdf(values);
|
|
228
|
+
}
|
|
229
|
+
}}
|
|
230
|
+
/>,
|
|
234
231
|
});
|
|
235
232
|
},
|
|
236
233
|
onChooseEmailAddress = (data) => {
|
|
234
|
+
|
|
237
235
|
showModal({
|
|
238
236
|
title: 'Email To',
|
|
239
|
-
includeReset: true,
|
|
240
237
|
includeCancel: true,
|
|
241
|
-
onSubmit: () => {
|
|
242
|
-
hideModal();
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
fv = self.children.ModalForm.formGetValues(),
|
|
246
|
-
email = fv.email,
|
|
247
|
-
message = fv.message;
|
|
248
|
-
|
|
249
|
-
sendEmail({
|
|
250
|
-
...data,
|
|
251
|
-
email,
|
|
252
|
-
message,
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
|
-
submitBtnLabel: 'Email PDF',
|
|
256
238
|
w: 510, // 510 so it's over the stack threshold
|
|
257
239
|
h: 500,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
240
|
+
body: <Form
|
|
241
|
+
submitBtnLabel='Email PDF'
|
|
242
|
+
onSubmit={(values)=> {
|
|
243
|
+
hideModal();
|
|
244
|
+
|
|
245
|
+
const
|
|
246
|
+
email = values.email,
|
|
247
|
+
message = values.message;
|
|
248
|
+
|
|
249
|
+
sendEmail({
|
|
250
|
+
...data,
|
|
251
|
+
email,
|
|
252
|
+
message,
|
|
253
|
+
});
|
|
254
|
+
}}
|
|
255
|
+
editorType={EDITOR_TYPE__PLAIN}
|
|
256
|
+
alert={alert}
|
|
257
|
+
columnDefaults={{
|
|
258
|
+
labelWidth: '100px',
|
|
259
|
+
}}
|
|
260
|
+
items={[
|
|
261
|
+
{
|
|
262
|
+
name: 'instructions',
|
|
263
|
+
type: 'DisplayField',
|
|
264
|
+
text: 'Please enter one or more email addresses, separated by a comma.',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'email',
|
|
268
|
+
label: 'Email Address',
|
|
269
|
+
type: 'Input',
|
|
270
|
+
tooltip: 'Separate multiple email addresses with a comma.',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'message',
|
|
274
|
+
label: 'Message',
|
|
275
|
+
placeholder: 'Please see attached PDF.',
|
|
276
|
+
type: 'TextArea',
|
|
277
|
+
totalLines: 6,
|
|
278
|
+
},
|
|
279
|
+
]}
|
|
280
|
+
validator={yup.object({
|
|
281
|
+
email: yup.string().required('Email is required').test({
|
|
282
|
+
name: 'csvEmails',
|
|
283
|
+
test: function(value) {
|
|
284
|
+
if (!value) {
|
|
285
|
+
return this.createError({
|
|
286
|
+
message: 'Email is required',
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
const firstInvalidEmail = value.split(",")
|
|
290
|
+
.map(email => email.trim())
|
|
291
|
+
.filter(v => !_.isEmpty(v))
|
|
292
|
+
.find(v => !yup.string().email().isValidSync(v));
|
|
293
|
+
if (firstInvalidEmail) {
|
|
294
|
+
return this.createError({
|
|
295
|
+
message: `The email address '${firstInvalidEmail}' is invalid.`
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return true;
|
|
299
|
+
},
|
|
300
|
+
}),
|
|
301
|
+
message: yup.string().notRequired(),
|
|
302
|
+
})}
|
|
303
|
+
/>,
|
|
309
304
|
});
|
|
310
305
|
},
|
|
311
306
|
getPdf = (data) => {
|
|
@@ -351,6 +346,7 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
351
346
|
icon: Pdf,
|
|
352
347
|
isDisabled: selection.length !== 1,
|
|
353
348
|
handler: () => onChooseFields(true),
|
|
349
|
+
tooltip: 'Email the selected item as a PDF.',
|
|
354
350
|
},
|
|
355
351
|
{
|
|
356
352
|
key: 'viewPdfBtn',
|
|
@@ -358,6 +354,7 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
358
354
|
icon: Pdf,
|
|
359
355
|
isDisabled: selection.length !== 1,
|
|
360
356
|
handler: () => onChooseFields(),
|
|
357
|
+
tooltip: 'View the selected item as a PDF.',
|
|
361
358
|
},
|
|
362
359
|
];
|
|
363
360
|
_.each(buttons, (button) => {
|
|
@@ -373,6 +370,7 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
373
370
|
{...props}
|
|
374
371
|
additionalEditButtons={additionalEditButtons}
|
|
375
372
|
additionalViewButtons={additionalViewButtons}
|
|
373
|
+
ref={ref}
|
|
376
374
|
/>;
|
|
377
|
-
});
|
|
375
|
+
}));
|
|
378
376
|
}
|