@nebularstreams/libmui 2.0.3 → 2.0.5
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/dist/libui.css +15 -1
- package/dist/libui.esm.js +1 -1
- package/dist/libui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/css/fontawesome/brands.min.css +16 -0
- package/src/css/fontawesome/fontawesome-ext.css +7 -0
- package/src/css/fontawesome/fontawesome-solid.css +17 -0
- package/src/css/fontawesome/fontawesome.css +4359 -0
- package/src/index.js +8 -2
- package/src/style.js +5 -0
- package/src/widgets/TitleBarWidget.js +60 -0
package/src/index.js
CHANGED
|
@@ -8,10 +8,12 @@ import SwitchWidget from "./widgets/SwitchWidget";
|
|
|
8
8
|
import * as OverflowUtils from "./widgets/OverflowUtils";
|
|
9
9
|
import {clearModal, popupMessage} from "./util/widgets";
|
|
10
10
|
import Separator from "./widgets/Separator";
|
|
11
|
+
import TitleBarWidget from "./widgets/TitleBarWidget";
|
|
11
12
|
import RangeWidget from "./widgets/RangeWidget";
|
|
12
13
|
import startApp from "./app/app"
|
|
13
14
|
import defineWidget from "./util/widgets.utils";
|
|
14
|
-
|
|
15
|
+
import {OverflowMenu} from "./util/widgets.core";
|
|
16
|
+
import {confirm, confirmPromise} from "./util/fuckingconfirm.js"
|
|
15
17
|
import "./style.js"
|
|
16
18
|
|
|
17
19
|
export {
|
|
@@ -22,13 +24,17 @@ export {
|
|
|
22
24
|
Icon,
|
|
23
25
|
InputWidget,
|
|
24
26
|
NoticeWidget,
|
|
27
|
+
OverflowMenu,
|
|
25
28
|
OverflowUtils,
|
|
26
29
|
RangeWidget,
|
|
27
30
|
Selector,
|
|
28
31
|
SwitchWidget,
|
|
29
32
|
Separator,
|
|
33
|
+
TitleBarWidget,
|
|
30
34
|
clearModal,
|
|
31
35
|
popupMessage,
|
|
32
36
|
startApp,
|
|
33
|
-
defineWidget
|
|
37
|
+
defineWidget,
|
|
38
|
+
confirm,
|
|
39
|
+
confirmPromise
|
|
34
40
|
}
|
package/src/style.js
CHANGED
|
@@ -7,3 +7,8 @@ import "./css/b-root-bootstrap-ext.css"
|
|
|
7
7
|
import "./css/b-root-semantic-flex.css"
|
|
8
8
|
import "./css/b-root-semantic-size.css"
|
|
9
9
|
import "./css/a-measures.css"
|
|
10
|
+
|
|
11
|
+
import "./css/fontawesome/fontawesome.css"
|
|
12
|
+
import "./css/fontawesome/fontawesome-solid.css"
|
|
13
|
+
import "./css/fontawesome/fontawesome-ext.css"
|
|
14
|
+
import "./css/fontawesome/brands.min.css"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import m from "mithril"
|
|
2
|
+
import {ButtonNew, defineWidget} from "./Basic";
|
|
3
|
+
import InputWidget from "./InputWidget.js"
|
|
4
|
+
import {OverflowMenu} from "../util/widgets.core.js"
|
|
5
|
+
|
|
6
|
+
const TitleBarWidget = defineWidget(
|
|
7
|
+
({attrs, dom}) => m(
|
|
8
|
+
".titlebar.noshrink.flexrow",
|
|
9
|
+
{
|
|
10
|
+
class: (attrs.class ? " " + attrs.class : "unitheight bg-window-hi pad-2 pad-h shadow-2 font-125"),
|
|
11
|
+
...attrs.onTitleClick && {onclick: attrs.onTitleClick}
|
|
12
|
+
},
|
|
13
|
+
[
|
|
14
|
+
...attrs.onClick ? [m(ButtonNew, {icon: "arrow-left", onClick: () => attrs.onClick()})] : [],
|
|
15
|
+
|
|
16
|
+
...attrs.logo
|
|
17
|
+
? [m("img.title-logo", {src: attrs.logo})]
|
|
18
|
+
: [],
|
|
19
|
+
...(attrs.editable && attrs.onchange)
|
|
20
|
+
? [
|
|
21
|
+
m(InputWidget, {
|
|
22
|
+
containerClass: "grows" + (attrs.onClick ? "" : " pad-2 pad-h"),
|
|
23
|
+
hint: attrs.title, // attrs.hint,
|
|
24
|
+
onchange: attrs.onchange,
|
|
25
|
+
oninput: () => {
|
|
26
|
+
},
|
|
27
|
+
value: attrs.value
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
: [m("span.grows.ellipsis", {class: attrs.onClick ? "" : "pad-2 pad-h"}, attrs.title)],
|
|
31
|
+
|
|
32
|
+
...attrs.auxaction ? [m(ButtonNew, {icon: attrs.auxaction.icon, onClick: attrs.auxaction.onClick})] : [],
|
|
33
|
+
...attrs.auxactions
|
|
34
|
+
? attrs.auxactions.map((action) => m(ButtonNew, {
|
|
35
|
+
class: action.class,
|
|
36
|
+
title: action.title,
|
|
37
|
+
icon: action.icon,
|
|
38
|
+
text: action.caption,
|
|
39
|
+
onClick: action.onClick
|
|
40
|
+
}))
|
|
41
|
+
: [],
|
|
42
|
+
...attrs.action ? [m(ButtonNew, {icon: attrs.action.icon, onClick: attrs.action.onClick})] : [],
|
|
43
|
+
...attrs.overflow
|
|
44
|
+
? [
|
|
45
|
+
m(ButtonNew, {
|
|
46
|
+
icon: attrs.overflow.icon || "ellipsis-v",
|
|
47
|
+
class: attrs.overflow.class || "",
|
|
48
|
+
onClick: () => OverflowMenu(
|
|
49
|
+
dom,
|
|
50
|
+
{title: attrs.title},
|
|
51
|
+
attrs.overflow.items
|
|
52
|
+
)
|
|
53
|
+
.then(({action}) => action.onClick())
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
: []
|
|
57
|
+
])
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export default TitleBarWidget;
|