@antv/component 2.1.1-alpha.1 → 2.1.1-alpha.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/dist/component.min.js +1 -1
- package/esm/animation/fadeIn.d.ts +1 -1
- package/esm/animation/fadeOut.d.ts +1 -1
- package/esm/animation/utils.d.ts +3 -3
- package/esm/animation/utils.js +37 -31
- package/esm/animation/utils.js.map +1 -1
- package/esm/constant.js +1 -1
- package/esm/constant.js.map +1 -1
- package/esm/core/component.js +43 -30
- package/esm/core/component.js.map +1 -1
- package/esm/shapes/Text.js +21 -13
- package/esm/shapes/Text.js.map +1 -1
- package/esm/ui/axis/axis.d.ts +1 -1
- package/esm/ui/axis/axis.js +31 -25
- package/esm/ui/axis/axis.js.map +1 -1
- package/esm/ui/axis/constant.js +13 -11
- package/esm/ui/axis/constant.js.map +1 -1
- package/esm/ui/axis/guides/grid.d.ts +1 -1
- package/esm/ui/axis/guides/grid.js +34 -29
- package/esm/ui/axis/guides/grid.js.map +1 -1
- package/esm/ui/axis/guides/labels.js +83 -76
- package/esm/ui/axis/guides/labels.js.map +1 -1
- package/esm/ui/axis/guides/line.js +87 -74
- package/esm/ui/axis/guides/line.js.map +1 -1
- package/esm/ui/axis/guides/ticks.d.ts +1 -1
- package/esm/ui/axis/guides/ticks.js +39 -31
- package/esm/ui/axis/guides/ticks.js.map +1 -1
- package/esm/ui/axis/guides/title.d.ts +1 -1
- package/esm/ui/axis/guides/title.js +37 -33
- package/esm/ui/axis/guides/title.js.map +1 -1
- package/esm/ui/axis/guides/utils.js +12 -10
- package/esm/ui/axis/guides/utils.js.map +1 -1
- package/esm/ui/axis/overlap/autoEllipsis.js +19 -12
- package/esm/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/esm/ui/axis/overlap/autoHide.js +24 -20
- package/esm/ui/axis/overlap/autoHide.js.map +1 -1
- package/esm/ui/axis/overlap/autoRotate.js +25 -11
- package/esm/ui/axis/overlap/autoRotate.js.map +1 -1
- package/esm/ui/axis/overlap/autoWrap.js +14 -11
- package/esm/ui/axis/overlap/autoWrap.js.map +1 -1
- package/esm/ui/axis/overlap/index.js +7 -7
- package/esm/ui/axis/overlap/index.js.map +1 -1
- package/esm/ui/axis/utils/bounds.js +75 -48
- package/esm/ui/axis/utils/bounds.js.map +1 -1
- package/esm/ui/axis/utils/contain.js +14 -14
- package/esm/ui/axis/utils/contain.js.map +1 -1
- package/esm/ui/axis/utils/index.js +7 -3
- package/esm/ui/axis/utils/index.js.map +1 -1
- package/esm/ui/axis/utils/intersect.js +33 -21
- package/esm/ui/axis/utils/intersect.js.map +1 -1
- package/esm/ui/axis/utils/test.js +41 -29
- package/esm/ui/axis/utils/test.js.map +1 -1
- package/esm/ui/breadcrumb/index.js +72 -64
- package/esm/ui/breadcrumb/index.js.map +1 -1
- package/esm/ui/button/constant.js +3 -3
- package/esm/ui/button/constant.js.map +1 -1
- package/esm/ui/button/index.js +97 -81
- package/esm/ui/button/index.js.map +1 -1
- package/esm/ui/checkbox/constant.js +4 -4
- package/esm/ui/checkbox/constant.js.map +1 -1
- package/esm/ui/checkbox/index.js +26 -23
- package/esm/ui/checkbox/index.js.map +1 -1
- package/esm/ui/crosshair/base.js +45 -29
- package/esm/ui/crosshair/base.js.map +1 -1
- package/esm/ui/crosshair/circle.js +34 -25
- package/esm/ui/crosshair/circle.js.map +1 -1
- package/esm/ui/crosshair/constant.js +4 -4
- package/esm/ui/crosshair/constant.js.map +1 -1
- package/esm/ui/crosshair/line.js +75 -55
- package/esm/ui/crosshair/line.js.map +1 -1
- package/esm/ui/crosshair/polygon.js +70 -54
- package/esm/ui/crosshair/polygon.js.map +1 -1
- package/esm/ui/grid/index.d.ts +1 -1
- package/esm/ui/grid/index.js +95 -73
- package/esm/ui/grid/index.js.map +1 -1
- package/esm/ui/indicator/constant.js +2 -2
- package/esm/ui/indicator/constant.js.map +1 -1
- package/esm/ui/indicator/indicator.js +63 -58
- package/esm/ui/indicator/indicator.js.map +1 -1
- package/esm/ui/layout/layout.js +66 -52
- package/esm/ui/layout/layout.js.map +1 -1
- package/esm/ui/legend/base.js +13 -12
- package/esm/ui/legend/base.js.map +1 -1
- package/esm/ui/legend/category/item.js +156 -122
- package/esm/ui/legend/category/item.js.map +1 -1
- package/esm/ui/legend/category/items.js +201 -158
- package/esm/ui/legend/category/items.js.map +1 -1
- package/esm/ui/legend/category.js +56 -46
- package/esm/ui/legend/category.js.map +1 -1
- package/esm/ui/legend/constant.js +6 -6
- package/esm/ui/legend/constant.js.map +1 -1
- package/esm/ui/legend/continuous/handle.js +33 -28
- package/esm/ui/legend/continuous/handle.js.map +1 -1
- package/esm/ui/legend/continuous/ribbon.js +38 -34
- package/esm/ui/legend/continuous/ribbon.js.map +1 -1
- package/esm/ui/legend/continuous/utils.js +11 -10
- package/esm/ui/legend/continuous/utils.js.map +1 -1
- package/esm/ui/legend/continuous.js +521 -417
- package/esm/ui/legend/continuous.js.map +1 -1
- package/esm/ui/legend/utils.js +31 -24
- package/esm/ui/legend/utils.js.map +1 -1
- package/esm/ui/marker/index.js +44 -38
- package/esm/ui/marker/index.js.map +1 -1
- package/esm/ui/marker/symbol.js +24 -24
- package/esm/ui/marker/symbol.js.map +1 -1
- package/esm/ui/marker/utils.js +2 -2
- package/esm/ui/marker/utils.js.map +1 -1
- package/esm/ui/navigator/index.js +159 -128
- package/esm/ui/navigator/index.js.map +1 -1
- package/esm/ui/poptip/constant.js +68 -67
- package/esm/ui/poptip/constant.js.map +1 -1
- package/esm/ui/poptip/index.js +111 -95
- package/esm/ui/poptip/index.js.map +1 -1
- package/esm/ui/poptip/utils.js +15 -8
- package/esm/ui/poptip/utils.js.map +1 -1
- package/esm/ui/scrollbar/index.js +132 -102
- package/esm/ui/scrollbar/index.js.map +1 -1
- package/esm/ui/select/option.js +58 -48
- package/esm/ui/select/option.js.map +1 -1
- package/esm/ui/select/select.js +164 -142
- package/esm/ui/select/select.js.map +1 -1
- package/esm/ui/slider/constant.js +4 -4
- package/esm/ui/slider/constant.js.map +1 -1
- package/esm/ui/slider/handle.js +54 -46
- package/esm/ui/slider/handle.js.map +1 -1
- package/esm/ui/slider/index.js +326 -280
- package/esm/ui/slider/index.js.map +1 -1
- package/esm/ui/sparkline/columns.js +34 -25
- package/esm/ui/sparkline/columns.js.map +1 -1
- package/esm/ui/sparkline/index.js +180 -145
- package/esm/ui/sparkline/index.js.map +1 -1
- package/esm/ui/sparkline/lines.js +50 -37
- package/esm/ui/sparkline/lines.js.map +1 -1
- package/esm/ui/sparkline/path.js +40 -36
- package/esm/ui/sparkline/path.js.map +1 -1
- package/esm/ui/sparkline/utils.js +9 -8
- package/esm/ui/sparkline/utils.js.map +1 -1
- package/esm/ui/switch/constant.js +1 -1
- package/esm/ui/switch/constant.js.map +1 -1
- package/esm/ui/switch/index.js +54 -44
- package/esm/ui/switch/index.js.map +1 -1
- package/esm/ui/tag/index.js +32 -29
- package/esm/ui/tag/index.js.map +1 -1
- package/esm/ui/timebar/controller.js +79 -69
- package/esm/ui/timebar/controller.js.map +1 -1
- package/esm/ui/timebar/handle.js +71 -62
- package/esm/ui/timebar/handle.js.map +1 -1
- package/esm/ui/timebar/icons.js +478 -308
- package/esm/ui/timebar/icons.js.map +1 -1
- package/esm/ui/timebar/timebar.js +318 -263
- package/esm/ui/timebar/timebar.js.map +1 -1
- package/esm/ui/timebar/utils.js +7 -7
- package/esm/ui/timebar/utils.js.map +1 -1
- package/esm/ui/timeline/index.js +6 -2
- package/esm/ui/timeline/index.js.map +1 -1
- package/esm/ui/title/index.js +64 -59
- package/esm/ui/title/index.js.map +1 -1
- package/esm/ui/tooltip/constant.js +30 -26
- package/esm/ui/tooltip/constant.js.map +1 -1
- package/esm/ui/tooltip/index.js +126 -109
- package/esm/ui/tooltip/index.js.map +1 -1
- package/esm/util/bbox.js +47 -24
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/callback.js +2 -1
- package/esm/util/callback.js.map +1 -1
- package/esm/util/classnames.js +10 -8
- package/esm/util/classnames.js.map +1 -1
- package/esm/util/deep-assign.js +14 -6
- package/esm/util/deep-assign.js.map +1 -1
- package/esm/util/defined.js +1 -1
- package/esm/util/defined.js.map +1 -1
- package/esm/util/ellipsis.js +2 -1
- package/esm/util/ellipsis.js.map +1 -1
- package/esm/util/event.js +3 -3
- package/esm/util/event.js.map +1 -1
- package/esm/util/geometry/line-length.js +4 -1
- package/esm/util/geometry/line-length.js.map +1 -1
- package/esm/util/geometry/lines-intersection.js +10 -5
- package/esm/util/geometry/lines-intersection.js.map +1 -1
- package/esm/util/group-by.js +1 -1
- package/esm/util/group-by.js.map +1 -1
- package/esm/util/group.js +3 -3
- package/esm/util/group.js.map +1 -1
- package/esm/util/html.js +1 -1
- package/esm/util/html.js.map +1 -1
- package/esm/util/if-show.js +5 -3
- package/esm/util/if-show.js.map +1 -1
- package/esm/util/in-range.js +3 -1
- package/esm/util/in-range.js.map +1 -1
- package/esm/util/interpolate.js +19 -12
- package/esm/util/interpolate.js.map +1 -1
- package/esm/util/keyframe-interpolate.d.ts +1 -1
- package/esm/util/keyframe-interpolate.js +7 -6
- package/esm/util/keyframe-interpolate.js.map +1 -1
- package/esm/util/layout/executer.js +4 -4
- package/esm/util/layout/executer.js.map +1 -1
- package/esm/util/layout/flex/index.js +26 -24
- package/esm/util/layout/flex/index.js.map +1 -1
- package/esm/util/layout/grid/index.js +1 -1
- package/esm/util/layout/grid/index.js.map +1 -1
- package/esm/util/layout/utils/helper.js +8 -7
- package/esm/util/layout/utils/helper.js.map +1 -1
- package/esm/util/matrix.js +8 -7
- package/esm/util/matrix.js.map +1 -1
- package/esm/util/number.js +7 -6
- package/esm/util/number.js.map +1 -1
- package/esm/util/offscreen.js +17 -9
- package/esm/util/offscreen.js.map +1 -1
- package/esm/util/omit.js +3 -3
- package/esm/util/omit.js.map +1 -1
- package/esm/util/path.js +41 -36
- package/esm/util/path.js.map +1 -1
- package/esm/util/primitive.js +3 -3
- package/esm/util/primitive.js.map +1 -1
- package/esm/util/replace-children.js +4 -3
- package/esm/util/replace-children.js.map +1 -1
- package/esm/util/sampling.js +3 -3
- package/esm/util/sampling.js.map +1 -1
- package/esm/util/scale-to-pixel.js +5 -4
- package/esm/util/scale-to-pixel.js.map +1 -1
- package/esm/util/selection.js +186 -142
- package/esm/util/selection.js.map +1 -1
- package/esm/util/series.js +1 -1
- package/esm/util/series.js.map +1 -1
- package/esm/util/shape.js +27 -15
- package/esm/util/shape.js.map +1 -1
- package/esm/util/string.js +5 -4
- package/esm/util/string.js.map +1 -1
- package/esm/util/style.js +29 -23
- package/esm/util/style.js.map +1 -1
- package/esm/util/svg2marker.js +16 -13
- package/esm/util/svg2marker.js.map +1 -1
- package/esm/util/text.js +14 -14
- package/esm/util/text.js.map +1 -1
- package/esm/util/throttle.js +13 -7
- package/esm/util/throttle.js.map +1 -1
- package/esm/util/time.js +24 -22
- package/esm/util/time.js.map +1 -1
- package/esm/util/timer.js +9 -5
- package/esm/util/timer.js.map +1 -1
- package/esm/util/transform.js +6 -5
- package/esm/util/transform.js.map +1 -1
- package/esm/util/transpose.js +1 -1
- package/esm/util/transpose.js.map +1 -1
- package/esm/util/traverse.js +1 -1
- package/esm/util/traverse.js.map +1 -1
- package/esm/util/visibility.js +2 -2
- package/esm/util/visibility.js.map +1 -1
- package/esm/util/wrap.js +4 -2
- package/esm/util/wrap.js.map +1 -1
- package/lib/animation/fadeIn.d.ts +1 -1
- package/lib/animation/fadeIn.js +1 -1
- package/lib/animation/fadeIn.js.map +1 -1
- package/lib/animation/fadeOut.d.ts +1 -1
- package/lib/animation/fadeOut.js +1 -1
- package/lib/animation/fadeOut.js.map +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/animation/utils.d.ts +3 -3
- package/lib/animation/utils.js +39 -33
- package/lib/animation/utils.js.map +1 -1
- package/lib/core/component.js +43 -31
- package/lib/core/component.js.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/shapes/Text.js +22 -15
- package/lib/shapes/Text.js.map +1 -1
- package/lib/shapes/index.js +1 -1
- package/lib/types/index.js +1 -1
- package/lib/ui/axis/axis.d.ts +1 -1
- package/lib/ui/axis/axis.js +39 -34
- package/lib/ui/axis/axis.js.map +1 -1
- package/lib/ui/axis/constant.js +12 -10
- package/lib/ui/axis/constant.js.map +1 -1
- package/lib/ui/axis/guides/grid.d.ts +1 -1
- package/lib/ui/axis/guides/grid.js +40 -35
- package/lib/ui/axis/guides/grid.js.map +1 -1
- package/lib/ui/axis/guides/labels.js +89 -82
- package/lib/ui/axis/guides/labels.js.map +1 -1
- package/lib/ui/axis/guides/line.js +92 -79
- package/lib/ui/axis/guides/line.js.map +1 -1
- package/lib/ui/axis/guides/ticks.d.ts +1 -1
- package/lib/ui/axis/guides/ticks.js +45 -37
- package/lib/ui/axis/guides/ticks.js.map +1 -1
- package/lib/ui/axis/guides/title.d.ts +1 -1
- package/lib/ui/axis/guides/title.js +41 -37
- package/lib/ui/axis/guides/title.js.map +1 -1
- package/lib/ui/axis/guides/utils.js +14 -12
- package/lib/ui/axis/guides/utils.js.map +1 -1
- package/lib/ui/axis/overlap/autoEllipsis.js +22 -15
- package/lib/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/lib/ui/axis/overlap/autoHide.js +27 -23
- package/lib/ui/axis/overlap/autoHide.js.map +1 -1
- package/lib/ui/axis/overlap/autoRotate.js +26 -12
- package/lib/ui/axis/overlap/autoRotate.js.map +1 -1
- package/lib/ui/axis/overlap/autoWrap.js +16 -13
- package/lib/ui/axis/overlap/autoWrap.js.map +1 -1
- package/lib/ui/axis/overlap/index.js +12 -12
- package/lib/ui/axis/overlap/index.js.map +1 -1
- package/lib/ui/axis/utils/bounds.js +75 -49
- package/lib/ui/axis/utils/bounds.js.map +1 -1
- package/lib/ui/axis/utils/contain.js +15 -15
- package/lib/ui/axis/utils/contain.js.map +1 -1
- package/lib/ui/axis/utils/index.js +8 -4
- package/lib/ui/axis/utils/index.js.map +1 -1
- package/lib/ui/axis/utils/intersect.js +34 -22
- package/lib/ui/axis/utils/intersect.js.map +1 -1
- package/lib/ui/axis/utils/test.js +47 -35
- package/lib/ui/axis/utils/test.js.map +1 -1
- package/lib/ui/breadcrumb/index.js +77 -70
- package/lib/ui/breadcrumb/index.js.map +1 -1
- package/lib/ui/button/index.js +101 -86
- package/lib/ui/button/index.js.map +1 -1
- package/lib/ui/checkbox/constant.js +2 -2
- package/lib/ui/checkbox/constant.js.map +1 -1
- package/lib/ui/checkbox/index.js +28 -26
- package/lib/ui/checkbox/index.js.map +1 -1
- package/lib/ui/crosshair/base.js +48 -33
- package/lib/ui/crosshair/base.js.map +1 -1
- package/lib/ui/crosshair/circle.js +37 -29
- package/lib/ui/crosshair/circle.js.map +1 -1
- package/lib/ui/crosshair/constant.js +1 -1
- package/lib/ui/crosshair/constant.js.map +1 -1
- package/lib/ui/crosshair/index.js +1 -1
- package/lib/ui/crosshair/line.js +77 -58
- package/lib/ui/crosshair/line.js.map +1 -1
- package/lib/ui/crosshair/polygon.js +72 -57
- package/lib/ui/crosshair/polygon.js.map +1 -1
- package/lib/ui/grid/index.d.ts +1 -1
- package/lib/ui/grid/index.js +97 -76
- package/lib/ui/grid/index.js.map +1 -1
- package/lib/ui/indicator/constant.js +1 -1
- package/lib/ui/indicator/constant.js.map +1 -1
- package/lib/ui/indicator/index.js +1 -1
- package/lib/ui/indicator/indicator.js +67 -63
- package/lib/ui/indicator/indicator.js.map +1 -1
- package/lib/ui/layout/layout.js +70 -57
- package/lib/ui/layout/layout.js.map +1 -1
- package/lib/ui/legend/base.js +15 -14
- package/lib/ui/legend/base.js.map +1 -1
- package/lib/ui/legend/category/item.js +159 -126
- package/lib/ui/legend/category/item.js.map +1 -1
- package/lib/ui/legend/category/items.js +208 -166
- package/lib/ui/legend/category/items.js.map +1 -1
- package/lib/ui/legend/category.js +60 -51
- package/lib/ui/legend/category.js.map +1 -1
- package/lib/ui/legend/constant.js +2 -2
- package/lib/ui/legend/constant.js.map +1 -1
- package/lib/ui/legend/continuous/handle.js +35 -31
- package/lib/ui/legend/continuous/handle.js.map +1 -1
- package/lib/ui/legend/continuous/ribbon.js +43 -40
- package/lib/ui/legend/continuous/ribbon.js.map +1 -1
- package/lib/ui/legend/continuous/utils.js +11 -10
- package/lib/ui/legend/continuous/utils.js.map +1 -1
- package/lib/ui/legend/continuous.js +535 -432
- package/lib/ui/legend/continuous.js.map +1 -1
- package/lib/ui/legend/index.js +2 -2
- package/lib/ui/legend/index.js.map +1 -1
- package/lib/ui/legend/utils.js +32 -25
- package/lib/ui/legend/utils.js.map +1 -1
- package/lib/ui/marker/index.js +48 -43
- package/lib/ui/marker/index.js.map +1 -1
- package/lib/ui/marker/symbol.js +22 -22
- package/lib/ui/marker/symbol.js.map +1 -1
- package/lib/ui/marker/utils.js +3 -3
- package/lib/ui/marker/utils.js.map +1 -1
- package/lib/ui/navigator/index.js +165 -135
- package/lib/ui/navigator/index.js.map +1 -1
- package/lib/ui/poptip/constant.js +66 -65
- package/lib/ui/poptip/constant.js.map +1 -1
- package/lib/ui/poptip/index.js +115 -100
- package/lib/ui/poptip/index.js.map +1 -1
- package/lib/ui/poptip/utils.js +15 -8
- package/lib/ui/poptip/utils.js.map +1 -1
- package/lib/ui/scrollbar/index.js +136 -107
- package/lib/ui/scrollbar/index.js.map +1 -1
- package/lib/ui/select/option.js +61 -52
- package/lib/ui/select/option.js.map +1 -1
- package/lib/ui/select/select.js +169 -148
- package/lib/ui/select/select.js.map +1 -1
- package/lib/ui/slider/constant.js +1 -1
- package/lib/ui/slider/constant.js.map +1 -1
- package/lib/ui/slider/handle.js +56 -49
- package/lib/ui/slider/handle.js.map +1 -1
- package/lib/ui/slider/index.js +334 -289
- package/lib/ui/slider/index.js.map +1 -1
- package/lib/ui/sparkline/columns.js +36 -28
- package/lib/ui/sparkline/columns.js.map +1 -1
- package/lib/ui/sparkline/index.js +187 -153
- package/lib/ui/sparkline/index.js.map +1 -1
- package/lib/ui/sparkline/lines.js +52 -40
- package/lib/ui/sparkline/lines.js.map +1 -1
- package/lib/ui/sparkline/path.js +42 -38
- package/lib/ui/sparkline/path.js.map +1 -1
- package/lib/ui/sparkline/utils.js +10 -9
- package/lib/ui/sparkline/utils.js.map +1 -1
- package/lib/ui/switch/index.js +58 -49
- package/lib/ui/switch/index.js.map +1 -1
- package/lib/ui/tag/index.js +36 -34
- package/lib/ui/tag/index.js.map +1 -1
- package/lib/ui/timebar/controller.js +82 -73
- package/lib/ui/timebar/controller.js.map +1 -1
- package/lib/ui/timebar/handle.js +74 -67
- package/lib/ui/timebar/handle.js.map +1 -1
- package/lib/ui/timebar/icons.js +466 -312
- package/lib/ui/timebar/icons.js.map +1 -1
- package/lib/ui/timebar/timebar.js +326 -272
- package/lib/ui/timebar/timebar.js.map +1 -1
- package/lib/ui/timebar/utils.js +8 -8
- package/lib/ui/timebar/utils.js.map +1 -1
- package/lib/ui/timeline/index.js +5 -2
- package/lib/ui/timeline/index.js.map +1 -1
- package/lib/ui/title/index.js +65 -61
- package/lib/ui/title/index.js.map +1 -1
- package/lib/ui/tooltip/constant.js +30 -26
- package/lib/ui/tooltip/constant.js.map +1 -1
- package/lib/ui/tooltip/index.js +129 -113
- package/lib/ui/tooltip/index.js.map +1 -1
- package/lib/util/bbox.js +46 -24
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/callback.js +3 -2
- package/lib/util/callback.js.map +1 -1
- package/lib/util/classnames.js +10 -8
- package/lib/util/classnames.js.map +1 -1
- package/lib/util/deep-assign.js +15 -7
- package/lib/util/deep-assign.js.map +1 -1
- package/lib/util/defined.js +1 -1
- package/lib/util/defined.js.map +1 -1
- package/lib/util/ellipsis.js +3 -2
- package/lib/util/ellipsis.js.map +1 -1
- package/lib/util/event.js +3 -3
- package/lib/util/event.js.map +1 -1
- package/lib/util/extend-display-object.js +2 -2
- package/lib/util/extend-display-object.js.map +1 -1
- package/lib/util/geometry/index.js +1 -1
- package/lib/util/geometry/line-length.js +4 -1
- package/lib/util/geometry/line-length.js.map +1 -1
- package/lib/util/geometry/lines-intersection.js +10 -5
- package/lib/util/geometry/lines-intersection.js.map +1 -1
- package/lib/util/group-by.js +1 -1
- package/lib/util/group-by.js.map +1 -1
- package/lib/util/group.js +3 -3
- package/lib/util/group.js.map +1 -1
- package/lib/util/html.js +1 -1
- package/lib/util/html.js.map +1 -1
- package/lib/util/if-show.js +5 -3
- package/lib/util/if-show.js.map +1 -1
- package/lib/util/in-range.js +3 -1
- package/lib/util/in-range.js.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/interpolate.js +19 -12
- package/lib/util/interpolate.js.map +1 -1
- package/lib/util/keyframe-interpolate.d.ts +1 -1
- package/lib/util/keyframe-interpolate.js +8 -7
- package/lib/util/keyframe-interpolate.js.map +1 -1
- package/lib/util/layout/executer.js +6 -6
- package/lib/util/layout/executer.js.map +1 -1
- package/lib/util/layout/flex/index.js +28 -26
- package/lib/util/layout/flex/index.js.map +1 -1
- package/lib/util/layout/grid/index.js +1 -1
- package/lib/util/layout/grid/index.js.map +1 -1
- package/lib/util/layout/index.js +1 -1
- package/lib/util/layout/utils/helper.js +9 -8
- package/lib/util/layout/utils/helper.js.map +1 -1
- package/lib/util/matrix.js +8 -7
- package/lib/util/matrix.js.map +1 -1
- package/lib/util/number.js +7 -6
- package/lib/util/number.js.map +1 -1
- package/lib/util/offscreen.js +20 -12
- package/lib/util/offscreen.js.map +1 -1
- package/lib/util/omit.js +3 -3
- package/lib/util/omit.js.map +1 -1
- package/lib/util/path.js +42 -37
- package/lib/util/path.js.map +1 -1
- package/lib/util/primitive.js +2 -2
- package/lib/util/primitive.js.map +1 -1
- package/lib/util/replace-children.js +4 -3
- package/lib/util/replace-children.js.map +1 -1
- package/lib/util/sampling.js +3 -3
- package/lib/util/sampling.js.map +1 -1
- package/lib/util/scale-to-pixel.js +5 -4
- package/lib/util/scale-to-pixel.js.map +1 -1
- package/lib/util/selection.js +187 -144
- package/lib/util/selection.js.map +1 -1
- package/lib/util/series.js +2 -2
- package/lib/util/series.js.map +1 -1
- package/lib/util/shape.js +28 -16
- package/lib/util/shape.js.map +1 -1
- package/lib/util/string.js +5 -4
- package/lib/util/string.js.map +1 -1
- package/lib/util/style.js +30 -24
- package/lib/util/style.js.map +1 -1
- package/lib/util/svg2marker.js +17 -15
- package/lib/util/svg2marker.js.map +1 -1
- package/lib/util/text.js +16 -16
- package/lib/util/text.js.map +1 -1
- package/lib/util/throttle.js +13 -7
- package/lib/util/throttle.js.map +1 -1
- package/lib/util/time.js +24 -22
- package/lib/util/time.js.map +1 -1
- package/lib/util/timer.js +9 -5
- package/lib/util/timer.js.map +1 -1
- package/lib/util/transform.js +6 -5
- package/lib/util/transform.js.map +1 -1
- package/lib/util/transpose.js +1 -1
- package/lib/util/transpose.js.map +1 -1
- package/lib/util/traverse.js +1 -1
- package/lib/util/traverse.js.map +1 -1
- package/lib/util/visibility.js +3 -3
- package/lib/util/visibility.js.map +1 -1
- package/lib/util/wrap.js +5 -3
- package/lib/util/wrap.js.map +1 -1
- package/package.json +3 -3
package/esm/ui/tooltip/index.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
1
|
+
import { __assign, __extends, __read, __rest } from "tslib";
|
|
2
2
|
import { substitute, createDOM } from '@antv/util';
|
|
3
3
|
import { Component } from '../../core';
|
|
4
4
|
import { BBox, applyStyleSheet, replaceChildren } from '../../util';
|
|
5
5
|
import { getClassNames, getDefaultTooltipStyle } from './constant';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getContainer() {
|
|
11
|
-
return this.element;
|
|
12
|
-
}
|
|
13
|
-
get elementSize() {
|
|
14
|
-
const width = this.element.offsetWidth;
|
|
15
|
-
const height = this.element.offsetHeight;
|
|
16
|
-
return { width, height };
|
|
17
|
-
}
|
|
18
|
-
get HTMLTooltipItemsElements() {
|
|
19
|
-
const { data, template } = this.attributes;
|
|
20
|
-
return data.map((_a, idx) => {
|
|
21
|
-
var { name = '', color = 'black', index } = _a, rest = __rest(_a, ["name", "color", "index"]);
|
|
22
|
-
const datum = Object.assign({ name, color, index: index !== null && index !== void 0 ? index : idx }, rest);
|
|
23
|
-
return createDOM(substitute(template.item, datum));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
constructor(options) {
|
|
6
|
+
var Tooltip = /** @class */ (function (_super) {
|
|
7
|
+
__extends(Tooltip, _super);
|
|
8
|
+
function Tooltip(options) {
|
|
9
|
+
var _this = this;
|
|
27
10
|
var _a, _b;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
var prefixCls = (_b = (_a = options.style) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.prefixCls;
|
|
12
|
+
var CLASS_NAME = getClassNames(prefixCls);
|
|
13
|
+
_this = _super.call(this, options, {
|
|
31
14
|
data: [],
|
|
32
15
|
x: 0,
|
|
33
16
|
y: 0,
|
|
@@ -43,48 +26,75 @@ export class Tooltip extends Component {
|
|
|
43
26
|
bounding: null,
|
|
44
27
|
template: {
|
|
45
28
|
prefixCls: '',
|
|
46
|
-
container:
|
|
47
|
-
title:
|
|
48
|
-
item:
|
|
49
|
-
<span class="${CLASS_NAME.NAME}">
|
|
50
|
-
<span class="${CLASS_NAME.MARKER}" style="background:{color}"></span>
|
|
51
|
-
<span class="${CLASS_NAME.NAME_LABEL}" title="{name}">{name}</span>
|
|
52
|
-
</span>
|
|
53
|
-
<span class="${CLASS_NAME.VALUE}" title="{value}">{value}</span>
|
|
54
|
-
</li>`,
|
|
29
|
+
container: "<div class=\"".concat(CLASS_NAME.CONTAINER, "\"></div>"),
|
|
30
|
+
title: "<div class=\"".concat(CLASS_NAME.TITLE, "\"></div>"),
|
|
31
|
+
item: "<li class=\"".concat(CLASS_NAME.LIST_ITEM, "\" data-index={index}>\n <span class=\"").concat(CLASS_NAME.NAME, "\">\n <span class=\"").concat(CLASS_NAME.MARKER, "\" style=\"background:{color}\"></span>\n <span class=\"").concat(CLASS_NAME.NAME_LABEL, "\" title=\"{name}\">{name}</span>\n </span>\n <span class=\"").concat(CLASS_NAME.VALUE, "\" title=\"{value}\">{value}</span>\n </li>"),
|
|
55
32
|
},
|
|
56
33
|
style: getDefaultTooltipStyle(prefixCls),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
}) || this;
|
|
35
|
+
_this.timestamp = -1;
|
|
36
|
+
_this.prevCustomContentKey = _this.attributes.contentKey;
|
|
37
|
+
_this.initShape();
|
|
38
|
+
_this.render(_this.attributes, _this);
|
|
39
|
+
return _this;
|
|
62
40
|
}
|
|
63
|
-
|
|
41
|
+
Object.defineProperty(Tooltip.prototype, "HTMLTooltipElement", {
|
|
42
|
+
get: function () {
|
|
43
|
+
return this.element;
|
|
44
|
+
},
|
|
45
|
+
enumerable: false,
|
|
46
|
+
configurable: true
|
|
47
|
+
});
|
|
48
|
+
Tooltip.prototype.getContainer = function () {
|
|
49
|
+
return this.element;
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(Tooltip.prototype, "elementSize", {
|
|
52
|
+
get: function () {
|
|
53
|
+
var width = this.element.offsetWidth;
|
|
54
|
+
var height = this.element.offsetHeight;
|
|
55
|
+
return { width: width, height: height };
|
|
56
|
+
},
|
|
57
|
+
enumerable: false,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(Tooltip.prototype, "HTMLTooltipItemsElements", {
|
|
61
|
+
get: function () {
|
|
62
|
+
var _a = this.attributes, data = _a.data, template = _a.template;
|
|
63
|
+
return data.map(function (_a, idx) {
|
|
64
|
+
var _b = _a.name, name = _b === void 0 ? '' : _b, _c = _a.color, color = _c === void 0 ? 'black' : _c, index = _a.index, rest = __rest(_a, ["name", "color", "index"]);
|
|
65
|
+
var datum = __assign({ name: name, color: color, index: index !== null && index !== void 0 ? index : idx }, rest);
|
|
66
|
+
return createDOM(substitute(template.item, datum));
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
72
|
+
Tooltip.prototype.render = function (attributes, container) {
|
|
64
73
|
this.renderHTMLTooltipElement();
|
|
65
74
|
this.updatePosition();
|
|
66
|
-
}
|
|
67
|
-
destroy() {
|
|
75
|
+
};
|
|
76
|
+
Tooltip.prototype.destroy = function () {
|
|
68
77
|
var _a;
|
|
69
78
|
(_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
|
|
70
|
-
|
|
71
|
-
}
|
|
79
|
+
_super.prototype.destroy.call(this);
|
|
80
|
+
};
|
|
72
81
|
/**
|
|
73
82
|
* 如果设置了坐标值,显示过程中会立即更新位置并关闭过渡动画
|
|
74
83
|
*/
|
|
75
|
-
show(x, y) {
|
|
84
|
+
Tooltip.prototype.show = function (x, y) {
|
|
85
|
+
var _this = this;
|
|
76
86
|
if (x !== undefined && y !== undefined) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
var isToggle = this.element.style.visibility === 'hidden';
|
|
88
|
+
var setPosition = function () {
|
|
89
|
+
_this.attributes.x = x !== null && x !== void 0 ? x : _this.attributes.x;
|
|
90
|
+
_this.attributes.y = y !== null && y !== void 0 ? y : _this.attributes.y;
|
|
91
|
+
_this.updatePosition();
|
|
82
92
|
};
|
|
83
93
|
// 只有从 hidden 状态变为 visible 状态时才需要关闭过渡动画
|
|
84
94
|
isToggle ? this.closeTransition(setPosition) : setPosition();
|
|
85
95
|
}
|
|
86
96
|
this.element.style.visibility = 'visible';
|
|
87
|
-
}
|
|
97
|
+
};
|
|
88
98
|
/**
|
|
89
99
|
* 如果 hide 时传入了坐标值,那么只有当鼠标不在 tooltip 上时才会隐藏
|
|
90
100
|
* 对于 enterable = true 的时候,需要传入 x y,为了避免问题,建议上层在使用的时候,都传入 x y
|
|
@@ -92,42 +102,44 @@ export class Tooltip extends Component {
|
|
|
92
102
|
* @param y
|
|
93
103
|
* @returns
|
|
94
104
|
*/
|
|
95
|
-
hide
|
|
96
|
-
|
|
105
|
+
Tooltip.prototype.hide = function (x, y) {
|
|
106
|
+
if (x === void 0) { x = 0; }
|
|
107
|
+
if (y === void 0) { y = 0; }
|
|
108
|
+
var enterable = this.attributes.enterable;
|
|
97
109
|
// 如果当前鼠标在 tooltip 上,则不隐藏
|
|
98
110
|
if (enterable && this.isCursorEntered(x, y))
|
|
99
111
|
return;
|
|
100
112
|
this.element.style.visibility = 'hidden';
|
|
101
|
-
}
|
|
113
|
+
};
|
|
102
114
|
/**
|
|
103
115
|
* 初始化容器
|
|
104
116
|
*/
|
|
105
|
-
initShape() {
|
|
106
|
-
|
|
117
|
+
Tooltip.prototype.initShape = function () {
|
|
118
|
+
var template = this.attributes.template;
|
|
107
119
|
this.element = createDOM(template.container);
|
|
108
120
|
if (this.id)
|
|
109
121
|
this.element.setAttribute('id', this.id);
|
|
110
|
-
}
|
|
111
|
-
renderCustomContent() {
|
|
122
|
+
};
|
|
123
|
+
Tooltip.prototype.renderCustomContent = function () {
|
|
112
124
|
if (this.prevCustomContentKey !== undefined && this.prevCustomContentKey === this.attributes.contentKey)
|
|
113
125
|
return;
|
|
114
126
|
this.prevCustomContentKey = this.attributes.contentKey;
|
|
115
|
-
|
|
127
|
+
var content = this.attributes.content;
|
|
116
128
|
if (!content)
|
|
117
129
|
return;
|
|
118
130
|
if (typeof content === 'string')
|
|
119
131
|
this.element.innerHTML = content;
|
|
120
132
|
else
|
|
121
133
|
replaceChildren(this.element, content);
|
|
122
|
-
}
|
|
134
|
+
};
|
|
123
135
|
/**
|
|
124
136
|
* 更新 HTML 上的内容
|
|
125
137
|
*/
|
|
126
|
-
renderHTMLTooltipElement() {
|
|
138
|
+
Tooltip.prototype.renderHTMLTooltipElement = function () {
|
|
127
139
|
var _a, _b;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
var _c = this.attributes, template = _c.template, title = _c.title, enterable = _c.enterable, style = _c.style, content = _c.content;
|
|
141
|
+
var CLASS_NAME = getClassNames(template.prefixCls);
|
|
142
|
+
var container = this.element;
|
|
131
143
|
this.element.style.pointerEvents = enterable ? 'auto' : 'none';
|
|
132
144
|
if (content)
|
|
133
145
|
this.renderCustomContent();
|
|
@@ -138,50 +150,51 @@ export class Tooltip extends Component {
|
|
|
138
150
|
}
|
|
139
151
|
else
|
|
140
152
|
(_b = (_a = container.getElementsByClassName(CLASS_NAME.TITLE)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.remove();
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
var itemsElements = this.HTMLTooltipItemsElements;
|
|
154
|
+
var ul = document.createElement('ul');
|
|
143
155
|
ul.className = CLASS_NAME.LIST;
|
|
144
156
|
replaceChildren(ul, itemsElements);
|
|
145
|
-
|
|
157
|
+
var list = this.element.querySelector(".".concat(CLASS_NAME.LIST));
|
|
146
158
|
if (list)
|
|
147
159
|
list.replaceWith(ul);
|
|
148
160
|
else
|
|
149
161
|
container.appendChild(ul);
|
|
150
162
|
}
|
|
151
163
|
applyStyleSheet(container, style);
|
|
152
|
-
}
|
|
164
|
+
};
|
|
153
165
|
/**
|
|
154
166
|
* 根据 position 和指针位置,计算出 tooltip 相对于指针的偏移量
|
|
155
167
|
* @param assignPosition {TooltipPosition} tooltip相对于指针的位置,不指定时使用默认参数
|
|
156
168
|
*/
|
|
157
|
-
getRelativeOffsetFromCursor(assignPosition) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
finalPosition.forEach((pos)
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
Tooltip.prototype.getRelativeOffsetFromCursor = function (assignPosition) {
|
|
170
|
+
var _a = this.attributes, position = _a.position, offset = _a.offset;
|
|
171
|
+
var interPosition = assignPosition || position;
|
|
172
|
+
var finalPosition = interPosition.split('-');
|
|
173
|
+
var positionScore = { left: [-1, 0], right: [1, 0], top: [0, -1], bottom: [0, 1] };
|
|
174
|
+
var _b = this.elementSize, width = _b.width, height = _b.height;
|
|
175
|
+
var absolutelyOffset = [-width / 2, -height / 2];
|
|
176
|
+
finalPosition.forEach(function (pos) {
|
|
177
|
+
var _a = __read(absolutelyOffset, 2), abs1 = _a[0], abs2 = _a[1];
|
|
178
|
+
var _b = __read(positionScore[pos], 2), pos1 = _b[0], pos2 = _b[1];
|
|
167
179
|
absolutelyOffset = [abs1 + (width / 2 + offset[0]) * pos1, abs2 + (height / 2 + offset[1]) * pos2];
|
|
168
180
|
});
|
|
169
181
|
return absolutelyOffset;
|
|
170
|
-
}
|
|
182
|
+
};
|
|
171
183
|
/**
|
|
172
184
|
* 将相对于指针的偏移量生效到dom元素上
|
|
173
185
|
*/
|
|
174
|
-
setOffsetPosition(
|
|
175
|
-
|
|
176
|
-
this.
|
|
177
|
-
this.element.style.
|
|
178
|
-
|
|
186
|
+
Tooltip.prototype.setOffsetPosition = function (_a) {
|
|
187
|
+
var _b = __read(_a, 2), offsetX = _b[0], offsetY = _b[1];
|
|
188
|
+
var _c = this.attributes, _d = _c.x, x = _d === void 0 ? 0 : _d, _e = _c.y, y = _e === void 0 ? 0 : _e, _f = _c.container, cx = _f.x, cy = _f.y;
|
|
189
|
+
this.element.style.left = "".concat(+x + cx + offsetX, "px");
|
|
190
|
+
this.element.style.top = "".concat(+y + cy + offsetY, "px");
|
|
191
|
+
};
|
|
179
192
|
/**
|
|
180
193
|
* 更新tooltip的位置
|
|
181
194
|
*/
|
|
182
|
-
updatePosition() {
|
|
183
|
-
|
|
184
|
-
|
|
195
|
+
Tooltip.prototype.updatePosition = function () {
|
|
196
|
+
var _a = this.attributes.showDelay, showDelay = _a === void 0 ? 60 : _a;
|
|
197
|
+
var currentTimestamp = Date.now();
|
|
185
198
|
if (this.timestamp > 0 && currentTimestamp - this.timestamp < showDelay)
|
|
186
199
|
return;
|
|
187
200
|
this.timestamp = currentTimestamp;
|
|
@@ -195,68 +208,72 @@ export class Tooltip extends Component {
|
|
|
195
208
|
* 实际摆放位置
|
|
196
209
|
*/
|
|
197
210
|
this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()));
|
|
198
|
-
}
|
|
211
|
+
};
|
|
199
212
|
/**
|
|
200
213
|
* 计算自动调整位置后的相对位置
|
|
201
214
|
* @param offsetX 根据position计算的横向偏移量
|
|
202
215
|
* @param offsetY 根据position计算的纵向偏移量
|
|
203
216
|
*/
|
|
204
|
-
autoPosition(
|
|
205
|
-
|
|
217
|
+
Tooltip.prototype.autoPosition = function (_a) {
|
|
218
|
+
var _b = __read(_a, 2), offsetX = _b[0], offsetY = _b[1];
|
|
219
|
+
var _c = this.attributes, cursorX = _c.x, cursorY = _c.y, bounding = _c.bounding, position = _c.position;
|
|
206
220
|
// 如果没有设置 bounds,那么意思就是不限制空间
|
|
207
221
|
if (!bounding)
|
|
208
222
|
return [offsetX, offsetY];
|
|
209
223
|
// 更新前的位置和宽度
|
|
210
|
-
|
|
224
|
+
var _d = this.element, offsetWidth = _d.offsetWidth, offsetHeight = _d.offsetHeight;
|
|
211
225
|
// 预期放置的位置
|
|
212
|
-
|
|
226
|
+
var _e = __read([+cursorX + offsetX, +cursorY + offsetY], 2), expectLeft = _e[0], expectTop = _e[1];
|
|
213
227
|
// 反方向
|
|
214
|
-
|
|
228
|
+
var inversion = {
|
|
215
229
|
left: 'right',
|
|
216
230
|
right: 'left',
|
|
217
231
|
top: 'bottom',
|
|
218
232
|
bottom: 'top',
|
|
219
233
|
};
|
|
220
234
|
// 各个边界是否超出容器边界
|
|
221
|
-
|
|
222
|
-
|
|
235
|
+
var boundingX = bounding.x, boundingY = bounding.y, boundingWidth = bounding.width, boundingHeight = bounding.height;
|
|
236
|
+
var edgeCompare = {
|
|
223
237
|
left: expectLeft < boundingX,
|
|
224
238
|
right: expectLeft + offsetWidth > boundingX + boundingWidth,
|
|
225
239
|
top: expectTop < boundingY,
|
|
226
240
|
bottom: expectTop + offsetHeight > boundingY + boundingHeight,
|
|
227
241
|
};
|
|
228
242
|
// 修正的位置
|
|
229
|
-
|
|
243
|
+
var correctivePosition = [];
|
|
230
244
|
// 判断是否超出边界
|
|
231
|
-
position.split('-').forEach((pos)
|
|
245
|
+
position.split('-').forEach(function (pos) {
|
|
232
246
|
// 如果在当前方向超出边界,则设置其反方向
|
|
233
247
|
if (edgeCompare[pos])
|
|
234
248
|
correctivePosition.push(inversion[pos]);
|
|
235
249
|
else
|
|
236
250
|
correctivePosition.push(pos);
|
|
237
251
|
});
|
|
238
|
-
|
|
252
|
+
var correctedPositionString = correctivePosition.join('-');
|
|
239
253
|
return this.getRelativeOffsetFromCursor(correctedPositionString);
|
|
240
|
-
}
|
|
241
|
-
isCursorEntered(clientX, clientY) {
|
|
254
|
+
};
|
|
255
|
+
Tooltip.prototype.isCursorEntered = function (clientX, clientY) {
|
|
242
256
|
// 是可捕获的,并且点在 tooltip dom 上
|
|
243
257
|
if (this.element) {
|
|
244
|
-
|
|
258
|
+
var _a = this.element.getBoundingClientRect(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
245
259
|
// const { container } = this.attributes;
|
|
246
260
|
// const { x: cx, y: cy } = container;
|
|
247
261
|
// console.log(1113, [clientX, clientY], [x, y, width, height], [cx, cy], new BBox(x - cx, y - cy, width, height).isPointIn(cursorX, cursorY));
|
|
248
262
|
return new BBox(x, y, width, height).isPointIn(clientX, clientY);
|
|
249
263
|
}
|
|
250
264
|
return false;
|
|
251
|
-
}
|
|
252
|
-
closeTransition(callback) {
|
|
253
|
-
|
|
265
|
+
};
|
|
266
|
+
Tooltip.prototype.closeTransition = function (callback) {
|
|
267
|
+
var _this = this;
|
|
268
|
+
var transition = this.element.style.transition;
|
|
254
269
|
this.element.style.transition = 'none';
|
|
255
270
|
callback();
|
|
256
|
-
setTimeout(()
|
|
257
|
-
|
|
271
|
+
setTimeout(function () {
|
|
272
|
+
_this.element.style.transition = transition;
|
|
258
273
|
}, 10);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
Tooltip
|
|
274
|
+
};
|
|
275
|
+
Tooltip.tag = 'tooltip';
|
|
276
|
+
return Tooltip;
|
|
277
|
+
}(Component));
|
|
278
|
+
export { Tooltip };
|
|
262
279
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/tooltip/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKnE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/tooltip/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKnE;IAA6B,2BAA4B;IA6BvD,iBAAY,OAAuB;QAAnC,iBAiCC;;QAhCC,IAAM,SAAS,GAAG,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,QAAQ,0CAAE,SAAS,CAAC;QACrD,IAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QAC5C,QAAA,MAAK,YAAC,OAAO,EAAE;YACb,IAAI,EAAE,EAAE;YACR,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,UAAU,EAAE,SAAS;YACrB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,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|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get right() {
|
|
9
|
-
return this.x + this.width;
|
|
10
|
-
}
|
|
11
|
-
get top() {
|
|
12
|
-
return this.y;
|
|
13
|
-
}
|
|
14
|
-
constructor(x = 0, y = 0, width = 0, height = 0) {
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
var BBox = /** @class */ (function () {
|
|
3
|
+
function BBox(x, y, width, height) {
|
|
4
|
+
if (x === void 0) { x = 0; }
|
|
5
|
+
if (y === void 0) { y = 0; }
|
|
6
|
+
if (width === void 0) { width = 0; }
|
|
7
|
+
if (height === void 0) { height = 0; }
|
|
15
8
|
this.x = 0;
|
|
16
9
|
this.y = 0;
|
|
17
10
|
this.width = 0;
|
|
@@ -21,10 +14,38 @@ export class BBox {
|
|
|
21
14
|
this.width = width;
|
|
22
15
|
this.height = height;
|
|
23
16
|
}
|
|
24
|
-
|
|
17
|
+
Object.defineProperty(BBox.prototype, "bottom", {
|
|
18
|
+
get: function () {
|
|
19
|
+
return this.y + this.height;
|
|
20
|
+
},
|
|
21
|
+
enumerable: false,
|
|
22
|
+
configurable: true
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(BBox.prototype, "left", {
|
|
25
|
+
get: function () {
|
|
26
|
+
return this.x;
|
|
27
|
+
},
|
|
28
|
+
enumerable: false,
|
|
29
|
+
configurable: true
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(BBox.prototype, "right", {
|
|
32
|
+
get: function () {
|
|
33
|
+
return this.x + this.width;
|
|
34
|
+
},
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(BBox.prototype, "top", {
|
|
39
|
+
get: function () {
|
|
40
|
+
return this.y;
|
|
41
|
+
},
|
|
42
|
+
enumerable: false,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
BBox.fromRect = function (other) {
|
|
25
46
|
return new BBox(other.x, other.y, other.width, other.height);
|
|
26
|
-
}
|
|
27
|
-
toJSON() {
|
|
47
|
+
};
|
|
48
|
+
BBox.prototype.toJSON = function () {
|
|
28
49
|
return {
|
|
29
50
|
x: this.x,
|
|
30
51
|
y: this.y,
|
|
@@ -35,19 +56,21 @@ export class BBox {
|
|
|
35
56
|
bottom: this.bottom,
|
|
36
57
|
left: this.left,
|
|
37
58
|
};
|
|
38
|
-
}
|
|
59
|
+
};
|
|
39
60
|
/**
|
|
40
61
|
* 点是否在 bbox 中
|
|
41
62
|
* @param p
|
|
42
63
|
*/
|
|
43
|
-
isPointIn(x, y) {
|
|
64
|
+
BBox.prototype.isPointIn = function (x, y) {
|
|
44
65
|
return x >= this.left && x <= this.right && y >= this.top && y <= this.bottom;
|
|
45
|
-
}
|
|
46
|
-
|
|
66
|
+
};
|
|
67
|
+
return BBox;
|
|
68
|
+
}());
|
|
69
|
+
export { BBox };
|
|
47
70
|
export function getRenderBBox(element) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
71
|
+
var _a = element.getRenderBounds(), _b = __read(_a.min, 2), minX = _b[0], minY = _b[1], _c = __read(_a.max, 2), maxX = _c[0], maxY = _c[1];
|
|
72
|
+
var width = maxX - minX;
|
|
73
|
+
var height = maxY - minY;
|
|
51
74
|
return new BBox(minX, minY, width, height);
|
|
52
75
|
}
|
|
53
76
|
//# sourceMappingURL=bbox.js.map
|
package/esm/util/bbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bbox.js","sourceRoot":"src/","sources":["util/bbox.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"bbox.js","sourceRoot":"src/","sources":["util/bbox.ts"],"names":[],"mappings":";AAEA;IAyBE,cAAY,CAAK,EAAE,CAAK,EAAE,KAAS,EAAE,MAAU;QAAnC,kBAAA,EAAA,KAAK;QAAE,kBAAA,EAAA,KAAK;QAAE,sBAAA,EAAA,SAAS;QAAE,uBAAA,EA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AhB,UAAiB,CAAS,EAAE,CAAS;QACnC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC;IAChF,CAAC;IACH,WAAC;AAAD,CAAC,AAxDD,IAwDC;;AAED,MAAM,UAAU,aAAa,CAAC,OAAsB;IAC5C,IAAA,KAGF,OAAO,CAAC,eAAe,EAAE,EAF3B,KAAA,iBAAiB,EAAX,IAAI,QAAA,EAAE,IAAI,QAAA,EAChB,KAAA,iBAAiB,EAAX,IAAI,QAAA,EAAE,IAAI,QACW,CAAC;IAC9B,IAAM,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3B,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC"}
|
package/esm/util/callback.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { __read, __spreadArray } from "tslib";
|
|
1
2
|
import { isFunction } from '@antv/util';
|
|
2
3
|
export function getCallbackValue(value, params) {
|
|
3
|
-
return isFunction(value) ? value(
|
|
4
|
+
return isFunction(value) ? value.apply(void 0, __spreadArray([], __read(params), false)) : value;
|
|
4
5
|
}
|
|
5
6
|
//# sourceMappingURL=callback.js.map
|
package/esm/util/callback.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.js","sourceRoot":"src/","sources":["util/callback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,UAAU,gBAAgB,CAAU,KAAU,EAAE,MAAa;IACjE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"callback.js","sourceRoot":"src/","sources":["util/callback.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,UAAU,gBAAgB,CAAU,KAAU,EAAE,MAAa;IACjE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,wCAAI,MAAM,WAAE,CAAC,CAAC,KAAK,CAAC;AACtD,CAAC"}
|
package/esm/util/classnames.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
export var classNames = function (cls, prefix) {
|
|
3
|
+
var PREFIX = function (str) { return "".concat(prefix, "-").concat(str); };
|
|
4
|
+
var obj = Object.fromEntries(Object.entries(cls).map(function (_a) {
|
|
5
|
+
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
6
|
+
var name = PREFIX(v);
|
|
5
7
|
return [
|
|
6
8
|
k,
|
|
7
9
|
{
|
|
8
|
-
name,
|
|
9
|
-
class:
|
|
10
|
-
id:
|
|
11
|
-
toString() {
|
|
10
|
+
name: name,
|
|
11
|
+
class: ".".concat(name),
|
|
12
|
+
id: "#".concat(name),
|
|
13
|
+
toString: function () {
|
|
12
14
|
return name;
|
|
13
15
|
},
|
|
14
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classnames.js","sourceRoot":"src/","sources":["util/classnames.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"classnames.js","sourceRoot":"src/","sources":["util/classnames.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,IAAM,UAAU,GAAG,UAAmC,GAAM,EAAE,MAAc;IACjF,IAAM,MAAM,GAAG,UAAC,GAAW,IAAK,OAAA,UAAG,MAAM,cAAI,GAAG,CAAE,EAAlB,CAAkB,CAAC;IACnD,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAC,EAAM;YAAN,KAAA,aAAM,EAAL,CAAC,QAAA,EAAE,CAAC,QAAA;QAC5B,IAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACvB,OAAO;YACL,CAAC;YACD;gBACE,IAAI,MAAA;gBACJ,KAAK,EAAE,WAAI,IAAI,CAAE;gBACjB,EAAE,EAAE,WAAI,IAAI,CAAE;gBACd,QAAQ;oBACN,OAAO,IAAI,CAAC;gBACd,CAAC;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,OAAO,GAMN,CAAC;AACJ,CAAC,CAAC"}
|
package/esm/util/deep-assign.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
1
2
|
import { isPlainObject, isArray } from '@antv/util';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var MAX_MIX_LEVEL = 5;
|
|
4
|
+
var deep = function (dist, src, level, maxLevel) {
|
|
5
|
+
if (level === void 0) { level = 0; }
|
|
6
|
+
if (maxLevel === void 0) { maxLevel = MAX_MIX_LEVEL; }
|
|
7
|
+
Object.entries(src).forEach(function (_a) {
|
|
8
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
9
|
+
var res = dist;
|
|
6
10
|
if (Object.prototype.hasOwnProperty.call(src, key)) {
|
|
7
11
|
if (!value) {
|
|
8
12
|
// null 、 undefined 等情况直接赋值
|
|
@@ -30,8 +34,12 @@ const deep = (dist, src, level = 0, maxLevel = MAX_MIX_LEVEL) => {
|
|
|
30
34
|
}
|
|
31
35
|
});
|
|
32
36
|
};
|
|
33
|
-
export
|
|
34
|
-
|
|
37
|
+
export var deepAssign = function (rst) {
|
|
38
|
+
var args = [];
|
|
39
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
40
|
+
args[_i - 1] = arguments[_i];
|
|
41
|
+
}
|
|
42
|
+
for (var i = 0; i < args.length; i += 1) {
|
|
35
43
|
deep(rst, args[i]);
|
|
36
44
|
}
|
|
37
45
|
return rst;
|