@fangzhongya/fang-ui 0.1.33 → 0.1.34

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.
@@ -98,7 +98,7 @@ function comHandle(props2, obj) {
98
98
  } else {
99
99
  let list = props2.value;
100
100
  if (props2.onRequestAfter) {
101
- list = props2.onRequestAfter(list, obj, true) || {};
101
+ list = props2.onRequestAfter(list, obj, true);
102
102
  }
103
103
  resolve(list);
104
104
  }
@@ -96,7 +96,7 @@ function comHandle(props2, obj) {
96
96
  } else {
97
97
  let list = props2.value;
98
98
  if (props2.onRequestAfter) {
99
- list = props2.onRequestAfter(list, obj, true) || {};
99
+ list = props2.onRequestAfter(list, obj, true);
100
100
  }
101
101
  resolve(list);
102
102
  }
@@ -119,6 +119,6 @@
119
119
  @use './tables/index.scss' as *;
120
120
  @use './tablesp/index.scss' as *;
121
121
  @use './tablespd/index.scss' as *;
122
+ @use './tabless/index.scss' as *;
122
123
  @use './tablesv/index.scss' as *;
123
- @use './tablesvp/index.scss' as *;
124
- @use './tablesvpd/index.scss' as *;
124
+ @use './tablesvp/index.scss' as *;
@@ -44,7 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
44
  onCurrentChange,
45
45
  paginat,
46
46
  data: data$1
47
- } = pagin.useInit(props, emit, refTable, getLocale, true);
47
+ } = pagin.useInit(props, emit, refTable, getLocale, { type: 2 });
48
48
  __expose({
49
49
  getSelection,
50
50
  getRef,
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  onCurrentChange,
43
43
  paginat,
44
44
  data
45
- } = useInit(props, emit, refTable, getLocale, true);
45
+ } = useInit(props, emit, refTable, getLocale, { type: 2 });
46
46
  __expose({
47
47
  getSelection,
48
48
  getRef,
@@ -47,7 +47,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
47
47
  onCurrentChange,
48
48
  paginat,
49
49
  data: data$2
50
- } = pagin.useInit(props, emit, refTable, getLocale, true);
50
+ } = pagin.useInit(props, emit, refTable, getLocale, {
51
+ type: 2,
52
+ config: {
53
+ isdrag: true
54
+ }
55
+ });
51
56
  __expose({
52
57
  getSelection,
53
58
  getRef,
@@ -45,7 +45,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  onCurrentChange,
46
46
  paginat,
47
47
  data
48
- } = useInit(props, emit, refTable, getLocale, true);
48
+ } = useInit(props, emit, refTable, getLocale, {
49
+ type: 2,
50
+ config: {
51
+ isdrag: true
52
+ }
53
+ });
49
54
  __expose({
50
55
  getSelection,
51
56
  getRef,
@@ -57,59 +57,49 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
57
57
  return arr.length > 0;
58
58
  });
