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,57 @@
|
|
|
1
|
+
import { Widget } from "../ui/Widget";
|
|
2
|
+
export class DocumentTitle extends Widget {
|
|
3
|
+
constructor(config) {
|
|
4
|
+
super(config);
|
|
5
|
+
}
|
|
6
|
+
init() {
|
|
7
|
+
if (this.value)
|
|
8
|
+
this.text = this.value;
|
|
9
|
+
if (this.append)
|
|
10
|
+
this.action = "append";
|
|
11
|
+
super.init();
|
|
12
|
+
}
|
|
13
|
+
declareData(...args) {
|
|
14
|
+
super.declareData(...args, {
|
|
15
|
+
value: undefined,
|
|
16
|
+
text: undefined,
|
|
17
|
+
action: undefined,
|
|
18
|
+
separator: undefined,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
explore(context, instance) {
|
|
22
|
+
if (!context.documentTitle) {
|
|
23
|
+
context.documentTitle = {
|
|
24
|
+
activeInstance: instance,
|
|
25
|
+
title: "",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
let { data } = instance;
|
|
29
|
+
if (data.text) {
|
|
30
|
+
switch (data.action) {
|
|
31
|
+
case "append":
|
|
32
|
+
if (context.documentTitle.title)
|
|
33
|
+
context.documentTitle.title += data.separator;
|
|
34
|
+
context.documentTitle.title += data.text;
|
|
35
|
+
break;
|
|
36
|
+
case "prepend":
|
|
37
|
+
context.documentTitle.title = data.text + data.separator + context.documentTitle.title;
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
case "replace":
|
|
41
|
+
context.documentTitle.title = data.text;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
super.explore(context, instance);
|
|
46
|
+
}
|
|
47
|
+
prepare(context, instance) {
|
|
48
|
+
if (context.documentTitle.activeInstance == instance)
|
|
49
|
+
document.title = context.documentTitle.title;
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
DocumentTitle.prototype.action = "append";
|
|
56
|
+
DocumentTitle.prototype.separator = "";
|
|
57
|
+
Widget.alias("document-title", DocumentTitle);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ContainerBase, StyledContainerConfig } from "../ui/Container";
|
|
2
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
3
|
+
import { Instance } from "../ui/Instance";
|
|
4
|
+
export interface FlexBoxConfig extends StyledContainerConfig {
|
|
5
|
+
/** Base CSS class. Default is `flexbox`. */
|
|
6
|
+
baseClass?: string;
|
|
7
|
+
/** Flex direction. Default is `row`. */
|
|
8
|
+
direction?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Add spacing between items by applying a margin to children.
|
|
11
|
+
* Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
12
|
+
* Value `true` is equivalent to `medium`.
|
|
13
|
+
*/
|
|
14
|
+
spacing?: string | boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Add horizontal spacing between items by applying a margin to children.
|
|
17
|
+
* Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
18
|
+
* Value `true` is equivalent to `medium`.
|
|
19
|
+
*/
|
|
20
|
+
hspacing?: boolean | string;
|
|
21
|
+
/**
|
|
22
|
+
* Add vertical spacing between items by applying a margin to children.
|
|
23
|
+
* Allowed values are xsmall, small, medium, large and xlarge.
|
|
24
|
+
* Value true is equivalent to medium.
|
|
25
|
+
*/
|
|
26
|
+
vspacing?: boolean | string;
|
|
27
|
+
/**
|
|
28
|
+
* Add padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
29
|
+
* Value `true` is equivalent to `medium`.
|
|
30
|
+
*/
|
|
31
|
+
pad?: boolean | string;
|
|
32
|
+
padding?: boolean | string;
|
|
33
|
+
/**
|
|
34
|
+
* Add horizontal padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
35
|
+
* Value `true` is equivalent to `medium`.
|
|
36
|
+
*/
|
|
37
|
+
hpad?: boolean | string;
|
|
38
|
+
hpadding?: boolean | string;
|
|
39
|
+
/**
|
|
40
|
+
* Add vertical padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
41
|
+
* Value `true` is equivalent to `medium`.
|
|
42
|
+
*/
|
|
43
|
+
vpad?: boolean | string;
|
|
44
|
+
vpadding?: boolean | string;
|
|
45
|
+
wrap?: boolean;
|
|
46
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch" | false;
|
|
47
|
+
justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | false;
|
|
48
|
+
target?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Set to true to add overflow styles required for deeply nested flexbox calculations.
|
|
51
|
+
*/
|
|
52
|
+
nested?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare class FlexBox extends ContainerBase<FlexBoxConfig, Instance> {
|
|
55
|
+
padding?: boolean | string;
|
|
56
|
+
hpadding?: boolean | string;
|
|
57
|
+
vpadding?: boolean | string;
|
|
58
|
+
spacing?: string | boolean;
|
|
59
|
+
hspacing?: boolean | string;
|
|
60
|
+
vspacing?: boolean | string;
|
|
61
|
+
pad?: boolean | string;
|
|
62
|
+
hpad?: boolean | string;
|
|
63
|
+
vpad?: boolean | string;
|
|
64
|
+
wrap?: boolean;
|
|
65
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch" | false;
|
|
66
|
+
justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | false;
|
|
67
|
+
target?: string;
|
|
68
|
+
nested?: boolean;
|
|
69
|
+
direction?: string;
|
|
70
|
+
constructor(config?: FlexBoxConfig);
|
|
71
|
+
init(): void;
|
|
72
|
+
initInstance(context: RenderingContext, instance: Instance): void;
|
|
73
|
+
prepareCSS(context: RenderingContext, instance: Instance): void;
|
|
74
|
+
render(context: RenderingContext, instance: Instance, key: string): React.ReactNode;
|
|
75
|
+
}
|
|
76
|
+
export declare class FlexRow extends FlexBox {
|
|
77
|
+
}
|
|
78
|
+
export declare class FlexCol extends FlexBox {
|
|
79
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ContainerBase } from "../ui/Container";
|
|
3
|
+
import { isUndefined } from "../util/isUndefined";
|
|
4
|
+
export class FlexBox extends ContainerBase {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
super(config);
|
|
7
|
+
}
|
|
8
|
+
init() {
|
|
9
|
+
if (this.padding)
|
|
10
|
+
this.pad = this.padding;
|
|
11
|
+
if (this.hpadding)
|
|
12
|
+
this.hpad = this.hpadding;
|
|
13
|
+
if (this.vpadding)
|
|
14
|
+
this.vpad = this.vpadding;
|
|
15
|
+
this.hpad = isUndefined(this.hpad) ? this.pad : this.hpad;
|
|
16
|
+
this.vpad = isUndefined(this.vpad) ? this.pad : this.hpad;
|
|
17
|
+
if (this.hpad === true)
|
|
18
|
+
this.hpad = "medium";
|
|
19
|
+
if (this.vpad === true)
|
|
20
|
+
this.vpad = "medium";
|
|
21
|
+
this.hspacing = isUndefined(this.hspacing) ? this.spacing : this.hspacing;
|
|
22
|
+
this.vspacing = isUndefined(this.vspacing) ? this.spacing : this.vspacing;
|
|
23
|
+
if (this.hspacing === true)
|
|
24
|
+
this.hspacing = "medium";
|
|
25
|
+
if (this.vspacing === true)
|
|
26
|
+
this.vspacing = "medium";
|
|
27
|
+
super.init();
|
|
28
|
+
}
|
|
29
|
+
initInstance(context, instance) {
|
|
30
|
+
instance.eventHandlers = instance.getJsxEventProps();
|
|
31
|
+
super.initInstance(context, instance);
|
|
32
|
+
}
|
|
33
|
+
prepareCSS(context, instance) {
|
|
34
|
+
let { data } = instance;
|
|
35
|
+
data.stateMods = {
|
|
36
|
+
...data.stateMods,
|
|
37
|
+
[this.hpad + "-hpad"]: this.hpad,
|
|
38
|
+
[this.vpad + "-vpad"]: this.vpad,
|
|
39
|
+
nested: this.nested,
|
|
40
|
+
};
|
|
41
|
+
super.prepareCSS(context, instance);
|
|
42
|
+
}
|
|
43
|
+
render(context, instance, key) {
|
|
44
|
+
let { data } = instance;
|
|
45
|
+
let eventHandlers = instance.eventHandlers;
|
|
46
|
+
let { CSS, baseClass } = this;
|
|
47
|
+
let flexboxMods = {
|
|
48
|
+
[this.hspacing + "-hspacing"]: this.hspacing,
|
|
49
|
+
[this.vspacing + "-vspacing"]: this.vspacing,
|
|
50
|
+
["align-" + this.align]: this.align,
|
|
51
|
+
["justify-" + this.justify]: this.justify,
|
|
52
|
+
wrap: this.wrap,
|
|
53
|
+
["target-" + this.target]: true,
|
|
54
|
+
[this.direction]: true,
|
|
55
|
+
};
|
|
56
|
+
return (_jsx("div", { className: data.classNames, style: data.style, ...eventHandlers, children: _jsx("div", { className: CSS.element(baseClass, "flexbox", flexboxMods), children: this.renderChildren(context, instance) }) }, key));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
FlexBox.prototype.baseClass = "flexbox";
|
|
60
|
+
FlexBox.prototype.styled = true;
|
|
61
|
+
FlexBox.prototype.direction = 'row';
|
|
62
|
+
FlexBox.prototype.spacing = false;
|
|
63
|
+
FlexBox.prototype.hspacing = undefined;
|
|
64
|
+
FlexBox.prototype.vspacing = undefined;
|
|
65
|
+
FlexBox.prototype.pad = false;
|
|
66
|
+
FlexBox.prototype.hpad = undefined;
|
|
67
|
+
FlexBox.prototype.vpad = undefined;
|
|
68
|
+
FlexBox.prototype.wrap = false;
|
|
69
|
+
FlexBox.prototype.align = false;
|
|
70
|
+
FlexBox.prototype.justify = false;
|
|
71
|
+
FlexBox.prototype.target = 'any';
|
|
72
|
+
FlexBox.prototype.nested = false;
|
|
73
|
+
export class FlexRow extends FlexBox {
|
|
74
|
+
}
|
|
75
|
+
export class FlexCol extends FlexBox {
|
|
76
|
+
}
|
|
77
|
+
FlexCol.prototype.direction = 'column';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HtmlElement, HtmlElementConfig, HtmlElementInstance } from "./HtmlElement";
|
|
2
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
3
|
+
export interface HeadingConfig extends HtmlElementConfig {
|
|
4
|
+
/** Name of the HTML element to be rendered. Default is `div`. */
|
|
5
|
+
tag?: string;
|
|
6
|
+
/** Heading level. Allowed values go from 1 to 6. Default is 3. */
|
|
7
|
+
level?: number | string;
|
|
8
|
+
/** Base CSS class. Default is `heading`. */
|
|
9
|
+
baseClass?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class Heading extends HtmlElement<HeadingConfig, HtmlElementInstance> {
|
|
12
|
+
level?: number | string;
|
|
13
|
+
init(): void;
|
|
14
|
+
prepareData(context: RenderingContext, instance: HtmlElementInstance): void;
|
|
15
|
+
isValidHtmlAttribute(attrName: string): string | false;
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HtmlElement } from "./HtmlElement";
|
|
2
|
+
export class Heading extends HtmlElement {
|
|
3
|
+
init() {
|
|
4
|
+
this.tag = `h${this.level}`;
|
|
5
|
+
super.init();
|
|
6
|
+
}
|
|
7
|
+
prepareData(context, instance) {
|
|
8
|
+
let { data } = instance;
|
|
9
|
+
data.stateMods = {
|
|
10
|
+
...data.stateMods,
|
|
11
|
+
[`level-${this.level}`]: true,
|
|
12
|
+
};
|
|
13
|
+
super.prepareData(context, instance);
|
|
14
|
+
}
|
|
15
|
+
isValidHtmlAttribute(attrName) {
|
|
16
|
+
switch (attrName) {
|
|
17
|
+
case "level":
|
|
18
|
+
return false;
|
|
19
|
+
default: return super.isValidHtmlAttribute(attrName);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
Heading.prototype.level = 3;
|
|
24
|
+
Heading.prototype.baseClass = "heading";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { Instance } from "../ui/Instance";
|
|
3
|
+
import type { RenderingContext } from "../ui/RenderingContext";
|
|
4
|
+
import { Widget, WidgetConfig } from "../ui/Widget";
|
|
5
|
+
import { StringProp, Prop } from "../ui/Prop";
|
|
6
|
+
export interface HighlightedSearchTextConfig extends WidgetConfig {
|
|
7
|
+
/** Search query used to highlight matching text. */
|
|
8
|
+
query?: StringProp;
|
|
9
|
+
/** Text content to be searched and highlighted. */
|
|
10
|
+
text?: StringProp;
|
|
11
|
+
/** Pre-computed text chunks where odd-indexed chunks are highlighted. */
|
|
12
|
+
chunks?: Prop<string[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare class HighlightedSearchText extends Widget<HighlightedSearchTextConfig> {
|
|
15
|
+
constructor(config?: HighlightedSearchTextConfig);
|
|
16
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
17
|
+
render(context: RenderingContext, instance: Instance, key: string): React.ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Widget } from "../ui/Widget";
|
|
3
|
+
import { getSearchQueryHighlighter } from "../util/getSearchQueryPredicate";
|
|
4
|
+
export class HighlightedSearchText extends Widget {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
super(config);
|
|
7
|
+
}
|
|
8
|
+
declareData(...args) {
|
|
9
|
+
super.declareData(...args, {
|
|
10
|
+
text: undefined,
|
|
11
|
+
chunks: undefined,
|
|
12
|
+
query: undefined,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
render(context, instance, key) {
|
|
16
|
+
let { data } = instance;
|
|
17
|
+
let { text, chunks, query, classNames, style } = data;
|
|
18
|
+
if (!chunks && text && query) {
|
|
19
|
+
let highlighter = getSearchQueryHighlighter(query, { cache: true });
|
|
20
|
+
chunks = highlighter(text);
|
|
21
|
+
}
|
|
22
|
+
if (!chunks)
|
|
23
|
+
return text;
|
|
24
|
+
return chunks.map((text, i) => {
|
|
25
|
+
if (i % 2 == 0)
|
|
26
|
+
return text;
|
|
27
|
+
return (_jsx("span", { className: classNames, style: style, children: text }, `${key}-${i}`));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
HighlightedSearchText.prototype.styled = true;
|
|
32
|
+
HighlightedSearchText.prototype.baseClass = "highlightedsearchtext";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { ContainerBase, StyledContainerConfig } from "../ui/Container";
|
|
3
|
+
import { TooltipParentInstance } from "./overlay/tooltip-ops";
|
|
4
|
+
import type { TooltipInstance } from "./overlay/Tooltip";
|
|
5
|
+
import type { RenderingContext } from "../ui/RenderingContext";
|
|
6
|
+
import type { RenderProps } from "../ui/Instance";
|
|
7
|
+
import { Instance } from "../ui/Instance";
|
|
8
|
+
import type { TooltipConfig, TooltipProp } from "./overlay/tooltip-ops";
|
|
9
|
+
import { StringProp, NumberProp } from "../ui/Prop";
|
|
10
|
+
export declare let urlAttributes: Record<string, boolean>;
|
|
11
|
+
export interface HtmlElementConfig extends StyledContainerConfig {
|
|
12
|
+
id?: StringProp | NumberProp;
|
|
13
|
+
/** Inner text contents. */
|
|
14
|
+
text?: StringProp | NumberProp;
|
|
15
|
+
/** Tooltip configuration. */
|
|
16
|
+
tooltip?: StringProp | TooltipConfig;
|
|
17
|
+
}
|
|
18
|
+
export declare class HtmlElementInstance<E extends HtmlElement<any, any> = HtmlElement<any, any>> extends Instance<E> implements TooltipParentInstance {
|
|
19
|
+
events?: Record<string, (e: React.SyntheticEvent, instance: Instance) => any>;
|
|
20
|
+
tooltips: {
|
|
21
|
+
[key: string]: TooltipInstance;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare class HtmlElement<Config extends HtmlElementConfig = HtmlElementConfig, InstanceType extends HtmlElementInstance<any> = HtmlElementInstance<any>> extends ContainerBase<Config, InstanceType> {
|
|
25
|
+
tag?: string;
|
|
26
|
+
html?: string;
|
|
27
|
+
innerText?: string;
|
|
28
|
+
text?: string;
|
|
29
|
+
innerHtml?: string;
|
|
30
|
+
attrs?: Record<string, unknown>;
|
|
31
|
+
data?: Record<string, unknown>;
|
|
32
|
+
events?: Record<string, (e: Event, instance: Instance) => unknown>;
|
|
33
|
+
urlAttributes?: string[];
|
|
34
|
+
extraProps?: Record<string, unknown>;
|
|
35
|
+
tooltip?: TooltipProp;
|
|
36
|
+
onRef?: (element: HTMLElement | null, instance: Instance) => void;
|
|
37
|
+
autoFocus?: boolean | string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
constructor(config?: Config);
|
|
40
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
41
|
+
isValidHtmlAttribute(attrName: string): string | false;
|
|
42
|
+
init(): void;
|
|
43
|
+
prepareData(context: RenderingContext, instance: InstanceType): void;
|
|
44
|
+
attachProps(context: RenderingContext, instance: InstanceType, props: RenderProps): void;
|
|
45
|
+
render(context: RenderingContext, instance: InstanceType, key: string): React.ReactNode;
|
|
46
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { Widget, VDOM } from "../ui/Widget";
|
|
4
|
+
import { ContainerBase } from "../ui/Container";
|
|
5
|
+
import { tooltipMouseMove, tooltipParentWillUnmount, tooltipMouseLeave, tooltipParentWillReceiveProps, tooltipParentDidMount, tooltipParentDidUpdate, } from "./overlay/tooltip-ops";
|
|
6
|
+
import { Url } from "../ui/app/Url";
|
|
7
|
+
import { debug } from "../util/Debug";
|
|
8
|
+
import { isString } from "../util/isString";
|
|
9
|
+
import { isUndefined } from "../util/isUndefined";
|
|
10
|
+
import { isDefined } from "../util/isDefined";
|
|
11
|
+
import { isArray } from "../util/isArray";
|
|
12
|
+
import { autoFocus } from "./autoFocus";
|
|
13
|
+
import { Instance } from "../ui/Instance";
|
|
14
|
+
const isDataAttribute = (attr) => (attr.indexOf("data-") === 0 ? attr.substring(5) : false);
|
|
15
|
+
export let urlAttributes = {
|
|
16
|
+
"a.href": true,
|
|
17
|
+
"img.src": true,
|
|
18
|
+
"iframe.src": true,
|
|
19
|
+
};
|
|
20
|
+
export class HtmlElementInstance extends Instance {
|
|
21
|
+
events;
|
|
22
|
+
}
|
|
23
|
+
export class HtmlElement extends ContainerBase {
|
|
24
|
+
constructor(config) {
|
|
25
|
+
super(config);
|
|
26
|
+
if (isUndefined(this.jsxAttributes) && config)
|
|
27
|
+
this.jsxAttributes = Object.keys(config).filter(this.isValidHtmlAttribute.bind(this));
|
|
28
|
+
}
|
|
29
|
+
declareData(...args) {
|
|
30
|
+
const data = {
|
|
31
|
+
text: undefined,
|
|
32
|
+
innerHtml: undefined,
|
|
33
|
+
attrs: {
|
|
34
|
+
structured: true,
|
|
35
|
+
},
|
|
36
|
+
data: {
|
|
37
|
+
structured: true,
|
|
38
|
+
},
|
|
39
|
+
autoFocus: undefined,
|
|
40
|
+
};
|
|
41
|
+
let name;
|
|
42
|
+
this.urlAttributes = [];
|
|
43
|
+
if (this.jsxAttributes) {
|
|
44
|
+
this.jsxAttributes.forEach((attr) => {
|
|
45
|
+
if (urlAttributes[`${this.tag}.${attr}`])
|
|
46
|
+
this.urlAttributes.push(attr);
|
|
47
|
+
if ((name = isDataAttribute(attr))) {
|
|
48
|
+
if (!this.data)
|
|
49
|
+
this.data = {};
|
|
50
|
+
this.data[name] = this[attr];
|
|
51
|
+
}
|
|
52
|
+
else if ((name = this.isValidHtmlAttribute(attr)) && !data.hasOwnProperty(name)) {
|
|
53
|
+
if (name.indexOf("on") === 0) {
|
|
54
|
+
if (this[attr]) {
|
|
55
|
+
if (!this.events)
|
|
56
|
+
this.events = {};
|
|
57
|
+
this.events[name] = this[attr];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (!this.attrs)
|
|
62
|
+
this.attrs = {};
|
|
63
|
+
this.attrs[name] = this[attr];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (this.urlAttributes.length === 0)
|
|
69
|
+
delete this.urlAttributes;
|
|
70
|
+
// Combine args array with data object for super call
|
|
71
|
+
super.declareData(...args, data);
|
|
72
|
+
}
|
|
73
|
+
isValidHtmlAttribute(attrName) {
|
|
74
|
+
switch (attrName) {
|
|
75
|
+
case "tag":
|
|
76
|
+
case "type":
|
|
77
|
+
case "$type":
|
|
78
|
+
case "$props":
|
|
79
|
+
case "text":
|
|
80
|
+
case "layout":
|
|
81
|
+
case "class":
|
|
82
|
+
case "className":
|
|
83
|
+
case "style":
|
|
84
|
+
case "controller":
|
|
85
|
+
case "outerLayout":
|
|
86
|
+
case "items":
|
|
87
|
+
case "children":
|
|
88
|
+
case "visible":
|
|
89
|
+
case "if":
|
|
90
|
+
case "mod":
|
|
91
|
+
case "putInto":
|
|
92
|
+
case "contentFor":
|
|
93
|
+
case "trimWhitespace":
|
|
94
|
+
case "preserveWhitespace":
|
|
95
|
+
case "ws":
|
|
96
|
+
case "plainText":
|
|
97
|
+
case "vertical":
|
|
98
|
+
case "memoize":
|
|
99
|
+
case "onInit":
|
|
100
|
+
case "onExplore":
|
|
101
|
+
case "onDestroy":
|
|
102
|
+
case "onRef":
|
|
103
|
+
case "html":
|
|
104
|
+
case "innerText":
|
|
105
|
+
case "baseClass":
|
|
106
|
+
case "CSS":
|
|
107
|
+
case "tooltip":
|
|
108
|
+
case "styles":
|
|
109
|
+
case "jsxAttributes":
|
|
110
|
+
case "jsxSpread":
|
|
111
|
+
case "instance":
|
|
112
|
+
case "store":
|
|
113
|
+
case "autoFocus":
|
|
114
|
+
case "vdomKey":
|
|
115
|
+
return false;
|
|
116
|
+
default:
|
|
117
|
+
if (isDataAttribute(attrName))
|
|
118
|
+
return false;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
return attrName;
|
|
122
|
+
}
|
|
123
|
+
init() {
|
|
124
|
+
if (this.html)
|
|
125
|
+
this.innerHtml = this.html;
|
|
126
|
+
if (this.innerText)
|
|
127
|
+
this.text = this.innerText;
|
|
128
|
+
super.init();
|
|
129
|
+
}
|
|
130
|
+
prepareData(context, instance) {
|
|
131
|
+
const { data } = instance;
|
|
132
|
+
if (this.urlAttributes && data.attrs) {
|
|
133
|
+
data.attrs = { ...data.attrs };
|
|
134
|
+
this.urlAttributes.forEach((attr) => {
|
|
135
|
+
const attrValue = data.attrs[attr];
|
|
136
|
+
if (isString(attrValue)) {
|
|
137
|
+
data.attrs[attr] = Url.resolve(attrValue);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
super.prepareData(context, instance);
|
|
142
|
+
}
|
|
143
|
+
attachProps(context, instance, props) {
|
|
144
|
+
Object.assign(props, this.extraProps);
|
|
145
|
+
if (!isString(this.tag))
|
|
146
|
+
props.instance = instance;
|
|
147
|
+
}
|
|
148
|
+
render(context, instance, key) {
|
|
149
|
+
//rebind events to pass instance
|
|
150
|
+
if (this.events && !instance.events) {
|
|
151
|
+
instance.events = {};
|
|
152
|
+
for (const eventName in this.events) {
|
|
153
|
+
const handler = this.events[eventName];
|
|
154
|
+
instance.events[eventName] = (e) => instance.invoke(eventName, e, instance);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const { data, events } = instance;
|
|
158
|
+
const props = Object.assign({
|
|
159
|
+
key: key,
|
|
160
|
+
}, data.attrs, events);
|
|
161
|
+
if (data.classNames)
|
|
162
|
+
props.className = data.classNames;
|
|
163
|
+
if (data.style)
|
|
164
|
+
props.style = data.style;
|
|
165
|
+
let children;
|
|
166
|
+
if (isDefined(data.text))
|
|
167
|
+
children = data.text;
|
|
168
|
+
else if (isString(data.innerHtml)) {
|
|
169
|
+
props.dangerouslySetInnerHTML = { __html: data.innerHtml };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
children = this.renderChildren(context, instance);
|
|
173
|
+
if (children && isArray(children) && children.length === 0)
|
|
174
|
+
children = undefined;
|
|
175
|
+
}
|
|
176
|
+
props.children = children;
|
|
177
|
+
this.attachProps(context, instance, props);
|
|
178
|
+
if (this.tooltip || this.onRef || this.autoFocus)
|
|
179
|
+
return (_jsx(ContainerComponent, { tag: this.tag, props: props, instance: instance, data: data, children: props.children }, key));
|
|
180
|
+
return VDOM.createElement(this.tag, props, props.children);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
HtmlElement.prototype.tag = "div";
|
|
184
|
+
HtmlElement.prototype.styled = true;
|
|
185
|
+
class ContainerComponent extends VDOM.Component {
|
|
186
|
+
el = null;
|
|
187
|
+
constructor(props) {
|
|
188
|
+
super(props);
|
|
189
|
+
this.ref = (c) => {
|
|
190
|
+
this.el = c;
|
|
191
|
+
const { instance } = this.props;
|
|
192
|
+
const widget = instance.widget;
|
|
193
|
+
if (widget.onRef) {
|
|
194
|
+
instance.invoke("onRef", c, instance);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
render() {
|
|
199
|
+
const { tag, props, children, instance } = this.props;
|
|
200
|
+
const widget = instance.widget;
|
|
201
|
+
props.ref = this.ref;
|
|
202
|
+
if (widget.tooltip) {
|
|
203
|
+
const { onMouseLeave, onMouseMove } = props;
|
|
204
|
+
props.onMouseLeave = (e) => {
|
|
205
|
+
tooltipMouseLeave(e, instance, widget.tooltip);
|
|
206
|
+
if (onMouseLeave)
|
|
207
|
+
onMouseLeave(e);
|
|
208
|
+
};
|
|
209
|
+
props.onMouseMove = (e) => {
|
|
210
|
+
tooltipMouseMove(e, instance, widget.tooltip);
|
|
211
|
+
if (onMouseMove)
|
|
212
|
+
onMouseMove(e);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
return VDOM.createElement(tag, props, children);
|
|
216
|
+
}
|
|
217
|
+
componentWillUnmount() {
|
|
218
|
+
tooltipParentWillUnmount(this.props.instance);
|
|
219
|
+
}
|
|
220
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
221
|
+
const widget = this.props.instance.widget;
|
|
222
|
+
if (this.el && widget.tooltip) {
|
|
223
|
+
tooltipParentWillReceiveProps(this.el, props.instance, widget.tooltip);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
componentDidMount() {
|
|
227
|
+
const widget = this.props.instance.widget;
|
|
228
|
+
if (this.el && widget.tooltip) {
|
|
229
|
+
tooltipParentDidMount(this.el, this.props.instance, widget.tooltip);
|
|
230
|
+
}
|
|
231
|
+
autoFocus(this.el, this);
|
|
232
|
+
}
|
|
233
|
+
componentDidUpdate() {
|
|
234
|
+
const widget = this.props.instance.widget;
|
|
235
|
+
if (this.el && widget.tooltip) {
|
|
236
|
+
tooltipParentDidUpdate(this.el, this.props.instance, widget.tooltip);
|
|
237
|
+
}
|
|
238
|
+
autoFocus(this.el, this);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const originalWidgetFactory = Widget.factory;
|
|
242
|
+
//support for React components
|
|
243
|
+
Widget.factory = function (type, config, more) {
|
|
244
|
+
const typeType = typeof type;
|
|
245
|
+
if (typeType === "undefined") {
|
|
246
|
+
debug("Creating a widget of unknown type.", config, more);
|
|
247
|
+
return new HtmlElement(Object.assign({}, config, more));
|
|
248
|
+
}
|
|
249
|
+
if (typeType === "function")
|
|
250
|
+
return HtmlElement.create(HtmlElement, { tag: type }, config);
|
|
251
|
+
return originalWidgetFactory.call(Widget, type, config, more);
|
|
252
|
+
};
|
|
253
|
+
Widget.alias("html-element", HtmlElement);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "cx/jsx-runtime";
|
|
2
|
+
import { Store } from "../data/Store";
|
|
3
|
+
import assert from "assert";
|
|
4
|
+
import { createTestRenderer } from "../util/test/createTestRenderer";
|
|
5
|
+
import { bind } from "../ui/bind";
|
|
6
|
+
describe("HtmlElement", () => {
|
|
7
|
+
it("renders textual content provided through the text property", () => {
|
|
8
|
+
let widget = (_jsx("cx", { children: _jsx("div", { text: bind("text") }) }));
|
|
9
|
+
let store = new Store({
|
|
10
|
+
data: {
|
|
11
|
+
text: "Test",
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const component = createTestRenderer(store, widget);
|
|
15
|
+
let tree = component.toJSON();
|
|
16
|
+
assert(tree && !Array.isArray(tree), "Expected single element");
|
|
17
|
+
assert.equal(tree.type, "div");
|
|
18
|
+
assert.deepEqual(tree.children, ["Test"]);
|
|
19
|
+
});
|
|
20
|
+
it("allows spread bindings", () => {
|
|
21
|
+
let store = new Store({
|
|
22
|
+
data: {
|
|
23
|
+
title: "title",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const component = createTestRenderer(store, (_jsx("cx", { children: _jsx("a", { href: "#", title: { bind: "title" }, children: "Link" }) })));
|
|
27
|
+
let tree = component.toJSON();
|
|
28
|
+
assert(tree && !Array.isArray(tree), "Expected single element");
|
|
29
|
+
assert.deepEqual(tree, {
|
|
30
|
+
type: "a",
|
|
31
|
+
children: ["Link"],
|
|
32
|
+
props: {
|
|
33
|
+
href: "#",
|
|
34
|
+
title: "title",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Widget, WidgetConfig } from "../ui/Widget";
|
|
2
|
+
import "./icons/index";
|
|
3
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
4
|
+
import { Instance } from "../ui/Instance";
|
|
5
|
+
import { StringProp, ClassProp, StyleProp } from "../ui/Prop";
|
|
6
|
+
export interface IconConfig extends WidgetConfig {
|
|
7
|
+
/** Name under which the icon is registered. */
|
|
8
|
+
name?: StringProp;
|
|
9
|
+
/** Additional CSS classes to be applied to the field.
|
|
10
|
+
* If an object is provided, all keys with a "truthy" value will be added to the CSS class list. */
|
|
11
|
+
className?: ClassProp;
|
|
12
|
+
/** Additional CSS classes to be applied to the field.
|
|
13
|
+
* If an object is provided, all keys with a "truthy" value will be added to the CSS class list. */
|
|
14
|
+
class?: ClassProp;
|
|
15
|
+
/** Style object applied to the wrapper div. Used for setting the dimensions of the field. */
|
|
16
|
+
style?: StyleProp;
|
|
17
|
+
/** Base CSS class to be applied to the element. Default is `icon`. */
|
|
18
|
+
baseClass?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class Icon extends Widget<IconConfig> {
|
|
21
|
+
declareData(...args: Record<string, unknown>[]): void;
|
|
22
|
+
render(context: RenderingContext, instance: Instance, key: string): React.ReactNode;
|
|
23
|
+
static register(name: string, icon: any, defaultIcon?: boolean): (props: Record<string, any>) => React.ReactNode;
|
|
24
|
+
static unregister(...args: string[]): void;
|
|
25
|
+
static render(name: string, props: Record<string, any>): React.ReactNode;
|
|
26
|
+
static clear(): void;
|
|
27
|
+
static registerFactory(factory: (name: string, props: Record<string, any>) => any): void;
|
|
28
|
+
static restoreDefaultIcons(): void;
|
|
29
|
+
}
|