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,361 @@
|
|
|
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 { Field, getFieldTooltip } from "./Field";
|
|
5
|
+
import { Format } from "../../ui/Format";
|
|
6
|
+
import { Culture } from "../../ui/Culture";
|
|
7
|
+
import { StringTemplate } from "../../data/StringTemplate";
|
|
8
|
+
import { tooltipParentWillReceiveProps, tooltipParentWillUnmount, tooltipMouseMove, tooltipMouseLeave, tooltipParentDidMount, } from "../overlay/tooltip-ops";
|
|
9
|
+
import { stopPropagation } from "../../util/eventCallbacks";
|
|
10
|
+
import { Localization } from "../../ui/Localization";
|
|
11
|
+
import ClearIcon from "../icons/clear";
|
|
12
|
+
import { isString } from "../../util/isString";
|
|
13
|
+
import { isNumber } from "../../util/isNumber";
|
|
14
|
+
import { isDefined } from "../../util/isDefined";
|
|
15
|
+
import { getActiveElement } from "../../util/getActiveElement";
|
|
16
|
+
import { enableCultureSensitiveFormatting } from "../../ui/Format";
|
|
17
|
+
import { KeyCode } from "../../util/KeyCode";
|
|
18
|
+
import { autoFocus } from "../autoFocus";
|
|
19
|
+
enableCultureSensitiveFormatting();
|
|
20
|
+
export class NumberField extends Field {
|
|
21
|
+
declareData(...args) {
|
|
22
|
+
super.declareData({
|
|
23
|
+
value: this.emptyValue,
|
|
24
|
+
disabled: undefined,
|
|
25
|
+
readOnly: undefined,
|
|
26
|
+
enabled: undefined,
|
|
27
|
+
placeholder: undefined,
|
|
28
|
+
required: undefined,
|
|
29
|
+
format: undefined,
|
|
30
|
+
minValue: undefined,
|
|
31
|
+
maxValue: undefined,
|
|
32
|
+
constrain: undefined,
|
|
33
|
+
minExclusive: undefined,
|
|
34
|
+
maxExclusive: undefined,
|
|
35
|
+
incrementPercentage: undefined,
|
|
36
|
+
increment: undefined,
|
|
37
|
+
icon: undefined,
|
|
38
|
+
scale: undefined,
|
|
39
|
+
offset: undefined,
|
|
40
|
+
}, ...args);
|
|
41
|
+
}
|
|
42
|
+
init() {
|
|
43
|
+
if (isDefined(this.step))
|
|
44
|
+
this.increment = this.step;
|
|
45
|
+
if (isDefined(this.hideClear))
|
|
46
|
+
this.showClear = !this.hideClear;
|
|
47
|
+
if (this.alwaysShowClear)
|
|
48
|
+
this.showClear = true;
|
|
49
|
+
super.init();
|
|
50
|
+
}
|
|
51
|
+
prepareData(context, instance) {
|
|
52
|
+
let { data, state, cached } = instance;
|
|
53
|
+
data.formatted = Format.value(data.value, data.format);
|
|
54
|
+
if (!cached.data || data.value != cached.data.value)
|
|
55
|
+
state.empty = data.value == null;
|
|
56
|
+
super.prepareData(context, instance);
|
|
57
|
+
}
|
|
58
|
+
formatValue(context, { data }) {
|
|
59
|
+
return data.formatted;
|
|
60
|
+
}
|
|
61
|
+
parseValue(value, instance) {
|
|
62
|
+
if (this.onParseInput) {
|
|
63
|
+
let result = instance.invoke("onParseInput", value, instance);
|
|
64
|
+
if (result !== undefined)
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
return Culture.getNumberCulture().parse(value);
|
|
68
|
+
}
|
|
69
|
+
validate(context, instance) {
|
|
70
|
+
super.validate(context, instance);
|
|
71
|
+
let { data } = instance;
|
|
72
|
+
if (isNumber(data.value) && !data.error) {
|
|
73
|
+
if (isNumber(data.minValue)) {
|
|
74
|
+
if (data.value < data.minValue)
|
|
75
|
+
data.error = StringTemplate.format(this.minValueErrorText, Format.value(data.minValue, data.format));
|
|
76
|
+
else if (data.value == data.minValue && data.minExclusive)
|
|
77
|
+
data.error = StringTemplate.format(this.minExclusiveErrorText, Format.value(data.minValue, data.format));
|
|
78
|
+
}
|
|
79
|
+
if (isNumber(data.maxValue)) {
|
|
80
|
+
if (data.value > data.maxValue)
|
|
81
|
+
data.error = StringTemplate.format(this.maxValueErrorText, Format.value(data.maxValue, data.format));
|
|
82
|
+
else if (data.value == data.maxValue && data.maxExclusive)
|
|
83
|
+
data.error = StringTemplate.format(this.maxExclusiveErrorText, Format.value(data.maxValue, data.format));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
renderInput(context, instance, key) {
|
|
88
|
+
return (_jsx(Input, { data: instance.data, instance: instance, label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")), help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")), icon: this.renderIcon(context, instance, "icon") }, key));
|
|
89
|
+
}
|
|
90
|
+
validateRequired(context, instance) {
|
|
91
|
+
return instance.state.empty && this.requiredText;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
NumberField.prototype.baseClass = "numberfield";
|
|
95
|
+
NumberField.prototype.reactOn = "enter blur";
|
|
96
|
+
NumberField.prototype.format = "n";
|
|
97
|
+
NumberField.prototype.inputType = "text";
|
|
98
|
+
NumberField.prototype.maxValueErrorText = "Enter {0} or less.";
|
|
99
|
+
NumberField.prototype.maxExclusiveErrorText = "Enter a number less than {0}.";
|
|
100
|
+
NumberField.prototype.minValueErrorText = "Enter {0} or more.";
|
|
101
|
+
NumberField.prototype.minExclusiveErrorText = "Enter a number greater than {0}.";
|
|
102
|
+
NumberField.prototype.inputErrorText = "Invalid number entered.";
|
|
103
|
+
NumberField.prototype.suppressErrorsUntilVisited = true;
|
|
104
|
+
NumberField.prototype.incrementPercentage = 0.1;
|
|
105
|
+
NumberField.prototype.scale = 1;
|
|
106
|
+
NumberField.prototype.offset = 0;
|
|
107
|
+
NumberField.prototype.snapToIncrement = true;
|
|
108
|
+
NumberField.prototype.icon = null;
|
|
109
|
+
NumberField.prototype.showClear = false;
|
|
110
|
+
NumberField.prototype.alwaysShowClear = false;
|
|
111
|
+
Widget.alias("numberfield", NumberField);
|
|
112
|
+
Localization.registerPrototype("cx/widgets/NumberField", NumberField);
|
|
113
|
+
class Input extends VDOM.Component {
|
|
114
|
+
input;
|
|
115
|
+
constructor(props) {
|
|
116
|
+
super(props);
|
|
117
|
+
this.state = {
|
|
118
|
+
focus: false,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
let { data, instance, label, help, icon: iconVDOM } = this.props;
|
|
123
|
+
let { widget, state } = instance;
|
|
124
|
+
let { CSS, baseClass, suppressErrorsUntilVisited } = widget;
|
|
125
|
+
let icon = iconVDOM && _jsx("div", { className: CSS.element(baseClass, "left-icon"), children: iconVDOM });
|
|
126
|
+
let insideButton;
|
|
127
|
+
if (!data.readOnly && !data.disabled) {
|
|
128
|
+
if (widget.showClear &&
|
|
129
|
+
(((widget.alwaysShowClear || !data.required) && !data.empty) || instance.state.inputError))
|
|
130
|
+
insideButton = (_jsx("div", { className: CSS.element(baseClass, "clear"), onMouseDown: (e) => e.preventDefault(), onClick: (e) => this.onClearClick(e), children: _jsx(ClearIcon, { className: CSS.element(baseClass, "icon") }) }));
|
|
131
|
+
}
|
|
132
|
+
let empty = this.input ? !this.input.value : data.empty;
|
|
133
|
+
return (_jsxs("div", { className: CSS.expand(data.classNames, CSS.state({
|
|
134
|
+
visited: state.visited,
|
|
135
|
+
focus: this.state.focus,
|
|
136
|
+
icon: !!icon,
|
|
137
|
+
empty: empty && !data.placeholder,
|
|
138
|
+
error: data.error && (state.visited || !suppressErrorsUntilVisited || !empty),
|
|
139
|
+
})), style: data.style, onMouseDown: stopPropagation, onTouchStart: stopPropagation, children: [_jsx("input", { id: data.id, type: widget.inputType, className: CSS.expand(CSS.element(baseClass, "input"), data.inputClass), defaultValue: data.formatted, ref: (el) => {
|
|
140
|
+
this.input = el || undefined;
|
|
141
|
+
}, style: data.inputStyle, disabled: data.disabled, readOnly: data.readOnly, tabIndex: data.tabIndex, placeholder: data.placeholder, ...data.inputAttrs, onMouseMove: (e) => tooltipMouseMove(e, ...getFieldTooltip(this.props.instance)), onMouseLeave: (e) => tooltipMouseLeave(e, ...getFieldTooltip(this.props.instance)), onChange: (e) => this.onChange(e, "change"), onKeyDown: this.onKeyDown.bind(this), onBlur: (e) => {
|
|
142
|
+
this.onChange(e, "blur");
|
|
143
|
+
}, onFocus: (e) => this.onFocus(), onWheel: (e) => {
|
|
144
|
+
this.onChange(e, "wheel");
|
|
145
|
+
}, onClick: stopPropagation }), insideButton, icon, label, help] }));
|
|
146
|
+
}
|
|
147
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
148
|
+
let { data, state } = props.instance;
|
|
149
|
+
if (this.props.data.formatted != data.formatted && !state.inputError) {
|
|
150
|
+
this.input.value = props.data.formatted || "";
|
|
151
|
+
props.instance.setState({
|
|
152
|
+
inputError: false,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
tooltipParentWillReceiveProps(this.input, ...getFieldTooltip(props.instance));
|
|
156
|
+
}
|
|
157
|
+
componentDidMount() {
|
|
158
|
+
tooltipParentDidMount(this.input, ...getFieldTooltip(this.props.instance));
|
|
159
|
+
autoFocus(this.input, this);
|
|
160
|
+
}
|
|
161
|
+
componentDidUpdate() {
|
|
162
|
+
autoFocus(this.input, this);
|
|
163
|
+
}
|
|
164
|
+
componentWillUnmount() {
|
|
165
|
+
if (this.input == getActiveElement() && this.input.value != this.props.data.formatted) {
|
|
166
|
+
this.onChange({ currentTarget: this.input }, "blur");
|
|
167
|
+
}
|
|
168
|
+
tooltipParentWillUnmount(this.props.instance);
|
|
169
|
+
}
|
|
170
|
+
getPreCursorDigits(text, cursor, decimalSeparator) {
|
|
171
|
+
let res = "";
|
|
172
|
+
for (let i = 0; i < cursor; i++) {
|
|
173
|
+
if ("0" <= text[i] && text[i] <= "9")
|
|
174
|
+
res += text[i];
|
|
175
|
+
else if (text[i] == decimalSeparator)
|
|
176
|
+
res += ".";
|
|
177
|
+
else if (text[i] == "-")
|
|
178
|
+
res += "-";
|
|
179
|
+
}
|
|
180
|
+
return res;
|
|
181
|
+
}
|
|
182
|
+
getLengthWithoutSuffix(text, decimalSeparator) {
|
|
183
|
+
let l = text.length;
|
|
184
|
+
while (l > 0) {
|
|
185
|
+
if ("0" <= text[l - 1] && text[l - 1] <= "9")
|
|
186
|
+
break;
|
|
187
|
+
if (text[l - 1] == decimalSeparator)
|
|
188
|
+
break;
|
|
189
|
+
l--;
|
|
190
|
+
}
|
|
191
|
+
return l;
|
|
192
|
+
}
|
|
193
|
+
getDecimalSeparator(format) {
|
|
194
|
+
let text = Format.value(0.11111111, format);
|
|
195
|
+
for (let i = text.length - 1; i >= 0; i--) {
|
|
196
|
+
if ("0" <= text[i] && text[i] <= "9")
|
|
197
|
+
continue;
|
|
198
|
+
if (text[i] == "," || text[i] == ".")
|
|
199
|
+
return text[i];
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
updateCursorPosition(preCursorText) {
|
|
205
|
+
if (isString(preCursorText)) {
|
|
206
|
+
let cursor = 0;
|
|
207
|
+
let preCursor = 0;
|
|
208
|
+
let text = this.input.value || "";
|
|
209
|
+
while (preCursor < preCursorText.length && cursor < text.length) {
|
|
210
|
+
if (text[cursor] == preCursorText[preCursor]) {
|
|
211
|
+
cursor++;
|
|
212
|
+
preCursor++;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
cursor++;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
this.input.setSelectionRange(cursor, cursor);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
calculateIncrement(value, strength) {
|
|
222
|
+
if (value == 0)
|
|
223
|
+
return 0.1;
|
|
224
|
+
let absValue = Math.abs(value * strength);
|
|
225
|
+
let log10 = Math.floor(Math.log10(absValue) + 0.001);
|
|
226
|
+
let size = Math.pow(10, log10);
|
|
227
|
+
if (absValue / size > 4.999)
|
|
228
|
+
return 5 * size;
|
|
229
|
+
if (absValue / size > 1.999)
|
|
230
|
+
return 2 * size;
|
|
231
|
+
return size;
|
|
232
|
+
}
|
|
233
|
+
onClearClick(e) {
|
|
234
|
+
this.input.value = "";
|
|
235
|
+
let { instance } = this.props;
|
|
236
|
+
instance.set("value", instance.widget.emptyValue, { immediate: true });
|
|
237
|
+
}
|
|
238
|
+
onKeyDown(e) {
|
|
239
|
+
let { instance } = this.props;
|
|
240
|
+
if (instance.widget.handleKeyDown(e, instance) === false)
|
|
241
|
+
return;
|
|
242
|
+
switch (e.keyCode) {
|
|
243
|
+
case KeyCode.enter:
|
|
244
|
+
this.onChange(e, "enter");
|
|
245
|
+
break;
|
|
246
|
+
case KeyCode.left:
|
|
247
|
+
case KeyCode.right:
|
|
248
|
+
e.stopPropagation();
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
onChange(e, change) {
|
|
253
|
+
let { instance, data } = this.props;
|
|
254
|
+
let { widget } = instance;
|
|
255
|
+
let inputValue = e.currentTarget.value;
|
|
256
|
+
if (data.required) {
|
|
257
|
+
instance.setState({
|
|
258
|
+
empty: !inputValue,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
if (change == "blur" && this.state.focus) {
|
|
262
|
+
this.setState({
|
|
263
|
+
focus: false,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
let immediate = change == "blur" || change == "enter";
|
|
267
|
+
if ((widget.reactOn.indexOf(change) == -1 && !immediate) || data.disabled || data.readOnly)
|
|
268
|
+
return;
|
|
269
|
+
if (immediate)
|
|
270
|
+
instance.setState({ visited: true });
|
|
271
|
+
let value = null;
|
|
272
|
+
if (inputValue) {
|
|
273
|
+
let displayValue = widget.parseValue(inputValue, instance);
|
|
274
|
+
if (isNaN(displayValue)) {
|
|
275
|
+
instance.setState({
|
|
276
|
+
inputError: instance.widget.inputErrorText,
|
|
277
|
+
});
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
value = displayValue * data.scale + data.offset;
|
|
281
|
+
if (change == "wheel") {
|
|
282
|
+
e.preventDefault();
|
|
283
|
+
let increment = data.increment != null ? data.increment : this.calculateIncrement(value, data.incrementPercentage);
|
|
284
|
+
let deltaY = e.deltaY;
|
|
285
|
+
value = value + (deltaY < 0 ? increment : -increment);
|
|
286
|
+
if (widget.snapToIncrement) {
|
|
287
|
+
value = Math.round(value / increment) * increment;
|
|
288
|
+
}
|
|
289
|
+
if (data.minValue != null) {
|
|
290
|
+
if (data.minExclusive) {
|
|
291
|
+
if (value <= data.minValue)
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
value = Math.max(value, data.minValue);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (data.maxValue != null) {
|
|
299
|
+
if (data.maxExclusive) {
|
|
300
|
+
if (value >= data.maxValue)
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
value = Math.min(value, data.maxValue);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (data.constrain) {
|
|
309
|
+
if (data.minValue != null) {
|
|
310
|
+
if (value < data.minValue) {
|
|
311
|
+
value = data.minValue;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (data.maxValue != null) {
|
|
315
|
+
if (value > data.maxValue) {
|
|
316
|
+
value = data.maxValue;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
let fmt = data.format;
|
|
321
|
+
let decimalSeparator = this.getDecimalSeparator(fmt) || Format.value(1.1, "n;1")[1];
|
|
322
|
+
let formatted = Format.value(value, fmt);
|
|
323
|
+
// Re-parse to avoid differences between formatted value and value in the store
|
|
324
|
+
value = widget.parseValue(formatted, instance) * data.scale + data.offset;
|
|
325
|
+
// Allow users to type numbers like 100.0003 or -0.05 without interruptions
|
|
326
|
+
// If the last typed character is zero or dot (decimal separator), skip processing it
|
|
327
|
+
let selectionEnd = this.input.selectionEnd;
|
|
328
|
+
if (change == "change" &&
|
|
329
|
+
this.input.selectionStart == selectionEnd &&
|
|
330
|
+
selectionEnd != null &&
|
|
331
|
+
selectionEnd >= this.getLengthWithoutSuffix(this.input.value, decimalSeparator) &&
|
|
332
|
+
(inputValue[selectionEnd - 1] == decimalSeparator ||
|
|
333
|
+
(inputValue.indexOf(decimalSeparator) >= 0 && inputValue[selectionEnd - 1] == "0") ||
|
|
334
|
+
(selectionEnd == 2 && inputValue[0] === "-" && inputValue[1] === "0")))
|
|
335
|
+
return;
|
|
336
|
+
if (change != "blur") {
|
|
337
|
+
// Format, but keep the correct cursor position
|
|
338
|
+
let preCursorText = this.getPreCursorDigits(this.input.value, this.input.selectionStart, decimalSeparator);
|
|
339
|
+
this.input.value = formatted;
|
|
340
|
+
this.updateCursorPosition(preCursorText);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this.input.value = formatted;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
instance.set("value", value, { immediate });
|
|
347
|
+
instance.setState({
|
|
348
|
+
inputError: false,
|
|
349
|
+
visited: true,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
onFocus() {
|
|
353
|
+
let { instance } = this.props;
|
|
354
|
+
let { widget } = instance;
|
|
355
|
+
if (widget.trackFocus) {
|
|
356
|
+
this.setState({
|
|
357
|
+
focus: true,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { RenderingContext } from "../../ui/RenderingContext";
|
|
3
|
+
import type { Instance } from "../../ui/Instance";
|
|
4
|
+
import { Field, FieldConfig, FieldInstance } from "./Field";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { BooleanProp, Prop, StringProp } from "../../ui/Prop";
|
|
7
|
+
export interface RadioConfig extends FieldConfig {
|
|
8
|
+
/** Selected value. If the value is equal to `option`, the radio button appears checked. */
|
|
9
|
+
value?: Prop<number | string | boolean>;
|
|
10
|
+
/** Selected value. If the value is equal to `option`, the radio button appears checked. */
|
|
11
|
+
selection?: Prop<number | string | boolean>;
|
|
12
|
+
/** Value to be written into `value` if radio button is clicked. */
|
|
13
|
+
option?: Prop<number | string | boolean>;
|
|
14
|
+
/** Defaults to `false`. Used to make the field read-only. */
|
|
15
|
+
readOnly?: BooleanProp;
|
|
16
|
+
/** Text description. */
|
|
17
|
+
text?: StringProp;
|
|
18
|
+
/** Base CSS class to be applied to the field. Defaults to `radio`. */
|
|
19
|
+
baseClass?: string;
|
|
20
|
+
/** Use native radio HTML element. Default is `false`. */
|
|
21
|
+
native?: boolean;
|
|
22
|
+
/** Set to `true` to make the radio initially selected. */
|
|
23
|
+
default?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class Radio extends Field<RadioConfig> {
|
|
26
|
+
selection?: Prop<number | string | boolean>;
|
|
27
|
+
option?: Prop<number | string | boolean>;
|
|
28
|
+
native?: boolean;
|
|
29
|
+
default?: boolean;
|
|
30
|
+
value?: Prop<number | string | boolean>;
|
|
31
|
+
constructor(config?: RadioConfig);
|
|
32
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
33
|
+
init(): void;
|
|
34
|
+
formatValue(context: RenderingContext, { data }: Instance): React.ReactNode;
|
|
35
|
+
prepareData(context: RenderingContext, instance: FieldInstance<Radio>): void;
|
|
36
|
+
renderValue(context: RenderingContext, { data }: FieldInstance): React.ReactNode;
|
|
37
|
+
renderWrap(context: RenderingContext, instance: FieldInstance, key: string, content: React.ReactNode): React.ReactElement;
|
|
38
|
+
renderNativeCheck(context: RenderingContext, instance: Instance): React.ReactElement;
|
|
39
|
+
renderCheck(context: RenderingContext, instance: FieldInstance<Radio>): React.ReactElement;
|
|
40
|
+
renderInput(context: RenderingContext, instance: FieldInstance<Radio>, key: string): React.ReactElement;
|
|
41
|
+
handleClick(e: React.MouseEvent, instance: Instance): void;
|
|
42
|
+
handleChange(e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent, instance: Instance): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Widget, VDOM, getContent } from "../../ui/Widget";
|
|
3
|
+
import { Field, getFieldTooltip } from "./Field";
|
|
4
|
+
import { tooltipMouseMove, tooltipMouseLeave } from "../overlay/tooltip-ops";
|
|
5
|
+
import { stopPropagation } from "../../util/eventCallbacks";
|
|
6
|
+
import { KeyCode } from "../../util/KeyCode";
|
|
7
|
+
import { isUndefined } from "../../util/isUndefined";
|
|
8
|
+
export class Radio extends Field {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super(config);
|
|
11
|
+
}
|
|
12
|
+
declareData(...args) {
|
|
13
|
+
super.declareData({
|
|
14
|
+
value: undefined,
|
|
15
|
+
selection: undefined,
|
|
16
|
+
option: undefined,
|
|
17
|
+
disabled: undefined,
|
|
18
|
+
enabled: undefined,
|
|
19
|
+
readOnly: undefined,
|
|
20
|
+
required: undefined,
|
|
21
|
+
text: undefined,
|
|
22
|
+
}, ...args);
|
|
23
|
+
}
|
|
24
|
+
init() {
|
|
25
|
+
if (this.selection)
|
|
26
|
+
this.value = this.selection;
|
|
27
|
+
super.init();
|
|
28
|
+
}
|
|
29
|
+
formatValue(context, { data }) {
|
|
30
|
+
return data.text;
|
|
31
|
+
}
|
|
32
|
+
prepareData(context, instance) {
|
|
33
|
+
super.prepareData(context, instance);
|
|
34
|
+
let { data } = instance;
|
|
35
|
+
data.checked = data.value === data.option;
|
|
36
|
+
if (this.default && isUndefined(data.value))
|
|
37
|
+
instance.set("value", data.option);
|
|
38
|
+
}
|
|
39
|
+
renderValue(context, { data }) {
|
|
40
|
+
if (data.value === data.option)
|
|
41
|
+
return super.renderValue(context, { data });
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
renderWrap(context, instance, key, content) {
|
|
45
|
+
var { data } = instance;
|
|
46
|
+
return (_jsxs("label", { className: data.classNames, style: data.style, onMouseDown: stopPropagation, onTouchStart: stopPropagation, onMouseMove: (e) => tooltipMouseMove(e, ...getFieldTooltip(instance)), onMouseLeave: (e) => tooltipMouseLeave(e, ...getFieldTooltip(instance)), onClick: (e) => {
|
|
47
|
+
this.handleClick(e, instance);
|
|
48
|
+
}, htmlFor: data.id, children: [content, this.labelPlacement && getContent(this.renderLabel(context, instance, "label"))] }, key));
|
|
49
|
+
}
|
|
50
|
+
renderNativeCheck(context, instance) {
|
|
51
|
+
var { CSS, baseClass } = this;
|
|
52
|
+
var { data } = instance;
|
|
53
|
+
return (_jsx("input", { className: CSS.element(baseClass, "radio"), id: data.id, type: "radio", checked: data.checked, disabled: data.disabled, ...data.inputAttrs, onClick: stopPropagation, onChange: (e) => {
|
|
54
|
+
this.handleChange(e, instance);
|
|
55
|
+
} }, "input"));
|
|
56
|
+
}
|
|
57
|
+
renderCheck(context, instance) {
|
|
58
|
+
return _jsx(RadioCmp, { instance: instance, data: instance.data }, "check");
|
|
59
|
+
}
|
|
60
|
+
renderInput(context, instance, key) {
|
|
61
|
+
var { data } = instance;
|
|
62
|
+
var text = data.text || this.renderChildren(context, instance);
|
|
63
|
+
var { CSS, baseClass } = this;
|
|
64
|
+
return this.renderWrap(context, instance, key, [
|
|
65
|
+
this.native ? this.renderNativeCheck(context, instance) : this.renderCheck(context, instance),
|
|
66
|
+
text ? (_jsx("div", { className: CSS.element(baseClass, "text"), children: text }, "text")) : (_jsx("span", { className: CSS.element(baseClass, "baseline"), children: "\u00A0" }, "baseline")),
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
handleClick(e, instance) {
|
|
70
|
+
if (this.native)
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
else {
|
|
73
|
+
var el = document.getElementById(instance.data.id);
|
|
74
|
+
if (el)
|
|
75
|
+
el.focus();
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
this.handleChange(e, instance);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
handleChange(e, instance) {
|
|
81
|
+
var { data } = instance;
|
|
82
|
+
if (data.disabled || data.readOnly || data.viewMode)
|
|
83
|
+
return;
|
|
84
|
+
instance.set("value", data.option);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
Radio.prototype.baseClass = "radio";
|
|
88
|
+
Radio.prototype.native = false;
|
|
89
|
+
Radio.prototype.default = false;
|
|
90
|
+
Widget.alias("radio", Radio);
|
|
91
|
+
class RadioCmp extends VDOM.Component {
|
|
92
|
+
constructor(props) {
|
|
93
|
+
super(props);
|
|
94
|
+
this.state = {
|
|
95
|
+
value: props.data.checked,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
99
|
+
this.setState({
|
|
100
|
+
value: props.data.checked,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
var { instance, data } = this.props;
|
|
105
|
+
var { widget } = instance;
|
|
106
|
+
var { baseClass, CSS } = widget;
|
|
107
|
+
return (_jsx("span", { tabIndex: data.disabled ? undefined : data.tabIndex || 0, className: CSS.element(baseClass, "input", {
|
|
108
|
+
checked: this.state.value,
|
|
109
|
+
}), style: CSS.parseStyle(data.inputStyle), id: data.id, onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this) }, "check"));
|
|
110
|
+
}
|
|
111
|
+
onClick(e) {
|
|
112
|
+
var { instance, data } = this.props;
|
|
113
|
+
var { widget } = instance;
|
|
114
|
+
if (!data.disabled && !data.readOnly) {
|
|
115
|
+
e.stopPropagation();
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
widget.handleChange(e, instance);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
onKeyDown(e) {
|
|
121
|
+
let { instance } = this.props;
|
|
122
|
+
const widget = instance.widget;
|
|
123
|
+
if (widget.handleKeyDown && widget.handleKeyDown(e, instance) === false)
|
|
124
|
+
return;
|
|
125
|
+
switch (e.keyCode) {
|
|
126
|
+
case KeyCode.space:
|
|
127
|
+
this.onClick(e);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { HtmlElement, HtmlElementInstance } from "../HtmlElement";
|
|
3
|
+
import { Field, FieldInstance } from "./Field";
|
|
4
|
+
import type { RenderingContext } from "../../ui/RenderingContext";
|
|
5
|
+
import type { Instance } from "../../ui/Instance";
|
|
6
|
+
import { FieldConfig } from "./Field";
|
|
7
|
+
import { Prop, StringProp, BooleanProp } from "../../ui/Prop";
|
|
8
|
+
export interface SelectConfig extends FieldConfig {
|
|
9
|
+
value?: Prop<number | string>;
|
|
10
|
+
emptyValue?: unknown;
|
|
11
|
+
enabled?: BooleanProp;
|
|
12
|
+
placeholder?: StringProp;
|
|
13
|
+
hideClear?: boolean;
|
|
14
|
+
showClear?: boolean;
|
|
15
|
+
alwaysShowClear?: boolean;
|
|
16
|
+
baseClass?: string;
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
convertValues?: boolean;
|
|
19
|
+
nullString?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class Select<Config extends SelectConfig = SelectConfig> extends Field<Config> {
|
|
22
|
+
baseClass: string;
|
|
23
|
+
hideClear?: boolean;
|
|
24
|
+
showClear: boolean;
|
|
25
|
+
alwaysShowClear: boolean;
|
|
26
|
+
multiple: boolean;
|
|
27
|
+
convertValues: boolean;
|
|
28
|
+
nullString: string;
|
|
29
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
30
|
+
init(): void;
|
|
31
|
+
renderInput(context: RenderingContext, instance: FieldInstance<Select>, key: string): React.ReactNode;
|
|
32
|
+
convert(value: string): string | number | boolean | null;
|
|
33
|
+
select(value: string, instance: Instance): void;
|
|
34
|
+
add(item: unknown): void;
|
|
35
|
+
}
|
|
36
|
+
export declare class Option extends HtmlElement {
|
|
37
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
38
|
+
prepareData(context: RenderingContext, instance: HtmlElementInstance): void;
|
|
39
|
+
render(context: RenderingContext, instance: HtmlElementInstance, key: string): React.ReactNode;
|
|
40
|
+
}
|