@nebularstreams/libmui 2.0.18 → 2.5.1

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.0.18",
4
+ "version": "2.5.1",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/src/index.js CHANGED
@@ -1,5 +1,3 @@
1
- import m from "mithril";
2
-
3
1
  import {Button, ButtonNew, Icon, Empty, Selector, Notification} from "./widgets/Basic";
4
2
  import CardieWidget from "./widgets/CardieWidget";
5
3
  import ButtonChoiceWidget from "./widgets/ButtonChoiceWidget";
@@ -1,39 +1,36 @@
1
- const
1
+ import m from "mithril"
2
+ import {defineWidget, ButtonNew, Empty} from "./Basic.js"
2
3
 
3
- m = require("mithril"),
4
- defineWidget = require("util.definewidget"),
5
-
6
- { ButtonNew, Empty } = require("app.widgets");
7
4
 
8
5
  const EmptyButton = defineWidget(
9
- ({ attrs }) => m(
10
- Empty,
11
- {
12
- size: 2,
13
- icon: attrs.icon,
14
- class: "pad-2"
15
- },
16
- [
17
- ...attrs.texts
18
- .map((text) => m(".text", text)),
19
- ...attrs.buttonText ? [
20
- m(ButtonNew, {
21
- class: "font-125 accentbutton unitheightsmall",
22
- icon: attrs.icon || "plus",
23
- text: attrs.buttonText,
24
- onClick: attrs.onClick
25
- })
26
- ] : [],
27
- ...attrs.buttonAlt ? [
28
- m(ButtonNew, {
29
- class: "font-125 accentbutton unitheightsmall",
30
- icon: attrs.iconAlt || "plus",
31
- text: attrs.buttonTextAlt,
32
- onClick: attrs.onClick
33
- })
34
- ] : []
35
- ]
36
- )
6
+ ({attrs}) => m(
7
+ Empty,
8
+ {
9
+ size: 2,
10
+ icon: attrs.icon,
11
+ class: "pad-2"
12
+ },
13
+ [
14
+ ...attrs.texts
15
+ .map((text) => m(".text", text)),
16
+ ...attrs.buttonText ? [
17
+ m(ButtonNew, {
18
+ class: "font-125 accentbutton unitheightsmall",
19
+ icon: attrs.icon || "plus",
20
+ text: attrs.buttonText,
21
+ onClick: attrs.onClick
22
+ })
23
+ ] : [],
24
+ ...attrs.buttonAlt ? [
25
+ m(ButtonNew, {
26
+ class: "font-125 accentbutton unitheightsmall",
27
+ icon: attrs.iconAlt || "plus",
28
+ text: attrs.buttonTextAlt,
29
+ onClick: attrs.onClick
30
+ })
31
+ ] : []
32
+ ]
33
+ )
37
34
  );
38
35
 
39
- module.exports = EmptyButton;
36
+ export default EmptyButton;