@jigx/core-sdk 1.1.0 → 1.2.0-rc

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 (39) hide show
  1. package/dist/action/ja.generate-pdf.d.ts +17 -1
  2. package/dist/action/ja.generate-pdf.d.ts.map +1 -1
  3. package/dist/action/ja.generate-pdf.js +4 -1
  4. package/dist/action/ja.in-background.d.ts +3 -2
  5. package/dist/action/ja.in-background.d.ts.map +1 -1
  6. package/dist/action/ja.in-background.js +1 -1
  7. package/dist/assets/example-extraction-cache.json +3 -3
  8. package/dist/assets/extracted-core-sdk-examples.yaml +18 -0
  9. package/dist/assets/extracted-core-sdk-types.yaml +58 -0
  10. package/dist/assets/type-extraction-cache.json +3 -3
  11. package/docs/array-fields.md +371 -0
  12. package/docs/conditional-logic.md +178 -0
  13. package/docs/convention-naming.md +102 -0
  14. package/docs/date-field.md +92 -0
  15. package/docs/dropdown-fields.md +879 -0
  16. package/docs/field-state.md +131 -0
  17. package/docs/field-types-overview.md +132 -0
  18. package/docs/formatting.md +421 -0
  19. package/docs/icons.md +142 -0
  20. package/docs/index.md +23 -0
  21. package/docs/jsonata-expressions.md +200 -0
  22. package/docs/media-fields.md +107 -0
  23. package/docs/overview.md +467 -0
  24. package/docs/pattern-build-deploy.md +91 -0
  25. package/docs/pattern-datasources.md +459 -0
  26. package/docs/pattern-forms.md +528 -0
  27. package/docs/pattern-global-actions.md +92 -0
  28. package/docs/pattern-javascript-functions.md +452 -0
  29. package/docs/pattern-navigation.md +304 -0
  30. package/docs/pattern-pdf-generation.md +391 -0
  31. package/docs/pattern-rest-acumatica.md +660 -0
  32. package/docs/pattern-sync-progress.md +96 -0
  33. package/docs/pattern-sync.md +653 -0
  34. package/docs/pattern-tabs-form.md +293 -0
  35. package/docs/recipe-index.md +64 -0
  36. package/docs/runtime-variables.md +127 -0
  37. package/docs/sections.md +81 -0
  38. package/docs/validation-patterns.md +150 -0
  39. package/package.json +3 -2
