@web-atoms/web-controls 2.1.6 → 2.1.7
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.
|
@@ -6,8 +6,9 @@ export interface IMenuItem {
|
|
|
6
6
|
eventClick?: any;
|
|
7
7
|
href?: string;
|
|
8
8
|
target?: string;
|
|
9
|
+
[key: string]: any;
|
|
9
10
|
}
|
|
10
|
-
export declare function MenuItem(
|
|
11
|
+
export declare function MenuItem({ label, icon, eventClick, href, target, ...others }: IMenuItem): any;
|
|
11
12
|
export declare class MenuItemTemplate extends AtomControl {
|
|
12
13
|
data: IMenuItem;
|
|
13
14
|
create(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupButton.d.ts","sourceRoot":"","sources":["../../src/basic/PopupButton.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAYlC,MAAM,WAAW,SAAS;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PopupButton.d.ts","sourceRoot":"","sources":["../../src/basic/PopupButton.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAYlC,MAAM,WAAW,SAAS;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,MAAM,EACN,GAAI,MAAM,EACb,EAAE,SAAS,OAUX;AAED,qBAAa,gBAAiB,SAAQ,WAAW;IAEtC,IAAI,EAAE,SAAS,CAAC;IAEhB,MAAM;CAahB;AAuED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,KAAK,EAAE,QAAQ,EAAG,GAAI,KAAK,EAAE,SAAS,EAAE,OAK5E"}
|
|
@@ -7,13 +7,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
10
21
|
(function (factory) {
|
|
11
22
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
12
23
|
var v = factory(require, exports);
|
|
13
24
|
if (v !== undefined) module.exports = v;
|
|
14
25
|
}
|
|
15
26
|
else if (typeof define === "function" && define.amd) {
|
|
16
|
-
define(["require", "exports", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/BindableProperty", "@web-atoms/core/dist/core/Colors", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/StyleRule", "@web-atoms/core/dist/web/controls/AtomControl", "@web-atoms/core/dist/web/
|
|
27
|
+
define(["require", "exports", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/BindableProperty", "@web-atoms/core/dist/core/Colors", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/StyleRule", "@web-atoms/core/dist/web/controls/AtomControl", "@web-atoms/core/dist/web/services/PopupService", "@web-atoms/core/dist/web/styles/CSS", "./combineClasses", "./Button"], factory);
|
|
17
28
|
}
|
|
18
29
|
})(function (require, exports) {
|
|
19
30
|
"use strict";
|
|
@@ -25,7 +36,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
36
|
const XNode_1 = require("@web-atoms/core/dist/core/XNode");
|
|
26
37
|
const StyleRule_1 = require("@web-atoms/core/dist/style/StyleRule");
|
|
27
38
|
const AtomControl_1 = require("@web-atoms/core/dist/web/controls/AtomControl");
|
|
28
|
-
const AtomItemsControl_1 = require("@web-atoms/core/dist/web/controls/AtomItemsControl");
|
|
29
39
|
const PopupService_1 = require("@web-atoms/core/dist/web/services/PopupService");
|
|
30
40
|
const CSS_1 = require("@web-atoms/core/dist/web/styles/CSS");
|
|
31
41
|
const combineClasses_1 = require("./combineClasses");
|
|
@@ -37,15 +47,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
37
47
|
.borderRadius(5)
|
|
38
48
|
.cursor("pointer")
|
|
39
49
|
.hoverBackgroundColor(Colors_1.default.lightGreen)));
|
|
40
|
-
function MenuItem(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
return menu;
|
|
50
|
+
function MenuItem(_a) {
|
|
51
|
+
var { label, icon, eventClick, href, target } = _a, others = __rest(_a, ["label", "icon", "eventClick", "href", "target"]);
|
|
52
|
+
if (label) {
|
|
53
|
+
return XNode_1.default.create("div", Object.assign({ class: "menu", eventClick: eventClick }, others),
|
|
54
|
+
XNode_1.default.create("i", { class: icon }));
|
|
55
|
+
}
|
|
56
|
+
return XNode_1.default.create("div", Object.assign({ class: "menu", eventClick: eventClick }, others),
|
|
57
|
+
XNode_1.default.create("i", { class: icon }));
|
|
49
58
|
}
|
|
50
59
|
exports.MenuItem = MenuItem;
|
|
51
60
|
class MenuItemTemplate extends AtomControl_1.AtomControl {
|
|
@@ -76,10 +85,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
76
85
|
this.popup.dispose();
|
|
77
86
|
return;
|
|
78
87
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
const menus = this.menus;
|
|
89
|
+
class Popup extends AtomControl_1.AtomControl {
|
|
90
|
+
create() {
|
|
91
|
+
this.render(XNode_1.default.create("div", { class: menuCss }, ...menus));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const items = new Popup(this.app, document.createElement("div"));
|
|
83
95
|
items.registerDisposable({
|
|
84
96
|
dispose: () => {
|
|
85
97
|
this.popup = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupButton.js","sourceRoot":"","sources":["../../src/basic/PopupButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PopupButton.js","sourceRoot":"","sources":["../../src/basic/PopupButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,yDAAkD;IAClD,iFAA8E;IAC9E,6DAAsD;IAEtD,2DAAoD;IACpD,oEAA6D;IAC7D,+EAA4E;IAE5E,iFAA0E;IAC1E,6DAAsD;IACtD,qDAA8C;IAC9C,qCAA8B;IAG9B,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,IAAA,mBAAS,GAAE;SAC1B,KAAK,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC;SACpB,OAAO,CAAC,CAAC,CAAC;SACV,MAAM,CAAC,CAAC,CAAC;SACT,YAAY,CAAC,CAAC,CAAC;S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ALD,8BAKC"}
|
package/package.json
CHANGED
|
@@ -28,18 +28,26 @@ export interface IMenuItem {
|
|
|
28
28
|
eventClick?: any;
|
|
29
29
|
href?: string;
|
|
30
30
|
target?: string;
|
|
31
|
+
[key: string]: any;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
export function MenuItem(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
export function MenuItem({
|
|
35
|
+
label,
|
|
36
|
+
icon,
|
|
37
|
+
eventClick,
|
|
38
|
+
href,
|
|
39
|
+
target,
|
|
40
|
+
... others
|
|
41
|
+
}: IMenuItem) {
|
|
42
|
+
|
|
43
|
+
if (label) {
|
|
44
|
+
return <div class="menu" eventClick={eventClick} { ... others }>
|
|
45
|
+
<i class={icon}/>
|
|
46
|
+
</div>;
|
|
47
|
+
}
|
|
48
|
+
return <div class="menu" eventClick={eventClick} { ... others }>
|
|
49
|
+
<i class={icon}/>
|
|
50
|
+
</div>;
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
export class MenuItemTemplate extends AtomControl {
|
|
@@ -105,10 +113,16 @@ class PopupMenuButton extends AtomControl {
|
|
|
105
113
|
return;
|
|
106
114
|
}
|
|
107
115
|
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
const menus = this.menus;
|
|
117
|
+
|
|
118
|
+
class Popup extends AtomControl {
|
|
119
|
+
protected create(): void {
|
|
120
|
+
this.render(<div class={menuCss}>
|
|
121
|
+
{ ... menus}
|
|
122
|
+
</div>);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const items = new Popup(this.app, document.createElement("div"));
|
|
112
126
|
items.registerDisposable({
|
|
113
127
|
dispose: () => {
|
|
114
128
|
this.popup = null;
|