cx 25.10.1 → 26.0.1
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/.mocharc.json +5 -0
- package/LICENSE-THIRD-PARTY.md +91 -91
- package/LICENSE.md +7 -7
- package/README.md +46 -46
- package/build.js +129 -0
- package/dist/charts.css +250 -250
- package/dist/charts.js +2421 -3102
- package/dist/data.js +857 -1063
- package/dist/hooks.js +48 -59
- package/dist/jsx-runtime.js +24 -0
- package/dist/manifest.js +959 -953
- package/dist/svg.js +266 -432
- package/dist/ui.js +1935 -2388
- package/dist/util.js +587 -557
- package/dist/widgets.css +6 -6
- package/dist/widgets.js +7543 -9909
- package/package.json +39 -5
- package/src/charts/Bar.scss +5 -3
- package/src/charts/Bar.ts +114 -0
- package/src/charts/BarGraph.scss +4 -3
- package/src/charts/BarGraph.tsx +145 -0
- package/src/charts/BubbleGraph.scss +5 -3
- package/src/charts/BubbleGraph.tsx +165 -0
- package/src/charts/Chart.ts +108 -0
- package/src/charts/ColorMap.ts +150 -0
- package/src/charts/Column.scss +5 -3
- package/src/charts/Column.ts +124 -0
- package/src/charts/ColumnBarBase.tsx +284 -0
- package/src/charts/ColumnBarGraphBase.tsx +229 -0
- package/src/charts/ColumnGraph.scss +5 -3
- package/src/charts/ColumnGraph.tsx +153 -0
- package/src/charts/Grid.ts +5 -0
- package/src/charts/Gridlines.scss +5 -3
- package/src/charts/Gridlines.tsx +88 -0
- package/src/charts/Legend.scss +5 -3
- package/src/charts/Legend.tsx +270 -0
- package/src/charts/LegendEntry.scss +5 -3
- package/src/charts/LegendEntry.tsx +197 -0
- package/src/charts/LineGraph.scss +4 -3
- package/src/charts/LineGraph.tsx +441 -0
- package/src/charts/Marker.scss +5 -3
- package/src/charts/Marker.tsx +483 -0
- package/src/charts/MarkerLine.scss +5 -3
- package/src/charts/MarkerLine.tsx +214 -0
- package/src/charts/MouseTracker.tsx +112 -0
- package/src/charts/Pie.ts +8 -0
- package/src/charts/PieChart.scss +5 -3
- package/src/charts/PieChart.tsx +717 -0
- package/src/charts/PieLabel.tsx +106 -0
- package/src/charts/PieLabelsContainer.ts +68 -0
- package/src/charts/Range.scss +4 -3
- package/src/charts/Range.tsx +318 -0
- package/src/charts/RangeMarker.scss +5 -3
- package/src/charts/RangeMarker.tsx +233 -0
- package/src/charts/ScatterGraph.scss +5 -3
- package/src/charts/ScatterGraph.tsx +245 -0
- package/src/charts/Swimlane.scss +5 -3
- package/src/charts/Swimlane.tsx +195 -0
- package/src/charts/Swimlanes.scss +5 -3
- package/src/charts/Swimlanes.tsx +179 -0
- package/src/charts/axis/Axis.scss +22 -22
- package/src/charts/axis/Axis.tsx +444 -0
- package/src/charts/axis/CategoryAxis.scss +5 -3
- package/src/charts/axis/CategoryAxis.tsx +313 -0
- package/src/charts/axis/NumericAxis.scss +5 -3
- package/src/charts/axis/NumericAxis.tsx +437 -0
- package/src/charts/axis/Stack.ts +61 -0
- package/src/charts/axis/TimeAxis.scss +4 -3
- package/src/charts/axis/TimeAxis.tsx +718 -0
- package/src/charts/axis/index.scss +5 -5
- package/src/charts/axis/index.ts +4 -0
- package/src/charts/axis/variables.scss +2 -2
- package/src/charts/helpers/MinMaxFinder.ts +66 -0
- package/src/charts/helpers/PointReducer.ts +135 -0
- package/src/charts/helpers/SnapPointFinder.ts +136 -0
- package/src/charts/helpers/ValueAtFinder.ts +72 -0
- package/src/charts/helpers/index.ts +4 -0
- package/src/charts/index.scss +22 -22
- package/src/charts/palette.scss +7 -5
- package/src/charts/shapes.tsx +86 -0
- package/src/charts/variables.scss +2 -1
- package/src/core.d.ts +182 -310
- package/src/data/AggregateFunction.ts +171 -0
- package/src/data/ArrayElementView.spec.ts +88 -0
- package/src/data/ArrayElementView.ts +90 -0
- package/src/data/ArrayRef.ts +35 -0
- package/src/data/AugmentedViewBase.ts +88 -0
- package/src/data/Binding.ts +104 -0
- package/src/data/ExposedRecordView.ts +95 -0
- package/src/data/ExposedValueView.ts +89 -0
- package/src/data/Expression.spec.ts +229 -0
- package/src/data/Expression.ts +233 -0
- package/src/data/Grouper.spec.ts +57 -0
- package/src/data/Grouper.ts +158 -0
- package/src/data/NestedDataView.ts +43 -0
- package/src/data/ReadOnlyDataView.ts +39 -0
- package/src/data/Ref.spec.ts +79 -0
- package/src/data/Ref.ts +104 -0
- package/src/data/Selector.ts +10 -0
- package/src/data/Store.spec.ts +22 -0
- package/src/data/Store.ts +52 -0
- package/src/data/StoreProxy.ts +19 -0
- package/src/data/StoreRef.spec.ts +24 -0
- package/src/data/StoreRef.ts +66 -0
- package/src/data/StringTemplate.spec.ts +132 -0
- package/src/data/StringTemplate.ts +93 -0
- package/src/data/StructuredSelector.spec.ts +113 -0
- package/src/data/StructuredSelector.ts +146 -0
- package/src/data/SubscribableView.ts +63 -0
- package/src/data/View.ts +289 -0
- package/src/data/ZoomIntoPropertyView.spec.ts +64 -0
- package/src/data/ZoomIntoPropertyView.ts +45 -0
- package/src/data/comparer.ts +78 -0
- package/src/data/computable.spec.ts +62 -0
- package/src/data/computable.ts +72 -0
- package/src/data/createAccessorModelProxy.ts +60 -0
- package/src/data/createStructuredSelector.spec.ts +45 -0
- package/src/data/createStructuredSelector.ts +62 -0
- package/src/data/defaultCompare.ts +15 -0
- package/src/data/diff/diffArrays.ts +49 -0
- package/src/data/diff/diffs.spec.ts +49 -0
- package/src/data/diff/index.ts +1 -0
- package/src/data/enableFatArrowExpansion.ts +6 -0
- package/src/data/getAccessor.spec.ts +11 -0
- package/src/data/getAccessor.ts +74 -0
- package/src/data/getSelector.spec.ts +43 -0
- package/src/data/getSelector.ts +66 -0
- package/src/data/index.ts +30 -0
- package/src/data/isSelector.ts +26 -0
- package/src/data/ops/append.spec.ts +28 -0
- package/src/data/ops/append.ts +5 -0
- package/src/data/ops/filter.spec.ts +35 -0
- package/src/data/ops/filter.ts +9 -0
- package/src/data/ops/findTreeNode.spec.ts +23 -0
- package/src/data/ops/findTreeNode.ts +18 -0
- package/src/data/ops/findTreePath.ts +23 -0
- package/src/data/ops/insertElement.ts +3 -0
- package/src/data/ops/merge.spec.ts +27 -0
- package/src/data/ops/merge.ts +13 -0
- package/src/data/ops/moveElement.ts +21 -0
- package/src/data/ops/removeTreeNodes.spec.ts +37 -0
- package/src/data/ops/removeTreeNodes.ts +15 -0
- package/src/data/ops/updateArray.spec.ts +69 -0
- package/src/data/ops/updateArray.ts +31 -0
- package/src/data/ops/updateTree.spec.ts +54 -0
- package/src/data/ops/updateTree.ts +23 -0
- package/src/data/test-types.ts +7 -0
- package/src/global.scss +13 -13
- package/src/hooks/createLocalStorageRef.ts +21 -0
- package/src/hooks/invokeCallback.spec.tsx +59 -0
- package/src/hooks/invokeCallback.ts +8 -0
- package/src/hooks/resolveCallback.spec.tsx +48 -0
- package/src/hooks/resolveCallback.ts +16 -0
- package/src/hooks/store.spec.tsx +67 -0
- package/src/hooks/store.ts +46 -0
- package/src/hooks/useEffect.ts +14 -0
- package/src/hooks/useInterval.ts +8 -0
- package/src/hooks/useState.ts +20 -0
- package/src/hooks/useTrigger.spec.tsx +99 -0
- package/src/hooks/useTrigger.ts +26 -0
- package/src/jsx-runtime.ts +72 -0
- package/src/locale/de-de.ts +76 -0
- package/src/locale/en-us.ts +75 -0
- package/src/locale/es-es.ts +76 -0
- package/src/locale/fr-fr.ts +76 -0
- package/src/locale/nl-nl.ts +76 -0
- package/src/locale/pt-pt.ts +76 -0
- package/src/locale/sr-latn-ba.ts +76 -0
- package/src/svg/BoundedObject.ts +101 -0
- package/src/svg/ClipRect.tsx +29 -0
- package/src/svg/Ellipse.tsx +69 -0
- package/src/svg/Line.tsx +58 -0
- package/src/svg/NonOverlappingRect.ts +26 -0
- package/src/svg/NonOverlappingRectGroup.ts +49 -0
- package/src/svg/Rectangle.tsx +91 -0
- package/src/svg/Svg.scss +5 -4
- package/src/svg/Svg.tsx +241 -0
- package/src/svg/Text.tsx +134 -0
- package/src/svg/TextualBoundedObject.ts +35 -0
- package/src/svg/index.scss +8 -8
- package/src/svg/util/Rect.ts +105 -0
- package/src/ui/CSS.ts +87 -0
- package/src/ui/CSSHelper.ts +17 -0
- package/src/ui/Container.tsx +216 -0
- package/src/ui/ContentResolver.spec.tsx +430 -0
- package/src/ui/ContentResolver.ts +124 -0
- package/src/ui/Controller.spec.tsx +566 -0
- package/src/ui/Controller.ts +189 -0
- package/src/ui/Culture.ts +159 -0
- package/src/ui/Cx.spec.tsx +208 -0
- package/src/ui/Cx.tsx +386 -0
- package/src/ui/DataProxy.spec.tsx +337 -0
- package/src/ui/DataProxy.ts +55 -0
- package/src/ui/DetachedScope.tsx +159 -0
- package/src/ui/FocusManager.ts +171 -0
- package/src/ui/Format.ts +108 -0
- package/src/ui/HoverSync.tsx +189 -0
- package/src/ui/Instance.ts +868 -0
- package/src/ui/IsolatedScope.spec.tsx +55 -0
- package/src/ui/IsolatedScope.ts +50 -0
- package/src/ui/Localization.ts +70 -0
- package/src/ui/Prop.ts +112 -0
- package/src/ui/PureContainer.spec.tsx +230 -0
- package/src/ui/PureContainer.tsx +19 -0
- package/src/ui/RenderingContext.ts +99 -0
- package/src/ui/Repeater.spec.tsx +141 -0
- package/src/ui/Repeater.ts +203 -0
- package/src/ui/Rescope.spec.tsx +199 -0
- package/src/ui/Rescope.ts +49 -0
- package/src/ui/ResizeManager.ts +31 -0
- package/src/ui/Restate.spec.tsx +418 -0
- package/src/ui/Restate.tsx +217 -0
- package/src/ui/StaticText.ts +11 -0
- package/src/ui/StructuredInstanceDataAccessor.ts +32 -0
- package/src/ui/Text.ts +30 -0
- package/src/ui/VDOM.ts +34 -0
- package/src/ui/Widget.spec.tsx +53 -0
- package/src/ui/Widget.tsx +308 -0
- package/src/ui/ZIndexManager.ts +11 -0
- package/src/ui/adapter/ArrayAdapter.spec.ts +55 -0
- package/src/ui/adapter/ArrayAdapter.ts +226 -0
- package/src/ui/adapter/DataAdapter.ts +52 -0
- package/src/ui/adapter/GroupAdapter.ts +235 -0
- package/src/ui/adapter/TreeAdapter.spec.ts +76 -0
- package/src/ui/adapter/TreeAdapter.ts +185 -0
- package/src/ui/app/History.ts +133 -0
- package/src/ui/app/Url.spec.ts +50 -0
- package/src/ui/app/Url.ts +102 -0
- package/src/ui/app/startAppLoop.tsx +74 -0
- package/src/ui/app/startHotAppLoop.ts +40 -0
- package/src/ui/batchUpdates.ts +77 -0
- package/src/ui/bind.ts +10 -0
- package/src/ui/createFunctionalComponent.spec.tsx +399 -0
- package/src/ui/createFunctionalComponent.ts +65 -0
- package/src/ui/expr.ts +44 -0
- package/src/ui/flattenProps.ts +21 -0
- package/src/ui/index.scss +2 -2
- package/src/ui/index.ts +45 -0
- package/src/ui/keyboardShortcuts.ts +40 -0
- package/src/ui/layout/Content.ts +30 -0
- package/src/ui/layout/ContentPlaceholder.spec.tsx +587 -0
- package/src/ui/layout/ContentPlaceholder.ts +133 -0
- package/src/ui/layout/FirstVisibleChildLayout.spec.tsx +195 -0
- package/src/ui/layout/FirstVisibleChildLayout.ts +60 -0
- package/src/ui/layout/LabelsLeftLayout.scss +6 -4
- package/src/ui/layout/LabelsLeftLayout.tsx +76 -0
- package/src/ui/layout/LabelsTopLayout.scss +5 -4
- package/src/ui/layout/LabelsTopLayout.tsx +156 -0
- package/src/ui/layout/UseParentLayout.ts +8 -0
- package/src/ui/layout/exploreChildren.ts +38 -0
- package/src/ui/layout/index.scss +3 -3
- package/src/ui/layout/variables.scss +2 -2
- package/src/ui/selection/KeySelection.ts +165 -0
- package/src/ui/selection/PropertySelection.ts +87 -0
- package/src/ui/selection/Selection.ts +118 -0
- package/src/ui/tpl.ts +5 -0
- package/src/ui/variables.scss +1 -1
- package/src/util/Component.spec.ts +381 -0
- package/src/util/Component.ts +296 -0
- package/src/util/Console.ts +11 -0
- package/src/util/DOM.ts +88 -0
- package/src/util/Debug.ts +71 -0
- package/src/util/Format.spec.ts +69 -0
- package/src/util/Format.ts +267 -0
- package/src/util/GlobalCacheIdentifier.ts +11 -0
- package/src/util/KeyCode.ts +21 -0
- package/src/util/SubscriberList.ts +87 -0
- package/src/util/Timing.ts +59 -0
- package/src/util/TraversalStack.spec.ts +54 -0
- package/src/util/TraversalStack.ts +48 -0
- package/src/util/addEventListenerWithOptions.ts +41 -0
- package/src/util/browserSupportsPassiveEventHandlers.ts +20 -0
- package/src/util/calculateNaturalElementHeight.ts +22 -0
- package/src/util/call-once.scss +6 -6
- package/src/util/capitalize.ts +4 -0
- package/src/util/coalesce.ts +6 -0
- package/src/util/color/hslToRgb.ts +34 -0
- package/src/util/color/parseColor.ts +173 -0
- package/src/util/color/rgbToHex.ts +15 -0
- package/src/util/color/rgbToHsl.ts +36 -0
- package/src/util/date/dateDiff.ts +9 -0
- package/src/util/date/diff.ts +13 -0
- package/src/util/date/encodeDate.ts +8 -0
- package/src/util/date/encodeDateWithTimezoneOffset.ts +19 -0
- package/src/util/date/lowerBoundCheck.ts +13 -0
- package/src/util/date/maxDate.ts +14 -0
- package/src/util/date/minDate.ts +14 -0
- package/src/util/date/monthStart.ts +8 -0
- package/src/util/date/parseDateInvariant.ts +20 -0
- package/src/util/date/sameDate.ts +11 -0
- package/src/util/date/upperBoundCheck.ts +13 -0
- package/src/util/date/zeroTime.ts +9 -0
- package/src/util/debounce.ts +26 -0
- package/src/util/dummyCallback.ts +1 -0
- package/src/util/escapeSpecialRegexCharacters.ts +8 -0
- package/src/util/eventCallbacks.ts +12 -0
- package/src/util/expandFatArrows.ts +118 -0
- package/src/util/findScrollableParent.ts +15 -0
- package/src/util/getActiveElement.ts +4 -0
- package/src/util/getParentFrameBoundingClientRect.ts +13 -0
- package/src/util/getScrollerBoundingClientRect.ts +12 -0
- package/src/util/getSearchQueryPredicate.ts +58 -0
- package/src/util/getTopLevelBoundingClientRect.ts +7 -0
- package/src/util/getVendorPrefix.ts +33 -0
- package/src/util/hasKey.ts +18 -0
- package/src/util/index.scss +10 -10
- package/src/util/index.ts +55 -0
- package/src/util/innerTextTrim.ts +10 -0
- package/src/util/isArray.ts +3 -0
- package/src/util/isDataRecord.ts +5 -0
- package/src/util/isDefined.ts +3 -0
- package/src/util/isDigit.ts +8 -0
- package/src/util/isFunction.ts +3 -0
- package/src/util/isNonEmptyArray.ts +3 -0
- package/src/util/isNumber.ts +3 -0
- package/src/util/isObject.ts +3 -0
- package/src/util/isPromise.ts +6 -0
- package/src/util/isString.ts +3 -0
- package/src/util/isTextInputElement.ts +3 -0
- package/src/util/isTouchDevice.ts +7 -0
- package/src/util/isTouchEvent.ts +64 -0
- package/src/util/isUndefined.ts +3 -0
- package/src/util/isValidIdentifierName.ts +5 -0
- package/src/util/onIdleCallback.ts +10 -0
- package/src/util/parseStyle.ts +29 -0
- package/src/util/quote.ts +6 -0
- package/src/util/reverseSlice.ts +10 -0
- package/src/util/routeAppend.ts +16 -0
- package/src/util/scrollElementIntoView.ts +40 -0
- package/src/util/scss/add-rules.scss +7 -5
- package/src/util/scss/calc.scss +12 -8
- package/src/util/scss/call-once.scss +5 -3
- package/src/util/scss/clockwise.scss +20 -18
- package/src/util/scss/colors.scss +4 -2
- package/src/util/scss/deep-get.scss +3 -1
- package/src/util/scss/deep-merge.scss +6 -3
- package/src/util/scss/divide.scss +3 -3
- package/src/util/scss/include.scss +6 -5
- package/src/util/scss/index.scss +9 -9
- package/src/util/shallowEquals.ts +43 -0
- package/src/util/test/createTestRenderer.tsx +12 -0
- package/src/util/throttle.ts +21 -0
- package/src/util/validatedDebounce.ts +23 -0
- package/src/variables.scss +217 -217
- package/src/widgets/AccessorBindings.spec.tsx +64 -66
- package/src/widgets/Button.scss +6 -4
- package/src/widgets/Button.tsx +201 -0
- package/src/widgets/Button.variables.scss +13 -10
- package/src/widgets/CxCredit.scss +6 -4
- package/src/widgets/CxCredit.tsx +46 -0
- package/src/widgets/DocumentTitle.ts +92 -0
- package/src/widgets/FlexBox.scss +7 -5
- package/src/widgets/FlexBox.tsx +169 -0
- package/src/widgets/Heading.scss +6 -4
- package/src/widgets/Heading.ts +43 -0
- package/src/widgets/HighlightedSearchText.scss +6 -4
- package/src/widgets/HighlightedSearchText.tsx +54 -0
- package/src/widgets/HtmlElement.spec.tsx +79 -0
- package/src/widgets/HtmlElement.tsx +349 -0
- package/src/widgets/Icon.scss +6 -4
- package/src/widgets/Icon.ts +78 -0
- package/src/widgets/List.scss +6 -4
- package/src/widgets/List.tsx +787 -0
- package/src/widgets/ProgressBar.scss +5 -4
- package/src/widgets/ProgressBar.tsx +66 -0
- package/src/widgets/Resizer.scss +5 -4
- package/src/widgets/Resizer.tsx +200 -0
- package/src/widgets/Sandbox.ts +103 -0
- package/src/widgets/Section.scss +5 -4
- package/src/widgets/Section.tsx +187 -0
- package/src/widgets/animations.scss +10 -10
- package/src/widgets/autoFocus.ts +9 -0
- package/src/widgets/cx.ts +63 -0
- package/src/widgets/drag-drop/DragClone.scss +6 -4
- package/src/widgets/drag-drop/DragHandle.scss +6 -4
- package/src/widgets/drag-drop/DragHandle.tsx +47 -0
- package/src/widgets/drag-drop/DragSource.scss +6 -4
- package/src/widgets/drag-drop/DragSource.tsx +238 -0
- package/src/widgets/drag-drop/DropZone.scss +6 -4
- package/src/widgets/drag-drop/DropZone.tsx +354 -0
- package/src/widgets/drag-drop/index.scss +3 -3
- package/src/widgets/drag-drop/ops.tsx +422 -0
- package/src/widgets/drag-drop/variables.scss +4 -1
- package/src/widgets/enableAllInternalDependencies.ts +11 -0
- package/src/widgets/form/Calendar.scss +8 -5
- package/src/widgets/form/Calendar.tsx +760 -0
- package/src/widgets/form/Calendar.variables.scss +63 -63
- package/src/widgets/form/Checkbox.scss +5 -3
- package/src/widgets/form/Checkbox.tsx +285 -0
- package/src/widgets/form/Checkbox.variables.scss +39 -39
- package/src/widgets/form/ColorField.scss +5 -3
- package/src/widgets/form/ColorField.tsx +491 -0
- package/src/widgets/form/ColorPicker.scss +5 -3
- package/src/widgets/form/ColorPicker.tsx +544 -0
- package/src/widgets/form/ColorPicker.variables.scss +22 -22
- package/src/widgets/form/DateField.ts +21 -0
- package/src/widgets/form/DateTimeField.scss +5 -3
- package/src/widgets/form/DateTimeField.tsx +723 -0
- package/src/widgets/form/DateTimePicker.scss +6 -4
- package/src/widgets/form/DateTimePicker.tsx +431 -0
- package/src/widgets/form/Field.scss +4 -2
- package/src/widgets/form/Field.tsx +611 -0
- package/src/widgets/form/FieldGroup.ts +10 -0
- package/src/widgets/form/FieldIcon.ts +61 -0
- package/src/widgets/form/HelpText.scss +5 -4
- package/src/widgets/form/HelpText.ts +15 -0
- package/src/widgets/form/Label.scss +5 -4
- package/src/widgets/form/Label.tsx +116 -0
- package/src/widgets/form/LabeledContainer.ts +81 -0
- package/src/widgets/form/LookupField.scss +5 -3
- package/src/widgets/form/LookupField.tsx +1326 -0
- package/src/widgets/form/MonthField.scss +4 -3
- package/src/widgets/form/MonthField.tsx +665 -0
- package/src/widgets/form/MonthPicker.scss +8 -5
- package/src/widgets/form/MonthPicker.tsx +822 -0
- package/src/widgets/form/NumberField.scss +5 -3
- package/src/widgets/form/NumberField.tsx +540 -0
- package/src/widgets/form/Radio.scss +5 -3
- package/src/widgets/form/Radio.tsx +245 -0
- package/src/widgets/form/Radio.variables.scss +45 -45
- package/src/widgets/form/Select.scss +6 -4
- package/src/widgets/form/Select.tsx +322 -0
- package/src/widgets/form/Slider.scss +6 -3
- package/src/widgets/form/Slider.tsx +461 -0
- package/src/widgets/form/Switch.scss +5 -3
- package/src/widgets/form/Switch.tsx +174 -0
- package/src/widgets/form/TextArea.scss +6 -4
- package/src/widgets/form/TextArea.tsx +229 -0
- package/src/widgets/form/TextField.scss +6 -4
- package/src/widgets/form/TextField.tsx +345 -0
- package/src/widgets/form/TimeField.ts +10 -0
- package/src/widgets/form/TimeList.tsx +94 -0
- package/src/widgets/form/UploadButton.scss +5 -3
- package/src/widgets/form/UploadButton.tsx +256 -0
- package/src/widgets/form/ValidationError.scss +4 -3
- package/src/widgets/form/ValidationError.tsx +72 -0
- package/src/widgets/form/ValidationGroup.spec.tsx +147 -0
- package/src/widgets/form/ValidationGroup.ts +141 -0
- package/src/widgets/form/Validator.ts +23 -0
- package/src/widgets/form/Wheel.scss +9 -7
- package/src/widgets/form/Wheel.tsx +315 -0
- package/src/widgets/form/index.scss +24 -24
- package/src/widgets/form/variables.scss +3 -1
- package/src/widgets/grid/Grid.scss +6 -4
- package/src/widgets/grid/Grid.tsx +4247 -0
- package/src/widgets/grid/GridCell.ts +143 -0
- package/src/widgets/grid/GridCellEditor.tsx +52 -0
- package/src/widgets/grid/GridRow.ts +302 -0
- package/src/widgets/grid/GridRowLine.ts +49 -0
- package/src/widgets/grid/Pagination.scss +5 -3
- package/src/widgets/grid/Pagination.tsx +126 -0
- package/src/widgets/grid/TreeNode.scss +6 -4
- package/src/widgets/grid/TreeNode.tsx +145 -0
- package/src/widgets/grid/createGridCellEditor.tsx +18 -0
- package/src/widgets/grid/index.scss +3 -3
- package/src/widgets/grid/index.ts +17 -0
- package/src/widgets/grid/variables.scss +8 -4
- package/src/widgets/icons/arrow-down.svg +3 -3
- package/src/widgets/icons/arrow-right.svg +2 -2
- package/src/widgets/icons/base.svg +104 -104
- package/src/widgets/icons/calendar-old.svg +169 -169
- package/src/widgets/icons/calendar.svg +187 -187
- package/src/widgets/icons/calendar.tsx +17 -0
- package/src/widgets/icons/check.tsx +13 -0
- package/src/widgets/icons/clear.svg +74 -74
- package/src/widgets/icons/clear.tsx +15 -0
- package/src/widgets/icons/close.svg +74 -74
- package/src/widgets/icons/close.tsx +20 -0
- package/src/widgets/icons/cx.tsx +38 -0
- package/src/widgets/icons/drop-down.tsx +15 -0
- package/src/widgets/icons/dropdown-arrow.svg +61 -61
- package/src/widgets/icons/file.svg +4 -4
- package/src/widgets/icons/file.tsx +13 -0
- package/src/widgets/icons/folder-open.svg +5 -5
- package/src/widgets/icons/folder-open.tsx +15 -0
- package/src/widgets/icons/folder.svg +58 -58
- package/src/widgets/icons/folder.tsx +13 -0
- package/src/widgets/icons/forward.svg +67 -67
- package/src/widgets/icons/forward.tsx +22 -0
- package/src/widgets/icons/loading.svg +4 -4
- package/src/widgets/icons/loading.tsx +24 -0
- package/src/widgets/icons/menu.tsx +17 -0
- package/src/widgets/icons/pixel-picker.tsx +18 -0
- package/src/widgets/icons/registry.ts +57 -0
- package/src/widgets/icons/search.svg +107 -107
- package/src/widgets/icons/search.tsx +13 -0
- package/src/widgets/icons/sort-asc.svg +3 -3
- package/src/widgets/icons/sort-asc.tsx +14 -0
- package/src/widgets/icons/square.tsx +18 -0
- package/src/widgets/index.d.ts +55 -55
- package/src/widgets/index.scss +16 -16
- package/src/widgets/nav/Link.scss +5 -3
- package/src/widgets/nav/Link.ts +12 -0
- package/src/widgets/nav/LinkButton.ts +176 -0
- package/src/widgets/nav/Menu.scss +7 -5
- package/src/widgets/nav/Menu.tsx +489 -0
- package/src/widgets/nav/Menu.variables.scss +3 -1
- package/src/widgets/nav/MenuItem.scss +6 -4
- package/src/widgets/nav/MenuItem.tsx +523 -0
- package/src/widgets/nav/MenuSpacer.ts +19 -0
- package/src/widgets/nav/RedirectRoute.ts +50 -0
- package/src/widgets/nav/Route.spec.tsx +24 -0
- package/src/widgets/nav/Route.ts +142 -0
- package/src/widgets/nav/Scroller.scss +5 -3
- package/src/widgets/nav/Scroller.tsx +253 -0
- package/src/widgets/nav/Submenu.ts +6 -0
- package/src/widgets/nav/Tab.scss +5 -4
- package/src/widgets/nav/Tab.ts +120 -0
- package/src/widgets/nav/Tab.variables.scss +84 -84
- package/src/widgets/nav/cover.scss +5 -4
- package/src/widgets/nav/index.scss +5 -5
- package/src/widgets/nav/variables.scss +3 -1
- package/src/widgets/overlay/ContextMenu.ts +42 -0
- package/src/widgets/overlay/Dropdown.scss +11 -9
- package/src/widgets/overlay/Dropdown.tsx +762 -0
- package/src/widgets/overlay/FlyweightTooltipTracker.ts +57 -0
- package/src/widgets/overlay/MsgBox.tsx +141 -0
- package/src/widgets/overlay/Overlay.scss +5 -3
- package/src/widgets/overlay/Overlay.tsx +942 -0
- package/src/widgets/overlay/Toast.scss +8 -7
- package/src/widgets/overlay/Toast.ts +111 -0
- package/src/widgets/overlay/Tooltip.scss +6 -4
- package/src/widgets/overlay/Tooltip.tsx +393 -0
- package/src/widgets/overlay/Window.scss +6 -4
- package/src/widgets/overlay/Window.tsx +299 -0
- package/src/widgets/overlay/Window.variables.scss +62 -62
- package/src/widgets/overlay/alerts.ts +46 -0
- package/src/widgets/overlay/captureMouse.scss +13 -13
- package/src/widgets/overlay/captureMouse.ts +195 -0
- package/src/widgets/overlay/createHotPromiseWindowFactory.ts +72 -0
- package/src/widgets/overlay/index.scss +15 -15
- package/src/widgets/overlay/index.ts +11 -0
- package/src/widgets/overlay/tooltip-ops.ts +173 -0
- package/src/widgets/overlay/variables.scss +3 -1
- package/src/widgets/variables.scss +3 -1
- package/tsconfig.compile.json +4 -0
- package/tsconfig.json +34 -0
- package/tsconfig.mocha.json +14 -0
- package/charts.d.ts +0 -1
- package/charts.js +0 -1
- package/data.d.ts +0 -1
- package/data.js +0 -1
- package/hooks.d.ts +0 -1
- package/hooks.js +0 -1
- package/index.js +0 -17
- package/locale/de-de.js +0 -75
- package/locale/en-us.js +0 -75
- package/locale/es-es.js +0 -75
- package/locale/fr-fr.js +0 -75
- package/locale/nl-nl.js +0 -75
- package/locale/pt-pt.js +0 -75
- package/locale/sr-latn-ba.js +0 -75
- package/manifest.js +0 -1
- package/src/charts/Bar.d.ts +0 -28
- package/src/charts/Bar.js +0 -90
- package/src/charts/BarGraph.d.ts +0 -15
- package/src/charts/BarGraph.js +0 -112
- package/src/charts/BubbleGraph.js +0 -93
- package/src/charts/Chart.d.ts +0 -12
- package/src/charts/Chart.js +0 -75
- package/src/charts/ColorMap.d.ts +0 -21
- package/src/charts/ColorMap.js +0 -97
- package/src/charts/Column.d.ts +0 -29
- package/src/charts/Column.js +0 -88
- package/src/charts/ColumnBarBase.d.ts +0 -64
- package/src/charts/ColumnBarBase.js +0 -176
- package/src/charts/ColumnBarGraphBase.d.ts +0 -73
- package/src/charts/ColumnBarGraphBase.js +0 -114
- package/src/charts/ColumnGraph.d.ts +0 -18
- package/src/charts/ColumnGraph.js +0 -120
- package/src/charts/Grid.js +0 -5
- package/src/charts/Gridlines.d.ts +0 -25
- package/src/charts/Gridlines.js +0 -49
- package/src/charts/Legend.d.ts +0 -45
- package/src/charts/Legend.js +0 -187
- package/src/charts/LegendEntry.d.ts +0 -54
- package/src/charts/LegendEntry.js +0 -128
- package/src/charts/LineGraph.d.ts +0 -101
- package/src/charts/LineGraph.js +0 -300
- package/src/charts/Marker.d.ts +0 -110
- package/src/charts/Marker.js +0 -311
- package/src/charts/MarkerLine.d.ts +0 -56
- package/src/charts/MarkerLine.js +0 -128
- package/src/charts/MouseTracker.d.ts +0 -17
- package/src/charts/MouseTracker.js +0 -81
- package/src/charts/Pie.js +0 -8
- package/src/charts/PieChart.d.ts +0 -92
- package/src/charts/PieChart.js +0 -530
- package/src/charts/PieLabel.d.ts +0 -26
- package/src/charts/PieLabel.js +0 -71
- package/src/charts/PieLabelsContainer.d.ts +0 -6
- package/src/charts/PieLabelsContainer.js +0 -55
- package/src/charts/Range.d.ts +0 -75
- package/src/charts/Range.js +0 -206
- package/src/charts/RangeMarker.d.ts +0 -35
- package/src/charts/RangeMarker.js +0 -159
- package/src/charts/ScatterGraph.d.ts +0 -64
- package/src/charts/ScatterGraph.js +0 -164
- package/src/charts/Swimlane.d.ts +0 -24
- package/src/charts/Swimlane.js +0 -140
- package/src/charts/Swimlanes.d.ts +0 -41
- package/src/charts/Swimlanes.js +0 -114
- package/src/charts/axis/Axis.d.ts +0 -113
- package/src/charts/axis/Axis.js +0 -288
- package/src/charts/axis/CategoryAxis.d.ts +0 -30
- package/src/charts/axis/CategoryAxis.js +0 -241
- package/src/charts/axis/NumericAxis.d.ts +0 -46
- package/src/charts/axis/NumericAxis.js +0 -351
- package/src/charts/axis/Stack.d.ts +0 -11
- package/src/charts/axis/Stack.js +0 -55
- package/src/charts/axis/TimeAxis.d.ts +0 -31
- package/src/charts/axis/TimeAxis.js +0 -611
- package/src/charts/axis/index.d.ts +0 -4
- package/src/charts/axis/index.js +0 -4
- package/src/charts/helpers/MinMaxFinder.d.ts +0 -22
- package/src/charts/helpers/MinMaxFinder.js +0 -36
- package/src/charts/helpers/PointReducer.d.ts +0 -24
- package/src/charts/helpers/PointReducer.js +0 -61
- package/src/charts/helpers/SnapPointFinder.d.ts +0 -30
- package/src/charts/helpers/SnapPointFinder.js +0 -69
- package/src/charts/helpers/ValueAtFinder.d.ts +0 -16
- package/src/charts/helpers/ValueAtFinder.js +0 -46
- package/src/charts/helpers/index.d.ts +0 -4
- package/src/charts/helpers/index.js +0 -4
- package/src/charts/index.d.ts +0 -27
- package/src/charts/shapes.d.ts +0 -23
- package/src/charts/shapes.js +0 -79
- package/src/data/AggregateFunction.d.ts +0 -20
- package/src/data/AggregateFunction.js +0 -145
- package/src/data/ArrayElementView.d.ts +0 -13
- package/src/data/ArrayElementView.js +0 -64
- package/src/data/ArrayElementView.spec.js +0 -88
- package/src/data/ArrayRef.d.ts +0 -15
- package/src/data/ArrayRef.js +0 -35
- package/src/data/AugmentedViewBase.d.ts +0 -18
- package/src/data/AugmentedViewBase.js +0 -77
- package/src/data/Binding.d.ts +0 -19
- package/src/data/Binding.js +0 -76
- package/src/data/ExposedRecordView.d.ts +0 -14
- package/src/data/ExposedRecordView.js +0 -75
- package/src/data/ExposedValueView.d.ts +0 -19
- package/src/data/ExposedValueView.js +0 -73
- package/src/data/Expression.d.ts +0 -17
- package/src/data/Expression.js +0 -229
- package/src/data/Expression.spec.js +0 -229
- package/src/data/Grouper.d.ts +0 -21
- package/src/data/Grouper.js +0 -144
- package/src/data/Grouper.spec.js +0 -57
- package/src/data/NestedDataView.d.ts +0 -19
- package/src/data/NestedDataView.js +0 -22
- package/src/data/ReadOnlyDataView.d.ts +0 -14
- package/src/data/ReadOnlyDataView.js +0 -27
- package/src/data/Ref.d.ts +0 -24
- package/src/data/Ref.js +0 -79
- package/src/data/Ref.spec.js +0 -79
- package/src/data/Store.d.ts +0 -14
- package/src/data/Store.js +0 -46
- package/src/data/Store.spec.js +0 -22
- package/src/data/StoreProxy.d.ts +0 -5
- package/src/data/StoreProxy.js +0 -17
- package/src/data/StoreRef.js +0 -54
- package/src/data/StoreRef.spec.js +0 -24
- package/src/data/StringTemplate.d.ts +0 -15
- package/src/data/StringTemplate.js +0 -92
- package/src/data/StringTemplate.spec.js +0 -132
- package/src/data/StructuredDataAccessor.d.ts +0 -7
- package/src/data/StructuredSelector.d.ts +0 -17
- package/src/data/StructuredSelector.js +0 -132
- package/src/data/StructuredSelector.spec.js +0 -113
- package/src/data/SubscribableView.d.ts +0 -11
- package/src/data/SubscribableView.js +0 -54
- package/src/data/View.d.ts +0 -155
- package/src/data/View.js +0 -182
- package/src/data/ZoomIntoPropertyView.d.ts +0 -11
- package/src/data/ZoomIntoPropertyView.js +0 -33
- package/src/data/ZoomIntoPropertyView.spec.js +0 -65
- package/src/data/comparer.d.ts +0 -7
- package/src/data/comparer.js +0 -54
- package/src/data/computable.d.ts +0 -125
- package/src/data/computable.js +0 -56
- package/src/data/computable.spec.js +0 -55
- package/src/data/createAccessorModelProxy.d.ts +0 -6
- package/src/data/createAccessorModelProxy.js +0 -43
- package/src/data/createStructuredSelector.d.ts +0 -3
- package/src/data/createStructuredSelector.js +0 -43
- package/src/data/createStructuredSelector.spec.js +0 -46
- package/src/data/defaultCompare.d.ts +0 -1
- package/src/data/defaultCompare.js +0 -15
- package/src/data/diff/diffArrays.d.ts +0 -15
- package/src/data/diff/diffArrays.js +0 -41
- package/src/data/diff/diffs.spec.js +0 -49
- package/src/data/diff/index.d.ts +0 -1
- package/src/data/diff/index.js +0 -1
- package/src/data/enableFatArrowExpansion.d.ts +0 -1
- package/src/data/enableFatArrowExpansion.js +0 -6
- package/src/data/getAccessor.d.ts +0 -9
- package/src/data/getAccessor.js +0 -61
- package/src/data/getAccessor.spec.js +0 -11
- package/src/data/getSelector.d.ts +0 -3
- package/src/data/getSelector.js +0 -49
- package/src/data/getSelector.spec.js +0 -43
- package/src/data/index.d.ts +0 -30
- package/src/data/index.js +0 -29
- package/src/data/isSelector.d.ts +0 -1
- package/src/data/isSelector.js +0 -26
- package/src/data/ops/append.d.ts +0 -1
- package/src/data/ops/append.js +0 -7
- package/src/data/ops/append.spec.js +0 -28
- package/src/data/ops/filter.d.ts +0 -1
- package/src/data/ops/filter.js +0 -8
- package/src/data/ops/filter.spec.js +0 -29
- package/src/data/ops/findTreeNode.d.ts +0 -1
- package/src/data/ops/findTreeNode.js +0 -15
- package/src/data/ops/findTreeNode.spec.js +0 -24
- package/src/data/ops/findTreePath.d.ts +0 -6
- package/src/data/ops/findTreePath.js +0 -16
- package/src/data/ops/index.d.ts +0 -10
- package/src/data/ops/insertElement.d.ts +0 -1
- package/src/data/ops/insertElement.js +0 -3
- package/src/data/ops/merge.d.ts +0 -3
- package/src/data/ops/merge.js +0 -9
- package/src/data/ops/merge.spec.js +0 -27
- package/src/data/ops/moveElement.d.ts +0 -1
- package/src/data/ops/moveElement.js +0 -14
- package/src/data/ops/removeTreeNodes.d.ts +0 -5
- package/src/data/ops/removeTreeNodes.js +0 -5
- package/src/data/ops/removeTreeNodes.spec.js +0 -28
- package/src/data/ops/updateArray.d.ts +0 -6
- package/src/data/ops/updateArray.js +0 -24
- package/src/data/ops/updateArray.spec.js +0 -38
- package/src/data/ops/updateTree.d.ts +0 -7
- package/src/data/ops/updateTree.js +0 -25
- package/src/data/ops/updateTree.spec.js +0 -36
- package/src/hooks/createLocalStorageRef.d.ts +0 -3
- package/src/hooks/createLocalStorageRef.js +0 -20
- package/src/hooks/index.js +0 -8
- package/src/hooks/invokeCallback.d.ts +0 -5
- package/src/hooks/invokeCallback.js +0 -7
- package/src/hooks/invokeCallback.spec.js +0 -53
- package/src/hooks/resolveCallback.d.ts +0 -3
- package/src/hooks/resolveCallback.js +0 -12
- package/src/hooks/resolveCallback.spec.js +0 -54
- package/src/hooks/store.d.ts +0 -8
- package/src/hooks/store.js +0 -32
- package/src/hooks/store.spec.js +0 -73
- package/src/hooks/useEffect.d.ts +0 -3
- package/src/hooks/useEffect.js +0 -15
- package/src/hooks/useInterval.d.ts +0 -1
- package/src/hooks/useInterval.js +0 -8
- package/src/hooks/useState.d.ts +0 -3
- package/src/hooks/useState.js +0 -16
- package/src/hooks/useTrigger.d.ts +0 -5
- package/src/hooks/useTrigger.js +0 -20
- package/src/hooks/useTrigger.spec.js +0 -102
- package/src/svg/BoundedObject.d.ts +0 -23
- package/src/svg/BoundedObject.js +0 -59
- package/src/svg/ClipRect.d.ts +0 -5
- package/src/svg/ClipRect.js +0 -23
- package/src/svg/Ellipse.d.ts +0 -24
- package/src/svg/Ellipse.js +0 -37
- package/src/svg/Line.d.ts +0 -21
- package/src/svg/Line.js +0 -33
- package/src/svg/NonOverlappingRect.d.ts +0 -5
- package/src/svg/NonOverlappingRect.js +0 -15
- package/src/svg/NonOverlappingRectGroup.d.ts +0 -3
- package/src/svg/NonOverlappingRectGroup.js +0 -37
- package/src/svg/Rectangle.d.ts +0 -37
- package/src/svg/Rectangle.js +0 -42
- package/src/svg/Svg.d.ts +0 -32
- package/src/svg/Svg.js +0 -177
- package/src/svg/Text.d.ts +0 -40
- package/src/svg/Text.js +0 -78
- package/src/svg/TextualBoundedObject.d.ts +0 -7
- package/src/svg/TextualBoundedObject.js +0 -28
- package/src/svg/index.d.ts +0 -11
- package/src/svg/util/Rect.d.ts +0 -41
- package/src/svg/util/Rect.js +0 -109
- package/src/svg/util/index.js +0 -1
- package/src/ui/CSS.d.ts +0 -20
- package/src/ui/CSS.js +0 -79
- package/src/ui/CSSHelper.d.ts +0 -11
- package/src/ui/CSSHelper.js +0 -18
- package/src/ui/Container.d.ts +0 -18
- package/src/ui/Container.js +0 -154
- package/src/ui/ContentResolver.d.ts +0 -12
- package/src/ui/ContentResolver.js +0 -78
- package/src/ui/Controller.d.ts +0 -182
- package/src/ui/Controller.js +0 -114
- package/src/ui/Controller.spec.js +0 -415
- package/src/ui/Culture.d.ts +0 -57
- package/src/ui/Culture.js +0 -139
- package/src/ui/Cx.d.ts +0 -18
- package/src/ui/Cx.js +0 -325
- package/src/ui/Cx.spec.js +0 -194
- package/src/ui/DataProxy.d.ts +0 -12
- package/src/ui/DataProxy.js +0 -31
- package/src/ui/DataProxy.spec.js +0 -338
- package/src/ui/DetachedScope.d.ts +0 -21
- package/src/ui/DetachedScope.js +0 -98
- package/src/ui/FocusManager.d.ts +0 -29
- package/src/ui/FocusManager.js +0 -171
- package/src/ui/Format.d.ts +0 -3
- package/src/ui/Format.js +0 -108
- package/src/ui/HoverSync.d.ts +0 -13
- package/src/ui/HoverSync.js +0 -147
- package/src/ui/Instance.d.ts +0 -72
- package/src/ui/Instance.js +0 -620
- package/src/ui/IsolatedScope.d.ts +0 -16
- package/src/ui/IsolatedScope.js +0 -30
- package/src/ui/IsolatedScope.spec.js +0 -62
- package/src/ui/Localization.d.ts +0 -17
- package/src/ui/Localization.js +0 -70
- package/src/ui/PureContainer.d.ts +0 -16
- package/src/ui/PureContainer.js +0 -7
- package/src/ui/RenderingContext.d.ts +0 -9
- package/src/ui/RenderingContext.js +0 -88
- package/src/ui/Repeater.d.ts +0 -61
- package/src/ui/Repeater.js +0 -109
- package/src/ui/Repeater.spec.js +0 -143
- package/src/ui/Rescope.d.ts +0 -10
- package/src/ui/Rescope.js +0 -35
- package/src/ui/Rescope.spec.js +0 -195
- package/src/ui/ResizeManager.d.ts +0 -10
- package/src/ui/ResizeManager.js +0 -31
- package/src/ui/Restate.d.ts +0 -21
- package/src/ui/Restate.js +0 -167
- package/src/ui/Restate.spec.js +0 -422
- package/src/ui/StaticText.d.ts +0 -8
- package/src/ui/StaticText.js +0 -9
- package/src/ui/StructuredInstanceDataAccessor.d.ts +0 -16
- package/src/ui/StructuredInstanceDataAccessor.js +0 -26
- package/src/ui/Text.d.ts +0 -10
- package/src/ui/Text.js +0 -25
- package/src/ui/VDOM.d.ts +0 -12
- package/src/ui/VDOM.js +0 -2
- package/src/ui/Widget.d.ts +0 -14
- package/src/ui/Widget.js +0 -184
- package/src/ui/ZIndexManager.d.ts +0 -7
- package/src/ui/ZIndexManager.js +0 -11
- package/src/ui/adapter/ArrayAdapter.d.ts +0 -17
- package/src/ui/adapter/ArrayAdapter.js +0 -152
- package/src/ui/adapter/ArrayAdapter.spec.js +0 -55
- package/src/ui/adapter/DataAdapter.d.ts +0 -31
- package/src/ui/adapter/DataAdapter.js +0 -15
- package/src/ui/adapter/GroupAdapter.d.ts +0 -23
- package/src/ui/adapter/GroupAdapter.js +0 -140
- package/src/ui/adapter/TreeAdapter.d.ts +0 -24
- package/src/ui/adapter/TreeAdapter.js +0 -101
- package/src/ui/adapter/TreeAdapter.spec.js +0 -67
- package/src/ui/adapter/index.js +0 -4
- package/src/ui/app/History.d.ts +0 -17
- package/src/ui/app/History.js +0 -114
- package/src/ui/app/Url.d.ts +0 -21
- package/src/ui/app/Url.js +0 -103
- package/src/ui/app/Url.spec.js +0 -51
- package/src/ui/app/index.d.ts +0 -4
- package/src/ui/app/startAppLoop.d.ts +0 -4
- package/src/ui/app/startAppLoop.js +0 -58
- package/src/ui/app/startHotAppLoop.d.ts +0 -7
- package/src/ui/app/startHotAppLoop.js +0 -25
- package/src/ui/batchUpdates.d.ts +0 -11
- package/src/ui/batchUpdates.js +0 -67
- package/src/ui/bind.d.ts +0 -4
- package/src/ui/bind.js +0 -7
- package/src/ui/createFunctionalComponent.d.ts +0 -1
- package/src/ui/createFunctionalComponent.js +0 -63
- package/src/ui/createFunctionalComponent.spec.js +0 -400
- package/src/ui/expr.d.ts +0 -24
- package/src/ui/expr.js +0 -17
- package/src/ui/flattenProps.js +0 -21
- package/src/ui/index.d.ts +0 -42
- package/src/ui/index.js +0 -44
- package/src/ui/keyboardShortcuts.d.ts +0 -5
- package/src/ui/keyboardShortcuts.js +0 -31
- package/src/ui/layout/Content.d.ts +0 -14
- package/src/ui/layout/Content.js +0 -16
- package/src/ui/layout/ContentPlaceholder.d.ts +0 -19
- package/src/ui/layout/ContentPlaceholder.js +0 -105
- package/src/ui/layout/ContentPlaceholder.spec.js +0 -579
- package/src/ui/layout/FirstVisibleChildLayout.d.ts +0 -4
- package/src/ui/layout/FirstVisibleChildLayout.js +0 -66
- package/src/ui/layout/FirstVisibleChildLayout.spec.js +0 -196
- package/src/ui/layout/LabelsLeftLayout.d.ts +0 -11
- package/src/ui/layout/LabelsLeftLayout.js +0 -59
- package/src/ui/layout/LabelsTopLayout.d.ts +0 -15
- package/src/ui/layout/LabelsTopLayout.js +0 -135
- package/src/ui/layout/UseParentLayout.d.ts +0 -4
- package/src/ui/layout/UseParentLayout.js +0 -6
- package/src/ui/layout/exploreChildren.d.ts +0 -12
- package/src/ui/layout/exploreChildren.js +0 -27
- package/src/ui/layout/index.js +0 -10
- package/src/ui/selection/KeySelection.d.ts +0 -17
- package/src/ui/selection/KeySelection.js +0 -129
- package/src/ui/selection/PropertySelection.d.ts +0 -17
- package/src/ui/selection/PropertySelection.js +0 -55
- package/src/ui/selection/Selection.d.ts +0 -27
- package/src/ui/selection/Selection.js +0 -93
- package/src/ui/selection/index.js +0 -3
- package/src/ui/tpl.d.ts +0 -3
- package/src/ui/tpl.js +0 -5
- package/src/util/Component.d.ts +0 -42
- package/src/util/Component.js +0 -108
- package/src/util/Console.d.ts +0 -4
- package/src/util/Console.js +0 -11
- package/src/util/DOM.d.ts +0 -33
- package/src/util/DOM.js +0 -72
- package/src/util/Debug.d.ts +0 -11
- package/src/util/Debug.js +0 -45
- package/src/util/Format.d.ts +0 -18
- package/src/util/Format.js +0 -270
- package/src/util/Format.spec.js +0 -69
- package/src/util/GlobalCacheIdentifier.js +0 -11
- package/src/util/GlobalCacheldentifier.d.ts +0 -7
- package/src/util/KeyCode.d.ts +0 -21
- package/src/util/KeyCode.js +0 -21
- package/src/util/SubscriberList.d.ts +0 -42
- package/src/util/SubscriberList.js +0 -58
- package/src/util/Timing.d.ts +0 -14
- package/src/util/Timing.js +0 -58
- package/src/util/TraversalStack.js +0 -43
- package/src/util/TraversalStack.spec.js +0 -47
- package/src/util/addEventListenerWithOptions.d.ts +0 -6
- package/src/util/addEventListenerWithOptions.js +0 -9
- package/src/util/browserSupportsPassiveEventHandlers.d.ts +0 -5
- package/src/util/browserSupportsPassiveEventHandlers.js +0 -18
- package/src/util/calculateNaturalElementHeight.d.ts +0 -1
- package/src/util/calculateNaturalElementHeight.js +0 -22
- package/src/util/capitalize.d.ts +0 -1
- package/src/util/capitalize.js +0 -4
- package/src/util/coalesce.d.ts +0 -1
- package/src/util/coalesce.js +0 -6
- package/src/util/color/hslToRgb.d.ts +0 -9
- package/src/util/color/hslToRgb.js +0 -27
- package/src/util/color/index.d.ts +0 -4
- package/src/util/color/parseColor.d.ts +0 -60
- package/src/util/color/parseColor.js +0 -119
- package/src/util/color/rgbToHex.d.ts +0 -9
- package/src/util/color/rgbToHex.js +0 -8
- package/src/util/color/rgbToHsl.d.ts +0 -9
- package/src/util/color/rgbToHsl.js +0 -28
- package/src/util/date/dateDiff.d.ts +0 -8
- package/src/util/date/dateDiff.js +0 -3
- package/src/util/date/diff.d.ts +0 -8
- package/src/util/date/diff.js +0 -7
- package/src/util/date/encodeDate.d.ts +0 -1
- package/src/util/date/encodeDate.js +0 -8
- package/src/util/date/encodeDateWithTimezoneOffset.d.ts +0 -1
- package/src/util/date/encodeDateWithTimezoneOffset.js +0 -19
- package/src/util/date/index.js +0 -11
- package/src/util/date/lowerBoundCheck.d.ts +0 -8
- package/src/util/date/lowerBoundCheck.js +0 -6
- package/src/util/date/maxDate.d.ts +0 -6
- package/src/util/date/maxDate.js +0 -9
- package/src/util/date/minDate.d.ts +0 -6
- package/src/util/date/minDate.js +0 -9
- package/src/util/date/monthStart.d.ts +0 -6
- package/src/util/date/monthStart.js +0 -3
- package/src/util/date/parseDateInvariant.d.ts +0 -3
- package/src/util/date/parseDateInvariant.js +0 -20
- package/src/util/date/sameDate.d.ts +0 -7
- package/src/util/date/sameDate.js +0 -5
- package/src/util/date/upperBoundCheck.d.ts +0 -8
- package/src/util/date/upperBoundCheck.js +0 -6
- package/src/util/date/zeroTime.d.ts +0 -7
- package/src/util/date/zeroTime.js +0 -3
- package/src/util/debounce.d.ts +0 -9
- package/src/util/debounce.js +0 -18
- package/src/util/dummyCallback.d.ts +0 -1
- package/src/util/dummyCallback.js +0 -1
- package/src/util/escapeSpecialRegexCharacters.d.ts +0 -7
- package/src/util/escapeSpecialRegexCharacters.js +0 -3
- package/src/util/eventCallbacks.d.ts +0 -5
- package/src/util/eventCallbacks.js +0 -2
- package/src/util/expandFatArrows.d.ts +0 -1
- package/src/util/expandFatArrows.js +0 -118
- package/src/util/findScrollableParent.d.ts +0 -1
- package/src/util/findScrollableParent.js +0 -16
- package/src/util/getActiveElement.d.ts +0 -1
- package/src/util/getActiveElement.js +0 -4
- package/src/util/getParentFrameBoundingClientRect.d.ts +0 -1
- package/src/util/getParentFrameBoundingClientRect.js +0 -21
- package/src/util/getScrollerBoundingClientRect.d.ts +0 -1
- package/src/util/getScrollerBoundingClientRect.js +0 -22
- package/src/util/getSearchQueryPredicate.d.ts +0 -1
- package/src/util/getSearchQueryPredicate.js +0 -59
- package/src/util/getTopLevelBoundingClientRect.d.ts +0 -1
- package/src/util/getTopLevelBoundingClientRect.js +0 -14
- package/src/util/getVendorPrefix.d.ts +0 -1
- package/src/util/getVendorPrefix.js +0 -26
- package/src/util/index.d.ts +0 -51
- package/src/util/index.js +0 -54
- package/src/util/innerTextTrim.d.ts +0 -7
- package/src/util/innerTextTrim.js +0 -5
- package/src/util/isArray.d.ts +0 -1
- package/src/util/isArray.js +0 -3
- package/src/util/isDefined.d.ts +0 -1
- package/src/util/isDefined.js +0 -3
- package/src/util/isDigit.d.ts +0 -7
- package/src/util/isDigit.js +0 -3
- package/src/util/isFunction.d.ts +0 -1
- package/src/util/isFunction.js +0 -3
- package/src/util/isNonEmptyArray.d.ts +0 -1
- package/src/util/isNonEmptyArray.js +0 -3
- package/src/util/isNumber.d.ts +0 -1
- package/src/util/isNumber.js +0 -3
- package/src/util/isObject.d.ts +0 -1
- package/src/util/isObject.js +0 -3
- package/src/util/isPromise.d.ts +0 -1
- package/src/util/isPromise.js +0 -6
- package/src/util/isString.d.ts +0 -1
- package/src/util/isString.js +0 -3
- package/src/util/isTextInputElement.d.ts +0 -1
- package/src/util/isTextInputElement.js +0 -3
- package/src/util/isTouchDevice.d.ts +0 -2
- package/src/util/isTouchDevice.js +0 -7
- package/src/util/isTouchEvent.d.ts +0 -4
- package/src/util/isTouchEvent.js +0 -64
- package/src/util/isUndefined.d.ts +0 -1
- package/src/util/isUndefined.js +0 -3
- package/src/util/isValidIdentifierName.d.ts +0 -1
- package/src/util/isValidIdentifierName.js +0 -5
- package/src/util/onIdleCallback.d.ts +0 -1
- package/src/util/onIdleCallback.js +0 -14
- package/src/util/parseStyle.d.ts +0 -4
- package/src/util/parseStyle.js +0 -27
- package/src/util/quote.d.ts +0 -3
- package/src/util/quote.js +0 -4
- package/src/util/reverseSlice.d.ts +0 -1
- package/src/util/reverseSlice.js +0 -10
- package/src/util/routeAppend.d.ts +0 -1
- package/src/util/routeAppend.js +0 -16
- package/src/util/scrollElementIntoView.d.ts +0 -7
- package/src/util/scrollElementIntoView.js +0 -34
- package/src/util/shallowEquals.d.ts +0 -1
- package/src/util/shallowEquals.js +0 -43
- package/src/util/throttle.d.ts +0 -9
- package/src/util/throttle.js +0 -14
- package/src/util/validatedDebounce.js +0 -19
- package/src/widgets/Button.d.ts +0 -58
- package/src/widgets/Button.js +0 -118
- package/src/widgets/CxCredit.d.ts +0 -12
- package/src/widgets/CxCredit.js +0 -32
- package/src/widgets/DocumentTitle.d.ts +0 -11
- package/src/widgets/DocumentTitle.js +0 -69
- package/src/widgets/FlexBox.d.ts +0 -69
- package/src/widgets/FlexBox.js +0 -93
- package/src/widgets/Heading.d.ts +0 -16
- package/src/widgets/Heading.js +0 -33
- package/src/widgets/HighlightedSearchText.d.ts +0 -9
- package/src/widgets/HighlightedSearchText.js +0 -36
- package/src/widgets/HtmlElement.d.ts +0 -30
- package/src/widgets/HtmlElement.js +0 -275
- package/src/widgets/HtmlElement.spec.js +0 -57
- package/src/widgets/Icon.d.ts +0 -34
- package/src/widgets/Icon.js +0 -50
- package/src/widgets/List.d.ts +0 -96
- package/src/widgets/List.js +0 -594
- package/src/widgets/ProgressBar.d.ts +0 -17
- package/src/widgets/ProgressBar.js +0 -46
- package/src/widgets/Resizer.d.ts +0 -27
- package/src/widgets/Resizer.js +0 -151
- package/src/widgets/Sandbox.d.ts +0 -18
- package/src/widgets/Sandbox.js +0 -65
- package/src/widgets/Section.d.ts +0 -52
- package/src/widgets/Section.js +0 -139
- package/src/widgets/autoFocus.d.ts +0 -1
- package/src/widgets/autoFocus.js +0 -9
- package/src/widgets/cx.d.ts +0 -2
- package/src/widgets/cx.js +0 -72
- package/src/widgets/drag-drop/DragHandle.d.ts +0 -10
- package/src/widgets/drag-drop/DragHandle.js +0 -37
- package/src/widgets/drag-drop/DragSource.d.ts +0 -45
- package/src/widgets/drag-drop/DragSource.js +0 -160
- package/src/widgets/drag-drop/DropZone.d.ts +0 -98
- package/src/widgets/drag-drop/DropZone.js +0 -214
- package/src/widgets/drag-drop/index.d.ts +0 -4
- package/src/widgets/drag-drop/ops.d.ts +0 -57
- package/src/widgets/drag-drop/ops.js +0 -344
- package/src/widgets/enableAllInternalDependencies.d.ts +0 -1
- package/src/widgets/enableAllInternalDependencies.js +0 -11
- package/src/widgets/form/Calendar.d.ts +0 -86
- package/src/widgets/form/Calendar.js +0 -618
- package/src/widgets/form/Checkbox.d.ts +0 -43
- package/src/widgets/form/Checkbox.js +0 -203
- package/src/widgets/form/ColorField.d.ts +0 -44
- package/src/widgets/form/ColorField.js +0 -397
- package/src/widgets/form/ColorPicker.d.ts +0 -23
- package/src/widgets/form/ColorPicker.js +0 -485
- package/src/widgets/form/DateField.d.ts +0 -6
- package/src/widgets/form/DateField.js +0 -12
- package/src/widgets/form/DateTimeField.d.ts +0 -89
- package/src/widgets/form/DateTimeField.js +0 -576
- package/src/widgets/form/DateTimePicker.js +0 -392
- package/src/widgets/form/Field.d.ts +0 -112
- package/src/widgets/form/Field.js +0 -446
- package/src/widgets/form/FieldGroup.d.ts +0 -6
- package/src/widgets/form/FieldGroup.js +0 -6
- package/src/widgets/form/FieldIcon.js +0 -42
- package/src/widgets/form/HelpText.d.ts +0 -10
- package/src/widgets/form/HelpText.js +0 -9
- package/src/widgets/form/Label.d.ts +0 -23
- package/src/widgets/form/Label.js +0 -89
- package/src/widgets/form/LabeledContainer.d.ts +0 -9
- package/src/widgets/form/LabeledContainer.js +0 -59
- package/src/widgets/form/LookupField.d.ts +0 -179
- package/src/widgets/form/LookupField.js +0 -1135
- package/src/widgets/form/MonthField.d.ts +0 -104
- package/src/widgets/form/MonthField.js +0 -524
- package/src/widgets/form/MonthPicker.d.ts +0 -97
- package/src/widgets/form/MonthPicker.js +0 -687
- package/src/widgets/form/NumberField.d.ts +0 -96
- package/src/widgets/form/NumberField.js +0 -459
- package/src/widgets/form/Radio.d.ts +0 -37
- package/src/widgets/form/Radio.js +0 -188
- package/src/widgets/form/Select.d.ts +0 -69
- package/src/widgets/form/Select.js +0 -269
- package/src/widgets/form/Slider.d.ts +0 -65
- package/src/widgets/form/Slider.js +0 -351
- package/src/widgets/form/Switch.d.ts +0 -38
- package/src/widgets/form/Switch.js +0 -118
- package/src/widgets/form/TextArea.d.ts +0 -17
- package/src/widgets/form/TextArea.js +0 -195
- package/src/widgets/form/TextField.d.ts +0 -78
- package/src/widgets/form/TextField.js +0 -290
- package/src/widgets/form/TimeField.d.ts +0 -6
- package/src/widgets/form/TimeField.js +0 -11
- package/src/widgets/form/TimeList.js +0 -84
- package/src/widgets/form/UploadButton.d.ts +0 -34
- package/src/widgets/form/UploadButton.js +0 -213
- package/src/widgets/form/ValidationError.d.ts +0 -10
- package/src/widgets/form/ValidationError.js +0 -44
- package/src/widgets/form/ValidationGroup.d.ts +0 -41
- package/src/widgets/form/ValidationGroup.js +0 -68
- package/src/widgets/form/ValidationGroup.spec.js +0 -148
- package/src/widgets/form/Validator.d.ts +0 -8
- package/src/widgets/form/Validator.js +0 -21
- package/src/widgets/form/Wheel.js +0 -261
- package/src/widgets/form/index.d.ts +0 -26
- package/src/widgets/grid/Grid.d.ts +0 -442
- package/src/widgets/grid/Grid.js +0 -3429
- package/src/widgets/grid/GridCell.d.ts +0 -38
- package/src/widgets/grid/GridCell.js +0 -71
- package/src/widgets/grid/GridCellEditor.js +0 -41
- package/src/widgets/grid/GridRow.js +0 -228
- package/src/widgets/grid/GridRowLine.js +0 -24
- package/src/widgets/grid/Pagination.d.ts +0 -14
- package/src/widgets/grid/Pagination.js +0 -95
- package/src/widgets/grid/TreeNode.d.ts +0 -23
- package/src/widgets/grid/TreeNode.js +0 -102
- package/src/widgets/grid/index.d.ts +0 -4
- package/src/widgets/grid/index.js +0 -15
- package/src/widgets/icons/calendar.js +0 -16
- package/src/widgets/icons/check.js +0 -12
- package/src/widgets/icons/clear.js +0 -14
- package/src/widgets/icons/close.js +0 -19
- package/src/widgets/icons/cx.js +0 -37
- package/src/widgets/icons/drop-down.js +0 -14
- package/src/widgets/icons/file.js +0 -12
- package/src/widgets/icons/folder-open.js +0 -14
- package/src/widgets/icons/folder.js +0 -12
- package/src/widgets/icons/forward.js +0 -21
- package/src/widgets/icons/loading.js +0 -23
- package/src/widgets/icons/menu.js +0 -16
- package/src/widgets/icons/pixel-picker.js +0 -17
- package/src/widgets/icons/registry.js +0 -54
- package/src/widgets/icons/search.js +0 -12
- package/src/widgets/icons/sort-asc.js +0 -13
- package/src/widgets/icons/square.js +0 -17
- package/src/widgets/nav/Link.d.ts +0 -26
- package/src/widgets/nav/Link.js +0 -8
- package/src/widgets/nav/LinkButton.d.ts +0 -34
- package/src/widgets/nav/LinkButton.js +0 -128
- package/src/widgets/nav/Menu.d.ts +0 -27
- package/src/widgets/nav/Menu.js +0 -406
- package/src/widgets/nav/MenuItem.d.ts +0 -31
- package/src/widgets/nav/MenuItem.js +0 -445
- package/src/widgets/nav/MenuSpacer.d.ts +0 -5
- package/src/widgets/nav/MenuSpacer.js +0 -13
- package/src/widgets/nav/RedirectRoute.d.ts +0 -9
- package/src/widgets/nav/RedirectRoute.js +0 -41
- package/src/widgets/nav/Route.d.ts +0 -21
- package/src/widgets/nav/Route.js +0 -102
- package/src/widgets/nav/Route.spec.js +0 -27
- package/src/widgets/nav/Scroller.d.ts +0 -17
- package/src/widgets/nav/Scroller.js +0 -214
- package/src/widgets/nav/Submenu.d.ts +0 -6
- package/src/widgets/nav/Submenu.js +0 -6
- package/src/widgets/nav/Tab.d.ts +0 -33
- package/src/widgets/nav/Tab.js +0 -82
- package/src/widgets/nav/index.d.ts +0 -10
- package/src/widgets/overlay/ContextMenu.d.ts +0 -10
- package/src/widgets/overlay/ContextMenu.js +0 -29
- package/src/widgets/overlay/Dropdown.d.ts +0 -32
- package/src/widgets/overlay/Dropdown.js +0 -612
- package/src/widgets/overlay/FlyweightTooltipTracker.d.ts +0 -8
- package/src/widgets/overlay/FlyweightTooltipTracker.js +0 -39
- package/src/widgets/overlay/MsgBox.d.ts +0 -17
- package/src/widgets/overlay/MsgBox.js +0 -116
- package/src/widgets/overlay/Overlay.d.ts +0 -73
- package/src/widgets/overlay/Overlay.js +0 -747
- package/src/widgets/overlay/Toast.d.ts +0 -30
- package/src/widgets/overlay/Toast.js +0 -93
- package/src/widgets/overlay/Tooltip.d.ts +0 -50
- package/src/widgets/overlay/Tooltip.js +0 -308
- package/src/widgets/overlay/Window.d.ts +0 -42
- package/src/widgets/overlay/Window.js +0 -202
- package/src/widgets/overlay/alerts.d.ts +0 -7
- package/src/widgets/overlay/alerts.js +0 -39
- package/src/widgets/overlay/captureMouse.d.ts +0 -54
- package/src/widgets/overlay/captureMouse.js +0 -124
- package/src/widgets/overlay/createHotPromiseWindowFactory.d.ts +0 -18
- package/src/widgets/overlay/createHotPromiseWindowFactory.js +0 -56
- package/src/widgets/overlay/index.js +0 -11
- package/src/widgets/overlay/tooltip-ops.d.ts +0 -11
- package/src/widgets/overlay/tooltip-ops.js +0 -29
- package/svg.d.ts +0 -1
- package/svg.js +0 -1
- package/ui.d.ts +0 -1
- package/ui.js +0 -1
- package/util.d.ts +0 -1
- package/util.js +0 -1
- package/widgets.d.ts +0 -1
- package/widgets.js +0 -1
- /package/src/charts/{index.js → index.ts} +0 -0
- /package/src/data/{Binding.spec.js → Binding.spec.ts} +0 -0
- /package/src/data/{View.spec.js → View.spec.ts} +0 -0
- /package/src/data/{comparer.spec.js → comparer.spec.ts} +0 -0
- /package/src/data/ops/{index.js → index.ts} +0 -0
- /package/src/hooks/{index.d.ts → index.ts} +0 -0
- /package/src/{index.js → index.ts} +0 -0
- /package/src/svg/{index.js → index.ts} +0 -0
- /package/src/svg/util/{index.d.ts → index.ts} +0 -0
- /package/src/ui/adapter/{index.d.ts → index.ts} +0 -0
- /package/src/ui/app/{index.js → index.ts} +0 -0
- /package/src/ui/layout/{index.d.ts → index.ts} +0 -0
- /package/src/ui/selection/{index.d.ts → index.ts} +0 -0
- /package/src/util/color/{index.js → index.ts} +0 -0
- /package/src/util/date/{index.d.ts → index.ts} +0 -0
- /package/src/util/date/{upperBoundCheck.spec.js → upperBoundCheck.spec.ts} +0 -0
- /package/src/util/{getSearchQueryPredicate.spec.js → getSearchQueryPredicate.spec.ts} +0 -0
- /package/src/util/{isValidIdentifierName.spec.js → isValidIdentifierName.spec.ts} +0 -0
- /package/src/util/{routeAppend.spec.js → routeAppend.spec.ts} +0 -0
- /package/src/widgets/drag-drop/{index.js → index.ts} +0 -0
- /package/src/widgets/form/{index.js → index.ts} +0 -0
- /package/src/widgets/icons/{index.js → index.ts} +0 -0
- /package/src/widgets/{index.js → index.ts} +0 -0
- /package/src/widgets/nav/{index.js → index.ts} +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { Widget, VDOM, getContentArray } from "../ui/Widget";
|
|
3
|
+
import { HtmlElement, HtmlElementConfig, HtmlElementInstance } from "./HtmlElement";
|
|
4
|
+
import { yesNo } from "./overlay/alerts";
|
|
5
|
+
import { Icon } from "./Icon";
|
|
6
|
+
import { preventFocus } from "../ui/FocusManager";
|
|
7
|
+
import { isFunction } from "../util/isFunction";
|
|
8
|
+
import { isDefined } from "../util/isDefined";
|
|
9
|
+
import { coalesce } from "../util/coalesce";
|
|
10
|
+
import type { RenderingContext } from "../ui/RenderingContext";
|
|
11
|
+
import type { Instance, WidgetData, RenderProps } from "../ui/Instance";
|
|
12
|
+
import { YesNoResult } from "../ui/Instance";
|
|
13
|
+
import { BooleanProp, StringProp, Prop, ModProp } from "../ui/Prop";
|
|
14
|
+
import type { FormRenderingContext } from "./form/ValidationGroup";
|
|
15
|
+
|
|
16
|
+
interface ButtonData extends WidgetData {
|
|
17
|
+
pressed?: boolean;
|
|
18
|
+
icon?: string | boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ButtonConfig extends HtmlElementConfig {
|
|
24
|
+
/** Confirmation text or configuration object. See MsgBox.yesNo for more details. */
|
|
25
|
+
confirm?: Prop<string | Record<string, unknown>>;
|
|
26
|
+
|
|
27
|
+
/** If true button appears in pressed state. Useful for implementing toggle buttons. */
|
|
28
|
+
pressed?: BooleanProp;
|
|
29
|
+
|
|
30
|
+
/** Name of the icon to be put on the left side of the button. */
|
|
31
|
+
icon?: StringProp;
|
|
32
|
+
|
|
33
|
+
/** HTML tag to be used. Default is `button`. */
|
|
34
|
+
tag?: string;
|
|
35
|
+
|
|
36
|
+
/** Base CSS class to be applied to the element. Default is 'button'. */
|
|
37
|
+
baseClass?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Determines if button should receive focus on mousedown event.
|
|
41
|
+
* Default is `false`, which means that focus can be set only using the keyboard `Tab` key.
|
|
42
|
+
*/
|
|
43
|
+
focusOnMouseDown?: boolean;
|
|
44
|
+
|
|
45
|
+
/** Add type="submit" to the button. */
|
|
46
|
+
submit?: boolean;
|
|
47
|
+
|
|
48
|
+
/** Set to `true` to disable the button. */
|
|
49
|
+
disabled?: BooleanProp;
|
|
50
|
+
|
|
51
|
+
/** Set to `false` to disable the button. */
|
|
52
|
+
enabled?: BooleanProp;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Click handler.
|
|
56
|
+
*
|
|
57
|
+
* @param e - Event.
|
|
58
|
+
* @param instance - Cx widget instance that fired the event.
|
|
59
|
+
*/
|
|
60
|
+
onClick?: string | ((e: MouseEvent, instance: Instance) => void);
|
|
61
|
+
|
|
62
|
+
onMouseDown?: string | ((e: MouseEvent, instance: Instance) => void);
|
|
63
|
+
|
|
64
|
+
/** Button type. */
|
|
65
|
+
type?: "submit" | "button";
|
|
66
|
+
|
|
67
|
+
/** If set to `true`, the Button will cause its parent Overlay (if one exists) to close. This, however, can be prevented if `onClick` explicitly returns `false`. */
|
|
68
|
+
dismiss?: boolean;
|
|
69
|
+
|
|
70
|
+
/** The form attribute specifies the form the button belongs to.
|
|
71
|
+
* The value of this attribute must be equal to the `id` attribute of a `<form>` element in the same document.
|
|
72
|
+
*/
|
|
73
|
+
form?: StringProp;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class Button extends HtmlElement<ButtonConfig, HtmlElementInstance> {
|
|
77
|
+
constructor(config?: ButtonConfig) {
|
|
78
|
+
super(config);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare icon?: boolean | string;
|
|
82
|
+
declare focusOnMouseDown?: boolean;
|
|
83
|
+
declare submit?: boolean;
|
|
84
|
+
declare dismiss?: boolean;
|
|
85
|
+
declare onMouseDown?: string | ((e: MouseEvent, instance: Instance) => void);
|
|
86
|
+
declare baseClass: string;
|
|
87
|
+
|
|
88
|
+
declareData(...args: Record<string, unknown>[]): void {
|
|
89
|
+
super.declareData(...args, {
|
|
90
|
+
confirm: { structured: true },
|
|
91
|
+
pressed: undefined,
|
|
92
|
+
icon: undefined,
|
|
93
|
+
disabled: undefined,
|
|
94
|
+
enabled: undefined,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
prepareData(context: RenderingContext, instance: HtmlElementInstance): void {
|
|
99
|
+
const { data } = instance;
|
|
100
|
+
data.stateMods = {
|
|
101
|
+
...data.stateMods,
|
|
102
|
+
pressed: data.pressed,
|
|
103
|
+
};
|
|
104
|
+
if (isDefined(data.enabled)) data.disabled = !data.enabled;
|
|
105
|
+
|
|
106
|
+
super.prepareData(context, instance);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
explore(context: FormRenderingContext, instance: HtmlElementInstance): void {
|
|
110
|
+
instance.data.parentDisabled = context.parentDisabled;
|
|
111
|
+
instance.data.parentStrict = context.parentStrict;
|
|
112
|
+
|
|
113
|
+
if (instance.cache("parentDisabled", context.parentDisabled)) instance.markShouldUpdate(context);
|
|
114
|
+
if (instance.cache("parentStrict", context.parentStrict)) instance.markShouldUpdate(context);
|
|
115
|
+
|
|
116
|
+
super.explore(context, instance);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
attachProps(context: RenderingContext, instance: HtmlElementInstance, props: RenderProps): void {
|
|
120
|
+
super.attachProps(context, instance, props);
|
|
121
|
+
|
|
122
|
+
if (!this.focusOnMouseDown) {
|
|
123
|
+
props.onMouseDown = (e: React.MouseEvent) => {
|
|
124
|
+
if (this.onMouseDown && instance.invoke("onMouseDown", e.nativeEvent, instance) === false) return;
|
|
125
|
+
preventFocus(e);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (this.dismiss) {
|
|
130
|
+
const { onClick } = props;
|
|
131
|
+
|
|
132
|
+
props.onClick = (e: React.MouseEvent) => {
|
|
133
|
+
if (onClick) {
|
|
134
|
+
const result = onClick(e);
|
|
135
|
+
if (result === false) return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (instance.parentOptions && isFunction(instance.parentOptions.dismiss)) {
|
|
139
|
+
instance.parentOptions.dismiss();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (this.tag === "button") props.type = this.submit ? "submit" : "button";
|
|
145
|
+
|
|
146
|
+
delete props.confirm;
|
|
147
|
+
delete props.dismiss;
|
|
148
|
+
delete props.pressed;
|
|
149
|
+
delete props.submit;
|
|
150
|
+
delete props.focusOnMouseDown;
|
|
151
|
+
delete props.icon;
|
|
152
|
+
delete props.enabled;
|
|
153
|
+
|
|
154
|
+
const { data } = instance;
|
|
155
|
+
|
|
156
|
+
props.disabled = coalesce(data.parentStrict ? data.parentDisabled : null, data.disabled, data.parentDisabled) as
|
|
157
|
+
| boolean
|
|
158
|
+
| undefined;
|
|
159
|
+
|
|
160
|
+
if (data.confirm) {
|
|
161
|
+
const oldOnClick = props.onClick;
|
|
162
|
+
props.onClick = (e: React.MouseEvent) => {
|
|
163
|
+
yesNo(data.confirm!).then((btn: string) => {
|
|
164
|
+
if (btn === YesNoResult.Yes && oldOnClick) {
|
|
165
|
+
oldOnClick(e);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (data.icon) {
|
|
172
|
+
const icon = Icon.render(data.icon, {
|
|
173
|
+
key: "icon",
|
|
174
|
+
className: this.CSS.element(this.baseClass, "icon"),
|
|
175
|
+
});
|
|
176
|
+
const children = getContentArray(props.children);
|
|
177
|
+
props.children = [icon, ...children];
|
|
178
|
+
props.className = this.CSS.expand(
|
|
179
|
+
props.className,
|
|
180
|
+
this.CSS.state("icon"),
|
|
181
|
+
children.length === 0 && this.CSS.state("empty"),
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
if (children.length === 0) {
|
|
185
|
+
(props.children as React.ReactNode[]).push(
|
|
186
|
+
<span key="baseline" className={this.CSS.element(this.baseClass, "baseline")}>
|
|
187
|
+
|
|
188
|
+
</span>,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
Button.prototype.tag = "button";
|
|
196
|
+
Button.prototype.baseClass = "button";
|
|
197
|
+
Button.prototype.icon = false;
|
|
198
|
+
Button.prototype.focusOnMouseDown = false;
|
|
199
|
+
Button.prototype.submit = false;
|
|
200
|
+
|
|
201
|
+
Widget.alias("button", Button);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
1
4
|
$cx-default-button-font-family: $cx-default-box-font-family !default;
|
|
2
5
|
$cx-default-button-font-size: $cx-default-box-font-size !default;
|
|
3
6
|
$cx-default-button-font-weight: normal !default;
|
|
@@ -61,9 +64,9 @@ $cx-button-mods: (
|
|
|
61
64
|
color: white,
|
|
62
65
|
),
|
|
63
66
|
disabled: (
|
|
64
|
-
background-color:
|
|
65
|
-
border-color:
|
|
66
|
-
color:
|
|
67
|
+
background-color: color.adjust(#1f99f8, $alpha: -0.5),
|
|
68
|
+
border-color: color.adjust(#1e88e5, $alpha: -0.9),
|
|
69
|
+
color: color.adjust(white, $alpha: -0.4),
|
|
67
70
|
),
|
|
68
71
|
hover: (
|
|
69
72
|
background-color: #1f99f8,
|
|
@@ -76,9 +79,9 @@ $cx-button-mods: (
|
|
|
76
79
|
color: white,
|
|
77
80
|
),
|
|
78
81
|
disabled: (
|
|
79
|
-
background-color:
|
|
80
|
-
border-color:
|
|
81
|
-
color:
|
|
82
|
+
background-color: color.adjust(#d32f2f, $alpha: -0.4),
|
|
83
|
+
border-color: color.adjust(#c62828, $alpha: -0.9),
|
|
84
|
+
color: color.adjust(white, $alpha: -0.5),
|
|
82
85
|
),
|
|
83
86
|
hover: (
|
|
84
87
|
background-color: #d32f2f,
|
|
@@ -92,16 +95,16 @@ $cx-button-mods: (
|
|
|
92
95
|
box-shadow: none,
|
|
93
96
|
),
|
|
94
97
|
hover:
|
|
95
|
-
map
|
|
96
|
-
map
|
|
98
|
+
map.merge(
|
|
99
|
+
map.get($cx-list-item, hover),
|
|
97
100
|
(
|
|
98
101
|
box-shadow: none,
|
|
99
102
|
border-color: transparent,
|
|
100
103
|
)
|
|
101
104
|
),
|
|
102
105
|
focus:
|
|
103
|
-
map
|
|
104
|
-
map
|
|
106
|
+
map.merge(
|
|
107
|
+
map.get($cx-list-item, selected-cursor),
|
|
105
108
|
(
|
|
106
109
|
box-shadow: none,
|
|
107
110
|
border-color: transparent,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
@mixin cx-cxcredit($name: "cxcredit", $besm: $cx-besm) {
|
|
2
|
-
$block: map
|
|
3
|
-
$element: map
|
|
4
|
-
$state: map
|
|
5
|
-
$mod: map
|
|
4
|
+
$block: map.get($besm, block);
|
|
5
|
+
$element: map.get($besm, element);
|
|
6
|
+
$state: map.get($besm, state);
|
|
7
|
+
$mod: map.get($besm, mod);
|
|
6
8
|
|
|
7
9
|
.#{$block}#{$name} {
|
|
8
10
|
width: 50px;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Widget, VDOM } from "../ui/Widget";
|
|
2
|
+
import { HtmlElement, HtmlElementConfig, HtmlElementInstance } from "./HtmlElement";
|
|
3
|
+
import { Icon } from "./Icon";
|
|
4
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
5
|
+
import { RenderProps } from "../ui/Instance";
|
|
6
|
+
|
|
7
|
+
export interface CxCreditConfig extends HtmlElementConfig {}
|
|
8
|
+
|
|
9
|
+
export class CxCredit extends HtmlElement<CxCreditConfig, HtmlElementInstance> {
|
|
10
|
+
declare baseClass: string;
|
|
11
|
+
|
|
12
|
+
constructor(config?: CxCreditConfig) {
|
|
13
|
+
super(config);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
init(): void {
|
|
17
|
+
this.tooltip = {
|
|
18
|
+
mouseTrap: true,
|
|
19
|
+
title: "Credits",
|
|
20
|
+
items: (
|
|
21
|
+
<cx>
|
|
22
|
+
<div ws>
|
|
23
|
+
User interface of this project is implemented using the CxJS framework. For more information about
|
|
24
|
+
CxJS, please visit
|
|
25
|
+
<a href="https://cxjs.io/" target="_blank">
|
|
26
|
+
the CxJS homepage
|
|
27
|
+
</a>
|
|
28
|
+
.
|
|
29
|
+
</div>
|
|
30
|
+
</cx>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
super.init();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
attachProps(context: RenderingContext, instance: HtmlElementInstance, props: RenderProps): void {
|
|
37
|
+
props.children = Icon.render("cx", {
|
|
38
|
+
className: this.CSS.element(this.baseClass, "icon"),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
CxCredit.prototype.baseClass = "cxcredit";
|
|
44
|
+
CxCredit.prototype.tag = "div";
|
|
45
|
+
|
|
46
|
+
Widget.alias("cx-credit", CxCredit);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Widget, WidgetConfig } from "../ui/Widget";
|
|
2
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
3
|
+
import { Instance } from "../ui/Instance";
|
|
4
|
+
import { StringProp } from "../ui/Prop";
|
|
5
|
+
|
|
6
|
+
export interface DocumentTitleConfig extends WidgetConfig {
|
|
7
|
+
/** Text value to be used for the document title. */
|
|
8
|
+
value?: StringProp;
|
|
9
|
+
|
|
10
|
+
/** Deprecated. Use `action: "append"` instead. */
|
|
11
|
+
append?: boolean;
|
|
12
|
+
|
|
13
|
+
/** How to combine the title with existing document title. Default is `append`. */
|
|
14
|
+
action?: "append" | "replace" | "prepend";
|
|
15
|
+
|
|
16
|
+
/** Separator used when appending or prepending to the title. Default is empty string. */
|
|
17
|
+
separator?: StringProp;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class DocumentTitle extends Widget<DocumentTitleConfig> {
|
|
21
|
+
declare value?: StringProp;
|
|
22
|
+
declare text?: StringProp;
|
|
23
|
+
declare append?: boolean;
|
|
24
|
+
declare action?: "append" | "replace" | "prepend";
|
|
25
|
+
declare separator?: StringProp;
|
|
26
|
+
|
|
27
|
+
constructor(config?: DocumentTitleConfig) {
|
|
28
|
+
super(config);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
init(): void {
|
|
32
|
+
if (this.value) this.text = this.value;
|
|
33
|
+
|
|
34
|
+
if (this.append) this.action = "append";
|
|
35
|
+
|
|
36
|
+
super.init();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declareData(...args: Record<string, unknown>[]): void {
|
|
40
|
+
super.declareData(...args, {
|
|
41
|
+
value: undefined,
|
|
42
|
+
text: undefined,
|
|
43
|
+
action: undefined,
|
|
44
|
+
separator: undefined,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
explore(context: RenderingContext, instance: Instance): void {
|
|
49
|
+
if (!(context as any).documentTitle) {
|
|
50
|
+
(context as any).documentTitle = {
|
|
51
|
+
activeInstance: instance,
|
|
52
|
+
title: "",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let { data } = instance;
|
|
57
|
+
|
|
58
|
+
if (data.text) {
|
|
59
|
+
switch (data.action) {
|
|
60
|
+
case "append":
|
|
61
|
+
if ((context as any).documentTitle.title) (context as any).documentTitle.title += data.separator;
|
|
62
|
+
(context as any).documentTitle.title += data.text;
|
|
63
|
+
break;
|
|
64
|
+
|
|
65
|
+
case "prepend":
|
|
66
|
+
(context as any).documentTitle.title = data.text + data.separator + (context as any).documentTitle.title;
|
|
67
|
+
break;
|
|
68
|
+
|
|
69
|
+
default:
|
|
70
|
+
case "replace":
|
|
71
|
+
(context as any).documentTitle.title = data.text;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
super.explore(context, instance);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
prepare(context: RenderingContext, instance: Instance): void {
|
|
80
|
+
if ((context as any).documentTitle.activeInstance == instance)
|
|
81
|
+
document.title = (context as any).documentTitle.title;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
render(): null {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
DocumentTitle.prototype.action = "append";
|
|
90
|
+
DocumentTitle.prototype.separator = "";
|
|
91
|
+
|
|
92
|
+
Widget.alias("document-title", DocumentTitle);
|
package/src/widgets/FlexBox.scss
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
@mixin cx-flexbox-spacing($divider, $besm: $cx-besm) {
|
|
2
|
-
$state: map
|
|
4
|
+
$state: map.get($besm, state);
|
|
3
5
|
@each $pad, $size in $cx-pad-size {
|
|
4
6
|
&.#{$state}#{$pad}-hspacing {
|
|
5
7
|
margin-left: cx-divide(-$size, $divider);
|
|
@@ -24,10 +26,10 @@
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
@mixin cx-flexbox($name: "flexbox", $besm: $cx-besm) {
|
|
27
|
-
$block: map
|
|
28
|
-
$element: map
|
|
29
|
-
$state: map
|
|
30
|
-
$mod: map
|
|
29
|
+
$block: map.get($besm, block);
|
|
30
|
+
$element: map.get($besm, element);
|
|
31
|
+
$state: map.get($besm, state);
|
|
32
|
+
$mod: map.get($besm, mod);
|
|
31
33
|
|
|
32
34
|
.#{$block}#{$name} {
|
|
33
35
|
box-sizing: border-box;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { VDOM } from "../ui/Widget";
|
|
3
|
+
import { ContainerBase, StyledContainerConfig } from "../ui/Container";
|
|
4
|
+
import { isUndefined } from "../util/isUndefined";
|
|
5
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
6
|
+
import { Instance } from "../ui/Instance";
|
|
7
|
+
|
|
8
|
+
export interface FlexBoxConfig extends StyledContainerConfig {
|
|
9
|
+
/** Base CSS class. Default is `flexbox`. */
|
|
10
|
+
baseClass?: string;
|
|
11
|
+
|
|
12
|
+
/** Flex direction. Default is `row`. */
|
|
13
|
+
direction?: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Add 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
|
+
spacing?: string | boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Add horizontal spacing between items by applying a margin to children.
|
|
24
|
+
* Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
25
|
+
* Value `true` is equivalent to `medium`.
|
|
26
|
+
*/
|
|
27
|
+
hspacing?: boolean | string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Add vertical spacing between items by applying a margin to children.
|
|
31
|
+
* Allowed values are xsmall, small, medium, large and xlarge.
|
|
32
|
+
* Value true is equivalent to medium.
|
|
33
|
+
*/
|
|
34
|
+
vspacing?: boolean | string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Add padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
38
|
+
* Value `true` is equivalent to `medium`.
|
|
39
|
+
*/
|
|
40
|
+
pad?: boolean | string;
|
|
41
|
+
padding?: boolean | string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Add horizontal padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
45
|
+
* Value `true` is equivalent to `medium`.
|
|
46
|
+
*/
|
|
47
|
+
hpad?: boolean | string;
|
|
48
|
+
hpadding?: boolean | string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Add vertical padding to the box. Allowed values are `xsmall`, `small`, `medium`, `large` and `xlarge`.
|
|
52
|
+
* Value `true` is equivalent to `medium`.
|
|
53
|
+
*/
|
|
54
|
+
vpad?: boolean | string;
|
|
55
|
+
vpadding?: boolean | string;
|
|
56
|
+
|
|
57
|
+
wrap?: boolean;
|
|
58
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch" | false;
|
|
59
|
+
justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | false;
|
|
60
|
+
target?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Set to true to add overflow styles required for deeply nested flexbox calculations.
|
|
64
|
+
*/
|
|
65
|
+
nested?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class FlexBox extends ContainerBase<FlexBoxConfig, Instance> {
|
|
69
|
+
declare padding?: boolean | string;
|
|
70
|
+
declare hpadding?: boolean | string;
|
|
71
|
+
declare vpadding?: boolean | string;
|
|
72
|
+
declare spacing?: string | boolean;
|
|
73
|
+
declare hspacing?: boolean | string;
|
|
74
|
+
declare vspacing?: boolean | string;
|
|
75
|
+
declare pad?: boolean | string;
|
|
76
|
+
declare hpad?: boolean | string;
|
|
77
|
+
declare vpad?: boolean | string;
|
|
78
|
+
declare wrap?: boolean;
|
|
79
|
+
declare align?: "start" | "center" | "end" | "baseline" | "stretch" | false;
|
|
80
|
+
declare justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | false;
|
|
81
|
+
declare target?: string;
|
|
82
|
+
declare nested?: boolean;
|
|
83
|
+
declare direction?: string;
|
|
84
|
+
|
|
85
|
+
constructor(config?: FlexBoxConfig) {
|
|
86
|
+
super(config);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
init(): void {
|
|
90
|
+
if (this.padding) this.pad = this.padding;
|
|
91
|
+
|
|
92
|
+
if (this.hpadding) this.hpad = this.hpadding;
|
|
93
|
+
|
|
94
|
+
if (this.vpadding) this.vpad = this.vpadding;
|
|
95
|
+
|
|
96
|
+
this.hpad = isUndefined(this.hpad) ? this.pad : this.hpad;
|
|
97
|
+
this.vpad = isUndefined(this.vpad) ? this.pad : this.hpad;
|
|
98
|
+
|
|
99
|
+
if (this.hpad === true) this.hpad = "medium";
|
|
100
|
+
|
|
101
|
+
if (this.vpad === true) this.vpad = "medium";
|
|
102
|
+
|
|
103
|
+
this.hspacing = isUndefined(this.hspacing) ? this.spacing : this.hspacing;
|
|
104
|
+
this.vspacing = isUndefined(this.vspacing) ? this.spacing : this.vspacing;
|
|
105
|
+
|
|
106
|
+
if (this.hspacing === true) this.hspacing = "medium";
|
|
107
|
+
|
|
108
|
+
if (this.vspacing === true) this.vspacing = "medium";
|
|
109
|
+
|
|
110
|
+
super.init();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
initInstance(context: RenderingContext, instance: Instance): void {
|
|
114
|
+
(instance as any).eventHandlers = instance.getJsxEventProps();
|
|
115
|
+
super.initInstance(context, instance);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
prepareCSS(context: RenderingContext, instance: Instance): void {
|
|
119
|
+
let { data } = instance;
|
|
120
|
+
data.stateMods = {
|
|
121
|
+
...data.stateMods,
|
|
122
|
+
[this.hpad + "-hpad"]: this.hpad,
|
|
123
|
+
[this.vpad + "-vpad"]: this.vpad,
|
|
124
|
+
nested: this.nested,
|
|
125
|
+
};
|
|
126
|
+
super.prepareCSS(context, instance);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
render(context: RenderingContext, instance: Instance, key: string): React.ReactNode {
|
|
130
|
+
let { data } = instance;
|
|
131
|
+
let eventHandlers = (instance as any).eventHandlers;
|
|
132
|
+
let { CSS, baseClass } = this;
|
|
133
|
+
let flexboxMods = {
|
|
134
|
+
[this.hspacing + "-hspacing"]: this.hspacing,
|
|
135
|
+
[this.vspacing + "-vspacing"]: this.vspacing,
|
|
136
|
+
["align-" + this.align]: this.align,
|
|
137
|
+
["justify-" + this.justify]: this.justify,
|
|
138
|
+
wrap: this.wrap,
|
|
139
|
+
["target-" + this.target]: true,
|
|
140
|
+
[this.direction!]: true,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div key={key} className={data.classNames as string} style={data.style as any} {...eventHandlers}>
|
|
145
|
+
<div className={CSS.element(baseClass!, "flexbox", flexboxMods)}>{this.renderChildren(context, instance)}</div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
FlexBox.prototype.baseClass = "flexbox";
|
|
152
|
+
FlexBox.prototype.styled = true;
|
|
153
|
+
FlexBox.prototype.direction = 'row';
|
|
154
|
+
FlexBox.prototype.spacing = false;
|
|
155
|
+
FlexBox.prototype.hspacing = undefined;
|
|
156
|
+
FlexBox.prototype.vspacing = undefined;
|
|
157
|
+
FlexBox.prototype.pad = false;
|
|
158
|
+
FlexBox.prototype.hpad = undefined;
|
|
159
|
+
FlexBox.prototype.vpad = undefined;
|
|
160
|
+
FlexBox.prototype.wrap = false;
|
|
161
|
+
FlexBox.prototype.align = false;
|
|
162
|
+
FlexBox.prototype.justify = false;
|
|
163
|
+
FlexBox.prototype.target = 'any';
|
|
164
|
+
FlexBox.prototype.nested = false;
|
|
165
|
+
|
|
166
|
+
export class FlexRow extends FlexBox {}
|
|
167
|
+
|
|
168
|
+
export class FlexCol extends FlexBox {}
|
|
169
|
+
FlexCol.prototype.direction = 'column';
|
package/src/widgets/Heading.scss
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
@mixin cxb-heading($name: "heading", $besm: $cx-besm) {
|
|
2
|
-
$block: map
|
|
3
|
-
$element: map
|
|
4
|
-
$state: map
|
|
5
|
-
$mod: map
|
|
4
|
+
$block: map.get($besm, block);
|
|
5
|
+
$element: map.get($besm, element);
|
|
6
|
+
$state: map.get($besm, state);
|
|
7
|
+
$mod: map.get($besm, mod);
|
|
6
8
|
|
|
7
9
|
.#{$block}#{$name} {
|
|
8
10
|
@include cx-add-rules($cx-caption-style-map);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HtmlElement, HtmlElementConfig, HtmlElementInstance } from "./HtmlElement";
|
|
2
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
3
|
+
|
|
4
|
+
export interface HeadingConfig extends HtmlElementConfig {
|
|
5
|
+
/** Name of the HTML element to be rendered. Default is `div`. */
|
|
6
|
+
tag?: string;
|
|
7
|
+
|
|
8
|
+
/** Heading level. Allowed values go from 1 to 6. Default is 3. */
|
|
9
|
+
level?: number | string;
|
|
10
|
+
|
|
11
|
+
/** Base CSS class. Default is `heading`. */
|
|
12
|
+
baseClass?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class Heading extends HtmlElement<HeadingConfig, HtmlElementInstance> {
|
|
16
|
+
declare level?: number | string;
|
|
17
|
+
|
|
18
|
+
init(): void {
|
|
19
|
+
this.tag = `h${this.level}`;
|
|
20
|
+
super.init();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
prepareData(context: RenderingContext, instance: HtmlElementInstance): void {
|
|
24
|
+
let { data } = instance;
|
|
25
|
+
data.stateMods = {
|
|
26
|
+
...data.stateMods,
|
|
27
|
+
[`level-${this.level}`]: true,
|
|
28
|
+
};
|
|
29
|
+
super.prepareData(context, instance);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
isValidHtmlAttribute(attrName: string): string | false {
|
|
33
|
+
switch (attrName) {
|
|
34
|
+
case "level":
|
|
35
|
+
return false;
|
|
36
|
+
|
|
37
|
+
default: return super.isValidHtmlAttribute(attrName);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Heading.prototype.level = 3;
|
|
43
|
+
Heading.prototype.baseClass = "heading";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
@mixin cxb-highlightedsearchtext(
|
|
2
4
|
$name: "highlightedsearchtext",
|
|
3
5
|
$styles: $cx-highlightedsearchtext-style-map,
|
|
4
6
|
$besm: $cx-besm
|
|
5
7
|
) {
|
|
6
|
-
$block: map
|
|
7
|
-
$element: map
|
|
8
|
-
$state: map
|
|
9
|
-
$mod: map
|
|
8
|
+
$block: map.get($besm, block);
|
|
9
|
+
$element: map.get($besm, element);
|
|
10
|
+
$state: map.get($besm, state);
|
|
11
|
+
$mod: map.get($besm, mod);
|
|
10
12
|
|
|
11
13
|
.#{$block}#{$name} {
|
|
12
14
|
@include cx-add-rules($styles);
|