@servicetitan/dte-pdf-editor 1.94.0 → 1.96.0

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.
Files changed (145) hide show
  1. package/README.md +121 -4
  2. package/dist/components/field-config-panel/advanced-settings.d.ts +2 -0
  3. package/dist/components/field-config-panel/advanced-settings.d.ts.map +1 -1
  4. package/dist/components/field-config-panel/advanced-settings.js +5 -4
  5. package/dist/components/field-config-panel/advanced-settings.js.map +1 -1
  6. package/dist/components/field-config-panel/e-sign-options-modal.d.ts +3 -0
  7. package/dist/components/field-config-panel/e-sign-options-modal.d.ts.map +1 -1
  8. package/dist/components/field-config-panel/e-sign-options-modal.js +6 -4
  9. package/dist/components/field-config-panel/e-sign-options-modal.js.map +1 -1
  10. package/dist/components/field-config-panel/field-config-panel-overlay.d.ts +14 -1
  11. package/dist/components/field-config-panel/field-config-panel-overlay.d.ts.map +1 -1
  12. package/dist/components/field-config-panel/field-config-panel-overlay.js +41 -2
  13. package/dist/components/field-config-panel/field-config-panel-overlay.js.map +1 -1
  14. package/dist/components/field-config-panel/field-config-panel.d.ts +6 -0
  15. package/dist/components/field-config-panel/field-config-panel.d.ts.map +1 -1
  16. package/dist/components/field-config-panel/field-config-panel.js +17 -3
  17. package/dist/components/field-config-panel/field-config-panel.js.map +1 -1
  18. package/dist/components/field-config-panel/formula-generator.d.ts +4 -0
  19. package/dist/components/field-config-panel/formula-generator.d.ts.map +1 -1
  20. package/dist/components/field-config-panel/formula-generator.js +2 -2
  21. package/dist/components/field-config-panel/formula-generator.js.map +1 -1
  22. package/dist/components/field-config-panel/formula-modal.d.ts +5 -0
  23. package/dist/components/field-config-panel/formula-modal.d.ts.map +1 -1
  24. package/dist/components/field-config-panel/formula-modal.js +13 -6
  25. package/dist/components/field-config-panel/formula-modal.js.map +1 -1
  26. package/dist/components/field-config-panel/formula-workspace.d.ts +2 -0
  27. package/dist/components/field-config-panel/formula-workspace.d.ts.map +1 -1
  28. package/dist/components/field-config-panel/formula-workspace.js +6 -4
  29. package/dist/components/field-config-panel/formula-workspace.js.map +1 -1
  30. package/dist/components/pdf-editor/pdf-editor.d.ts +52 -1
  31. package/dist/components/pdf-editor/pdf-editor.d.ts.map +1 -1
  32. package/dist/components/pdf-editor/pdf-editor.js +2 -2
  33. package/dist/components/pdf-editor/pdf-editor.js.map +1 -1
  34. package/dist/components/pdf-fields-overlay/pdf-overlay-field-fillable.d.ts.map +1 -1
  35. package/dist/components/pdf-fields-overlay/pdf-overlay-field-fillable.js +4 -6
  36. package/dist/components/pdf-fields-overlay/pdf-overlay-field-fillable.js.map +1 -1
  37. package/dist/components/pdf-view/pdf-view-calculated.d.ts +3 -1
  38. package/dist/components/pdf-view/pdf-view-calculated.d.ts.map +1 -1
  39. package/dist/components/pdf-view/pdf-view-calculated.js +14 -4
  40. package/dist/components/pdf-view/pdf-view-calculated.js.map +1 -1
  41. package/dist/components/pdf-view/pdf-view-fillable.d.ts.map +1 -1
  42. package/dist/components/pdf-view/pdf-view-fillable.js +27 -4
  43. package/dist/components/pdf-view/pdf-view-fillable.js.map +1 -1
  44. package/dist/components/pdf-view/pdf-view.d.ts +18 -4
  45. package/dist/components/pdf-view/pdf-view.d.ts.map +1 -1
  46. package/dist/components/pdf-view/pdf-view.js +2 -2
  47. package/dist/components/pdf-view/pdf-view.js.map +1 -1
  48. package/dist/components/shared/char-limit-indicator.d.ts +8 -0
  49. package/dist/components/shared/char-limit-indicator.d.ts.map +1 -0
  50. package/dist/components/shared/char-limit-indicator.js +9 -0
  51. package/dist/components/shared/char-limit-indicator.js.map +1 -0
  52. package/dist/components/shared/index.d.ts +1 -0
  53. package/dist/components/shared/index.d.ts.map +1 -1
  54. package/dist/components/shared/index.js +1 -0
  55. package/dist/components/shared/index.js.map +1 -1
  56. package/dist/constants/calculated.constants.d.ts +6 -0
  57. package/dist/constants/calculated.constants.d.ts.map +1 -1
  58. package/dist/constants/calculated.constants.js +6 -0
  59. package/dist/constants/calculated.constants.js.map +1 -1
  60. package/dist/hooks/usePinchZoom.d.ts.map +1 -1
  61. package/dist/hooks/usePinchZoom.js +1 -1
  62. package/dist/hooks/usePinchZoom.js.map +1 -1
  63. package/dist/interface/types.d.ts +37 -1
  64. package/dist/interface/types.d.ts.map +1 -1
  65. package/dist/interface/types.js.map +1 -1
  66. package/dist/styles/pdf-field-overlay.css +9 -2
  67. package/dist/styles/pdf-field.css +22 -1
  68. package/dist/utils/field/field-text-box.utils.d.ts +31 -0
  69. package/dist/utils/field/field-text-box.utils.d.ts.map +1 -0
  70. package/dist/utils/field/field-text-box.utils.js +102 -0
  71. package/dist/utils/field/field-text-box.utils.js.map +1 -0
  72. package/dist/utils/field/fit-field-text.utils.d.ts +13 -0
  73. package/dist/utils/field/fit-field-text.utils.d.ts.map +1 -0
  74. package/dist/utils/field/fit-field-text.utils.js +44 -0
  75. package/dist/utils/field/fit-field-text.utils.js.map +1 -0
  76. package/dist/utils/field/get-field-max-length.utils.d.ts +38 -0
  77. package/dist/utils/field/get-field-max-length.utils.d.ts.map +1 -0
  78. package/dist/utils/field/get-field-max-length.utils.js +166 -0
  79. package/dist/utils/field/get-field-max-length.utils.js.map +1 -0
  80. package/dist/utils/field/index.d.ts +2 -0
  81. package/dist/utils/field/index.d.ts.map +1 -1
  82. package/dist/utils/field/index.js +2 -0
  83. package/dist/utils/field/index.js.map +1 -1
  84. package/dist/utils/field/text-wrap.utils.d.ts +26 -0
  85. package/dist/utils/field/text-wrap.utils.d.ts.map +1 -0
  86. package/dist/utils/field/text-wrap.utils.js +53 -0
  87. package/dist/utils/field/text-wrap.utils.js.map +1 -0
  88. package/dist/utils/formula/business-days.utils.d.ts +32 -0
  89. package/dist/utils/formula/business-days.utils.d.ts.map +1 -0
  90. package/dist/utils/formula/business-days.utils.js +148 -0
  91. package/dist/utils/formula/business-days.utils.js.map +1 -0
  92. package/dist/utils/formula/caret.utils.js +1 -1
  93. package/dist/utils/formula/caret.utils.js.map +1 -1
  94. package/dist/utils/formula/evaluate-formula.utils.d.ts +25 -6
  95. package/dist/utils/formula/evaluate-formula.utils.d.ts.map +1 -1
  96. package/dist/utils/formula/evaluate-formula.utils.js +61 -101
  97. package/dist/utils/formula/evaluate-formula.utils.js.map +1 -1
  98. package/dist/utils/formula/index.d.ts +1 -0
  99. package/dist/utils/formula/index.d.ts.map +1 -1
  100. package/dist/utils/formula/index.js +1 -0
  101. package/dist/utils/formula/index.js.map +1 -1
  102. package/dist/utils/formula/schedule-bindings.utils.d.ts +12 -0
  103. package/dist/utils/formula/schedule-bindings.utils.d.ts.map +1 -0
  104. package/dist/utils/formula/schedule-bindings.utils.js +17 -0
  105. package/dist/utils/formula/schedule-bindings.utils.js.map +1 -0
  106. package/package.json +2 -1
  107. package/src/__tests__/field-types/date-fields.test.ts +29 -3
  108. package/src/__tests__/field-types/e-sign-fields.test.ts +2 -2
  109. package/src/__tests__/field-types/fillable-fields.test.ts +2 -2
  110. package/src/components/field-config-panel/advanced-settings.tsx +16 -3
  111. package/src/components/field-config-panel/e-sign-options-modal.tsx +13 -2
  112. package/src/components/field-config-panel/field-config-panel-overlay.tsx +97 -1
  113. package/src/components/field-config-panel/field-config-panel.tsx +28 -0
  114. package/src/components/field-config-panel/formula-generator.tsx +8 -1
  115. package/src/components/field-config-panel/formula-modal.tsx +19 -4
  116. package/src/components/field-config-panel/formula-workspace.tsx +31 -6
  117. package/src/components/pdf-editor/pdf-editor.tsx +82 -0
  118. package/src/components/pdf-fields-overlay/pdf-overlay-field-fillable.tsx +41 -28
  119. package/src/components/pdf-view/pdf-view-calculated.tsx +28 -3
  120. package/src/components/pdf-view/pdf-view-fillable.tsx +82 -36
  121. package/src/components/pdf-view/pdf-view.tsx +23 -3
  122. package/src/components/shared/char-limit-indicator.tsx +23 -0
  123. package/src/components/shared/index.ts +1 -0
  124. package/src/constants/calculated.constants.ts +7 -0
  125. package/src/hooks/usePinchZoom.ts +1 -6
  126. package/src/interface/types.ts +47 -0
  127. package/src/styles/pdf-field-overlay.css +9 -2
  128. package/src/styles/pdf-field.css +22 -1
  129. package/src/utils/field/__tests__/field-background-color.utils.test.ts +8 -8
  130. package/src/utils/field/__tests__/fit-field-text.utils.test.ts +224 -0
  131. package/src/utils/field/__tests__/get-field-bounds-style.utils.test.ts +16 -0
  132. package/src/utils/field/__tests__/get-field-max-length.utils.test.ts +751 -0
  133. package/src/utils/field/__tests__/text-wrap.utils.test.ts +181 -0
  134. package/src/utils/field/field-text-box.utils.ts +143 -0
  135. package/src/utils/field/fit-field-text.utils.ts +61 -0
  136. package/src/utils/field/get-field-max-length.utils.ts +211 -0
  137. package/src/utils/field/index.ts +2 -0
  138. package/src/utils/field/text-wrap.utils.ts +78 -0
  139. package/src/utils/formula/__tests__/evaluate-formula.utils.test.ts +198 -16
  140. package/src/utils/formula/__tests__/schedule-bindings.utils.test.ts +73 -0
  141. package/src/utils/formula/business-days.utils.ts +188 -0
  142. package/src/utils/formula/caret.utils.ts +1 -1
  143. package/src/utils/formula/evaluate-formula.utils.ts +94 -114
  144. package/src/utils/formula/index.ts +1 -0
  145. package/src/utils/formula/schedule-bindings.utils.ts +27 -0
