@visactor/vtable 0.15.5-alpha.2 → 0.15.5-alpha.3

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/es/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import type { MousePointerCellEvent } from './ts-types/events';
12
12
  import * as CustomLayout from './render/layout';
13
13
  export { getDataCellPath } from './tools/get-data-path';
14
14
  export * from './render/jsx';
15
- export declare const version = "0.15.5-alpha.2";
15
+ export declare const version = "0.15.5-alpha.3";
16
16
  export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, IIndicator, ITitleDefine, ICornerDefine, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
17
17
  declare function getIcons(): {
18
18
  [key: string]: TYPES.ColumnIconOption;
package/es/index.js CHANGED
@@ -24,7 +24,7 @@ export { getDataCellPath } from "./tools/get-data-path";
24
24
 
25
25
  export * from "./render/jsx";
26
26
 
27
- export const version = "0.15.5-alpha.2";
27
+ export const version = "0.15.5-alpha.3";
28
28
 
29
29
  export { TYPES, core, ListTable, PivotTable, PivotChart, themes, data, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
30
30
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAsB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\n// import { container, loadCanvasPicker } from '@visactor/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.15.5-alpha.2\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAsB3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAIxC,OAAO,EAKL,KAAK,EACL,IAAI,EACJ,SAAS,EAET,UAAU,EAGV,UAAU,EAiBV,MAAM,EACN,IAAI,EAEJ,QAAQ,EACR,WAAW,EAEX,QAAQ,EAIR,cAAc,EACd,YAAY,EACb,CAAC;AAGF,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AACD,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\n// import { container, loadCanvasPicker } from '@visactor/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.15.5-alpha.3\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
@@ -7,39 +7,27 @@ import { getQuadProps } from "../utils/padding";
7
7
  export function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPosition) {
8
8
  var _a, _b, _c, _d;
9
9
  if (!frameTheme) return;
10
- const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme;
11
- let hasShadow = !1;
12
- const groupAttributes = {}, rectAttributes = {
10
+ const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme, groupAttributes = {}, rectAttributes = {
13
11
  pickable: !1
14
12
  };
15
13
  shadowBlur && isTableGroup && (rectAttributes.shadowBlur = shadowBlur, rectAttributes.shadowOffsetX = shadowOffsetX,
16
14
  rectAttributes.shadowOffsetY = shadowOffsetY, rectAttributes.shadowColor = shadowColor,
17
15
  rectAttributes.stroke = !0, rectAttributes.stroke = shadowColor, rectAttributes.lineWidth = 1,
18
- hasShadow = !0), borderLineWidth && (rectAttributes.stroke = !0, rectAttributes.fill = !1,
19
- rectAttributes.stroke = getStroke(borderColor, strokeArray), rectAttributes.lineWidth = borderLineWidth,
20
- borderLineDash && (rectAttributes.lineDash = borderLineDash), rectAttributes.lineCap = "square"),
21
- Array.isArray(borderColor) && (rectAttributes.strokeArrayColor = getQuadProps(borderColor)),
16
+ rectAttributes.fill = !0, rectAttributes.fillOpacity = .01), borderLineWidth && (rectAttributes.stroke = !0,
17
+ rectAttributes.fill = !1, rectAttributes.stroke = getStroke(borderColor, strokeArray),
18
+ rectAttributes.lineWidth = borderLineWidth, borderLineDash && (rectAttributes.lineDash = borderLineDash),
19
+ rectAttributes.lineCap = "square"), Array.isArray(borderColor) && (rectAttributes.strokeArrayColor = getQuadProps(borderColor)),
22
20
  Array.isArray(borderLineWidth) && (rectAttributes.strokeArrayWidth = getQuadProps(borderLineWidth),
23
21
  rectAttributes.lineWidth = 1), cornerRadius && (rectAttributes.cornerRadius = cornerRadius,
24
22
  groupAttributes.cornerRadius = cornerRadius);
25
23
  const borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_a = rectAttributes.lineWidth) && void 0 !== _a ? _a : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0;
26
24
  if (group.setAttributes(groupAttributes), !justForXYPosition && rectAttributes.stroke) if (rectAttributes.x = borderLeft / 2,
27
25
  rectAttributes.y = borderTop / 2, rectAttributes.pickable = !1, isTableGroup) {
28
- let shadowRect, borderRect;
26
+ let borderRect;
29
27
  rectAttributes.x = -borderLeft / 2, rectAttributes.y = -borderTop / 2, rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2,
30
28
  rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2,
31
- hasShadow ? (rectAttributes.fill = "white", rectAttributes.notAdjustPos = !0, shadowRect = createRect(rectAttributes),
32
- borderRect = createGroup({
33
- x: group.attribute.x,
34
- y: group.attribute.y,
35
- width: group.attribute.width,
36
- height: group.attribute.height,
37
- fill: "red",
38
- cornerRadius: group.attribute.cornerRadius,
39
- globalCompositeOperation: "destination-out"
40
- }), borderRect.name = "table-border-rect", borderRect.addChild(shadowRect)) : (borderRect = createRect(rectAttributes),
41
- borderRect.name = "table-border-rect"), group.parent.insertBefore(borderRect, group),
42
- group.border = borderRect;
29
+ borderRect = createRect(rectAttributes), borderRect.name = "table-border-rect",
30
+ group.parent.insertBefore(borderRect, group), group.border = borderRect;
43
31
  } else {
44
32
  rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2,
45
33
  rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,MAAM,UAAU,iB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AAE,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAChC,KAAK,CAAC,MAAM,CAAC,UAAoB,CAAC,aAAa,CAAC;YAC/C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK;YAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;SAC/B,CAAC,CAAC;KACJ;AACH,CAAC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRect, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createGroup, createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n let hasShadow = false;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n hasShadow = true;\n\n // rectAttributes.fill = true;\n // rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = -borderLeft / 2;\n rectAttributes.y = -borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n\n let shadowRect;\n let borderRect;\n if (hasShadow) {\n rectAttributes.fill = 'white';\n (rectAttributes as any).notAdjustPos = true;\n // first draw\n shadowRect = createRect(rectAttributes);\n // second draw\n borderRect = createGroup({\n x: group.attribute.x,\n y: group.attribute.y,\n width: group.attribute.width,\n height: group.attribute.height,\n fill: 'red',\n cornerRadius: group.attribute.cornerRadius,\n globalCompositeOperation: 'destination-out'\n });\n borderRect.name = 'table-border-rect';\n borderRect.addChild(shadowRect);\n } else {\n borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n }\n\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n\n if (group.border.type === 'group') {\n (group.border.firstChild as IRect).setAttributes({\n width: group.attribute.width,\n height: group.attribute.height\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/style/frame-border.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA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MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IAEtD,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QAChC,KAAK,CAAC,MAAM,CAAC,UAAoB,CAAC,aAAa,CAAC;YAC/C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK;YAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;SAC/B,CAAC,CAAC;KACJ;AACH,CAAC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRect, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createGroup, createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n const hasShadow = false;\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n // hasShadow = true;\n\n rectAttributes.fill = true;\n rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n // if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n // const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n // const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n // groupAttributes.x = deltaX;\n // groupAttributes.y = deltaY;\n // // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n // }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = -borderLeft / 2;\n rectAttributes.y = -borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n\n let shadowRect;\n let borderRect;\n if (hasShadow) {\n rectAttributes.fill = 'white';\n (rectAttributes as any).notAdjustPos = true;\n // first draw\n shadowRect = createRect(rectAttributes);\n // second draw\n borderRect = createGroup({\n x: group.attribute.x,\n y: group.attribute.y,\n width: group.attribute.width,\n height: group.attribute.height,\n fill: 'red',\n cornerRadius: group.attribute.cornerRadius,\n globalCompositeOperation: 'destination-out'\n });\n borderRect.name = 'table-border-rect';\n borderRect.addChild(shadowRect);\n } else {\n borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n }\n\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nexport function getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n\n if (group.border.type === 'group') {\n (group.border.firstChild as IRect).setAttributes({\n width: group.attribute.width,\n height: group.attribute.height\n });\n }\n}\n"]}
@@ -55,4 +55,5 @@ export default {
55
55
  selectionStyle: {
56
56
  cellBgColor: "rgba(0, 0, 255,0.1)"
57
57
  }
58
- };
58
+ };
59
+ //# sourceMappingURL=BRIGHT.js.map
package/es/themes/DARK.js CHANGED
@@ -74,5 +74,4 @@ export default {
74
74
  cellBorderColor: "#4284FF",
75
75
  cellBorderLineWidth: 2
76
76
  }
77
- };
78
- //# sourceMappingURL=DARK.js.map
77
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vtable",
3
- "version": "0.15.5-alpha.2",
3
+ "version": "0.15.5-alpha.3",
4
4
  "description": "canvas table width high performance",
5
5
  "keywords": [
6
6
  "grid",
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@visactor/vtable-editors": "0.15.5-alpha.2",
38
+ "@visactor/vtable-editors": "0.15.5-alpha.3",
39
39
  "@visactor/vrender": "0.16.17",
40
40
  "@visactor/vrender-components": "0.16.17",
41
41
  "@visactor/vutils-extension": "1.5.1-alpha.0",
@@ -93,8 +93,8 @@
93
93
  "@resvg/resvg-js": "^2.5.0",
94
94
  "pikaday": "1.8.2",
95
95
  "@internal/bundler": "0.0.1",
96
- "@internal/eslint-config": "0.0.1",
97
- "@internal/ts-config": "0.0.1"
96
+ "@internal/ts-config": "0.0.1",
97
+ "@internal/eslint-config": "0.0.1"
98
98
  },
99
99
  "unpkg": "latest",
100
100
  "unpkgFiles": [