@fangzhongya/fang-ui 0.0.55 → 0.0.57
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/components/lists/index.css +3 -3
- package/dist/components/lists/index.scss +3 -3
- package/dist/components/lists/src/index2.cjs +1 -1
- package/dist/components/lists/src/index2.js +1 -1
- package/dist/components/listsp/index.css +8 -3
- package/dist/components/listsp/index.scss +7 -0
- package/dist/components/listsp/src/index2.cjs +10 -10
- package/dist/components/listsp/src/index2.js +10 -10
- package/dist/components/page/index.css +6 -0
- package/dist/components/tables/common/pagin.cjs +32 -15
- package/dist/components/tables/common/pagin.d.ts +12 -3
- package/dist/components/tables/common/pagin.js +32 -15
- package/dist/components/tables/src/column.cjs +2 -1
- package/dist/components/tables/src/column.js +2 -1
- package/dist/components/tablesp/index.css +6 -0
- package/dist/components/tablesp/index.scss +8 -0
- package/dist/components/tablesp/src/index2.cjs +15 -6
- package/dist/components/tablesp/src/index2.js +15 -6
- package/dist/components/tablesv/src/column.cjs +2 -1
- package/dist/components/tablesv/src/column.js +2 -1
- package/dist/css/index.css +14 -3
- package/dist/css/lists.css +3 -3
- package/dist/css/listsp.css +8 -3
- package/dist/css/page.css +6 -0
- package/dist/css/tablesp.css +6 -0
- package/dist/directives/scroll/index.cjs +59 -12
- package/dist/directives/scroll/index.js +59 -12
- package/dist/hooks/cssname/index.cjs +16 -0
- package/dist/hooks/cssname/index.d.ts +2 -0
- package/dist/hooks/cssname/index.js +16 -0
- package/dist/icons/index.css +29 -29
- package/dist/icons/index.json +7 -7
- package/dist/index.css +14 -3
- package/dist/type.d.ts +4 -2
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, useSlots, ref, createElementBlock, openBlock, normalizeStyle, unref, normalizeClass,
|
|
1
|
+
import { defineComponent, useSlots, ref, createElementBlock, openBlock, normalizeStyle, unref, normalizeClass, withDirectives, createBlock, createCommentVNode, mergeProps, toHandlers, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
import { Tables } from "../../tables/index.js";
|
|
3
3
|
import { Paging } from "../../paging/index.js";
|
|
4
|
+
import vScroll from "../../../directives/scroll/index.js";
|
|
4
5
|
import { useInit, dataEmit, dataProps } from "../../tables/common/pagin.js";
|
|
5
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -22,6 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
23
|
loading,
|
|
23
24
|
tableList,
|
|
24
25
|
tableConfig,
|
|
26
|
+
scroll,
|
|
25
27
|
onSortChange,
|
|
26
28
|
onListEvents,
|
|
27
29
|
onSelect,
|
|
@@ -47,16 +49,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
49
|
class: normalizeClass(unref(cs).z()),
|
|
48
50
|
style: normalizeStyle(unref(cs).vdo({ height: unref(height) }))
|
|
49
51
|
}, [
|
|
50
|
-
|
|
52
|
+
withDirectives((openBlock(), createBlock(unref(Tables), mergeProps(unref(tableConfig).config, toHandlers(unref(formEvent)), {
|
|
51
53
|
height: unref(height),
|
|
52
54
|
ref_key: "refTable",
|
|
53
55
|
ref: refTable,
|
|
54
|
-
class: [
|
|
56
|
+
class: [
|
|
57
|
+
unref(cs).z("main"),
|
|
58
|
+
unref(cs).is("radio", (_a = unref(tableConfig).config) == null ? void 0 : _a.isradio),
|
|
59
|
+
unref(cs).is("scroll", unref(paginat).is && unref(paginat).scroll)
|
|
60
|
+
],
|
|
61
|
+
"scroll-selector": "." + unref(cs).ec("scrollbar") + " ." + unref(cs).ec("scrollbar", "", "wrap"),
|
|
55
62
|
value: unref(data).list,
|
|
56
63
|
list: unref(tableList),
|
|
57
64
|
size: (_b = unref(tableConfig).config) == null ? void 0 : _b.size,
|
|
58
65
|
paginat: unref(paginat),
|
|
59
|
-
loading: unref(loading),
|
|
66
|
+
loading: unref(paginat).scroll && unref(paginat).current > 1 ? false : unref(loading),
|
|
60
67
|
options: props.options,
|
|
61
68
|
compons: props.compons,
|
|
62
69
|
onSortChange: unref(onSortChange),
|
|
@@ -73,8 +80,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
80
|
])
|
|
74
81
|
};
|
|
75
82
|
})
|
|
76
|
-
]), 1040, ["height", "class", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"]),
|
|
77
|
-
|
|
83
|
+
]), 1040, ["height", "class", "scroll-selector", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"])), [
|
|
84
|
+
[unref(vScroll), unref(scroll)]
|
|
85
|
+
]),
|
|
86
|
+
((_c = unref(paginat)) == null ? void 0 : _c.is) && !unref(paginat).scroll ? (openBlock(), createBlock(unref(Paging), mergeProps({ key: 0 }, unref(pagconfig), {
|
|
78
87
|
class: unref(cs).z("paginat"),
|
|
79
88
|
paginat: unref(paginat),
|
|
80
89
|
total: unref(data).total,
|
|
@@ -192,13 +192,14 @@ function setSslot(obj, scope, emit, slots, props, index2) {
|
|
|
192
192
|
return defaultDom(obj, scope, props, index2);
|
|
193
193
|
}
|
|
194
194
|
function defaultDom(obj, scope, props, index2) {
|
|
195
|
+
var _a;
|
|
195
196
|
const table = props.table;
|
|
196
197
|
let domValue = "";
|
|
197
198
|
if (obj.type == "index") {
|
|
198
199
|
if (obj.index) {
|
|
199
200
|
domValue = obj.index(scope.$rowIndex, table.paginat);
|
|
200
201
|
} else {
|
|
201
|
-
if (table.paginat && table.paginat.current && table.paginat.pageSize) {
|
|
202
|
+
if (((_a = table.paginat) == null ? void 0 : _a.is) && !table.paginat.scroll && table.paginat.current && table.paginat.pageSize) {
|
|
202
203
|
domValue = (table.paginat.current - 1) * table.paginat.pageSize + scope.$rowIndex + 1;
|
|
203
204
|
} else {
|
|
204
205
|
domValue = scope.$rowIndex + 1;
|
|
@@ -190,13 +190,14 @@ function setSslot(obj, scope, emit, slots, props, index) {
|
|
|
190
190
|
return defaultDom(obj, scope, props, index);
|
|
191
191
|
}
|
|
192
192
|
function defaultDom(obj, scope, props, index) {
|
|
193
|
+
var _a;
|
|
193
194
|
const table = props.table;
|
|
194
195
|
let domValue = "";
|
|
195
196
|
if (obj.type == "index") {
|
|
196
197
|
if (obj.index) {
|
|
197
198
|
domValue = obj.index(scope.$rowIndex, table.paginat);
|
|
198
199
|
} else {
|
|
199
|
-
if (table.paginat && table.paginat.current && table.paginat.pageSize) {
|
|
200
|
+
if (((_a = table.paginat) == null ? void 0 : _a.is) && !table.paginat.scroll && table.paginat.current && table.paginat.pageSize) {
|
|
200
201
|
domValue = (table.paginat.current - 1) * table.paginat.pageSize + scope.$rowIndex + 1;
|
|
201
202
|
} else {
|
|
202
203
|
domValue = scope.$rowIndex + 1;
|
package/dist/css/index.css
CHANGED
|
@@ -540,6 +540,12 @@
|
|
|
540
540
|
.tablesp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
|
|
541
541
|
display: none;
|
|
542
542
|
}
|
|
543
|
+
.tablesp-main.is-scroll .v-scroll-add {
|
|
544
|
+
text-align: center;
|
|
545
|
+
padding: 10px;
|
|
546
|
+
color: #999;
|
|
547
|
+
background-color: #eee;
|
|
548
|
+
}
|
|
543
549
|
.tablesp-paginat {
|
|
544
550
|
overflow: hidden;
|
|
545
551
|
}
|
|
@@ -912,11 +918,11 @@
|
|
|
912
918
|
.lists-list-item {
|
|
913
919
|
background-color: #fff;
|
|
914
920
|
margin: 0 var(--lists-interval);
|
|
915
|
-
margin-top: calc(var(--lists-interval) * 2);
|
|
916
|
-
}
|
|
917
|
-
.lists-list-item:last-child {
|
|
918
921
|
margin-bottom: calc(var(--lists-interval) * 2);
|
|
919
922
|
}
|
|
923
|
+
.lists-list-item:first-child {
|
|
924
|
+
margin-top: calc(var(--lists-interval) * 2);
|
|
925
|
+
}
|
|
920
926
|
.lists-list-item.is-active {
|
|
921
927
|
background-color: rgb(250, 235, 215);
|
|
922
928
|
}
|
|
@@ -939,6 +945,11 @@
|
|
|
939
945
|
flex: 1;
|
|
940
946
|
width: 100%;
|
|
941
947
|
}
|
|
948
|
+
.listsp-main.is-scroll .v-scroll-add {
|
|
949
|
+
text-align: center;
|
|
950
|
+
padding: 10px;
|
|
951
|
+
color: #999;
|
|
952
|
+
}
|
|
942
953
|
.listsp-paginat {
|
|
943
954
|
overflow: hidden;
|
|
944
955
|
}
|
package/dist/css/lists.css
CHANGED
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
.lists-list-item {
|
|
36
36
|
background-color: #fff;
|
|
37
37
|
margin: 0 var(--lists-interval);
|
|
38
|
-
margin-top: calc(var(--lists-interval) * 2);
|
|
39
|
-
}
|
|
40
|
-
.lists-list-item:last-child {
|
|
41
38
|
margin-bottom: calc(var(--lists-interval) * 2);
|
|
42
39
|
}
|
|
40
|
+
.lists-list-item:first-child {
|
|
41
|
+
margin-top: calc(var(--lists-interval) * 2);
|
|
42
|
+
}
|
|
43
43
|
.lists-list-item.is-active {
|
|
44
44
|
background-color: rgb(250, 235, 215);
|
|
45
45
|
}
|
package/dist/css/listsp.css
CHANGED
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
.lists-list-item {
|
|
36
36
|
background-color: #fff;
|
|
37
37
|
margin: 0 var(--lists-interval);
|
|
38
|
-
margin-top: calc(var(--lists-interval) * 2);
|
|
39
|
-
}
|
|
40
|
-
.lists-list-item:last-child {
|
|
41
38
|
margin-bottom: calc(var(--lists-interval) * 2);
|
|
42
39
|
}
|
|
40
|
+
.lists-list-item:first-child {
|
|
41
|
+
margin-top: calc(var(--lists-interval) * 2);
|
|
42
|
+
}
|
|
43
43
|
.lists-list-item.is-active {
|
|
44
44
|
background-color: rgb(250, 235, 215);
|
|
45
45
|
}
|
|
@@ -78,6 +78,11 @@
|
|
|
78
78
|
flex: 1;
|
|
79
79
|
width: 100%;
|
|
80
80
|
}
|
|
81
|
+
.listsp-main.is-scroll .v-scroll-add {
|
|
82
|
+
text-align: center;
|
|
83
|
+
padding: 10px;
|
|
84
|
+
color: #999;
|
|
85
|
+
}
|
|
81
86
|
.listsp-paginat {
|
|
82
87
|
overflow: hidden;
|
|
83
88
|
}
|
package/dist/css/page.css
CHANGED
|
@@ -234,6 +234,12 @@
|
|
|
234
234
|
.tablesp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
|
|
235
235
|
display: none;
|
|
236
236
|
}
|
|
237
|
+
.tablesp-main.is-scroll .v-scroll-add {
|
|
238
|
+
text-align: center;
|
|
239
|
+
padding: 10px;
|
|
240
|
+
color: #999;
|
|
241
|
+
background-color: #eee;
|
|
242
|
+
}
|
|
237
243
|
.tablesp-paginat {
|
|
238
244
|
overflow: hidden;
|
|
239
245
|
}
|
package/dist/css/tablesp.css
CHANGED
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
.tablesp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
|
|
61
61
|
display: none;
|
|
62
62
|
}
|
|
63
|
+
.tablesp-main.is-scroll .v-scroll-add {
|
|
64
|
+
text-align: center;
|
|
65
|
+
padding: 10px;
|
|
66
|
+
color: #999;
|
|
67
|
+
background-color: #eee;
|
|
68
|
+
}
|
|
63
69
|
.tablesp-paginat {
|
|
64
70
|
overflow: hidden;
|
|
65
71
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
3
4
|
const vScroll = {
|
|
4
5
|
name: "scroll",
|
|
5
6
|
mounted(el, binding) {
|
|
@@ -9,7 +10,12 @@ const vScroll = {
|
|
|
9
10
|
let is = true;
|
|
10
11
|
let selector = el.getAttribute(`scroll-selector`);
|
|
11
12
|
let distance = el.getAttribute(`scroll-distance`) || 10;
|
|
13
|
+
let loadText = "加载中...";
|
|
14
|
+
let endText = "无更多数据";
|
|
15
|
+
let cssname = "v-scroll-add";
|
|
16
|
+
let isf = false;
|
|
12
17
|
if (typeof value === "function") {
|
|
18
|
+
isf = true;
|
|
13
19
|
fun = value;
|
|
14
20
|
} else {
|
|
15
21
|
fun = value.onChange;
|
|
@@ -20,12 +26,27 @@ const vScroll = {
|
|
|
20
26
|
if (value.distance) {
|
|
21
27
|
distance = value.distance;
|
|
22
28
|
}
|
|
29
|
+
if (value.loadText) {
|
|
30
|
+
loadText = value.loadText;
|
|
31
|
+
}
|
|
32
|
+
if (value.endText) {
|
|
33
|
+
endText = value.endText;
|
|
34
|
+
}
|
|
35
|
+
if (value.cssname) {
|
|
36
|
+
cssname = value.cssname;
|
|
37
|
+
}
|
|
23
38
|
}
|
|
24
39
|
let t;
|
|
25
40
|
let tm = () => {
|
|
26
41
|
clearTimeout(t);
|
|
27
42
|
t = setTimeout(() => {
|
|
28
|
-
|
|
43
|
+
if (isf) {
|
|
44
|
+
fun();
|
|
45
|
+
} else {
|
|
46
|
+
if (!vue.toValue(value.load) && !vue.toValue(value.end)) {
|
|
47
|
+
fun();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
29
50
|
}, 100);
|
|
30
51
|
};
|
|
31
52
|
let dom = el;
|
|
@@ -36,25 +57,51 @@ const vScroll = {
|
|
|
36
57
|
dom = selector;
|
|
37
58
|
}
|
|
38
59
|
}
|
|
39
|
-
if (is) {
|
|
60
|
+
if (dom && is) {
|
|
61
|
+
if (!isf) {
|
|
62
|
+
const adddmm = document.createElement("div");
|
|
63
|
+
adddmm.className = cssname;
|
|
64
|
+
adddmm.style.display = "none";
|
|
65
|
+
dom.appendChild(adddmm);
|
|
66
|
+
vue.watch(value.load, () => {
|
|
67
|
+
const v = vue.toValue(value.load);
|
|
68
|
+
if (v) {
|
|
69
|
+
adddmm.className = cssname + " " + cssname + "-load";
|
|
70
|
+
adddmm.style.display = "block";
|
|
71
|
+
adddmm.innerText = loadText;
|
|
72
|
+
} else {
|
|
73
|
+
adddmm.style.display = "none";
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
vue.watch(value.end, () => {
|
|
77
|
+
const v = vue.toValue(value.end);
|
|
78
|
+
if (v) {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
adddmm.className = cssname + " " + cssname + "-end";
|
|
81
|
+
adddmm.style.display = "block";
|
|
82
|
+
adddmm.innerText = endText;
|
|
83
|
+
}, 100);
|
|
84
|
+
} else {
|
|
85
|
+
adddmm.style.display = "none";
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
40
89
|
dom.style.overflowY = "auto";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function() {
|
|
45
|
-
if (is) {
|
|
90
|
+
dom.addEventListener(
|
|
91
|
+
"scroll",
|
|
92
|
+
function() {
|
|
46
93
|
let d = this;
|
|
47
94
|
const s = d.scrollHeight - d.scrollTop;
|
|
48
95
|
const h = d.clientHeight;
|
|
49
96
|
if (s - distance < h) {
|
|
50
97
|
tm();
|
|
51
98
|
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
passive: true
|
|
52
102
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
passive: true
|
|
56
|
-
}
|
|
57
|
-
);
|
|
103
|
+
);
|
|
104
|
+
}
|
|
58
105
|
}
|
|
59
106
|
};
|
|
60
107
|
exports.default = vScroll;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toValue, watch } from "vue";
|
|
1
2
|
const vScroll = {
|
|
2
3
|
name: "scroll",
|
|
3
4
|
mounted(el, binding) {
|
|
@@ -7,7 +8,12 @@ const vScroll = {
|
|
|
7
8
|
let is = true;
|
|
8
9
|
let selector = el.getAttribute(`scroll-selector`);
|
|
9
10
|
let distance = el.getAttribute(`scroll-distance`) || 10;
|
|
11
|
+
let loadText = "加载中...";
|
|
12
|
+
let endText = "无更多数据";
|
|
13
|
+
let cssname = "v-scroll-add";
|
|
14
|
+
let isf = false;
|
|
10
15
|
if (typeof value === "function") {
|
|
16
|
+
isf = true;
|
|
11
17
|
fun = value;
|
|
12
18
|
} else {
|
|
13
19
|
fun = value.onChange;
|
|
@@ -18,12 +24,27 @@ const vScroll = {
|
|
|
18
24
|
if (value.distance) {
|
|
19
25
|
distance = value.distance;
|
|
20
26
|
}
|
|
27
|
+
if (value.loadText) {
|
|
28
|
+
loadText = value.loadText;
|
|
29
|
+
}
|
|
30
|
+
if (value.endText) {
|
|
31
|
+
endText = value.endText;
|
|
32
|
+
}
|
|
33
|
+
if (value.cssname) {
|
|
34
|
+
cssname = value.cssname;
|
|
35
|
+
}
|
|
21
36
|
}
|
|
22
37
|
let t;
|
|
23
38
|
let tm = () => {
|
|
24
39
|
clearTimeout(t);
|
|
25
40
|
t = setTimeout(() => {
|
|
26
|
-
|
|
41
|
+
if (isf) {
|
|
42
|
+
fun();
|
|
43
|
+
} else {
|
|
44
|
+
if (!toValue(value.load) && !toValue(value.end)) {
|
|
45
|
+
fun();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
27
48
|
}, 100);
|
|
28
49
|
};
|
|
29
50
|
let dom = el;
|
|
@@ -34,25 +55,51 @@ const vScroll = {
|
|
|
34
55
|
dom = selector;
|
|
35
56
|
}
|
|
36
57
|
}
|
|
37
|
-
if (is) {
|
|
58
|
+
if (dom && is) {
|
|
59
|
+
if (!isf) {
|
|
60
|
+
const adddmm = document.createElement("div");
|
|
61
|
+
adddmm.className = cssname;
|
|
62
|
+
adddmm.style.display = "none";
|
|
63
|
+
dom.appendChild(adddmm);
|
|
64
|
+
watch(value.load, () => {
|
|
65
|
+
const v = toValue(value.load);
|
|
66
|
+
if (v) {
|
|
67
|
+
adddmm.className = cssname + " " + cssname + "-load";
|
|
68
|
+
adddmm.style.display = "block";
|
|
69
|
+
adddmm.innerText = loadText;
|
|
70
|
+
} else {
|
|
71
|
+
adddmm.style.display = "none";
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
watch(value.end, () => {
|
|
75
|
+
const v = toValue(value.end);
|
|
76
|
+
if (v) {
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
adddmm.className = cssname + " " + cssname + "-end";
|
|
79
|
+
adddmm.style.display = "block";
|
|
80
|
+
adddmm.innerText = endText;
|
|
81
|
+
}, 100);
|
|
82
|
+
} else {
|
|
83
|
+
adddmm.style.display = "none";
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
38
87
|
dom.style.overflowY = "auto";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
function() {
|
|
43
|
-
if (is) {
|
|
88
|
+
dom.addEventListener(
|
|
89
|
+
"scroll",
|
|
90
|
+
function() {
|
|
44
91
|
let d = this;
|
|
45
92
|
const s = d.scrollHeight - d.scrollTop;
|
|
46
93
|
const h = d.clientHeight;
|
|
47
94
|
if (s - distance < h) {
|
|
48
95
|
tm();
|
|
49
96
|
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
passive: true
|
|
50
100
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
passive: true
|
|
54
|
-
}
|
|
55
|
-
);
|
|
101
|
+
);
|
|
102
|
+
}
|
|
56
103
|
}
|
|
57
104
|
};
|
|
58
105
|
export {
|
|
@@ -50,6 +50,7 @@ function getElSpace() {
|
|
|
50
50
|
return namespace ? namespace + com.common : "";
|
|
51
51
|
}
|
|
52
52
|
const useCssName = (block) => {
|
|
53
|
+
const c = (name = "", blockSuffix = "", element = "", modifier = "") => getClassName(name, blockSuffix, element, modifier);
|
|
53
54
|
const z = (blockSuffix = "", element = "", modifier = "") => getClassName(block, blockSuffix, element, modifier);
|
|
54
55
|
const is = (name, state) => {
|
|
55
56
|
return name && state ? `${com.state}${name}` : "";
|
|
@@ -68,6 +69,19 @@ const useCssName = (block) => {
|
|
|
68
69
|
}
|
|
69
70
|
return cls;
|
|
70
71
|
};
|
|
72
|
+
const ec = (name = "", blockSuffix = "", element = "", modifier = "") => {
|
|
73
|
+
let cls = e() + name;
|
|
74
|
+
if (blockSuffix) {
|
|
75
|
+
cls += `${com.common}${blockSuffix}`;
|
|
76
|
+
}
|
|
77
|
+
if (element) {
|
|
78
|
+
cls += `${com.element}${element}`;
|
|
79
|
+
}
|
|
80
|
+
if (modifier) {
|
|
81
|
+
cls += `${com.modifier}${modifier}`;
|
|
82
|
+
}
|
|
83
|
+
return cls;
|
|
84
|
+
};
|
|
71
85
|
const zis = (blockSuffix = "", modifier = "", state) => {
|
|
72
86
|
return state ? z(blockSuffix, "", modifier) : "";
|
|
73
87
|
};
|
|
@@ -93,9 +107,11 @@ const useCssName = (block) => {
|
|
|
93
107
|
const vdm = (name) => `--${getName() + block + com.common + name}`;
|
|
94
108
|
return {
|
|
95
109
|
name: getName(),
|
|
110
|
+
c,
|
|
96
111
|
z,
|
|
97
112
|
e,
|
|
98
113
|
el,
|
|
114
|
+
ec,
|
|
99
115
|
is,
|
|
100
116
|
zis,
|
|
101
117
|
vo,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const useCssName: (block: string) => {
|
|
2
2
|
name: string;
|
|
3
|
+
c: (name?: string, blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
3
4
|
z: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
4
5
|
e: () => string;
|
|
5
6
|
el: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
7
|
+
ec: (name?: string, blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
6
8
|
is: (name: string, state?: boolean) => string;
|
|
7
9
|
zis: (blockSuffix?: string, modifier?: string, state?: boolean) => string;
|
|
8
10
|
vo: (object: Record<string, string>) => Record<string, string>;
|
|
@@ -48,6 +48,7 @@ function getElSpace() {
|
|
|
48
48
|
return namespace ? namespace + com.common : "";
|
|
49
49
|
}
|
|
50
50
|
const useCssName = (block) => {
|
|
51
|
+
const c = (name = "", blockSuffix = "", element = "", modifier = "") => getClassName(name, blockSuffix, element, modifier);
|
|
51
52
|
const z = (blockSuffix = "", element = "", modifier = "") => getClassName(block, blockSuffix, element, modifier);
|
|
52
53
|
const is = (name, state) => {
|
|
53
54
|
return name && state ? `${com.state}${name}` : "";
|
|
@@ -66,6 +67,19 @@ const useCssName = (block) => {
|
|
|
66
67
|
}
|
|
67
68
|
return cls;
|
|
68
69
|
};
|
|
70
|
+
const ec = (name = "", blockSuffix = "", element = "", modifier = "") => {
|
|
71
|
+
let cls = e() + name;
|
|
72
|
+
if (blockSuffix) {
|
|
73
|
+
cls += `${com.common}${blockSuffix}`;
|
|
74
|
+
}
|
|
75
|
+
if (element) {
|
|
76
|
+
cls += `${com.element}${element}`;
|
|
77
|
+
}
|
|
78
|
+
if (modifier) {
|
|
79
|
+
cls += `${com.modifier}${modifier}`;
|
|
80
|
+
}
|
|
81
|
+
return cls;
|
|
82
|
+
};
|
|
69
83
|
const zis = (blockSuffix = "", modifier = "", state) => {
|
|
70
84
|
return state ? z(blockSuffix, "", modifier) : "";
|
|
71
85
|
};
|
|
@@ -91,9 +105,11 @@ const useCssName = (block) => {
|
|
|
91
105
|
const vdm = (name) => `--${getName() + block + com.common + name}`;
|
|
92
106
|
return {
|
|
93
107
|
name: getName(),
|
|
108
|
+
c,
|
|
94
109
|
z,
|
|
95
110
|
e,
|
|
96
111
|
el,
|
|
112
|
+
ec,
|
|
97
113
|
is,
|
|
98
114
|
zis,
|
|
99
115
|
vo,
|
package/dist/icons/index.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--icon-svg-bar: url("data:image/svg+xml;utf8,%3Csvg id='icon-bar' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' %3E %3Cpath fill='currentColor' d='M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z' %3E%3C/path%3E %3C/svg%3E");
|
|
3
|
-
--icon-svg-below: url("data:image/svg+xml;utf8,%3Csvg id='icon-below' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
4
|
-
--icon-svg-bottom-right: url("data:image/svg+xml;utf8,%3Csvg id='icon-bottom-right' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M352 768a32 32 0 1 0 0 64h448a32 32 0 0 0 32-32V352a32 32 0 0 0-64 0v416H352z'/%3E%3Cpath fill='currentColor' d='M777.344 822.656a32 32 0 0 0 45.312-45.312l-544-544a32 32 0 0 0-45.312 45.312l544 544z'/%3E%3C/svg%3E");
|
|
5
3
|
--icon-svg-bicycle: url("data:image/svg+xml;utf8,%3Csvg id='icon-bicycle' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M256 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256zm0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384z'/%3E%3Cpath fill='currentColor' d='M288 672h320q32 0 32 32t-32 32H288q-32 0-32-32t32-32z'/%3E%3Cpath fill='currentColor' d='M768 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256zm0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384z'/%3E%3Cpath fill='currentColor' d='M480 192a32 32 0 0 1 0-64h160a32 32 0 0 1 31.04 24.256l96 384a32 32 0 0 1-62.08 15.488L615.04 192H480zM96 384a32 32 0 0 1 0-64h128a32 32 0 0 1 30.336 21.888l64 192a32 32 0 1 1-60.672 20.224L200.96 384H96z'/%3E%3Cpath fill='currentColor' d='m373.376 599.808-42.752-47.616 320-288 42.752 47.616z'/%3E%3C/svg%3E");
|
|
4
|
+
--icon-svg-bottom: url("data:image/svg+xml;utf8,%3Csvg id='icon-bottom' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M544 805.888V168a32 32 0 1 0-64 0v637.888L246.656 557.952a30.72 30.72 0 0 0-45.312 0 35.52 35.52 0 0 0 0 48.064l288 306.048a30.72 30.72 0 0 0 45.312 0l288-306.048a35.52 35.52 0 0 0 0-48 30.72 30.72 0 0 0-45.312 0L544 805.824z'/%3E%3C/svg%3E");
|
|
6
5
|
--icon-svg-bottom-left: url("data:image/svg+xml;utf8,%3Csvg id='icon-bottom-left' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M256 768h416a32 32 0 1 1 0 64H224a32 32 0 0 1-32-32V352a32 32 0 0 1 64 0v416z'/%3E%3Cpath fill='currentColor' d='M246.656 822.656a32 32 0 0 1-45.312-45.312l544-544a32 32 0 0 1 45.312 45.312l-544 544z'/%3E%3C/svg%3E");
|
|
6
|
+
--icon-svg-below: url("data:image/svg+xml;utf8,%3Csvg id='icon-below' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
7
|
+
--icon-svg-bottom-right: url("data:image/svg+xml;utf8,%3Csvg id='icon-bottom-right' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M352 768a32 32 0 1 0 0 64h448a32 32 0 0 0 32-32V352a32 32 0 0 0-64 0v416H352z'/%3E%3Cpath fill='currentColor' d='M777.344 822.656a32 32 0 0 0 45.312-45.312l-544-544a32 32 0 0 0-45.312 45.312l544 544z'/%3E%3C/svg%3E");
|
|
7
8
|
--icon-svg-clear: url("data:image/svg+xml;utf8,%3Csvg id='icon-clear' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z' %3E%3C/path%3E %3Cpath fill='currentColor' d='M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z' %3E%3C/path%3E %3C/svg%3E");
|
|
8
|
-
--icon-svg-bottom: url("data:image/svg+xml;utf8,%3Csvg id='icon-bottom' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M544 805.888V168a32 32 0 1 0-64 0v637.888L246.656 557.952a30.72 30.72 0 0 0-45.312 0 35.52 35.52 0 0 0 0 48.064l288 306.048a30.72 30.72 0 0 0 45.312 0l288-306.048a35.52 35.52 0 0 0 0-48 30.72 30.72 0 0 0-45.312 0L544 805.824z'/%3E%3C/svg%3E");
|
|
9
9
|
--icon-svg-close: url("data:image/svg+xml;utf8,%3Csvg id='icon-close' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='currentColor' d='M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z' %3E%3C/path%3E %3C/svg%3E");
|
|
10
10
|
--icon-svg-left: url("data:image/svg+xml;utf8,%3Csvg id='icon-left' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
11
|
-
--icon-svg-right: url("data:image/svg+xml;utf8,%3Csvg id='icon-right' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' %3E %3Cpath fill='currentColor' d='M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
12
|
-
--icon-svg-edit: url("data:image/svg+xml;utf8,%3Csvg id='icon-edit' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='currentColor' d='M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z' %3E%3C/path%3E %3Cpath fill='currentColor' d='m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
13
11
|
--icon-svg-frame: url("data:image/svg+xml;utf8,%3Csvg id='icon-frame' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64v.064zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64l-192 .192zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64v-.064z' %3E%3C/path%3E %3C/svg%3E");
|
|
12
|
+
--icon-svg-edit: url("data:image/svg+xml;utf8,%3Csvg id='icon-edit' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='currentColor' d='M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z' %3E%3C/path%3E %3Cpath fill='currentColor' d='m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
13
|
+
--icon-svg-right: url("data:image/svg+xml;utf8,%3Csvg id='icon-right' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' %3E %3Cpath fill='currentColor' d='M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z' %3E%3C/path%3E %3C/svg%3E");
|
|
14
14
|
--icon-svg-star: url("data:image/svg+xml;utf8,%3Csvg id='icon-star' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' data-v-ea893728='' %3E %3Cpath fill='currentColor' d='m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72L512 747.84zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z' %3E%3C/path%3E %3C/svg%3E");
|
|
15
15
|
}
|
|
16
16
|
.icon-bar {
|
|
@@ -23,62 +23,62 @@
|
|
|
23
23
|
mask-size: 100% 100%;
|
|
24
24
|
color: inherit;
|
|
25
25
|
}
|
|
26
|
-
.icon-
|
|
26
|
+
.icon-bicycle {
|
|
27
27
|
height: 1em;
|
|
28
28
|
width: 1em;
|
|
29
29
|
background-color: currentColor;
|
|
30
|
-
-webkit-mask: var(--icon-svg-
|
|
31
|
-
mask: var(--icon-svg-
|
|
30
|
+
-webkit-mask: var(--icon-svg-bicycle) no-repeat;
|
|
31
|
+
mask: var(--icon-svg-bicycle) no-repeat;
|
|
32
32
|
-webkit-mask-size: 100% 100%;
|
|
33
33
|
mask-size: 100% 100%;
|
|
34
34
|
color: inherit;
|
|
35
35
|
}
|
|
36
|
-
.icon-bottom
|
|
36
|
+
.icon-bottom {
|
|
37
37
|
height: 1em;
|
|
38
38
|
width: 1em;
|
|
39
39
|
background-color: currentColor;
|
|
40
|
-
-webkit-mask: var(--icon-svg-bottom
|
|
41
|
-
mask: var(--icon-svg-bottom
|
|
40
|
+
-webkit-mask: var(--icon-svg-bottom) no-repeat;
|
|
41
|
+
mask: var(--icon-svg-bottom) no-repeat;
|
|
42
42
|
-webkit-mask-size: 100% 100%;
|
|
43
43
|
mask-size: 100% 100%;
|
|
44
44
|
color: inherit;
|
|
45
45
|
}
|
|
46
|
-
.icon-
|
|
46
|
+
.icon-bottom-left {
|
|
47
47
|
height: 1em;
|
|
48
48
|
width: 1em;
|
|
49
49
|
background-color: currentColor;
|
|
50
|
-
-webkit-mask: var(--icon-svg-
|
|
51
|
-
mask: var(--icon-svg-
|
|
50
|
+
-webkit-mask: var(--icon-svg-bottom-left) no-repeat;
|
|
51
|
+
mask: var(--icon-svg-bottom-left) no-repeat;
|
|
52
52
|
-webkit-mask-size: 100% 100%;
|
|
53
53
|
mask-size: 100% 100%;
|
|
54
54
|
color: inherit;
|
|
55
55
|
}
|
|
56
|
-
.icon-
|
|
56
|
+
.icon-below {
|
|
57
57
|
height: 1em;
|
|
58
58
|
width: 1em;
|
|
59
59
|
background-color: currentColor;
|
|
60
|
-
-webkit-mask: var(--icon-svg-
|
|
61
|
-
mask: var(--icon-svg-
|
|
60
|
+
-webkit-mask: var(--icon-svg-below) no-repeat;
|
|
61
|
+
mask: var(--icon-svg-below) no-repeat;
|
|
62
62
|
-webkit-mask-size: 100% 100%;
|
|
63
63
|
mask-size: 100% 100%;
|
|
64
64
|
color: inherit;
|
|
65
65
|
}
|
|
66
|
-
.icon-
|
|
66
|
+
.icon-bottom-right {
|
|
67
67
|
height: 1em;
|
|
68
68
|
width: 1em;
|
|
69
69
|
background-color: currentColor;
|
|
70
|
-
-webkit-mask: var(--icon-svg-
|
|
71
|
-
mask: var(--icon-svg-
|
|
70
|
+
-webkit-mask: var(--icon-svg-bottom-right) no-repeat;
|
|
71
|
+
mask: var(--icon-svg-bottom-right) no-repeat;
|
|
72
72
|
-webkit-mask-size: 100% 100%;
|
|
73
73
|
mask-size: 100% 100%;
|
|
74
74
|
color: inherit;
|
|
75
75
|
}
|
|
76
|
-
.icon-
|
|
76
|
+
.icon-clear {
|
|
77
77
|
height: 1em;
|
|
78
78
|
width: 1em;
|
|
79
79
|
background-color: currentColor;
|
|
80
|
-
-webkit-mask: var(--icon-svg-
|
|
81
|
-
mask: var(--icon-svg-
|
|
80
|
+
-webkit-mask: var(--icon-svg-clear) no-repeat;
|
|
81
|
+
mask: var(--icon-svg-clear) no-repeat;
|
|
82
82
|
-webkit-mask-size: 100% 100%;
|
|
83
83
|
mask-size: 100% 100%;
|
|
84
84
|
color: inherit;
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
mask-size: 100% 100%;
|
|
104
104
|
color: inherit;
|
|
105
105
|
}
|
|
106
|
-
.icon-
|
|
106
|
+
.icon-frame {
|
|
107
107
|
height: 1em;
|
|
108
108
|
width: 1em;
|
|
109
109
|
background-color: currentColor;
|
|
110
|
-
-webkit-mask: var(--icon-svg-
|
|
111
|
-
mask: var(--icon-svg-
|
|
110
|
+
-webkit-mask: var(--icon-svg-frame) no-repeat;
|
|
111
|
+
mask: var(--icon-svg-frame) no-repeat;
|
|
112
112
|
-webkit-mask-size: 100% 100%;
|
|
113
113
|
mask-size: 100% 100%;
|
|
114
114
|
color: inherit;
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
mask-size: 100% 100%;
|
|
124
124
|
color: inherit;
|
|
125
125
|
}
|
|
126
|
-
.icon-
|
|
126
|
+
.icon-right {
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
background-color: currentColor;
|
|
130
|
-
-webkit-mask: var(--icon-svg-
|
|
131
|
-
mask: var(--icon-svg-
|
|
130
|
+
-webkit-mask: var(--icon-svg-right) no-repeat;
|
|
131
|
+
mask: var(--icon-svg-right) no-repeat;
|
|
132
132
|
-webkit-mask-size: 100% 100%;
|
|
133
133
|
mask-size: 100% 100%;
|
|
134
134
|
color: inherit;
|