@@ -0,0 +1,38 @@
1
+ import { type PdfField } from '../../interface/types';
2
+ import { type FieldTextBox } from './field-text-box.utils';
3
+ /**
4
+ * Largest `length` in `[0, max]` for which `fits(length)` holds; `fits` must be monotone
5
+ * (once a length stops fitting, longer ones don't either) and `fits(0)` is taken as true.
6
+ */
7
+ export declare const findLargestFit: (fits: (length: number) => boolean, max?: number) => number;
8
+ type TextBoxGeometry = Omit<FieldTextBox, 'key'>;
9
+ export type TextCapacityParams = TextBoxGeometry & {
10
+ /** What is already typed; it counts towards the capacity and uses up some of the room. */
11
+ value?: string;
12
+ };
13
+ /**
14
+ * Highest character count a text box can hold, from rendered text widths: the characters
15
+ * already in `value` plus how many more fit after it.
16
+ *
17
+ * - `number`: guaranteed fit, bounded by the widest of the digits, `.` and `-`
18
+ * - `single-line`: expected fit for typical text, from the mean glyph width of a sample
19
+ * - `multiline`: expected fit for typical text, from simulated word wrapping into the
20
+ * `floor(height / lineHeight)` lines available
21
+ *
22
+ * Narrow text leaves more room than wide text, so the answer moves with what is typed. A
23
+ * value that already overflows has no room left: the capacity is just its own length.
24
+ * At least 1; `undefined` when `measure` yields no usable text width, since there is then
25
+ * no basis for a limit.
26
+ */
27
+ export declare const estimateTextCapacity: ({ value, ...box }: TextCapacityParams) => number | undefined;
28
+ /**
29
+ * Max character count a fillable `text`/`number` field can hold given what is typed in it, so
30
+ * the counter can say how much room is left. With no `value` it is the field's capacity when
31
+ * empty. Input is limited by what actually fits, see `fitFieldTextChange`, not by this count.
32
+ *
33
+ * See {@link estimateTextCapacity} for how each field kind is measured. Text is measured
34
+ * with canvas at the field's own font, so it follows family, weight and size.
35
+ */
36
+ export declare const getFieldMaxLength: (field: PdfField, value?: string) => number | undefined;
37
+ export {};
38
+ //# sourceMappingURL=get-field-max-length.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-field-max-length.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/field/get-field-max-length.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA+BlG;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,EAAE,YAAkB,KAAG,MAsBtF,CAAC;AAkBF,KAAK,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AA2DjD,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IAC/C,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAAI,mBAGlC,kBAAkB,KAAG,MAAM,GAAG,SAqBhC,CAAC;AAKF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,QAAQ,EAAE,cAAU,KAAG,MAAM,GAAG,SAmBxE,CAAC"}
@@ -0,0 +1,166 @@
1
+ import { EPSILON, getFieldTextBox, getMaxLines } from './field-text-box.utils';
2
+ import { advanceWrap, INITIAL_WRAP_STATE, } from './text-wrap.utils';
3
+ /**
4
+ * Typical free-text form entries (names, addresses, emails, short notes) in mixed case.
5
+ *
6
+ * Capacity is estimated for this text rather than for a uniform `A-Za-z0-9` alphabet: that one
7
+ * averages ~0.58em per glyph against ~0.46em here (and ~0.47em for real entries), which is why
8
+ * the previous estimate under-reported capacity by ~20%. Contains no hyphens or newlines, so
9
+ * the wrap simulation in `text-wrap.utils` stays exact for it.
10
+ */
11
+ const TEXT_SAMPLE = 'Jonathan Alexander Smith 1234 Elm Street, Apartment 5B Springfield, IL 62704 ' +
12
+ 'jonathan.smith@example.com Maria Garcia Lopez Estimate #48213 for $1,250.00 ' +
13
+ 'Replace the capacitor and clean the coils. Call before arriving, gate code 4471. ' +
14
+ 'Dana Whitfield, Park Avenue Plumbing ';
15
+ /** Glyphs a user can type into a number field; the capacity is bounded by the widest of them. */
16
+ const NUMBER_GLYPHS = '0123456789.-';
17
+ /** Evenly spaced word-start offsets into the sample that multiline wrapping is averaged over. */
18
+ const MULTILINE_SAMPLE_PHASES = 8;
19
+ /** Hard stop for the search, so a degenerate measurer (zero-width glyphs) can't loop forever. */
20
+ const MAX_CAPACITY = 10000;
21
+ /**
22
+ * Largest `length` in `[0, max]` for which `fits(length)` holds; `fits` must be monotone
23
+ * (once a length stops fitting, longer ones don't either) and `fits(0)` is taken as true.
24
+ */
25
+ export const findLargestFit = (fits, max = MAX_CAPACITY) => {
26
+ let low = 0;
27
+ let high = max + 1;
28
+ for (let probe = 1; probe < high; probe *= 2) {
29
+ if (!fits(probe)) {
30
+ high = probe;
31
+ break;
32
+ }
33
+ low = probe;
34
+ }
35
+ while (high - low > 1) {
36
+ const mid = Math.floor((low + high) / 2);
37
+ if (fits(mid)) {
38
+ low = mid;
39
+ }
40
+ else {
41
+ high = mid;
42
+ }
43
+ }
44
+ return low;
45
+ };
46
+ /** The sample starting at `start` and wrapping around, repeated to `length` characters. */
47
+ const getSampleText = (start, length) => {
48
+ const rotated = TEXT_SAMPLE.slice(start) + TEXT_SAMPLE.slice(0, start);
49
+ return rotated.repeat(Math.ceil(length / rotated.length)).slice(0, length);
50
+ };
51
+ const SAMPLE_WORD_STARTS = Array.from(TEXT_SAMPLE, (char, index) => index).filter(index => {
52
+ return TEXT_SAMPLE[index] !== ' ' && (index === 0 || TEXT_SAMPLE[index - 1] === ' ');
53
+ });
54
+ const SAMPLE_PHASES = Array.from({ length: MULTILINE_SAMPLE_PHASES }, (_, index) => {
55
+ return SAMPLE_WORD_STARTS[Math.floor((index * SAMPLE_WORD_STARTS.length) / MULTILINE_SAMPLE_PHASES)];
56
+ });
57
+ const getRemainingWidth = ({ measure, width }, value) => {
58
+ return Math.max(0, width - measure(value));
59
+ };
60
+ /**
61
+ * Number inputs only ever hold digits, `.` and `-`, so every value of N characters is at most
62
+ * N widest-glyphs wide: the room left is a guaranteed fit, not an average.
63
+ */
64
+ const estimateNumberRoom = (box, value) => {
65
+ const widestGlyph = Math.max(...Array.from(NUMBER_GLYPHS, glyph => box.measure(glyph)));
66
+ return Math.floor(getRemainingWidth(box, value) / widestGlyph + EPSILON);
67
+ };
68
+ /** Characters of typical text that fit in the width left: it over the sample's mean glyph. */
69
+ const estimateSingleLineRoom = (box, value) => {
70
+ const meanGlyphWidth = box.measure(TEXT_SAMPLE) / TEXT_SAMPLE.length;
71
+ return Math.floor(getRemainingWidth(box, value) / meanGlyphWidth + EPSILON);
72
+ };
73
+ /**
74
+ * Characters of typical text that fit in the lines left after `value`. Real wrapping is
75
+ * simulated, so the unused space at the end of each line is accounted for; the result is
76
+ * averaged over several starting points in the sample because it shifts by a few characters
77
+ * with where the text begins.
78
+ */
79
+ const estimateMultilineRoom = (box, value) => {
80
+ const maxLines = getMaxLines(box);
81
+ const measureCache = new Map();
82
+ const measure = text => {
83
+ let measured = measureCache.get(text);
84
+ if (measured === undefined) {
85
+ measured = box.measure(text);
86
+ measureCache.set(text, measured);
87
+ }
88
+ return measured;
89
+ };
90
+ const valueState = advanceWrap(INITIAL_WRAP_STATE, value, box.width, measure);
91
+ if (valueState.lines > maxLines) {
92
+ return 0;
93
+ }
94
+ // typed text goes on after a word, so continue it with a space unless it already ends in one
95
+ const separator = /(^|[ \n])$/.test(value) ? '' : ' ';
96
+ const fitsAfterValue = (state, text) => {
97
+ return advanceWrap(state, text, box.width, measure).lines <= maxLines;
98
+ };
99
+ const capacities = SAMPLE_PHASES.map(start => {
100
+ return findLargestFit(length => {
101
+ return fitsAfterValue(valueState, separator + getSampleText(start, length));
102
+ });
103
+ });
104
+ return Math.floor(capacities.reduce((sum, value) => sum + value, 0) / capacities.length);
105
+ };
106
+ /**
107
+ * Highest character count a text box can hold, from rendered text widths: the characters
108
+ * already in `value` plus how many more fit after it.
109
+ *
110
+ * - `number`: guaranteed fit, bounded by the widest of the digits, `.` and `-`
111
+ * - `single-line`: expected fit for typical text, from the mean glyph width of a sample
112
+ * - `multiline`: expected fit for typical text, from simulated word wrapping into the
113
+ * `floor(height / lineHeight)` lines available
114
+ *
115
+ * Narrow text leaves more room than wide text, so the answer moves with what is typed. A
116
+ * value that already overflows has no room left: the capacity is just its own length.
117
+ * At least 1; `undefined` when `measure` yields no usable text width, since there is then
118
+ * no basis for a limit.
119
+ */
120
+ export const estimateTextCapacity = ({ value = '', ...box }) => {
121
+ const sampleWidth = box.measure(TEXT_SAMPLE);
122
+ if (!Number.isFinite(sampleWidth) || sampleWidth <= 0) {
123
+ return undefined;
124
+ }
125
+ let room;
126
+ switch (box.layout) {
127
+ case 'number':
128
+ room = estimateNumberRoom(box, value);
129
+ break;
130
+ case 'multiline':
131
+ room = estimateMultilineRoom(box, value);
132
+ break;
133
+ default:
134
+ room = estimateSingleLineRoom(box, value);
135
+ }
136
+ return Number.isNaN(room)
137
+ ? undefined
138
+ : Math.max(1, value.length + Math.min(MAX_CAPACITY, room));
139
+ };
140
+ const MAX_LENGTH_CACHE_SIZE = 500;
141
+ const maxLengthCache = new Map();
142
+ /**
143
+ * Max character count a fillable `text`/`number` field can hold given what is typed in it, so
144
+ * the counter can say how much room is left. With no `value` it is the field's capacity when
145
+ * empty. Input is limited by what actually fits, see `fitFieldTextChange`, not by this count.
146
+ *
147
+ * See {@link estimateTextCapacity} for how each field kind is measured. Text is measured
148
+ * with canvas at the field's own font, so it follows family, weight and size.
149
+ */
150
+ export const getFieldMaxLength = (field, value = '') => {
151
+ const box = getFieldTextBox(field);
152
+ if (!box) {
153
+ return undefined;
154
+ }
155
+ const cacheKey = `${box.key}|${value}`;
156
+ if (maxLengthCache.has(cacheKey)) {
157
+ return maxLengthCache.get(cacheKey);
158
+ }
159
+ const maxLength = estimateTextCapacity({ ...box, value });
160
+ if (maxLengthCache.size >= MAX_LENGTH_CACHE_SIZE) {
161
+ maxLengthCache.clear();
162
+ }
163
+ maxLengthCache.set(cacheKey, maxLength);
164
+ return maxLength;
165
+ };
166
+ //# sourceMappingURL=get-field-max-length.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-field-max-length.utils.js","sourceRoot":"","sources":["../../../src/utils/field/get-field-max-length.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAqB,MAAM,wBAAwB,CAAC;AAClG,OAAO,EACH,WAAW,EACX,kBAAkB,GAGrB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,WAAW,GACb,+EAA+E;IAC/E,8EAA8E;IAC9E,mFAAmF;IACnF,uCAAuC,CAAC;AAE5C,iGAAiG;AACjG,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,iGAAiG;AACjG,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,iGAAiG;AACjG,MAAM,YAAY,GAAG,KAAM,CAAC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C,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAE,KAAK,GAAG,EAAE,EAAsB,EAAE;IACjF,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,KAAK,EAAE,CAAC;IACvC,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,OAAO,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,SAAS,GAAG,oBAAoB,CAAC,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAE1D,IAAI,cAAc,CAAC,IAAI,IAAI,qBAAqB,EAAE,CAAC;QAC/C,cAAc,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACD,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAExC,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC"}
@@ -5,8 +5,10 @@ export * from './field-drag.utils';
5
5
  export * from './field-placeholder-text.utils';
