@fluixi-ui/bulk-editor 0.3.0-alpha.17 → 0.3.0-alpha.19

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/formula.js CHANGED
@@ -1,7 +1,18 @@
1
1
  import { evaluateFormula } from "@fluixi-ui/formula";
2
+ //#region src/formula.ts
3
+ /**
4
+ * A drop-in `evaluate` hook that turns `=`-prefixed cell values into spreadsheet
5
+ * formulas (arithmetic, A1 refs, ranges, SUM/IF/…). Non-formula values pass
6
+ * through unchanged. Wire it up with `<BulkEditor evaluate={formulaEvaluator()} />`.
7
+ *
8
+ * The editor's `get` already resolves A1 addresses against the original row
9
+ * order with a cycle guard, so cross-cell references and ranges work as-is.
10
+ */
2
11
  function formulaEvaluator(options) {
3
- return ({ raw, get }) => evaluateFormula(raw, { resolve: get, functions: options?.functions });
12
+ return ({ raw, get }) => evaluateFormula(raw, {
13
+ resolve: get,
14
+ functions: options?.functions
15
+ });
4
16
  }
5
- export {
6
- formulaEvaluator
7
- };
17
+ //#endregion
18
+ export { formulaEvaluator };
package/dist/index.js CHANGED
@@ -1,16 +1,8 @@
1
+ import { colToLabel, createBulkEditorState, labelToCol, matchesFilter, parseAddress } from "./state.js";
2
+ import { BulkEditor } from "./bulk-editor.js";
3
+ import { formulaEvaluator } from "./formula.js";
1
4
  import "@fluixi-ui/tokens/css/base.css";
2
5
  import "@fluixi-ui/tokens/css/parts/motion.css";
3
6
  import "@fluixi-ui/tokens/css/bulk-editor.css";
4
7
  import "@fluixi-ui/tokens/css/parts/menu.css";
5
- import { BulkEditor } from "./bulk-editor.js";
6
- import { formulaEvaluator } from "./formula.js";
7
- import { colToLabel, createBulkEditorState, labelToCol, matchesFilter, parseAddress } from "./state.js";
8
- export {
9
- BulkEditor,
10
- colToLabel,
11
- createBulkEditorState,
12
- formulaEvaluator,
13
- labelToCol,
14
- matchesFilter,
15
- parseAddress
16
- };
8
+ export { BulkEditor, colToLabel, createBulkEditorState, formulaEvaluator, labelToCol, matchesFilter, parseAddress };