@visactor/vseed 0.0.27 → 0.0.28
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/builder/builder/builder.d.ts +48 -0
- package/dist/index.cjs +31 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -32
- package/dist/index.js.map +1 -1
- package/dist/types/advancedVSeed.d.ts +12 -0
- package/dist/types/properties/config/config.d.ts +12 -0
- package/dist/types/properties/theme/customTheme.d.ts +12 -0
- package/dist/umd/index.js +34 -357
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { clone, groupBy, isArray, isEmpty, isNullish, isNumber, isString, mergeDeep, omit, pick, sort, unique } from "remeda";
|
2
|
-
import { color as external_d3_color_color } from "d3-color";
|
3
2
|
import zod, { z } from "zod";
|
4
3
|
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
5
4
|
const { vseed } = context;
|
@@ -5916,16 +5915,14 @@ const bodyStyle = (spec, context)=>{
|
|
5916
5915
|
};
|
5917
5916
|
const { advancedVSeed } = context;
|
5918
5917
|
const { customTheme, chartType } = advancedVSeed;
|
5919
|
-
const
|
5920
|
-
if (!result.theme || !
|
5921
|
-
const borderColor =
|
5922
|
-
const backgroundColor =
|
5923
|
-
const fontColor =
|
5924
|
-
const fontSize =
|
5925
|
-
const hoverCellBgColor =
|
5926
|
-
const hoverInlineColor =
|
5927
|
-
opacity: 0.2
|
5928
|
-
}).toString();
|
5918
|
+
const themeConfig = customTheme?.config?.[chartType];
|
5919
|
+
if (!result.theme || !themeConfig) return result;
|
5920
|
+
const borderColor = themeConfig.borderColor || 'rgb(224, 224, 224)';
|
5921
|
+
const backgroundColor = themeConfig.bodyBackgroundColor || '#fff';
|
5922
|
+
const fontColor = themeConfig.bodyFontColor || '#1B1F23';
|
5923
|
+
const fontSize = themeConfig.bodyFontSize || 12;
|
5924
|
+
const hoverCellBgColor = themeConfig.hoverBodyBackgroundColor || '#bedaff';
|
5925
|
+
const hoverInlineColor = themeConfig.hoverBodyInlineBackgroundColor || '#bedaff';
|
5929
5926
|
result.theme.bodyStyle = {
|
5930
5927
|
borderColor: borderColor,
|
5931
5928
|
borderLineWidth: 1,
|
@@ -5964,7 +5961,7 @@ const headerStyle = (spec, context)=>{
|
|
5964
5961
|
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
5965
5962
|
const fontSize = themConfig.headerFontSize || 12;
|
5966
5963
|
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
5967
|
-
const hoverInlineColor = themConfig.
|
5964
|
+
const hoverInlineColor = themConfig.hoverHeaderInlineBackgroundColor || '#bedaff';
|
5968
5965
|
result.theme.headerStyle = {
|
5969
5966
|
borderColor: borderColor,
|
5970
5967
|
borderLineWidth: 1,
|
@@ -5976,9 +5973,7 @@ const headerStyle = (spec, context)=>{
|
|
5976
5973
|
],
|
5977
5974
|
textAlign: 'center',
|
5978
5975
|
hover: {
|
5979
|
-
cellBgColor:
|
5980
|
-
opacity: 1
|
5981
|
-
}).brighter(0.5).toString(),
|
5976
|
+
cellBgColor: hoverCellBgColor,
|
5982
5977
|
inlineRowBgColor: hoverInlineColor,
|
5983
5978
|
inlineColumnBgColor: hoverInlineColor
|
5984
5979
|
},
|
@@ -6014,7 +6009,7 @@ const rowHeaderStyle = (spec, context)=>{
|
|
6014
6009
|
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
6015
6010
|
const fontSize = themConfig.headerFontSize || 12;
|
6016
6011
|
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
6017
|
-
const hoverInlineColor = themConfig.
|
6012
|
+
const hoverInlineColor = themConfig.hoverBodyInlineBackgroundColor || '#bedaff';
|
6018
6013
|
result.theme.rowHeaderStyle = {
|
6019
6014
|
borderColor: borderColor,
|
6020
6015
|
borderLineWidth: 1,
|
@@ -6026,9 +6021,7 @@ const rowHeaderStyle = (spec, context)=>{
|
|
6026
6021
|
],
|
6027
6022
|
textAlign: 'left',
|
6028
6023
|
hover: {
|
6029
|
-
cellBgColor:
|
6030
|
-
opacity: 1
|
6031
|
-
}).brighter(0.5).toString(),
|
6024
|
+
cellBgColor: hoverCellBgColor,
|
6032
6025
|
inlineRowBgColor: hoverInlineColor,
|
6033
6026
|
inlineColumnBgColor: hoverInlineColor
|
6034
6027
|
},
|
@@ -6063,8 +6056,8 @@ const cornerHeaderStyle = (spec, context)=>{
|
|
6063
6056
|
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
6064
6057
|
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
6065
6058
|
const fontSize = themConfig.headerFontSize || 12;
|
6066
|
-
const
|
6067
|
-
const
|
6059
|
+
const hoverInlineColor = themConfig.hoverHeaderInlineBackgroundColor;
|
6060
|
+
const hoverCellColor = themConfig.hoverHeaderBackgroundColor;
|
6068
6061
|
result.theme.cornerHeaderStyle = {
|
6069
6062
|
borderColor: [
|
6070
6063
|
borderColor,
|
@@ -6079,9 +6072,7 @@ const cornerHeaderStyle = (spec, context)=>{
|
|
6079
6072
|
],
|
6080
6073
|
textAlign: 'left',
|
6081
6074
|
hover: {
|
6082
|
-
cellBgColor:
|
6083
|
-
opacity: 1
|
6084
|
-
}).brighter(0.5).toString(),
|
6075
|
+
cellBgColor: hoverCellColor,
|
6085
6076
|
inlineRowBgColor: hoverInlineColor,
|
6086
6077
|
inlineColumnBgColor: hoverInlineColor
|
6087
6078
|
},
|
@@ -6129,12 +6120,11 @@ const selectionStyle = (spec, context)=>{
|
|
6129
6120
|
const themConfig = customTheme?.config?.[chartType];
|
6130
6121
|
if (!result.theme || !themConfig) return result;
|
6131
6122
|
const borderColor = themConfig.selectedBorderColor || 'rgb(224, 224, 224)';
|
6123
|
+
const backgroundColor = themConfig.selectedBackgroundColor || 'rgb(224, 224, 224, 0.5)';
|
6132
6124
|
result.theme.selectionStyle = {
|
6133
6125
|
cellBorderColor: borderColor,
|
6134
6126
|
cellBorderLineWidth: 2,
|
6135
|
-
cellBgColor:
|
6136
|
-
opacity: 0.15
|
6137
|
-
}).toString()
|
6127
|
+
cellBgColor: backgroundColor
|
6138
6128
|
};
|
6139
6129
|
return result;
|
6140
6130
|
};
|
@@ -6513,8 +6503,11 @@ const darkTheme = ()=>{
|
|
6513
6503
|
headerFontColor: '#fdfdfd',
|
6514
6504
|
headerBackgroundColor: '#36393e',
|
6515
6505
|
hoverBodyBackgroundColor: '#4284ff66',
|
6516
|
-
|
6517
|
-
|
6506
|
+
hoverBodyInlineBackgroundColor: '#4284ff10',
|
6507
|
+
hoverHeaderBackgroundColor: '#6f7984cc',
|
6508
|
+
hoverHeaderInlineBackgroundColor: '#4b4f54',
|
6509
|
+
selectedBorderColor: '#3073F2',
|
6510
|
+
selectedBackgroundColor: '#3073F210'
|
6518
6511
|
};
|
6519
6512
|
return {
|
6520
6513
|
config: {
|
@@ -6819,8 +6812,11 @@ const lightTheme = ()=>{
|
|
6819
6812
|
headerFontColor: '#21252c',
|
6820
6813
|
headerBackgroundColor: '#f6f7f9',
|
6821
6814
|
hoverBodyBackgroundColor: '#bedaff',
|
6822
|
-
|
6823
|
-
|
6815
|
+
hoverBodyInlineBackgroundColor: '#bedaff33',
|
6816
|
+
hoverHeaderBackgroundColor: '#D9DDE4',
|
6817
|
+
hoverHeaderInlineBackgroundColor: '#D9DDE455',
|
6818
|
+
selectedBorderColor: '#4080ffee',
|
6819
|
+
selectedBackgroundColor: '#4080ff10'
|
6824
6820
|
};
|
6825
6821
|
return {
|
6826
6822
|
config: {
|
@@ -7354,11 +7350,14 @@ const zTableConfig = z.object({
|
|
7354
7350
|
bodyFontColor: z.string().optional(),
|
7355
7351
|
bodyBackgroundColor: z.string().optional(),
|
7356
7352
|
hoverBodyBackgroundColor: z.string().optional(),
|
7353
|
+
hoverBodyInlineBackgroundColor: z.string().optional(),
|
7357
7354
|
headerFontSize: z.number().optional(),
|
7358
7355
|
headerFontColor: z.string().optional(),
|
7359
7356
|
headerBackgroundColor: z.string().optional(),
|
7360
7357
|
hoverHeaderBackgroundColor: z.string().optional(),
|
7361
|
-
|
7358
|
+
hoverHeaderInlineBackgroundColor: z.string().optional(),
|
7359
|
+
selectedBorderColor: z.string().optional(),
|
7360
|
+
selectedBackgroundColor: z.string().optional()
|
7362
7361
|
});
|
7363
7362
|
const zPivotTableConfig = zTableConfig;
|
7364
7363
|
const zLineConfig = z.object({
|