@antv/component 2.0.4 → 2.1.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +31 -37
- 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 +30 -43
- package/esm/core/component.js.map +1 -1
- package/esm/shapes/Text.js +13 -21
- package/esm/shapes/Text.js.map +1 -1
- package/esm/ui/axis/axis.d.ts +1 -1
- package/esm/ui/axis/axis.js +25 -31
- package/esm/ui/axis/axis.js.map +1 -1
- package/esm/ui/axis/constant.js +11 -13
- 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 +29 -34
- package/esm/ui/axis/guides/grid.js.map +1 -1
- package/esm/ui/axis/guides/labels.js +76 -83
- package/esm/ui/axis/guides/labels.js.map +1 -1
- package/esm/ui/axis/guides/line.js +74 -87
- 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 +31 -39
- 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 +33 -37
- package/esm/ui/axis/guides/title.js.map +1 -1
- package/esm/ui/axis/guides/utils.js +10 -12
- package/esm/ui/axis/guides/utils.js.map +1 -1
- package/esm/ui/axis/overlap/autoEllipsis.js +12 -19
- package/esm/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/esm/ui/axis/overlap/autoHide.js +20 -24
- package/esm/ui/axis/overlap/autoHide.js.map +1 -1
- package/esm/ui/axis/overlap/autoRotate.js +11 -25
- package/esm/ui/axis/overlap/autoRotate.js.map +1 -1
- package/esm/ui/axis/overlap/autoWrap.js +11 -14
- 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 +48 -75
- 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 +3 -7
- package/esm/ui/axis/utils/index.js.map +1 -1
- package/esm/ui/axis/utils/intersect.js +21 -33
- package/esm/ui/axis/utils/intersect.js.map +1 -1
- package/esm/ui/axis/utils/test.js +29 -41
- package/esm/ui/axis/utils/test.js.map +1 -1
- package/esm/ui/breadcrumb/index.js +64 -72
- 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 +81 -97
- 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 +23 -26
- package/esm/ui/checkbox/index.js.map +1 -1
- package/esm/ui/crosshair/base.js +29 -45
- package/esm/ui/crosshair/base.js.map +1 -1
- package/esm/ui/crosshair/circle.js +25 -34
- 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 +55 -75
- package/esm/ui/crosshair/line.js.map +1 -1
- package/esm/ui/crosshair/polygon.js +54 -70
- package/esm/ui/crosshair/polygon.js.map +1 -1
- package/esm/ui/grid/index.d.ts +1 -1
- package/esm/ui/grid/index.js +73 -95
- 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 +58 -63
- package/esm/ui/indicator/indicator.js.map +1 -1
- package/esm/ui/layout/layout.js +52 -66
- package/esm/ui/layout/layout.js.map +1 -1
- package/esm/ui/legend/base.js +12 -13
- package/esm/ui/legend/base.js.map +1 -1
- package/esm/ui/legend/category/item.js +122 -156
- package/esm/ui/legend/category/item.js.map +1 -1
- package/esm/ui/legend/category/items.js +158 -201
- package/esm/ui/legend/category/items.js.map +1 -1
- package/esm/ui/legend/category.js +46 -56
- 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 +28 -33
- package/esm/ui/legend/continuous/handle.js.map +1 -1
- package/esm/ui/legend/continuous/ribbon.js +34 -38
- package/esm/ui/legend/continuous/ribbon.js.map +1 -1
- package/esm/ui/legend/continuous/utils.js +10 -11
- package/esm/ui/legend/continuous/utils.js.map +1 -1
- package/esm/ui/legend/continuous.js +417 -521
- package/esm/ui/legend/continuous.js.map +1 -1
- package/esm/ui/legend/utils.js +24 -31
- package/esm/ui/legend/utils.js.map +1 -1
- package/esm/ui/marker/index.js +38 -44
- 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 +128 -159
- package/esm/ui/navigator/index.js.map +1 -1
- package/esm/ui/poptip/constant.d.ts +1 -1
- package/esm/ui/poptip/constant.js +68 -69
- package/esm/ui/poptip/constant.js.map +1 -1
- package/esm/ui/poptip/index.js +95 -111
- package/esm/ui/poptip/index.js.map +1 -1
- package/esm/ui/poptip/utils.js +8 -15
- package/esm/ui/poptip/utils.js.map +1 -1
- package/esm/ui/scrollbar/index.js +102 -132
- package/esm/ui/scrollbar/index.js.map +1 -1
- package/esm/ui/select/option.js +48 -58
- package/esm/ui/select/option.js.map +1 -1
- package/esm/ui/select/select.js +142 -164
- 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 +46 -54
- package/esm/ui/slider/handle.js.map +1 -1
- package/esm/ui/slider/index.js +282 -328
- package/esm/ui/slider/index.js.map +1 -1
- package/esm/ui/sparkline/columns.js +25 -34
- package/esm/ui/sparkline/columns.js.map +1 -1
- package/esm/ui/sparkline/index.js +145 -180
- package/esm/ui/sparkline/index.js.map +1 -1
- package/esm/ui/sparkline/lines.js +37 -50
- package/esm/ui/sparkline/lines.js.map +1 -1
- package/esm/ui/sparkline/path.js +36 -40
- package/esm/ui/sparkline/path.js.map +1 -1
- package/esm/ui/sparkline/utils.js +10 -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 +44 -54
- package/esm/ui/switch/index.js.map +1 -1
- package/esm/ui/tag/index.js +29 -32
- package/esm/ui/tag/index.js.map +1 -1
- package/esm/ui/timebar/controller.js +69 -79
- package/esm/ui/timebar/controller.js.map +1 -1
- package/esm/ui/timebar/handle.js +62 -71
- package/esm/ui/timebar/handle.js.map +1 -1
- package/esm/ui/timebar/icons.js +308 -478
- package/esm/ui/timebar/icons.js.map +1 -1
- package/esm/ui/timebar/timebar.js +263 -318
- 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 +2 -6
- package/esm/ui/timeline/index.js.map +1 -1
- package/esm/ui/title/index.js +59 -64
- package/esm/ui/title/index.js.map +1 -1
- package/esm/ui/title/types.d.ts +1 -1
- package/esm/ui/tooltip/constant.js +26 -30
- package/esm/ui/tooltip/constant.js.map +1 -1
- package/esm/ui/tooltip/index.js +109 -126
- package/esm/ui/tooltip/index.js.map +1 -1
- package/esm/util/bbox.js +24 -47
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/callback.js +1 -2
- package/esm/util/callback.js.map +1 -1
- package/esm/util/classnames.js +8 -10
- package/esm/util/classnames.js.map +1 -1
- package/esm/util/deep-assign.js +6 -14
- 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 +1 -2
- 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 +1 -4
- package/esm/util/geometry/line-length.js.map +1 -1
- package/esm/util/geometry/lines-intersection.js +5 -10
- 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 +3 -5
- package/esm/util/if-show.js.map +1 -1
- package/esm/util/in-range.js +1 -3
- package/esm/util/in-range.js.map +1 -1
- package/esm/util/interpolate.js +12 -19
- package/esm/util/interpolate.js.map +1 -1
- package/esm/util/keyframe-interpolate.d.ts +1 -1
- package/esm/util/keyframe-interpolate.js +6 -7
- 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 +24 -26
- 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 +7 -8
- package/esm/util/layout/utils/helper.js.map +1 -1
- package/esm/util/matrix.js +7 -8
- package/esm/util/matrix.js.map +1 -1
- package/esm/util/number.js +6 -7
- package/esm/util/number.js.map +1 -1
- package/esm/util/offscreen.js +9 -17
- 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 +36 -41
- 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 +3 -4
- 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 +4 -5
- package/esm/util/scale-to-pixel.js.map +1 -1
- package/esm/util/selection.js +142 -186
- 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 +15 -27
- package/esm/util/shape.js.map +1 -1
- package/esm/util/string.js +4 -5
- package/esm/util/string.js.map +1 -1
- package/esm/util/style.js +23 -29
- package/esm/util/style.js.map +1 -1
- package/esm/util/svg2marker.js +13 -16
- package/esm/util/svg2marker.js.map +1 -1
- package/esm/util/text.d.ts +1 -9
- package/esm/util/text.js +14 -14
- package/esm/util/text.js.map +1 -1
- package/esm/util/throttle.js +7 -13
- package/esm/util/throttle.js.map +1 -1
- package/esm/util/time.js +22 -24
- package/esm/util/time.js.map +1 -1
- package/esm/util/timer.js +5 -9
- package/esm/util/timer.js.map +1 -1
- package/esm/util/transform.js +5 -6
- 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 +2 -4
- 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 +33 -39
- package/lib/animation/utils.js.map +1 -1
- package/lib/core/component.js +31 -43
- 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 +15 -22
- 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 +34 -39
- package/lib/ui/axis/axis.js.map +1 -1
- package/lib/ui/axis/constant.js +10 -12
- 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 +35 -40
- package/lib/ui/axis/guides/grid.js.map +1 -1
- package/lib/ui/axis/guides/labels.js +82 -89
- package/lib/ui/axis/guides/labels.js.map +1 -1
- package/lib/ui/axis/guides/line.js +79 -92
- 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 +37 -45
- 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 +37 -41
- package/lib/ui/axis/guides/title.js.map +1 -1
- package/lib/ui/axis/guides/utils.js +12 -14
- package/lib/ui/axis/guides/utils.js.map +1 -1
- package/lib/ui/axis/overlap/autoEllipsis.js +15 -22
- package/lib/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/lib/ui/axis/overlap/autoHide.js +23 -27
- package/lib/ui/axis/overlap/autoHide.js.map +1 -1
- package/lib/ui/axis/overlap/autoRotate.js +12 -26
- package/lib/ui/axis/overlap/autoRotate.js.map +1 -1
- package/lib/ui/axis/overlap/autoWrap.js +13 -16
- 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 +49 -75
- 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 +4 -8
- package/lib/ui/axis/utils/index.js.map +1 -1
- package/lib/ui/axis/utils/intersect.js +22 -34
- package/lib/ui/axis/utils/intersect.js.map +1 -1
- package/lib/ui/axis/utils/test.js +35 -47
- package/lib/ui/axis/utils/test.js.map +1 -1
- package/lib/ui/breadcrumb/index.js +70 -77
- package/lib/ui/breadcrumb/index.js.map +1 -1
- package/lib/ui/button/index.js +86 -101
- 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 +26 -28
- package/lib/ui/checkbox/index.js.map +1 -1
- package/lib/ui/crosshair/base.js +33 -48
- package/lib/ui/crosshair/base.js.map +1 -1
- package/lib/ui/crosshair/circle.js +29 -37
- 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 +58 -77
- package/lib/ui/crosshair/line.js.map +1 -1
- package/lib/ui/crosshair/polygon.js +57 -72
- package/lib/ui/crosshair/polygon.js.map +1 -1
- package/lib/ui/grid/index.d.ts +1 -1
- package/lib/ui/grid/index.js +76 -97
- 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 +63 -67
- package/lib/ui/indicator/indicator.js.map +1 -1
- package/lib/ui/layout/layout.js +57 -70
- package/lib/ui/layout/layout.js.map +1 -1
- package/lib/ui/legend/base.js +14 -15
- package/lib/ui/legend/base.js.map +1 -1
- package/lib/ui/legend/category/item.js +126 -159
- package/lib/ui/legend/category/item.js.map +1 -1
- package/lib/ui/legend/category/items.js +166 -208
- package/lib/ui/legend/category/items.js.map +1 -1
- package/lib/ui/legend/category.js +51 -60
- 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 +31 -35
- package/lib/ui/legend/continuous/handle.js.map +1 -1
- package/lib/ui/legend/continuous/ribbon.js +40 -43
- package/lib/ui/legend/continuous/ribbon.js.map +1 -1
- package/lib/ui/legend/continuous/utils.js +10 -11
- package/lib/ui/legend/continuous/utils.js.map +1 -1
- package/lib/ui/legend/continuous.js +432 -535
- 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 +25 -32
- package/lib/ui/legend/utils.js.map +1 -1
- package/lib/ui/marker/index.js +43 -48
- 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 +135 -165
- package/lib/ui/navigator/index.js.map +1 -1
- package/lib/ui/poptip/constant.d.ts +1 -1
- package/lib/ui/poptip/constant.js +66 -67
- package/lib/ui/poptip/constant.js.map +1 -1
- package/lib/ui/poptip/index.js +100 -115
- package/lib/ui/poptip/index.js.map +1 -1
- package/lib/ui/poptip/utils.js +8 -15
- package/lib/ui/poptip/utils.js.map +1 -1
- package/lib/ui/scrollbar/index.js +107 -136
- package/lib/ui/scrollbar/index.js.map +1 -1
- package/lib/ui/select/option.js +52 -61
- package/lib/ui/select/option.js.map +1 -1
- package/lib/ui/select/select.js +148 -169
- 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 +49 -56
- package/lib/ui/slider/handle.js.map +1 -1
- package/lib/ui/slider/index.js +291 -336
- package/lib/ui/slider/index.js.map +1 -1
- package/lib/ui/sparkline/columns.js +28 -36
- package/lib/ui/sparkline/columns.js.map +1 -1
- package/lib/ui/sparkline/index.js +153 -187
- package/lib/ui/sparkline/index.js.map +1 -1
- package/lib/ui/sparkline/lines.js +40 -52
- package/lib/ui/sparkline/lines.js.map +1 -1
- package/lib/ui/sparkline/path.js +38 -42
- package/lib/ui/sparkline/path.js.map +1 -1
- package/lib/ui/sparkline/utils.js +11 -9
- package/lib/ui/sparkline/utils.js.map +1 -1
- package/lib/ui/switch/index.js +49 -58
- package/lib/ui/switch/index.js.map +1 -1
- package/lib/ui/tag/index.js +34 -36
- package/lib/ui/tag/index.js.map +1 -1
- package/lib/ui/timebar/controller.js +73 -82
- package/lib/ui/timebar/controller.js.map +1 -1
- package/lib/ui/timebar/handle.js +67 -74
- package/lib/ui/timebar/handle.js.map +1 -1
- package/lib/ui/timebar/icons.js +312 -466
- package/lib/ui/timebar/icons.js.map +1 -1
- package/lib/ui/timebar/timebar.js +272 -326
- 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 +2 -5
- package/lib/ui/timeline/index.js.map +1 -1
- package/lib/ui/title/index.js +61 -65
- package/lib/ui/title/index.js.map +1 -1
- package/lib/ui/title/types.d.ts +1 -1
- package/lib/ui/tooltip/constant.js +26 -30
- package/lib/ui/tooltip/constant.js.map +1 -1
- package/lib/ui/tooltip/index.js +113 -129
- package/lib/ui/tooltip/index.js.map +1 -1
- package/lib/util/bbox.js +24 -46
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/callback.js +2 -3
- package/lib/util/callback.js.map +1 -1
- package/lib/util/classnames.js +8 -10
- package/lib/util/classnames.js.map +1 -1
- package/lib/util/deep-assign.js +7 -15
- 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 +2 -3
- 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 +1 -4
- package/lib/util/geometry/line-length.js.map +1 -1
- package/lib/util/geometry/lines-intersection.js +5 -10
- 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 +3 -5
- package/lib/util/if-show.js.map +1 -1
- package/lib/util/in-range.js +1 -3
- package/lib/util/in-range.js.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/interpolate.js +12 -19
- package/lib/util/interpolate.js.map +1 -1
- package/lib/util/keyframe-interpolate.d.ts +1 -1
- package/lib/util/keyframe-interpolate.js +7 -8
- 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 +26 -28
- 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 +8 -9
- package/lib/util/layout/utils/helper.js.map +1 -1
- package/lib/util/matrix.js +7 -8
- package/lib/util/matrix.js.map +1 -1
- package/lib/util/number.js +6 -7
- package/lib/util/number.js.map +1 -1
- package/lib/util/offscreen.js +12 -20
- 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 +37 -42
- 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 +3 -4
- 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 +4 -5
- package/lib/util/scale-to-pixel.js.map +1 -1
- package/lib/util/selection.js +144 -187
- 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 +16 -28
- package/lib/util/shape.js.map +1 -1
- package/lib/util/string.js +4 -5
- package/lib/util/string.js.map +1 -1
- package/lib/util/style.js +24 -30
- package/lib/util/style.js.map +1 -1
- package/lib/util/svg2marker.js +15 -17
- package/lib/util/svg2marker.js.map +1 -1
- package/lib/util/text.d.ts +1 -9
- package/lib/util/text.js +16 -16
- package/lib/util/text.js.map +1 -1
- package/lib/util/throttle.js +7 -13
- package/lib/util/throttle.js.map +1 -1
- package/lib/util/time.js +22 -24
- package/lib/util/time.js.map +1 -1
- package/lib/util/timer.js +5 -9
- package/lib/util/timer.js.map +1 -1
- package/lib/util/transform.js +5 -6
- 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 +3 -5
- package/lib/util/wrap.js.map +1 -1
- package/package.json +9 -8
- package/src/ui/poptip/constant.ts +1 -1
- package/src/ui/slider/index.ts +3 -2
- package/src/ui/sparkline/utils.ts +4 -1
- package/src/ui/title/types.ts +1 -1
package/lib/ui/button/index.js
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Button = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const util_1 = require("@antv/util");
|
|
5
|
+
const core_1 = require("../../core");
|
|
6
|
+
const util_2 = require("../../util");
|
|
7
|
+
const marker_1 = require("../marker");
|
|
8
|
+
const constant_1 = require("./constant");
|
|
9
|
+
class Button extends core_1.Component {
|
|
10
|
+
get markerSize() {
|
|
11
|
+
const { markerSymbol } = this.attributes;
|
|
12
|
+
const markerStyle = this.getStyle('marker');
|
|
13
|
+
const markerSize = !markerSymbol ? 0 : (markerStyle === null || markerStyle === void 0 ? void 0 : markerStyle.size) || 2;
|
|
14
|
+
return markerSize;
|
|
15
|
+
}
|
|
16
|
+
/* 获得文本可用宽度 */
|
|
17
|
+
get textAvailableWidth() {
|
|
18
|
+
const { markerSymbol, padding, ellipsis, width: bWidth, markerSpacing: spacing } = this.attributes;
|
|
19
|
+
if (!ellipsis)
|
|
20
|
+
return Infinity;
|
|
21
|
+
/* 按钮总宽度 */
|
|
22
|
+
const width = ((0, util_1.isUndefined)(bWidth) ? this.getStyle('button').width : bWidth);
|
|
23
|
+
if (markerSymbol)
|
|
24
|
+
return width - padding * 2 - spacing - this.markerSize;
|
|
25
|
+
return width - padding * 2;
|
|
26
|
+
}
|
|
27
|
+
get buttonHeight() {
|
|
28
|
+
const { height } = this.attributes;
|
|
29
|
+
if (height)
|
|
30
|
+
return +height;
|
|
31
|
+
return +this.getStyle('button').height;
|
|
32
|
+
}
|
|
33
|
+
constructor(options) {
|
|
34
|
+
super(options, {
|
|
14
35
|
cursor: 'pointer',
|
|
15
36
|
padding: 10,
|
|
16
37
|
size: 'middle',
|
|
@@ -24,145 +45,109 @@ var Button = /** @class */ (function (_super) {
|
|
|
24
45
|
buttonRadius: 5,
|
|
25
46
|
},
|
|
26
47
|
active: {},
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
48
|
+
});
|
|
49
|
+
this.state = 'default';
|
|
50
|
+
this.clickEvents = () => {
|
|
51
|
+
const { onClick, state } = this.attributes;
|
|
31
52
|
// 点击事件
|
|
32
53
|
if (state !== 'disabled')
|
|
33
|
-
onClick === null || onClick === void 0 ? void 0 : onClick.call(
|
|
54
|
+
onClick === null || onClick === void 0 ? void 0 : onClick.call(this, this);
|
|
34
55
|
};
|
|
35
|
-
|
|
36
|
-
|
|
56
|
+
this.mouseenterEvent = () => {
|
|
57
|
+
const { state } = this.attributes;
|
|
37
58
|
if (state !== 'disabled') {
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
this.state = 'active';
|
|
60
|
+
this.render(this.attributes, this);
|
|
40
61
|
}
|
|
41
62
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
this.mouseleaveEvent = () => {
|
|
64
|
+
const { state } = this.attributes;
|
|
65
|
+
this.state = state;
|
|
66
|
+
this.render(this.attributes, this);
|
|
46
67
|
};
|
|
47
|
-
return _this;
|
|
48
68
|
}
|
|
49
|
-
Object.defineProperty(Button.prototype, "markerSize", {
|
|
50
|
-
get: function () {
|
|
51
|
-
var markerSymbol = this.attributes.markerSymbol;
|
|
52
|
-
var markerStyle = this.getStyle('marker');
|
|
53
|
-
var markerSize = !markerSymbol ? 0 : (markerStyle === null || markerStyle === void 0 ? void 0 : markerStyle.size) || 2;
|
|
54
|
-
return markerSize;
|
|
55
|
-
},
|
|
56
|
-
enumerable: false,
|
|
57
|
-
configurable: true
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(Button.prototype, "textAvailableWidth", {
|
|
60
|
-
/* 获得文本可用宽度 */
|
|
61
|
-
get: function () {
|
|
62
|
-
var _a = this.attributes, markerSymbol = _a.markerSymbol, padding = _a.padding, ellipsis = _a.ellipsis, bWidth = _a.width, spacing = _a.markerSpacing;
|
|
63
|
-
if (!ellipsis)
|
|
64
|
-
return Infinity;
|
|
65
|
-
/* 按钮总宽度 */
|
|
66
|
-
var width = ((0, util_1.isUndefined)(bWidth) ? this.getStyle('button').width : bWidth);
|
|
67
|
-
if (markerSymbol)
|
|
68
|
-
return width - padding * 2 - spacing - this.markerSize;
|
|
69
|
-
return width - padding * 2;
|
|
70
|
-
},
|
|
71
|
-
enumerable: false,
|
|
72
|
-
configurable: true
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(Button.prototype, "buttonHeight", {
|
|
75
|
-
get: function () {
|
|
76
|
-
var height = this.attributes.height;
|
|
77
|
-
if (height)
|
|
78
|
-
return +height;
|
|
79
|
-
return +this.getStyle('button').height;
|
|
80
|
-
},
|
|
81
|
-
enumerable: false,
|
|
82
|
-
configurable: true
|
|
83
|
-
});
|
|
84
69
|
/**
|
|
85
70
|
* 根据size、type属性生成实际渲染的属性
|
|
86
71
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
getStyle(name) {
|
|
73
|
+
const { size, type } = this.attributes;
|
|
74
|
+
const { state } = this;
|
|
75
|
+
const mixedStyle = (0, util_1.deepMix)({}, constant_1.SIZE_STYLE[size], constant_1.TYPE_STYLE[type][state], this.attributes.default, this.attributes[state]);
|
|
91
76
|
if (state === 'disabled') {
|
|
92
77
|
// 从DISABLED_STYLE中pick中pick mixedStyle里已有的style
|
|
93
|
-
Object.keys(mixedStyle).forEach(
|
|
78
|
+
Object.keys(mixedStyle).forEach((key) => {
|
|
94
79
|
if (key in constant_1.DISABLED_STYLE) {
|
|
95
80
|
// @ts-ignore
|
|
96
81
|
mixedStyle[key] = constant_1.DISABLED_STYLE[key];
|
|
97
82
|
}
|
|
98
83
|
});
|
|
99
|
-
Object.keys(constant_1.DISABLED_STYLE.strict).forEach(
|
|
84
|
+
Object.keys(constant_1.DISABLED_STYLE.strict).forEach((key) => {
|
|
100
85
|
// @ts-ignore
|
|
101
86
|
mixedStyle[key] = constant_1.DISABLED_STYLE.strict[key];
|
|
102
87
|
});
|
|
103
88
|
(0, util_1.deepMix)(mixedStyle, this.attributes.disabled || {});
|
|
104
89
|
}
|
|
105
90
|
return (0, util_2.subStyleProps)(mixedStyle, name);
|
|
106
|
-
}
|
|
91
|
+
}
|
|
107
92
|
// @todo 处理 markerAlign='right' 的场景. 方案: left marker & right marker 处理为两个 shape, 互相不干扰
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
render(attributes, container) {
|
|
94
|
+
const { text = '', padding = 0, markerSymbol, markerSpacing = 0, x = 0, y = 0 } = attributes;
|
|
110
95
|
container.attr({
|
|
111
96
|
cursor: this.state === 'disabled' ? 'not-allowed' : 'pointer',
|
|
112
97
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
.update({ style
|
|
98
|
+
const [pt, pr, pb, pl] = (0, util_2.parseSeriesAttr)(padding);
|
|
99
|
+
const height = this.buttonHeight;
|
|
100
|
+
const markerStyle = this.getStyle('marker');
|
|
101
|
+
const { markerSize } = this;
|
|
102
|
+
const style = Object.assign(Object.assign({}, markerStyle), { symbol: markerSymbol, x: x + pl + markerSize / 2, y: y + height / 2, size: markerSize });
|
|
103
|
+
const markerShape = (0, util_2.maybeAppend)(container, '.marker', () => new marker_1.Marker({ className: 'marker', style }))
|
|
104
|
+
.update({ style })
|
|
120
105
|
.node();
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
const bounds = markerShape.getLocalBounds();
|
|
107
|
+
const textStyle = this.getStyle('text');
|
|
123
108
|
this.textShape = (0, util_2.maybeAppend)(container, '.text', 'text')
|
|
124
109
|
.attr('className', 'text')
|
|
125
|
-
.styles(
|
|
110
|
+
.styles(Object.assign(Object.assign({ x: x + (markerSize ? bounds.max[0] + markerSpacing : pl), y: y + height / 2 }, textStyle), { text, textAlign: 'left', textBaseline: 'middle', wordWrap: true, wordWrapWidth: this.textAvailableWidth, maxLines: 1, textOverflow: '...' }))
|
|
126
111
|
.node();
|
|
127
|
-
|
|
128
|
-
|
|
112
|
+
const textBounds = this.textShape.getLocalBounds();
|
|
113
|
+
const buttonStyle = this.getStyle('button');
|
|
129
114
|
(0, util_2.select)(container)
|
|
130
115
|
.maybeAppendByClassName('.background', 'rect')
|
|
131
|
-
.styles(
|
|
132
|
-
|
|
116
|
+
.styles(Object.assign(Object.assign({ zIndex: -1 }, buttonStyle), { x,
|
|
117
|
+
y,
|
|
118
|
+
height, width: pl + (markerSize ? markerSize + markerSpacing : 0) + textBounds.halfExtents[0] * 2 + pr }));
|
|
119
|
+
}
|
|
133
120
|
/**
|
|
134
121
|
* 组件的更新
|
|
135
122
|
*/
|
|
136
|
-
|
|
137
|
-
if (attr === void 0) { attr = {}; }
|
|
123
|
+
update(attr = {}) {
|
|
138
124
|
this.attr((0, util_1.deepMix)({}, this.attributes, attr));
|
|
139
|
-
|
|
125
|
+
const { state } = this.attributes;
|
|
140
126
|
// 更新状态
|
|
141
127
|
this.state = state;
|
|
142
128
|
this.render(this.attributes, this);
|
|
143
|
-
}
|
|
129
|
+
}
|
|
144
130
|
/** 更新状态 (不需要走 update) */
|
|
145
|
-
|
|
146
|
-
this.update({ state
|
|
147
|
-
}
|
|
148
|
-
|
|
131
|
+
setState(state) {
|
|
132
|
+
this.update({ state });
|
|
133
|
+
}
|
|
134
|
+
hide() {
|
|
149
135
|
// @ts-ignore
|
|
150
136
|
this.style.visibility = 'hidden';
|
|
151
|
-
}
|
|
152
|
-
|
|
137
|
+
}
|
|
138
|
+
show() {
|
|
153
139
|
// @ts-ignore
|
|
154
140
|
this.style.visibility = 'visible';
|
|
155
|
-
}
|
|
156
|
-
|
|
141
|
+
}
|
|
142
|
+
bindEvents() {
|
|
157
143
|
this.addEventListener('click', this.clickEvents);
|
|
158
144
|
this.addEventListener('mouseenter', this.mouseenterEvent);
|
|
159
145
|
this.addEventListener('mouseleave', this.mouseleaveEvent);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
* 组件类型
|
|
163
|
-
*/
|
|
164
|
-
Button.tag = 'button';
|
|
165
|
-
return Button;
|
|
166
|
-
}(core_1.Component));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
167
148
|
exports.Button = Button;
|
|
149
|
+
/**
|
|
150
|
+
* 组件类型
|
|
151
|
+
*/
|
|
152
|
+
Button.tag = 'button';
|
|
168
153
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/button/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/button/index.ts"],"names":[],"mappings":";;;AAAA,qCAAkD;AAClD,qCAAuC;AAEvC,qCAAiF;AACjF,sCAAmC;AACnC,yCAAoE;AAKpE,MAAa,MAAO,SAAQ,gBAA2B;IAarD,IAAY,UAAU;QACpB,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,KAAI,CAAC,CAAC;QAC9D,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,cAAc;IACd,IAAY,kBAAkB;QAC5B,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QACnG,IAAI,CAAC,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC/B,WAAW;QACX,MAAM,KAAK,GAAG,CAAC,IAAA,kBAAW,EAAC,MAAM,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAW,CAAC;QAC3G,IAAI,YAAY;YAAE,OAAO,KAAK,GAAG,OAAQ,GAAG,CAAC,GAAG,OAAQ,GAAG,IAAI,CAAC,UAAU,CAAC;QAC3E,OAAO,KAAK,GAAG,OAAQ,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,IAAY,YAAY;QACtB,MAAM,EAA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I,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,yBAAyB;IAClB,QAAQ,CAAC,KAAwC;QACtD,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACzB,CAAC;IAEM,IAAI;QACT,aAAa;QACb,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IACnC,CAAC;IAEM,IAAI;QACT,aAAa;QACb,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;IACpC,CAAC;IAsBM,UAAU;QACf,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5D,CAAC;;AAhMH,wBAiMC;AAhMC;;GAEG;AACW,UAAG,GAAG,QAAQ,AAAX,CAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CHECKED_SHAPE_STYLE = exports.CHECKBOX_RECT_STYLE = exports.LABEL_TEXT_STYLE = void 0;
|
|
4
|
-
|
|
4
|
+
const util_1 = require("../../util");
|
|
5
5
|
// 默认文本样式
|
|
6
6
|
exports.LABEL_TEXT_STYLE = (0, util_1.superStyleProps)({
|
|
7
7
|
fill: 'rgba(0,0,0,0.45)',
|
|
@@ -30,7 +30,7 @@ exports.CHECKBOX_RECT_STYLE = {
|
|
|
30
30
|
cursor: 'pointer',
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
const CHECKED_SHAPE_PATH = [
|
|
34
34
|
['M', 3, 6],
|
|
35
35
|
['L', '5', '8.5'],
|
|
36
36
|
['L', '8.5', '4'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"src/","sources":["ui/checkbox/constant.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"src/","sources":["ui/checkbox/constant.ts"],"names":[],"mappings":";;;AAEA,qCAA6C;AAE7C,SAAS;AACI,QAAA,gBAAgB,GAAG,IAAA,sBAAe,EAC7C;IACE,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,OAAO;IAClB,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,MAAM;CACR,EACV,OAAO,CACR,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KACA;IACnB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KACA;CACpB,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC;IACjB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC;CACX,CAAC;AAEI,QAAA,mBAAmB,GAAG;IACjC,CAAC,EAAE,kBAAkB;IACrB,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,SAAS;CAClB,CAAC"}
|
package/lib/ui/checkbox/index.js
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Checkbox = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var constant_1 = require("./constant");
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const util_1 = require("../../util");
|
|
6
|
+
const constant_1 = require("./constant");
|
|
8
7
|
function getLablePosition(shape, spacing) {
|
|
9
|
-
|
|
8
|
+
const bounds = shape.getLocalBounds();
|
|
10
9
|
return {
|
|
11
10
|
x: bounds.halfExtents[0] ? bounds.max[0] + (spacing || 0) : shape.style.x,
|
|
12
11
|
y: bounds.halfExtents[1] ? (bounds.min[1] + bounds.max[1]) / 2 : shape.style.y,
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return _super.call(this, options, tslib_1.__assign({ labelText: '', spacing: 4, checked: false }, constant_1.LABEL_TEXT_STYLE)) || this;
|
|
14
|
+
class Checkbox extends core_1.Component {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
super(options, Object.assign({ labelText: '', spacing: 4, checked: false }, constant_1.LABEL_TEXT_STYLE));
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
render(attributes, container) {
|
|
19
|
+
const { checked, spacing } = attributes;
|
|
22
20
|
this.checked = !!checked;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
const group = (0, util_1.maybeAppend)(container, '.checkbox-content', 'g').attr('className', 'checkbox-content').node();
|
|
22
|
+
const boxStyle = (0, util_1.subStyleProps)(attributes, 'box');
|
|
23
|
+
const checkedStyle = (0, util_1.subStyleProps)(attributes, 'checked');
|
|
24
|
+
const labelStyle = (0, util_1.subStyleProps)(attributes, 'label');
|
|
25
|
+
const checkboxStyle = Object.assign(Object.assign({}, (this.checked ? constant_1.CHECKBOX_RECT_STYLE.selected : constant_1.CHECKBOX_RECT_STYLE.default)), boxStyle);
|
|
26
|
+
const checkboxBoxCheckedStyle = Object.assign(Object.assign({}, constant_1.CHECKED_SHAPE_STYLE), checkedStyle);
|
|
29
27
|
this.checkboxBoxShape = (0, util_1.maybeAppend)(group, '.checkbox-box', 'rect')
|
|
30
|
-
.styles(
|
|
28
|
+
.styles(Object.assign({ className: 'checkbox-box', zIndex: (group.style.zIndex || 0) - 1 }, checkboxStyle))
|
|
31
29
|
.node();
|
|
32
|
-
(0, util_1.maybeAppend)(this.checkboxBoxShape, '.checkbox-checked', 'path').styles(
|
|
33
|
-
|
|
34
|
-
(0, util_1.maybeAppend)(group, '.checkbox-label', 'text').styles(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
Checkbox.tag = 'checkbox';
|
|
40
|
-
return Checkbox;
|
|
41
|
-
}(core_1.Component));
|
|
30
|
+
(0, util_1.maybeAppend)(this.checkboxBoxShape, '.checkbox-checked', 'path').styles(Object.assign({ className: 'checkbox-box-checked', stroke: '#fff' }, checkboxBoxCheckedStyle));
|
|
31
|
+
const { x, y } = getLablePosition(this.checkboxBoxShape, Number(spacing));
|
|
32
|
+
(0, util_1.maybeAppend)(group, '.checkbox-label', 'text').styles(Object.assign({ className: 'checkbox-label', x,
|
|
33
|
+
y }, labelStyle));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
42
36
|
exports.Checkbox = Checkbox;
|
|
37
|
+
/**
|
|
38
|
+
* 组件 checkbox
|
|
39
|
+
*/
|
|
40
|
+
Checkbox.tag = 'checkbox';
|
|
43
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/checkbox/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/checkbox/index.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,qCAAwD;AAGxD,yCAAwF;AAIxF,SAAS,gBAAgB,CAAC,KAAW,EAAE,OAAgB;IACr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CACd,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,8BAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,8BAAmB,CAAC,OAAO,CAAC,GAC3E,QAAQ,CACZ,CAAC;QACF,MAAM,uBAAuB,mCAAQ,8BAAmB,GAAK,YAAY,CAAE,CAAC;QAE5E,IAAI,CAAC,gBAAgB,GAAG,IAAA,kBAAW,EAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC;aAChE,MAAM,iBACL,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,IAClC,aAAa,EAChB;aACD,IAAI,EAAE,CAAC;QAEV,IAAA,kBAAW,EAAC,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC,MAAM,iBACpE,SAAS,EAAE,sBAAsB,EACjC,MAAM,EAAE,MAAM,IACX,uBAAuB,EAC1B,CAAC;QAEH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAE1E,IAAA,kBAAW,EAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC,MAAM,iBAClD,SAAS,EAAE,gBAAgB,EAC3B,CAAC;YACD,CAAC,IACE,UAAU,EACb,CAAC;IACL,CAAC;;AAxDH,4BAyDC;AAxDC;;GAEG;AACW,YAAG,GAAG,UAAU,CAAC"}
|
package/lib/ui/crosshair/base.js
CHANGED
|
@@ -1,67 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CrosshairBase = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const util_1 = require("../../util");
|
|
6
|
+
const tag_1 = require("../tag");
|
|
7
|
+
const constant_1 = require("./constant");
|
|
8
|
+
class CrosshairBase extends core_1.Component {
|
|
9
|
+
/**
|
|
10
|
+
* 获得 pointer 的相对坐标
|
|
11
|
+
*/
|
|
12
|
+
get localPointer() {
|
|
13
|
+
const [bx, by] = this.getPosition();
|
|
14
|
+
const [x, y] = this.pointer;
|
|
15
|
+
return [x - bx, y - by];
|
|
16
|
+
}
|
|
17
|
+
get tagStyle() {
|
|
18
|
+
const style = (0, util_1.subStyleProps)(this.attributes, 'tag');
|
|
19
|
+
return style;
|
|
20
|
+
}
|
|
21
|
+
get crosshairStyle() {
|
|
22
|
+
const style = (0, util_1.subStyleProps)(this.attributes, 'line');
|
|
23
|
+
return Object.assign(Object.assign({}, style), { d: this.crosshairPath });
|
|
24
|
+
}
|
|
25
|
+
constructor(options) {
|
|
12
26
|
// @ts-ignore
|
|
13
|
-
|
|
27
|
+
super(options, constant_1.CROSSHAIR_BASE_DEFAULT_STYLE);
|
|
14
28
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* 获得 pointer 的相对坐标
|
|
18
|
-
*/
|
|
19
|
-
get: function () {
|
|
20
|
-
var _a = tslib_1.__read(this.getPosition(), 2), bx = _a[0], by = _a[1];
|
|
21
|
-
var _b = tslib_1.__read(this.pointer, 2), x = _b[0], y = _b[1];
|
|
22
|
-
return [x - bx, y - by];
|
|
23
|
-
},
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(CrosshairBase.prototype, "tagStyle", {
|
|
28
|
-
get: function () {
|
|
29
|
-
var style = (0, util_1.subStyleProps)(this.attributes, 'tag');
|
|
30
|
-
return style;
|
|
31
|
-
},
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(CrosshairBase.prototype, "crosshairStyle", {
|
|
36
|
-
get: function () {
|
|
37
|
-
var style = (0, util_1.subStyleProps)(this.attributes, 'line');
|
|
38
|
-
return tslib_1.__assign(tslib_1.__assign({}, style), { d: this.crosshairPath });
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
CrosshairBase.prototype.render = function (attributes, container) {
|
|
44
|
-
var group = (0, util_1.select)(container).maybeAppendByClassName('.crosshair-group', 'g').node();
|
|
29
|
+
render(attributes, container) {
|
|
30
|
+
const group = (0, util_1.select)(container).maybeAppendByClassName('.crosshair-group', 'g').node();
|
|
45
31
|
this.shapesGroup = group;
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
const tagStyle = this.tagStyle;
|
|
33
|
+
const crosshairStyle = this.crosshairStyle;
|
|
48
34
|
this.tagShape = (0, util_1.select)(group)
|
|
49
|
-
.maybeAppendByClassName('crosshair-tag',
|
|
35
|
+
.maybeAppendByClassName('crosshair-tag', () => new tag_1.Tag({ style: tagStyle }))
|
|
50
36
|
.styles(tagStyle)
|
|
51
37
|
.node();
|
|
52
38
|
this.crosshairShape = (0, util_1.select)(group).maybeAppendByClassName('.crosshair-path', 'path').styles(crosshairStyle).node();
|
|
53
39
|
this.adjustLayout();
|
|
54
|
-
}
|
|
40
|
+
}
|
|
55
41
|
/**
|
|
56
42
|
* 设置当前指针的位置
|
|
57
43
|
* 1. 线条类型 调整位置即可
|
|
58
44
|
* 2. circle 和 polygon 需要重新计算 path
|
|
59
45
|
*/
|
|
60
|
-
|
|
46
|
+
setPointer(pointer) {
|
|
61
47
|
this.pointer = pointer;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return CrosshairBase;
|
|
65
|
-
}(core_1.Component));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
66
50
|
exports.CrosshairBase = CrosshairBase;
|
|
51
|
+
CrosshairBase.tag = 'crosshair-base';
|
|
67
52
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["ui/crosshair/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["ui/crosshair/base.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAGvC,qCAAmD;AACnD,gCAA6B;AAC7B,yCAA0D;AAG1D,MAAsB,aAAiD,SAAQ,gBAAY;IAczF;;OAEG;IACH,IAAc,YAAY;QACxB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1B,CAAC;IAOD,IAAY,QAAQ;QAClB,MAAM,KAAK,GAAG,IAAA,oBAAa,EAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAY,cAAc;QACxB,MAAM,KAAK,GAAG,IAAA,oBAAa,EAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACrD,uCACK,KAAK,KACR,CAAC,EAAE,IAAI,CAAC,aAAa,IACrB;IACJ,CAAC;IAED,YAAY,OAA6B;QACvC,aAAa;QACb,KAAK,CAAC,OAAO,EAAE,uCAA4B,CAAC,CAAC;IAC/C,CAAC;IAEM,MAAM,CAAC,UAAmC,EAAE,SAAgB;QACjE,MAAM,KAAK,GAAG,IAAA,aAAM,EAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACvF,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAA,aAAM,EAAC,KAAK,CAAC;aAC1B,sBAAsB,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,SAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;aAC3E,MAAM,CAAC,QAAQ,CAAC;aAChB,IAAI,EAAE,CAAC;QACV,IAAI,CAAC,cAAc,GAAG,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;QAEpH,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,OAAc;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AApEH,sCA0EC;AAzEe,iBAAG,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CircleCrosshair = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function CircleCrosshair(options) {
|
|
12
|
-
return _super.call(this, (0, util_1.deepAssign)({}, CircleCrosshair.defaultOptions, options)) || this;
|
|
4
|
+
const util_1 = require("../../util");
|
|
5
|
+
const symbol_1 = require("../marker/symbol");
|
|
6
|
+
const base_1 = require("./base");
|
|
7
|
+
const constant_1 = require("./constant");
|
|
8
|
+
class CircleCrosshair extends base_1.CrosshairBase {
|
|
9
|
+
get crosshairPath() {
|
|
10
|
+
return this.createCirclePath();
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _b = tslib_1.__read(_a, 2), x = _b[0], y = _b[1];
|
|
26
|
-
_super.prototype.setPointer.call(this, [x, y]);
|
|
27
|
-
var _c = tslib_1.__read(this.localPointer, 2), lx = _c[0], ly = _c[1];
|
|
28
|
-
var _d = tslib_1.__read(this.attributes.center, 2), cx = _d[0], cy = _d[1];
|
|
29
|
-
var path = this.createCirclePath(Math.pow((Math.pow((lx - cx), 2) + Math.pow((ly - cy), 2)), 0.5));
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super((0, util_1.deepAssign)({}, CircleCrosshair.defaultOptions, options));
|
|
14
|
+
}
|
|
15
|
+
update(cfg) {
|
|
16
|
+
super.update(cfg);
|
|
17
|
+
}
|
|
18
|
+
setPointer([x, y]) {
|
|
19
|
+
super.setPointer([x, y]);
|
|
20
|
+
const [lx, ly] = this.localPointer;
|
|
21
|
+
const { center: [cx, cy], } = this.attributes;
|
|
22
|
+
const path = this.createCirclePath(Math.pow((Math.pow((lx - cx), 2) + Math.pow((ly - cy), 2)), 0.5));
|
|
30
23
|
this.crosshairShape.attr({ d: path });
|
|
31
|
-
}
|
|
32
|
-
|
|
24
|
+
}
|
|
25
|
+
adjustLayout() {
|
|
33
26
|
(0, util_1.hide)(this.tagShape);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
}
|
|
28
|
+
createCirclePath(radius) {
|
|
29
|
+
const { center: [x, y], defaultRadius, } = this.attributes;
|
|
37
30
|
return (0, symbol_1.circle)(x, y, radius || defaultRadius);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
CircleCrosshair.defaultOptions = {
|
|
41
|
-
style: constant_1.CIRCLE_CROSSHAIR_DEFAULT_STYLE,
|
|
42
|
-
};
|
|
43
|
-
return CircleCrosshair;
|
|
44
|
-
}(base_1.CrosshairBase));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
45
33
|
exports.CircleCrosshair = CircleCrosshair;
|
|
34
|
+
CircleCrosshair.tag = 'circle-crosshair';
|
|
35
|
+
CircleCrosshair.defaultOptions = {
|
|
36
|
+
style: constant_1.CIRCLE_CROSSHAIR_DEFAULT_STYLE,
|
|
37
|
+
};
|
|
46
38
|
//# sourceMappingURL=circle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle.js","sourceRoot":"src/","sources":["ui/crosshair/circle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"circle.js","sourceRoot":"src/","sources":["ui/crosshair/circle.ts"],"names":[],"mappings":";;;AACA,qCAA8C;AAC9C,6CAA0C;AAC1C,iCAAuC;AACvC,yCAA4D;AAK5D,MAAa,eAAgB,SAAQ,oBAAkD;IAOrF,IAAc,aAAa;QACzB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED,YAAY,OAA+B;QACzC,KAAK,CAAC,IAAA,iBAAU,EAAC,EAAE,EAAE,eAAe,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,GAA8B;QAC1C,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IAEM,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAQ;QAC7B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,MAAM,EACJ,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GACjB,GAAG,IAAI,CAAC,UAAU,CAAC;QAEpB,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAA,CAAC,SAAA,CAAC,EAAE,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,GAAG,SAAA,CAAC,EAAE,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,CAAC,EAAI,GAAG,CAAA,CAAQ,CAAC;QACpF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAES,YAAY;QACpB,IAAA,WAAI,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IAEO,gBAAgB,CAAC,MAAe;QACtC,MAAM,EACJ,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,aAAa,GACd,GAAG,IAAI,CAAC,UAAU,CAAC;QACpB,OAAO,IAAA,eAAM,EAAC,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,aAAa,CAAU,CAAC;IACxD,CAAC;;AAxCH,0CAyCC;AAxCe,mBAAG,GAAG,kBAAkB,CAAC;AAEtB,8BAAc,GAAG;IAChC,KAAK,EAAE,yCAA8B;CACtC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.POLYGON_CROSSHAIR_DEFAULT_STYLE = exports.CIRCLE_CROSSHAIR_DEFAULT_STYLE = exports.LINE_CROSSHAIR_DEFAULT_STYLE = exports.CROSSHAIR_BASE_DEFAULT_STYLE = void 0;
|
|
4
|
-
|
|
4
|
+
const util_1 = require("../../util");
|
|
5
5
|
exports.CROSSHAIR_BASE_DEFAULT_STYLE = {
|
|
6
6
|
tagText: '',
|
|
7
7
|
lineStroke: '#416180',
|