@servicetitan/dte-pdf-editor 1.96.0 → 1.96.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -7
- package/dist/components/field-config-panel/advanced-settings.d.ts +1 -1
- package/dist/components/field-config-panel/advanced-settings.js +1 -1
- package/dist/components/field-config-panel/e-sign-options-modal.d.ts +1 -1
- package/dist/components/field-config-panel/e-sign-options-modal.js +1 -1
- package/dist/components/field-config-panel/field-config-panel-overlay.d.ts.map +1 -1
- package/dist/components/field-config-panel/field-config-panel-overlay.js +23 -15
- package/dist/components/field-config-panel/field-config-panel-overlay.js.map +1 -1
- package/dist/components/field-config-panel/field-config-panel.d.ts +1 -1
- package/dist/components/field-config-panel/formula-generator.d.ts +1 -1
- package/dist/components/field-config-panel/formula-modal.d.ts +1 -1
- package/dist/components/field-config-panel/formula-workspace.d.ts +1 -1
- package/dist/components/pdf-editor/pdf-editor.d.ts +6 -1
- package/dist/components/pdf-editor/pdf-editor.d.ts.map +1 -1
- package/dist/components/pdf-editor/pdf-editor.js.map +1 -1
- package/dist/interface/types.d.ts +1 -1
- package/dist/vendor/dte-shared/business-calendar-validation.utils.d.ts +22 -0
- package/dist/vendor/dte-shared/business-calendar-validation.utils.js +76 -0
- package/dist/vendor/dte-shared/components/business-calendar-section.d.ts +15 -0
- package/dist/vendor/dte-shared/components/business-calendar-section.js +13 -0
- package/dist/vendor/dte-shared/components/schedule-drawer.d.ts +16 -0
- package/dist/vendor/dte-shared/components/schedule-drawer.js +112 -0
- package/dist/vendor/dte-shared/components/schedule-picker.d.ts +8 -0
- package/dist/vendor/dte-shared/components/schedule-picker.js +88 -0
- package/dist/vendor/dte-shared/constants.d.ts +10 -0
- package/dist/vendor/dte-shared/constants.js +10 -0
- package/dist/vendor/dte-shared/index.d.ts +6 -0
- package/dist/vendor/dte-shared/index.js +5 -0
- package/dist/vendor/dte-shared/styles/schedule.css +19 -0
- package/dist/vendor/dte-shared/types.d.ts +67 -0
- package/dist/vendor/dte-shared/types.js +1 -0
- package/package.json +5 -3
- package/src/components/field-config-panel/__tests__/field-config-panel-overlay.test.tsx +184 -0
- package/src/components/field-config-panel/__tests__/schedule-switch-visibility.test.tsx +206 -0
- package/src/components/field-config-panel/field-config-panel-overlay.tsx +25 -16
- package/src/components/pdf-editor/pdf-editor.tsx +6 -1
|
@@ -106,23 +106,32 @@ export const FieldConfigPanelOverlay: FC<FieldConfigPanelOverlayProps> = ({
|
|
|
106
106
|
[scheduleBindings, selectedFieldId, onScheduleBindingsChange],
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
/*
|
|
110
|
+
* The schedule UI (the Formula Builder's switch and the e-sign day offset's schedule) is offered
|
|
111
|
+
* only to a host that passes `onScheduleBindingsChange`. Without it there is no context, and
|
|
112
|
+
* everything that renders the schedule UI checks for one.
|
|
113
|
+
*/
|
|
114
|
+
const businessCalendar: ScheduleEditorContext | undefined = useMemo(
|
|
115
|
+
() =>
|
|
116
|
+
onScheduleBindingsChange
|
|
117
|
+
? {
|
|
118
|
+
enabled: !!selectedBinding,
|
|
119
|
+
selectedScheduleId: selectedBinding?.scheduleId,
|
|
120
|
+
onToggle: handleToggle,
|
|
121
|
+
onSelectSchedule: handleSelectSchedule,
|
|
122
|
+
holidayCatalog,
|
|
123
|
+
holidayCatalogLoading,
|
|
124
|
+
holidayCatalogError,
|
|
125
|
+
schedules,
|
|
126
|
+
schedulesLoading,
|
|
127
|
+
schedulesError,
|
|
128
|
+
onCreateSchedule,
|
|
129
|
+
onUpdateSchedule,
|
|
130
|
+
onDeleteSchedule,
|
|
131
|
+
}
|
|
132
|
+
: undefined,
|
|
125
133
|
[
|
|
134
|
+
onScheduleBindingsChange,
|
|
126
135
|
selectedBinding,
|
|
127
136
|
handleToggle,
|
|
128
137
|
handleSelectSchedule,
|
|
@@ -46,7 +46,7 @@ export interface PdfEditorProps {
|
|
|
46
46
|
/**
|
|
47
47
|
* Date calculated fields whose custom business-day exclusion toggle is on, and the schedule
|
|
48
48
|
* each uses (`PdfField.id` as `fieldKey`), as `PdfView`'s. Also drives the Formula Builder's
|
|
49
|
-
* toggle/picker for the selected field
|
|
49
|
+
* toggle/picker for the selected field, which are shown only with `onScheduleBindingsChange`.
|
|
50
50
|
*/
|
|
51
51
|
scheduleBindings?: FieldScheduleBinding[];
|
|
52
52
|
/** The tenant's known holidays, for the schedule editor's checklist. */
|
|
@@ -67,6 +67,11 @@ export interface PdfEditorProps {
|
|
|
67
67
|
* `PUT api/holidays/templates/{id}/bindings`). `PdfEditor` does not persist this itself —
|
|
68
68
|
* the host is expected to save it (and the bindings are typically saved separately from the
|
|
69
69
|
* template's own fields).
|
|
70
|
+
*
|
|
71
|
+
* Passing it also turns the schedule UI on: without it the Formula Builder has no "Exclude
|
|
72
|
+
* weekends & holidays" switch and the e-sign day offset has no schedule. A host that cannot save
|
|
73
|
+
* bindings (for example one without a tenant) leaves it out. It is not called for the e-sign
|
|
74
|
+
* schedule, which is stored in the field's `data`.
|
|
70
75
|
*/
|
|
71
76
|
onScheduleBindingsChange?(bindings: FieldScheduleBinding[]): void;
|
|
72
77
|
/**
|