@servicetitan/dte-unlayer 0.158.0 → 0.159.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 (147) hide show
  1. package/dist/api-core.js +22 -29
  2. package/dist/api-core.js.map +1 -1
  3. package/dist/api-custom-tools.js +23 -29
  4. package/dist/api-custom-tools.js.map +1 -1
  5. package/dist/business-calendar/BusinessCalendarDrawer.d.ts +19 -0
  6. package/dist/business-calendar/BusinessCalendarDrawer.d.ts.map +1 -0
  7. package/dist/business-calendar/BusinessCalendarDrawer.js +41 -0
  8. package/dist/business-calendar/BusinessCalendarDrawer.js.map +1 -0
  9. package/dist/business-calendar/business-calendar-requests.d.ts +25 -0
  10. package/dist/business-calendar/business-calendar-requests.d.ts.map +1 -0
  11. package/dist/business-calendar/business-calendar-requests.js +46 -0
  12. package/dist/business-calendar/business-calendar-requests.js.map +1 -0
  13. package/dist/business-calendar/business-calendar-state.d.ts +22 -0
  14. package/dist/business-calendar/business-calendar-state.d.ts.map +1 -0
  15. package/dist/business-calendar/business-calendar-state.js +74 -0
  16. package/dist/business-calendar/business-calendar-state.js.map +1 -0
  17. package/dist/business-calendar/useBusinessCalendarRequests.d.ts +15 -0
  18. package/dist/business-calendar/useBusinessCalendarRequests.d.ts.map +1 -0
  19. package/dist/business-calendar/useBusinessCalendarRequests.js +30 -0
  20. package/dist/business-calendar/useBusinessCalendarRequests.js.map +1 -0
  21. package/dist/display-conditions/ConditionGroup.js +15 -89
  22. package/dist/display-conditions/ConditionGroup.js.map +1 -1
  23. package/dist/display-conditions/ConditionGroupsSection.js +2 -70
  24. package/dist/display-conditions/ConditionGroupsSection.js.map +1 -1
  25. package/dist/display-conditions/ConditionRow.js +63 -205
  26. package/dist/display-conditions/ConditionRow.js.map +1 -1
  27. package/dist/display-conditions/DisplayConditionModal.js +40 -190
  28. package/dist/display-conditions/DisplayConditionModal.js.map +1 -1
  29. package/dist/display-conditions/LookupValueControl.js +42 -105
  30. package/dist/display-conditions/LookupValueControl.js.map +1 -1
  31. package/dist/display-conditions/SeparatorWithChip.js +1 -10
  32. package/dist/display-conditions/SeparatorWithChip.js.map +1 -1
  33. package/dist/display-conditions/constants.js +15 -20
  34. package/dist/display-conditions/constants.js.map +1 -1
  35. package/dist/display-conditions/displayConditionController.js +5 -8
  36. package/dist/display-conditions/displayConditionController.js.map +1 -1
  37. package/dist/display-conditions/lookupOptionsController.js +16 -16
  38. package/dist/display-conditions/lookupOptionsController.js.map +1 -1
  39. package/dist/display-conditions/nunjucks.js +98 -116
  40. package/dist/display-conditions/nunjucks.js.map +1 -1
  41. package/dist/display-conditions/schemaDataPoints.js +13 -11
  42. package/dist/display-conditions/schemaDataPoints.js.map +1 -1
  43. package/dist/display-conditions/types.js +23 -67
  44. package/dist/display-conditions/types.js.map +1 -1
  45. package/dist/display-conditions/useConditionForms.js +38 -56
  46. package/dist/display-conditions/useConditionForms.js.map +1 -1
  47. package/dist/display-conditions/useLookupOptions.js +24 -44
  48. package/dist/display-conditions/useLookupOptions.js.map +1 -1
  49. package/dist/e-sign-offset/ESignDateSignedOffsetModal.js +37 -150
  50. package/dist/e-sign-offset/ESignDateSignedOffsetModal.js.map +1 -1
  51. package/dist/e-sign-offset/ESignOffsetRuleRow.js +12 -73
  52. package/dist/e-sign-offset/ESignOffsetRuleRow.js.map +1 -1
  53. package/dist/e-sign-offset/eSignOffsetController.js +5 -8
  54. package/dist/e-sign-offset/eSignOffsetController.js.map +1 -1
  55. package/dist/editor-core-source.d.ts +2 -2
  56. package/dist/editor-core-source.d.ts.map +1 -1
  57. package/dist/editor-core-source.js +3 -3
  58. package/dist/editor-core-source.js.map +1 -1
  59. package/dist/editor-core.js +2 -2
  60. package/dist/editor-core.js.map +1 -1
  61. package/dist/editor.d.ts.map +1 -1
  62. package/dist/editor.js +56 -118
  63. package/dist/editor.js.map +1 -1
  64. package/dist/image-upload-error.js +3 -3
  65. package/dist/image-upload-error.js.map +1 -1
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +0 -1
  69. package/dist/index.js.map +1 -1
  70. package/dist/loadScript.js +7 -8
  71. package/dist/loadScript.js.map +1 -1
  72. package/dist/log.js +2 -3
  73. package/dist/log.js.map +1 -1
  74. package/dist/merge-tags.js +18 -17
  75. package/dist/merge-tags.js.map +1 -1
  76. package/dist/shared/configs.js +1 -2
  77. package/dist/shared/configs.js.map +1 -1
  78. package/dist/shared/const.d.ts +70 -0
  79. package/dist/shared/const.d.ts.map +1 -1
  80. package/dist/shared/const.js +13 -4
  81. package/dist/shared/const.js.map +1 -1
  82. package/dist/shared/date-calc.js +47 -38
  83. package/dist/shared/date-calc.js.map +1 -1
  84. package/dist/shared/e-sign-offset.js +46 -63
  85. package/dist/shared/e-sign-offset.js.map +1 -1
  86. package/dist/shared/edit-icon.js +0 -1
  87. package/dist/shared/edit-icon.js.map +1 -1
  88. package/dist/shared/fonts.js +16 -17
  89. package/dist/shared/fonts.js.map +1 -1
  90. package/dist/shared/forms.js +16 -38
  91. package/dist/shared/forms.js.map +1 -1
  92. package/dist/shared/instance-id.js +6 -9
  93. package/dist/shared/instance-id.js.map +1 -1
  94. package/dist/shared/nunjucks-helpers.js +2 -5
  95. package/dist/shared/nunjucks-helpers.js.map +1 -1
  96. package/dist/shared/schema.js +52 -96
  97. package/dist/shared/schema.js.map +1 -1
  98. package/dist/shared/tools.js +6 -13
  99. package/dist/shared/tools.js.map +1 -1
  100. package/dist/store.d.ts +15 -1
  101. package/dist/store.d.ts.map +1 -1
  102. package/dist/store.js +851 -548
  103. package/dist/store.js.map +1 -1
  104. package/dist/tools.js +133 -143
  105. package/dist/tools.js.map +1 -1
  106. package/dist/unlayer-interface.d.ts +15 -4
  107. package/dist/unlayer-interface.d.ts.map +1 -1
  108. package/dist/unlayer-interface.js +1 -2
  109. package/dist/unlayer-interface.js.map +1 -1
  110. package/dist/unlayer.js +86 -113
  111. package/dist/unlayer.js.map +1 -1
  112. package/dist/vendor/dte-shared/business-calendar-validation.utils.d.ts +25 -0
  113. package/dist/vendor/dte-shared/business-calendar-validation.utils.js +80 -0
  114. package/dist/vendor/dte-shared/components/business-calendar-section.d.ts +15 -0
  115. package/dist/vendor/dte-shared/components/business-calendar-section.js +14 -0
  116. package/dist/vendor/dte-shared/components/schedule-drawer.d.ts +18 -0
  117. package/dist/vendor/dte-shared/components/schedule-drawer.js +119 -0
  118. package/dist/vendor/dte-shared/components/schedule-picker.d.ts +8 -0
  119. package/dist/vendor/dte-shared/components/schedule-picker.js +88 -0
  120. package/dist/vendor/dte-shared/constants.d.ts +31 -0
  121. package/dist/vendor/dte-shared/constants.js +34 -0
  122. package/dist/vendor/dte-shared/field-schedule-editor-context.d.ts +31 -0
  123. package/dist/vendor/dte-shared/field-schedule-editor-context.js +110 -0
  124. package/dist/vendor/dte-shared/index.d.ts +8 -0
  125. package/dist/vendor/dte-shared/index.js +7 -0
  126. package/dist/vendor/dte-shared/schedule-bindings.utils.d.ts +22 -0
  127. package/dist/vendor/dte-shared/schedule-bindings.utils.js +31 -0
  128. package/dist/vendor/dte-shared/styles/schedule.css +19 -0
  129. package/dist/vendor/dte-shared/types.d.ts +129 -0
  130. package/dist/vendor/dte-shared/types.js +1 -0
  131. package/package.json +7 -1
  132. package/src/__tests__/business-calendar-drawer.test.tsx +183 -0
  133. package/src/__tests__/business-calendar-requests.test.ts +166 -0
  134. package/src/__tests__/business-calendar-state.test.tsx +142 -0
  135. package/src/__tests__/store.business-calendar.test.ts +185 -0
  136. package/src/__tests__/unlayer.e-sign-types.test.ts +30 -0
  137. package/src/business-calendar/BusinessCalendarDrawer.tsx +76 -0
  138. package/src/business-calendar/business-calendar-requests.ts +80 -0
  139. package/src/business-calendar/business-calendar-state.ts +113 -0
  140. package/src/business-calendar/useBusinessCalendarRequests.ts +49 -0
  141. package/src/editor-core-source.ts +2 -2
  142. package/src/editor.tsx +15 -0
  143. package/src/index.ts +10 -0
  144. package/src/shared/const.ts +59 -0
  145. package/src/store.ts +67 -5
  146. package/src/unlayer-interface.tsx +15 -4
  147. package/src/unlayer.tsx +5 -5
