@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/lib/ui/tooltip/index.js
CHANGED
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tooltip = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
getContainer() {
|
|
14
|
-
return this.element;
|
|
15
|
-
}
|
|
16
|
-
get elementSize() {
|
|
17
|
-
const width = this.element.offsetWidth;
|
|
18
|
-
const height = this.element.offsetHeight;
|
|
19
|
-
return { width, height };
|
|
20
|
-
}
|
|
21
|
-
get HTMLTooltipItemsElements() {
|
|
22
|
-
const { data, template } = this.attributes;
|
|
23
|
-
return data.map((_a, idx) => {
|
|
24
|
-
var { name = '', color = 'black', index } = _a, rest = tslib_1.__rest(_a, ["name", "color", "index"]);
|
|
25
|
-
const datum = Object.assign({ name, color, index: index !== null && index !== void 0 ? index : idx }, rest);
|
|
26
|
-
return (0, util_1.createDOM)((0, util_1.substitute)(template.item, datum));
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
constructor(options) {
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var util_1 = require("@antv/util");
|
|
6
|
+
var core_1 = require("../../core");
|
|
7
|
+
var util_2 = require("../../util");
|
|
8
|
+
var constant_1 = require("./constant");
|
|
9
|
+
var Tooltip = /** @class */ (function (_super) {
|
|
10
|
+
tslib_1.__extends(Tooltip, _super);
|
|
11
|
+
function Tooltip(options) {
|
|
12
|
+
var _this = this;
|
|
30
13
|
var _a, _b;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
var prefixCls = (_b = (_a = options.style) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.prefixCls;
|
|
15
|
+
var CLASS_NAME = (0, constant_1.getClassNames)(prefixCls);
|
|
16
|
+
_this = _super.call(this, options, {
|
|
34
17
|
data: [],
|
|
35
18
|
x: 0,
|
|
36
19
|
y: 0,
|
|
@@ -46,48 +29,75 @@ class Tooltip extends core_1.Component {
|
|
|
46
29
|
bounding: null,
|
|
47
30
|
template: {
|
|
48
31
|
prefixCls: '',
|
|
49
|
-
container:
|
|
50
|
-
title:
|
|
51
|
-
item:
|
|
52
|
-
<span class="${CLASS_NAME.NAME}">
|
|
53
|
-
<span class="${CLASS_NAME.MARKER}" style="background:{color}"></span>
|
|
54
|
-
<span class="${CLASS_NAME.NAME_LABEL}" title="{name}">{name}</span>
|
|
55
|
-
</span>
|
|
56
|
-
<span class="${CLASS_NAME.VALUE}" title="{value}">{value}</span>
|
|
57
|
-
</li>`,
|
|
32
|
+
container: "<div class=\"".concat(CLASS_NAME.CONTAINER, "\"></div>"),
|
|
33
|
+
title: "<div class=\"".concat(CLASS_NAME.TITLE, "\"></div>"),
|
|
34
|
+
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>"),
|
|
58
35
|
},
|
|
59
36
|
style: (0, constant_1.getDefaultTooltipStyle)(prefixCls),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
}) || this;
|
|
38
|
+
_this.timestamp = -1;
|
|
39
|
+
_this.prevCustomContentKey = _this.attributes.contentKey;
|
|
40
|
+
_this.initShape();
|
|
41
|
+
_this.render(_this.attributes, _this);
|
|
42
|
+
return _this;
|
|
65
43
|
}
|
|
66
|
-
|
|
44
|
+
Object.defineProperty(Tooltip.prototype, "HTMLTooltipElement", {
|
|
45
|
+
get: function () {
|
|
46
|
+
return this.element;
|
|
47
|
+
},
|
|
48
|
+
enumerable: false,
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
51
|
+
Tooltip.prototype.getContainer = function () {
|
|
52
|
+
return this.element;
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(Tooltip.prototype, "elementSize", {
|
|
55
|
+
get: function () {
|
|
56
|
+
var width = this.element.offsetWidth;
|
|
57
|
+
var height = this.element.offsetHeight;
|
|
58
|
+
return { width: width, height: height };
|
|
59
|
+
},
|
|
60
|
+
enumerable: false,
|
|
61
|
+
configurable: true
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(Tooltip.prototype, "HTMLTooltipItemsElements", {
|
|
64
|
+
get: function () {
|
|
65
|
+
var _a = this.attributes, data = _a.data, template = _a.template;
|
|
66
|
+
return data.map(function (_a, idx) {
|
|
67
|
+
var _b = _a.name, name = _b === void 0 ? '' : _b, _c = _a.color, color = _c === void 0 ? 'black' : _c, index = _a.index, rest = tslib_1.__rest(_a, ["name", "color", "index"]);
|
|
68
|
+
var datum = tslib_1.__assign({ name: name, color: color, index: index !== null && index !== void 0 ? index : idx }, rest);
|
|
69
|
+
return (0, util_1.createDOM)((0, util_1.substitute)(template.item, datum));
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
enumerable: false,
|
|
73
|
+
configurable: true
|
|
74
|
+
});
|
|
75
|
+
Tooltip.prototype.render = function (attributes, container) {
|
|
67
76
|
this.renderHTMLTooltipElement();
|
|
68
77
|
this.updatePosition();
|
|
69
|
-
}
|
|
70
|
-
destroy() {
|
|
78
|
+
};
|
|
79
|
+
Tooltip.prototype.destroy = function () {
|
|
71
80
|
var _a;
|
|
72
81
|
(_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
|
|
73
|
-
|
|
74
|
-
}
|
|
82
|
+
_super.prototype.destroy.call(this);
|
|
83
|
+
};
|
|
75
84
|
/**
|
|
76
85
|
* 如果设置了坐标值,显示过程中会立即更新位置并关闭过渡动画
|
|
77
86
|
*/
|
|
78
|
-
show(x, y) {
|
|
87
|
+
Tooltip.prototype.show = function (x, y) {
|
|
88
|
+
var _this = this;
|
|
79
89
|
if (x !== undefined && y !== undefined) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
var isToggle = this.element.style.visibility === 'hidden';
|
|
91
|
+
var setPosition = function () {
|
|
92
|
+
_this.attributes.x = x !== null && x !== void 0 ? x : _this.attributes.x;
|
|
93
|
+
_this.attributes.y = y !== null && y !== void 0 ? y : _this.attributes.y;
|
|
94
|
+
_this.updatePosition();
|
|
85
95
|
};
|
|
86
96
|
// 只有从 hidden 状态变为 visible 状态时才需要关闭过渡动画
|
|
87
97
|
isToggle ? this.closeTransition(setPosition) : setPosition();
|
|
88
98
|
}
|
|
89
99
|
this.element.style.visibility = 'visible';
|
|
90
|
-
}
|
|
100
|
+
};
|
|
91
101
|
/**
|
|
92
102
|
* 如果 hide 时传入了坐标值,那么只有当鼠标不在 tooltip 上时才会隐藏
|
|
93
103
|
* 对于 enterable = true 的时候,需要传入 x y,为了避免问题,建议上层在使用的时候,都传入 x y
|
|
@@ -95,42 +105,44 @@ class Tooltip extends core_1.Component {
|
|
|
95
105
|
* @param y
|
|
96
106
|
* @returns
|
|
97
107
|
*/
|
|
98
|
-
hide
|
|
99
|
-
|
|
108
|
+
Tooltip.prototype.hide = function (x, y) {
|
|
109
|
+
if (x === void 0) { x = 0; }
|
|
110
|
+
if (y === void 0) { y = 0; }
|
|
111
|
+
var enterable = this.attributes.enterable;
|
|
100
112
|
// 如果当前鼠标在 tooltip 上,则不隐藏
|
|
101
113
|
if (enterable && this.isCursorEntered(x, y))
|
|
102
114
|
return;
|
|
103
115
|
this.element.style.visibility = 'hidden';
|
|
104
|
-
}
|
|
116
|
+
};
|
|
105
117
|
/**
|
|
106
118
|
* 初始化容器
|
|
107
119
|
*/
|
|
108
|
-
initShape() {
|
|
109
|
-
|
|
120
|
+
Tooltip.prototype.initShape = function () {
|
|
121
|
+
var template = this.attributes.template;
|
|
110
122
|
this.element = (0, util_1.createDOM)(template.container);
|
|
111
123
|
if (this.id)
|
|
112
124
|
this.element.setAttribute('id', this.id);
|
|
113
|
-
}
|
|
114
|
-
renderCustomContent() {
|
|
125
|
+
};
|
|
126
|
+
Tooltip.prototype.renderCustomContent = function () {
|
|
115
127
|
if (this.prevCustomContentKey !== undefined && this.prevCustomContentKey === this.attributes.contentKey)
|
|
116
128
|
return;
|
|
117
129
|
this.prevCustomContentKey = this.attributes.contentKey;
|
|
118
|
-
|
|
130
|
+
var content = this.attributes.content;
|
|
119
131
|
if (!content)
|
|
120
132
|
return;
|
|
121
133
|
if (typeof content === 'string')
|
|
122
134
|
this.element.innerHTML = content;
|
|
123
135
|
else
|
|
124
136
|
(0, util_2.replaceChildren)(this.element, content);
|
|
125
|
-
}
|
|
137
|
+
};
|
|
126
138
|
/**
|
|
127
139
|
* 更新 HTML 上的内容
|
|
128
140
|
*/
|
|
129
|
-
renderHTMLTooltipElement() {
|
|
141
|
+
Tooltip.prototype.renderHTMLTooltipElement = function () {
|
|
130
142
|
var _a, _b;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
143
|
+
var _c = this.attributes, template = _c.template, title = _c.title, enterable = _c.enterable, style = _c.style, content = _c.content;
|
|
144
|
+
var CLASS_NAME = (0, constant_1.getClassNames)(template.prefixCls);
|
|
145
|
+
var container = this.element;
|
|
134
146
|
this.element.style.pointerEvents = enterable ? 'auto' : 'none';
|
|
135
147
|
if (content)
|
|
136
148
|
this.renderCustomContent();
|
|
@@ -141,50 +153,51 @@ class Tooltip extends core_1.Component {
|
|
|
141
153
|
}
|
|
142
154
|
else
|
|
143
155
|
(_b = (_a = container.getElementsByClassName(CLASS_NAME.TITLE)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.remove();
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
var itemsElements = this.HTMLTooltipItemsElements;
|
|
157
|
+
var ul = document.createElement('ul');
|
|
146
158
|
ul.className = CLASS_NAME.LIST;
|
|
147
159
|
(0, util_2.replaceChildren)(ul, itemsElements);
|
|
148
|
-
|
|
160
|
+
var list = this.element.querySelector(".".concat(CLASS_NAME.LIST));
|
|
149
161
|
if (list)
|
|
150
162
|
list.replaceWith(ul);
|
|
151
163
|
else
|
|
152
164
|
container.appendChild(ul);
|
|
153
165
|
}
|
|
154
166
|
(0, util_2.applyStyleSheet)(container, style);
|
|
155
|
-
}
|
|
167
|
+
};
|
|
156
168
|
/**
|
|
157
169
|
* 根据 position 和指针位置,计算出 tooltip 相对于指针的偏移量
|
|
158
170
|
* @param assignPosition {TooltipPosition} tooltip相对于指针的位置,不指定时使用默认参数
|
|
159
171
|
*/
|
|
160
|
-
getRelativeOffsetFromCursor(assignPosition) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
finalPosition.forEach((pos)
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
Tooltip.prototype.getRelativeOffsetFromCursor = function (assignPosition) {
|
|
173
|
+
var _a = this.attributes, position = _a.position, offset = _a.offset;
|
|
174
|
+
var interPosition = assignPosition || position;
|
|
175
|
+
var finalPosition = interPosition.split('-');
|
|
176
|
+
var positionScore = { left: [-1, 0], right: [1, 0], top: [0, -1], bottom: [0, 1] };
|
|
177
|
+
var _b = this.elementSize, width = _b.width, height = _b.height;
|
|
178
|
+
var absolutelyOffset = [-width / 2, -height / 2];
|
|
179
|
+
finalPosition.forEach(function (pos) {
|
|
180
|
+
var _a = tslib_1.__read(absolutelyOffset, 2), abs1 = _a[0], abs2 = _a[1];
|
|
181
|
+
var _b = tslib_1.__read(positionScore[pos], 2), pos1 = _b[0], pos2 = _b[1];
|
|
170
182
|
absolutelyOffset = [abs1 + (width / 2 + offset[0]) * pos1, abs2 + (height / 2 + offset[1]) * pos2];
|
|
171
183
|
});
|
|
172
184
|
return absolutelyOffset;
|
|
173
|
-
}
|
|
185
|
+
};
|
|
174
186
|
/**
|
|
175
187
|
* 将相对于指针的偏移量生效到dom元素上
|
|
176
188
|
*/
|
|
177
|
-
setOffsetPosition(
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
this.element.style.
|
|
181
|
-
|
|
189
|
+
Tooltip.prototype.setOffsetPosition = function (_a) {
|
|
190
|
+
var _b = tslib_1.__read(_a, 2), offsetX = _b[0], offsetY = _b[1];
|
|
191
|
+
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;
|
|
192
|
+
this.element.style.left = "".concat(+x + cx + offsetX, "px");
|
|
193
|
+
this.element.style.top = "".concat(+y + cy + offsetY, "px");
|
|
194
|
+
};
|
|
182
195
|
/**
|
|
183
196
|
* 更新tooltip的位置
|
|
184
197
|
*/
|
|
185
|
-
updatePosition() {
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
Tooltip.prototype.updatePosition = function () {
|
|
199
|
+
var _a = this.attributes.showDelay, showDelay = _a === void 0 ? 60 : _a;
|
|
200
|
+
var currentTimestamp = Date.now();
|
|
188
201
|
if (this.timestamp > 0 && currentTimestamp - this.timestamp < showDelay)
|
|
189
202
|
return;
|
|
190
203
|
this.timestamp = currentTimestamp;
|
|
@@ -198,69 +211,72 @@ class Tooltip extends core_1.Component {
|
|
|
198
211
|
* 实际摆放位置
|
|
199
212
|
*/
|
|
200
213
|
this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()));
|
|
201
|
-
}
|
|
214
|
+
};
|
|
202
215
|
/**
|
|
203
216
|
* 计算自动调整位置后的相对位置
|
|
204
217
|
* @param offsetX 根据position计算的横向偏移量
|
|
205
218
|
* @param offsetY 根据position计算的纵向偏移量
|
|
206
219
|
*/
|
|
207
|
-
autoPosition(
|
|
208
|
-
|
|
220
|
+
Tooltip.prototype.autoPosition = function (_a) {
|
|
221
|
+
var _b = tslib_1.__read(_a, 2), offsetX = _b[0], offsetY = _b[1];
|
|
222
|
+
var _c = this.attributes, cursorX = _c.x, cursorY = _c.y, bounding = _c.bounding, position = _c.position;
|
|
209
223
|
// 如果没有设置 bounds,那么意思就是不限制空间
|
|
210
224
|
if (!bounding)
|
|
211
225
|
return [offsetX, offsetY];
|
|
212
226
|
// 更新前的位置和宽度
|
|
213
|
-
|
|
227
|
+
var _d = this.element, offsetWidth = _d.offsetWidth, offsetHeight = _d.offsetHeight;
|
|
214
228
|
// 预期放置的位置
|
|
215
|
-
|
|
229
|
+
var _e = tslib_1.__read([+cursorX + offsetX, +cursorY + offsetY], 2), expectLeft = _e[0], expectTop = _e[1];
|
|
216
230
|
// 反方向
|
|
217
|
-
|
|
231
|
+
var inversion = {
|
|
218
232
|
left: 'right',
|
|
219
233
|
right: 'left',
|
|
220
234
|
top: 'bottom',
|
|
221
235
|
bottom: 'top',
|
|
222
236
|
};
|
|
223
237
|
// 各个边界是否超出容器边界
|
|
224
|
-
|
|
225
|
-
|
|
238
|
+
var boundingX = bounding.x, boundingY = bounding.y, boundingWidth = bounding.width, boundingHeight = bounding.height;
|
|
239
|
+
var edgeCompare = {
|
|
226
240
|
left: expectLeft < boundingX,
|
|
227
241
|
right: expectLeft + offsetWidth > boundingX + boundingWidth,
|
|
228
242
|
top: expectTop < boundingY,
|
|
229
243
|
bottom: expectTop + offsetHeight > boundingY + boundingHeight,
|
|
230
244
|
};
|
|
231
245
|
// 修正的位置
|
|
232
|
-
|
|
246
|
+
var correctivePosition = [];
|
|
233
247
|
// 判断是否超出边界
|
|
234
|
-
position.split('-').forEach((pos)
|
|
248
|
+
position.split('-').forEach(function (pos) {
|
|
235
249
|
// 如果在当前方向超出边界,则设置其反方向
|
|
236
250
|
if (edgeCompare[pos])
|
|
237
251
|
correctivePosition.push(inversion[pos]);
|
|
238
252
|
else
|
|
239
253
|
correctivePosition.push(pos);
|
|
240
254
|
});
|
|
241
|
-
|
|
255
|
+
var correctedPositionString = correctivePosition.join('-');
|
|
242
256
|
return this.getRelativeOffsetFromCursor(correctedPositionString);
|
|
243
|
-
}
|
|
244
|
-
isCursorEntered(clientX, clientY) {
|
|
257
|
+
};
|
|
258
|
+
Tooltip.prototype.isCursorEntered = function (clientX, clientY) {
|
|
245
259
|
// 是可捕获的,并且点在 tooltip dom 上
|
|
246
260
|
if (this.element) {
|
|
247
|
-
|
|
261
|
+
var _a = this.element.getBoundingClientRect(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
248
262
|
// const { container } = this.attributes;
|
|
249
263
|
// const { x: cx, y: cy } = container;
|
|
250
264
|
// console.log(1113, [clientX, clientY], [x, y, width, height], [cx, cy], new BBox(x - cx, y - cy, width, height).isPointIn(cursorX, cursorY));
|
|
251
265
|
return new util_2.BBox(x, y, width, height).isPointIn(clientX, clientY);
|
|
252
266
|
}
|
|
253
267
|
return false;
|
|
254
|
-
}
|
|
255
|
-
closeTransition(callback) {
|
|
256
|
-
|
|
268
|
+
};
|
|
269
|
+
Tooltip.prototype.closeTransition = function (callback) {
|
|
270
|
+
var _this = this;
|
|
271
|
+
var transition = this.element.style.transition;
|
|
257
272
|
this.element.style.transition = 'none';
|
|
258
273
|
callback();
|
|
259
|
-
setTimeout(()
|
|
260
|
-
|
|
274
|
+
setTimeout(function () {
|
|
275
|
+
_this.element.style.transition = transition;
|
|
261
276
|
}, 10);
|
|
262
|
-
}
|
|
263
|
-
|
|
277
|
+
};
|
|
278
|
+
Tooltip.tag = 'tooltip';
|
|
279
|
+
return Tooltip;
|
|
280
|
+
}(core_1.Component));
|
|
264
281
|
exports.Tooltip = Tooltip;
|
|
265
|
-
Tooltip.tag = 'tooltip';
|
|
266
282
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/tooltip/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/tooltip/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAmD;AACnD,mCAAuC;AAEvC,mCAAoE;AACpE,uCAAmE;AAKnE;IAA6B,mCAA4B;IA6BvD,iBAAY,OAAuB;QAAnC,iBAiCC;;QAhCC,IAAM,SAAS,GAAG,MAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,QAAQ,0CAAE,SAAS,CAAC;QACrD,IAAM,UAAU,GAAG,IAAA,wBAAa,EAAC,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,cAAc;YACxB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACd,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE;gBACT,CAAC,EAAE,CAAC;gBACJ,C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enderBBox;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
get right() {
|
|
13
|
-
return this.x + this.width;
|
|
14
|
-
}
|
|
15
|
-
get top() {
|
|
16
|
-
return this.y;
|
|
17
|
-
}
|
|
18
|
-
constructor(x = 0, y = 0, width = 0, height = 0) {
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var BBox = /** @class */ (function () {
|
|
7
|
+
function BBox(x, y, width, height) {
|
|
8
|
+
if (x === void 0) { x = 0; }
|
|
9
|
+
if (y === void 0) { y = 0; }
|
|
10
|
+
if (width === void 0) { width = 0; }
|
|
11
|
+
if (height === void 0) { height = 0; }
|
|
19
12
|
this.x = 0;
|
|
20
13
|
this.y = 0;
|
|
21
14
|
this.width = 0;
|
|
@@ -25,10 +18,38 @@ class BBox {
|
|
|
25
18
|
this.width = width;
|
|
26
19
|
this.height = height;
|
|
27
20
|
}
|
|
28
|
-
|
|
21
|
+
Object.defineProperty(BBox.prototype, "bottom", {
|
|
22
|
+
get: function () {
|
|
23
|
+
return this.y + this.height;
|
|
24
|
+
},
|
|
25
|
+
enumerable: false,
|
|
26
|
+
configurable: true
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(BBox.prototype, "left", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this.x;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(BBox.prototype, "right", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return this.x + this.width;
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(BBox.prototype, "top", {
|
|
43
|
+
get: function () {
|
|
44
|
+
return this.y;
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
BBox.fromRect = function (other) {
|
|
29
50
|
return new BBox(other.x, other.y, other.width, other.height);
|
|
30
|
-
}
|
|
31
|
-
toJSON() {
|
|
51
|
+
};
|
|
52
|
+
BBox.prototype.toJSON = function () {
|
|
32
53
|
return {
|
|
33
54
|
x: this.x,
|
|
34
55
|
y: this.y,
|
|
@@ -39,20 +60,21 @@ class BBox {
|
|
|
39
60
|
bottom: this.bottom,
|
|
40
61
|
left: this.left,
|
|
41
62
|
};
|
|
42
|
-
}
|
|
63
|
+
};
|
|
43
64
|
/**
|
|
44
65
|
* 点是否在 bbox 中
|
|
45
66
|
* @param p
|
|
46
67
|
*/
|
|
47
|
-
isPointIn(x, y) {
|
|
68
|
+
BBox.prototype.isPointIn = function (x, y) {
|
|
48
69
|
return x >= this.left && x <= this.right && y >= this.top && y <= this.bottom;
|
|
49
|
-
}
|
|
50
|
-
|
|
70
|
+
};
|
|
71
|
+
return BBox;
|
|
72
|
+
}());
|
|
51
73
|
exports.BBox = BBox;
|
|
52
74
|
function getRenderBBox(element) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
var _a = element.getRenderBounds(), _b = tslib_1.__read(_a.min, 2), minX = _b[0], minY = _b[1], _c = tslib_1.__read(_a.max, 2), maxX = _c[0], maxY = _c[1];
|
|
76
|
+
var width = maxX - minX;
|
|
77
|
+
var height = maxY - minY;
|
|
56
78
|
return new BBox(minX, minY, width, height);
|
|
57
79
|
}
|
|
58
80
|
//# sourceMappingURL=bbox.js.map
|
package/lib/util/bbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bbox.js","sourceRoot":"src/","sources":["util/bbox.ts"],"names":[],"mappings":";;;AA4DA,sCAQC
|
|
1
|
+
{"version":3,"file":"bbox.js","sourceRoot":"src/","sources":["util/bbox.ts"],"names":[],"mappings":";;;AA4DA,sCAQC;;AAlED;IAyBE,cAAY,CAAK,EAAE,CAAK,EAAE,KAAS,EAAE,MAAU;QAA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;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,wBAAS,GAAhB,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;AAxDY,oBAAI;AA0DjB,SAAgB,aAAa,CAAC,OAAsB;IAC5C,IAAA,KAGF,OAAO,CAAC,eAAe,EAAE,EAF3B,KAAA,yBAAiB,EAAX,IAAI,QAAA,EAAE,IAAI,QAAA,EAChB,KAAA,yBAAiB,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/lib/util/callback.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCallbackValue = getCallbackValue;
|
|
4
|
-
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var util_1 = require("@antv/util");
|
|
5
6
|
function getCallbackValue(value, params) {
|
|
6
|
-
return (0, util_1.isFunction)(value) ? value(
|
|
7
|
+
return (0, util_1.isFunction)(value) ? value.apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(params), false)) : value;
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=callback.js.map
|
package/lib/util/callback.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.js","sourceRoot":"src/","sources":["util/callback.ts"],"names":[],"mappings":";;AAEA,4CAEC
|
|
1
|
+
{"version":3,"file":"callback.js","sourceRoot":"src/","sources":["util/callback.ts"],"names":[],"mappings":";;AAEA,4CAEC;;AAJD,mCAAwC;AAExC,SAAgB,gBAAgB,CAAU,KAAU,EAAE,MAAa;IACjE,OAAO,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,wDAAI,MAAM,WAAE,CAAC,CAAC,KAAK,CAAC;AACtD,CAAC"}
|
package/lib/util/classnames.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.classNames = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var classNames = function (cls, prefix) {
|
|
6
|
+
var PREFIX = function (str) { return "".concat(prefix, "-").concat(str); };
|
|
7
|
+
var obj = Object.fromEntries(Object.entries(cls).map(function (_a) {
|
|
8
|
+
var _b = tslib_1.__read(_a, 2), k = _b[0], v = _b[1];
|
|
9
|
+
var name = PREFIX(v);
|
|
8
10
|
return [
|
|
9
11
|
k,
|
|
10
12
|
{
|
|
11
|
-
name,
|
|
12
|
-
class:
|
|
13
|
-
id:
|
|
14
|
-
toString() {
|
|
13
|
+
name: name,
|
|
14
|
+
class: ".".concat(name),
|
|
15
|
+
id: "#".concat(name),
|
|
16
|
+
toString: function () {
|
|
15
17
|
return name;
|
|
16
18
|
},
|
|
17
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classnames.js","sourceRoot":"src/","sources":["util/classnames.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"classnames.js","sourceRoot":"src/","sources":["util/classnames.ts"],"names":[],"mappings":";;;;AAAO,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,qBAAM,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;AA1BW,QAAA,UAAU,cA0BrB"}
|