@fangzhongya/fang-ui 0.1.43 → 0.1.45

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.
Files changed (47) hide show
  1. package/dist/components/buttons/src/index2.cjs +15 -8
  2. package/dist/components/buttons/src/index2.js +13 -6
  3. package/dist/components/common/use.cjs +34 -27
  4. package/dist/components/common/use.js +14 -7
  5. package/dist/components/dates/src/data.cjs +6 -0
  6. package/dist/components/dates/src/data.d.ts +6 -0
  7. package/dist/components/dates/src/data.js +6 -0
  8. package/dist/components/dates/src/index2.cjs +12 -1
  9. package/dist/components/dates/src/index2.js +12 -1
  10. package/dist/components/dates-divide/src/data.cjs +7 -1
  11. package/dist/components/dates-divide/src/data.d.ts +6 -0
  12. package/dist/components/dates-divide/src/data.js +7 -1
  13. package/dist/components/dates-divide/src/index2.cjs +13 -4
  14. package/dist/components/dates-divide/src/index2.js +13 -4
  15. package/dist/components/dates-picker/src/data.cjs +6 -0
  16. package/dist/components/dates-picker/src/data.d.ts +12 -0
  17. package/dist/components/dates-picker/src/data.js +6 -0
  18. package/dist/components/dates-picker/src/index2.cjs +11 -0
  19. package/dist/components/dates-picker/src/index2.js +11 -0
  20. package/dist/components/dates2/src/data.cjs +6 -0
  21. package/dist/components/dates2/src/data.d.ts +6 -0
  22. package/dist/components/dates2/src/data.js +6 -0
  23. package/dist/components/dates2/src/index2.cjs +12 -0
  24. package/dist/components/dates2/src/index2.js +12 -0
  25. package/dist/components/forms-div/src/index2.cjs +27 -19
  26. package/dist/components/forms-div/src/index2.js +27 -19
  27. package/dist/components/forms-item/src/data.cjs +2 -5
  28. package/dist/components/forms-item/src/data.d.ts +2 -3
  29. package/dist/components/forms-item/src/data.js +2 -5
  30. package/dist/components/forms-item/src/indexts.d.ts +2 -5
  31. package/dist/components/tables/common/com-but2.cjs +9 -13
  32. package/dist/components/tables/common/com-but2.js +7 -11
  33. package/dist/components/tables/common/com-color2.cjs +7 -11
  34. package/dist/components/tables/common/com-color2.js +8 -12
  35. package/dist/components/tables/common/com-lis2.cjs +7 -10
  36. package/dist/components/tables/common/com-lis2.js +8 -11
  37. package/dist/components/tables/common/util.cjs +0 -88
  38. package/dist/components/tables/common/util.d.ts +0 -8
  39. package/dist/components/tables/common/util.js +1 -89
  40. package/dist/hooks/event-aliass/index.cjs +121 -0
  41. package/dist/hooks/event-aliass/index.d.ts +1 -0
  42. package/dist/hooks/event-aliass/index.js +121 -0
  43. package/dist/icons/index.json +1 -1
  44. package/dist/utils/vues/common.d.ts +0 -8
  45. package/package.json +7 -7
  46. /package/dist/components/{input-tag → keep-com}/index.css +0 -0
  47. /package/dist/css/{input-tag.css → keep-com.css} +0 -0
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
4
  const use = require("../../common/use.cjs");
5
- const firstUpper = require("@fangzhongya/utils/basic/string/firstUpper");
6
- const splitUpper = require("@fangzhongya/utils/basic/string/splitUpper");
7
5
  const getAttrValue = require("../../../utils/vues/getAttrValue.cjs");
8
6
  const css = require("../../../utils/css.cjs");
9
7
  function getVNodeWidth(vnode) {
@@ -67,91 +65,6 @@ function setMinWidth(obj, props) {
67
65
  }
68
66
  }
69
67
  }