@@ -0,0 +1,102 @@
1
+ # Convention: Naming
2
+
3
+ ## File and component naming
4
+
5
+ All files and components that map to output files follow this pattern:
6
+
7
+ ```
8
+ {type}-{entity}-{action}
9
+ ```
10
+
11
+ Keep names short. The type prefix indicates what the component is.
12
+
13
+ | Type | Prefix | Examples |
14
+ | --- | --- | --- |
15
+ | Jig (screen) | `jig-` | `jig-customer-create`, `jig-customer-list`, `jig-customer-view` |
16
+ | Action | `act-` | `act-customer-save`, `act-customers-sync` |
17
+ | Datasource | `data-` | `data-select-customers`, `data-select-customer` |
18
+ | Function (REST) | `rest-` | `rest-get-customers`, `rest-put-customer` |
19
+
20
+ Functions are the exception — prefix with the call type and HTTP method: `rest-get-`, `rest-put-`, `rest-post-`, `rest-delete-`.
21
+
22
+ ## TypeScript file names match the component ID
23
+
24
+ ```
25
+ src/
26
+ ├── screens/
27
+ │ ├── jig-customer-list.ts # screenId: 'jig-customer-list'
28
+ │ ├── jig-customer-create.ts # screenId: 'jig-customer-create'
29
+ │ └── jig-customer-view.ts # screenId: 'jig-customer-view'
30
+ ├── functions/
31
+ │ └── rest-put-customer.ts # functionId: 'rest-put-customer'
32
+ ├── actions/
33
+ │ └── act-customer-save.ts # actionId: 'act-customer-save'
34
+ ```
35
+
36
+ ## Function export names
37
+
38
+ Use camelCase matching the file name:
39
+
40
+ ```typescript
41
+ // jig-customer-list.ts
42
+ export function jigCustomerList(app: ApplicationBuilder): void { ... }
43
+
44
+ // act-customer-save.ts
45
+ export function actCustomerSave(app: ApplicationBuilder): void { ... }
46
+
47
+ // rest-put-customer.ts
48
+ export function restPutCustomer(app: ApplicationBuilder): void { ... }
49
+ ```
50
+
51
+ ## Constants use the component IDs
52
+
53
+ ```typescript
54
+ export const SCREEN = {
55
+ CUSTOMER_LIST: 'jig-customer-list',
56
+ CUSTOMER_CREATE: 'jig-customer-create',
57
+ CUSTOMER_VIEW: 'jig-customer-view',
58
+ } as const
59
+
60
+ export const ACTION = {
61
+ CUSTOMER_SAVE: 'act-customer-save',
62
+ CUSTOMER_SAVE_REMOTE: 'act-customer-save-remote',
63
+ } as const
64
+
65
+ export const FUNCTION = {
66
+ REST_PUT_CUSTOMER: 'rest-put-customer',
67
+ } as const
68
+
69
+ export const GLOBAL_DATASOURCE = {
70
+ CONFIG: 'data-select-config',
71
+ CUSTOMERS: 'data-select-customers',
72
+ CUSTOMER_TO_SAVE: 'data-select-customer-to-save',
73
+ } as const
74
+
75
+ export const ENTITY = {
76
+ CONFIG: { TABLE: 'config', FQN: 'default/config' },
77
+ CUSTOMERS: { TABLE: 'customers', FQN: 'default/customers' },
78
+ CONTACTS: { TABLE: 'contacts', FQN: 'default/contacts' },
79
+ } as const
80
+ ```
81
+
82
+ ## Field naming convention
83
+
84
+ Name `instanceId` values to match the external schema field names. This makes the form component state (`@ctx.components.<instanceId>.state.value`) naturally map to the expected data shape.
85
+
86
+ For fields in nested schema objects that collide (e.g., `Phone1` exists on both `PrimaryContact` and `MainContact`), prefix with the parent: `PrimaryContact-Phone1`, `MainContact-Phone1`.
87
+
88
+ Fields on separate tab screens don't collide — each screen has its own component namespace.
89
+
90
+ ## Config naming convention
91
+
92
+ Config field names are case-sensitive. Keep the Acumatica URL fields identical everywhere:
93
+
94
+ - REST: `acumaticaURL`
95
+ - OData: `acumaticaOdataURL`
96
+
97
+ Use the same casing in:
98
+
99
+ - `default/config` data
100
+ - datasource expressions such as `@ctx.datasources.data-select-config.data.acumaticaURL`
101
+ - function path parameters
102
+ - action `parameters`
@@ -0,0 +1,92 @@
1
+ ## Display in Titles
2
+
3
+ Date fields store ISO 8601 strings. When referencing in `submissionItemTitle`, `submissionItemSubtitle`, arrayField `title`/`subtitle`/`description`, or step `title`, **always wrap in `FormatBuilder`** with a `dateFormat` option — otherwise unreadable ISO strings like `"2024-01-15T14:30:00Z"` display.
4
+
5
+ Recommended `dateFormat` by mode:
6
+
7
+ | Mode | Format | Example |
8
+ | --- | --- | --- |
9
+ | `'date'` | `'LL'` | January 15, 2024 |
10
+ | `'time'` | `'LT'` | 3:28 PM |
11
+ | `'datetime'` | `'LLL'` | January 15, 2024 3:28 PM |
12
+
13
+ **Ref:** `./formatting.md` for `FormatBuilder` usage, date format codes, and examples
14
+
15
+ ## Date Field Modes
16
+
17
+ ```typescript
18
+ // Date only (default)
19
+ step.addDate({
20
+ name: 'birthday',
21
+ label: 'Date of Birth',
22
+ })
23
+ // Time only
24
+ step.addDate({
25
+ name: 'meeting-time',
26
+ label: 'Meeting Time',
27
+ mode: 'time',
28
+ })
29
+ // Date and time
30
+ step.addDate({
31
+ name: 'appointment',
32
+ label: 'Appointment',
33
+ mode: 'datetime',
34
+ })
35
+ ```
36
+
37
+ ## Date Constraints (min/max)
38
+
39
+ Restrict selectable dates with `minimum` and `maximum`:
40
+
41
+ ```typescript
42
+ // Future dates only (min = today)
43
+ step.addDate({
44
+ name: 'booking-date',
45
+ label: 'Booking Date',
46
+ minimum: '2024-01-01',
47
+ })
48
+ // Date range constraint
49
+ step.addDate({
50
+ name: 'event-date',
51
+ label: 'Event Date',
52
+ minimum: '2024-01-01',
53
+ maximum: '2024-12-31',
54
+ })
55
+ ```
56
+
57
+ ## Dynamic Constraints
58
+
59
+ Use JsonataBuilder for dynamic min/max values:
60
+
61
+ ```typescript
62
+ // Minimum from current date
63
+ step.addDate({
64
+ name: 'future-date',
65
+ label: 'Select Future Date',
66
+ minimum: new JsonataBuilder('$now()'),
67
+ })
68
+ // Maximum 6 months from now
69
+ step.addDate({
70
+ name: 'deadline',
71
+ label: 'Deadline',
72
+ maximum: new JsonataBuilder('$fromMillis($millis() + 180*24*60*60*1000)'),
73
+ })
74
+ ```
75
+
76
+ ## Date Range (Two Fields)
77
+
78
+ Link start and end dates so end is always after start:
79
+
80
+ ```typescript
81
+ const startDate = step.addDate({
82
+ name: 'start-date',
83
+ label: 'Start Date',
84
+ minimum: '=$now()',
85
+ })
86
+ // End date must be after start date
87
+ step.addDate({
88
+ name: 'end-date',
89
+ label: 'End Date',
90
+ minimum: startDate.state.value,
91
+ })
92
+ ```