@nebularstreams/libmui 2.5.95 → 2.5.97

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebularstreams/libmui",
3
3
  "description": "Micro UI based on Mithril",
4
- "version": "2.5.95",
4
+ "version": "2.5.97",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
@@ -289,7 +289,7 @@ const
289
289
  : targetSource;
290
290
 
291
291
  // targetSource estaba antes, targetParameters incluye TARGET !!!!
292
- if ( !parameters || (whenner && !checkWhen(whenner, parameters, auxParameters, targetParameters))) {
292
+ if (!parameters || (whenner && !checkWhen(whenner, parameters, auxParameters, targetParameters))) {
293
293
  return [];
294
294
  }
295
295
 
@@ -397,7 +397,7 @@ const
397
397
  ? Array.isArray(rawValue)
398
398
  ? rawValue.map((item, index) => m(CardieWidget, {
399
399
  class: "relative grows " + (metaDef.class || "emby w-max") + (metaDef.dynClass ? " " + metaDef.dynClass(parameters, auxParameters) : ""),
400
- title: metaDef.dynTitle ? metaDef.dynTitle(parameters, auxParameters) : metaDef.title+" "+(index+1),
400
+ title: metaDef.dynTitle ? metaDef.dynTitle(parameters, auxParameters) : metaDef.title + " " + (index + 1),
401
401
  cardid: metaDef.cardid + "-" + index,
402
402
  nofold: false,
403
403
  size: metaDef.margin || 0,
@@ -429,8 +429,17 @@ const
429
429
  ],
430
430
  titleExpended: metaDef.titleExpanded || metaDef.hint,
431
431
  titleCollapsed: metaDef.titleCollapsed || metaDef.hint,
432
- }))
432
+ })).concat(metaDef.addAction ? [
433
+ m(ButtonNew, {
434
+ ...metaDef.addAction,
435
+ onClick: (e) => {
436
+ metaDef.addAction.onClick(e, parameters, auxParameters);
437
+ m.redraw();
438
+ }
439
+ })
440
+ ] : [])
433
441
  : []
442
+
434
443
  : isCardie
435
444
  ? [
436
445
  m(CardieWidget, {
@@ -463,7 +472,16 @@ const
463
472
  auxTargetIsDefault: attrs.auxTargetIsDefault,
464
473
  AssetButton: attrs.AssetButton,
465
474
  CodeMirror: attrs.CodeMirror
466
- })
475
+ }),
476
+ ...metaDef.addAction ? [
477
+ m(ButtonNew, {
478
+ ...metaDef.addAction,
479
+ onClick: (e) => {
480
+ metaDef.addAction.onClick(e, parameters, auxParameters);
481
+ m.redraw();
482
+ }
483
+ })
484
+ ] : []
467
485
  ],
468
486
  titleExpended: metaDef.titleExpanded || metaDef.hint,
469
487
  titleCollapsed: metaDef.titleCollapsed || metaDef.hint,