70
- const eventAliasObj = {
71
- //.stop - 调用 event.stopPropagation()。
72
- stop(event) {
73
- event.stopPropagation();
74
- return true;
75
- },
76
- // .prevent - 调用 event.preventDefault()。
77
- prevent(event) {
78
- event.preventDefault();
79
- return true;
80
- },
81
- // .self - 只有事件从元素本身发出才触发处理函数。
82
- self(event) {
83
- return event.target === event.currentTarget;
84
- },
85
- // .once - 最多触发一次处理函数。
86
- once(event) {
87
- var _a;
88
- if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
89
- return false;
90
- } else {
91
- if (event.currentTarget) {
92
- event.currentTarget.__once__ = true;
93
- }
94
- return true;
95
- }
96
- }
97
- // .capture - 在捕获模式添加事件监听器。
98
- // 处理事件是异步的,只有在触发了事件后才执行方法,
99
- // 目前无法支持 capture
100
- // capture(event) {
101
- // console.log('event', event);
102
- // return true;
103
- // },
104
- };
105
- function eventAlias(key, callback, obj, $event) {
106
- let is = false;
107
- const name = "on" + firstUpper.firstUpper(key);
108
- const arr = [];
109
- for (const k of Object.keys(obj)) {
110
- if (k.startsWith(name)) {
111
- arr.push(k);
112
- }
113
- }
114
- const reg = new RegExp("^" + name);
115
- for (const v of arr) {
116
- let s = v.replace(reg, "");
117
- if (s && $event) {
118
- let ns = splitUpper.splitUpper(s);
119
- if (ns.includes("passive")) {
120
- ns = ns.filter((k) => {
121
- return k != "prevent";
122
- });
123
- }
124
- const fn = () => {
125
- if (ns.includes("once")) {
126
- let isc = eventAliasObj.once($event);
127
- if (isc) {
128
- callback(obj[v]);
129
- }
130
- } else {
131
- callback(obj[v]);
132
- }
133
- };
134
- vue.withModifiers(fn, ns)();
135
- } else {
136
- callback(obj[v]);
137
- }
138
- is = true;
139
- }
140
- return is;
141
- }
142
- function eventAliass(callback, arr, obj, $event) {
143
- if (!callback || !obj || !arr || arr.length === 0) {
144
- return false;
145
- }
146
- let is = false;
147
- const items = Array.isArray(arr) ? arr : [arr];
148
- for (const key of items) {
149
- if (eventAlias(key, callback, obj, $event)) {
150
- is = true;
151
- }
152
- }
153
- return is;
154
- }
155
68
  function setEmptyDisplay(value, emptyDisplay, isStr) {
156
69
  if (isStr) {
157
70
  if (value === "" || value === void 0 || value === null) {
@@ -161,6 +74,5 @@ function setEmptyDisplay(value, emptyDisplay, isStr) {
161
74
  return emptyDisplay;
162
75
  }
163
76
  }
164
- exports.eventAliass = eventAliass;
165
77
  exports.setEmptyDisplay = setEmptyDisplay;
166
78
  exports.setMinWidth = setMinWidth;
@@ -5,14 +5,6 @@
5
5
  * @returns 返回设置的最小宽度值,可能为具体数值、函数执行结果或undefined
6
6
  */
7
7
  export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
8
- /**
9
- * 支持事件别名处理
10
- * @param {*} callback
11
- * @param {*} arr
12
- * @param {*} obj
13
- * @param {*} $event
14
- */
15
- export declare function eventAliass(callback: Function, arr: string | string[], obj: ObjAny, $event: Event): boolean;
16
8
  /**
17
9
  * 设置空值显示内容
18
10
  * @param value 需要检查的值
@@ -1,7 +1,5 @@
1
- import { render, isVNode, h, withModifiers } from "vue";
1
+ import { render, isVNode, h } from "vue";
2
2
  import { useGetDomLabel } from "../../common/use.js";
3
- import { firstUpper } from "@fangzhongya/utils/basic/string/firstUpper";
4
- import { splitUpper } from "@fangzhongya/utils/basic/string/splitUpper";
5
3
  import { getAttrValue } from "../../../utils/vues/getAttrValue.js";
6
4
  import { getCssNumber } from "../../../utils/css.js";
7
5
  function getVNodeWidth(vnode) {
@@ -65,91 +63,6 @@ function setMinWidth(obj, props) {
65
63
  }
66
64
  }
67
65
  }
68
- const eventAliasObj = {
69
- //.stop - 调用 event.stopPropagation()。
70
- stop(event) {
71
- event.stopPropagation();
72
- return true;
73
- },
74
- // .prevent - 调用 event.preventDefault()。
75
- prevent(event) {
76
- event.preventDefault();
77
- return true;
78
- },
79
- // .self - 只有事件从元素本身发出才触发处理函数。
80
- self(event) {
81
- return event.target === event.currentTarget;
82
- },
83
- // .once - 最多触发一次处理函数。
84
- once(event) {
85
- var _a;
86
- if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
87
- return false;
88
- } else {
89
- if (event.currentTarget) {
90
- event.currentTarget.__once__ = true;
91
- }
92
- return true;
93
- }
94
- }
95
- // .capture - 在捕获模式添加事件监听器。
96
- // 处理事件是异步的,只有在触发了事件后才执行方法,
97
- // 目前无法支持 capture
98
- // capture(event) {
99
- // console.log('event', event);
100
- // return true;
101
- // },
102
- };
103
- function eventAlias(key, callback, obj, $event) {
104
- let is = false;
105
- const name = "on" + firstUpper(key);
106
- const arr = [];
107
- for (const k of Object.keys(obj)) {
108
- if (k.startsWith(name)) {
109
- arr.push(k);
110
- }
111
- }
112
- const reg = new RegExp("^" + name);
113
- for (const v of arr) {
114
- let s = v.replace(reg, "");
115
- if (s && $event) {
116
- let ns = splitUpper(s);
117
- if (ns.includes("passive")) {
118
- ns = ns.filter((k) => {
119
- return k != "prevent";
120
- });
121
- }
122
- const fn = () => {
123
- if (ns.includes("once")) {
124
- let isc = eventAliasObj.once($event);
125
- if (isc) {
126
- callback(obj[v]);
127
- }
128
- } else {
129
- callback(obj[v]);
130
- }
131
- };
132
- withModifiers(fn, ns)();
133
- } else {
134
- callback(obj[v]);
135
- }
136
- is = true;
137
- }
138
- return is;
139
- }
140
- function eventAliass(callback, arr, obj, $event) {
141
- if (!callback || !obj || !arr || arr.length === 0) {
142
- return false;
143
- }
144
- let is = false;
145
- const items = Array.isArray(arr) ? arr : [arr];
146
- for (const key of items) {
147
- if (eventAlias(key, callback, obj, $event)) {
148
- is = true;
149
- }
150
- }
151
- return is;
152
- }
153
66
  function setEmptyDisplay(value, emptyDisplay, isStr) {
154
67
  if (isStr) {
155
68
  if (value === "" || value === void 0 || value === null) {
@@ -160,7 +73,6 @@ function setEmptyDisplay(value, emptyDisplay, isStr) {
160
73
  }
161
74
  }
162
75
  export {
163
- eventAliass,
164
76
  setEmptyDisplay,
165
77
  setMinWidth
166
78
  };
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const firstUpper = require("@fangzhongya/utils/basic/string/firstUpper");
5
+ const splitUpper = require("@fangzhongya/utils/basic/string/splitUpper");
6
+ const firstLower = require("@fangzhongya/utils/basic/string/firstLower");
7
+ const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
8
+ const eventAliasObj = {
9
+ //.stop - 调用 event.stopPropagation()。
10
+ stop(event) {
11
+ event.stopPropagation();
12
+ return true;
13
+ },
14
+ // .prevent - 调用 event.preventDefault()。
15
+ prevent(event) {
16
+ event.preventDefault();
17
+ return true;
18
+ },
19
+ // .self - 只有事件从元素本身发出才触发处理函数。
20
+ self(event) {
21
+ return event.target === event.currentTarget;
22
+ },
23
+ // .once - 最多触发一次处理函数。
24
+ once(event) {
25
+ var _a;
26
+ if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
27
+ return false;
28
+ } else {
29
+ if (event.currentTarget) {
30
+ event.currentTarget.__once__ = true;
31
+ }
32
+ return true;
33
+ }
34
+ }
35
+ // .capture - 在捕获模式添加事件监听器。
36
+ // 处理事件是异步的,只有在触发了事件后才执行方法,
37
+ // 目前无法支持 capture
38
+ // capture(event) {
39
+ // console.log('event', event);
40
+ // return true;
41
+ // },
42
+ };
43
+ function eventAlias(key, callback, obj, $event) {
44
+ let is = false;
45
+ const name = "on" + firstUpper.firstUpper(key);
46
+ const arr = [];
47
+ for (const k of Object.keys(obj)) {
48
+ if (k.startsWith(name) || k.startsWith(key)) {
49
+ arr.push(k);
50
+ }
51
+ }
52
+ const reg = new RegExp("^" + name + "|" + key);
53
+ for (const v of arr) {
54
+ let s = v.replace(reg, "");
55
+ if (s && $event) {
56
+ let ns = splitUpper.splitUpper(s);
57
+ if (s.includes(".")) {
58
+ ns = s.split(".").filter((o) => Boolean(o));
59
+ }
60
+ if (ns.includes("passive")) {
61
+ ns = ns.filter((k) => {
62
+ return k != "prevent";
63
+ });
64
+ }
65
+ const fn = () => {
66
+ if (ns.includes("once")) {
67
+ let isc = eventAliasObj.once($event);
68
+ if (isc) {
69
+ callback(obj[v]);
70
+ }
71
+ } else {
72
+ callback(obj[v]);
73
+ }
74
+ };
75
+ const wc = vue.withModifiers(fn, ns);
76
+ wc($event);
77
+ } else {
78
+ callback(obj[v]);
79
+ }
80
+ is = true;
81
+ }
82
+ return is;
83
+ }
84
+ function eventAliass(callback, arr, obj, $event) {
85
+ if (!callback || !obj) {
86
+ return false;
87
+ }
88
+ if (!arr || arr.length === 0) {
89
+ return false;
90
+ }
91
+ let is = false;
92
+ if (Array.isArray(arr)) {
93
+ for (const key of arr) {
94
+ if (eventAlias(key, callback, obj, $event)) {
95
+ is = true;
96
+ }
97
+ }
98
+ } else {
99
+ is = eventAlias(arr, callback, obj, $event);
100
+ }
101
+ return is;
102
+ }
103
+ function getEventKey(key, aliass = []) {
104
+ let ml = key;
105
+ if (!/on[A-Z]/.test(key)) {
106
+ ml = "on" + lineToLargeHump.lineToLargeHump(key);
107
+ }
108
+ ml = firstLower.firstLower(lineToLargeHump.lineToLargeHump(ml));
109
+ if (ml.includes(".")) {
110
+ ml = ml.split(".")[0];
111
+ }
112
+ for (const v of aliass) {
113
+ const rs = "on" + lineToLargeHump.lineToLargeHump(v);
114
+ if (ml.startsWith(rs)) {
115
+ return rs;
116
+ }
117
+ }
118
+ return ml;
119
+ }
120
+ exports.eventAliass = eventAliass;
121
+ exports.getEventKey = getEventKey;
@@ -6,3 +6,4 @@
6
6
  * @param {*} $event
7
7
  */
8
8
  export declare function eventAliass(callback: Function, arr: string | string[], obj: any, $event: Event): boolean;
9
+ export declare function getEventKey(key: string, aliass?: string[]): string;
@@ -0,0 +1,121 @@
1
+ import { withModifiers } from "vue";
2
+ import { firstUpper } from "@fangzhongya/utils/basic/string/firstUpper";
3
+ import { splitUpper } from "@fangzhongya/utils/basic/string/splitUpper";
4
+ import { firstLower } from "@fangzhongya/utils/basic/string/firstLower";
5
+ import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
6
+ const eventAliasObj = {
7
+ //.stop - 调用 event.stopPropagation()。
8
+ stop(event) {
9
+ event.stopPropagation();
10
+ return true;
11
+ },
12
+ // .prevent - 调用 event.preventDefault()。
13
+ prevent(event) {
14
+ event.preventDefault();
15
+ return true;
16
+ },
17
+ // .self - 只有事件从元素本身发出才触发处理函数。
18
+ self(event) {
19
+ return event.target === event.currentTarget;
20
+ },
21
+ // .once - 最多触发一次处理函数。
22
+ once(event) {
23
+ var _a;
24
+ if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
25
+ return false;
26
+ } else {
27
+ if (event.currentTarget) {
28
+ event.currentTarget.__once__ = true;
29
+ }
30
+ return true;
31
+ }
32
+ }
33
+ // .capture - 在捕获模式添加事件监听器。
34
+ // 处理事件是异步的,只有在触发了事件后才执行方法,
35
+ // 目前无法支持 capture
36
+ // capture(event) {
37
+ // console.log('event', event);
38
+ // return true;
39
+ // },
40
+ };
41
+ function eventAlias(key, callback, obj, $event) {
42
+ let is = false;
43
+ const name = "on" + firstUpper(key);
44
+ const arr = [];
45
+ for (const k of Object.keys(obj)) {
46
+ if (k.startsWith(name) || k.startsWith(key)) {
47
+ arr.push(k);
48
+ }
49
+ }
50
+ const reg = new RegExp("^" + name + "|" + key);
51
+ for (const v of arr) {
52
+ let s = v.replace(reg, "");
53
+ if (s && $event) {
54
+ let ns = splitUpper(s);
55
+ if (s.includes(".")) {
56
+ ns = s.split(".").filter((o) => Boolean(o));
57
+ }
58
+ if (ns.includes("passive")) {
59
+ ns = ns.filter((k) => {
60
+ return k != "prevent";
61
+ });
62
+ }
63
+ const fn = () => {
64
+ if (ns.includes("once")) {
65
+ let isc = eventAliasObj.once($event);
66
+ if (isc) {
67
+ callback(obj[v]);
68
+ }
69
+ } else {
70
+ callback(obj[v]);
71
+ }
72
+ };
73
+ const wc = withModifiers(fn, ns);
74
+ wc($event);
75
+ } else {
76
+ callback(obj[v]);
77
+ }
78
+ is = true;
79
+ }
80
+ return is;
81
+ }
82
+ function eventAliass(callback, arr, obj, $event) {
83
+ if (!callback || !obj) {
84
+ return false;
85
+ }
86
+ if (!arr || arr.length === 0) {
87
+ return false;
88
+ }
89
+ let is = false;
90
+ if (Array.isArray(arr)) {
91
+ for (const key of arr) {
92
+ if (eventAlias(key, callback, obj, $event)) {
93
+ is = true;
94
+ }
95
+ }
96
+ } else {
97
+ is = eventAlias(arr, callback, obj, $event);
98
+ }
99
+ return is;
100
+ }
101
+ function getEventKey(key, aliass = []) {
102
+ let ml = key;
103
+ if (!/on[A-Z]/.test(key)) {
104
+ ml = "on" + lineToLargeHump(key);
105
+ }
106
+ ml = firstLower(lineToLargeHump(ml));
107
+ if (ml.includes(".")) {
108
+ ml = ml.split(".")[0];
109
+ }
110
+ for (const v of aliass) {
111
+ const rs = "on" + lineToLargeHump(v);
112
+ if (ml.startsWith(rs)) {
113
+ return rs;
114
+ }
115
+ }
116
+ return ml;
117
+ }
118
+ export {
119
+ eventAliass,
120
+ getEventKey
121
+ };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1764416820549,
4
+ "lastModified": 1764582045174,
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> "
@@ -7,12 +7,4 @@ export declare function setHide(item: any, v?: any): boolean;
7
7
  type SetClass = string | string[] | ObjStr;
8
8
  export declare function setClass(...arr: Array<SetClass>): string;
9
9
  export declare function setMinWidth(obj: ObjAny): any;
10
- /**
11
- * 支持事件别名处理
12
- * @param {*} callback
13
- * @param {*} arr
14
- * @param {*} obj
15
- * @param {*} $event
16
- */
17
- export declare function eventAliass(callback: Function, arr: string | string[], obj: any, $event: Event): boolean;
18
10
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.43",
4
+ "version": "0.1.45",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  "fangui": "bin/fang-ui.js"
25
25
  },
