@fangzhongya/fang-ui 0.1.38 → 0.1.40

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 (154) hide show
  1. package/dist/components/common/css.d.ts +7 -0
  2. package/dist/components/common/list.d.ts +7 -0
  3. package/dist/components/common/urls.d.ts +6 -0
  4. package/dist/components/common/use.cjs +153 -125
  5. package/dist/components/common/use.d.ts +114 -8
  6. package/dist/components/common/use.js +154 -126
  7. package/dist/components/company-select/src/index2.cjs +1 -2
  8. package/dist/components/company-select/src/index2.js +1 -2
  9. package/dist/components/double/src/index2.cjs +2 -2
  10. package/dist/components/double/src/index2.js +2 -2
  11. package/dist/components/forms/index.css +18 -0
  12. package/dist/components/forms/src/index2.cjs +9 -6
  13. package/dist/components/forms/src/index2.js +9 -6
  14. package/dist/components/forms/src/setup.cjs +9 -12
  15. package/dist/components/forms/src/setup.d.ts +10 -0
  16. package/dist/components/forms/src/setup.js +9 -12
  17. package/dist/components/forms/src/util.cjs +8 -10
  18. package/dist/components/forms/src/util.d.ts +11 -6
  19. package/dist/components/forms/src/util.js +8 -10
  20. package/dist/components/forms-div/src/data.cjs +8 -5
  21. package/dist/components/forms-div/src/data.d.ts +21 -3
  22. package/dist/components/forms-div/src/data.js +8 -5
  23. package/dist/components/forms-div/src/index2.cjs +41 -70
  24. package/dist/components/forms-div/src/index2.js +43 -72
  25. package/dist/components/forms-item/src/data.cjs +6 -0
  26. package/dist/components/forms-item/src/data.d.ts +19 -0
  27. package/dist/components/forms-item/src/data.js +6 -0
  28. package/dist/components/forms-item/src/index2.cjs +11 -7
  29. package/dist/components/forms-item/src/index2.js +11 -7
  30. package/dist/components/forms-item/src/indexts.d.ts +40 -1
  31. package/dist/components/forms-item/src/label.cjs +7 -2
  32. package/dist/components/forms-item/src/label.d.ts +40 -1
  33. package/dist/components/forms-item/src/label.js +7 -2
  34. package/dist/components/forms-items/index.css +67 -0
  35. package/dist/components/forms-items/index.scss +21 -0
  36. package/dist/components/forms-items/src/data.cjs +9 -0
  37. package/dist/components/forms-items/src/data.d.ts +22 -0
  38. package/dist/components/forms-items/src/data.js +9 -0
  39. package/dist/components/forms-items/src/index2.cjs +22 -10
  40. package/dist/components/forms-items/src/index2.js +22 -10
  41. package/dist/components/forms-items/style/index2.scss +1 -0
  42. package/dist/components/icon/src/index2.cjs +1 -2
  43. package/dist/components/icon/src/index2.js +1 -2
  44. package/dist/components/input-history/src/index2.cjs +1 -1
  45. package/dist/components/input-history/src/index2.js +1 -1
  46. package/dist/components/input-select/src/index2.cjs +0 -2
  47. package/dist/components/input-select/src/index2.js +0 -2
  48. package/dist/components/inputs/src/index2.cjs +1 -1
  49. package/dist/components/inputs/src/index2.js +1 -1
  50. package/dist/components/list/src/index2.cjs +5 -19
  51. package/dist/components/list/src/index2.js +5 -19
  52. package/dist/components/list/src/util.cjs +9 -9
  53. package/dist/components/list/src/util.d.ts +30 -2
  54. package/dist/components/list/src/util.js +9 -9
  55. package/dist/components/lists/src/index2.cjs +1 -2
  56. package/dist/components/lists/src/index2.js +1 -2
  57. package/dist/components/menus/src/util.cjs +8 -24
  58. package/dist/components/menus/src/util.js +9 -25
  59. package/dist/components/page/index.css +18 -0
  60. package/dist/components/right-key/src/index2.cjs +3 -3
  61. package/dist/components/right-key/src/index2.js +3 -3
  62. package/dist/components/seamless-scroll/src/index2.cjs +1 -1
  63. package/dist/components/seamless-scroll/src/index2.js +1 -1
  64. package/dist/components/selects/src/index2.cjs +2 -2
  65. package/dist/components/selects/src/index2.js +2 -2
  66. package/dist/components/stick-edge/src/index2.cjs +2 -2
  67. package/dist/components/stick-edge/src/index2.js +2 -2
  68. package/dist/components/switchs/src/index2.cjs +1 -1
  69. package/dist/components/switchs/src/index2.js +1 -1
  70. package/dist/components/tables/common/com-color2.cjs +0 -3
  71. package/dist/components/tables/common/com-color2.js +0 -3
  72. package/dist/components/tables/common/com-lis2.cjs +0 -1
  73. package/dist/components/tables/common/com-lis2.js +0 -1
  74. package/dist/components/tables/common/pagin.d.ts +16 -0
  75. package/dist/components/tables/common/tooltip.cjs +1 -1
  76. package/dist/components/tables/common/tooltip.js +1 -1
  77. package/dist/components/tables/common/util.cjs +46 -8
  78. package/dist/components/tables/common/util.d.ts +13 -0
  79. package/dist/components/tables/common/util.js +47 -9
  80. package/dist/components/tables/src/column.cjs +11 -4
  81. package/dist/components/tables/src/column.d.ts +29 -0
  82. package/dist/components/tables/src/column.js +11 -4
  83. package/dist/components/tables/src/columns.d.ts +7 -0
  84. package/dist/components/tables/src/columns3.cjs +1 -7
  85. package/dist/components/tables/src/columns3.js +1 -7
  86. package/dist/components/tables/src/index2.cjs +3 -3
  87. package/dist/components/tables/src/index2.js +3 -3
  88. package/dist/components/tablesv/src/column.cjs +11 -4
  89. package/dist/components/tablesv/src/column.d.ts +25 -0
  90. package/dist/components/tablesv/src/column.js +11 -4
  91. package/dist/components/tablesv/src/columns.d.ts +7 -0
  92. package/dist/components/tablesv/src/columns3.cjs +1 -7
  93. package/dist/components/tablesv/src/columns3.js +1 -7
  94. package/dist/components/tablesv/src/index2.cjs +3 -3
  95. package/dist/components/tablesv/src/index2.js +3 -3
  96. package/dist/components/uploads/src/util.cjs +2 -3
  97. package/dist/components/uploads/src/util.d.ts +7 -0
  98. package/dist/components/uploads/src/util.js +2 -3
  99. package/dist/css/forms-items.css +67 -0
  100. package/dist/css/forms.css +18 -0
  101. package/dist/css/index.css +18 -0
  102. package/dist/css/page.css +18 -0
  103. package/dist/directives/adjust/index.cjs +4 -8
  104. package/dist/directives/adjust/index.js +4 -8
  105. package/dist/directives/drag/index.cjs +6 -1
  106. package/dist/directives/drag/index.js +6 -1
  107. package/dist/directives/expose/index.cjs +6 -0
  108. package/dist/directives/expose/index.js +6 -0
  109. package/dist/directives/inserted/index.cjs +5 -0
  110. package/dist/directives/inserted/index.js +5 -0
  111. package/dist/directives/locus/index.cjs +5 -0
  112. package/dist/directives/locus/index.js +5 -0
  113. package/dist/directives/scroll/index.cjs +10 -0
  114. package/dist/directives/scroll/index.d.ts +0 -5
  115. package/dist/directives/scroll/index.js +10 -0
  116. package/dist/directives/sortable/index.cjs +5 -0
  117. package/dist/directives/sortable/index.js +5 -0
  118. package/dist/directives/stick/index.cjs +13 -8
  119. package/dist/directives/stick/index.js +13 -8
  120. package/dist/hooks/attrs-default/index.d.ts +5 -3
  121. package/dist/hooks/compons/index.d.ts +13 -0
  122. package/dist/hooks/cssname/index.cjs +1 -1
  123. package/dist/hooks/cssname/index.d.ts +22 -1
  124. package/dist/hooks/cssname/index.js +1 -1
  125. package/dist/hooks/default-config/index.d.ts +10 -0
  126. package/dist/hooks/expose/index.cjs +2 -0
  127. package/dist/hooks/expose/index.d.ts +6 -0
  128. package/dist/hooks/expose/index.js +2 -0
  129. package/dist/hooks/full-screen/index.d.ts +6 -0
  130. package/dist/hooks/global-config/index.d.ts +16 -0
  131. package/dist/hooks/inherit/index.cjs +2 -0
  132. package/dist/hooks/inherit/index.d.ts +8 -0
  133. package/dist/hooks/inherit/index.js +2 -0
  134. package/dist/hooks/locale/index.d.ts +24 -0
  135. package/dist/hooks/props-default/index.d.ts +14 -5
  136. package/dist/icons/iconify.d.ts +7 -0
  137. package/dist/icons/iconifyCss.d.ts +6 -0
  138. package/dist/icons/index.json +1 -1
  139. package/dist/index.css +18 -0
  140. package/dist/locale/en.cjs +2 -1
  141. package/dist/locale/en.d.ts +1 -0
  142. package/dist/locale/en.js +2 -1
  143. package/dist/locale/zh-cn.cjs +2 -1
  144. package/dist/locale/zh-cn.d.ts +1 -0
  145. package/dist/locale/zh-cn.js +2 -1
  146. package/dist/type.d.ts +8 -0
  147. package/dist/utils/css.cjs +4 -0
  148. package/dist/utils/css.d.ts +1 -0
  149. package/dist/utils/css.js +4 -0
  150. package/dist/utils/local.cjs +12 -6
  151. package/dist/utils/local.js +12 -6
  152. package/dist/utils/util.cjs +7 -5
  153. package/dist/utils/util.js +7 -5
  154. package/package.json +1 -1