6
6
  export * from './field-reading-order.utils';
7
7
  export * from './field-resize.utils';
8
+ export * from './fit-field-text.utils';
8
9
  export * from './get-field-bounds-style.utils';
9
10
  export * from './get-field-font-size.utils';
11
+ export * from './get-field-max-length.utils';
10
12
  export * from './get-field-text-clip.utils';
11
13
  export * from './get-field-type-option.utils';
12
14
  export * from './get-field-typography.utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/field/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/field/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
@@ -5,8 +5,10 @@ export * from './field-drag.utils';
5
5
  export * from './field-placeholder-text.utils';
6
6
  export * from './field-reading-order.utils';
7
7
  export * from './field-resize.utils';
8
+ export * from './fit-field-text.utils';
8
9
  export * from './get-field-bounds-style.utils';
9
10
  export * from './get-field-font-size.utils';
11
+ export * from './get-field-max-length.utils';
10
12
  export * from './get-field-text-clip.utils';
11
13
  export * from './get-field-type-option.utils';
12
14
  export * from './get-field-typography.utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/field/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/field/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** Returns the rendered width of `text` in pixels for one fixed font. */
2
+ export type TextMeasurer = (text: string) => number;
3
+ /** Where text wrapping has got to: the line being filled, and how wide it is so far. */
4
+ export interface WrapState {
5
+ lines: number;
6
+ lineWidth: number;
7
+ }
8
+ /** An empty box still occupies one line. */
9
+ export declare const INITIAL_WRAP_STATE: WrapState;
10
+ /**
11
+ * Continues laying out `text` after `state` in a box `maxWidth` wide, simulating browser layout
12
+ * for `white-space: pre-wrap; overflow-wrap: break-word` (the multiline fillable textarea):
13
+ *
14
+ * - `\n` forces a line break; a trailing `\n` still opens a line, as in a textarea
15
+ * - words wrap at spaces; runs of spaces are preserved and hang past the edge instead of wrapping
16
+ * - a word wider than a whole line is broken between characters (code points)
17
+ *
18
+ * `text` must start at a word boundary of the text already laid out, i.e. not continue a word.
19
+ *
20
+ * Not modelled: break opportunities after hyphens and other punctuation, which only ever let
21
+ * browsers pack lines more tightly, so the line count is never optimistic.
22
+ */
23
+ export declare const advanceWrap: (state: WrapState, text: string, maxWidth: number, measure: TextMeasurer) => WrapState;
24
+ /** Counts the lines `text` occupies in a box `maxWidth` wide; see {@link advanceWrap}. */
25
+ export declare const countWrappedLines: (text: string, maxWidth: number, measure: TextMeasurer) => number;
26
+ //# sourceMappingURL=text-wrap.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-wrap.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/field/text-wrap.utils.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEpD,wFAAwF;AACxF,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,EAAE,SAAsC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GACpB,OAAO,SAAS,EAChB,MAAM,MAAM,EACZ,UAAU,MAAM,EAChB,SAAS,YAAY,KACtB,SAsCF,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,GAC1B,MAAM,MAAM,EACZ,UAAU,MAAM,EAChB,SAAS,YAAY,KACtB,MAEF,CAAC"}
@@ -0,0 +1,53 @@
1
+ /** An empty box still occupies one line. */
2
+ export const INITIAL_WRAP_STATE = { lines: 1, lineWidth: 0 };
3
+ /**
4
+ * Continues laying out `text` after `state` in a box `maxWidth` wide, simulating browser layout
5
+ * for `white-space: pre-wrap; overflow-wrap: break-word` (the multiline fillable textarea):
6
+ *
7
+ * - `\n` forces a line break; a trailing `\n` still opens a line, as in a textarea
8
+ * - words wrap at spaces; runs of spaces are preserved and hang past the edge instead of wrapping
9
+ * - a word wider than a whole line is broken between characters (code points)
10
+ *
11
+ * `text` must start at a word boundary of the text already laid out, i.e. not continue a word.
12
+ *
13
+ * Not modelled: break opportunities after hyphens and other punctuation, which only ever let
14
+ * browsers pack lines more tightly, so the line count is never optimistic.
15
+ */
16
+ export const advanceWrap = (state, text, maxWidth, measure) => {
17
+ var _a;
18
+ let { lineWidth, lines } = state;
19
+ for (const token of (_a = text.replace(/\r\n?/g, '\n').match(/\n| +|[^ \n]+/g)) !== null && _a !== void 0 ? _a : []) {
20
+ if (token === '\n') {
21
+ lines += 1;
22
+ lineWidth = 0;
23
+ continue;
24
+ }
25
+ const tokenWidth = measure(token);
26
+ if (token[0] === ' ' || lineWidth + tokenWidth <= maxWidth) {
27
+ lineWidth += tokenWidth;
28
+ continue;
29
+ }
30
+ if (lineWidth > 0) {
31
+ lines += 1;
32
+ lineWidth = 0;
33
+ }
34
+ if (tokenWidth <= maxWidth) {
35
+ lineWidth = tokenWidth;
36
+ continue;
37
+ }
38
+ for (const char of token) {
39
+ const charWidth = measure(char);
40
+ if (lineWidth > 0 && lineWidth + charWidth > maxWidth) {
41
+ lines += 1;
42
+ lineWidth = 0;
43
+ }
44
+ lineWidth += charWidth;
45
+ }
46
+ }
47
+ return { lines, lineWidth };
48
+ };
49
+ /** Counts the lines `text` occupies in a box `maxWidth` wide; see {@link advanceWrap}. */
50
+ export const countWrappedLines = (text, maxWidth, measure) => {
51
+ return advanceWrap(INITIAL_WRAP_STATE, text, maxWidth, measure).lines;
52
+ };
53
+ //# sourceMappingURL=text-wrap.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-wrap.utils.js","sourceRoot":"","sources":["../../../src/utils/field/text-wrap.utils.ts"],"names":[],"mappings":"AASA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,kBAAkB,GAAc,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACvB,KAAgB,EAChB,IAAY,EACZ,QAAgB,EAChB,OAAqB,EACZ,EAAE;;IACX,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEjC,KAAK,MAAM,KAAK,IAAI,MAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,mCAAI,EAAE,EAAE,CAAC;QAC7E,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,CAAC;YACX,SAAS,GAAG,CAAC,CAAC;YACd,SAAS;QACb,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAElC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,SAAS,GAAG,UAAU,IAAI,QAAQ,EAAE,CAAC;YACzD,SAAS,IAAI,UAAU,CAAC;YACxB,SAAS;QACb,CAAC;QAED,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;YAChB,KAAK,IAAI,CAAC,CAAC;YACX,SAAS,GAAG,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;YACzB,SAAS,GAAG,UAAU,CAAC;YACvB,SAAS;QACb,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,SAAS,GAAG,QAAQ,EAAE,CAAC;gBACpD,KAAK,IAAI,CAAC,CAAC;gBACX,SAAS,GAAG,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,IAAI,SAAS,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC7B,IAAY,EACZ,QAAgB,EAChB,OAAqB,EACf,EAAE;IACR,OAAO,WAAW,CAAC,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC;AAC1E,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type BusinessCalendar } from '../../interface/types';
2
+ /**
3
+ * The default calendar: Saturday and Sunday plus `holidays` (the host's, DTE's
4
+ * `GET api/holidays`), for the current year ± DEFAULT_CALENDAR_YEARS. Fields whose schedule toggle
5
+ * is off use it.
6
+ */
7
+ export declare function defaultBusinessCalendar(holidays?: string[]): BusinessCalendar;
8
+ /**
9
+ * Walks `days` business days from a date (epoch ms; negative walks back), the start not counted.
10
+ * Mirrors DTE's `BusinessDayCalculator.AddBusinessDays`: null for a fractional offset, more than
11
+ * MAX_DATE_CALC_DAYS, an invalid start, or a start or walk outside the calendar's years.
12
+ */
13
+ export declare function addBusinessDays(startMs: number, days: number, calendar: BusinessCalendar): number | null;
14
+ /**
15
+ * Counts the business days from `fromMs` to `toMs`, negative when `toMs` is earlier; the start is
16
+ * not counted, the end is. Mirrors DTE's `BusinessDayCalculator.CountBusinessDays`: null for an
17
+ * invalid date, a span over MAX_DATE_CALC_DAYS, or a date outside the calendar's years.
18
+ */
19
+ export declare function countBusinessDays(fromMs: number, toMs: number, calendar: BusinessCalendar): number | null;
20
+ /**
21
+ * Adds `days` plain calendar days to a date (epoch ms; negative subtracts) — no weekend or holiday
22
+ * skipping. Used when a date calculated field's business-day exclusion toggle is off, matching the
23
+ * pre-DTE-4695 behavior. Null for a fractional offset, more than MAX_DATE_CALC_DAYS, or an invalid
24
+ * start.
25
+ */
26
+ export declare function addCalendarDays(startMs: number, days: number): number | null;
27
+ /**
28
+ * Counts the plain calendar days from `fromMs` to `toMs`, negative when `toMs` is earlier — no
29
+ * weekend or holiday skipping. Null for an invalid date or a span over MAX_DATE_CALC_DAYS.
30
+ */
31
+ export declare function countCalendarDays(fromMs: number, toMs: number): number | null;
32
+ //# sourceMappingURL=business-days.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-days.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/formula/business-days.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAwD9D;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAQ7E;AAWD;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,gBAAgB,GAC3B,MAAM,GAAG,IAAI,CA2Bf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,gBAAgB,GAC3B,MAAM,GAAG,IAAI,CA2Bf;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU5E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ7E"}
@@ -0,0 +1,148 @@
1
+ import { DEFAULT_CALENDAR_YEARS, MAX_DATE_CALC_DAYS } from '../../constants';
2
+ /** Saturday and Sunday: the default calendar's weekend. */
3
+ const DEFAULT_WEEKEND_DAYS = [0, 6];
4
+ const DAY_MS = 24 * 60 * 60 * 1000;
5
+ function toDateOnly(ms) {
6
+ const d = new Date(ms);
7
+ d.setUTCHours(0, 0, 0, 0);
8
+ return d;
9
+ }
10
+ function toDateKey(d) {
11
+ const y = d.getUTCFullYear();
12
+ const m = String(d.getUTCMonth() + 1).padStart(2, '0');
13
+ const day = String(d.getUTCDate()).padStart(2, '0');
14
+ return `${y}-${m}-${day}`;
15
+ }
16
+ function buildHolidaySet(holidays) {
17
+ const set = new Set();
18
+ for (const h of holidays !== null && holidays !== void 0 ? holidays : []) {
19
+ const d = toDateOnly(new Date(h).getTime());
20
+ if (!isNaN(d.getTime())) {
21
+ set.add(toDateKey(d));
22
+ }
23
+ }
24
+ return set;
25
+ }
26
+ // Calendars are passed once and reused by every field, so each is prepared once.
27
+ const preparedCalendars = new WeakMap();
28
+ function prepareCalendar(calendar) {
29
+ var _a;
30
+ const cached = preparedCalendars.get(calendar);
31
+ if (cached) {
32
+ return cached;
33
+ }
34
+ const prepared = {
35
+ weekendDays: new Set((_a = calendar.weekendDays) !== null && _a !== void 0 ? _a : DEFAULT_WEEKEND_DAYS),
36
+ holidays: buildHolidaySet(calendar.holidays),
37
+ firstYear: calendar.firstYear,
38
+ lastYear: calendar.lastYear,
39
+ };
40
+ preparedCalendars.set(calendar, prepared);
41
+ return prepared;
42
+ }
43
+ /**
44
+ * The default calendar: Saturday and Sunday plus `holidays` (the host's, DTE's
45
+ * `GET api/holidays`), for the current year ± DEFAULT_CALENDAR_YEARS. Fields whose schedule toggle
46
+ * is off use it.
47
+ */
48
+ export function defaultBusinessCalendar(holidays) {
49
+ const year = new Date().getUTCFullYear();
50
+ return {
51
+ weekendDays: DEFAULT_WEEKEND_DAYS,
52
+ holidays: holidays !== null && holidays !== void 0 ? holidays : [],
53
+ firstYear: year - DEFAULT_CALENDAR_YEARS,
54
+ lastYear: year + DEFAULT_CALENDAR_YEARS,
55
+ };
56
+ }
57
+ function isBusinessDay(d, calendar) {
58
+ return !calendar.weekendDays.has(d.getUTCDay()) && !calendar.holidays.has(toDateKey(d));
59
+ }
60
+ function isWithinYears(d, calendar) {
61
+ const year = d.getUTCFullYear();
62
+ return year >= calendar.firstYear && year <= calendar.lastYear;
63
+ }
64
+ /**
65
+ * Walks `days` business days from a date (epoch ms; negative walks back), the start not counted.
66
+ * Mirrors DTE's `BusinessDayCalculator.AddBusinessDays`: null for a fractional offset, more than
67
+ * MAX_DATE_CALC_DAYS, an invalid start, or a start or walk outside the calendar's years.
68
+ */
69
+ export function addBusinessDays(startMs, days, calendar) {
70
+ const prepared = prepareCalendar(calendar);
71
+ const start = toDateOnly(startMs);
72
+ if (!Number.isInteger(days) ||
73
+ Math.abs(days) > MAX_DATE_CALC_DAYS ||
74
+ !isFinite(start.getTime()) ||
75
+ !isWithinYears(start, prepared)) {
76
+ return null;
77
+ }
78
+ const direction = days >= 0 ? 1 : -1;
79
+ let remaining = Math.abs(days);
80
+ const current = new Date(start.getTime());
81
+ while (remaining > 0) {
82
+ current.setUTCDate(current.getUTCDate() + direction);
83
+ if (!isWithinYears(current, prepared)) {
84
+ return null;
85
+ }
86
+ if (isBusinessDay(current, prepared)) {
87
+ remaining--;
88
+ }
89
+ }
90
+ return current.getTime();
91
+ }
92
+ /**
93
+ * Counts the business days from `fromMs` to `toMs`, negative when `toMs` is earlier; the start is
94
+ * not counted, the end is. Mirrors DTE's `BusinessDayCalculator.CountBusinessDays`: null for an
95
+ * invalid date, a span over MAX_DATE_CALC_DAYS, or a date outside the calendar's years.
96
+ */
97
+ export function countBusinessDays(fromMs, toMs, calendar) {
98
+ const prepared = prepareCalendar(calendar);
99
+ const from = toDateOnly(fromMs);
100
+ const to = toDateOnly(toMs);
101
+ if (!isFinite(from.getTime()) || !isFinite(to.getTime())) {
102
+ return null;
103
+ }
104
+ if (Math.abs(to.getTime() - from.getTime()) / DAY_MS > MAX_DATE_CALC_DAYS ||
105
+ !isWithinYears(from, prepared) ||
106
+ !isWithinYears(to, prepared)) {
107
+ return null;
108
+ }
109
+ const direction = to.getTime() >= from.getTime() ? 1 : -1;
110
+ const cursor = new Date(from.getTime());
111
+ let count = 0;
112
+ while (toDateKey(cursor) !== toDateKey(to)) {
113
+ cursor.setUTCDate(cursor.getUTCDate() + direction);
114
+ if (isBusinessDay(cursor, prepared)) {
115
+ count++;
116
+ }
117
+ }
118
+ return count * direction;
119
+ }
120
+ /**
121
+ * Adds `days` plain calendar days to a date (epoch ms; negative subtracts) — no weekend or holiday
122
+ * skipping. Used when a date calculated field's business-day exclusion toggle is off, matching the
123
+ * pre-DTE-4695 behavior. Null for a fractional offset, more than MAX_DATE_CALC_DAYS, or an invalid
124
+ * start.
125
+ */
126
+ export function addCalendarDays(startMs, days) {
127
+ const start = toDateOnly(startMs);
128
+ if (!Number.isInteger(days) ||
129
+ Math.abs(days) > MAX_DATE_CALC_DAYS ||
130
+ !isFinite(start.getTime())) {
131
+ return null;
132
+ }
133
+ return start.getTime() + days * DAY_MS;
134
+ }
135
+ /**
136
+ * Counts the plain calendar days from `fromMs` to `toMs`, negative when `toMs` is earlier — no
137
+ * weekend or holiday skipping. Null for an invalid date or a span over MAX_DATE_CALC_DAYS.
138
+ */
139
+ export function countCalendarDays(fromMs, toMs) {
140
+ const from = toDateOnly(fromMs);
141
+ const to = toDateOnly(toMs);
142
+ if (!isFinite(from.getTime()) || !isFinite(to.getTime())) {
143
+ return null;
144
+ }
145
+ const diffDays = Math.round((to.getTime() - from.getTime()) / DAY_MS);
146
+ return Math.abs(diffDays) > MAX_DATE_CALC_DAYS ? null : diffDays;
147
+ }
148
+ //# sourceMappingURL=business-days.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-days.utils.js","sourceRoot":"","sources":["../../../src/utils/formula/business-days.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,C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M,UAAU,eAAe,CAAC,OAAe,EAAE,IAAY;IACzD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAClC,IACI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,kBAAkB;QACnC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAC5B,CAAC;QACC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,IAAY;IAC1D,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;AACrE,CAAC"}
@@ -26,7 +26,7 @@ function getExpressionBeforeCaret(element) {
26
26
  while (current && current.parentNode !== element) {
27
27
  current = current.parentNode;
28
28
  }
29
- return current && current.parentNode === element ? current : null;
29
+ return (current === null || current === void 0 ? void 0 : current.parentNode) === element ? current : null;
30
30
  };
