@asteby/metacore-runtime-react 7.1.2 → 7.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 7.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - c985453: Auto-derive `date_range` filter for `type: 'date'` columns.
8
+
9
+ The zero-config filter chip in 7.1.0 picked the right variant for text/number/boolean/select but mapped `type: 'date'` to a generic text filter. `FilterableColumnHeader` already supports `date_range` — pointing the auto-derive at it makes any column flagged `filterable: true` with `type: 'date'` light up the calendar range picker without app-side glue.
10
+
11
+ ## 7.1.3
12
+
13
+ ### Patch Changes
14
+
15
+ - db1a224: Fix raw i18n keys leaking into the auto-generated CRUD actions dropdown.
16
+
17
+ The auto-Actions column shipped in 7.1.0 looked up `datatable.view_record`, `datatable.edit` and `datatable.delete` — keys that didn't exist in `@asteby/metacore-i18n/locales`, so i18next fell back to the key string and the dropdown rendered "datatable.view_record" instead of "Ver".
18
+
19
+ Two fixes:
20
+ - `@asteby/metacore-i18n`: add `datatable.edit` and `datatable.delete` to the base ES/EN bundles (alongside the pre-existing `datatable.view`).
21
+ - `@asteby/metacore-runtime-react`: lookup `datatable.view` (the real key) and pass `{ defaultValue }` to every action label so a missing bundle never leaks the key into the UI.
22
+
3
23
  ## 7.1.2
4
24
 
5
25
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAER,iBAAiB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAwHD;;;;GAIG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,GAAE,qBAA0B,GACpC,iBAAiB,CAiXnB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBACL,CAAA"}
1
+ {"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAER,iBAAiB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAwHD;;;;GAIG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,GAAE,qBAA0B,GACpC,iBAAiB,CAmXnB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBACL,CAAA"}
@@ -276,24 +276,25 @@ export function makeDefaultGetDynamicColumns(helpers = {}) {
276
276
  // ship.
277
277
  const explicitActions = metadata.actions ?? [];
278
278
  const hasExplicitActions = (metadata.hasActions ?? explicitActions.length > 0) && explicitActions.length > 0;
279
+ const tx = (key, fallback) => t ? t(key, { defaultValue: fallback }) : fallback;
279
280
  const defaultCRUDActions = metadata.enableCRUDActions
280
281
  ? [
281
282
  {
282
283
  key: 'view',
283
284
  name: 'view',
284
- label: t ? t('datatable.view_record') : 'Ver',
285
+ label: tx('datatable.view', 'Ver'),
285
286
  icon: 'Eye',
286
287
  },
287
288
  {
288
289
  key: 'edit',
289
290
  name: 'edit',
290
- label: t ? t('datatable.edit') : 'Editar',
291
+ label: tx('datatable.edit', 'Editar'),
291
292
  icon: 'Pencil',
292
293
  },
293
294
  {
294
295
  key: 'delete',
295
296
  name: 'delete',
296
- label: t ? t('datatable.delete') : 'Eliminar',
297
+ label: tx('datatable.delete', 'Eliminar'),
297
298
  icon: 'Trash2',
298
299
  },
299
300
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AA+B9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AASnF,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACxC;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,GAC/C,EAAE,iBAAiB,2CAsrBnB"}
1
+ {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AA+B9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AASnF,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACxC;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,GAC/C,EAAE,iBAAiB,2CAwrBnB"}
@@ -473,6 +473,7 @@ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColu
473
473
  // - explicit options or searchEndpoint → multi-select dropdown
474
474
  // - boolean → boolean toggle (renders as select under the hood)
475
475
  // - number / number_range / numeric → number range
476
+ // - date → date range picker (start/end calendar)
476
477
  // - everything else (text, email, phone, tags…) → text contains
477
478
  let filterType = 'select';
478
479
  if (hasStaticOptions || hasEndpoint)
@@ -481,6 +482,8 @@ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColu
481
482
  filterType = 'boolean';
482
483
  else if (c.type === 'number')
483
484
  filterType = 'number_range';
485
+ else if (c.type === 'date')
486
+ filterType = 'date_range';
484
487
  else
485
488
  filterType = 'text';
486
489
  const options = hasStaticOptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "7.1.2",
3
+ "version": "7.1.4",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,7 +46,7 @@
46
46
  "@tanstack/react-table": "^8.20.0",
47
47
  "@types/react": "^19.0.0",
48
48
  "date-fns": "^4.1.0",
49
- "i18next": "^23.16.0",
49
+ "i18next": "^26.0.0",
50
50
  "lucide-react": "^0.460.0",
51
51
  "react": "^19.2.4",
52
52
  "react-day-picker": "^8.10.1",
@@ -471,25 +471,27 @@ export function makeDefaultGetDynamicColumns(
471
471
  // ship.
472
472
  const explicitActions = metadata.actions ?? []
473
473
  const hasExplicitActions = (metadata.hasActions ?? explicitActions.length > 0) && explicitActions.length > 0
474
+ const tx = (key: string, fallback: string) =>
475
+ t ? t(key, { defaultValue: fallback }) : fallback
474
476
  const defaultCRUDActions: typeof explicitActions =
475
477
  metadata.enableCRUDActions
476
478
  ? [
477
479
  {
478
480
  key: 'view',
479
481
  name: 'view',
480
- label: t ? t('datatable.view_record') : 'Ver',
482
+ label: tx('datatable.view', 'Ver'),
481
483
  icon: 'Eye',
482
484
  } as any,
483
485
  {
484
486
  key: 'edit',
485
487
  name: 'edit',
486
- label: t ? t('datatable.edit') : 'Editar',
488
+ label: tx('datatable.edit', 'Editar'),
487
489
  icon: 'Pencil',
488
490
  } as any,
489
491
  {
490
492
  key: 'delete',
491
493
  name: 'delete',
492
- label: t ? t('datatable.delete') : 'Eliminar',
494
+ label: tx('datatable.delete', 'Eliminar'),
493
495
  icon: 'Trash2',
494
496
  } as any,
495
497
  ]
@@ -511,11 +511,13 @@ export function DynamicTable({
511
511
  // - explicit options or searchEndpoint → multi-select dropdown
512
512
  // - boolean → boolean toggle (renders as select under the hood)
513
513
  // - number / number_range / numeric → number range
514
+ // - date → date range picker (start/end calendar)
514
515
  // - everything else (text, email, phone, tags…) → text contains
515
516
  let filterType: ColumnFilterConfig['filterType'] = 'select'
516
517
  if (hasStaticOptions || hasEndpoint) filterType = 'select'
517
518
  else if (c.type === 'boolean') filterType = 'boolean'
518
519
  else if (c.type === 'number') filterType = 'number_range'
520
+ else if (c.type === 'date') filterType = 'date_range'
519
521
  else filterType = 'text'
520
522
 
521
523
  const options = hasStaticOptions