@rowsncolumns/utils 9.5.7 → 9.6.2
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/cell-data-helpers.d.ts +8 -2
- package/dist/cjs/cell-data-helpers.d.ts.map +1 -1
- package/dist/cjs/cell-data-helpers.js +11 -3
- package/dist/cjs/cjk-number-format.d.ts +11 -0
- package/dist/cjs/cjk-number-format.d.ts.map +1 -0
- package/dist/cjs/cjk-number-format.js +533 -0
- package/dist/cjs/color.d.ts +9 -0
- package/dist/cjs/color.d.ts.map +1 -1
- package/dist/cjs/color.js +55 -1
- package/dist/cjs/excel-number-format.d.ts.map +1 -1
- package/dist/cjs/excel-number-format.js +13 -1
- package/dist/cjs/formatter.d.ts +42 -0
- package/dist/cjs/formatter.d.ts.map +1 -1
- package/dist/cjs/formatter.js +180 -15
- package/dist/cjs/selection.d.ts.map +1 -1
- package/dist/cjs/selection.js +2 -2
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/cell-data-helpers.d.ts +8 -2
- package/dist/esm/cell-data-helpers.d.ts.map +1 -1
- package/dist/esm/cell-data-helpers.js +9 -2
- package/dist/esm/cjk-number-format.d.ts +11 -0
- package/dist/esm/cjk-number-format.d.ts.map +1 -0
- package/dist/esm/cjk-number-format.js +494 -0
- package/dist/esm/color.d.ts +9 -0
- package/dist/esm/color.d.ts.map +1 -1
- package/dist/esm/color.js +53 -0
- package/dist/esm/excel-number-format.d.ts.map +1 -1
- package/dist/esm/excel-number-format.js +13 -1
- package/dist/esm/formatter.d.ts +42 -0
- package/dist/esm/formatter.d.ts.map +1 -1
- package/dist/esm/formatter.js +163 -11
- package/dist/esm/selection.d.ts.map +1 -1
- package/dist/esm/selection.js +2 -2
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/esm/formatter.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { addLocale, format, formatColor, getFormatDateInfo, getLocale, isDateFormat, isTextFormat, } from "numfmt";
|
|
2
|
+
import { prepareCjkNumberFormat } from "./cjk-number-format";
|
|
2
3
|
import { IndexedColors } from "./colors";
|
|
3
4
|
import { excelNumberPrePass, splitFormatSections, } from "./excel-number-format";
|
|
4
5
|
/**
|
|
@@ -69,8 +70,6 @@ export const isTextPattern = (pattern) => {
|
|
|
69
70
|
return false;
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
|
-
const isSingleSectionElapsedTimePattern = (pattern) => !pattern.includes(";") &&
|
|
73
|
-
/\[(?:h+|m+|s+)\]/i.test(pattern.replace(/\[\$[^\]]+\]/g, ""));
|
|
74
73
|
/**
|
|
75
74
|
* Does the pattern spell a month name (`mmm`+) with no day-of-month field
|
|
76
75
|
* (`d`/`dd`) beside it? Quoted literals, bracket directives and escaped
|
|
@@ -498,6 +497,153 @@ const withWorkbookSeparatorsCached = (code, locale) => {
|
|
|
498
497
|
return rewritten;
|
|
499
498
|
};
|
|
500
499
|
export const ssfFormat = (pattern, value, locale) => {
|
|
500
|
+
// East Asian tokens numfmt does not render (`[DBNumN]`, Japanese era `g`/`e`,
|
|
501
|
+
// `aaa` weekdays): rewrite the code to plain literals, then convert the
|
|
502
|
+
// rendered digits to the `[DBNumN]` numeral system (see cjk-number-format).
|
|
503
|
+
if (typeof value === "number") {
|
|
504
|
+
const cjk = prepareCjkNumberFormat(pattern, value, locale);
|
|
505
|
+
if (cjk)
|
|
506
|
+
return cjk.finish(ssfFormatBase(cjk.code, value, locale));
|
|
507
|
+
}
|
|
508
|
+
return ssfFormatBase(pattern, value, locale);
|
|
509
|
+
};
|
|
510
|
+
const LAYOUT_FILL_MARK = "\uE000";
|
|
511
|
+
const LAYOUT_SKIP_MARK = "\uE001";
|
|
512
|
+
const LAYOUT_LITERAL_SPACE = "\uE002";
|
|
513
|
+
const LAYOUT_DIGIT_PAD = "\u00a0";
|
|
514
|
+
/**
|
|
515
|
+
* Quote every literal space of `code` as a private-use sentinel so that,
|
|
516
|
+
* rendered with numfmt's `nbsp` option, the only non-breaking spaces left
|
|
517
|
+
* in the output are the `?` digit pads.
|
|
518
|
+
*/
|
|
519
|
+
const markLiteralSpaces = (code) => {
|
|
520
|
+
let out = "";
|
|
521
|
+
let inQuotes = false;
|
|
522
|
+
let inBrackets = false;
|
|
523
|
+
for (let i = 0; i < code.length; i++) {
|
|
524
|
+
const char = code[i];
|
|
525
|
+
if (inQuotes) {
|
|
526
|
+
if (char === '"')
|
|
527
|
+
inQuotes = false;
|
|
528
|
+
out += char === " " ? LAYOUT_LITERAL_SPACE : char;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
if (inBrackets) {
|
|
532
|
+
if (char === "]")
|
|
533
|
+
inBrackets = false;
|
|
534
|
+
out += char;
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
if (char === '"') {
|
|
538
|
+
inQuotes = true;
|
|
539
|
+
}
|
|
540
|
+
else if (char === "[") {
|
|
541
|
+
inBrackets = true;
|
|
542
|
+
}
|
|
543
|
+
else if (char === "\\" && code[i + 1] === " ") {
|
|
544
|
+
out += `"${LAYOUT_LITERAL_SPACE}"`;
|
|
545
|
+
i++;
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
else if (char === "\\" || char === "_" || char === "*") {
|
|
549
|
+
out += char + (code[i + 1] ?? "");
|
|
550
|
+
i++;
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
else if (char === " ") {
|
|
554
|
+
out += `"${LAYOUT_LITERAL_SPACE}"`;
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
557
|
+
out += char;
|
|
558
|
+
}
|
|
559
|
+
return out;
|
|
560
|
+
};
|
|
561
|
+
/** Does the pattern carry a `*` fill, `_` skip or `?` placeholder at all? */
|
|
562
|
+
const LAYOUT_TOKEN_REGEX = /[*_?]/;
|
|
563
|
+
/**
|
|
564
|
+
* Excel's width-aware number-format output: `*x` repeats `x` to the cell's
|
|
565
|
+
* width, `_x` reserves the width of `x` and `?` reserves a digit's width
|
|
566
|
+
* ("Number format codes", support.microsoft.com). A plain formatted string
|
|
567
|
+
* cannot carry that — `ssfFormat` drops the fill and renders the reserves as
|
|
568
|
+
* single spaces — so the painter asks for the parts and expands them with
|
|
569
|
+
* measured glyph widths.
|
|
570
|
+
*
|
|
571
|
+
* Returns `undefined` when the pattern has none of those tokens (the plain
|
|
572
|
+
* string is already exact), and for East Asian numeral codes. The parts'
|
|
573
|
+
* plain text ({@link numberFormatLayoutText}) equals `ssfFormat`'s output;
|
|
574
|
+
* callers compare it against the string they paint and ignore the layout
|
|
575
|
+
* when the two disagree.
|
|
576
|
+
*/
|
|
577
|
+
export const ssfFormatLayout = (pattern, value, locale) => {
|
|
578
|
+
if (!pattern || !LAYOUT_TOKEN_REGEX.test(pattern))
|
|
579
|
+
return undefined;
|
|
580
|
+
if (typeof value === "number" && prepareCjkNumberFormat(pattern, value, locale)) {
|
|
581
|
+
return undefined;
|
|
582
|
+
}
|
|
583
|
+
const raw = ssfFormatBase(pattern, value, locale, {
|
|
584
|
+
nbsp: true,
|
|
585
|
+
fillChar: LAYOUT_FILL_MARK,
|
|
586
|
+
skipChar: LAYOUT_SKIP_MARK,
|
|
587
|
+
transform: markLiteralSpaces,
|
|
588
|
+
});
|
|
589
|
+
if (raw === undefined)
|
|
590
|
+
return undefined;
|
|
591
|
+
// A locale whose group separator is itself a non-breaking space makes the
|
|
592
|
+
// digit pads ambiguous: keep those as plain spaces.
|
|
593
|
+
const digitPads = separatorsFor(locale).group !== LAYOUT_DIGIT_PAD;
|
|
594
|
+
const parts = [];
|
|
595
|
+
let text = "";
|
|
596
|
+
const flush = () => {
|
|
597
|
+
if (text)
|
|
598
|
+
parts.push({ type: "text", text });
|
|
599
|
+
text = "";
|
|
600
|
+
};
|
|
601
|
+
for (let i = 0; i < raw.length; i++) {
|
|
602
|
+
const char = raw[i];
|
|
603
|
+
if (char === LAYOUT_FILL_MARK || char === LAYOUT_SKIP_MARK) {
|
|
604
|
+
const next = raw[i + 1] ?? " ";
|
|
605
|
+
flush();
|
|
606
|
+
parts.push({
|
|
607
|
+
type: char === LAYOUT_FILL_MARK ? "fill" : "skip",
|
|
608
|
+
char: next,
|
|
609
|
+
});
|
|
610
|
+
i++;
|
|
611
|
+
}
|
|
612
|
+
else if (char === LAYOUT_DIGIT_PAD) {
|
|
613
|
+
if (digitPads) {
|
|
614
|
+
flush();
|
|
615
|
+
parts.push({ type: "digit" });
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
text += char;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
else if (char === LAYOUT_LITERAL_SPACE) {
|
|
622
|
+
text += " ";
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
text += char;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
flush();
|
|
629
|
+
return parts.some((part) => part.type !== "text") ? parts : undefined;
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* The plain string a layout stands for — what `ssfFormat` returns for the
|
|
633
|
+
* same pattern and value: fills drop out, skips and digit pads are one
|
|
634
|
+
* space each.
|
|
635
|
+
*/
|
|
636
|
+
export const numberFormatLayoutText = (parts) => {
|
|
637
|
+
let out = "";
|
|
638
|
+
for (const part of parts) {
|
|
639
|
+
if (part.type === "text")
|
|
640
|
+
out += part.text;
|
|
641
|
+
else if (part.type !== "fill")
|
|
642
|
+
out += " ";
|
|
643
|
+
}
|
|
644
|
+
return out;
|
|
645
|
+
};
|
|
646
|
+
function ssfFormatBase(pattern, value, locale, layout) {
|
|
501
647
|
try {
|
|
502
648
|
if (locale)
|
|
503
649
|
ensureNumfmtLocale(locale);
|
|
@@ -506,12 +652,22 @@ export const ssfFormat = (pattern, value, locale) => {
|
|
|
506
652
|
shortAmPm = withShortAmPmMarker(pattern);
|
|
507
653
|
shortAmPmPatternCache.set(pattern, shortAmPm);
|
|
508
654
|
}
|
|
509
|
-
const
|
|
655
|
+
const baseCode = withWorkbookSeparatorsCached(shortAmPm ?? pattern, locale);
|
|
656
|
+
const code = layout ? layout.transform(baseCode) : baseCode;
|
|
510
657
|
let patternLocale = localeForPattern(pattern, locale);
|
|
511
658
|
if (shortAmPm !== undefined && patternLocale) {
|
|
512
659
|
patternLocale = getShortAmPmLocale(patternLocale);
|
|
513
660
|
}
|
|
514
|
-
|
|
661
|
+
// numfmt types `fillChar` / `skipChar` as booleans; at runtime they are
|
|
662
|
+
// the marker strings it emits ahead of the fill / skip character.
|
|
663
|
+
const options = layout
|
|
664
|
+
? {
|
|
665
|
+
locale: patternLocale,
|
|
666
|
+
nbsp: layout.nbsp,
|
|
667
|
+
fillChar: layout.fillChar,
|
|
668
|
+
skipChar: layout.skipChar,
|
|
669
|
+
}
|
|
670
|
+
: { locale: patternLocale };
|
|
515
671
|
if (typeof value === "number") {
|
|
516
672
|
// Excel decides rounding, `General`, huge magnitudes and conditional
|
|
517
673
|
// sections from the 15-significant-digit decimal, not the binary
|
|
@@ -522,16 +678,12 @@ export const ssfFormat = (pattern, value, locale) => {
|
|
|
522
678
|
}
|
|
523
679
|
value = pre.value;
|
|
524
680
|
}
|
|
525
|
-
|
|
526
|
-
value < 0 &&
|
|
527
|
-
isSingleSectionElapsedTimePattern(pattern);
|
|
528
|
-
const formatted = format(code, isNegativeElapsedTime ? Math.abs(value) : value, options);
|
|
529
|
-
return isNegativeElapsedTime ? `-${formatted}` : formatted;
|
|
681
|
+
return format(code, value, options);
|
|
530
682
|
}
|
|
531
683
|
catch (err) {
|
|
532
|
-
return String(value);
|
|
684
|
+
return layout ? undefined : String(value);
|
|
533
685
|
}
|
|
534
|
-
}
|
|
686
|
+
}
|
|
535
687
|
/**
|
|
536
688
|
* Excel's legacy fixed 56-color palette used by `[ColorN]` directives
|
|
537
689
|
* inside number format patterns (1-indexed). This palette is INDEPENDENT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../selection.ts"],"names":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AG,IAYd,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAQ,SAAS,UAAU,EAAE,EAC7B,SAAS,MAAM,EACf,MAAM,SAAS,EACf,IAAI,SAAS,KACZ,UAAU,EAAE,GAAG,IA8CjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,4BAGxB,aAAa,KAAG,SAOlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,WAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,WAA+B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,OAAO;IACL,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IACjD,KAAK,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC,EACD,YAAY,MAAM,GAAG,SAAS,uBAO/B,CAAC"}
|
package/dist/esm/selection.js
CHANGED
|
@@ -294,11 +294,11 @@ export const cellToArea = ({ rowIndex, columnIndex, }) => {
|
|
|
294
294
|
/**
|
|
295
295
|
* Convert font size from points to pixels.
|
|
296
296
|
*/
|
|
297
|
-
export const pointToPixel = (pt) =>
|
|
297
|
+
export const pointToPixel = (pt) => (pt * 96) / 72;
|
|
298
298
|
/**
|
|
299
299
|
* Convert font size from pixels to points.
|
|
300
300
|
*/
|
|
301
|
-
export const pixelToPoint = (px) => Math.round((px
|
|
301
|
+
export const pixelToPoint = (px) => Math.round((px * 72) / 96);
|
|
302
302
|
/**
|
|
303
303
|
* Resolve a table column name to absolute column index.
|
|
304
304
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../array.ts","../../cell-data-helpers.ts","../../clipboard-html-sanitize.ts","../../color.ts","../../colors.ts","../../condition-operand.ts","../../conditional-format.ts","../../content-hash.ts","../../data-validation.ts","../../date.ts","../../dom.ts","../../excel-number-format.ts","../../formatter.ts","../../formula-locale.ts","../../formula-refs.ts","../../formula.ts","../../index.ts","../../keyboard.ts","../../locale.ts","../../log.ts","../../memoize.ts","../../numbers.ts","../../rich-text-html.ts","../../rich-text-links.ts","../../selection.ts","../../shared-string-canonical.ts","../../sheet-names.ts","../../sheet-protection.ts","../../sheet-span.ts","../../sort.ts","../../sparkline-groups.ts","../../string.ts","../../table-names.ts","../../table-styles.ts","../../table-totals.ts","../../typeguards.ts","../../uuid.ts","../../vitest.config.ts","../../formula-locale/formula-locale-data.generated.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../../array.ts","../../cell-data-helpers.ts","../../cjk-number-format.ts","../../clipboard-html-sanitize.ts","../../color.ts","../../colors.ts","../../condition-operand.ts","../../conditional-format.ts","../../content-hash.ts","../../data-validation.ts","../../date.ts","../../dom.ts","../../excel-number-format.ts","../../formatter.ts","../../formula-locale.ts","../../formula-refs.ts","../../formula.ts","../../index.ts","../../keyboard.ts","../../locale.ts","../../log.ts","../../memoize.ts","../../numbers.ts","../../rich-text-html.ts","../../rich-text-links.ts","../../selection.ts","../../shared-string-canonical.ts","../../sheet-names.ts","../../sheet-protection.ts","../../sheet-span.ts","../../sort.ts","../../sparkline-groups.ts","../../string.ts","../../table-names.ts","../../table-styles.ts","../../table-totals.ts","../../typeguards.ts","../../uuid.ts","../../vitest.config.ts","../../formula-locale/formula-locale-data.generated.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.2",
|
|
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
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"numfmt": "^3.2.2",
|
|
47
|
-
"@rowsncolumns/common-types": ">=5.3.
|
|
47
|
+
"@rowsncolumns/common-types": ">=5.3.5"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {},
|
|
50
50
|
"peerDependencies": {}
|