@fangzhongya/fang-ui 0.1.22 → 0.1.23
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/list/src/index2.cjs +26 -26
- package/dist/components/list/src/index2.js +27 -27
- package/dist/components/uploads/src/data.cjs +1 -1
- package/dist/components/uploads/src/data.js +1 -1
- package/dist/icons/index.json +1 -1
- package/package.json +6 -6
- /package/dist/components/{popover → divider}/index.css +0 -0
- /package/dist/components/{forms-item → forms-items}/index.css +0 -0
- /package/dist/css/{popover.css → divider.css} +0 -0
- /package/dist/css/{forms-item.css → forms-items.css} +0 -0
|
@@ -7,7 +7,6 @@ const use = require("../../common/use.cjs");
|
|
|
7
7
|
const compons = require("../../common/compons.cjs");
|
|
8
8
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
9
9
|
const tooltip = require("../../tables/common/tooltip.cjs");
|
|
10
|
-
require("../../tables/common/config.cjs");
|
|
11
10
|
const index = require("../../../hooks/props-default/index.cjs");
|
|
12
11
|
const data = require("./data.cjs");
|
|
13
12
|
require("../../tables/common/img.cjs");
|
|
@@ -28,7 +27,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
28
27
|
const cs = index$1.useCssName(data.name);
|
|
29
28
|
const refDom = vue.ref();
|
|
30
29
|
const isfocus = vue.ref(false);
|
|
31
|
-
const rowObj = vue.
|
|
30
|
+
const rowObj = vue.shallowRef();
|
|
32
31
|
const borderColor = vue.computed(() => {
|
|
33
32
|
const d = "#ccc";
|
|
34
33
|
if (typeof props.border === "boolean") {
|
|
@@ -37,9 +36,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
37
36
|
return props.border ?? d;
|
|
38
37
|
}
|
|
39
38
|
});
|
|
39
|
+
const ComponSelectedName = "compon-selected";
|
|
40
40
|
function isComponSelected(obj) {
|
|
41
41
|
if (use.useObjComponSelected(obj, props)) {
|
|
42
|
-
if (rowObj.value
|
|
42
|
+
if (rowObj.value === obj) {
|
|
43
43
|
if (isfocus.value) {
|
|
44
44
|
return true;
|
|
45
45
|
} else {
|
|
@@ -148,6 +148,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
148
148
|
},
|
|
149
149
|
class: [
|
|
150
150
|
cs.z("table-th"),
|
|
151
|
+
ComponSelectedName,
|
|
151
152
|
cs.is("whole", obj.whole),
|
|
152
153
|
cs.is(
|
|
153
154
|
"width",
|
|
@@ -159,13 +160,11 @@ const _sfc_main = vue.defineComponent({
|
|
|
159
160
|
obj.class ?? ""
|
|
160
161
|
].join(" "),
|
|
161
162
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
162
|
-
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// return false;
|
|
168
|
-
// },
|
|
163
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
164
|
+
onClick: () => {
|
|
165
|
+
isfocus.value = true;
|
|
166
|
+
rowObj.value = obj;
|
|
167
|
+
}
|
|
169
168
|
},
|
|
170
169
|
[
|
|
171
170
|
vue.h(
|
|
@@ -254,19 +253,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
254
253
|
style: css.setStyles(obj, props.value, props),
|
|
255
254
|
class: [
|
|
256
255
|
cs.z("table-td"),
|
|
256
|
+
ComponSelectedName,
|
|
257
257
|
cs.is("whole", obj.whole),
|
|
258
258
|
"items" + (obj.items ?? props.items),
|
|
259
259
|
"align" + (obj.align ?? props.align),
|
|
260
260
|
obj.class ?? ""
|
|
261
261
|
].join(" "),
|
|
262
262
|
colspan: setColspan(obj),
|
|
263
|
-
rowspan: setRowspan(obj, isRow)
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
// return false;
|
|
269
|
-
// },
|
|
263
|
+
rowspan: setRowspan(obj, isRow),
|
|
264
|
+
onClick: () => {
|
|
265
|
+
isfocus.value = true;
|
|
266
|
+
rowObj.value = obj;
|
|
267
|
+
}
|
|
270
268
|
},
|
|
271
269
|
[...getChildrenValue(obj, index2)]
|
|
272
270
|
);
|
|
@@ -350,6 +348,14 @@ const _sfc_main = vue.defineComponent({
|
|
|
350
348
|
}
|
|
351
349
|
return;
|
|
352
350
|
};
|
|
351
|
+
const onClickTotal = (event) => {
|
|
352
|
+
const isFromGrandchild = event.target.closest(
|
|
353
|
+
"." + ComponSelectedName
|
|
354
|
+
);
|
|
355
|
+
if (!isFromGrandchild) {
|
|
356
|
+
isfocus.value = false;
|
|
357
|
+
}
|
|
358
|
+
};
|
|
353
359
|
const renderValue = () => {
|
|
354
360
|
if (props.list && props.list.length > 0) {
|
|
355
361
|
return vue.h(
|
|
@@ -364,12 +370,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
364
370
|
rowMaxHeight: props.rowMaxHeight,
|
|
365
371
|
lineClamp: props.lineClamp,
|
|
366
372
|
interval: props.interval
|
|
367
|
-
})
|
|
368
|
-
|
|
369
|
-
// isfocus.value = true;
|
|
370
|
-
// event.stopPropagation();
|
|
371
|
-
// return false;
|
|
372
|
-
// },
|
|
373
|
+
}),
|
|
374
|
+
onClick: onClickTotal
|
|
373
375
|
},
|
|
374
376
|
[
|
|
375
377
|
vue.h(
|
|
@@ -398,9 +400,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
398
400
|
};
|
|
399
401
|
vue.onMounted(() => {
|
|
400
402
|
if (window) {
|
|
401
|
-
window.addEventListener("click",
|
|
402
|
-
isfocus.value = false;
|
|
403
|
-
});
|
|
403
|
+
window.addEventListener("click", onClickTotal);
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
406
|
return {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, h, onMounted } from "vue";
|
|
1
|
+
import { defineComponent, ref, shallowRef, computed, h, onMounted } from "vue";
|
|
2
2
|
import { setLabel, setSslot } from "./util.js";
|
|
3
3
|
import { setStyles } from "../../common/css.js";
|
|
4
4
|
import { useObjComponSelected, useHide } from "../../common/use.js";
|
|
5
5
|
import { useCompons } from "../../common/compons.js";
|
|
6
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
7
7
|
import { hideTooltip, showTooltip } from "../../tables/common/tooltip.js";
|
|
8
|
-
import "../../tables/common/config.js";
|
|
9
8
|
import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
|
|
10
9
|
import { name, dataProps, dataExpose, dataEmits } from "./data.js";
|
|
11
10
|
import "../../tables/common/img.js";
|
|
@@ -26,7 +25,7 @@ const _sfc_main = defineComponent({
|
|
|
26
25
|
const cs = useCssName(name);
|
|
27
26
|
const refDom = ref();
|
|
28
27
|
const isfocus = ref(false);
|
|
29
|
-
const rowObj =
|
|
28
|
+
const rowObj = shallowRef();
|
|
30
29
|
const borderColor = computed(() => {
|
|
31
30
|
const d = "#ccc";
|
|
32
31
|
if (typeof props.border === "boolean") {
|
|
@@ -35,9 +34,10 @@ const _sfc_main = defineComponent({
|
|
|
35
34
|
return props.border ?? d;
|
|
36
35
|
}
|
|
37
36
|
});
|
|
37
|
+
const ComponSelectedName = "compon-selected";
|
|
38
38
|
function isComponSelected(obj) {
|
|
39
39
|
if (useObjComponSelected(obj, props)) {
|
|
40
|
-
if (rowObj.value
|
|
40
|
+
if (rowObj.value === obj) {
|
|
41
41
|
if (isfocus.value) {
|
|
42
42
|
return true;
|
|
43
43
|
} else {
|
|
@@ -146,6 +146,7 @@ const _sfc_main = defineComponent({
|
|
|
146
146
|
},
|
|
147
147
|
class: [
|
|
148
148
|
cs.z("table-th"),
|
|
149
|
+
ComponSelectedName,
|
|
149
150
|
cs.is("whole", obj.whole),
|
|
150
151
|
cs.is(
|
|
151
152
|
"width",
|
|
@@ -157,13 +158,11 @@ const _sfc_main = defineComponent({
|
|
|
157
158
|
obj.class ?? ""
|
|
158
159
|
].join(" "),
|
|
159
160
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
160
|
-
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
// return false;
|
|
166
|
-
// },
|
|
161
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
162
|
+
onClick: () => {
|
|
163
|
+
isfocus.value = true;
|
|
164
|
+
rowObj.value = obj;
|
|
165
|
+
}
|
|
167
166
|
},
|
|
168
167
|
[
|
|
169
168
|
h(
|
|
@@ -252,19 +251,18 @@ const _sfc_main = defineComponent({
|
|
|
252
251
|
style: setStyles(obj, props.value, props),
|
|
253
252
|
class: [
|
|
254
253
|
cs.z("table-td"),
|
|
254
|
+
ComponSelectedName,
|
|
255
255
|
cs.is("whole", obj.whole),
|
|
256
256
|
"items" + (obj.items ?? props.items),
|
|
257
257
|
"align" + (obj.align ?? props.align),
|
|
258
258
|
obj.class ?? ""
|
|
259
259
|
].join(" "),
|
|
260
260
|
colspan: setColspan(obj),
|
|
261
|
-
rowspan: setRowspan(obj, isRow)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
// return false;
|
|
267
|
-
// },
|
|
261
|
+
rowspan: setRowspan(obj, isRow),
|
|
262
|
+
onClick: () => {
|
|
263
|
+
isfocus.value = true;
|
|
264
|
+
rowObj.value = obj;
|
|
265
|
+
}
|
|
268
266
|
},
|
|
269
267
|
[...getChildrenValue(obj, index)]
|
|
270
268
|
);
|
|
@@ -348,6 +346,14 @@ const _sfc_main = defineComponent({
|
|
|
348
346
|
}
|
|
349
347
|
return;
|
|
350
348
|
};
|
|
349
|
+
const onClickTotal = (event) => {
|
|
350
|
+
const isFromGrandchild = event.target.closest(
|
|
351
|
+
"." + ComponSelectedName
|
|
352
|
+
);
|
|
353
|
+
if (!isFromGrandchild) {
|
|
354
|
+
isfocus.value = false;
|
|
355
|
+
}
|
|
356
|
+
};
|
|
351
357
|
const renderValue = () => {
|
|
352
358
|
if (props.list && props.list.length > 0) {
|
|
353
359
|
return h(
|
|
@@ -362,12 +368,8 @@ const _sfc_main = defineComponent({
|
|
|
362
368
|
rowMaxHeight: props.rowMaxHeight,
|
|
363
369
|
lineClamp: props.lineClamp,
|
|
364
370
|
interval: props.interval
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
// isfocus.value = true;
|
|
368
|
-
// event.stopPropagation();
|
|
369
|
-
// return false;
|
|
370
|
-
// },
|
|
371
|
+
}),
|
|
372
|
+
onClick: onClickTotal
|
|
371
373
|
},
|
|
372
374
|
[
|
|
373
375
|
h(
|
|
@@ -396,9 +398,7 @@ const _sfc_main = defineComponent({
|
|
|
396
398
|
};
|
|
397
399
|
onMounted(() => {
|
|
398
400
|
if (window) {
|
|
399
|
-
window.addEventListener("click",
|
|
400
|
-
isfocus.value = false;
|
|
401
|
-
});
|
|
401
|
+
window.addEventListener("click", onClickTotal);
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
return {
|
package/dist/icons/index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/fang-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.23",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"vue-tsc": "^3.1.3",
|
|
52
52
|
"vuedraggable": "4.1.0",
|
|
53
53
|
"vxe-table": "4.17.13",
|
|
54
|
-
"@fang-ui/icons": "0.0.1-0",
|
|
55
|
-
"@fang-ui/directives": "0.0.1-0",
|
|
56
54
|
"@fang-ui/components": "0.0.1-0",
|
|
55
|
+
"@fang-ui/directives": "0.0.1-0",
|
|
57
56
|
"@fang-ui/hooks": "0.0.1-0",
|
|
58
|
-
"@fang-ui/utils": "0.0.1-0",
|
|
59
|
-
"@fang-ui/theme": "0.0.1-0",
|
|
60
57
|
"@fang-ui/locale": "0.0.1-0",
|
|
61
|
-
"@fang-ui/
|
|
58
|
+
"@fang-ui/icons": "0.0.1-0",
|
|
59
|
+
"@fang-ui/theme": "0.0.1-0",
|
|
60
|
+
"@fang-ui/types": "0.0.1-0",
|
|
61
|
+
"@fang-ui/utils": "0.0.1-0"
|
|
62
62
|
},
|
|
63
63
|
"main": "./dist/index.cjs",
|
|
64
64
|
"module": "./dist/index.js",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|