@web-utils/form-ui 1.0.0-beta93 → 1.0.0-beta95

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 (139) hide show
  1. package/chunks/{6dpdFLpv2.mjs → B0i3ywbn2.mjs} +35 -44
  2. package/chunks/{Cv1iIzzy2.mjs → BanS-yUY2.mjs} +1 -1
  3. package/chunks/{BZw-uhPj.mjs → C23Qaggp.mjs} +27 -26
  4. package/chunks/{n1KViU9y2.mjs → CIVnqVAQ2.mjs} +12 -9
  5. package/chunks/{JUkvPXqc.mjs → CZxWWk4N.mjs} +8 -8
  6. package/chunks/{BKdkhZkk2.mjs → D7kTwnJK2.mjs} +1 -1
  7. package/chunks/{C6l7TFPU.mjs → D8C17D2k.mjs} +7 -7
  8. package/chunks/{DngNYJVa2.mjs → DzfHfYvS2.mjs} +1 -1
  9. package/chunks/{5BOS55Lv2.mjs → NYkLWtyw2.mjs} +1 -1
  10. package/chunks/{BpZ0yk642.mjs → bBwzYT0T2.mjs} +23 -18
  11. package/chunks/{-d4DuTH12.mjs → dgRz6V6p2.mjs} +1 -1
  12. package/chunks/qIca9lDu2.mjs +108 -0
  13. package/chunks/{DRkvaPr32.mjs → q_m3gw_j2.mjs} +11 -8
  14. package/chunks/{BTVXdtOG.mjs → sCsjgWvR.mjs} +104 -95
  15. package/chunks/{D6B1lNKn2.mjs → v2GLQDzI2.mjs} +18 -18
  16. package/data-table-picker/index.mjs +1 -1
  17. package/form-cascader/index.mjs +1 -1
  18. package/form-checkbox-group/index.mjs +1 -1
  19. package/form-input/index.d.ts +3 -3
  20. package/form-input/index.mjs +1 -1
  21. package/form-input-email/index.d.ts +3 -3
  22. package/form-input-email/index.mjs +1 -1
  23. package/form-input-id-card/index.d.ts +3 -3
  24. package/form-input-id-card/index.mjs +1 -1
  25. package/form-input-number/index.d.ts +2 -2
  26. package/form-input-number/index.mjs +1 -1
  27. package/form-input-phone-number/index.d.ts +3 -3
  28. package/form-input-phone-number/index.mjs +1 -1
  29. package/form-radio-group/index.mjs +1 -1
  30. package/form-select/index.mjs +1 -1
  31. package/form-table/index.d.ts +2 -0
  32. package/form-table/index.mjs +1 -1
  33. package/form-table-plus/index.d.ts +2 -2
  34. package/form-table-plus/index.mjs +1 -1
  35. package/form-textarea/index.d.ts +1 -1
  36. package/form-textarea/index.mjs +1 -1
  37. package/index.mjs +15 -15
  38. package/package.json +3 -4
  39. package/pageable-table/index.d.ts +2 -2
  40. package/pageable-table/index.mjs +1 -1
  41. package/props/input-number.d.ts +1 -1
  42. package/props/input-number.mjs +5 -1
  43. package/props/input.d.ts +1 -1
  44. package/props/input.mjs +3 -2
  45. package/sub-table/index.d.ts +2 -0
  46. package/sub-table/index.mjs +1 -1
  47. package/sub-table-plus/index.d.ts +2 -0
  48. package/sub-table-plus/index.mjs +1 -1
  49. package/table-view/index.d.ts +3 -0
  50. package/table-view/index.mjs +13 -18
  51. package/vue/directives/chat-drag.d.ts +2 -0
  52. package/vue/directives/chat-drag.mjs +12 -0
  53. package/vue/directives/click-outside.d.ts +10 -0
  54. package/vue/directives/click-outside.mjs +36 -0
  55. package/vue/directives/dialog-drag.d.ts +2 -0
  56. package/vue/directives/dialog-drag.mjs +15 -0
  57. package/vue/directives/drag-move.d.ts +10 -0
  58. package/vue/directives/drag-move.mjs +27 -0
  59. package/vue/directives/fix-fixed-column-height.d.ts +7 -0
  60. package/vue/directives/fix-fixed-column-height.mjs +20 -0
  61. package/vue/directives/index.d.ts +7 -0
  62. package/vue/directives/index.mjs +8 -0
  63. package/vue/directives/resize.d.ts +2 -0
  64. package/vue/directives/resize.mjs +12 -0
  65. package/vue/directives/scroll-bottom.d.ts +5 -0
  66. package/vue/directives/scroll-bottom.mjs +6 -0
  67. package/vue/hooks/index.d.ts +3 -0
  68. package/vue/hooks/index.mjs +4 -0
  69. package/{hook → vue/hooks}/useDictionary.d.ts +1 -1
  70. package/{hook → vue/hooks}/useDictionary.mjs +2 -2
  71. package/vue/hooks/useEventBus.d.ts +1 -0
  72. package/vue/hooks/useEventBus.mjs +20 -0
  73. package/{hook → vue/hooks}/useVisibilityChange.mjs +1 -1
  74. package/vue/index.d.ts +3 -0
  75. package/vue/index.mjs +83 -0
  76. package/vue/mixin/bus.d.ts +5 -0
  77. package/vue/mixin/bus.mjs +33 -0
  78. package/vue/mixin/dialog.d.ts +38 -0
  79. package/vue/mixin/dialog.mjs +2 -0
  80. package/vue/mixin/index.d.ts +6 -0
  81. package/vue/mixin/index.mjs +7 -0
  82. package/vue/mixin/message.d.ts +2 -0
  83. package/vue/mixin/message.mjs +27 -0
  84. package/vue/mixin/multi-items.d.ts +43 -0
  85. package/vue/mixin/multi-items.mjs +70 -0
  86. package/vue/mixin/page.d.ts +28 -0
  87. package/vue/mixin/page.mjs +38 -0
  88. package/vue/mixin/resize-mixin.d.ts +15 -0
  89. package/vue/mixin/resize-mixin.mjs +24 -0
  90. package/web-types.json +1 -1
  91. package/chunks/DML17Idh2.mjs +0 -108
  92. package/column/index.d.ts +0 -38
  93. package/column-default/index.d.ts +0 -77
  94. package/column-dynamic/index.d.ts +0 -8
  95. package/column-menu/index.d.ts +0 -81
  96. package/column-slot/index.d.ts +0 -21
  97. package/dialog-column/index.d.ts +0 -19
  98. package/dialog-excel/index.d.ts +0 -16
  99. package/dialog-filter/index.d.ts +0 -20
  100. package/element-base-info/index.d.ts +0 -35
  101. package/element-form/index.d.ts +0 -45
  102. package/element-listeners/index.d.ts +0 -42
  103. package/element-multi-instance/index.d.ts +0 -29
  104. package/element-other-config/index.d.ts +0 -14
  105. package/element-properties/index.d.ts +0 -21
  106. package/element-task-config/index.d.ts +0 -89
  107. package/flow-condition/index.d.ts +0 -16
  108. package/form-group/index.d.ts +0 -62
  109. package/form-temp/index.d.ts +0 -11286
  110. package/fy-dialog-form/index.d.ts +0 -1014
  111. package/fy-form-menu/index.d.ts +0 -9
  112. package/header-menu/index.d.ts +0 -86
  113. package/header-search/index.d.ts +0 -32
  114. package/process-designer/index.d.ts +0 -176
  115. package/process-palette/index.d.ts +0 -9
  116. package/properties-panel/index.d.ts +0 -97
  117. package/receive-task/index.d.ts +0 -20
  118. package/script-task/index.d.ts +0 -21
  119. package/signal-and-message/index.d.ts +0 -22
  120. package/table-column-filterable/index.d.ts +0 -163
  121. package/table-column-setting-panel/index.d.ts +0 -14
  122. package/table-page/index.d.ts +0 -23
  123. package/trigger/index.d.ts +0 -25
  124. package/user-task/index.d.ts +0 -24
  125. package/user-task-listeners/index.d.ts +0 -45
  126. package/vue-tree-select-arrow/index.d.ts +0 -2
  127. package/vue-tree-select-control/index.d.ts +0 -2
  128. package/vue-tree-select-delete/index.d.ts +0 -2
  129. package/vue-tree-select-hidden-fields/index.d.ts +0 -2
  130. package/vue-tree-select-input/index.d.ts +0 -2
  131. package/vue-tree-select-menu/index.d.ts +0 -2
  132. package/vue-tree-select-menu-portal/index.d.ts +0 -2
  133. package/vue-tree-select-multi-value/index.d.ts +0 -2
  134. package/vue-tree-select-multi-value-item/index.d.ts +0 -12
  135. package/vue-tree-select-option/index.d.ts +0 -12
  136. package/vue-tree-select-placeholder/index.d.ts +0 -2
  137. package/vue-tree-select-portal-target/index.d.ts +0 -2
  138. package/vue-tree-select-single-value/index.d.ts +0 -2
  139. /package/{hook → vue/hooks}/useVisibilityChange.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ import { useVisibilityChange as e } from "./useVisibilityChange.mjs";
