@geotab/zenith 1.22.0 → 1.22.1-beta.ssr.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/README.md +4 -0
- package/dist/absolute/absolute.js +11 -6
- package/dist/accordion/accordion.js +5 -0
- package/dist/banner/banner.js +5 -0
- package/dist/betaPill/betaPill.js +6 -1
- package/dist/calendar/calendar.js +6 -4
- package/dist/chart/barChart/getDefaultDatasetStyle.d.ts +1 -1
- package/dist/chart/barChart.js +2 -3
- package/dist/chart/lineChart/getDefaultDatasetStyle.d.ts +1 -1
- package/dist/chart/lineChart/useChartTicks.js +2 -2
- package/dist/chart/lineChart.js +2 -3
- package/dist/chart/pieChart.js +2 -3
- package/dist/chart/plugins/legend/legendPlugin.js +3 -1
- package/dist/chart/plugins/tooltip/renderTooltip.js +20 -8
- package/dist/chart/plugins/tooltip/tooltipPlugin.js +3 -1
- package/dist/combobox/comboboxNavigation.js +5 -2
- package/dist/commonHelpers/arrowNavigation/hooks/useHoldOnScroll.js +1 -1
- package/dist/commonHelpers/arrowNavigation/hooks/useScrollWhileHolding.js +1 -1
- package/dist/commonHelpers/hooks/useClientReady.d.ts +1 -0
- package/dist/commonHelpers/hooks/useClientReady.js +15 -0
- package/dist/commonHelpers/hooks/useDeviceType.d.ts +1 -1
- package/dist/commonHelpers/hooks/useDeviceType.js +3 -2
- package/dist/commonHelpers/hooks/useKeydown.js +5 -2
- package/dist/commonHelpers/hooks/useMobile.js +1 -1
- package/dist/commonHelpers/hooks/usePortal.d.ts +2 -0
- package/dist/commonHelpers/hooks/usePortal.js +18 -0
- package/dist/commonHelpers/hooks/useResize.js +6 -4
- package/dist/commonHelpers/hooks/useResizeObserver.js +8 -4
- package/dist/commonHelpers/hooks/useScroll.js +4 -1
- package/dist/commonHelpers/hooks/useTrapFocus.js +13 -8
- package/dist/commonHelpers/isDomEnv.d.ts +1 -0
- package/dist/commonHelpers/isDomEnv.js +11 -0
- package/dist/commonHelpers/utils.js +2 -2
- package/dist/dataGrid/withFlexibleColumns/flexibleColumnsReorder.js +16 -11
- package/dist/dataGrid/withFlexibleColumns/flexibleColumnsResizer.js +10 -8
- package/dist/dateInput/dateInput.js +1 -2
- package/dist/dialog/dialog.js +23 -8
- package/dist/dialog/dialogHelpers.js +4 -2
- package/dist/dropdown/dropdown.js +47 -15
- package/dist/dropdownOld/dropdownOld.js +1 -1
- package/dist/feedbackContainer/feedbackContainer.js +9 -3
- package/dist/feedbackContainer/hooks/useFeedbackAlert.js +1 -1
- package/dist/feedbackContainer/hooks/useFeedbackToast.js +1 -1
- package/dist/feedbackProvider/utils/getDefaultProviderMode.js +2 -2
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.js +4 -5
- package/dist/filtersBar/components/filtersBarGroupButton/filtersBarGroupButton.js +2 -2
- package/dist/filtersBar/components/filtersBarGroupsFilter/filtersBarGroupsFilter.js +2 -2
- package/dist/filtersBar/components/filtersBarPeriodPicker/filtersBarPeriodPicker.js +2 -3
- package/dist/filtersBar/components/filtersBarRange/filtersBarRange.js +2 -2
- package/dist/filtersBar/components/filtersBarSearch/filtersBarSearch.js +3 -3
- package/dist/filtersBar/filtersBar.js +5 -0
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelCheckboxGroup/filtersBarSidePanelCheckboxGroup.js +1 -2
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRadioGroup/filtersBarSidePanelRadioGroup.js +2 -2
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +6 -3
- package/dist/filtersBar/filtersContainer/filtersContainer.js +7 -7
- package/dist/gridLayout/hooks/useTablet.js +1 -1
- package/dist/header/header.js +24 -7
- package/dist/header/headerHelpers.js +4 -2
- package/dist/icons/deprecated/iconActivity.js +1 -2
- package/dist/icons/deprecated/iconArchive.js +1 -2
- package/dist/icons/deprecated/iconArrowBottom.js +1 -2
- package/dist/icons/deprecated/iconArrowDown.js +1 -2
- package/dist/icons/deprecated/iconArrowTop.js +1 -2
- package/dist/icons/deprecated/iconAssetInactive.js +1 -2
- package/dist/icons/deprecated/iconBackArrow.js +1 -2
- package/dist/icons/deprecated/iconBookmark.js +1 -2
- package/dist/icons/deprecated/iconBookmarkFill.js +1 -2
- package/dist/icons/deprecated/iconCalendar.js +1 -2
- package/dist/icons/deprecated/iconCheckmark.js +1 -2
- package/dist/icons/deprecated/iconChevronDownSmall.js +1 -2
- package/dist/icons/deprecated/iconChevronLeftSmall.js +1 -2
- package/dist/icons/deprecated/iconChevronRightSmall.js +1 -2
- package/dist/icons/deprecated/iconCircleOk.js +1 -2
- package/dist/icons/deprecated/iconCogSettings.js +1 -2
- package/dist/icons/deprecated/iconConditions.js +1 -2
- package/dist/icons/deprecated/iconCrossThin.js +1 -2
- package/dist/icons/deprecated/iconDelete.js +1 -2
- package/dist/icons/deprecated/iconDownload.js +1 -2
- package/dist/icons/deprecated/iconDragAndDrop.js +1 -2
- package/dist/icons/deprecated/iconEdit.js +1 -2
- package/dist/icons/deprecated/iconError.js +1 -2
- package/dist/icons/deprecated/iconErrorNew.js +1 -2
- package/dist/icons/deprecated/iconExclude.js +1 -2
- package/dist/icons/deprecated/iconFilterOutline.js +1 -2
- package/dist/icons/deprecated/iconFlatFilledArrowDown.js +1 -2
- package/dist/icons/deprecated/iconFolderNew.js +1 -2
- package/dist/icons/deprecated/iconFullscreen.js +1 -2
- package/dist/icons/deprecated/iconGlobe.js +1 -2
- package/dist/icons/deprecated/iconHouse.js +1 -2
- package/dist/icons/deprecated/iconInfoCircleTooltip.js +1 -2
- package/dist/icons/deprecated/iconInfoCircled.js +1 -2
- package/dist/icons/deprecated/iconLeftBracketLg.js +1 -2
- package/dist/icons/deprecated/iconLocation.js +1 -2
- package/dist/icons/deprecated/iconLocationPin.js +1 -2
- package/dist/icons/deprecated/iconLoupe.js +1 -2
- package/dist/icons/deprecated/iconLvlUp.js +1 -2
- package/dist/icons/deprecated/iconMap.js +1 -2
- package/dist/icons/deprecated/iconMinusIcon.js +1 -2
- package/dist/icons/deprecated/iconNarrowArrowRight.js +1 -2
- package/dist/icons/deprecated/iconNotificationBell.js +1 -2
- package/dist/icons/deprecated/iconOptionsIcon.js +1 -2
- package/dist/icons/deprecated/iconOrgFilter.js +1 -2
- package/dist/icons/deprecated/iconPlus.js +1 -2
- package/dist/icons/deprecated/iconRefresh.js +1 -2
- package/dist/icons/deprecated/iconReportError.js +1 -2
- package/dist/icons/deprecated/iconRightArrow.js +1 -2
- package/dist/icons/deprecated/iconSelectArrow.js +1 -2
- package/dist/icons/deprecated/iconSettings6SliderThree.js +1 -2
- package/dist/icons/deprecated/iconShrink.js +1 -2
- package/dist/icons/deprecated/iconSortAsc.js +1 -2
- package/dist/icons/deprecated/iconSortDec.js +1 -2
- package/dist/icons/deprecated/iconSpinner.js +1 -2
- package/dist/icons/deprecated/iconStatusNoComm.js +1 -2
- package/dist/icons/deprecated/iconSuccessNew.js +1 -2
- package/dist/icons/deprecated/iconTick.js +1 -2
- package/dist/icons/deprecated/iconVerticalEllipsis.js +1 -2
- package/dist/icons/deprecated/iconWarningNew.js +1 -2
- package/dist/icons/iconActivity.js +1 -2
- package/dist/icons/iconAddPeople.js +1 -2
- package/dist/icons/iconAddPeople2.js +1 -2
- package/dist/icons/iconAiImages.js +1 -2
- package/dist/icons/iconAiSparkles.js +1 -2
- package/dist/icons/iconAiSparkles2.js +1 -2
- package/dist/icons/iconAirplay.js +1 -2
- package/dist/icons/iconAirpods.js +1 -2
- package/dist/icons/iconAlignBottom.js +1 -2
- package/dist/icons/iconAlignLeft.js +1 -2
- package/dist/icons/iconAlignRightBox.js +1 -2
- package/dist/icons/iconAlignTopBox.js +1 -2
- package/dist/icons/iconAlignmentCenter.js +1 -2
- package/dist/icons/iconAlignmentJustify.js +1 -2
- package/dist/icons/iconAlignmentLeft.js +1 -2
- package/dist/icons/iconAlignmentRight.js +1 -2
- package/dist/icons/iconAnchor.js +1 -2
- package/dist/icons/iconAnchor2.js +1 -2
- package/dist/icons/iconArchive.js +1 -2
- package/dist/icons/iconArchive2.js +1 -2
- package/dist/icons/iconArrowBottom.js +1 -2
- package/dist/icons/iconArrowBottomCircle.js +1 -2
- package/dist/icons/iconArrowBottomLeft.js +1 -2
- package/dist/icons/iconArrowBottomRight.js +1 -2
- package/dist/icons/iconArrowDownPath.js +1 -2
- package/dist/icons/iconArrowLeft.js +1 -2
- package/dist/icons/iconArrowLeftCircle.js +1 -2
- package/dist/icons/iconArrowLeftPath.js +1 -2
- package/dist/icons/iconArrowRight.js +1 -2
- package/dist/icons/iconArrowRightCircle.js +1 -2
- package/dist/icons/iconArrowRightPath.js +1 -2
- package/dist/icons/iconArrowTop.js +1 -2
- package/dist/icons/iconArrowTopCircle.js +1 -2
- package/dist/icons/iconArrowTopLeft.js +1 -2
- package/dist/icons/iconArrowTopRight.js +1 -2
- package/dist/icons/iconArrowUpPath.js +1 -2
- package/dist/icons/iconAt.js +1 -2
- package/dist/icons/iconAttachment.js +1 -2
- package/dist/icons/iconAttachment2.js +1 -2
- package/dist/icons/iconAttachmentFile.js +1 -2
- package/dist/icons/iconAudio.js +1 -2
- package/dist/icons/iconAutoSize.js +1 -2
- package/dist/icons/iconBackward.js +1 -2
- package/dist/icons/iconBadge.js +1 -2
- package/dist/icons/iconBag.js +1 -2
- package/dist/icons/iconBag2.js +1 -2
- package/dist/icons/iconBagLuggage.js +1 -2
- package/dist/icons/iconBagLuggage2.js +1 -2
- package/dist/icons/iconBasket.js +1 -2
- package/dist/icons/iconBasket2.js +1 -2
- package/dist/icons/iconBatteryError.js +1 -2
- package/dist/icons/iconBatteryFull.js +1 -2
- package/dist/icons/iconBatteryLoading.js +1 -2
- package/dist/icons/iconBatteryLow.js +1 -2
- package/dist/icons/iconBatteryLow2.js +1 -2
- package/dist/icons/iconBatteryMedium.js +1 -2
- package/dist/icons/iconBell.js +1 -2
- package/dist/icons/iconBeta.js +1 -2
- package/dist/icons/iconBitcoin.js +1 -2
- package/dist/icons/iconBluetooth.js +1 -2
- package/dist/icons/iconBold.js +1 -2
- package/dist/icons/iconBook.js +1 -2
- package/dist/icons/iconBook2.js +1 -2
- package/dist/icons/iconBookmark.js +1 -2
- package/dist/icons/iconBookmarkCheck.js +1 -2
- package/dist/icons/iconBookmarkDelete.js +1 -2
- package/dist/icons/iconBookmarkFill.js +1 -2
- package/dist/icons/iconBookmarkPlus.js +1 -2
- package/dist/icons/iconBookmarkSelectedHover.js +1 -2
- package/dist/icons/iconBranches.js +1 -2
- package/dist/icons/iconBrokenLink.js +1 -2
- package/dist/icons/iconBrowser.js +1 -2
- package/dist/icons/iconBrush.js +1 -2
- package/dist/icons/iconBubble.js +1 -2
- package/dist/icons/iconBubble2.js +1 -2
- package/dist/icons/iconBubble3.js +1 -2
- package/dist/icons/iconBubble4.js +1 -2
- package/dist/icons/iconBubble5.js +1 -2
- package/dist/icons/iconBubble6.js +1 -2
- package/dist/icons/iconBubbleAnnotation.js +1 -2
- package/dist/icons/iconBubbleAnnotation2.js +1 -2
- package/dist/icons/iconBubbleAnnotation4.js +1 -2
- package/dist/icons/iconBubbleAnnotation5.js +1 -2
- package/dist/icons/iconBubbleAnnotation6.js +1 -2
- package/dist/icons/iconBubbleNotification.js +1 -2
- package/dist/icons/iconBubbles.js +1 -2
- package/dist/icons/iconBucket.js +1 -2
- package/dist/icons/iconBuilding.js +1 -2
- package/dist/icons/iconBulkSelect.js +1 -2
- package/dist/icons/iconBulletList.js +1 -2
- package/dist/icons/iconBusiness.js +1 -2
- package/dist/icons/iconCalculator.js +1 -2
- package/dist/icons/iconCalendar.js +1 -2
- package/dist/icons/iconCalendar2.js +1 -2
- package/dist/icons/iconCamera.js +1 -2
- package/dist/icons/iconCamera2.js +1 -2
- package/dist/icons/iconCamera3.js +1 -2
- package/dist/icons/iconCameraAction.js +1 -2
- package/dist/icons/iconCanBus.js +1 -2
- package/dist/icons/iconChart.js +1 -2
- package/dist/icons/iconChart2.js +1 -2
- package/dist/icons/iconChart3.js +1 -2
- package/dist/icons/iconChart4.js +1 -2
- package/dist/icons/iconChart5.js +1 -2
- package/dist/icons/iconChart6.js +1 -2
- package/dist/icons/iconChart7.js +1 -2
- package/dist/icons/iconChart8.js +1 -2
- package/dist/icons/iconCheck.js +1 -2
- package/dist/icons/iconCheckRadio.js +1 -2
- package/dist/icons/iconCheckbox.js +1 -2
- package/dist/icons/iconChevronBottom.js +1 -2
- package/dist/icons/iconChevronDoubleDown.js +1 -2
- package/dist/icons/iconChevronDoubleLeft.js +1 -2
- package/dist/icons/iconChevronDoubleRight.js +1 -2
- package/dist/icons/iconChevronDoubleUp.js +1 -2
- package/dist/icons/iconChevronDownSmall.js +1 -2
- package/dist/icons/iconChevronGrabberHorizontal.js +1 -2
- package/dist/icons/iconChevronGrabberVertical.js +1 -2
- package/dist/icons/iconChevronLeft.js +1 -2
- package/dist/icons/iconChevronLeftSmall.js +1 -2
- package/dist/icons/iconChevronRight.js +1 -2
- package/dist/icons/iconChevronRightSmall.js +1 -2
- package/dist/icons/iconChevronTop.js +1 -2
- package/dist/icons/iconChevronTopSmall.js +1 -2
- package/dist/icons/iconChromecast.js +1 -2
- package/dist/icons/iconCircle.js +1 -2
- package/dist/icons/iconClipboard.js +1 -2
- package/dist/icons/iconClipboard2.js +1 -2
- package/dist/icons/iconClock.js +1 -2
- package/dist/icons/iconClock2.js +1 -2
- package/dist/icons/iconClockSnooze.js +1 -2
- package/dist/icons/iconClockTimer.js +1 -2
- package/dist/icons/iconClose.js +1 -2
- package/dist/icons/iconCloseCircle.js +1 -2
- package/dist/icons/iconCloseSquare.js +1 -2
- package/dist/icons/iconCloud.js +1 -2
- package/dist/icons/iconCloud2.js +1 -2
- package/dist/icons/iconCloudCheck.js +1 -2
- package/dist/icons/iconCloudDownload.js +1 -2
- package/dist/icons/iconCloudLines.js +1 -2
- package/dist/icons/iconCloudOff.js +1 -2
- package/dist/icons/iconCloudOff2.js +1 -2
- package/dist/icons/iconCloudQuestion.js +1 -2
- package/dist/icons/iconCloudSync.js +1 -2
- package/dist/icons/iconCloudUpload.js +1 -2
- package/dist/icons/iconCmd.js +1 -2
- package/dist/icons/iconCmd2.js +1 -2
- package/dist/icons/iconCode.js +1 -2
- package/dist/icons/iconCode2.js +1 -2
- package/dist/icons/iconColor.js +1 -2
- package/dist/icons/iconColorPicker.js +1 -2
- package/dist/icons/iconCommunity.js +1 -2
- package/dist/icons/iconCompass.js +1 -2
- package/dist/icons/iconConnectDevices.js +1 -2
- package/dist/icons/iconConsole.js +1 -2
- package/dist/icons/iconConstruction.js +1 -2
- package/dist/icons/iconCopy.js +1 -2
- package/dist/icons/iconCopy2.js +1 -2
- package/dist/icons/iconCopy3.js +1 -2
- package/dist/icons/iconCopy4.js +1 -2
- package/dist/icons/iconCopy5.js +1 -2
- package/dist/icons/iconCornerDownLeft.js +1 -2
- package/dist/icons/iconCornerDownRight.js +1 -2
- package/dist/icons/iconCornerLeftDown.js +1 -2
- package/dist/icons/iconCornerLeftUp.js +1 -2
- package/dist/icons/iconCornerRightDown.js +1 -2
- package/dist/icons/iconCornerRightUp.js +1 -2
- package/dist/icons/iconCornerUpLeft.js +1 -2
- package/dist/icons/iconCornerUpRight.js +1 -2
- package/dist/icons/iconCornerUpRight2.js +1 -2
- package/dist/icons/iconCreditCard.js +1 -2
- package/dist/icons/iconCreditCard2.js +1 -2
- package/dist/icons/iconCreditCard3.js +1 -2
- package/dist/icons/iconCrop.js +1 -2
- package/dist/icons/iconCrypto.js +1 -2
- package/dist/icons/iconCryptoCoin.js +1 -2
- package/dist/icons/iconCup.js +1 -2
- package/dist/icons/iconCursor.js +1 -2
- package/dist/icons/iconCursor2.js +1 -2
- package/dist/icons/iconCursor3.js +1 -2
- package/dist/icons/iconCursorBox.js +1 -2
- package/dist/icons/iconCursorClick.js +1 -2
- package/dist/icons/iconCycle.js +1 -2
- package/dist/icons/iconDelete.js +1 -2
- package/dist/icons/iconDelete2.js +1 -2
- package/dist/icons/iconDelete3.js +1 -2
- package/dist/icons/iconDeviceUptime.js +1 -2
- package/dist/icons/iconDeviceUptimeDisconnected.js +1 -2
- package/dist/icons/iconDiamondWarning.js +1 -2
- package/dist/icons/iconDisk.js +1 -2
- package/dist/icons/iconDisk2.js +1 -2
- package/dist/icons/iconDispatchAsset.js +1 -2
- package/dist/icons/iconDock.js +1 -2
- package/dist/icons/iconDocument.js +1 -2
- package/dist/icons/iconDocumentWithLines.js +1 -2
- package/dist/icons/iconDollar.js +1 -2
- package/dist/icons/iconDotGrid.js +1 -2
- package/dist/icons/iconDotHorizontal.js +1 -2
- package/dist/icons/iconDotVertical.js +1 -2
- package/dist/icons/iconDownload.js +1 -2
- package/dist/icons/iconDrive.js +1 -2
- package/dist/icons/iconDriver.js +1 -2
- package/dist/icons/iconDvir.js +1 -2
- package/dist/icons/iconEdit.js +1 -2
- package/dist/icons/iconEdit2.js +1 -2
- package/dist/icons/iconEditBig.js +1 -2
- package/dist/icons/iconEditSmall.js +1 -2
- package/dist/icons/iconEmail.js +1 -2
- package/dist/icons/iconEmail2.js +1 -2
- package/dist/icons/iconEmailNotification.js +1 -2
- package/dist/icons/iconEsc.js +1 -2
- package/dist/icons/iconEthereum.js +1 -2
- package/dist/icons/iconEuro.js +1 -2
- package/dist/icons/iconEvse.js +1 -2
- package/dist/icons/iconExcel.js +1 -2
- package/dist/icons/iconException.js +1 -2
- package/dist/icons/iconExpand.js +1 -2
- package/dist/icons/iconEye.js +1 -2
- package/dist/icons/iconEyeOff.js +1 -2
- package/dist/icons/iconFaceId.js +1 -2
- package/dist/icons/iconFile.js +1 -2
- package/dist/icons/iconFileCopy.js +1 -2
- package/dist/icons/iconFileLocked.js +1 -2
- package/dist/icons/iconFileSync.js +1 -2
- package/dist/icons/iconFileSync2.js +1 -2
- package/dist/icons/iconFileSync3.js +1 -2
- package/dist/icons/iconFileSync4.js +1 -2
- package/dist/icons/iconFileSync5.js +1 -2
- package/dist/icons/iconFilter.js +1 -2
- package/dist/icons/iconFilter2.js +1 -2
- package/dist/icons/iconFilter3.js +1 -2
- package/dist/icons/iconFilter3Asc.js +1 -2
- package/dist/icons/iconFilter3Desc.js +1 -2
- package/dist/icons/iconFilterAsc.js +1 -2
- package/dist/icons/iconFilterDesc.js +1 -2
- package/dist/icons/iconFingerPrint.js +1 -2
- package/dist/icons/iconFocus.js +1 -2
- package/dist/icons/iconFolder.js +1 -2
- package/dist/icons/iconFolder2.js +1 -2
- package/dist/icons/iconFolderAdd.js +1 -2
- package/dist/icons/iconFolderBookmarks.js +1 -2
- package/dist/icons/iconFolderCloud.js +1 -2
- package/dist/icons/iconFolderCloud2.js +1 -2
- package/dist/icons/iconFolderDelete.js +1 -2
- package/dist/icons/iconFolderDownload.js +1 -2
- package/dist/icons/iconFolderRestricted.js +1 -2
- package/dist/icons/iconFolderShared.js +1 -2
- package/dist/icons/iconFolderUpload.js +1 -2
- package/dist/icons/iconFolders.js +1 -2
- package/dist/icons/iconFork.js +1 -2
- package/dist/icons/iconFuelGas.js +1 -2
- package/dist/icons/iconGamepad.js +1 -2
- package/dist/icons/iconGeotabDrive.js +1 -2
- package/dist/icons/iconGeotabSales.js +1 -2
- package/dist/icons/iconGift.js +1 -2
- package/dist/icons/iconGlobus.js +1 -2
- package/dist/icons/iconGrab.js +1 -2
- package/dist/icons/iconGraph.js +1 -2
- package/dist/icons/iconGraphChart.js +1 -2
- package/dist/icons/iconGraphLines.js +1 -2
- package/dist/icons/iconGraphPresentation.js +1 -2
- package/dist/icons/iconGraphStatistics.js +1 -2
- package/dist/icons/iconGrids.js +1 -2
- package/dist/icons/iconGrids2.js +1 -2
- package/dist/icons/iconHarness.js +1 -2
- package/dist/icons/iconHeadphones.js +1 -2
- package/dist/icons/iconHeart.js +1 -2
- package/dist/icons/iconHexonalWarning.js +1 -2
- package/dist/icons/iconHistory.js +1 -2
- package/dist/icons/iconHomeDoor.js +1 -2
- package/dist/icons/iconHomeDoor2.js +1 -2
- package/dist/icons/iconHomeRoof.js +1 -2
- package/dist/icons/iconHomeSimple.js +1 -2
- package/dist/icons/iconHourglass.js +1 -2
- package/dist/icons/iconITS.js +1 -2
- package/dist/icons/iconIcon.js +1 -2
- package/dist/icons/iconImac.js +1 -2
- package/dist/icons/iconImac2.js +1 -2
- package/dist/icons/iconImage.js +1 -2
- package/dist/icons/iconImages.js +1 -2
- package/dist/icons/iconImages2.js +1 -2
- package/dist/icons/iconInbox.js +1 -2
- package/dist/icons/iconInbox2.js +1 -2
- package/dist/icons/iconInfoCircle.js +1 -2
- package/dist/icons/iconInfoSquare.js +1 -2
- package/dist/icons/iconInspect.js +1 -2
- package/dist/icons/iconItalic.js +1 -2
- package/dist/icons/iconKeyboard.js +1 -2
- package/dist/icons/iconKeyboardDown.js +1 -2
- package/dist/icons/iconKeyboardUp.js +1 -2
- package/dist/icons/iconKeyboardUp2.js +1 -2
- package/dist/icons/iconLab.js +1 -2
- package/dist/icons/iconLaptop.js +1 -2
- package/dist/icons/iconLayers.js +1 -2
- package/dist/icons/iconLayout.js +1 -2
- package/dist/icons/iconLayoutBottom.js +1 -2
- package/dist/icons/iconLayoutColumn.js +1 -2
- package/dist/icons/iconLayoutLeft.js +1 -2
- package/dist/icons/iconLayoutRight.js +1 -2
- package/dist/icons/iconLayoutSearch.js +1 -2
- package/dist/icons/iconLayoutSidebar.js +1 -2
- package/dist/icons/iconLayoutTop.js +1 -2
- package/dist/icons/iconLayoutTopbar.js +1 -2
- package/dist/icons/iconLayoutWindow.js +1 -2
- package/dist/icons/iconLayoutWindow2.js +1 -2
- package/dist/icons/iconLayoutWindow3.js +1 -2
- package/dist/icons/iconLayoutWindow4.js +1 -2
- package/dist/icons/iconLayoutWindow5.js +1 -2
- package/dist/icons/iconLeaf.js +1 -2
- package/dist/icons/iconLifeBuoy.js +1 -2
- package/dist/icons/iconLightBulb.js +1 -2
- package/dist/icons/iconLightning.js +1 -2
- package/dist/icons/iconLink.js +1 -2
- package/dist/icons/iconLink2.js +1 -2
- package/dist/icons/iconLink3.js +1 -2
- package/dist/icons/iconLinkLines.js +1 -2
- package/dist/icons/iconList.js +1 -2
- package/dist/icons/iconLoader.js +1 -2
- package/dist/icons/iconLocationCompass.js +1 -2
- package/dist/icons/iconLocationMap.js +1 -2
- package/dist/icons/iconLocationOff.js +1 -2
- package/dist/icons/iconLock.js +1 -2
- package/dist/icons/iconLogin.js +1 -2
- package/dist/icons/iconLogout.js +1 -2
- package/dist/icons/iconLowDataQuality.js +1 -2
- package/dist/icons/iconMacbook.js +1 -2
- package/dist/icons/iconMagic.js +1 -2
- package/dist/icons/iconMagic2.js +1 -2
- package/dist/icons/iconMagicEyes.js +1 -2
- package/dist/icons/iconMap.js +1 -2
- package/dist/icons/iconMarketplace.js +1 -2
- package/dist/icons/iconMedal.js +1 -2
- package/dist/icons/iconMemory.js +1 -2
- package/dist/icons/iconMemory2.js +1 -2
- package/dist/icons/iconMenu.js +1 -2
- package/dist/icons/iconMenu2.js +1 -2
- package/dist/icons/iconMenu3.js +1 -2
- package/dist/icons/iconMenuCircle.js +1 -2
- package/dist/icons/iconMenuCircle2.js +1 -2
- package/dist/icons/iconMicrophone.js +1 -2
- package/dist/icons/iconMicrophone2.js +1 -2
- package/dist/icons/iconMinimize.js +1 -2
- package/dist/icons/iconMinus.js +1 -2
- package/dist/icons/iconMinusCircle.js +1 -2
- package/dist/icons/iconMinusSquare.js +1 -2
- package/dist/icons/iconMobi.js +1 -2
- package/dist/icons/iconMoney.js +1 -2
- package/dist/icons/iconMoon.js +1 -2
- package/dist/icons/iconMouse.js +1 -2
- package/dist/icons/iconMouseScrollDown.js +1 -2
- package/dist/icons/iconMouseScrollUp.js +1 -2
- package/dist/icons/iconMove.js +1 -2
- package/dist/icons/iconMove2.js +1 -2
- package/dist/icons/iconMyAdmin.js +1 -2
- package/dist/icons/iconMyGeotab.js +1 -2
- package/dist/icons/iconNews.js +1 -2
- package/dist/icons/iconNewspaper.js +1 -2
- package/dist/icons/iconNote.js +1 -2
- package/dist/icons/iconNotificationAlarm.js +1 -2
- package/dist/icons/iconNotificationBell.js +1 -2
- package/dist/icons/iconNotificationOff.js +1 -2
- package/dist/icons/iconNotifications.js +1 -2
- package/dist/icons/iconNumberedList.js +1 -2
- package/dist/icons/iconOnDuty.js +1 -2
- package/dist/icons/iconOpen.js +1 -2
- package/dist/icons/iconOpen2.js +1 -2
- package/dist/icons/iconOpt.js +1 -2
- package/dist/icons/iconOptAlt.js +1 -2
- package/dist/icons/iconPDF.js +1 -2
- package/dist/icons/iconPackage.js +1 -2
- package/dist/icons/iconPackage2.js +1 -2
- package/dist/icons/iconPackage3.js +1 -2
- package/dist/icons/iconPaperPlane.js +1 -2
- package/dist/icons/iconPassword.js +1 -2
- package/dist/icons/iconPause.js +1 -2
- package/dist/icons/iconPencil.js +1 -2
- package/dist/icons/iconPencil2.js +1 -2
- package/dist/icons/iconPeople.js +1 -2
- package/dist/icons/iconPeopleGroup.js +1 -2
- package/dist/icons/iconPeopleGroup2.js +1 -2
- package/dist/icons/iconPeopleLike.js +1 -2
- package/dist/icons/iconPercent.js +1 -2
- package/dist/icons/iconPerformance.js +1 -2
- package/dist/icons/iconPhone.js +1 -2
- package/dist/icons/iconPhoneMobile.js +1 -2
- package/dist/icons/iconPin.js +1 -2
- package/dist/icons/iconPin2.js +1 -2
- package/dist/icons/iconPinLocation.js +1 -2
- package/dist/icons/iconPinLocation2.js +1 -2
- package/dist/icons/iconPinLocation3.js +1 -2
- package/dist/icons/iconPlay.js +1 -2
- package/dist/icons/iconPlus.js +1 -2
- package/dist/icons/iconPlusCircle.js +1 -2
- package/dist/icons/iconPlusFile.js +1 -2
- package/dist/icons/iconPlusLines.js +1 -2
- package/dist/icons/iconPlusSquare.js +1 -2
- package/dist/icons/iconPound.js +1 -2
- package/dist/icons/iconPrinter.js +1 -2
- package/dist/icons/iconProcessor.js +1 -2
- package/dist/icons/iconPullRequest.js +1 -2
- package/dist/icons/iconPuzzle.js +1 -2
- package/dist/icons/iconQuestion.js +1 -2
- package/dist/icons/iconRadar.js +1 -2
- package/dist/icons/iconReceipt.js +1 -2
- package/dist/icons/iconRecord.js +1 -2
- package/dist/icons/iconRedo.js +1 -2
- package/dist/icons/iconRedo2.js +1 -2
- package/dist/icons/iconRefrigeration.js +1 -2
- package/dist/icons/iconRemovePeople.js +1 -2
- package/dist/icons/iconRepeat.js +1 -2
- package/dist/icons/iconRepeat2.js +1 -2
- package/dist/icons/iconResizeBig.js +1 -2
- package/dist/icons/iconResizeSmall.js +1 -2
- package/dist/icons/iconRotateClockwise.js +1 -2
- package/dist/icons/iconRotateCounterclockwise.js +1 -2
- package/dist/icons/iconRotateRepeat.js +1 -2
- package/dist/icons/iconRotateRepeat2.js +1 -2
- package/dist/icons/iconRoute.js +1 -2
- package/dist/icons/iconRuler.js +1 -2
- package/dist/icons/iconSdCard.js +1 -2
- package/dist/icons/iconSearch.js +1 -2
- package/dist/icons/iconSearchDocument.js +1 -2
- package/dist/icons/iconSearchLines.js +1 -2
- package/dist/icons/iconSearchPage.js +1 -2
- package/dist/icons/iconSeatbelt.js +1 -2
- package/dist/icons/iconSecured.js +1 -2
- package/dist/icons/iconSecuredLines.js +1 -2
- package/dist/icons/iconSend.js +1 -2
- package/dist/icons/iconServer.js +1 -2
- package/dist/icons/iconServer2.js +1 -2
- package/dist/icons/iconServer3.js +1 -2
- package/dist/icons/iconSettings1.js +1 -2
- package/dist/icons/iconSettings2.js +1 -2
- package/dist/icons/iconSettings3.js +1 -2
- package/dist/icons/iconSettings4.js +1 -2
- package/dist/icons/iconSettings6.js +1 -2
- package/dist/icons/iconSettings7.js +1 -2
- package/dist/icons/iconSettings8.js +1 -2
- package/dist/icons/iconShare.js +1 -2
- package/dist/icons/iconShare2.js +1 -2
- package/dist/icons/iconShare3.js +1 -2
- package/dist/icons/iconShield.js +1 -2
- package/dist/icons/iconShield2.js +1 -2
- package/dist/icons/iconShield3.js +1 -2
- package/dist/icons/iconShield4.js +1 -2
- package/dist/icons/iconSidebar.js +1 -2
- package/dist/icons/iconSign.js +1 -2
- package/dist/icons/iconSmiley.js +1 -2
- package/dist/icons/iconSort2Horizontal.js +1 -2
- package/dist/icons/iconSort2Vertical.js +1 -2
- package/dist/icons/iconSortHorizontal.js +1 -2
- package/dist/icons/iconSortVertical.js +1 -2
- package/dist/icons/iconSpeaker.js +1 -2
- package/dist/icons/iconSquare.js +1 -2
- package/dist/icons/iconStar.js +1 -2
- package/dist/icons/iconStarAi.js +1 -2
- package/dist/icons/iconStarFilled.d.ts +4 -0
- package/dist/icons/iconStarFilled.js +17 -0
- package/dist/icons/iconStopwatch.js +1 -2
- package/dist/icons/iconStorage.js +1 -2
- package/dist/icons/iconStore.js +1 -2
- package/dist/icons/iconStrikeThrough.js +1 -2
- package/dist/icons/iconSun.js +1 -2
- package/dist/icons/iconSupport.js +1 -2
- package/dist/icons/iconTable.js +1 -2
- package/dist/icons/iconTachograph.js +1 -2
- package/dist/icons/iconTachographTimeCard.js +1 -2
- package/dist/icons/iconTarget.js +1 -2
- package/dist/icons/iconTarget2.js +1 -2
- package/dist/icons/iconTarget3.js +1 -2
- package/dist/icons/iconTelevision.js +1 -2
- package/dist/icons/iconTelevision2.js +1 -2
- package/dist/icons/iconTextSize.js +1 -2
- package/dist/icons/iconThermograph.js +1 -2
- package/dist/icons/iconThermometer.js +1 -2
- package/dist/icons/iconThumbsDown.js +1 -2
- package/dist/icons/iconThumbsUp.js +1 -2
- package/dist/icons/iconTrailer.js +1 -2
- package/dist/icons/iconUmbrella.js +1 -2
- package/dist/icons/iconUnderline.js +1 -2
- package/dist/icons/iconUndo.js +1 -2
- package/dist/icons/iconUndo2.js +1 -2
- package/dist/icons/iconUndock.js +1 -2
- package/dist/icons/iconUnlocked.js +1 -2
- package/dist/icons/iconUpload.js +1 -2
- package/dist/icons/iconUsb.js +1 -2
- package/dist/icons/iconUsbHub.js +1 -2
- package/dist/icons/iconVideo.js +1 -2
- package/dist/icons/iconVideo2.js +1 -2
- package/dist/icons/iconVideoReplay.js +1 -2
- package/dist/icons/iconVisitPage.js +1 -2
- package/dist/icons/iconVoice.js +1 -2
- package/dist/icons/iconVolumeDown.js +1 -2
- package/dist/icons/iconVolumeFull.js +1 -2
- package/dist/icons/iconVolumeHalf.js +1 -2
- package/dist/icons/iconVolumeMinimum.js +1 -2
- package/dist/icons/iconVolumeOf.js +1 -2
- package/dist/icons/iconVolumeOff.js +1 -2
- package/dist/icons/iconVolumeOn.js +1 -2
- package/dist/icons/iconWallet.js +1 -2
- package/dist/icons/iconWallet1.js +1 -2
- package/dist/icons/iconWarning.js +1 -2
- package/dist/icons/iconWatch.js +1 -2
- package/dist/icons/iconWatch2.js +1 -2
- package/dist/icons/iconWebcam.js +1 -2
- package/dist/icons/iconWhisper.js +1 -2
- package/dist/icons/iconWifi.js +1 -2
- package/dist/icons/iconWifi2.js +1 -2
- package/dist/icons/iconWorkday.js +1 -2
- package/dist/icons/iconWorld.js +1 -2
- package/dist/icons/iconWrench.js +1 -2
- package/dist/icons/iconWrite.js +1 -2
- package/dist/icons/iconYen.js +1 -2
- package/dist/icons/iconZone.js +1 -2
- package/dist/icons/iconZoom.js +1 -2
- package/dist/icons/iconZoom2.js +1 -2
- package/dist/images/imageNothingFound.js +1 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/layout/layout.js +22 -7
- package/dist/layout/layoutFullScreen.js +1 -2
- package/dist/lineChart/plugins/htmlLegend.js +9 -6
- package/dist/lineChart/utils.d.ts +1 -1
- package/dist/menu/controlledMenu.js +9 -1
- package/dist/mobileSheet/mobileSheet.js +15 -5
- package/dist/modal/modal.js +35 -17
- package/dist/pillAction/pillAction.js +2 -2
- package/dist/selectList/selectList.js +3 -1
- package/dist/selectRaw/select.helpers.js +3 -2
- package/dist/selectRaw/selectRaw.js +3 -1
- package/dist/sidePanel/sidePanel.js +35 -22
- package/dist/svgIcon/svgIcon.js +2 -2
- package/dist/table/flexible/useFlexibleColumns.js +2 -1
- package/dist/table/flexible/useSettingsStorage.js +3 -1
- package/dist/table/sortable/sortableStorage.js +10 -1
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +5 -0
- package/dist/tabs/tabs.js +11 -10
- package/dist/toolbar/helpers/getWidthWithMargin.js +1 -1
- package/dist/toolbar/helpers/getWidthWithoutPadding.js +1 -1
- package/dist/tooltip/tooltip.js +19 -7
- package/dist/utils/getParentWithHiddenOverflow.js +1 -1
- package/dist/utils/getRelativeParent.js +1 -1
- package/dist/utils/localization/getSupportedLanguage.d.ts +1 -1
- package/dist/utils/localization/getSupportedLanguage.js +1 -1
- package/dist/utils/localization/languageContext.d.ts +1 -1
- package/dist/utils/localization/translations/ko-KR-json.d.ts +228 -0
- package/dist/utils/localization/translations/ko-KR-json.js +231 -0
- package/dist/utils/localization/useLanguage.js +3 -1
- package/dist/utils/positioningUtils/adjustParentRect.js +2 -2
- package/dist/utils/positioningUtils/calculatePosition.js +11 -7
- package/dist/utils/positioningUtils/isChildPopup.js +3 -1
- package/dist/utils/topWindow/topWindowContext.d.ts +1 -1
- package/dist/utils/topWindow/topWindowProvider.d.ts +1 -1
- package/dist/utils/useBodyScroll.js +6 -2
- package/dist/waiting/waiting.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,12 +33,14 @@ const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, trigger
|
|
|
33
33
|
}, [role, ariaLabelledby, ariaLabel]);
|
|
34
34
|
const darkClassName = dark ? "zen-dark" : "";
|
|
35
35
|
const renderPopup = () => {
|
|
36
|
+
var _a, _b;
|
|
36
37
|
if (isOpen) {
|
|
37
38
|
const result = (0, jsx_runtime_1.jsx)("div", Object.assign({}, accessableAttr, { ref: popupRef, id: id, onScroll: shouldHoldScroll ? onScrollHandler : undefined, className: (0, classNames_1.classNames)(["zen-absolute", darkClassName, className || ""]), children: children }));
|
|
38
39
|
if (inline) {
|
|
39
40
|
return result;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
// eslint-disable-next-line
|
|
43
|
+
return (0, react_dom_1.createPortal)(result, ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.fullscreenElement) || ((_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.body));
|
|
42
44
|
}
|
|
43
45
|
return "";
|
|
44
46
|
};
|
|
@@ -69,7 +71,7 @@ const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, trigger
|
|
|
69
71
|
(0, useEscape_1.useEscape)(popupRef, handleEscape, isOpen);
|
|
70
72
|
(0, useArrowKey_1.useArrowKey)(popupRef, handleEscape, isOpen);
|
|
71
73
|
(0, react_1.useEffect)(() => {
|
|
72
|
-
var _a, _b;
|
|
74
|
+
var _a, _b, _c;
|
|
73
75
|
const closeOnClickOutside = (e) => {
|
|
74
76
|
if (!popupRef.current) {
|
|
75
77
|
return;
|
|
@@ -85,18 +87,21 @@ const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, trigger
|
|
|
85
87
|
onOpenChange(false);
|
|
86
88
|
};
|
|
87
89
|
if (isOpen) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
// eslint-disable-next-line
|
|
91
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.addEventListener("click", closeOnClickOutside, true);
|
|
92
|
+
const firstFocusable = (_b = popupRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(focusableSelector_1.FOCUSABLE_SELECTOR);
|
|
90
93
|
if (useTrapFocusWithTrigger !== "withTrigger") {
|
|
91
94
|
if (firstFocusable) {
|
|
92
95
|
firstFocusable.focus();
|
|
93
96
|
}
|
|
94
97
|
else {
|
|
95
|
-
(
|
|
98
|
+
(_c = popupRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
return () => {
|
|
99
|
-
|
|
102
|
+
var _a;
|
|
103
|
+
// eslint-disable-next-line
|
|
104
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.removeEventListener("click", closeOnClickOutside, true);
|
|
100
105
|
};
|
|
101
106
|
}
|
|
102
107
|
return () => { };
|
|
@@ -5,8 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const accordionItem_1 = require("./accordionItem/accordionItem");
|
|
7
7
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
8
|
+
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
8
9
|
const Accordion = ({ data = [], className = "", activeIds = [], onItemClick }) => {
|
|
9
10
|
const fullClassName = (0, classNames_1.classNames)(["zen-accordion", className]);
|
|
11
|
+
const isClientReady = (0, useClientReady_1.useClientReady)();
|
|
12
|
+
if (!isClientReady) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
10
15
|
return (0, jsx_runtime_1.jsx)("div", { className: fullClassName, children: data.map((item) => (0, react_1.createElement)(accordionItem_1.AccordionItem, Object.assign({}, item, { key: item.id, isActive: activeIds.indexOf(item.id) !== -1, onClick: () => onItemClick && onItemClick(item.id) }))) });
|
|
11
16
|
};
|
|
12
17
|
exports.Accordion = Accordion;
|
package/dist/banner/banner.js
CHANGED
|
@@ -5,9 +5,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const bannerSingleLine_1 = require("./bannerSingleLine");
|
|
6
6
|
const bannerMultipLine_1 = require("./bannerMultipLine");
|
|
7
7
|
const useMobile_1 = require("../commonHelpers/hooks/useMobile");
|
|
8
|
+
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
8
9
|
const Banner = ({ children, header, type = "warning", icon, action, size, onClose, multiline, role = "status", ariaAtomic = "true", ariaLive = "polite", className }) => {
|
|
9
10
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
10
11
|
const isMultiline = multiline === undefined ? isMobile : multiline;
|
|
12
|
+
const isClientReady = (0, useClientReady_1.useClientReady)();
|
|
13
|
+
if (!isClientReady) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
11
16
|
return isMultiline ? (0, jsx_runtime_1.jsx)(bannerMultipLine_1.BannerMultiline, { children,
|
|
12
17
|
header,
|
|
13
18
|
type,
|
|
@@ -10,6 +10,7 @@ const pill_1 = require("../pill/pill");
|
|
|
10
10
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
11
11
|
const pillExpandable_1 = require("../pillExpandable/pillExpandable");
|
|
12
12
|
const betaPillContext_1 = require("./betaPillContext");
|
|
13
|
+
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
13
14
|
const BetaPill = ({ className, feedbackAction, betaOptionAction }) => {
|
|
14
15
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
15
16
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
@@ -19,14 +20,18 @@ const BetaPill = ({ className, feedbackAction, betaOptionAction }) => {
|
|
|
19
20
|
isMobile ? "zen-beta-pill--mobile" : "",
|
|
20
21
|
className !== null && className !== void 0 ? className : ""
|
|
21
22
|
]), [isMobile, className]);
|
|
23
|
+
const isClientReady = (0, useClientReady_1.useClientReady)();
|
|
22
24
|
const contextActions = (0, betaPillContext_1.useBetaPillActions)();
|
|
23
25
|
let resolvedMainAction = feedbackAction || (contextActions === null || contextActions === void 0 ? void 0 : contextActions.feedbackAction);
|
|
24
26
|
let resolvedSecondaryAction = betaOptionAction || (contextActions === null || contextActions === void 0 ? void 0 : contextActions.betaOptionAction);
|
|
25
|
-
if (resolvedMainAction || resolvedSecondaryAction) {
|
|
27
|
+
if ((resolvedMainAction || resolvedSecondaryAction) && isClientReady) {
|
|
26
28
|
resolvedMainAction = Object.assign(Object.assign({}, resolvedMainAction), { text: (resolvedMainAction === null || resolvedMainAction === void 0 ? void 0 : resolvedMainAction.text) || translate("Send feedback") });
|
|
27
29
|
resolvedSecondaryAction = Object.assign(Object.assign({}, resolvedSecondaryAction), { text: (resolvedSecondaryAction === null || resolvedSecondaryAction === void 0 ? void 0 : resolvedSecondaryAction.text) || translate("Manage beta option") });
|
|
28
30
|
return ((0, jsx_runtime_1.jsx)(pillExpandable_1.PillExpandable, { isBeta: true, icon: iconLab_1.IconLab, description: translate("This feature is still in testing, and is not fully supported yet. Your feedback is valuable to help guide future enhancements."), text: translate("Beta"), type: "info", className: pillClasses, mainAction: resolvedMainAction, secondaryAction: resolvedSecondaryAction }));
|
|
29
31
|
}
|
|
32
|
+
if (!isClientReady) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
30
35
|
return ((0, jsx_runtime_1.jsx)(pill_1.Pill, { icon: iconLab_1.IconLab, className: pillClasses, type: "info", children: !isMobile && ((0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: translate("Beta") })) }));
|
|
31
36
|
};
|
|
32
37
|
exports.BetaPill = BetaPill;
|
|
@@ -30,12 +30,14 @@ const Calendar = ({ id, value, onChange, disableFutureDates = false, disablePast
|
|
|
30
30
|
const [hoverDate, setHoverDate] = (0, react_1.useState)(fromDate);
|
|
31
31
|
const [focusDate, setFocusDate] = (0, react_1.useState)(fromDate || new Date().toISOString());
|
|
32
32
|
const changeView = (0, react_1.useCallback)((date) => {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
|
|
33
|
+
var _a, _b, _c, _d;
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
focusRef.current = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.activeElement;
|
|
35
36
|
const dateLike = new Date(date);
|
|
36
37
|
dateLike.setDate(15);
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
// eslint-disable-next-line
|
|
39
|
+
if ((_c = (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.activeElement) === null || _c === void 0 ? void 0 : _c.classList.contains("zen-parallel-selection__select")) {
|
|
40
|
+
(_d = parallelSelectionTriggerRef.current) === null || _d === void 0 ? void 0 : _d.focus();
|
|
39
41
|
}
|
|
40
42
|
setViewDate(dateLike.toISOString());
|
|
41
43
|
}, [setViewDate]);
|
|
@@ -8,7 +8,7 @@ export declare const getDefaultDatasetStyle: (dataSet: IBarChartDataset, dsIndex
|
|
|
8
8
|
barThickness?: number | "flex" | undefined;
|
|
9
9
|
maxBarThickness?: number | undefined;
|
|
10
10
|
minBarLength?: number | undefined;
|
|
11
|
-
pointStyle?: false | "circle" | "line" | "rect" | "triangle" | "cross" | "crossRot" | "dash" | "rectRounded" | "rectRot" | "star" | import("chart.js/dist/types/utils")._DeepPartialObject<
|
|
11
|
+
pointStyle?: false | "circle" | "line" | "rect" | "triangle" | "cross" | "crossRot" | "dash" | "rectRounded" | "rectRot" | "star" | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLImageElement> | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLCanvasElement> | undefined;
|
|
12
12
|
grouped?: boolean | undefined;
|
|
13
13
|
indexAxis?: "x" | "y" | undefined;
|
|
14
14
|
clip?: number | false | import("chart.js/dist/types/utils")._DeepPartialObject<import("chart.js").ChartArea> | undefined;
|
package/dist/chart/barChart.js
CHANGED
|
@@ -21,7 +21,6 @@ const utils_1 = require("../commonHelpers/utils");
|
|
|
21
21
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
22
22
|
const useMobile_1 = require("../commonHelpers/hooks/useMobile");
|
|
23
23
|
const themeContext_1 = require("../utils/theme/themeContext");
|
|
24
|
-
const generateId_1 = require("../commonHelpers/generateId");
|
|
25
24
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
26
25
|
const legendPlugin_1 = require("./plugins/legend/legendPlugin");
|
|
27
26
|
const chartSummary_1 = require("./chartSummary/chartSummary");
|
|
@@ -53,8 +52,8 @@ const BarChart = (_a) => {
|
|
|
53
52
|
};
|
|
54
53
|
auto_1.Chart.defaults.color = dark ? "#FFFFFF" : "#1F2833";
|
|
55
54
|
}, [fontSize, dark]);
|
|
56
|
-
const legendId = (0, react_1.
|
|
57
|
-
const tooltipId = (0, react_1.
|
|
55
|
+
const legendId = (0, react_1.useId)();
|
|
56
|
+
const tooltipId = (0, react_1.useId)();
|
|
58
57
|
const { toLocalDateTime } = (0, react_1.useContext)(userFormatContext_1.userFormatContext);
|
|
59
58
|
const isTimedData = (0, react_1.useMemo)(() => (0, isDateRange_1.isDateRange)(data, false), [data]);
|
|
60
59
|
const yAxisMeta = (0, react_1.useMemo)(() => (0, getYAxisMeta_1.getYAxisMeta)(data), [data]);
|
|
@@ -21,7 +21,7 @@ export declare const getDefaultDatasetStyle: (dataSet: ILineChartNativeDataset,
|
|
|
21
21
|
pointHitRadius?: number | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => number | undefined) | readonly (number | undefined)[] | undefined;
|
|
22
22
|
pointRadius?: number | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => number | undefined) | readonly (number | undefined)[] | undefined;
|
|
23
23
|
pointRotation?: number | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => number | undefined) | readonly (number | undefined)[] | undefined;
|
|
24
|
-
pointStyle?: false | "circle" | "line" | "rect" | "triangle" | "cross" | "crossRot" | "dash" | "rectRounded" | "rectRot" | "star" | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => import("chart.js").PointStyle | undefined) | import("chart.js/dist/types/utils")._DeepPartialObject<
|
|
24
|
+
pointStyle?: false | "circle" | "line" | "rect" | "triangle" | "cross" | "crossRot" | "dash" | "rectRounded" | "rectRot" | "star" | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => import("chart.js").PointStyle | undefined) | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLImageElement> | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLCanvasElement> | readonly (false | "circle" | "line" | "rect" | "triangle" | "cross" | "crossRot" | "dash" | "rectRounded" | "rectRot" | "star" | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLImageElement> | import("chart.js/dist/types/utils")._DeepPartialObject<HTMLCanvasElement> | undefined)[] | undefined;
|
|
25
25
|
pointHoverBackgroundColor?: string | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => import("chart.js").Color | undefined) | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasGradient> | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasPattern> | readonly (string | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasGradient> | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasPattern> | undefined)[] | undefined;
|
|
26
26
|
pointHoverBorderColor?: string | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => import("chart.js").Color | undefined) | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasGradient> | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasPattern> | readonly (string | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasGradient> | import("chart.js/dist/types/utils")._DeepPartialObject<CanvasPattern> | undefined)[] | undefined;
|
|
27
27
|
pointHoverBorderWidth?: number | ((ctx: import("chart.js").ScriptableContext<"line">, options: import("chart.js/dist/types/basic").AnyObject) => number | undefined) | readonly (number | undefined)[] | undefined;
|
|
@@ -20,9 +20,9 @@ const useChartTicks = () => {
|
|
|
20
20
|
const handleResize = () => {
|
|
21
21
|
applyWidth();
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
globalThis.addEventListener("resize", handleResize);
|
|
24
24
|
return () => {
|
|
25
|
-
|
|
25
|
+
globalThis.removeEventListener("resize", handleResize);
|
|
26
26
|
};
|
|
27
27
|
}, []);
|
|
28
28
|
const ticks = (0, react_1.useMemo)(() => {
|
package/dist/chart/lineChart.js
CHANGED
|
@@ -22,7 +22,6 @@ const getDefaultDatasetStyle_1 = require("./lineChart/getDefaultDatasetStyle");
|
|
|
22
22
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
23
23
|
const useMobile_1 = require("../commonHelpers/hooks/useMobile");
|
|
24
24
|
const themeContext_1 = require("../utils/theme/themeContext");
|
|
25
|
-
const generateId_1 = require("../commonHelpers/generateId");
|
|
26
25
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
27
26
|
const legendPlugin_1 = require("./plugins/legend/legendPlugin");
|
|
28
27
|
const chartAxis_1 = require("./chartAxis/chartAxis");
|
|
@@ -55,8 +54,8 @@ const LineChart = (_a) => {
|
|
|
55
54
|
};
|
|
56
55
|
auto_1.Chart.defaults.color = dark ? "#FFFFFF" : "#1F2833";
|
|
57
56
|
}, [fontSize, dark]);
|
|
58
|
-
const legendId = (0, react_1.
|
|
59
|
-
const tooltipId = (0, react_1.
|
|
57
|
+
const legendId = (0, react_1.useId)();
|
|
58
|
+
const tooltipId = (0, react_1.useId)();
|
|
60
59
|
const { isHidden, toggleHidden } = (0, useHidden_1.useHidden)();
|
|
61
60
|
const { toLocalDateTime } = (0, react_1.useContext)(userFormatContext_1.userFormatContext);
|
|
62
61
|
const isTimedData = (0, react_1.useMemo)(() => (0, isDateRange_1.isDateRange)(data, true), [data]);
|
package/dist/chart/pieChart.js
CHANGED
|
@@ -21,7 +21,6 @@ const utils_1 = require("../commonHelpers/utils");
|
|
|
21
21
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
22
22
|
const useMobile_1 = require("../commonHelpers/hooks/useMobile");
|
|
23
23
|
const themeContext_1 = require("../utils/theme/themeContext");
|
|
24
|
-
const generateId_1 = require("../commonHelpers/generateId");
|
|
25
24
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
26
25
|
const legendPlugin_1 = require("./plugins/legend/legendPlugin");
|
|
27
26
|
const chartSummary_1 = require("./chartSummary/chartSummary");
|
|
@@ -38,6 +37,8 @@ const PieChart = (_a) => {
|
|
|
38
37
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
39
38
|
const fontSize = (0, react_1.useMemo)(() => isDrive ? (isMobile ? 14 : 16) : 12, [isDrive, isMobile]);
|
|
40
39
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
40
|
+
const legendId = (0, react_1.useId)();
|
|
41
|
+
const tooltipId = (0, react_1.useId)();
|
|
41
42
|
(0, react_1.useEffect)(() => {
|
|
42
43
|
auto_1.Chart.defaults.font = {
|
|
43
44
|
family: "Roboto",
|
|
@@ -45,8 +46,6 @@ const PieChart = (_a) => {
|
|
|
45
46
|
};
|
|
46
47
|
auto_1.Chart.defaults.color = dark ? "#FFFFFF" : "#1F2833";
|
|
47
48
|
}, [fontSize, dark]);
|
|
48
|
-
const legendId = (0, react_1.useMemo)(() => (0, generateId_1.generateId)(), []);
|
|
49
|
-
const tooltipId = (0, react_1.useMemo)(() => (0, generateId_1.generateId)(), []);
|
|
50
49
|
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(), []);
|
|
51
50
|
const chartOptions = (0, utils_1.deepMerge)(defOptions, options);
|
|
52
51
|
const { isHidden, toggleHidden } = (0, useHidden_1.useHidden)();
|
|
@@ -10,7 +10,9 @@ const legendPlugin = (containerId, options, isDrive, isHidden, toggleHidden) =>
|
|
|
10
10
|
id: exports.LEGEND_PLUGIN_ID,
|
|
11
11
|
isDrive: isDrive,
|
|
12
12
|
afterUpdate(chart) {
|
|
13
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
// eslint-disable-next-line
|
|
15
|
+
const container = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.getElementById(containerId);
|
|
14
16
|
if (!container) {
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
@@ -5,19 +5,24 @@ const escapeHtml_1 = require("../../../utils/escapeHtml");
|
|
|
5
5
|
const calculatePositions_1 = require("./calculatePositions");
|
|
6
6
|
const isOutOfViewport_1 = require("./isOutOfViewport");
|
|
7
7
|
const getOrCreateTooltip = (id, isDark) => {
|
|
8
|
-
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
10
|
+
let tooltipEl = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.getElementById(id);
|
|
9
11
|
if (!tooltipEl) {
|
|
10
|
-
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
13
|
+
tooltipEl = (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.createElement("div");
|
|
11
14
|
tooltipEl.id = id;
|
|
12
15
|
tooltipEl.className = "zen-chart-tooltip";
|
|
13
16
|
tooltipEl.setAttribute("role", "tooltip");
|
|
14
17
|
tooltipEl.setAttribute("aria-hidden", "true");
|
|
15
|
-
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
19
|
+
(_c = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _c === void 0 ? void 0 : _c.body.appendChild(tooltipEl);
|
|
16
20
|
}
|
|
17
21
|
tooltipEl.classList.toggle("zen-dark", isDark);
|
|
18
22
|
return tooltipEl;
|
|
19
23
|
};
|
|
20
24
|
const renderTooltip = (tooltipId, x, y, position, items, title, subtitle, isDark) => {
|
|
25
|
+
var _a, _b;
|
|
21
26
|
const element = getOrCreateTooltip(tooltipId, isDark);
|
|
22
27
|
element.style.display = "block";
|
|
23
28
|
const titleHtml = title ? `<div class="zen-chart-tooltip__header">${(0, escapeHtml_1.htmlEscape)(title)}</div>` : "";
|
|
@@ -29,12 +34,14 @@ const renderTooltip = (tooltipId, x, y, position, items, title, subtitle, isDark
|
|
|
29
34
|
</div>`);
|
|
30
35
|
const itemsHtml = `<div class="zen-chart-tooltip__items">${itemsList.join("")}</div>`;
|
|
31
36
|
element.innerHTML = `${titleHtml}${subtitleHtml}${itemsHtml}`;
|
|
32
|
-
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
38
|
+
const arrow = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.createElement("div");
|
|
33
39
|
arrow.className = "zen-chart-tooltip__arrow";
|
|
34
40
|
element.appendChild(arrow);
|
|
35
41
|
const tooltipRect = element.getBoundingClientRect();
|
|
36
42
|
const positionsOrder = [position, ...calculatePositions_1.positionOrder[position]];
|
|
37
|
-
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
44
|
+
const bodyRect = (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.body.getBoundingClientRect();
|
|
38
45
|
let finalPosition = undefined;
|
|
39
46
|
for (let i = 0; i < positionsOrder.length; i++) {
|
|
40
47
|
const pos = positionsOrder[i];
|
|
@@ -62,16 +69,21 @@ const renderTooltip = (tooltipId, x, y, position, items, title, subtitle, isDark
|
|
|
62
69
|
};
|
|
63
70
|
exports.renderTooltip = renderTooltip;
|
|
64
71
|
const hideTooltip = (tooltipId) => {
|
|
65
|
-
|
|
72
|
+
var _a;
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
74
|
+
const element = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.getElementById(tooltipId);
|
|
66
75
|
if (element) {
|
|
67
76
|
element.style.display = "none";
|
|
68
77
|
}
|
|
69
78
|
};
|
|
70
79
|
exports.hideTooltip = hideTooltip;
|
|
71
80
|
const destroyTooltip = (tooltipId) => {
|
|
72
|
-
|
|
81
|
+
var _a, _b;
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
83
|
+
const element = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.getElementById(tooltipId);
|
|
73
84
|
if (element) {
|
|
74
|
-
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
86
|
+
(_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _b === void 0 ? void 0 : _b.body.removeChild(element);
|
|
75
87
|
}
|
|
76
88
|
};
|
|
77
89
|
exports.destroyTooltip = destroyTooltip;
|
|
@@ -75,6 +75,7 @@ const TooltipPlugin = (containerId, options, alignment = "top", isHidden, isDark
|
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
afterDraw: (chart) => {
|
|
78
|
+
var _a;
|
|
78
79
|
if (options === false) {
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
@@ -97,7 +98,8 @@ const TooltipPlugin = (containerId, options, alignment = "top", isHidden, isDark
|
|
|
97
98
|
values = (0, getPieTooltipItems_1.getPieTooltipItems)(chart.data, datasetIndex, index, options);
|
|
98
99
|
}
|
|
99
100
|
const chartRect = chart.canvas.getBoundingClientRect();
|
|
100
|
-
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
102
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.getBoundingClientRect();
|
|
101
103
|
const scrollableParent = (0, getScrollableParent_1.getScrollableParent)(chart.canvas);
|
|
102
104
|
const scrollTop = scrollableParent ? scrollableParent.scrollTop : 0;
|
|
103
105
|
const scrollLeft = scrollableParent ? scrollableParent.scrollLeft : 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useClickOutside = exports.useComboboxNavigation = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const useKeydown_1 = require("../commonHelpers/hooks/useKeydown");
|
|
6
7
|
const useComboboxNavigation = (callback, subscriptionTrigger, condition) => {
|
|
@@ -12,14 +13,16 @@ const useComboboxNavigation = (callback, subscriptionTrigger, condition) => {
|
|
|
12
13
|
exports.useComboboxNavigation = useComboboxNavigation;
|
|
13
14
|
const useClickOutside = (ref, callback) => {
|
|
14
15
|
(0, react_1.useEffect)(() => {
|
|
16
|
+
var _a;
|
|
15
17
|
const handleClick = (event) => {
|
|
16
18
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
17
19
|
callback();
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
|
-
document.body.addEventListener("click", handleClick, true);
|
|
22
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.addEventListener("click", handleClick, true);
|
|
21
23
|
return () => {
|
|
22
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.removeEventListener("click", handleClick, true);
|
|
23
26
|
};
|
|
24
27
|
}, [ref, callback]);
|
|
25
28
|
};
|
|
@@ -8,7 +8,7 @@ const useScrollWhileHolding = ({ action, container, intervalTimer }) => {
|
|
|
8
8
|
if (!container || !action) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
intervalTimer.current =
|
|
11
|
+
intervalTimer.current = globalThis.setInterval(() => {
|
|
12
12
|
const { left, top } = (0, arrowNavigationHelper_1.getScrollOptions)(action, container);
|
|
13
13
|
(0, arrowNavigationHelper_1.scrollElement)(container, { left, top });
|
|
14
14
|
if ((left === container.scrollWidth && action === "right") || (left === 0 && action === "left")) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useClientReady: () => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useClientReady = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const isDomEnv_1 = require("../isDomEnv");
|
|
6
|
+
const useClientReady = () => {
|
|
7
|
+
const [isClientReady, setIsClientReady] = (0, react_1.useState)(false);
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
if ((0, isDomEnv_1.isDomEnv)()) {
|
|
10
|
+
setIsClientReady(true);
|
|
11
|
+
}
|
|
12
|
+
}, []);
|
|
13
|
+
return isClientReady;
|
|
14
|
+
};
|
|
15
|
+
exports.useClientReady = useClientReady;
|
|
@@ -8,7 +8,8 @@ const topWindowContext_1 = require("../../utils/topWindow/topWindowContext");
|
|
|
8
8
|
const getParentWindow_1 = require("../../utils/getParentWindow");
|
|
9
9
|
const MobileMaxWidth = 640;
|
|
10
10
|
const getDeviceType = (width) => {
|
|
11
|
-
if
|
|
11
|
+
// TODO: think about better solution - could be issue if app opens in mobile with SSR
|
|
12
|
+
if (width === undefined || width > MobileMaxWidth) {
|
|
12
13
|
return deviceType_1.DeviceType.Desktop;
|
|
13
14
|
}
|
|
14
15
|
return deviceType_1.DeviceType.Mobile;
|
|
@@ -16,7 +17,7 @@ const getDeviceType = (width) => {
|
|
|
16
17
|
exports.getDeviceType = getDeviceType;
|
|
17
18
|
const useDeviceType = (callback) => {
|
|
18
19
|
const { topWindow } = (0, react_1.useContext)(topWindowContext_1.topWindowContext);
|
|
19
|
-
const win = (0, react_1.useMemo)(() => topWindow || (0, getParentWindow_1.getParentWindow)(
|
|
20
|
+
const win = (0, react_1.useMemo)(() => topWindow || (0, getParentWindow_1.getParentWindow)(globalThis), [topWindow]);
|
|
20
21
|
const [deviceType, setDeviceType] = (0, react_1.useState)((0, exports.getDeviceType)(win.innerWidth));
|
|
21
22
|
(0, useResize_1.useResize)(() => {
|
|
22
23
|
setDeviceType((0, exports.getDeviceType)(win.innerWidth));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useKeydown = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const useKeydown = (callback, subscriptionTrigger, condition) => {
|
|
6
7
|
(0, react_1.useEffect)(() => {
|
|
8
|
+
var _a;
|
|
7
9
|
if (condition ? condition(subscriptionTrigger) : subscriptionTrigger) {
|
|
8
|
-
document.body.addEventListener("keydown", callback);
|
|
10
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.addEventListener("keydown", callback);
|
|
9
11
|
}
|
|
10
12
|
return () => {
|
|
11
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body.removeEventListener("keydown", callback);
|
|
12
15
|
};
|
|
13
16
|
}, [callback, condition, subscriptionTrigger]);
|
|
14
17
|
};
|
|
@@ -5,7 +5,7 @@ const react_1 = require("react");
|
|
|
5
5
|
const deviceType_1 = require("./deviceType");
|
|
6
6
|
const useDeviceType_1 = require("./useDeviceType");
|
|
7
7
|
const getParentWindow_1 = require("../../utils/getParentWindow");
|
|
8
|
-
const initialParent = (0, getParentWindow_1.getParentWindow)(
|
|
8
|
+
const initialParent = (0, getParentWindow_1.getParentWindow)(globalThis);
|
|
9
9
|
exports.initialValue = (0, useDeviceType_1.getDeviceType)(initialParent.innerWidth);
|
|
10
10
|
const useMobile = () => {
|
|
11
11
|
const [deviceType, setDeviceType] = (0, react_1.useState)(exports.initialValue);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePortal = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_dom_1 = require("react-dom");
|
|
6
|
+
const usePortal = (children, container, key) => {
|
|
7
|
+
const [portalContainer, setPortalContainer] = (0, react_1.useState)(container);
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
if (portalContainer || !container) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
setPortalContainer(container);
|
|
13
|
+
}, [portalContainer, container]);
|
|
14
|
+
// TODO: memoization?
|
|
15
|
+
// TODO: client ready check?
|
|
16
|
+
return portalContainer ? (0, react_dom_1.createPortal)(children, portalContainer, key) : null;
|
|
17
|
+
};
|
|
18
|
+
exports.usePortal = usePortal;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useResize = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const useResize = (callback, active) => {
|
|
6
7
|
(0, react_1.useEffect)(() => {
|
|
8
|
+
var _a;
|
|
7
9
|
if (!active) {
|
|
8
|
-
return;
|
|
10
|
+
return undefined;
|
|
9
11
|
}
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line consistent-return
|
|
12
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.addEventListener) === null || _a === void 0 ? void 0 : _a.call(globalThis, "resize", callback);
|
|
12
13
|
return () => {
|
|
13
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(globalThis, "resize", callback);
|
|
14
16
|
};
|
|
15
17
|
}, [callback, active]);
|
|
16
18
|
};
|
|
@@ -10,17 +10,21 @@ const getTarget = (target) => {
|
|
|
10
10
|
const useResizeObserver = ({ target }) => {
|
|
11
11
|
const [result, setResult] = (0, react_1.useState)(null);
|
|
12
12
|
const timeoutRef = (0, react_1.useRef)(null);
|
|
13
|
-
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
const ResizeObserverFn = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ResizeObserver;
|
|
15
|
+
// eslint-disable-next-line
|
|
16
|
+
const observerCallback = ResizeObserverFn ? new ResizeObserverFn((entities) => {
|
|
14
17
|
timeoutRef.current && cancelAnimationFrame(timeoutRef.current);
|
|
15
18
|
timeoutRef.current = requestAnimationFrame(() => setResult(entities[0]));
|
|
16
|
-
})
|
|
19
|
+
}) : undefined;
|
|
20
|
+
const observer = (0, react_1.useRef)(observerCallback);
|
|
17
21
|
(0, react_1.useLayoutEffect)(() => {
|
|
18
22
|
const targetObj = getTarget(target);
|
|
19
23
|
const observerObj = observer.current;
|
|
20
|
-
targetObj && observerObj.observe(targetObj);
|
|
24
|
+
targetObj && (observerObj === null || observerObj === void 0 ? void 0 : observerObj.observe(targetObj));
|
|
21
25
|
return () => {
|
|
22
26
|
timeoutRef.current && cancelAnimationFrame(timeoutRef.current);
|
|
23
|
-
observerObj.disconnect();
|
|
27
|
+
observerObj === null || observerObj === void 0 ? void 0 : observerObj.disconnect();
|
|
24
28
|
};
|
|
25
29
|
}, [target]);
|
|
26
30
|
return { result };
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useScroll = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
6
|
+
const useScroll = (callback, active, triggerRef) => {
|
|
7
|
+
var _a;
|
|
8
|
+
if (triggerRef === void 0) { triggerRef = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body; }
|
|
6
9
|
(0, react_1.useEffect)(() => {
|
|
7
10
|
if (!active || triggerRef === null) {
|
|
8
11
|
return;
|