@neo4j-ndl/react 4.16.2 → 4.16.4
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/lib/cjs/data-grid/style-rules/index.js +14 -12
- package/lib/cjs/data-grid/style-rules/index.js.map +1 -1
- package/lib/cjs/data-grid/style-rules/types.js +23 -1
- package/lib/cjs/data-grid/style-rules/types.js.map +1 -1
- package/lib/esm/data-grid/style-rules/index.js +1 -0
- package/lib/esm/data-grid/style-rules/index.js.map +1 -1
- package/lib/esm/data-grid/style-rules/types.js +21 -0
- package/lib/esm/data-grid/style-rules/types.js.map +1 -1
- package/lib/types/_common/utils.d.ts +1 -1
- package/lib/types/_common/utils.d.ts.map +1 -1
- package/lib/types/data-grid/style-rules/index.d.ts +1 -0
- package/lib/types/data-grid/style-rules/index.d.ts.map +1 -1
- package/lib/types/data-grid/style-rules/types.d.ts +21 -0
- package/lib/types/data-grid/style-rules/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -20,21 +20,23 @@
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.DataGridTimeLiteralSchema = exports.DataGridStyleRuleWhereSchema = exports.DataGridStyleRuleSchema = exports.DataGridStyleRuleOperandSchema = exports.DataGridStyleRuleLiteralSchema = exports.DataGridDisableableColorSchema = exports.DataGridDatetimeLiteralSchema = exports.DataGridColumnRefSchema = exports.DataGridColorRangeSchema = exports.DataGridCellStyleSchema = exports.useDataGridCellStyle = exports.evaluateDataGridStyleRules = void 0;
|
|
23
|
+
exports.DataGridTimeLiteralSchema = exports.DataGridStyleRuleWhereSchema = exports.DataGridStyleRuleSchema = exports.DataGridStyleRuleOperandSchema = exports.DataGridStyleRuleLiteralSchema = exports.DataGridDisableableColorSchema = exports.DataGridDatetimeLiteralSchema = exports.DataGridColumnRefSchema = exports.DataGridColorRangeSchema = exports.DataGridCellStyleSchema = exports.isDataGridStyleRule = exports.useDataGridCellStyle = exports.evaluateDataGridStyleRules = void 0;
|
|
24
24
|
var evaluate_1 = require("./evaluate");
|
|
25
25
|
Object.defineProperty(exports, "evaluateDataGridStyleRules", { enumerable: true, get: function () { return evaluate_1.evaluateDataGridStyleRules; } });
|
|
26
26
|
var hooks_1 = require("./hooks");
|
|
27
27
|
Object.defineProperty(exports, "useDataGridCellStyle", { enumerable: true, get: function () { return hooks_1.useDataGridCellStyle; } });
|
|
28
|
-
// TODO v5: remove schema exports
|
|
29
28
|
var types_1 = require("./types");
|
|
30
|
-
Object.defineProperty(exports, "
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "
|
|
34
|
-
Object.defineProperty(exports, "
|
|
35
|
-
Object.defineProperty(exports, "
|
|
36
|
-
Object.defineProperty(exports, "
|
|
37
|
-
Object.defineProperty(exports, "
|
|
38
|
-
Object.defineProperty(exports, "
|
|
39
|
-
Object.defineProperty(exports, "
|
|
29
|
+
Object.defineProperty(exports, "isDataGridStyleRule", { enumerable: true, get: function () { return types_1.isDataGridStyleRule; } });
|
|
30
|
+
// TODO v5: remove schema exports
|
|
31
|
+
var types_2 = require("./types");
|
|
32
|
+
Object.defineProperty(exports, "DataGridCellStyleSchema", { enumerable: true, get: function () { return types_2.DataGridCellStyleSchema; } });
|
|
33
|
+
Object.defineProperty(exports, "DataGridColorRangeSchema", { enumerable: true, get: function () { return types_2.DataGridColorRangeSchema; } });
|
|
34
|
+
Object.defineProperty(exports, "DataGridColumnRefSchema", { enumerable: true, get: function () { return types_2.DataGridColumnRefSchema; } });
|
|
35
|
+
Object.defineProperty(exports, "DataGridDatetimeLiteralSchema", { enumerable: true, get: function () { return types_2.DataGridDatetimeLiteralSchema; } });
|
|
36
|
+
Object.defineProperty(exports, "DataGridDisableableColorSchema", { enumerable: true, get: function () { return types_2.DataGridDisableableColorSchema; } });
|
|
37
|
+
Object.defineProperty(exports, "DataGridStyleRuleLiteralSchema", { enumerable: true, get: function () { return types_2.DataGridStyleRuleLiteralSchema; } });
|
|
38
|
+
Object.defineProperty(exports, "DataGridStyleRuleOperandSchema", { enumerable: true, get: function () { return types_2.DataGridStyleRuleOperandSchema; } });
|
|
39
|
+
Object.defineProperty(exports, "DataGridStyleRuleSchema", { enumerable: true, get: function () { return types_2.DataGridStyleRuleSchema; } });
|
|
40
|
+
Object.defineProperty(exports, "DataGridStyleRuleWhereSchema", { enumerable: true, get: function () { return types_2.DataGridStyleRuleWhereSchema; } });
|
|
41
|
+
Object.defineProperty(exports, "DataGridTimeLiteralSchema", { enumerable: true, get: function () { return types_2.DataGridTimeLiteralSchema; } });
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA;AACnC,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAC7B,iCAAiC;AACjC,iCAWiB;AAVf,gHAAA,uBAAuB,OAAA;AACvB,iHAAA,wBAAwB,OAAA;AACxB,gHAAA,uBAAuB,OAAA;AACvB,sHAAA,6BAA6B,OAAA;AAC7B,uHAAA,8BAA8B,OAAA;AAC9B,uHAAA,8BAA8B,OAAA;AAC9B,uHAAA,8BAA8B,OAAA;AAC9B,gHAAA,uBAAuB,OAAA;AACvB,qHAAA,4BAA4B,OAAA;AAC5B,kHAAA,yBAAyB,OAAA","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { evaluateDataGridStyleRules } from './evaluate';\nexport { useDataGridCellStyle } from './hooks';\n// TODO v5: remove schema exports\nexport {\n DataGridCellStyleSchema,\n DataGridColorRangeSchema,\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridDisableableColorSchema,\n DataGridStyleRuleLiteralSchema,\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleSchema,\n DataGridStyleRuleWhereSchema,\n DataGridTimeLiteralSchema,\n} from './types';\nexport type {\n DataGridCellStyle,\n DataGridColorRange,\n DataGridColumnRef,\n DataGridDatetimeLiteral,\n DataGridDisableableColor,\n DataGridStyleRuleLiteral,\n DataGridStyleRuleOperand,\n DataGridStyleRule,\n DataGridStyleRuleWhere,\n DataGridStyleRuleValueConverter,\n DataGridStyleRuleValueConverters,\n DataGridTimeLiteral,\n} from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,uCAAwD;AAA/C,sHAAA,0BAA0B,OAAA;AACnC,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAC7B,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA;AAC5B,iCAAiC;AACjC,iCAWiB;AAVf,gHAAA,uBAAuB,OAAA;AACvB,iHAAA,wBAAwB,OAAA;AACxB,gHAAA,uBAAuB,OAAA;AACvB,sHAAA,6BAA6B,OAAA;AAC7B,uHAAA,8BAA8B,OAAA;AAC9B,uHAAA,8BAA8B,OAAA;AAC9B,uHAAA,8BAA8B,OAAA;AAC9B,gHAAA,uBAAuB,OAAA;AACvB,qHAAA,4BAA4B,OAAA;AAC5B,kHAAA,yBAAyB,OAAA","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { evaluateDataGridStyleRules } from './evaluate';\nexport { useDataGridCellStyle } from './hooks';\nexport { isDataGridStyleRule } from './types';\n// TODO v5: remove schema exports\nexport {\n DataGridCellStyleSchema,\n DataGridColorRangeSchema,\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridDisableableColorSchema,\n DataGridStyleRuleLiteralSchema,\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleSchema,\n DataGridStyleRuleWhereSchema,\n DataGridTimeLiteralSchema,\n} from './types';\nexport type {\n DataGridCellStyle,\n DataGridColorRange,\n DataGridColumnRef,\n DataGridDatetimeLiteral,\n DataGridDisableableColor,\n DataGridStyleRuleLiteral,\n DataGridStyleRuleOperand,\n DataGridStyleRule,\n DataGridStyleRuleWhere,\n DataGridStyleRuleValueConverter,\n DataGridStyleRuleValueConverters,\n DataGridTimeLiteral,\n} from './types';\n"]}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.DataGridStyleRuleSchema = exports.DataGridCellStyleSchema = exports.DataGridDisableableColorSchema = exports.DataGridColorRangeSchema = exports.DataGridStyleRuleWhereSchema = exports.DataGridStyleRuleOperandSchema = exports.DataGridTimeLiteralSchema = exports.DataGridDatetimeLiteralSchema = exports.DataGridColumnRefSchema = exports.DataGridStyleRuleLiteralSchema = void 0;
|
|
23
|
+
exports.isDataGridStyleRule = exports.DataGridStyleRuleSchema = exports.DataGridCellStyleSchema = exports.DataGridDisableableColorSchema = exports.DataGridColorRangeSchema = exports.DataGridStyleRuleWhereSchema = exports.DataGridStyleRuleOperandSchema = exports.DataGridTimeLiteralSchema = exports.DataGridDatetimeLiteralSchema = exports.DataGridColumnRefSchema = exports.DataGridStyleRuleLiteralSchema = void 0;
|
|
24
24
|
const zod_1 = require("zod");
|
|
25
25
|
const style_rules_1 = require("../../_generated/style-rules");
|
|
26
26
|
/*
|
|
@@ -179,4 +179,26 @@ exports.DataGridStyleRuleSchema = zod_1.z.object({
|
|
|
179
179
|
/** Condition to evaluate. If omitted, rule always applies to matched column(s). */
|
|
180
180
|
where: exports.DataGridStyleRuleWhereSchema.optional(),
|
|
181
181
|
});
|
|
182
|
+
/**
|
|
183
|
+
* Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod
|
|
184
|
+
* schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid
|
|
185
|
+
* style rule.
|
|
186
|
+
*
|
|
187
|
+
* This lets consumers validate values without taking a dependency on Zod or on
|
|
188
|
+
* our schema export. For example, it can be passed to another validation
|
|
189
|
+
* library's custom check:
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* import { z } from 'zod';
|
|
194
|
+
* import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';
|
|
195
|
+
*
|
|
196
|
+
* const formSchema = z.object({
|
|
197
|
+
* rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),
|
|
198
|
+
* notes: z.string(),
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
const isDataGridStyleRule = (value) => exports.DataGridStyleRuleSchema.safeParse(value).success;
|
|
203
|
+
exports.isDataGridStyleRule = isDataGridStyleRule;
|
|
182
204
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,6BAAwB;AAExB,8DAGsC;AAEtC;;;GAGG;AAEH,mFAAmF;AACtE,QAAA,8BAA8B,GAAG,OAAC,CAAC,KAAK,CAAC;IACpD,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,OAAO,EAAE;IACX,OAAC,CAAC,IAAI,EAAE;CACT,CAAC,CAAC;AAKH,+EAA+E;AAClE,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGxE;;;;;;;;;;;GAWG;AACU,QAAA,6BAA6B,GAAG,mCAAqB,CAAC;AAKnE;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,+BAAiB,CAAC;AAG3D,oIAAoI;AACvH,QAAA,8BAA8B,GAAG,OAAC,CAAC,KAAK,CAAC;IACpD,+BAAuB;IACvB,qCAA6B;IAC7B,iCAAyB;IACzB,sCAA8B;CAC/B,CAAC,CAAC;AA4BU,QAAA,4BAA4B,GACvC,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACV,OAAC,CAAC,KAAK,CAAC;IACN,OAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,oCAA4B,EAAE,CAAC;IAC/C,OAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAC,CAAC,KAAK,CAAC,oCAA4B,CAAC,EAAE,CAAC;IACxD,OAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,oCAA4B,CAAC,EAAE,CAAC;IACvD,OAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,OAAC,CAAC,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,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,6CAA6C;IAC7C,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,0CAA0C;IAC1C,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,oPAAoP;IACpP,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7C,mFAAmF;IACnF,KAAK,EAAE,oCAA4B,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { z } from 'zod';\n\nimport {\n DatetimeLiteralSchema,\n TimeLiteralSchema,\n} from '../../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n */\n\n/** A scalar literal that can appear as an operand in a style-rule where clause. */\nexport const DataGridStyleRuleLiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type DataGridStyleRuleLiteral = z.infer<\n typeof DataGridStyleRuleLiteralSchema\n>;\n\n/** A reference to a column whose cell value is resolved at evaluation time. */\nexport const DataGridColumnRefSchema = z.object({ column: z.string() });\nexport type DataGridColumnRef = z.infer<typeof DataGridColumnRefSchema>;\n\n/**\n * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond\n * timestamp at evaluation time. Wraps the shared `DatetimeLiteralSchema` with a\n * DataGrid-specific name. Supported formats:\n * - RFC 9557 with IANA timezone: `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset\n * inferred) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"` (offset explicit)\n * - UTC or offset datetime: `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * - Plain datetime (treated as UTC): `\"2024-01-01T14:30:00\"`\n * - Date-only (treated as UTC midnight): `\"2024-01-01\"`\n *\n * Unzoned datetimes without `Z` or an offset are treated as UTC wall-clock time.\n */\nexport const DataGridDatetimeLiteralSchema = DatetimeLiteralSchema;\nexport type DataGridDatetimeLiteral = z.infer<\n typeof DataGridDatetimeLiteralSchema\n>;\n\n/**\n * An ISO 8601 time literal that resolves to milliseconds since UTC midnight at\n * evaluation time. Wraps the shared `TimeLiteralSchema` with a DataGrid-specific\n * name. Supported formats:\n * - Local time (treated as UTC): `\"14:30:00\"`, `\"14:30:00.500\"`\n * - Offset time (UTC-normalised): `\"14:30:00+02:00\"`\n */\nexport const DataGridTimeLiteralSchema = TimeLiteralSchema;\nexport type DataGridTimeLiteral = z.infer<typeof DataGridTimeLiteralSchema>;\n\n/** An operand in a style-rule where clause -- either a literal value, a datetime literal, a time literal, or a column reference. */\nexport const DataGridStyleRuleOperandSchema = z.union([\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridTimeLiteralSchema,\n DataGridStyleRuleLiteralSchema,\n]);\nexport type DataGridStyleRuleOperand =\n | DataGridColumnRef\n | DataGridDatetimeLiteral\n | DataGridTimeLiteral\n | DataGridStyleRuleLiteral;\n\n/**\n * Recursive WHERE clause for conditional expressions.\n * Inspired by the graph visualization style rule system but adapted for tabular data.\n *\n * The type is manually defined for the export, since zod doesn't support\n * exporting inferred recursive types.\n */\nexport type DataGridStyleRuleWhere =\n | { not: DataGridStyleRuleWhere }\n | { and: DataGridStyleRuleWhere[] }\n | { or: DataGridStyleRuleWhere[] }\n | { equal: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { contains: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { startsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { endsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { isNull: DataGridStyleRuleOperand };\n\nexport const DataGridStyleRuleWhereSchema: z.ZodType<DataGridStyleRuleWhere> =\n z.lazy(() =>\n z.union([\n z.object({ not: DataGridStyleRuleWhereSchema }),\n z.object({ and: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({ or: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({\n equal: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n contains: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n startsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n endsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({ isNull: DataGridStyleRuleOperandSchema }),\n ]),\n );\n\n/**\n * Gradient coloring based on a continuous numeric column value.\n * Colors should be hex strings (#rrggbb).\n * If the column value is missing or non-numeric, the colorRange is ignored.\n */\nexport const DataGridColorRangeSchema = z.object({\n /** Disable this color range without removing it. */\n isDisabled: z.boolean().optional(),\n /** Hex color (#rrggbb) at the maximum value. */\n maxColor: z.string(),\n /** The high end of the numeric range. Values above this clamp to maxColor. */\n maxValue: z.number(),\n /** Hex color (#rrggbb) at the optional mid-point for a 3-stop gradient. */\n midColor: z.string().optional(),\n /** Optional inflection point between minValue and maxValue for a 3-stop gradient. */\n midValue: z.number().optional(),\n /** Hex color (#rrggbb) at the minimum value. */\n minColor: z.string(),\n /** The low end of the numeric range. Values below this clamp to minColor. */\n minValue: z.number(),\n /** The column whose numeric value drives the interpolation. */\n onColumn: z.string(),\n});\nexport type DataGridColorRange = z.infer<typeof DataGridColorRangeSchema>;\n\n/** A disable-able static color value. */\nexport const DataGridDisableableColorSchema = z.object({\n /** Disable this style without removing it. */\n isDisabled: z.boolean().optional(),\n /** The CSS color value (e.g. '#fee2e2'). */\n value: z.string(),\n});\nexport type DataGridDisableableColor = z.infer<\n typeof DataGridDisableableColorSchema\n>;\n\n/** Visual properties that a style rule can apply to a cell or row. */\nexport const DataGridCellStyleSchema = z.object({\n /** CSS background color / cell fill (e.g. '#fee2e2'). Matches the graph `Style.color`. */\n color: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the cell fill. Matches the graph `Style.colorRange`. */\n colorRange: DataGridColorRangeSchema.optional(),\n /** CSS text color (e.g. '#991b1b'). Grid-only; no graph equivalent. */\n textColor: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the text color. Grid-only; no graph equivalent. */\n textColorRange: DataGridColorRangeSchema.optional(),\n});\nexport type DataGridCellStyle = z.infer<typeof DataGridCellStyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluating the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\n/**\n * A function that converts a complex or non-scalar cell value into a\n * `DataGridStyleRuleLiteral` so it can participate in where-clause evaluation\n * and color-range interpolation.\n *\n * The function receives the raw cell value (`unknown`) and must return a scalar\n * (`string | number | boolean | null`). Return `null` to signal that the value\n * is missing or cannot be represented.\n *\n * Note: converter functions are TypeScript-only — they cannot be serialized as\n * JSON, so no Zod schema is provided.\n */\nexport type DataGridStyleRuleValueConverter = (\n value: unknown,\n) => DataGridStyleRuleLiteral;\n\n/**\n * A map of column id → converter function.\n * Pass this as the `styleRuleValueConverters` prop on `DataGrid` to teach the\n * style-rule engine how to interpret complex cell values for specific columns.\n *\n * @example\n * ```ts\n * const converters: DataGridStyleRuleValueConverters = {\n * priority: (v) => {\n * const s = v as { min: number; max: number };\n * return s.max - s.min;\n * },\n * };\n * ```\n */\nexport type DataGridStyleRuleValueConverters = Record<\n string,\n DataGridStyleRuleValueConverter\n>;\n\n/** A single declarative rule that conditionally applies styles to DataGrid cells. */\nexport const DataGridStyleRuleSchema = z.object({\n /** Style properties to apply when the rule matches. */\n apply: DataGridCellStyleSchema,\n /** Which column this rule targets. Set to null to apply styles to all columns (row-level effect). */\n column: z.string().nullable(),\n /** Disable this rule without removing it. */\n isDisabled: z.boolean().optional(),\n /** Additional metadata about the rule. */\n metaData: metaDataSchema.optional(),\n /** Higher priority rules are applied later (override lower). Must be >= 0; negative values are reserved for internal use. Rules without explicit priority preserve their array order but are always applied before rules with explicit priority. */\n priority: z.number().nonnegative().optional(),\n /** Condition to evaluate. If omitted, rule always applies to matched column(s). */\n where: DataGridStyleRuleWhereSchema.optional(),\n});\nexport type DataGridStyleRule = z.infer<typeof DataGridStyleRuleSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAm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AAE;IACnC,oPAAoP;IACpP,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7C,mFAAmF;IACnF,KAAK,EAAE,oCAA4B,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,mBAAmB,GAAG,CACjC,KAAc,EACc,EAAE,CAC9B,+BAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAHtC,QAAA,mBAAmB,uBAGmB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { z } from 'zod';\n\nimport {\n DatetimeLiteralSchema,\n TimeLiteralSchema,\n} from '../../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n */\n\n/** A scalar literal that can appear as an operand in a style-rule where clause. */\nexport const DataGridStyleRuleLiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type DataGridStyleRuleLiteral = z.infer<\n typeof DataGridStyleRuleLiteralSchema\n>;\n\n/** A reference to a column whose cell value is resolved at evaluation time. */\nexport const DataGridColumnRefSchema = z.object({ column: z.string() });\nexport type DataGridColumnRef = z.infer<typeof DataGridColumnRefSchema>;\n\n/**\n * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond\n * timestamp at evaluation time. Wraps the shared `DatetimeLiteralSchema` with a\n * DataGrid-specific name. Supported formats:\n * - RFC 9557 with IANA timezone: `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset\n * inferred) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"` (offset explicit)\n * - UTC or offset datetime: `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * - Plain datetime (treated as UTC): `\"2024-01-01T14:30:00\"`\n * - Date-only (treated as UTC midnight): `\"2024-01-01\"`\n *\n * Unzoned datetimes without `Z` or an offset are treated as UTC wall-clock time.\n */\nexport const DataGridDatetimeLiteralSchema = DatetimeLiteralSchema;\nexport type DataGridDatetimeLiteral = z.infer<\n typeof DataGridDatetimeLiteralSchema\n>;\n\n/**\n * An ISO 8601 time literal that resolves to milliseconds since UTC midnight at\n * evaluation time. Wraps the shared `TimeLiteralSchema` with a DataGrid-specific\n * name. Supported formats:\n * - Local time (treated as UTC): `\"14:30:00\"`, `\"14:30:00.500\"`\n * - Offset time (UTC-normalised): `\"14:30:00+02:00\"`\n */\nexport const DataGridTimeLiteralSchema = TimeLiteralSchema;\nexport type DataGridTimeLiteral = z.infer<typeof DataGridTimeLiteralSchema>;\n\n/** An operand in a style-rule where clause -- either a literal value, a datetime literal, a time literal, or a column reference. */\nexport const DataGridStyleRuleOperandSchema = z.union([\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridTimeLiteralSchema,\n DataGridStyleRuleLiteralSchema,\n]);\nexport type DataGridStyleRuleOperand =\n | DataGridColumnRef\n | DataGridDatetimeLiteral\n | DataGridTimeLiteral\n | DataGridStyleRuleLiteral;\n\n/**\n * Recursive WHERE clause for conditional expressions.\n * Inspired by the graph visualization style rule system but adapted for tabular data.\n *\n * The type is manually defined for the export, since zod doesn't support\n * exporting inferred recursive types.\n */\nexport type DataGridStyleRuleWhere =\n | { not: DataGridStyleRuleWhere }\n | { and: DataGridStyleRuleWhere[] }\n | { or: DataGridStyleRuleWhere[] }\n | { equal: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { contains: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { startsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { endsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { isNull: DataGridStyleRuleOperand };\n\nexport const DataGridStyleRuleWhereSchema: z.ZodType<DataGridStyleRuleWhere> =\n z.lazy(() =>\n z.union([\n z.object({ not: DataGridStyleRuleWhereSchema }),\n z.object({ and: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({ or: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({\n equal: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n contains: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n startsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n endsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({ isNull: DataGridStyleRuleOperandSchema }),\n ]),\n );\n\n/**\n * Gradient coloring based on a continuous numeric column value.\n * Colors should be hex strings (#rrggbb).\n * If the column value is missing or non-numeric, the colorRange is ignored.\n */\nexport const DataGridColorRangeSchema = z.object({\n /** Disable this color range without removing it. */\n isDisabled: z.boolean().optional(),\n /** Hex color (#rrggbb) at the maximum value. */\n maxColor: z.string(),\n /** The high end of the numeric range. Values above this clamp to maxColor. */\n maxValue: z.number(),\n /** Hex color (#rrggbb) at the optional mid-point for a 3-stop gradient. */\n midColor: z.string().optional(),\n /** Optional inflection point between minValue and maxValue for a 3-stop gradient. */\n midValue: z.number().optional(),\n /** Hex color (#rrggbb) at the minimum value. */\n minColor: z.string(),\n /** The low end of the numeric range. Values below this clamp to minColor. */\n minValue: z.number(),\n /** The column whose numeric value drives the interpolation. */\n onColumn: z.string(),\n});\nexport type DataGridColorRange = z.infer<typeof DataGridColorRangeSchema>;\n\n/** A disable-able static color value. */\nexport const DataGridDisableableColorSchema = z.object({\n /** Disable this style without removing it. */\n isDisabled: z.boolean().optional(),\n /** The CSS color value (e.g. '#fee2e2'). */\n value: z.string(),\n});\nexport type DataGridDisableableColor = z.infer<\n typeof DataGridDisableableColorSchema\n>;\n\n/** Visual properties that a style rule can apply to a cell or row. */\nexport const DataGridCellStyleSchema = z.object({\n /** CSS background color / cell fill (e.g. '#fee2e2'). Matches the graph `Style.color`. */\n color: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the cell fill. Matches the graph `Style.colorRange`. */\n colorRange: DataGridColorRangeSchema.optional(),\n /** CSS text color (e.g. '#991b1b'). Grid-only; no graph equivalent. */\n textColor: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the text color. Grid-only; no graph equivalent. */\n textColorRange: DataGridColorRangeSchema.optional(),\n});\nexport type DataGridCellStyle = z.infer<typeof DataGridCellStyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluating the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\n/**\n * A function that converts a complex or non-scalar cell value into a\n * `DataGridStyleRuleLiteral` so it can participate in where-clause evaluation\n * and color-range interpolation.\n *\n * The function receives the raw cell value (`unknown`) and must return a scalar\n * (`string | number | boolean | null`). Return `null` to signal that the value\n * is missing or cannot be represented.\n *\n * Note: converter functions are TypeScript-only — they cannot be serialized as\n * JSON, so no Zod schema is provided.\n */\nexport type DataGridStyleRuleValueConverter = (\n value: unknown,\n) => DataGridStyleRuleLiteral;\n\n/**\n * A map of column id → converter function.\n * Pass this as the `styleRuleValueConverters` prop on `DataGrid` to teach the\n * style-rule engine how to interpret complex cell values for specific columns.\n *\n * @example\n * ```ts\n * const converters: DataGridStyleRuleValueConverters = {\n * priority: (v) => {\n * const s = v as { min: number; max: number };\n * return s.max - s.min;\n * },\n * };\n * ```\n */\nexport type DataGridStyleRuleValueConverters = Record<\n string,\n DataGridStyleRuleValueConverter\n>;\n\n/** A single declarative rule that conditionally applies styles to DataGrid cells. */\nexport const DataGridStyleRuleSchema = z.object({\n /** Style properties to apply when the rule matches. */\n apply: DataGridCellStyleSchema,\n /** Which column this rule targets. Set to null to apply styles to all columns (row-level effect). */\n column: z.string().nullable(),\n /** Disable this rule without removing it. */\n isDisabled: z.boolean().optional(),\n /** Additional metadata about the rule. */\n metaData: metaDataSchema.optional(),\n /** Higher priority rules are applied later (override lower). Must be >= 0; negative values are reserved for internal use. Rules without explicit priority preserve their array order but are always applied before rules with explicit priority. */\n priority: z.number().nonnegative().optional(),\n /** Condition to evaluate. If omitted, rule always applies to matched column(s). */\n where: DataGridStyleRuleWhereSchema.optional(),\n});\nexport type DataGridStyleRule = z.infer<typeof DataGridStyleRuleSchema>;\n\n/**\n * Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod\n * schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid\n * style rule.\n *\n * This lets consumers validate values without taking a dependency on Zod or on\n * our schema export. For example, it can be passed to another validation\n * library's custom check:\n *\n * @example\n * ```ts\n * import { z } from 'zod';\n * import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';\n *\n * const formSchema = z.object({\n * rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),\n * notes: z.string(),\n * });\n * ```\n */\nexport const isDataGridStyleRule = (\n value: unknown,\n): value is DataGridStyleRule =>\n DataGridStyleRuleSchema.safeParse(value).success;\n"]}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { evaluateDataGridStyleRules } from './evaluate';
|
|
22
22
|
export { useDataGridCellStyle } from './hooks';
|
|
23
|
+
export { isDataGridStyleRule } from './types';
|
|
23
24
|
// TODO v5: remove schema exports
|
|
24
25
|
export { DataGridCellStyleSchema, DataGridColorRangeSchema, DataGridColumnRefSchema, DataGridDatetimeLiteralSchema, DataGridDisableableColorSchema, DataGridStyleRuleLiteralSchema, DataGridStyleRuleOperandSchema, DataGridStyleRuleSchema, DataGridStyleRuleWhereSchema, DataGridTimeLiteralSchema, } from './types';
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,iCAAiC;AACjC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { evaluateDataGridStyleRules } from './evaluate';\nexport { useDataGridCellStyle } from './hooks';\n// TODO v5: remove schema exports\nexport {\n DataGridCellStyleSchema,\n DataGridColorRangeSchema,\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridDisableableColorSchema,\n DataGridStyleRuleLiteralSchema,\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleSchema,\n DataGridStyleRuleWhereSchema,\n DataGridTimeLiteralSchema,\n} from './types';\nexport type {\n DataGridCellStyle,\n DataGridColorRange,\n DataGridColumnRef,\n DataGridDatetimeLiteral,\n DataGridDisableableColor,\n DataGridStyleRuleLiteral,\n DataGridStyleRuleOperand,\n DataGridStyleRule,\n DataGridStyleRuleWhere,\n DataGridStyleRuleValueConverter,\n DataGridStyleRuleValueConverters,\n DataGridTimeLiteral,\n} from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,iCAAiC;AACjC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { evaluateDataGridStyleRules } from './evaluate';\nexport { useDataGridCellStyle } from './hooks';\nexport { isDataGridStyleRule } from './types';\n// TODO v5: remove schema exports\nexport {\n DataGridCellStyleSchema,\n DataGridColorRangeSchema,\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridDisableableColorSchema,\n DataGridStyleRuleLiteralSchema,\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleSchema,\n DataGridStyleRuleWhereSchema,\n DataGridTimeLiteralSchema,\n} from './types';\nexport type {\n DataGridCellStyle,\n DataGridColorRange,\n DataGridColumnRef,\n DataGridDatetimeLiteral,\n DataGridDisableableColor,\n DataGridStyleRuleLiteral,\n DataGridStyleRuleOperand,\n DataGridStyleRule,\n DataGridStyleRuleWhere,\n DataGridStyleRuleValueConverter,\n DataGridStyleRuleValueConverters,\n DataGridTimeLiteral,\n} from './types';\n"]}
|
|
@@ -176,4 +176,25 @@ export const DataGridStyleRuleSchema = z.object({
|
|
|
176
176
|
/** Condition to evaluate. If omitted, rule always applies to matched column(s). */
|
|
177
177
|
where: DataGridStyleRuleWhereSchema.optional(),
|
|
178
178
|
});
|
|
179
|
+
/**
|
|
180
|
+
* Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod
|
|
181
|
+
* schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid
|
|
182
|
+
* style rule.
|
|
183
|
+
*
|
|
184
|
+
* This lets consumers validate values without taking a dependency on Zod or on
|
|
185
|
+
* our schema export. For example, it can be passed to another validation
|
|
186
|
+
* library's custom check:
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* import { z } from 'zod';
|
|
191
|
+
* import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';
|
|
192
|
+
*
|
|
193
|
+
* const formSchema = z.object({
|
|
194
|
+
* rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),
|
|
195
|
+
* notes: z.string(),
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
export const isDataGridStyleRule = (value) => DataGridStyleRuleSchema.safeParse(value).success;
|
|
179
200
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC;IACpD,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,OAAO,EAAE;IACX,CAAC,CAAC,IAAI,EAAE;CACT,CAAC,CAAC;AAKH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGxE;;;;;;;;;;;GAW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AAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,4CAA4C;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAKH,sEAAsE;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,0FAA0F;IAC1F,KAAK,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IAChD,mGAAmG;IACnG,UAAU,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAC/C,uEAAuE;IACvE,SAAS,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACpD,8FAA8F;IAC9F,cAAc,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAsCzD,qFAAqF;AACrF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,uDAAuD;IACvD,KAAK,EAAE,uBAAuB;IAC9B,qGAAqG;IACrG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,6CAA6C;IAC7C,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,0CAA0C;IAC1C,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,oPAAoP;IACpP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7C,mFAAmF;IACnF,KAAK,EAAE,4BAA4B,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { z } from 'zod';\n\nimport {\n DatetimeLiteralSchema,\n TimeLiteralSchema,\n} from '../../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n */\n\n/** A scalar literal that can appear as an operand in a style-rule where clause. */\nexport const DataGridStyleRuleLiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type DataGridStyleRuleLiteral = z.infer<\n typeof DataGridStyleRuleLiteralSchema\n>;\n\n/** A reference to a column whose cell value is resolved at evaluation time. */\nexport const DataGridColumnRefSchema = z.object({ column: z.string() });\nexport type DataGridColumnRef = z.infer<typeof DataGridColumnRefSchema>;\n\n/**\n * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond\n * timestamp at evaluation time. Wraps the shared `DatetimeLiteralSchema` with a\n * DataGrid-specific name. Supported formats:\n * - RFC 9557 with IANA timezone: `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset\n * inferred) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"` (offset explicit)\n * - UTC or offset datetime: `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * - Plain datetime (treated as UTC): `\"2024-01-01T14:30:00\"`\n * - Date-only (treated as UTC midnight): `\"2024-01-01\"`\n *\n * Unzoned datetimes without `Z` or an offset are treated as UTC wall-clock time.\n */\nexport const DataGridDatetimeLiteralSchema = DatetimeLiteralSchema;\nexport type DataGridDatetimeLiteral = z.infer<\n typeof DataGridDatetimeLiteralSchema\n>;\n\n/**\n * An ISO 8601 time literal that resolves to milliseconds since UTC midnight at\n * evaluation time. Wraps the shared `TimeLiteralSchema` with a DataGrid-specific\n * name. Supported formats:\n * - Local time (treated as UTC): `\"14:30:00\"`, `\"14:30:00.500\"`\n * - Offset time (UTC-normalised): `\"14:30:00+02:00\"`\n */\nexport const DataGridTimeLiteralSchema = TimeLiteralSchema;\nexport type DataGridTimeLiteral = z.infer<typeof DataGridTimeLiteralSchema>;\n\n/** An operand in a style-rule where clause -- either a literal value, a datetime literal, a time literal, or a column reference. */\nexport const DataGridStyleRuleOperandSchema = z.union([\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridTimeLiteralSchema,\n DataGridStyleRuleLiteralSchema,\n]);\nexport type DataGridStyleRuleOperand =\n | DataGridColumnRef\n | DataGridDatetimeLiteral\n | DataGridTimeLiteral\n | DataGridStyleRuleLiteral;\n\n/**\n * Recursive WHERE clause for conditional expressions.\n * Inspired by the graph visualization style rule system but adapted for tabular data.\n *\n * The type is manually defined for the export, since zod doesn't support\n * exporting inferred recursive types.\n */\nexport type DataGridStyleRuleWhere =\n | { not: DataGridStyleRuleWhere }\n | { and: DataGridStyleRuleWhere[] }\n | { or: DataGridStyleRuleWhere[] }\n | { equal: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { contains: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { startsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { endsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { isNull: DataGridStyleRuleOperand };\n\nexport const DataGridStyleRuleWhereSchema: z.ZodType<DataGridStyleRuleWhere> =\n z.lazy(() =>\n z.union([\n z.object({ not: DataGridStyleRuleWhereSchema }),\n z.object({ and: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({ or: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({\n equal: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n contains: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n startsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n endsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({ isNull: DataGridStyleRuleOperandSchema }),\n ]),\n );\n\n/**\n * Gradient coloring based on a continuous numeric column value.\n * Colors should be hex strings (#rrggbb).\n * If the column value is missing or non-numeric, the colorRange is ignored.\n */\nexport const DataGridColorRangeSchema = z.object({\n /** Disable this color range without removing it. */\n isDisabled: z.boolean().optional(),\n /** Hex color (#rrggbb) at the maximum value. */\n maxColor: z.string(),\n /** The high end of the numeric range. Values above this clamp to maxColor. */\n maxValue: z.number(),\n /** Hex color (#rrggbb) at the optional mid-point for a 3-stop gradient. */\n midColor: z.string().optional(),\n /** Optional inflection point between minValue and maxValue for a 3-stop gradient. */\n midValue: z.number().optional(),\n /** Hex color (#rrggbb) at the minimum value. */\n minColor: z.string(),\n /** The low end of the numeric range. Values below this clamp to minColor. */\n minValue: z.number(),\n /** The column whose numeric value drives the interpolation. */\n onColumn: z.string(),\n});\nexport type DataGridColorRange = z.infer<typeof DataGridColorRangeSchema>;\n\n/** A disable-able static color value. */\nexport const DataGridDisableableColorSchema = z.object({\n /** Disable this style without removing it. */\n isDisabled: z.boolean().optional(),\n /** The CSS color value (e.g. '#fee2e2'). */\n value: z.string(),\n});\nexport type DataGridDisableableColor = z.infer<\n typeof DataGridDisableableColorSchema\n>;\n\n/** Visual properties that a style rule can apply to a cell or row. */\nexport const DataGridCellStyleSchema = z.object({\n /** CSS background color / cell fill (e.g. '#fee2e2'). Matches the graph `Style.color`. */\n color: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the cell fill. Matches the graph `Style.colorRange`. */\n colorRange: DataGridColorRangeSchema.optional(),\n /** CSS text color (e.g. '#991b1b'). Grid-only; no graph equivalent. */\n textColor: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the text color. Grid-only; no graph equivalent. */\n textColorRange: DataGridColorRangeSchema.optional(),\n});\nexport type DataGridCellStyle = z.infer<typeof DataGridCellStyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluating the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\n/**\n * A function that converts a complex or non-scalar cell value into a\n * `DataGridStyleRuleLiteral` so it can participate in where-clause evaluation\n * and color-range interpolation.\n *\n * The function receives the raw cell value (`unknown`) and must return a scalar\n * (`string | number | boolean | null`). Return `null` to signal that the value\n * is missing or cannot be represented.\n *\n * Note: converter functions are TypeScript-only — they cannot be serialized as\n * JSON, so no Zod schema is provided.\n */\nexport type DataGridStyleRuleValueConverter = (\n value: unknown,\n) => DataGridStyleRuleLiteral;\n\n/**\n * A map of column id → converter function.\n * Pass this as the `styleRuleValueConverters` prop on `DataGrid` to teach the\n * style-rule engine how to interpret complex cell values for specific columns.\n *\n * @example\n * ```ts\n * const converters: DataGridStyleRuleValueConverters = {\n * priority: (v) => {\n * const s = v as { min: number; max: number };\n * return s.max - s.min;\n * },\n * };\n * ```\n */\nexport type DataGridStyleRuleValueConverters = Record<\n string,\n DataGridStyleRuleValueConverter\n>;\n\n/** A single declarative rule that conditionally applies styles to DataGrid cells. */\nexport const DataGridStyleRuleSchema = z.object({\n /** Style properties to apply when the rule matches. */\n apply: DataGridCellStyleSchema,\n /** Which column this rule targets. Set to null to apply styles to all columns (row-level effect). */\n column: z.string().nullable(),\n /** Disable this rule without removing it. */\n isDisabled: z.boolean().optional(),\n /** Additional metadata about the rule. */\n metaData: metaDataSchema.optional(),\n /** Higher priority rules are applied later (override lower). Must be >= 0; negative values are reserved for internal use. Rules without explicit priority preserve their array order but are always applied before rules with explicit priority. */\n priority: z.number().nonnegative().optional(),\n /** Condition to evaluate. If omitted, rule always applies to matched column(s). */\n where: DataGridStyleRuleWhereSchema.optional(),\n});\nexport type DataGridStyleRule = z.infer<typeof DataGridStyleRuleSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC;IACpD,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,OAAO,EAAE;IACX,CAAC,CAAC,IAAI,EAAE;CACT,CAAC,CAAC;AAKH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAA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AAE,CAC9B,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { z } from 'zod';\n\nimport {\n DatetimeLiteralSchema,\n TimeLiteralSchema,\n} from '../../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n */\n\n/** A scalar literal that can appear as an operand in a style-rule where clause. */\nexport const DataGridStyleRuleLiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type DataGridStyleRuleLiteral = z.infer<\n typeof DataGridStyleRuleLiteralSchema\n>;\n\n/** A reference to a column whose cell value is resolved at evaluation time. */\nexport const DataGridColumnRefSchema = z.object({ column: z.string() });\nexport type DataGridColumnRef = z.infer<typeof DataGridColumnRefSchema>;\n\n/**\n * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond\n * timestamp at evaluation time. Wraps the shared `DatetimeLiteralSchema` with a\n * DataGrid-specific name. Supported formats:\n * - RFC 9557 with IANA timezone: `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset\n * inferred) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"` (offset explicit)\n * - UTC or offset datetime: `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * - Plain datetime (treated as UTC): `\"2024-01-01T14:30:00\"`\n * - Date-only (treated as UTC midnight): `\"2024-01-01\"`\n *\n * Unzoned datetimes without `Z` or an offset are treated as UTC wall-clock time.\n */\nexport const DataGridDatetimeLiteralSchema = DatetimeLiteralSchema;\nexport type DataGridDatetimeLiteral = z.infer<\n typeof DataGridDatetimeLiteralSchema\n>;\n\n/**\n * An ISO 8601 time literal that resolves to milliseconds since UTC midnight at\n * evaluation time. Wraps the shared `TimeLiteralSchema` with a DataGrid-specific\n * name. Supported formats:\n * - Local time (treated as UTC): `\"14:30:00\"`, `\"14:30:00.500\"`\n * - Offset time (UTC-normalised): `\"14:30:00+02:00\"`\n */\nexport const DataGridTimeLiteralSchema = TimeLiteralSchema;\nexport type DataGridTimeLiteral = z.infer<typeof DataGridTimeLiteralSchema>;\n\n/** An operand in a style-rule where clause -- either a literal value, a datetime literal, a time literal, or a column reference. */\nexport const DataGridStyleRuleOperandSchema = z.union([\n DataGridColumnRefSchema,\n DataGridDatetimeLiteralSchema,\n DataGridTimeLiteralSchema,\n DataGridStyleRuleLiteralSchema,\n]);\nexport type DataGridStyleRuleOperand =\n | DataGridColumnRef\n | DataGridDatetimeLiteral\n | DataGridTimeLiteral\n | DataGridStyleRuleLiteral;\n\n/**\n * Recursive WHERE clause for conditional expressions.\n * Inspired by the graph visualization style rule system but adapted for tabular data.\n *\n * The type is manually defined for the export, since zod doesn't support\n * exporting inferred recursive types.\n */\nexport type DataGridStyleRuleWhere =\n | { not: DataGridStyleRuleWhere }\n | { and: DataGridStyleRuleWhere[] }\n | { or: DataGridStyleRuleWhere[] }\n | { equal: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { lessThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThan: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { greaterThanOrEqual: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { contains: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { startsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { endsWith: [DataGridStyleRuleOperand, DataGridStyleRuleOperand] }\n | { isNull: DataGridStyleRuleOperand };\n\nexport const DataGridStyleRuleWhereSchema: z.ZodType<DataGridStyleRuleWhere> =\n z.lazy(() =>\n z.union([\n z.object({ not: DataGridStyleRuleWhereSchema }),\n z.object({ and: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({ or: z.array(DataGridStyleRuleWhereSchema) }),\n z.object({\n equal: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n lessThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThan: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n greaterThanOrEqual: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n contains: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n startsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({\n endsWith: z.tuple([\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleOperandSchema,\n ]),\n }),\n z.object({ isNull: DataGridStyleRuleOperandSchema }),\n ]),\n );\n\n/**\n * Gradient coloring based on a continuous numeric column value.\n * Colors should be hex strings (#rrggbb).\n * If the column value is missing or non-numeric, the colorRange is ignored.\n */\nexport const DataGridColorRangeSchema = z.object({\n /** Disable this color range without removing it. */\n isDisabled: z.boolean().optional(),\n /** Hex color (#rrggbb) at the maximum value. */\n maxColor: z.string(),\n /** The high end of the numeric range. Values above this clamp to maxColor. */\n maxValue: z.number(),\n /** Hex color (#rrggbb) at the optional mid-point for a 3-stop gradient. */\n midColor: z.string().optional(),\n /** Optional inflection point between minValue and maxValue for a 3-stop gradient. */\n midValue: z.number().optional(),\n /** Hex color (#rrggbb) at the minimum value. */\n minColor: z.string(),\n /** The low end of the numeric range. Values below this clamp to minColor. */\n minValue: z.number(),\n /** The column whose numeric value drives the interpolation. */\n onColumn: z.string(),\n});\nexport type DataGridColorRange = z.infer<typeof DataGridColorRangeSchema>;\n\n/** A disable-able static color value. */\nexport const DataGridDisableableColorSchema = z.object({\n /** Disable this style without removing it. */\n isDisabled: z.boolean().optional(),\n /** The CSS color value (e.g. '#fee2e2'). */\n value: z.string(),\n});\nexport type DataGridDisableableColor = z.infer<\n typeof DataGridDisableableColorSchema\n>;\n\n/** Visual properties that a style rule can apply to a cell or row. */\nexport const DataGridCellStyleSchema = z.object({\n /** CSS background color / cell fill (e.g. '#fee2e2'). Matches the graph `Style.color`. */\n color: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the cell fill. Matches the graph `Style.colorRange`. */\n colorRange: DataGridColorRangeSchema.optional(),\n /** CSS text color (e.g. '#991b1b'). Grid-only; no graph equivalent. */\n textColor: DataGridDisableableColorSchema.optional(),\n /** Gradient color interpolation applied to the text color. Grid-only; no graph equivalent. */\n textColorRange: DataGridColorRangeSchema.optional(),\n});\nexport type DataGridCellStyle = z.infer<typeof DataGridCellStyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluating the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\n/**\n * A function that converts a complex or non-scalar cell value into a\n * `DataGridStyleRuleLiteral` so it can participate in where-clause evaluation\n * and color-range interpolation.\n *\n * The function receives the raw cell value (`unknown`) and must return a scalar\n * (`string | number | boolean | null`). Return `null` to signal that the value\n * is missing or cannot be represented.\n *\n * Note: converter functions are TypeScript-only — they cannot be serialized as\n * JSON, so no Zod schema is provided.\n */\nexport type DataGridStyleRuleValueConverter = (\n value: unknown,\n) => DataGridStyleRuleLiteral;\n\n/**\n * A map of column id → converter function.\n * Pass this as the `styleRuleValueConverters` prop on `DataGrid` to teach the\n * style-rule engine how to interpret complex cell values for specific columns.\n *\n * @example\n * ```ts\n * const converters: DataGridStyleRuleValueConverters = {\n * priority: (v) => {\n * const s = v as { min: number; max: number };\n * return s.max - s.min;\n * },\n * };\n * ```\n */\nexport type DataGridStyleRuleValueConverters = Record<\n string,\n DataGridStyleRuleValueConverter\n>;\n\n/** A single declarative rule that conditionally applies styles to DataGrid cells. */\nexport const DataGridStyleRuleSchema = z.object({\n /** Style properties to apply when the rule matches. */\n apply: DataGridCellStyleSchema,\n /** Which column this rule targets. Set to null to apply styles to all columns (row-level effect). */\n column: z.string().nullable(),\n /** Disable this rule without removing it. */\n isDisabled: z.boolean().optional(),\n /** Additional metadata about the rule. */\n metaData: metaDataSchema.optional(),\n /** Higher priority rules are applied later (override lower). Must be >= 0; negative values are reserved for internal use. Rules without explicit priority preserve their array order but are always applied before rules with explicit priority. */\n priority: z.number().nonnegative().optional(),\n /** Condition to evaluate. If omitted, rule always applies to matched column(s). */\n where: DataGridStyleRuleWhereSchema.optional(),\n});\nexport type DataGridStyleRule = z.infer<typeof DataGridStyleRuleSchema>;\n\n/**\n * Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod\n * schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid\n * style rule.\n *\n * This lets consumers validate values without taking a dependency on Zod or on\n * our schema export. For example, it can be passed to another validation\n * library's custom check:\n *\n * @example\n * ```ts\n * import { z } from 'zod';\n * import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';\n *\n * const formSchema = z.object({\n * rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),\n * notes: z.string(),\n * });\n * ```\n */\nexport const isDataGridStyleRule = (\n value: unknown,\n): value is DataGridStyleRule =>\n DataGridStyleRuleSchema.safeParse(value).success;\n"]}
|
|
@@ -84,6 +84,6 @@ export declare const getSpacing: (spacing: Spacing | undefined, property: keyof
|
|
|
84
84
|
export declare const RadiusDefaults: {
|
|
85
85
|
borderRadius: undefined;
|
|
86
86
|
};
|
|
87
|
-
export declare const getRadius: (spacing: Radius | undefined, property: keyof typeof RadiusDefaults) => string | undefined;
|
|
87
|
+
export declare const getRadius: (spacing: Radius | undefined, property: keyof typeof RadiusDefaults) => string | number | undefined;
|
|
88
88
|
export declare const parseRgbString: (rgbString: string) => [number, number, number];
|
|
89
89
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/_common/utils.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EAIhB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,WACP,CAAC;AAEtC,qCAAqC;AACrC,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,WACP,CAAC;AAEpC,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,SACV,CAAC;AAa3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,kBAGL,OAAO,QAAO,QAAQ,SAYpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EACnE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EACvB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,SAwBlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,WAGd,CAAC;AAG1B,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,G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AAM,OAAO,cAAc,gCAKtC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAMzE,CAAC"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { evaluateDataGridStyleRules } from './evaluate';
|
|
22
22
|
export { useDataGridCellStyle } from './hooks';
|
|
23
|
+
export { isDataGridStyleRule } from './types';
|
|
23
24
|
export { DataGridCellStyleSchema, DataGridColorRangeSchema, DataGridColumnRefSchema, DataGridDatetimeLiteralSchema, DataGridDisableableColorSchema, DataGridStyleRuleLiteralSchema, DataGridStyleRuleOperandSchema, DataGridStyleRuleSchema, DataGridStyleRuleWhereSchema, DataGridTimeLiteralSchema, } from './types';
|
|
24
25
|
export type { DataGridCellStyle, DataGridColorRange, DataGridColumnRef, DataGridDatetimeLiteral, DataGridDisableableColor, DataGridStyleRuleLiteral, DataGridStyleRuleOperand, DataGridStyleRule, DataGridStyleRuleWhere, DataGridStyleRuleValueConverter, DataGridStyleRuleValueConverters, DataGridTimeLiteral, } from './types';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,+BAA+B,EAC/B,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -218,4 +218,25 @@ export declare const DataGridStyleRuleSchema: z.ZodObject<{
|
|
|
218
218
|
where: z.ZodOptional<z.ZodType<DataGridStyleRuleWhere, unknown, z.core.$ZodTypeInternals<DataGridStyleRuleWhere, unknown>>>;
|
|
219
219
|
}, z.core.$strip>;
|
|
220
220
|
export type DataGridStyleRule = z.infer<typeof DataGridStyleRuleSchema>;
|
|
221
|
+
/**
|
|
222
|
+
* Runtime type guard for {@link DataGridStyleRule}, backed by the internal Zod
|
|
223
|
+
* schema. Narrows an `unknown` value to `DataGridStyleRule` when it is a valid
|
|
224
|
+
* style rule.
|
|
225
|
+
*
|
|
226
|
+
* This lets consumers validate values without taking a dependency on Zod or on
|
|
227
|
+
* our schema export. For example, it can be passed to another validation
|
|
228
|
+
* library's custom check:
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```ts
|
|
232
|
+
* import { z } from 'zod';
|
|
233
|
+
* import { isDataGridStyleRule, type DataGridStyleRule } from '@neo4j-ndl/react';
|
|
234
|
+
*
|
|
235
|
+
* const formSchema = z.object({
|
|
236
|
+
* rule: z.custom<DataGridStyleRule>(isDataGridStyleRule),
|
|
237
|
+
* notes: z.string(),
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
export declare const isDataGridStyleRule: (value: unknown) => value is DataGridStyleRule;
|
|
221
242
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/data-grid/style-rules/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,mFAAmF;AACnF,eAAO,MAAM,8BAA8B,0EAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB;;iBAAmC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B;;iBAAwB,CAAC;AACnE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;iBAAoB,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,oIAAoI;AACpI,eAAO,MAAM,8BAA8B;;;;;;6FAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,uBAAuB,GACvB,mBAAmB,GACnB,wBAAwB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,GAAG,EAAE,sBAAsB,CAAA;CAAE,GAC/B;IAAE,GAAG,EAAE,sBAAsB,EAAE,CAAA;CAAE,GACjC;IAAE,EAAE,EAAE,sBAAsB,EAAE,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,CAAC,wBAAwB,EAAE,wBAAwB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AiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAQxE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC5C,KAAK,EAAE,OAAO,KACX,wBAAwB,CAAC;AAE9B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gCAAgC,GAAG,MAAM,CACnD,MAAM,EACN,+BAA+B,CAChC,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAalC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,KACb,KAAK,IAAI,iBACsC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.4",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
"@tanstack/react-table": "8.21.3",
|
|
399
399
|
"react": ">=19.0.0",
|
|
400
400
|
"react-dom": ">=19.0.0",
|
|
401
|
-
"@neo4j-ndl/base": "^4.16.
|
|
401
|
+
"@neo4j-ndl/base": "^4.16.2"
|
|
402
402
|
},
|
|
403
403
|
"dependencies": {
|
|
404
404
|
"@dnd-kit/core": "6.3.1",
|