@visactor/vseed 0.4.6 → 0.4.7
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/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/prepare.js +87 -153
- package/dist/esm/builder/builder/prepare.js.map +1 -1
- package/dist/esm/dataSelector/selector.d.ts +2 -2
- package/dist/esm/dataSelector/selector.js.map +1 -1
- package/dist/esm/i18n/i18nData.js +28 -0
- package/dist/esm/i18n/i18nData.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/config/pivotTableConfig.js +2 -1
- package/dist/esm/pipeline/advanced/table/pipes/config/pivotTableConfig.js.map +1 -1
- package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js +6 -2
- package/dist/esm/pipeline/spec/chart/pipes/label/label.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipeline/table.js +2 -1
- package/dist/esm/pipeline/spec/table/pipeline/table.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/columnsAggregation.d.ts +8 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/columnsAggregation.js +76 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/columnsAggregation.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js +1 -27
- package/dist/esm/pipeline/spec/table/pipes/columns/dimensionsToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/index.js +1 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js +1 -27
- package/dist/esm/pipeline/spec/table/pipes/columns/measuresToColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js +12 -2
- package/dist/esm/pipeline/spec/table/pipes/columns/pivotColumns.js.map +1 -1
- package/dist/esm/pipeline/spec/table/pipes/columns/utils.d.ts +15 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/utils.js +35 -0
- package/dist/esm/pipeline/spec/table/pipes/columns/utils.js.map +1 -0
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js +39 -4
- package/dist/esm/pipeline/spec/table/pipes/indicators/pivotDataConfig.js.map +1 -1
- package/dist/esm/types/advancedVSeed.d.ts +2 -1
- package/dist/esm/types/advancedVSeed.js +3 -2
- package/dist/esm/types/advancedVSeed.js.map +1 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +113 -8
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +113 -8
- package/dist/esm/types/chartType/bar/zBar.d.ts +97 -4
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +97 -4
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +97 -4
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +89 -2
- package/dist/esm/types/chartType/circlePacking/zCirclePacking.d.ts +81 -0
- package/dist/esm/types/chartType/column/zColumn.d.ts +97 -4
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +97 -4
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +97 -4
- package/dist/esm/types/chartType/donut/zDonut.d.ts +81 -0
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +121 -10
- package/dist/esm/types/chartType/funnel/zFunnel.d.ts +81 -0
- package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +81 -0
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +97 -4
- package/dist/esm/types/chartType/line/zLine.d.ts +105 -6
- package/dist/esm/types/chartType/pie/zPie.d.ts +81 -0
- package/dist/esm/types/chartType/pivotTable/pivotTable.d.ts +6 -1
- package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +12 -0
- package/dist/esm/types/chartType/pivotTable/zPivotTable.js +2 -1
- package/dist/esm/types/chartType/pivotTable/zPivotTable.js.map +1 -1
- package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +97 -4
- package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +97 -4
- package/dist/esm/types/chartType/raceDonut/zRaceDonut.d.ts +81 -0
- package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +105 -6
- package/dist/esm/types/chartType/racePie/zRacePie.d.ts +81 -0
- package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +97 -4
- package/dist/esm/types/chartType/radar/zRadar.d.ts +81 -0
- package/dist/esm/types/chartType/rose/zRose.d.ts +81 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +81 -0
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +97 -4
- package/dist/esm/types/chartType/sunburst/zSunburst.d.ts +81 -0
- package/dist/esm/types/chartType/table/table.d.ts +11 -1
- package/dist/esm/types/chartType/table/zTable.d.ts +7 -0
- package/dist/esm/types/chartType/table/zTable.js +2 -1
- package/dist/esm/types/chartType/table/zTable.js.map +1 -1
- package/dist/esm/types/chartType/treeMap/zTreeMap.d.ts +81 -0
- package/dist/esm/types/dataSelector/selector.d.ts +53 -29
- package/dist/esm/types/dataSelector/selector.js +1 -1
- package/dist/esm/types/dataSelector/selector.js.map +1 -1
- package/dist/esm/types/properties/aggregation/aggregation.d.ts +9 -0
- package/dist/esm/types/properties/aggregation/aggregation.js +0 -0
- package/dist/esm/types/properties/aggregation/index.d.ts +2 -0
- package/dist/esm/types/properties/aggregation/index.js +2 -0
- package/dist/esm/types/properties/aggregation/zAggregation.d.ts +8 -0
- package/dist/esm/types/properties/aggregation/zAggregation.js +11 -0
- package/dist/esm/types/properties/aggregation/zAggregation.js.map +1 -0
- package/dist/esm/types/properties/annotation/annotation.d.ts +8 -2
- package/dist/esm/types/properties/annotation/zAnnotationPoint.d.ts +4 -1
- package/dist/esm/types/properties/config/annotation/zAnnotation.d.ts +8 -2
- package/dist/esm/types/properties/config/area.d.ts +170 -2
- package/dist/esm/types/properties/config/bar.d.ts +255 -3
- package/dist/esm/types/properties/config/boxplot.d.ts +85 -1
- package/dist/esm/types/properties/config/circlePacking.d.ts +81 -0
- package/dist/esm/types/properties/config/column.d.ts +255 -3
- package/dist/esm/types/properties/config/config.d.ts +2425 -19
- package/dist/esm/types/properties/config/dualAxis.d.ts +85 -1
- package/dist/esm/types/properties/config/funnel.d.ts +81 -0
- package/dist/esm/types/properties/config/heatmap.d.ts +81 -0
- package/dist/esm/types/properties/config/histogram.d.ts +85 -1
- package/dist/esm/types/properties/config/label/label.d.ts +18 -1
- package/dist/esm/types/properties/config/label/zLabel.d.ts +81 -0
- package/dist/esm/types/properties/config/label/zLabel.js +3 -2
- package/dist/esm/types/properties/config/label/zLabel.js.map +1 -1
- package/dist/esm/types/properties/config/label/zPieLabel.d.ts +81 -0
- package/dist/esm/types/properties/config/line.d.ts +85 -1
- package/dist/esm/types/properties/config/pie.d.ts +243 -0
- package/dist/esm/types/properties/config/race.d.ts +510 -6
- package/dist/esm/types/properties/config/rose.d.ts +162 -0
- package/dist/esm/types/properties/config/scatter.d.ts +85 -1
- package/dist/esm/types/properties/config/sunburst.d.ts +81 -0
- package/dist/esm/types/properties/config/treeMap.d.ts +81 -0
- package/dist/esm/types/properties/index.d.ts +2 -0
- package/dist/esm/types/properties/index.js +2 -0
- package/dist/esm/types/properties/markStyle/barStyle.d.ts +4 -1
- package/dist/esm/types/properties/markStyle/lineStyle.d.ts +4 -1
- package/dist/esm/types/properties/markStyle/markStyle.d.ts +32 -8
- package/dist/esm/types/properties/markStyle/pointStyle.d.ts +4 -1
- package/dist/esm/types/properties/markStyle/zAreaStyle.d.ts +4 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +4850 -38
- package/dist/esm/types/properties/totals/index.d.ts +2 -0
- package/dist/esm/types/properties/totals/index.js +2 -0
- package/dist/esm/types/properties/totals/totals.d.ts +34 -0
- package/dist/esm/types/properties/totals/totals.js +0 -0
- package/dist/esm/types/properties/totals/zTotals.d.ts +18 -0
- package/dist/esm/types/properties/totals/zTotals.js +13 -0
- package/dist/esm/types/properties/totals/zTotals.js.map +1 -0
- package/dist/umd/index.js +291 -211
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -72,11 +72,29 @@ export type Selector = ValueSelector | PartialDatumSelector | MeasureSelector |
|
|
|
72
72
|
export type AreaSelector = MeasureSelector | DimensionSelector;
|
|
73
73
|
export type AreaSelectors = Array<AreaSelector>;
|
|
74
74
|
export type Selectors = Array<Selector>;
|
|
75
|
-
|
|
75
|
+
/**
|
|
76
|
+
* 行索引与字段组合的数据结构
|
|
77
|
+
* @description 用于表示动态筛选器返回的结果,指向原始数据中特定行的特定字段
|
|
78
|
+
*/
|
|
79
|
+
export type RowWithFieldRes = {
|
|
80
|
+
/**
|
|
81
|
+
* 原始数据项的行索引
|
|
82
|
+
* @description 从 0 开始计数,对应数据源中数据项的位置
|
|
83
|
+
*/
|
|
76
84
|
__row_index: number;
|
|
85
|
+
/**
|
|
86
|
+
* 字段名称
|
|
87
|
+
* @description
|
|
88
|
+
* - 具体字段名:表示该行中的某个特定字段
|
|
89
|
+
* - '*':表示该行的所有字段(整行)
|
|
90
|
+
*/
|
|
77
91
|
field: string | '*';
|
|
78
92
|
};
|
|
79
|
-
|
|
93
|
+
/**
|
|
94
|
+
* 部分数据项结果
|
|
95
|
+
* @description 用于表示动态筛选器返回的部分数据项
|
|
96
|
+
*/
|
|
97
|
+
export type PartialDatumRes = Datum;
|
|
80
98
|
export type DynamicFilterExecutionResult<T> = {
|
|
81
99
|
success: boolean;
|
|
82
100
|
data?: T[];
|
|
@@ -197,7 +215,7 @@ export interface TableDynamicFilter {
|
|
|
197
215
|
* 动态筛选执行结果(运行期字段)
|
|
198
216
|
* @description prepare() 阶段写入,运行时只读
|
|
199
217
|
*/
|
|
200
|
-
result?: DynamicFilterExecutionResult<
|
|
218
|
+
result?: DynamicFilterExecutionResult<RowWithFieldRes>;
|
|
201
219
|
}
|
|
202
220
|
/**
|
|
203
221
|
* 图表动态筛选器配置
|
|
@@ -216,46 +234,46 @@ export interface ChartDynamicFilter {
|
|
|
216
234
|
* AI 生成的 JavaScript 筛选代码
|
|
217
235
|
* @description
|
|
218
236
|
* - 只能使用内置工具函数(通过 _ 或 R 访问)
|
|
219
|
-
* - 输入参数: data (数组)
|
|
220
|
-
* -
|
|
221
|
-
* -
|
|
237
|
+
* - 输入参数: data (数组),每个 item 包含 __row_index 字段表示行号
|
|
238
|
+
* - 必须返回行索引与字段组合的数组: Array<{ __row_index: number, field: string }>
|
|
239
|
+
* - __row_index 表示原始数据项的行号,field 表示需要高亮的字段
|
|
222
240
|
* - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求
|
|
223
241
|
*
|
|
224
|
-
* @example 高亮销售额大于1000
|
|
242
|
+
* @example 高亮销售额大于1000的数据项的 sales 字段
|
|
225
243
|
* ```javascript
|
|
226
244
|
* const filtered = _.filter(data, item => item.sales > 1000);
|
|
227
|
-
* // 假设柱子由 product 和 area 两个维度唯一标识
|
|
228
245
|
* return _.map(filtered, item => ({
|
|
229
|
-
*
|
|
230
|
-
*
|
|
246
|
+
* __row_index: item.__row_index,
|
|
247
|
+
* field: 'sales'
|
|
231
248
|
* }));
|
|
232
249
|
* ```
|
|
233
250
|
*
|
|
234
|
-
* @example
|
|
251
|
+
* @example 高亮每个区域中利润率最高的数据项
|
|
235
252
|
* ```javascript
|
|
236
253
|
* const grouped = _.groupBy(data, 'area');
|
|
237
|
-
* const
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* return result;
|
|
254
|
+
* const maxItems = _.map(grouped, group =>
|
|
255
|
+
* _.maxBy(group, item => item.profit / item.sales)
|
|
256
|
+
* );
|
|
257
|
+
* return _.flatten(
|
|
258
|
+
* _.map(maxItems, item => [
|
|
259
|
+
* { __row_index: item.__row_index, field: 'product' },
|
|
260
|
+
* { __row_index: item.__row_index, field: 'profit' }
|
|
261
|
+
* ])
|
|
262
|
+
* );
|
|
247
263
|
* ```
|
|
248
264
|
*
|
|
249
|
-
* @example
|
|
265
|
+
* @example 高亮多条件筛选的数据项
|
|
250
266
|
* ```javascript
|
|
251
267
|
* const filtered = _.filter(data, item => {
|
|
252
268
|
* const profitRate = item.profit / item.sales;
|
|
253
269
|
* return profitRate > 0.2 && item.sales > 5000;
|
|
254
270
|
* });
|
|
255
|
-
* return _.
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* }
|
|
271
|
+
* return _.flatten(
|
|
272
|
+
* _.map(filtered, item => [
|
|
273
|
+
* { __row_index: item.__row_index, field: 'product' },
|
|
274
|
+
* { __row_index: item.__row_index, field: 'sales' }
|
|
275
|
+
* ])
|
|
276
|
+
* );
|
|
259
277
|
* ```
|
|
260
278
|
*/
|
|
261
279
|
code: string;
|
|
@@ -267,7 +285,7 @@ export interface ChartDynamicFilter {
|
|
|
267
285
|
* 动态筛选执行结果(运行期字段)
|
|
268
286
|
* @description prepare() 阶段写入,运行时只读
|
|
269
287
|
*/
|
|
270
|
-
result?: DynamicFilterExecutionResult<
|
|
288
|
+
result?: DynamicFilterExecutionResult<RowWithFieldRes>;
|
|
271
289
|
}
|
|
272
290
|
export interface ValueDynamicFilter {
|
|
273
291
|
type: 'value';
|
|
@@ -665,7 +683,10 @@ export declare const zChartDynamicFilter: z.ZodObject<{
|
|
|
665
683
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
666
684
|
result: z.ZodOptional<z.ZodObject<{
|
|
667
685
|
success: z.ZodBoolean;
|
|
668
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
686
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
687
|
+
__row_index: z.ZodNumber;
|
|
688
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
689
|
+
}, z.core.$strip>>>;
|
|
669
690
|
}, z.core.$strip>>;
|
|
670
691
|
}, z.core.$strip>;
|
|
671
692
|
export declare const zValueDynamicFilter: z.ZodObject<{
|
|
@@ -836,6 +857,9 @@ export declare const zDynamicFilter: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
836
857
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
837
858
|
result: z.ZodOptional<z.ZodObject<{
|
|
838
859
|
success: z.ZodBoolean;
|
|
839
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
860
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
861
|
+
__row_index: z.ZodNumber;
|
|
862
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
863
|
+
}, z.core.$strip>>>;
|
|
840
864
|
}, z.core.$strip>>;
|
|
841
865
|
}, z.core.$strip>]>;
|
|
@@ -94,7 +94,7 @@ const zChartDynamicFilter = z.object({
|
|
|
94
94
|
]).optional(),
|
|
95
95
|
result: z.object({
|
|
96
96
|
success: z.boolean(),
|
|
97
|
-
data: z.array(
|
|
97
|
+
data: z.array(zCellSelector).optional()
|
|
98
98
|
}).optional()
|
|
99
99
|
});
|
|
100
100
|
const zValueDynamicFilter = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types/dataSelector/selector.js","sources":["webpack://@visactor/vseed/./src/types/dataSelector/selector.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zDatum, type Datum } from '../properties'\n\nexport type ValueSelector = string | number\n\nexport type PartialDatumSelector = Datum\n\n/**\n * @description 指标选择器, 用于选择数据项中指标字段的值\n */\nexport type MeasureSelector = {\n /**\n * @description 指标字段, measures 某一项的 id\n */\n field: string\n /**\n * @description 操作符\n * - =: 选择数据项中指标字段的值等于 value 的数据项\n * - ==: 选择数据项中指标字段的值等于 value 的数据项\n * - !=: 选择数据项中指标字段的值不等于 value 的数据项\n * - >: 选择数据项中指标字段的值大于 value 的数据项\n * - <: 选择数据项中指标字段的值小于 value 的数据项\n * - >=: 选择数据项中指标字段的值大于等于 value 的数据项\n * - <=: 选择数据项中指标字段的值小于等于 value 的数据项\n * - between: 选择数据项中指标字段的值在 value 之间的 data item\n */\n operator?: '=' | '==' | '!=' | '>' | '<' | '>=' | '<=' | 'between'\n /**\n * @description 操作符\n * - =: 选择数据项中指标字段的值等于 value 的数据项, 会将值转换为字符串后进行比较, 因此 1 == \"1\" 为 true\n * - ==: 选择数据项中指标字段的值精准等于 value 的数据项, 不会做任何特殊处理, 因此 1 == \"1\" 为 false\n * - !=: 选择数据项中指标字段的值不等于 value 的数据项\n * - >: 选择数据项中指标字段的值大于 value 的数据项\n * - <: 选择数据项中指标字段的值小于 value 的数据项\n * - >=: 选择数据项中指标字段的值大于等于 value 的数据项\n * - <=: 选择数据项中指标字段的值小于等于 value 的数据项\n * - between: 选择数据项中指标字段的值在 value 之间的 data item\n * same as operator\n */\n op?: '=' | '==' | '!=' | '>' | '<' | '>=' | '<=' | 'between'\n /**\n * @description 选择数据项中指标字段的值\n * - 仅 op 为 between 时, value 为长度为2的数组, 数组中的元素为指标字段的最小值和最大值\n * - 其他情况, value 为指标字段的单个值\n */\n value: string | number | Array<string | number>\n // /**\n // * @description 是否使用原始数据进行数据匹配, 开启后会有更多的数据被匹配到\n // * 若下述数据, measures 仅设置了 value, field 为 isHigh 或 isLow, op 为 =, value 为 1,\n // * 关闭useOrigin时, 数据项并不会考虑measures之外的字段, 因此field为isHigh或isLow的字段会被忽略\n // * 开启useOrigin时, 会直接使用整个数据项进行匹配\n // * [\n // * {value: 100, isHigh: 1, isLow: 0},\n // * {value: 200, isHigh: 0, isLow: 1},\n // * {value: 300, isHigh: 1, isLow: 0},\n // * ]\n // * @default false\n // */\n // useOrigin?: boolean\n}\n\n/**\n * @description 维度选择器, 用于选择数据项中维度字段的值\n */\nexport type DimensionSelector = {\n /**\n * @description 维度字段, dimensions 某一项的 id\n */\n field: string\n /**\n * @description 操作符\n * - in: 选择数据项中维度字段的值在 value 中的数据项\n * - not in: 选择数据项中维度字段的值不在 value 中的数据项\n */\n operator?: 'in' | 'not in'\n /**\n * @description 操作符\n * - in: 选择数据项中维度字段的值在 value 中的数据项\n * - not in: 选择数据项中维度字段的值不在 value 中的数据项\n * same as operator\n */\n op?: 'in' | 'not in'\n /**\n * @description 选择数据项中维度字段的值, 支持数组\n */\n value: string | number | Array<string | number>\n // /**\n // * @description 是否使用原始数据进行数据匹配, 开启后会有更多的数据被匹配到\n // * 若下述数据, dimensions 仅设置了 name, field 为 name, op 为 =, value 为 \"high\",\n // * 关闭useOrigin时, 数据项并不会考虑dimensions之外的字段, 因此field为name的字段会被忽略\n // * 开启useOrigin时, 会直接使用整个数据项进行匹配\n // * [\n // * {name: \"low\", isHigh: \"false\", isLow: \"true\"},\n // * {name: \"low\", isHigh: \"false\", isLow: \"true\"},\n // * {name: \"high\", isHigh: \"true\", isLow: \"false\"},\n // * ]\n // * @default false\n // */\n // useOrigin?: boolean\n}\n\nexport type Selector = ValueSelector | PartialDatumSelector | MeasureSelector | DimensionSelector\n\nexport type AreaSelector = MeasureSelector | DimensionSelector\n\nexport type AreaSelectors = Array<AreaSelector>\n\nexport type Selectors = Array<Selector>\n\nexport type TableDynamicFilterRes = {\n __row_index: number\n field: string | '*'\n}\n\nexport type ChartDynamicFilterRes = Datum\n\nexport type DynamicFilterExecutionResult<T> = {\n success: boolean\n data?: T[]\n error?: string\n}\n\n/**\n * 表格动态筛选器配置\n * @description 通过 AI 生成的 JavaScript 代码实现表格单元格级别的精确筛选\n * @environment 仅支持浏览器环境(需要 Web Worker),Node.js 环境将使用 fallback\n */\nexport interface TableDynamicFilter {\n type: 'row-with-field'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"高亮销售额大于1000的单元格\"\n * @example \"高亮每行中最大值所在的单元格\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组),每个 item 包含 _index 字段表示行号\n * - 必须返回单元格选择器数组: Array<{ __row_index: number, field: string }>\n * - field 为 \"*\" 时表示整行高亮\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example Top N 筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '高亮销售额最高的前3个产品',\n * code: `\n * const sorted = _.sortBy(data, 'sales');\n * const reversed = [...sorted].reverse();\n * const result = _.take(reversed, 3);\n * return _.flatten(\n * _.map(result, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 多条件筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '高亮利润率大于20%且销售额超过5000的产品',\n * code: `\n * const matched = _.filter(data, item => {\n * const profitRate = (item.profit / item.sales) * 100;\n * return profitRate > 20 && item.sales > 5000;\n * });\n * return _.flatten(\n * _.map(matched, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 相对值筛选\n * dynamicFilter = { *\n * type: 'row-with-field',\n * description: '高亮销售额高于平均值的产品',\n * code: `\n * const avgSales = _.meanBy(data, 'sales');\n * const matched = _.filter(data, item => item.sales > avgSales);\n * return _.flatten(\n * _.map(matched, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 分组筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '每个区域中销售额最高的产品',\n * code: `\n * const grouped = _.groupBy(data, 'region');\n * const topByRegion = _.map(_.values(grouped), group => _.maxBy(group, 'sales'));\n * return _.flatten(\n * _.map(topByRegion, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 整行高亮\n * dynamicFilter = {\n * description: '高亮销售额大于利润的整行',\n * code: `\n * const matched = _.filter(data, item => item.sales > item.profit);\n * return matched.map(item => ({\n * __row_index: item._index,\n * field: '*'\n * }));\n * `,\n * enabled: true\n * }\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: Selector | Selectors\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: DynamicFilterExecutionResult<TableDynamicFilterRes>\n}\n\n/**\n * 图表动态筛选器配置\n * @description 通过 AI 生成的 JavaScript 代码实现图表标记(柱子、点等)的筛选\n * @environment 仅支持浏览器环境(需要 Web Worker),Node.js 环境将使用 fallback\n */\nexport interface ChartDynamicFilter {\n type: 'row-with-field'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"高亮销售额大于1000的柱子\"\n * @example \"高亮每个区域中利润率最高的柱子\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组)\n * - 必须返回部分数据项数组: Array<{ [dimField]: value }>\n * - 返回的对象包含能唯一标识图表标记的维度字段组合\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example 高亮销售额大于1000的柱子\n * ```javascript\n * const filtered = _.filter(data, item => item.sales > 1000);\n * // 假设柱子由 product 和 area 两个维度唯一标识\n * return _.map(filtered, item => ({\n * product: item.product,\n * area: item.area\n * }));\n * ```\n *\n * @example 高亮每个区域中利润率最高的柱子\n * ```javascript\n * const grouped = _.groupBy(data, 'area');\n * const result = _.map(grouped, group => {\n * const maxProfitRateItem = _.maxBy(group, item =>\n * item.profit / item.sales\n * );\n * return {\n * product: maxProfitRateItem.product,\n * area: maxProfitRateItem.area\n * };\n * });\n * return result;\n * ```\n *\n * @example 高亮多条件筛选\n * ```javascript\n * const filtered = _.filter(data, item => {\n * const profitRate = item.profit / item.sales;\n * return profitRate > 0.2 && item.sales > 5000;\n * });\n * return _.map(filtered, item => ({\n * product: item.product,\n * region: item.region\n * }));\n * ```\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: Selector | Selectors\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: DynamicFilterExecutionResult<ChartDynamicFilterRes>\n}\n\nexport interface ValueDynamicFilter {\n type: 'value'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"获取销售额最高的值作为标注线参考\"\n * @example \"计算平均销售额用于标注线\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组)\n * - 必须返回单个数值或字符串: number | string\n * - 适用场景:标注线(水平线、垂直线)需要的动态数值\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example 获取销售额最大值作为标注线值\n * ```javascript\n * const maxSales = _.maxBy(data, 'sales')?.sales;\n * return maxSales || 0;\n * ```\n *\n * @example 计算平均值用于标注线\n * ```javascript\n * const avgSales = _.meanBy(data, 'sales');\n * return _.round(avgSales, 2);\n * ```\n *\n * @example 获取分位数作为标注线\n * ```javascript\n * const sorted = _.sortBy(data, 'sales');\n * const index = Math.floor(sorted.length * 0.75);\n * return sorted[index]?.sales || 0;\n * ```\n *\n * @example 根据条件计算目标值\n * ```javascript\n * const currentYearTotal = _.sumBy(\n * _.filter(data, item => item.year === 2024),\n * 'sales'\n * );\n * return currentYearTotal;\n * ```\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: string | number\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: {\n success: boolean\n data?: number | string\n }\n}\n\nexport const zPartialSelector = zDatum\nexport const zMeasureSelector = z.object({\n field: z.string(),\n operator: z.enum(['=', '==', '!=', '>', '<', '>=', '<=', 'between']).nullish(),\n op: z.enum(['=', '==', '!=', '>', '<', '>=', '<=', 'between']).nullish(),\n value: z.union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]),\n})\n\nexport const zDimensionSelector = z.object({\n field: z.string(),\n operator: z.enum(['in', 'not in']).nullish(),\n op: z.enum(['in', 'not in']).nullish(),\n value: z.union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]),\n})\n\nexport const zSelector = z.union([z.string(), z.number(), zMeasureSelector, zDimensionSelector, zPartialSelector])\n\nexport const zSelectors = z.array(zSelector)\n\nexport const zAreaSelector = z.union([zMeasureSelector, zDimensionSelector])\n\nexport const zAreaSelectors = z.array(zAreaSelector)\n\nexport const zCellSelector = z.object({\n __row_index: z.number(),\n field: z.union([z.string(), z.literal('*')]),\n})\n\nexport const zTableDynamicFilter = z.object({\n type: z.literal('row-with-field'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([zSelector, zSelectors]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.array(zCellSelector).optional(),\n })\n .optional(),\n})\n\nexport const zChartDynamicFilter = z.object({\n type: z.literal('row-with-field'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([zSelector, zSelectors]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.array(z.record(z.string(), z.any())).optional(),\n })\n .optional(),\n})\n\nexport const zValueDynamicFilter = z.object({\n type: z.literal('value'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([z.string(), z.number()]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.union([z.number(), z.string()]).optional(),\n })\n .optional(),\n})\n\n/**\n * @deprecated 请使用 zTableDynamicFilter 或 zChartDynamicFilter\n */\nexport const zDynamicFilter = z.union([zTableDynamicFilter, zChartDynamicFilter])\n"],"names":["zPartialSelector","zDatum","zMeasureSelector","z","zDimensionSelector","zSelector","zSelectors","zAreaSelector","zAreaSelectors","zCellSelector","zTableDynamicFilter","zChartDynamicFilter","zValueDynamicFilter","zDynamicFilter"],"mappings":";;AA4XO,MAAMA,mBAAmBC;AACzB,MAAMC,mBAAmBC,EAAE,MAAM,CAAC;IACvC,OAAOA,EAAE,MAAM;IACf,UAAUA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAK;QAAM;QAAM;QAAK;QAAK;QAAM;QAAM;KAAU,EAAE,OAAO;IAC5E,IAAIA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAK;QAAM;QAAM;QAAK;QAAK;QAAM;QAAM;KAAU,EAAE,OAAO;IACtE,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;QAAIA,EAAE,KAAK,CAACA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG;KAAG;AACrF;AAEO,MAAMC,qBAAqBD,EAAE,MAAM,CAAC;IACzC,OAAOA,EAAE,MAAM;IACf,UAAUA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAM;KAAS,EAAE,OAAO;IAC1C,IAAIA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAM;KAAS,EAAE,OAAO;IACpC,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;QAAIA,EAAE,KAAK,CAACA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG;KAAG;AACrF;AAEO,MAAME,YAAYF,EAAE,KAAK,CAAC;IAACA,EAAE,MAAM;IAAIA,EAAE,MAAM;IAAID;IAAkBE;IAAoBJ;CAAiB;AAE1G,MAAMM,aAAaH,EAAE,KAAK,CAACE;AAE3B,MAAME,gBAAgBJ,EAAE,KAAK,CAAC;IAACD;IAAkBE;CAAmB;AAEpE,MAAMI,iBAAiBL,EAAE,KAAK,CAACI;AAE/B,MAAME,gBAAgBN,EAAE,MAAM,CAAC;IACpC,aAAaA,EAAE,MAAM;IACrB,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,OAAO,CAAC;KAAK;AAC7C;AAEO,MAAMO,sBAAsBP,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACE;QAAWC;KAAW,EAAE,QAAQ;IACnD,QAAQH,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAACM,eAAe,QAAQ;IACvC,GACC,QAAQ;AACb;AAEO,MAAME,sBAAsBR,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACE;QAAWC;KAAW,EAAE,QAAQ;IACnD,QAAQH,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAACA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG,KAAK,QAAQ;IACvD,GACC,QAAQ;AACb;AAEO,MAAMS,sBAAsBT,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;KAAG,EAAE,QAAQ;IACpD,QAAQA,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG,EAAE,QAAQ;IAClD,GACC,QAAQ;AACb;AAKO,MAAMU,iBAAiBV,EAAE,KAAK,CAAC;IAACO;IAAqBC;CAAoB"}
|
|
1
|
+
{"version":3,"file":"types/dataSelector/selector.js","sources":["webpack://@visactor/vseed/./src/types/dataSelector/selector.ts"],"sourcesContent":["import { z } from 'zod'\nimport { zDatum, type Datum } from '../properties'\n\nexport type ValueSelector = string | number\n\nexport type PartialDatumSelector = Datum\n\n/**\n * @description 指标选择器, 用于选择数据项中指标字段的值\n */\nexport type MeasureSelector = {\n /**\n * @description 指标字段, measures 某一项的 id\n */\n field: string\n /**\n * @description 操作符\n * - =: 选择数据项中指标字段的值等于 value 的数据项\n * - ==: 选择数据项中指标字段的值等于 value 的数据项\n * - !=: 选择数据项中指标字段的值不等于 value 的数据项\n * - >: 选择数据项中指标字段的值大于 value 的数据项\n * - <: 选择数据项中指标字段的值小于 value 的数据项\n * - >=: 选择数据项中指标字段的值大于等于 value 的数据项\n * - <=: 选择数据项中指标字段的值小于等于 value 的数据项\n * - between: 选择数据项中指标字段的值在 value 之间的 data item\n */\n operator?: '=' | '==' | '!=' | '>' | '<' | '>=' | '<=' | 'between'\n /**\n * @description 操作符\n * - =: 选择数据项中指标字段的值等于 value 的数据项, 会将值转换为字符串后进行比较, 因此 1 == \"1\" 为 true\n * - ==: 选择数据项中指标字段的值精准等于 value 的数据项, 不会做任何特殊处理, 因此 1 == \"1\" 为 false\n * - !=: 选择数据项中指标字段的值不等于 value 的数据项\n * - >: 选择数据项中指标字段的值大于 value 的数据项\n * - <: 选择数据项中指标字段的值小于 value 的数据项\n * - >=: 选择数据项中指标字段的值大于等于 value 的数据项\n * - <=: 选择数据项中指标字段的值小于等于 value 的数据项\n * - between: 选择数据项中指标字段的值在 value 之间的 data item\n * same as operator\n */\n op?: '=' | '==' | '!=' | '>' | '<' | '>=' | '<=' | 'between'\n /**\n * @description 选择数据项中指标字段的值\n * - 仅 op 为 between 时, value 为长度为2的数组, 数组中的元素为指标字段的最小值和最大值\n * - 其他情况, value 为指标字段的单个值\n */\n value: string | number | Array<string | number>\n // /**\n // * @description 是否使用原始数据进行数据匹配, 开启后会有更多的数据被匹配到\n // * 若下述数据, measures 仅设置了 value, field 为 isHigh 或 isLow, op 为 =, value 为 1,\n // * 关闭useOrigin时, 数据项并不会考虑measures之外的字段, 因此field为isHigh或isLow的字段会被忽略\n // * 开启useOrigin时, 会直接使用整个数据项进行匹配\n // * [\n // * {value: 100, isHigh: 1, isLow: 0},\n // * {value: 200, isHigh: 0, isLow: 1},\n // * {value: 300, isHigh: 1, isLow: 0},\n // * ]\n // * @default false\n // */\n // useOrigin?: boolean\n}\n\n/**\n * @description 维度选择器, 用于选择数据项中维度字段的值\n */\nexport type DimensionSelector = {\n /**\n * @description 维度字段, dimensions 某一项的 id\n */\n field: string\n /**\n * @description 操作符\n * - in: 选择数据项中维度字段的值在 value 中的数据项\n * - not in: 选择数据项中维度字段的值不在 value 中的数据项\n */\n operator?: 'in' | 'not in'\n /**\n * @description 操作符\n * - in: 选择数据项中维度字段的值在 value 中的数据项\n * - not in: 选择数据项中维度字段的值不在 value 中的数据项\n * same as operator\n */\n op?: 'in' | 'not in'\n /**\n * @description 选择数据项中维度字段的值, 支持数组\n */\n value: string | number | Array<string | number>\n // /**\n // * @description 是否使用原始数据进行数据匹配, 开启后会有更多的数据被匹配到\n // * 若下述数据, dimensions 仅设置了 name, field 为 name, op 为 =, value 为 \"high\",\n // * 关闭useOrigin时, 数据项并不会考虑dimensions之外的字段, 因此field为name的字段会被忽略\n // * 开启useOrigin时, 会直接使用整个数据项进行匹配\n // * [\n // * {name: \"low\", isHigh: \"false\", isLow: \"true\"},\n // * {name: \"low\", isHigh: \"false\", isLow: \"true\"},\n // * {name: \"high\", isHigh: \"true\", isLow: \"false\"},\n // * ]\n // * @default false\n // */\n // useOrigin?: boolean\n}\n\nexport type Selector = ValueSelector | PartialDatumSelector | MeasureSelector | DimensionSelector\n\nexport type AreaSelector = MeasureSelector | DimensionSelector\n\nexport type AreaSelectors = Array<AreaSelector>\n\nexport type Selectors = Array<Selector>\n\n/**\n * 行索引与字段组合的数据结构\n * @description 用于表示动态筛选器返回的结果,指向原始数据中特定行的特定字段\n */\nexport type RowWithFieldRes = {\n /**\n * 原始数据项的行索引\n * @description 从 0 开始计数,对应数据源中数据项的位置\n */\n __row_index: number\n /**\n * 字段名称\n * @description\n * - 具体字段名:表示该行中的某个特定字段\n * - '*':表示该行的所有字段(整行)\n */\n field: string | '*'\n}\n\n/**\n * 部分数据项结果\n * @description 用于表示动态筛选器返回的部分数据项\n */\nexport type PartialDatumRes = Datum\n\nexport type DynamicFilterExecutionResult<T> = {\n success: boolean\n data?: T[]\n error?: string\n}\n\n/**\n * 表格动态筛选器配置\n * @description 通过 AI 生成的 JavaScript 代码实现表格单元格级别的精确筛选\n * @environment 仅支持浏览器环境(需要 Web Worker),Node.js 环境将使用 fallback\n */\nexport interface TableDynamicFilter {\n type: 'row-with-field'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"高亮销售额大于1000的单元格\"\n * @example \"高亮每行中最大值所在的单元格\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组),每个 item 包含 _index 字段表示行号\n * - 必须返回单元格选择器数组: Array<{ __row_index: number, field: string }>\n * - field 为 \"*\" 时表示整行高亮\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example Top N 筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '高亮销售额最高的前3个产品',\n * code: `\n * const sorted = _.sortBy(data, 'sales');\n * const reversed = [...sorted].reverse();\n * const result = _.take(reversed, 3);\n * return _.flatten(\n * _.map(result, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 多条件筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '高亮利润率大于20%且销售额超过5000的产品',\n * code: `\n * const matched = _.filter(data, item => {\n * const profitRate = (item.profit / item.sales) * 100;\n * return profitRate > 20 && item.sales > 5000;\n * });\n * return _.flatten(\n * _.map(matched, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 相对值筛选\n * dynamicFilter = { *\n * type: 'row-with-field',\n * description: '高亮销售额高于平均值的产品',\n * code: `\n * const avgSales = _.meanBy(data, 'sales');\n * const matched = _.filter(data, item => item.sales > avgSales);\n * return _.flatten(\n * _.map(matched, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 分组筛选\n * dynamicFilter = {\n * type: 'row-with-field',\n * description: '每个区域中销售额最高的产品',\n * code: `\n * const grouped = _.groupBy(data, 'region');\n * const topByRegion = _.map(_.values(grouped), group => _.maxBy(group, 'sales'));\n * return _.flatten(\n * _.map(topByRegion, item => [\n * { __row_index: item._index, field: 'product' },\n * { __row_index: item._index, field: 'sales' }\n * ])\n * );\n * `,\n * enabled: true\n * }\n *\n * @example 整行高亮\n * dynamicFilter = {\n * description: '高亮销售额大于利润的整行',\n * code: `\n * const matched = _.filter(data, item => item.sales > item.profit);\n * return matched.map(item => ({\n * __row_index: item._index,\n * field: '*'\n * }));\n * `,\n * enabled: true\n * }\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: Selector | Selectors\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: DynamicFilterExecutionResult<RowWithFieldRes>\n}\n\n/**\n * 图表动态筛选器配置\n * @description 通过 AI 生成的 JavaScript 代码实现图表标记(柱子、点等)的筛选\n * @environment 仅支持浏览器环境(需要 Web Worker),Node.js 环境将使用 fallback\n */\nexport interface ChartDynamicFilter {\n type: 'row-with-field'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"高亮销售额大于1000的柱子\"\n * @example \"高亮每个区域中利润率最高的柱子\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组),每个 item 包含 __row_index 字段表示行号\n * - 必须返回行索引与字段组合的数组: Array<{ __row_index: number, field: string }>\n * - __row_index 表示原始数据项的行号,field 表示需要高亮的字段\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example 高亮销售额大于1000的数据项的 sales 字段\n * ```javascript\n * const filtered = _.filter(data, item => item.sales > 1000);\n * return _.map(filtered, item => ({\n * __row_index: item.__row_index,\n * field: 'sales'\n * }));\n * ```\n *\n * @example 高亮每个区域中利润率最高的数据项\n * ```javascript\n * const grouped = _.groupBy(data, 'area');\n * const maxItems = _.map(grouped, group =>\n * _.maxBy(group, item => item.profit / item.sales)\n * );\n * return _.flatten(\n * _.map(maxItems, item => [\n * { __row_index: item.__row_index, field: 'product' },\n * { __row_index: item.__row_index, field: 'profit' }\n * ])\n * );\n * ```\n *\n * @example 高亮多条件筛选的数据项\n * ```javascript\n * const filtered = _.filter(data, item => {\n * const profitRate = item.profit / item.sales;\n * return profitRate > 0.2 && item.sales > 5000;\n * });\n * return _.flatten(\n * _.map(filtered, item => [\n * { __row_index: item.__row_index, field: 'product' },\n * { __row_index: item.__row_index, field: 'sales' }\n * ])\n * );\n * ```\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: Selector | Selectors\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: DynamicFilterExecutionResult<RowWithFieldRes>\n}\n\nexport interface ValueDynamicFilter {\n type: 'value'\n /**\n * 用户的筛选需求描述(自然语言)\n * @example \"获取销售额最高的值作为标注线参考\"\n * @example \"计算平均销售额用于标注线\"\n */\n description?: string\n\n /**\n * AI 生成的 JavaScript 筛选代码\n * @description\n * - 只能使用内置工具函数(通过 _ 或 R 访问)\n * - 输入参数: data (数组)\n * - 必须返回单个数值或字符串: number | string\n * - 适用场景:标注线(水平线、垂直线)需要的动态数值\n * - 禁止使用: eval, Function, 异步操作, DOM API, 网络请求\n *\n * @example 获取销售额最大值作为标注线值\n * ```javascript\n * const maxSales = _.maxBy(data, 'sales')?.sales;\n * return maxSales || 0;\n * ```\n *\n * @example 计算平均值用于标注线\n * ```javascript\n * const avgSales = _.meanBy(data, 'sales');\n * return _.round(avgSales, 2);\n * ```\n *\n * @example 获取分位数作为标注线\n * ```javascript\n * const sorted = _.sortBy(data, 'sales');\n * const index = Math.floor(sorted.length * 0.75);\n * return sorted[index]?.sales || 0;\n * ```\n *\n * @example 根据条件计算目标值\n * ```javascript\n * const currentYearTotal = _.sumBy(\n * _.filter(data, item => item.year === 2024),\n * 'sales'\n * );\n * return currentYearTotal;\n * ```\n */\n code: string\n\n /**\n * 代码执行失败或环境不支持时的降级方案\n */\n fallback?: string | number\n\n /**\n * 动态筛选执行结果(运行期字段)\n * @description prepare() 阶段写入,运行时只读\n */\n result?: {\n success: boolean\n data?: number | string\n }\n}\n\nexport const zPartialSelector = zDatum\nexport const zMeasureSelector = z.object({\n field: z.string(),\n operator: z.enum(['=', '==', '!=', '>', '<', '>=', '<=', 'between']).nullish(),\n op: z.enum(['=', '==', '!=', '>', '<', '>=', '<=', 'between']).nullish(),\n value: z.union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]),\n})\n\nexport const zDimensionSelector = z.object({\n field: z.string(),\n operator: z.enum(['in', 'not in']).nullish(),\n op: z.enum(['in', 'not in']).nullish(),\n value: z.union([z.string(), z.number(), z.array(z.union([z.string(), z.number()]))]),\n})\n\nexport const zSelector = z.union([z.string(), z.number(), zMeasureSelector, zDimensionSelector, zPartialSelector])\n\nexport const zSelectors = z.array(zSelector)\n\nexport const zAreaSelector = z.union([zMeasureSelector, zDimensionSelector])\n\nexport const zAreaSelectors = z.array(zAreaSelector)\n\nexport const zCellSelector = z.object({\n __row_index: z.number(),\n field: z.union([z.string(), z.literal('*')]),\n})\n\nexport const zTableDynamicFilter = z.object({\n type: z.literal('row-with-field'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([zSelector, zSelectors]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.array(zCellSelector).optional(),\n })\n .optional(),\n})\n\nexport const zChartDynamicFilter = z.object({\n type: z.literal('row-with-field'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([zSelector, zSelectors]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.array(zCellSelector).optional(),\n })\n .optional(),\n})\n\nexport const zValueDynamicFilter = z.object({\n type: z.literal('value'),\n description: z.string().optional(),\n code: z.string(),\n fallback: z.union([z.string(), z.number()]).optional(),\n result: z\n .object({\n success: z.boolean(),\n data: z.union([z.number(), z.string()]).optional(),\n })\n .optional(),\n})\n\n/**\n * @deprecated 请使用 zTableDynamicFilter 或 zChartDynamicFilter\n */\nexport const zDynamicFilter = z.union([zTableDynamicFilter, zChartDynamicFilter])\n"],"names":["zPartialSelector","zDatum","zMeasureSelector","z","zDimensionSelector","zSelector","zSelectors","zAreaSelector","zAreaSelectors","zCellSelector","zTableDynamicFilter","zChartDynamicFilter","zValueDynamicFilter","zDynamicFilter"],"mappings":";;AA8YO,MAAMA,mBAAmBC;AACzB,MAAMC,mBAAmBC,EAAE,MAAM,CAAC;IACvC,OAAOA,EAAE,MAAM;IACf,UAAUA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAK;QAAM;QAAM;QAAK;QAAK;QAAM;QAAM;KAAU,EAAE,OAAO;IAC5E,IAAIA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAK;QAAM;QAAM;QAAK;QAAK;QAAM;QAAM;KAAU,EAAE,OAAO;IACtE,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;QAAIA,EAAE,KAAK,CAACA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG;KAAG;AACrF;AAEO,MAAMC,qBAAqBD,EAAE,MAAM,CAAC;IACzC,OAAOA,EAAE,MAAM;IACf,UAAUA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAM;KAAS,EAAE,OAAO;IAC1C,IAAIA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAM;KAAS,EAAE,OAAO;IACpC,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;QAAIA,EAAE,KAAK,CAACA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG;KAAG;AACrF;AAEO,MAAME,YAAYF,EAAE,KAAK,CAAC;IAACA,EAAE,MAAM;IAAIA,EAAE,MAAM;IAAID;IAAkBE;IAAoBJ;CAAiB;AAE1G,MAAMM,aAAaH,EAAE,KAAK,CAACE;AAE3B,MAAME,gBAAgBJ,EAAE,KAAK,CAAC;IAACD;IAAkBE;CAAmB;AAEpE,MAAMI,iBAAiBL,EAAE,KAAK,CAACI;AAE/B,MAAME,gBAAgBN,EAAE,MAAM,CAAC;IACpC,aAAaA,EAAE,MAAM;IACrB,OAAOA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,OAAO,CAAC;KAAK;AAC7C;AAEO,MAAMO,sBAAsBP,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACE;QAAWC;KAAW,EAAE,QAAQ;IACnD,QAAQH,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAACM,eAAe,QAAQ;IACvC,GACC,QAAQ;AACb;AAEO,MAAME,sBAAsBR,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACE;QAAWC;KAAW,EAAE,QAAQ;IACnD,QAAQH,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAACM,eAAe,QAAQ;IACvC,GACC,QAAQ;AACb;AAEO,MAAMG,sBAAsBT,EAAE,MAAM,CAAC;IAC1C,MAAMA,EAAE,OAAO,CAAC;IAChB,aAAaA,EAAE,MAAM,GAAG,QAAQ;IAChC,MAAMA,EAAE,MAAM;IACd,UAAUA,EAAE,KAAK,CAAC;QAACA,EAAE,MAAM;QAAIA,EAAE,MAAM;KAAG,EAAE,QAAQ;IACpD,QAAQA,EAAAA,MACC,CAAC;QACN,SAASA,EAAE,OAAO;QAClB,MAAMA,EAAE,KAAK,CAAC;YAACA,EAAE,MAAM;YAAIA,EAAE,MAAM;SAAG,EAAE,QAAQ;IAClD,GACC,QAAQ;AACb;AAKO,MAAMU,iBAAiBV,EAAE,KAAK,CAAC;IAACO;IAAqBC;CAAoB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types/properties/aggregation/zAggregation.js","sources":["webpack://@visactor/vseed/./src/types/properties/aggregation/zAggregation.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const zTotalType = z.enum(['sum', 'avg', 'max', 'min', 'count'])\n"],"names":["zTotalType","z"],"mappings":";AAEO,MAAMA,aAAaC,CAAC,CAADA,OAAM,CAAC;IAAC;IAAO;IAAO;IAAO;IAAO;CAAQ"}
|
|
@@ -145,7 +145,10 @@ export declare const zAnnotation: z.ZodObject<{
|
|
|
145
145
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
146
146
|
result: z.ZodOptional<z.ZodObject<{
|
|
147
147
|
success: z.ZodBoolean;
|
|
148
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
148
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
149
|
+
__row_index: z.ZodNumber;
|
|
150
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
151
|
+
}, z.core.$strip>>>;
|
|
149
152
|
}, z.core.$strip>>;
|
|
150
153
|
}, z.core.$strip>>;
|
|
151
154
|
text: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
@@ -315,7 +318,10 @@ export declare const zAnnotation: z.ZodObject<{
|
|
|
315
318
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
316
319
|
result: z.ZodOptional<z.ZodObject<{
|
|
317
320
|
success: z.ZodBoolean;
|
|
318
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
321
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
322
|
+
__row_index: z.ZodNumber;
|
|
323
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
324
|
+
}, z.core.$strip>>>;
|
|
319
325
|
}, z.core.$strip>>;
|
|
320
326
|
}, z.core.$strip>>;
|
|
321
327
|
text: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
@@ -144,7 +144,10 @@ export declare const zAnnotationPoint: z.ZodObject<{
|
|
|
144
144
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
145
145
|
result: z.ZodOptional<z.ZodObject<{
|
|
146
146
|
success: z.ZodBoolean;
|
|
147
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
147
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
148
|
+
__row_index: z.ZodNumber;
|
|
149
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
148
151
|
}, z.core.$strip>>;
|
|
149
152
|
}, z.core.$strip>>;
|
|
150
153
|
text: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
@@ -75,7 +75,10 @@ export declare const zAnnotationPointConfig: z.ZodObject<{
|
|
|
75
75
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
76
76
|
result: z.ZodOptional<z.ZodObject<{
|
|
77
77
|
success: z.ZodBoolean;
|
|
78
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
78
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
79
|
+
__row_index: z.ZodNumber;
|
|
80
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
81
|
+
}, z.core.$strip>>>;
|
|
79
82
|
}, z.core.$strip>>;
|
|
80
83
|
}, z.core.$strip>>>;
|
|
81
84
|
textColor: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>;
|
|
@@ -237,7 +240,10 @@ export declare const zAnnotationConfig: z.ZodObject<{
|
|
|
237
240
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
238
241
|
result: z.ZodOptional<z.ZodObject<{
|
|
239
242
|
success: z.ZodBoolean;
|
|
240
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
243
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
244
|
+
__row_index: z.ZodNumber;
|
|
245
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
246
|
+
}, z.core.$strip>>>;
|
|
241
247
|
}, z.core.$strip>>;
|
|
242
248
|
}, z.core.$strip>>>;
|
|
243
249
|
textColor: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>;
|
|
@@ -114,6 +114,87 @@ export declare const zAreaConfig: z.ZodObject<{
|
|
|
114
114
|
}>>>;
|
|
115
115
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
116
116
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>>;
|
|
117
|
+
dynamicFilter: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"row-with-field">;
|
|
119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
120
|
+
code: z.ZodString;
|
|
121
|
+
fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
122
|
+
field: z.ZodString;
|
|
123
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
124
|
+
"=": "=";
|
|
125
|
+
"==": "==";
|
|
126
|
+
"!=": "!=";
|
|
127
|
+
">": ">";
|
|
128
|
+
"<": "<";
|
|
129
|
+
">=": ">=";
|
|
130
|
+
"<=": "<=";
|
|
131
|
+
between: "between";
|
|
132
|
+
}>>>;
|
|
133
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
134
|
+
"=": "=";
|
|
135
|
+
"==": "==";
|
|
136
|
+
"!=": "!=";
|
|
137
|
+
">": ">";
|
|
138
|
+
"<": "<";
|
|
139
|
+
">=": ">=";
|
|
140
|
+
"<=": "<=";
|
|
141
|
+
between: "between";
|
|
142
|
+
}>>>;
|
|
143
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
+
field: z.ZodString;
|
|
146
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
147
|
+
in: "in";
|
|
148
|
+
"not in": "not in";
|
|
149
|
+
}>>>;
|
|
150
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
151
|
+
in: "in";
|
|
152
|
+
"not in": "not in";
|
|
153
|
+
}>>>;
|
|
154
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
155
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
156
|
+
field: z.ZodString;
|
|
157
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
158
|
+
"=": "=";
|
|
159
|
+
"==": "==";
|
|
160
|
+
"!=": "!=";
|
|
161
|
+
">": ">";
|
|
162
|
+
"<": "<";
|
|
163
|
+
">=": ">=";
|
|
164
|
+
"<=": "<=";
|
|
165
|
+
between: "between";
|
|
166
|
+
}>>>;
|
|
167
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
168
|
+
"=": "=";
|
|
169
|
+
"==": "==";
|
|
170
|
+
"!=": "!=";
|
|
171
|
+
">": ">";
|
|
172
|
+
"<": "<";
|
|
173
|
+
">=": ">=";
|
|
174
|
+
"<=": "<=";
|
|
175
|
+
between: "between";
|
|
176
|
+
}>>>;
|
|
177
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
179
|
+
field: z.ZodString;
|
|
180
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
181
|
+
in: "in";
|
|
182
|
+
"not in": "not in";
|
|
183
|
+
}>>>;
|
|
184
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
185
|
+
in: "in";
|
|
186
|
+
"not in": "not in";
|
|
187
|
+
}>>>;
|
|
188
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
189
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
190
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
success: z.ZodBoolean;
|
|
192
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
193
|
+
__row_index: z.ZodNumber;
|
|
194
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
195
|
+
}, z.core.$strip>>>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
117
198
|
}, z.core.$strip>>>;
|
|
118
199
|
color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
119
200
|
colorScheme: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
@@ -411,7 +492,10 @@ export declare const zAreaConfig: z.ZodObject<{
|
|
|
411
492
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
412
493
|
result: z.ZodOptional<z.ZodObject<{
|
|
413
494
|
success: z.ZodBoolean;
|
|
414
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
495
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
496
|
+
__row_index: z.ZodNumber;
|
|
497
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
498
|
+
}, z.core.$strip>>>;
|
|
415
499
|
}, z.core.$strip>>;
|
|
416
500
|
}, z.core.$strip>>>;
|
|
417
501
|
textColor: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>;
|
|
@@ -631,6 +715,87 @@ export declare const zAreaPercentConfig: z.ZodObject<{
|
|
|
631
715
|
}>>>;
|
|
632
716
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
633
717
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>>;
|
|
718
|
+
dynamicFilter: z.ZodOptional<z.ZodObject<{
|
|
719
|
+
type: z.ZodLiteral<"row-with-field">;
|
|
720
|
+
description: z.ZodOptional<z.ZodString>;
|
|
721
|
+
code: z.ZodString;
|
|
722
|
+
fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
723
|
+
field: z.ZodString;
|
|
724
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
725
|
+
"=": "=";
|
|
726
|
+
"==": "==";
|
|
727
|
+
"!=": "!=";
|
|
728
|
+
">": ">";
|
|
729
|
+
"<": "<";
|
|
730
|
+
">=": ">=";
|
|
731
|
+
"<=": "<=";
|
|
732
|
+
between: "between";
|
|
733
|
+
}>>>;
|
|
734
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
735
|
+
"=": "=";
|
|
736
|
+
"==": "==";
|
|
737
|
+
"!=": "!=";
|
|
738
|
+
">": ">";
|
|
739
|
+
"<": "<";
|
|
740
|
+
">=": ">=";
|
|
741
|
+
"<=": "<=";
|
|
742
|
+
between: "between";
|
|
743
|
+
}>>>;
|
|
744
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
745
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
746
|
+
field: z.ZodString;
|
|
747
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
748
|
+
in: "in";
|
|
749
|
+
"not in": "not in";
|
|
750
|
+
}>>>;
|
|
751
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
752
|
+
in: "in";
|
|
753
|
+
"not in": "not in";
|
|
754
|
+
}>>>;
|
|
755
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
756
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
|
|
757
|
+
field: z.ZodString;
|
|
758
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
759
|
+
"=": "=";
|
|
760
|
+
"==": "==";
|
|
761
|
+
"!=": "!=";
|
|
762
|
+
">": ">";
|
|
763
|
+
"<": "<";
|
|
764
|
+
">=": ">=";
|
|
765
|
+
"<=": "<=";
|
|
766
|
+
between: "between";
|
|
767
|
+
}>>>;
|
|
768
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
769
|
+
"=": "=";
|
|
770
|
+
"==": "==";
|
|
771
|
+
"!=": "!=";
|
|
772
|
+
">": ">";
|
|
773
|
+
"<": "<";
|
|
774
|
+
">=": ">=";
|
|
775
|
+
"<=": "<=";
|
|
776
|
+
between: "between";
|
|
777
|
+
}>>>;
|
|
778
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
780
|
+
field: z.ZodString;
|
|
781
|
+
operator: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
782
|
+
in: "in";
|
|
783
|
+
"not in": "not in";
|
|
784
|
+
}>>>;
|
|
785
|
+
op: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
786
|
+
in: "in";
|
|
787
|
+
"not in": "not in";
|
|
788
|
+
}>>>;
|
|
789
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
|
|
790
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
791
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
792
|
+
success: z.ZodBoolean;
|
|
793
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
794
|
+
__row_index: z.ZodNumber;
|
|
795
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
796
|
+
}, z.core.$strip>>>;
|
|
797
|
+
}, z.core.$strip>>;
|
|
798
|
+
}, z.core.$strip>>;
|
|
634
799
|
}, z.core.$strip>>>;
|
|
635
800
|
color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
636
801
|
colorScheme: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
@@ -928,7 +1093,10 @@ export declare const zAreaPercentConfig: z.ZodObject<{
|
|
|
928
1093
|
}, z.core.$strip>, z.ZodRecord<z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodAny>]>>]>>;
|
|
929
1094
|
result: z.ZodOptional<z.ZodObject<{
|
|
930
1095
|
success: z.ZodBoolean;
|
|
931
|
-
data: z.ZodOptional<z.ZodArray<z.
|
|
1096
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1097
|
+
__row_index: z.ZodNumber;
|
|
1098
|
+
field: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
|
|
1099
|
+
}, z.core.$strip>>>;
|
|
932
1100
|
}, z.core.$strip>>;
|
|
933
1101
|
}, z.core.$strip>>>;
|
|
934
1102
|
textColor: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>;
|