efront 3.12.4 → 3.13.2
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/apps/pivot/api.yml +2 -0
- package/apps/pivot/home/welcome.html +1 -1
- package/apps/pivot/home/welcome.js +6 -9
- package/apps/pivot/log/boot.html +2 -0
- package/apps/pivot/log/boot.js +24 -0
- package/apps/pivot/log/boot.less +3 -0
- package/apps/pivot/log/count.html +5 -0
- package/apps/pivot/log/count.js +22 -0
- package/apps/pivot/log/count.less +16 -0
- package/apps/pivot/menu.yml +7 -1
- package/apps/pivot/share/list.less +0 -4
- package/apps/pivot/user/edit.js +1 -0
- package/apps/pivot/user/list.js +4 -0
- package/apps/pivot/user/tag/edit.js +1 -0
- package/apps/pivot/user/tag/list.js +3 -0
- package/coms/basic/parseYML.js +1 -1
- package/coms/basic/renderExpress.js +1 -1
- package/coms/frame/route.js +4 -0
- package/coms/pivot/plist.js +1 -1
- package/coms/zimoli/AudioContext_test.html +1 -1
- package/coms/zimoli/AudioContext_test.js +3 -3
- package/coms/zimoli/bind.js +4 -2
- package/coms/zimoli/cloneVisible.js +9 -2
- package/coms/zimoli/css.js +13 -5
- package/coms/zimoli/data.js +1 -1
- package/coms/zimoli/drag.js +3 -2
- package/coms/zimoli/field.html +15 -10
- package/coms/zimoli/menu.js +33 -13
- package/coms/zimoli/menu.less +31 -9
- package/coms/zimoli/menuItem.js +1 -1
- package/coms/zimoli/menuList.html +5 -3
- package/coms/zimoli/menuList.js +63 -28
- package/coms/zimoli/menuList.less +5 -0
- package/coms/zimoli/model.js +22 -2
- package/coms/zimoli/on.js +5 -3
- package/coms/zimoli/picture.js +30 -335
- package/coms/zimoli/picture_.js +356 -0
- package/coms/zimoli/prompt.js +3 -1
- package/coms/zimoli/render.js +22 -10
- package/coms/zimoli/renderDefaults.js +1 -0
- package/coms/zimoli/search.js +5 -4
- package/coms/zimoli/select.js +12 -8
- package/coms/zimoli/selectList.js +12 -9
- package/coms/zimoli/selectListEdit.js +1 -1
- package/coms/zimoli/slider.js +13 -6
- package/coms/zimoli/success.js +4 -0
- package/coms/zimoli/success.less +13 -0
- package/coms/zimoli/table.html +6 -8
- package/coms/zimoli/table.js +25 -2
- package/coms/zimoli/table.less +24 -4
- package/coms/zimoli/view.less +4 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/apps/pivot/api.yml
CHANGED
|
@@ -6,15 +6,12 @@ function main() {
|
|
|
6
6
|
version: data.from("version"),
|
|
7
7
|
hrtime: data.from("uptime", a => Date.now() - a * 1000),
|
|
8
8
|
filterTime,
|
|
9
|
-
async run(id
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (info) alert(info, 'pass');
|
|
16
|
-
} catch { }
|
|
17
|
-
target.removeAttribute('pending');
|
|
9
|
+
async run(id) {
|
|
10
|
+
await new Promise(ok => setTimeout(ok, 2000));
|
|
11
|
+
var info = await data.from("run", {
|
|
12
|
+
run: id
|
|
13
|
+
}).loading_promise;
|
|
14
|
+
if (info) alert(info, 'pass');
|
|
18
15
|
},
|
|
19
16
|
async logout() {
|
|
20
17
|
data.setSource({});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var fields = refilm`
|
|
2
|
+
地址/ip
|
|
3
|
+
端口/port
|
|
4
|
+
版本/version
|
|
5
|
+
进程/pid
|
|
6
|
+
时间/time date
|
|
7
|
+
`;
|
|
8
|
+
function main() {
|
|
9
|
+
var page = div();
|
|
10
|
+
page.innerHTML = template;
|
|
11
|
+
var items = data.from("bootlog", item => {
|
|
12
|
+
item.forEach(a => {
|
|
13
|
+
var [v, p] = a.ppid.split("/");
|
|
14
|
+
a.version = v;
|
|
15
|
+
a.pid = p;
|
|
16
|
+
})
|
|
17
|
+
return item;
|
|
18
|
+
});
|
|
19
|
+
renderWithDefaults(page, {
|
|
20
|
+
items,
|
|
21
|
+
fields
|
|
22
|
+
});
|
|
23
|
+
return page;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var fields = refilm`
|
|
2
|
+
路径/path html
|
|
3
|
+
访问量/count
|
|
4
|
+
`;
|
|
5
|
+
function main() {
|
|
6
|
+
var page = div();
|
|
7
|
+
page.innerHTML = template;
|
|
8
|
+
var items = data.from("count", a => {
|
|
9
|
+
return Object.keys(a).map(b => ({ path: b, count: a[b] }));
|
|
10
|
+
});
|
|
11
|
+
renderWithDefaults(page, {
|
|
12
|
+
items,
|
|
13
|
+
searchText: "",
|
|
14
|
+
filter() {
|
|
15
|
+
var text = this.searchText;
|
|
16
|
+
if (!text) return this.items = items;
|
|
17
|
+
this.items = search(text, items, 'path');
|
|
18
|
+
},
|
|
19
|
+
fields
|
|
20
|
+
});
|
|
21
|
+
return page;
|
|
22
|
+
}
|
package/apps/pivot/menu.yml
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pedit.bind(null, "用户信息", "user");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pedit.bind(null, "标签", "tag");
|
package/coms/basic/parseYML.js
CHANGED
|
@@ -3,7 +3,7 @@ function createSeek(express) {
|
|
|
3
3
|
express.forEach(function (search) {
|
|
4
4
|
if (dist) {
|
|
5
5
|
if (/[\=]/.test(dist)) dist = `(${dist})`;
|
|
6
|
-
dist =
|
|
6
|
+
dist = `typeof ${dist}!=='undefined'&&${dist}!==null?${dist}${search}:''`
|
|
7
7
|
} else {
|
|
8
8
|
dist = search;
|
|
9
9
|
}
|
package/coms/frame/route.js
CHANGED
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
if (/,/.test(name)) {
|
|
76
76
|
|
|
77
77
|
}
|
|
78
|
+
item.closed = true;
|
|
78
79
|
return item;
|
|
79
80
|
});
|
|
80
81
|
return items;
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
actived = mmap[opened.active] || actived;
|
|
115
116
|
if (actived) {
|
|
116
117
|
if (actived_value === historys.length) {
|
|
118
|
+
setActive(actived, true);
|
|
117
119
|
result.active = actived;
|
|
118
120
|
};
|
|
119
121
|
}
|
|
@@ -123,6 +125,7 @@
|
|
|
123
125
|
var setActive = function (p, active) {
|
|
124
126
|
while (p) {
|
|
125
127
|
p.active = active;
|
|
128
|
+
if (active) p.closed = false;
|
|
126
129
|
p = p.parent;
|
|
127
130
|
}
|
|
128
131
|
};
|
|
@@ -195,6 +198,7 @@
|
|
|
195
198
|
result.then = then;
|
|
196
199
|
return result;
|
|
197
200
|
};
|
|
201
|
+
result.parse = parseMenuList;
|
|
198
202
|
var then = function (ok, oh) {
|
|
199
203
|
if (this.loading_promise) {
|
|
200
204
|
return this.loading_promise.then(ok, oh);
|
package/coms/pivot/plist.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function main(title, type, fields, edit_ref, options) {
|
|
3
3
|
return frame$list(title, {
|
|
4
4
|
load() {
|
|
5
|
-
return data.from("list", { type }, a => JSAM.parse(encode62.timedecode(a)));
|
|
5
|
+
return data.from("list", { type }, a => JSAM.parse(encode62.timedecode(a || '')));
|
|
6
6
|
},
|
|
7
7
|
remove(o) {
|
|
8
8
|
return data.from("edit", { type, key: encode62.timeencode(o.key), value: encode62.timeencode("") }).loading_promise;
|
|
@@ -2,8 +2,8 @@ function piano() {
|
|
|
2
2
|
var res = [];
|
|
3
3
|
var yin = [1, 3, 5, 7, 8, 10, 12].reverse();
|
|
4
4
|
var yue = [2, 4, 6, 9, 11].reverse();
|
|
5
|
-
var c=a => 440 * Math.pow(2, cx + (3 - a) / 12);
|
|
6
|
-
for (var cx = -
|
|
5
|
+
var c = a => 440 * Math.pow(2, cx + (3 - a) / 12);
|
|
6
|
+
for (var cx = -12, dx = 8; cx < dx; cx++) {
|
|
7
7
|
var yinjie1 = yin.map(c);
|
|
8
8
|
var yinjie2 = yue.map(c);
|
|
9
9
|
res.push(yinjie1, yinjie2);
|
|
@@ -23,7 +23,7 @@ function main() {
|
|
|
23
23
|
oscillator.connect(gainNode);
|
|
24
24
|
gainNode.connect(audioCtx.destination);
|
|
25
25
|
oscillator.type = 'sine';
|
|
26
|
-
oscillator.frequency.value = hz;
|
|
26
|
+
oscillator.frequency.value = -hz;
|
|
27
27
|
gainNode.gain.setValueAtTime(0, audioCtx.currentTime);
|
|
28
28
|
gainNode.gain.linearRampToValueAtTime(65536 / Math.log2(hz), audioCtx.currentTime + 0.01);
|
|
29
29
|
oscillator.start(audioCtx.currentTime);
|
package/coms/zimoli/bind.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
function bind(eventName, bindTo = window) {
|
|
2
2
|
return function (target, eventListener) {
|
|
3
3
|
var off;
|
|
4
|
-
var
|
|
4
|
+
var mount = function () {
|
|
5
5
|
if (off) off();
|
|
6
6
|
off = on(eventName).call(bindTo, target, eventListener);
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
|
+
if (isMounted(target)) mount();
|
|
9
|
+
var off1 = on("append")(target, mount);
|
|
8
10
|
var off2 = on("remove")(target, function () {
|
|
9
11
|
if (off) off();
|
|
10
12
|
off = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace".split(",");
|
|
2
|
-
var cloneProperties2 = "position,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");
|
|
2
|
+
var cloneProperties2 = "position,backdropFilter,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");
|
|
3
3
|
var pushProperty = function (key, props) {
|
|
4
4
|
props.split(",").forEach(k => {
|
|
5
5
|
cloneProperties2.push(key + k);
|
|
@@ -86,7 +86,13 @@ var isMaybeVisible = function (node) {
|
|
|
86
86
|
if (style.overflow === "hidden") {
|
|
87
87
|
if (node.offsetHeight === 0 || node.offsetWidth === 0) return;
|
|
88
88
|
}
|
|
89
|
-
if (node.offsetParent
|
|
89
|
+
if (node.offsetParent) {
|
|
90
|
+
var parent = node.offsetParent;
|
|
91
|
+
return !(node.offsetLeft + node.offsetWidth - parent.scrollLeft <= parent.clientLeft ||
|
|
92
|
+
node.offsetTop + node.offsetHeight - parent.scrollTop <= parent.clientTop ||
|
|
93
|
+
node.offsetLeft - parent.scrollLeft >= (parent.clientWidth || parent.offsetWidth) ||
|
|
94
|
+
node.offsetTop - parent.scrollTop >= (parent.clientHeight || parent.offsetHeight));
|
|
95
|
+
}
|
|
90
96
|
return true;
|
|
91
97
|
}
|
|
92
98
|
var clonePseudo = function (node, pseudo) {
|
|
@@ -173,6 +179,7 @@ var cloneVisible = function (td) {
|
|
|
173
179
|
};
|
|
174
180
|
clone(td);
|
|
175
181
|
extend(result.style, {
|
|
182
|
+
zIndex: getComputedStyle(td).zIndex,
|
|
176
183
|
position: "absolute",
|
|
177
184
|
left: _left + "px",
|
|
178
185
|
top: _top + "px",
|
package/coms/zimoli/css.js
CHANGED
|
@@ -19,9 +19,15 @@ var transfromSimpleValue = function (value) {
|
|
|
19
19
|
};
|
|
20
20
|
var transformValue = function (value, k) {
|
|
21
21
|
if (ratioPropReg.test(k) || !value) return value;
|
|
22
|
-
if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s
|
|
22
|
+
if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s+/).map(transfromSimpleValue).join(' ');
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
|
+
var partifyValue = function (v) {
|
|
26
|
+
return String(v).toLowerCase().split(/['"`]|\s+/).join(" ");
|
|
27
|
+
};
|
|
28
|
+
var isSameValue = function (v1, v2) {
|
|
29
|
+
return partifyValue(v1) === partifyValue(v2);
|
|
30
|
+
};
|
|
25
31
|
/**
|
|
26
32
|
* 将中划线转成驼峰式
|
|
27
33
|
* @param {string} key
|
|
@@ -86,7 +92,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
|
|
|
86
92
|
var key = transformNodeKey(k);
|
|
87
93
|
if (key in styleobject) {
|
|
88
94
|
try {
|
|
89
|
-
|
|
95
|
+
var value = transformValue(oStyle[k], key);
|
|
96
|
+
if (!isSameValue(value, styleobject[value])) styleobject[key] = transformValue(oStyle[k], key);
|
|
90
97
|
} catch (e) {
|
|
91
98
|
console.warn(key, oStyle[k], "无效");
|
|
92
99
|
}
|
|
@@ -95,7 +102,8 @@ var cssTargetNode = function (targetNode, oStyle, oValue) {
|
|
|
95
102
|
} else {
|
|
96
103
|
for (var k in oStyle) {
|
|
97
104
|
var key = transformNodeKey(k);
|
|
98
|
-
|
|
105
|
+
var value = transformValue(oStyle[k], key);
|
|
106
|
+
if (key in styleobject && !isSameValue(value, styleobject[key])) styleobject[key] = value;
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
}
|
|
@@ -153,9 +161,9 @@ function cssTargetStyleSheet(stylesheet, innerCss) {
|
|
|
153
161
|
var styleSheet = stylesheet.styleSheet;
|
|
154
162
|
if (styleSheet) {
|
|
155
163
|
//IE
|
|
156
|
-
styleSheet.cssText = innerCss;
|
|
164
|
+
if (styleSheet.cssText !== innerCss) styleSheet.cssText = innerCss;
|
|
157
165
|
} else {
|
|
158
|
-
stylesheet.innerHTML = innerCss;
|
|
166
|
+
if (stylesheet.innerHTML !== innerCss) stylesheet.innerHTML = innerCss;
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
|
package/coms/zimoli/data.js
CHANGED
package/coms/zimoli/drag.js
CHANGED
|
@@ -61,8 +61,9 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
|
61
61
|
saved_delta.x += clone_left - target_left;
|
|
62
62
|
saved_delta.y += clone_top - target_top;
|
|
63
63
|
if (clone.style) {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
var z = zIndex();
|
|
65
|
+
clone.style.zIndex = z + (+clone.style.zIndex || 0);
|
|
66
|
+
extraClones.map(e => e.style.zIndex = z + (+e.style.zIndex || 0));
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
drag.target = clone;
|
package/coms/zimoli/field.html
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<template v-if='field?.key'>
|
|
2
|
+
<div class="head">
|
|
3
|
+
<span ng-bind=field.name></span>
|
|
4
|
+
<span class="required" ng-if="field.required">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="body">
|
|
7
|
+
<model _data=data _field=field></model>
|
|
8
|
+
<span class="error" ng-bind="error"></span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="foot" ng-if="field.msg">
|
|
11
|
+
<span ng-bind=field.msg></span>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-else>
|
|
6
15
|
<model _data=data _field=field></model>
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
<div class="foot" ng-if="field.msg">
|
|
10
|
-
<span ng-bind=field.msg></span>
|
|
11
|
-
</div>
|
|
16
|
+
</template>
|
package/coms/zimoli/menu.js
CHANGED
|
@@ -101,23 +101,34 @@ function main(elem, mode) {
|
|
|
101
101
|
// }
|
|
102
102
|
// elem.setAttribute('browser', os);
|
|
103
103
|
var mode = elem.getAttribute('mode') || elem.getAttribute('type');
|
|
104
|
+
if (!mode) {
|
|
105
|
+
if (elem.hasAttribute("inline")) mode = 'inline';
|
|
106
|
+
else if (elem.hasAttribute("vertical")) mode = "vertical";
|
|
107
|
+
else if (elem.hasAttribute("horizonal")) mode = "horizonal";
|
|
108
|
+
else if (
|
|
109
|
+
elem.hasAttribute("toolbar")
|
|
110
|
+
|| elem.hasAttribute('tool')
|
|
111
|
+
|| elem.hasAttribute('tools')
|
|
112
|
+
|| elem.hasAttribute('bar')
|
|
113
|
+
) mode = "toolbar";
|
|
114
|
+
}
|
|
104
115
|
if (!mode) {
|
|
105
116
|
if (/^[xyhvtci]/i.test(elem.tagName)) {
|
|
106
117
|
mode = elem.tagName.slice(0, 1);
|
|
118
|
+
if (/^t$/i.test(mode)) mode = elem.tagName.slice(0, 2);
|
|
107
119
|
}
|
|
108
|
-
else if (/[
|
|
109
|
-
mode = elem.tagName.slice(
|
|
120
|
+
else if (/[xyhvci]$/i.test(elem.tagName)) {
|
|
121
|
+
mode = elem.tagName.slice(elem.tagName.length - 1);
|
|
110
122
|
}
|
|
111
123
|
}
|
|
112
124
|
mode = mode ? mode.toLowerCase() : "horizonal";
|
|
113
|
-
|
|
125
|
+
var direction;
|
|
114
126
|
switch (mode) {
|
|
127
|
+
case "tr":
|
|
115
128
|
case "i":
|
|
116
129
|
case "c":
|
|
117
130
|
case "inline":
|
|
118
|
-
|
|
119
|
-
case "tree":
|
|
120
|
-
mode = "tree";
|
|
131
|
+
mode = "inline";
|
|
121
132
|
if (elem) {
|
|
122
133
|
var generator = getGenerator(elem, 'menu-item');
|
|
123
134
|
tree(elem, function (index, item) {
|
|
@@ -145,22 +156,31 @@ function main(elem, mode) {
|
|
|
145
156
|
elem = inlineMenu.call(elem, nodes);
|
|
146
157
|
}
|
|
147
158
|
break;
|
|
159
|
+
case "to":
|
|
160
|
+
case "t":
|
|
161
|
+
case "b":
|
|
162
|
+
case "tool":
|
|
163
|
+
case "tools":
|
|
164
|
+
case "bar":
|
|
165
|
+
case "toolbar":
|
|
166
|
+
direction = 't';
|
|
167
|
+
mode = "toolbar";
|
|
148
168
|
case "h":
|
|
149
169
|
case "x":
|
|
150
170
|
case "horizonal":
|
|
151
|
-
|
|
152
|
-
|
|
171
|
+
if (!direction) {
|
|
172
|
+
direction = 'x';
|
|
173
|
+
mode = "horizonal";
|
|
174
|
+
}
|
|
153
175
|
case "v":
|
|
154
176
|
case "y":
|
|
155
177
|
case "vertical":
|
|
178
|
+
if (!direction) mode = "vertical", direction = 'y';
|
|
156
179
|
var emit = function (item, target) {
|
|
157
180
|
active(elem, item.value, item, target);
|
|
158
181
|
};
|
|
159
182
|
if ("$src" in elem) {
|
|
160
183
|
getGenerator(elem, 'menu-item');
|
|
161
|
-
on("append")(elem, function () {
|
|
162
|
-
elem.registerAsRoot();
|
|
163
|
-
});
|
|
164
184
|
var src0 = [];
|
|
165
185
|
menuList(elem, src0, emit, direction);
|
|
166
186
|
care(elem, function (src) {
|
|
@@ -177,7 +197,6 @@ function main(elem, mode) {
|
|
|
177
197
|
var nodes = getArrayNodes(elem);
|
|
178
198
|
remove(elem.children);
|
|
179
199
|
elem = menuList(elem, nodes, emit, direction);
|
|
180
|
-
elem.registerAsRoot();
|
|
181
200
|
}
|
|
182
201
|
break;
|
|
183
202
|
default:
|
|
@@ -187,7 +206,8 @@ function main(elem, mode) {
|
|
|
187
206
|
mode = mode || "horizonal";
|
|
188
207
|
elem = menu.apply(null, arguments);
|
|
189
208
|
}
|
|
190
|
-
elem.setAttribute('mode', mode);
|
|
209
|
+
if (!elem.hasAttribute('mode')) elem.setAttribute('mode', mode);
|
|
210
|
+
if (!elem.hasAttribute(mode)) elem.setAttribute(mode, '');
|
|
191
211
|
return elem;
|
|
192
212
|
|
|
193
213
|
}
|
package/coms/zimoli/menu.less
CHANGED
|
@@ -82,13 +82,11 @@ body:active & {
|
|
|
82
82
|
width: 100%;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
&[
|
|
86
|
-
&[type=vertical] {
|
|
85
|
+
&[vertical] {
|
|
87
86
|
display: block;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
&[
|
|
91
|
-
&[type=horizonal] {
|
|
89
|
+
&[horizonal] {
|
|
92
90
|
display: block;
|
|
93
91
|
overflow: hidden;
|
|
94
92
|
text-overflow: hidden;
|
|
@@ -115,11 +113,35 @@ body:active & {
|
|
|
115
113
|
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
&[
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
&[toolbar] {
|
|
117
|
+
>menu-item{
|
|
118
|
+
padding-left: 6px;
|
|
119
|
+
padding-right: 6px;
|
|
120
|
+
text-align: center;
|
|
121
|
+
}
|
|
122
|
+
>menu-item.has-children {
|
|
123
|
+
&::after {
|
|
124
|
+
display: block;
|
|
125
|
+
content: "";
|
|
126
|
+
width: 0;
|
|
127
|
+
height: 0;
|
|
128
|
+
font-size: 0;
|
|
129
|
+
transform: none;
|
|
130
|
+
border: 2px solid;
|
|
131
|
+
border-top-color: transparent;
|
|
132
|
+
border-left-color: transparent;
|
|
133
|
+
position: absolute;
|
|
134
|
+
right: 3px;
|
|
135
|
+
bottom: 3px;
|
|
136
|
+
box-sizing: border-box;
|
|
137
|
+
line-height: 0;
|
|
138
|
+
top: auto;
|
|
139
|
+
margin: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&[inline] {
|
|
123
145
|
height: auto;
|
|
124
146
|
box-shadow: none;
|
|
125
147
|
padding: 0;
|
package/coms/zimoli/menuItem.js
CHANGED
|
@@ -11,7 +11,7 @@ function main(elem, scope, hasIcon) {
|
|
|
11
11
|
var name = scope.name;
|
|
12
12
|
var icon = scope.icon;
|
|
13
13
|
if (hasIcon === undefined) hasIcon = !!icon;
|
|
14
|
-
render(item.children, { useIcon: hasIcon, hasIcon, name, icon });
|
|
14
|
+
render(item.children, scope, hasIcon instanceof Array ? hasIcon : [{ useIcon: hasIcon, hasIcon, name, icon }]);
|
|
15
15
|
if (scope.line) item.setAttribute("line", ''), on("click")(item, preventDefault);
|
|
16
16
|
return item;
|
|
17
17
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open.call(this)"
|
|
2
|
-
ng-
|
|
3
|
-
|
|
1
|
+
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open.call(this)" ng-mouseleave="cancel()"
|
|
2
|
+
ng-mouseenter="popMenu.call(this)" ng-mousedown="popMenu1.call(this,event)" ng-class="{'has-children':menu.children&&menu.children.length,
|
|
3
|
+
'warn':menu.type==='danger'||menu.type==='warn'||menu.type==='red',
|
|
4
|
+
'selected':menu.selected
|
|
5
|
+
}">
|
|
4
6
|
</menu-item>
|