@@ -69,14 +69,22 @@ function handleSelectableConfig(obj, vxeconfig, table) {
69
69
  };
70
70
  }
71
71
  function setSslot(obj, scope, emit, slots, props, index) {
72
- const slot = useSetSlot(obj, scope.row, slots, index, scope);
72
+ const optionss = props.options || {};
73
+ const slot = useSetSlot(
74
+ obj,
75
+ scope.row,
76
+ slots,
77
+ optionss,
78
+ emit,
79
+ index,
80
+ scope
81
+ );
73
82
  if (slot) {
74
83
  return slot;
75
84
  }
76
85
  if (obj.compon) {
77
86
  const isComponSelected = props.isComponSelected;
78
87
  if (isComponSelected(obj, scope)) {
79
- const optionss = props.options || {};
80
88
  const column = useSetCompon(
81
89
  obj,
82
90
  scope.row,
@@ -84,7 +92,7 @@ function setSslot(obj, scope, emit, slots, props, index) {
84
92
  useComponsGet(provides.compons),
85
93
  emit,
86
94
  index,
87
- { ...scope, options: props.options, config: props.table }
95
+ { ...scope, options: optionss, config: props.table }
88
96
  );
89
97
  if (column) {
90
98
  return column;
@@ -129,7 +137,6 @@ function setDomValue(domValue, table) {
129
137
  function setHeader(obj, scope, slots, emit, props, index) {
130
138
  const optionss = props.options || {};
131
139
  return useGetDomLabel(
132
- obj.label,
133
140
  obj,
134
141
  scope.row,
135
142
  slots,
@@ -1 +1,8 @@
1
+ /**
2
+ * 渲染函数,用于处理列表渲染逻辑
3
+ * @param porps 包含组件属性的对象,必须包含list属性用于渲染列表数据
4
+ * @param emit 事件发射函数,用于触发自定义事件
5
+ * @param slots 插槽对象,包含组件的插槽配置
6
+ * @returns 返回处理后的列表渲染结果
7
+ */
1
8
  export declare function render(porps: ObjAny, emit: Function, slots: ObjAny): ObjAny[];
@@ -18,13 +18,7 @@ function getLists(arrs, emit, props, slots, listobj) {
18
18
  if (obj.children && obj.children.length > 0) {
19
19
  const slotObj = {
20
20
  default: (scope) => {
21
- return getLists(
22
- obj.children,
23
- emit,
24
- props,
25
- slots,
26
- obj
27
- );
21
+ return getLists(obj.children, emit, props, slots, obj);
28
22
  }
29
23
  };
30
24
  if (obj.type != "selection") {
@@ -16,13 +16,7 @@ function getLists(arrs, emit, props, slots, listobj) {
16
16
  if (obj.children && obj.children.length > 0) {
17
17
  const slotObj = {
18
18
  default: (scope) => {
19
- return getLists(
20
- obj.children,
21
- emit,
22
- props,
23
- slots,
24
- obj
25
- );
19
+ return getLists(obj.children, emit, props, slots, obj);
26
20
  }
27
21
  };
28
22
  if (obj.type != "selection") {
@@ -206,8 +206,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
206
206
  return tableRef.value;
207
207
  };
208
208
  vue.onMounted(() => {
209
- if (window) {
210
- window.addEventListener("click", () => {
209
+ if (globalThis) {
210
+ globalThis.addEventListener("click", () => {
211
211
  isfocus.value = false;
212
212
  });
213
213
  }
@@ -256,7 +256,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
256
256
  ]),
257
257
  default: vue.withCtx(() => [
258
258
  vue.createVNode(columns_vue_vue_type_script_lang.default, {
259
- table: vue.unref(attrs).assem,
259
+ table: { ...vue.unref(props), ...vue.unref(attrs).assem },
260
260
  vxeconfig: config$1.value,
261
261
  value: vue.unref(props).value,
262
262
  list: vue.unref(props).list,
@@ -204,8 +204,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
204
204
  return tableRef.value;
205
205
  };
206
206
  onMounted(() => {
207
- if (window) {
208
- window.addEventListener("click", () => {
207
+ if (globalThis) {
208
+ globalThis.addEventListener("click", () => {
209
209
  isfocus.value = false;
210
210
  });
211
211
  }
@@ -254,7 +254,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
254
254
  ]),
255
255
  default: withCtx(() => [
256
256
  createVNode(_sfc_main$1, {
257
- table: unref(attrs).assem,
257
+ table: { ...unref(props), ...unref(attrs).assem },
258
258
  vxeconfig: config.value,
259
259
  value: unref(props).value,
260
260
  list: unref(props).list,
@@ -7,8 +7,7 @@ const getExtension = (fileName) => {
7
7
  const extension = fileName.toLowerCase();
8
8
  if (extension) {
9
9
  const ks = Object.keys(data.types);
10
- for (let index = 0; index < ks.length; index++) {
11
- const key = ks[index];
10
+ for (const key of ks) {
12
11
  if (data.types[key].includes(extension)) {
13
12
  return key;
14
13
  }
@@ -65,7 +64,7 @@ function smartFileHandler(url) {
65
64
  iframe.style.display = "none";
66
65
  iframe.src = url;
67
66
  iframe.onload = function() {
68
- window.open(url, "_blank");
67
+ globalThis.open(url, "_blank");
69
68
  iframe.remove();
70
69
  };
71
70
  iframe.onerror = function() {
@@ -1,5 +1,12 @@
1
1
  import { ListValue } from '../../players/common/util';
2
2
  export declare const getType: (accept?: string) => string;
3
+ /**
4
+ * 获取列表项的类型
5
+ * @param obj - 列表值对象,可选参数
6
+ * @param type - 指定的类型,可选参数
7
+ * @param accept - 接受的类型,可选参数
8
+ * @returns 返回确定的类型字符串
9
+ */
3
10
  export declare const getListType: (obj?: ListValue, type?: string, accept?: string) => string;
4
11
  /**
5
12
  * 从 URL 下载文件
@@ -5,8 +5,7 @@ const getExtension = (fileName) => {
5
5
  const extension = fileName.toLowerCase();
6
6
  if (extension) {
7
7
  const ks = Object.keys(types);
8
- for (let index = 0; index < ks.length; index++) {
9
- const key = ks[index];
8
+ for (const key of ks) {
10
9
  if (types[key].includes(extension)) {
11
10
  return key;
12
11
  }
@@ -63,7 +62,7 @@ function smartFileHandler(url) {
63
62
  iframe.style.display = "none";
64
63
  iframe.src = url;
65
64
  iframe.onload = function() {
66
- window.open(url, "_blank");
65
+ globalThis.open(url, "_blank");
67
66
  iframe.remove();
68
67
  };
69
68
  iframe.onerror = function() {
@@ -0,0 +1,67 @@
1
+ :root {
2
+ --on: rgb(91, 189, 246);
3
+ --color-primary: #409eff;
4
+ --bag-primary: #409eff;
5
+ --bag-primary-text: #ffffff;
6
+ --border: #eee;
7
+ --layout-panel-gap: 10px;
8
+ --layout-panel-padding: 20px;
9
+ --layout-form-item-padding-right: var(
10
+ --layout-panel-gap
11
+ );
12
+ --g-main-bg: var(--bg-color-page);
13
+ --lable-array-height: 20px;
14
+ }
15
+
16
+ .com-footer {
17
+ border-top: 1px solid var(--border);
18
+ padding: 20px 20px;
19
+ }
20
+
21
+ .com-lable-array {
22
+ line-height: var(--lable-array-height);
23
+ }
24
+
25
+ .forms-div {
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+ .forms-div-com {
30
+ height: 100%;
31
+ }
32
+
33
+ .forms-item {
34
+ width: 100%;
35
+ }
36
+ .forms-item-el-item.is-height {
37
+ min-height: var(--forms-item-row-height);
38
+ }
39
+ .forms-item-el-item.is-height .el-form-item__label {
40
+ height: var(--forms-item-row-height);
41
+ line-height: var(--forms-item-row-height);
42
+ }
43
+ .forms-item-el-item .el-form-item__label {
44
+ white-space: pre-wrap;
45
+ }
46
+ .forms-item-el-item.is-top .el-form-item__content {
47
+ min-height: var(--forms-item-row-height);
48
+ display: grid;
49
+ }
50
+
51
+ .forms-items {
52
+ width: 100%;
53
+ }
54
+ .forms-items.row {
55
+ display: flex;
56
+ flex-direction: row;
57
+ }
58
+ .forms-items.column {
59
+ display: flex;
60
+ flex-direction: column;
61
+ }
62
+ .forms-items-li.no-error {
63
+ --el-color-danger: var(--el-border-color);
64
+ }
65
+ .forms-items-li.no-error .el-input__wrapper.is-focus {
66
+ --el-color-danger: var(--el-input-focus-border);
67
+ }
@@ -49,6 +49,24 @@
49
49
  display: grid;
50
50
  }
51
51
 
52
+ .forms-items {
53
+ width: 100%;
54
+ }
55
+ .forms-items.row {
56
+ display: flex;
57
+ flex-direction: row;
58
+ }
59
+ .forms-items.column {
60
+ display: flex;
61
+ flex-direction: column;
62
+ }
63
+ .forms-items-li.no-error {
64
+ --el-color-danger: var(--el-border-color);
65
+ }
66
+ .forms-items-li.no-error .el-input__wrapper.is-focus {
67
+ --el-color-danger: var(--el-input-focus-border);
68
+ }
69
+
52
70
  .double {
53
71
  width: 100%;
54
72
  display: inline-flex;
@@ -49,6 +49,24 @@
49
49
  display: grid;
50
50
  }
51
51
 
52
+ .forms-items {
53
+ width: 100%;
54
+ }
55
+ .forms-items.row {
56
+ display: flex;
57
+ flex-direction: row;
58
+ }
59
+ .forms-items.column {
60
+ display: flex;
61
+ flex-direction: column;
62
+ }
63
+ .forms-items-li.no-error {
64
+ --el-color-danger: var(--el-border-color);
65
+ }
66
+ .forms-items-li.no-error .el-input__wrapper.is-focus {
67
+ --el-color-danger: var(--el-input-focus-border);
68
+ }
69
+
52
70
  .double {
53
71
  width: 100%;
54
72
  display: inline-flex;
package/dist/css/page.css CHANGED
@@ -49,6 +49,24 @@
49
49
  display: grid;
50
50
  }
51
51
 
52
+ .forms-items {
53
+ width: 100%;
54
+ }
55
+ .forms-items.row {
56
+ display: flex;
57
+ flex-direction: row;
58
+ }
59
+ .forms-items.column {
60
+ display: flex;
61
+ flex-direction: column;
62
+ }
63
+ .forms-items-li.no-error {
64
+ --el-color-danger: var(--el-border-color);
65
+ }
66
+ .forms-items-li.no-error .el-input__wrapper.is-focus {
67
+ --el-color-danger: var(--el-input-focus-border);
68
+ }
69
+
52
70
  .double {
53
71
  width: 100%;
54
72
  display: inline-flex;
@@ -22,9 +22,7 @@ function getPosition(el) {
22
22
  return obj;
23
23
  }
24
24
  function getNext(el, paren) {
25
- if (!paren) {
26
- paren = el.parentElement || el;
27
- }
25
+ paren ?? (paren = el.parentElement ?? el);
28
26
  const cs = paren.childNodes;
29
27
  let index = 0;
30
28
  let k = cs.length;
@@ -40,9 +38,7 @@ function getNext(el, paren) {
40
38
  return cs[index];
41
39
  }
42
40
  function getFront(el, paren) {
43
- if (!paren) {
44
- paren = el.parentElement || el;
45
- }
41
+ paren ?? (paren = el.parentElement ?? el);
46
42
  const cs = paren.childNodes;
47
43
  let index = cs.length - 1;
48
44
  let k = -1;
@@ -500,8 +496,8 @@ const vAdjust = {
500
496
  if (value && Object.keys(value).length > 0) {
501
497
  let getVobj = function(e) {
502
498
  let is = true;
503
- for (let index = 0; index < arr.length; index++) {
504
- const v = arr[index](e, eps);
499
+ for (const fun of arr) {
500
+ const v = fun(e, eps);
505
501
  if (v) {
506
502
  vobj = v;
507
503
  isCur = true;
@@ -20,9 +20,7 @@ function getPosition(el) {
20
20
  return obj;
21
21
  }
22
22
  function getNext(el, paren) {
23
- if (!paren) {
24
- paren = el.parentElement || el;
25
- }
23
+ paren ?? (paren = el.parentElement ?? el);
26
24
  const cs = paren.childNodes;
27
25
  let index = 0;
28
26
  let k = cs.length;
@@ -38,9 +36,7 @@ function getNext(el, paren) {
38
36
  return cs[index];
39
37
  }
40
38
  function getFront(el, paren) {
41
- if (!paren) {
42
- paren = el.parentElement || el;
43
- }
39
+ paren ?? (paren = el.parentElement ?? el);
44
40
  const cs = paren.childNodes;
45
41
  let index = cs.length - 1;
46
42
  let k = -1;
@@ -498,8 +494,8 @@ const vAdjust = {
498
494
  if (value && Object.keys(value).length > 0) {
499
495
  let getVobj = function(e) {
500
496
  let is = true;
501
- for (let index = 0; index < arr.length; index++) {
502
- const v = arr[index](e, eps);
497
+ for (const fun of arr) {
498
+ const v = fun(e, eps);
503
499
  if (v) {
504
500
  vobj = v;
505
501
  isCur = true;
@@ -28,7 +28,7 @@ function setDom(dom, el, value) {
28
28
  });
29
29
  };
30
30
  const handleMouseMove = (event) => {
31
- if (typeof value.often == "undefined" || value.often) {
31
+ if (value.often === void 0 || value.often) {
32
32
  setValue(event);
33
33
  }
34
34
  if (value.onMouseMove) {
@@ -77,6 +77,11 @@ function setDom(dom, el, value) {
77
77
  }
78
78
  const vDrag = {
79
79
  name: "Drag",
80
+ /**
81
+ * Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
82
+ * @param el - 指令绑定的DOM元素
83
+ * @param binding - 指令绑定的相关信息对象
84
+ */
80
85
  mounted(el, binding) {
81
86
  const value = binding.value;
82
87
  let dom;
@@ -26,7 +26,7 @@ function setDom(dom, el, value) {
26
26
  });
27
27
  };
28
28
  const handleMouseMove = (event) => {
29
- if (typeof value.often == "undefined" || value.often) {
29
+ if (value.often === void 0 || value.often) {
30
30
  setValue(event);
31
31
  }
32
32
  if (value.onMouseMove) {
@@ -75,6 +75,11 @@ function setDom(dom, el, value) {
75
75
  }
76
76
  const vDrag = {
77
77
  name: "Drag",
78
+ /**
79
+ * Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
80
+ * @param el - 指令绑定的DOM元素
81
+ * @param binding - 指令绑定的相关信息对象
82
+ */
78
83
  mounted(el, binding) {
79
84
  const value = binding.value;
80
85
  let dom;
@@ -3,6 +3,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const hasOwn = require("@fangzhongya/utils/basic/object/hasOwn");
4
4
  const index = {
5
5
  name: "expose",
6
+ /**
7
+ * Vue指令的created钩子函数,在指令绑定元素被创建时执行
8
+ * @param el 指令绑定的DOM元素
9
+ * @param binding 包含指令信息的绑定对象
10
+ * @param vnode 虚拟节点对象
11
+ */
6
12
  created(el, binding, vnode) {
7
13
  var _a, _b, _c, _d;
8
14
  if (!(binding == null ? void 0 : binding.instance)) return;
@@ -1,6 +1,12 @@
1
1
  import { hasOwn } from "@fangzhongya/utils/basic/object/hasOwn";
2
2
  const index = {
3
3
  name: "expose",
4
+ /**
5
+ * Vue指令的created钩子函数,在指令绑定元素被创建时执行
6
+ * @param el 指令绑定的DOM元素
7
+ * @param binding 包含指令信息的绑定对象
8
+ * @param vnode 虚拟节点对象
9
+ */
4
10
  created(el, binding, vnode) {
5
11
  var _a, _b, _c, _d;
6
12
  if (!(binding == null ? void 0 : binding.instance)) return;
@@ -2,6 +2,11 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vInserted = {
4
4
  name: "inserted",
5
+ /**
6
+ * Vue指令的created钩子函数,在绑定元素被创建时执行
7
+ * @param el 指令绑定的DOM元素
8
+ * @param binding 包含指令相关信息的绑定对象
9
+ */
5
10
  created(el, binding) {
6
11
  const value = binding.value;
7
12
  let dom = el;
@@ -1,5 +1,10 @@
1
1
  const vInserted = {
2
2
  name: "inserted",
3
+ /**
4
+ * Vue指令的created钩子函数,在绑定元素被创建时执行
5
+ * @param el 指令绑定的DOM元素
6
+ * @param binding 包含指令相关信息的绑定对象
7
+ */
3
8
  created(el, binding) {
4
9
  const value = binding.value;
5
10
  let dom = el;
@@ -23,6 +23,11 @@ function setDom(el, value) {
23
23
  }
24
24
  const index = {
25
25
  name: "Locus",
26
+ /**
27
+ * Vue指令的mounted钩子函数,在元素挂载到DOM时执行
28
+ * @param el - 指令绑定的DOM元素
29
+ * @param binding - 指令绑定的相关信息对象
30
+ */
26
31
  mounted(el, binding) {
27
32
  const value = binding.value;
28
33
  if (value) {
@@ -21,6 +21,11 @@ function setDom(el, value) {
21
21
  }
22
22
  const index = {
23
23
  name: "Locus",
24
+ /**
25
+ * Vue指令的mounted钩子函数,在元素挂载到DOM时执行
26
+ * @param el - 指令绑定的DOM元素
27
+ * @param binding - 指令绑定的相关信息对象
28
+ */
24
29
  mounted(el, binding) {
25
30
  const value = binding.value;
26
31
  if (value) {
@@ -107,6 +107,11 @@ function createScrollHandler(scrollContainer, config, value) {
107
107
  }
108
108
  const vScroll = {
109
109
  name: "scroll",
110
+ /**
111
+ * Vue指令的mounted钩子函数,用于初始化滚动相关的功能
112
+ * @param el - 指令绑定的DOM元素
113
+ * @param binding - 指令绑定的对象,包含value属性
114
+ */
110
115
  mounted(el, binding) {
111
116
  const value = binding.value;
112
117
  const config = parseConfig(el, value);
@@ -132,6 +137,11 @@ const vScroll = {
132
137
  scrollContainer.removeEventListener("scroll", scrollHandler);
133
138
  };
134
139
  },
140
+ /**
141
+ * 组件卸载时的清理函数
142
+ *
143
+ * @param el - 需要清理的HTML元素
144
+ */
135
145
  unmounted(el) {
136
146
  if (el._scrollCleanup) {
137
147
  el._scrollCleanup();
@@ -4,8 +4,3 @@ import { Directive } from 'vue';
4
4
  */
5
5
  declare const _default: Directive;
6
6
  export default _default;
7
- declare global {
8
- interface HTMLElement {
9
- _scrollCleanup?: () => void;
10
- }
11
- }
@@ -105,6 +105,11 @@ function createScrollHandler(scrollContainer, config, value) {
105
105
  }
106
106
  const vScroll = {
107
107
  name: "scroll",
108
+ /**
109
+ * Vue指令的mounted钩子函数,用于初始化滚动相关的功能
110
+ * @param el - 指令绑定的DOM元素
111
+ * @param binding - 指令绑定的对象,包含value属性
112
+ */
108
113
  mounted(el, binding) {
109
114
  const value = binding.value;
110
115
  const config = parseConfig(el, value);
@@ -130,6 +135,11 @@ const vScroll = {
130
135
  scrollContainer.removeEventListener("scroll", scrollHandler);
131
136
  };
132
137
  },
138
+ /**
139
+ * 组件卸载时的清理函数
140
+ *
141
+ * @param el - 需要清理的HTML元素
142
+ */
133
143
  unmounted(el) {
134
144
  if (el._scrollCleanup) {
135
145
  el._scrollCleanup();
@@ -3,6 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const Sortable = require("sortablejs");
4
4
  const vSortable = {
5
5
  name: "Sortable",
6
+ /**
7
+ * Vue指令的mounted钩子函数,用于初始化sortable功能
8
+ * @param el 指令绑定的DOM元素
9
+ * @param binding Vue指令绑定对象,包含value等属性
10
+ */
6
11
  mounted(el, binding) {
7
12
  const value = binding.value;
8
13
  let selector = el.getAttribute(`sortable-selector`);
@@ -1,6 +1,11 @@
1
1
  import Sortable from "sortablejs";
2
2
  const vSortable = {
3
3
  name: "Sortable",
4
+ /**
5
+ * Vue指令的mounted钩子函数,用于初始化sortable功能
6
+ * @param el 指令绑定的DOM元素
7
+ * @param binding Vue指令绑定对象,包含value等属性
8
+ */
4
9
  mounted(el, binding) {
5
10
  const value = binding.value;
6
11
  let selector = el.getAttribute(`sortable-selector`);
@@ -5,12 +5,6 @@ const getShiftEvent = require("@fangzhongya/utils/dom/getShiftEvent");
5
5
  const attrValueSort = require("@fangzhongya/utils/basic/object/attrValueSort");
6
6
  function setDom(dom, el, value) {
7
7
  if (dom) {
8
- let getDirection = function(obj2) {
9
- return attrValueSort.attrValueSort(
10
- obj2,
11
- value.directions || ["left", "right", "top", "bottom"]
12
- )[0];
13
- };
14
8
  const obj = {
15
9
  position: "fixed",
16
10
  display: "flex",
@@ -23,6 +17,12 @@ function setDom(dom, el, value) {
23
17
  obj[key] = "0";
24
18
  obj["flex-direction"] = key == "left" || key == "right" ? "column" : "row";
25
19
  setCss.setCss(el, obj);
20
+ const getDirection = (obj2) => {
21
+ return attrValueSort.attrValueSort(
22
+ obj2,
23
+ value.directions || ["left", "right", "top", "bottom"]
24
+ )[0];
25
+ };
26
26
  const bodyStyle = document.body.style;
27
27
  const cursor = bodyStyle.cursor;
28
28
  const setValue = (event) => {
@@ -30,8 +30,8 @@ function setDom(dom, el, value) {
30
30
  key = getDirection({
31
31
  left: event.clientX,
32
32
  top: event.clientY,
33
- right: window.innerWidth - event.clientX,
34
- bottom: window.innerHeight - event.clientY
33
+ right: globalThis.innerWidth - event.clientX,
34
+ bottom: globalThis.innerHeight - event.clientY
35
35
  });
36
36
  setCss.setCss(el, {
37
37
  [key]: "0",
@@ -61,6 +61,11 @@ function setDom(dom, el, value) {
61
61
  }
62
62
  const vStick = {
63
63
  name: "Stick",
64
+ /**
65
+ * Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
66
+ * @param el - 指令绑定的DOM元素
67
+ * @param binding - 指令绑定的相关信息对象
68
+ */
64
69
  mounted(el, binding) {
65
70
  const value = binding.value;
66
71
  let dom;