@visactor/react-vtable 1.6.0-alpha.5 → 1.6.0
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/cjs/components/avatar/avatar.d.ts +15 -0
- package/cjs/components/avatar/avatar.js +84 -0
- package/cjs/components/avatar/avatar.js.map +1 -0
- package/cjs/components/button/button.d.ts +27 -0
- package/cjs/components/button/button.js +107 -0
- package/cjs/components/button/button.js.map +1 -0
- package/cjs/components/checkbox/checkbox.d.ts +17 -0
- package/cjs/components/checkbox/checkbox.js +69 -0
- package/cjs/components/checkbox/checkbox.js.map +1 -0
- package/cjs/components/index.d.ts +7 -19
- package/cjs/components/index.js +4 -101
- package/cjs/components/index.js.map +1 -1
- package/cjs/components/link/link.d.ts +30 -0
- package/cjs/components/link/link.js +118 -0
- package/cjs/components/link/link.js.map +1 -0
- package/cjs/components/popover/popover.d.ts +13 -0
- package/cjs/components/popover/popover.js +281 -0
- package/cjs/components/popover/popover.js.map +1 -0
- package/cjs/components/radio/radio.d.ts +15 -0
- package/cjs/components/radio/radio.js +64 -0
- package/cjs/components/radio/radio.js.map +1 -0
- package/cjs/components/tag/tag.d.ts +13 -0
- package/cjs/components/tag/tag.js +48 -0
- package/cjs/components/tag/tag.js.map +1 -0
- package/cjs/components/vrender-components/checkbox.d.ts +4 -0
- package/cjs/components/vrender-components/checkbox.js +6 -0
- package/cjs/components/vrender-components/checkbox.js.map +1 -0
- package/cjs/components/vrender-components/component-creater.d.ts +2 -0
- package/cjs/components/vrender-components/component-creater.js +22 -0
- package/cjs/components/vrender-components/component-creater.js.map +1 -0
- package/cjs/components/vrender-components/radio.d.ts +4 -0
- package/cjs/components/vrender-components/radio.js +6 -0
- package/cjs/components/vrender-components/radio.js.map +1 -0
- package/cjs/components/vrender-components/tag.d.ts +4 -0
- package/cjs/components/vrender-components/tag.js +6 -0
- package/cjs/components/vrender-components/tag.js.map +1 -0
- package/cjs/components/vrender-components/type.d.ts +6 -0
- package/cjs/components/vrender-components/type.js +6 -0
- package/cjs/components/vrender-components/type.js.map +1 -0
- package/cjs/constants.js +2 -1
- package/cjs/eventsUtils.d.ts +1 -1
- package/cjs/eventsUtils.js +1 -1
- package/cjs/eventsUtils.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/{components → table-components}/base-component.js +1 -0
- package/cjs/table-components/base-component.js.map +1 -0
- package/cjs/table-components/component/emptyTip.js.map +1 -0
- package/cjs/table-components/component/menu.js.map +1 -0
- package/cjs/table-components/component/title.d.ts +4 -0
- package/cjs/table-components/component/title.js +10 -0
- package/cjs/table-components/component/title.js.map +1 -0
- package/cjs/table-components/component/tooltip.js.map +1 -0
- package/cjs/{components → table-components}/custom/custom-layout.d.ts +1 -1
- package/cjs/{components → table-components}/custom/custom-layout.js +2 -6
- package/cjs/table-components/custom/custom-layout.js.map +1 -0
- package/{es/components → cjs/table-components}/custom/graphic.d.ts +1 -14
- package/cjs/table-components/custom/graphic.js.map +1 -0
- package/cjs/table-components/custom/reconciler.d.ts +5 -0
- package/cjs/{components → table-components}/custom/reconciler.js +12 -10
- package/cjs/table-components/custom/reconciler.js.map +1 -0
- package/cjs/table-components/custom/vtable-browser-env-contribution.d.ts +7 -0
- package/cjs/{components → table-components}/custom/vtable-browser-env-contribution.js +4 -4
- package/cjs/table-components/custom/vtable-browser-env-contribution.js.map +1 -0
- package/{es/components → cjs/table-components}/custom/vtable-react-attribute-plugin.d.ts +2 -8
- package/cjs/{components → table-components}/custom/vtable-react-attribute-plugin.js +6 -6
- package/cjs/table-components/custom/vtable-react-attribute-plugin.js.map +1 -0
- package/cjs/table-components/custom-component.js.map +1 -0
- package/cjs/table-components/index.d.ts +19 -0
- package/cjs/table-components/index.js +130 -0
- package/cjs/table-components/index.js.map +1 -0
- package/cjs/table-components/list/list-column.js.map +1 -0
- package/cjs/table-components/pivot/pivot-corner.js.map +1 -0
- package/cjs/table-components/pivot/pivot-dimension.js.map +1 -0
- package/cjs/table-components/pivot/pivot-header-title.js.map +1 -0
- package/cjs/table-components/pivot/pivot-indicator.js.map +1 -0
- package/cjs/tables/base-table.d.ts +5 -4
- package/cjs/tables/base-table.js +7 -12
- package/cjs/tables/base-table.js.map +1 -1
- package/cjs/tables/index.d.ts +2 -0
- package/cjs/tables/index.js +19 -1
- package/cjs/tables/index.js.map +1 -1
- package/cjs/tables/list-table-simple.d.ts +8 -0
- package/cjs/tables/list-table-simple.js +13 -0
- package/cjs/tables/list-table-simple.js.map +1 -0
- package/cjs/tables/list-table.d.ts +1 -1
- package/cjs/tables/list-table.js +5 -2
- package/cjs/tables/list-table.js.map +1 -1
- package/cjs/tables/pivot-chart.d.ts +5 -1
- package/cjs/tables/pivot-chart.js +6 -29
- package/cjs/tables/pivot-chart.js.map +1 -1
- package/cjs/tables/pivot-table-simple.d.ts +8 -0
- package/cjs/tables/pivot-table-simple.js +13 -0
- package/cjs/tables/pivot-table-simple.js.map +1 -0
- package/cjs/tables/pivot-table.d.ts +1 -1
- package/cjs/tables/pivot-table.js +5 -2
- package/cjs/tables/pivot-table.js.map +1 -1
- package/cjs/util.js +1 -2
- package/cjs/vtable.d.ts +1 -2
- package/cjs/vtable.js +0 -33
- package/cjs/vtable.js.map +1 -1
- package/es/components/avatar/avatar.d.ts +15 -0
- package/es/components/avatar/avatar.js +82 -0
- package/es/components/avatar/avatar.js.map +1 -0
- package/es/components/button/button.d.ts +27 -0
- package/es/components/button/button.js +84 -0
- package/es/components/button/button.js.map +1 -0
- package/es/components/checkbox/checkbox.d.ts +17 -0
- package/es/components/checkbox/checkbox.js +48 -0
- package/es/components/checkbox/checkbox.js.map +1 -0
- package/es/components/index.d.ts +7 -19
- package/es/components/index.js +7 -17
- package/es/components/index.js.map +1 -1
- package/es/components/link/link.d.ts +30 -0
- package/es/components/link/link.js +95 -0
- package/es/components/link/link.js.map +1 -0
- package/es/components/popover/popover.d.ts +13 -0
- package/es/components/popover/popover.js +258 -0
- package/es/components/popover/popover.js.map +1 -0
- package/es/components/radio/radio.d.ts +15 -0
- package/es/components/radio/radio.js +43 -0
- package/es/components/radio/radio.js.map +1 -0
- package/es/components/tag/tag.d.ts +13 -0
- package/es/components/tag/tag.js +46 -0
- package/es/components/tag/tag.js.map +1 -0
- package/es/components/vrender-components/checkbox.d.ts +4 -0
- package/es/components/vrender-components/checkbox.js +2 -0
- package/es/components/vrender-components/checkbox.js.map +1 -0
- package/es/components/vrender-components/component-creater.d.ts +2 -0
- package/es/components/vrender-components/component-creater.js +14 -0
- package/es/components/vrender-components/component-creater.js.map +1 -0
- package/es/components/vrender-components/radio.d.ts +4 -0
- package/es/components/vrender-components/radio.js +2 -0
- package/es/components/vrender-components/radio.js.map +1 -0
- package/es/components/vrender-components/tag.d.ts +4 -0
- package/es/components/vrender-components/tag.js +2 -0
- package/es/components/vrender-components/tag.js.map +1 -0
- package/es/components/vrender-components/type.d.ts +6 -0
- package/es/components/vrender-components/type.js +2 -0
- package/es/components/vrender-components/type.js.map +1 -0
- package/es/constants.js +2 -1
- package/es/eventsUtils.d.ts +1 -1
- package/es/eventsUtils.js +2 -2
- package/es/eventsUtils.js.map +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +3 -3
- package/es/index.js.map +1 -1
- package/es/{components → table-components}/base-component.js +2 -1
- package/es/table-components/base-component.js.map +1 -0
- package/es/table-components/component/emptyTip.js.map +1 -0
- package/es/table-components/component/menu.js.map +1 -0
- package/es/table-components/component/title.d.ts +4 -0
- package/es/table-components/component/title.js +4 -0
- package/es/table-components/component/title.js.map +1 -0
- package/es/table-components/component/tooltip.js.map +1 -0
- package/es/{components → table-components}/custom/custom-layout.d.ts +1 -1
- package/es/{components → table-components}/custom/custom-layout.js +1 -7
- package/es/table-components/custom/custom-layout.js.map +1 -0
- package/{cjs/components → es/table-components}/custom/graphic.d.ts +1 -14
- package/es/table-components/custom/graphic.js.map +1 -0
- package/es/table-components/custom/reconciler.d.ts +5 -0
- package/es/{components → table-components}/custom/reconciler.js +9 -8
- package/es/table-components/custom/reconciler.js.map +1 -0
- package/es/table-components/custom/vtable-browser-env-contribution.d.ts +7 -0
- package/es/{components → table-components}/custom/vtable-browser-env-contribution.js +3 -3
- package/es/table-components/custom/vtable-browser-env-contribution.js.map +1 -0
- package/{cjs/components → es/table-components}/custom/vtable-react-attribute-plugin.d.ts +2 -8
- package/es/{components → table-components}/custom/vtable-react-attribute-plugin.js +1 -3
- package/es/table-components/custom/vtable-react-attribute-plugin.js.map +1 -0
- package/es/table-components/custom-component.js.map +1 -0
- package/es/table-components/index.d.ts +19 -0
- package/es/table-components/index.js +24 -0
- package/es/table-components/index.js.map +1 -0
- package/es/table-components/list/list-column.js.map +1 -0
- package/es/table-components/pivot/pivot-corner.js.map +1 -0
- package/es/table-components/pivot/pivot-dimension.js.map +1 -0
- package/es/table-components/pivot/pivot-header-title.js.map +1 -0
- package/es/table-components/pivot/pivot-indicator.js.map +1 -0
- package/es/tables/base-table.d.ts +5 -4
- package/es/tables/base-table.js +8 -15
- package/es/tables/base-table.js.map +1 -1
- package/es/tables/index.d.ts +2 -0
- package/es/tables/index.js +4 -0
- package/es/tables/index.js.map +1 -1
- package/es/tables/list-table-simple.d.ts +8 -0
- package/es/tables/list-table-simple.js +9 -0
- package/es/tables/list-table-simple.js.map +1 -0
- package/es/tables/list-table.d.ts +1 -1
- package/es/tables/list-table.js +6 -1
- package/es/tables/list-table.js.map +1 -1
- package/es/tables/pivot-chart.d.ts +5 -1
- package/es/tables/pivot-chart.js +8 -3
- package/es/tables/pivot-chart.js.map +1 -1
- package/es/tables/pivot-table-simple.d.ts +8 -0
- package/es/tables/pivot-table-simple.js +9 -0
- package/es/tables/pivot-table-simple.js.map +1 -0
- package/es/tables/pivot-table.d.ts +1 -1
- package/es/tables/pivot-table.js +6 -1
- package/es/tables/pivot-table.js.map +1 -1
- package/es/util.js +1 -2
- package/es/vtable.d.ts +1 -2
- package/es/vtable.js +1 -3
- package/es/vtable.js.map +1 -1
- package/package.json +5 -5
- package/cjs/components/base-component.js.map +0 -1
- package/cjs/components/component/emptyTip.js.map +0 -1
- package/cjs/components/component/menu.js.map +0 -1
- package/cjs/components/component/tooltip.js.map +0 -1
- package/cjs/components/custom/component.d.ts +0 -16
- package/cjs/components/custom/component.js +0 -7
- package/cjs/components/custom/component.js.map +0 -1
- package/cjs/components/custom/custom-layout.js.map +0 -1
- package/cjs/components/custom/graphic.js.map +0 -1
- package/cjs/components/custom/reconciler.d.ts +0 -5
- package/cjs/components/custom/reconciler.js.map +0 -1
- package/cjs/components/custom/vtable-browser-env-contribution.d.ts +0 -2
- package/cjs/components/custom/vtable-browser-env-contribution.js.map +0 -1
- package/cjs/components/custom/vtable-react-attribute-plugin.js.map +0 -1
- package/cjs/components/custom-component.js.map +0 -1
- package/cjs/components/list/list-column.js.map +0 -1
- package/cjs/components/pivot/pivot-corner.js.map +0 -1
- package/cjs/components/pivot/pivot-dimension.js.map +0 -1
- package/cjs/components/pivot/pivot-header-title.js.map +0 -1
- package/cjs/components/pivot/pivot-indicator.js.map +0 -1
- package/dist/react-vtable.js +0 -13799
- package/dist/react-vtable.min.js +0 -46
- package/es/components/base-component.js.map +0 -1
- package/es/components/component/emptyTip.js.map +0 -1
- package/es/components/component/menu.js.map +0 -1
- package/es/components/component/tooltip.js.map +0 -1
- package/es/components/custom/component.d.ts +0 -16
- package/es/components/custom/component.js +0 -6
- package/es/components/custom/component.js.map +0 -1
- package/es/components/custom/custom-layout.js.map +0 -1
- package/es/components/custom/graphic.js.map +0 -1
- package/es/components/custom/reconciler.d.ts +0 -5
- package/es/components/custom/reconciler.js.map +0 -1
- package/es/components/custom/vtable-browser-env-contribution.d.ts +0 -2
- package/es/components/custom/vtable-browser-env-contribution.js.map +0 -1
- package/es/components/custom/vtable-react-attribute-plugin.js.map +0 -1
- package/es/components/custom-component.js.map +0 -1
- package/es/components/list/list-column.js.map +0 -1
- package/es/components/pivot/pivot-corner.js.map +0 -1
- package/es/components/pivot/pivot-dimension.js.map +0 -1
- package/es/components/pivot/pivot-header-title.js.map +0 -1
- package/es/components/pivot/pivot-indicator.js.map +0 -1
- /package/cjs/{components → table-components}/base-component.d.ts +0 -0
- /package/cjs/{components → table-components}/component/emptyTip.d.ts +0 -0
- /package/cjs/{components → table-components}/component/emptyTip.js +0 -0
- /package/cjs/{components → table-components}/component/menu.d.ts +0 -0
- /package/cjs/{components → table-components}/component/menu.js +0 -0
- /package/cjs/{components → table-components}/component/tooltip.d.ts +0 -0
- /package/cjs/{components → table-components}/component/tooltip.js +0 -0
- /package/cjs/{components → table-components}/custom/graphic.js +0 -0
- /package/cjs/{components → table-components}/custom-component.d.ts +0 -0
- /package/cjs/{components → table-components}/custom-component.js +0 -0
- /package/cjs/{components → table-components}/list/list-column.d.ts +0 -0
- /package/cjs/{components → table-components}/list/list-column.js +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-corner.d.ts +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-corner.js +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-dimension.d.ts +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-dimension.js +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-header-title.d.ts +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-header-title.js +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-indicator.d.ts +0 -0
- /package/cjs/{components → table-components}/pivot/pivot-indicator.js +0 -0
- /package/es/{components → table-components}/base-component.d.ts +0 -0
- /package/es/{components → table-components}/component/emptyTip.d.ts +0 -0
- /package/es/{components → table-components}/component/emptyTip.js +0 -0
- /package/es/{components → table-components}/component/menu.d.ts +0 -0
- /package/es/{components → table-components}/component/menu.js +0 -0
- /package/es/{components → table-components}/component/tooltip.d.ts +0 -0
- /package/es/{components → table-components}/component/tooltip.js +0 -0
- /package/es/{components → table-components}/custom/graphic.js +0 -0
- /package/es/{components → table-components}/custom-component.d.ts +0 -0
- /package/es/{components → table-components}/custom-component.js +0 -0
- /package/es/{components → table-components}/list/list-column.d.ts +0 -0
- /package/es/{components → table-components}/list/list-column.js +0 -0
- /package/es/{components → table-components}/pivot/pivot-corner.d.ts +0 -0
- /package/es/{components → table-components}/pivot/pivot-corner.js +0 -0
- /package/es/{components → table-components}/pivot/pivot-dimension.d.ts +0 -0
- /package/es/{components → table-components}/pivot/pivot-dimension.js +0 -0
- /package/es/{components → table-components}/pivot/pivot-header-title.d.ts +0 -0
- /package/es/{components → table-components}/pivot/pivot-header-title.js +0 -0
- /package/es/{components → table-components}/pivot/pivot-indicator.d.ts +0 -0
- /package/es/{components → table-components}/pivot/pivot-indicator.js +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IGroup } from '@visactor/vtable/es/vrender';
|
|
2
|
+
import { type BackgroundAttributes, type Cursor, type ITextGraphicAttribute } from '@visactor/vtable/es/vrender';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
children?: string | React.ReactNode;
|
|
6
|
+
textStyle?: Partial<ITextGraphicAttribute>;
|
|
7
|
+
panelStyle?: BackgroundAttributes;
|
|
8
|
+
size?: number;
|
|
9
|
+
shape?: 'circle' | 'square';
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
cursor?: Cursor;
|
|
12
|
+
autoFixFontSize?: boolean;
|
|
13
|
+
onClick?: (e: Event) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<IGroup>>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
}), exports.Avatar = void 0;
|
|
12
|
+
|
|
13
|
+
const vrender_1 = require("@visactor/vtable/es/vrender"), vutils_1 = require("@visactor/vutils"), react_1 = __importDefault(require("react")), table_components_1 = require("../../table-components"), defaultProps = {
|
|
14
|
+
textStyle: {
|
|
15
|
+
fontSize: 14,
|
|
16
|
+
fontFamily: "sans-serif",
|
|
17
|
+
fill: "#FFF"
|
|
18
|
+
},
|
|
19
|
+
panelStyle: {
|
|
20
|
+
visible: !0,
|
|
21
|
+
fill: "rgb(201, 205, 212)",
|
|
22
|
+
lineWidth: 1,
|
|
23
|
+
cornerRadius: 2
|
|
24
|
+
},
|
|
25
|
+
size: 40,
|
|
26
|
+
shape: "circle",
|
|
27
|
+
autoFixFontSize: !0
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function AvatarComponent(baseProps, ref) {
|
|
31
|
+
const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {size: size, children: children, onClick: onClick} = props;
|
|
32
|
+
let avatarRef = react_1.default.useRef(null);
|
|
33
|
+
avatarRef = ref || avatarRef;
|
|
34
|
+
const handleClick = react_1.default.useCallback((event => {
|
|
35
|
+
onClick && onClick(event);
|
|
36
|
+
}), [ onClick ]), groupAttribute = getGroupAttribute(props);
|
|
37
|
+
if ((0, vutils_1.isString)(children)) {
|
|
38
|
+
const textAttribute = getTextAttribute(props);
|
|
39
|
+
return react_1.default.createElement(table_components_1.Group, {
|
|
40
|
+
ref: avatarRef,
|
|
41
|
+
attribute: groupAttribute,
|
|
42
|
+
onClick: handleClick
|
|
43
|
+
}, react_1.default.createElement(table_components_1.Text, {
|
|
44
|
+
attribute: textAttribute
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
return "image" === children.type && (children.props.attribute.width = size, children.props.attribute.height = size),
|
|
48
|
+
react_1.default.createElement(table_components_1.Group, {
|
|
49
|
+
ref: avatarRef,
|
|
50
|
+
attribute: groupAttribute,
|
|
51
|
+
onClick: handleClick
|
|
52
|
+
}, children);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getTextAttribute(props) {
|
|
56
|
+
const {textStyle: textStyle, size: size, children: children, autoFixFontSize: autoFixFontSize} = props, attribute = Object.assign({
|
|
57
|
+
text: children
|
|
58
|
+
}, textStyle);
|
|
59
|
+
return autoFixFontSize && getAutoFixFontSize(size, attribute), attribute;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getGroupAttribute(props) {
|
|
63
|
+
var _a;
|
|
64
|
+
const {panelStyle: panelStyle, size: size, shape: shape} = props;
|
|
65
|
+
return Object.assign(Object.assign({}, panelStyle), {
|
|
66
|
+
width: size,
|
|
67
|
+
height: size,
|
|
68
|
+
clip: !0,
|
|
69
|
+
cornerRadius: "circle" === shape ? size / 2 : null !== (_a = panelStyle.cornerRadius) && void 0 !== _a ? _a : 2,
|
|
70
|
+
display: "flex",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
justifyContent: "center",
|
|
73
|
+
visibleAll: !0,
|
|
74
|
+
path: void 0
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getAutoFixFontSize(size, attribute) {
|
|
79
|
+
const scale = size / ((0, vrender_1.measureTextSize)(attribute.text, attribute).width + 8), fontSize = Math.max(Math.floor(attribute.fontSize * scale), 6);
|
|
80
|
+
attribute.fontSize = fontSize;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=avatar.js.map
|
|
84
|
+
exports.Avatar = react_1.default.forwardRef(AvatarComponent), exports.Avatar.displayName = "Avatar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/avatar/avatar.tsx"],"names":[],"mappings":";;;;;;AACA,yDASqC;AAErC,6CAAmD;AAEnD,kDAAyC;AACzC,6DAA4D;AAc5D,MAAM,YAAY,GAAgB;IAChC,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,MAAM;KACb;IACD,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,oBAAoB;QAC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CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IACrE,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAChC,CAAC","file":"avatar.js","sourcesContent":["import type { IGroup, IGroupAttribute } from '@visactor/vtable/es/vrender';\nimport {\n measureTextSize,\n type BackgroundAttributes,\n type Cursor,\n type IRectGraphicAttribute,\n type ITextGraphicAttribute,\n type Padding,\n type Tag,\n type TagAttributes\n} from '@visactor/vtable/es/vrender';\nimport { Tag as VTag } from '../vrender-components/tag';\nimport { isString, merge } from '@visactor/vutils';\nimport type { ReactElement } from 'react';\nimport React, { useEffect } from 'react';\nimport { Group, Image, Text } from '../../table-components';\n\nexport interface AvatarProps {\n children?: string | React.ReactNode;\n textStyle?: Partial<ITextGraphicAttribute>;\n panelStyle?: BackgroundAttributes;\n size?: number;\n shape?: 'circle' | 'square';\n visible?: boolean;\n cursor?: Cursor;\n autoFixFontSize?: boolean;\n onClick?: (e: Event) => void;\n}\n\nconst defaultProps: AvatarProps = {\n textStyle: {\n fontSize: 14,\n fontFamily: 'sans-serif',\n fill: '#FFF'\n },\n panelStyle: {\n visible: true,\n fill: 'rgb(201, 205, 212)',\n lineWidth: 1,\n cornerRadius: 2\n },\n size: 40,\n shape: 'circle',\n autoFixFontSize: true\n // cursor: 'pointer',\n};\n\nfunction AvatarComponent(baseProps: AvatarProps, ref: React.Ref<IGroup>) {\n const props: AvatarProps = merge({}, defaultProps, baseProps);\n const { size, children, onClick } = props;\n let avatarRef = React.useRef<IGroup>(null);\n avatarRef = ref ? (ref as React.RefObject<IGroup>) : avatarRef;\n\n const handleClick: React.MouseEventHandler<HTMLElement> = React.useCallback(\n (event: any): void => {\n onClick && onClick(event);\n },\n [onClick]\n );\n\n const groupAttribute = getGroupAttribute(props);\n if (isString(children)) {\n const textAttribute = getTextAttribute(props);\n return (\n <Group ref={avatarRef} attribute={groupAttribute} onClick={handleClick}>\n <Text attribute={textAttribute}></Text>\n </Group>\n );\n }\n if ((children as ReactElement).type === 'image') {\n (children as ReactElement).props.attribute.width = size;\n (children as ReactElement).props.attribute.height = size;\n }\n return (\n <Group ref={avatarRef} attribute={groupAttribute} onClick={handleClick}>\n {children}\n </Group>\n );\n}\n\nfunction getTextAttribute(props: AvatarProps) {\n const { textStyle, size, children, autoFixFontSize } = props;\n\n const attribute: ITextGraphicAttribute = {\n text: children as string,\n ...textStyle\n };\n\n if (autoFixFontSize) {\n getAutoFixFontSize(size, attribute);\n }\n\n return attribute;\n}\nfunction getGroupAttribute(props: AvatarProps) {\n const { panelStyle, size, shape } = props;\n const attribute: IGroupAttribute = {\n ...panelStyle,\n width: size,\n height: size,\n clip: true,\n cornerRadius: shape === 'circle' ? size / 2 : panelStyle.cornerRadius ?? 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n visibleAll: true,\n path: undefined\n };\n return attribute;\n}\n\nexport const Avatar = React.forwardRef<IGroup, AvatarProps>(AvatarComponent);\n\nAvatar.displayName = 'Avatar';\n\n// auto adjust font size\nfunction getAutoFixFontSize(size: number, attribute: ITextGraphicAttribute) {\n const textWidth = measureTextSize(attribute.text, attribute).width;\n const scale = size / (textWidth + 8);\n const fontSize = Math.max(Math.floor(attribute.fontSize * scale), 6);\n attribute.fontSize = fontSize;\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BackgroundAttributes, Cursor, IRectGraphicAttribute, ITextGraphicAttribute, Padding, Tag } from '@visactor/vtable/es/vrender';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface ButtonStateStyle {
|
|
4
|
+
textStyle?: {
|
|
5
|
+
hover?: Partial<ITextGraphicAttribute>;
|
|
6
|
+
disabled?: Partial<ITextGraphicAttribute>;
|
|
7
|
+
};
|
|
8
|
+
panelStyle?: {
|
|
9
|
+
hover?: Partial<IRectGraphicAttribute>;
|
|
10
|
+
disabled?: Partial<IRectGraphicAttribute>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ButtonProps {
|
|
14
|
+
children?: string;
|
|
15
|
+
textStyle?: Partial<ITextGraphicAttribute>;
|
|
16
|
+
padding?: Padding;
|
|
17
|
+
panelStyle?: BackgroundAttributes;
|
|
18
|
+
minWidth?: number;
|
|
19
|
+
maxWidth?: number;
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
state?: ButtonStateStyle;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
cursor?: Cursor;
|
|
24
|
+
onClick?: (e: Event) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<Tag>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
value: v
|
|
18
|
+
});
|
|
19
|
+
} : function(o, v) {
|
|
20
|
+
o.default = v;
|
|
21
|
+
}), __importStar = this && this.__importStar || function(mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
|
|
25
|
+
return __setModuleDefault(result, mod), result;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
Object.defineProperty(exports, "__esModule", {
|
|
29
|
+
value: !0
|
|
30
|
+
}), exports.Button = void 0;
|
|
31
|
+
|
|
32
|
+
const tag_1 = require("../vrender-components/tag"), vutils_1 = require("@visactor/vutils"), react_1 = __importStar(require("react")), defaultProps = {
|
|
33
|
+
textStyle: {
|
|
34
|
+
fontSize: 14,
|
|
35
|
+
fontFamily: "sans-serif",
|
|
36
|
+
fill: "#FFF"
|
|
37
|
+
},
|
|
38
|
+
panelStyle: {
|
|
39
|
+
visible: !0,
|
|
40
|
+
fill: "rgb(22, 93, 255)",
|
|
41
|
+
lineWidth: 1,
|
|
42
|
+
cornerRadius: 2
|
|
43
|
+
},
|
|
44
|
+
padding: 10,
|
|
45
|
+
state: {
|
|
46
|
+
panelStyle: {
|
|
47
|
+
hover: {
|
|
48
|
+
fill: "rgb(64, 128, 255)"
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
fill: "rgb(148, 191, 255)"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function ButtonComponent(baseProps, ref) {
|
|
58
|
+
const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {disabled: disabled, onClick: onClick} = props;
|
|
59
|
+
let buttonRef = react_1.default.useRef(null);
|
|
60
|
+
buttonRef = ref || buttonRef;
|
|
61
|
+
const handleClick = react_1.default.useCallback((event => {
|
|
62
|
+
disabled ? "function" == typeof (null == event ? void 0 : event.preventDefault) && event.preventDefault() : onClick && onClick(event);
|
|
63
|
+
}), [ disabled, onClick ]), attribute = getTagAttribute(props);
|
|
64
|
+
return (0, react_1.useEffect)((() => {
|
|
65
|
+
buttonRef.current.addEventListener("mouseenter", (() => {
|
|
66
|
+
disabled || (buttonRef.current.addState("hover", !0, !1), buttonRef.current.stage.renderNextFrame());
|
|
67
|
+
})), buttonRef.current.addEventListener("mouseleave", (() => {
|
|
68
|
+
disabled || (buttonRef.current.removeState("hover", !1), buttonRef.current.stage.renderNextFrame());
|
|
69
|
+
}));
|
|
70
|
+
})), (0, react_1.useEffect)((() => {
|
|
71
|
+
disabled ? (buttonRef.current.removeState("disabled", !1), buttonRef.current.addState("disabled", !0, !1)) : buttonRef.current.removeState("disabled", !1),
|
|
72
|
+
buttonRef.current.stage.renderNextFrame();
|
|
73
|
+
})), react_1.default.createElement(tag_1.Tag, {
|
|
74
|
+
ref: buttonRef,
|
|
75
|
+
attribute: attribute,
|
|
76
|
+
onClick: handleClick
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function getTagAttribute(props) {
|
|
81
|
+
var _a, _b, _c, _d;
|
|
82
|
+
const {textStyle: textStyle, padding: padding, panelStyle: panelStyle, minWidth: minWidth, maxWidth: maxWidth, visible: visible, cursor: cursor, disabled: disabled, state: state, children: children} = props;
|
|
83
|
+
return {
|
|
84
|
+
text: children,
|
|
85
|
+
textStyle: textStyle,
|
|
86
|
+
padding: padding,
|
|
87
|
+
panel: panelStyle,
|
|
88
|
+
minWidth: minWidth,
|
|
89
|
+
maxWidth: maxWidth,
|
|
90
|
+
visible: visible,
|
|
91
|
+
cursor: (null != cursor ? cursor : disabled) ? "not-allowed" : "pointer",
|
|
92
|
+
childrenPickable: !1,
|
|
93
|
+
state: {
|
|
94
|
+
text: {
|
|
95
|
+
hover: null === (_a = null == state ? void 0 : state.textStyle) || void 0 === _a ? void 0 : _a.hover,
|
|
96
|
+
disabled: null === (_b = null == state ? void 0 : state.textStyle) || void 0 === _b ? void 0 : _b.disabled
|
|
97
|
+
},
|
|
98
|
+
panel: {
|
|
99
|
+
hover: null === (_c = null == state ? void 0 : state.panelStyle) || void 0 === _c ? void 0 : _c.hover,
|
|
100
|
+
disabled: null === (_d = null == state ? void 0 : state.panelStyle) || void 0 === _d ? void 0 : _d.disabled
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
exports.Button = react_1.default.forwardRef(ButtonComponent), exports.Button.displayName = "Button";
|
|
107
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/button/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASA,mDAAwD;AACxD,6CAAyC;AACzC,+CAAyC;AA2BzC,MAAM,YAAY,GAAgB;IAChC,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,MAAM;KACb;IACD,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,OAAO,EAAE,EAAE;IAEX,KAAK,EAAE;QACL,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,mBAAmB;aAC1B;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,oBAAoB;aAC3B;SACF;KACF;CACF,CAAC;AAEF,SAAS,eAAe,CAAC,SAAsB,EAAE,GAAmB;IAClE,MAAM,KAAK,GAAgB,IAAA,cAAK,EAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAC9D,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpC,IAAI,SAAS,GAAG,eAAK,CAAC,MAAM,CAAM,IAAI,CAAC,CAAC;IACxC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAE,GAA4B,CAAC,CAAC,CAAC,SAAS,CAAC;IAE5D,MAAM,WAAW,GAAyC,eAAK,CAAC,WAAW,CACzE,CAAC,KAAU,EAAQ,EAAE;QACnB,IAAI,QAAQ,EAAE;YACZ,OAAO,CAAA,KAAK,aAAL,KAAK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ribute,\n ITextGraphicAttribute,\n Padding,\n Tag,\n TagAttributes\n} from '@visactor/vtable/es/vrender';\nimport { Tag as VTag } from '../vrender-components/tag';\nimport { merge } from '@visactor/vutils';\nimport React, { useEffect } from 'react';\n\ninterface ButtonStateStyle {\n textStyle?: {\n hover?: Partial<ITextGraphicAttribute>;\n disabled?: Partial<ITextGraphicAttribute>;\n };\n panelStyle?: {\n hover?: Partial<IRectGraphicAttribute>;\n disabled?: Partial<IRectGraphicAttribute>;\n };\n}\n\nexport interface ButtonProps {\n children?: string;\n textStyle?: Partial<ITextGraphicAttribute>;\n padding?: Padding;\n panelStyle?: BackgroundAttributes;\n minWidth?: number;\n maxWidth?: number;\n visible?: boolean;\n state?: ButtonStateStyle;\n disabled?: boolean;\n cursor?: Cursor;\n onClick?: (e: Event) => void;\n}\n\nconst defaultProps: ButtonProps = {\n textStyle: {\n fontSize: 14,\n fontFamily: 'sans-serif',\n fill: '#FFF'\n },\n panelStyle: {\n visible: true,\n fill: 'rgb(22, 93, 255)',\n lineWidth: 1,\n cornerRadius: 2\n },\n padding: 10,\n // cursor: 'pointer',\n state: {\n panelStyle: {\n hover: {\n fill: 'rgb(64, 128, 255)'\n },\n disabled: {\n fill: 'rgb(148, 191, 255)'\n }\n }\n }\n};\n\nfunction ButtonComponent(baseProps: ButtonProps, ref: React.Ref<Tag>) {\n const props: ButtonProps = merge({}, defaultProps, baseProps);\n const { disabled, onClick } = props;\n let buttonRef = React.useRef<Tag>(null);\n buttonRef = ref ? (ref as React.RefObject<Tag>) : buttonRef;\n\n const handleClick: React.MouseEventHandler<HTMLElement> = React.useCallback(\n (event: any): void => {\n if (disabled) {\n typeof event?.preventDefault === 'function' && event.preventDefault();\n return;\n }\n onClick && onClick(event);\n },\n [disabled, onClick]\n );\n\n const attribute: TagAttributes = getTagAttribute(props);\n\n useEffect(() => {\n buttonRef.current.addEventListener('mouseenter', () => {\n // console.log('mouseenter', buttonRef.current, e.clone());\n if (!disabled) {\n buttonRef.current.addState('hover', true, false);\n // buttonRef.current._bgRect.addState('hover', true, false);\n // buttonRef.current._textShape.addState('hover', true, false);\n buttonRef.current.stage.renderNextFrame();\n }\n });\n buttonRef.current.addEventListener('mouseleave', () => {\n // console.log('mouseleave', buttonRef.current, e.clone());\n if (!disabled) {\n buttonRef.current.removeState('hover', false);\n // buttonRef.current._bgRect.removeState('hover', false);\n // buttonRef.current._textShape.removeState('hover', false);\n buttonRef.current.stage.renderNextFrame();\n }\n });\n });\n\n useEffect(() => {\n if (disabled) {\n buttonRef.current.removeState('disabled', false);\n // buttonRef.current._bgRect.removeState('disabled', false);\n // buttonRef.current._textShape.removeState('disabled', false);\n\n buttonRef.current.addState('disabled', true, false);\n // buttonRef.current._bgRect.addState('disabled', true, false);\n // buttonRef.current._textShape.addState('disabled', true, false);\n // console.log('add disable');\n } else {\n buttonRef.current.removeState('disabled', false);\n // buttonRef.current._bgRect.removeState('disabled', false);\n // buttonRef.current._textShape.removeState('disabled', false);\n // console.log('remove disable');\n }\n buttonRef.current.stage.renderNextFrame();\n });\n\n return <VTag ref={buttonRef} attribute={attribute} onClick={handleClick}></VTag>;\n}\n\nfunction getTagAttribute(props: ButtonProps) {\n const { textStyle, padding, panelStyle, minWidth, maxWidth, visible, cursor, disabled, state, children } = props;\n const attr: TagAttributes = {\n text: children,\n textStyle,\n padding,\n panel: panelStyle,\n minWidth,\n maxWidth,\n visible,\n cursor: cursor ?? disabled ? 'not-allowed' : 'pointer',\n childrenPickable: false,\n state: {\n text: {\n hover: state?.textStyle?.hover,\n disabled: state?.textStyle?.disabled\n },\n panel: {\n hover: state?.panelStyle?.hover,\n disabled: state?.panelStyle?.disabled\n }\n }\n };\n\n return attr;\n}\n\nexport const Button = React.forwardRef<Tag, ButtonProps>(ButtonComponent);\n\nButton.displayName = 'Button';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Cursor, CheckBox as VRenderCheckbox, CheckboxAttributes } from '@visactor/vtable/es/vrender';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
children?: string;
|
|
5
|
+
textStyle?: CheckboxAttributes['text'];
|
|
6
|
+
boxStyle?: CheckboxAttributes['box'];
|
|
7
|
+
iconStyle?: CheckboxAttributes['icon'];
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
interactive?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
disableCursor?: Cursor;
|
|
13
|
+
spaceBetweenTextAndIcon?: number;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
onChange?: (checked: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<VRenderCheckbox>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", {
|
|
16
|
+
enumerable: !0,
|
|
17
|
+
value: v
|
|
18
|
+
});
|
|
19
|
+
} : function(o, v) {
|
|
20
|
+
o.default = v;
|
|
21
|
+
}), __importStar = this && this.__importStar || function(mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
|
|
25
|
+
return __setModuleDefault(result, mod), result;
|
|
26
|
+
}, __rest = this && this.__rest || function(s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
29
|
+
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
30
|
+
var i = 0;
|
|
31
|
+
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37
|
+
value: !0
|
|
38
|
+
}), exports.Checkbox = void 0;
|
|
39
|
+
|
|
40
|
+
const checkbox_1 = require("../vrender-components/checkbox"), vutils_1 = require("@visactor/vutils"), react_1 = __importStar(require("react")), defaultProps = {};
|
|
41
|
+
|
|
42
|
+
function CheckboxComponent(baseProps, ref) {
|
|
43
|
+
const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {textStyle: textStyle, boxStyle: boxStyle, iconStyle: iconStyle, children: children} = props, rest = __rest(props, [ "textStyle", "boxStyle", "iconStyle", "children" ]);
|
|
44
|
+
let checkboxRef = react_1.default.useRef(null);
|
|
45
|
+
checkboxRef = ref || checkboxRef;
|
|
46
|
+
const handleChange = (0, react_1.useCallback)((event => {
|
|
47
|
+
props.onChange && props.onChange(event.target.attribute.checked);
|
|
48
|
+
}), []);
|
|
49
|
+
return (0, react_1.useEffect)((() => {
|
|
50
|
+
var _a;
|
|
51
|
+
return null === (_a = checkboxRef.current) || void 0 === _a || _a.addEventListener("checkbox_state_change", handleChange),
|
|
52
|
+
() => {
|
|
53
|
+
var _a;
|
|
54
|
+
null === (_a = checkboxRef.current) || void 0 === _a || _a.removeEventListener("checkbox_state_change", handleChange);
|
|
55
|
+
};
|
|
56
|
+
}), []), react_1.default.createElement(checkbox_1.Checkbox, {
|
|
57
|
+
ref: checkboxRef,
|
|
58
|
+
attribute: Object.assign({
|
|
59
|
+
text: Object.assign(Object.assign({}, textStyle), {
|
|
60
|
+
text: children
|
|
61
|
+
}),
|
|
62
|
+
box: boxStyle,
|
|
63
|
+
icon: iconStyle
|
|
64
|
+
}, rest)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.Checkbox = react_1.default.forwardRef(CheckboxComponent), exports.Checkbox.displayName = "Checkbox";
|
|
69
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/checkbox/checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,6DAAuE;AACvE,6CAAyC;AACzC,+CAAsD;AAiBtD,MAAM,YAAY,GAAkB,EAAE,CAAC;AAEvC,SAAS,iBAAiB,CAAC,SAAwB,EAAE,GAA+B;IAClF,MAAM,KAAK,GAAkB,IAAA,cAAK,EAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAChE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA7D,kDAAqD,CAAQ,CAAC;IACpE,IAAI,WAAW,GAAG,eAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAAC;IACtD,WAAW,GAAG,GAAG,CAAC,CAAC,CAAE,GAAwC,CAAC,CAAC,CAAC,WAAW,CAAC;IAE5E,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAC,CAAC,KAAkC,EAAE,EAAE;QACtE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;;QACb,MAAA,WAAW,CAAC,OAAO,0CAAE,gBAAgB,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;QAC7E,OAAO,GAAG,EAAE;;YACV,MAAA,WAAW,CAAC,OAAO,0CAAE,mBAAmB,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;QAClF,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BAAC,mBAAS,IACR,GAAG,EAAE,WAAW,EAChB,SAAS,kBACP,IAAI,kCACC,SAAS,KACZ,IAAI,EAAE,QAAQ,KAEhB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,SAAS,IACZ,IAAI,IAEE,CACd,CAAC;AACJ,CAAC;AAEY,QAAA,QAAQ,GAAG,eAAK,CAAC,UAAU,CAAiC,iBAAiB,CAAC,CAAC;AAE5F,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","file":"checkbox.js","sourcesContent":["import type {\n BackgroundAttributes,\n Cursor,\n IRectGraphicAttribute,\n ITextGraphicAttribute,\n Padding,\n CheckBox as VRenderCheckbox,\n CheckboxAttributes\n} from '@visactor/vtable/es/vrender';\nimport { Checkbox as VCheckbox } from '../vrender-components/checkbox';\nimport { merge } from '@visactor/vutils';\nimport React, { useCallback, useEffect } from 'react';\n\nexport interface CheckboxProps {\n children?: string;\n textStyle?: CheckboxAttributes['text'];\n boxStyle?: CheckboxAttributes['box'];\n iconStyle?: CheckboxAttributes['icon'];\n checked?: boolean;\n indeterminate?: boolean;\n interactive?: boolean;\n disabled?: boolean;\n disableCursor?: Cursor;\n spaceBetweenTextAndIcon?: number;\n visible?: boolean;\n onChange?: (checked: boolean) => void;\n}\n\nconst defaultProps: CheckboxProps = {};\n\nfunction CheckboxComponent(baseProps: CheckboxProps, ref: React.Ref<VRenderCheckbox>) {\n const props: CheckboxProps = merge({}, defaultProps, baseProps);\n const { textStyle, boxStyle, iconStyle, children, ...rest } = props;\n let checkboxRef = React.useRef<VRenderCheckbox>(null);\n checkboxRef = ref ? (ref as React.RefObject<VRenderCheckbox>) : checkboxRef;\n\n const handleChange = useCallback((event: { target: VRenderCheckbox }) => {\n props.onChange && props.onChange(event.target.attribute.checked);\n }, []);\n\n useEffect(() => {\n checkboxRef.current?.addEventListener('checkbox_state_change', handleChange);\n return () => {\n checkboxRef.current?.removeEventListener('checkbox_state_change', handleChange);\n };\n }, []);\n\n return (\n <VCheckbox\n ref={checkboxRef}\n attribute={{\n text: {\n ...textStyle,\n text: children\n },\n box: boxStyle,\n icon: iconStyle,\n ...rest\n }}\n ></VCheckbox>\n );\n}\n\nexport const Checkbox = React.forwardRef<VRenderCheckbox, CheckboxProps>(CheckboxComponent);\n\nCheckbox.displayName = 'Checkbox';\n"]}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export { Tooltip } from './component/tooltip';
|
|
9
|
-
export { EmptyTip } from './component/emptyTip';
|
|
10
|
-
export { CustomComponent } from './custom-component';
|
|
11
|
-
export { CustomLayout, type CustomLayoutFunctionArg } from './custom/custom-layout';
|
|
12
|
-
export * from './custom/graphic';
|
|
13
|
-
export * from './custom/component';
|
|
14
|
-
type Props = {
|
|
15
|
-
updateId?: number;
|
|
16
|
-
};
|
|
17
|
-
export interface IMarkElement extends React.ReactElement<Props, React.JSXElementConstructor<Props>> {
|
|
18
|
-
id: string | number;
|
|
19
|
-
}
|
|
1
|
+
export * from './button/button';
|
|
2
|
+
export * from './link/link';
|
|
3
|
+
export * from './avatar/avatar';
|
|
4
|
+
export * from './popover/popover';
|
|
5
|
+
export * from './tag/tag';
|
|
6
|
+
export * from './radio/radio';
|
|
7
|
+
export * from './checkbox/checkbox';
|
package/cjs/components/index.js
CHANGED
|
@@ -17,105 +17,8 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Object.defineProperty(exports, "ListColumn", {
|
|
25
|
-
enumerable: !0,
|
|
26
|
-
get: function() {
|
|
27
|
-
return list_column_1.ListColumn;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
var pivot_dimension_1 = require("./pivot/pivot-dimension");
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "PivotColumnDimension", {
|
|
34
|
-
enumerable: !0,
|
|
35
|
-
get: function() {
|
|
36
|
-
return pivot_dimension_1.PivotColumnDimension;
|
|
37
|
-
}
|
|
38
|
-
}), Object.defineProperty(exports, "PivotRowDimension", {
|
|
39
|
-
enumerable: !0,
|
|
40
|
-
get: function() {
|
|
41
|
-
return pivot_dimension_1.PivotRowDimension;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
var pivot_indicator_1 = require("./pivot/pivot-indicator");
|
|
46
|
-
|
|
47
|
-
Object.defineProperty(exports, "PivotIndicator", {
|
|
48
|
-
enumerable: !0,
|
|
49
|
-
get: function() {
|
|
50
|
-
return pivot_indicator_1.PivotIndicator;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
var pivot_header_title_1 = require("./pivot/pivot-header-title");
|
|
55
|
-
|
|
56
|
-
Object.defineProperty(exports, "PivotColumnHeaderTitle", {
|
|
57
|
-
enumerable: !0,
|
|
58
|
-
get: function() {
|
|
59
|
-
return pivot_header_title_1.PivotColumnHeaderTitle;
|
|
60
|
-
}
|
|
61
|
-
}), Object.defineProperty(exports, "PivotRowHeaderTitle", {
|
|
62
|
-
enumerable: !0,
|
|
63
|
-
get: function() {
|
|
64
|
-
return pivot_header_title_1.PivotRowHeaderTitle;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
var pivot_corner_1 = require("./pivot/pivot-corner");
|
|
69
|
-
|
|
70
|
-
Object.defineProperty(exports, "PivotCorner", {
|
|
71
|
-
enumerable: !0,
|
|
72
|
-
get: function() {
|
|
73
|
-
return pivot_corner_1.PivotCorner;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
var menu_1 = require("./component/menu");
|
|
78
|
-
|
|
79
|
-
Object.defineProperty(exports, "Menu", {
|
|
80
|
-
enumerable: !0,
|
|
81
|
-
get: function() {
|
|
82
|
-
return menu_1.Menu;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
var tooltip_1 = require("./component/tooltip");
|
|
87
|
-
|
|
88
|
-
Object.defineProperty(exports, "Tooltip", {
|
|
89
|
-
enumerable: !0,
|
|
90
|
-
get: function() {
|
|
91
|
-
return tooltip_1.Tooltip;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var emptyTip_1 = require("./component/emptyTip");
|
|
96
|
-
|
|
97
|
-
Object.defineProperty(exports, "EmptyTip", {
|
|
98
|
-
enumerable: !0,
|
|
99
|
-
get: function() {
|
|
100
|
-
return emptyTip_1.EmptyTip;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
var custom_component_1 = require("./custom-component");
|
|
105
|
-
|
|
106
|
-
Object.defineProperty(exports, "CustomComponent", {
|
|
107
|
-
enumerable: !0,
|
|
108
|
-
get: function() {
|
|
109
|
-
return custom_component_1.CustomComponent;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
var custom_layout_1 = require("./custom/custom-layout");
|
|
114
|
-
|
|
115
|
-
Object.defineProperty(exports, "CustomLayout", {
|
|
116
|
-
enumerable: !0,
|
|
117
|
-
get: function() {
|
|
118
|
-
return custom_layout_1.CustomLayout;
|
|
119
|
-
}
|
|
120
|
-
}), __exportStar(require("./custom/graphic"), exports), __exportStar(require("./custom/component"), exports);
|
|
20
|
+
}), __exportStar(require("./button/button"), exports), __exportStar(require("./link/link"), exports),
|
|
21
|
+
__exportStar(require("./avatar/avatar"), exports), __exportStar(require("./popover/popover"), exports),
|
|
22
|
+
__exportStar(require("./tag/tag"), exports), __exportStar(require("./radio/radio"), exports),
|
|
23
|
+
__exportStar(require("./checkbox/checkbox"), exports);
|
|
121
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,kDAAgC;AAChC,8CAA4B;AAC5B,kDAAgC;AAChC,oDAAkC;AAClC,4CAA0B;AAC1B,gDAA8B;AAC9B,sDAAoC","file":"index.js","sourcesContent":["// export * from './vrender-components/tag';\n// export * from './vrender-components/checkbox';\n// export * from './vrender-components/radio';\nexport * from './button/button';\nexport * from './link/link';\nexport * from './avatar/avatar';\nexport * from './popover/popover';\nexport * from './tag/tag';\nexport * from './radio/radio';\nexport * from './checkbox/checkbox';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BackgroundAttributes, Cursor, IRectGraphicAttribute, ITextGraphicAttribute, Padding, Tag } from '@visactor/vtable/es/vrender';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface LinkStateStyle {
|
|
4
|
+
textStyle?: {
|
|
5
|
+
hover?: Partial<ITextGraphicAttribute>;
|
|
6
|
+
disabled?: Partial<ITextGraphicAttribute>;
|
|
7
|
+
};
|
|
8
|
+
panelStyle?: {
|
|
9
|
+
hover?: Partial<IRectGraphicAttribute>;
|
|
10
|
+
disabled?: Partial<IRectGraphicAttribute>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface LinkProps {
|
|
14
|
+
children?: string;
|
|
15
|
+
textStyle?: Partial<ITextGraphicAttribute>;
|
|
16
|
+
padding?: Padding;
|
|
17
|
+
space?: number;
|
|
18
|
+
panelStyle?: BackgroundAttributes;
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
maxWidth?: number;
|
|
21
|
+
visible?: boolean;
|
|
22
|
+
state?: LinkStateStyle;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
icon?: boolean;
|
|
25
|
+
cursor?: Cursor;
|
|
26
|
+
href?: string;
|
|
27
|
+
onClick?: (e: Event) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<Tag>>;
|
|
30
|
+
export {};
|