31
31
  if (endContainer === element) {
32
32
  element.childNodes.forEach((node, index) => {
@@ -1 +1 @@
1
-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AAU,CAAC,UAAU,CAAC,CAAC,IAAI,CACnD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CACjB,CAAC;QACtB,IAAI,QAAQ,EAAE,CAAC;YACX,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,MAAA,MAAA,QAAQ,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC,CAAC;QACxF,CAAC;aAAM,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YAC1B,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrB,SAAS,CAAC,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
@@ -1,4 +1,21 @@
1
- import { type DataModelValues, type StructuredFormula } from '../../interface/types';
1
+ import { type BusinessCalendar, type DataModelValues, type FieldScheduleBinding, type StructuredFormula } from '../../interface/types';
2
+ /**
3
+ * Which calendar a date formula uses. `enabled` is the field's custom business-day exclusion
4
+ * toggle (DTE's schedule binding): off uses plain calendar-day arithmetic (no weekend/holiday
5
+ * skipping, the pre-DTE-4695 behavior); on uses the field's own calendar (`calendar`, a field
6
+ * bound to a schedule) or the default one, Saturday and Sunday plus `holidays`.
7
+ */
8
+ export interface DateCalcOptions {
9
+ enabled?: boolean;
10
+ calendar?: BusinessCalendar;
11
+ holidays?: string[];
12
+ }
13
+ /**
14
+ * A field's options: disabled (plain calendar-day math) unless it has a binding in
15
+ * `scheduleBindings` (DTE's `fieldKey` = `PdfField.id`), in which case it uses its own calendar
16
+ * when the host passed one for its id, else the default calendar.
17
+ */
18
+ export declare function getFieldDateCalcOptions(fieldId: string | undefined, scheduleBindings: FieldScheduleBinding[] | undefined, holidays: string[] | undefined, fieldCalendars: Record<string, BusinessCalendar> | undefined): DateCalcOptions;
2
19
  /**
3
20
  * Convert formula operand to number. Merge tags and fillable only ever give:
4
21
  * empty '', a number, or a string number (e.g. '1.2'). Only those are converted to number for calculation.
@@ -15,14 +32,16 @@ export declare function valueToNumber(raw: unknown): number;
15
32
  * field is omitted rather than showing 0.
16
33
  *
17
34
  * Date fields are identified by `fieldType: 'date'` on field tokens. When date
18
- * fields are present, arithmetic follows business-day semantics — weekends and
19
- * holidays are skipped when adding/subtracting days, and date diffs count only
20
- * business days.
35
+ * fields are present and `options.enabled` is on, arithmetic follows business-day
36
+ * semantics — the calendar's weekend days and holidays are skipped when adding/subtracting
37
+ * days, and date diffs count only business days, with a result outside the calendar's years
38
+ * blank. Otherwise (the field's exclusion toggle is off) it's plain calendar-day arithmetic.
39
+ * Either way, as in DTE, a fractional offset or a difference over 365 days is `null` (blank).
21
40
  */
22
- export declare function evaluateFormula(formula: StructuredFormula | undefined | null, data: DataModelValues | undefined, holidays?: string[]): number | null;
41
+ export declare function evaluateFormula(formula: StructuredFormula | undefined | null, data: DataModelValues | undefined, options?: DateCalcOptions): number | null;
23
42
  /**
24
43
  * Returns true when the formula divides by zero with the given data
25
44
  * (literal `… / 0` or a divisor that resolves to 0). Matches backend null result.
26
45
  */
27
- export declare function hasDivisionByZero(formula: StructuredFormula | undefined | null, data?: DataModelValues, holidays?: string[]): boolean;
46
+ export declare function hasDivisionByZero(formula: StructuredFormula | undefined | null, data?: DataModelValues, options?: DateCalcOptions): boolean;
28
47
  //# sourceMappingURL=evaluate-formula.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluate-formula.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/formula/evaluate-formula.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,eAAe,EAGpB,KAAK,iBAAiB,EACzB,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAgBlD;AAiXD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,EAC7C,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,GACpB,MAAM,GAAG,IAAI,CAsBf;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI,EAC7C,IAAI,CAAC,EAAE,eAAe,EACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,WActB"}
1
+ {"version":3,"file":"evaluate-formula.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/formula/evaluate-formula.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAGzB,KAAK,iBAAiB,EACzB,MAAM,uBAAuB,CAAC;AAU/B;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,gBAAgB,EAAE,oBAAoB,EAAE,GAAG,SAAS,EACpD,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,SAAS,GAC7D,eAAe,CAOjB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,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