26
26
  "dependencies": {
27
- "@fangzhongya/utils": "0.0.49"
27
+ "@fangzhongya/utils": "0.0.50"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@fangzhongya/create": "0.2.43",
@@ -34,27 +34,27 @@
34
34
  "@vue/shared": "3.5.25",
35
35
  "axios": "^1.13.2",
36
36
  "d3-timer": "3.0.1",
37
- "element-plus": "^2.11.8",
37
+ "element-plus": "^2.11.9",
38
38
  "fast-glob": "^3.3.3",
39
39
  "sass": "^1.94.2",
40
40
  "sortablejs": "1.15.6",
41
41
  "ts-node": "^10.9.2",
42
42
  "tsup": "^8.5.1",
43
43
  "typescript": "^5.9.3",
44
- "unplugin-auto-import": "20.2.0",
44
+ "unplugin-auto-import": "20.3.0",
45
45
  "unplugin-dts": "1.0.0-beta.6",
46
46
  "unplugin-vue-components": "30.0.0",
47
47
  "vite": "^6.3.5",
48
48
  "vitepress": "1.6.4",
49
- "vitest": "^4.0.13",
49
+ "vitest": "^4.0.14",
50
50
  "vue": "^3.5.25",
51
51
  "vue-tsc": "^3.1.5",
52
52
  "vxe-table": "4.6.20",
53
- "@fang-ui/directives": "0.0.1-0",
54
53
  "@fang-ui/components": "0.0.1-0",
54
+ "@fang-ui/directives": "0.0.1-0",
55
55
  "@fang-ui/hooks": "0.0.1-0",
56
- "@fang-ui/locale": "0.0.1-0",
57
56
  "@fang-ui/icons": "0.0.1-0",
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",
60
60
  "@fang-ui/utils": "0.0.1-0"
File without changes