@rowsncolumns/spreadsheet 10.2.70 → 10.2.71

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.
@@ -1 +1 @@
1
- {"version":3,"file":"text-format-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-format-selector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,CAAC,CAAC,SAAS,MAAM,UAAU,EAC7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IACV,oBAAoB,CAAC,IAAI,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0GAO1B,uBAAuB,uBAoY3B,CAAC"}
1
+ {"version":3,"file":"text-format-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-format-selector.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,CAAC,CAAC,SAAS,MAAM,UAAU,EAC7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IACV,oBAAoB,CAAC,IAAI,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0GAO1B,uBAAuB,uBAqY3B,CAAC"}
@@ -14,12 +14,8 @@ exports.TextFormatSelector = (0, react_1.memo)(function (_a) {
14
14
  var localeDateFormat = (0, utils_1.getDefaultDateFormat)(locale);
15
15
  var longDateFormat = (0, utils_1.getLongDateFormat)(locale);
16
16
  var focusSheet = (0, atoms_1.useFocusSheet)();
17
- var date = new Date(Date.UTC(2023, 8, 26, 0, 0, 0));
18
- var dateformat = new Intl.DateTimeFormat(locale).format(date);
17
+ var sampleDate = new Date(2023, 8, 26, 15, 59, 0);
19
18
  var currencySymbol = (0, helpers_1.getCurrencySymbol)(locale, currency);
20
- var longDate = new Intl.DateTimeFormat(locale, {
21
- dateStyle: "full",
22
- }).format(date);
23
19
  var percentPattern = "0%";
24
20
  var scientficPattern = "0.00E+00";
25
21
  var isScientific = ((_b = cellFormat === null || cellFormat === void 0 ? void 0 : cellFormat.numberFormat) === null || _b === void 0 ? void 0 : _b.pattern) === scientficPattern;
@@ -35,6 +31,11 @@ exports.TextFormatSelector = (0, react_1.memo)(function (_a) {
35
31
  var isTimePattern = ((_g = cellFormat === null || cellFormat === void 0 ? void 0 : cellFormat.numberFormat) === null || _g === void 0 ? void 0 : _g.pattern) === timePattern;
36
32
  var dateTimePattern = "[$-".concat(locale, "]").concat(localeDateFormat, " hh:mm:ss");
37
33
  var isDateTimePattern = ((_h = cellFormat === null || cellFormat === void 0 ? void 0 : cellFormat.numberFormat) === null || _h === void 0 ? void 0 : _h.pattern) === dateTimePattern;
34
+ // Previews render through the exact pattern each item applies, so the
35
+ // menu can never disagree with the formatted cell.
36
+ var dateformat = (0, utils_1.ssfFormat)(localeDateFormat, sampleDate, locale);
37
+ var longDate = (0, utils_1.ssfFormat)(longDateFormat, sampleDate, locale);
38
+ var dateTime = (0, utils_1.ssfFormat)(dateTimePattern, sampleDate, locale);
38
39
  var durationPattern = "[$-".concat(locale, "][h]:mm:ss");
39
40
  var isDurationPattern = ((_j = cellFormat === null || cellFormat === void 0 ? void 0 : cellFormat.numberFormat) === null || _j === void 0 ? void 0 : _j.pattern) === durationPattern;
40
41
  var currencyRoundedPattern = "\"".concat(currencySymbol, "\"#,##0");
@@ -241,9 +242,7 @@ exports.TextFormatSelector = (0, react_1.memo)(function (_a) {
241
242
  react_1.default.createElement(ui_1.DropdownMenuItemIndicator, null,
242
243
  react_1.default.createElement(icons_1.CheckIcon, null)),
243
244
  "Date time",
244
- react_1.default.createElement(ui_1.DropdownRightSlot, null,
245
- dateformat,
246
- " 15:59:00")),
245
+ react_1.default.createElement(ui_1.DropdownRightSlot, null, dateTime)),
247
246
  react_1.default.createElement(ui_1.DropdownMenuCheckboxItem, { checked: isDurationPattern, onCheckedChange: function () {
248
247
  onChangeFormatting("numberFormat", {
249
248
  type: "TIME",
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.releaseDate = void 0;
5
5
  exports.releaseDate =
6
6
  // @ts-ignore
7
- (_a = new Date("2026-09-03")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
7
+ (_a = new Date("2026-09-04")) !== null && _a !== void 0 ? _a : new Date("2025-06-18");
@@ -1 +1 @@
1
- {"version":3,"file":"text-format-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-format-selector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,CAAC,CAAC,SAAS,MAAM,UAAU,EAC7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IACV,oBAAoB,CAAC,IAAI,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0GAO1B,uBAAuB,uBAoY3B,CAAC"}
1
+ {"version":3,"file":"text-format-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-format-selector.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,CAAC,CAAC,SAAS,MAAM,UAAU,EAC7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IACV,oBAAoB,CAAC,IAAI,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0GAO1B,uBAAuB,uBAqY3B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { CheckIcon, ChevronRightIcon, MdOutlineArrowDropDown, } from "@rowsncolumns/icons";
2
2
  import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownRightSlot, IconButton, } from "@rowsncolumns/ui";
3
- import { getDefaultDateFormat, getLongDateFormat } from "@rowsncolumns/utils";
3
+ import { getDefaultDateFormat, getLongDateFormat, ssfFormat, } from "@rowsncolumns/utils";
4
4
  import React, { memo } from "react";
5
5
  import { useFocusSheet } from "../../atoms";
6
6
  import { getCurrencySymbol } from "../../helpers";
@@ -8,12 +8,8 @@ export const TextFormatSelector = memo(({ locale = "en-US", currency = "USD", ce
8
8
  const localeDateFormat = getDefaultDateFormat(locale);
9
9
  const longDateFormat = getLongDateFormat(locale);
10
10
  const focusSheet = useFocusSheet();
11
- const date = new Date(Date.UTC(2023, 8, 26, 0, 0, 0));
12
- const dateformat = new Intl.DateTimeFormat(locale).format(date);
11
+ const sampleDate = new Date(2023, 8, 26, 15, 59, 0);
13
12
  const currencySymbol = getCurrencySymbol(locale, currency);
14
- const longDate = new Intl.DateTimeFormat(locale, {
15
- dateStyle: "full",
16
- }).format(date);
17
13
  const percentPattern = "0%";
18
14
  const scientficPattern = "0.00E+00";
19
15
  const isScientific = cellFormat?.numberFormat?.pattern === scientficPattern;
@@ -29,6 +25,11 @@ export const TextFormatSelector = memo(({ locale = "en-US", currency = "USD", ce
29
25
  const isTimePattern = cellFormat?.numberFormat?.pattern === timePattern;
30
26
  const dateTimePattern = `[$-${locale}]${localeDateFormat} hh:mm:ss`;
31
27
  const isDateTimePattern = cellFormat?.numberFormat?.pattern === dateTimePattern;
28
+ // Previews render through the exact pattern each item applies, so the
29
+ // menu can never disagree with the formatted cell.
30
+ const dateformat = ssfFormat(localeDateFormat, sampleDate, locale);
31
+ const longDate = ssfFormat(longDateFormat, sampleDate, locale);
32
+ const dateTime = ssfFormat(dateTimePattern, sampleDate, locale);
32
33
  const durationPattern = `[$-${locale}][h]:mm:ss`;
33
34
  const isDurationPattern = cellFormat?.numberFormat?.pattern === durationPattern;
34
35
  const currencyRoundedPattern = `"${currencySymbol}"#,##0`;
@@ -235,9 +236,7 @@ export const TextFormatSelector = memo(({ locale = "en-US", currency = "USD", ce
235
236
  React.createElement(DropdownMenuItemIndicator, null,
236
237
  React.createElement(CheckIcon, null)),
237
238
  "Date time",
238
- React.createElement(DropdownRightSlot, null,
239
- dateformat,
240
- " 15:59:00")),
239
+ React.createElement(DropdownRightSlot, null, dateTime)),
241
240
  React.createElement(DropdownMenuCheckboxItem, { checked: isDurationPattern, onCheckedChange: () => {
242
241
  onChangeFormatting("numberFormat", {
243
242
  type: "TIME",
@@ -1,3 +1,3 @@
1
1
  export const releaseDate =
2
2
  // @ts-ignore
3
- new Date("2026-09-03") ?? new Date("2025-06-18");
3
+ new Date("2026-09-04") ?? new Date("2025-06-18");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/spreadsheet",
3
- "version": "10.2.70",
3
+ "version": "10.2.71",
4
4
  "author": "Vinay M",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./dist/cjs/index.js",
@@ -44,7 +44,7 @@
44
44
  "@rowsncolumns/functions": ">=14.0.29",
45
45
  "@rowsncolumns/grid": ">=13.2.32",
46
46
  "@rowsncolumns/icons": ">=7.2.30",
47
- "@rowsncolumns/ui": ">=15.0.38",
47
+ "@rowsncolumns/ui": ">=15.0.40",
48
48
  "@rowsncolumns/utils": ">=9.2.35",
49
49
  "@rowsncolumns/version-comparison": ">=8.0.33",
50
50
  "@tanstack/react-virtual": "3.13.9",