@onehat/ui 0.3.380 → 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 +144 -147
- 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
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import Inflector from 'inflector-js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* extractTailwindClasses
|
|
5
|
+
* Extracts the tailwind classes from a className string.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} className
|
|
8
|
+
* @returns {array} of classes
|
|
9
|
+
*/
|
|
10
|
+
export function extractTailwindClasses(className) {
|
|
11
|
+
if (!className) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const regex = /[^\s]+/g;
|
|
15
|
+
return className.match(regex) || [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tailwind patterns to match classes to their CSS properties
|
|
19
|
+
export const commonCssPropertyPatterns = [
|
|
20
|
+
{ pattern: /^h-/, property: 'height' },
|
|
21
|
+
{ pattern: /^w-/, property: 'width' },
|
|
22
|
+
{ pattern: /^flex(-.*)?$/, property: 'flex' },
|
|
23
|
+
{ pattern: /^bg-/, property: 'background-color' },
|
|
24
|
+
{ pattern: /^m([trblxy]?)\-/, property: (m) => `margin${m && m[1] ? '-' + m[1] : ''}` },
|
|
25
|
+
{ pattern: /^p([trblxy]?)\-/, property: (m) => `padding${m && m[1] ? '-' + m[1] : ''}` },
|
|
26
|
+
{ pattern: /^border-/, property: 'border' },
|
|
27
|
+
{ pattern: /^text-\[.*\]$/, property: 'font-size' }, // Matches arbitrary font sizes like 'text-[12px]'
|
|
28
|
+
{ pattern: /^text-(left|center|right|justify)$/, property: 'text-align' }, // Matches text alignment
|
|
29
|
+
{ pattern: /^text-opacity-/, property: 'text-opacity' }, // Matches text opacity
|
|
30
|
+
{ pattern: /^text-shadow(-.*)?$/, property: 'text-shadow' }, // Matches text shadow
|
|
31
|
+
{ pattern: /^indent-/, property: 'text-indent' }, // Matches text indent
|
|
32
|
+
{ pattern: /^text-(decoration|underline-offset)-/, property: 'text' }, // Matches text-related properties
|
|
33
|
+
{ pattern: /^text-(black|white|grey|gray|red|yellow|green|blue|indigo|purple|pink|.*)$/, property: 'color' }, // Matches text colors
|
|
34
|
+
{ pattern: /^(underline|overline|line-through|no-underline)$/, property: 'text-decoration' }, // Matches text decoration
|
|
35
|
+
{ pattern: /^(uppercase|lowercase|capitalize|normal-case)$/, property: 'text-transform' }, // Matches text transform
|
|
36
|
+
{ pattern: /^(truncate|overflow-ellipsis|overflow-clip)$/, property: 'text-overflow' }, // Matches text overflow
|
|
37
|
+
{ pattern: /^decoration-/, property: 'text-decoration-color' }, // Matches text decoration color
|
|
38
|
+
{ pattern: /^decoration-(solid|double|dotted|dashed|wavy)$/, property: 'text-decoration-style' }, // Matches text decoration style
|
|
39
|
+
{ pattern: /^decoration-\[.*\]$/, property: 'text-decoration-thickness' }, // Matches arbitrary text decoration thickness
|
|
40
|
+
{ pattern: /^underline-offset-\[.*\]$/, property: 'underline-offset' }, // Matches arbitrary underline offset
|
|
41
|
+
{ pattern: /^font-/, property: 'font' },
|
|
42
|
+
{ pattern: /^(block|inline-block|inline|flex|grid|hidden)$/, property: 'display' },
|
|
43
|
+
{ pattern: /^items-/, property: 'items' },
|
|
44
|
+
{ pattern: /^justify-/, property: 'justify' },
|
|
45
|
+
{ pattern: /^background-/, property: 'background' },
|
|
46
|
+
{ pattern: /^(visible|invisible)$/, property: 'visibility' },
|
|
47
|
+
{ pattern: /^opacity-/, property: 'opacity' },
|
|
48
|
+
{ pattern: /^z-/, property: 'z' },
|
|
49
|
+
];
|
|
50
|
+
export const allCssPropertyPatterns = [
|
|
51
|
+
{ pattern: /^h-/, property: 'height' },
|
|
52
|
+
{ pattern: /^w-/, property: 'width' },
|
|
53
|
+
{ pattern: /^flex(-.*)?$/, property: 'flex' },
|
|
54
|
+
{ pattern: /^bg-/, property: 'background-color' },
|
|
55
|
+
{ pattern: /^m([trblxy]?)\-/, property: (m) => `margin${m && m[1] ? '-' + m[1] : ''}` },
|
|
56
|
+
{ pattern: /^p([trblxy]?)\-/, property: (m) => `padding${m && m[1] ? '-' + m[1] : ''}` },
|
|
57
|
+
{ pattern: /^border-/, property: 'border' },
|
|
58
|
+
{ pattern: /^text-\[.*\]$/, property: 'font-size' }, // Matches arbitrary font sizes like 'text-[12px]'
|
|
59
|
+
{ pattern: /^text-(left|center|right|justify)$/, property: 'text-align' }, // Matches text alignment
|
|
60
|
+
{ pattern: /^text-opacity-/, property: 'text-opacity' }, // Matches text opacity
|
|
61
|
+
{ pattern: /^text-shadow(-.*)?$/, property: 'text-shadow' }, // Matches text shadow
|
|
62
|
+
{ pattern: /^indent-/, property: 'text-indent' }, // Matches text indent
|
|
63
|
+
{ pattern: /^text-(decoration|underline-offset)-/, property: 'text' }, // Matches text-related properties
|
|
64
|
+
{ pattern: /^text-(black|white|grey|gray|red|yellow|green|blue|indigo|purple|pink|.*)$/, property: 'color' }, // Matches text colors
|
|
65
|
+
{ pattern: /^(underline|overline|line-through|no-underline)$/, property: 'text-decoration' }, // Matches text decoration
|
|
66
|
+
{ pattern: /^(uppercase|lowercase|capitalize|normal-case)$/, property: 'text-transform' }, // Matches text transform
|
|
67
|
+
{ pattern: /^(truncate|overflow-ellipsis|overflow-clip)$/, property: 'text-overflow' }, // Matches text overflow
|
|
68
|
+
{ pattern: /^decoration-/, property: 'text-decoration-color' }, // Matches text decoration color
|
|
69
|
+
{ pattern: /^decoration-(solid|double|dotted|dashed|wavy)$/, property: 'text-decoration-style' }, // Matches text decoration style
|
|
70
|
+
{ pattern: /^decoration-\[.*\]$/, property: 'text-decoration-thickness' }, // Matches arbitrary text decoration thickness
|
|
71
|
+
{ pattern: /^underline-offset-\[.*\]$/, property: 'underline-offset' }, // Matches arbitrary underline offset
|
|
72
|
+
{ pattern: /^font-/, property: 'font' },
|
|
73
|
+
{ pattern: /^(block|inline-block|inline|flex|grid|hidden)$/, property: 'display' },
|
|
74
|
+
{ pattern: /^items-/, property: 'items' },
|
|
75
|
+
{ pattern: /^justify-/, property: 'justify' },
|
|
76
|
+
{ pattern: /^background-/, property: 'background' },
|
|
77
|
+
{ pattern: /^(visible|invisible)$/, property: 'visibility' },
|
|
78
|
+
{ pattern: /^opacity-/, property: 'opacity' },
|
|
79
|
+
{ pattern: /^z-/, property: 'z' },
|
|
80
|
+
{ pattern: /^self-/, property: 'self' },
|
|
81
|
+
{ pattern: /^content-/, property: 'content' },
|
|
82
|
+
{ pattern: /^grid(-.*)?$/, property: 'grid' },
|
|
83
|
+
{ pattern: /^gap-/, property: 'gap' },
|
|
84
|
+
{ pattern: /^space-/, property: 'space' },
|
|
85
|
+
{ pattern: /^place-/, property: 'place' },
|
|
86
|
+
{ pattern: /^leading-/, property: 'leading' },
|
|
87
|
+
{ pattern: /^tracking-/, property: 'tracking' },
|
|
88
|
+
{ pattern: /^list-/, property: 'list' },
|
|
89
|
+
{ pattern: /^placeholder-/, property: 'placeholder' },
|
|
90
|
+
{ pattern: /^order-/, property: 'order' },
|
|
91
|
+
{ pattern: /^cursor-/, property: 'cursor' },
|
|
92
|
+
{ pattern: /^select-/, property: 'select' },
|
|
93
|
+
{ pattern: /^pointer-events-/, property: 'pointer-events' },
|
|
94
|
+
{ pattern: /^resize-/, property: 'resize' },
|
|
95
|
+
{ pattern: /^fill-/, property: 'fill' },
|
|
96
|
+
{ pattern: /^stroke-/, property: 'stroke' },
|
|
97
|
+
{ pattern: /^table-/, property: 'table' },
|
|
98
|
+
{ pattern: /^transition-/, property: 'transition' },
|
|
99
|
+
{ pattern: /^duration-/, property: 'duration' },
|
|
100
|
+
{ pattern: /^ease-/, property: 'ease' },
|
|
101
|
+
{ pattern: /^delay-/, property: 'delay' },
|
|
102
|
+
{ pattern: /^animate-/, property: 'animate' },
|
|
103
|
+
{ pattern: /^transform-/, property: 'transform' },
|
|
104
|
+
{ pattern: /^scale-/, property: 'scale' },
|
|
105
|
+
{ pattern: /^rotate-/, property: 'rotate' },
|
|
106
|
+
{ pattern: /^translate-/, property: 'translate' },
|
|
107
|
+
{ pattern: /^skew-/, property: 'skew' },
|
|
108
|
+
{ pattern: /^origin-/, property: 'origin' },
|
|
109
|
+
{ pattern: /^accent-/, property: 'accent' },
|
|
110
|
+
{ pattern: /^align-/, property: 'align' },
|
|
111
|
+
{ pattern: /^appearance-/, property: 'appearance' },
|
|
112
|
+
{ pattern: /^backface-/, property: 'backface' },
|
|
113
|
+
{ pattern: /^blend-/, property: 'blend' },
|
|
114
|
+
{ pattern: /^blur-/, property: 'blur' },
|
|
115
|
+
{ pattern: /^break-/, property: 'break' },
|
|
116
|
+
{ pattern: /^brightness-/, property: 'brightness' },
|
|
117
|
+
{ pattern: /^caret-/, property: 'caret' },
|
|
118
|
+
{ pattern: /^contrast-/, property: 'contrast' },
|
|
119
|
+
{ pattern: /^decoration-/, property: 'decoration' },
|
|
120
|
+
{ pattern: /^filter-/, property: 'filter' },
|
|
121
|
+
{ pattern: /^float-/, property: 'float' },
|
|
122
|
+
{ pattern: /^clear-/, property: 'clear' },
|
|
123
|
+
{ pattern: /^object-/, property: 'object' },
|
|
124
|
+
{ pattern: /^outline-/, property: 'outline' },
|
|
125
|
+
{ pattern: /^overscroll-/, property: 'overscroll' },
|
|
126
|
+
{ pattern: /^shadow-/, property: 'shadow' },
|
|
127
|
+
{ pattern: /^stroke-/, property: 'stroke' },
|
|
128
|
+
{ pattern: /^transform-/, property: 'transform' },
|
|
129
|
+
{ pattern: /^whitespace-/, property: 'whitespace' },
|
|
130
|
+
{ pattern: /^word-/, property: 'word' },
|
|
131
|
+
{ pattern: /^writing-/, property: 'writing' },
|
|
132
|
+
{ pattern: /^(sr-only|not-sr-only)$/, property: 'accessibility' },
|
|
133
|
+
{ pattern: /^(isolate|isolation-auto)$/, property: 'isolation' },
|
|
134
|
+
{ pattern: /^mix-blend-/, property: 'mix-blend' },
|
|
135
|
+
{ pattern: /^backdrop-/, property: 'backdrop' },
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* getTailwindClasses
|
|
140
|
+
* Extracts the tailwind classes from a className string,
|
|
141
|
+
* takes into account overrides and returns an array of
|
|
142
|
+
* final controlling classes.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} className
|
|
145
|
+
* @param {boolean} useCommonPatterns - whether to use common patterns or all patterns
|
|
146
|
+
* @returns {array} of classes
|
|
147
|
+
*/
|
|
148
|
+
export function getTailwindClasses(className, useCommonPatterns = true) {
|
|
149
|
+
if (!className) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const
|
|
154
|
+
cssPropertyPatterns = useCommonPatterns ? commonCssPropertyPatterns : allCssPropertyPatterns,
|
|
155
|
+
classes = extractTailwindClasses(className),
|
|
156
|
+
propertyClassMap = new Map(),
|
|
157
|
+
result = [];
|
|
158
|
+
|
|
159
|
+
// Process classes in reverse order
|
|
160
|
+
for (let i = classes.length - 1; i >= 0; i--) {
|
|
161
|
+
const
|
|
162
|
+
cls = classes[i],
|
|
163
|
+
parts = cls.split(':'), // Split variants (e.g., 'hover:', 'sm:')
|
|
164
|
+
variant = parts.length > 1 ? parts.slice(0, -1).join(':') + ':' : '',
|
|
165
|
+
baseClass = parts[parts.length - 1];
|
|
166
|
+
|
|
167
|
+
let property = null;
|
|
168
|
+
|
|
169
|
+
// Match class against patterns
|
|
170
|
+
for (const { pattern, property: prop } of cssPropertyPatterns) {
|
|
171
|
+
const match = baseClass.match(pattern);
|
|
172
|
+
if (match) {
|
|
173
|
+
property = typeof prop === 'function' ? prop(match) : prop;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (property) {
|
|
179
|
+
const key = variant + property;
|
|
180
|
+
if (!propertyClassMap.has(key)) {
|
|
181
|
+
propertyClassMap.set(key, cls);
|
|
182
|
+
result.push(cls);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return result.reverse();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* getTailwindValue
|
|
192
|
+
* Extracts the value of a CSS property from a tailwind class.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} className
|
|
195
|
+
* @param {string} cssProperty - like 'background-color' or 'width'
|
|
196
|
+
* @returns {string|null}
|
|
197
|
+
*/
|
|
198
|
+
export function getTailwindValue(className, cssProperty, useCommonPatterns = true) {
|
|
199
|
+
if (!className || !cssProperty) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const
|
|
204
|
+
cssPropertyPatterns = useCommonPatterns ? commonCssPropertyPatterns : allCssPropertyPatterns,
|
|
205
|
+
classes = getTailwindClasses(className);
|
|
206
|
+
|
|
207
|
+
// Find the class that matches the given CSS property
|
|
208
|
+
for (const cls of classes) {
|
|
209
|
+
for (const { pattern, property } of cssPropertyPatterns) {
|
|
210
|
+
const match = cls.match(pattern);
|
|
211
|
+
if (match) {
|
|
212
|
+
const resolvedProperty = typeof property === 'function' ? property(match) : property;
|
|
213
|
+
if (resolvedProperty === cssProperty) {
|
|
214
|
+
// Extract the value from the class
|
|
215
|
+
const valueMatch = cls.match(/-(\[.*\]|[^\s]+)/);
|
|
216
|
+
if (valueMatch) {
|
|
217
|
+
return valueMatch[1].replace(/[\[\]]/g, ''); // Remove brackets if present
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* hasTailwindValue
|
|
229
|
+
* Checks if a tailwind class has a value
|
|
230
|
+
* for a given CSS property.
|
|
231
|
+
*
|
|
232
|
+
* @param {string} className
|
|
233
|
+
* @param {string} cssProperty - like 'background-color' or 'width'
|
|
234
|
+
* @returns {boolean}
|
|
235
|
+
*/
|
|
236
|
+
export function hasTailwindValue(className, cssProperty) {
|
|
237
|
+
const value = getTailwindValue(className, cssProperty);
|
|
238
|
+
if (!value && value !== 0) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* stripClassesByProperty
|
|
246
|
+
* Removes all classes that match a given CSS property.
|
|
247
|
+
*
|
|
248
|
+
* @param {string} className
|
|
249
|
+
* @param {string} cssProperty like 'background-color' or 'width'
|
|
250
|
+
* @returns {string}
|
|
251
|
+
*/
|
|
252
|
+
export function stripClassesByProperty(className, cssProperty, useCommonPatterns = true) {
|
|
253
|
+
if (!className || !cssProperty) {
|
|
254
|
+
return className;
|
|
255
|
+
}
|
|
256
|
+
const
|
|
257
|
+
cssPropertyPatterns = useCommonPatterns ? commonCssPropertyPatterns : allCssPropertyPatterns,
|
|
258
|
+
classes = extractTailwindClasses(className),
|
|
259
|
+
filteredClasses = classes.filter((cls) => {
|
|
260
|
+
return !cssPropertyPatterns.some((patternObj) => {
|
|
261
|
+
const { pattern, property } = patternObj;
|
|
262
|
+
const propertyName = typeof property === 'function' ? property(cls.match(pattern)) : property;
|
|
263
|
+
return propertyName === cssProperty && pattern.test(cls);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
return filteredClasses.join(' ');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* removeToken
|
|
271
|
+
* Removes a token from a tailwind class string.
|
|
272
|
+
* Additional effect: replaces multiple spaces with single spaces, and trims string.
|
|
273
|
+
* @param {string} className
|
|
274
|
+
* @param {string} token like 'bg-blue-300/20'
|
|
275
|
+
* @returns
|
|
276
|
+
*/
|
|
277
|
+
export function removeToken(className, token) {
|
|
278
|
+
if (!className || !token) {
|
|
279
|
+
return className;
|
|
280
|
+
}
|
|
281
|
+
const regex = new RegExp(`\\b${token}\\b`, 'g'); // The \b word boundary ensures that the exact class name is matched, not substrings.
|
|
282
|
+
return className.replace(regex, '')
|
|
283
|
+
.replace(/\s+/g, ' ') // replaces multiple spaces with a single space
|
|
284
|
+
.trim();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* extractCssPropertyFromClassName
|
|
289
|
+
* Extracts a CSS property from a tailwind class name.
|
|
290
|
+
*
|
|
291
|
+
* @param {*} className
|
|
292
|
+
* @param {*} cssProperty
|
|
293
|
+
* @returns {object} { value: string|null, className: string }
|
|
294
|
+
*/
|
|
295
|
+
export function extractCssPropertyFromClassName(className, cssProperty) {
|
|
296
|
+
if (!className || !cssProperty) {
|
|
297
|
+
return {
|
|
298
|
+
value: null,
|
|
299
|
+
className,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const value = getTailwindValue(className, cssProperty);
|
|
304
|
+
className = stripClassesByProperty(className, cssProperty);
|
|
305
|
+
return {
|
|
306
|
+
value,
|
|
307
|
+
className,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* extractCssPropertyFromStyle
|
|
313
|
+
* Extracts a CSS property from a style object.
|
|
314
|
+
*
|
|
315
|
+
* @param {string} cssProperty like 'background-color' or 'width'
|
|
316
|
+
* @param {object} style
|
|
317
|
+
* @returns
|
|
318
|
+
*/
|
|
319
|
+
export function extractCssPropertyFromStyle(style, cssProperty) {
|
|
320
|
+
if (!style || !cssProperty) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
cssProperty = Inflector.camelize(cssProperty, true); // true to lower-case the first letter
|
|
324
|
+
return style[cssProperty] || null;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* extractCssPropertyFromProps
|
|
329
|
+
* Extracts a CSS property from either style or className on props.
|
|
330
|
+
*
|
|
331
|
+
* @param {object} props
|
|
332
|
+
* @param {string} cssProperty like 'background-color' or 'width'
|
|
333
|
+
* @returns
|
|
334
|
+
*/
|
|
335
|
+
export function extractCssPropertyFromProps(props, cssProperty) {
|
|
336
|
+
if (!props || !cssProperty) {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
let value = extractCssPropertyFromStyle(props.style, cssProperty);
|
|
340
|
+
if (value === null) {
|
|
341
|
+
value = extractCssPropertyFromClassName(props.className, cssProperty).value;
|
|
342
|
+
}
|
|
343
|
+
return value;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function extractHeight(props) {
|
|
347
|
+
return extractCssPropertyFromProps(props, 'height');
|
|
348
|
+
}
|
|
349
|
+
export function hasHeight(props) {
|
|
350
|
+
if (props.h && props.h !== 0) {
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
const value = extractCssPropertyFromProps(props, 'height');
|
|
354
|
+
if (!value && value !== 0) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
export function extractWidth(props) {
|
|
360
|
+
return extractCssPropertyFromProps(props, 'width');
|
|
361
|
+
}
|
|
362
|
+
export function hasWidth(props) {
|
|
363
|
+
if (props.h && props.h !== 0) {
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
const value = extractCssPropertyFromProps(props, 'width');
|
|
367
|
+
if (!value && value !== 0) {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
export function extractFlex(props) {
|
|
373
|
+
return extractCssPropertyFromProps(props, 'flex');
|
|
374
|
+
}
|
|
375
|
+
export function hasFlex(props) {
|
|
376
|
+
if (props.flex) {
|
|
377
|
+
return true;
|
|
378
|
+
}
|
|
379
|
+
const value = extractCssPropertyFromProps(props, 'flex');
|
|
380
|
+
if (!value && value !== 0) {
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/Functions/waitFor.js
CHANGED
|
@@ -9,8 +9,8 @@ export default async function waitFor(fn, pollingFrequencyMs = 1000, timeoutMs =
|
|
|
9
9
|
timeElapsed += pollingFrequencyMs;
|
|
10
10
|
return timeElapsed > timeoutMs;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
while(!fn() && !isTimedOut()) {
|
|
13
13
|
await sleep(pollingFrequencyMs);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
return fn();
|
|
16
16
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useState, useEffect, useRef, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
|
-
|
|
5
|
-
Column,
|
|
4
|
+
HStack,
|
|
6
5
|
Pressable,
|
|
7
|
-
Row,
|
|
8
6
|
Spinner,
|
|
9
7
|
Text,
|
|
10
|
-
|
|
8
|
+
VStack,
|
|
9
|
+
} from '../../Components/Gluestack';
|
|
10
|
+
import Button from '../../Components/Buttons/Button';
|
|
11
11
|
import {
|
|
12
12
|
CURRENT_MODE,
|
|
13
13
|
UI_MODE_WEB,
|
|
14
|
-
|
|
14
|
+
UI_MODE_NATIVE,
|
|
15
15
|
} from '../../Constants/UiModes.js';
|
|
16
16
|
import UiGlobals from '../../UiGlobals.js';
|
|
17
17
|
import {
|
|
@@ -45,24 +45,19 @@ function FileCardCustom(props) {
|
|
|
45
45
|
uploadStatus,
|
|
46
46
|
} = props,
|
|
47
47
|
isDownloading = uploadStatus && inArray(uploadStatus, ['preparing', 'uploading', 'success']);
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
>
|
|
60
|
-
{isDownloading && <Spinner mr={2} />}
|
|
61
|
-
<Text>{filename}</Text>
|
|
62
|
-
{onDelete && <IconButton ml={1} icon={Xmark} onPress={() => onDelete(id)} />}
|
|
63
|
-
</Pressable>;
|
|
48
|
+
return (
|
|
49
|
+
<Pressable
|
|
50
|
+
onPress={() => {
|
|
51
|
+
downloadInBackground(downloadUrl);
|
|
52
|
+
}}
|
|
53
|
+
className="px-3 py-1 items-center flex-row rounded-[5px] border border-primary.700">
|
|
54
|
+
{isDownloading && <Spinner className="mr-2" />}
|
|
55
|
+
<Text>{filename}</Text>
|
|
56
|
+
{onDelete && <IconButton ml={1} icon={Xmark} onPress={() => onDelete(id)} />}
|
|
57
|
+
</Pressable>
|
|
58
|
+
);
|
|
64
59
|
}
|
|
65
|
-
|
|
60
|
+
|
|
66
61
|
|
|
67
62
|
// Note this component uploads only one file per server request---
|
|
68
63
|
// it doesn't upload multiple files simultaneously.
|
|
@@ -286,16 +281,12 @@ function AttachmentsElement(props) {
|
|
|
286
281
|
if (canCrud) {
|
|
287
282
|
_fileMosaic.onDelete = onFileDelete;
|
|
288
283
|
}
|
|
289
|
-
let content = <
|
|
290
|
-
|
|
291
|
-
p={2}
|
|
292
|
-
background={styles.ATTACHMENTS_BG}
|
|
293
|
-
>
|
|
294
|
-
<Row flexWrap="wrap">
|
|
284
|
+
let content = <VStack background={styles.ATTACHMENTS_BG} className="w-[100%] p-1">
|
|
285
|
+
<HStack className="flex-wrap">
|
|
295
286
|
{files.map((file) => {
|
|
296
287
|
return <Box
|
|
297
288
|
key={file.id}
|
|
298
|
-
|
|
289
|
+
className="mr-2"
|
|
299
290
|
>
|
|
300
291
|
{useFileMosaic &&
|
|
301
292
|
<FileMosaic
|
|
@@ -312,20 +303,23 @@ function AttachmentsElement(props) {
|
|
|
312
303
|
/>}
|
|
313
304
|
</Box>;
|
|
314
305
|
})}
|
|
315
|
-
</
|
|
306
|
+
</HStack>
|
|
316
307
|
{Repository.total <= collapsedMax ? null :
|
|
317
308
|
<Button
|
|
318
309
|
onPress={toggleShowAll}
|
|
319
|
-
mt
|
|
310
|
+
className="mt-2"
|
|
311
|
+
text={'Show ' + (showAll ? ' Less' : ' All ' + Repository.total)}
|
|
320
312
|
_text={{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
313
|
+
className: `
|
|
314
|
+
text-grey-600
|
|
315
|
+
italic
|
|
316
|
+
text-left
|
|
317
|
+
w-full
|
|
318
|
+
`,
|
|
325
319
|
}}
|
|
326
|
-
variant="
|
|
327
|
-
|
|
328
|
-
</
|
|
320
|
+
variant="outline"
|
|
321
|
+
/>}
|
|
322
|
+
</VStack>;
|
|
329
323
|
|
|
330
324
|
if (canCrud) {
|
|
331
325
|
content = <Dropzone
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { useEffect, } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
Column,
|
|
5
|
-
Row,
|
|
3
|
+
HStack,
|
|
6
4
|
Text,
|
|
7
|
-
} from '
|
|
5
|
+
} from '../../Components/Gluestack';
|
|
8
6
|
import {
|
|
9
7
|
CURRENT_MODE,
|
|
10
8
|
UI_MODE_WEB,
|
|
11
|
-
|
|
9
|
+
UI_MODE_NATIVE,
|
|
12
10
|
} from '../../Constants/UiModes.js';
|
|
13
11
|
import UiGlobals from '../../UiGlobals.js';
|
|
14
12
|
// import {
|
|
@@ -17,7 +15,9 @@ import UiGlobals from '../../UiGlobals.js';
|
|
|
17
15
|
// FileSizeValidator,
|
|
18
16
|
// ImageDimensionsValidator,
|
|
19
17
|
// } from 'use-file-picker/validators';
|
|
20
|
-
import { useFilePicker
|
|
18
|
+
import { useFilePicker } from 'use-file-picker/dist'; // https://github.com/Jaaneek/useFilePicker/issues/81#issuecomment-1774044241
|
|
19
|
+
// import { useFilePicker } from 'use-file-picker'; // https://www.npmjs.com/package/use-file-picker
|
|
20
|
+
import Button from '../../Components/Buttons/Button.js';
|
|
21
21
|
import IconButton from '../../Components/Buttons/IconButton.js';
|
|
22
22
|
import Xmark from '../../Components/Icons/Xmark.js'
|
|
23
23
|
import withAlert from '../../Components/Hoc/withAlert.js';
|
|
@@ -99,32 +99,39 @@ function FileComponent(props) {
|
|
|
99
99
|
|
|
100
100
|
let assembledComponents = null;
|
|
101
101
|
if (_.isEmpty(filesContent)) {
|
|
102
|
-
assembledComponents =
|
|
102
|
+
assembledComponents =
|
|
103
|
+
<Button
|
|
104
|
+
onPress={() => openFilePicker()}
|
|
105
|
+
text="Select File"
|
|
106
|
+
/>;
|
|
103
107
|
} else {
|
|
104
|
-
assembledComponents =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
108
|
+
assembledComponents =
|
|
109
|
+
<HStack
|
|
110
|
+
className={`
|
|
111
|
+
px-3
|
|
112
|
+
py-1
|
|
113
|
+
items-center
|
|
114
|
+
rounded-[5px]
|
|
115
|
+
border
|
|
116
|
+
border-primary.700
|
|
117
|
+
`}
|
|
118
|
+
>
|
|
119
|
+
<IconButton
|
|
120
|
+
icon={Xmark}
|
|
121
|
+
_icon={{
|
|
122
|
+
size: 'sm',
|
|
123
|
+
className: 'text-grey-600',
|
|
124
|
+
}}
|
|
125
|
+
onPress={() => clear()}
|
|
126
|
+
className={`
|
|
127
|
+
h-full
|
|
128
|
+
mr-1
|
|
129
|
+
${styles.FORM_COMBO_TRIGGER_BG}
|
|
130
|
+
${styles.FORM_COMBO_TRIGGER_BG_HOVER}
|
|
131
|
+
`}
|
|
132
|
+
/>
|
|
133
|
+
<Text>{plainFiles[0].name}</Text>
|
|
134
|
+
</HStack>;
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
return assembledComponents;
|
package/src/UiGlobals.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CURRENT_MODE } from './Constants/UiModes.js';
|
|
2
|
+
import Styles from './Constants/Styles.js';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
|
|
4
5
|
|
|
@@ -10,8 +11,14 @@ const Globals = {
|
|
|
10
11
|
paginationIsShowMoreOnly: false,
|
|
11
12
|
autoAdjustPageSizeToHeight: true,
|
|
12
13
|
doubleClickingGridRowOpensEditorInViewMode: false,
|
|
13
|
-
disableSavedColumnsConfig:
|
|
14
|
+
disableSavedColumnsConfig: true,
|
|
14
15
|
autoSubmitDelay: 500,
|
|
16
|
+
// stayInEditModeOnSelectionChange: true,
|
|
17
|
+
// isSideEditorAlwaysEditMode: true,
|
|
18
|
+
|
|
19
|
+
styles: {
|
|
20
|
+
...Styles,
|
|
21
|
+
},
|
|
15
22
|
};
|
|
16
23
|
|
|
17
24
|
export default Globals;
|