cx 26.0.1 → 26.0.2
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 +2 -2
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**@jsxImportSource react */
|
|
3
|
+
import { Widget, VDOM, getContent } from "../../ui/Widget";
|
|
4
|
+
import { Cx } from "../../ui/Cx";
|
|
5
|
+
import { Field, getFieldTooltip } from "./Field";
|
|
6
|
+
import { ReadOnlyDataView } from "../../data/ReadOnlyDataView";
|
|
7
|
+
import { Binding } from "../../data/Binding";
|
|
8
|
+
import { debug } from "../../util/Debug";
|
|
9
|
+
import { Dropdown } from "../overlay/Dropdown";
|
|
10
|
+
import { FocusManager } from "../../ui/FocusManager";
|
|
11
|
+
import { isFocused } from "../../util/DOM";
|
|
12
|
+
import { isTouchDevice } from "../../util/isTouchDevice";
|
|
13
|
+
import { isTouchEvent } from "../../util/isTouchEvent";
|
|
14
|
+
import { tooltipParentWillReceiveProps, tooltipParentWillUnmount, tooltipMouseMove, tooltipMouseLeave, tooltipParentDidMount, } from "../overlay/tooltip-ops";
|
|
15
|
+
import { stopPropagation, preventDefault } from "../../util/eventCallbacks";
|
|
16
|
+
import ClearIcon from "../icons/clear";
|
|
17
|
+
import DropdownIcon from "../icons/drop-down";
|
|
18
|
+
import { getSearchQueryPredicate } from "../../util/getSearchQueryPredicate";
|
|
19
|
+
import { KeyCode } from "../../util/KeyCode";
|
|
20
|
+
import { Localization } from "../../ui/Localization";
|
|
21
|
+
import { StringTemplate } from "../../data/StringTemplate";
|
|
22
|
+
import { isString } from "../../util/isString";
|
|
23
|
+
import { isDefined } from "../../util/isDefined";
|
|
24
|
+
import { isArray } from "../../util/isArray";
|
|
25
|
+
import { isNonEmptyArray } from "../../util/isNonEmptyArray";
|
|
26
|
+
import { addEventListenerWithOptions } from "../../util/addEventListenerWithOptions";
|
|
27
|
+
import { List } from "../List";
|
|
28
|
+
import { Selection } from "../../ui/selection/Selection";
|
|
29
|
+
import { HighlightedSearchText } from "../HighlightedSearchText";
|
|
30
|
+
import { autoFocus } from "../autoFocus";
|
|
31
|
+
import { bind } from "../../ui";
|
|
32
|
+
import { isAccessorChain } from "../../data/createAccessorModelProxy";
|
|
33
|
+
export class LookupField extends Field {
|
|
34
|
+
declareData(...args) {
|
|
35
|
+
let additionalAttributes = this.multiple
|
|
36
|
+
? { values: undefined, records: undefined }
|
|
37
|
+
: { value: undefined, text: undefined };
|
|
38
|
+
super.declareData({
|
|
39
|
+
disabled: undefined,
|
|
40
|
+
enabled: undefined,
|
|
41
|
+
placeholder: undefined,
|
|
42
|
+
required: undefined,
|
|
43
|
+
options: undefined,
|
|
44
|
+
icon: undefined,
|
|
45
|
+
autoOpen: undefined,
|
|
46
|
+
readOnly: undefined,
|
|
47
|
+
filterParams: { structured: true },
|
|
48
|
+
}, additionalAttributes, ...args);
|
|
49
|
+
}
|
|
50
|
+
init() {
|
|
51
|
+
if (isDefined(this.hideClear))
|
|
52
|
+
this.showClear = !this.hideClear;
|
|
53
|
+
if (this.alwaysShowClear)
|
|
54
|
+
this.showClear = true;
|
|
55
|
+
if (!this.bindings) {
|
|
56
|
+
let b = [];
|
|
57
|
+
if (this.value) {
|
|
58
|
+
if (isAccessorChain(this.value))
|
|
59
|
+
this.value = bind(this.value);
|
|
60
|
+
if (this.value.bind)
|
|
61
|
+
b.push({
|
|
62
|
+
key: true,
|
|
63
|
+
local: this.value.bind,
|
|
64
|
+
remote: `$option.${this.optionIdField}`,
|
|
65
|
+
set: this.value.set,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (this.text) {
|
|
69
|
+
if (isAccessorChain(this.text))
|
|
70
|
+
this.text = bind(this.text);
|
|
71
|
+
if (this.text.bind)
|
|
72
|
+
b.push({
|
|
73
|
+
local: this.text.bind,
|
|
74
|
+
remote: `$option.${this.optionTextField}`,
|
|
75
|
+
set: this.text.set,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
this.bindings = b;
|
|
79
|
+
}
|
|
80
|
+
if (this.bindings.length == 0 && this.multiple)
|
|
81
|
+
this.bindings = [
|
|
82
|
+
{
|
|
83
|
+
key: true,
|
|
84
|
+
local: `$value.${this.valueIdField}`,
|
|
85
|
+
remote: `$option.${this.optionIdField}`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
local: `$value.${this.valueTextField}`,
|
|
89
|
+
remote: `$option.${this.optionTextField}`,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
this.keyBindings = this.bindings.filter((b) => b.key);
|
|
93
|
+
if (!this.items && !this.children)
|
|
94
|
+
this.items = {
|
|
95
|
+
type: HighlightedSearchText,
|
|
96
|
+
text: { bind: `$option.${this.optionTextField}` },
|
|
97
|
+
query: { bind: "$query" },
|
|
98
|
+
};
|
|
99
|
+
this.itemConfig = this.children || this.items;
|
|
100
|
+
this.items = [];
|
|
101
|
+
delete this.children;
|
|
102
|
+
super.init();
|
|
103
|
+
}
|
|
104
|
+
prepareData(context, instance) {
|
|
105
|
+
let { data, store } = instance;
|
|
106
|
+
data.stateMods = {
|
|
107
|
+
multiple: this.multiple,
|
|
108
|
+
single: !this.multiple,
|
|
109
|
+
disabled: data.disabled,
|
|
110
|
+
readonly: data.readOnly,
|
|
111
|
+
};
|
|
112
|
+
data.visibleOptions = data.options;
|
|
113
|
+
if (this.onCreateVisibleOptionsFilter && isArray(data.options)) {
|
|
114
|
+
let filterPredicate = instance.invoke("onCreateVisibleOptionsFilter", data.filterParams, instance);
|
|
115
|
+
data.visibleOptions = data.options.filter(filterPredicate);
|
|
116
|
+
}
|
|
117
|
+
data.selectedKeys = [];
|
|
118
|
+
if (this.multiple) {
|
|
119
|
+
if (isArray(data.values) && isArray(data.options)) {
|
|
120
|
+
data.selectedKeys = data.values.map((v) => (this.keyBindings.length == 1 ? [v] : v));
|
|
121
|
+
let map = {};
|
|
122
|
+
data.options.filter(($option) => {
|
|
123
|
+
let optionKey = getOptionKey(this.keyBindings, { $option });
|
|
124
|
+
for (let i = 0; i < data.selectedKeys.length; i++)
|
|
125
|
+
if (areKeysEqual(optionKey, data.selectedKeys[i])) {
|
|
126
|
+
map[i] = convertOption(this.bindings, { $option });
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
data.records = [];
|
|
131
|
+
for (let i = 0; i < data.selectedKeys.length; i++)
|
|
132
|
+
if (map[i])
|
|
133
|
+
data.records.push(map[i]);
|
|
134
|
+
}
|
|
135
|
+
else if (isArray(data.records))
|
|
136
|
+
data.selectedKeys.push(...data.records.map(($value) => this.keyBindings.map((b) => Binding.get(b.local).value({ $value }))));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
let dataViewData = store.getData();
|
|
140
|
+
data.selectedKeys.push(this.keyBindings.map((b) => Binding.get(b.local).value(dataViewData)));
|
|
141
|
+
if (!this.text && isArray(data.options)) {
|
|
142
|
+
let option = data.options.find(($option) => areKeysEqual(getOptionKey(this.keyBindings, { $option }), data.selectedKeys[0]));
|
|
143
|
+
data.text = (option && option[this.optionTextField]) || "";
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
instance.lastDropdown = context.lastDropdown;
|
|
147
|
+
super.prepareData(context, instance);
|
|
148
|
+
}
|
|
149
|
+
renderInput(context, instance, key) {
|
|
150
|
+
return (_jsx(LookupComponent, { multiple: this.multiple, instance: instance, itemConfig: this.itemConfig, bindings: this.bindings, baseClass: this.baseClass, label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")), help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")), forceUpdate: context.forceUpdate, icon: this.renderIcon(context, instance, "icon") }, key));
|
|
151
|
+
}
|
|
152
|
+
filterOptions(instance, options, query) {
|
|
153
|
+
if (!query)
|
|
154
|
+
return options;
|
|
155
|
+
let textPredicate = getSearchQueryPredicate(query);
|
|
156
|
+
return options.filter((o) => isString(o[this.optionTextField]) && textPredicate(o[this.optionTextField]));
|
|
157
|
+
}
|
|
158
|
+
isEmpty(data) {
|
|
159
|
+
if (this.multiple)
|
|
160
|
+
return !isNonEmptyArray(data.values) && !isNonEmptyArray(data.records);
|
|
161
|
+
return super.isEmpty(data);
|
|
162
|
+
}
|
|
163
|
+
getValidationValue(data) {
|
|
164
|
+
if (this.multiple)
|
|
165
|
+
return data.records ?? data.values;
|
|
166
|
+
return super.getValidationValue(data);
|
|
167
|
+
}
|
|
168
|
+
formatValue(context, instance) {
|
|
169
|
+
if (!this.multiple)
|
|
170
|
+
return super.formatValue(context, instance);
|
|
171
|
+
let { records, values, options } = instance.data;
|
|
172
|
+
if (isArray(records)) {
|
|
173
|
+
let valueTextFormatter = typeof this.onGetRecordDisplayText === "function"
|
|
174
|
+
? this.onGetRecordDisplayText
|
|
175
|
+
: (record) => record[this.valueTextField] || record[this.valueIdField];
|
|
176
|
+
return records.map((record) => valueTextFormatter(record, instance));
|
|
177
|
+
}
|
|
178
|
+
if (isArray(values)) {
|
|
179
|
+
if (isArray(options))
|
|
180
|
+
return values
|
|
181
|
+
.map((id) => {
|
|
182
|
+
let option = options.find((o) => o[this.optionIdField] == id);
|
|
183
|
+
return option ? option[this.valueTextField] : id;
|
|
184
|
+
})
|
|
185
|
+
.filter(Boolean)
|
|
186
|
+
.join(", ");
|
|
187
|
+
return values.join(", ");
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
LookupField.prototype.baseClass = "lookupfield";
|
|
193
|
+
//LookupField.prototype.memoize = false;
|
|
194
|
+
LookupField.prototype.multiple = false;
|
|
195
|
+
LookupField.prototype.queryDelay = 150;
|
|
196
|
+
LookupField.prototype.minQueryLength = 0;
|
|
197
|
+
LookupField.prototype.hideSearchField = false;
|
|
198
|
+
LookupField.prototype.minOptionsForSearchField = 7;
|
|
199
|
+
LookupField.prototype.loadingText = "Loading...";
|
|
200
|
+
LookupField.prototype.queryErrorText = "Error occurred while querying for lookup data.";
|
|
201
|
+
LookupField.prototype.noResultsText = "No results found.";
|
|
202
|
+
LookupField.prototype.optionIdField = "id";
|
|
203
|
+
LookupField.prototype.optionTextField = "text";
|
|
204
|
+
LookupField.prototype.valueIdField = "id";
|
|
205
|
+
LookupField.prototype.valueTextField = "text";
|
|
206
|
+
LookupField.prototype.suppressErrorsUntilVisited = true;
|
|
207
|
+
LookupField.prototype.fetchAll = false;
|
|
208
|
+
LookupField.prototype.cacheAll = false;
|
|
209
|
+
LookupField.prototype.showClear = true;
|
|
210
|
+
LookupField.prototype.alwaysShowClear = false;
|
|
211
|
+
LookupField.prototype.closeOnSelect = true;
|
|
212
|
+
LookupField.prototype.minQueryLengthMessageText = "Type in at least {0} character(s).";
|
|
213
|
+
LookupField.prototype.icon = null;
|
|
214
|
+
LookupField.prototype.sort = false;
|
|
215
|
+
LookupField.prototype.listOptions = null;
|
|
216
|
+
LookupField.prototype.autoOpen = false;
|
|
217
|
+
LookupField.prototype.submitOnEnterKey = false;
|
|
218
|
+
LookupField.prototype.submitOnDropdownEnterKey = false;
|
|
219
|
+
LookupField.prototype.pageSize = 100;
|
|
220
|
+
LookupField.prototype.infinite = false;
|
|
221
|
+
LookupField.prototype.quickSelectAll = false;
|
|
222
|
+
LookupField.prototype.onGetRecordDisplayText = null;
|
|
223
|
+
Localization.registerPrototype("cx/widgets/LookupField", LookupField);
|
|
224
|
+
Widget.alias("lookupfield", LookupField);
|
|
225
|
+
function getOptionKey(bindings, data) {
|
|
226
|
+
return bindings.filter((a) => a.key).map((b) => Binding.get(b.remote).value(data));
|
|
227
|
+
}
|
|
228
|
+
function areKeysEqual(key1, key2) {
|
|
229
|
+
if (!key1 || !key2 || key1.length != key2.length)
|
|
230
|
+
return false;
|
|
231
|
+
for (let i = 0; i < key1.length; i++)
|
|
232
|
+
if (key1[i] !== key2[i])
|
|
233
|
+
return false;
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
function convertOption(bindings, data) {
|
|
237
|
+
let result = { $value: {} };
|
|
238
|
+
bindings.forEach((b) => {
|
|
239
|
+
let value = Binding.get(b.remote).value(data);
|
|
240
|
+
result = Binding.get(b.local).set(result, value);
|
|
241
|
+
});
|
|
242
|
+
return result.$value;
|
|
243
|
+
}
|
|
244
|
+
class SelectionDelegate extends Selection {
|
|
245
|
+
delegate;
|
|
246
|
+
constructor({ delegate }) {
|
|
247
|
+
super();
|
|
248
|
+
this.delegate = delegate;
|
|
249
|
+
}
|
|
250
|
+
getIsSelectedDelegate(store) {
|
|
251
|
+
return (record, index) => this.delegate(record, index);
|
|
252
|
+
}
|
|
253
|
+
select() {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
class LookupComponent extends VDOM.Component {
|
|
258
|
+
dom = {};
|
|
259
|
+
itemStore;
|
|
260
|
+
dropdown;
|
|
261
|
+
list;
|
|
262
|
+
listKeyDown;
|
|
263
|
+
queryTimeoutId;
|
|
264
|
+
cachedResult;
|
|
265
|
+
tmpCachedResult;
|
|
266
|
+
lastQueryId;
|
|
267
|
+
lastQuery;
|
|
268
|
+
extraPageLoadingBlocker;
|
|
269
|
+
unsubscribeListOnWheel;
|
|
270
|
+
unsubscribeListOnScroll;
|
|
271
|
+
constructor(props) {
|
|
272
|
+
super(props);
|
|
273
|
+
let { data, store } = this.props.instance;
|
|
274
|
+
this.dom = {};
|
|
275
|
+
this.state = {
|
|
276
|
+
options: [],
|
|
277
|
+
formatted: data.formatted,
|
|
278
|
+
value: data.formatted,
|
|
279
|
+
dropdownOpen: false,
|
|
280
|
+
focus: false,
|
|
281
|
+
};
|
|
282
|
+
this.itemStore = new ReadOnlyDataView({
|
|
283
|
+
store: store,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
getOptionKey(data) {
|
|
287
|
+
return this.props.bindings.filter((a) => a.key).map((b) => Binding.get(b.remote).value(data));
|
|
288
|
+
}
|
|
289
|
+
getLocalKey(data) {
|
|
290
|
+
return this.props.bindings.filter((a) => a.key).map((b) => Binding.get(b.local).value(data));
|
|
291
|
+
}
|
|
292
|
+
findOption(options, key) {
|
|
293
|
+
if (!key)
|
|
294
|
+
return -1;
|
|
295
|
+
for (let i = 0; i < options.length; i++) {
|
|
296
|
+
let optionKey = this.getOptionKey({ $option: options[i] });
|
|
297
|
+
if (areKeysEqual(key, optionKey))
|
|
298
|
+
return i;
|
|
299
|
+
}
|
|
300
|
+
return -1;
|
|
301
|
+
}
|
|
302
|
+
getDropdown() {
|
|
303
|
+
if (this.dropdown)
|
|
304
|
+
return this.dropdown;
|
|
305
|
+
let { widget } = this.props.instance;
|
|
306
|
+
let { lastDropdown } = this.props.instance;
|
|
307
|
+
this.list = Widget.create({
|
|
308
|
+
type: List,
|
|
309
|
+
sortField: widget.sort && widget.optionTextField,
|
|
310
|
+
sortDirection: "ASC",
|
|
311
|
+
mod: "dropdown",
|
|
312
|
+
scrollSelectionIntoView: true,
|
|
313
|
+
cached: widget.infinite,
|
|
314
|
+
...widget.listOptions,
|
|
315
|
+
records: bind("$options"),
|
|
316
|
+
recordName: "$option",
|
|
317
|
+
onItemClick: (e, inst) => this.onItemClick(e, inst),
|
|
318
|
+
pipeKeyDown: (kd) => {
|
|
319
|
+
this.listKeyDown = kd;
|
|
320
|
+
},
|
|
321
|
+
selectOnTab: true,
|
|
322
|
+
focusable: false,
|
|
323
|
+
selection: {
|
|
324
|
+
type: SelectionDelegate,
|
|
325
|
+
delegate: (data) => this.props.instance.data.selectedKeys.find((x) => areKeysEqual(x, this.getOptionKey({ $option: data }))) != null,
|
|
326
|
+
},
|
|
327
|
+
children: this.props.itemConfig,
|
|
328
|
+
});
|
|
329
|
+
let dropdown = {
|
|
330
|
+
constrain: true,
|
|
331
|
+
scrollTracking: true,
|
|
332
|
+
inline: !isTouchDevice() || !!lastDropdown,
|
|
333
|
+
placementOrder: "down-right down-left up-right up-left",
|
|
334
|
+
...widget.dropdownOptions,
|
|
335
|
+
type: Dropdown,
|
|
336
|
+
relatedElement: this.dom.input,
|
|
337
|
+
renderChildren: () => this.renderDropdownContents(),
|
|
338
|
+
onFocusOut: (e) => this.closeDropdown(e),
|
|
339
|
+
memoize: false,
|
|
340
|
+
touchFriendly: isTouchDevice(),
|
|
341
|
+
onMeasureNaturalContentSize: () => {
|
|
342
|
+
if (this.dom.dropdown && this.dom.list) {
|
|
343
|
+
return {
|
|
344
|
+
height: this.dom.dropdown.offsetHeight -
|
|
345
|
+
this.dom.list.offsetHeight +
|
|
346
|
+
(this.dom.list.firstElementChild?.offsetHeight || 0),
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
onDismissAfterScroll: () => {
|
|
351
|
+
this.closeDropdown(null, true);
|
|
352
|
+
return false;
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
return (this.dropdown = Widget.create(dropdown));
|
|
356
|
+
}
|
|
357
|
+
renderDropdownContents() {
|
|
358
|
+
let content;
|
|
359
|
+
let { instance } = this.props;
|
|
360
|
+
let { data, widget } = instance;
|
|
361
|
+
let { CSS, baseClass } = widget;
|
|
362
|
+
let searchVisible = !widget.hideSearchField &&
|
|
363
|
+
(!isArray(data.visibleOptions) ||
|
|
364
|
+
(widget.minOptionsForSearchField && data.visibleOptions.length >= widget.minOptionsForSearchField));
|
|
365
|
+
if (this.state.status == "loading") {
|
|
366
|
+
content = (_jsx("div", { className: CSS.element(baseClass, "message", "loading"), children: widget.loadingText }, "msg"));
|
|
367
|
+
}
|
|
368
|
+
else if (this.state.status == "error") {
|
|
369
|
+
content = (_jsx("div", { className: CSS.element(baseClass, "message", "error"), children: widget.queryErrorText }, "msg"));
|
|
370
|
+
}
|
|
371
|
+
else if (this.state.status == "info") {
|
|
372
|
+
content = (_jsx("div", { className: CSS.element(baseClass, "message", "info"), children: this.state.message }, "msg"));
|
|
373
|
+
}
|
|
374
|
+
else if (this.state.options.length == 0) {
|
|
375
|
+
content = (_jsx("div", { className: CSS.element(baseClass, "message", "no-results"), children: widget.noResultsText }, "msg"));
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
content = (_jsx("div", { ref: (el) => {
|
|
379
|
+
this.dom.list = el;
|
|
380
|
+
this.subscribeListOnWheel(el);
|
|
381
|
+
this.subscribeListOnScroll(el);
|
|
382
|
+
}, className: CSS.element(baseClass, "scroll-container"), children: _jsx(Cx, { widget: this.list, store: this.itemStore, options: { name: "lookupfield-list" } }) }, "msg"));
|
|
383
|
+
}
|
|
384
|
+
return (_jsxs("div", { ref: (el) => {
|
|
385
|
+
this.dom.dropdown = el;
|
|
386
|
+
}, className: CSS.element(baseClass, "dropdown"), tabIndex: 0, onFocus: (e) => this.onDropdownFocus(e), onKeyDown: (e) => this.onDropdownKeyPress(e), children: [searchVisible && (_jsx("input", { ref: (el) => {
|
|
387
|
+
this.dom.query = el;
|
|
388
|
+
}, type: "text", className: CSS.element(baseClass, "query"), onClick: (e) => {
|
|
389
|
+
e.preventDefault();
|
|
390
|
+
e.stopPropagation();
|
|
391
|
+
}, onChange: (e) => this.query(e.target.value), onBlur: (e) => this.onQueryBlur(e) }, "query")), content] }, "dropdown"));
|
|
392
|
+
}
|
|
393
|
+
onListWheel(e) {
|
|
394
|
+
let { list } = this.dom;
|
|
395
|
+
if (list &&
|
|
396
|
+
((list.scrollTop + list.offsetHeight == list.scrollHeight && e.deltaY > 0) ||
|
|
397
|
+
(list.scrollTop == 0 && e.deltaY < 0))) {
|
|
398
|
+
e.preventDefault();
|
|
399
|
+
e.stopPropagation();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
onListScroll() {
|
|
403
|
+
if (!this.dom.list)
|
|
404
|
+
return;
|
|
405
|
+
var el = this.dom.list;
|
|
406
|
+
if (el.scrollTop > el.scrollHeight - 2 * el.offsetHeight) {
|
|
407
|
+
this.loadAdditionalOptionPages();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
onDropdownFocus(e) {
|
|
411
|
+
if (this.dom.query && !isFocused(this.dom.query) && !isTouchDevice())
|
|
412
|
+
FocusManager.focus(this.dom.query);
|
|
413
|
+
}
|
|
414
|
+
getPlaceholder(text) {
|
|
415
|
+
let { CSS, baseClass } = this.props.instance.widget;
|
|
416
|
+
if (text)
|
|
417
|
+
return _jsx("span", { className: CSS.element(baseClass, "placeholder"), children: text });
|
|
418
|
+
return _jsx("span", { className: CSS.element(baseClass, "placeholder"), children: "\u00A0" });
|
|
419
|
+
}
|
|
420
|
+
render() {
|
|
421
|
+
let { instance, label, help, icon: iconVDOM } = this.props;
|
|
422
|
+
let { data, widget, state } = instance;
|
|
423
|
+
let { CSS, baseClass, suppressErrorsUntilVisited } = widget;
|
|
424
|
+
let icon = iconVDOM && (_jsx("div", { className: CSS.element(baseClass, "left-icon"), onMouseDown: preventDefault, onClick: (e) => {
|
|
425
|
+
this.openDropdown(e);
|
|
426
|
+
e.stopPropagation();
|
|
427
|
+
e.preventDefault();
|
|
428
|
+
}, children: iconVDOM }, "icon"));
|
|
429
|
+
let dropdown;
|
|
430
|
+
if (this.state.dropdownOpen) {
|
|
431
|
+
this.itemStore.setData({
|
|
432
|
+
$options: this.state.options,
|
|
433
|
+
$query: this.lastQuery,
|
|
434
|
+
});
|
|
435
|
+
dropdown = (_jsx(Cx, { widget: this.getDropdown(), store: this.itemStore, options: { name: "lookupfield-dropdown" } }));
|
|
436
|
+
}
|
|
437
|
+
let insideButton = null;
|
|
438
|
+
let multipleEntries = this.props.multiple && isArray(data.records) && data.records.length > 1;
|
|
439
|
+
if (!data.readOnly) {
|
|
440
|
+
if (widget.showClear &&
|
|
441
|
+
!data.disabled &&
|
|
442
|
+
!data.empty &&
|
|
443
|
+
(widget.alwaysShowClear || (!data.required && !this.props.multiple) || multipleEntries)) {
|
|
444
|
+
insideButton = (_jsx("div", { onMouseDown: preventDefault, onClick: (e) => (!this.props.multiple ? this.onClearClick(e) : this.onClearMultipleClick(e)), className: CSS.element(baseClass, "clear"), children: _jsx(ClearIcon, { className: CSS.element(baseClass, "icon") }) }, "ib"));
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
insideButton = (_jsx("div", { className: CSS.element(baseClass, "tool"), onMouseDown: preventDefault, onClick: (e) => {
|
|
448
|
+
this.toggleDropdown(e, true);
|
|
449
|
+
e.stopPropagation();
|
|
450
|
+
e.preventDefault();
|
|
451
|
+
}, children: _jsx(DropdownIcon, { className: CSS.element(baseClass, "icon") }) }, "ib"));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
let text;
|
|
455
|
+
if (this.props.multiple) {
|
|
456
|
+
let readOnly = data.disabled || data.readOnly;
|
|
457
|
+
if (isNonEmptyArray(data.records)) {
|
|
458
|
+
let valueTextFormatter = widget.onGetRecordDisplayText ??
|
|
459
|
+
((record) => record[widget.valueTextField]);
|
|
460
|
+
text = data.records.map((v, i) => (_jsxs("div", { className: CSS.element(baseClass, "tag", {
|
|
461
|
+
readonly: readOnly,
|
|
462
|
+
}), children: [_jsx("span", { className: CSS.element(baseClass, "tag-value"), children: valueTextFormatter(v, instance) }), !readOnly && (_jsx("div", { className: CSS.element(baseClass, "tag-clear"), onMouseDown: (e) => {
|
|
463
|
+
e.preventDefault();
|
|
464
|
+
e.stopPropagation();
|
|
465
|
+
}, onClick: (e) => this.onClearClick(e, v), children: _jsx(ClearIcon, { className: CSS.element(baseClass, "icon") }) }))] }, i)));
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
text = this.getPlaceholder(data.placeholder);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
text = !data.empty ? data.text || this.getPlaceholder() : this.getPlaceholder(data.placeholder);
|
|
473
|
+
}
|
|
474
|
+
let states = {
|
|
475
|
+
visited: state.visited,
|
|
476
|
+
focus: this.state.focus || this.state.dropdownOpen,
|
|
477
|
+
icon: !!iconVDOM,
|
|
478
|
+
empty: !data.placeholder && data.empty,
|
|
479
|
+
error: data.error && (state.visited || !suppressErrorsUntilVisited || !data.empty),
|
|
480
|
+
};
|
|
481
|
+
return (_jsxs("div", { className: CSS.expand(data.classNames, CSS.state(states)), style: data.style, onMouseDown: stopPropagation, onTouchStart: stopPropagation, onKeyDown: (e) => this.onKeyDown(e), children: [_jsx("div", { id: data.id, className: CSS.expand(CSS.element(widget.baseClass, "input"), data.inputClass), style: data.inputStyle, tabIndex: data.disabled ? null : data.tabIndex || 0, ref: (el) => {
|
|
482
|
+
this.dom.input = el;
|
|
483
|
+
}, "aria-labelledby": data.id + "-label", onMouseMove: (e) => tooltipMouseMove(e, ...getFieldTooltip(this.props.instance)), onMouseLeave: (e) => tooltipMouseLeave(e, ...getFieldTooltip(this.props.instance)), onClick: (e) => this.onClick(e), onKeyDown: (e) => this.onInputKeyDown(e), onMouseDown: (e) => this.onMouseDown(e), onBlur: (e) => this.onBlur(e), onFocus: (e) => this.onFocus(e), children: text }), insideButton, icon, dropdown, label, help] }));
|
|
484
|
+
}
|
|
485
|
+
onMouseDown(e) {
|
|
486
|
+
//skip touch start to allow touch scrolling
|
|
487
|
+
if (isTouchEvent())
|
|
488
|
+
return;
|
|
489
|
+
e.preventDefault();
|
|
490
|
+
e.stopPropagation();
|
|
491
|
+
this.toggleDropdown(e, true);
|
|
492
|
+
}
|
|
493
|
+
onClick(e) {
|
|
494
|
+
//mouse down will handle it for non-touch events
|
|
495
|
+
if (!isTouchEvent())
|
|
496
|
+
return;
|
|
497
|
+
e.preventDefault();
|
|
498
|
+
e.stopPropagation();
|
|
499
|
+
this.toggleDropdown(e, true);
|
|
500
|
+
}
|
|
501
|
+
onItemClick(e, { store }) {
|
|
502
|
+
this.select(e, [store.getData()]);
|
|
503
|
+
if (!this.props.instance.widget.submitOnEnterKey || e.type != "keydown")
|
|
504
|
+
e.stopPropagation();
|
|
505
|
+
if (e.keyCode != KeyCode.tab)
|
|
506
|
+
e.preventDefault();
|
|
507
|
+
}
|
|
508
|
+
onClearClick(e, value) {
|
|
509
|
+
let { instance } = this.props;
|
|
510
|
+
let { data, store, widget } = instance;
|
|
511
|
+
let { keyBindings } = widget;
|
|
512
|
+
e.stopPropagation();
|
|
513
|
+
e.preventDefault();
|
|
514
|
+
if (widget.multiple) {
|
|
515
|
+
if (isArray(data.records)) {
|
|
516
|
+
let itemKey = this.getLocalKey({ $value: value });
|
|
517
|
+
let newRecords = data.records.filter((v) => !areKeysEqual(this.getLocalKey({ $value: v }), itemKey));
|
|
518
|
+
instance.set("records", newRecords);
|
|
519
|
+
let newValues = newRecords
|
|
520
|
+
.map((rec) => this.getLocalKey({ $value: rec }))
|
|
521
|
+
.map((k) => (keyBindings.length == 1 ? k[0] : k));
|
|
522
|
+
instance.set("values", newValues);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
this.props.bindings.forEach((b) => {
|
|
527
|
+
store.set(b.local, widget.emptyValue);
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
if (!isTouchEvent())
|
|
531
|
+
this.dom.input.focus();
|
|
532
|
+
}
|
|
533
|
+
onClearMultipleClick(e) {
|
|
534
|
+
let { instance } = this.props;
|
|
535
|
+
instance.set("records", []);
|
|
536
|
+
instance.set("values", []);
|
|
537
|
+
}
|
|
538
|
+
select(e, itemsData, reset) {
|
|
539
|
+
let { instance } = this.props;
|
|
540
|
+
let { store, data, widget } = instance;
|
|
541
|
+
let { bindings, keyBindings } = widget;
|
|
542
|
+
if (widget.multiple) {
|
|
543
|
+
let { selectedKeys, records } = data;
|
|
544
|
+
let newRecords = reset ? [] : [...(records || [])];
|
|
545
|
+
let singleSelect = itemsData.length == 1;
|
|
546
|
+
let optionKey = null;
|
|
547
|
+
if (singleSelect)
|
|
548
|
+
optionKey = this.getOptionKey(itemsData[0]);
|
|
549
|
+
// deselect
|
|
550
|
+
if (singleSelect && selectedKeys.find((k) => areKeysEqual(optionKey, k))) {
|
|
551
|
+
newRecords = records.filter((v) => !areKeysEqual(optionKey, this.getLocalKey({ $value: v })));
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
itemsData.forEach((itemData) => {
|
|
555
|
+
let valueData = {
|
|
556
|
+
$value: {},
|
|
557
|
+
};
|
|
558
|
+
bindings.forEach((b) => {
|
|
559
|
+
valueData = Binding.get(b.local).set(valueData, Binding.get(b.remote).value(itemData));
|
|
560
|
+
});
|
|
561
|
+
newRecords.push(valueData.$value);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
instance.set("records", newRecords);
|
|
565
|
+
let newValues = newRecords
|
|
566
|
+
.map((rec) => this.getLocalKey({ $value: rec }))
|
|
567
|
+
.map((k) => (keyBindings.length == 1 ? k[0] : k));
|
|
568
|
+
instance.set("values", newValues);
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
bindings.forEach((b) => {
|
|
572
|
+
let v = Binding.get(b.remote).value(itemsData[0]);
|
|
573
|
+
if (b.set)
|
|
574
|
+
b.set(v, instance);
|
|
575
|
+
else
|
|
576
|
+
store.set(b.local, v);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
if (widget.closeOnSelect) {
|
|
580
|
+
//Pressing Tab should work it's own thing. Focus will move elsewhere and the dropdown will close.
|
|
581
|
+
if (e.keyCode != KeyCode.tab) {
|
|
582
|
+
if (!isTouchEvent())
|
|
583
|
+
this.dom.input.focus();
|
|
584
|
+
this.closeDropdown(e);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
if (e.keyCode == KeyCode.enter && widget.submitOnDropdownEnterKey) {
|
|
588
|
+
this.submitOnEnter(e);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
onDropdownKeyPress(e) {
|
|
592
|
+
switch (e.keyCode) {
|
|
593
|
+
case KeyCode.esc:
|
|
594
|
+
this.closeDropdown(e);
|
|
595
|
+
this.dom.input.focus();
|
|
596
|
+
break;
|
|
597
|
+
case KeyCode.tab:
|
|
598
|
+
// if tab needs to do a list selection, we have to first call List's handleKeyDown
|
|
599
|
+
if (this.listKeyDown)
|
|
600
|
+
this.listKeyDown(e);
|
|
601
|
+
// if next focusable element is disabled, recalculate and update the dom before switching focus
|
|
602
|
+
this.props.forceUpdate();
|
|
603
|
+
break;
|
|
604
|
+
case KeyCode.a:
|
|
605
|
+
if (!e.ctrlKey)
|
|
606
|
+
return;
|
|
607
|
+
let { quickSelectAll, multiple } = this.props.instance.widget;
|
|
608
|
+
if (!quickSelectAll || !multiple)
|
|
609
|
+
return;
|
|
610
|
+
let optionsToSelect = this.state.options.map((o) => ({
|
|
611
|
+
$option: o,
|
|
612
|
+
}));
|
|
613
|
+
this.select(e, optionsToSelect, true);
|
|
614
|
+
e.stopPropagation();
|
|
615
|
+
e.preventDefault();
|
|
616
|
+
break;
|
|
617
|
+
default:
|
|
618
|
+
if (this.listKeyDown)
|
|
619
|
+
this.listKeyDown(e);
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
onKeyDown(e) {
|
|
624
|
+
switch (e.keyCode) {
|
|
625
|
+
case KeyCode.pageDown:
|
|
626
|
+
case KeyCode.pageUp:
|
|
627
|
+
if (this.state.dropdownOpen)
|
|
628
|
+
e.preventDefault();
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
onInputKeyDown(e) {
|
|
633
|
+
let { instance } = this.props;
|
|
634
|
+
if (instance.widget.handleKeyDown(e, instance) === false)
|
|
635
|
+
return;
|
|
636
|
+
switch (e.keyCode) {
|
|
637
|
+
case KeyCode.delete:
|
|
638
|
+
this.onClearClick(e);
|
|
639
|
+
return;
|
|
640
|
+
case KeyCode.shift:
|
|
641
|
+
case KeyCode.ctrl:
|
|
642
|
+
case KeyCode.tab:
|
|
643
|
+
case KeyCode.left:
|
|
644
|
+
case KeyCode.right:
|
|
645
|
+
case KeyCode.pageUp:
|
|
646
|
+
case KeyCode.pageDown:
|
|
647
|
+
case KeyCode.insert:
|
|
648
|
+
case KeyCode.esc:
|
|
649
|
+
break;
|
|
650
|
+
case KeyCode.down:
|
|
651
|
+
this.openDropdown(e);
|
|
652
|
+
e.stopPropagation();
|
|
653
|
+
break;
|
|
654
|
+
case KeyCode.enter:
|
|
655
|
+
if (this.props.instance.widget.submitOnEnterKey) {
|
|
656
|
+
this.submitOnEnter(e);
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
this.openDropdown(e);
|
|
660
|
+
}
|
|
661
|
+
break;
|
|
662
|
+
default:
|
|
663
|
+
this.openDropdown(e);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
onQueryBlur(e) {
|
|
668
|
+
FocusManager.nudge();
|
|
669
|
+
}
|
|
670
|
+
onFocus(e) {
|
|
671
|
+
let { instance } = this.props;
|
|
672
|
+
let { widget } = instance;
|
|
673
|
+
if (widget.trackFocus) {
|
|
674
|
+
this.setState({
|
|
675
|
+
focus: true,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
if (this.props.instance.data.autoOpen)
|
|
679
|
+
this.openDropdown(null);
|
|
680
|
+
}
|
|
681
|
+
onBlur(e) {
|
|
682
|
+
if (!this.state.dropdownOpen)
|
|
683
|
+
this.props.instance.setState({ visited: true });
|
|
684
|
+
if (this.state.focus)
|
|
685
|
+
this.setState({
|
|
686
|
+
focus: false,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
toggleDropdown(e, keepFocus) {
|
|
690
|
+
if (this.state.dropdownOpen)
|
|
691
|
+
this.closeDropdown(e, keepFocus);
|
|
692
|
+
else
|
|
693
|
+
this.openDropdown(e);
|
|
694
|
+
}
|
|
695
|
+
closeDropdown(e, keepFocus) {
|
|
696
|
+
if (this.state.dropdownOpen) {
|
|
697
|
+
this.setState({
|
|
698
|
+
dropdownOpen: false,
|
|
699
|
+
}, () => keepFocus && this.dom.input?.focus());
|
|
700
|
+
this.props.instance.setState({
|
|
701
|
+
visited: true,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
//delete results valid only while the dropdown is open
|
|
705
|
+
delete this.tmpCachedResult;
|
|
706
|
+
}
|
|
707
|
+
openDropdown(e) {
|
|
708
|
+
let { instance } = this.props;
|
|
709
|
+
let { data } = instance;
|
|
710
|
+
if (!this.state.dropdownOpen && !data.disabled && !data.readOnly) {
|
|
711
|
+
this.query("");
|
|
712
|
+
this.setState({
|
|
713
|
+
dropdownOpen: true,
|
|
714
|
+
}, () => {
|
|
715
|
+
if (this.dom.dropdown)
|
|
716
|
+
this.dom.dropdown.focus();
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
query(q) {
|
|
721
|
+
/*
|
|
722
|
+
In fetchAll mode onQuery should fetch all data and after
|
|
723
|
+
that everything is done filtering is done client-side.
|
|
724
|
+
If cacheAll is set results are cached for the lifetime of the
|
|
725
|
+
widget, otherwise cache is invalidated when dropdown closes.
|
|
726
|
+
*/
|
|
727
|
+
let { instance } = this.props;
|
|
728
|
+
let { widget, data } = instance;
|
|
729
|
+
this.lastQuery = q;
|
|
730
|
+
//do not make duplicate queries if fetchAll is enabled
|
|
731
|
+
if (widget.fetchAll && this.state.status == "loading")
|
|
732
|
+
return;
|
|
733
|
+
if (this.queryTimeoutId)
|
|
734
|
+
clearTimeout(this.queryTimeoutId);
|
|
735
|
+
if (q.length < widget.minQueryLength) {
|
|
736
|
+
this.setState({
|
|
737
|
+
status: "info",
|
|
738
|
+
message: StringTemplate.format(widget.minQueryLengthMessageText, widget.minQueryLength),
|
|
739
|
+
});
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
if (isArray(data.visibleOptions)) {
|
|
743
|
+
let results = widget.filterOptions(this.props.instance, data.visibleOptions, q);
|
|
744
|
+
this.setState({
|
|
745
|
+
options: results,
|
|
746
|
+
status: "loaded",
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
if (widget.onQuery) {
|
|
750
|
+
let { queryDelay, fetchAll, cacheAll, pageSize } = widget;
|
|
751
|
+
if (fetchAll)
|
|
752
|
+
queryDelay = 0;
|
|
753
|
+
if (!this.cachedResult) {
|
|
754
|
+
this.setState({
|
|
755
|
+
status: "loading",
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
this.queryTimeoutId = setTimeout(() => {
|
|
759
|
+
delete this.queryTimeoutId;
|
|
760
|
+
let result = this.tmpCachedResult || this.cachedResult;
|
|
761
|
+
let query = fetchAll ? "" : q;
|
|
762
|
+
let params = !widget.infinite
|
|
763
|
+
? query
|
|
764
|
+
: {
|
|
765
|
+
query,
|
|
766
|
+
page: 1,
|
|
767
|
+
pageSize,
|
|
768
|
+
};
|
|
769
|
+
if (!result)
|
|
770
|
+
result = instance.invoke("onQuery", params, instance);
|
|
771
|
+
let queryId = (this.lastQueryId = Date.now());
|
|
772
|
+
Promise.resolve(result)
|
|
773
|
+
.then((results) => {
|
|
774
|
+
//discard results which do not belong to the last query
|
|
775
|
+
if (queryId !== this.lastQueryId)
|
|
776
|
+
return;
|
|
777
|
+
if (!isArray(results))
|
|
778
|
+
results = [];
|
|
779
|
+
if (fetchAll) {
|
|
780
|
+
if (cacheAll)
|
|
781
|
+
this.cachedResult = results;
|
|
782
|
+
else
|
|
783
|
+
this.tmpCachedResult = results;
|
|
784
|
+
results = widget.filterOptions(this.props.instance, results, this.lastQuery);
|
|
785
|
+
}
|
|
786
|
+
this.setState({
|
|
787
|
+
page: 1,
|
|
788
|
+
query,
|
|
789
|
+
options: results,
|
|
790
|
+
status: "loaded",
|
|
791
|
+
}, () => {
|
|
792
|
+
if (widget.infinite)
|
|
793
|
+
this.onListScroll();
|
|
794
|
+
});
|
|
795
|
+
})
|
|
796
|
+
.catch((err) => {
|
|
797
|
+
this.setState({ status: "error" });
|
|
798
|
+
debug("Lookup query error:", err);
|
|
799
|
+
});
|
|
800
|
+
}, queryDelay);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
loadAdditionalOptionPages() {
|
|
804
|
+
let { instance } = this.props;
|
|
805
|
+
let { widget } = instance;
|
|
806
|
+
if (!widget.infinite)
|
|
807
|
+
return;
|
|
808
|
+
let { query, page, status, options } = this.state;
|
|
809
|
+
if (!page)
|
|
810
|
+
page = 1;
|
|
811
|
+
let blockerKey = query;
|
|
812
|
+
if (status != "loaded")
|
|
813
|
+
return;
|
|
814
|
+
if (options.length < page * widget.pageSize)
|
|
815
|
+
return; //some pages were not full which means we reached the end
|
|
816
|
+
if (this.extraPageLoadingBlocker === blockerKey)
|
|
817
|
+
return;
|
|
818
|
+
this.extraPageLoadingBlocker = blockerKey;
|
|
819
|
+
let params = {
|
|
820
|
+
page: page + 1,
|
|
821
|
+
query,
|
|
822
|
+
pageSize: widget.pageSize,
|
|
823
|
+
};
|
|
824
|
+
var result = instance.invoke("onQuery", params, instance);
|
|
825
|
+
Promise.resolve(result)
|
|
826
|
+
.then((results) => {
|
|
827
|
+
//discard results which do not belong to the last query
|
|
828
|
+
if (this.extraPageLoadingBlocker !== blockerKey)
|
|
829
|
+
return;
|
|
830
|
+
this.extraPageLoadingBlocker = false;
|
|
831
|
+
if (!isArray(results))
|
|
832
|
+
return;
|
|
833
|
+
this.setState({
|
|
834
|
+
page: params.page,
|
|
835
|
+
query,
|
|
836
|
+
options: [...options, ...results],
|
|
837
|
+
}, () => {
|
|
838
|
+
this.onListScroll();
|
|
839
|
+
});
|
|
840
|
+
})
|
|
841
|
+
.catch((err) => {
|
|
842
|
+
if (this.extraPageLoadingBlocker !== blockerKey)
|
|
843
|
+
return;
|
|
844
|
+
this.extraPageLoadingBlocker = false;
|
|
845
|
+
this.setState({ status: "error" });
|
|
846
|
+
debug("Lookup query error:", err);
|
|
847
|
+
console.error(err);
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
851
|
+
if (this.dom.input) {
|
|
852
|
+
tooltipParentWillReceiveProps(this.dom.input, ...getFieldTooltip(props.instance));
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
componentDidMount() {
|
|
856
|
+
if (this.dom.input) {
|
|
857
|
+
tooltipParentDidMount(this.dom.input, ...getFieldTooltip(this.props.instance));
|
|
858
|
+
autoFocus(this.dom.input, this);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
componentDidUpdate() {
|
|
862
|
+
if (this.dom.input) {
|
|
863
|
+
autoFocus(this.dom.input, this);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
componentWillUnmount() {
|
|
867
|
+
if (this.queryTimeoutId)
|
|
868
|
+
clearTimeout(this.queryTimeoutId);
|
|
869
|
+
tooltipParentWillUnmount(this.props.instance);
|
|
870
|
+
this.subscribeListOnWheel(null);
|
|
871
|
+
}
|
|
872
|
+
subscribeListOnWheel(list) {
|
|
873
|
+
if (this.unsubscribeListOnWheel) {
|
|
874
|
+
this.unsubscribeListOnWheel();
|
|
875
|
+
this.unsubscribeListOnWheel = null;
|
|
876
|
+
}
|
|
877
|
+
if (list) {
|
|
878
|
+
this.unsubscribeListOnWheel = addEventListenerWithOptions(list, "wheel", (e) => this.onListWheel(e), {
|
|
879
|
+
passive: false,
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
subscribeListOnScroll(list) {
|
|
884
|
+
if (this.unsubscribeListOnScroll) {
|
|
885
|
+
this.unsubscribeListOnScroll();
|
|
886
|
+
this.unsubscribeListOnScroll = null;
|
|
887
|
+
}
|
|
888
|
+
if (list) {
|
|
889
|
+
this.unsubscribeListOnScroll = addEventListenerWithOptions(list, "scroll", () => this.onListScroll(), {
|
|
890
|
+
passive: false,
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
submitOnEnter(e) {
|
|
895
|
+
let instance = this.props.instance.parent;
|
|
896
|
+
while (instance) {
|
|
897
|
+
let htmlInstance = instance;
|
|
898
|
+
if (htmlInstance.events && htmlInstance.events.onSubmit) {
|
|
899
|
+
htmlInstance.events.onSubmit(e, instance);
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
instance = instance.parent;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|