@servicetitan/dte-pdf-editor 1.24.0 → 1.26.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.
- package/README.md +75 -38
- package/dist/components/display-conditions/display-condition.d.ts.map +1 -1
- package/dist/components/display-conditions/display-condition.js +0 -2
- package/dist/components/display-conditions/display-condition.js.map +1 -1
- package/dist/components/field-config-panel/field-config-panel.d.ts.map +1 -1
- package/dist/components/field-config-panel/field-config-panel.js +3 -2
- package/dist/components/field-config-panel/field-config-panel.js.map +1 -1
- package/dist/components/field-config-panel/table-configs.d.ts +9 -0
- package/dist/components/field-config-panel/table-configs.d.ts.map +1 -0
- package/dist/components/field-config-panel/table-configs.js +78 -0
- package/dist/components/field-config-panel/table-configs.js.map +1 -0
- package/dist/components/field-sidebar/field-menu-group.d.ts +1 -1
- package/dist/components/field-sidebar/field-menu-group.d.ts.map +1 -1
- package/dist/components/field-sidebar/field-menu-group.js +1 -5
- package/dist/components/field-sidebar/field-menu-group.js.map +1 -1
- package/dist/components/field-sidebar/field-sidebar.d.ts.map +1 -1
- package/dist/components/field-sidebar/field-sidebar.js +3 -2
- package/dist/components/field-sidebar/field-sidebar.js.map +1 -1
- package/dist/components/field-sidebar/generic-field-type-list.d.ts +9 -0
- package/dist/components/field-sidebar/generic-field-type-list.d.ts.map +1 -0
- package/dist/components/field-sidebar/generic-field-type-list.js +12 -0
- package/dist/components/field-sidebar/generic-field-type-list.js.map +1 -0
- package/dist/components/pdf-canvas/pdf-canvas.d.ts +1 -0
- package/dist/components/pdf-canvas/pdf-canvas.d.ts.map +1 -1
- package/dist/components/pdf-canvas/pdf-canvas.js +2 -2
- package/dist/components/pdf-canvas/pdf-canvas.js.map +1 -1
- package/dist/components/pdf-editor/pdf-editor.d.ts.map +1 -1
- package/dist/components/pdf-editor/pdf-editor.js +1 -1
- package/dist/components/pdf-editor/pdf-editor.js.map +1 -1
- package/dist/components/pdf-fields-overlay/pdf-fields-overlay.d.ts +1 -0
- package/dist/components/pdf-fields-overlay/pdf-fields-overlay.d.ts.map +1 -1
- package/dist/components/pdf-fields-overlay/pdf-fields-overlay.js +2 -2
- package/dist/components/pdf-fields-overlay/pdf-fields-overlay.js.map +1 -1
- package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.d.ts +9 -0
- package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.d.ts.map +1 -0
- package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.js +83 -0
- package/dist/components/pdf-fields-overlay/pdf-overlay-field-generic.js.map +1 -0
- package/dist/components/pdf-fields-overlay/pdf-overlay-field.d.ts +1 -0
- package/dist/components/pdf-fields-overlay/pdf-overlay-field.d.ts.map +1 -1
- package/dist/components/pdf-fields-overlay/pdf-overlay-field.js +6 -3
- package/dist/components/pdf-fields-overlay/pdf-overlay-field.js.map +1 -1
- package/dist/components/pdf-view/pdf-view-generic.d.ts +16 -0
- package/dist/components/pdf-view/pdf-view-generic.d.ts.map +1 -0
- package/dist/components/pdf-view/pdf-view-generic.js +68 -0
- package/dist/components/pdf-view/pdf-view-generic.js.map +1 -0
- package/dist/components/pdf-view/pdf-view.d.ts.map +1 -1
- package/dist/components/pdf-view/pdf-view.js +2 -1
- package/dist/components/pdf-view/pdf-view.js.map +1 -1
- package/dist/components/shared/index.d.ts +2 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/components/shared/index.js +2 -0
- package/dist/components/shared/index.js.map +1 -0
- package/dist/components/shared/inline-editable.d.ts +8 -0
- package/dist/components/shared/inline-editable.d.ts.map +1 -0
- package/dist/components/shared/inline-editable.js +17 -0
- package/dist/components/shared/inline-editable.js.map +1 -0
- package/dist/constants/field.constants.d.ts +8 -1
- package/dist/constants/field.constants.d.ts.map +1 -1
- package/dist/constants/field.constants.js +23 -0
- package/dist/constants/field.constants.js.map +1 -1
- package/dist/constants/menu-group.d.ts.map +1 -1
- package/dist/constants/menu-group.js +6 -0
- package/dist/constants/menu-group.js.map +1 -1
- package/dist/hooks/usePdfFieldDnD.d.ts.map +1 -1
- package/dist/hooks/usePdfFieldDnD.js +80 -20
- package/dist/hooks/usePdfFieldDnD.js.map +1 -1
- package/dist/interface/types.d.ts +24 -2
- package/dist/interface/types.d.ts.map +1 -1
- package/dist/interface/types.js +1 -0
- package/dist/interface/types.js.map +1 -1
- package/package.json +1 -1
- package/src/components/display-conditions/display-condition.tsx +0 -3
- package/src/components/field-config-panel/field-config-panel.tsx +8 -1
- package/src/components/field-config-panel/table-configs.tsx +136 -0
- package/src/components/field-sidebar/field-menu-group.tsx +16 -27
- package/src/components/field-sidebar/field-sidebar.tsx +5 -1
- package/src/components/field-sidebar/generic-field-type-list.tsx +27 -0
- package/src/components/pdf-canvas/pdf-canvas.tsx +3 -0
- package/src/components/pdf-editor/pdf-editor.tsx +1 -0
- package/src/components/pdf-fields-overlay/pdf-fields-overlay.tsx +3 -0
- package/src/components/pdf-fields-overlay/pdf-overlay-field-generic.tsx +188 -0
- package/src/components/pdf-fields-overlay/pdf-overlay-field.tsx +11 -1
- package/src/components/pdf-view/pdf-view-generic.tsx +129 -0
- package/src/components/pdf-view/pdf-view.tsx +4 -0
- package/src/components/shared/index.ts +1 -0
- package/src/components/shared/inline-editable.tsx +47 -0
- package/src/constants/field.constants.ts +27 -0
- package/src/constants/menu-group.ts +6 -0
- package/src/hooks/usePdfFieldDnD.ts +97 -27
- package/src/interface/types.ts +27 -1
- package/src/styles/index.css +1 -0
- package/src/styles/inline-editable.css +20 -0
- package/src/styles/pdf-field-overlay.css +31 -0
- package/src/styles/variables.css +6 -0
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @servicetitan/dte-pdf-editor
|
|
2
2
|
|
|
3
|
-
A React component library for creating interactive PDF editors with drag-and-drop field placement, data model
|
|
3
|
+
A React component library for creating interactive PDF editors with drag-and-drop field placement, data model
|
|
4
|
+
integration, e-signature support, fillable form fields, and calculated fields with formulas.
|
|
4
5
|
|
|
5
6
|
## Features
|
|
6
7
|
|
|
@@ -9,17 +10,25 @@ A React component library for creating interactive PDF editors with drag-and-dro
|
|
|
9
10
|
- 📊 **Data Model Integration**: Connect fields to structured data models using JSON Schema
|
|
10
11
|
- ✍️ **E-Signature Support**: Add signature, initials, date signed, and full name fields
|
|
11
12
|
- 📝 **Fillable Fields**: Support for text, number, date, checkbox, and radio button inputs
|
|
12
|
-
- 🧮 **Calculated Fields**: Formula-based fields with validation, autosuggest, and advanced formatting (number, currency,
|
|
13
|
+
- 🧮 **Calculated Fields**: Formula-based fields with validation, autosuggest, and advanced formatting (number, currency,
|
|
14
|
+
percent, rounding, separators)
|
|
15
|
+
- 📋 **Generic Fields**: Custom table and text blocks with configurable rows/cells and inline editing in view mode
|
|
13
16
|
- 👥 **Multi-Recipient Support**: Assign fields to different recipients with color-coded visualization
|
|
14
|
-
- ⚙️ **Field Configuration**: Configure field properties including position, size, label, recipient assignment,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
17
|
+
- ⚙️ **Field Configuration**: Configure field properties including position, size, label, recipient assignment,
|
|
18
|
+
formula/format for calculated fields, and table structure (header/body rows and cells) for generic table fields
|
|
19
|
+
- 👁️ **View Mode**: Display PDFs with filled data in a read-only or interactive view mode (including generic fields via
|
|
20
|
+
`PdfViewGeneric`)
|
|
21
|
+
|
|
22
|
+
### Recent changes (vs master) — feature/DTE-3811
|
|
23
|
+
|
|
24
|
+
- **Generic fields**: New field type `generic` with subTypes `table` and `text`. Tables support configurable header and
|
|
25
|
+
body rows with editable cells; text blocks support inline editing. Both are rendered in the overlay and in view mode.
|
|
26
|
+
- **PdfField**: Added optional `data?: FieldDataType` for generic fields (`GenericFieldTableDataType` for tables,
|
|
27
|
+
`GenericFieldTextDataType` for text).
|
|
28
|
+
- **Field config panel**: New **Table configs** (TableConfigs) for generic table fields—manage header visibility,
|
|
29
|
+
header/body row heights, and cell values. Inline editable components for text and table content in the overlay.
|
|
30
|
+
- **Sidebar**: Generic field type list (Text, Table) in the field menu for drag-and-drop placement.
|
|
31
|
+
- **PdfView**: Generic fields are rendered in view mode via `PdfViewGeneric` with the same inline editing support.
|
|
23
32
|
|
|
24
33
|
## Installation
|
|
25
34
|
|
|
@@ -83,16 +92,16 @@ The main component for editing PDF documents and placing fields.
|
|
|
83
92
|
|
|
84
93
|
#### Props
|
|
85
94
|
|
|
86
|
-
| Prop
|
|
87
|
-
|
|
88
|
-
| `pdfUrl`
|
|
89
|
-
| `fields`
|
|
90
|
-
| `onFieldsChange`
|
|
91
|
-
| `dataModel`
|
|
92
|
-
| `recipients`
|
|
93
|
-
| `loading`
|
|
94
|
-
| `loadingPlaceholder` | `ReactNode`
|
|
95
|
-
| `errorPlaceholder`
|
|
95
|
+
| Prop | Type | Required | Description |
|
|
96
|
+
|----------------------|--------------------------------|----------|---------------------------------------------------------|
|
|
97
|
+
| `pdfUrl` | `string` | Yes | URL or path to the PDF file |
|
|
98
|
+
| `fields` | `PdfField[]` | No | Array of fields placed on the PDF |
|
|
99
|
+
| `onFieldsChange` | `(fields: PdfField[]) => void` | Yes | Callback when fields are added, modified, or deleted |
|
|
100
|
+
| `dataModel` | `SchemaObject` | No | JSON Schema object defining available data model fields |
|
|
101
|
+
| `recipients` | `RecipientInfo[]` | No | Array of recipients that can be assigned to fields |
|
|
102
|
+
| `loading` | `boolean` | No | Whether the PDF is currently loading |
|
|
103
|
+
| `loadingPlaceholder` | `ReactNode` | No | Custom component to display while PDF is loading |
|
|
104
|
+
| `errorPlaceholder` | `ReactNode` | No | Custom component to display if PDF fails to load |
|
|
96
105
|
|
|
97
106
|
#### Example
|
|
98
107
|
|
|
@@ -115,17 +124,17 @@ Component for displaying PDFs with filled data in view mode.
|
|
|
115
124
|
|
|
116
125
|
#### Props
|
|
117
126
|
|
|
118
|
-
| Prop
|
|
119
|
-
|
|
120
|
-
| `pdfUrl`
|
|
121
|
-
| `fields`
|
|
122
|
-
| `data`
|
|
123
|
-
| `recipients`
|
|
124
|
-
| `fillingBy`
|
|
125
|
-
| `onDataChange`
|
|
126
|
-
| `loading`
|
|
127
|
-
| `loadingPlaceholder` | `ReactNode`
|
|
128
|
-
| `errorPlaceholder`
|
|
127
|
+
| Prop | Type | Required | Description |
|
|
128
|
+
|----------------------|----------------------------------------------------------------|----------|----------------------------------------------------------|
|
|
129
|
+
| `pdfUrl` | `string` | Yes | URL or path to the PDF file |
|
|
130
|
+
| `fields` | `PdfField[]` | Yes | Array of fields to display on the PDF |
|
|
131
|
+
| `data` | `DataModelValues` | No | Data object containing values for data model fields |
|
|
132
|
+
| `recipients` | `RecipientInfo[]` | No | Array of recipients for field assignment |
|
|
133
|
+
| `fillingBy` | `string[]` | No | Array of recipient names that are allowed to fill fields |
|
|
134
|
+
| `onDataChange` | `(changedData: { [path: string]: string \| boolean }) => void` | No | Callback when fillable field data changes |
|
|
135
|
+
| `loading` | `boolean` | No | Whether the PDF is currently loading |
|
|
136
|
+
| `loadingPlaceholder` | `ReactNode` | No | Custom component to display while PDF is loading |
|
|
137
|
+
| `errorPlaceholder` | `ReactNode` | No | Custom component to display if PDF fails to load |
|
|
129
138
|
|
|
130
139
|
#### Example
|
|
131
140
|
|
|
@@ -163,6 +172,7 @@ interface PdfField {
|
|
|
163
172
|
path?: string;
|
|
164
173
|
recipient?: string;
|
|
165
174
|
description?: string;
|
|
175
|
+
data?: FieldDataType; // for generic fields (table/text)
|
|
166
176
|
formula?: StructuredFormula; // for calculated fields
|
|
167
177
|
formulaFormat?: CalculatedFieldFormat; // for calculated fields
|
|
168
178
|
}
|
|
@@ -176,6 +186,7 @@ Enumeration of field types:
|
|
|
176
186
|
- `eSign`: E-signature field
|
|
177
187
|
- `fillable`: User-fillable form field
|
|
178
188
|
- `calculated`: Formula-based calculated field
|
|
189
|
+
- `generic`: Custom table or text block (configurable rows/cells, inline editing)
|
|
179
190
|
|
|
180
191
|
### ESignFieldType
|
|
181
192
|
|
|
@@ -188,7 +199,8 @@ Types of e-signature fields:
|
|
|
188
199
|
|
|
189
200
|
### PdfFieldSubType
|
|
190
201
|
|
|
191
|
-
Union of fillable
|
|
202
|
+
Union of fillable, e-sign, and generic sub-types: `FillableFieldType | ESignFieldType | GenericFieldType`. Used for
|
|
203
|
+
`PdfField.subType` and `FieldTypeOption.subType`.
|
|
192
204
|
|
|
193
205
|
### FillableFieldType
|
|
194
206
|
|
|
@@ -200,18 +212,36 @@ Types of fillable fields:
|
|
|
200
212
|
- `checkbox`: Checkbox
|
|
201
213
|
- `radio`: Radio button
|
|
202
214
|
|
|
215
|
+
### GenericFieldType
|
|
216
|
+
|
|
217
|
+
Types of generic fields:
|
|
218
|
+
|
|
219
|
+
- `table`: Configurable table with header and body rows and editable cells
|
|
220
|
+
- `text`: Text block with inline editing
|
|
221
|
+
|
|
222
|
+
### FieldDataType
|
|
223
|
+
|
|
224
|
+
For generic fields, `PdfField.data` can be:
|
|
225
|
+
|
|
226
|
+
- **GenericFieldTableDataType**: `showHeader`, `header` (height, cells), `body` (array of rows with height and cells)
|
|
227
|
+
- **GenericFieldTextDataType**: `value` (string)
|
|
228
|
+
|
|
203
229
|
### Calculated Fields (formula & format)
|
|
204
230
|
|
|
205
231
|
Calculated fields use a structured formula and optional display format:
|
|
206
232
|
|
|
207
|
-
- **StructuredFormula**: Token list (numbers, operators `+ - * /`, parentheses, field references) used for validation
|
|
208
|
-
|
|
233
|
+
- **StructuredFormula**: Token list (numbers, operators `+ - * /`, parentheses, field references) used for validation
|
|
234
|
+
and safe editing.
|
|
235
|
+
- **CalculatedFieldFormat**: Controls result display: `resultType` (`number` | `currency` | `percent`), rounding mode,
|
|
236
|
+
decimal places, thousands/decimal separators, prefix/postfix text.
|
|
209
237
|
|
|
210
|
-
Schema fields can opt in via `options.useInCalculatedFields` and `options.useInConditionals` for data model extraction
|
|
238
|
+
Schema fields can opt in via `options.useInCalculatedFields` and `options.useInConditionals` for data model extraction
|
|
239
|
+
in formula builder and conditionals.
|
|
211
240
|
|
|
212
241
|
### SchemaObject
|
|
213
242
|
|
|
214
|
-
JSON Schema object defining the data model structure. Supports nested objects, arrays, and various string subtypes (
|
|
243
|
+
JSON Schema object defining the data model structure. Supports nested objects, arrays, and various string subtypes (
|
|
244
|
+
string, text, html, image).
|
|
215
245
|
|
|
216
246
|
```tsx
|
|
217
247
|
interface SchemaObject {
|
|
@@ -357,20 +387,26 @@ function PdfEditorPage() {
|
|
|
357
387
|
### Adding Fields
|
|
358
388
|
|
|
359
389
|
Fields are added by dragging from the sidebar onto the PDF canvas. The sidebar displays:
|
|
390
|
+
|
|
360
391
|
- **Data Model Fields (Merge Tags)**: Grouped by schema structure
|
|
361
392
|
- **E-Sign Fields**: Signature, initials, date signed, full name
|
|
362
393
|
- **Fillable Fields**: Text, number, date, checkbox, radio
|
|
363
394
|
- **Calculated Fields**: Formula-based fields (configure formula and format in the config panel)
|
|
395
|
+
- **Generic Fields**: Text and Table (configure table rows/cells in the config panel; inline editing in view mode)
|
|
364
396
|
|
|
365
397
|
### Configuring Fields
|
|
366
398
|
|
|
367
399
|
Click on a field to open the configuration panel where you can:
|
|
400
|
+
|
|
368
401
|
- Change the label
|
|
369
402
|
- Adjust position and size
|
|
370
403
|
- Assign a recipient
|
|
371
404
|
- Set required status (fillable fields, except checkbox)
|
|
372
405
|
- Update the data model path
|
|
373
|
-
- For **calculated fields**: edit formula (with validation and autosuggest from data model + fillable fields), set
|
|
406
|
+
- For **calculated fields**: edit formula (with validation and autosuggest from data model + fillable fields), set
|
|
407
|
+
result type (number/currency/percent), rounding, decimals, and separators
|
|
408
|
+
- For **generic table fields**: configure header visibility, header/body row heights, and cell values via Table configs;
|
|
409
|
+
generic text fields support inline editing in the overlay
|
|
374
410
|
|
|
375
411
|
### Moving and Resizing
|
|
376
412
|
|
|
@@ -394,6 +430,7 @@ The package includes default styles. To customize, you can override CSS classes:
|
|
|
394
430
|
## Browser Support
|
|
395
431
|
|
|
396
432
|
This package requires modern browsers with support for:
|
|
433
|
+
|
|
397
434
|
- ES6+
|
|
398
435
|
- Canvas API
|
|
399
436
|
- Drag and Drop API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-condition.d.ts","sourceRoot":"","sources":["../../../src/components/display-conditions/display-condition.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAyB,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAE9F,UAAU,qBACN,SAAQ,IAAI,CAAC,0BAA0B,EAAE,cAAc,GAAG,QAAQ,GAAG,gBAAgB,CAAC;IACtF,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"display-condition.d.ts","sourceRoot":"","sources":["../../../src/components/display-conditions/display-condition.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAyB,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAE9F,UAAU,qBACN,SAAQ,IAAI,CAAC,0BAA0B,EAAE,cAAc,GAAG,QAAQ,GAAG,gBAAgB,CAAC;IACtF,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA6BtD,CAAC"}
|
|
@@ -5,8 +5,6 @@ import { Fragment, useState } from 'react';
|
|
|
5
5
|
import { DisplayConditionModal } from './display-condition-modal';
|
|
6
6
|
export const DisplayCondition = ({ documentFields, initialState, onSave, schema, }) => {
|
|
7
7
|
const [open, setOpen] = useState(false);
|
|
8
|
-
// TODO hide for prod
|
|
9
|
-
return null;
|
|
10
8
|
return (_jsxs(Fragment, { children: [_jsx(Button, { appearance: "secondary", className: "full-width", icon: PlusIcon, onClick: () => setOpen(true), children: "Add Display Condition" }), open && (_jsx(DisplayConditionModal, { onClose: () => setOpen(false), onSave: state => onSave({ displayCondition: state !== null && state !== void 0 ? state : undefined }), initialState: initialState, schema: schema, documentFields: documentFields }))] }));
|
|
11
9
|
};
|
|
12
10
|
//# sourceMappingURL=display-condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-condition.js","sourceRoot":"","sources":["../../../src/components/display-conditions/display-condition.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,QAAQ,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAA8B,MAAM,2BAA2B,CAAC;AAO9F,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,EACxD,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,GACT,EAAE,EAAE;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,
|
|
1
|
+
{"version":3,"file":"display-condition.js","sourceRoot":"","sources":["../../../src/components/display-conditions/display-condition.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,QAAQ,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAA8B,MAAM,2BAA2B,CAAC;AAO9F,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,EACxD,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,GACT,EAAE,EAAE;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,MAAM,IACH,UAAU,EAAC,WAAW,EACtB,SAAS,EAAC,YAAY,EACtB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,sCAGvB,EACR,IAAI,IAAI,CACL,KAAC,qBAAqB,IAClB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EAAE,CAAC,EACjE,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,GAChC,CACL,IACM,CACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-config-panel.d.ts","sourceRoot":"","sources":["../../../src/components/field-config-panel/field-config-panel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAGH,QAAQ,EACR,aAAa,EACb,YAAY,EACf,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"field-config-panel.d.ts","sourceRoot":"","sources":["../../../src/components/field-config-panel/field-config-panel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAGH,QAAQ,EACR,aAAa,EACb,YAAY,EACf,MAAM,uBAAuB,CAAC;AAM/B,UAAU,qBAAqB;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,iFAAiF;IACjF,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,aAAa,IAAI,IAAI,CAAC;IACtB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAsKtD,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { FieldTypeEnum, } from '../../interface/types';
|
|
|
6
6
|
import { generateESignPath, generateFillablePath } from '../../utils';
|
|
7
7
|
import { DisplayCondition } from '../display-conditions/display-condition';
|
|
8
8
|
import { FormulaGenerator } from './formula-generator';
|
|
9
|
+
import { TableConfigs } from './table-configs';
|
|
9
10
|
export const FieldConfigPanel = ({ dataModel, documentFields = [], field, onDeleteField, onFieldConfigChange, recipients = [], }) => {
|
|
10
11
|
var _a;
|
|
11
12
|
const recipientOptions = useMemo(() => recipients.map(recipient => ({
|
|
@@ -39,12 +40,12 @@ export const FieldConfigPanel = ({ dataModel, documentFields = [], field, onDele
|
|
|
39
40
|
};
|
|
40
41
|
return (_jsxs(Flex, { direction: "column", gap: "4", children: [[FieldTypeEnum.fillable, FieldTypeEnum.eSign, FieldTypeEnum.calculated].includes(field.type) && (_jsx(TextField, { required: field.type === FieldTypeEnum.fillable, label: "Label", value: field.label, onChange: e => onFieldConfigChange({
|
|
41
42
|
label: e.target.value,
|
|
42
|
-
}) })), (field.type === FieldTypeEnum.fillable || field.type === FieldTypeEnum.eSign) && (_jsxs(Combobox, { items: recipientOptions, itemToString: item => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.name) !== null && _a !== void 0 ? _a : ''; }, onChange: handleRecipientChange, selectedItem: selectedRecipient, filterOptions: { keys: ['name'] }, children: [_jsx(Combobox.SearchField, { placeholder: "", label: "Recipient" }), _jsx(Combobox.Content, { children: ({ items }) => (_jsx(Combobox.List, { children: items.map((item, i) => (_jsx(Combobox.Item, { item: item, index: i, children: item.name }, item.id))) })) })] })), field.type === FieldTypeEnum.eSign && (_jsxs(Combobox, { items: E_SIGN_FIELD_TYPE_OPTIONS, itemToString: item => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.name) !== null && _a !== void 0 ? _a : ''; }, onChange: handleESignFieldTypeChange, selectedItem: selectedESignFieldType, children: [_jsx(Combobox.SearchField, { label: "Field Type" }), _jsx(Combobox.Content, { children: ({ items }) => (_jsx(Combobox.List, { children: items.map((item, i) => (_jsx(Combobox.Item, { item: item, index: i, children: item.name }, item.id))) })) })] })), _jsx(TextField, { label: "Data Path", value: field.path, disabled: true }), field.type === FieldTypeEnum.fillable && field.subType !== 'checkbox' && (_jsx(Checkbox, { label: "Required", checked: field.required, onChange: () => onFieldConfigChange({
|
|
43
|
+
}) })), (field.type === FieldTypeEnum.fillable || field.type === FieldTypeEnum.eSign) && (_jsxs(Combobox, { items: recipientOptions, itemToString: item => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.name) !== null && _a !== void 0 ? _a : ''; }, onChange: handleRecipientChange, selectedItem: selectedRecipient, filterOptions: { keys: ['name'] }, children: [_jsx(Combobox.SearchField, { placeholder: "", label: "Recipient" }), _jsx(Combobox.Content, { children: ({ items }) => (_jsx(Combobox.List, { children: items.map((item, i) => (_jsx(Combobox.Item, { item: item, index: i, children: item.name }, item.id))) })) })] })), field.type === FieldTypeEnum.eSign && (_jsxs(Combobox, { items: E_SIGN_FIELD_TYPE_OPTIONS, itemToString: item => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.name) !== null && _a !== void 0 ? _a : ''; }, onChange: handleESignFieldTypeChange, selectedItem: selectedESignFieldType, children: [_jsx(Combobox.SearchField, { label: "Field Type" }), _jsx(Combobox.Content, { children: ({ items }) => (_jsx(Combobox.List, { children: items.map((item, i) => (_jsx(Combobox.Item, { item: item, index: i, children: item.name }, item.id))) })) })] })), field.type !== FieldTypeEnum.generic && (_jsx(TextField, { label: "Data Path", value: field.path, disabled: true })), field.type === FieldTypeEnum.fillable && field.subType !== 'checkbox' && (_jsx(Checkbox, { label: "Required", checked: field.required, onChange: () => onFieldConfigChange({
|
|
43
44
|
required: !field.required,
|
|
44
45
|
}) })), field.type === FieldTypeEnum.calculated && (_jsx(FormulaGenerator, { dataModel: dataModel, documentFields: documentFields, formula: field.formula, formulaFormat: field.formulaFormat, onFormulaChange: (formula, formulaFormat) => onFieldConfigChange({
|
|
45
46
|
formula,
|
|
46
47
|
formulaFormat,
|
|
47
|
-
}) })), _jsx(DisplayCondition, { onSave: onFieldConfigChange, documentFields: documentFields, schema: dataModel, initialState: (_a = field.displayCondition) !== null && _a !== void 0 ? _a : undefined }), _jsx(Textarea, { label: "Description", value: field.description, onChange: e => {
|
|
48
|
+
}) })), field.type === FieldTypeEnum.generic && field.subType === 'table' && (_jsx(TableConfigs, { field: field, onFieldConfigChange: onFieldConfigChange })), _jsx(DisplayCondition, { onSave: onFieldConfigChange, documentFields: documentFields, schema: dataModel, initialState: (_a = field.displayCondition) !== null && _a !== void 0 ? _a : undefined }), _jsx(Textarea, { label: "Description", value: field.description, onChange: e => {
|
|
48
49
|
var _a;
|
|
49
50
|
return onFieldConfigChange({
|
|
50
51
|
description: (_a = e === null || e === void 0 ? void 0 : e.target.value) !== null && _a !== void 0 ? _a : '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-config-panel.js","sourceRoot":"","sources":["../../../src/components/field-config-panel/field-config-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAEH,aAAa,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"field-config-panel.js","sourceRoot":"","sources":["../../../src/components/field-config-panel/field-config-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAEH,aAAa,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAY/C,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,EACxD,SAAS,EACT,cAAc,GAAG,EAAE,EACnB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,UAAU,GAAG,EAAE,GAClB,EAAE,EAAE;;IACD,MAAM,gBAAgB,GAAG,OAAO,CAC5B,GAAG,EAAE,CACD,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACzB,EAAE,EAAE,SAAS,CAAC,IAAI;QAClB,IAAI,EAAE,SAAS,CAAC,WAAW;KAC9B,CAAC,CAAC,EACP,CAAC,UAAU,CAAC,CACf,CAAC;IAEF,MAAM,iBAAiB,GAAG,OAAO,CAC7B,GAAG,EAAE,WAAC,OAAA,MAAA,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC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KAAC,gBAAgB,IACb,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,eAAe,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,CACxC,mBAAmB,CAAC;oBAChB,OAAO;oBACP,aAAa;iBAChB,CAAC,GAER,CACL,EAEA,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,IAAI,CAClE,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,GAAI,CAC3E,EAED,KAAC,gBAAgB,IACb,MAAM,EAAE,mBAAmB,EAC3B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,MAAA,KAAK,CAAC,gBAAgB,mCAAI,SAAS,GACnD,EAEF,KAAC,QAAQ,IACL,KAAK,EAAC,aAAa,EACnB,KAAK,EAAE,KAAK,CAAC,WAAW,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE;;oBACV,OAAA,mBAAmB,CAAC;wBAChB,WAAW,EAAE,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAC,KAAK,mCAAI,EAAE;qBACrC,CAAC,CAAA;iBAAA,GAER,EAEF,KAAC,MAAM,IAAC,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAC,QAAQ,6BAEjE,IACN,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PdfField } from '../../interface/types';
|
|
3
|
+
interface TableConfigsProps {
|
|
4
|
+
field: PdfField;
|
|
5
|
+
onFieldConfigChange(updates: Partial<PdfField>): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableConfigs: FC<TableConfigsProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=table-configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-configs.d.ts","sourceRoot":"","sources":["../../../src/components/field-config-panel/table-configs.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,EAA6B,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5E,UAAU,iBAAiB;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CACzD;AACD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8H9C,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex, Switch } from '@servicetitan/anvil2';
|
|
3
|
+
import { Fragment } from 'react';
|
|
4
|
+
import { GENERIC_FIELD_TABLE_ROW_HEIGHT } from '../../constants';
|
|
5
|
+
export const TableConfigs = ({ field, onFieldConfigChange }) => {
|
|
6
|
+
const data = field.data;
|
|
7
|
+
const handleClickAddRow = () => {
|
|
8
|
+
const newRow = {
|
|
9
|
+
height: GENERIC_FIELD_TABLE_ROW_HEIGHT,
|
|
10
|
+
cells: data.header.cells.map(() => ({ value: '' })),
|
|
11
|
+
};
|
|
12
|
+
onFieldConfigChange({
|
|
13
|
+
...field,
|
|
14
|
+
height: field.height + GENERIC_FIELD_TABLE_ROW_HEIGHT,
|
|
15
|
+
data: {
|
|
16
|
+
...data,
|
|
17
|
+
body: [...data.body, newRow],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const handleClickRemoveRow = () => {
|
|
22
|
+
const removedRow = data.body[data.body.length - 1];
|
|
23
|
+
onFieldConfigChange({
|
|
24
|
+
...field,
|
|
25
|
+
height: field.height - removedRow.height,
|
|
26
|
+
data: {
|
|
27
|
+
...data,
|
|
28
|
+
body: data.body.slice(0, -1),
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const handleClickAddCell = () => {
|
|
33
|
+
onFieldConfigChange({
|
|
34
|
+
...field,
|
|
35
|
+
data: {
|
|
36
|
+
...data,
|
|
37
|
+
header: {
|
|
38
|
+
...data.header,
|
|
39
|
+
cells: [...data.header.cells, { value: '' }],
|
|
40
|
+
},
|
|
41
|
+
body: data.body.map(row => ({
|
|
42
|
+
...row,
|
|
43
|
+
cells: [...row.cells, { value: '' }],
|
|
44
|
+
})),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const handleClickRemoveCell = () => {
|
|
49
|
+
if (data.header.cells.length <= 1) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onFieldConfigChange({
|
|
53
|
+
...field,
|
|
54
|
+
data: {
|
|
55
|
+
...data,
|
|
56
|
+
header: {
|
|
57
|
+
...data.header,
|
|
58
|
+
cells: data.header.cells.slice(0, -1),
|
|
59
|
+
},
|
|
60
|
+
body: data.body.map(row => ({
|
|
61
|
+
...row,
|
|
62
|
+
cells: row.cells.slice(0, -1),
|
|
63
|
+
})),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
return (_jsxs(Fragment, { children: [_jsx(Switch, { checked: data.showHeader, onChange: (_e, { checked }) => {
|
|
68
|
+
onFieldConfigChange({
|
|
69
|
+
...field,
|
|
70
|
+
height: field.height + (checked ? 40 : -40),
|
|
71
|
+
data: {
|
|
72
|
+
...data,
|
|
73
|
+
showHeader: checked,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}, label: "Enable Header" }), _jsxs(Flex, { gap: "2", justifyContent: "space-between", alignItems: "center", children: ["Columns", _jsxs(Flex, { gap: "1", children: [_jsx(Button, { size: "small", disabled: data.header.cells.length <= 1, appearance: "secondary", onClick: handleClickRemoveCell, children: "-" }), _jsx(Button, { size: "small", disabled: data.header.cells.length >= 8, appearance: "secondary", onClick: handleClickAddCell, children: "+" })] })] }), _jsxs(Flex, { gap: "2", justifyContent: "space-between", alignItems: "center", children: ["Rows", _jsxs(Flex, { gap: "1", children: [_jsx(Button, { size: "small", disabled: data.body.length <= 1, appearance: "secondary", onClick: handleClickRemoveRow, children: "-" }), _jsx(Button, { size: "small", disabled: data.body.length >= 50, appearance: "secondary", onClick: handleClickAddRow, children: "+" })] })] })] }));
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=table-configs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-configs.js","sourceRoot":"","sources":["../../../src/components/field-config-panel/table-configs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAOjE,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAClF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAiC,CAAC;IAErD,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC3B,MAAM,MAAM,GAAG;YACX,MAAM,EAAE,8BAA8B;YACtC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;SACtD,CAAC;QACF,mBAAmB,CAAC;YAChB,GAAG,KAAK;YACR,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,8BAA8B;YACrD,IAAI,EAAE;gBACF,GAAG,IAAI;gBACP,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;aAC/B;S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EAAE,kBAAkB,kBAGtB,IACN,IACJ,EACP,MAAC,IAAI,IAAC,GAAG,EAAC,GAAG,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,qBAE5D,MAAC,IAAI,IAAC,GAAG,EAAC,GAAG,aACT,KAAC,MAAM,IACH,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAC/B,UAAU,EAAC,WAAW,EACtB,OAAO,EAAE,oBAAoB,kBAGxB,EACT,KAAC,MAAM,IACH,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAChC,UAAU,EAAC,WAAW,EACtB,OAAO,EAAE,iBAAiB,kBAGrB,IACN,IACJ,IACA,CACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-menu-group.d.ts","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-menu-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"field-menu-group.d.ts","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-menu-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,UAAU,mBAAmB;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,cAAc,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAwBlD,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex, Icon, Text } from '@servicetitan/anvil2';
|
|
3
|
-
import { FieldTypeEnum } from '../../interface/types';
|
|
4
3
|
export const FieldMenuGroup = ({ activeFieldKey, menuGroups, onClickMenu, }) => {
|
|
5
|
-
return (_jsx(Flex, { className: "dte-field-sidebar-menu", shrink: 0, direction: "column", gap: "3", children: menuGroups
|
|
6
|
-
// TODO filter out calculated for prod
|
|
7
|
-
.filter(mg => mg.key !== FieldTypeEnum.calculated)
|
|
8
|
-
.map(({ key, label, svgIcon }) => (_jsxs(Flex, { alignItems: "center", justifyContent: "center", direction: "column", className: `dte-field-sidebar-menu-item cursor-pointer ${key === activeFieldKey ? '--active' : ''}`, onClick: () => onClickMenu(key), children: [_jsx(Icon, { svg: svgIcon, size: "large", className: "dte-field-sidebar-menu-item-icon" }), _jsx(Text, { variant: "body", size: "small", className: "dte-field-sidebar-menu-item-text", children: label })] }, key))) }));
|
|
4
|
+
return (_jsx(Flex, { className: "dte-field-sidebar-menu", shrink: 0, direction: "column", gap: "3", children: menuGroups.map(({ key, label, svgIcon }) => (_jsxs(Flex, { alignItems: "center", justifyContent: "center", direction: "column", className: `dte-field-sidebar-menu-item cursor-pointer ${key === activeFieldKey ? '--active' : ''}`, onClick: () => onClickMenu(key), children: [_jsx(Icon, { svg: svgIcon, size: "large", className: "dte-field-sidebar-menu-item-icon" }), _jsx(Text, { variant: "body", size: "small", className: "dte-field-sidebar-menu-item-text", children: label })] }, key))) }));
|
|
9
5
|
};
|
|
10
6
|
//# sourceMappingURL=field-menu-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-menu-group.js","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-menu-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"field-menu-group.js","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-menu-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAWxD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EACpD,cAAc,EACd,UAAU,EACV,WAAW,GACd,EAAE,EAAE;IACD,OAAO,CACH,KAAC,IAAI,IAAC,SAAS,EAAC,wBAAwB,EAAC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,YACzE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACzC,MAAC,IAAI,IAED,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,EACvB,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,8CAA8C,GAAG,KAAK,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EACnG,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,aAE/B,KAAC,IAAI,IAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,kCAAkC,GAAG,EAChF,KAAC,IAAI,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,kCAAkC,YACzE,KAAK,GACH,KAVF,GAAG,CAWL,CACV,CAAC,GACC,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,mBAAmB,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"field-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,mBAAmB,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQ5F,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACxC,SAAS,IAAI,IAAI,CAAC;IAClB,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6D9C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button, Flex, Icon, Text } from '@servicetitan/anvil2';
|
|
3
3
|
import IconMenuOpen from '@servicetitan/anvil2/assets/icons/material/round/menu_open.svg';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { menuGroups } from '../../constants
|
|
5
|
+
import { menuGroups } from '../../constants';
|
|
6
6
|
import { useToggle } from '../../hooks';
|
|
7
7
|
import { FieldTypeEnum } from '../../interface/types';
|
|
8
8
|
import { CalculatedFieldTypeList } from './calculated-field-type-list';
|
|
@@ -10,6 +10,7 @@ import { DataModelFieldTypeList } from './data-model-field-type-list';
|
|
|
10
10
|
import { ESignFieldTypeList } from './e-sign-field-type-list';
|
|
11
11
|
import { FieldMenuGroup } from './field-menu-group';
|
|
12
12
|
import { FillableFieldTypeList } from './fillable-field-type-list';
|
|
13
|
+
import { GenericFieldTypeList } from './generic-field-type-list';
|
|
13
14
|
export const FieldSidebar = ({ dataModelGroups = [], onDragEnd, onDragStart, }) => {
|
|
14
15
|
var _a;
|
|
15
16
|
const [activeFieldType, setActiveFieldType] = useState(FieldTypeEnum.dataModel);
|
|
@@ -18,6 +19,6 @@ export const FieldSidebar = ({ dataModelGroups = [], onDragEnd, onDragStart, })
|
|
|
18
19
|
setActiveFieldType(activeFieldType);
|
|
19
20
|
open();
|
|
20
21
|
};
|
|
21
|
-
return (_jsxs(Flex, { className: "dte-field-sidebar-container skeleton-item", children: [_jsx(FieldMenuGroup, { menuGroups: menuGroups, onClickMenu: handleActiveFieldTypeChange, activeFieldKey: activeFieldType }), _jsx(Flex, { className: `dte-field-sidebar-content skeleton-item ${isOpen ? '--open' : ''}`, shrink: 0, children: _jsxs(Flex, { className: "dte-field-sidebar-content-inner", children: [_jsx(Text, { variant: "headline", el: "h1", size: "medium", children: (_a = menuGroups.find(group => group.key === activeFieldType)) === null || _a === void 0 ? void 0 : _a.label }), activeFieldType === FieldTypeEnum.fillable && (_jsx(FillableFieldTypeList, { onDragStart: onDragStart, onDragEnd: onDragEnd })), activeFieldType === FieldTypeEnum.eSign && (_jsx(ESignFieldTypeList, { onDragEnd: onDragEnd, onDragStart: onDragStart })), activeFieldType === FieldTypeEnum.dataModel && (_jsx(DataModelFieldTypeList, { dataModelGroups: dataModelGroups, onDragStart: onDragStart, onDragEnd: onDragEnd })), activeFieldType === FieldTypeEnum.calculated && (_jsx(CalculatedFieldTypeList, { onDragStart: onDragStart, onDragEnd: onDragEnd }))] }) }), _jsx(Button, { size: "small", appearance: "ghost", onClick: toggle, className: "dte-field-sidebar-toggler", children: _jsx(Icon, { svg: IconMenuOpen, size: "medium" }) })] }));
|
|
22
|
+
return (_jsxs(Flex, { className: "dte-field-sidebar-container skeleton-item", children: [_jsx(FieldMenuGroup, { menuGroups: menuGroups, onClickMenu: handleActiveFieldTypeChange, activeFieldKey: activeFieldType }), _jsx(Flex, { className: `dte-field-sidebar-content skeleton-item ${isOpen ? '--open' : ''}`, shrink: 0, children: _jsxs(Flex, { className: "dte-field-sidebar-content-inner", children: [_jsx(Text, { variant: "headline", el: "h1", size: "medium", children: (_a = menuGroups.find(group => group.key === activeFieldType)) === null || _a === void 0 ? void 0 : _a.label }), activeFieldType === FieldTypeEnum.fillable && (_jsx(FillableFieldTypeList, { onDragStart: onDragStart, onDragEnd: onDragEnd })), activeFieldType === FieldTypeEnum.eSign && (_jsx(ESignFieldTypeList, { onDragEnd: onDragEnd, onDragStart: onDragStart })), activeFieldType === FieldTypeEnum.dataModel && (_jsx(DataModelFieldTypeList, { dataModelGroups: dataModelGroups, onDragStart: onDragStart, onDragEnd: onDragEnd })), activeFieldType === FieldTypeEnum.calculated && (_jsx(CalculatedFieldTypeList, { onDragStart: onDragStart, onDragEnd: onDragEnd })), activeFieldType === FieldTypeEnum.generic && (_jsx(GenericFieldTypeList, { onDragStart: onDragStart, onDragEnd: onDragEnd }))] }) }), _jsx(Button, { size: "small", appearance: "ghost", onClick: toggle, className: "dte-field-sidebar-toggler", children: _jsx(Icon, { svg: IconMenuOpen, size: "medium" }) })] }));
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=field-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-sidebar.js","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,YAAY,MAAM,gEAAgE,CAAC;AAE1F,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"field-sidebar.js","sourceRoot":"","sources":["../../../src/components/field-sidebar/field-sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,YAAY,MAAM,gEAAgE,CAAC;AAE1F,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,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,QAAQ,YACzC,MAAA,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,eAAe,CAAC,0CAAE,KAAK,GAC5D,EAEN,eAAe,KAAK,aAAa,CAAC,QAAQ,IAAI,CAC3C,KAAC,qBAAqB,IAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,GAAI,CAC5E,EACA,eAAe,KAAK,aAAa,CAAC,KAAK,IAAI,CACxC,KAAC,kBAAkB,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAI,CACzE,EACA,eAAe,KAAK,aAAa,CAAC,SAAS,IAAI,CAC5C,KAAC,sBAAsB,IACnB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACtB,CACL,EACA,eAAe,KAAK,aAAa,CAAC,UAAU,IAAI,CAC7C,KAAC,uBAAuB,IAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,GAAI,CAC9E,EACA,eAAe,KAAK,aAAa,CAAC,OAAO,IAAI,CAC1C,KAAC,oBAAoB,IAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,GAAI,CAC3E,IACE,GACJ,EACP,KAAC,MAAM,IACH,IAAI,EAAC,OAAO,EACZ,UAAU,EAAC,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAC,2BAA2B,YAErC,KAAC,IAAI,IAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAC,QAAQ,GAAG,GACpC,IACN,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FieldTypeOption } from '../../interface/types';
|
|
3
|
+
interface GenericFieldTypeListProps {
|
|
4
|
+
onDragStart(fieldOption: FieldTypeOption): void;
|
|
5
|
+
onDragEnd(): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const GenericFieldTypeList: FC<GenericFieldTypeListProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=generic-field-type-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-field-type-list.d.ts","sourceRoot":"","sources":["../../../src/components/field-sidebar/generic-field-type-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,UAAU,yBAAyB;IAC/B,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IAChD,SAAS,IAAI,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAgB9D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { GENERIC_FIELD_TYPES } from '../../constants';
|
|
4
|
+
import { FieldType } from './field-type';
|
|
5
|
+
export const GenericFieldTypeList = ({ onDragEnd, onDragStart }) => {
|
|
6
|
+
return (_jsx(Fragment, { children: GENERIC_FIELD_TYPES.map(fieldOption => {
|
|
7
|
+
var _a;
|
|
8
|
+
const key = `${fieldOption.type}-${(_a = fieldOption.path) !== null && _a !== void 0 ? _a : fieldOption.label}`;
|
|
9
|
+
return (_jsx(FieldType, { label: fieldOption.label, onDragEnd: onDragEnd, onDragStart: () => onDragStart(fieldOption) }, key));
|
|
10
|
+
}) }));
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=generic-field-type-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-field-type-list.js","sourceRoot":"","sources":["../../../src/components/field-sidebar/generic-field-type-list.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,MAAM,CAAC,MAAM,oBAAoB,GAAkC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IAC9F,OAAO,CACH,KAAC,QAAQ,cACJ,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;;YACnC,MAAM,GAAG,GAAG,GAAG,WAAW,CAAC,IAAI,IAAI,MAAA,WAAW,CAAC,IAAI,mCAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YAC3E,OAAO,CACH,KAAC,SAAS,IAEN,KAAK,EAAE,WAAW,CAAC,KAAK,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,IAHtC,GAAG,CAIV,CACL,CAAC;QACN,CAAC,CAAC,GACK,CACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -19,6 +19,7 @@ interface PdfCanvasProps {
|
|
|
19
19
|
onFieldMove(fieldId: string, newX: number, newY: number, pageNumber: number): void;
|
|
20
20
|
onFieldResize(fieldId: string, newWidth: number, newHeight: number, pageNumber: number): void;
|
|
21
21
|
onDeselectField(): void;
|
|
22
|
+
onFieldConfigChange(updates: Partial<PdfField>): void;
|
|
22
23
|
}
|
|
23
24
|
export declare const PdfCanvas: FC<PdfCanvasProps>;
|
|
24
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-canvas.d.ts","sourceRoot":"","sources":["../../../src/components/pdf-canvas/pdf-canvas.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE7F,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjD,UAAU,cAAc;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CA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CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAmExC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
|
|
|
4
4
|
import { BASE_PAGE_WIDTH } from '../../constants';
|
|
5
5
|
import { PdfFieldsOverlay } from '../pdf-fields-overlay/pdf-fields-overlay';
|
|
6
6
|
import { PdfDocumentRenderer } from './pdf-document-renderer';
|
|
7
|
-
export const PdfCanvas = ({ errorPlaceholder, errors = {}, fields, handleAddNewField, loading, loadingPlaceholder, onDeselectField, onDragOver, onDrop, onFieldClick, onFieldMove, onFieldResize, onLoadSuccess, pdfContainerRef, pdfUrl, pdfWrapperRef, recipientsColors, selectedField, }) => {
|
|
7
|
+
export const PdfCanvas = ({ errorPlaceholder, errors = {}, fields, handleAddNewField, loading, loadingPlaceholder, onDeselectField, onDragOver, onDrop, onFieldClick, onFieldConfigChange, onFieldMove, onFieldResize, onLoadSuccess, pdfContainerRef, pdfUrl, pdfWrapperRef, recipientsColors, selectedField, }) => {
|
|
8
8
|
const [isPdfLoaded, setIsPdfLoaded] = useState(false);
|
|
9
9
|
const onDocumentLoadSuccess = (pageNum) => {
|
|
10
10
|
setIsPdfLoaded(true);
|
|
@@ -13,6 +13,6 @@ export const PdfCanvas = ({ errorPlaceholder, errors = {}, fields, handleAddNewF
|
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
setIsPdfLoaded(false);
|
|
15
15
|
}, [pdfUrl]);
|
|
16
|
-
return (_jsx(Flex, { flex: 1, ref: pdfContainerRef, className: "dte-pdf-canvas-container", onClick: onDeselectField, children: _jsxs("div", { ref: pdfWrapperRef, className: "dte-pdf-wrapper", style: { width: BASE_PAGE_WIDTH }, children: [_jsx(PdfDocumentRenderer, { pdfUrl: pdfUrl, onDrop: onDrop, loading: loading, onDragOver: onDragOver, pageWidth: BASE_PAGE_WIDTH, errorPlaceholder: errorPlaceholder, loadingPlaceholder: loadingPlaceholder, onDocumentLoadSuccess: onDocumentLoadSuccess }), isPdfLoaded && (_jsx(PdfFieldsOverlay, { fields: fields, errors: errors, handleAddNewField: handleAddNewField, pdfWrapperRef: pdfWrapperRef, recipientsColors: recipientsColors, selectedField: selectedField !== null && selectedField !== void 0 ? selectedField : null, onFieldClick: onFieldClick, onFieldMove: onFieldMove, onFieldResize: onFieldResize }))] }) }));
|
|
16
|
+
return (_jsx(Flex, { flex: 1, ref: pdfContainerRef, className: "dte-pdf-canvas-container", onClick: onDeselectField, children: _jsxs("div", { ref: pdfWrapperRef, className: "dte-pdf-wrapper", style: { width: BASE_PAGE_WIDTH }, children: [_jsx(PdfDocumentRenderer, { pdfUrl: pdfUrl, onDrop: onDrop, loading: loading, onDragOver: onDragOver, pageWidth: BASE_PAGE_WIDTH, errorPlaceholder: errorPlaceholder, loadingPlaceholder: loadingPlaceholder, onDocumentLoadSuccess: onDocumentLoadSuccess }), isPdfLoaded && (_jsx(PdfFieldsOverlay, { fields: fields, errors: errors, onFieldConfigChange: onFieldConfigChange, handleAddNewField: handleAddNewField, pdfWrapperRef: pdfWrapperRef, recipientsColors: recipientsColors, selectedField: selectedField !== null && selectedField !== void 0 ? selectedField : null, onFieldClick: onFieldClick, onFieldMove: onFieldMove, onFieldResize: onFieldResize }))] }) }));
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=pdf-canvas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-canvas.js","sourceRoot":"","sources":["../../../src/components/pdf-canvas/pdf-canvas.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAmD,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,mBAAm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AC;IACzB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,aAAa,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"pdf-editor.d.ts","sourceRoot":"","sources":["../../../src/components/pdf-editor/pdf-editor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAgC,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM9E,OAAO,wBAAwB,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,aAAa,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4FxC,CAAC"}
|
|
@@ -21,6 +21,6 @@ export const PdfEditor = ({ dataModel, errorPlaceholder, errors = {}, fields = [
|
|
|
21
21
|
const dataModelGroups = useMemo(() => (dataModel ? extractGroupedFieldsFromDataModel(dataModel) : []), [dataModel]);
|
|
22
22
|
const handleAddNewField = useCallback((field) => onFieldsChange([...fields, field]), [fields, onFieldsChange]);
|
|
23
23
|
const recipientsColors = mapColorsToRecipients(recipients);
|
|
24
|
-
return (_jsxs(Flex, { flex: 1, className: `dte-pdf-editor ${loading ? 'skeleton' : ''}`, children: [selectedField && (_jsx(FieldConfigPanelOverlay, { dataModel: dataModel, documentFields: fields, selectedField: selectedField, onFieldConfigChange: updateField, onDeleteField: deleteSelectedField, recipients: recipients, onDeselectField: deselectField })), _jsx(Flex, { className: "dte-pdf-editor-sidebar-container", children: _jsx(FieldSidebar, { dataModelGroups: dataModelGroups, onDragStart: pdfFieldDnd.handleDragStart, onDragEnd: pdfFieldDnd.handleDragEnd }) }), _jsx(Flex, { gap: 12, flex: 1, className: "dte-pdf-editor-content-container skeleton-item", children: _jsx(PdfCanvas, { pdfUrl: pdfUrl, fields: fields, loading: loading, errors: errors, onLoadSuccess: onLoadSuccess, recipientsColors: recipientsColors, selectedField: selectedField, pdfContainerRef: pdfContainerRef, pdfWrapperRef: pdfWrapperRef, errorPlaceholder: errorPlaceholder, loadingPlaceholder: loadingPlaceholder, handleAddNewField: handleAddNewField, onDrop: pdfFieldDnd.handleDrop, onDragOver: pdfFieldDnd.handleDragOver, onFieldClick: selectField, onFieldMove: moveField, onFieldResize: resizeField, onDeselectField: deselectField }) })] }));
|
|
24
|
+
return (_jsxs(Flex, { flex: 1, className: `dte-pdf-editor ${loading ? 'skeleton' : ''}`, children: [selectedField && (_jsx(FieldConfigPanelOverlay, { dataModel: dataModel, documentFields: fields, selectedField: selectedField, onFieldConfigChange: updateField, onDeleteField: deleteSelectedField, recipients: recipients, onDeselectField: deselectField })), _jsx(Flex, { className: "dte-pdf-editor-sidebar-container", children: _jsx(FieldSidebar, { dataModelGroups: dataModelGroups, onDragStart: pdfFieldDnd.handleDragStart, onDragEnd: pdfFieldDnd.handleDragEnd }) }), _jsx(Flex, { gap: 12, flex: 1, className: "dte-pdf-editor-content-container skeleton-item", children: _jsx(PdfCanvas, { pdfUrl: pdfUrl, fields: fields, loading: loading, errors: errors, onLoadSuccess: onLoadSuccess, recipientsColors: recipientsColors, selectedField: selectedField, pdfContainerRef: pdfContainerRef, pdfWrapperRef: pdfWrapperRef, errorPlaceholder: errorPlaceholder, loadingPlaceholder: loadingPlaceholder, handleAddNewField: handleAddNewField, onDrop: pdfFieldDnd.handleDrop, onDragOver: pdfFieldDnd.handleDragOver, onFieldClick: selectField, onFieldMove: moveField, onFieldResize: resizeField, onDeselectField: deselectField, onFieldConfigChange: updateField }) })] }));
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=pdf-editor.js.map
|