@rowsncolumns/spreadsheet 10.5.15 → 10.5.16
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/api/selections.d.ts +1 -1
- package/dist/cjs/api/validation.d.ts.map +1 -1
- package/dist/cjs/api/validation.js +8 -3
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +11 -3
- package/dist/cjs/components/cell-editor/index.d.ts.map +1 -1
- package/dist/cjs/components/cell-editor/index.js +7 -5
- package/dist/cjs/helpers.d.ts +9 -0
- package/dist/cjs/helpers.d.ts.map +1 -1
- package/dist/cjs/helpers.js +15 -1
- package/dist/cjs/hooks/use-structured-reference-selection.d.ts +1 -1
- package/dist/esm/api/validation.d.ts.map +1 -1
- package/dist/esm/api/validation.js +10 -5
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +13 -5
- package/dist/esm/components/cell-editor/index.d.ts.map +1 -1
- package/dist/esm/components/cell-editor/index.js +9 -7
- package/dist/esm/helpers.d.ts +9 -0
- package/dist/esm/helpers.d.ts.map +1 -1
- package/dist/esm/helpers.js +9 -0
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ import type { SheetRange, TableView } from "../types";
|
|
|
8
8
|
* @param isActiveCell
|
|
9
9
|
* @param isSelection
|
|
10
10
|
*/
|
|
11
|
-
export declare const getSelectionStrokeStyle: (formulaMode: boolean, isFill: boolean, isActiveCell: boolean, emptySelections: boolean) => "
|
|
11
|
+
export declare const getSelectionStrokeStyle: (formulaMode: boolean, isFill: boolean, isActiveCell: boolean, emptySelections: boolean) => "solid" | "dashed";
|
|
12
12
|
export type SelectionStrokeOptions = {
|
|
13
13
|
/** Border width of a range selection outside formula mode. Default `1`. */
|
|
14
14
|
selectionStrokeWidth?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAanE,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EAEvB,cAAc,EACd,KAAK,EACL,cAAc,EACd,eAAe,EACf,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA6CF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,QAAQ,EACjD,OAAO,kBAAkB,GAAG,SAAS,EACrC,QAAQ,mBAAmB,EAC3B,gBAAgB,mBAAmB,EACnC,iBAAiB,CAAC,OAAO,EAAE,MAAM,KAAK,cAAc,EAAE,EACtD,UAAU,uBAAuB,wBAyYlC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,gBAAgB,cAAc,EAC9B,QAAQ,mBAAmB,wBAM5B,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,GAC/B,WAAW,gBAAgB,EAC3B,QAAQ,mBAAmB,wBACc,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,aAAa,CAQpE,CAAC;AAEL,eAAO,MAAM,0BAA0B,GACrC,WAAW,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAS,KAC7C,OACwE,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,M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C,CAAC,EAAE,QAAQ,CAAC,CAAC,KACzE,OAC2E,CAAC;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,OAAO,SAAS,EAChB,iBAAiB,cAAc,EAAE,GAAG,SAAS,GAAG,IAAI,wBAWrD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,MAAM,EACf,OAAO,SAAS,EAChB,iBAAiB,cAAc,EAAE,GAAG,SAAS,+BAW9C,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,KAAK,CAAC,aAAa,CAAC,YAGjE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,KAAK,CAAC,uBAAuB,CAAC,EACrC,SAAS,OAAO,KACf,wBAKF,CAAC"}
|
|
@@ -279,9 +279,14 @@ var checkBooleanRule = function (rule, value, previousValue, getRangeValues, opt
|
|
|
279
279
|
return true;
|
|
280
280
|
}
|
|
281
281
|
var firstValue_1 = valuesArray[0].userEnteredValue;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`) or an A1
|
|
283
|
+
// reference reads its options from that source, like ONE_OF_RANGE.
|
|
284
|
+
var listReference = (0, utils_1.getDataValidationListReference)({
|
|
285
|
+
type: type,
|
|
286
|
+
values: valuesArray,
|
|
287
|
+
});
|
|
288
|
+
var finalValues = listReference !== undefined
|
|
289
|
+
? getRangeValues === null || getRangeValues === void 0 ? void 0 : getRangeValues(listReference)
|
|
285
290
|
: (0, helpers_1.splitDataValidationListValues)(firstValue_1);
|
|
286
291
|
// A cell storing the lone text-prefix apostrophe (`'`) is Excel's
|
|
287
292
|
// "empty text" — it satisfies the list exactly like a blank cell does,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAqDA,OAAO,KASN,MAAM,OAAO,CAAC;AAyNf,OAAO,KAAK,EAGV,QAAQ,EAWT,MAAM,aAAa,CAAC;AAoBrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAgjMnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1530,6 +1530,10 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1530
1530
|
getValidationSourceValue: getValidationSourceValue,
|
|
1531
1531
|
resolveValidationSourceValues: resolveValidationSourceValues,
|
|
1532
1532
|
}), 3), getFormattedValuesFromAddress = _68[0], getEffectiveValuesFromRange = _68[1], getFormattedValuesFromAddressAsync = _68[2];
|
|
1533
|
+
/**
|
|
1534
|
+
* The cell editor's dropdown options: same resolver, editor argument order.
|
|
1535
|
+
*/
|
|
1536
|
+
var getEditorRangeValuesAsync = (0, react_1.useMemo)(function () { return (0, helpers_1.toEditorRangeValuesAsync)(getFormattedValuesFromAddressAsync); }, [getFormattedValuesFromAddressAsync]);
|
|
1533
1537
|
/**
|
|
1534
1538
|
* Get all formatted values from range as a single 1d array
|
|
1535
1539
|
*/
|
|
@@ -1610,8 +1614,11 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1610
1614
|
// engine resolver. A source the UI cannot resolve yields NO list — fail
|
|
1611
1615
|
// OPEN rather than block valid input behind a Stop alert: the engine's
|
|
1612
1616
|
// compiled `COUNTIF(source, cell)>0` rule still paints the red marker.
|
|
1613
|
-
|
|
1614
|
-
|
|
1617
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`, Excel's
|
|
1618
|
+
// List source typed into "Dropdown") is the same list.
|
|
1619
|
+
if ((0, utils_1.getEffectiveDataValidationConditionType)(rule.condition) ===
|
|
1620
|
+
"ONE_OF_RANGE") {
|
|
1621
|
+
var source = (_c = (_b = (_a = rule.condition) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.userEnteredValue;
|
|
1615
1622
|
if (typeof source !== "string" || !source.trim()) {
|
|
1616
1623
|
return undefined;
|
|
1617
1624
|
}
|
|
@@ -2139,12 +2146,13 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
2139
2146
|
var editingSheetName = getSheetName === null || getSheetName === void 0 ? void 0 : getSheetName(editingSheetId);
|
|
2140
2147
|
var effectiveValue = getEffectiveValue(editingSheetId, rowIndex, columnIndex);
|
|
2141
2148
|
var horizontalAlignment = getEditorHorizontalAlignment(editingSheetId, rowIndex, columnIndex);
|
|
2142
|
-
return (react_1.default.createElement(CellEditor, tslib_1.__assign({}, props, { locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync:
|
|
2149
|
+
return (react_1.default.createElement(CellEditor, tslib_1.__assign({}, props, { locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync: getEditorRangeValuesAsync, scale: scale, sheetName: sheetName, editingSheetId: editingSheetId, sheetId: sheetId, editingSheetName: editingSheetName, address: address, theme: theme, tokenizer: localeTokenizer, formulaLocale: formulaLocale, horizontalAlignment: horizontalAlignment, defaultBackgroundColor: cellBackgroundColor, defaultTextColor: (0, themes_1.getStringifiedColor)(cellColor, theme), functionDescriptions: localizedFunctionDescriptions, getNamedRanges: getNamedRanges, getTableNames: getTableNames, getStructuredProperties: getStructuredProperties, getTableColumnNames: getTableColumnNames, showFormulaHelp: showFormulaHelp, onHideFormulaHelp: onHideFormulaHelp, onShowFormulaHelp: onShowFormulaHelp, onRequestCalculate: onRequestCalculate, SuggestionsDropdown: SuggestionsDropdown, stickyEditor: stickyEditor, defaultFontSizePoint: defaultFontSize, getMentions: getMentions, getFunctionParameterSuggestions: getFunctionParameterSuggestions, shouldFetchFunctionParameters: shouldFetchFunctionParameters, MentionTagComponent: MentionTagComponent, MentionDropdownItemComponent: MentionDropdownItemComponent })));
|
|
2143
2150
|
}, [
|
|
2144
2151
|
scale,
|
|
2145
2152
|
getEffectiveCellFormat,
|
|
2146
2153
|
getDataValidationRule,
|
|
2147
2154
|
getFormattedValuesFromAddress,
|
|
2155
|
+
getEditorRangeValuesAsync,
|
|
2148
2156
|
CellEditor,
|
|
2149
2157
|
getSheetName,
|
|
2150
2158
|
showFormulaHelp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/cell-editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EAEtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/cell-editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EAEtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,aAAa,EAQnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAyD,MA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mB,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC7D;;OAEG;IACH,4BAA4B,CAAC,EAAE,eAAe,CAAC,8BAA8B,CAAC,CAAC;CAChF,CAAC;AAEF,eAAO,MAAM,UAAU,s4BA2DlB,eAAe,uBAocnB,CAAC"}
|
|
@@ -197,14 +197,16 @@ exports.CellEditor = (0, react_1.memo)(function (_a) {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
var firstValue = (_c = values === null || values === void 0 ? void 0 : values[0]) === null || _c === void 0 ? void 0 : _c.userEnteredValue;
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`, Excel's
|
|
201
|
+
// List source) or an A1 reference lists that source, like ONE_OF_RANGE.
|
|
202
|
+
var listReference = (0, utils_1.getDataValidationListReference)(dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation.condition);
|
|
203
|
+
if (listReference === undefined) {
|
|
202
204
|
updateOptions((0, helpers_1.splitDataValidationListValues)(firstValue));
|
|
203
205
|
return function () {
|
|
204
206
|
isActive = false;
|
|
205
207
|
};
|
|
206
208
|
}
|
|
207
|
-
if (!
|
|
209
|
+
if (!listReference || !cell) {
|
|
208
210
|
updateOptions([]);
|
|
209
211
|
return function () {
|
|
210
212
|
isActive = false;
|
|
@@ -217,12 +219,12 @@ exports.CellEditor = (0, react_1.memo)(function (_a) {
|
|
|
217
219
|
switch (_b.label) {
|
|
218
220
|
case 0:
|
|
219
221
|
if (!getRangeValuesAsync) return [3 /*break*/, 2];
|
|
220
|
-
return [4 /*yield*/, getRangeValuesAsync(
|
|
222
|
+
return [4 /*yield*/, getRangeValuesAsync(listReference, targetSheetId, cell.rowIndex, cell.columnIndex)];
|
|
221
223
|
case 1:
|
|
222
224
|
_a = _b.sent();
|
|
223
225
|
return [3 /*break*/, 3];
|
|
224
226
|
case 2:
|
|
225
|
-
_a = getRangeValues === null || getRangeValues === void 0 ? void 0 : getRangeValues(
|
|
227
|
+
_a = getRangeValues === null || getRangeValues === void 0 ? void 0 : getRangeValues(listReference);
|
|
226
228
|
_b.label = 3;
|
|
227
229
|
case 3:
|
|
228
230
|
rangeValues = _a;
|
package/dist/cjs/helpers.d.ts
CHANGED
|
@@ -107,6 +107,15 @@ export declare const isSheetRange: (mayBeSheetRange: SheetCoordinate | SheetRang
|
|
|
107
107
|
export declare const sheetRangeToSheetCoordinate: (mayBeSheetRange: SheetCoordinate | SheetRange) => SheetCoordinate;
|
|
108
108
|
export declare const isEqualColors: (a: Color | undefined, b: Color | undefined) => boolean;
|
|
109
109
|
export declare const checkIfStringIsReference: (str: string | undefined) => boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The cell editor asks for a list source's options as `(source, sheetId, rowIndex, columnIndex)`
|
|
112
|
+
* (`CellEditorProps["getRangeValuesAsync"]`), while the grid's resolver
|
|
113
|
+
* (`useGetValuesFromRange`'s async getter) takes `(source, rowIndex, columnIndex, sheetId)`. Every
|
|
114
|
+
* argument is a number, so passing one where the other is expected type-checks and silently
|
|
115
|
+
* resolves the source against the wrong sheet: a dropdown in column C looked up sheet 3 and
|
|
116
|
+
* listed nothing for a defined name, while column A happened to work. Adapt the order here.
|
|
117
|
+
*/
|
|
118
|
+
export declare const toEditorRangeValuesAsync: <T>(resolveAtCell: (source: string, rowIndex: number, columnIndex: number, sheetId: number) => Promise<T>) => (source: string, sheetId: number, rowIndex: number, columnIndex: number) => Promise<T>;
|
|
110
119
|
export declare const trimValue: (value: string | undefined) => string | undefined;
|
|
111
120
|
export declare const shouldShowToValue: (conditionType: ConditionType | undefined) => boolean | undefined;
|
|
112
121
|
export declare const shouldShowFromValue: (conditionType: ConditionType | undefined) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMnE,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AAM,0BAA0B,GACrC,OAAO,SAAS,GAAG,SAAS,EAC5B,YAAY,aAAa,GAAG,SAAS,GAAG,IAAI,EAC5C,aAAa,aAAa,GAAG,SAAS,GAAG,IAAI,+BAM9C,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExtendedValueError = exports.getExtendedValueFormula = exports.getExtendedValueBool = exports.getExtendedValueString = exports.getExtendedValueNumber = exports.getCellEffectiveValue = exports.getCellUserEnteredValue = exports.getCellFormattedValue = exports.isHoveredCellsWithinBounds = exports.isStructuredValue = exports.isStyleReference = exports.isTouchDevice = exports.splitDataValidationListValues = exports.shouldShowFromValue = exports.shouldShowToValue = exports.trimValue = exports.checkIfStringIsReference = exports.isEqualColors = exports.sheetRangeToSheetCoordinate = exports.isSheetRange = exports.getCurrencySymbol = exports.isInSequence = exports.createArrayRange = exports.generateMultiDimTitle = exports.addIndent = exports.isGridRange = exports.definedProps = exports.getChipVerticalPosition = exports.getDefaultColumnHeader = exports.getDefaultRowHeader = exports.getHorizontalSpacing = exports.getIconSpacing = exports.getTableHeaderCells = exports.isFilterAppliedToColumnIndex = exports.createEmpty2dArray = exports.getTooltipVariant = exports.getJustifyPropertyFromAlignment = exports.isHeaderCell = exports.createNewSheet = exports.convertThicknessStyleToScaleFactor = exports.convertBorderStyleToDashArray = exports.normalizeDisplayText = exports.pixelToPoint = exports.pointToPixel = exports.isMac = exports.isFirefox = void 0;
|
|
3
|
+
exports.getExtendedValueError = exports.getExtendedValueFormula = exports.getExtendedValueBool = exports.getExtendedValueString = exports.getExtendedValueNumber = exports.getCellEffectiveValue = exports.getCellUserEnteredValue = exports.getCellFormattedValue = exports.isHoveredCellsWithinBounds = exports.isStructuredValue = exports.isStyleReference = exports.isTouchDevice = exports.splitDataValidationListValues = exports.shouldShowFromValue = exports.shouldShowToValue = exports.trimValue = exports.toEditorRangeValuesAsync = exports.checkIfStringIsReference = exports.isEqualColors = exports.sheetRangeToSheetCoordinate = exports.isSheetRange = exports.getCurrencySymbol = exports.isInSequence = exports.createArrayRange = exports.generateMultiDimTitle = exports.addIndent = exports.isGridRange = exports.definedProps = exports.getChipVerticalPosition = exports.getDefaultColumnHeader = exports.getDefaultRowHeader = exports.getHorizontalSpacing = exports.getIconSpacing = exports.getTableHeaderCells = exports.isFilterAppliedToColumnIndex = exports.createEmpty2dArray = exports.getTooltipVariant = exports.getJustifyPropertyFromAlignment = exports.isHeaderCell = exports.createNewSheet = exports.convertThicknessStyleToScaleFactor = exports.convertBorderStyleToDashArray = exports.normalizeDisplayText = exports.pixelToPoint = exports.pointToPixel = exports.isMac = exports.isFirefox = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var grid_1 = require("@rowsncolumns/grid");
|
|
6
6
|
var utils_1 = require("@rowsncolumns/utils");
|
|
@@ -437,6 +437,20 @@ var checkIfStringIsReference = function (str) {
|
|
|
437
437
|
return (0, utils_1.isNil)(str) ? false : rangeReferencePattern.test(str);
|
|
438
438
|
};
|
|
439
439
|
exports.checkIfStringIsReference = checkIfStringIsReference;
|
|
440
|
+
/**
|
|
441
|
+
* The cell editor asks for a list source's options as `(source, sheetId, rowIndex, columnIndex)`
|
|
442
|
+
* (`CellEditorProps["getRangeValuesAsync"]`), while the grid's resolver
|
|
443
|
+
* (`useGetValuesFromRange`'s async getter) takes `(source, rowIndex, columnIndex, sheetId)`. Every
|
|
444
|
+
* argument is a number, so passing one where the other is expected type-checks and silently
|
|
445
|
+
* resolves the source against the wrong sheet: a dropdown in column C looked up sheet 3 and
|
|
446
|
+
* listed nothing for a defined name, while column A happened to work. Adapt the order here.
|
|
447
|
+
*/
|
|
448
|
+
var toEditorRangeValuesAsync = function (resolveAtCell) {
|
|
449
|
+
return function (source, sheetId, rowIndex, columnIndex) {
|
|
450
|
+
return resolveAtCell(source, rowIndex, columnIndex, sheetId);
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
exports.toEditorRangeValuesAsync = toEditorRangeValuesAsync;
|
|
440
454
|
var trimValue = function (value) { return value === null || value === void 0 ? void 0 : value.trim(); };
|
|
441
455
|
exports.trimValue = trimValue;
|
|
442
456
|
var shouldShowToValue = function (conditionType) {
|
|
@@ -11,12 +11,12 @@ export declare const useOnStructuredReferenceSelection: ({ tables, getSheetName,
|
|
|
11
11
|
endColumnIndex: number;
|
|
12
12
|
startRowIndex: number;
|
|
13
13
|
endRowIndex: number;
|
|
14
|
-
sheetId: number;
|
|
15
14
|
} | {
|
|
16
15
|
startColumnIndex: number;
|
|
17
16
|
endColumnIndex: number;
|
|
18
17
|
startRowIndex: number;
|
|
19
18
|
endRowIndex: number;
|
|
19
|
+
sheetId: number;
|
|
20
20
|
};
|
|
21
21
|
sheetName: string | undefined;
|
|
22
22
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../api/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAanE,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EAEvB,cAAc,EACd,KAAK,EACL,cAAc,EACd,eAAe,EACf,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,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SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,KAAK,CAAC,uBAAuB,CAAC,EACrC,SAAS,OAAO,KACf,wBAKF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isCellWithinBounds } from "@rowsncolumns/grid";
|
|
2
|
-
import { escapeCharacters, isNil, matchesWildcardPattern, toDate, toSerial, } from "@rowsncolumns/utils";
|
|
2
|
+
import { escapeCharacters, getDataValidationListReference, isNil, matchesWildcardPattern, toDate, toSerial, } from "@rowsncolumns/utils";
|
|
3
3
|
import { EMAIL_REGEX, URL_REGEX } from "../config";
|
|
4
|
-
import {
|
|
4
|
+
import { splitDataValidationListValues } from "../helpers";
|
|
5
5
|
/**
|
|
6
6
|
* Parse a number value with locale awareness
|
|
7
7
|
* Handles common decimal separators like comma (e.g., "6,5" in German)
|
|
@@ -265,9 +265,14 @@ export const checkBooleanRule = (rule, value, previousValue, getRangeValues, opt
|
|
|
265
265
|
return true;
|
|
266
266
|
}
|
|
267
267
|
const firstValue = valuesArray[0].userEnteredValue;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`) or an A1
|
|
269
|
+
// reference reads its options from that source, like ONE_OF_RANGE.
|
|
270
|
+
const listReference = getDataValidationListReference({
|
|
271
|
+
type,
|
|
272
|
+
values: valuesArray,
|
|
273
|
+
});
|
|
274
|
+
const finalValues = listReference !== undefined
|
|
275
|
+
? getRangeValues?.(listReference)
|
|
271
276
|
: splitDataValidationListValues(firstValue);
|
|
272
277
|
// A cell storing the lone text-prefix apostrophe (`'`) is Excel's
|
|
273
278
|
// "empty text" — it satisfies the list exactly like a blank cell does,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAqDA,OAAO,KASN,MAAM,OAAO,CAAC;AAyNf,OAAO,KAAK,EAGV,QAAQ,EAWT,MAAM,aAAa,CAAC;AAoBrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AAgjMnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { getBoundedCells, MouseButtonCodes } from "@rowsncolumns/grid";
|
|
|
5
5
|
import { isCellWithinBounds } from "@rowsncolumns/grid";
|
|
6
6
|
import { cellIdentifier, Grid as BaseGrid, isEqualCells, } from "@rowsncolumns/grid";
|
|
7
7
|
import { cn, DropdownMenuContent, DropdownMenuPortal, Skeleton, tryParseRichText, } from "@rowsncolumns/ui";
|
|
8
|
-
import { cellToAddress, getCellEffectiveFormat, getContrastColor, getFormulaLocale, isConditionalFormatFormulaRule, isDataValidationFormulaRule, isNil, isNilOrBlank, iterateCellsInRange, localizeCellInput, localizeFormula, localizeFunctionDescriptions, log, resolveDefaultHorizontalAlignment, ssfFormatColor, uuid, } from "@rowsncolumns/utils";
|
|
8
|
+
import { cellToAddress, getCellEffectiveFormat, getContrastColor, getFormulaLocale, getEffectiveDataValidationConditionType, isConditionalFormatFormulaRule, isDataValidationFormulaRule, isNil, isNilOrBlank, iterateCellsInRange, localizeCellInput, localizeFormula, localizeFunctionDescriptions, log, resolveDefaultHorizontalAlignment, ssfFormatColor, uuid, } from "@rowsncolumns/utils";
|
|
9
9
|
import { useStore } from "jotai";
|
|
10
10
|
import merge from "lodash/merge";
|
|
11
11
|
import throttle from "lodash/throttle";
|
|
@@ -33,7 +33,7 @@ import { useQuickEditState } from "../../atoms/magic-fill-state.atom";
|
|
|
33
33
|
import { useOnHideFormulaHelp, useOnShowFormulaHelp, useShowFormulaHelpValue, } from "../../atoms/show-formula-help.atom";
|
|
34
34
|
import { useSetSpreadsheetApi } from "../../atoms/spreadsheet-api.atom";
|
|
35
35
|
import { ARROW_DOWN_WIDTH, CALCULATED_ICON_WIDTH, CELL_HORIZONTAL_ALIGNMENT, CF_ICON_SPACING, CF_ICON_WIDTH, CHIP_COLOR, CHIP_SPACING, COLUMN_HEADER_HEIGHT, DEFAULT_ACTIVE_CELL, DEFAULT_ARRAY, DEFAULT_CELL_BACKGROUND_COLOR, DEFAULT_CELL_COLOR, DEFAULT_CELL_SPACING, DEFAULT_COLUMN_COUNT, DEFAULT_COLUMN_WIDTH, DEFAULT_FONT_SIZE_PT, DEFAULT_HEADER_ACTIVE_BG, DEFAULT_HEADER_ACTIVE_TABLE_BG, DEFAULT_HEADER_BG, DEFAULT_HEADER_BORDER_COLOR, DEFAULT_HEADER_COLOR, DEFAULT_HEADER_SELECTED_BG, DEFAULT_HEADER_SELECTED_TABLE_BG, DEFAULT_HEADER_TABLE_BG, DEFAULT_ROW_COUNT, DEFAULT_ROW_HEIGHT, DEFAULT_SCROLL_POSITION, defaultSpreadsheetTheme, EXPAND_COLLAPSE_ICON_WIDTH, FILTER_ICON_WIDTH, GRIDLINE_COLOR, HEADER_TEXT_FORMAT, INDENT_SPACING, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MIN_COLUMN_WIDTH, ROW_HEADER_WIDTH, SCROLLBAR_SIZE, SELECTION_BG, SELECTION_BORDER, } from "../../config";
|
|
36
|
-
import { definedProps, getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredValue, getDefaultColumnHeader, getDefaultRowHeader, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, getTableHeaderCells, isFirefox, isStyleReference, isTouchDevice, } from "../../helpers";
|
|
36
|
+
import { definedProps, getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredValue, getDefaultColumnHeader, getDefaultRowHeader, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, getTableHeaderCells, isFirefox, isStyleReference, isTouchDevice, toEditorRangeValuesAsync, } from "../../helpers";
|
|
37
37
|
import { useBorderStyles } from "../../hooks/use-border-styles";
|
|
38
38
|
import { useCallbackRef } from "../../hooks/use-callback-ref";
|
|
39
39
|
import { useCellPopover } from "../../hooks/use-cell-popover";
|
|
@@ -1416,6 +1416,10 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1416
1416
|
getValidationSourceValue,
|
|
1417
1417
|
resolveValidationSourceValues,
|
|
1418
1418
|
});
|
|
1419
|
+
/**
|
|
1420
|
+
* The cell editor's dropdown options: same resolver, editor argument order.
|
|
1421
|
+
*/
|
|
1422
|
+
const getEditorRangeValuesAsync = useMemo(() => toEditorRangeValuesAsync(getFormattedValuesFromAddressAsync), [getFormattedValuesFromAddressAsync]);
|
|
1419
1423
|
/**
|
|
1420
1424
|
* Get all formatted values from range as a single 1d array
|
|
1421
1425
|
*/
|
|
@@ -1474,8 +1478,11 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1474
1478
|
// engine resolver. A source the UI cannot resolve yields NO list — fail
|
|
1475
1479
|
// OPEN rather than block valid input behind a Stop alert: the engine's
|
|
1476
1480
|
// compiled `COUNTIF(source, cell)>0` rule still paints the red marker.
|
|
1477
|
-
|
|
1478
|
-
|
|
1481
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`, Excel's
|
|
1482
|
+
// List source typed into "Dropdown") is the same list.
|
|
1483
|
+
if (getEffectiveDataValidationConditionType(rule.condition) ===
|
|
1484
|
+
"ONE_OF_RANGE") {
|
|
1485
|
+
const source = rule.condition?.values?.[0]?.userEnteredValue;
|
|
1479
1486
|
if (typeof source !== "string" || !source.trim()) {
|
|
1480
1487
|
return undefined;
|
|
1481
1488
|
}
|
|
@@ -1985,12 +1992,13 @@ function CanvasGridComponent(props, forwardedRef) {
|
|
|
1985
1992
|
const editingSheetName = getSheetName?.(editingSheetId);
|
|
1986
1993
|
const effectiveValue = getEffectiveValue(editingSheetId, rowIndex, columnIndex);
|
|
1987
1994
|
const horizontalAlignment = getEditorHorizontalAlignment(editingSheetId, rowIndex, columnIndex);
|
|
1988
|
-
return (React.createElement(CellEditor, { ...props, locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync:
|
|
1995
|
+
return (React.createElement(CellEditor, { ...props, locale: locale, effectiveValue: effectiveValue, format: cellFormat, dataValidation: dataValidation, getRangeValues: getFormattedValuesFromAddress, getRangeValuesAsync: getEditorRangeValuesAsync, scale: scale, sheetName: sheetName, editingSheetId: editingSheetId, sheetId: sheetId, editingSheetName: editingSheetName, address: address, theme: theme, tokenizer: localeTokenizer, formulaLocale: formulaLocale, horizontalAlignment: horizontalAlignment, defaultBackgroundColor: cellBackgroundColor, defaultTextColor: getStringifiedColor(cellColor, theme), functionDescriptions: localizedFunctionDescriptions, getNamedRanges: getNamedRanges, getTableNames: getTableNames, getStructuredProperties: getStructuredProperties, getTableColumnNames: getTableColumnNames, showFormulaHelp: showFormulaHelp, onHideFormulaHelp: onHideFormulaHelp, onShowFormulaHelp: onShowFormulaHelp, onRequestCalculate: onRequestCalculate, SuggestionsDropdown: SuggestionsDropdown, stickyEditor: stickyEditor, defaultFontSizePoint: defaultFontSize, getMentions: getMentions, getFunctionParameterSuggestions: getFunctionParameterSuggestions, shouldFetchFunctionParameters: shouldFetchFunctionParameters, MentionTagComponent: MentionTagComponent, MentionDropdownItemComponent: MentionDropdownItemComponent }));
|
|
1989
1996
|
}, [
|
|
1990
1997
|
scale,
|
|
1991
1998
|
getEffectiveCellFormat,
|
|
1992
1999
|
getDataValidationRule,
|
|
1993
2000
|
getFormattedValuesFromAddress,
|
|
2001
|
+
getEditorRangeValuesAsync,
|
|
1994
2002
|
CellEditor,
|
|
1995
2003
|
getSheetName,
|
|
1996
2004
|
showFormulaHelp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/cell-editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EAEtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/cell-editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EAEtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,aAAa,EAQnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAyD,MAAM,OAAO,CAAC;AAgB9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAgBhF,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAC5C;;OAEG;IACH,MAAM,CAAC,EAAE,U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C;IAC5C;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,aAAa,IAAI,UAAU,EAAE,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;IAC7E;;;;;OAKG;IACH,uBAAuB,CACrB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,UAAU,EAAE,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D;;OAEG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACxC;;OAEG;IACH,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;IAC5C;;OAEG;IACH,+BAA+B,EAAE,eAAe,CAAC,iCAAiC,CAAC,CAAC;IACpF;;OAEG;IACH,6BAA6B,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC;IAChF;;OAEG;IACH,mBAAmB,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC7D;;OAEG;IACH,4BAA4B,CAAC,EAAE,eAAe,CAAC,8BAA8B,CAAC,CAAC;CAChF,CAAC;AAEF,eAAO,MAAM,UAAU,s4BA2DlB,eAAe,uBAocnB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ProseMirrorEditor } from "@rowsncolumns/ui";
|
|
2
|
-
import { dataValidationOptionMatchesCellValue, getDefaultDateFormat, isAnArrowKey, isNil, lightenColor, normalizeColor, ssfFormat, } from "@rowsncolumns/utils";
|
|
2
|
+
import { dataValidationOptionMatchesCellValue, getDataValidationListReference, getDefaultDateFormat, isAnArrowKey, isNil, lightenColor, normalizeColor, ssfFormat, } from "@rowsncolumns/utils";
|
|
3
3
|
import React, { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useSetCellEditorInstance } from "../../atoms";
|
|
5
5
|
import { useActiveEditor, useSetActiveEditor, } from "../../atoms/active-editor.atom";
|
|
6
6
|
import { useFormulaModeValue } from "../../atoms/formula-mode.atom";
|
|
7
7
|
import { useSetFormulaSelectionState } from "../../atoms/formula-selection-state.atom";
|
|
8
8
|
import { EDITOR_FORMULA_VERTICAL_ALIGNMENT, EDITOR_VERTICAL_ALIGNMENT, FORMULA_FONT_CONFIG, INDENT_SPACING, } from "../../config";
|
|
9
|
-
import {
|
|
9
|
+
import { pointToPixel, splitDataValidationListValues } from "../../helpers";
|
|
10
10
|
import { useIsomorphicLayoutEffect } from "../../hooks/use-isomorphic-layout-effect";
|
|
11
11
|
import { useMergeRefs } from "../../hooks/use-merge.refs";
|
|
12
12
|
import { useTextDimension } from "../../hooks/use-text-dimensions";
|
|
@@ -189,14 +189,16 @@ export const CellEditor = memo(({ value = "", effectiveValue, isNewValue, onChan
|
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
const firstValue = values?.[0]?.userEnteredValue;
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
// A ONE_OF_LIST whose value is a source formula (`=RegionList`, Excel's
|
|
193
|
+
// List source) or an A1 reference lists that source, like ONE_OF_RANGE.
|
|
194
|
+
const listReference = getDataValidationListReference(dataValidation?.condition);
|
|
195
|
+
if (listReference === undefined) {
|
|
194
196
|
updateOptions(splitDataValidationListValues(firstValue));
|
|
195
197
|
return () => {
|
|
196
198
|
isActive = false;
|
|
197
199
|
};
|
|
198
200
|
}
|
|
199
|
-
if (!
|
|
201
|
+
if (!listReference || !cell) {
|
|
200
202
|
updateOptions([]);
|
|
201
203
|
return () => {
|
|
202
204
|
isActive = false;
|
|
@@ -205,8 +207,8 @@ export const CellEditor = memo(({ value = "", effectiveValue, isNewValue, onChan
|
|
|
205
207
|
const targetSheetId = editingSheetId ?? sheetId;
|
|
206
208
|
const run = async () => {
|
|
207
209
|
const rangeValues = getRangeValuesAsync
|
|
208
|
-
? await getRangeValuesAsync(
|
|
209
|
-
: getRangeValues?.(
|
|
210
|
+
? await getRangeValuesAsync(listReference, targetSheetId, cell.rowIndex, cell.columnIndex)
|
|
211
|
+
: getRangeValues?.(listReference);
|
|
210
212
|
updateOptions(rangeValues);
|
|
211
213
|
};
|
|
212
214
|
run();
|
package/dist/esm/helpers.d.ts
CHANGED
|
@@ -107,6 +107,15 @@ export declare const isSheetRange: (mayBeSheetRange: SheetCoordinate | SheetRang
|
|
|
107
107
|
export declare const sheetRangeToSheetCoordinate: (mayBeSheetRange: SheetCoordinate | SheetRange) => SheetCoordinate;
|
|
108
108
|
export declare const isEqualColors: (a: Color | undefined, b: Color | undefined) => boolean;
|
|
109
109
|
export declare const checkIfStringIsReference: (str: string | undefined) => boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The cell editor asks for a list source's options as `(source, sheetId, rowIndex, columnIndex)`
|
|
112
|
+
* (`CellEditorProps["getRangeValuesAsync"]`), while the grid's resolver
|
|
113
|
+
* (`useGetValuesFromRange`'s async getter) takes `(source, rowIndex, columnIndex, sheetId)`. Every
|
|
114
|
+
* argument is a number, so passing one where the other is expected type-checks and silently
|
|
115
|
+
* resolves the source against the wrong sheet: a dropdown in column C looked up sheet 3 and
|
|
116
|
+
* listed nothing for a defined name, while column A happened to work. Adapt the order here.
|
|
117
|
+
*/
|
|
118
|
+
export declare const toEditorRangeValuesAsync: <T>(resolveAtCell: (source: string, rowIndex: number, columnIndex: number, sheetId: number) => Promise<T>) => (source: string, sheetId: number, rowIndex: number, columnIndex: number) => Promise<T>;
|
|
110
119
|
export declare const trimValue: (value: string | undefined) => string | undefined;
|
|
111
120
|
export declare const shouldShowToValue: (conditionType: ConditionType | undefined) => boolean | undefined;
|
|
112
121
|
export declare const shouldShowFromValue: (conditionType: ConditionType | undefined) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRo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iB,GAAI,CAAC,SAAS,QAAQ,EAClD,KAAK,CAAC,CAAC,gBAAgB,CAAC,KACvB,EAAE,IAAI,eAKR,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,OAAO,SAAS,GAAG,SAAS,EAC5B,YAAY,aAAa,GAAG,SAAS,GAAG,IAAI,EAC5C,aAAa,aAAa,GAAG,SAAS,GAAG,IAAI,+BAM9C,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
package/dist/esm/helpers.js
CHANGED
|
@@ -387,6 +387,15 @@ export const isEqualColors = (a, b) => {
|
|
|
387
387
|
// https://regex101.com/r/h40MZC/1
|
|
388
388
|
const rangeReferencePattern = /^(\=?'?[A-Za-z0-9\s]+'?\!)?(\$?[A-Za-z]+\$?\d+):?(\$?[A-Za-z]+\$?\d+)?$/;
|
|
389
389
|
export const checkIfStringIsReference = (str) => isNil(str) ? false : rangeReferencePattern.test(str);
|
|
390
|
+
/**
|
|
391
|
+
* The cell editor asks for a list source's options as `(source, sheetId, rowIndex, columnIndex)`
|
|
392
|
+
* (`CellEditorProps["getRangeValuesAsync"]`), while the grid's resolver
|
|
393
|
+
* (`useGetValuesFromRange`'s async getter) takes `(source, rowIndex, columnIndex, sheetId)`. Every
|
|
394
|
+
* argument is a number, so passing one where the other is expected type-checks and silently
|
|
395
|
+
* resolves the source against the wrong sheet: a dropdown in column C looked up sheet 3 and
|
|
396
|
+
* listed nothing for a defined name, while column A happened to work. Adapt the order here.
|
|
397
|
+
*/
|
|
398
|
+
export const toEditorRangeValuesAsync = (resolveAtCell) => (source, sheetId, rowIndex, columnIndex) => resolveAtCell(source, rowIndex, columnIndex, sheetId);
|
|
390
399
|
export const trimValue = (value) => value?.trim();
|
|
391
400
|
export const shouldShowToValue = (conditionType) => conditionType &&
|
|
392
401
|
[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/spreadsheet",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.16",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@rowsncolumns/grid": ">=13.3.0",
|
|
49
49
|
"@rowsncolumns/icons": ">=7.2.33",
|
|
50
50
|
"@rowsncolumns/ui": ">=16.1.0",
|
|
51
|
-
"@rowsncolumns/utils": ">=9.5.
|
|
51
|
+
"@rowsncolumns/utils": ">=9.5.7",
|
|
52
52
|
"@rowsncolumns/version-comparison": ">=9.0.1",
|
|
53
53
|
"@tanstack/react-virtual": "3.13.9",
|
|
54
54
|
"jotai": "^2.12.4",
|