@@ -1,3 +1,4 @@
1
+ import type { BusinessDaySchedule, HolidayCatalog } from '../vendor/dte-shared/index';
1
2
  import type { DisplayConditionState } from '../display-conditions/types';
2
3
  import type { BusinessCalendar } from './date-calc';
3
4
  import { SchemaObject } from './schema';
@@ -39,6 +40,73 @@ export interface UnlayerEventESignOffset {
39
40
  requestId: string;
40
41
  value: ESignDateSignedOffsetSettings;
41
42
  }
43
+ /**
44
+ * Names shown for e-sign field types whose title differs from the type list entry it is derived
45
+ * from (by type value). Only the label changes: the stored value stays, so saved designs and the
46
+ * `esign_<recipient>_<type>` placeholder are unaffected.
47
+ */
48
+ export declare const E_SIGN_FIELD_TYPE_LABELS: Readonly<Record<string, string | undefined>>;
49
+ /**
50
+ * Payload of `--business-calendar-request` (iframe to parent): what a date field's inline schedule
51
+ * settings (a calculated field's or an e-sign "Date Signed Offset" field's) ask the parent window
52
+ * to do. `fieldKey` is the tool's instance id (`values.id`), the key DTE binds the schedule to.
53
+ * - `toggle` / `select`: the exclusion toggle and the schedule picker.
54
+ * - `create` / `edit`: open the schedule drawer, for a new schedule or `scheduleId`.
55
+ * - `delete`: delete the selected schedule; the outcome comes back as `--business-calendar-result`.
56
+ */
57
+ export type UnlayerEventBusinessCalendarRequest = {
58
+ action: 'toggle';
59
+ fieldKey: string;
60
+ enabled: boolean;
61
+ } | {
62
+ action: 'select';
63
+ fieldKey: string;
64
+ scheduleId?: number;
65
+ } | {
66
+ action: 'create';
67
+ fieldKey: string;
68
+ } | {
69
+ action: 'edit';
70
+ fieldKey: string;
71
+ scheduleId: number;
72
+ } | {
73
+ action: 'delete';
74
+ fieldKey: string;
75
+ scheduleId: number;
76
+ requestId: string;
77
+ };
78
+ /** Payload of `--business-calendar-result` (parent to iframe): how a `delete` request ended. */
79
+ export interface UnlayerEventBusinessCalendarResult {
80
+ requestId: string;
81
+ /** Why it failed, shown under the schedule; absent on success. */
82
+ error?: string;
83
+ }
84
+ /**
85
+ * Payload of `--business-calendar-state` (parent to iframe), sent whenever the host's schedule
86
+ * props change: what the property editors show and the calendars the previews use.
87
+ */
88
+ export interface UnlayerEventBusinessCalendarState {
89
+ /** Whether the host edits schedules (it passes `onScheduleBindingsChange`). */
90
+ enabled: boolean;
91
+ /** The fields whose exclusion toggle is on, by field key, with their schedule (none: default). */
92
+ bindings: Record<string, {
93
+ scheduleId?: number;
94
+ }>;
95
+ /** The schedules a field can pick, default first, as the host passes them. */
96
+ schedules: BusinessDaySchedule[];
97
+ schedulesLoading?: boolean;
98
+ schedulesError?: string;
99
+ /** The tenant's known holidays, for the schedule preview's names. */
100
+ holidayCatalog?: HolidayCatalog;
101
+ holidayCatalogLoading?: boolean;
102
+ holidayCatalogError?: string;
103
+ /** Whether the host can delete schedules (it passes `onDeleteSchedule`). */
104
+ canDeleteSchedule: boolean;
105
+ /** Calendars of the bound fields, by field key. */
106
+ fieldCalendars: Record<string, BusinessCalendar>;
107
+ /** The default calendar's holidays. */
108
+ holidays?: string[];
109
+ }
42
110
  export interface UnlayerEditorUnit {
43
111
  id: string;
44
112
  generic: string;
@@ -65,6 +133,8 @@ export interface UnlayerEventRegister {
65
133
  units?: UnlayerEditorUnit[];
66
134
  eSignRecipients?: UnlayerEditorESignRecipientInfo[];
67
135
  eSignFieldTypes?: string[];
136
+ /** {@link E_SIGN_FIELD_TYPE_LABELS}, for the e-sign tool's canvas label. */
137
+ eSignFieldTypeLabels?: Readonly<Record<string, string | undefined>>;
68
138
  customTools?: {
69
139
  key: string;
70
140
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/shared/const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UA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E,GAAG,CAAC;IAChB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAClD,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,+BAA+B,EAAE,CAAC;IACpD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IACJ,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1,12 +1,21 @@
1
1
  export const constGenericsEditor = {
2
2
  infoDataProperty: '_info',
3
3
  adminConfigProperty: 'adminConfig',
4
- userConfigProperty: 'config'
4
+ userConfigProperty: 'config',
5
5
  };
6
6
  export const E_SIGN_TOOL_SLUG = 'e-sign';
7
7
  export const E_SIGN_DATE_SIGNED_OFFSET_TYPE = 'dateSignedOffset';
8
- /** Must match the backend `EsignFieldSubTypes` registry key read from the e-sign tool values. */ export const E_SIGN_DATE_SIGNED_OFFSET_VALUES_KEY = 'eSignDateSignedOffset';
8
+ /** Must match the backend `EsignFieldSubTypes` registry key read from the e-sign tool values. */
9
+ export const E_SIGN_DATE_SIGNED_OFFSET_VALUES_KEY = 'eSignDateSignedOffset';
9
10
  export const MAX_E_SIGN_OFFSET_DAYS = 365;
10
- /** Counts the trailing unconditional rule too. */ export const MAX_E_SIGN_OFFSET_RULES = 5;
11
-
11
+ /** Counts the trailing unconditional rule too. */
12
+ export const MAX_E_SIGN_OFFSET_RULES = 5;
13
+ /**
14
+ * Names shown for e-sign field types whose title differs from the type list entry it is derived
15
+ * from (by type value). Only the label changes: the stored value stays, so saved designs and the
16
+ * `esign_<recipient>_<type>` placeholder are unaffected.
17
+ */
18
+ export const E_SIGN_FIELD_TYPE_LABELS = {
19
+ [E_SIGN_DATE_SIGNED_OFFSET_TYPE]: 'Calculated Signing Date',
20
+ };
12
21
  //# sourceMappingURL=const.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/const.ts"],"sourcesContent":["import type { DisplayConditionState } from '../display-conditions/types';\nimport type { BusinessCalendar } from './date-calc';\nimport { SchemaObject } from './schema';\n\nexport const constGenericsEditor = {\n infoDataProperty: '_info',\n adminConfigProperty: 'adminConfig',\n userConfigProperty: 'config',\n};\n\nexport interface UnlayerEditorESignRecipientInfo {\n id: number;\n name: string;\n displayName: string;\n}\n\nexport const E_SIGN_TOOL_SLUG = 'e-sign';\nexport const E_SIGN_DATE_SIGNED_OFFSET_TYPE = 'dateSignedOffset';\n/** Must match the backend `EsignFieldSubTypes` registry key read from the e-sign tool values. */\nexport const E_SIGN_DATE_SIGNED_OFFSET_VALUES_KEY = 'eSignDateSignedOffset';\nexport const MAX_E_SIGN_OFFSET_DAYS = 365;\n/** Counts the trailing unconditional rule too. */\nexport const MAX_E_SIGN_OFFSET_RULES = 5;\n\nexport interface ESignDateSignedOffsetRule {\n days: number;\n /** Always `behavior: 'show'` with exactly one condition; the backend rejects anything else. */\n condition: DisplayConditionState;\n}\n\nexport interface ESignDateSignedOffsetFinalRule {\n days: number;\n condition?: never;\n}\n\n/**\n * Ordered if / else-if / else chain: the first rule whose condition matches supplies the offset,\n * and the last rule is always the unconditional fallback.\n */\nexport interface ESignDateSignedOffsetSettings {\n rules:\n | [ESignDateSignedOffsetFinalRule]\n | [...ESignDateSignedOffsetRule[], ESignDateSignedOffsetFinalRule];\n}\n\n/** Payload of both `--esign-offset-open` (iframe to parent) and `--esign-offset-result` (back). */\nexport interface UnlayerEventESignOffset {\n requestId: string;\n value: ESignDateSignedOffsetSettings;\n}\n\nexport interface UnlayerEditorUnit {\n id: string;\n generic: string;\n title: string;\n values: any;\n}\n\nexport interface UnlayerEditorTwin {\n tool: string;\n title: string;\n values: any;\n}\n\nexport interface UnlayerEventConfig {\n dummyData?: any;\n schema?: SchemaObject;\n generics?: true | string[];\n genericConfigMode?: boolean;\n isSnapshotMode?: boolean;\n units?: UnlayerEditorUnit[];\n holidays?: string[];\n fieldCalendars?: Record<string, BusinessCalendar>;\n conditionalRulesEnabled?: boolean;\n}\n\nexport interface UnlayerEventRegister {\n units?: UnlayerEditorUnit[];\n eSignRecipients?: UnlayerEditorESignRecipientInfo[];\n eSignFieldTypes?: string[];\n customTools?: {\n key: string;\n title?: string;\n }[];\n toolTwins?: UnlayerEditorTwin[];\n}\n\nexport interface UnlayerToolMetaData {\n key: string;\n description?: string;\n}\n"],"names":["constGenericsEditor","infoDataProperty","adminConfigProperty","userConfigProperty","E_SIGN_TOOL_SLUG","E_SIGN_DATE_SIGNED_OFFSET_TYPE","E_SIGN_DATE_SIGNED_OFFSET_VALUES_KEY","MAX_E_SIGN_OFFSET_DAYS","MAX_E_SIGN_OFFSET_RULES"],"mappings":"AAIA,OAAO,MAAMA,sBAAsB;IAC/BC,kBAAkB;IAClBC,qBAAqB;IACrBC,oBAAoB;AACxB,EAAE;AAQF,OAAO,MAAMC,mBAAmB,SAAS;AACzC,OAAO,MAAMC,iCAAiC,mBAAmB;AACjE,+FAA+F,GAC/F,OAAO,MAAMC,uCAAuC,wBAAwB;AAC5E,OAAO,MAAMC,yBAAyB,IAAI;AAC1C,gDAAgD,GAChD,OAAO,MAAMC,0BAA0B,EAAE"}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/shared/const.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,gBAAgB,EAAE,OAAO;IACzB,mBAAmB,EAAE,aAAa;IAClC,kBAAkB,EAAE,QAAQ;CAC/B,CAAC;AAQF,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AACjE,iGAAiG;AACjG,MAAM,CAAC,MAAM,oCAAoC,GAAG,uBAAuB,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,kDAAkD;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AA6BzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAiD;IAClF,CAAC,8BAA8B,CAAC,EAAE,yBAAyB;CAC9D,CAAC"}
@@ -2,11 +2,13 @@ export const MAX_DATE_CALC_DAYS = 365;
2
2
  /**
3
3
  * The years DTE knows holidays for (`HolidayCheckService.HolidayYearsWindow`): outside them a
4
4
  * default-calendar answer would skip weekends but miss holidays, so it is left blank, as in BYOD.
5
- */ export const DATE_RANGE_YEARS = 1;
5
+ */
6
+ export const DATE_RANGE_YEARS = 1;
6
7
  /**
7
8
  * Returns true if the date's year falls within [currentYear - DATE_RANGE_YEARS, currentYear + DATE_RANGE_YEARS].
8
9
  * Invalid or unparseable dates return false.
9
- */ export function isDateWithinRange(dateInput) {
10
+ */
11
+ export function isDateWithinRange(dateInput) {
10
12
  if (typeof dateInput !== 'string' && !(dateInput instanceof Date)) {
11
13
  return false;
12
14
  }
@@ -18,10 +20,8 @@ export const MAX_DATE_CALC_DAYS = 365;
18
20
  const year = d.getUTCFullYear();
19
21
  return year >= currentYear - DATE_RANGE_YEARS && year <= currentYear + DATE_RANGE_YEARS;
20
22
  }
21
- /** Saturday and Sunday: the default calendar's weekend. */ export const DEFAULT_WEEKEND_DAYS = [
22
- 0,
23
- 6
24
- ];
23
+ /** Saturday and Sunday: the default calendar's weekend. */
24
+ export const DEFAULT_WEEKEND_DAYS = [0, 6];
25
25
  function toDateOnly(input) {
26
26
  const d = typeof input === 'string' ? new Date(input) : new Date(input.getTime());
27
27
  d.setUTCHours(0, 0, 0, 0);
@@ -42,7 +42,7 @@ function parseDate(input) {
42
42
  }
43
43
  function buildHolidaySet(holidays) {
44
44
  const set = new Set();
45
- for (const h of holidays !== null && holidays !== void 0 ? holidays : []){
45
+ for (const h of holidays !== null && holidays !== void 0 ? holidays : []) {
46
46
  const d = parseDate(h);
47
47
  if (d) {
48
48
  set.add(toDateKey(d));
@@ -53,36 +53,30 @@ function buildHolidaySet(holidays) {
53
53
  // Calendars are passed once and reused by every calculation, so each is prepared once.
54
54
  const preparedCalendars = new WeakMap();
55
55
  function prepareCalendar(calendar) {
56
- var _calendar_weekendDays, _calendar_firstYear, _calendar_lastYear;
56
+ var _a, _b, _c;
57
57
  const cached = preparedCalendars.get(calendar);
58
58
  if (cached) {
59
59
  return cached;
60
60
  }
61
61
  const prepared = {
62
- weekendDays: new Set((_calendar_weekendDays = calendar.weekendDays) !== null && _calendar_weekendDays !== void 0 ? _calendar_weekendDays : DEFAULT_WEEKEND_DAYS),
62
+ weekendDays: new Set((_a = calendar.weekendDays) !== null && _a !== void 0 ? _a : DEFAULT_WEEKEND_DAYS),
63
63
  holidays: buildHolidaySet(calendar.holidays),
64
- firstYear: (_calendar_firstYear = calendar.firstYear) !== null && _calendar_firstYear !== void 0 ? _calendar_firstYear : null,
65
- lastYear: (_calendar_lastYear = calendar.lastYear) !== null && _calendar_lastYear !== void 0 ? _calendar_lastYear : null
64
+ firstYear: (_b = calendar.firstYear) !== null && _b !== void 0 ? _b : null,
65
+ lastYear: (_c = calendar.lastYear) !== null && _c !== void 0 ? _c : null,
66
66
  };
67
67
  preparedCalendars.set(calendar, prepared);
68
68
  return prepared;
69
69
  }
70
70
  // One calendar per holidays array, so the default calendar is also prepared once.
71
71
  const holidayCalendars = new WeakMap();
72
- const NO_HOLIDAYS_CALENDAR = {
73
- weekendDays: DEFAULT_WEEKEND_DAYS,
74
- holidays: []
75
- };
72
+ const NO_HOLIDAYS_CALENDAR = { weekendDays: DEFAULT_WEEKEND_DAYS, holidays: [] };
76
73
  function defaultCalendar(holidays) {
77
74
  if (!Array.isArray(holidays)) {
78
75
  return NO_HOLIDAYS_CALENDAR;
79
76
  }
80
77
  let calendar = holidayCalendars.get(holidays);
81
78
  if (!calendar) {
82
- calendar = {
83
- weekendDays: DEFAULT_WEEKEND_DAYS,
84
- holidays
85
- };
79
+ calendar = { weekendDays: DEFAULT_WEEKEND_DAYS, holidays };
86
80
  holidayCalendars.set(holidays, calendar);
87
81
  }
88
82
  return calendar;
@@ -92,20 +86,22 @@ function isBusinessDay(d, calendar) {
92
86
  }
93
87
  function isWithinYears(d, calendar) {
94
88
  const year = d.getUTCFullYear();
95
- return (calendar.firstYear === null || year >= calendar.firstYear) && (calendar.lastYear === null || year <= calendar.lastYear);
89
+ return ((calendar.firstYear === null || year >= calendar.firstYear) &&
90
+ (calendar.lastYear === null || year <= calendar.lastYear));
96
91
  }
97
92
  /**
98
93
  * Walks `days` business days from `start` (negative walks back); the start is not counted.
99
94
  * Mirrors `BusinessDayCalculator.AddBusinessDays` in DTE: null for more than MAX_DATE_CALC_DAYS,
100
95
  * or when the start or the walk leaves the calendar's years.
101
- */ function addBusinessDays(start, days, calendar) {
96
+ */
97
+ function addBusinessDays(start, days, calendar) {
102
98
  if (Math.abs(days) > MAX_DATE_CALC_DAYS || !isWithinYears(start, calendar)) {
103
99
  return null;
104
100
  }
105
101
  const direction = days >= 0 ? 1 : -1;
106
102
  let remaining = Math.abs(days);
107
103
  const current = new Date(start.getTime());
108
- while(remaining > 0){
104
+ while (remaining > 0) {
109
105
  current.setUTCDate(current.getUTCDate() + direction);
110
106
  if (!isWithinYears(current, calendar)) {
111
107
  return null;
@@ -120,15 +116,18 @@ function isWithinYears(d, calendar) {
120
116
  * Counts the business days from `from` to `to`, negative when `to` is earlier; the start is not
121
117
  * counted, the end is. Mirrors `BusinessDayCalculator.CountBusinessDays` in DTE: null for a span
122
118
  * over MAX_DATE_CALC_DAYS, or a date outside the calendar's years.
123
- */ function countBusinessDays(from, to, calendar) {
119
+ */
120
+ function countBusinessDays(from, to, calendar) {
124
121
  const span = Math.abs(to.getTime() - from.getTime()) / (24 * 60 * 60 * 1000);
125
- if (span > MAX_DATE_CALC_DAYS || !isWithinYears(from, calendar) || !isWithinYears(to, calendar)) {
122
+ if (span > MAX_DATE_CALC_DAYS ||
123
+ !isWithinYears(from, calendar) ||
124
+ !isWithinYears(to, calendar)) {
126
125
  return null;
127
126
  }
128
127
  const direction = to.getTime() >= from.getTime() ? 1 : -1;
129
128
  const cursor = new Date(from.getTime());
130
129
  let count = 0;
131
- while(toDateKey(cursor) !== toDateKey(to)){
130
+ while (toDateKey(cursor) !== toDateKey(to)) {
132
131
  cursor.setUTCDate(cursor.getUTCDate() + direction);
133
132
  if (isBusinessDay(cursor, calendar)) {
134
133
  count++;
@@ -140,17 +139,18 @@ function isWithinYears(d, calendar) {
140
139
  * Adds business days to a date, as DTE's noderenderer `dateAddDays` does. Returns the result as
141
140
  * `YYYY-MM-DD`, or null (a blank field, as in BYOD) for an invalid date, a fractional offset, or
142
141
  * a start or result outside the calendar's years.
143
- */ export function addDays(dateInput, daysInput, options) {
144
- var _ref;
142
+ */
143
+ export function addDays(dateInput, daysInput, options) {
144
+ var _a;
145
145
  const isDefault = !(options === null || options === void 0 ? void 0 : options.calendar);
146
- const calendar = prepareCalendar((_ref = options === null || options === void 0 ? void 0 : options.calendar) !== null && _ref !== void 0 ? _ref : defaultCalendar(options === null || options === void 0 ? void 0 : options.holidays));
146
+ const calendar = prepareCalendar((_a = options === null || options === void 0 ? void 0 : options.calendar) !== null && _a !== void 0 ? _a : defaultCalendar(options === null || options === void 0 ? void 0 : options.holidays));
147
147
  const start = parseDate(dateInput);
148
148
  const days = Number(daysInput);
149
- if (!start || !Number.isInteger(days) || isDefault && !isDateWithinRange(start)) {
149
+ if (!start || !Number.isInteger(days) || (isDefault && !isDateWithinRange(start))) {
150
150
  return null;
151
151
  }
152
152
  const result = addBusinessDays(start, days, calendar);
153
- if (!result || isDefault && !isDateWithinRange(result)) {
153
+ if (!result || (isDefault && !isDateWithinRange(result))) {
154
154
  return null;
155
155
  }
156
156
  return toDateKey(result);
@@ -159,9 +159,10 @@ function isWithinYears(d, calendar) {
159
159
  * Counts the business days from `from` to `to` (positive when `to` is later), as DTE's
160
160
  * noderenderer `dateDiffDays` does. A formula's `D1 - D2` counts from D2 to D1. Null (a blank
161
161
  * field) for an invalid or missing date, or a span over MAX_DATE_CALC_DAYS.
162
- */ export function dateDiffDays(fromInput, toInput, options) {
163
- var _ref;
164
- const calendar = prepareCalendar((_ref = options === null || options === void 0 ? void 0 : options.calendar) !== null && _ref !== void 0 ? _ref : defaultCalendar(options === null || options === void 0 ? void 0 : options.holidays));
162
+ */
163
+ export function dateDiffDays(fromInput, toInput, options) {
164
+ var _a;
165
+ const calendar = prepareCalendar((_a = options === null || options === void 0 ? void 0 : options.calendar) !== null && _a !== void 0 ? _a : defaultCalendar(options === null || options === void 0 ? void 0 : options.holidays));
165
166
  const from = parseDate(fromInput);
166
167
  const to = parseDate(toInput);
167
168
  if (!from || !to) {
@@ -182,7 +183,7 @@ const MONTH_NAMES_FULL = [
182
183
  'September',
183
184
  'October',
184
185
  'November',
185
- 'December'
186
+ 'December',
186
187
  ];
187
188
  const MONTH_NAMES_SHORT = [
188
189
  'Jan',
@@ -196,13 +197,14 @@ const MONTH_NAMES_SHORT = [
196
197
  'Sep',
197
198
  'Oct',
198
199
  'Nov',
199
- 'Dec'
200
+ 'Dec',
200
201
  ];
201
202
  /**
202
203
  * Format a Date using a pattern string.
203
204
  * Supported tokens: YYYY, YY, MMMM, MMM, MM, M, DD, D.
204
205
  * All other characters are treated as literals.
205
- */ export function formatDate(date, pattern) {
206
+ */
207
+ export function formatDate(date, pattern) {
206
208
  if (!isFinite(date.getTime())) {
207
209
  return '';
208
210
  }
@@ -210,7 +212,14 @@ const MONTH_NAMES_SHORT = [
210
212
  const year = date.getUTCFullYear();
211
213
  const month = date.getUTCMonth();
212
214
  const day = date.getUTCDate();
213
- return fmt.replace(/YYYY/g, String(year)).replace(/YY/g, String(year).slice(-2)).replace(/MMMM/g, MONTH_NAMES_FULL[month]).replace(/MMM/g, MONTH_NAMES_SHORT[month]).replace(/MM/g, String(month + 1).padStart(2, '0')).replace(/\bM\b/g, String(month + 1)).replace(/DD/g, String(day).padStart(2, '0')).replace(/\bD\b/g, String(day));
215
+ return fmt
216
+ .replace(/YYYY/g, String(year))
217
+ .replace(/YY/g, String(year).slice(-2))
218
+ .replace(/MMMM/g, MONTH_NAMES_FULL[month])
219
+ .replace(/MMM/g, MONTH_NAMES_SHORT[month])
220
+ .replace(/MM/g, String(month + 1).padStart(2, '0'))
221
+ .replace(/\bM\b/g, String(month + 1))
222
+ .replace(/DD/g, String(day).padStart(2, '0'))
223
+ .replace(/\bD\b/g, String(day));
214
224
  }
215
-
216
225
  //# sourceMappingURL=date-calc.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/date-calc.ts"],"sourcesContent":["export const MAX_DATE_CALC_DAYS = 365;\n\n/**\n * The years DTE knows holidays for (`HolidayCheckService.HolidayYearsWindow`): outside them a\n * default-calendar answer would skip weekends but miss holidays, so it is left blank, as in BYOD.\n */\nexport const DATE_RANGE_YEARS = 1;\n\n/**\n * Returns true if the date's year falls within [currentYear - DATE_RANGE_YEARS, currentYear + DATE_RANGE_YEARS].\n * Invalid or unparseable dates return false.\n */\nexport function isDateWithinRange(dateInput: unknown): boolean {\n if (typeof dateInput !== 'string' && !(dateInput instanceof Date)) {\n return false;\n }\n const d = typeof dateInput === 'string' ? new Date(dateInput) : dateInput;\n if (!isFinite(d.getTime())) {\n return false;\n }\n const currentYear = new Date().getUTCFullYear();\n const year = d.getUTCFullYear();\n return year >= currentYear - DATE_RANGE_YEARS && year <= currentYear + DATE_RANGE_YEARS;\n}\n\n/**\n * Days a date calculation skips, as DTE resolves them (`POST api/holidays/calendar`, and the\n * `calendars` noderenderer receives). Arithmetic outside `firstYear`–`lastYear` is blank; without\n * years no year limit applies.\n */\nexport interface BusinessCalendar {\n /** Excluded weekend days, as `Date.getUTCDay()` numbers them: 0 = Sunday, 6 = Saturday. */\n weekendDays: number[];\n /** Holiday dates, already moved to their observed days, as `YYYY-MM-DD`. */\n holidays: string[];\n firstYear?: number | null;\n lastYear?: number | null;\n}\n\n/** Saturday and Sunday: the default calendar's weekend. */\nexport const DEFAULT_WEEKEND_DAYS = [0, 6];\n\n/**\n * Which calendar a calculation uses. With `calendar` (a field bound to a schedule) only that\n * calendar applies. Without it, the default calendar applies: Saturday and Sunday plus `holidays`,\n * with the start and the result limited to the current year ± DATE_RANGE_YEARS.\n */\nexport interface DateCalcOptions {\n calendar?: BusinessCalendar;\n holidays?: string[];\n}\n\ninterface PreparedCalendar {\n weekendDays: Set<number>;\n holidays: Set<string>;\n firstYear: number | null;\n lastYear: number | null;\n}\n\nfunction toDateOnly(input: string | Date): Date {\n const d = typeof input === 'string' ? new Date(input) : new Date(input.getTime());\n d.setUTCHours(0, 0, 0, 0);\n return d;\n}\n\nfunction toDateKey(d: Date): string {\n const y = d.getUTCFullYear();\n const m = String(d.getUTCMonth() + 1).padStart(2, '0');\n const day = String(d.getUTCDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\nfunction parseDate(input: unknown): Date | null {\n if (typeof input !== 'string' && !(input instanceof Date)) {\n return null;\n }\n const d = toDateOnly(input);\n return isFinite(d.getTime()) ? d : null;\n}\n\nfunction buildHolidaySet(holidays?: string[]): Set<string> {\n const set = new Set<string>();\n for (const h of holidays ?? []) {\n const d = parseDate(h);\n if (d) {\n set.add(toDateKey(d));\n }\n }\n return set;\n}\n\n// Calendars are passed once and reused by every calculation, so each is prepared once.\nconst preparedCalendars = new WeakMap<BusinessCalendar, PreparedCalendar>();\n\nfunction prepareCalendar(calendar: BusinessCalendar): PreparedCalendar {\n const cached = preparedCalendars.get(calendar);\n if (cached) {\n return cached;\n }\n\n const prepared: PreparedCalendar = {\n weekendDays: new Set(calendar.weekendDays ?? DEFAULT_WEEKEND_DAYS),\n holidays: buildHolidaySet(calendar.holidays),\n firstYear: calendar.firstYear ?? null,\n lastYear: calendar.lastYear ?? null,\n };\n preparedCalendars.set(calendar, prepared);\n return prepared;\n}\n\n// One calendar per holidays array, so the default calendar is also prepared once.\nconst holidayCalendars = new WeakMap<string[], BusinessCalendar>();\nconst NO_HOLIDAYS_CALENDAR: BusinessCalendar = { weekendDays: DEFAULT_WEEKEND_DAYS, holidays: [] };\n\nfunction defaultCalendar(holidays?: string[]): BusinessCalendar {\n if (!Array.isArray(holidays)) {\n return NO_HOLIDAYS_CALENDAR;\n }\n let calendar = holidayCalendars.get(holidays);\n if (!calendar) {\n calendar = { weekendDays: DEFAULT_WEEKEND_DAYS, holidays };\n holidayCalendars.set(holidays, calendar);\n }\n return calendar;\n}\n\nfunction isBusinessDay(d: Date, calendar: PreparedCalendar): boolean {\n return !calendar.weekendDays.has(d.getUTCDay()) && !calendar.holidays.has(toDateKey(d));\n}\n\nfunction isWithinYears(d: Date, calendar: PreparedCalendar): boolean {\n const year = d.getUTCFullYear();\n return (\n (calendar.firstYear === null || year >= calendar.firstYear) &&\n (calendar.lastYear === null || year <= calendar.lastYear)\n );\n}\n\n/**\n * Walks `days` business days from `start` (negative walks back); the start is not counted.\n * Mirrors `BusinessDayCalculator.AddBusinessDays` in DTE: null for more than MAX_DATE_CALC_DAYS,\n * or when the start or the walk leaves the calendar's years.\n */\nfunction addBusinessDays(start: Date, days: number, calendar: PreparedCalendar): Date | null {\n if (Math.abs(days) > MAX_DATE_CALC_DAYS || !isWithinYears(start, calendar)) {\n return null;\n }\n\n const direction = days >= 0 ? 1 : -1;\n let remaining = Math.abs(days);\n const current = new Date(start.getTime());\n\n while (remaining > 0) {\n current.setUTCDate(current.getUTCDate() + direction);\n if (!isWithinYears(current, calendar)) {\n return null;\n }\n if (isBusinessDay(current, calendar)) {\n remaining--;\n }\n }\n\n return current;\n}\n\n/**\n * Counts the business days from `from` to `to`, negative when `to` is earlier; the start is not\n * counted, the end is. Mirrors `BusinessDayCalculator.CountBusinessDays` in DTE: null for a span\n * over MAX_DATE_CALC_DAYS, or a date outside the calendar's years.\n */\nfunction countBusinessDays(from: Date, to: Date, calendar: PreparedCalendar): number | null {\n const span = Math.abs(to.getTime() - from.getTime()) / (24 * 60 * 60 * 1000);\n if (\n span > MAX_DATE_CALC_DAYS ||\n !isWithinYears(from, calendar) ||\n !isWithinYears(to, calendar)\n ) {\n return null;\n }\n\n const direction = to.getTime() >= from.getTime() ? 1 : -1;\n const cursor = new Date(from.getTime());\n let count = 0;\n\n while (toDateKey(cursor) !== toDateKey(to)) {\n cursor.setUTCDate(cursor.getUTCDate() + direction);\n if (isBusinessDay(cursor, calendar)) {\n count++;\n }\n }\n\n return count * direction;\n}\n\n/**\n * Adds business days to a date, as DTE's noderenderer `dateAddDays` does. Returns the result as\n * `YYYY-MM-DD`, or null (a blank field, as in BYOD) for an invalid date, a fractional offset, or\n * a start or result outside the calendar's years.\n */\nexport function addDays(\n dateInput: unknown,\n daysInput: unknown,\n options?: DateCalcOptions,\n): string | null {\n const isDefault = !options?.calendar;\n const calendar = prepareCalendar(options?.calendar ?? defaultCalendar(options?.holidays));\n const start = parseDate(dateInput);\n const days = Number(daysInput);\n if (!start || !Number.isInteger(days) || (isDefault && !isDateWithinRange(start))) {\n return null;\n }\n const result = addBusinessDays(start, days, calendar);\n if (!result || (isDefault && !isDateWithinRange(result))) {\n return null;\n }\n return toDateKey(result);\n}\n\n/**\n * Counts the business days from `from` to `to` (positive when `to` is later), as DTE's\n * noderenderer `dateDiffDays` does. A formula's `D1 - D2` counts from D2 to D1. Null (a blank\n * field) for an invalid or missing date, or a span over MAX_DATE_CALC_DAYS.\n */\nexport function dateDiffDays(\n fromInput: unknown,\n toInput: unknown,\n options?: DateCalcOptions,\n): number | null {\n const calendar = prepareCalendar(options?.calendar ?? defaultCalendar(options?.holidays));\n const from = parseDate(fromInput);\n const to = parseDate(toInput);\n if (!from || !to) {\n return null;\n }\n return countBusinessDays(from, to, calendar);\n}\n\nexport const DEFAULT_DATE_FORMAT = 'MM/DD/YYYY';\n\nconst MONTH_NAMES_FULL = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nconst MONTH_NAMES_SHORT = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n\n/**\n * Format a Date using a pattern string.\n * Supported tokens: YYYY, YY, MMMM, MMM, MM, M, DD, D.\n * All other characters are treated as literals.\n */\nexport function formatDate(date: Date, pattern?: string): string {\n if (!isFinite(date.getTime())) {\n return '';\n }\n const fmt = pattern ?? DEFAULT_DATE_FORMAT;\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const day = date.getUTCDate();\n\n return fmt\n .replace(/YYYY/g, String(year))\n .replace(/YY/g, String(year).slice(-2))\n .replace(/MMMM/g, MONTH_NAMES_FULL[month])\n .replace(/MMM/g, MONTH_NAMES_SHORT[month])\n .replace(/MM/g, String(month + 1).padStart(2, '0'))\n .replace(/\\bM\\b/g, String(month + 1))\n .replace(/DD/g, String(day).padStart(2, '0'))\n .replace(/\\bD\\b/g, String(day));\n}\n"],"names":["MAX_DATE_CALC_DAYS","DATE_RANGE_YEARS","isDateWithinRange","dateInput","Date","d","isFinite","getTime","currentYear","getUTCFullYear","year","DEFAULT_WEEKEND_DAYS","toDateOnly","input","setUTCHours","toDateKey","y","m","String","getUTCMonth","padStart","day","getUTCDate","parseDate","buildHolidaySet","holidays","set","Set","h","add","preparedCalendars","WeakMap","prepareCalendar","calendar","cached","get","prepared","weekendDays","firstYear","lastYear","holidayCalendars","NO_HOLIDAYS_CALENDAR","defaultCalendar","Array","isArray","isBusinessDay","has","getUTCDay","isWithinYears","addBusinessDays","start","days","Math","abs","direction","remaining","current","setUTCDate","countBusinessDays","from","to","span","cursor","count","addDays","daysInput","options","isDefault","Number","isInteger","result","dateDiffDays","fromInput","toInput","DEFAULT_DATE_FORMAT","MONTH_NAMES_FULL","MONTH_NAMES_SHORT","formatDate","date","pattern","fmt","month","replace","slice"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,IAAI;AAEtC;;;CAGC,GACD,OAAO,MAAMC,mBAAmB,EAAE;AAElC;;;CAGC,GACD,OAAO,SAASC,kBAAkBC,SAAkB;IAChD,IAAI,OAAOA,cAAc,YAAY,CAAEA,CAAAA,qBAAqBC,IAAG,GAAI;QAC/D,OAAO;IACX;IACA,MAAMC,IAAI,OAAOF,cAAc,WAAW,IAAIC,KAAKD,aAAaA;IAChE,IAAI,CAACG,SAASD,EAAEE,OAAO,KAAK;QACxB,OAAO;IACX;IACA,MAAMC,cAAc,IAAIJ,OAAOK,cAAc;IAC7C,MAAMC,OAAOL,EAAEI,cAAc;IAC7B,OAAOC,QAAQF,cAAcP,oBAAoBS,QAAQF,cAAcP;AAC3E;AAgBA,yDAAyD,GACzD,OAAO,MAAMU,uBAAuB;IAAC;IAAG;CAAE,CAAC;AAmB3C,SAASC,WAAWC,KAAoB;IACpC,MAAMR,IAAI,OAAOQ,UAAU,WAAW,IAAIT,KAAKS,SAAS,IAAIT,KAAKS,MAAMN,OAAO;IAC9EF,EAAES,WAAW,CAAC,GAAG,GAAG,GAAG;IACvB,OAAOT;AACX;AAEA,SAASU,UAAUV,CAAO;IACtB,MAAMW,IAAIX,EAAEI,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C,CAAC;SACpC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC5C,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { defaultGroup } from '../display-conditions/constants';
2
- import { CONDITION_OPERATORS, VALUE_LESS_OPERATORS } from '../display-conditions/types';
3
- import { MAX_E_SIGN_OFFSET_DAYS, MAX_E_SIGN_OFFSET_RULES } from './const';
2
+ import { CONDITION_OPERATORS, VALUE_LESS_OPERATORS, } from '../display-conditions/types';
3
+ import { MAX_E_SIGN_OFFSET_DAYS, MAX_E_SIGN_OFFSET_RULES, } from './const';
4
4
  const NUMERIC_VALUE_RE = /^-?(?:\d+\.?\d*|\.\d+)$/;
5
5
  function isRecord(value) {
6
6
  return typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -11,52 +11,32 @@ function isConditionState(value) {
11
11
  function isConditionedRule(rule) {
12
12
  return rule.condition !== undefined;
13
13
  }
14
- export const clampESignOffsetDays = (days)=>{
14
+ export const clampESignOffsetDays = (days) => {
15
15
  if (typeof days !== 'number' || !Number.isFinite(days)) {
16
16
  return 0;
17
17
  }
18
18
  return Math.max(Math.min(MAX_E_SIGN_OFFSET_DAYS, Math.trunc(days)), 0);
19
19
  };
20
- export const createESignOffsetSettings = (days = 0)=>{
21
- return {
22
- rules: [
23
- {
24
- days: clampESignOffsetDays(days)
25
- }
26
- ]
27
- };
20
+ export const createESignOffsetSettings = (days = 0) => {
21
+ return { rules: [{ days: clampESignOffsetDays(days) }] };
28
22
  };
29
- export const createESignOffsetRule = ()=>{
30
- return {
31
- condition: {
32
- behavior: 'show',
33
- groups: [
34
- defaultGroup()
35
- ]
36
- },
37
- days: 0
38
- };
23
+ export const createESignOffsetRule = () => {
24
+ return { condition: { behavior: 'show', groups: [defaultGroup()] }, days: 0 };
39
25
  };
40
- export const buildESignOffsetSettings = (conditionedRules, finalDays)=>{
26
+ export const buildESignOffsetSettings = (conditionedRules, finalDays) => {
41
27
  return {
42
28
  rules: [
43
- ...conditionedRules.map((rule)=>({
44
- ...rule,
45
- days: clampESignOffsetDays(rule.days)
46
- })),
47
- {
48
- days: clampESignOffsetDays(finalDays)
49
- }
50
- ]
29
+ ...conditionedRules.map(rule => ({ ...rule, days: clampESignOffsetDays(rule.days) })),
30
+ { days: clampESignOffsetDays(finalDays) },
31
+ ],
51
32
  };
52
33
  };
53
- export const splitESignOffsetSettings = (settings)=>{
54
- var _ref;
55
- var _rules_;
34
+ export const splitESignOffsetSettings = (settings) => {
35
+ var _a, _b;
56
36
  const rules = settings.rules;
57
37
  return {
58
38
  conditionedRules: rules.filter(isConditionedRule),
59
- finalDays: (_ref = (_rules_ = rules[rules.length - 1]) === null || _rules_ === void 0 ? void 0 : _rules_.days) !== null && _ref !== void 0 ? _ref : 0
39
+ finalDays: (_b = (_a = rules[rules.length - 1]) === null || _a === void 0 ? void 0 : _a.days) !== null && _b !== void 0 ? _b : 0,
60
40
  };
61
41
  };
62
42
  export function isESignOffsetSettings(value) {
@@ -67,14 +47,17 @@ export function isESignOffsetSettings(value) {
67
47
  if (rules.length === 0 || rules.length > MAX_E_SIGN_OFFSET_RULES) {
68
48
  return false;
69
49
  }
70
- return rules.every((rule, index)=>{
50
+ return rules.every((rule, index) => {
71
51
  if (!isRecord(rule) || clampESignOffsetDays(rule.days) !== rule.days) {
72
52
  return false;
73
53
  }
74
- return index === rules.length - 1 ? rule.condition === undefined : isConditionState(rule.condition);
54
+ return index === rules.length - 1
55
+ ? rule.condition === undefined
56
+ : isConditionState(rule.condition);
75
57
  });
76
58
  }
77
- /** Coerces whatever is stored on the tool (missing, legacy or hand-edited) into a valid chain. */ export const normalizeESignOffsetSettings = (value)=>{
59
+ /** Coerces whatever is stored on the tool (missing, legacy or hand-edited) into a valid chain. */
60
+ export const normalizeESignOffsetSettings = (value) => {
78
61
  if (isESignOffsetSettings(value)) {
79
62
  return value;
80
63
  }
@@ -83,34 +66,31 @@ export function isESignOffsetSettings(value) {
83
66
  }
84
67
  const rules = value.rules;
85
68
  const lastRule = rules[rules.length - 1];
86
- const conditionedRules = rules.slice(0, -1).flatMap((rule)=>isRecord(rule) && isConditionState(rule.condition) ? [
87
- {
88
- condition: rule.condition,
89
- days: clampESignOffsetDays(rule.days)
90
- }
91
- ] : []).slice(0, MAX_E_SIGN_OFFSET_RULES - 1);
69
+ const conditionedRules = rules
70
+ .slice(0, -1)
71
+ .flatMap(rule => isRecord(rule) && isConditionState(rule.condition)
72
+ ? [{ condition: rule.condition, days: clampESignOffsetDays(rule.days) }]
73
+ : [])
74
+ .slice(0, MAX_E_SIGN_OFFSET_RULES - 1);
92
75
  return buildESignOffsetSettings(conditionedRules, isRecord(lastRule) ? clampESignOffsetDays(lastRule.days) : 0);
93
76
  };
94
- export const canAddESignOffsetRule = (rules)=>{
77
+ export const canAddESignOffsetRule = (rules) => {
95
78
  return rules.length < MAX_E_SIGN_OFFSET_RULES - 1;
96
79
  };
97
- export const addESignOffsetRule = (rules)=>{
98
- return canAddESignOffsetRule(rules) ? [
99
- ...rules,
100
- createESignOffsetRule()
101
- ] : rules;
80
+ export const addESignOffsetRule = (rules) => {
81
+ return canAddESignOffsetRule(rules) ? [...rules, createESignOffsetRule()] : rules;
102
82
  };
103
- export const updateESignOffsetRule = (rules, index, nextRule)=>{
104
- return rules.map((rule, ruleIndex)=>ruleIndex === index ? nextRule : rule);
83
+ export const updateESignOffsetRule = (rules, index, nextRule) => {
84
+ return rules.map((rule, ruleIndex) => (ruleIndex === index ? nextRule : rule));
105
85
  };
106
- export const removeESignOffsetRule = (rules, index)=>{
107
- return rules.filter((_, ruleIndex)=>ruleIndex !== index);
86
+ export const removeESignOffsetRule = (rules, index) => {
87
+ return rules.filter((_, ruleIndex) => ruleIndex !== index);
108
88
  };
109
- export const getESignOffsetRuleCondition = (rule)=>{
110
- var _rule_condition_groups_;
111
- return (_rule_condition_groups_ = rule.condition.groups[0]) === null || _rule_condition_groups_ === void 0 ? void 0 : _rule_condition_groups_.conditions[0];
89
+ export const getESignOffsetRuleCondition = (rule) => {
90
+ var _a;
91
+ return (_a = rule.condition.groups[0]) === null || _a === void 0 ? void 0 : _a.conditions[0];
112
92
  };
113
- export const isCompleteESignOffsetCondition = (condition, fieldType)=>{
93
+ export const isCompleteESignOffsetCondition = (condition, fieldType) => {
114
94
  if (!(condition === null || condition === void 0 ? void 0 : condition.dataPointKey)) {
115
95
  return false;
116
96
  }
@@ -120,11 +100,14 @@ export const isCompleteESignOffsetCondition = (condition, fieldType)=>{
120
100
  const value = condition.value.trim();
121
101
  return value !== '' && (fieldType !== 'number' || NUMERIC_VALUE_RE.test(value));
122
102
  };
123
- export const getESignOffsetConditionText = (condition, dataPointTitle)=>{
124
- var _ref;
125
- var _CONDITION_OPERATORS_find;
126
- const operatorLabel = ((_ref = (_CONDITION_OPERATORS_find = CONDITION_OPERATORS.find((operator)=>operator.value === condition.operator)) === null || _CONDITION_OPERATORS_find === void 0 ? void 0 : _CONDITION_OPERATORS_find.label) !== null && _ref !== void 0 ? _ref : condition.operator).split(' (')[0].replace('==', '=').toLowerCase();
127
- return VALUE_LESS_OPERATORS.includes(condition.operator) ? `${dataPointTitle} ${operatorLabel}` : `${dataPointTitle} ${operatorLabel} ${condition.value}`;
103
+ export const getESignOffsetConditionText = (condition, dataPointTitle) => {
104
+ var _a, _b;
105
+ const operatorLabel = ((_b = (_a = CONDITION_OPERATORS.find(operator => operator.value === condition.operator)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : condition.operator)
106
+ .split(' (')[0]
107
+ .replace('==', '=')
108
+ .toLowerCase();
109
+ return VALUE_LESS_OPERATORS.includes(condition.operator)
110
+ ? `${dataPointTitle} ${operatorLabel}`
111
+ : `${dataPointTitle} ${operatorLabel} ${condition.value}`;
128
112
  };
129
-
130
113
  //# sourceMappingURL=e-sign-offset.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/e-sign-offset.ts"],"sourcesContent":["import { defaultGroup } from '../display-conditions/constants';\nimport {\n CONDITION_OPERATORS,\n type DataPointOption,\n type DisplayConditionState,\n type SingleCondition,\n VALUE_LESS_OPERATORS,\n} from '../display-conditions/types';\nimport {\n type ESignDateSignedOffsetFinalRule,\n type ESignDateSignedOffsetRule,\n type ESignDateSignedOffsetSettings,\n MAX_E_SIGN_OFFSET_DAYS,\n MAX_E_SIGN_OFFSET_RULES,\n} from './const';\n\nconst NUMERIC_VALUE_RE = /^-?(?:\\d+\\.?\\d*|\\.\\d+)$/;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isConditionState(value: unknown): value is DisplayConditionState {\n return isRecord(value) && Array.isArray(value.groups) && value.groups.length > 0;\n}\n\nfunction isConditionedRule(\n rule: ESignDateSignedOffsetRule | ESignDateSignedOffsetFinalRule,\n): rule is ESignDateSignedOffsetRule {\n return rule.condition !== undefined;\n}\n\nexport const clampESignOffsetDays = (days: unknown) => {\n if (typeof days !== 'number' || !Number.isFinite(days)) {\n return 0;\n }\n\n return Math.max(Math.min(MAX_E_SIGN_OFFSET_DAYS, Math.trunc(days)), 0);\n};\n\nexport const createESignOffsetSettings = (days = 0): ESignDateSignedOffsetSettings => {\n return { rules: [{ days: clampESignOffsetDays(days) }] };\n};\n\nexport const createESignOffsetRule = (): ESignDateSignedOffsetRule => {\n return { condition: { behavior: 'show', groups: [defaultGroup()] }, days: 0 };\n};\n\nexport const buildESignOffsetSettings = (\n conditionedRules: ESignDateSignedOffsetRule[],\n finalDays: number,\n): ESignDateSignedOffsetSettings => {\n return {\n rules: [\n ...conditionedRules.map(rule => ({ ...rule, days: clampESignOffsetDays(rule.days) })),\n { days: clampESignOffsetDays(finalDays) },\n ],\n };\n};\n\nexport const splitESignOffsetSettings = (settings: ESignDateSignedOffsetSettings) => {\n const rules: readonly (ESignDateSignedOffsetRule | ESignDateSignedOffsetFinalRule)[] =\n settings.rules;\n\n return {\n conditionedRules: rules.filter(isConditionedRule),\n finalDays: rules[rules.length - 1]?.days ?? 0,\n };\n};\n\nexport function isESignOffsetSettings(value: unknown): value is ESignDateSignedOffsetSettings {\n if (!isRecord(value) || !Array.isArray(value.rules)) {\n return false;\n }\n\n const rules: unknown[] = value.rules;\n\n if (rules.length === 0 || rules.length > MAX_E_SIGN_OFFSET_RULES) {\n return false;\n }\n\n return rules.every((rule, index) => {\n if (!isRecord(rule) || clampESignOffsetDays(rule.days) !== rule.days) {\n return false;\n }\n\n return index === rules.length - 1\n ? rule.condition === undefined\n : isConditionState(rule.condition);\n });\n}\n\n/** Coerces whatever is stored on the tool (missing, legacy or hand-edited) into a valid chain. */\nexport const normalizeESignOffsetSettings = (value: unknown): ESignDateSignedOffsetSettings => {\n if (isESignOffsetSettings(value)) {\n return value;\n }\n\n if (!isRecord(value) || !Array.isArray(value.rules)) {\n return createESignOffsetSettings();\n }\n\n const rules: unknown[] = value.rules;\n const lastRule = rules[rules.length - 1];\n const conditionedRules = rules\n .slice(0, -1)\n .flatMap(rule =>\n isRecord(rule) && isConditionState(rule.condition)\n ? [{ condition: rule.condition, days: clampESignOffsetDays(rule.days) }]\n : [],\n )\n .slice(0, MAX_E_SIGN_OFFSET_RULES - 1);\n\n return buildESignOffsetSettings(\n conditionedRules,\n isRecord(lastRule) ? clampESignOffsetDays(lastRule.days) : 0,\n );\n};\n\nexport const canAddESignOffsetRule = (rules: ESignDateSignedOffsetRule[]) => {\n return rules.length < MAX_E_SIGN_OFFSET_RULES - 1;\n};\n\nexport const addESignOffsetRule = (rules: ESignDateSignedOffsetRule[]) => {\n return canAddESignOffsetRule(rules) ? [...rules, createESignOffsetRule()] : rules;\n};\n\nexport const updateESignOffsetRule = (\n rules: ESignDateSignedOffsetRule[],\n index: number,\n nextRule: ESignDateSignedOffsetRule,\n) => {\n return rules.map((rule, ruleIndex) => (ruleIndex === index ? nextRule : rule));\n};\n\nexport const removeESignOffsetRule = (rules: ESignDateSignedOffsetRule[], index: number) => {\n return rules.filter((_, ruleIndex) => ruleIndex !== index);\n};\n\nexport const getESignOffsetRuleCondition = (rule: ESignDateSignedOffsetRule) => {\n return rule.condition.groups[0]?.conditions[0];\n};\n\nexport const isCompleteESignOffsetCondition = (\n condition: SingleCondition | undefined,\n fieldType: DataPointOption['fieldType'],\n) => {\n if (!condition?.dataPointKey) {\n return false;\n }\n\n if (VALUE_LESS_OPERATORS.includes(condition.operator)) {\n return true;\n }\n\n const value = condition.value.trim();\n\n return value !== '' && (fieldType !== 'number' || NUMERIC_VALUE_RE.test(value));\n};\n\nexport const getESignOffsetConditionText = (condition: SingleCondition, dataPointTitle: string) => {\n const operatorLabel = (\n CONDITION_OPERATORS.find(operator => operator.value === condition.operator)?.label ??\n condition.operator\n )\n .split(' (')[0]\n .replace('==', '=')\n .toLowerCase();\n\n return VALUE_LESS_OPERATORS.includes(condition.operator)\n ? `${dataPointTitle} ${operatorLabel}`\n : `${dataPointTitle} ${operatorLabel} ${condition.value}`;\n};\n"],"names":["defaultGroup","CONDITION_OPERATORS","VALUE_LESS_OPERATORS","MAX_E_SIGN_OFFSET_DAYS","MAX_E_SIGN_OFFSET_RULES","NUMERIC_VALUE_RE","isRecord","value","Array","isArray","isConditionState","groups","length","isConditionedRule","rule","condition","undefined","clampESignOffsetDays","days","Number","isFinite","Math","max","min","trunc","createESignOffsetSettings","rules","createESignOffsetRule","behavior","buildESignOffsetSettings","conditionedRules","finalDays","map","splitESignOffsetSettings","settings","filter","isESignOffsetSettings","every","index","normalizeESignOffsetSettings","lastRule","slice","flatMap","canAddESignOffsetRule","addESignOffsetRule","updateESignOffsetRule","nextRule","ruleIndex","removeESignOffsetRule","_","getESignOffsetRuleCondition","conditions","isCompleteESignOffsetCondition","fieldType","dataPointKey","includes","operator","trim","test","getESignOffsetConditionText","dataPointTitle","operatorLabel","find","label","split","replace","toLowerCase"],"mappings":"AAAA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AE,KAAK,mCAClF,SAAS,CAAC,QAAQ,CACrB;SACI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACd,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,WAAW,EAAE,CAAC;IAEnB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QACpD,CAAC,CAAC,GAAG,cAAc,IAAI,aAAa,EAAE;QACtC,CAAC,CAAC,GAAG,cAAc,IAAI,aAAa,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;AAClE,CAAC,CAAC"}
@@ -10,5 +10,4 @@ export const editIconSvg = `
10
10
  </defs>
11
11
  </svg>
12
12
  `;
13
-
14
13
  //# sourceMappingURL=edit-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/edit-icon.ts"],"sourcesContent":["export const editIconSvg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\">\n <g clip-path=\"url(#clip0_2941_4625)\">\n <path d=\"M4 23V28H9L23.7533 13.2467L18.7533 8.24667L4 23ZM27.6067 9.39333C28.1267 8.87333 28.1267 8.02667 27.6067 7.50667L24.4933 4.39333C23.9733 3.87333 23.1267 3.87333 22.6067 4.39333L20.1667 6.83333L25.1667 11.8333L27.6067 9.39333Z\" fill=\"#606162\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_2941_4625\">\n <rect width=\"32\" height=\"32\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n`;\n"],"names":["editIconSvg"],"mappings":"AAAA,OAAO,MAAMA,cAAc,CAAC;;;;;;;;;;;AAW5B,CAAC,CAAC"}
1
+ {"version":3,"file":"edit-icon.js","sourceRoot":"","sources":["../../src/shared/edit-icon.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;CAW1B,CAAC"}