@nebularstreams/libmui 2.5.120 → 2.5.122

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.120",
4
+ "version": "2.5.122",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
@@ -410,14 +410,9 @@ const
410
410
  },
411
411
  isCardieArray
412
412
  ? Array.isArray(rawValue)
413
- ? rawValue.map((item, index) => m(CardieWidget, {
414
- class: "relative grows " + (metaDef.class || "pad-h emby w-max") + (metaDef.dynClass ? " " + metaDef.dynClass(parameters, auxParameters, index) : ""),
415
- title: metaDef.dynTitle ? metaDef.dynTitle(parameters, auxParameters, index) : metaDef.title + " " + (index + 1),
416
- cardid: metaDef.cardid + "-" + index,
417
- nofold: false,
418
- size: metaDef.margin || 0,
419
- expandedView: () => [
420
- m(ParameterTable, {
413
+ ? rawValue.map(
414
+ (item, index) => metaDef.small
415
+ ? m(ParameterTable, {
421
416
  meta: metaDef.items,
422
417
  crit: {},
423
418
  when: {},
@@ -426,6 +421,8 @@ const
426
421
  parameters: item,
427
422
  auxParameters,
428
423
 
424
+ arrayInfo: {source: rawValue, index},
425
+
429
426
  global,
430
427
  clone,
431
428
  onchange,
@@ -441,22 +438,56 @@ const
441
438
  AssetButton: attrs.AssetButton,
442
439
  CodeMirror: attrs.CodeMirror
443
440
  })
444
- ],
445
- titleExpended: metaDef.titleExpanded || metaDef.hint,
446
- titleCollapsed: metaDef.titleCollapsed || metaDef.hint,
447
- })).concat(metaDef.addAction ? [
448
- m(ButtonNew, {
449
- ...metaDef.addAction,
450
- onClick: (e) => {
451
- if (metaDef.addAction.onClick) {
452
- metaDef.addAction.onClick(e, parameters, auxParameters);
453
- } else if (metaDef.addAction.template) {
454
- rawValue.push(cloneObject(metaDef.addAction.template));
455
- }
456
- m.redraw();
457
- }
458
- })
459
- ] : [])
441
+ : m(CardieWidget, {
442
+ class: "relative grows " + (metaDef.class || "pad-h emby w-max") + (metaDef.dynClass ? " " + metaDef.dynClass(parameters, auxParameters, index) : ""),
443
+ title: metaDef.dynTitle ? metaDef.dynTitle(parameters, auxParameters, index) : metaDef.title + " " + (index + 1),
444
+ cardid: metaDef.cardid + "-" + index,
445
+ nofold: false,
446
+ size: metaDef.margin || 0,
447
+ expandedView: () => [
448
+ m(ParameterTable, {
449
+ meta: metaDef.items,
450
+ crit: {},
451
+ when: {},
452
+ sizes: {},
453
+
454
+ parameters: item,
455
+ auxParameters,
456
+
457
+ global,
458
+ clone,
459
+ onchange,
460
+ itemClass,
461
+ wrapper,
462
+ empty: vacioperovacio,
463
+ itemsDict: attrs.itemsDict,
464
+ layer: attrs.layer,
465
+ onAction: attrs.onAction,
466
+ optionsDict: attrs.optionsDict,
467
+ play: attrs.play,
468
+ auxTargetIsDefault: false,
469
+ AssetButton: attrs.AssetButton,
470
+ CodeMirror: attrs.CodeMirror
471
+ })
472
+ ],
473
+ titleExpended: metaDef.titleExpanded || metaDef.hint,
474
+ titleCollapsed: metaDef.titleCollapsed || metaDef.hint,
475
+ })
476
+ )
477
+ .concat(
478
+ metaDef.addAction ? [
479
+ m(ButtonNew, {
480
+ ...metaDef.addAction,
481
+ onClick: (e) => {
482
+ if (metaDef.addAction.onClick) {
483
+ metaDef.addAction.onClick(e, parameters, auxParameters);
484
+ } else if (metaDef.addAction.template) {
485
+ rawValue.push(cloneObject(metaDef.addAction.template));
486
+ }
487
+ m.redraw();
488
+ }
489
+ })
490
+ ] : [])
460
491
  : []
461
492
 
462
493
  : isCardie
@@ -538,11 +569,11 @@ const
538
569
  )
539
570
  : metaDef.attrs,
540
571
 
541
- metaDef.children
542
- ? metaDef.children(rawValue, state, (critical, rootParameters) => {
543
- onchange(critical || UPDATECODE, rootParameters ? parameters : targetParameters, metaKey, undefined, metaDef);
544
- }, global, attrs, targetParameters)
545
- : [])
572
+ metaDef.children
573
+ ? metaDef.children(rawValue, state, (critical, rootParameters) => {
574
+ onchange(critical || UPDATECODE, rootParameters ? parameters : targetParameters, metaKey, undefined, metaDef);
575
+ }, global, attrs, targetParameters)
576
+ : [])
546
577
  ]
547
578
  : isPlusMinus
548
579
  ? [
@@ -813,7 +844,7 @@ const
813
844
  if (metaDef.onClick) {
814
845
  metaDef.onClick(metaKey, e, targetParameters, auxParameters, global, attrs);
815
846
  } else {
816
- if (attrs.onAction) attrs.onAction(metaKey, e, targetSource);
847
+ if (attrs.onAction) attrs.onAction(metaKey, e, targetSource, attrs.arrayInfo);
817
848
  }
818
849
  };
819
850