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,445 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { StringTemplate } from "../../data/StringTemplate";
|
|
4
|
+
import { Culture } from "../../ui/Culture";
|
|
5
|
+
import { FocusManager, offFocusOut, oneFocusOut } from "../../ui/FocusManager";
|
|
6
|
+
import "../../ui/Format";
|
|
7
|
+
import { Localization } from "../../ui/Localization";
|
|
8
|
+
import { VDOM, Widget } from "../../ui/Widget";
|
|
9
|
+
import { parseDateInvariant } from "../../util";
|
|
10
|
+
import { KeyCode } from "../../util/KeyCode";
|
|
11
|
+
import { dateDiff } from "../../util/date/dateDiff";
|
|
12
|
+
import { lowerBoundCheck } from "../../util/date/lowerBoundCheck";
|
|
13
|
+
import { monthStart } from "../../util/date/monthStart";
|
|
14
|
+
import { sameDate } from "../../util/date/sameDate";
|
|
15
|
+
import { upperBoundCheck } from "../../util/date/upperBoundCheck";
|
|
16
|
+
import { zeroTime } from "../../util/date/zeroTime";
|
|
17
|
+
import DropdownIcon from "../icons/drop-down";
|
|
18
|
+
import ForwardIcon from "../icons/forward";
|
|
19
|
+
import { tooltipMouseLeave, tooltipMouseMove, tooltipParentDidMount, tooltipParentWillReceiveProps, tooltipParentWillUnmount, } from "../overlay/tooltip-ops";
|
|
20
|
+
import { Field, getFieldTooltip } from "./Field";
|
|
21
|
+
export class Calendar extends Field {
|
|
22
|
+
constructor(config) {
|
|
23
|
+
super(config);
|
|
24
|
+
}
|
|
25
|
+
declareData(...args) {
|
|
26
|
+
super.declareData({
|
|
27
|
+
value: undefined,
|
|
28
|
+
refDate: undefined,
|
|
29
|
+
disabled: undefined,
|
|
30
|
+
enabled: undefined,
|
|
31
|
+
minValue: undefined,
|
|
32
|
+
minExclusive: undefined,
|
|
33
|
+
maxValue: undefined,
|
|
34
|
+
maxExclusive: undefined,
|
|
35
|
+
focusable: undefined,
|
|
36
|
+
dayData: undefined,
|
|
37
|
+
}, ...args);
|
|
38
|
+
}
|
|
39
|
+
init() {
|
|
40
|
+
if (this.unfocusable)
|
|
41
|
+
this.focusable = false;
|
|
42
|
+
super.init();
|
|
43
|
+
}
|
|
44
|
+
prepareData(context, instance, ...args) {
|
|
45
|
+
const { data } = instance;
|
|
46
|
+
data.stateMods = {
|
|
47
|
+
disabled: data.disabled,
|
|
48
|
+
};
|
|
49
|
+
if (data.value) {
|
|
50
|
+
let d = parseDateInvariant(data.value);
|
|
51
|
+
if (!isNaN(d.getTime())) {
|
|
52
|
+
data.date = zeroTime(d);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (data.refDate)
|
|
56
|
+
data.refDate = zeroTime(parseDateInvariant(data.refDate));
|
|
57
|
+
if (data.maxValue)
|
|
58
|
+
data.maxValue = zeroTime(parseDateInvariant(data.maxValue));
|
|
59
|
+
if (data.minValue)
|
|
60
|
+
data.minValue = zeroTime(parseDateInvariant(data.minValue));
|
|
61
|
+
super.prepareData(context, instance, ...args);
|
|
62
|
+
}
|
|
63
|
+
validate(context, instance) {
|
|
64
|
+
super.validate(context, instance);
|
|
65
|
+
let { data, widget } = instance;
|
|
66
|
+
let calendarWidget = widget;
|
|
67
|
+
if (!data.error && data.date) {
|
|
68
|
+
let d;
|
|
69
|
+
if (data.maxValue) {
|
|
70
|
+
d = dateDiff(data.date, data.maxValue);
|
|
71
|
+
if (d > 0)
|
|
72
|
+
data.error = StringTemplate.format(this.maxValueErrorText, data.maxValue);
|
|
73
|
+
else if (d == 0 && data.maxExclusive)
|
|
74
|
+
data.error = StringTemplate.format(this.maxExclusiveErrorText, data.maxValue);
|
|
75
|
+
}
|
|
76
|
+
if (data.minValue) {
|
|
77
|
+
d = dateDiff(data.date, data.minValue);
|
|
78
|
+
if (d < 0)
|
|
79
|
+
data.error = StringTemplate.format(this.minValueErrorText, data.minValue);
|
|
80
|
+
else if (d == 0 && data.minExclusive)
|
|
81
|
+
data.error = StringTemplate.format(this.minExclusiveErrorText, data.minValue);
|
|
82
|
+
}
|
|
83
|
+
if (calendarWidget.disabledDaysOfWeek) {
|
|
84
|
+
if (calendarWidget.disabledDaysOfWeek.includes(data.date.getDay()))
|
|
85
|
+
data.error = this.disabledDaysOfWeekErrorText;
|
|
86
|
+
}
|
|
87
|
+
if (data.dayData) {
|
|
88
|
+
let date = parseDateInvariant(data.value);
|
|
89
|
+
let info = data.dayData[date.toDateString()];
|
|
90
|
+
if (info && info.disabled)
|
|
91
|
+
data.error = this.disabledDaysOfWeekErrorText;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
renderInput(context, instance, key) {
|
|
96
|
+
return (_jsx(CalendarCmp, { instance: instance, handleSelect: (e, date) => this.handleSelect(e, instance, date) }, key));
|
|
97
|
+
}
|
|
98
|
+
handleSelect(e, instance, date) {
|
|
99
|
+
let { store, data, widget } = instance;
|
|
100
|
+
let calendarWidget = widget;
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
if (data.disabled)
|
|
103
|
+
return;
|
|
104
|
+
if (!validationCheck(date, data, calendarWidget.disabledDaysOfWeek))
|
|
105
|
+
return;
|
|
106
|
+
if (this.onBeforeSelect && instance.invoke("onBeforeSelect", e, instance, date) === false)
|
|
107
|
+
return;
|
|
108
|
+
if (calendarWidget.partial) {
|
|
109
|
+
let mixed = parseDateInvariant(data.value);
|
|
110
|
+
if (data.value && !isNaN(mixed.getTime())) {
|
|
111
|
+
mixed.setFullYear(date.getFullYear());
|
|
112
|
+
mixed.setMonth(date.getMonth());
|
|
113
|
+
mixed.setDate(date.getDate());
|
|
114
|
+
date = mixed;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
let encode = calendarWidget.encoding || Culture.getDefaultDateEncoding();
|
|
118
|
+
instance.set("value", encode(date));
|
|
119
|
+
if (this.onSelect)
|
|
120
|
+
instance.invoke("onSelect", e, instance, date);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
Calendar.prototype.baseClass = "calendar";
|
|
124
|
+
Calendar.prototype.highlightToday = true;
|
|
125
|
+
Calendar.prototype.maxValueErrorText = "Select a date not after {0:d}.";
|
|
126
|
+
Calendar.prototype.maxExclusiveErrorText = "Select a date before {0:d}.";
|
|
127
|
+
Calendar.prototype.minValueErrorText = "Select a date not before {0:d}.";
|
|
128
|
+
Calendar.prototype.minExclusiveErrorText = "Select a date after {0:d}.";
|
|
129
|
+
Calendar.prototype.disabledDaysOfWeekErrorText = "Selected day of week is not allowed.";
|
|
130
|
+
Calendar.prototype.suppressErrorsUntilVisited = false;
|
|
131
|
+
Calendar.prototype.showTodayButton = false;
|
|
132
|
+
Calendar.prototype.todayButtonText = "Today";
|
|
133
|
+
Calendar.prototype.startWithMonday = false;
|
|
134
|
+
Calendar.prototype.focusable = true;
|
|
135
|
+
Localization.registerPrototype("cx/widgets/Calendar", Calendar);
|
|
136
|
+
const validationCheck = (date, data, disabledDaysOfWeek) => {
|
|
137
|
+
if (data.maxValue && !upperBoundCheck(date, data.maxValue, data.maxExclusive))
|
|
138
|
+
return false;
|
|
139
|
+
if (data.minValue && !lowerBoundCheck(date, data.minValue, data.minExclusive))
|
|
140
|
+
return false;
|
|
141
|
+
if (disabledDaysOfWeek && disabledDaysOfWeek.includes(date.getDay()))
|
|
142
|
+
return false;
|
|
143
|
+
if (data.dayData) {
|
|
144
|
+
let day = data.dayData[date.toDateString()];
|
|
145
|
+
if (day && (day.disabled || day.unselectable))
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
};
|
|
150
|
+
export class CalendarCmp extends VDOM.Component {
|
|
151
|
+
el = null;
|
|
152
|
+
constructor(props) {
|
|
153
|
+
super(props);
|
|
154
|
+
let { data } = props.instance;
|
|
155
|
+
let refDate = data.refDate ? data.refDate : data.date || zeroTime(new Date());
|
|
156
|
+
this.state = {
|
|
157
|
+
hover: false,
|
|
158
|
+
focus: false,
|
|
159
|
+
cursor: zeroTime(data.date || refDate),
|
|
160
|
+
activeView: "calendar",
|
|
161
|
+
...this.getPage(refDate),
|
|
162
|
+
};
|
|
163
|
+
this.handleMouseMove = this.handleMouseMove.bind(this);
|
|
164
|
+
this.handleMouseDown = this.handleMouseDown.bind(this);
|
|
165
|
+
}
|
|
166
|
+
getPage(refDate) {
|
|
167
|
+
refDate = monthStart(refDate); //make a copy
|
|
168
|
+
let calendarWidget = this.props.instance.widget;
|
|
169
|
+
let startWithMonday = calendarWidget.startWithMonday;
|
|
170
|
+
let startDay = startWithMonday ? 1 : 0;
|
|
171
|
+
let startDate = new Date(refDate);
|
|
172
|
+
while (startDate.getDay() != startDay)
|
|
173
|
+
startDate.setDate(startDate.getDate() - 1);
|
|
174
|
+
let endDate = new Date(refDate);
|
|
175
|
+
endDate.setMonth(refDate.getMonth() + 1);
|
|
176
|
+
endDate.setDate(endDate.getDate() - 1);
|
|
177
|
+
let endDay = startWithMonday ? 0 : 6;
|
|
178
|
+
while (endDate.getDay() != endDay)
|
|
179
|
+
endDate.setDate(endDate.getDate() + 1);
|
|
180
|
+
return {
|
|
181
|
+
refDate,
|
|
182
|
+
startDate,
|
|
183
|
+
endDate,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
moveCursor(e, date, options = {}) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
date = zeroTime(date);
|
|
190
|
+
if (date.getTime() == this.state.cursor.getTime())
|
|
191
|
+
return;
|
|
192
|
+
let refDate = this.state.refDate;
|
|
193
|
+
if (options.movePage || date < this.state.startDate || date > this.state.endDate)
|
|
194
|
+
refDate = date;
|
|
195
|
+
this.setState({
|
|
196
|
+
...this.getPage(refDate),
|
|
197
|
+
cursor: date,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
move(e, period, delta) {
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
e.stopPropagation();
|
|
203
|
+
let refDate = new Date(this.state.refDate);
|
|
204
|
+
switch (period) {
|
|
205
|
+
case "y":
|
|
206
|
+
refDate.setFullYear(refDate.getFullYear() + delta);
|
|
207
|
+
break;
|
|
208
|
+
case "m":
|
|
209
|
+
refDate.setMonth(refDate.getMonth() + delta);
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
let page = this.getPage(refDate);
|
|
213
|
+
let cursor = this.state.cursor;
|
|
214
|
+
if (cursor < page.startDate)
|
|
215
|
+
cursor = page.startDate;
|
|
216
|
+
else if (cursor > page.endDate)
|
|
217
|
+
cursor = page.endDate;
|
|
218
|
+
this.setState({ ...page, cursor });
|
|
219
|
+
}
|
|
220
|
+
handleKeyPress(e) {
|
|
221
|
+
let cursor = new Date(this.state.cursor);
|
|
222
|
+
switch (e.keyCode) {
|
|
223
|
+
case KeyCode.enter:
|
|
224
|
+
this.props.handleSelect(e, this.state.cursor);
|
|
225
|
+
break;
|
|
226
|
+
case KeyCode.left:
|
|
227
|
+
cursor.setDate(cursor.getDate() - 1);
|
|
228
|
+
this.moveCursor(e, cursor);
|
|
229
|
+
break;
|
|
230
|
+
case KeyCode.right:
|
|
231
|
+
cursor.setDate(cursor.getDate() + 1);
|
|
232
|
+
this.moveCursor(e, cursor);
|
|
233
|
+
break;
|
|
234
|
+
case KeyCode.up:
|
|
235
|
+
cursor.setDate(cursor.getDate() - 7);
|
|
236
|
+
this.moveCursor(e, cursor);
|
|
237
|
+
break;
|
|
238
|
+
case KeyCode.down:
|
|
239
|
+
cursor.setDate(cursor.getDate() + 7);
|
|
240
|
+
this.moveCursor(e, cursor);
|
|
241
|
+
break;
|
|
242
|
+
case KeyCode.pageUp:
|
|
243
|
+
cursor.setMonth(cursor.getMonth() - 1);
|
|
244
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
245
|
+
break;
|
|
246
|
+
case KeyCode.pageDown:
|
|
247
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
248
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
249
|
+
break;
|
|
250
|
+
case KeyCode.home:
|
|
251
|
+
cursor.setDate(1);
|
|
252
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
253
|
+
break;
|
|
254
|
+
case KeyCode.end:
|
|
255
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
256
|
+
cursor.setDate(0);
|
|
257
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
let { instance } = this.props;
|
|
261
|
+
let calendarWidget = instance.widget;
|
|
262
|
+
if (calendarWidget.onKeyDown)
|
|
263
|
+
instance.invoke("onKeyDown", e, instance);
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
handleWheel(e) {
|
|
268
|
+
e.preventDefault();
|
|
269
|
+
e.stopPropagation();
|
|
270
|
+
let cursor = new Date(this.state.cursor);
|
|
271
|
+
if (e.deltaY < 0) {
|
|
272
|
+
cursor.setMonth(cursor.getMonth() - 1);
|
|
273
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
274
|
+
}
|
|
275
|
+
else if (e.deltaY > 0) {
|
|
276
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
277
|
+
this.moveCursor(e, cursor, { movePage: true });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
handleBlur(e) {
|
|
281
|
+
FocusManager.nudge();
|
|
282
|
+
let { instance } = this.props;
|
|
283
|
+
let calendarWidget = instance.widget;
|
|
284
|
+
if (calendarWidget.onBlur)
|
|
285
|
+
instance.invoke("onBlur", e, instance);
|
|
286
|
+
this.setState({
|
|
287
|
+
focus: false,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
handleFocus(e) {
|
|
291
|
+
oneFocusOut(this, this.el, this.handleFocusOut.bind(this));
|
|
292
|
+
this.setState({
|
|
293
|
+
focus: true,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
handleFocusOut() {
|
|
297
|
+
let { instance } = this.props;
|
|
298
|
+
let calendarWidget = instance.widget;
|
|
299
|
+
if (calendarWidget.onFocusOut)
|
|
300
|
+
instance.invoke("onFocusOut", null, instance);
|
|
301
|
+
}
|
|
302
|
+
handleMouseLeave(e) {
|
|
303
|
+
tooltipMouseLeave(e, ...getFieldTooltip(this.props.instance));
|
|
304
|
+
this.setState({
|
|
305
|
+
hover: false,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
handleMouseEnter(e) {
|
|
309
|
+
this.setState({
|
|
310
|
+
hover: true,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
handleMouseMove(e) {
|
|
314
|
+
this.moveCursor(e, readDate(e.target.dataset));
|
|
315
|
+
}
|
|
316
|
+
handleMouseDown(e) {
|
|
317
|
+
this.props.handleSelect(e, readDate(e.target.dataset));
|
|
318
|
+
}
|
|
319
|
+
componentDidMount() {
|
|
320
|
+
//calendar doesn't bring up keyboard so it's ok to focus it even on mobile
|
|
321
|
+
let calendarWidget = this.props.instance.widget;
|
|
322
|
+
if (calendarWidget.autoFocus && this.el)
|
|
323
|
+
this.el.focus();
|
|
324
|
+
if (this.el) {
|
|
325
|
+
tooltipParentDidMount(this.el, ...getFieldTooltip(this.props.instance));
|
|
326
|
+
this.el.addEventListener("wheel", (e) => this.handleWheel(e));
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
330
|
+
let { data } = props.instance;
|
|
331
|
+
if (data.date)
|
|
332
|
+
this.setState({
|
|
333
|
+
...this.getPage(data.date),
|
|
334
|
+
});
|
|
335
|
+
if (this.el) {
|
|
336
|
+
tooltipParentWillReceiveProps(this.el, ...getFieldTooltip(props.instance));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
componentWillUnmount() {
|
|
340
|
+
offFocusOut(this);
|
|
341
|
+
tooltipParentWillUnmount(this.props.instance);
|
|
342
|
+
}
|
|
343
|
+
showYearDropdown() {
|
|
344
|
+
if (this.el && this.el.firstChild) {
|
|
345
|
+
this.setState({
|
|
346
|
+
activeView: "year-picker",
|
|
347
|
+
yearPickerHeight: this.el.firstChild.offsetHeight,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
handleYearSelect(e, year) {
|
|
352
|
+
e.preventDefault();
|
|
353
|
+
e.stopPropagation();
|
|
354
|
+
let refDate = new Date(this.state.refDate);
|
|
355
|
+
refDate.setFullYear(year);
|
|
356
|
+
this.setState({
|
|
357
|
+
...this.getPage(refDate),
|
|
358
|
+
activeView: "calendar",
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
renderYearPicker() {
|
|
362
|
+
let { data, widget } = this.props.instance;
|
|
363
|
+
let calendarWidget = widget;
|
|
364
|
+
let minYear = data.minValue?.getFullYear();
|
|
365
|
+
let maxYear = data.maxValue?.getFullYear();
|
|
366
|
+
let { CSS } = widget;
|
|
367
|
+
let years = [];
|
|
368
|
+
let currentYear = new Date().getFullYear();
|
|
369
|
+
let midYear = currentYear - (currentYear % 5);
|
|
370
|
+
let refYear = new Date(this.state.refDate).getFullYear();
|
|
371
|
+
for (let i = midYear - 100; i <= midYear + 100; i++) {
|
|
372
|
+
years.push(i);
|
|
373
|
+
}
|
|
374
|
+
let rows = [];
|
|
375
|
+
for (let i = 0; i < years.length; i += 5) {
|
|
376
|
+
rows.push(years.slice(i, i + 5));
|
|
377
|
+
}
|
|
378
|
+
return (_jsx("div", { className: CSS.element(calendarWidget.baseClass, "year-picker"), style: {
|
|
379
|
+
height: this.state.yearPickerHeight,
|
|
380
|
+
}, ref: (el) => {
|
|
381
|
+
if (el) {
|
|
382
|
+
el.addEventListener("wheel", (e) => {
|
|
383
|
+
e.stopPropagation();
|
|
384
|
+
});
|
|
385
|
+
let activeYear = el.querySelector("." + CSS.state("selected"));
|
|
386
|
+
if (activeYear)
|
|
387
|
+
activeYear.scrollIntoView({ block: "center", behavior: "instant" });
|
|
388
|
+
}
|
|
389
|
+
}, children: _jsx("table", { children: _jsx("tbody", { children: rows.map((row, rowIndex) => (_jsx("tr", { children: row.map((year) => (_jsx("td", { className: CSS.element(calendarWidget.baseClass, "year-option", {
|
|
390
|
+
unselectable: (minYear && year < minYear) || (maxYear && year > maxYear),
|
|
391
|
+
selected: year === refYear,
|
|
392
|
+
active: year === currentYear,
|
|
393
|
+
}), onClick: (e) => this.handleYearSelect(e, year), children: year }, year))) }, rowIndex))) }) }) }));
|
|
394
|
+
}
|
|
395
|
+
render() {
|
|
396
|
+
let { data, widget } = this.props.instance;
|
|
397
|
+
let calendarWidget = widget;
|
|
398
|
+
let { CSS, baseClass, disabledDaysOfWeek, startWithMonday } = calendarWidget;
|
|
399
|
+
let { refDate, startDate, endDate } = this.getPage(this.state.refDate);
|
|
400
|
+
let month = refDate.getMonth();
|
|
401
|
+
let year = refDate.getFullYear();
|
|
402
|
+
let weeks = [];
|
|
403
|
+
let date = startDate;
|
|
404
|
+
let empty = {};
|
|
405
|
+
let today = zeroTime(new Date());
|
|
406
|
+
while (date >= startDate && date <= endDate) {
|
|
407
|
+
let days = [];
|
|
408
|
+
for (let i = 0; i < 7; i++) {
|
|
409
|
+
let dayInfo = (data.dayData && data.dayData[date.toDateString()]) || empty;
|
|
410
|
+
let unselectable = !validationCheck(date, data, disabledDaysOfWeek);
|
|
411
|
+
let classNames = CSS.expand(CSS.element(baseClass, "day", {
|
|
412
|
+
outside: month != date.getMonth(),
|
|
413
|
+
unselectable: unselectable,
|
|
414
|
+
selected: data.date && sameDate(data.date, date),
|
|
415
|
+
cursor: (this.state.hover || this.state.focus) && this.state.cursor && sameDate(this.state.cursor, date),
|
|
416
|
+
today: calendarWidget.highlightToday && sameDate(date, today),
|
|
417
|
+
}), dayInfo.className, CSS.mod(dayInfo.mod));
|
|
418
|
+
let dateInst = new Date(date);
|
|
419
|
+
days.push(_jsx("td", { className: classNames, style: CSS.parseStyle(dayInfo.style), "data-year": dateInst.getFullYear(), "data-month": dateInst.getMonth() + 1, "data-date": dateInst.getDate(), onMouseMove: unselectable ? undefined : this.handleMouseMove, onMouseDown: unselectable ? undefined : this.handleMouseDown, children: date.getDate() }, i));
|
|
420
|
+
date.setDate(date.getDate() + 1);
|
|
421
|
+
}
|
|
422
|
+
weeks.push(_jsxs("tr", { className: CSS.element(baseClass, "week"), children: [_jsx("td", {}), days, _jsx("td", {})] }, weeks.length));
|
|
423
|
+
}
|
|
424
|
+
let culture = Culture.getDateTimeCulture();
|
|
425
|
+
let monthNames = culture.getMonthNames("long");
|
|
426
|
+
let dayNames = culture.getWeekdayNames("short").map((x) => x.substr(0, 2));
|
|
427
|
+
if (startWithMonday)
|
|
428
|
+
dayNames = [...dayNames.slice(1), dayNames[0]];
|
|
429
|
+
return (_jsxs("div", { className: data.classNames, tabIndex: data.disabled || !data.focusable ? null : data.tabIndex || 0, onKeyDown: (e) => this.handleKeyPress(e), onMouseDown: (e) => {
|
|
430
|
+
// prevent losing focus from the input field
|
|
431
|
+
if (!data.focusable) {
|
|
432
|
+
e.preventDefault();
|
|
433
|
+
}
|
|
434
|
+
e.stopPropagation();
|
|
435
|
+
}, ref: (el) => {
|
|
436
|
+
this.el = el;
|
|
437
|
+
}, onMouseMove: (e) => tooltipMouseMove(e, ...getFieldTooltip(this.props.instance)), onMouseLeave: (e) => this.handleMouseLeave(e), onMouseEnter: (e) => this.handleMouseEnter(e),
|
|
438
|
+
// onWheel={(e) => this.handleWheel(e)}
|
|
439
|
+
onFocus: (e) => this.handleFocus(e), onBlur: (e) => this.handleBlur(e), children: [this.state.activeView == "calendar" && (_jsxs("table", { children: [_jsxs("thead", { children: [_jsxs("tr", { className: CSS.element(baseClass, "header"), children: [_jsx("td", {}), _jsx("td", { onClick: (e) => this.move(e, "y", -1), children: _jsx(ForwardIcon, { className: CSS.element(baseClass, "icon-prev-year") }) }), _jsx("td", { onClick: (e) => this.move(e, "m", -1), children: _jsx(DropdownIcon, { className: CSS.element(baseClass, "icon-prev-month") }) }), _jsxs("th", { className: CSS.element(baseClass, "display"), colSpan: 3, children: [monthNames[month], _jsx("br", {}), _jsx("span", { onClick: () => this.showYearDropdown(), className: CSS.element(baseClass, "year-name"), children: year })] }), _jsx("td", { onClick: (e) => this.move(e, "m", +1), children: _jsx(DropdownIcon, { className: CSS.element(baseClass, "icon-next-month") }) }), _jsx("td", { onClick: (e) => this.move(e, "y", +1), children: _jsx(ForwardIcon, { className: CSS.element(baseClass, "icon-next-year") }) }), _jsx("td", {})] }, "h"), _jsxs("tr", { className: CSS.element(baseClass, "day-names"), children: [_jsx("td", {}), dayNames.map((name, i) => (_jsx("th", { children: name }, i))), _jsx("td", {})] }, "d")] }), _jsx("tbody", { children: weeks })] })), this.state.activeView == "calendar" && calendarWidget.showTodayButton && (_jsx("div", { className: CSS.element(baseClass, "toolbar"), children: _jsx("button", { className: CSS.expand(CSS.element(baseClass, "today-button"), CSS.block("button", "hollow")), "data-year": today.getFullYear(), "data-month": today.getMonth() + 1, "data-date": today.getDate(), onClick: (e) => {
|
|
440
|
+
this.handleMouseDown(e);
|
|
441
|
+
}, children: calendarWidget.todayButtonText }) })), this.state.activeView == "year-picker" && this.renderYearPicker()] }));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
const readDate = (ds) => new Date(Number(ds.year), Number(ds.month) - 1, Number(ds.date));
|
|
445
|
+
Widget.alias("calendar", Calendar);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import type { Instance } from "../../ui/Instance";
|
|
4
|
+
import type { RenderingContext } from "../../ui/RenderingContext";
|
|
5
|
+
import { Field, FieldConfig, FieldInstance } from "./Field";
|
|
6
|
+
import { BooleanProp, StringProp } from "../../ui/Prop";
|
|
7
|
+
export interface CheckboxConfig extends FieldConfig {
|
|
8
|
+
/** Value of the checkbox. */
|
|
9
|
+
value?: BooleanProp;
|
|
10
|
+
/** Set to `true` to make the checkbox read-only. */
|
|
11
|
+
readOnly?: BooleanProp;
|
|
12
|
+
/** Base CSS class to be applied to the element. Defaults to `checkbox`. */
|
|
13
|
+
baseClass?: string;
|
|
14
|
+
/** Use native checkbox HTML element. */
|
|
15
|
+
native?: boolean;
|
|
16
|
+
/** Set to `true` to display a square icon to indicate `null` or `undefined` value. */
|
|
17
|
+
indeterminate?: boolean;
|
|
18
|
+
/** Checked value alias for `value`. */
|
|
19
|
+
checked?: BooleanProp;
|
|
20
|
+
/** Text description. */
|
|
21
|
+
text?: StringProp;
|
|
22
|
+
/** Set to true to disable focusing on the checkbox. Used in grids to avoid conflicts. */
|
|
23
|
+
unfocusable?: boolean;
|
|
24
|
+
/** View mode text. */
|
|
25
|
+
viewText?: StringProp;
|
|
26
|
+
}
|
|
27
|
+
export declare class Checkbox extends Field<CheckboxConfig> {
|
|
28
|
+
baseClass: string;
|
|
29
|
+
checked?: unknown;
|
|
30
|
+
value?: unknown;
|
|
31
|
+
indeterminate?: boolean;
|
|
32
|
+
unfocusable?: boolean;
|
|
33
|
+
native?: boolean;
|
|
34
|
+
constructor(config?: CheckboxConfig);
|
|
35
|
+
init(): void;
|
|
36
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
37
|
+
renderWrap(context: RenderingContext, instance: FieldInstance<Checkbox>, key: string, content: React.ReactNode): React.ReactElement;
|
|
38
|
+
validateRequired(context: RenderingContext, instance: FieldInstance<Checkbox>): string | undefined;
|
|
39
|
+
renderNativeCheck(context: RenderingContext, instance: FieldInstance<Checkbox>): React.ReactElement;
|
|
40
|
+
renderCheck(context: RenderingContext, instance: FieldInstance<Checkbox>): React.ReactElement;
|
|
41
|
+
renderInput(context: RenderingContext, instance: FieldInstance<Checkbox>, key: string): React.ReactElement;
|
|
42
|
+
renderValue(context: RenderingContext, instance: FieldInstance): React.ReactNode;
|
|
43
|
+
formatValue(context: RenderingContext, instance: Instance): React.ReactNode | string;
|
|
44
|
+
handleClick(e: React.MouseEvent, instance: Instance): void;
|
|
45
|
+
handleChange(e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent, instance: Instance, checked?: boolean): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { VDOM } from "../../ui/VDOM";
|
|
3
|
+
import { Widget, getContent } from "../../ui/Widget";
|
|
4
|
+
import { stopPropagation } from "../../util/eventCallbacks";
|
|
5
|
+
import { KeyCode } from "../../util/KeyCode";
|
|
6
|
+
import CheckIcon from "../icons/check";
|
|
7
|
+
import SquareIcon from "../icons/square";
|
|
8
|
+
import { tooltipMouseLeave, tooltipMouseMove } from "../overlay/tooltip-ops";
|
|
9
|
+
import { Field, getFieldTooltip } from "./Field";
|
|
10
|
+
export class Checkbox extends Field {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super(config);
|
|
13
|
+
}
|
|
14
|
+
init() {
|
|
15
|
+
if (this.checked)
|
|
16
|
+
this.value = this.checked;
|
|
17
|
+
super.init();
|
|
18
|
+
}
|
|
19
|
+
declareData(...args) {
|
|
20
|
+
super.declareData({
|
|
21
|
+
value: !this.indeterminate ? false : undefined,
|
|
22
|
+
text: undefined,
|
|
23
|
+
readOnly: undefined,
|
|
24
|
+
disabled: undefined,
|
|
25
|
+
enabled: undefined,
|
|
26
|
+
required: undefined,
|
|
27
|
+
viewText: undefined,
|
|
28
|
+
}, ...args);
|
|
29
|
+
}
|
|
30
|
+
renderWrap(context, instance, key, content) {
|
|
31
|
+
let { data } = instance;
|
|
32
|
+
return (_jsxs("label", { className: data.classNames, onMouseDown: (e) => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
if (this.unfocusable)
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
}, onMouseMove: (e) => {
|
|
37
|
+
const tooltip = getFieldTooltip(instance);
|
|
38
|
+
if (Array.isArray(tooltip)) {
|
|
39
|
+
tooltipMouseMove(e, ...tooltip);
|
|
40
|
+
}
|
|
41
|
+
}, onMouseLeave: (e) => {
|
|
42
|
+
const tooltip = getFieldTooltip(instance);
|
|
43
|
+
if (Array.isArray(tooltip)) {
|
|
44
|
+
tooltipMouseLeave(e, ...tooltip);
|
|
45
|
+
}
|
|
46
|
+
}, onClick: (e) => {
|
|
47
|
+
this.handleClick(e, instance);
|
|
48
|
+
}, style: data.style, children: [content, this.labelPlacement && getContent(this.renderLabel(context, instance, "label"))] }, key));
|
|
49
|
+
}
|
|
50
|
+
validateRequired(context, instance) {
|
|
51
|
+
let { data } = instance;
|
|
52
|
+
if (!data.value)
|
|
53
|
+
return this.requiredText;
|
|
54
|
+
}
|
|
55
|
+
renderNativeCheck(context, instance) {
|
|
56
|
+
let { CSS, baseClass } = this;
|
|
57
|
+
let { data } = instance;
|
|
58
|
+
return (_jsx("input", { className: CSS.element(baseClass, "checkbox"), id: data.id, type: "checkbox", checked: data.value || false, disabled: data.disabled, ...data.inputAttrs, onClick: stopPropagation, onChange: (e) => {
|
|
59
|
+
this.handleChange(e, instance, e.target.checked);
|
|
60
|
+
} }, "input"));
|
|
61
|
+
}
|
|
62
|
+
renderCheck(context, instance) {
|
|
63
|
+
return _jsx(CheckboxCmp, { instance: instance, data: instance.data }, "check");
|
|
64
|
+
}
|
|
65
|
+
renderInput(context, instance, key) {
|
|
66
|
+
let { data } = instance;
|
|
67
|
+
let text = data.text || this.renderChildren?.(context, instance);
|
|
68
|
+
let { CSS, baseClass } = this;
|
|
69
|
+
return this.renderWrap(context, instance, key, [
|
|
70
|
+
this.native ? this.renderNativeCheck(context, instance) : this.renderCheck(context, instance),
|
|
71
|
+
text ? (_jsx("div", { className: CSS.element(baseClass, "text"), children: text }, "text")) : (_jsx("span", { className: CSS.element(baseClass, "baseline"), children: "\u00A0" }, "baseline")),
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
renderValue(context, instance) {
|
|
75
|
+
let { data } = instance;
|
|
76
|
+
if (!data.viewText)
|
|
77
|
+
return super.renderValue(context, instance, undefined);
|
|
78
|
+
return _jsx("span", { className: this.CSS.element(this.baseClass, "view-text"), children: data.viewText });
|
|
79
|
+
}
|
|
80
|
+
formatValue(context, instance) {
|
|
81
|
+
let { data } = instance;
|
|
82
|
+
return data.value && (data.text || this.renderChildren?.(context, instance));
|
|
83
|
+
}
|
|
84
|
+
handleClick(e, instance) {
|
|
85
|
+
if (this.native)
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
else {
|
|
88
|
+
var el = document.getElementById(instance.data.id);
|
|
89
|
+
if (el)
|
|
90
|
+
el.focus();
|
|
91
|
+
if (!instance.data.viewMode) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
this.handleChange(e, instance, !instance.data.value);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
handleChange(e, instance, checked) {
|
|
99
|
+
let { data } = instance;
|
|
100
|
+
if (data.readOnly || data.disabled || data.viewMode)
|
|
101
|
+
return;
|
|
102
|
+
instance.set("value", checked != null ? checked : e.target.checked);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
Checkbox.prototype.baseClass = "checkbox";
|
|
106
|
+
Checkbox.prototype.native = false;
|
|
107
|
+
Checkbox.prototype.indeterminate = false;
|
|
108
|
+
Checkbox.prototype.unfocusable = false;
|
|
109
|
+
Widget.alias("checkbox", Checkbox);
|
|
110
|
+
class CheckboxCmp extends VDOM.Component {
|
|
111
|
+
constructor(props) {
|
|
112
|
+
super(props);
|
|
113
|
+
this.state = {
|
|
114
|
+
value: props.data.value,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
118
|
+
this.setState({
|
|
119
|
+
value: props.data.value,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
let { instance, data } = this.props;
|
|
124
|
+
let { widget } = instance;
|
|
125
|
+
let { baseClass, CSS } = widget;
|
|
126
|
+
let check = false;
|
|
127
|
+
if (this.state.value == null && widget.indeterminate)
|
|
128
|
+
check = "indeterminate";
|
|
129
|
+
else if (this.state.value)
|
|
130
|
+
check = "check";
|
|
131
|
+
return (_jsxs("span", { tabIndex: widget.unfocusable || data.disabled ? undefined : data.tabIndex || 0, className: CSS.element(baseClass, "input", {
|
|
132
|
+
checked: check,
|
|
133
|
+
}), style: CSS.parseStyle(data.inputStyle), id: data.id, onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this), children: [check == "check" && _jsx(CheckIcon, { className: CSS.element(baseClass, "input-check") }), check == "indeterminate" && _jsx(SquareIcon, { className: CSS.element(baseClass, "input-check") })] }, "check"));
|
|
134
|
+
}
|
|
135
|
+
onClick(e) {
|
|
136
|
+
let { instance, data } = this.props;
|
|
137
|
+
let { widget } = instance;
|
|
138
|
+
if (!data.disabled && !data.readOnly) {
|
|
139
|
+
e.stopPropagation();
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
this.setState({ value: !this.state.value });
|
|
142
|
+
widget.handleChange(e, instance, !this.state.value);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
onKeyDown(e) {
|
|
146
|
+
let { instance } = this.props;
|
|
147
|
+
const { widget } = instance;
|
|
148
|
+
if (widget.handleKeyDown &&
|
|
149
|
+
widget.handleKeyDown(e, instance) === false)
|
|
150
|
+
return;
|
|
151
|
+
switch (e.keyCode) {
|
|
152
|
+
case KeyCode.space:
|
|
153
|
+
this.onClick(e);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|