2
+ import { useDictionary as t } from "./useDictionary.mjs";
3
+ import { useEventBus as n } from "./useEventBus.mjs";
4
+ export { t as useDictionary, n as useEventBus, e as useVisibilityChange };
@@ -1,4 +1,4 @@
1
- import { DictItem } from '../api';
1
+ import { DictItem } from '../../api';
2
2
  export declare const useDictionary: (props: Record<string, any>) => {
3
3
  dictItems: globalThis.Ref<{
4
4
  id: string;
@@ -1,6 +1,6 @@
1
- import { getDictData as e } from "../helper/dictionary.mjs";
1
+ import { getDictData as e } from "../../helper/dictionary.mjs";
2
2
  import { ref as t, watchEffect as n } from "vue";
3
- //#region src/hook/useDictionary.ts
3
+ //#region src/vue/hooks/useDictionary.ts
4
4
  var r = (r) => {
5
5
  let i = t([]);
6
6
  return n(async () => {
@@ -0,0 +1 @@
1
+ export declare const useEventBus: (event: string | Record<string, () => void>, cb: (...args: any[]) => void) => void;
@@ -0,0 +1,20 @@
1
+ import { onBeforeMount as e, onBeforeUnmount as t } from "vue";
2
+ import { emitter as n, isObject as r } from "@web-utils/core";
3
+ //#region src/vue/hooks/useEventBus.ts
4
+ var i = (i, a) => {
5
+ e(() => {
6
+ if (a) n.on(i, a);
7
+ else if (r(i)) {
8
+ let e = i;
9
+ for (let t in e) n.on(t, e[t]);
10
+ }
11
+ }), t(() => {
12
+ if (a) n.off(i, a);
13
+ else if (r(i)) {
14
+ let e = i;
15
+ for (let t in e) n.off(t, e[t]);
16
+ }
17
+ });
18
+ };
19
+ //#endregion
20
+ export { i as useEventBus };
@@ -1,5 +1,5 @@
1
1
  import { onBeforeMount as e, onBeforeUnmount as t } from "vue";
2
- //#region src/hook/useVisibilityChange.ts
2
+ //#region src/vue/hooks/useVisibilityChange.ts
3
3
  var n = ({ onPageHidden: n, onPageVisible: r } = {}) => {
4
4
  let i = () => {
5
5
  document.hidden ? n == null || n() : r == null || r();
package/vue/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './directives';
2
+ export * from './hooks';
3
+ export * from './mixin';
package/vue/index.mjs ADDED
@@ -0,0 +1,83 @@
1
+ import { bus as e, eventBusPlugin as t } from "./mixin/bus.mjs";
2
+ import { chatDrag as n } from "./directives/chat-drag.mjs";
3
+ import { clickOutside as r } from "./directives/click-outside.mjs";
4
+ import { useVisibilityChange as i } from "./hooks/useVisibilityChange.mjs";
5
+ import { dialogDrag as a } from "./directives/dialog-drag.mjs";
6
+ import { dragMove as o } from "./directives/drag-move.mjs";
7
+ import { fixFixedColumnHeight as s } from "./directives/fix-fixed-column-height.mjs";
8
+ import { resize as c } from "./directives/resize.mjs";
9
+ import { scrollBottom as l } from "./directives/scroll-bottom.mjs";
10
+ import "./directives/index.mjs";
11
+ import { useDictionary as u } from "./hooks/useDictionary.mjs";
12
+ import { useEventBus as d } from "./hooks/useEventBus.mjs";
13
+ import "./hooks/index.mjs";
14
+ import { ServerMessageManager as f, messageMixin as p } from "./mixin/message.mjs";
15
+ import { childMixin as m, parentMixin as h } from "./mixin/multi-items.mjs";
16
+ import { page as g } from "./mixin/page.mjs";
17
+ import { resizeMixin as _ } from "./mixin/resize-mixin.mjs";
18
+ import { getComputedHeight as v } from "@web-utils/core";
19
+ //#region src/vue/mixin/dialog.ts
20
+ var y = {
21
+ directives: {
22
+ dialogDrag: a,
23
+ alignCenter: { async inserted(e, t, n) {
24
+ await n.componentInstance.$nextTick();
25
+ let r = v(n.componentInstance.$refs.dialog), i = window.document.body.offsetHeight - r;
26
+ n.componentInstance.$refs.dialog.style.marginTop = `${i / 2}px`;
27
+ } }
28
+ },
29
+ props: {
30
+ visible: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ closeOnClickModal: Boolean,
35
+ reservePositionOnClose: {
36
+ type: Boolean,
37
+ default: !0
38
+ }
39
+ },
40
+ data() {
41
+ return {
42
+ show: !1,
43
+ fullScreen: !1
44
+ };
45
+ },
46
+ methods: {
47
+ closed() {
48
+ if (!this.reservePositionOnClose && this.$refs.dialog) {
49
+ let { dialog: e } = this.$refs.dialog.$refs;
50
+ e.style.top = "unset", e.style.left = "unset";
51
+ }
52
+ this.exitFullScreen(), this.$emit("closed");
53
+ },
54
+ close() {
55
+ this.show = !1;
56
+ },
57
+ toggleFullScreen() {
58
+ this.fullScreen = !this.fullScreen;
59
+ },
60
+ enterFullScreen() {
61
+ this.fullScreen = !0;
62
+ },
63
+ exitFullScreen() {
64
+ this.fullScreen = !1;
65
+ }
66
+ },
67
+ watch: {
68
+ visible: {
69
+ immediate: !0,
70
+ handler(e) {
71
+ this.show = e;
72
+ }
73
+ },
74
+ show(e) {
75
+ e !== this.visible && this.$emit("update:visible", e), e || this.$emit("close");
76
+ }
77
+ },
78
+ beforeDestroy() {
79
+ this.show && this.close();
80
+ }
81
+ };
82
+ //#endregion
83
+ export { f as ServerMessageManager, e as bus, n as chatDrag, m as childMixin, r as clickOutside, y as dialog, a as dialogDrag, o as dragMove, t as eventBusPlugin, s as fixFixedColumnHeight, p as messageMixin, g as page, h as parentMixin, c as resize, _ as resizeMixin, l as scrollBottom, u as useDictionary, d as useEventBus, i as useVisibilityChange };
@@ -0,0 +1,5 @@
1
+ import { emitter as bus } from '@web-utils/core';
2
+ export { bus };
3
+ export declare const eventBusPlugin: {
4
+ install(app: any, globalHooks: Record<string, any>): void;
5
+ };
@@ -0,0 +1,33 @@
1
+ import { emitter as e, isArray as t, isObject as n, isString as r, isUndefined as i } from "@web-utils/core";
2
+ //#region src/vue/mixin/bus.ts
3
+ function a(i) {
4
+ if (n(i)) for (let t in i) {
5
+ let o;
6
+ r(i[t]) ? o = this[i[t]] : n(i[t]) ? a.call(this, i[t]) : o = i[t].bind(this), o && (e.on(t, o), this.$Bus.push({
7
+ event: t,
8
+ handler: o
9
+ }));
10
+ }
11
+ t(i) && i.forEach((t) => {
12
+ let i = this[t];
13
+ r(t) && i && (e.on(t, i), this.$Bus.push({
14
+ event: t,
15
+ handler: i
16
+ })), n(t) && a.call(this, t);
17
+ });
18
+ }
19
+ var o = { install(n, r) {
20
+ n.config.globalProperties.$bus = (t, ...n) => {
21
+ e.emit(t, ...n);
22
+ }, n.mixin({
23
+ beforeCreate() {
24
+ let e = this.$options.bus;
25
+ this.$Bus = [], e && a.call(this, e), a.call(this, r);
26
+ },
27
+ beforeUnmount() {
28
+ if (this.$Bus) for (let t of this.$Bus) e.off(t.event, t.handler);
29
+ }
30
+ }), n.config.optionMergeStrategies.bus = (e, n) => t(e) ? t(n) ? e.concat(n) : (i(n) || e.push(n), e) : t(n) ? (i(e) || n.push(e), n) : e && n ? [e, n] : e || n;
31
+ } };
32
+ //#endregion
33
+ export { e as bus, o as eventBusPlugin };
@@ -0,0 +1,38 @@
1
+ export declare const dialog: {
2
+ directives: {
3
+ dialogDrag: import('vue').ObjectDirective<any, any, string, any>;
4
+ alignCenter: {
5
+ inserted(el: any, binding: any, vNode: any): Promise<void>;
6
+ };
7
+ };
8
+ props: {
9
+ visible: {
10
+ type: BooleanConstructor;
11
+ default: boolean;
12
+ };
13
+ closeOnClickModal: BooleanConstructor;
14
+ reservePositionOnClose: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ };
19
+ data(): {
20
+ show: boolean;
21
+ fullScreen: boolean;
22
+ };
23
+ methods: {
24
+ closed(this: any): void;
25
+ close(this: any): void;
26
+ toggleFullScreen(this: any): void;
27
+ enterFullScreen(this: any): void;
28
+ exitFullScreen(this: any): void;
29
+ };
30
+ watch: {
31
+ visible: {
32
+ immediate: boolean;
33
+ handler(this: any, newVal: boolean): void;
34
+ };
35
+ show(this: any, newVal: boolean): void;
36
+ };
37
+ beforeDestroy(this: any): void;
38
+ };
@@ -0,0 +1,2 @@
1
+ import { dialog as e } from "../index.mjs";
2
+ export { e as dialog };
@@ -0,0 +1,6 @@
1
+ export * from './bus';
2
+ export * from './dialog';
3
+ export * from './message';
4
+ export * from './multi-items';
5
+ export * from './page';
6
+ export * from './resize-mixin';
@@ -0,0 +1,7 @@
1
+ import { bus as e, eventBusPlugin as t } from "./bus.mjs";
2
+ import { ServerMessageManager as n, messageMixin as r } from "./message.mjs";
3
+ import { childMixin as i, parentMixin as a } from "./multi-items.mjs";
4
+ import { page as o } from "./page.mjs";
5
+ import { resizeMixin as s } from "./resize-mixin.mjs";
6
+ import { dialog as c } from "../index.mjs";
7
+ export { n as ServerMessageManager, e as bus, i as childMixin, c as dialog, t as eventBusPlugin, r as messageMixin, o as page, a as parentMixin, s as resizeMixin };
@@ -0,0 +1,2 @@
1
+ export declare const ServerMessageManager: import('@web-utils/core').MessageManager;
2
+ export declare const messageMixin: any;
@@ -0,0 +1,27 @@
1
+ import { capitalize as e, createMessageManager as t, isObject as n, isString as r } from "@web-utils/core";
2
+ //#region src/vue/mixin/message.ts
3
+ var i = t({ loggerTag: "ServerMessageManager" }), a = {
4
+ beforeCreate() {
5
+ let t = this.$options.message;
6
+ if (t) {
7
+ this.$MessageEvents = [];
8
+ for (let n in t) {
9
+ let r = (e) => {
10
+ t[n].call(this, e);
11
+ }, a = e(n);
12
+ i.addMessageListener(a, r), this.$MessageEvents.push({
13
+ model: a,
14
+ handler: r
15
+ });
16
+ }
17
+ }
18
+ },
19
+ beforeDestroy() {
20
+ if (this.$MessageEvents) for (let e of this.$MessageEvents) i.removeMessageListener(e.model, e.handler);
21
+ },
22
+ methods: { sendMessageToServer(e) {
23
+ (r(e) || n(e)) && i.sendMessage(r(e) ? e : JSON.stringify(e));
24
+ } }
25
+ };
26
+ //#endregion
27
+ export { i as ServerMessageManager, a as messageMixin };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Tab组件用到
3
+ */
4
+ export declare const parentMixin: {
5
+ mounted(this: any): void;
6
+ methods: {
7
+ updateIndex(this: any): void;
8
+ };
9
+ props: {
10
+ value: NumberConstructor;
11
+ };
12
+ watch: {
13
+ currentIndex(this: any, val: number, oldVal: number): void;
14
+ index(this: any, val: number): void;
15
+ value(this: any, val: number): void;
16
+ };
17
+ data(this: any): {
18
+ index: number;
19
+ currentIndex: any;
20
+ number: any;
21
+ };
22
+ };
23
+ export declare const childMixin: {
24
+ props: {
25
+ selected: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ };
30
+ mounted(this: any): void;
31
+ beforeDestroy(this: any): void;
32
+ methods: {
33
+ onItemClick(this: any, hasLink: string | boolean): void;
34
+ };
35
+ watch: {
36
+ currentSelected(this: any, val: boolean): void;
37
+ selected(this: any, val: boolean): void;
38
+ };
39
+ data(this: any): {
40
+ currentIndex: number;
41
+ currentSelected: any;
42
+ };
43
+ };
@@ -0,0 +1,70 @@
1
+ //#region src/vue/mixin/multi-items.ts
2
+ var e = {
3
+ mounted() {
4
+ this.value >= 0 && (this.currentIndex = this.value), this.updateIndex();
5
+ },
6
+ methods: { updateIndex() {
7
+ if (!this.$children || !this.$children.length) return;
8
+ this.number = this.$children.length;
9
+ let e = this.$children;
10
+ for (let t = 0; t < e.length; t++) e[t].currentIndex = t, e[t].currentSelected && (this.index = t);
11
+ } },
12
+ props: { value: Number },
13
+ watch: {
14
+ currentIndex(e, t) {
15
+ t > -1 && this.$children[t] && (this.$children[t].currentSelected = !1), e > -1 && this.$children[e] && (this.$children[e].currentSelected = !0), this.$emit("input", e), this.$emit("on-index-change", e, t);
16
+ },
17
+ index(e) {
18
+ this.currentIndex = e;
19
+ },
20
+ value(e) {
21
+ this.index = e;
22
+ }
23
+ },
24
+ data() {
25
+ return {
26
+ index: -1,
27
+ currentIndex: this.index,
28
+ number: this.$children.length
29
+ };
30
+ }
31
+ }, t = {
32
+ props: { selected: {
33
+ type: Boolean,
34
+ default: !1
35
+ } },
36
+ mounted() {
37
+ this.$parent.updateIndex();
38
+ },
39
+ beforeDestroy() {
40
+ let { $parent: e } = this;
41
+ this.$nextTick(() => {
42
+ e.updateIndex();
43
+ });
44
+ },
45
+ methods: { onItemClick(e) {
46
+ if (this.$parent.preventDefault) {
47
+ this.$parent.$emit("on-before-index-change", this.currentIndex);
48
+ return;
49
+ }
50
+ (this.disabled === void 0 || this.disabled === !1) && (this.currentSelected = !0, this.$parent.currentIndex = this.currentIndex, this.$nextTick(() => {
51
+ this.$emit("on-item-click", this.currentIndex);
52
+ }));
53
+ } },
54
+ watch: {
55
+ currentSelected(e) {
56
+ e && (this.$parent.index = this.currentIndex);
57
+ },
58
+ selected(e) {
59
+ this.currentSelected = e;
60
+ }
61
+ },
62
+ data() {
63
+ return {
64
+ currentIndex: -1,
65
+ currentSelected: this.selected
66
+ };
67
+ }
68
+ };
69
+ //#endregion
70
+ export { t as childMixin, e as parentMixin };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 公用分页mixin
3
+ */
4
+ export declare const page: {
5
+ data(): {
6
+ page: {
7
+ total: number;
8
+ page: number;
9
+ limit: number;
10
+ ascs: string;
11
+ descs: string;
12
+ filters: {};
13
+ model: {};
14
+ };
15
+ };
16
+ methods: {
17
+ resetPage(this: any): void;
18
+ makeSureNotEmpty(this: any): void;
19
+ /**
20
+ *
21
+ * @param {FilterRule} rule
22
+ */
23
+ addRule(this: any, rule: any): void;
24
+ addRules(this: any, rules: Array<any>): void;
25
+ clearRule(this: any): void;
26
+ removeRule(this: any, field: string): void;
27
+ };
28
+ };
@@ -0,0 +1,38 @@
1
+ //#region src/vue/mixin/page.ts
2
+ var e = {
3
+ data() {
4
+ return { page: {
5
+ total: 0,
6
+ page: 1,
7
+ limit: 25,
8
+ ascs: "",
9
+ descs: "",
10
+ filters: {},
11
+ model: {}
12
+ } };
13
+ },
14
+ methods: {
15
+ resetPage() {
16
+ this.page = this.$options.data.call(this).page;
17
+ },
18
+ makeSureNotEmpty() {
19
+ this.page.filters = this.page.filters || {}, this.page.filters.rules = this.page.filters.rules || [];
20
+ },
21
+ addRule(e) {
22
+ this.makeSureNotEmpty(), this.removeRule(e.field), this.page.filters.rules.push(e);
23
+ },
24
+ addRules(e) {
25
+ e.forEach((e) => this.addRule(e));
26
+ },
27
+ clearRule() {
28
+ delete this.page.filters.rules;
29
+ },
30
+ removeRule(e) {
31
+ this.makeSureNotEmpty();
32
+ let { rules: t } = this.page.filters, n = t.findIndex((t) => t.field === e);
33
+ n > -1 && t.splice(n, 1);
34
+ }
35
+ }
36
+ };
37
+ //#endregion
38
+ export { e as page };
@@ -0,0 +1,15 @@
1
+ export declare const resizeMixin: {
2
+ data(): {
3
+ /**
4
+ * 表格高度
5
+ */
6
+ tableHeight: null;
7
+ };
8
+ mounted(this: any): void;
9
+ methods: {
10
+ internalWindowResize(this: any): void;
11
+ };
12
+ activated(this: any): void;
13
+ deactivated(this: any): void;
14
+ beforeDestroy(this: any): void;
15
+ };
@@ -0,0 +1,24 @@
1
+ import { debounce as e } from "@web-utils/integrations/lodash";
2
+ //#region src/vue/mixin/resize-mixin.ts
3
+ var t = {
4
+ data() {
5
+ return { tableHeight: null };
6
+ },
7
+ mounted() {
8
+ this.onWindowResize && (this.internalWindowResize(), this.debouncedResize = e(this.internalWindowResize, 200), window.addEventListener("resize", this.debouncedResize));
9
+ },
10
+ methods: { internalWindowResize() {
11
+ this._inactive || this.onWindowResize();
12
+ } },
13
+ activated() {
14
+ this.debouncedResize && window.addEventListener("resize", this.debouncedResize);
15
+ },
16
+ deactivated() {
17
+ this.debouncedResize && window.removeEventListener("resize", this.debouncedResize);
18
+ },
19
+ beforeDestroy() {
20
+ this.debouncedResize && window.removeEventListener("resize", this.debouncedResize);
21
+ }
22
+ };
23
+ //#endregion
24
+ export { t as resizeMixin };