cx 26.0.1 → 26.0.3
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/build/charts/Bar.d.ts +29 -0
- package/build/charts/Bar.js +74 -0
- package/build/charts/BarGraph.d.ts +29 -0
- package/build/charts/BarGraph.js +86 -0
- package/build/charts/BubbleGraph.d.ts +54 -0
- package/build/charts/BubbleGraph.js +80 -0
- package/build/charts/Chart.d.ts +31 -0
- package/build/charts/Chart.js +62 -0
- package/build/charts/ColorMap.d.ts +59 -0
- package/build/charts/ColorMap.js +97 -0
- package/build/charts/Column.d.ts +32 -0
- package/build/charts/Column.js +81 -0
- package/build/charts/ColumnBarBase.d.ts +92 -0
- package/build/charts/ColumnBarBase.js +144 -0
- package/build/charts/ColumnBarGraphBase.d.ts +91 -0
- package/build/charts/ColumnBarGraphBase.js +106 -0
- package/build/charts/ColumnGraph.d.ts +30 -0
- package/build/charts/ColumnGraph.js +94 -0
- package/build/charts/Grid.d.ts +2 -0
- package/build/charts/Grid.js +3 -0
- package/build/charts/Gridlines.d.ts +34 -0
- package/build/charts/Gridlines.js +42 -0
- package/build/charts/Legend.d.ts +73 -0
- package/build/charts/Legend.js +138 -0
- package/build/charts/LegendEntry.d.ts +60 -0
- package/build/charts/LegendEntry.js +101 -0
- package/build/charts/LineGraph.d.ts +111 -0
- package/build/charts/LineGraph.js +253 -0
- package/build/charts/Marker.d.ts +133 -0
- package/build/charts/Marker.js +275 -0
- package/build/charts/MarkerLine.d.ts +65 -0
- package/build/charts/MarkerLine.js +108 -0
- package/build/charts/MouseTracker.d.ts +34 -0
- package/build/charts/MouseTracker.js +55 -0
- package/build/charts/Pie.d.ts +4 -0
- package/build/charts/Pie.js +5 -0
- package/build/charts/PieChart.d.ts +158 -0
- package/build/charts/PieChart.js +445 -0
- package/build/charts/PieLabel.d.ts +34 -0
- package/build/charts/PieLabel.js +47 -0
- package/build/charts/PieLabelsContainer.d.ts +15 -0
- package/build/charts/PieLabelsContainer.js +54 -0
- package/build/charts/Range.d.ts +94 -0
- package/build/charts/Range.js +160 -0
- package/build/charts/RangeMarker.d.ts +65 -0
- package/build/charts/RangeMarker.js +143 -0
- package/build/charts/ScatterGraph.d.ts +72 -0
- package/build/charts/ScatterGraph.js +133 -0
- package/build/charts/Swimlane.d.ts +47 -0
- package/build/charts/Swimlane.js +113 -0
- package/build/charts/Swimlanes.d.ts +57 -0
- package/build/charts/Swimlanes.js +83 -0
- package/build/charts/axis/Axis.d.ts +141 -0
- package/build/charts/axis/Axis.js +215 -0
- package/build/charts/axis/CategoryAxis.d.ts +35 -0
- package/build/charts/axis/CategoryAxis.js +240 -0
- package/build/charts/axis/NumericAxis.d.ts +57 -0
- package/build/charts/axis/NumericAxis.js +316 -0
- package/build/charts/axis/Stack.d.ts +16 -0
- package/build/charts/axis/Stack.js +57 -0
- package/build/charts/axis/TimeAxis.d.ts +50 -0
- package/build/charts/axis/TimeAxis.js +554 -0
- package/build/charts/axis/index.d.ts +4 -0
- package/build/charts/axis/index.js +4 -0
- package/build/charts/helpers/MinMaxFinder.d.ts +36 -0
- package/build/charts/helpers/MinMaxFinder.js +37 -0
- package/build/charts/helpers/PointReducer.d.ts +41 -0
- package/build/charts/helpers/PointReducer.js +55 -0
- package/build/charts/helpers/SnapPointFinder.d.ts +58 -0
- package/build/charts/helpers/SnapPointFinder.js +65 -0
- package/build/charts/helpers/ValueAtFinder.d.ts +33 -0
- package/build/charts/helpers/ValueAtFinder.js +46 -0
- package/build/charts/helpers/index.d.ts +4 -0
- package/build/charts/helpers/index.js +4 -0
- package/build/charts/index.d.ts +26 -0
- package/build/charts/index.js +26 -0
- package/build/charts/shapes.d.ts +13 -0
- package/build/charts/shapes.js +62 -0
- package/build/data/AggregateFunction.d.ts +60 -0
- package/build/data/AggregateFunction.js +155 -0
- package/build/data/ArrayElementView.d.ts +33 -0
- package/build/data/ArrayElementView.js +65 -0
- package/build/data/ArrayElementView.spec.d.ts +1 -0
- package/build/data/ArrayElementView.spec.js +81 -0
- package/build/data/ArrayRef.d.ts +9 -0
- package/build/data/ArrayRef.js +29 -0
- package/build/data/AugmentedViewBase.d.ts +18 -0
- package/build/data/AugmentedViewBase.js +72 -0
- package/build/data/Binding.d.ts +23 -0
- package/build/data/Binding.js +78 -0
- package/build/data/Binding.spec.d.ts +1 -0
- package/build/data/Binding.spec.js +61 -0
- package/build/data/ExposedRecordView.d.ts +24 -0
- package/build/data/ExposedRecordView.js +76 -0
- package/build/data/ExposedValueView.d.ts +20 -0
- package/build/data/ExposedValueView.js +68 -0
- package/build/data/Expression.d.ts +12 -0
- package/build/data/Expression.js +201 -0
- package/build/data/Expression.spec.d.ts +1 -0
- package/build/data/Expression.spec.js +196 -0
- package/build/data/Grouper.d.ts +29 -0
- package/build/data/Grouper.js +138 -0
- package/build/data/Grouper.spec.d.ts +1 -0
- package/build/data/Grouper.spec.js +48 -0
- package/build/data/NestedDataView.d.ts +21 -0
- package/build/data/NestedDataView.js +24 -0
- package/build/data/ReadOnlyDataView.d.ts +13 -0
- package/build/data/ReadOnlyDataView.js +25 -0
- package/build/data/Ref.d.ts +23 -0
- package/build/data/Ref.js +79 -0
- package/build/data/Ref.spec.d.ts +1 -0
- package/build/data/Ref.spec.js +72 -0
- package/build/data/Selector.d.ts +8 -0
- package/build/data/Selector.js +1 -0
- package/build/data/Store.d.ts +12 -0
- package/build/data/Store.js +41 -0
- package/build/data/Store.spec.d.ts +1 -0
- package/build/data/Store.spec.js +19 -0
- package/build/data/StoreProxy.d.ts +6 -0
- package/build/data/StoreProxy.js +14 -0
- package/build/data/StoreRef.d.ts +22 -0
- package/build/data/StoreRef.js +47 -0
- package/build/data/StoreRef.spec.d.ts +1 -0
- package/build/data/StoreRef.spec.js +22 -0
- package/build/data/StringTemplate.d.ts +9 -0
- package/build/data/StringTemplate.js +81 -0
- package/build/data/StringTemplate.spec.d.ts +1 -0
- package/build/data/StringTemplate.spec.js +112 -0
- package/build/data/StructuredSelector.d.ts +12 -0
- package/build/data/StructuredSelector.js +131 -0
- package/build/data/StructuredSelector.spec.d.ts +1 -0
- package/build/data/StructuredSelector.spec.js +102 -0
- package/build/data/SubscribableView.d.ts +15 -0
- package/build/data/SubscribableView.js +52 -0
- package/build/data/View.d.ts +125 -0
- package/build/data/View.js +163 -0
- package/build/data/View.spec.d.ts +1 -0
- package/build/data/View.spec.js +44 -0
- package/build/data/ZoomIntoPropertyView.d.ts +15 -0
- package/build/data/ZoomIntoPropertyView.js +34 -0
- package/build/data/ZoomIntoPropertyView.spec.d.ts +1 -0
- package/build/data/ZoomIntoPropertyView.spec.js +54 -0
- package/build/data/comparer.d.ts +11 -0
- package/build/data/comparer.js +55 -0
- package/build/data/comparer.spec.d.ts +1 -0
- package/build/data/comparer.spec.js +50 -0
- package/build/data/computable.d.ts +10 -0
- package/build/data/computable.js +46 -0
- package/build/data/computable.spec.d.ts +1 -0
- package/build/data/computable.spec.js +56 -0
- package/build/data/createAccessorModelProxy.d.ts +17 -0
- package/build/data/createAccessorModelProxy.js +37 -0
- package/build/data/createAccessorModelProxy.spec.d.ts +1 -0
- package/build/data/createAccessorModelProxy.spec.js +30 -0
- package/build/data/createStructuredSelector.d.ts +9 -0
- package/build/data/createStructuredSelector.js +40 -0
- package/build/data/createStructuredSelector.spec.d.ts +1 -0
- package/build/data/createStructuredSelector.spec.js +42 -0
- package/build/data/defaultCompare.d.ts +1 -0
- package/build/data/defaultCompare.js +12 -0
- package/build/data/diff/diffArrays.d.ts +12 -0
- package/build/data/diff/diffArrays.js +34 -0
- package/build/data/diff/diffs.spec.d.ts +1 -0
- package/build/data/diff/diffs.spec.js +45 -0
- package/build/data/diff/index.d.ts +1 -0
- package/build/data/diff/index.js +1 -0
- package/build/data/enableFatArrowExpansion.d.ts +1 -0
- package/build/data/enableFatArrowExpansion.js +5 -0
- package/build/data/getAccessor.d.ts +11 -0
- package/build/data/getAccessor.js +51 -0
- package/build/data/getAccessor.spec.d.ts +1 -0
- package/build/data/getAccessor.spec.js +10 -0
- package/build/data/getSelector.d.ts +3 -0
- package/build/data/getSelector.js +60 -0
- package/build/data/getSelector.spec.d.ts +1 -0
- package/build/data/getSelector.spec.js +36 -0
- package/build/data/index.d.ts +29 -0
- package/build/data/index.js +29 -0
- package/build/data/isSelector.d.ts +1 -0
- package/build/data/isSelector.js +19 -0
- package/build/data/ops/append.d.ts +1 -0
- package/build/data/ops/append.js +7 -0
- package/build/data/ops/append.spec.d.ts +1 -0
- package/build/data/ops/append.spec.js +24 -0
- package/build/data/ops/filter.d.ts +1 -0
- package/build/data/ops/filter.js +8 -0
- package/build/data/ops/filter.spec.d.ts +1 -0
- package/build/data/ops/filter.spec.js +25 -0
- package/build/data/ops/findTreeNode.d.ts +1 -0
- package/build/data/ops/findTreeNode.js +13 -0
- package/build/data/ops/findTreeNode.spec.d.ts +1 -0
- package/build/data/ops/findTreeNode.spec.js +20 -0
- package/build/data/ops/findTreePath.d.ts +1 -0
- package/build/data/ops/findTreePath.js +15 -0
- package/build/data/ops/index.d.ts +10 -0
- package/build/data/ops/index.js +10 -0
- package/build/data/ops/insertElement.d.ts +1 -0
- package/build/data/ops/insertElement.js +3 -0
- package/build/data/ops/merge.d.ts +1 -0
- package/build/data/ops/merge.js +10 -0
- package/build/data/ops/merge.spec.d.ts +1 -0
- package/build/data/ops/merge.spec.js +23 -0
- package/build/data/ops/moveElement.d.ts +1 -0
- package/build/data/ops/moveElement.js +20 -0
- package/build/data/ops/removeTreeNodes.d.ts +1 -0
- package/build/data/ops/removeTreeNodes.js +4 -0
- package/build/data/ops/removeTreeNodes.spec.d.ts +1 -0
- package/build/data/ops/removeTreeNodes.spec.js +35 -0
- package/build/data/ops/updateArray.d.ts +1 -0
- package/build/data/ops/updateArray.js +23 -0
- package/build/data/ops/updateArray.spec.d.ts +1 -0
- package/build/data/ops/updateArray.spec.js +33 -0
- package/build/data/ops/updateTree.d.ts +1 -0
- package/build/data/ops/updateTree.js +14 -0
- package/build/data/ops/updateTree.spec.d.ts +1 -0
- package/build/data/ops/updateTree.spec.js +44 -0
- package/build/data/test-types.d.ts +1 -0
- package/build/data/test-types.js +2 -0
- package/build/hooks/createLocalStorageRef.d.ts +2 -0
- package/build/hooks/createLocalStorageRef.js +22 -0
- package/build/hooks/index.d.ts +8 -0
- package/build/hooks/index.js +8 -0
- package/build/hooks/invokeCallback.d.ts +2 -0
- package/build/hooks/invokeCallback.js +8 -0
- package/build/hooks/invokeCallback.spec.d.ts +1 -0
- package/build/hooks/invokeCallback.spec.js +44 -0
- package/build/hooks/resolveCallback.d.ts +2 -0
- package/build/hooks/resolveCallback.js +13 -0
- package/build/hooks/resolveCallback.spec.d.ts +1 -0
- package/build/hooks/resolveCallback.spec.js +35 -0
- package/build/hooks/store.d.ts +11 -0
- package/build/hooks/store.js +38 -0
- package/build/hooks/store.spec.d.ts +1 -0
- package/build/hooks/store.spec.js +48 -0
- package/build/hooks/useEffect.d.ts +2 -0
- package/build/hooks/useEffect.js +13 -0
- package/build/hooks/useInterval.d.ts +1 -0
- package/build/hooks/useInterval.js +7 -0
- package/build/hooks/useState.d.ts +2 -0
- package/build/hooks/useState.js +17 -0
- package/build/hooks/useTrigger.d.ts +3 -0
- package/build/hooks/useTrigger.js +22 -0
- package/build/hooks/useTrigger.spec.d.ts +1 -0
- package/build/hooks/useTrigger.spec.js +59 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +7 -0
- package/build/jsx-runtime.d.ts +31 -0
- package/build/jsx-runtime.js +27 -0
- package/build/locale/de-de.d.ts +1 -0
- package/build/locale/de-de.js +62 -0
- package/build/locale/en-us.d.ts +1 -0
- package/build/locale/en-us.js +62 -0
- package/build/locale/es-es.d.ts +1 -0
- package/build/locale/es-es.js +62 -0
- package/build/locale/fr-fr.d.ts +1 -0
- package/build/locale/fr-fr.js +62 -0
- package/build/locale/nl-nl.d.ts +1 -0
- package/build/locale/nl-nl.js +62 -0
- package/build/locale/pt-pt.d.ts +1 -0
- package/build/locale/pt-pt.js +62 -0
- package/build/locale/sr-latn-ba.d.ts +1 -0
- package/build/locale/sr-latn-ba.js +62 -0
- package/build/svg/BoundedObject.d.ts +39 -0
- package/build/svg/BoundedObject.js +51 -0
- package/build/svg/ClipRect.d.ts +11 -0
- package/build/svg/ClipRect.js +18 -0
- package/build/svg/Ellipse.d.ts +27 -0
- package/build/svg/Ellipse.js +22 -0
- package/build/svg/Line.d.ts +26 -0
- package/build/svg/Line.js +19 -0
- package/build/svg/NonOverlappingRect.d.ts +12 -0
- package/build/svg/NonOverlappingRect.js +17 -0
- package/build/svg/NonOverlappingRectGroup.d.ts +15 -0
- package/build/svg/NonOverlappingRectGroup.js +38 -0
- package/build/svg/Rectangle.d.ts +40 -0
- package/build/svg/Rectangle.js +27 -0
- package/build/svg/Svg.d.ts +49 -0
- package/build/svg/Svg.js +132 -0
- package/build/svg/Text.d.ts +48 -0
- package/build/svg/Text.js +60 -0
- package/build/svg/TextualBoundedObject.d.ts +7 -0
- package/build/svg/TextualBoundedObject.js +22 -0
- package/build/svg/index.d.ts +11 -0
- package/build/svg/index.js +11 -0
- package/build/svg/util/Rect.d.ts +31 -0
- package/build/svg/util/Rect.js +83 -0
- package/build/svg/util/index.d.ts +1 -0
- package/build/svg/util/index.js +1 -0
- package/build/ui/CSS.d.ts +10 -0
- package/build/ui/CSS.js +77 -0
- package/build/ui/CSSHelper.d.ts +5 -0
- package/build/ui/CSSHelper.js +15 -0
- package/build/ui/Container.d.ts +55 -0
- package/build/ui/Container.js +160 -0
- package/build/ui/ContentResolver.d.ts +51 -0
- package/build/ui/ContentResolver.js +71 -0
- package/build/ui/Controller.d.ts +64 -0
- package/build/ui/Controller.js +110 -0
- package/build/ui/Controller.spec.d.ts +1 -0
- package/build/ui/Controller.spec.js +251 -0
- package/build/ui/Culture.d.ts +39 -0
- package/build/ui/Culture.js +124 -0
- package/build/ui/Cx.d.ts +57 -0
- package/build/ui/Cx.js +277 -0
- package/build/ui/Cx.spec.d.ts +1 -0
- package/build/ui/Cx.spec.js +153 -0
- package/build/ui/DataProxy.d.ts +24 -0
- package/build/ui/DataProxy.js +26 -0
- package/build/ui/DataProxy.spec.d.ts +1 -0
- package/build/ui/DataProxy.spec.js +208 -0
- package/build/ui/DetachedScope.d.ts +61 -0
- package/build/ui/DetachedScope.js +84 -0
- package/build/ui/FocusManager.d.ts +16 -0
- package/build/ui/FocusManager.js +149 -0
- package/build/ui/Format.d.ts +4 -0
- package/build/ui/Format.js +96 -0
- package/build/ui/HoverSync.d.ts +30 -0
- package/build/ui/HoverSync.js +129 -0
- package/build/ui/Instance.d.ts +219 -0
- package/build/ui/Instance.js +613 -0
- package/build/ui/IsolatedScope.d.ts +19 -0
- package/build/ui/IsolatedScope.js +31 -0
- package/build/ui/IsolatedScope.spec.d.ts +1 -0
- package/build/ui/IsolatedScope.spec.js +42 -0
- package/build/ui/Localization.d.ts +9 -0
- package/build/ui/Localization.js +63 -0
- package/build/ui/Prop.d.ts +83 -0
- package/build/ui/Prop.js +1 -0
- package/build/ui/PureContainer.d.ts +9 -0
- package/build/ui/PureContainer.js +9 -0
- package/build/ui/RenderingContext.d.ts +19 -0
- package/build/ui/RenderingContext.js +84 -0
- package/build/ui/Repeater.d.ts +73 -0
- package/build/ui/Repeater.js +99 -0
- package/build/ui/Repeater.spec.d.ts +1 -0
- package/build/ui/Repeater.spec.js +109 -0
- package/build/ui/Rescope.d.ts +18 -0
- package/build/ui/Rescope.js +31 -0
- package/build/ui/Rescope.spec.d.ts +1 -0
- package/build/ui/Rescope.spec.js +134 -0
- package/build/ui/ResizeManager.d.ts +5 -0
- package/build/ui/ResizeManager.js +24 -0
- package/build/ui/Restate.d.ts +44 -0
- package/build/ui/Restate.js +142 -0
- package/build/ui/Restate.spec.d.ts +1 -0
- package/build/ui/Restate.spec.js +257 -0
- package/build/ui/StaticText.d.ts +5 -0
- package/build/ui/StaticText.js +7 -0
- package/build/ui/StructuredInstanceDataAccessor.d.ts +13 -0
- package/build/ui/StructuredInstanceDataAccessor.js +30 -0
- package/build/ui/Text.d.ts +10 -0
- package/build/ui/Text.js +21 -0
- package/build/ui/VDOM.d.ts +20 -0
- package/build/ui/VDOM.js +3 -0
- package/build/ui/Widget.d.ts +111 -0
- package/build/ui/Widget.js +170 -0
- package/build/ui/ZIndexManager.d.ts +4 -0
- package/build/ui/ZIndexManager.js +9 -0
- package/build/ui/adapter/ArrayAdapter.d.ts +48 -0
- package/build/ui/adapter/ArrayAdapter.js +148 -0
- package/build/ui/adapter/ArrayAdapter.spec.d.ts +1 -0
- package/build/ui/adapter/ArrayAdapter.spec.js +44 -0
- package/build/ui/adapter/DataAdapter.d.ts +30 -0
- package/build/ui/adapter/DataAdapter.js +13 -0
- package/build/ui/adapter/GroupAdapter.d.ts +57 -0
- package/build/ui/adapter/GroupAdapter.js +137 -0
- package/build/ui/adapter/TreeAdapter.d.ts +51 -0
- package/build/ui/adapter/TreeAdapter.js +98 -0
- package/build/ui/adapter/TreeAdapter.spec.d.ts +1 -0
- package/build/ui/adapter/TreeAdapter.spec.js +71 -0
- package/build/ui/adapter/index.d.ts +4 -0
- package/build/ui/adapter/index.js +4 -0
- package/build/ui/app/History.d.ts +18 -0
- package/build/ui/app/History.js +109 -0
- package/build/ui/app/Url.d.ts +13 -0
- package/build/ui/app/Url.js +86 -0
- package/build/ui/app/Url.spec.d.ts +1 -0
- package/build/ui/app/Url.spec.js +43 -0
- package/build/ui/app/index.d.ts +4 -0
- package/build/ui/app/index.js +4 -0
- package/build/ui/app/startAppLoop.d.ts +10 -0
- package/build/ui/app/startAppLoop.js +53 -0
- package/build/ui/app/startHotAppLoop.d.ts +11 -0
- package/build/ui/app/startHotAppLoop.js +22 -0
- package/build/ui/batchUpdates.d.ts +5 -0
- package/build/ui/batchUpdates.js +60 -0
- package/build/ui/bind.d.ts +3 -0
- package/build/ui/bind.js +7 -0
- package/build/ui/createFunctionalComponent.d.ts +2 -0
- package/build/ui/createFunctionalComponent.js +58 -0
- package/build/ui/createFunctionalComponent.spec.d.ts +1 -0
- package/build/ui/createFunctionalComponent.spec.js +272 -0
- package/build/ui/expr.d.ts +11 -0
- package/build/ui/expr.js +17 -0
- package/build/ui/flattenProps.d.ts +1 -0
- package/build/ui/flattenProps.js +18 -0
- package/build/ui/index.d.ts +40 -0
- package/build/ui/index.js +41 -0
- package/build/ui/keyboardShortcuts.d.ts +10 -0
- package/build/ui/keyboardShortcuts.js +27 -0
- package/build/ui/layout/Content.d.ts +14 -0
- package/build/ui/layout/Content.js +15 -0
- package/build/ui/layout/ContentPlaceholder.d.ts +35 -0
- package/build/ui/layout/ContentPlaceholder.js +105 -0
- package/build/ui/layout/ContentPlaceholder.spec.d.ts +1 -0
- package/build/ui/layout/ContentPlaceholder.spec.js +333 -0
- package/build/ui/layout/FirstVisibleChildLayout.d.ts +7 -0
- package/build/ui/layout/FirstVisibleChildLayout.js +58 -0
- package/build/ui/layout/FirstVisibleChildLayout.spec.d.ts +1 -0
- package/build/ui/layout/FirstVisibleChildLayout.spec.js +101 -0
- package/build/ui/layout/LabelsLeftLayout.d.ts +17 -0
- package/build/ui/layout/LabelsLeftLayout.js +50 -0
- package/build/ui/layout/LabelsTopLayout.d.ts +36 -0
- package/build/ui/layout/LabelsTopLayout.js +97 -0
- package/build/ui/layout/UseParentLayout.d.ts +4 -0
- package/build/ui/layout/UseParentLayout.js +5 -0
- package/build/ui/layout/exploreChildren.d.ts +4 -0
- package/build/ui/layout/exploreChildren.js +27 -0
- package/build/ui/layout/index.d.ts +7 -0
- package/build/ui/layout/index.js +7 -0
- package/build/ui/selection/KeySelection.d.ts +37 -0
- package/build/ui/selection/KeySelection.js +125 -0
- package/build/ui/selection/PropertySelection.d.ts +26 -0
- package/build/ui/selection/PropertySelection.js +51 -0
- package/build/ui/selection/Selection.d.ts +35 -0
- package/build/ui/selection/Selection.js +75 -0
- package/build/ui/selection/index.d.ts +3 -0
- package/build/ui/selection/index.js +3 -0
- package/build/ui/tpl.d.ts +3 -0
- package/build/ui/tpl.js +5 -0
- package/build/util/Component.d.ts +149 -0
- package/build/util/Component.js +109 -0
- package/build/util/Console.d.ts +4 -0
- package/build/util/Console.js +10 -0
- package/build/util/DOM.d.ts +24 -0
- package/build/util/DOM.js +64 -0
- package/build/util/Debug.d.ts +25 -0
- package/build/util/Debug.js +42 -0
- package/build/util/Format.d.ts +14 -0
- package/build/util/Format.js +229 -0
- package/build/util/Format.spec.d.ts +1 -0
- package/build/util/Format.spec.js +58 -0
- package/build/util/GlobalCacheIdentifier.d.ts +4 -0
- package/build/util/GlobalCacheIdentifier.js +9 -0
- package/build/util/KeyCode.d.ts +21 -0
- package/build/util/KeyCode.js +21 -0
- package/build/util/SubscriberList.d.ts +39 -0
- package/build/util/SubscriberList.js +70 -0
- package/build/util/Timing.d.ts +15 -0
- package/build/util/Timing.js +49 -0
- package/build/util/TraversalStack.d.ts +8 -0
- package/build/util/TraversalStack.js +37 -0
- package/build/util/TraversalStack.spec.d.ts +1 -0
- package/build/util/TraversalStack.spec.js +43 -0
- package/build/util/addEventListenerWithOptions.d.ts +17 -0
- package/build/util/addEventListenerWithOptions.js +8 -0
- package/build/util/browserSupportsPassiveEventHandlers.d.ts +5 -0
- package/build/util/browserSupportsPassiveEventHandlers.js +20 -0
- package/build/util/calculateNaturalElementHeight.d.ts +1 -0
- package/build/util/calculateNaturalElementHeight.js +24 -0
- package/build/util/capitalize.d.ts +1 -0
- package/build/util/capitalize.js +5 -0
- package/build/util/coalesce.d.ts +1 -0
- package/build/util/coalesce.js +7 -0
- package/build/util/color/hslToRgb.d.ts +8 -0
- package/build/util/color/hslToRgb.js +38 -0
- package/build/util/color/index.d.ts +4 -0
- package/build/util/color/index.js +4 -0
- package/build/util/color/parseColor.d.ts +57 -0
- package/build/util/color/parseColor.js +114 -0
- package/build/util/color/rgbToHex.d.ts +8 -0
- package/build/util/color/rgbToHex.js +14 -0
- package/build/util/color/rgbToHsl.d.ts +8 -0
- package/build/util/color/rgbToHsl.js +35 -0
- package/build/util/date/dateDiff.d.ts +7 -0
- package/build/util/date/dateDiff.js +10 -0
- package/build/util/date/diff.d.ts +7 -0
- package/build/util/date/diff.js +11 -0
- package/build/util/date/encodeDate.d.ts +1 -0
- package/build/util/date/encodeDate.js +7 -0
- package/build/util/date/encodeDateWithTimezoneOffset.d.ts +1 -0
- package/build/util/date/encodeDateWithTimezoneOffset.js +16 -0
- package/build/util/date/index.d.ts +11 -0
- package/build/util/date/index.js +11 -0
- package/build/util/date/lowerBoundCheck.d.ts +8 -0
- package/build/util/date/lowerBoundCheck.js +12 -0
- package/build/util/date/maxDate.d.ts +6 -0
- package/build/util/date/maxDate.js +13 -0
- package/build/util/date/minDate.d.ts +6 -0
- package/build/util/date/minDate.js +13 -0
- package/build/util/date/monthStart.d.ts +6 -0
- package/build/util/date/monthStart.js +8 -0
- package/build/util/date/parseDateInvariant.d.ts +2 -0
- package/build/util/date/parseDateInvariant.js +18 -0
- package/build/util/date/sameDate.d.ts +7 -0
- package/build/util/date/sameDate.js +11 -0
- package/build/util/date/upperBoundCheck.d.ts +8 -0
- package/build/util/date/upperBoundCheck.js +12 -0
- package/build/util/date/upperBoundCheck.spec.d.ts +1 -0
- package/build/util/date/upperBoundCheck.spec.js +22 -0
- package/build/util/date/zeroTime.d.ts +7 -0
- package/build/util/date/zeroTime.js +9 -0
- package/build/util/debounce.d.ts +5 -0
- package/build/util/debounce.js +15 -0
- package/build/util/dummyCallback.d.ts +1 -0
- package/build/util/dummyCallback.js +1 -0
- package/build/util/escapeSpecialRegexCharacters.d.ts +6 -0
- package/build/util/escapeSpecialRegexCharacters.js +8 -0
- package/build/util/eventCallbacks.d.ts +7 -0
- package/build/util/eventCallbacks.js +6 -0
- package/build/util/expandFatArrows.d.ts +1 -0
- package/build/util/expandFatArrows.js +104 -0
- package/build/util/findScrollableParent.d.ts +1 -0
- package/build/util/findScrollableParent.js +16 -0
- package/build/util/getActiveElement.d.ts +1 -0
- package/build/util/getActiveElement.js +4 -0
- package/build/util/getParentFrameBoundingClientRect.d.ts +1 -0
- package/build/util/getParentFrameBoundingClientRect.js +13 -0
- package/build/util/getScrollerBoundingClientRect.d.ts +1 -0
- package/build/util/getScrollerBoundingClientRect.js +10 -0
- package/build/util/getSearchQueryPredicate.d.ts +2 -0
- package/build/util/getSearchQueryPredicate.js +54 -0
- package/build/util/getSearchQueryPredicate.spec.d.ts +1 -0
- package/build/util/getSearchQueryPredicate.spec.js +33 -0
- package/build/util/getTopLevelBoundingClientRect.d.ts +1 -0
- package/build/util/getTopLevelBoundingClientRect.js +6 -0
- package/build/util/getVendorPrefix.d.ts +1 -0
- package/build/util/getVendorPrefix.js +22 -0
- package/build/util/hasKey.d.ts +4 -0
- package/build/util/hasKey.js +14 -0
- package/build/util/index.d.ts +55 -0
- package/build/util/index.js +55 -0
- package/build/util/innerTextTrim.d.ts +6 -0
- package/build/util/innerTextTrim.js +10 -0
- package/build/util/isArray.d.ts +1 -0
- package/build/util/isArray.js +3 -0
- package/build/util/isDataRecord.d.ts +1 -0
- package/build/util/isDataRecord.js +4 -0
- package/build/util/isDefined.d.ts +1 -0
- package/build/util/isDefined.js +3 -0
- package/build/util/isDigit.d.ts +6 -0
- package/build/util/isDigit.js +8 -0
- package/build/util/isFunction.d.ts +1 -0
- package/build/util/isFunction.js +3 -0
- package/build/util/isNonEmptyArray.d.ts +1 -0
- package/build/util/isNonEmptyArray.js +3 -0
- package/build/util/isNumber.d.ts +1 -0
- package/build/util/isNumber.js +3 -0
- package/build/util/isObject.d.ts +1 -0
- package/build/util/isObject.js +3 -0
- package/build/util/isPromise.d.ts +1 -0
- package/build/util/isPromise.js +5 -0
- package/build/util/isString.d.ts +1 -0
- package/build/util/isString.js +3 -0
- package/build/util/isTextInputElement.d.ts +1 -0
- package/build/util/isTextInputElement.js +3 -0
- package/build/util/isTouchDevice.d.ts +1 -0
- package/build/util/isTouchDevice.js +6 -0
- package/build/util/isTouchEvent.d.ts +2 -0
- package/build/util/isTouchEvent.js +43 -0
- package/build/util/isUndefined.d.ts +1 -0
- package/build/util/isUndefined.js +3 -0
- package/build/util/isValidIdentifierName.d.ts +1 -0
- package/build/util/isValidIdentifierName.js +4 -0
- package/build/util/isValidIdentifierName.spec.d.ts +1 -0
- package/build/util/isValidIdentifierName.spec.js +28 -0
- package/build/util/onIdleCallback.d.ts +1 -0
- package/build/util/onIdleCallback.js +13 -0
- package/build/util/parseStyle.d.ts +2 -0
- package/build/util/parseStyle.js +22 -0
- package/build/util/quote.d.ts +2 -0
- package/build/util/quote.js +5 -0
- package/build/util/reverseSlice.d.ts +1 -0
- package/build/util/reverseSlice.js +10 -0
- package/build/util/routeAppend.d.ts +1 -0
- package/build/util/routeAppend.js +16 -0
- package/build/util/routeAppend.spec.d.ts +1 -0
- package/build/util/routeAppend.spec.js +14 -0
- package/build/util/scrollElementIntoView.d.ts +1 -0
- package/build/util/scrollElementIntoView.js +28 -0
- package/build/util/shallowEquals.d.ts +1 -0
- package/build/util/shallowEquals.js +30 -0
- package/build/util/test/createTestRenderer.d.ts +5 -0
- package/build/util/test/createTestRenderer.js +10 -0
- package/build/util/throttle.d.ts +9 -0
- package/build/util/throttle.js +19 -0
- package/build/util/validatedDebounce.d.ts +3 -0
- package/build/util/validatedDebounce.js +18 -0
- package/build/widgets/AccessorBindings.spec.d.ts +1 -0
- package/build/widgets/AccessorBindings.spec.js +40 -0
- package/build/widgets/Button.d.ts +57 -0
- package/build/widgets/Button.js +105 -0
- package/build/widgets/CxCredit.d.ts +11 -0
- package/build/widgets/CxCredit.js +25 -0
- package/build/widgets/DocumentTitle.d.ts +27 -0
- package/build/widgets/DocumentTitle.js +57 -0
- package/build/widgets/FlexBox.d.ts +79 -0
- package/build/widgets/FlexBox.js +77 -0
- package/build/widgets/Heading.d.ts +16 -0
- package/build/widgets/Heading.js +24 -0
- package/build/widgets/HighlightedSearchText.d.ts +18 -0
- package/build/widgets/HighlightedSearchText.js +32 -0
- package/build/widgets/HtmlElement.d.ts +46 -0
- package/build/widgets/HtmlElement.js +253 -0
- package/build/widgets/HtmlElement.spec.d.ts +1 -0
- package/build/widgets/HtmlElement.spec.js +38 -0
- package/build/widgets/Icon.d.ts +29 -0
- package/build/widgets/Icon.js +39 -0
- package/build/widgets/List.d.ts +122 -0
- package/build/widgets/List.js +510 -0
- package/build/widgets/ProgressBar.d.ts +20 -0
- package/build/widgets/ProgressBar.js +29 -0
- package/build/widgets/Resizer.d.ts +30 -0
- package/build/widgets/Resizer.js +111 -0
- package/build/widgets/Sandbox.d.ts +40 -0
- package/build/widgets/Sandbox.js +54 -0
- package/build/widgets/Section.d.ts +52 -0
- package/build/widgets/Section.js +93 -0
- package/build/widgets/autoFocus.d.ts +1 -0
- package/build/widgets/autoFocus.js +9 -0
- package/build/widgets/cx.d.ts +2 -0
- package/build/widgets/cx.js +53 -0
- package/build/widgets/drag-drop/DragHandle.d.ts +12 -0
- package/build/widgets/drag-drop/DragHandle.js +23 -0
- package/build/widgets/drag-drop/DragSource.d.ts +55 -0
- package/build/widgets/drag-drop/DragSource.js +135 -0
- package/build/widgets/drag-drop/DropZone.d.ts +103 -0
- package/build/widgets/drag-drop/DropZone.js +173 -0
- package/build/widgets/drag-drop/index.d.ts +4 -0
- package/build/widgets/drag-drop/index.js +4 -0
- package/build/widgets/drag-drop/ops.d.ts +55 -0
- package/build/widgets/drag-drop/ops.js +292 -0
- package/build/widgets/enableAllInternalDependencies.d.ts +1 -0
- package/build/widgets/enableAllInternalDependencies.js +10 -0
- package/build/widgets/form/Calendar.d.ts +130 -0
- package/build/widgets/form/Calendar.js +445 -0
- package/build/widgets/form/Checkbox.d.ts +46 -0
- package/build/widgets/form/Checkbox.js +157 -0
- package/build/widgets/form/ColorField.d.ts +49 -0
- package/build/widgets/form/ColorField.js +310 -0
- package/build/widgets/form/ColorPicker.d.ts +46 -0
- package/build/widgets/form/ColorPicker.js +304 -0
- package/build/widgets/form/DateField.d.ts +8 -0
- package/build/widgets/form/DateField.js +12 -0
- package/build/widgets/form/DateTimeField.d.ts +98 -0
- package/build/widgets/form/DateTimeField.js +474 -0
- package/build/widgets/form/DateTimePicker.d.ts +17 -0
- package/build/widgets/form/DateTimePicker.js +248 -0
- package/build/widgets/form/Field.d.ts +140 -0
- package/build/widgets/form/Field.js +369 -0
- package/build/widgets/form/FieldGroup.d.ts +5 -0
- package/build/widgets/form/FieldGroup.js +5 -0
- package/build/widgets/form/FieldIcon.d.ts +22 -0
- package/build/widgets/form/FieldIcon.js +41 -0
- package/build/widgets/form/HelpText.d.ts +6 -0
- package/build/widgets/form/HelpText.js +10 -0
- package/build/widgets/form/Label.d.ts +27 -0
- package/build/widgets/form/Label.js +74 -0
- package/build/widgets/form/LabeledContainer.d.ts +30 -0
- package/build/widgets/form/LabeledContainer.js +48 -0
- package/build/widgets/form/LookupField.d.ts +124 -0
- package/build/widgets/form/LookupField.js +907 -0
- package/build/widgets/form/MonthField.d.ts +104 -0
- package/build/widgets/form/MonthField.js +423 -0
- package/build/widgets/form/MonthPicker.d.ts +125 -0
- package/build/widgets/form/MonthPicker.js +557 -0
- package/build/widgets/form/NumberField.d.ts +63 -0
- package/build/widgets/form/NumberField.js +361 -0
- package/build/widgets/form/Radio.d.ts +43 -0
- package/build/widgets/form/Radio.js +131 -0
- package/build/widgets/form/Select.d.ts +40 -0
- package/build/widgets/form/Select.js +183 -0
- package/build/widgets/form/Slider.d.ts +68 -0
- package/build/widgets/form/Slider.js +264 -0
- package/build/widgets/form/Switch.d.ts +41 -0
- package/build/widgets/form/Switch.js +94 -0
- package/build/widgets/form/TextArea.d.ts +20 -0
- package/build/widgets/form/TextArea.js +128 -0
- package/build/widgets/form/TextField.d.ts +49 -0
- package/build/widgets/form/TextField.js +202 -0
- package/build/widgets/form/TimeField.d.ts +3 -0
- package/build/widgets/form/TimeField.js +8 -0
- package/build/widgets/form/TimeList.d.ts +1 -0
- package/build/widgets/form/TimeList.js +89 -0
- package/build/widgets/form/UploadButton.d.ts +17 -0
- package/build/widgets/form/UploadButton.js +163 -0
- package/build/widgets/form/ValidationError.d.ts +27 -0
- package/build/widgets/form/ValidationError.js +33 -0
- package/build/widgets/form/ValidationGroup.d.ts +63 -0
- package/build/widgets/form/ValidationGroup.js +58 -0
- package/build/widgets/form/ValidationGroup.spec.d.ts +1 -0
- package/build/widgets/form/ValidationGroup.spec.js +62 -0
- package/build/widgets/form/Validator.d.ts +8 -0
- package/build/widgets/form/Validator.js +19 -0
- package/build/widgets/form/Wheel.d.ts +61 -0
- package/build/widgets/form/Wheel.js +178 -0
- package/build/widgets/form/index.d.ts +28 -0
- package/build/widgets/form/index.js +28 -0
- package/build/widgets/grid/Grid.d.ts +517 -0
- package/build/widgets/grid/Grid.js +2756 -0
- package/build/widgets/grid/GridCell.d.ts +68 -0
- package/build/widgets/grid/GridCell.js +61 -0
- package/build/widgets/grid/GridCellEditor.d.ts +10 -0
- package/build/widgets/grid/GridCellEditor.js +29 -0
- package/build/widgets/grid/GridRow.d.ts +87 -0
- package/build/widgets/grid/GridRow.js +192 -0
- package/build/widgets/grid/GridRowLine.d.ts +27 -0
- package/build/widgets/grid/GridRowLine.js +24 -0
- package/build/widgets/grid/Pagination.d.ts +23 -0
- package/build/widgets/grid/Pagination.js +73 -0
- package/build/widgets/grid/TreeNode.d.ts +42 -0
- package/build/widgets/grid/TreeNode.js +82 -0
- package/build/widgets/grid/createGridCellEditor.d.ts +2 -0
- package/build/widgets/grid/createGridCellEditor.js +6 -0
- package/build/widgets/grid/index.d.ts +10 -0
- package/build/widgets/grid/index.js +10 -0
- package/build/widgets/icons/calendar.d.ts +2 -0
- package/build/widgets/icons/calendar.js +5 -0
- package/build/widgets/icons/check.d.ts +2 -0
- package/build/widgets/icons/check.js +5 -0
- package/build/widgets/icons/clear.d.ts +2 -0
- package/build/widgets/icons/clear.js +5 -0
- package/build/widgets/icons/close.d.ts +2 -0
- package/build/widgets/icons/close.js +5 -0
- package/build/widgets/icons/cx.d.ts +2 -0
- package/build/widgets/icons/cx.js +5 -0
- package/build/widgets/icons/drop-down.d.ts +2 -0
- package/build/widgets/icons/drop-down.js +5 -0
- package/build/widgets/icons/file.d.ts +2 -0
- package/build/widgets/icons/file.js +5 -0
- package/build/widgets/icons/folder-open.d.ts +2 -0
- package/build/widgets/icons/folder-open.js +5 -0
- package/build/widgets/icons/folder.d.ts +2 -0
- package/build/widgets/icons/folder.js +5 -0
- package/build/widgets/icons/forward.d.ts +2 -0
- package/build/widgets/icons/forward.js +5 -0
- package/build/widgets/icons/index.d.ts +12 -0
- package/build/widgets/icons/index.js +12 -0
- package/build/widgets/icons/loading.d.ts +2 -0
- package/build/widgets/icons/loading.js +14 -0
- package/build/widgets/icons/menu.d.ts +2 -0
- package/build/widgets/icons/menu.js +5 -0
- package/build/widgets/icons/pixel-picker.d.ts +2 -0
- package/build/widgets/icons/pixel-picker.js +5 -0
- package/build/widgets/icons/registry.d.ts +9 -0
- package/build/widgets/icons/registry.js +40 -0
- package/build/widgets/icons/search.d.ts +2 -0
- package/build/widgets/icons/search.js +5 -0
- package/build/widgets/icons/sort-asc.d.ts +2 -0
- package/build/widgets/icons/sort-asc.js +5 -0
- package/build/widgets/icons/square.d.ts +2 -0
- package/build/widgets/icons/square.js +5 -0
- package/build/widgets/index.d.ts +36 -0
- package/build/widgets/index.js +37 -0
- package/build/widgets/nav/Link.d.ts +6 -0
- package/build/widgets/nav/Link.js +6 -0
- package/build/widgets/nav/LinkButton.d.ts +45 -0
- package/build/widgets/nav/LinkButton.js +110 -0
- package/build/widgets/nav/Menu.d.ts +48 -0
- package/build/widgets/nav/Menu.js +336 -0
- package/build/widgets/nav/MenuItem.d.ts +68 -0
- package/build/widgets/nav/MenuItem.js +364 -0
- package/build/widgets/nav/MenuSpacer.d.ts +13 -0
- package/build/widgets/nav/MenuSpacer.js +11 -0
- package/build/widgets/nav/RedirectRoute.d.ts +14 -0
- package/build/widgets/nav/RedirectRoute.js +30 -0
- package/build/widgets/nav/Route.d.ts +40 -0
- package/build/widgets/nav/Route.js +94 -0
- package/build/widgets/nav/Route.spec.d.ts +1 -0
- package/build/widgets/nav/Route.spec.js +15 -0
- package/build/widgets/nav/Scroller.d.ts +55 -0
- package/build/widgets/nav/Scroller.js +125 -0
- package/build/widgets/nav/Submenu.d.ts +3 -0
- package/build/widgets/nav/Submenu.js +3 -0
- package/build/widgets/nav/Tab.d.ts +40 -0
- package/build/widgets/nav/Tab.js +66 -0
- package/build/widgets/nav/index.d.ts +10 -0
- package/build/widgets/nav/index.js +10 -0
- package/build/widgets/overlay/ContextMenu.d.ts +9 -0
- package/build/widgets/overlay/ContextMenu.js +31 -0
- package/build/widgets/overlay/Dropdown.d.ts +120 -0
- package/build/widgets/overlay/Dropdown.js +522 -0
- package/build/widgets/overlay/FlyweightTooltipTracker.d.ts +22 -0
- package/build/widgets/overlay/FlyweightTooltipTracker.js +39 -0
- package/build/widgets/overlay/MsgBox.d.ts +25 -0
- package/build/widgets/overlay/MsgBox.js +67 -0
- package/build/widgets/overlay/Overlay.d.ts +183 -0
- package/build/widgets/overlay/Overlay.js +597 -0
- package/build/widgets/overlay/Toast.d.ts +27 -0
- package/build/widgets/overlay/Toast.js +76 -0
- package/build/widgets/overlay/Tooltip.d.ts +55 -0
- package/build/widgets/overlay/Tooltip.js +307 -0
- package/build/widgets/overlay/Window.d.ts +65 -0
- package/build/widgets/overlay/Window.js +154 -0
- package/build/widgets/overlay/alerts.d.ts +12 -0
- package/build/widgets/overlay/alerts.js +31 -0
- package/build/widgets/overlay/captureMouse.d.ts +57 -0
- package/build/widgets/overlay/captureMouse.js +147 -0
- package/build/widgets/overlay/createHotPromiseWindowFactory.d.ts +10 -0
- package/build/widgets/overlay/createHotPromiseWindowFactory.js +54 -0
- package/build/widgets/overlay/index.d.ts +11 -0
- package/build/widgets/overlay/index.js +11 -0
- package/build/widgets/overlay/tooltip-ops.d.ts +73 -0
- package/build/widgets/overlay/tooltip-ops.js +34 -0
- package/dist/manifest.js +844 -844
- package/dist/util.js +0 -1
- package/dist/widgets.js +1 -2
- package/package.json +3 -2
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { Localization } from "../../ui/Localization";
|
|
4
|
+
import { ResizeManager } from "../../ui/ResizeManager";
|
|
5
|
+
import { Widget } from "../../ui/Widget";
|
|
6
|
+
import { calculateNaturalElementHeight } from "../../util/calculateNaturalElementHeight";
|
|
7
|
+
import { closestParent, findFirst, isFocusable } from "../../util/DOM";
|
|
8
|
+
import { getTopLevelBoundingClientRect } from "../../util/getTopLevelBoundingClientRect";
|
|
9
|
+
import { isTouchDevice } from "../../util/isTouchDevice";
|
|
10
|
+
import { OverlayBase, OverlayInstance } from "./Overlay";
|
|
11
|
+
export class DropdownInstance extends OverlayInstance {
|
|
12
|
+
mousePosition;
|
|
13
|
+
parentPositionChangeEvent;
|
|
14
|
+
initialScreenPosition;
|
|
15
|
+
relatedElement;
|
|
16
|
+
needsBeacon;
|
|
17
|
+
}
|
|
18
|
+
export class DropdownBase extends OverlayBase {
|
|
19
|
+
init() {
|
|
20
|
+
if (this.trackMouse) {
|
|
21
|
+
this.trackMouseX = true;
|
|
22
|
+
this.trackMouseY = true;
|
|
23
|
+
}
|
|
24
|
+
if (this.autoFocus && !this.hasOwnProperty("focusable"))
|
|
25
|
+
this.focusable = true;
|
|
26
|
+
super.init();
|
|
27
|
+
}
|
|
28
|
+
declareData(...args) {
|
|
29
|
+
return super.declareData(...args, {
|
|
30
|
+
placement: undefined,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
initInstance(context, instance) {
|
|
34
|
+
instance.mousePosition = this.mousePosition;
|
|
35
|
+
instance.parentPositionChangeEvent = context.parentPositionChangeEvent;
|
|
36
|
+
super.initInstance(context, instance);
|
|
37
|
+
}
|
|
38
|
+
explore(context, instance) {
|
|
39
|
+
context.push("lastDropdown", instance);
|
|
40
|
+
super.explore(context, instance);
|
|
41
|
+
}
|
|
42
|
+
exploreCleanup(context, instance) {
|
|
43
|
+
context.pop("lastDropdown");
|
|
44
|
+
super.exploreCleanup(context, instance);
|
|
45
|
+
}
|
|
46
|
+
overlayDidMount(instance, component) {
|
|
47
|
+
super.overlayDidMount(instance, component);
|
|
48
|
+
var scrollableParents = (component.scrollableParents = [window]);
|
|
49
|
+
component.updateDropdownPosition = (e) => this.updateDropdownPosition(instance, component);
|
|
50
|
+
instance.initialScreenPosition = null;
|
|
51
|
+
var el = instance.relatedElement?.parentElement;
|
|
52
|
+
while (el) {
|
|
53
|
+
scrollableParents.push(el);
|
|
54
|
+
el = el.parentElement;
|
|
55
|
+
}
|
|
56
|
+
scrollableParents.forEach((el) => {
|
|
57
|
+
el.addEventListener("scroll", component.updateDropdownPosition);
|
|
58
|
+
});
|
|
59
|
+
component.offResize = ResizeManager.subscribe(component.updateDropdownPosition);
|
|
60
|
+
if (this.onDropdownDidMount)
|
|
61
|
+
instance.invoke("onDropdownDidMount", instance, component);
|
|
62
|
+
if (this.pipeValidateDropdownPosition)
|
|
63
|
+
instance.invoke("pipeValidateDropdownPosition", component.updateDropdownPosition, instance);
|
|
64
|
+
if (instance.parentPositionChangeEvent)
|
|
65
|
+
component.offParentPositionChange = instance.parentPositionChangeEvent.subscribe(component.updateDropdownPosition);
|
|
66
|
+
}
|
|
67
|
+
overlayDidUpdate(instance, component) {
|
|
68
|
+
this.updateDropdownPosition(instance, component);
|
|
69
|
+
}
|
|
70
|
+
overlayWillUnmount(instance, component) {
|
|
71
|
+
var { scrollableParents } = component;
|
|
72
|
+
if (scrollableParents) {
|
|
73
|
+
scrollableParents.forEach((el) => {
|
|
74
|
+
el.removeEventListener("scroll", component.updateDropdownPosition);
|
|
75
|
+
});
|
|
76
|
+
delete component.scrollableParents;
|
|
77
|
+
delete component.updateDropdownPosition;
|
|
78
|
+
}
|
|
79
|
+
if (component.offResize)
|
|
80
|
+
component.offResize();
|
|
81
|
+
if (this.pipeValidateDropdownPosition)
|
|
82
|
+
instance.invoke("pipeValidateDropdownPosition", null, instance);
|
|
83
|
+
if (component.offParentPositionChange)
|
|
84
|
+
component.offParentPositionChange();
|
|
85
|
+
delete component.parentBounds;
|
|
86
|
+
delete component.initialScreenPosition;
|
|
87
|
+
}
|
|
88
|
+
dismissAfterScroll(data, instance, component) {
|
|
89
|
+
if (this.onDismissAfterScroll && instance.invoke("onDismissAfterScroll", data, instance, component) === false)
|
|
90
|
+
return;
|
|
91
|
+
if (instance.dismiss)
|
|
92
|
+
instance.dismiss();
|
|
93
|
+
}
|
|
94
|
+
updateDropdownPosition(instance, component) {
|
|
95
|
+
var { el, initialScreenPosition } = component;
|
|
96
|
+
var { data, relatedElement } = instance;
|
|
97
|
+
var parentBounds = getTopLevelBoundingClientRect(relatedElement);
|
|
98
|
+
//getBoundingClientRect() will return an empty rect if the element is hidden or removed
|
|
99
|
+
if (parentBounds.left == 0 && parentBounds.top == 0 && parentBounds.bottom == 0 && parentBounds.right == 0) {
|
|
100
|
+
if (!component.parentBounds)
|
|
101
|
+
return;
|
|
102
|
+
parentBounds = component.parentBounds;
|
|
103
|
+
}
|
|
104
|
+
else
|
|
105
|
+
component.parentBounds = parentBounds;
|
|
106
|
+
if (this.trackMouseX && instance.mousePosition) {
|
|
107
|
+
parentBounds = new DOMRect(instance.mousePosition.x, parentBounds.top, 0, parentBounds.bottom - parentBounds.top);
|
|
108
|
+
}
|
|
109
|
+
if (this.trackMouseY && instance.mousePosition) {
|
|
110
|
+
parentBounds = new DOMRect(parentBounds.left, instance.mousePosition.y, parentBounds.right - parentBounds.left, 0);
|
|
111
|
+
}
|
|
112
|
+
let explode = this.pad && typeof this.elementExplode === "number" ? this.elementExplode : 0;
|
|
113
|
+
if (explode) {
|
|
114
|
+
parentBounds = new DOMRect(Math.round(parentBounds.left - explode), Math.round(parentBounds.top - explode), Math.round(parentBounds.right - parentBounds.left + 2 * explode), Math.round(parentBounds.bottom - parentBounds.top + 2 * explode));
|
|
115
|
+
}
|
|
116
|
+
var style = {};
|
|
117
|
+
if (this.matchWidth)
|
|
118
|
+
style.minWidth = `${parentBounds.right - parentBounds.left}px`;
|
|
119
|
+
if (this.matchMaxWidth)
|
|
120
|
+
style.maxWidth = `${parentBounds.right - parentBounds.left}px`;
|
|
121
|
+
var contentSize = this.measureNaturalDropdownSize(instance, component);
|
|
122
|
+
var placement = this.findOptimalPlacement(contentSize, parentBounds, data.placement, component.lastPlacement);
|
|
123
|
+
this.applyPositioningPlacementStyles(style, placement, contentSize, parentBounds, el, false);
|
|
124
|
+
component.setCustomStyle(style);
|
|
125
|
+
this.setDirectionClass(component, placement);
|
|
126
|
+
if (this.constrain) {
|
|
127
|
+
//recheck content size for changes as sometimes when auto is used the size can change
|
|
128
|
+
let newContentSize = this.measureNaturalDropdownSize(instance, component);
|
|
129
|
+
if (newContentSize.width != contentSize.width || newContentSize.height != contentSize.height) {
|
|
130
|
+
let newStyle = {};
|
|
131
|
+
this.applyPositioningPlacementStyles(newStyle, placement, newContentSize, parentBounds, el, true);
|
|
132
|
+
component.setCustomStyle(newStyle);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (!initialScreenPosition)
|
|
136
|
+
initialScreenPosition = component.initialScreenPosition = parentBounds;
|
|
137
|
+
if ((!this.trackMouseY && Math.abs(parentBounds.top - initialScreenPosition.top) > this.closeOnScrollDistance) ||
|
|
138
|
+
(!this.trackMouseX && Math.abs(parentBounds.left - initialScreenPosition.left) > this.closeOnScrollDistance))
|
|
139
|
+
this.dismissAfterScroll({ parentBounds, initialScreenPosition }, instance, component);
|
|
140
|
+
instance.positionChangeSubscribers.notify();
|
|
141
|
+
}
|
|
142
|
+
applyFixedPositioningPlacementStyles(style, placement, contentSize, rel, el, noAuto) {
|
|
143
|
+
let viewport = getViewportRect(this.screenPadding);
|
|
144
|
+
style.position = "fixed";
|
|
145
|
+
if (placement.startsWith("down")) {
|
|
146
|
+
style.top = `${(this.cover ? rel.top : rel.bottom) + this.offset}px`;
|
|
147
|
+
let bottom = viewport.bottom - (rel.bottom + this.offset + contentSize.height);
|
|
148
|
+
style.bottom =
|
|
149
|
+
this.constrain && (noAuto || bottom < this.screenPadding + 10)
|
|
150
|
+
? Math.max(this.screenPadding, bottom) + "px"
|
|
151
|
+
: "auto";
|
|
152
|
+
}
|
|
153
|
+
else if (placement.startsWith("up")) {
|
|
154
|
+
let top = rel.top - this.offset - contentSize.height - viewport.top;
|
|
155
|
+
style.top =
|
|
156
|
+
this.constrain && (noAuto || top < this.screenPadding + 10)
|
|
157
|
+
? Math.max(this.screenPadding, top) + "px"
|
|
158
|
+
: "auto";
|
|
159
|
+
style.bottom =
|
|
160
|
+
document.documentElement.offsetHeight - (this.cover ? rel.bottom : rel.top) + this.offset + "px";
|
|
161
|
+
}
|
|
162
|
+
switch (placement) {
|
|
163
|
+
case "down":
|
|
164
|
+
case "down-center":
|
|
165
|
+
style.right = "auto";
|
|
166
|
+
style.left = `${Math.round((rel.left + rel.right - el.offsetWidth) / 2)}px`;
|
|
167
|
+
break;
|
|
168
|
+
case "down-right":
|
|
169
|
+
style.right = "auto";
|
|
170
|
+
style.left = `${rel.left}px`;
|
|
171
|
+
break;
|
|
172
|
+
case "down-left":
|
|
173
|
+
style.right = `${document.documentElement.offsetWidth - rel.right}px`;
|
|
174
|
+
style.left = "auto";
|
|
175
|
+
break;
|
|
176
|
+
case "up":
|
|
177
|
+
case "up-center":
|
|
178
|
+
style.right = "auto";
|
|
179
|
+
style.left = `${Math.round((rel.left + rel.right - el.offsetWidth) / 2)}px`;
|
|
180
|
+
break;
|
|
181
|
+
case "up-right":
|
|
182
|
+
style.right = "auto";
|
|
183
|
+
style.left = `${rel.left}px`;
|
|
184
|
+
break;
|
|
185
|
+
case "up-left":
|
|
186
|
+
style.right = `${document.documentElement.offsetWidth - rel.right}px`;
|
|
187
|
+
style.left = "auto";
|
|
188
|
+
break;
|
|
189
|
+
case "right":
|
|
190
|
+
case "right-center":
|
|
191
|
+
style.top = `${Math.round((rel.top + rel.bottom - el.offsetHeight) / 2)}px`;
|
|
192
|
+
style.right = "auto";
|
|
193
|
+
style.bottom = "auto";
|
|
194
|
+
style.left = `${rel.right + this.offset}px`;
|
|
195
|
+
break;
|
|
196
|
+
case "right-down":
|
|
197
|
+
style.top = `${rel.top}px`;
|
|
198
|
+
style.right = "auto";
|
|
199
|
+
style.bottom = "auto";
|
|
200
|
+
style.left = `${rel.right + this.offset}px`;
|
|
201
|
+
break;
|
|
202
|
+
case "right-up":
|
|
203
|
+
style.top = "auto";
|
|
204
|
+
style.right = "auto";
|
|
205
|
+
style.bottom = `${document.documentElement.offsetHeight - rel.bottom}px`;
|
|
206
|
+
style.left = `${rel.right + this.offset}px`;
|
|
207
|
+
break;
|
|
208
|
+
case "left":
|
|
209
|
+
case "left-center":
|
|
210
|
+
style.top = `${Math.round((rel.top + rel.bottom - el.offsetHeight) / 2)}px`;
|
|
211
|
+
style.right = `${document.documentElement.offsetWidth - rel.left + this.offset}px`;
|
|
212
|
+
style.bottom = "auto";
|
|
213
|
+
style.left = "auto";
|
|
214
|
+
break;
|
|
215
|
+
case "left-down":
|
|
216
|
+
style.top = `${rel.top}px`;
|
|
217
|
+
style.right = `${document.documentElement.offsetWidth - rel.left + this.offset}px`;
|
|
218
|
+
style.bottom = "auto";
|
|
219
|
+
style.left = "auto";
|
|
220
|
+
break;
|
|
221
|
+
case "left-up":
|
|
222
|
+
style.top = "auto";
|
|
223
|
+
style.right = `${document.documentElement.offsetWidth - rel.left + this.offset}px`;
|
|
224
|
+
style.bottom = `${document.documentElement.offsetHeight - rel.bottom}px`;
|
|
225
|
+
style.left = "auto";
|
|
226
|
+
break;
|
|
227
|
+
case "screen-center":
|
|
228
|
+
let w = Math.min(contentSize.width, document.documentElement.offsetWidth - 2 * this.screenPadding);
|
|
229
|
+
let h = Math.min(contentSize.height, document.documentElement.offsetHeight - 2 * this.screenPadding);
|
|
230
|
+
style.top = `${Math.round((document.documentElement.offsetHeight - h) / 2)}px`;
|
|
231
|
+
style.right = `${Math.round((document.documentElement.offsetWidth - w) / 2)}px`;
|
|
232
|
+
style.bottom = `${Math.round((document.documentElement.offsetHeight - h) / 2)}px`;
|
|
233
|
+
style.left = `${Math.round((document.documentElement.offsetWidth - w) / 2)}px`;
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
applyAbsolutePositioningPlacementStyles(style, placement, contentSize, rel, el, noAuto) {
|
|
238
|
+
var viewport = getViewportRect(this.screenPadding);
|
|
239
|
+
style.position = "absolute";
|
|
240
|
+
if (placement.startsWith("down")) {
|
|
241
|
+
style.top = `${rel.bottom - rel.top + this.offset}px`;
|
|
242
|
+
let room = viewport.bottom - rel.bottom + this.offset;
|
|
243
|
+
style.bottom =
|
|
244
|
+
this.constrain && (noAuto || contentSize.height >= room - 10)
|
|
245
|
+
? `${-Math.min(room, contentSize.height)}px`
|
|
246
|
+
: "auto";
|
|
247
|
+
}
|
|
248
|
+
else if (placement.startsWith("up")) {
|
|
249
|
+
let room = rel.top - this.offset - viewport.top;
|
|
250
|
+
style.top =
|
|
251
|
+
this.constrain && (noAuto || contentSize.height >= room - 10)
|
|
252
|
+
? `${-Math.min(room, contentSize.height)}px`
|
|
253
|
+
: "auto";
|
|
254
|
+
style.bottom = `${rel.bottom - rel.top - this.offset}px`;
|
|
255
|
+
}
|
|
256
|
+
switch (placement) {
|
|
257
|
+
case "down":
|
|
258
|
+
case "down-center":
|
|
259
|
+
style.right = "auto";
|
|
260
|
+
style.left = `${Math.round((rel.right - rel.left - el.offsetWidth) / 2)}px`;
|
|
261
|
+
break;
|
|
262
|
+
case "down-right":
|
|
263
|
+
style.right = "auto";
|
|
264
|
+
style.left = `0`;
|
|
265
|
+
break;
|
|
266
|
+
case "down-left":
|
|
267
|
+
style.right = `0`;
|
|
268
|
+
style.left = "auto";
|
|
269
|
+
break;
|
|
270
|
+
case "up":
|
|
271
|
+
case "up-center":
|
|
272
|
+
style.right = "auto";
|
|
273
|
+
style.left = `${Math.round((rel.right - rel.left - el.offsetWidth) / 2)}px`;
|
|
274
|
+
break;
|
|
275
|
+
case "up-right":
|
|
276
|
+
style.right = "auto";
|
|
277
|
+
style.left = `0`;
|
|
278
|
+
break;
|
|
279
|
+
case "up-left":
|
|
280
|
+
style.right = `0`;
|
|
281
|
+
style.left = "auto";
|
|
282
|
+
break;
|
|
283
|
+
case "right":
|
|
284
|
+
case "right-center":
|
|
285
|
+
style.top = `${Math.round((rel.bottom - rel.top - el.offsetHeight) / 2)}px`;
|
|
286
|
+
style.right = "auto";
|
|
287
|
+
style.bottom = "auto";
|
|
288
|
+
style.left = `${rel.right - rel.left + this.offset}px`;
|
|
289
|
+
break;
|
|
290
|
+
case "right-down":
|
|
291
|
+
style.top = `0`;
|
|
292
|
+
style.right = "auto";
|
|
293
|
+
style.bottom = "auto";
|
|
294
|
+
style.left = `${rel.right - rel.left + this.offset}px`;
|
|
295
|
+
break;
|
|
296
|
+
case "right-up":
|
|
297
|
+
style.top = "auto";
|
|
298
|
+
style.right = "auto";
|
|
299
|
+
style.bottom = `0`;
|
|
300
|
+
style.left = `${rel.right - rel.left + this.offset}px`;
|
|
301
|
+
break;
|
|
302
|
+
case "left":
|
|
303
|
+
case "left-center":
|
|
304
|
+
style.top = `${Math.round((rel.bottom - rel.top - el.offsetHeight) / 2)}px`;
|
|
305
|
+
style.right = `${rel.right - rel.left + this.offset}px`;
|
|
306
|
+
style.bottom = "auto";
|
|
307
|
+
style.left = "auto";
|
|
308
|
+
break;
|
|
309
|
+
case "left-down":
|
|
310
|
+
style.top = `0`;
|
|
311
|
+
style.right = `${rel.right - rel.left + this.offset}px`;
|
|
312
|
+
style.bottom = "auto";
|
|
313
|
+
style.left = "auto";
|
|
314
|
+
break;
|
|
315
|
+
case "left-up":
|
|
316
|
+
style.top = "auto";
|
|
317
|
+
style.right = `${rel.right - rel.left + this.offset}px`;
|
|
318
|
+
style.bottom = `0`;
|
|
319
|
+
style.left = "auto";
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
applyPositioningPlacementStyles(style, placement, contentSize, parentBounds, el, noAuto) {
|
|
324
|
+
switch (this.positioning) {
|
|
325
|
+
case "absolute":
|
|
326
|
+
this.applyAbsolutePositioningPlacementStyles(style, placement, contentSize, parentBounds, el, noAuto);
|
|
327
|
+
break;
|
|
328
|
+
case "auto":
|
|
329
|
+
if (isTouchDevice())
|
|
330
|
+
this.applyAbsolutePositioningPlacementStyles(style, placement, contentSize, parentBounds, el, noAuto);
|
|
331
|
+
else
|
|
332
|
+
this.applyFixedPositioningPlacementStyles(style, placement, contentSize, parentBounds, el, noAuto);
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
this.applyFixedPositioningPlacementStyles(style, placement, contentSize, parentBounds, el, noAuto);
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
setDirectionClass(component, placement) {
|
|
340
|
+
var state = {
|
|
341
|
+
"place-left": false,
|
|
342
|
+
"place-right": false,
|
|
343
|
+
"place-up": false,
|
|
344
|
+
"place-down": false,
|
|
345
|
+
};
|
|
346
|
+
component.lastPlacement = placement;
|
|
347
|
+
component.setCSSState({
|
|
348
|
+
...state,
|
|
349
|
+
["place-" + placement]: true,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
measureNaturalDropdownSize(instance, component) {
|
|
353
|
+
var { el } = component;
|
|
354
|
+
var size = {
|
|
355
|
+
width: el.offsetWidth,
|
|
356
|
+
height: this.constrain
|
|
357
|
+
? calculateNaturalElementHeight(el)
|
|
358
|
+
: el.offsetHeight - el.clientHeight + el.scrollHeight,
|
|
359
|
+
};
|
|
360
|
+
if (this.firstChildDefinesHeight && el.firstChild) {
|
|
361
|
+
size.height = el.firstChild.offsetHeight;
|
|
362
|
+
}
|
|
363
|
+
if (this.firstChildDefinesWidth && el.firstChild) {
|
|
364
|
+
size.width = el.firstChild.offsetWidth;
|
|
365
|
+
}
|
|
366
|
+
if (this.onMeasureNaturalContentSize) {
|
|
367
|
+
var more = instance.invoke("onMeasureNaturalContentSize", el, instance, component);
|
|
368
|
+
Object.assign(size, more);
|
|
369
|
+
}
|
|
370
|
+
return size;
|
|
371
|
+
}
|
|
372
|
+
findOptimalPlacement(contentSize, target, placement, lastPlacement) {
|
|
373
|
+
var placementOrder = this.placementOrder.split(" ");
|
|
374
|
+
var best = lastPlacement || placement;
|
|
375
|
+
var first;
|
|
376
|
+
var score = {};
|
|
377
|
+
var viewport = getViewportRect();
|
|
378
|
+
for (var i = 0; i < placementOrder.length; i++) {
|
|
379
|
+
var p = placementOrder[i];
|
|
380
|
+
if (!first)
|
|
381
|
+
first = p;
|
|
382
|
+
var parts = p.split("-");
|
|
383
|
+
var primary = parts[0];
|
|
384
|
+
var secondary = parts[1] || "center";
|
|
385
|
+
score[p] = 0;
|
|
386
|
+
var vertical = true;
|
|
387
|
+
switch (primary) {
|
|
388
|
+
case "down":
|
|
389
|
+
score[p] += 3 * Math.min(1, (viewport.bottom - target.bottom - this.offset) / contentSize.height);
|
|
390
|
+
break;
|
|
391
|
+
case "up":
|
|
392
|
+
score[p] += 3 * Math.min(1, (target.top - viewport.top - this.offset) / contentSize.height);
|
|
393
|
+
break;
|
|
394
|
+
case "right":
|
|
395
|
+
score[p] += target.right + contentSize.width + this.offset < viewport.right ? 3 : 0;
|
|
396
|
+
vertical = false;
|
|
397
|
+
break;
|
|
398
|
+
case "left":
|
|
399
|
+
score[p] += target.left - contentSize.width - this.offset >= viewport.left ? 3 : 0;
|
|
400
|
+
vertical = false;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
switch (secondary) {
|
|
404
|
+
case "center":
|
|
405
|
+
if (vertical) {
|
|
406
|
+
score[p] += (target.right + target.left - contentSize.width) / 2 >= viewport.left ? 1 : 0;
|
|
407
|
+
score[p] += (target.right + target.left + contentSize.width) / 2 < viewport.right ? 1 : 0;
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
score[p] += (target.bottom + target.top - contentSize.height) / 2 >= viewport.top ? 1 : 0;
|
|
411
|
+
score[p] += (target.bottom + target.top + contentSize.height) / 2 < viewport.bottom ? 1 : 0;
|
|
412
|
+
}
|
|
413
|
+
break;
|
|
414
|
+
case "right":
|
|
415
|
+
score[p] += target.left + contentSize.width < viewport.right ? 2 : 0;
|
|
416
|
+
break;
|
|
417
|
+
case "left":
|
|
418
|
+
score[p] += target.right - contentSize.width >= viewport.left ? 2 : 0;
|
|
419
|
+
break;
|
|
420
|
+
case "up":
|
|
421
|
+
score[p] += target.bottom - contentSize.height >= viewport.top ? 2 : 0;
|
|
422
|
+
break;
|
|
423
|
+
case "down":
|
|
424
|
+
score[p] += target.top + contentSize.height < viewport.bottom ? 2 : 0;
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (!(best in score))
|
|
429
|
+
best = first;
|
|
430
|
+
for (var k in score)
|
|
431
|
+
if (score[k] > score[best])
|
|
432
|
+
best = k;
|
|
433
|
+
if (this.touchFriendly && isTouchDevice() && score[best] < 5)
|
|
434
|
+
return "screen-center";
|
|
435
|
+
return best;
|
|
436
|
+
}
|
|
437
|
+
handleKeyDown(e, instance) {
|
|
438
|
+
switch (e.keyCode) {
|
|
439
|
+
case 27: //esc
|
|
440
|
+
var focusable = findFirst(instance.relatedElement, isFocusable);
|
|
441
|
+
if (focusable)
|
|
442
|
+
focusable.focus();
|
|
443
|
+
e.stopPropagation();
|
|
444
|
+
e.preventDefault();
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
if (this.onKeyDown)
|
|
448
|
+
instance.invoke("onKeyDown", e, instance);
|
|
449
|
+
}
|
|
450
|
+
renderContents(context, instance) {
|
|
451
|
+
let { CSS, baseClass } = this;
|
|
452
|
+
let result = [super.renderContents(context, instance)];
|
|
453
|
+
if (this.arrow) {
|
|
454
|
+
result.push(_jsx("div", { className: CSS.element(baseClass, "arrow-border") }, "arrow-border"), _jsx("div", { className: CSS.element(baseClass, "arrow-fill") }, "arrow-back"));
|
|
455
|
+
}
|
|
456
|
+
return result;
|
|
457
|
+
}
|
|
458
|
+
render(context, instance, key) {
|
|
459
|
+
let { CSS, baseClass } = this;
|
|
460
|
+
//if relatedElement is not provided, a beacon is rendered to and used to resolve a nearby element as a target
|
|
461
|
+
//if onResolveTarget doesn't provide another element, the beacon itself is used as a target
|
|
462
|
+
let beacon = null;
|
|
463
|
+
if (this.relatedElement)
|
|
464
|
+
instance.relatedElement = this.relatedElement;
|
|
465
|
+
if (!this.relatedElement || instance.needsBeacon) {
|
|
466
|
+
beacon = (_jsx("div", { className: CSS.element(baseClass, "beacon"), ref: (el) => {
|
|
467
|
+
if (instance.relatedElement || !el)
|
|
468
|
+
return;
|
|
469
|
+
let target = el;
|
|
470
|
+
if (this.onResolveRelatedElement)
|
|
471
|
+
target = instance.invoke("onResolveRelatedElement", el, instance);
|
|
472
|
+
else
|
|
473
|
+
target = el.previousElementSibling;
|
|
474
|
+
if (!target)
|
|
475
|
+
target = el;
|
|
476
|
+
if (target == el)
|
|
477
|
+
instance.needsBeacon = true;
|
|
478
|
+
instance.relatedElement = target;
|
|
479
|
+
instance.setState({ dummy: {} });
|
|
480
|
+
} }, `${key}-beacon`));
|
|
481
|
+
}
|
|
482
|
+
return [beacon, instance.relatedElement && super.render(context, instance, key)];
|
|
483
|
+
}
|
|
484
|
+
getOverlayContainer() {
|
|
485
|
+
// this should be instance.relatedElement
|
|
486
|
+
if (this.relatedElement) {
|
|
487
|
+
let container = closestParent(this.relatedElement, (el) => el.dataset && !!el.dataset.focusableOverlayContainer);
|
|
488
|
+
if (container)
|
|
489
|
+
return container;
|
|
490
|
+
}
|
|
491
|
+
return super.getOverlayContainer();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
DropdownBase.prototype.offset = 0;
|
|
495
|
+
DropdownBase.prototype.baseClass = "dropdown";
|
|
496
|
+
DropdownBase.prototype.matchWidth = true;
|
|
497
|
+
DropdownBase.prototype.matchMaxWidth = false;
|
|
498
|
+
DropdownBase.prototype.placementOrder = "up down right left";
|
|
499
|
+
DropdownBase.prototype.placement = null; //default placement
|
|
500
|
+
DropdownBase.prototype.constrain = false;
|
|
501
|
+
DropdownBase.prototype.positioning = "fixed";
|
|
502
|
+
DropdownBase.prototype.touchFriendly = false;
|
|
503
|
+
DropdownBase.prototype.arrow = false;
|
|
504
|
+
DropdownBase.prototype.pad = false;
|
|
505
|
+
DropdownBase.prototype.elementExplode = 0;
|
|
506
|
+
DropdownBase.prototype.closeOnScrollDistance = 50;
|
|
507
|
+
DropdownBase.prototype.screenPadding = 5;
|
|
508
|
+
DropdownBase.prototype.firstChildDefinesHeight = false;
|
|
509
|
+
DropdownBase.prototype.firstChildDefinesWidth = false;
|
|
510
|
+
DropdownBase.prototype.cover = false;
|
|
511
|
+
export class Dropdown extends DropdownBase {
|
|
512
|
+
}
|
|
513
|
+
Widget.alias("dropdown", Dropdown);
|
|
514
|
+
Localization.registerPrototype("cx/widgets/Dropdown", Dropdown);
|
|
515
|
+
function getViewportRect(padding = 0) {
|
|
516
|
+
return {
|
|
517
|
+
left: padding,
|
|
518
|
+
top: padding,
|
|
519
|
+
right: document.documentElement.offsetWidth - padding,
|
|
520
|
+
bottom: document.documentElement.offsetHeight - padding,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Instance } from "../../ui/Instance";
|
|
2
|
+
import { RenderingContext } from "../../ui/RenderingContext";
|
|
3
|
+
import { Widget } from "../../ui/Widget";
|
|
4
|
+
import type { TooltipInstance } from "./Tooltip";
|
|
5
|
+
import { TooltipParentInstance, TooltipProp } from "./tooltip-ops";
|
|
6
|
+
export interface FlyweightTooltipTrackerConfig {
|
|
7
|
+
onGetTooltip?: (element: Element, instance: Instance) => TooltipProp;
|
|
8
|
+
}
|
|
9
|
+
export declare class FlyweightTooltipTrackerInstance extends Instance<FlyweightTooltipTracker> implements TooltipParentInstance {
|
|
10
|
+
lastTarget?: EventTarget | null;
|
|
11
|
+
tooltip?: TooltipProp;
|
|
12
|
+
parentEl?: Element;
|
|
13
|
+
tooltips: {
|
|
14
|
+
[key: string]: TooltipInstance;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare class FlyweightTooltipTracker extends Widget {
|
|
18
|
+
onGetTooltip?: (element: Element, instance: Instance) => TooltipProp | undefined;
|
|
19
|
+
initInstance(context: RenderingContext, instance: FlyweightTooltipTrackerInstance): void;
|
|
20
|
+
render(context: RenderingContext, instance: FlyweightTooltipTrackerInstance, key: string): any;
|
|
21
|
+
handleMouseMove(e: MouseEvent, instance: FlyweightTooltipTrackerInstance): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Instance } from "../../ui/Instance";
|
|
2
|
+
import { Widget } from "../../ui/Widget";
|
|
3
|
+
import { closest } from "../../util";
|
|
4
|
+
import { tooltipMouseLeave, tooltipMouseMove } from "./tooltip-ops";
|
|
5
|
+
export class FlyweightTooltipTrackerInstance extends Instance {
|
|
6
|
+
}
|
|
7
|
+
export class FlyweightTooltipTracker extends Widget {
|
|
8
|
+
initInstance(context, instance) {
|
|
9
|
+
let handler = (e) => this.handleMouseMove(e, instance);
|
|
10
|
+
document.addEventListener("mousemove", handler);
|
|
11
|
+
instance.subscribeOnDestroy(() => {
|
|
12
|
+
document.removeEventListener("mousemove", handler);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
render(context, instance, key) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
handleMouseMove(e, instance) {
|
|
19
|
+
if (!this.onGetTooltip)
|
|
20
|
+
return;
|
|
21
|
+
let parentEl, tooltip;
|
|
22
|
+
if (instance.lastTarget == e.target)
|
|
23
|
+
return;
|
|
24
|
+
instance.lastTarget = e.target;
|
|
25
|
+
parentEl = closest(e.target, (element) => {
|
|
26
|
+
tooltip = instance.invoke("onGetTooltip", element, instance);
|
|
27
|
+
return !!tooltip;
|
|
28
|
+
});
|
|
29
|
+
if (!parentEl)
|
|
30
|
+
tooltipMouseLeave(e, instance, instance.tooltip, { target: instance.parentEl });
|
|
31
|
+
else {
|
|
32
|
+
instance.tooltip = tooltip;
|
|
33
|
+
instance.parentEl = parentEl;
|
|
34
|
+
tooltipMouseMove(e, instance, instance.tooltip, {
|
|
35
|
+
target: parentEl,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface MsgBoxOptions {
|
|
2
|
+
message?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
header?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
callback?: (option?: string) => boolean | void;
|
|
7
|
+
okText?: string;
|
|
8
|
+
yesText?: string;
|
|
9
|
+
noText?: string;
|
|
10
|
+
yesButtonMod?: string;
|
|
11
|
+
noButtonMod?: string;
|
|
12
|
+
items?: any;
|
|
13
|
+
children?: any;
|
|
14
|
+
store?: any;
|
|
15
|
+
}
|
|
16
|
+
export declare class MsgBox {
|
|
17
|
+
buttonMod?: string;
|
|
18
|
+
footerDirection?: string;
|
|
19
|
+
footerJustify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | false;
|
|
20
|
+
yesText?: string;
|
|
21
|
+
noText?: string;
|
|
22
|
+
static alert(options: string | MsgBoxOptions): Promise<void>;
|
|
23
|
+
static yesNo(options: string | MsgBoxOptions): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare function enableMsgBoxAlerts(): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "cx/jsx-runtime";
|
|
2
|
+
import { Window } from "./Window";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
import { Localization } from "../../ui/Localization";
|
|
5
|
+
import { FlexRow } from "../FlexBox";
|
|
6
|
+
import { registerAlertImpl } from "./alerts";
|
|
7
|
+
import { isString } from "../../util/isString";
|
|
8
|
+
export class MsgBox {
|
|
9
|
+
buttonMod;
|
|
10
|
+
footerDirection;
|
|
11
|
+
footerJustify;
|
|
12
|
+
yesText;
|
|
13
|
+
noText;
|
|
14
|
+
static alert(options) {
|
|
15
|
+
let opts;
|
|
16
|
+
if (isString(options))
|
|
17
|
+
opts = {
|
|
18
|
+
message: options,
|
|
19
|
+
};
|
|
20
|
+
else
|
|
21
|
+
opts = options;
|
|
22
|
+
return new Promise(function (resolve) {
|
|
23
|
+
let callback = (e, instance) => {
|
|
24
|
+
if (opts.callback && opts.callback() === false)
|
|
25
|
+
return;
|
|
26
|
+
instance.parentOptions.dismiss();
|
|
27
|
+
resolve();
|
|
28
|
+
};
|
|
29
|
+
let w = Window.create(_jsx("cx", { children: _jsxs(Window, { title: opts.title, header: opts.header, mod: "alert", modal: true, center: true, resizable: false, closable: false, style: opts.style || "max-width: 90vw", dismissOnPopState: true, children: [opts.message || opts.items || opts.children, _jsx(FlexRow, { putInto: "footer", direction: MsgBox.prototype.footerDirection, justify: MsgBox.prototype.footerJustify, children: _jsx(Button, { mod: MsgBox.prototype.buttonMod, onClick: callback, children: opts.okText || "OK" }) })] }) }));
|
|
30
|
+
w.open(opts.store);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
static yesNo(options) {
|
|
34
|
+
let opts;
|
|
35
|
+
if (isString(options))
|
|
36
|
+
opts = {
|
|
37
|
+
message: options,
|
|
38
|
+
};
|
|
39
|
+
else
|
|
40
|
+
opts = options;
|
|
41
|
+
return new Promise(function (resolve, reject) {
|
|
42
|
+
let callback = (option) => (e, instance) => {
|
|
43
|
+
if (opts.callback && opts.callback(option) === false)
|
|
44
|
+
return;
|
|
45
|
+
instance.parentOptions.dismiss();
|
|
46
|
+
if (option == "yes")
|
|
47
|
+
resolve(option);
|
|
48
|
+
else
|
|
49
|
+
resolve(option);
|
|
50
|
+
};
|
|
51
|
+
let w = Window.create(_jsx("cx", { children: _jsxs(Window, { title: opts.title, header: opts.header, mod: "alert", modal: true, center: true, resizable: false, closable: false, style: opts.style || "max-width: 90vw", dismissOnPopState: true, children: [opts.message || opts.items || opts.children, _jsxs(FlexRow, { putInto: "footer", direction: MsgBox.prototype.footerDirection, justify: MsgBox.prototype.footerJustify, hspacing: "small", children: [_jsx(Button, { mod: opts.yesButtonMod || MsgBox.prototype.buttonMod, onClick: callback("yes"), children: opts.yesText || MsgBox.prototype.yesText }), _jsx(Button, { mod: opts.noButtonMod || MsgBox.prototype.buttonMod, onClick: callback("no"), children: opts.noText || MsgBox.prototype.noText })] })] }) }));
|
|
52
|
+
w.open(opts.store);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
MsgBox.prototype.buttonMod = undefined;
|
|
57
|
+
MsgBox.prototype.footerDirection = "row";
|
|
58
|
+
MsgBox.prototype.footerJustify = "center";
|
|
59
|
+
MsgBox.prototype.yesText = "Yes";
|
|
60
|
+
MsgBox.prototype.noText = "No";
|
|
61
|
+
Localization.registerPrototype("cx/widgets/MsgBox", MsgBox);
|
|
62
|
+
export function enableMsgBoxAlerts() {
|
|
63
|
+
registerAlertImpl({
|
|
64
|
+
yesNo: MsgBox.yesNo.bind(MsgBox),
|
|
65
|
+
alert: MsgBox.alert.bind(MsgBox),
|
|
66
|
+
});
|
|
67
|
+
}
|