@cxtms/cx-schema 1.9.263 → 1.9.265

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.9.263",
3
+ "version": "1.9.265",
4
4
  "description": "Schema validation package for CXTMS YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,6 +19,9 @@
19
19
  "src": {
20
20
  "description": "Image URL. Falls back to initials when empty or failed to load"
21
21
  },
22
+ "text": {
23
+ "description": "Explicit fallback text displayed after src and before generated initials. Template-aware; text longer than two characters scales to fit"
24
+ },
22
25
  "firstName": {
23
26
  "description": "Explicit first name (organization user form). Takes priority over name"
24
27
  },
@@ -79,7 +82,7 @@
79
82
  }
80
83
  },
81
84
  "additionalProperties": true,
82
- "description": "Circular avatar with automatic two-letter initials. Sources are tried in priority order: src image, firstName + lastName, name, email, then a placeholder user icon.",
85
+ "description": "Circular avatar with explicit text or automatic initials. Sources are tried in priority order: src image, text, firstName + lastName, name, email, then a placeholder user icon.",
83
86
  "x-examples": [
84
87
  {
85
88
  "component": "avatar",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "header": {
79
79
  "type": "object",
80
- "description": "Card header configuration",
80
+ "description": "Card header configuration. title and subheader accept localized values; title, subheader, and icon are template-aware",
81
81
  "additionalProperties": true
82
82
  },
83
83
  "actions": {
@@ -383,6 +383,8 @@ the common cases — use them first. Reach for `eval` only when nothing below fi
383
383
  | `dateDiff` | `{{ dateDiff dueDate startDate }}` | Whole days, first minus second |
384
384
  | `daysBetween` | `{{ daysBetween pickupDate deliveryDate }}` | Absolute day difference |
385
385
  | `daysUntil` / `daysAgo` | `{{ daysUntil dueDate }}` | Days between now and the date |
386
+ | `minutesAgo` | `{{ minutesAgo arrivedAt }}` | Whole minutes from the date to now; null for missing/invalid dates |
387
+ | `elapsed` | `{{ elapsed arrivedAt departedAt }}` | Elapsed hours/minutes (`1h 05m`); optional end path, otherwise now |
386
388
  | `isDateBefore` / `isDateAfter` | `{{ isDateBefore pickupDate deliveryDate }}` | Date comparison |
387
389
  | `hasPermission` | `{{ hasPermission Orders/Update }}` | Current user permission check |
388
390
  | `fromConfig` | `{{ fromConfig apps.myFeature key }}` | Organization config lookup |
@@ -281,7 +281,7 @@ Composable MUI ListItem with component slots and built-in popover menu.
281
281
  | `secondaryComponent` | `ComponentProps` | Secondary text area component |
282
282
  | `avatarComponent` | `ComponentProps` | Avatar slot component |
283
283
  | `secondaryAction` | `ComponentProps` | Right-side action component |
284
- | `selected` | `boolean` | Visual selection state |
284
+ | `selected` | `boolean \| template string` | Visual selection state; templates resolve against props, variables, and store values |
285
285
  | `disabled` | `boolean` | Disabled state |
286
286
  | `divider` | `boolean` | Bottom divider |
287
287
  | `button` | `boolean` | Render as ListItemButton |
@@ -291,6 +291,8 @@ Composable MUI ListItem with component slots and built-in popover menu.
291
291
 
292
292
  **Events:** `onClick`, `menu.items[].onClick`
293
293
 
294
+ Both event forms receive `sender`, the component's named `actions`, and the active React Hook Form/custom form context (with Formik retained for compatibility), so list-item actions can read or update the surrounding form.
295
+
294
296
  **Children:** Fallback — rendered when no primary/secondary components.
295
297
 
296
298
  ```yaml
@@ -521,12 +521,13 @@ props:
521
521
 
522
522
  ## avatar
523
523
 
524
- Template-aware display component for compact entity cards and planner headers. Circular avatar with automatic two-letter initials. Sources tried in priority order: `src` image → `firstName` + `lastName` → `name` → `email` → placeholder user icon. Color is picked deterministically from the theme palette by hashing `colorSeed`.
524
+ Template-aware display component for compact entity cards and planner headers. Circular avatar with explicit text or automatic two-letter initials. Sources tried in priority order: `src` image → `text` → `firstName` + `lastName` → `name` → `email` → placeholder user icon. Color is picked deterministically from the theme palette by hashing `colorSeed`.
525
525
 
526
526
  **Props (all template-parsed):**
527
527
  | Prop | Type | Description |
528
528
  |------|------|-------------|
529
529
  | `src` | `string` | Image URL; falls back to initials when empty or broken |
530
+ | `text` | `string` | Explicit fallback text after `src`; values longer than two characters scale to fit |
530
531
  | `name` | `string` | Full name: `Andre Kovac` → AK, `Kovac, Andre` → AK, `Madonna` → MA |
531
532
  | `firstName` / `lastName` | `string` | Explicit name parts (organization user form); take priority over `name` |
532
533
  | `email` | `string` | Last text fallback: local part, digits dropped (`andre.kovac@…` → AK) |
@@ -624,7 +625,7 @@ Icon renderer. Supports FontAwesome, Tabler, and Feather icons.
624
625
  **Props:**
625
626
  | Prop | Type | Description |
626
627
  |------|------|-------------|
627
- | `icon` | `string` | Icon name: FontAwesome name, `tabler-*` class, or `activity` |
628
+ | `icon` | `string` | Template-aware icon name: FontAwesome name, `tabler-*` class, or `activity`; resolves against variables and store values |
628
629
  | `color` | `string` | MUI palette color (e.g., `primary`, `error.light`) or CSS color |
629
630
  | `iconColor` | `string` | Higher-priority color override |
630
631
  | `style` | `object` | Inline styles |
@@ -633,7 +634,7 @@ Icon renderer. Supports FontAwesome, Tabler, and Feather icons.
633
634
  component: icon
634
635
  name: statusIcon
635
636
  props:
636
- icon: check-circle
637
+ icon: "{{ item.statusIcon }}"
637
638
  color: success
638
639
  ```
639
640
 
@@ -519,13 +519,15 @@ MUI Card container with optional header, content, and actions.
519
519
  | `className` | `string` | — | Additional CSS class |
520
520
  | `bgcolor` | `string` | — | Background color |
521
521
  | `color` | `string` | — | Text color |
522
- | `header` | `{title?, subheader?, icon?, iconColor?, sx?}` | — | Renders MUI CardHeader; icon is its avatar |
522
+ | `header` | `{title?, subheader?, icon?, iconColor?, sx?}` | — | Renders MUI CardHeader; title/subheader may be localized and title, subheader, and icon are template-aware |
523
523
  | `disableContentWrapper` | `boolean` | `false` | Skip CardContent wrapper |
524
524
  | `contentSx` | `SxProps` | — | CardContent styles |
525
525
  | `contentClassName` | `string` | `card-content` | CardContent CSS class |
526
526
 
527
527
  **Children:** Yes — wrapped in CardContent (unless `disableContentWrapper`).
528
528
 
529
+ When `onClick` is present, the card is keyboard accessible: Enter and Space activate it and a focus outline is shown. Actions receive the card name as `sender`; keyboard events from nested interactive controls are ignored.
530
+
529
531
  ```yaml
530
532
  component: card
531
533
  name: summaryCard