@fangzhongya/fang-ui 0.1.22 → 0.1.24

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.
@@ -146,16 +146,14 @@ function comHandle(props2, emit, config) {
146
146
  if (config == null ? void 0 : config.getValue) v = config.getValue(v);
147
147
  if (v && v instanceof Array) {
148
148
  return v.join(props2.multiple);
149
- } else {
150
- return v;
151
149
  }
150
+ return v;
152
151
  };
153
152
  setMultipleValue = (v) => {
154
- let arr = [];
155
153
  if (v && typeof v === "string") {
156
- arr = v.split(props2.multiple);
154
+ return v.split(props2.multiple);
157
155
  }
158
- return arr;
156
+ return v;
159
157
  };
160
158
  setValue(3);
161
159
  }
@@ -144,16 +144,14 @@ function comHandle(props2, emit, config) {
144
144
  if (config == null ? void 0 : config.getValue) v = config.getValue(v);
145
145
  if (v && v instanceof Array) {
146
146
  return v.join(props2.multiple);
147
- } else {
148
- return v;
149
147
  }
148
+ return v;
150
149
  };
151
150
  setMultipleValue = (v) => {
152
- let arr = [];
153
151
  if (v && typeof v === "string") {
154
- arr = v.split(props2.multiple);
152
+ return v.split(props2.multiple);
155
153
  }
156
- return arr;
154
+ return v;
157
155
  };
158
156
  setValue(3);
159
157
  }
@@ -119,4 +119,4 @@
119
119
  @use './tablesp/index.scss' as *;
120
120
  @use './tablespd/index.scss' as *;
121
121
  @use './tabless/index.scss' as *;
