@ohos-ports/superset-ui-core 0.20.4-beta.1
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 +42 -0
- package/esm/api/index.js +1 -0
- package/esm/api/types/core.js +0 -0
- package/esm/api/types/core.js.map +1 -0
- package/esm/chart/clients/ChartClient.js +201 -0
- package/esm/chart/clients/ChartClient.js.map +1 -0
- package/esm/chart/components/ChartDataProvider.js +171 -0
- package/esm/chart/components/ChartDataProvider.js.map +1 -0
- package/esm/chart/components/FallbackComponent.js +61 -0
- package/esm/chart/components/FallbackComponent.js.map +1 -0
- package/esm/chart/components/NoResultsComponent.js +88 -0
- package/esm/chart/components/NoResultsComponent.js.map +1 -0
- package/esm/chart/components/SuperChart.js +267 -0
- package/esm/chart/components/SuperChart.js.map +1 -0
- package/esm/chart/components/SuperChartCore.js +235 -0
- package/esm/chart/components/SuperChartCore.js.map +1 -0
- package/esm/chart/components/createLoadableRenderer.js +75 -0
- package/esm/chart/components/createLoadableRenderer.js.map +1 -0
- package/esm/chart/components/reactify.js +115 -0
- package/esm/chart/components/reactify.js.map +1 -0
- package/esm/chart/index.js +49 -0
- package/esm/chart/index.js.map +1 -0
- package/esm/chart/models/ChartControlPanel.js +1 -0
- package/esm/chart/models/ChartControlPanel.js.map +1 -0
- package/esm/chart/models/ChartMetadata.js +160 -0
- package/esm/chart/models/ChartMetadata.js.map +1 -0
- package/esm/chart/models/ChartPlugin.js +162 -0
- package/esm/chart/models/ChartPlugin.js.map +1 -0
- package/esm/chart/models/ChartProps.js +270 -0
- package/esm/chart/models/ChartProps.js.map +1 -0
- package/esm/chart/registries/ChartBuildQueryRegistrySingleton.js +53 -0
- package/esm/chart/registries/ChartBuildQueryRegistrySingleton.js.map +1 -0
- package/esm/chart/registries/ChartComponentRegistrySingleton.js +32 -0
- package/esm/chart/registries/ChartComponentRegistrySingleton.js.map +1 -0
- package/esm/chart/registries/ChartControlPanelRegistrySingleton.js +35 -0
- package/esm/chart/registries/ChartControlPanelRegistrySingleton.js.map +1 -0
- package/esm/chart/registries/ChartMetadataRegistrySingleton.js +32 -0
- package/esm/chart/registries/ChartMetadataRegistrySingleton.js.map +1 -0
- package/esm/chart/registries/ChartTransformPropsRegistrySingleton.js +35 -0
- package/esm/chart/registries/ChartTransformPropsRegistrySingleton.js.map +1 -0
- package/esm/chart/types/Annotation.js +1 -0
- package/esm/chart/types/Annotation.js.map +1 -0
- package/esm/chart/types/Base.js +108 -0
- package/esm/chart/types/Base.js.map +1 -0
- package/esm/chart/types/QueryResponse.js +53 -0
- package/esm/chart/types/QueryResponse.js.map +1 -0
- package/esm/chart/types/TransformFunction.js +55 -0
- package/esm/chart/types/TransformFunction.js.map +1 -0
- package/esm/chart/types/VizType.js +20 -0
- package/esm/chart/types/VizType.js.map +1 -0
- package/esm/chart-composition/ChartFrame.js +75 -0
- package/esm/chart-composition/ChartFrame.js.map +1 -0
- package/esm/chart-composition/index.js +24 -0
- package/esm/chart-composition/index.js.map +1 -0
- package/esm/chart-composition/legend/WithLegend.js +147 -0
- package/esm/chart-composition/legend/WithLegend.js.map +1 -0
- package/esm/chart-composition/tooltip/TooltipFrame.js +48 -0
- package/esm/chart-composition/tooltip/TooltipFrame.js.map +1 -0
- package/esm/chart-composition/tooltip/TooltipTable.js +70 -0
- package/esm/chart-composition/tooltip/TooltipTable.js.map +1 -0
- package/esm/color/CategoricalColorNamespace.js +122 -0
- package/esm/color/CategoricalColorNamespace.js.map +1 -0
- package/esm/color/CategoricalColorScale.js +375 -0
- package/esm/color/CategoricalColorScale.js.map +1 -0
- package/esm/color/CategoricalScheme.js +23 -0
- package/esm/color/CategoricalScheme.js.map +1 -0
- package/esm/color/CategoricalSchemeRegistrySingleton.js +36 -0
- package/esm/color/CategoricalSchemeRegistrySingleton.js.map +1 -0
- package/esm/color/ColorScheme.js +60 -0
- package/esm/color/ColorScheme.js.map +1 -0
- package/esm/color/ColorSchemeRegistry.js +44 -0
- package/esm/color/ColorSchemeRegistry.js.map +1 -0
- package/esm/color/LabelsColorMapSingleton.js +177 -0
- package/esm/color/LabelsColorMapSingleton.js.map +1 -0
- package/esm/color/SequentialScheme.js +97 -0
- package/esm/color/SequentialScheme.js.map +1 -0
- package/esm/color/SequentialSchemeRegistrySingleton.js +36 -0
- package/esm/color/SequentialSchemeRegistrySingleton.js.map +1 -0
- package/esm/color/colorSchemes/categorical/airbnb.js +46 -0
- package/esm/color/colorSchemes/categorical/airbnb.js.map +1 -0
- package/esm/color/colorSchemes/categorical/blueToGreen.js +45 -0
- package/esm/color/colorSchemes/categorical/blueToGreen.js.map +1 -0
- package/esm/color/colorSchemes/categorical/colorsOfRainbow.js +47 -0
- package/esm/color/colorSchemes/categorical/colorsOfRainbow.js.map +1 -0
- package/esm/color/colorSchemes/categorical/d3.js +121 -0
- package/esm/color/colorSchemes/categorical/d3.js.map +1 -0
- package/esm/color/colorSchemes/categorical/echarts.js +59 -0
- package/esm/color/colorSchemes/categorical/echarts.js.map +1 -0
- package/esm/color/colorSchemes/categorical/google.js +69 -0
- package/esm/color/colorSchemes/categorical/google.js.map +1 -0
- package/esm/color/colorSchemes/categorical/index.js +33 -0
- package/esm/color/colorSchemes/categorical/index.js.map +1 -0
- package/esm/color/colorSchemes/categorical/lyft.js +43 -0
- package/esm/color/colorSchemes/categorical/lyft.js.map +1 -0
- package/esm/color/colorSchemes/categorical/modernSunset.js +47 -0
- package/esm/color/colorSchemes/categorical/modernSunset.js.map +1 -0
- package/esm/color/colorSchemes/categorical/preset.js +57 -0
- package/esm/color/colorSchemes/categorical/preset.js.map +1 -0
- package/esm/color/colorSchemes/categorical/presetAndSuperset.js +47 -0
- package/esm/color/colorSchemes/categorical/presetAndSuperset.js.map +1 -0
- package/esm/color/colorSchemes/categorical/redToYellow.js +45 -0
- package/esm/color/colorSchemes/categorical/redToYellow.js.map +1 -0
- package/esm/color/colorSchemes/categorical/superset.js +57 -0
- package/esm/color/colorSchemes/categorical/superset.js.map +1 -0
- package/esm/color/colorSchemes/categorical/wavesOfBlue.js +45 -0
- package/esm/color/colorSchemes/categorical/wavesOfBlue.js.map +1 -0
- package/esm/color/colorSchemes/index.js +22 -0
- package/esm/color/colorSchemes/index.js.map +1 -0
- package/esm/color/colorSchemes/sequential/common.js +229 -0
- package/esm/color/colorSchemes/sequential/common.js.map +1 -0
- package/esm/color/colorSchemes/sequential/d3.js +530 -0
- package/esm/color/colorSchemes/sequential/d3.js.map +1 -0
- package/esm/color/colorSchemes/sequential/index.js +22 -0
- package/esm/color/colorSchemes/sequential/index.js.map +1 -0
- package/esm/color/index.js +43 -0
- package/esm/color/index.js.map +1 -0
- package/esm/color/stringifyAndTrim.js +27 -0
- package/esm/color/stringifyAndTrim.js.map +1 -0
- package/esm/color/types.js +36 -0
- package/esm/color/types.js.map +1 -0
- package/esm/color/utils.js +123 -0
- package/esm/color/utils.js.map +1 -0
- package/esm/components/SafeMarkdown.js +90 -0
- package/esm/components/SafeMarkdown.js.map +1 -0
- package/esm/components/constants.js +29 -0
- package/esm/components/constants.js.map +1 -0
- package/esm/components/index.js +22 -0
- package/esm/components/index.js.map +1 -0
- package/esm/connection/README.md +106 -0
- package/esm/connection/SupersetClient.js +56 -0
- package/esm/connection/SupersetClient.js.map +1 -0
- package/esm/connection/SupersetClientClass.js +279 -0
- package/esm/connection/SupersetClientClass.js.map +1 -0
- package/esm/connection/callApi/callApi.js +182 -0
- package/esm/connection/callApi/callApi.js.map +1 -0
- package/esm/connection/callApi/callApiAndParseWithTimeout.js +40 -0
- package/esm/connection/callApi/callApiAndParseWithTimeout.js.map +1 -0
- package/esm/connection/callApi/index.js +21 -0
- package/esm/connection/callApi/index.js.map +1 -0
- package/esm/connection/callApi/parseResponse.js +81 -0
- package/esm/connection/callApi/parseResponse.js.map +1 -0
- package/esm/connection/callApi/rejectAfterTimeout.js +35 -0
- package/esm/connection/callApi/rejectAfterTimeout.js.map +1 -0
- package/esm/connection/constants.js +42 -0
- package/esm/connection/constants.js.map +1 -0
- package/esm/connection/index.js +27 -0
- package/esm/connection/index.js.map +1 -0
- package/esm/connection/types.js +170 -0
- package/esm/connection/types.js.map +1 -0
- package/esm/currency-format/CurrencyFormatter.js +80 -0
- package/esm/currency-format/CurrencyFormatter.js.map +1 -0
- package/esm/currency-format/index.js +23 -0
- package/esm/currency-format/index.js.map +1 -0
- package/esm/currency-format/utils.js +100 -0
- package/esm/currency-format/utils.js.map +1 -0
- package/esm/dimension/computeMaxFontSize.js +95 -0
- package/esm/dimension/computeMaxFontSize.js.map +1 -0
- package/esm/dimension/getMultipleTextDimensions.js +85 -0
- package/esm/dimension/getMultipleTextDimensions.js.map +1 -0
- package/esm/dimension/getTextDimension.js +62 -0
- package/esm/dimension/getTextDimension.js.map +1 -0
- package/esm/dimension/index.js +28 -0
- package/esm/dimension/index.js.map +1 -0
- package/esm/dimension/mergeMargin.js +48 -0
- package/esm/dimension/mergeMargin.js.map +1 -0
- package/esm/dimension/parseLength.js +42 -0
- package/esm/dimension/parseLength.js.map +1 -0
- package/esm/dimension/svg/LazyFactory.js +61 -0
- package/esm/dimension/svg/LazyFactory.js.map +1 -0
- package/esm/dimension/svg/constants.js +22 -0
- package/esm/dimension/svg/constants.js.map +1 -0
- package/esm/dimension/svg/createHiddenSvgNode.js +34 -0
- package/esm/dimension/svg/createHiddenSvgNode.js.map +1 -0
- package/esm/dimension/svg/createTextNode.js +25 -0
- package/esm/dimension/svg/createTextNode.js.map +1 -0
- package/esm/dimension/svg/factories.js +26 -0
- package/esm/dimension/svg/factories.js.map +1 -0
- package/esm/dimension/svg/getBBoxCeil.js +35 -0
- package/esm/dimension/svg/getBBoxCeil.js.map +1 -0
- package/esm/dimension/svg/updateTextNode.js +72 -0
- package/esm/dimension/svg/updateTextNode.js.map +1 -0
- package/esm/dimension/types.js +42 -0
- package/esm/dimension/types.js.map +1 -0
- package/esm/dynamic-plugins/index.js +21 -0
- package/esm/dynamic-plugins/index.js.map +1 -0
- package/esm/dynamic-plugins/shared-modules.js +98 -0
- package/esm/dynamic-plugins/shared-modules.js.map +1 -0
- package/esm/hooks/index.js +26 -0
- package/esm/hooks/index.js.map +1 -0
- package/esm/hooks/useChangeEffect/index.js +21 -0
- package/esm/hooks/useChangeEffect/index.js.map +1 -0
- package/esm/hooks/useChangeEffect/useChangeEffect.js +39 -0
- package/esm/hooks/useChangeEffect/useChangeEffect.js.map +1 -0
- package/esm/hooks/useChangeEffect/useChangeEffect.test.js +55 -0
- package/esm/hooks/useChangeEffect/useChangeEffect.test.js.map +1 -0
- package/esm/hooks/useComponentDidMount/index.js +21 -0
- package/esm/hooks/useComponentDidMount/index.js.map +1 -0
- package/esm/hooks/useComponentDidMount/useComponentDidMount.js +25 -0
- package/esm/hooks/useComponentDidMount/useComponentDidMount.js.map +1 -0
- package/esm/hooks/useComponentDidMount/useComponentDidMount.test.js +29 -0
- package/esm/hooks/useComponentDidMount/useComponentDidMount.test.js.map +1 -0
- package/esm/hooks/useComponentDidUpdate/index.js +21 -0
- package/esm/hooks/useComponentDidUpdate/index.js.map +1 -0
- package/esm/hooks/useComponentDidUpdate/useComponentDidUpdate.js +36 -0
- package/esm/hooks/useComponentDidUpdate/useComponentDidUpdate.js.map +1 -0
- package/esm/hooks/useComponentDidUpdate/useComponentDidUpdate.test.js +32 -0
- package/esm/hooks/useComponentDidUpdate/useComponentDidUpdate.test.js.map +1 -0
- package/esm/hooks/useElementOnScreen/index.js +21 -0
- package/esm/hooks/useElementOnScreen/index.js.map +1 -0
- package/esm/hooks/useElementOnScreen/useElementOnScreen.js +47 -0
- package/esm/hooks/useElementOnScreen/useElementOnScreen.js.map +1 -0
- package/esm/hooks/useElementOnScreen/useElementOnScreen.test.js +111 -0
- package/esm/hooks/useElementOnScreen/useElementOnScreen.test.js.map +1 -0
- package/esm/hooks/usePrevious/index.js +21 -0
- package/esm/hooks/usePrevious/index.js.map +1 -0
- package/esm/hooks/usePrevious/usePrevious.js +37 -0
- package/esm/hooks/usePrevious/usePrevious.js.map +1 -0
- package/esm/hooks/usePrevious/usePrevious.test.js +44 -0
- package/esm/hooks/usePrevious/usePrevious.test.js.map +1 -0
- package/esm/hooks/useTruncation/index.js +24 -0
- package/esm/hooks/useTruncation/index.js.map +1 -0
- package/esm/hooks/useTruncation/useCSSTextTruncation.js +62 -0
- package/esm/hooks/useTruncation/useCSSTextTruncation.js.map +1 -0
- package/esm/hooks/useTruncation/useCSSTextTruncation.test.js +62 -0
- package/esm/hooks/useTruncation/useCSSTextTruncation.test.js.map +1 -0
- package/esm/hooks/useTruncation/useChildElementTruncation.js +95 -0
- package/esm/hooks/useTruncation/useChildElementTruncation.js.map +1 -0
- package/esm/hooks/useTruncation/useChildElementTruncation.test.js +223 -0
- package/esm/hooks/useTruncation/useChildElementTruncation.test.js.map +1 -0
- package/esm/index.js +41 -0
- package/esm/index.js.map +1 -0
- package/esm/math-expression/index.js +122 -0
- package/esm/math-expression/index.js.map +1 -0
- package/esm/models/ExtensibleFunction.js +31 -0
- package/esm/models/ExtensibleFunction.js.map +1 -0
- package/esm/models/Plugin.js +54 -0
- package/esm/models/Plugin.js.map +1 -0
- package/esm/models/Preset.js +57 -0
- package/esm/models/Preset.js.map +1 -0
- package/esm/models/Registry.js +286 -0
- package/esm/models/Registry.js.map +1 -0
- package/esm/models/RegistryWithDefaultKey.js +95 -0
- package/esm/models/RegistryWithDefaultKey.js.map +1 -0
- package/esm/models/TypedRegistry.js +61 -0
- package/esm/models/TypedRegistry.js.map +1 -0
- package/esm/models/index.js +25 -0
- package/esm/models/index.js.map +1 -0
- package/esm/number-format/D3FormatConfig.js +27 -0
- package/esm/number-format/D3FormatConfig.js.map +1 -0
- package/esm/number-format/NumberFormats.js +90 -0
- package/esm/number-format/NumberFormats.js.map +1 -0
- package/esm/number-format/NumberFormatter.js +87 -0
- package/esm/number-format/NumberFormatter.js.map +1 -0
- package/esm/number-format/NumberFormatterRegistry.js +86 -0
- package/esm/number-format/NumberFormatterRegistry.js.map +1 -0
- package/esm/number-format/NumberFormatterRegistrySingleton.js +41 -0
- package/esm/number-format/NumberFormatterRegistrySingleton.js.map +1 -0
- package/esm/number-format/README.md +82 -0
- package/esm/number-format/factories/createD3NumberFormatter.js +58 -0
- package/esm/number-format/factories/createD3NumberFormatter.js.map +1 -0
- package/esm/number-format/factories/createDurationFormatter.js +41 -0
- package/esm/number-format/factories/createDurationFormatter.js.map +1 -0
- package/esm/number-format/factories/createMemoryFormatter.js +56 -0
- package/esm/number-format/factories/createMemoryFormatter.js.map +1 -0
- package/esm/number-format/factories/createSiAtMostNDigitFormatter.js +46 -0
- package/esm/number-format/factories/createSiAtMostNDigitFormatter.js.map +1 -0
- package/esm/number-format/factories/createSmartNumberFormatter.js +71 -0
- package/esm/number-format/factories/createSmartNumberFormatter.js.map +1 -0
- package/esm/number-format/index.js +37 -0
- package/esm/number-format/index.js.map +1 -0
- package/esm/number-format/types.js +1 -0
- package/esm/number-format/types.js.map +1 -0
- package/esm/query/DatasourceKey.js +45 -0
- package/esm/query/DatasourceKey.js.map +1 -0
- package/esm/query/README.md +30 -0
- package/esm/query/api/legacy/getDatasourceMetadata.js +40 -0
- package/esm/query/api/legacy/getDatasourceMetadata.js.map +1 -0
- package/esm/query/api/legacy/getFormData.js +46 -0
- package/esm/query/api/legacy/getFormData.js.map +1 -0
- package/esm/query/api/legacy/index.js +25 -0
- package/esm/query/api/legacy/index.js.map +1 -0
- package/esm/query/api/legacy/types.js +27 -0
- package/esm/query/api/legacy/types.js.map +1 -0
- package/esm/query/api/types.js +1 -0
- package/esm/query/api/types.js.map +1 -0
- package/esm/query/api/v1/handleError.js +107 -0
- package/esm/query/api/v1/handleError.js.map +1 -0
- package/esm/query/api/v1/index.js +33 -0
- package/esm/query/api/v1/index.js.map +1 -0
- package/esm/query/api/v1/makeApi.js +159 -0
- package/esm/query/api/v1/makeApi.js.map +1 -0
- package/esm/query/api/v1/types.js +142 -0
- package/esm/query/api/v1/types.js.map +1 -0
- package/esm/query/buildQueryContext.js +72 -0
- package/esm/query/buildQueryContext.js.map +1 -0
- package/esm/query/buildQueryObject.js +141 -0
- package/esm/query/buildQueryObject.js.map +1 -0
- package/esm/query/constants.js +60 -0
- package/esm/query/constants.js.map +1 -0
- package/esm/query/convertFilter.js +57 -0
- package/esm/query/convertFilter.js.map +1 -0
- package/esm/query/extractExtras.js +84 -0
- package/esm/query/extractExtras.js.map +1 -0
- package/esm/query/extractQueryFields.js +129 -0
- package/esm/query/extractQueryFields.js.map +1 -0
- package/esm/query/extractTimegrain.js +39 -0
- package/esm/query/extractTimegrain.js.map +1 -0
- package/esm/query/getClientErrorObject.js +304 -0
- package/esm/query/getClientErrorObject.js.map +1 -0
- package/esm/query/getColumnLabel.js +31 -0
- package/esm/query/getColumnLabel.js.map +1 -0
- package/esm/query/getMetricLabel.js +36 -0
- package/esm/query/getMetricLabel.js.map +1 -0
- package/esm/query/getXAxis.js +52 -0
- package/esm/query/getXAxis.js.map +1 -0
- package/esm/query/index.js +48 -0
- package/esm/query/index.js.map +1 -0
- package/esm/query/normalizeOrderBy.js +80 -0
- package/esm/query/normalizeOrderBy.js.map +1 -0
- package/esm/query/normalizeTimeColumn.js +82 -0
- package/esm/query/normalizeTimeColumn.js.map +1 -0
- package/esm/query/processExtraFormData.js +50 -0
- package/esm/query/processExtraFormData.js.map +1 -0
- package/esm/query/processFilters.js +76 -0
- package/esm/query/processFilters.js.map +1 -0
- package/esm/query/types/AdvancedAnalytics.js +44 -0
- package/esm/query/types/AdvancedAnalytics.js.map +1 -0
- package/esm/query/types/AnnotationLayer.js +185 -0
- package/esm/query/types/AnnotationLayer.js.map +1 -0
- package/esm/query/types/Column.js +82 -0
- package/esm/query/types/Column.js.map +1 -0
- package/esm/query/types/Dashboard.js +171 -0
- package/esm/query/types/Dashboard.js.map +1 -0
- package/esm/query/types/Datasource.js +65 -0
- package/esm/query/types/Datasource.js.map +1 -0
- package/esm/query/types/Filter.js +100 -0
- package/esm/query/types/Filter.js.map +1 -0
- package/esm/query/types/Metric.js +98 -0
- package/esm/query/types/Metric.js.map +1 -0
- package/esm/query/types/Operator.js +75 -0
- package/esm/query/types/Operator.js.map +1 -0
- package/esm/query/types/PostProcessing.js +360 -0
- package/esm/query/types/PostProcessing.js.map +1 -0
- package/esm/query/types/Query.js +486 -0
- package/esm/query/types/Query.js.map +1 -0
- package/esm/query/types/QueryFormData.js +212 -0
- package/esm/query/types/QueryFormData.js.map +1 -0
- package/esm/query/types/QueryResponse.js +98 -0
- package/esm/query/types/QueryResponse.js.map +1 -0
- package/esm/query/types/Time.js +40 -0
- package/esm/query/types/Time.js.map +1 -0
- package/esm/query/types/index.js +43 -0
- package/esm/query/types/index.js.map +1 -0
- package/esm/style/index.js +174 -0
- package/esm/style/index.js.map +1 -0
- package/esm/time-comparison/README.md +47 -0
- package/esm/time-comparison/customTimeRangeDecode.js +174 -0
- package/esm/time-comparison/customTimeRangeDecode.js.map +1 -0
- package/esm/time-comparison/fetchTimeRange.js +113 -0
- package/esm/time-comparison/fetchTimeRange.js.map +1 -0
- package/esm/time-comparison/getComparisonFilters.js +68 -0
- package/esm/time-comparison/getComparisonFilters.js.map +1 -0
- package/esm/time-comparison/getComparisonInfo.js +66 -0
- package/esm/time-comparison/getComparisonInfo.js.map +1 -0
- package/esm/time-comparison/getTimeOffset.js +319 -0
- package/esm/time-comparison/getTimeOffset.js.map +1 -0
- package/esm/time-comparison/index.js +31 -0
- package/esm/time-comparison/index.js.map +1 -0
- package/esm/time-comparison/types.js +25 -0
- package/esm/time-comparison/types.js.map +1 -0
- package/esm/time-format/D3FormatConfig.js +66 -0
- package/esm/time-format/D3FormatConfig.js.map +1 -0
- package/esm/time-format/README.md +68 -0
- package/esm/time-format/TimeFormats.js +39 -0
- package/esm/time-format/TimeFormats.js.map +1 -0
- package/esm/time-format/TimeFormatsForGranularity.js +50 -0
- package/esm/time-format/TimeFormatsForGranularity.js.map +1 -0
- package/esm/time-format/TimeFormatter.js +77 -0
- package/esm/time-format/TimeFormatter.js.map +1 -0
- package/esm/time-format/TimeFormatterRegistry.js +78 -0
- package/esm/time-format/TimeFormatterRegistry.js.map +1 -0
- package/esm/time-format/TimeFormatterRegistrySingleton.js +92 -0
- package/esm/time-format/TimeFormatterRegistrySingleton.js.map +1 -0
- package/esm/time-format/TimeRangeFormatter.js +69 -0
- package/esm/time-format/TimeRangeFormatter.js.map +1 -0
- package/esm/time-format/factories/createD3TimeFormatter.js +65 -0
- package/esm/time-format/factories/createD3TimeFormatter.js.map +1 -0
- package/esm/time-format/factories/createMultiFormatter.js +124 -0
- package/esm/time-format/factories/createMultiFormatter.js.map +1 -0
- package/esm/time-format/formatters/finestTemporalGrain.js +81 -0
- package/esm/time-format/formatters/finestTemporalGrain.js.map +1 -0
- package/esm/time-format/formatters/finestTemporalGrain.test.js +64 -0
- package/esm/time-format/formatters/finestTemporalGrain.test.js.map +1 -0
- package/esm/time-format/formatters/smartDate.js +42 -0
- package/esm/time-format/formatters/smartDate.js.map +1 -0
- package/esm/time-format/formatters/smartDateDetailed.js +44 -0
- package/esm/time-format/formatters/smartDateDetailed.js.map +1 -0
- package/esm/time-format/formatters/smartDateVerbose.js +42 -0
- package/esm/time-format/formatters/smartDateVerbose.js.map +1 -0
- package/esm/time-format/index.js +54 -0
- package/esm/time-format/index.js.map +1 -0
- package/esm/time-format/types.js +48 -0
- package/esm/time-format/types.js.map +1 -0
- package/esm/time-format/utils/createTime.js +41 -0
- package/esm/time-format/utils/createTime.js.map +1 -0
- package/esm/time-format/utils/createTimeRangeFromGranularity.js +112 -0
- package/esm/time-format/utils/createTimeRangeFromGranularity.js.map +1 -0
- package/esm/time-format/utils/d3Time.js +142 -0
- package/esm/time-format/utils/d3Time.js.map +1 -0
- package/esm/time-format/utils/denormalizeTimestamp.js +29 -0
- package/esm/time-format/utils/denormalizeTimestamp.js.map +1 -0
- package/esm/time-format/utils/normalizeTimestamp.js +29 -0
- package/esm/time-format/utils/normalizeTimestamp.js.map +1 -0
- package/esm/time-format/utils/stringifyTimeInput.js +30 -0
- package/esm/time-format/utils/stringifyTimeInput.js.map +1 -0
- package/esm/translation/README.md +71 -0
- package/esm/translation/Translator.js +106 -0
- package/esm/translation/Translator.js.map +1 -0
- package/esm/translation/TranslatorSingleton.js +82 -0
- package/esm/translation/TranslatorSingleton.js.map +1 -0
- package/esm/translation/index.js +26 -0
- package/esm/translation/index.js.map +1 -0
- package/esm/translation/types/index.js +74 -0
- package/esm/translation/types/index.js.map +1 -0
- package/esm/translation/types/jed.js +57 -0
- package/esm/translation/types/jed.js.map +1 -0
- package/esm/types/index.js +23 -0
- package/esm/types/index.js.map +1 -0
- package/esm/ui-overrides/ExtensionsRegistry.js +32 -0
- package/esm/ui-overrides/ExtensionsRegistry.js.map +1 -0
- package/esm/ui-overrides/index.js +21 -0
- package/esm/ui-overrides/index.js.map +1 -0
- package/esm/ui-overrides/types.js +1 -0
- package/esm/ui-overrides/types.js.map +1 -0
- package/esm/utils/convertKeysToCamelCase.js +34 -0
- package/esm/utils/convertKeysToCamelCase.js.map +1 -0
- package/esm/utils/ensureIsArray.js +30 -0
- package/esm/utils/ensureIsArray.js.map +1 -0
- package/esm/utils/ensureIsInt.js +28 -0
- package/esm/utils/ensureIsInt.js.map +1 -0
- package/esm/utils/featureFlags.js +105 -0
- package/esm/utils/featureFlags.js.map +1 -0
- package/esm/utils/getSelectedText.js +20 -0
- package/esm/utils/getSelectedText.js.map +1 -0
- package/esm/utils/html.js +122 -0
- package/esm/utils/html.js.map +1 -0
- package/esm/utils/html.test.js +192 -0
- package/esm/utils/html.test.js.map +1 -0
- package/esm/utils/index.js +36 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/isDefined.js +23 -0
- package/esm/utils/isDefined.js.map +1 -0
- package/esm/utils/isEqualArray.js +34 -0
- package/esm/utils/isEqualArray.js.map +1 -0
- package/esm/utils/isEqualArray.test.js +32 -0
- package/esm/utils/isEqualArray.test.js.map +1 -0
- package/esm/utils/isRequired.js +23 -0
- package/esm/utils/isRequired.js.map +1 -0
- package/esm/utils/logging.js +39 -0
- package/esm/utils/logging.js.map +1 -0
- package/esm/utils/lruCache.js +75 -0
- package/esm/utils/lruCache.js.map +1 -0
- package/esm/utils/makeSingleton.js +38 -0
- package/esm/utils/makeSingleton.js.map +1 -0
- package/esm/utils/promiseTimeout.js +33 -0
- package/esm/utils/promiseTimeout.js.map +1 -0
- package/esm/utils/random.js +28 -0
- package/esm/utils/random.js.map +1 -0
- package/esm/utils/removeDuplicates.js +39 -0
- package/esm/utils/removeDuplicates.js.map +1 -0
- package/esm/utils/tooltip.js +58 -0
- package/esm/utils/tooltip.js.map +1 -0
- package/esm/utils/typedMemo.js +22 -0
- package/esm/utils/typedMemo.js.map +1 -0
- package/esm/validator/index.js +28 -0
- package/esm/validator/index.js.map +1 -0
- package/esm/validator/legacyValidateInteger.js +35 -0
- package/esm/validator/legacyValidateInteger.js.map +1 -0
- package/esm/validator/legacyValidateNumber.js +32 -0
- package/esm/validator/legacyValidateNumber.js.map +1 -0
- package/esm/validator/validateInteger.js +34 -0
- package/esm/validator/validateInteger.js.map +1 -0
- package/esm/validator/validateMapboxStylesUrl.js +37 -0
- package/esm/validator/validateMapboxStylesUrl.js.map +1 -0
- package/esm/validator/validateMaxValue.js +27 -0
- package/esm/validator/validateMaxValue.js.map +1 -0
- package/esm/validator/validateNonEmpty.js +33 -0
- package/esm/validator/validateNonEmpty.js.map +1 -0
- package/esm/validator/validateNumber.js +34 -0
- package/esm/validator/validateNumber.js.map +1 -0
- package/esm/validator/validateTimeComparisonRangeValues.js +38 -0
- package/esm/validator/validateTimeComparisonRangeValues.js.map +1 -0
- package/lib/api/index.js +1 -0
- package/lib/api/types/core.d.ts +30 -0
- package/lib/api/types/core.d.ts.map +1 -0
- package/lib/api/types/core.js +19 -0
- package/lib/api/types/core.js.map +1 -0
- package/lib/chart/clients/ChartClient.d.ts +34 -0
- package/lib/chart/clients/ChartClient.d.ts.map +1 -0
- package/lib/chart/clients/ChartClient.js +119 -0
- package/lib/chart/clients/ChartClient.js.map +1 -0
- package/lib/chart/components/ChartDataProvider.d.ts +52 -0
- package/lib/chart/components/ChartDataProvider.d.ts.map +1 -0
- package/lib/chart/components/ChartDataProvider.js +171 -0
- package/lib/chart/components/ChartDataProvider.js.map +1 -0
- package/lib/chart/components/ChartDataProvider.jsx +97 -0
- package/lib/chart/components/ChartDataProvider.jsx.map +1 -0
- package/lib/chart/components/FallbackComponent.d.ts +5 -0
- package/lib/chart/components/FallbackComponent.d.ts.map +1 -0
- package/lib/chart/components/FallbackComponent.js +61 -0
- package/lib/chart/components/FallbackComponent.js.map +1 -0
- package/lib/chart/components/FallbackComponent.jsx +41 -0
- package/lib/chart/components/FallbackComponent.jsx.map +1 -0
- package/lib/chart/components/NoResultsComponent.d.ts +9 -0
- package/lib/chart/components/NoResultsComponent.d.ts.map +1 -0
- package/lib/chart/components/NoResultsComponent.js +88 -0
- package/lib/chart/components/NoResultsComponent.js.map +1 -0
- package/lib/chart/components/NoResultsComponent.jsx +57 -0
- package/lib/chart/components/NoResultsComponent.jsx.map +1 -0
- package/lib/chart/components/SuperChart.d.ts +108 -0
- package/lib/chart/components/SuperChart.d.ts.map +1 -0
- package/lib/chart/components/SuperChart.js +267 -0
- package/lib/chart/components/SuperChart.js.map +1 -0
- package/lib/chart/components/SuperChart.jsx +121 -0
- package/lib/chart/components/SuperChart.jsx.map +1 -0
- package/lib/chart/components/SuperChartCore.d.ts +59 -0
- package/lib/chart/components/SuperChartCore.d.ts.map +1 -0
- package/lib/chart/components/SuperChartCore.js +236 -0
- package/lib/chart/components/SuperChartCore.js.map +1 -0
- package/lib/chart/components/SuperChartCore.jsx +139 -0
- package/lib/chart/components/SuperChartCore.jsx.map +1 -0
- package/lib/chart/components/createLoadableRenderer.d.ts +12 -0
- package/lib/chart/components/createLoadableRenderer.d.ts.map +1 -0
- package/lib/chart/components/createLoadableRenderer.js +52 -0
- package/lib/chart/components/createLoadableRenderer.js.map +1 -0
- package/lib/chart/components/reactify.d.ts +16 -0
- package/lib/chart/components/reactify.d.ts.map +1 -0
- package/lib/chart/components/reactify.js +115 -0
- package/lib/chart/components/reactify.js.map +1 -0
- package/lib/chart/components/reactify.jsx +69 -0
- package/lib/chart/components/reactify.jsx.map +1 -0
- package/lib/chart/index.d.ts +24 -0
- package/lib/chart/index.d.ts.map +1 -0
- package/lib/chart/index.js +40 -0
- package/lib/chart/index.js.map +1 -0
- package/lib/chart/models/ChartControlPanel.d.ts +4 -0
- package/lib/chart/models/ChartControlPanel.d.ts.map +1 -0
- package/lib/chart/models/ChartControlPanel.js +20 -0
- package/lib/chart/models/ChartControlPanel.js.map +1 -0
- package/lib/chart/models/ChartMetadata.d.ts +57 -0
- package/lib/chart/models/ChartMetadata.d.ts.map +1 -0
- package/lib/chart/models/ChartMetadata.js +74 -0
- package/lib/chart/models/ChartMetadata.js.map +1 -0
- package/lib/chart/models/ChartPlugin.d.ts +44 -0
- package/lib/chart/models/ChartPlugin.d.ts.map +1 -0
- package/lib/chart/models/ChartPlugin.js +92 -0
- package/lib/chart/models/ChartPlugin.js.map +1 -0
- package/lib/chart/models/ChartProps.d.ts +99 -0
- package/lib/chart/models/ChartProps.d.ts.map +1 -0
- package/lib/chart/models/ChartProps.js +95 -0
- package/lib/chart/models/ChartProps.js.map +1 -0
- package/lib/chart/registries/ChartBuildQueryRegistrySingleton.d.ts +17 -0
- package/lib/chart/registries/ChartBuildQueryRegistrySingleton.d.ts.map +1 -0
- package/lib/chart/registries/ChartBuildQueryRegistrySingleton.js +27 -0
- package/lib/chart/registries/ChartBuildQueryRegistrySingleton.js.map +1 -0
- package/lib/chart/registries/ChartComponentRegistrySingleton.d.ts +8 -0
- package/lib/chart/registries/ChartComponentRegistrySingleton.d.ts.map +1 -0
- package/lib/chart/registries/ChartComponentRegistrySingleton.js +27 -0
- package/lib/chart/registries/ChartComponentRegistrySingleton.js.map +1 -0
- package/lib/chart/registries/ChartControlPanelRegistrySingleton.d.ts +8 -0
- package/lib/chart/registries/ChartControlPanelRegistrySingleton.d.ts.map +1 -0
- package/lib/chart/registries/ChartControlPanelRegistrySingleton.js +27 -0
- package/lib/chart/registries/ChartControlPanelRegistrySingleton.js.map +1 -0
- package/lib/chart/registries/ChartMetadataRegistrySingleton.d.ts +8 -0
- package/lib/chart/registries/ChartMetadataRegistrySingleton.d.ts.map +1 -0
- package/lib/chart/registries/ChartMetadataRegistrySingleton.js +27 -0
- package/lib/chart/registries/ChartMetadataRegistrySingleton.js.map +1 -0
- package/lib/chart/registries/ChartTransformPropsRegistrySingleton.d.ts +8 -0
- package/lib/chart/registries/ChartTransformPropsRegistrySingleton.d.ts.map +1 -0
- package/lib/chart/registries/ChartTransformPropsRegistrySingleton.js +30 -0
- package/lib/chart/registries/ChartTransformPropsRegistrySingleton.js.map +1 -0
- package/lib/chart/types/Annotation.d.ts +5 -0
- package/lib/chart/types/Annotation.d.ts.map +1 -0
- package/lib/chart/types/Annotation.js +20 -0
- package/lib/chart/types/Annotation.js.map +1 -0
- package/lib/chart/types/Base.d.ts +67 -0
- package/lib/chart/types/Base.d.ts.map +1 -0
- package/lib/chart/types/Base.js +63 -0
- package/lib/chart/types/Base.js.map +1 -0
- package/lib/chart/types/QueryResponse.d.ts +25 -0
- package/lib/chart/types/QueryResponse.d.ts.map +1 -0
- package/lib/chart/types/QueryResponse.js +20 -0
- package/lib/chart/types/QueryResponse.js.map +1 -0
- package/lib/chart/types/TransformFunction.d.ts +21 -0
- package/lib/chart/types/TransformFunction.d.ts.map +1 -0
- package/lib/chart/types/TransformFunction.js +20 -0
- package/lib/chart/types/TransformFunction.js.map +1 -0
- package/lib/chart/types/VizType.d.ts +55 -0
- package/lib/chart/types/VizType.d.ts.map +1 -0
- package/lib/chart/types/VizType.js +74 -0
- package/lib/chart/types/VizType.js.map +1 -0
- package/lib/chart-composition/ChartFrame.d.ts +19 -0
- package/lib/chart-composition/ChartFrame.d.ts.map +1 -0
- package/lib/chart-composition/ChartFrame.js +76 -0
- package/lib/chart-composition/ChartFrame.js.map +1 -0
- package/lib/chart-composition/ChartFrame.jsx +48 -0
- package/lib/chart-composition/ChartFrame.jsx.map +1 -0
- package/lib/chart-composition/index.d.ts +5 -0
- package/lib/chart-composition/index.d.ts.map +1 -0
- package/lib/chart-composition/index.js +23 -0
- package/lib/chart-composition/index.js.map +1 -0
- package/lib/chart-composition/legend/WithLegend.d.ts +35 -0
- package/lib/chart-composition/legend/WithLegend.d.ts.map +1 -0
- package/lib/chart-composition/legend/WithLegend.js +147 -0
- package/lib/chart-composition/legend/WithLegend.js.map +1 -0
- package/lib/chart-composition/legend/WithLegend.jsx +105 -0
- package/lib/chart-composition/legend/WithLegend.jsx.map +1 -0
- package/lib/chart-composition/tooltip/TooltipFrame.d.ts +16 -0
- package/lib/chart-composition/tooltip/TooltipFrame.d.ts.map +1 -0
- package/lib/chart-composition/tooltip/TooltipFrame.js +48 -0
- package/lib/chart-composition/tooltip/TooltipFrame.js.map +1 -0
- package/lib/chart-composition/tooltip/TooltipFrame.jsx +34 -0
- package/lib/chart-composition/tooltip/TooltipFrame.jsx.map +1 -0
- package/lib/chart-composition/tooltip/TooltipTable.d.ts +25 -0
- package/lib/chart-composition/tooltip/TooltipTable.d.ts.map +1 -0
- package/lib/chart-composition/tooltip/TooltipTable.js +71 -0
- package/lib/chart-composition/tooltip/TooltipTable.js.map +1 -0
- package/lib/chart-composition/tooltip/TooltipTable.jsx +43 -0
- package/lib/chart-composition/tooltip/TooltipTable.jsx.map +1 -0
- package/lib/color/CategoricalColorNamespace.d.ts +32 -0
- package/lib/color/CategoricalColorNamespace.d.ts.map +1 -0
- package/lib/color/CategoricalColorNamespace.js +91 -0
- package/lib/color/CategoricalColorNamespace.js.map +1 -0
- package/lib/color/CategoricalColorScale.d.ts +132 -0
- package/lib/color/CategoricalColorScale.d.ts.map +1 -0
- package/lib/color/CategoricalColorScale.js +255 -0
- package/lib/color/CategoricalColorScale.js.map +1 -0
- package/lib/color/CategoricalScheme.d.ts +4 -0
- package/lib/color/CategoricalScheme.d.ts.map +1 -0
- package/lib/color/CategoricalScheme.js +22 -0
- package/lib/color/CategoricalScheme.js.map +1 -0
- package/lib/color/CategoricalSchemeRegistrySingleton.d.ts +8 -0
- package/lib/color/CategoricalSchemeRegistrySingleton.d.ts.map +1 -0
- package/lib/color/CategoricalSchemeRegistrySingleton.js +30 -0
- package/lib/color/CategoricalSchemeRegistrySingleton.js.map +1 -0
- package/lib/color/ColorScheme.d.ts +19 -0
- package/lib/color/ColorScheme.d.ts.map +1 -0
- package/lib/color/ColorScheme.js +35 -0
- package/lib/color/ColorScheme.js.map +1 -0
- package/lib/color/ColorSchemeRegistry.d.ts +6 -0
- package/lib/color/ColorSchemeRegistry.d.ts.map +1 -0
- package/lib/color/ColorSchemeRegistry.js +40 -0
- package/lib/color/ColorSchemeRegistry.js.map +1 -0
- package/lib/color/LabelsColorMapSingleton.d.ts +58 -0
- package/lib/color/LabelsColorMapSingleton.d.ts.map +1 -0
- package/lib/color/LabelsColorMapSingleton.js +141 -0
- package/lib/color/LabelsColorMapSingleton.js.map +1 -0
- package/lib/color/SequentialScheme.d.ts +30 -0
- package/lib/color/SequentialScheme.d.ts.map +1 -0
- package/lib/color/SequentialScheme.js +67 -0
- package/lib/color/SequentialScheme.js.map +1 -0
- package/lib/color/SequentialSchemeRegistrySingleton.d.ts +8 -0
- package/lib/color/SequentialSchemeRegistrySingleton.d.ts.map +1 -0
- package/lib/color/SequentialSchemeRegistrySingleton.js +30 -0
- package/lib/color/SequentialSchemeRegistrySingleton.js.map +1 -0
- package/lib/color/colorSchemes/categorical/airbnb.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/airbnb.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/airbnb.js +43 -0
- package/lib/color/colorSchemes/categorical/airbnb.js.map +1 -0
- package/lib/color/colorSchemes/categorical/blueToGreen.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/blueToGreen.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/blueToGreen.js +42 -0
- package/lib/color/colorSchemes/categorical/blueToGreen.js.map +1 -0
- package/lib/color/colorSchemes/categorical/colorsOfRainbow.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/colorsOfRainbow.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/colorsOfRainbow.js +44 -0
- package/lib/color/colorSchemes/categorical/colorsOfRainbow.js.map +1 -0
- package/lib/color/colorSchemes/categorical/d3.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/d3.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/d3.js +118 -0
- package/lib/color/colorSchemes/categorical/d3.js.map +1 -0
- package/lib/color/colorSchemes/categorical/echarts.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/echarts.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/echarts.js +56 -0
- package/lib/color/colorSchemes/categorical/echarts.js.map +1 -0
- package/lib/color/colorSchemes/categorical/google.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/google.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/google.js +66 -0
- package/lib/color/colorSchemes/categorical/google.js.map +1 -0
- package/lib/color/colorSchemes/categorical/index.d.ts +14 -0
- package/lib/color/colorSchemes/categorical/index.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/index.js +32 -0
- package/lib/color/colorSchemes/categorical/index.js.map +1 -0
- package/lib/color/colorSchemes/categorical/lyft.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/lyft.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/lyft.js +40 -0
- package/lib/color/colorSchemes/categorical/lyft.js.map +1 -0
- package/lib/color/colorSchemes/categorical/modernSunset.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/modernSunset.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/modernSunset.js +44 -0
- package/lib/color/colorSchemes/categorical/modernSunset.js.map +1 -0
- package/lib/color/colorSchemes/categorical/preset.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/preset.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/preset.js +54 -0
- package/lib/color/colorSchemes/categorical/preset.js.map +1 -0
- package/lib/color/colorSchemes/categorical/presetAndSuperset.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/presetAndSuperset.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/presetAndSuperset.js +44 -0
- package/lib/color/colorSchemes/categorical/presetAndSuperset.js.map +1 -0
- package/lib/color/colorSchemes/categorical/redToYellow.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/redToYellow.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/redToYellow.js +42 -0
- package/lib/color/colorSchemes/categorical/redToYellow.js.map +1 -0
- package/lib/color/colorSchemes/categorical/superset.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/superset.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/superset.js +54 -0
- package/lib/color/colorSchemes/categorical/superset.js.map +1 -0
- package/lib/color/colorSchemes/categorical/wavesOfBlue.d.ts +4 -0
- package/lib/color/colorSchemes/categorical/wavesOfBlue.d.ts.map +1 -0
- package/lib/color/colorSchemes/categorical/wavesOfBlue.js +42 -0
- package/lib/color/colorSchemes/categorical/wavesOfBlue.js.map +1 -0
- package/lib/color/colorSchemes/index.d.ts +3 -0
- package/lib/color/colorSchemes/index.d.ts.map +1 -0
- package/lib/color/colorSchemes/index.js +21 -0
- package/lib/color/colorSchemes/index.js.map +1 -0
- package/lib/color/colorSchemes/sequential/common.d.ts +4 -0
- package/lib/color/colorSchemes/sequential/common.d.ts.map +1 -0
- package/lib/color/colorSchemes/sequential/common.js +226 -0
- package/lib/color/colorSchemes/sequential/common.js.map +1 -0
- package/lib/color/colorSchemes/sequential/d3.d.ts +4 -0
- package/lib/color/colorSchemes/sequential/d3.d.ts.map +1 -0
- package/lib/color/colorSchemes/sequential/d3.js +527 -0
- package/lib/color/colorSchemes/sequential/d3.js.map +1 -0
- package/lib/color/colorSchemes/sequential/index.d.ts +3 -0
- package/lib/color/colorSchemes/sequential/index.d.ts.map +1 -0
- package/lib/color/colorSchemes/sequential/index.js +21 -0
- package/lib/color/colorSchemes/sequential/index.js.map +1 -0
- package/lib/color/index.d.ts +18 -0
- package/lib/color/index.d.ts.map +1 -0
- package/lib/color/index.js +36 -0
- package/lib/color/index.js.map +1 -0
- package/lib/color/stringifyAndTrim.d.ts +6 -0
- package/lib/color/stringifyAndTrim.d.ts.map +1 -0
- package/lib/color/stringifyAndTrim.js +26 -0
- package/lib/color/stringifyAndTrim.js.map +1 -0
- package/lib/color/types.d.ts +18 -0
- package/lib/color/types.d.ts.map +1 -0
- package/lib/color/types.js +25 -0
- package/lib/color/types.js.map +1 -0
- package/lib/color/utils.d.ts +6 -0
- package/lib/color/utils.d.ts.map +1 -0
- package/lib/color/utils.js +113 -0
- package/lib/color/utils.js.map +1 -0
- package/lib/components/SafeMarkdown.d.ts +11 -0
- package/lib/components/SafeMarkdown.d.ts.map +1 -0
- package/lib/components/SafeMarkdown.js +90 -0
- package/lib/components/SafeMarkdown.js.map +1 -0
- package/lib/components/SafeMarkdown.jsx +57 -0
- package/lib/components/SafeMarkdown.jsx.map +1 -0
- package/lib/components/constants.d.ts +27 -0
- package/lib/components/constants.d.ts.map +1 -0
- package/lib/components/constants.js +27 -0
- package/lib/components/constants.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +21 -0
- package/lib/components/index.js.map +1 -0
- package/lib/connection/README.md +106 -0
- package/lib/connection/SupersetClient.d.ts +4 -0
- package/lib/connection/SupersetClient.d.ts.map +1 -0
- package/lib/connection/SupersetClient.js +48 -0
- package/lib/connection/SupersetClient.js.map +1 -0
- package/lib/connection/SupersetClientClass.d.ts +45 -0
- package/lib/connection/SupersetClientClass.d.ts.map +1 -0
- package/lib/connection/SupersetClientClass.js +187 -0
- package/lib/connection/SupersetClientClass.js.map +1 -0
- package/lib/connection/callApi/callApi.d.ts +11 -0
- package/lib/connection/callApi/callApi.d.ts.map +1 -0
- package/lib/connection/callApi/callApi.js +145 -0
- package/lib/connection/callApi/callApi.js.map +1 -0
- package/lib/connection/callApi/callApiAndParseWithTimeout.d.ts +6 -0
- package/lib/connection/callApi/callApiAndParseWithTimeout.d.ts.map +1 -0
- package/lib/connection/callApi/callApiAndParseWithTimeout.js +29 -0
- package/lib/connection/callApi/callApiAndParseWithTimeout.js.map +1 -0
- package/lib/connection/callApi/index.d.ts +2 -0
- package/lib/connection/callApi/index.d.ts.map +1 -0
- package/lib/connection/callApi/index.js +20 -0
- package/lib/connection/callApi/index.js.map +1 -0
- package/lib/connection/callApi/parseResponse.d.ts +3 -0
- package/lib/connection/callApi/parseResponse.d.ts.map +1 -0
- package/lib/connection/callApi/parseResponse.js +63 -0
- package/lib/connection/callApi/parseResponse.js.map +1 -0
- package/lib/connection/callApi/rejectAfterTimeout.d.ts +2 -0
- package/lib/connection/callApi/rejectAfterTimeout.d.ts.map +1 -0
- package/lib/connection/callApi/rejectAfterTimeout.js +31 -0
- package/lib/connection/callApi/rejectAfterTimeout.js.map +1 -0
- package/lib/connection/constants.d.ts +11 -0
- package/lib/connection/constants.d.ts.map +1 -0
- package/lib/connection/constants.js +34 -0
- package/lib/connection/constants.js.map +1 -0
- package/lib/connection/index.d.ts +7 -0
- package/lib/connection/index.d.ts.map +1 -0
- package/lib/connection/index.js +25 -0
- package/lib/connection/index.js.map +1 -0
- package/lib/connection/types.d.ts +132 -0
- package/lib/connection/types.d.ts.map +1 -0
- package/lib/connection/types.js +2 -0
- package/lib/connection/types.js.map +1 -0
- package/lib/currency-format/CurrencyFormatter.d.ts +40 -0
- package/lib/currency-format/CurrencyFormatter.d.ts.map +1 -0
- package/lib/currency-format/CurrencyFormatter.js +55 -0
- package/lib/currency-format/CurrencyFormatter.js.map +1 -0
- package/lib/currency-format/index.d.ts +4 -0
- package/lib/currency-format/index.d.ts.map +1 -0
- package/lib/currency-format/index.js +22 -0
- package/lib/currency-format/index.js.map +1 -0
- package/lib/currency-format/utils.d.ts +23 -0
- package/lib/currency-format/utils.d.ts.map +1 -0
- package/lib/currency-format/utils.js +61 -0
- package/lib/currency-format/utils.js.map +1 -0
- package/lib/dimension/computeMaxFontSize.d.ts +7 -0
- package/lib/dimension/computeMaxFontSize.d.ts.map +1 -0
- package/lib/dimension/computeMaxFontSize.js +64 -0
- package/lib/dimension/computeMaxFontSize.js.map +1 -0
- package/lib/dimension/getMultipleTextDimensions.d.ts +13 -0
- package/lib/dimension/getMultipleTextDimensions.d.ts.map +1 -0
- package/lib/dimension/getMultipleTextDimensions.js +67 -0
- package/lib/dimension/getMultipleTextDimensions.js.map +1 -0
- package/lib/dimension/getTextDimension.d.ts +9 -0
- package/lib/dimension/getTextDimension.d.ts.map +1 -0
- package/lib/dimension/getTextDimension.js +45 -0
- package/lib/dimension/getTextDimension.js.map +1 -0
- package/lib/dimension/index.d.ts +8 -0
- package/lib/dimension/index.d.ts.map +1 -0
- package/lib/dimension/index.js +26 -0
- package/lib/dimension/index.js.map +1 -0
- package/lib/dimension/mergeMargin.d.ts +8 -0
- package/lib/dimension/mergeMargin.d.ts.map +1 -0
- package/lib/dimension/mergeMargin.js +36 -0
- package/lib/dimension/mergeMargin.js.map +1 -0
- package/lib/dimension/parseLength.d.ts +8 -0
- package/lib/dimension/parseLength.d.ts.map +1 -0
- package/lib/dimension/parseLength.js +32 -0
- package/lib/dimension/parseLength.js.map +1 -0
- package/lib/dimension/svg/LazyFactory.d.ts +8 -0
- package/lib/dimension/svg/LazyFactory.d.ts.map +1 -0
- package/lib/dimension/svg/LazyFactory.js +47 -0
- package/lib/dimension/svg/LazyFactory.js.map +1 -0
- package/lib/dimension/svg/constants.d.ts +2 -0
- package/lib/dimension/svg/constants.d.ts.map +1 -0
- package/lib/dimension/svg/constants.js +21 -0
- package/lib/dimension/svg/constants.js.map +1 -0
- package/lib/dimension/svg/createHiddenSvgNode.d.ts +2 -0
- package/lib/dimension/svg/createHiddenSvgNode.d.ts.map +1 -0
- package/lib/dimension/svg/createHiddenSvgNode.js +31 -0
- package/lib/dimension/svg/createHiddenSvgNode.js.map +1 -0
- package/lib/dimension/svg/createTextNode.d.ts +2 -0
- package/lib/dimension/svg/createTextNode.d.ts.map +1 -0
- package/lib/dimension/svg/createTextNode.js +23 -0
- package/lib/dimension/svg/createTextNode.js.map +1 -0
- package/lib/dimension/svg/factories.d.ts +4 -0
- package/lib/dimension/svg/factories.d.ts.map +1 -0
- package/lib/dimension/svg/factories.js +24 -0
- package/lib/dimension/svg/factories.js.map +1 -0
- package/lib/dimension/svg/getBBoxCeil.d.ts +6 -0
- package/lib/dimension/svg/getBBoxCeil.d.ts.map +1 -0
- package/lib/dimension/svg/getBBoxCeil.js +27 -0
- package/lib/dimension/svg/getBBoxCeil.js.map +1 -0
- package/lib/dimension/svg/updateTextNode.d.ts +7 -0
- package/lib/dimension/svg/updateTextNode.d.ts.map +1 -0
- package/lib/dimension/svg/updateTextNode.js +50 -0
- package/lib/dimension/svg/updateTextNode.js.map +1 -0
- package/lib/dimension/types.d.ts +21 -0
- package/lib/dimension/types.d.ts.map +1 -0
- package/lib/dimension/types.js +20 -0
- package/lib/dimension/types.js.map +1 -0
- package/lib/dynamic-plugins/index.d.ts +20 -0
- package/lib/dynamic-plugins/index.d.ts.map +1 -0
- package/lib/dynamic-plugins/index.js +20 -0
- package/lib/dynamic-plugins/index.js.map +1 -0
- package/lib/dynamic-plugins/shared-modules.d.ts +46 -0
- package/lib/dynamic-plugins/shared-modules.d.ts.map +1 -0
- package/lib/dynamic-plugins/shared-modules.js +68 -0
- package/lib/dynamic-plugins/shared-modules.js.map +1 -0
- package/lib/hooks/index.d.ts +25 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +25 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useChangeEffect/index.d.ts +20 -0
- package/lib/hooks/useChangeEffect/index.d.ts.map +1 -0
- package/lib/hooks/useChangeEffect/index.js +20 -0
- package/lib/hooks/useChangeEffect/index.js.map +1 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.d.ts +25 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.d.ts.map +1 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.js +34 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.js.map +1 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.test.d.ts +2 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.test.d.ts.map +1 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.test.js +46 -0
- package/lib/hooks/useChangeEffect/useChangeEffect.test.js.map +1 -0
- package/lib/hooks/useComponentDidMount/index.d.ts +20 -0
- package/lib/hooks/useComponentDidMount/index.d.ts.map +1 -0
- package/lib/hooks/useComponentDidMount/index.js +20 -0
- package/lib/hooks/useComponentDidMount/index.js.map +1 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.d.ts +21 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.d.ts.map +1 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.js +24 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.js.map +1 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.test.d.ts +2 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.test.d.ts.map +1 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.test.js +28 -0
- package/lib/hooks/useComponentDidMount/useComponentDidMount.test.js.map +1 -0
- package/lib/hooks/useComponentDidUpdate/index.d.ts +20 -0
- package/lib/hooks/useComponentDidUpdate/index.d.ts.map +1 -0
- package/lib/hooks/useComponentDidUpdate/index.js +20 -0
- package/lib/hooks/useComponentDidUpdate/index.js.map +1 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.d.ts +21 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.d.ts.map +1 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.js +32 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.js.map +1 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.test.d.ts +2 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.test.d.ts.map +1 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.test.js +31 -0
- package/lib/hooks/useComponentDidUpdate/useComponentDidUpdate.test.js.map +1 -0
- package/lib/hooks/useElementOnScreen/index.d.ts +20 -0
- package/lib/hooks/useElementOnScreen/index.d.ts.map +1 -0
- package/lib/hooks/useElementOnScreen/index.js +20 -0
- package/lib/hooks/useElementOnScreen/index.js.map +1 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.d.ts +21 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.d.ts.map +1 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.js +41 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.js.map +1 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.test.d.ts +2 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.test.d.ts.map +1 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.test.js +85 -0
- package/lib/hooks/useElementOnScreen/useElementOnScreen.test.js.map +1 -0
- package/lib/hooks/usePrevious/index.d.ts +20 -0
- package/lib/hooks/usePrevious/index.d.ts.map +1 -0
- package/lib/hooks/usePrevious/index.js +20 -0
- package/lib/hooks/usePrevious/index.js.map +1 -0
- package/lib/hooks/usePrevious/usePrevious.d.ts +26 -0
- package/lib/hooks/usePrevious/usePrevious.d.ts.map +1 -0
- package/lib/hooks/usePrevious/usePrevious.js +28 -0
- package/lib/hooks/usePrevious/usePrevious.js.map +1 -0
- package/lib/hooks/usePrevious/usePrevious.test.d.ts +2 -0
- package/lib/hooks/usePrevious/usePrevious.test.d.ts.map +1 -0
- package/lib/hooks/usePrevious/usePrevious.test.js +40 -0
- package/lib/hooks/usePrevious/usePrevious.test.js.map +1 -0
- package/lib/hooks/useTruncation/index.d.ts +22 -0
- package/lib/hooks/useTruncation/index.d.ts.map +1 -0
- package/lib/hooks/useTruncation/index.js +22 -0
- package/lib/hooks/useTruncation/index.js.map +1 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.d.ts +33 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.d.ts.map +1 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.js +52 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.js.map +1 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.d.ts +2 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.d.ts.map +1 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.js +62 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.js.map +1 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.jsx +48 -0
- package/lib/hooks/useTruncation/useCSSTextTruncation.test.jsx.map +1 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.d.ts +12 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.d.ts.map +1 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.js +86 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.js.map +1 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.test.d.ts +2 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.test.d.ts.map +1 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.test.js +161 -0
- package/lib/hooks/useTruncation/useChildElementTruncation.test.js.map +1 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +40 -0
- package/lib/index.js.map +1 -0
- package/lib/math-expression/index.d.ts +3 -0
- package/lib/math-expression/index.d.ts.map +1 -0
- package/lib/math-expression/index.js +118 -0
- package/lib/math-expression/index.js.map +1 -0
- package/lib/models/ExtensibleFunction.d.ts +7 -0
- package/lib/models/ExtensibleFunction.d.ts.map +1 -0
- package/lib/models/ExtensibleFunction.js +29 -0
- package/lib/models/ExtensibleFunction.js.map +1 -0
- package/lib/models/Plugin.d.ts +13 -0
- package/lib/models/Plugin.d.ts.map +1 -0
- package/lib/models/Plugin.js +41 -0
- package/lib/models/Plugin.js.map +1 -0
- package/lib/models/Preset.d.ts +15 -0
- package/lib/models/Preset.d.ts.map +1 -0
- package/lib/models/Preset.js +41 -0
- package/lib/models/Preset.js.map +1 -0
- package/lib/models/Registry.d.ts +99 -0
- package/lib/models/Registry.d.ts.map +1 -0
- package/lib/models/Registry.js +191 -0
- package/lib/models/Registry.js.map +1 -0
- package/lib/models/RegistryWithDefaultKey.d.ts +20 -0
- package/lib/models/RegistryWithDefaultKey.d.ts.map +1 -0
- package/lib/models/RegistryWithDefaultKey.js +68 -0
- package/lib/models/RegistryWithDefaultKey.js.map +1 -0
- package/lib/models/TypedRegistry.d.ts +47 -0
- package/lib/models/TypedRegistry.d.ts.map +1 -0
- package/lib/models/TypedRegistry.js +55 -0
- package/lib/models/TypedRegistry.js.map +1 -0
- package/lib/models/index.d.ts +25 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/index.js +25 -0
- package/lib/models/index.js.map +1 -0
- package/lib/number-format/D3FormatConfig.d.ts +21 -0
- package/lib/number-format/D3FormatConfig.d.ts.map +1 -0
- package/lib/number-format/D3FormatConfig.js +7 -0
- package/lib/number-format/D3FormatConfig.js.map +1 -0
- package/lib/number-format/NumberFormats.d.ts +33 -0
- package/lib/number-format/NumberFormats.d.ts.map +1 -0
- package/lib/number-format/NumberFormats.js +80 -0
- package/lib/number-format/NumberFormats.js.map +1 -0
- package/lib/number-format/NumberFormatter.d.ts +43 -0
- package/lib/number-format/NumberFormatter.d.ts.map +1 -0
- package/lib/number-format/NumberFormatter.js +54 -0
- package/lib/number-format/NumberFormatter.js.map +1 -0
- package/lib/number-format/NumberFormatterRegistry.d.ts +29 -0
- package/lib/number-format/NumberFormatterRegistry.d.ts.map +1 -0
- package/lib/number-format/NumberFormatterRegistry.js +43 -0
- package/lib/number-format/NumberFormatterRegistry.js.map +1 -0
- package/lib/number-format/NumberFormatterRegistrySingleton.d.ts +26 -0
- package/lib/number-format/NumberFormatterRegistrySingleton.d.ts.map +1 -0
- package/lib/number-format/NumberFormatterRegistrySingleton.js +14 -0
- package/lib/number-format/NumberFormatterRegistrySingleton.js.map +1 -0
- package/lib/number-format/README.md +82 -0
- package/lib/number-format/factories/createD3NumberFormatter.d.ts +27 -0
- package/lib/number-format/factories/createD3NumberFormatter.d.ts.map +1 -0
- package/lib/number-format/factories/createD3NumberFormatter.js +44 -0
- package/lib/number-format/factories/createD3NumberFormatter.js.map +1 -0
- package/lib/number-format/factories/createDurationFormatter.d.ts +9 -0
- package/lib/number-format/factories/createDurationFormatter.d.ts.map +1 -0
- package/lib/number-format/factories/createDurationFormatter.js +30 -0
- package/lib/number-format/factories/createDurationFormatter.js.map +1 -0
- package/lib/number-format/factories/createMemoryFormatter.d.ts +9 -0
- package/lib/number-format/factories/createMemoryFormatter.d.ts.map +1 -0
- package/lib/number-format/factories/createMemoryFormatter.js +40 -0
- package/lib/number-format/factories/createMemoryFormatter.js.map +1 -0
- package/lib/number-format/factories/createSiAtMostNDigitFormatter.d.ts +8 -0
- package/lib/number-format/factories/createSiAtMostNDigitFormatter.d.ts.map +1 -0
- package/lib/number-format/factories/createSiAtMostNDigitFormatter.js +35 -0
- package/lib/number-format/factories/createSiAtMostNDigitFormatter.js.map +1 -0
- package/lib/number-format/factories/createSmartNumberFormatter.d.ts +8 -0
- package/lib/number-format/factories/createSmartNumberFormatter.d.ts.map +1 -0
- package/lib/number-format/factories/createSmartNumberFormatter.js +58 -0
- package/lib/number-format/factories/createSmartNumberFormatter.js.map +1 -0
- package/lib/number-format/index.d.ts +11 -0
- package/lib/number-format/index.d.ts.map +1 -0
- package/lib/number-format/index.js +29 -0
- package/lib/number-format/index.js.map +1 -0
- package/lib/number-format/types.d.ts +2 -0
- package/lib/number-format/types.d.ts.map +1 -0
- package/lib/number-format/types.js +20 -0
- package/lib/number-format/types.js.map +1 -0
- package/lib/query/DatasourceKey.d.ts +12 -0
- package/lib/query/DatasourceKey.d.ts.map +1 -0
- package/lib/query/DatasourceKey.js +39 -0
- package/lib/query/DatasourceKey.js.map +1 -0
- package/lib/query/README.md +30 -0
- package/lib/query/api/legacy/getDatasourceMetadata.d.ts +7 -0
- package/lib/query/api/legacy/getDatasourceMetadata.d.ts.map +1 -0
- package/lib/query/api/legacy/getDatasourceMetadata.js +28 -0
- package/lib/query/api/legacy/getDatasourceMetadata.js.map +1 -0
- package/lib/query/api/legacy/getFormData.d.ts +8 -0
- package/lib/query/api/legacy/getFormData.d.ts.map +1 -0
- package/lib/query/api/legacy/getFormData.js +31 -0
- package/lib/query/api/legacy/getFormData.js.map +1 -0
- package/lib/query/api/legacy/index.d.ts +5 -0
- package/lib/query/api/legacy/index.d.ts.map +1 -0
- package/lib/query/api/legacy/index.js +23 -0
- package/lib/query/api/legacy/index.js.map +1 -0
- package/lib/query/api/legacy/types.d.ts +25 -0
- package/lib/query/api/legacy/types.d.ts.map +1 -0
- package/lib/query/api/legacy/types.js +2 -0
- package/lib/query/api/legacy/types.js.map +1 -0
- package/lib/query/api/types.d.ts +24 -0
- package/lib/query/api/types.d.ts.map +1 -0
- package/lib/query/api/types.js +2 -0
- package/lib/query/api/types.js.map +1 -0
- package/lib/query/api/v1/handleError.d.ts +26 -0
- package/lib/query/api/v1/handleError.d.ts.map +1 -0
- package/lib/query/api/v1/handleError.js +97 -0
- package/lib/query/api/v1/handleError.js.map +1 -0
- package/lib/query/api/v1/index.d.ts +20 -0
- package/lib/query/api/v1/index.d.ts.map +1 -0
- package/lib/query/api/v1/index.js +30 -0
- package/lib/query/api/v1/index.js.map +1 -0
- package/lib/query/api/v1/makeApi.d.ts +40 -0
- package/lib/query/api/v1/makeApi.d.ts.map +1 -0
- package/lib/query/api/v1/makeApi.js +91 -0
- package/lib/query/api/v1/makeApi.js.map +1 -0
- package/lib/query/api/v1/types.d.ts +80 -0
- package/lib/query/api/v1/types.d.ts.map +1 -0
- package/lib/query/api/v1/types.js +54 -0
- package/lib/query/api/v1/types.js.map +1 -0
- package/lib/query/buildQueryContext.d.ts +14 -0
- package/lib/query/buildQueryContext.d.ts.map +1 -0
- package/lib/query/buildQueryContext.js +50 -0
- package/lib/query/buildQueryContext.js.map +1 -0
- package/lib/query/buildQueryObject.d.ts +11 -0
- package/lib/query/buildQueryObject.d.ts.map +1 -0
- package/lib/query/buildQueryObject.js +89 -0
- package/lib/query/buildQueryObject.js.map +1 -0
- package/lib/query/constants.d.ts +27 -0
- package/lib/query/constants.d.ts.map +1 -0
- package/lib/query/constants.js +24 -0
- package/lib/query/constants.js.map +1 -0
- package/lib/query/convertFilter.d.ts +4 -0
- package/lib/query/convertFilter.d.ts.map +1 -0
- package/lib/query/convertFilter.js +44 -0
- package/lib/query/convertFilter.js.map +1 -0
- package/lib/query/extractExtras.d.ts +16 -0
- package/lib/query/extractExtras.d.ts.map +1 -0
- package/lib/query/extractExtras.js +55 -0
- package/lib/query/extractExtras.js.map +1 -0
- package/lib/query/extractQueryFields.d.ts +11 -0
- package/lib/query/extractQueryFields.d.ts.map +1 -0
- package/lib/query/extractQueryFields.js +105 -0
- package/lib/query/extractQueryFields.js.map +1 -0
- package/lib/query/extractTimegrain.d.ts +22 -0
- package/lib/query/extractTimegrain.d.ts.map +1 -0
- package/lib/query/extractTimegrain.js +31 -0
- package/lib/query/extractTimegrain.js.map +1 -0
- package/lib/query/getClientErrorObject.d.ts +48 -0
- package/lib/query/getClientErrorObject.d.ts.map +1 -0
- package/lib/query/getClientErrorObject.js +226 -0
- package/lib/query/getClientErrorObject.js.map +1 -0
- package/lib/query/getColumnLabel.d.ts +21 -0
- package/lib/query/getColumnLabel.d.ts.map +1 -0
- package/lib/query/getColumnLabel.js +29 -0
- package/lib/query/getColumnLabel.js.map +1 -0
- package/lib/query/getMetricLabel.d.ts +3 -0
- package/lib/query/getMetricLabel.d.ts.map +1 -0
- package/lib/query/getMetricLabel.js +32 -0
- package/lib/query/getMetricLabel.js.map +1 -0
- package/lib/query/getXAxis.d.ts +23 -0
- package/lib/query/getXAxis.d.ts.map +1 -0
- package/lib/query/getXAxis.js +38 -0
- package/lib/query/getXAxis.js.map +1 -0
- package/lib/query/index.d.ts +43 -0
- package/lib/query/index.d.ts.map +1 -0
- package/lib/query/index.js +44 -0
- package/lib/query/index.js.map +1 -0
- package/lib/query/normalizeOrderBy.d.ts +3 -0
- package/lib/query/normalizeOrderBy.d.ts.map +1 -0
- package/lib/query/normalizeOrderBy.js +64 -0
- package/lib/query/normalizeOrderBy.js.map +1 -0
- package/lib/query/normalizeTimeColumn.d.ts +3 -0
- package/lib/query/normalizeTimeColumn.d.ts.map +1 -0
- package/lib/query/normalizeTimeColumn.js +62 -0
- package/lib/query/normalizeTimeColumn.js.map +1 -0
- package/lib/query/processExtraFormData.d.ts +21 -0
- package/lib/query/processExtraFormData.d.ts.map +1 -0
- package/lib/query/processExtraFormData.js +22 -0
- package/lib/query/processExtraFormData.js.map +1 -0
- package/lib/query/processFilters.d.ts +4 -0
- package/lib/query/processFilters.d.ts.map +1 -0
- package/lib/query/processFilters.js +67 -0
- package/lib/query/processFilters.js.map +1 -0
- package/lib/query/types/AdvancedAnalytics.d.ts +42 -0
- package/lib/query/types/AdvancedAnalytics.d.ts.map +1 -0
- package/lib/query/types/AdvancedAnalytics.js +35 -0
- package/lib/query/types/AdvancedAnalytics.js.map +1 -0
- package/lib/query/types/AnnotationLayer.d.ts +110 -0
- package/lib/query/types/AnnotationLayer.d.ts.map +1 -0
- package/lib/query/types/AnnotationLayer.js +68 -0
- package/lib/query/types/AnnotationLayer.js.map +1 -0
- package/lib/query/types/Column.d.ts +61 -0
- package/lib/query/types/Column.d.ts.map +1 -0
- package/lib/query/types/Column.js +33 -0
- package/lib/query/types/Column.js.map +1 -0
- package/lib/query/types/Dashboard.d.ts +120 -0
- package/lib/query/types/Dashboard.d.ts.map +1 -0
- package/lib/query/types/Dashboard.js +48 -0
- package/lib/query/types/Dashboard.js.map +1 -0
- package/lib/query/types/Datasource.d.ts +55 -0
- package/lib/query/types/Datasource.d.ts.map +1 -0
- package/lib/query/types/Datasource.js +16 -0
- package/lib/query/types/Datasource.js.map +1 -0
- package/lib/query/types/Filter.d.ts +35 -0
- package/lib/query/types/Filter.d.ts.map +1 -0
- package/lib/query/types/Filter.js +38 -0
- package/lib/query/types/Filter.js.map +1 -0
- package/lib/query/types/Metric.d.ts +68 -0
- package/lib/query/types/Metric.d.ts.map +1 -0
- package/lib/query/types/Metric.js +16 -0
- package/lib/query/types/Metric.js.map +1 -0
- package/lib/query/types/Operator.d.ts +17 -0
- package/lib/query/types/Operator.d.ts.map +1 -0
- package/lib/query/types/Operator.js +52 -0
- package/lib/query/types/Operator.js.map +1 -0
- package/lib/query/types/PostProcessing.d.ts +208 -0
- package/lib/query/types/PostProcessing.d.ts.map +1 -0
- package/lib/query/types/PostProcessing.js +51 -0
- package/lib/query/types/PostProcessing.js.map +1 -0
- package/lib/query/types/Query.d.ts +384 -0
- package/lib/query/types/Query.d.ts.map +1 -0
- package/lib/query/types/Query.js +233 -0
- package/lib/query/types/Query.js.map +1 -0
- package/lib/query/types/QueryFormData.d.ts +168 -0
- package/lib/query/types/QueryFormData.d.ts.map +1 -0
- package/lib/query/types/QueryFormData.js +29 -0
- package/lib/query/types/QueryFormData.js.map +1 -0
- package/lib/query/types/QueryResponse.d.ts +83 -0
- package/lib/query/types/QueryResponse.d.ts.map +1 -0
- package/lib/query/types/QueryResponse.js +30 -0
- package/lib/query/types/QueryResponse.js.map +1 -0
- package/lib/query/types/Time.d.ts +12 -0
- package/lib/query/types/Time.d.ts.map +1 -0
- package/lib/query/types/Time.js +20 -0
- package/lib/query/types/Time.js.map +1 -0
- package/lib/query/types/index.d.ts +42 -0
- package/lib/query/types/index.d.ts.map +1 -0
- package/lib/query/types/index.js +41 -0
- package/lib/query/types/index.js.map +1 -0
- package/lib/style/index.d.ts +236 -0
- package/lib/style/index.d.ts.map +1 -0
- package/lib/style/index.js +174 -0
- package/lib/style/index.js.map +1 -0
- package/lib/style/index.jsx +148 -0
- package/lib/style/index.jsx.map +1 -0
- package/lib/time-comparison/README.md +47 -0
- package/lib/time-comparison/customTimeRangeDecode.d.ts +22 -0
- package/lib/time-comparison/customTimeRangeDecode.d.ts.map +1 -0
- package/lib/time-comparison/customTimeRangeDecode.js +135 -0
- package/lib/time-comparison/customTimeRangeDecode.js.map +1 -0
- package/lib/time-comparison/fetchTimeRange.d.ts +12 -0
- package/lib/time-comparison/fetchTimeRange.d.ts.map +1 -0
- package/lib/time-comparison/fetchTimeRange.js +74 -0
- package/lib/time-comparison/fetchTimeRange.js.map +1 -0
- package/lib/time-comparison/getComparisonFilters.d.ts +31 -0
- package/lib/time-comparison/getComparisonFilters.d.ts.map +1 -0
- package/lib/time-comparison/getComparisonFilters.js +47 -0
- package/lib/time-comparison/getComparisonFilters.js.map +1 -0
- package/lib/time-comparison/getComparisonInfo.d.ts +31 -0
- package/lib/time-comparison/getComparisonInfo.d.ts.map +1 -0
- package/lib/time-comparison/getComparisonInfo.js +56 -0
- package/lib/time-comparison/getComparisonInfo.js.map +1 -0
- package/lib/time-comparison/getTimeOffset.d.ts +11 -0
- package/lib/time-comparison/getTimeOffset.d.ts.map +1 -0
- package/lib/time-comparison/getTimeOffset.js +266 -0
- package/lib/time-comparison/getTimeOffset.js.map +1 -0
- package/lib/time-comparison/index.d.ts +7 -0
- package/lib/time-comparison/index.d.ts.map +1 -0
- package/lib/time-comparison/index.js +25 -0
- package/lib/time-comparison/index.js.map +1 -0
- package/lib/time-comparison/types.d.ts +30 -0
- package/lib/time-comparison/types.d.ts.map +1 -0
- package/lib/time-comparison/types.js +30 -0
- package/lib/time-comparison/types.js.map +1 -0
- package/lib/time-format/D3FormatConfig.d.ts +21 -0
- package/lib/time-format/D3FormatConfig.d.ts.map +1 -0
- package/lib/time-format/D3FormatConfig.js +63 -0
- package/lib/time-format/D3FormatConfig.js.map +1 -0
- package/lib/time-format/README.md +68 -0
- package/lib/time-format/TimeFormats.d.ts +11 -0
- package/lib/time-format/TimeFormats.d.ts.map +1 -0
- package/lib/time-format/TimeFormats.js +35 -0
- package/lib/time-format/TimeFormats.js.map +1 -0
- package/lib/time-format/TimeFormatsForGranularity.d.ts +7 -0
- package/lib/time-format/TimeFormatsForGranularity.d.ts.map +1 -0
- package/lib/time-format/TimeFormatsForGranularity.js +46 -0
- package/lib/time-format/TimeFormatsForGranularity.js.map +1 -0
- package/lib/time-format/TimeFormatter.d.ts +42 -0
- package/lib/time-format/TimeFormatter.d.ts.map +1 -0
- package/lib/time-format/TimeFormatter.js +46 -0
- package/lib/time-format/TimeFormatter.js.map +1 -0
- package/lib/time-format/TimeFormatterRegistry.d.ts +29 -0
- package/lib/time-format/TimeFormatterRegistry.d.ts.map +1 -0
- package/lib/time-format/TimeFormatterRegistry.js +60 -0
- package/lib/time-format/TimeFormatterRegistry.js.map +1 -0
- package/lib/time-format/TimeFormatterRegistrySingleton.d.ts +17 -0
- package/lib/time-format/TimeFormatterRegistrySingleton.d.ts.map +1 -0
- package/lib/time-format/TimeFormatterRegistrySingleton.js +65 -0
- package/lib/time-format/TimeFormatterRegistrySingleton.js.map +1 -0
- package/lib/time-format/TimeRangeFormatter.d.ts +40 -0
- package/lib/time-format/TimeRangeFormatter.d.ts.map +1 -0
- package/lib/time-format/TimeRangeFormatter.js +40 -0
- package/lib/time-format/TimeRangeFormatter.js.map +1 -0
- package/lib/time-format/factories/createD3TimeFormatter.d.ts +28 -0
- package/lib/time-format/factories/createD3TimeFormatter.d.ts.map +1 -0
- package/lib/time-format/factories/createD3TimeFormatter.js +45 -0
- package/lib/time-format/factories/createD3TimeFormatter.js.map +1 -0
- package/lib/time-format/factories/createMultiFormatter.d.ts +22 -0
- package/lib/time-format/factories/createMultiFormatter.d.ts.map +1 -0
- package/lib/time-format/factories/createMultiFormatter.js +70 -0
- package/lib/time-format/factories/createMultiFormatter.js.map +1 -0
- package/lib/time-format/formatters/finestTemporalGrain.d.ts +3 -0
- package/lib/time-format/formatters/finestTemporalGrain.d.ts.map +1 -0
- package/lib/time-format/formatters/finestTemporalGrain.js +64 -0
- package/lib/time-format/formatters/finestTemporalGrain.js.map +1 -0
- package/lib/time-format/formatters/finestTemporalGrain.test.d.ts +2 -0
- package/lib/time-format/formatters/finestTemporalGrain.test.d.ts.map +1 -0
- package/lib/time-format/formatters/finestTemporalGrain.test.js +44 -0
- package/lib/time-format/formatters/finestTemporalGrain.test.js.map +1 -0
- package/lib/time-format/formatters/smartDate.d.ts +4 -0
- package/lib/time-format/formatters/smartDate.d.ts.map +1 -0
- package/lib/time-format/formatters/smartDate.js +38 -0
- package/lib/time-format/formatters/smartDate.js.map +1 -0
- package/lib/time-format/formatters/smartDateDetailed.d.ts +4 -0
- package/lib/time-format/formatters/smartDateDetailed.d.ts.map +1 -0
- package/lib/time-format/formatters/smartDateDetailed.js +38 -0
- package/lib/time-format/formatters/smartDateDetailed.js.map +1 -0
- package/lib/time-format/formatters/smartDateVerbose.d.ts +4 -0
- package/lib/time-format/formatters/smartDateVerbose.d.ts.map +1 -0
- package/lib/time-format/formatters/smartDateVerbose.js +38 -0
- package/lib/time-format/formatters/smartDateVerbose.js.map +1 -0
- package/lib/time-format/index.d.ts +14 -0
- package/lib/time-format/index.d.ts.map +1 -0
- package/lib/time-format/index.js +32 -0
- package/lib/time-format/index.js.map +1 -0
- package/lib/time-format/types.d.ts +28 -0
- package/lib/time-format/types.d.ts.map +1 -0
- package/lib/time-format/types.js +41 -0
- package/lib/time-format/types.js.map +1 -0
- package/lib/time-format/utils/createTime.d.ts +2 -0
- package/lib/time-format/utils/createTime.d.ts.map +1 -0
- package/lib/time-format/utils/createTime.js +31 -0
- package/lib/time-format/utils/createTime.js.map +1 -0
- package/lib/time-format/utils/createTimeRangeFromGranularity.d.ts +3 -0
- package/lib/time-format/utils/createTimeRangeFromGranularity.d.ts.map +1 -0
- package/lib/time-format/utils/createTimeRangeFromGranularity.js +83 -0
- package/lib/time-format/utils/createTimeRangeFromGranularity.js.map +1 -0
- package/lib/time-format/utils/d3Time.d.ts +63 -0
- package/lib/time-format/utils/d3Time.d.ts.map +1 -0
- package/lib/time-format/utils/d3Time.js +101 -0
- package/lib/time-format/utils/d3Time.js.map +1 -0
- package/lib/time-format/utils/denormalizeTimestamp.d.ts +2 -0
- package/lib/time-format/utils/denormalizeTimestamp.d.ts.map +1 -0
- package/lib/time-format/utils/denormalizeTimestamp.js +27 -0
- package/lib/time-format/utils/denormalizeTimestamp.js.map +1 -0
- package/lib/time-format/utils/normalizeTimestamp.d.ts +3 -0
- package/lib/time-format/utils/normalizeTimestamp.d.ts.map +1 -0
- package/lib/time-format/utils/normalizeTimestamp.js +27 -0
- package/lib/time-format/utils/normalizeTimestamp.js.map +1 -0
- package/lib/time-format/utils/stringifyTimeInput.d.ts +2 -0
- package/lib/time-format/utils/stringifyTimeInput.d.ts.map +1 -0
- package/lib/time-format/utils/stringifyTimeInput.js +25 -0
- package/lib/time-format/utils/stringifyTimeInput.js.map +1 -0
- package/lib/translation/README.md +71 -0
- package/lib/translation/Translator.d.ts +18 -0
- package/lib/translation/Translator.d.ts.map +1 -0
- package/lib/translation/Translator.js +89 -0
- package/lib/translation/Translator.js.map +1 -0
- package/lib/translation/TranslatorSingleton.d.ts +11 -0
- package/lib/translation/TranslatorSingleton.d.ts.map +1 -0
- package/lib/translation/TranslatorSingleton.js +59 -0
- package/lib/translation/TranslatorSingleton.js.map +1 -0
- package/lib/translation/index.d.ts +6 -0
- package/lib/translation/index.d.ts.map +1 -0
- package/lib/translation/index.js +23 -0
- package/lib/translation/index.js.map +1 -0
- package/lib/translation/types/index.d.ts +55 -0
- package/lib/translation/types/index.d.ts.map +1 -0
- package/lib/translation/types/index.js +4 -0
- package/lib/translation/types/index.js.map +1 -0
- package/lib/translation/types/jed.d.ts +31 -0
- package/lib/translation/types/jed.d.ts.map +1 -0
- package/lib/translation/types/jed.js +20 -0
- package/lib/translation/types/jed.js.map +1 -0
- package/lib/types/index.d.ts +26 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/ui-overrides/ExtensionsRegistry.d.ts +30 -0
- package/lib/ui-overrides/ExtensionsRegistry.d.ts.map +1 -0
- package/lib/ui-overrides/ExtensionsRegistry.js +29 -0
- package/lib/ui-overrides/ExtensionsRegistry.js.map +1 -0
- package/lib/ui-overrides/index.d.ts +21 -0
- package/lib/ui-overrides/index.d.ts.map +1 -0
- package/lib/ui-overrides/index.js +21 -0
- package/lib/ui-overrides/index.js.map +1 -0
- package/lib/ui-overrides/index.jsx +21 -0
- package/lib/ui-overrides/index.jsx.map +1 -0
- package/lib/ui-overrides/types.d.ts +192 -0
- package/lib/ui-overrides/types.d.ts.map +1 -0
- package/lib/ui-overrides/types.js +2 -0
- package/lib/ui-overrides/types.js.map +1 -0
- package/lib/utils/convertKeysToCamelCase.d.ts +2 -0
- package/lib/utils/convertKeysToCamelCase.d.ts.map +1 -0
- package/lib/utils/convertKeysToCamelCase.js +30 -0
- package/lib/utils/convertKeysToCamelCase.js.map +1 -0
- package/lib/utils/ensureIsArray.d.ts +24 -0
- package/lib/utils/ensureIsArray.d.ts.map +1 -0
- package/lib/utils/ensureIsArray.js +29 -0
- package/lib/utils/ensureIsArray.js.map +1 -0
- package/lib/utils/ensureIsInt.d.ts +20 -0
- package/lib/utils/ensureIsInt.d.ts.map +1 -0
- package/lib/utils/ensureIsInt.js +24 -0
- package/lib/utils/ensureIsInt.js.map +1 -0
- package/lib/utils/featureFlags.d.ts +66 -0
- package/lib/utils/featureFlags.d.ts.map +1 -0
- package/lib/utils/featureFlags.js +80 -0
- package/lib/utils/featureFlags.js.map +1 -0
- package/lib/utils/getSelectedText.d.ts +20 -0
- package/lib/utils/getSelectedText.d.ts.map +1 -0
- package/lib/utils/getSelectedText.js +20 -0
- package/lib/utils/getSelectedText.js.map +1 -0
- package/lib/utils/html.d.ts +12 -0
- package/lib/utils/html.d.ts.map +1 -0
- package/lib/utils/html.js +122 -0
- package/lib/utils/html.js.map +1 -0
- package/lib/utils/html.jsx +96 -0
- package/lib/utils/html.jsx.map +1 -0
- package/lib/utils/html.test.d.ts +2 -0
- package/lib/utils/html.test.d.ts.map +1 -0
- package/lib/utils/html.test.js +192 -0
- package/lib/utils/html.test.js.map +1 -0
- package/lib/utils/html.test.jsx +152 -0
- package/lib/utils/html.test.jsx.map +1 -0
- package/lib/utils/index.d.ts +36 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +36 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/isDefined.d.ts +2 -0
- package/lib/utils/isDefined.d.ts.map +1 -0
- package/lib/utils/isDefined.js +22 -0
- package/lib/utils/isDefined.js.map +1 -0
- package/lib/utils/isEqualArray.d.ts +20 -0
- package/lib/utils/isEqualArray.d.ts.map +1 -0
- package/lib/utils/isEqualArray.js +27 -0
- package/lib/utils/isEqualArray.js.map +1 -0
- package/lib/utils/isEqualArray.test.d.ts +2 -0
- package/lib/utils/isEqualArray.test.d.ts.map +1 -0
- package/lib/utils/isEqualArray.test.js +31 -0
- package/lib/utils/isEqualArray.test.js.map +1 -0
- package/lib/utils/isRequired.d.ts +2 -0
- package/lib/utils/isRequired.d.ts.map +1 -0
- package/lib/utils/isRequired.js +22 -0
- package/lib/utils/isRequired.js.map +1 -0
- package/lib/utils/logging.d.ts +55 -0
- package/lib/utils/logging.d.ts.map +1 -0
- package/lib/utils/logging.js +36 -0
- package/lib/utils/logging.js.map +1 -0
- package/lib/utils/lruCache.d.ts +31 -0
- package/lib/utils/lruCache.d.ts.map +1 -0
- package/lib/utils/lruCache.js +65 -0
- package/lib/utils/lruCache.js.map +1 -0
- package/lib/utils/makeSingleton.d.ts +6 -0
- package/lib/utils/makeSingleton.d.ts.map +1 -0
- package/lib/utils/makeSingleton.js +28 -0
- package/lib/utils/makeSingleton.js.map +1 -0
- package/lib/utils/promiseTimeout.d.ts +7 -0
- package/lib/utils/promiseTimeout.d.ts.map +1 -0
- package/lib/utils/promiseTimeout.js +31 -0
- package/lib/utils/promiseTimeout.js.map +1 -0
- package/lib/utils/random.d.ts +22 -0
- package/lib/utils/random.d.ts.map +1 -0
- package/lib/utils/random.js +26 -0
- package/lib/utils/random.js.map +1 -0
- package/lib/utils/removeDuplicates.d.ts +24 -0
- package/lib/utils/removeDuplicates.d.ts.map +1 -0
- package/lib/utils/removeDuplicates.js +36 -0
- package/lib/utils/removeDuplicates.js.map +1 -0
- package/lib/utils/tooltip.d.ts +2 -0
- package/lib/utils/tooltip.d.ts.map +1 -0
- package/lib/utils/tooltip.js +51 -0
- package/lib/utils/tooltip.js.map +1 -0
- package/lib/utils/typedMemo.d.ts +2 -0
- package/lib/utils/typedMemo.d.ts.map +1 -0
- package/lib/utils/typedMemo.js +21 -0
- package/lib/utils/typedMemo.js.map +1 -0
- package/lib/validator/index.d.ts +9 -0
- package/lib/validator/index.d.ts.map +1 -0
- package/lib/validator/index.js +27 -0
- package/lib/validator/index.js.map +1 -0
- package/lib/validator/legacyValidateInteger.d.ts +6 -0
- package/lib/validator/legacyValidateInteger.d.ts.map +1 -0
- package/lib/validator/legacyValidateInteger.js +31 -0
- package/lib/validator/legacyValidateInteger.js.map +1 -0
- package/lib/validator/legacyValidateNumber.d.ts +6 -0
- package/lib/validator/legacyValidateNumber.d.ts.map +1 -0
- package/lib/validator/legacyValidateNumber.js +30 -0
- package/lib/validator/legacyValidateNumber.js.map +1 -0
- package/lib/validator/validateInteger.d.ts +2 -0
- package/lib/validator/validateInteger.d.ts.map +1 -0
- package/lib/validator/validateInteger.js +29 -0
- package/lib/validator/validateInteger.js.map +1 -0
- package/lib/validator/validateMapboxStylesUrl.d.ts +6 -0
- package/lib/validator/validateMapboxStylesUrl.d.ts.map +1 -0
- package/lib/validator/validateMapboxStylesUrl.js +32 -0
- package/lib/validator/validateMapboxStylesUrl.js.map +1 -0
- package/lib/validator/validateMaxValue.d.ts +2 -0
- package/lib/validator/validateMaxValue.d.ts.map +1 -0
- package/lib/validator/validateMaxValue.js +26 -0
- package/lib/validator/validateMaxValue.js.map +1 -0
- package/lib/validator/validateNonEmpty.d.ts +2 -0
- package/lib/validator/validateNonEmpty.d.ts.map +1 -0
- package/lib/validator/validateNonEmpty.js +29 -0
- package/lib/validator/validateNonEmpty.js.map +1 -0
- package/lib/validator/validateNumber.d.ts +2 -0
- package/lib/validator/validateNumber.d.ts.map +1 -0
- package/lib/validator/validateNumber.js +29 -0
- package/lib/validator/validateNumber.js.map +1 -0
- package/lib/validator/validateTimeComparisonRangeValues.d.ts +3 -0
- package/lib/validator/validateTimeComparisonRangeValues.d.ts.map +1 -0
- package/lib/validator/validateTimeComparisonRangeValues.js +30 -0
- package/lib/validator/validateTimeComparisonRangeValues.js.map +1 -0
- package/package.json +101 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import __cjs_default_react_27 from 'react'; const { useEffect, useRef, useState } = __cjs_default_react_27;;
|
|
20
|
+
|
|
21
|
+
export function useElementOnScreen(
|
|
22
|
+
options)
|
|
23
|
+
{
|
|
24
|
+
const containerRef = useRef(null);
|
|
25
|
+
const [isSticky, setIsSticky] = useState(false);
|
|
26
|
+
|
|
27
|
+
const callback = (entries) => {
|
|
28
|
+
const [entry] = entries;
|
|
29
|
+
setIsSticky(entry.intersectionRatio < 1);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const observer = new IntersectionObserver(callback, options);
|
|
34
|
+
const element = containerRef.current;
|
|
35
|
+
if (element) {
|
|
36
|
+
observer.observe(element);
|
|
37
|
+
}
|
|
38
|
+
return () => {
|
|
39
|
+
if (element) {
|
|
40
|
+
observer.unobserve(element);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [containerRef, options]);
|
|
44
|
+
|
|
45
|
+
return [containerRef, isSticky];
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=useElementOnScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useElementOnScreen.js","names":["useEffect","useRef","useState","useElementOnScreen","options","containerRef","isSticky","setIsSticky","callback","entries","entry","intersectionRatio","observer","IntersectionObserver","element","current","observe","unobserve"],"sources":["../../../src/hooks/useElementOnScreen/useElementOnScreen.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { useEffect, useRef, useState, RefObject } from 'react';\n\nexport function useElementOnScreen<T extends Element>(\n options: IntersectionObserverInit,\n): [RefObject<T>, boolean] {\n const containerRef = useRef<T>(null);\n const [isSticky, setIsSticky] = useState(false);\n\n const callback = (entries: IntersectionObserverEntry[]) => {\n const [entry] = entries;\n setIsSticky(entry.intersectionRatio < 1);\n };\n\n useEffect(() => {\n const observer = new IntersectionObserver(callback, options);\n const element = containerRef.current;\n if (element) {\n observer.observe(element);\n }\n return () => {\n if (element) {\n observer.unobserve(element);\n }\n };\n }, [containerRef, options]);\n\n return [containerRef, isSticky];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAmB,OAAO;;AAE9D,OAAO,SAASC,kBAAkBA;AAChCC,OAAiC;AACR;EACzB,MAAMC,YAAY,GAAGJ,MAAM,CAAI,IAAI,CAAC;EACpC,MAAM,CAACK,QAAQ,EAAEC,WAAW,CAAC,GAAGL,QAAQ,CAAC,KAAK,CAAC;;EAE/C,MAAMM,QAAQ,GAAGA,CAACC,OAAoC,KAAK;IACzD,MAAM,CAACC,KAAK,CAAC,GAAGD,OAAO;IACvBF,WAAW,CAACG,KAAK,CAACC,iBAAiB,GAAG,CAAC,CAAC;EAC1C,CAAC;;EAEDX,SAAS,CAAC,MAAM;IACd,MAAMY,QAAQ,GAAG,IAAIC,oBAAoB,CAACL,QAAQ,EAAEJ,OAAO,CAAC;IAC5D,MAAMU,OAAO,GAAGT,YAAY,CAACU,OAAO;IACpC,IAAID,OAAO,EAAE;MACXF,QAAQ,CAACI,OAAO,CAACF,OAAO,CAAC;IAC3B;IACA,OAAO,MAAM;MACX,IAAIA,OAAO,EAAE;QACXF,QAAQ,CAACK,SAAS,CAACH,OAAO,CAAC;MAC7B;IACF,CAAC;EACH,CAAC,EAAE,CAACT,YAAY,EAAED,OAAO,CAAC,CAAC;;EAE3B,OAAO,CAACC,YAAY,EAAEC,QAAQ,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
20
|
+
import { useElementOnScreen } from './useElementOnScreen.js';
|
|
21
|
+
|
|
22
|
+
const observeMock = jest.fn();
|
|
23
|
+
const unobserveMock = jest.fn();
|
|
24
|
+
const IntersectionObserverMock = jest.fn();
|
|
25
|
+
IntersectionObserverMock.prototype.observe = observeMock;
|
|
26
|
+
IntersectionObserverMock.prototype.unobserve = unobserveMock;
|
|
27
|
+
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
window.IntersectionObserver = IntersectionObserverMock;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
IntersectionObserverMock.mockClear();
|
|
34
|
+
jest.clearAllMocks();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('should return null and false on first render', () => {
|
|
38
|
+
const hook = renderHook(() =>
|
|
39
|
+
useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' })
|
|
40
|
+
);
|
|
41
|
+
expect(hook.result.current).toEqual([{ current: null }, false]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('should return isSticky as true when intersectionRatio < 1', async () => {
|
|
45
|
+
const hook = renderHook(() =>
|
|
46
|
+
useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' })
|
|
47
|
+
);
|
|
48
|
+
const callback = IntersectionObserverMock.mock.calls[0][0];
|
|
49
|
+
const callBack = callback([{ isIntersecting: true, intersectionRatio: 0.5 }]);
|
|
50
|
+
const observer = new IntersectionObserverMock(callBack, {});
|
|
51
|
+
const newDiv = document.createElement('div');
|
|
52
|
+
observer.observe(newDiv);
|
|
53
|
+
expect(hook.result.current[1]).toEqual(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('should return isSticky as false when intersectionRatio >= 1', async () => {
|
|
57
|
+
const hook = renderHook(() =>
|
|
58
|
+
useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' })
|
|
59
|
+
);
|
|
60
|
+
const callback = IntersectionObserverMock.mock.calls[0][0];
|
|
61
|
+
const callBack = callback([{ isIntersecting: true, intersectionRatio: 1 }]);
|
|
62
|
+
const observer = new IntersectionObserverMock(callBack, {});
|
|
63
|
+
const newDiv = document.createElement('div');
|
|
64
|
+
observer.observe(newDiv);
|
|
65
|
+
expect(hook.result.current[1]).toEqual(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('should observe and unobserve element with IntersectionObserver', async () => {
|
|
69
|
+
jest.spyOn(global.React, 'useRef').mockReturnValue({ current: 'test' });
|
|
70
|
+
const options = { threshold: 0.5 };
|
|
71
|
+
const { result, unmount } = renderHook(() => useElementOnScreen(options));
|
|
72
|
+
const [elementRef] = result.current;
|
|
73
|
+
|
|
74
|
+
expect(IntersectionObserverMock).toHaveBeenCalledWith(
|
|
75
|
+
expect.any(Function),
|
|
76
|
+
options
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
expect(elementRef).not.toBe(null);
|
|
80
|
+
expect(observeMock).toHaveBeenCalledWith(elementRef.current);
|
|
81
|
+
|
|
82
|
+
unmount();
|
|
83
|
+
|
|
84
|
+
expect(unobserveMock).toHaveBeenCalledWith(elementRef.current);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('should not observe an element if it is null', () => {
|
|
88
|
+
jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null });
|
|
89
|
+
const options = {};
|
|
90
|
+
const { result } = renderHook(() => useElementOnScreen(options));
|
|
91
|
+
const [ref, isSticky] = result.current;
|
|
92
|
+
expect(ref.current).toBe(null);
|
|
93
|
+
expect(isSticky).toBe(false);
|
|
94
|
+
|
|
95
|
+
expect(observeMock).not.toHaveBeenCalled();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('should not unobserve the element if it is null', () => {
|
|
99
|
+
jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null });
|
|
100
|
+
const options = {};
|
|
101
|
+
const { result, unmount } = renderHook(() => useElementOnScreen(options));
|
|
102
|
+
const [ref, isSticky] = result.current;
|
|
103
|
+
|
|
104
|
+
expect(ref.current).toBe(null);
|
|
105
|
+
expect(isSticky).toBe(false);
|
|
106
|
+
|
|
107
|
+
unmount();
|
|
108
|
+
|
|
109
|
+
expect(unobserveMock).not.toHaveBeenCalled();
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=useElementOnScreen.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useElementOnScreen.test.js","names":["renderHook","useElementOnScreen","observeMock","jest","fn","unobserveMock","IntersectionObserverMock","prototype","observe","unobserve","beforeEach","window","IntersectionObserver","afterEach","mockClear","clearAllMocks","test","hook","rootMargin","expect","result","current","toEqual","callback","mock","calls","callBack","isIntersecting","intersectionRatio","observer","newDiv","document","createElement","spyOn","global","React","mockReturnValue","options","threshold","unmount","elementRef","toHaveBeenCalledWith","any","Function","not","toBe","ref","isSticky","toHaveBeenCalled"],"sources":["../../../src/hooks/useElementOnScreen/useElementOnScreen.test.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { renderHook } from '@testing-library/react-hooks';\nimport { useElementOnScreen } from './useElementOnScreen';\n\nconst observeMock = jest.fn();\nconst unobserveMock = jest.fn();\nconst IntersectionObserverMock = jest.fn();\nIntersectionObserverMock.prototype.observe = observeMock;\nIntersectionObserverMock.prototype.unobserve = unobserveMock;\n\nbeforeEach(() => {\n window.IntersectionObserver = IntersectionObserverMock;\n});\n\nafterEach(() => {\n IntersectionObserverMock.mockClear();\n jest.clearAllMocks();\n});\n\ntest('should return null and false on first render', () => {\n const hook = renderHook(() =>\n useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' }),\n );\n expect(hook.result.current).toEqual([{ current: null }, false]);\n});\n\ntest('should return isSticky as true when intersectionRatio < 1', async () => {\n const hook = renderHook(() =>\n useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' }),\n );\n const callback = IntersectionObserverMock.mock.calls[0][0];\n const callBack = callback([{ isIntersecting: true, intersectionRatio: 0.5 }]);\n const observer = new IntersectionObserverMock(callBack, {});\n const newDiv = document.createElement('div');\n observer.observe(newDiv);\n expect(hook.result.current[1]).toEqual(true);\n});\n\ntest('should return isSticky as false when intersectionRatio >= 1', async () => {\n const hook = renderHook(() =>\n useElementOnScreen({ rootMargin: '-50px 0px 0px 0px' }),\n );\n const callback = IntersectionObserverMock.mock.calls[0][0];\n const callBack = callback([{ isIntersecting: true, intersectionRatio: 1 }]);\n const observer = new IntersectionObserverMock(callBack, {});\n const newDiv = document.createElement('div');\n observer.observe(newDiv);\n expect(hook.result.current[1]).toEqual(false);\n});\n\ntest('should observe and unobserve element with IntersectionObserver', async () => {\n jest.spyOn(global.React, 'useRef').mockReturnValue({ current: 'test' });\n const options = { threshold: 0.5 };\n const { result, unmount } = renderHook(() => useElementOnScreen(options));\n const [elementRef] = result.current;\n\n expect(IntersectionObserverMock).toHaveBeenCalledWith(\n expect.any(Function),\n options,\n );\n\n expect(elementRef).not.toBe(null);\n expect(observeMock).toHaveBeenCalledWith(elementRef.current);\n\n unmount();\n\n expect(unobserveMock).toHaveBeenCalledWith(elementRef.current);\n});\n\ntest('should not observe an element if it is null', () => {\n jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null });\n const options = {};\n const { result } = renderHook(() => useElementOnScreen(options));\n const [ref, isSticky] = result.current;\n expect(ref.current).toBe(null);\n expect(isSticky).toBe(false);\n\n expect(observeMock).not.toHaveBeenCalled();\n});\n\ntest('should not unobserve the element if it is null', () => {\n jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null });\n const options = {};\n const { result, unmount } = renderHook(() => useElementOnScreen(options));\n const [ref, isSticky] = result.current;\n\n expect(ref.current).toBe(null);\n expect(isSticky).toBe(false);\n\n unmount();\n\n expect(unobserveMock).not.toHaveBeenCalled();\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,8BAA8B;AACzD,SAASC,kBAAkB,QAAQ,sBAAsB;;AAEzD,MAAMC,WAAW,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;AAC7B,MAAMC,aAAa,GAAGF,IAAI,CAACC,EAAE,CAAC,CAAC;AAC/B,MAAME,wBAAwB,GAAGH,IAAI,CAACC,EAAE,CAAC,CAAC;AAC1CE,wBAAwB,CAACC,SAAS,CAACC,OAAO,GAAGN,WAAW;AACxDI,wBAAwB,CAACC,SAAS,CAACE,SAAS,GAAGJ,aAAa;;AAE5DK,UAAU,CAAC,MAAM;EACfC,MAAM,CAACC,oBAAoB,GAAGN,wBAAwB;AACxD,CAAC,CAAC;;AAEFO,SAAS,CAAC,MAAM;EACdP,wBAAwB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AAC;EAC9B1B,MAAM,CAAC4B,QAAQ,CAAC,CAACF,IAAI,CAAC,KAAK,CAAC;;EAE5BN,OAAO,CAAC,CAAC;;EAETpB,MAAM,CAACd,aAAa,CAAC,CAACuC,GAAG,CAACI,gBAAgB,CAAC,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export * from './usePrevious.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/usePrevious/index.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport * from './usePrevious';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import __cjs_default_react_28 from 'react'; const { useEffect, useRef } = __cjs_default_react_28;;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Pass in a piece of state.
|
|
24
|
+
* This hook returns what the value of that state was in the previous render.
|
|
25
|
+
* Returns undefined (or whatever value you specify) the first time.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export function usePrevious(value, initialValue) {
|
|
30
|
+
const previous = useRef(initialValue);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
// useEffect runs after the render completes
|
|
33
|
+
previous.current = value;
|
|
34
|
+
}, [value]);
|
|
35
|
+
return previous.current;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=usePrevious.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrevious.js","names":["useEffect","useRef","usePrevious","value","initialValue","previous","current"],"sources":["../../../src/hooks/usePrevious/usePrevious.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * Pass in a piece of state.\n * This hook returns what the value of that state was in the previous render.\n * Returns undefined (or whatever value you specify) the first time.\n */\nexport function usePrevious<T>(value: T): T | undefined;\nexport function usePrevious<T, INIT>(value: T, initialValue: INIT): T | INIT;\nexport function usePrevious<T>(value: T, initialValue?: any): T {\n const previous = useRef<T>(initialValue);\n useEffect(() => {\n // useEffect runs after the render completes\n previous.current = value;\n }, [value]);\n return previous.current;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEzC;AACA;AACA;AACA;AACA;;;AAGA,OAAO,SAASC,WAAWA,CAAIC,KAAQ,EAAEC,YAAkB,EAAK;EAC9D,MAAMC,QAAQ,GAAGJ,MAAM,CAAIG,YAAY,CAAC;EACxCJ,SAAS,CAAC,MAAM;IACd;IACAK,QAAQ,CAACC,OAAO,GAAGH,KAAK;EAC1B,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EACX,OAAOE,QAAQ,CAACC,OAAO;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
20
|
+
import { usePrevious } from './usePrevious.js';
|
|
21
|
+
|
|
22
|
+
test('get undefined on the first render when initialValue is not defined', () => {
|
|
23
|
+
const hook = renderHook(() => usePrevious('state'));
|
|
24
|
+
expect(hook.result.current).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('get initial value on the first render when initialValue is defined', () => {
|
|
28
|
+
const hook = renderHook(() => usePrevious('state', 'initial'));
|
|
29
|
+
expect(hook.result.current).toBe('initial');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('get state value on second render', () => {
|
|
33
|
+
const hook = renderHook(() => usePrevious('state', 'initial'));
|
|
34
|
+
hook.rerender(() => usePrevious('state'));
|
|
35
|
+
expect(hook.result.current).toBe('state');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('get state value on third render', () => {
|
|
39
|
+
const hook = renderHook(() => usePrevious('state'));
|
|
40
|
+
hook.rerender(() => usePrevious('state'));
|
|
41
|
+
hook.rerender(() => usePrevious('state-2'));
|
|
42
|
+
expect(hook.result.current).toBe('state');
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=usePrevious.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrevious.test.js","names":["renderHook","usePrevious","test","hook","expect","result","current","toBeUndefined","toBe","rerender"],"sources":["../../../src/hooks/usePrevious/usePrevious.test.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { renderHook } from '@testing-library/react-hooks';\nimport { usePrevious } from './usePrevious';\n\ntest('get undefined on the first render when initialValue is not defined', () => {\n const hook = renderHook(() => usePrevious('state'));\n expect(hook.result.current).toBeUndefined();\n});\n\ntest('get initial value on the first render when initialValue is defined', () => {\n const hook = renderHook(() => usePrevious('state', 'initial'));\n expect(hook.result.current).toBe('initial');\n});\n\ntest('get state value on second render', () => {\n const hook = renderHook(() => usePrevious('state', 'initial'));\n hook.rerender(() => usePrevious('state'));\n expect(hook.result.current).toBe('state');\n});\n\ntest('get state value on third render', () => {\n const hook = renderHook(() => usePrevious('state'));\n hook.rerender(() => usePrevious('state'));\n hook.rerender(() => usePrevious('state-2'));\n expect(hook.result.current).toBe('state');\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import useTruncation from './useChildElementTruncation.js';
|
|
21
|
+
import useCSSTextTruncation, { truncationCSS } from './useCSSTextTruncation.js';
|
|
22
|
+
|
|
23
|
+
export { useTruncation, useCSSTextTruncation, truncationCSS };
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["useTruncation","useCSSTextTruncation","truncationCSS"],"sources":["../../../src/hooks/useTruncation/index.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport useTruncation from './useChildElementTruncation';\nimport useCSSTextTruncation, { truncationCSS } from './useCSSTextTruncation';\n\nexport { useTruncation, useCSSTextTruncation, truncationCSS };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,aAAa,MAAM,6BAA6B;AACvD,OAAOC,oBAAoB,IAAIC,aAAa,QAAQ,wBAAwB;;AAE5E,SAASF,aAAa,EAAEC,oBAAoB,EAAEC,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() {return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";} /**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { css } from '@emotion/react';
|
|
21
|
+
import __cjs_default_react_29 from 'react'; const { useEffect, useRef, useState } = __cjs_default_react_29;;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Importable CSS that enables text truncation on fixed-width block
|
|
25
|
+
* elements.
|
|
26
|
+
*/
|
|
27
|
+
export const truncationCSS = process.env.NODE_ENV === "production" ? { name: "l8l8b8", styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis" } : { name: "u6p4lb-truncationCSS", styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;label:truncationCSS;", map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ob29rcy91c2VUcnVuY2F0aW9uL3VzZUNTU1RleHRUcnVuY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCZ0MiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2hvb2tzL3VzZVRydW5jYXRpb24vdXNlQ1NTVGV4dFRydW5jYXRpb24udHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIExpY2Vuc2VkIHRvIHRoZSBBcGFjaGUgU29mdHdhcmUgRm91bmRhdGlvbiAoQVNGKSB1bmRlciBvbmVcbiAqIG9yIG1vcmUgY29udHJpYnV0b3IgbGljZW5zZSBhZ3JlZW1lbnRzLiAgU2VlIHRoZSBOT1RJQ0UgZmlsZVxuICogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3JtYXRpb25cbiAqIHJlZ2FyZGluZyBjb3B5cmlnaHQgb3duZXJzaGlwLiAgVGhlIEFTRiBsaWNlbnNlcyB0aGlzIGZpbGVcbiAqIHRvIHlvdSB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGVcbiAqIFwiTGljZW5zZVwiKTsgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZVxuICogd2l0aCB0aGUgTGljZW5zZS4gIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuICpcbiAq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gcmV0dXJuIFtyZWYsIGlzVHJ1bmNhdGVkXTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IHVzZUNTU1RleHRUcnVuY2F0aW9uO1xuIl19 */", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ };
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This hook encapsulates logic supporting truncation of text via
|
|
35
|
+
* the CSS "text-overflow: ellipsis;" feature. Given the text content
|
|
36
|
+
* to be displayed, this hook returns a ref to attach to the text
|
|
37
|
+
* element and a boolean for whether that element is currently truncated.
|
|
38
|
+
*/
|
|
39
|
+
const useCSSTextTruncation = () =>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
const [isTruncated, setIsTruncated] = useState(true);
|
|
44
|
+
const ref = useRef(null);
|
|
45
|
+
const [offsetWidth, setOffsetWidth] = useState(0);
|
|
46
|
+
const [scrollWidth, setScrollWidth] = useState(0);
|
|
47
|
+
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
useEffect(() => {var _ref$current$offsetWi, _ref$current, _ref$current$scrollWi, _ref$current2;
|
|
50
|
+
setOffsetWidth((_ref$current$offsetWi = (_ref$current = ref.current) == null ? void 0 : _ref$current.offsetWidth) != null ? _ref$current$offsetWi : 0);
|
|
51
|
+
setScrollWidth((_ref$current$scrollWi = (_ref$current2 = ref.current) == null ? void 0 : _ref$current2.scrollWidth) != null ? _ref$current$scrollWi : 0);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setIsTruncated(offsetWidth < scrollWidth);
|
|
56
|
+
}, [offsetWidth, scrollWidth]);
|
|
57
|
+
|
|
58
|
+
return [ref, isTruncated];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default useCSSTextTruncation;
|
|
62
|
+
//# sourceMappingURL=useCSSTextTruncation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCSSTextTruncation.js","names":["css","useEffect","useRef","useState","truncationCSS","process","env","NODE_ENV","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","useCSSTextTruncation","isTruncated","setIsTruncated","ref","offsetWidth","setOffsetWidth","scrollWidth","setScrollWidth","_ref$current$offsetWi","_ref$current","_ref$current$scrollWi","_ref$current2","current"],"sources":["../../../src/hooks/useTruncation/useCSSTextTruncation.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { css } from '@emotion/react';\nimport { useEffect, useRef, useState, RefObject } from 'react';\n\n/**\n * Importable CSS that enables text truncation on fixed-width block\n * elements.\n */\nexport const truncationCSS = css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\n/**\n * This hook encapsulates logic supporting truncation of text via\n * the CSS \"text-overflow: ellipsis;\" feature. Given the text content\n * to be displayed, this hook returns a ref to attach to the text\n * element and a boolean for whether that element is currently truncated.\n */\nconst useCSSTextTruncation = <T extends HTMLElement>(): [\n RefObject<T>,\n boolean,\n] => {\n const [isTruncated, setIsTruncated] = useState(true);\n const ref = useRef<T>(null);\n const [offsetWidth, setOffsetWidth] = useState(0);\n const [scrollWidth, setScrollWidth] = useState(0);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n setOffsetWidth(ref.current?.offsetWidth ?? 0);\n setScrollWidth(ref.current?.scrollWidth ?? 0);\n });\n\n useEffect(() => {\n setIsTruncated(offsetWidth < scrollWidth);\n }, [offsetWidth, scrollWidth]);\n\n return [ref, isTruncated];\n};\n\nexport default useCSSTextTruncation;\n"],"mappings":"wRAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAmB,OAAO;;AAE9D;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,sBAAAC,IAAA,YAAAC,MAAA,oEAAAD,IAAA,0BAAAC,MAAA,oFAAAC,GAAA,ilGAAAC,QAAA,EAAAC,gCAAA,EAIzB;;;;;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAAA;;;AAGxB;EACH,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGZ,QAAQ,CAAC,IAAI,CAAC;EACpD,MAAMa,GAAG,GAAGd,MAAM,CAAI,IAAI,CAAC;EAC3B,MAAM,CAACe,WAAW,EAAEC,cAAc,CAAC,GAAGf,QAAQ,CAAC,CAAC,CAAC;EACjD,MAAM,CAACgB,WAAW,EAAEC,cAAc,CAAC,GAAGjB,QAAQ,CAAC,CAAC,CAAC;;EAEjD;EACAF,SAAS,CAAC,MAAM,KAAAoB,qBAAA,EAAAC,YAAA,EAAAC,qBAAA,EAAAC,aAAA;IACdN,cAAc,EAAAG,qBAAA,IAAAC,YAAA,GAACN,GAAG,CAACS,OAAO,qBAAXH,YAAA,CAAaL,WAAW,YAAAI,qBAAA,GAAI,CAAC,CAAC;IAC7CD,cAAc,EAAAG,qBAAA,IAAAC,aAAA,GAACR,GAAG,CAACS,OAAO,qBAAXD,aAAA,CAAaL,WAAW,YAAAI,qBAAA,GAAI,CAAC,CAAC;EAC/C,CAAC,CAAC;;EAEFtB,SAAS,CAAC,MAAM;IACdc,cAAc,CAACE,WAAW,GAAGE,WAAW,CAAC;EAC3C,CAAC,EAAE,CAACF,WAAW,EAAEE,WAAW,CAAC,CAAC;;EAE9B,OAAO,CAACH,GAAG,EAAEF,WAAW,CAAC;AAC3B,CAAC;;AAED,eAAeD,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
20
|
+
import useCSSTextTruncation from './useCSSTextTruncation.js';
|
|
21
|
+
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
jest.clearAllMocks();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('should be false by default', () => {
|
|
27
|
+
const { result } = renderHook(() =>
|
|
28
|
+
useCSSTextTruncation()
|
|
29
|
+
);
|
|
30
|
+
const [paragraphRef, isTruncated] = result.current;
|
|
31
|
+
expect(paragraphRef.current).toBe(null);
|
|
32
|
+
expect(isTruncated).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('should not truncate', () => {
|
|
36
|
+
const ref = { current: document.createElement('p') };
|
|
37
|
+
Object.defineProperty(ref.current, 'offsetWidth', { get: () => 100 });
|
|
38
|
+
Object.defineProperty(ref.current, 'scrollWidth', { get: () => 50 });
|
|
39
|
+
jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current });
|
|
40
|
+
|
|
41
|
+
const { result } = renderHook(() =>
|
|
42
|
+
useCSSTextTruncation()
|
|
43
|
+
);
|
|
44
|
+
const [, isTruncated] = result.current;
|
|
45
|
+
|
|
46
|
+
expect(isTruncated).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('should truncate', () => {
|
|
50
|
+
const ref = { current: document.createElement('p') };
|
|
51
|
+
Object.defineProperty(ref.current, 'offsetWidth', { get: () => 50 });
|
|
52
|
+
Object.defineProperty(ref.current, 'scrollWidth', { get: () => 100 });
|
|
53
|
+
jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current });
|
|
54
|
+
|
|
55
|
+
const { result } = renderHook(() =>
|
|
56
|
+
useCSSTextTruncation()
|
|
57
|
+
);
|
|
58
|
+
const [, isTruncated] = result.current;
|
|
59
|
+
|
|
60
|
+
expect(isTruncated).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=useCSSTextTruncation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCSSTextTruncation.test.js","names":["renderHook","useCSSTextTruncation","afterEach","jest","clearAllMocks","test","result","paragraphRef","isTruncated","current","expect","toBe","ref","document","createElement","Object","defineProperty","get","spyOn","global","React","mockReturnValue"],"sources":["../../../src/hooks/useTruncation/useCSSTextTruncation.test.tsx"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { renderHook } from '@testing-library/react-hooks';\nimport useCSSTextTruncation from './useCSSTextTruncation';\n\nafterEach(() => {\n jest.clearAllMocks();\n});\n\ntest('should be false by default', () => {\n const { result } = renderHook(() =>\n useCSSTextTruncation<HTMLParagraphElement>(),\n );\n const [paragraphRef, isTruncated] = result.current;\n expect(paragraphRef.current).toBe(null);\n expect(isTruncated).toBe(false);\n});\n\ntest('should not truncate', () => {\n const ref = { current: document.createElement('p') };\n Object.defineProperty(ref.current, 'offsetWidth', { get: () => 100 });\n Object.defineProperty(ref.current, 'scrollWidth', { get: () => 50 });\n jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current });\n\n const { result } = renderHook(() =>\n useCSSTextTruncation<HTMLParagraphElement>(),\n );\n const [, isTruncated] = result.current;\n\n expect(isTruncated).toBe(false);\n});\n\ntest('should truncate', () => {\n const ref = { current: document.createElement('p') };\n Object.defineProperty(ref.current, 'offsetWidth', { get: () => 50 });\n Object.defineProperty(ref.current, 'scrollWidth', { get: () => 100 });\n jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current });\n\n const { result } = renderHook(() =>\n useCSSTextTruncation<HTMLParagraphElement>(),\n );\n const [, isTruncated] = result.current;\n\n expect(isTruncated).toBe(true);\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,oBAAoB,MAAM,wBAAwB;;AAEzDC,SAAS,CAAC,MAAM;EACdC,IAAI,CAACC,aAAa,CAAC,CAAC;AACtB,CAAC,CAAC;;AAEFC,IAAI,CAAC,4BAA4B,EAAE,MAAM;EACvC,M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Ac,CAACJ,GAAG,CAACH,OAAO,EAAE,aAAa,EAAE,EAAEQ,GAAG,EAAEA,CAAA,KAAM,EAAE,CAAC,CAAC,CAAC;EACpEF,MAAM,CAACC,cAAc,CAACJ,GAAG,CAACH,OAAO,EAAE,aAAa,EAAE,EAAEQ,GAAG,EAAEA,CAAA,KAAM,GAAG,CAAC,CAAC,CAAC;EACrEd,IAAI,CAACe,KAAK,CAACC,MAAM,CAACC,KAAK,EAAE,QAAQ,CAAC,CAACC,eAAe,CAAC,EAAEZ,OAAO,EAAEG,GAAG,CAACH,OAAO,CAAC,CAAC,CAAC;;EAE5E,MAAM,EAAEH,MAAM,CAAC,CAAC,GAAGN,UAAU,CAAC;EAC5BC,oBAAoB,CAAuB;EAC7C,CAAC;EACD,MAAM,GAAGO,WAAW,CAAC,GAAGF,MAAM,CAACG,OAAO;;EAEtCC,MAAM,CAACF,WAAW,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;AAChC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import __cjs_default_react_30 from 'react'; const { useLayoutEffect, useRef, useState } = __cjs_default_react_30;;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* This hook encapsulates logic to support truncation of child HTML
|
|
23
|
+
* elements contained in a fixed-width parent HTML element. Given
|
|
24
|
+
* a ref to the parent element and optionally a ref to the "+x"
|
|
25
|
+
* component that shows the number of truncated items, this hook
|
|
26
|
+
* will return the number of elements that are not fully visible
|
|
27
|
+
* (including those completely hidden) and whether any elements
|
|
28
|
+
* are completely hidden.
|
|
29
|
+
*/
|
|
30
|
+
const useChildElementTruncation = () => {
|
|
31
|
+
const [elementsTruncated, setElementsTruncated] = useState(0);
|
|
32
|
+
const [hasHiddenElements, setHasHiddenElements] = useState(false);
|
|
33
|
+
const elementRef = useRef(null);
|
|
34
|
+
const plusRef = useRef(null);
|
|
35
|
+
|
|
36
|
+
useLayoutEffect(() => {var _elementRef$current;
|
|
37
|
+
const onResize = () => {
|
|
38
|
+
const currentElement = elementRef.current;
|
|
39
|
+
if (!currentElement) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const plusRefElement = plusRef.current;
|
|
43
|
+
const { scrollWidth, clientWidth, childNodes } = currentElement;
|
|
44
|
+
|
|
45
|
+
if (scrollWidth > clientWidth) {
|
|
46
|
+
// "..." is around 6px wide
|
|
47
|
+
const truncationWidth = 6;
|
|
48
|
+
const plusSize = (plusRefElement == null ? void 0 : plusRefElement.offsetWidth) || 0;
|
|
49
|
+
const maxWidth = clientWidth - truncationWidth;
|
|
50
|
+
const elementsCount = childNodes.length;
|
|
51
|
+
|
|
52
|
+
let width = 0;
|
|
53
|
+
let hiddenElements = 0;
|
|
54
|
+
for (let i = 0; i < elementsCount; i += 1) {
|
|
55
|
+
const itemWidth = childNodes[i].offsetWidth;
|
|
56
|
+
const remainingWidth = maxWidth - width - plusSize;
|
|
57
|
+
|
|
58
|
+
// assures it shows +{number} only when the item is not visible
|
|
59
|
+
if (remainingWidth <= 0) {
|
|
60
|
+
hiddenElements += 1;
|
|
61
|
+
}
|
|
62
|
+
width += itemWidth;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (elementsCount > 1 && hiddenElements) {
|
|
66
|
+
setHasHiddenElements(true);
|
|
67
|
+
setElementsTruncated(hiddenElements);
|
|
68
|
+
} else {
|
|
69
|
+
setHasHiddenElements(false);
|
|
70
|
+
setElementsTruncated(1);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
setHasHiddenElements(false);
|
|
74
|
+
setElementsTruncated(0);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const obs = new ResizeObserver(onResize);
|
|
78
|
+
|
|
79
|
+
const element = (_elementRef$current = elementRef.current) == null ? void 0 : _elementRef$current.parentElement;
|
|
80
|
+
if (element) {
|
|
81
|
+
obs.observe(element);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
onResize();
|
|
85
|
+
|
|
86
|
+
return () => {
|
|
87
|
+
obs.disconnect();
|
|
88
|
+
};
|
|
89
|
+
}, [plusRef.current]); // plus is rendered dynamically - the component rerenders the hook when plus appears, this makes sure that useLayoutEffect is rerun
|
|
90
|
+
|
|
91
|
+
return [elementRef, plusRef, elementsTruncated, hasHiddenElements];
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default useChildElementTruncation;
|
|
95
|
+
//# sourceMappingURL=useChildElementTruncation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChildElementTruncation.js","names":["useLayoutEffect","useRef","useState","useChildElementTruncation","elementsTruncated","setElementsTruncated","hasHiddenElements","setHasHiddenElements","elementRef","plusRef","_elementRef$current","onResize","currentElement","current","plusRefElement","scrollWidth","clientWidth","childNodes","truncationWidth","plusSize","offsetWidth","maxWidth","elementsCount","length","width","hiddenElements","i","itemWidth","remainingWidth","obs","ResizeObserver","element","parentElement","observe","disconnect"],"sources":["../../../src/hooks/useTruncation/useChildElementTruncation.ts"],"sourcesContent":["/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { useLayoutEffect, useRef, useState } from 'react';\n\n/**\n * This hook encapsulates logic to support truncation of child HTML\n * elements contained in a fixed-width parent HTML element. Given\n * a ref to the parent element and optionally a ref to the \"+x\"\n * component that shows the number of truncated items, this hook\n * will return the number of elements that are not fully visible\n * (including those completely hidden) and whether any elements\n * are completely hidden.\n */\nconst useChildElementTruncation = () => {\n const [elementsTruncated, setElementsTruncated] = useState(0);\n const [hasHiddenElements, setHasHiddenElements] = useState(false);\n const elementRef = useRef<HTMLDivElement>(null);\n const plusRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n const onResize = () => {\n const currentElement = elementRef.current;\n if (!currentElement) {\n return;\n }\n const plusRefElement = plusRef.current;\n const { scrollWidth, clientWidth, childNodes } = currentElement;\n\n if (scrollWidth > clientWidth) {\n // \"...\" is around 6px wide\n const truncationWidth = 6;\n const plusSize = plusRefElement?.offsetWidth || 0;\n const maxWidth = clientWidth - truncationWidth;\n const elementsCount = childNodes.length;\n\n let width = 0;\n let hiddenElements = 0;\n for (let i = 0; i < elementsCount; i += 1) {\n const itemWidth = (childNodes[i] as HTMLElement).offsetWidth;\n const remainingWidth = maxWidth - width - plusSize;\n\n // assures it shows +{number} only when the item is not visible\n if (remainingWidth <= 0) {\n hiddenElements += 1;\n }\n width += itemWidth;\n }\n\n if (elementsCount > 1 && hiddenElements) {\n setHasHiddenElements(true);\n setElementsTruncated(hiddenElements);\n } else {\n setHasHiddenElements(false);\n setElementsTruncated(1);\n }\n } else {\n setHasHiddenElements(false);\n setElementsTruncated(0);\n }\n };\n const obs = new ResizeObserver(onResize);\n\n const element = elementRef.current?.parentElement;\n if (element) {\n obs.observe(element);\n }\n\n onResize();\n\n return () => {\n obs.disconnect();\n };\n }, [plusRef.current]); // plus is rendered dynamically - the component rerenders the hook when plus appears, this makes sure that useLayoutEffect is rerun\n\n return [elementRef, plusRef, elementsTruncated, hasHiddenElements] as const;\n};\n\nexport default useChildElementTruncation;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EACtC,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGH,QAAQ,CAAC,CAAC,CAAC;EAC7D,MAAM,CAACI,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGL,QAAQ,CAAC,KAAK,CAAC;EACjE,MAAMM,UAAU,GAAGP,MAAM,CAAiB,IAAI,CAAC;EAC/C,MAAMQ,OAAO,GAAGR,MAAM,CAAiB,IAAI,CAAC;;EAE5CD,eAAe,CAAC,MAAM,KAAAU,mBAAA;IACpB,MAAMC,QAAQ,GAAGA,CAAA,KAAM;MACrB,MAAMC,cAAc,GAAGJ,UAAU,CAACK,OAAO;MACzC,IAAI,CAACD,cAAc,EAAE;QACnB;MACF;MACA,MAAME,cAAc,GAAGL,OAAO,CAACI,OAAO;MACtC,MAAM,EAAEE,WAAW,EAAEC,WAAW,EAAEC,UAAU,CAAC,CAAC,GAAGL,cAAc;;MAE/D,IAAIG,WAAW,GAAGC,WAAW,EAAE;QAC7B;QACA,MAAME,eAAe,GAAG,CAAC;QACzB,MAAMC,QAAQ,GAAG,CAAAL,cAAc,oBAAdA,cA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