59
59
  const setEmptyFun = () => {
60
- if (isOptionsEmpty.value) {
61
- setValue = (item) => {
62
- const v = use.useVueValue(item, props.prop);
63
- if (v === "") {
64
- return emptyValue;
65
- }
66
- return v;
67
- };
68
- value = vue.computed({
69
- set(v) {
70
- if (multiple.value) {
71
- listFuObj.value.value = (v ?? []).map((o) => {
72
- if (o === emptyValue) {
73
- return "";
74
- }
75
- return o;
76
- });
77
- } else {
78
- if (v === emptyValue) {
79
- listFuObj.value.value = "";
80
- } else {
81
- listFuObj.value.value = v;
60
+ setValue = (item) => {
61
+ const v = use.useVueValue(item, props.prop);
62
+ if (v === "") {
63
+ return emptyValue;
64
+ }
65
+ return v;
66
+ };
67
+ value = vue.computed({
68
+ set(v) {
69
+ if (multiple.value) {
70
+ listFuObj.value.value = (v ?? []).map((o) => {
71
+ if (o === emptyValue) {
72
+ return "";
82
73
  }
83
- }
84
- },
85
- get() {
86
- const v = listFuObj.value.value;
87
- if (multiple.value) {
88
- return (v ?? []).map((o) => {
89
- if (o === "") {
90
- return emptyValue;
91
- }
92
- return o;
93
- });
74
+ return o;
75
+ });
76
+ } else {
77
+ if (v === emptyValue) {
78
+ listFuObj.value.value = "";
94
79
  } else {
95
- if (v === "") {
80
+ listFuObj.value.value = v;
81
+ }
82
+ }
83
+ },
84
+ get() {
85
+ const v = listFuObj.value.value;
86
+ if (multiple.value) {
87
+ return (v ?? []).map((o) => {
88
+ if (o === "") {
96
89
  return emptyValue;
97
90
  }
98
- return v;
91
+ return o;
92
+ });
93
+ } else {
94
+ if (isOptionsEmpty.value && v === "") {
95
+ return emptyValue;
99
96
  }
97
+ return v;
100
98
  }
101
- });
102
- }
99
+ }
100
+ });
103
101
  };
104
- vue.watch(
105
- () => isOptionsEmpty.value,
106
- () => {
107
- setEmptyFun();
108
- },
109
- {
110
- immediate: true
111
- }
112
- );
102
+ setEmptyFun();
113
103
  }
114
104
  const onChange = (v) => {
115
105
  if (multiple.value) {
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, useAttrs, computed, watch, createElementBlock, openBlock, mergeProps, unref, createVNode, isRef, withCtx, Fragment, renderList, createBlock } from "vue";
1
+ import { defineComponent, ref, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, createVNode, isRef, withCtx, Fragment, renderList, createBlock } from "vue";
2
2
  import { Select } from "../../select/index.js";
3
3
  import { Option } from "../../option/index.js";
4
4
  import { compareArray } from "@fangzhongya/utils/basic/array/compareArray";
@@ -55,59 +55,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55
55
  return arr.length > 0;
56
56
  });
57
57
  const setEmptyFun = () => {
58
- if (isOptionsEmpty.value) {
59
- setValue = (item) => {
60
- const v = useVueValue(item, props.prop);
61
- if (v === "") {
62
- return emptyValue;
63
- }
64
- return v;
65
- };
66
- value = computed({
67
- set(v) {
68
- if (multiple.value) {
69
- listFuObj.value.value = (v ?? []).map((o) => {
70
- if (o === emptyValue) {
71
- return "";
72
- }
73
- return o;
74
- });
75
- } else {
76
- if (v === emptyValue) {
77
- listFuObj.value.value = "";
78
- } else {
79
- listFuObj.value.value = v;
58
+ setValue = (item) => {
59
+ const v = useVueValue(item, props.prop);
60
+ if (v === "") {
61
+ return emptyValue;
62
+ }
63
+ return v;
64
+ };
65
+ value = computed({
66
+ set(v) {
67
+ if (multiple.value) {
68
+ listFuObj.value.value = (v ?? []).map((o) => {
69
+ if (o === emptyValue) {
70
+ return "";
80
71
  }
81
- }
82
- },
83
- get() {
84
- const v = listFuObj.value.value;
85
- if (multiple.value) {
86
- return (v ?? []).map((o) => {
87
- if (o === "") {
88
- return emptyValue;
89
- }
90
- return o;
91
- });
72
+ return o;
73
+ });
74
+ } else {
75
+ if (v === emptyValue) {
76
+ listFuObj.value.value = "";
92
77
  } else {
93
- if (v === "") {
78
+ listFuObj.value.value = v;
79
+ }
80
+ }
81
+ },
82
+ get() {
83
+ const v = listFuObj.value.value;
84
+ if (multiple.value) {
85
+ return (v ?? []).map((o) => {
86
+ if (o === "") {
94
87
  return emptyValue;
95
88
  }
96
- return v;
89
+ return o;
90
+ });
91
+ } else {
92
+ if (isOptionsEmpty.value && v === "") {
93
+ return emptyValue;
97
94
  }
95
+ return v;
98
96
  }
99
- });
100
- }
97
+ }
98
+ });
101
99
  };
102
- watch(
103
- () => isOptionsEmpty.value,
104
- () => {
105
- setEmptyFun();
106
- },
107
- {
108
- immediate: true
109
- }
110
- );
100
+ setEmptyFun();
111
101
  }
112
102
  const onChange = (v) => {
113
103
  if (multiple.value) {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
+ const unmergeObject = require("@fangzhongya/utils/basic/object/unmergeObject");
4
5
  require("../../../utils/index.cjs");
5
6
  const urls = require("../../common/urls.cjs");
6
7
  const firstLower = require("@fangzhongya/utils/basic/string/firstLower");
@@ -73,7 +74,7 @@ const dataProps = {
73
74
  }
74
75
  };
75
76
  const dataEmit = ["list-events", "selection", "drag", "update:value"];
76
- const useInit = (props2, emit, refTable, getLocale, isEl) => {
77
+ const useInit = (props2, emit, refTable, getLocale, defaultConfig = {}) => {
77
78
  var _a, _b;
78
79
  const loading = vue.ref(false);
79
80
  const mpagconfig = {
@@ -207,7 +208,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
207
208
  paginat.cross = pagin.cross || false;
208
209
  paginat.pageSize = pagin.size || mpagconfig.pageSize;
209
210
  pagconfig.value = Object.assign({}, mpagconfig, pagin.config || {});
210
- tableConfig.value = config;
211
+ tableConfig.value = unmergeObject.unmergeObject(defaultConfig, config, 2);
211
212
  };
212
213
  vue.watch(
213
214
  [() => props2.configs, () => props2.config, () => props2.list],
@@ -232,13 +233,6 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
232
233
  });
233
234
  return obj;
234
235
  });
235
- const istype = vue.computed(() => {
236
- if (isEl) {
237
- return true;
238
- } else {
239
- return tableConfig.value.type == 1;
240
- }
241
- });
242
236
  function setCrossPage() {
243
237
  const v = data.current;
244
238
  console.log("v", v);
@@ -428,7 +422,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
428
422
  }
429
423
  function empty() {
430
424
  var _a2, _b2, _c, _d;
431
- if (istype.value && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
425
+ if (tableConfig.value.type == 1 && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
432
426
  (_b2 = refTable.value) == null ? void 0 : _b2.clearRadioRow();
433
427
  }
434
428
  (_c = refTable.value) == null ? void 0 : _c.clearSelection();
@@ -93,7 +93,7 @@ export declare const dataProps: {
93
93
  };
94
94
  };
95
95
  export declare const dataEmit: string[];
96
- export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit: Function, refTable: Ref, getLocale: Translator, isEl?: boolean) => {
96
+ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit: Function, refTable: Ref, getLocale: Translator, defaultConfig?: TableConfig) => {
97
97
  height: ComputedRef<any>;
98
98
  tableConfig: Ref<{
99
99
  [x: string]: any;
@@ -1,4 +1,5 @@
1
1
  import { ref, reactive, watch, computed, nextTick } from "vue";
2
+ import { unmergeObject } from "@fangzhongya/utils/basic/object/unmergeObject";
2
3
  import "../../../utils/index.js";
3
4
  import { props, comHandle } from "../../common/urls.js";
4
5
  import { firstLower } from "@fangzhongya/utils/basic/string/firstLower";
@@ -71,7 +72,7 @@ const dataProps = {
71
72
  }
72
73
  };
73
74
  const dataEmit = ["list-events", "selection", "drag", "update:value"];
74
- const useInit = (props2, emit, refTable, getLocale, isEl) => {
75
+ const useInit = (props2, emit, refTable, getLocale, defaultConfig = {}) => {
75
76
  var _a, _b;
76
77
  const loading = ref(false);
77
78
  const mpagconfig = {
@@ -205,7 +206,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
205
206
  paginat.cross = pagin.cross || false;
206
207
  paginat.pageSize = pagin.size || mpagconfig.pageSize;
207
208
  pagconfig.value = Object.assign({}, mpagconfig, pagin.config || {});
208
- tableConfig.value = config;
209
+ tableConfig.value = unmergeObject(defaultConfig, config, 2);
209
210
  };
210
211
  watch(
211
212
  [() => props2.configs, () => props2.config, () => props2.list],
@@ -230,13 +231,6 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
230
231
  });
231
232
  return obj;
232
233
  });
233
- const istype = computed(() => {
234
- if (isEl) {
235
- return true;
236
- } else {
237
- return tableConfig.value.type == 1;
238
- }
239
- });
240
234
  function setCrossPage() {
241
235
  const v = data.current;
242
236
  console.log("v", v);
@@ -426,7 +420,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
426
420
  }
427
421
  function empty() {
428
422
  var _a2, _b2, _c, _d;
429
- if (istype.value && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
423
+ if (tableConfig.value.type == 1 && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
430
424
  (_b2 = refTable.value) == null ? void 0 : _b2.clearRadioRow();
431
425
  }
432
426
  (_c = refTable.value) == null ? void 0 : _c.clearSelection();
@@ -44,7 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
44
  onCurrentChange,
45
45
  paginat,
46
46
  data: data$1
47
- } = pagin.useInit(props, emit, refTable, getLocale, true);
47
+ } = pagin.useInit(props, emit, refTable, getLocale);
48
48
  __expose({
49
49
  getRef,
50
50
  getSelection,
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  onCurrentChange,
43
43
  paginat,
44
44
  data
45
- } = useInit(props, emit, refTable, getLocale, true);
45
+ } = useInit(props, emit, refTable, getLocale);
46
46
  __expose({
47
47
  getRef,
48
48
  getSelection,
@@ -46,7 +46,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
46
46
  onCurrentChange,
47
47
  paginat,
48
48
  data: data$1
49
- } = pagin.useInit(props, emit, refTable, getLocale, true);
49
+ } = pagin.useInit(props, emit, refTable, getLocale, {
50
+ config: {
51
+ isdrag: true
52
+ }
53
+ });
50
54
  __expose({
51
55
  getSelection,
52
56
  getRef,
@@ -44,7 +44,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
44
  onCurrentChange,
45
45
  paginat,
46
46
  data
47
- } = useInit(props, emit, refTable, getLocale, true);
47
+ } = useInit(props, emit, refTable, getLocale, {
48
+ config: {
49
+ isdrag: true
50
+ }
51
+ });
48
52
  __expose({
49
53
  getSelection,
50
54
  getRef,
@@ -44,7 +44,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
44
  paginat,
45
45
  scroll,
46
46
  data: data$1
47
- } = pagin.useInit(props, emit, refTable, getLocale);
47
+ } = pagin.useInit(props, emit, refTable, getLocale, {
48
+ type: 1
49
+ });
48
50
  __expose({
49
51
  getSelection,
50
52
  getRef,
@@ -42,7 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  paginat,
43
43
  scroll,
44
44
  data
45
- } = useInit(props, emit, refTable, getLocale);
45
+ } = useInit(props, emit, refTable, getLocale, {
46
+ type: 1
47
+ });
46
48
  __expose({
47
49
  getSelection,
48
50
  getRef,
@@ -46,7 +46,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
46
46
  scroll,
47
47
  sortable,
48
48
  data: data$1
49
- } = pagin.useInit(props, emit, refTable, getLocale);
49
+ } = pagin.useInit(props, emit, refTable, getLocale, {
50
+ type: 1,
51
+ config: {
52
+ isdrag: true
53
+ }
54
+ });
50
55
  __expose({
51
56
  getSelection,
52
57
  getRef,
@@ -44,7 +44,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
44
  scroll,
45
45
  sortable,
46
46
  data
47
- } = useInit(props, emit, refTable, getLocale);
47
+ } = useInit(props, emit, refTable, getLocale, {
48
+ type: 1,
49
+ config: {
50
+ isdrag: true
51
+ }
52
+ });
48
53
  __expose({
49
54
  getSelection,
50
55
  getRef,
@@ -1751,6 +1751,28 @@
1751
1751
  justify-content: flex-end;
1752
1752
  }
1753
1753
 
1754
+ .tabless {
1755
+ width: 100%;
1756
+ flex: 1;
1757
+ display: flex;
1758
+ flex-direction: column;
1759
+ }
1760
+ .tabless-main {
1761
+ display: flex;
1762
+ flex-direction: column;
1763
+ flex: 1;
1764
+ width: 100%;
1765
+ }
1766
+ .tabless-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1767
+ display: none;
1768
+ }
1769
+ .tabless-paginat {
1770
+ overflow: hidden;
1771
+ }
1772
+ .tabless-paginat .el-pagination {
1773
+ justify-content: flex-end;
1774
+ }
1775
+
1754
1776
  .tablesv {
1755
1777
  width: 100%;
1756
1778
  min-height: 100px;
@@ -1860,32 +1882,4 @@
1860
1882
  }
1861
1883
  .tablesvp-paginat .el-pagination {
1862
1884
  justify-content: flex-end;
1863
- }
1864
-
1865
- .tablesvpd {
1866
- width: 100%;
1867
- height: var(--tablesvpd-height);
1868
- display: flex;
1869
- flex-direction: column;
1870
- }
1871
- .tablesvpd-main {
1872
- display: flex;
1873
- flex-direction: column;
1874
- flex: 1;
1875
- width: 100%;
1876
- }
1877
- .tablesvpd-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1878
- display: none;
1879
- }
1880
- .tablesvpd-main.is-scroll .v-scroll-add {
1881
- text-align: center;
1882
- padding: 10px;
1883
- color: #999;
1884
- background-color: #eee;
1885
- }
1886
- .tablesvpd-paginat {
1887
- overflow: hidden;
1888
- }
1889
- .tablesvpd-paginat .el-pagination {
1890
- justify-content: flex-end;
1891
1885
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1763557620058,
4
+ "lastModified": 1763605251473,
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
@@ -1751,6 +1751,28 @@
1751
1751
  justify-content: flex-end;
1752
1752
  }
1753
1753
 
1754
+ .tabless {
1755
+ width: 100%;
1756
+ flex: 1;
1757
+ display: flex;
1758
+ flex-direction: column;
1759
+ }
1760
+ .tabless-main {
1761
+ display: flex;
1762
+ flex-direction: column;
1763
+ flex: 1;
1764
+ width: 100%;
1765
+ }
1766
+ .tabless-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1767
+ display: none;
1768
+ }
1769
+ .tabless-paginat {
1770
+ overflow: hidden;
1771
+ }
1772
+ .tabless-paginat .el-pagination {
1773
+ justify-content: flex-end;
1774
+ }
1775
+
1754
1776
  .tablesv {
1755
1777
  width: 100%;
1756
1778
  min-height: 100px;
@@ -1860,32 +1882,4 @@
1860
1882
  }
1861
1883
  .tablesvp-paginat .el-pagination {
1862
1884
  justify-content: flex-end;
1863
- }
1864
-
1865
- .tablesvpd {
1866
- width: 100%;
1867
- height: var(--tablesvpd-height);
1868
- display: flex;
1869
- flex-direction: column;
1870
- }
1871
- .tablesvpd-main {
1872
- display: flex;
1873
- flex-direction: column;
1874
- flex: 1;
1875
- width: 100%;
1876
- }
1877
- .tablesvpd-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1878
- display: none;
1879
- }
1880
- .tablesvpd-main.is-scroll .v-scroll-add {
1881
- text-align: center;
1882
- padding: 10px;
1883
- color: #999;
1884
- background-color: #eee;
1885
- }
1886
- .tablesvpd-paginat {
1887
- overflow: hidden;
1888
- }
1889
- .tablesvpd-paginat .el-pagination {
1890
- justify-content: flex-end;
1891
1885
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.33",
4
+ "version": "0.1.34",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -51,9 +51,9 @@
51
51
  "vue-tsc": "^3.1.4",
52
52
  "vxe-table": "4.6.20",
53
53
  "@fang-ui/components": "0.0.1-0",
54
+ "@fang-ui/icons": "0.0.1-0",
54
55
  "@fang-ui/directives": "0.0.1-0",
55
56
  "@fang-ui/hooks": "0.0.1-0",
56
- "@fang-ui/icons": "0.0.1-0",
57
57
  "@fang-ui/locale": "0.0.1-0",
58
58
  "@fang-ui/theme": "0.0.1-0",
59
59
  "@fang-ui/types": "0.0.1-0",
File without changes
File without changes