122
- @use './tablesv/index.scss' as *;
122
+ @use './tablesvp/index.scss' as *;
@@ -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.ref();
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 == obj) {
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
- // onClick: (event: Event) => {
164
- // isfocus.value = true;
165
- // rowObj.value = obj;
166
- // event.stopPropagation();
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
- // onClick: (event: Event) => {
265
- // isfocus.value = true;
266
- // rowObj.value = obj;
267
- // event.stopPropagation();
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
- // onClick(event: Event) {
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 = ref();
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 == obj) {
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
- // onClick: (event: Event) => {
162
- // isfocus.value = true;
163
- // rowObj.value = obj;
164
- // event.stopPropagation();
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
- // onClick: (event: Event) => {
263
- // isfocus.value = true;
264
- // rowObj.value = obj;
265
- // event.stopPropagation();
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
- // onClick(event: Event) {
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 {
@@ -77,7 +77,7 @@ const dataProps = {
77
77
  }
78
78
  };
79
79
  const dataHandle = list.comHandle;
80
- const dataEmits = [...list.emits, "views"];
80
+ const dataEmits = [...list.emits, "views", "httpRequest"];
81
81
  const dataSlot = {
82
82
  default: "default",
83
83
  views: "views"
@@ -75,7 +75,7 @@ const dataProps = {
75
75
  }
76
76
  };
77
77
  const dataHandle = comHandle;
78
- const dataEmits = [...emits, "views"];
78
+ const dataEmits = [...emits, "views", "httpRequest"];
79
79
  const dataSlot = {
80
80
  default: "default",
81
81
  views: "views"
@@ -141,6 +141,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
141
141
  if (is) {
142
142
  if (multiple.value) {
143
143
  value.value.splice(index2, 1);
144
+ value.value = value.value;
144
145
  } else {
145
146
  value.value = "";
146
147
  }
@@ -152,6 +153,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
152
153
  } else {
153
154
  if (multiple.value) {
154
155
  value.value.splice(index2, 1);
156
+ value.value = value.value;
155
157
  } else {
156
158
  value.value = "";
157
159
  }
@@ -206,12 +208,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
206
208
  if (v instanceof Array) {
207
209
  if (value.value) {
208
210
  value.value.push(...v);
211
+ value.value = value.value;
209
212
  } else {
210
213
  value.value = [...v];
211
214
  }
212
215
  } else {
213
216
  if (value.value) {
214
217
  value.value.push(v);
218
+ value.value = value.value;
215
219
  } else {
216
220
  value.value = [v];
217
221
  }
@@ -139,6 +139,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
139
139
  if (is) {
140
140
  if (multiple.value) {
141
141
  value.value.splice(index, 1);
142
+ value.value = value.value;
142
143
  } else {
143
144
  value.value = "";
144
145
  }
@@ -150,6 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
150
151
  } else {
151
152
  if (multiple.value) {
152
153
  value.value.splice(index, 1);
154
+ value.value = value.value;
153
155
  } else {
154
156
  value.value = "";
155
157
  }
@@ -204,12 +206,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
204
206
  if (v instanceof Array) {
205
207
  if (value.value) {
206
208
  value.value.push(...v);
209
+ value.value = value.value;
207
210
  } else {
208
211
  value.value = [...v];
209
212
  }
210
213
  } else {
211
214
  if (value.value) {
212
215
  value.value.push(v);
216
+ value.value = value.value;
213
217
  } else {
214
218
  value.value = [v];
215
219
  }
@@ -1835,4 +1835,26 @@
1835
1835
  left: 0;
1836
1836
  z-index: 1;
1837
1837
  opacity: 0;
1838
+ }
1839
+
1840
+ .tablesvp {
1841
+ width: 100%;
1842
+ height: var(--tablesvp-height);
1843
+ display: flex;
1844
+ flex-direction: column;
1845
+ }
1846
+ .tablesvp-main {
1847
+ display: flex;
1848
+ flex-direction: column;
1849
+ flex: 1;
1850
+ width: 100%;
1851
+ }
1852
+ .tablesvp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1853
+ display: none;
1854
+ }
1855
+ .tablesvp-paginat {
1856
+ overflow: hidden;
1857
+ }
1858
+ .tablesvp-paginat .el-pagination {
1859
+ justify-content: flex-end;
1838
1860
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1762909550581,
4
+ "lastModified": 1762957513602,
5
5
  "icons": {
6
6
  "bar": {
7
7
  "body": " <path fill=\"currentColor\" d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\" ></path> "
package/dist/index.css CHANGED
@@ -1835,4 +1835,26 @@
1835
1835
  left: 0;
1836
1836
  z-index: 1;
1837
1837
  opacity: 0;
1838
+ }
1839
+
1840
+ .tablesvp {
1841
+ width: 100%;
1842
+ height: var(--tablesvp-height);
1843
+ display: flex;
1844
+ flex-direction: column;
1845
+ }
1846
+ .tablesvp-main {
1847
+ display: flex;
1848
+ flex-direction: column;
1849
+ flex: 1;
1850
+ width: 100%;
1851
+ }
1852
+ .tablesvp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1853
+ display: none;
1854
+ }
1855
+ .tablesvp-paginat {
1856
+ overflow: hidden;
1857
+ }
1858
+ .tablesvp-paginat .el-pagination {
1859
+ justify-content: flex-end;
1838
1860
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.22",
4
+ "version": "0.1.24",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -52,13 +52,13 @@
52
52
  "vuedraggable": "4.1.0",
53
53
  "vxe-table": "4.17.13",
54
54
  "@fang-ui/icons": "0.0.1-0",
55
- "@fang-ui/directives": "0.0.1-0",
56
55
  "@fang-ui/components": "0.0.1-0",
56
+ "@fang-ui/locale": "0.0.1-0",
57
+ "@fang-ui/directives": "0.0.1-0",
57
58
  "@fang-ui/hooks": "0.0.1-0",
59
+ "@fang-ui/types": "0.0.1-0",
58
60
  "@fang-ui/utils": "0.0.1-0",
59
- "@fang-ui/theme": "0.0.1-0",
60
- "@fang-ui/locale": "0.0.1-0",
61
- "@fang-ui/types": "0.0.1-0"
61
+ "@fang-ui/theme": "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