vxe-pc-ui 3.0.1 → 3.0.2
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.
- package/README.md +23 -25
- package/es/calendar/index.js +12 -0
- package/es/calendar/src/calendar.js +1227 -0
- package/es/calendar/style.css +247 -0
- package/es/calendar/style.min.css +1 -0
- package/es/checkbox/src/checkbox.js +6 -1
- package/es/checkbox/src/group.js +6 -1
- package/es/collapse/index.js +12 -0
- package/es/collapse/src/collapse-pane.js +39 -0
- package/es/collapse/src/collapse.js +39 -0
- package/es/collapse/style.css +0 -0
- package/es/collapse/style.min.css +0 -0
- package/es/collapse-pane/index.js +12 -0
- package/es/collapse-pane/style.css +0 -0
- package/es/collapse-pane/style.min.css +0 -0
- package/es/components.js +27 -27
- package/es/date-picker/src/date-picker.js +17 -13
- package/es/drawer/src/drawer.js +17 -12
- package/es/form/index.js +13 -0
- package/es/form/render/index.js +461 -0
- package/es/form/src/form-config-item.js +201 -0
- package/es/form/src/form-gather.js +87 -0
- package/es/form/src/form-item.js +291 -0
- package/es/form/src/form.js +762 -0
- package/es/form/src/itemInfo.js +43 -0
- package/es/form/src/render.js +78 -0
- package/es/form/src/util.js +66 -0
- package/es/form/style.css +470 -0
- package/es/form/style.min.css +1 -0
- package/es/form-gather/index.js +12 -0
- package/es/form-gather/style.css +0 -0
- package/es/form-gather/style.min.css +0 -0
- package/es/form-item/index.js +12 -0
- package/es/form-item/style.css +0 -0
- package/es/form-item/style.min.css +0 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +5 -1
- package/es/image/src/preview.js +1 -2
- package/es/input/src/input.js +19 -15
- package/es/list/index.js +12 -0
- package/es/list/src/list.js +373 -0
- package/es/list/style.css +28 -0
- package/es/list/style.min.css +1 -0
- package/es/loading/src/loading.js +5 -0
- package/es/menu/src/menu.js +6 -2
- package/es/modal/src/modal.js +7 -4
- package/es/number-input/src/number-input.js +11 -7
- package/es/pager/style.css +303 -0
- package/es/pager/style.min.css +1 -0
- package/es/password-input/src/password-input.js +7 -3
- package/es/pulldown/src/pulldown.js +6 -2
- package/es/radio/src/button.js +6 -2
- package/es/radio/src/group.js +6 -2
- package/es/radio/src/radio.js +6 -2
- package/es/select/src/select.js +16 -1
- package/es/select/src/util.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/src/switch.js +6 -2
- package/es/tabs/src/tabs.js +8 -3
- package/es/textarea/src/textarea.js +9 -5
- package/es/tooltip/src/tooltip.js +6 -1
- package/es/tree/index.js +12 -0
- package/es/tree/src/tree.js +1216 -0
- package/es/tree/style.css +219 -0
- package/es/tree/style.min.css +1 -0
- package/es/tree-select/index.js +12 -0
- package/es/tree-select/src/tree-select.js +685 -0
- package/es/tree-select/style.css +129 -0
- package/es/tree-select/style.min.css +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.js +1 -1
- package/es/upload/src/upload.js +9 -5
- package/es/vxe-calendar/index.js +3 -0
- package/es/vxe-calendar/style.css +247 -0
- package/es/vxe-calendar/style.min.css +1 -0
- package/es/vxe-collapse/index.js +3 -0
- package/es/vxe-collapse/style.css +0 -0
- package/es/vxe-collapse/style.min.css +0 -0
- package/es/vxe-collapse-pane/index.js +3 -0
- package/es/vxe-collapse-pane/style.css +0 -0
- package/es/vxe-collapse-pane/style.min.css +0 -0
- package/es/vxe-form/index.js +3 -0
- package/es/vxe-form/style.css +470 -0
- package/es/vxe-form/style.min.css +1 -0
- package/es/vxe-form-gather/index.js +3 -0
- package/es/vxe-form-gather/style.css +0 -0
- package/es/vxe-form-gather/style.min.css +0 -0
- package/es/vxe-form-item/index.js +3 -0
- package/es/vxe-form-item/style.css +0 -0
- package/es/vxe-form-item/style.min.css +0 -0
- package/es/vxe-list/index.js +3 -0
- package/es/vxe-list/style.css +28 -0
- package/es/vxe-list/style.min.css +1 -0
- package/es/vxe-pager/index.js +3 -0
- package/es/vxe-pager/style.css +303 -0
- package/es/vxe-pager/style.min.css +1 -0
- package/es/vxe-tree/index.js +3 -0
- package/es/vxe-tree/style.css +219 -0
- package/es/vxe-tree/style.min.css +1 -0
- package/es/vxe-tree-select/index.js +3 -0
- package/es/vxe-tree-select/style.css +129 -0
- package/es/vxe-tree-select/style.min.css +1 -0
- package/lib/calendar/index.js +19 -0
- package/lib/calendar/index.min.js +1 -0
- package/lib/calendar/src/calendar.js +1286 -0
- package/lib/calendar/src/calendar.min.js +1 -0
- package/lib/calendar/style/index.js +1 -0
- package/lib/calendar/style/style.css +247 -0
- package/lib/calendar/style/style.min.css +1 -0
- package/lib/checkbox/src/checkbox.js +6 -1
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +6 -1
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/collapse/index.js +19 -0
- package/lib/collapse/index.min.js +1 -0
- package/lib/collapse/src/collapse-pane.js +48 -0
- package/lib/collapse/src/collapse-pane.min.js +1 -0
- package/lib/collapse/src/collapse.js +48 -0
- package/lib/collapse/src/collapse.min.js +1 -0
- package/lib/collapse/style/index.js +1 -0
- package/lib/collapse/style/style.css +0 -0
- package/lib/collapse/style/style.min.css +0 -0
- package/lib/collapse-pane/index.js +19 -0
- package/lib/collapse-pane/index.min.js +1 -0
- package/lib/collapse-pane/style/index.js +1 -0
- package/lib/collapse-pane/style/style.css +0 -0
- package/lib/collapse-pane/style/style.min.css +0 -0
- package/lib/components.js +114 -39
- package/lib/components.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +17 -13
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/drawer/src/drawer.js +17 -12
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/index.js +20 -0
- package/lib/form/index.min.js +1 -0
- package/lib/form/render/index.js +509 -0
- package/lib/form/render/index.min.js +1 -0
- package/lib/form/src/form-config-item.js +210 -0
- package/lib/form/src/form-config-item.min.js +1 -0
- package/lib/form/src/form-gather.js +99 -0
- package/lib/form/src/form-gather.min.js +1 -0
- package/lib/form/src/form-item.js +299 -0
- package/lib/form/src/form-item.min.js +1 -0
- package/lib/form/src/form.js +856 -0
- package/lib/form/src/form.min.js +1 -0
- package/lib/form/src/itemInfo.js +60 -0
- package/lib/form/src/itemInfo.min.js +1 -0
- package/lib/form/src/render.js +94 -0
- package/lib/form/src/render.min.js +1 -0
- package/lib/form/src/util.js +93 -0
- package/lib/form/src/util.min.js +1 -0
- package/lib/form/style/index.js +1 -0
- package/lib/form/style/style.css +470 -0
- package/lib/form/style/style.min.css +1 -0
- package/lib/form-gather/index.js +19 -0
- package/lib/form-gather/index.min.js +1 -0
- package/lib/form-gather/style/index.js +1 -0
- package/lib/form-gather/style/style.css +0 -0
- package/lib/form-gather/style/style.min.css +0 -0
- package/lib/form-item/index.js +19 -0
- package/lib/form-item/index.min.js +1 -0
- package/lib/form-item/style/index.js +1 -0
- package/lib/form-item/style/style.css +0 -0
- package/lib/form-item/style/style.min.css +0 -0
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +5 -1
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/image/src/preview.js +1 -2
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +11284 -5009
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +19 -15
- package/lib/input/src/input.min.js +1 -1
- package/lib/list/index.js +19 -0
- package/lib/list/index.min.js +1 -0
- package/lib/list/src/list.js +415 -0
- package/lib/list/src/list.min.js +1 -0
- package/lib/list/style/index.js +1 -0
- package/lib/list/style/style.css +28 -0
- package/lib/list/style/style.min.css +1 -0
- package/lib/loading/src/loading.js +5 -0
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +6 -2
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +7 -4
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/number-input/src/number-input.js +11 -7
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/pager/style/index.js +1 -0
- package/lib/pager/style/style.css +303 -0
- package/lib/pager/style/style.min.css +1 -0
- package/lib/password-input/src/password-input.js +7 -3
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +6 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +6 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +6 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +6 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +16 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/src/util.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/src/switch.js +6 -2
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/tabs/src/tabs.js +8 -3
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/textarea/src/textarea.js +9 -5
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +6 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/index.js +19 -0
- package/lib/tree/index.min.js +1 -0
- package/lib/tree/src/tree.js +1324 -0
- package/lib/tree/src/tree.min.js +1 -0
- package/lib/tree/style/index.js +1 -0
- package/lib/tree/style/style.css +219 -0
- package/lib/tree/style/style.min.css +1 -0
- package/lib/tree-select/index.js +19 -0
- package/lib/tree-select/index.min.js +1 -0
- package/lib/tree-select/src/tree-select.js +695 -0
- package/lib/tree-select/src/tree-select.min.js +1 -0
- package/lib/tree-select/style/index.js +1 -0
- package/lib/tree-select/style/style.css +129 -0
- package/lib/tree-select/style/style.min.css +1 -0
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/vn.js +1 -1
- package/lib/ui/src/vn.min.js +1 -1
- package/lib/upload/src/upload.js +9 -5
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/vxe-calendar/index.js +23 -0
- package/lib/vxe-calendar/index.min.js +1 -0
- package/lib/vxe-calendar/style/index.js +1 -0
- package/lib/vxe-calendar/style/style.css +247 -0
- package/lib/vxe-calendar/style/style.min.css +1 -0
- package/lib/vxe-collapse/index.js +23 -0
- package/lib/vxe-collapse/index.min.js +1 -0
- package/lib/vxe-collapse/style/index.js +1 -0
- package/lib/vxe-collapse/style/style.css +0 -0
- package/lib/vxe-collapse/style/style.min.css +0 -0
- package/lib/vxe-collapse-pane/index.js +23 -0
- package/lib/vxe-collapse-pane/index.min.js +1 -0
- package/lib/vxe-collapse-pane/style/index.js +1 -0
- package/lib/vxe-collapse-pane/style/style.css +0 -0
- package/lib/vxe-collapse-pane/style/style.min.css +0 -0
- package/lib/vxe-form/index.js +23 -0
- package/lib/vxe-form/index.min.js +1 -0
- package/lib/vxe-form/style/index.js +1 -0
- package/lib/vxe-form/style/style.css +470 -0
- package/lib/vxe-form/style/style.min.css +1 -0
- package/lib/vxe-form-gather/index.js +23 -0
- package/lib/vxe-form-gather/index.min.js +1 -0
- package/lib/vxe-form-gather/style/index.js +1 -0
- package/lib/vxe-form-gather/style/style.css +0 -0
- package/lib/vxe-form-gather/style/style.min.css +0 -0
- package/lib/vxe-form-item/index.js +23 -0
- package/lib/vxe-form-item/index.min.js +1 -0
- package/lib/vxe-form-item/style/index.js +1 -0
- package/lib/vxe-form-item/style/style.css +0 -0
- package/lib/vxe-form-item/style/style.min.css +0 -0
- package/lib/vxe-list/index.js +23 -0
- package/lib/vxe-list/index.min.js +1 -0
- package/lib/vxe-list/style/index.js +1 -0
- package/lib/vxe-list/style/style.css +28 -0
- package/lib/vxe-list/style/style.min.css +1 -0
- package/lib/vxe-pager/index.js +23 -0
- package/lib/vxe-pager/index.min.js +1 -0
- package/lib/vxe-pager/style/index.js +1 -0
- package/lib/vxe-pager/style/style.css +303 -0
- package/lib/vxe-pager/style/style.min.css +1 -0
- package/lib/vxe-tree/index.js +23 -0
- package/lib/vxe-tree/index.min.js +1 -0
- package/lib/vxe-tree/style/index.js +1 -0
- package/lib/vxe-tree/style/style.css +219 -0
- package/lib/vxe-tree/style/style.min.css +1 -0
- package/lib/vxe-tree-select/index.js +23 -0
- package/lib/vxe-tree-select/index.min.js +1 -0
- package/lib/vxe-tree-select/style/index.js +1 -0
- package/lib/vxe-tree-select/style/style.css +129 -0
- package/lib/vxe-tree-select/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/calendar/index.ts +16 -0
- package/packages/calendar/src/calendar.ts +1281 -0
- package/packages/checkbox/src/checkbox.ts +7 -1
- package/packages/checkbox/src/group.ts +8 -2
- package/packages/collapse/index.ts +16 -0
- package/packages/collapse/src/collapse-pane.ts +47 -0
- package/packages/collapse/src/collapse.ts +47 -0
- package/packages/collapse-pane/index.ts +16 -0
- package/packages/components.ts +27 -27
- package/packages/date-picker/src/date-picker.ts +18 -13
- package/packages/drawer/src/drawer.ts +18 -12
- package/packages/form/index.ts +17 -0
- package/packages/form/render/index.ts +499 -0
- package/packages/form/src/form-config-item.ts +219 -0
- package/packages/form/src/form-gather.ts +104 -0
- package/packages/form/src/form-item.ts +322 -0
- package/packages/form/src/form.ts +809 -0
- package/packages/form/src/itemInfo.ts +47 -0
- package/packages/form/src/render.ts +98 -0
- package/packages/form/src/util.ts +80 -0
- package/packages/form-gather/index.ts +16 -0
- package/packages/form-item/index.ts +16 -0
- package/packages/icon-picker/src/icon-picker.ts +6 -1
- package/packages/image/src/preview.ts +1 -2
- package/packages/input/src/input.ts +20 -15
- package/packages/layout-footer/src/layout-footer.ts +1 -0
- package/packages/list/index.ts +16 -0
- package/packages/list/src/list.ts +403 -0
- package/packages/loading/src/loading.ts +6 -0
- package/packages/menu/src/menu.ts +7 -2
- package/packages/modal/src/modal.ts +8 -4
- package/packages/number-input/src/number-input.ts +12 -7
- package/packages/password-input/src/password-input.ts +8 -3
- package/packages/pulldown/src/pulldown.ts +7 -2
- package/packages/radio/src/button.ts +7 -2
- package/packages/radio/src/group.ts +7 -2
- package/packages/radio/src/radio.ts +7 -2
- package/packages/select/src/select.ts +17 -1
- package/packages/select/src/util.ts +4 -3
- package/packages/switch/src/switch.ts +7 -2
- package/packages/tabs/src/tabs.ts +9 -3
- package/packages/textarea/src/textarea.ts +10 -5
- package/packages/tooltip/src/tooltip.ts +7 -1
- package/packages/tree/index.ts +16 -0
- package/packages/tree/src/tree.ts +1292 -0
- package/packages/tree-select/index.ts +16 -0
- package/packages/tree-select/src/tree-select.ts +743 -0
- package/packages/ui/src/vn.ts +1 -1
- package/packages/upload/src/upload.ts +10 -5
- package/types/components/calendar.d.ts +6 -0
- package/types/components/colgroup.d.ts +1 -0
- package/types/components/column.d.ts +1 -0
- package/types/components/drawer.d.ts +11 -10
- package/types/components/form-item.d.ts +1 -1
- package/types/components/form.d.ts +8 -1
- package/types/components/list.d.ts +1 -0
- package/types/components/table.d.ts +43 -4
- package/types/components/toolbar.d.ts +5 -0
- package/types/components/tree-select.d.ts +4 -0
- package/types/ui/index.d.ts +0 -5
- package/types/ui/renderer.d.ts +37 -36
- package/types/handles/form-design.d.ts +0 -4
- package/types/handles/index.d.ts +0 -3
- package/types/handles/list-design.d.ts +0 -4
- package/types/handles/table.d.ts +0 -4
- /package/es/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/es/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _comp = require("../../ui/src/comp");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _ui = require("../../ui");
|
|
10
|
+
var _dom = require("../../ui/src/dom");
|
|
11
|
+
var _loading = _interopRequireDefault(require("../../loading/src/loading"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
18
|
+
name: 'VxeList',
|
|
19
|
+
mixins: [_ui.globalMixins.sizeMixin],
|
|
20
|
+
props: {
|
|
21
|
+
data: Array,
|
|
22
|
+
height: [Number, String],
|
|
23
|
+
maxHeight: [Number, String],
|
|
24
|
+
loading: Boolean,
|
|
25
|
+
className: [String, Function],
|
|
26
|
+
size: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: function _default() {
|
|
29
|
+
return (0, _ui.getConfig)().list.size || (0, _ui.getConfig)().size;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
autoResize: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: function _default() {
|
|
35
|
+
return (0, _ui.getConfig)().list.autoResize;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
syncResize: [Boolean, String, Number],
|
|
39
|
+
scrollY: Object
|
|
40
|
+
},
|
|
41
|
+
data: function data() {
|
|
42
|
+
var xID = _xeUtils.default.uniqueId();
|
|
43
|
+
var reactData = {
|
|
44
|
+
scrollYLoad: false,
|
|
45
|
+
bodyHeight: 0,
|
|
46
|
+
rowHeight: 0,
|
|
47
|
+
topSpaceHeight: 0,
|
|
48
|
+
items: []
|
|
49
|
+
};
|
|
50
|
+
var internalData = {
|
|
51
|
+
resizeObserver: undefined,
|
|
52
|
+
fullData: [],
|
|
53
|
+
lastScrollLeft: 0,
|
|
54
|
+
lastScrollTop: 0,
|
|
55
|
+
scrollYStore: {
|
|
56
|
+
startIndex: 0,
|
|
57
|
+
endIndex: 0,
|
|
58
|
+
visibleSize: 0,
|
|
59
|
+
offsetSize: 0,
|
|
60
|
+
rowHeight: 0
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
xID: xID,
|
|
65
|
+
reactData: reactData,
|
|
66
|
+
internalData: internalData
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
computed: Object.assign(Object.assign({}, {}), {
|
|
70
|
+
computeSYOpts: function computeSYOpts() {
|
|
71
|
+
var $xeList = this;
|
|
72
|
+
var props = $xeList;
|
|
73
|
+
return Object.assign({}, (0, _ui.getConfig)().list.scrollY, props.scrollY);
|
|
74
|
+
},
|
|
75
|
+
computeStyles: function computeStyles() {
|
|
76
|
+
var $xeList = this;
|
|
77
|
+
var props = $xeList;
|
|
78
|
+
var height = props.height,
|
|
79
|
+
maxHeight = props.maxHeight;
|
|
80
|
+
var style = {};
|
|
81
|
+
if (height) {
|
|
82
|
+
style.height = "".concat(isNaN(height) ? height : "".concat(height, "px"));
|
|
83
|
+
} else if (maxHeight) {
|
|
84
|
+
style.height = 'auto';
|
|
85
|
+
style.maxHeight = "".concat(isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px"));
|
|
86
|
+
}
|
|
87
|
+
return style;
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
methods: {
|
|
91
|
+
//
|
|
92
|
+
// Method
|
|
93
|
+
//
|
|
94
|
+
dispatchEvent: function dispatchEvent(type, params, evnt) {
|
|
95
|
+
var $xeList = this;
|
|
96
|
+
$xeList.$emit(type, (0, _ui.createEvent)(evnt, {
|
|
97
|
+
$list: $xeList
|
|
98
|
+
}, params));
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* 加载数据
|
|
102
|
+
* @param {Array} datas 数据
|
|
103
|
+
*/
|
|
104
|
+
loadData: function loadData(datas) {
|
|
105
|
+
var $xeList = this;
|
|
106
|
+
var reactData = $xeList.reactData;
|
|
107
|
+
var internalData = $xeList.internalData;
|
|
108
|
+
var scrollYStore = internalData.scrollYStore;
|
|
109
|
+
var sYOpts = $xeList.computeSYOpts;
|
|
110
|
+
var fullData = datas || [];
|
|
111
|
+
Object.assign(scrollYStore, {
|
|
112
|
+
startIndex: 0,
|
|
113
|
+
endIndex: 1,
|
|
114
|
+
visibleSize: 0
|
|
115
|
+
});
|
|
116
|
+
internalData.fullData = fullData;
|
|
117
|
+
// 如果gt为0,则总是启用
|
|
118
|
+
reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length);
|
|
119
|
+
$xeList.handleData();
|
|
120
|
+
return $xeList.computeScrollLoad().then(function () {
|
|
121
|
+
$xeList.refreshScroll();
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* 重新加载数据
|
|
126
|
+
* @param {Array} datas 数据
|
|
127
|
+
*/
|
|
128
|
+
reloadData: function reloadData(datas) {
|
|
129
|
+
var $xeList = this;
|
|
130
|
+
$xeList.clearScroll();
|
|
131
|
+
return $xeList.loadData(datas);
|
|
132
|
+
},
|
|
133
|
+
updateYSpace: function updateYSpace() {
|
|
134
|
+
var $xeList = this;
|
|
135
|
+
var reactData = $xeList.reactData;
|
|
136
|
+
var internalData = $xeList.internalData;
|
|
137
|
+
var scrollYLoad = reactData.scrollYLoad;
|
|
138
|
+
var scrollYStore = internalData.scrollYStore,
|
|
139
|
+
fullData = internalData.fullData;
|
|
140
|
+
reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
|
|
141
|
+
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
|
|
142
|
+
},
|
|
143
|
+
handleData: function handleData() {
|
|
144
|
+
var $xeList = this;
|
|
145
|
+
var reactData = $xeList.reactData;
|
|
146
|
+
var internalData = $xeList.internalData;
|
|
147
|
+
var scrollYLoad = reactData.scrollYLoad;
|
|
148
|
+
var fullData = internalData.fullData,
|
|
149
|
+
scrollYStore = internalData.scrollYStore;
|
|
150
|
+
reactData.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
|
|
151
|
+
return $xeList.$nextTick();
|
|
152
|
+
},
|
|
153
|
+
updateYData: function updateYData() {
|
|
154
|
+
var $xeList = this;
|
|
155
|
+
$xeList.handleData();
|
|
156
|
+
$xeList.updateYSpace();
|
|
157
|
+
},
|
|
158
|
+
computeScrollLoad: function computeScrollLoad() {
|
|
159
|
+
var $xeList = this;
|
|
160
|
+
var reactData = $xeList.reactData;
|
|
161
|
+
var internalData = $xeList.internalData;
|
|
162
|
+
return $xeList.$nextTick().then(function () {
|
|
163
|
+
var scrollYLoad = reactData.scrollYLoad;
|
|
164
|
+
var scrollYStore = internalData.scrollYStore;
|
|
165
|
+
var virtualBodyElem = $xeList.$refs.refVirtualBody;
|
|
166
|
+
var sYOpts = $xeList.computeSYOpts;
|
|
167
|
+
var rowHeight = 0;
|
|
168
|
+
var firstItemElem;
|
|
169
|
+
if (virtualBodyElem) {
|
|
170
|
+
if (sYOpts.sItem) {
|
|
171
|
+
firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem);
|
|
172
|
+
}
|
|
173
|
+
if (!firstItemElem) {
|
|
174
|
+
firstItemElem = virtualBodyElem.children[0];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (firstItemElem) {
|
|
178
|
+
rowHeight = firstItemElem.offsetHeight;
|
|
179
|
+
}
|
|
180
|
+
rowHeight = Math.max(20, rowHeight);
|
|
181
|
+
scrollYStore.rowHeight = rowHeight;
|
|
182
|
+
// 计算 Y 逻辑
|
|
183
|
+
if (scrollYLoad) {
|
|
184
|
+
var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
|
|
185
|
+
var visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight));
|
|
186
|
+
var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0;
|
|
187
|
+
scrollYStore.offsetSize = offsetYSize;
|
|
188
|
+
scrollYStore.visibleSize = visibleYSize;
|
|
189
|
+
scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
190
|
+
$xeList.updateYData();
|
|
191
|
+
} else {
|
|
192
|
+
$xeList.updateYSpace();
|
|
193
|
+
}
|
|
194
|
+
reactData.rowHeight = rowHeight;
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* 清除滚动条
|
|
199
|
+
*/
|
|
200
|
+
clearScroll: function clearScroll() {
|
|
201
|
+
var $xeList = this;
|
|
202
|
+
var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
|
|
203
|
+
if (scrollBodyElem) {
|
|
204
|
+
scrollBodyElem.scrollTop = 0;
|
|
205
|
+
}
|
|
206
|
+
return $xeList.$nextTick();
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* 如果有滚动条,则滚动到对应的位置
|
|
210
|
+
* @param {Number} scrollLeft 左距离
|
|
211
|
+
* @param {Number} scrollTop 上距离
|
|
212
|
+
*/
|
|
213
|
+
scrollTo: function scrollTo(scrollLeft, scrollTop) {
|
|
214
|
+
var $xeList = this;
|
|
215
|
+
var reactData = $xeList.reactData;
|
|
216
|
+
var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
|
|
217
|
+
if (_xeUtils.default.isNumber(scrollLeft)) {
|
|
218
|
+
scrollBodyElem.scrollLeft = scrollLeft;
|
|
219
|
+
}
|
|
220
|
+
if (_xeUtils.default.isNumber(scrollTop)) {
|
|
221
|
+
scrollBodyElem.scrollTop = scrollTop;
|
|
222
|
+
}
|
|
223
|
+
if (reactData.scrollYLoad) {
|
|
224
|
+
return new Promise(function (resolve) {
|
|
225
|
+
setTimeout(function () {
|
|
226
|
+
$xeList.$nextTick(function () {
|
|
227
|
+
resolve();
|
|
228
|
+
});
|
|
229
|
+
}, 50);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return $xeList.$nextTick();
|
|
233
|
+
},
|
|
234
|
+
/**
|
|
235
|
+
* 刷新滚动条
|
|
236
|
+
*/
|
|
237
|
+
refreshScroll: function refreshScroll() {
|
|
238
|
+
var $xeList = this;
|
|
239
|
+
var internalData = $xeList.internalData;
|
|
240
|
+
var lastScrollLeft = internalData.lastScrollLeft,
|
|
241
|
+
lastScrollTop = internalData.lastScrollTop;
|
|
242
|
+
return $xeList.clearScroll().then(function () {
|
|
243
|
+
if (lastScrollLeft || lastScrollTop) {
|
|
244
|
+
internalData.lastScrollLeft = 0;
|
|
245
|
+
internalData.lastScrollTop = 0;
|
|
246
|
+
return scrollTo(lastScrollLeft, lastScrollTop);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* 重新计算列表
|
|
252
|
+
*/
|
|
253
|
+
recalculate: function recalculate() {
|
|
254
|
+
var $xeList = this;
|
|
255
|
+
var el = $xeList.$refs.refElem;
|
|
256
|
+
if (el.clientWidth && el.clientHeight) {
|
|
257
|
+
return $xeList.computeScrollLoad();
|
|
258
|
+
}
|
|
259
|
+
return Promise.resolve();
|
|
260
|
+
},
|
|
261
|
+
loadYData: function loadYData(evnt) {
|
|
262
|
+
var $xeList = this;
|
|
263
|
+
var internalData = $xeList.internalData;
|
|
264
|
+
var scrollYStore = internalData.scrollYStore;
|
|
265
|
+
var startIndex = scrollYStore.startIndex,
|
|
266
|
+
endIndex = scrollYStore.endIndex,
|
|
267
|
+
visibleSize = scrollYStore.visibleSize,
|
|
268
|
+
offsetSize = scrollYStore.offsetSize,
|
|
269
|
+
rowHeight = scrollYStore.rowHeight;
|
|
270
|
+
var scrollBodyElem = evnt.target;
|
|
271
|
+
var scrollTop = scrollBodyElem.scrollTop;
|
|
272
|
+
var toVisibleIndex = Math.floor(scrollTop / rowHeight);
|
|
273
|
+
var offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
|
|
274
|
+
var offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
|
|
275
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
276
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
277
|
+
scrollYStore.startIndex = offsetStartIndex;
|
|
278
|
+
scrollYStore.endIndex = offsetEndIndex;
|
|
279
|
+
$xeList.updateYData();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
scrollEvent: function scrollEvent(evnt) {
|
|
284
|
+
var $xeList = this;
|
|
285
|
+
var reactData = $xeList.reactData;
|
|
286
|
+
var internalData = $xeList.internalData;
|
|
287
|
+
var scrollBodyElem = evnt.target;
|
|
288
|
+
var scrollTop = scrollBodyElem.scrollTop;
|
|
289
|
+
var scrollLeft = scrollBodyElem.scrollLeft;
|
|
290
|
+
var isX = scrollLeft !== internalData.lastScrollLeft;
|
|
291
|
+
var isY = scrollTop !== internalData.lastScrollTop;
|
|
292
|
+
internalData.lastScrollTop = scrollTop;
|
|
293
|
+
internalData.lastScrollLeft = scrollLeft;
|
|
294
|
+
if (reactData.scrollYLoad) {
|
|
295
|
+
$xeList.loadYData(evnt);
|
|
296
|
+
}
|
|
297
|
+
$xeList.dispatchEvent('scroll', {
|
|
298
|
+
scrollLeft: scrollLeft,
|
|
299
|
+
scrollTop: scrollTop,
|
|
300
|
+
isX: isX,
|
|
301
|
+
isY: isY
|
|
302
|
+
}, evnt);
|
|
303
|
+
},
|
|
304
|
+
//
|
|
305
|
+
// Render
|
|
306
|
+
//
|
|
307
|
+
renderVN: function renderVN(h) {
|
|
308
|
+
var $xeList = this;
|
|
309
|
+
var props = $xeList;
|
|
310
|
+
var reactData = $xeList.reactData;
|
|
311
|
+
var slots = $xeList.$scopedSlots;
|
|
312
|
+
var className = props.className,
|
|
313
|
+
loading = props.loading;
|
|
314
|
+
var bodyHeight = reactData.bodyHeight,
|
|
315
|
+
topSpaceHeight = reactData.topSpaceHeight,
|
|
316
|
+
items = reactData.items;
|
|
317
|
+
var defaultSlot = slots.default;
|
|
318
|
+
var vSize = $xeList.computeSize;
|
|
319
|
+
var styles = $xeList.computeStyles;
|
|
320
|
+
return h('div', {
|
|
321
|
+
ref: 'refElem',
|
|
322
|
+
class: ['vxe-list', className ? _xeUtils.default.isFunction(className) ? className({
|
|
323
|
+
$list: $xeList
|
|
324
|
+
}) : className : '', _defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--loading', loading)]
|
|
325
|
+
}, [h('div', {
|
|
326
|
+
ref: 'refVirtualWrapper',
|
|
327
|
+
class: 'vxe-list--virtual-wrapper',
|
|
328
|
+
style: styles,
|
|
329
|
+
on: {
|
|
330
|
+
scroll: $xeList.scrollEvent
|
|
331
|
+
}
|
|
332
|
+
}, [h('div', {
|
|
333
|
+
class: 'vxe-list--y-space',
|
|
334
|
+
style: {
|
|
335
|
+
height: bodyHeight ? "".concat(bodyHeight, "px") : ''
|
|
336
|
+
}
|
|
337
|
+
}), h('div', {
|
|
338
|
+
ref: 'refVirtualBody',
|
|
339
|
+
class: 'vxe-list--body',
|
|
340
|
+
style: {
|
|
341
|
+
marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
|
|
342
|
+
}
|
|
343
|
+
}, defaultSlot ? defaultSlot({
|
|
344
|
+
items: items,
|
|
345
|
+
$list: $xeList
|
|
346
|
+
}) : [])]),
|
|
347
|
+
/**
|
|
348
|
+
* 加载中
|
|
349
|
+
*/
|
|
350
|
+
h(_loading.default, {
|
|
351
|
+
class: 'vxe-list--loading',
|
|
352
|
+
props: {
|
|
353
|
+
value: loading
|
|
354
|
+
}
|
|
355
|
+
})]);
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
watch: {
|
|
359
|
+
data: function data() {
|
|
360
|
+
var $xeList = this;
|
|
361
|
+
var props = $xeList;
|
|
362
|
+
$xeList.loadData(props.data || []);
|
|
363
|
+
},
|
|
364
|
+
syncResize: function syncResize(val) {
|
|
365
|
+
var $xeList = this;
|
|
366
|
+
if (val) {
|
|
367
|
+
$xeList.recalculate();
|
|
368
|
+
$xeList.$nextTick(function () {
|
|
369
|
+
return setTimeout(function () {
|
|
370
|
+
return $xeList.recalculate();
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
created: function created() {
|
|
377
|
+
var $xeList = this;
|
|
378
|
+
var props = $xeList;
|
|
379
|
+
_ui.globalEvents.on($xeList, 'resize', function () {
|
|
380
|
+
$xeList.recalculate();
|
|
381
|
+
});
|
|
382
|
+
$xeList.loadData(props.data || []);
|
|
383
|
+
},
|
|
384
|
+
mounted: function mounted() {
|
|
385
|
+
var $xeList = this;
|
|
386
|
+
var props = $xeList;
|
|
387
|
+
var internalData = $xeList.internalData;
|
|
388
|
+
if (props.autoResize) {
|
|
389
|
+
var el = $xeList.$refs.refElem;
|
|
390
|
+
var resizeObserver = _ui.globalResize.create(function () {
|
|
391
|
+
return $xeList.recalculate();
|
|
392
|
+
});
|
|
393
|
+
resizeObserver.observe(el);
|
|
394
|
+
internalData.resizeObserver = resizeObserver;
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
activated: function activated() {
|
|
398
|
+
var $xeList = this;
|
|
399
|
+
$xeList.recalculate().then(function () {
|
|
400
|
+
return $xeList.refreshScroll();
|
|
401
|
+
});
|
|
402
|
+
},
|
|
403
|
+
beforeDestroy: function beforeDestroy() {
|
|
404
|
+
var $xeList = this;
|
|
405
|
+
var internalData = $xeList.internalData;
|
|
406
|
+
var resizeObserver = internalData.resizeObserver;
|
|
407
|
+
if (resizeObserver) {
|
|
408
|
+
resizeObserver.disconnect();
|
|
409
|
+
}
|
|
410
|
+
_ui.globalEvents.off($xeList, 'resize');
|
|
411
|
+
},
|
|
412
|
+
render: function render(h) {
|
|
413
|
+
return this.renderVN(h);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],scrollY:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{scrollYLoad:!1,bodyHeight:0,rowHeight:0,topSpaceHeight:0,items:[]},internalData:{resizeObserver:void 0,fullData:[],lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0}}}},computed:Object.assign(Object.assign({},{}),{computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.scrollY,this.scrollY)},computeStyles:function(){var t=this.height,e=this.maxHeight,r={};return t?r.height="".concat(isNaN(t)?t:"".concat(t,"px")):e&&(r.height="auto",r.maxHeight="".concat(isNaN(e)?e:"".concat(e,"px"))),r}}),methods:{dispatchEvent:function(t,e,r){this.$emit(t,(0,_ui.createEvent)(r,{$list:this},e))},loadData:function(t){var e=this,r=e.reactData,i=e.internalData,a=i.scrollYStore,o=e.computeSYOpts,t=t||[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),i.fullData=t,r.scrollYLoad=!!o.enabled&&-1<o.gt&&(0===o.gt||o.gt<=t.length),e.handleData(),e.computeScrollLoad().then(function(){e.refreshScroll()})},reloadData:function(t){return this.clearScroll(),this.loadData(t)},updateYSpace:function(){var t=this.reactData,e=this.internalData,r=t.scrollYLoad,i=e.scrollYStore;t.bodyHeight=r?e.fullData.length*i.rowHeight:0,t.topSpaceHeight=r?Math.max(i.startIndex*i.rowHeight,0):0},handleData:function(){var t=this,e=t.reactData,r=t.internalData,i=e.scrollYLoad,a=r.fullData,r=r.scrollYStore;return e.items=i?a.slice(r.startIndex,r.endIndex):a.slice(0),t.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var l=this,n=l.reactData,s=l.internalData;return l.$nextTick().then(function(){var t,e=n.scrollYLoad,r=s.scrollYStore,i=l.$refs.refVirtualBody,a=l.computeSYOpts,o=0;(t=i?(t=a.sItem?i.querySelector(a.sItem):t)||i.children[0]:t)&&(o=t.offsetHeight),o=Math.max(20,o),r.rowHeight=o,e?(i=l.$refs.refVirtualWrapper,t=Math.max(8,Math.ceil(i.clientHeight/o)),e=a.oSize?_xeUtils.default.toNumber(a.oSize):_dom.browse.edge?10:0,r.offsetSize=e,r.visibleSize=t,r.endIndex=Math.max(r.startIndex,t+e,r.endIndex),l.updateYData()):l.updateYSpace(),n.rowHeight=o})},clearScroll:function(){var t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0),this.$nextTick()},scrollTo:function(t,e){var r=this,i=r.reactData,a=r.$refs.refVirtualWrapper;return _xeUtils.default.isNumber(t)&&(a.scrollLeft=t),_xeUtils.default.isNumber(e)&&(a.scrollTop=e),i.scrollYLoad?new Promise(function(t){setTimeout(function(){r.$nextTick(function(){t()})},50)}):r.$nextTick()},refreshScroll:function(){var t=this.internalData,e=t.lastScrollLeft,r=t.lastScrollTop;return this.clearScroll().then(function(){if(e||r)return t.lastScrollLeft=0,t.lastScrollTop=0,scrollTo(e,r)})},recalculate:function(){var t=this.$refs.refElem;return t.clientWidth&&t.clientHeight?this.computeScrollLoad():Promise.resolve()},loadYData:function(t){var e=this.internalData.scrollYStore,r=e.startIndex,i=e.endIndex,a=e.visibleSize,o=e.offsetSize,t=t.target.scrollTop,t=Math.floor(t/e.rowHeight),l=Math.max(0,t-1-o),o=t+a+o;!(t<=r||i-a-1<=t)||r===l&&i===o||(e.startIndex=l,e.endIndex=o,this.updateYData())},scrollEvent:function(t){var e=this.reactData,r=this.internalData,i=t.target,a=i.scrollTop,i=i.scrollLeft,o=i!==r.lastScrollLeft,l=a!==r.lastScrollTop;r.lastScrollTop=a,r.lastScrollLeft=i,e.scrollYLoad&&this.loadYData(t),this.dispatchEvent("scroll",{scrollLeft:i,scrollTop:a,isX:o,isY:l},t)},renderVN:function(t){var e=this,r=e.reactData,i=e.className,a=e.loading,o=r.bodyHeight,l=r.topSpaceHeight,r=r.items,n=e.$scopedSlots.default,s=e.computeSize,c=e.computeStyles;return t("div",{ref:"refElem",class:["vxe-list",i?_xeUtils.default.isFunction(i)?i({$list:e}):i:"",_defineProperty(_defineProperty({},"size--".concat(s),s),"is--loading",a)]},[t("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:c,on:{scroll:e.scrollEvent}},[t("div",{class:"vxe-list--y-space",style:{height:o?"".concat(o,"px"):""}}),t("div",{ref:"refVirtualBody",class:"vxe-list--body",style:{marginTop:l?"".concat(l,"px"):""}},n?n({items:r,$list:e}):[])]),t(_loading.default,{class:"vxe-list--loading",props:{value:a}})])}},watch:{data:function(){this.loadData(this.data||[])},syncResize:function(t){var e=this;t&&(e.recalculate(),e.$nextTick(function(){return setTimeout(function(){return e.recalculate()})}))}},created:function(){var t=this,e=t;_ui.globalEvents.on(t,"resize",function(){t.recalculate()}),t.loadData(e.data||[])},mounted:function(){var t,e,r=this,i=r.internalData;r.autoResize&&(t=r.$refs.refElem,(e=_ui.globalResize.create(function(){return r.recalculate()})).observe(t),i.resizeObserver=e)},activated:function(){var t=this;t.recalculate().then(function(){return t.refreshScroll()})},beforeDestroy:function(){var t=this.internalData.resizeObserver;t&&t.disconnect(),_ui.globalEvents.off(this,"resize")},render:function(t){return this.renderVN(t)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.vxe-list {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: var(--vxe-ui-font-color);
|
|
6
|
+
font-family: var(--vxe-ui-font-family);
|
|
7
|
+
direction: ltr;
|
|
8
|
+
}
|
|
9
|
+
.vxe-list .vxe-list--virtual-wrapper {
|
|
10
|
+
position: relative;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
outline: 0;
|
|
13
|
+
}
|
|
14
|
+
.vxe-list .vxe-list--y-space {
|
|
15
|
+
width: 0;
|
|
16
|
+
float: left;
|
|
17
|
+
}
|
|
18
|
+
.vxe-list .vxe-list--virtual-wrapper,
|
|
19
|
+
.vxe-list .vxe-list--body {
|
|
20
|
+
padding: 0;
|
|
21
|
+
margin: 0;
|
|
22
|
+
border: 0;
|
|
23
|
+
outline: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vxe-list--virtual-wrapper {
|
|
27
|
+
height: 100px;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vxe-list{position:relative;display:block;padding:0;color:var(--vxe-ui-font-color);font-family:var(--vxe-ui-font-family);direction:ltr}.vxe-list .vxe-list--virtual-wrapper{position:relative;overflow:auto;outline:0}.vxe-list .vxe-list--y-space{width:0;float:left}.vxe-list .vxe-list--body,.vxe-list .vxe-list--virtual-wrapper{padding:0;margin:0;border:0;outline:0}.vxe-list--virtual-wrapper{height:100px}
|
|
@@ -88,6 +88,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
88
88
|
$loading: $xeLoading
|
|
89
89
|
}, params));
|
|
90
90
|
},
|
|
91
|
+
emitModel: function emitModel(value) {
|
|
92
|
+
var $xeLoading = this;
|
|
93
|
+
$xeLoading.$emit('input', value);
|
|
94
|
+
$xeLoading.$emit('modelValue', value);
|
|
95
|
+
},
|
|
91
96
|
handleInit: function handleInit() {
|
|
92
97
|
var $xeLoading = this;
|
|
93
98
|
var reactData = $xeLoading.reactData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeLoading",mixins:[_ui.globalMixins.sizeMixin],props:{value:Boolean,icon:{type:String,default:function(){return(0,_ui.getConfig)().loading.icon}},showIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().loading.showIcon}},text:{type:String,default:function(){return(0,_ui.getConfig)().loading.text}},showText:{type:Boolean,default:function(){return(0,_ui.getConfig)().loading.showText}},status:String,size:{type:String,default:function(){return(0,_ui.getConfig)().loading.size||(0,_ui.getConfig)().size}}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1}}},computed:Object.assign(Object.assign({},{}),{computeLoadingIcon:function(){return this.icon||(0,_ui.getIcon)().LOADING},computeLoadingText:function(){var e=this.text;return _xeUtils.default.isString(e)?e:(0,_ui.getI18n)("vxe.loading.text")}}),watch:{value:function(){this.handleInit()}},methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$loading:this},t))},handleInit:function(){var e=this.reactData;e.initialized||(e.initialized=!!e.initialized)},renderVN:function(e){var t=this,i=t.$scopedSlots,n=t.value,o=t.showIcon,r=t.status,u=t.reactData.initialized,a=t.computeSize,l=i.default,c=i.text,i=i.icon,s=t.computeLoadingIcon,d=t.computeLoadingText;return u||n?e("div",{class:["vxe-loading",_defineProperty(_defineProperty(_defineProperty({},"size--".concat(a),a),"theme--".concat(r),r),"is--visible",n)]},l?[e("div",{class:"vxe-loading--wrapper"},(0,_vn.getSlotVNs)(l({})))]:[e("div",{class:"vxe-loading--chunk"},[o&&(i||s)?e("div",{class:"vxe-loading--icon"},i?(0,_vn.getSlotVNs)(i({})):[e("i",{class:s})]):e("div",{class:"vxe-loading--spinner"}),c||d?e("div",{class:"vxe-loading--text"},c?(0,_vn.getSlotVNs)(c({})):"".concat(d)):null])]):(0,_ui.renderEmptyElement)(t)}},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeLoading",mixins:[_ui.globalMixins.sizeMixin],props:{value:Boolean,icon:{type:String,default:function(){return(0,_ui.getConfig)().loading.icon}},showIcon:{type:Boolean,default:function(){return(0,_ui.getConfig)().loading.showIcon}},text:{type:String,default:function(){return(0,_ui.getConfig)().loading.text}},showText:{type:Boolean,default:function(){return(0,_ui.getConfig)().loading.showText}},status:String,size:{type:String,default:function(){return(0,_ui.getConfig)().loading.size||(0,_ui.getConfig)().size}}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1}}},computed:Object.assign(Object.assign({},{}),{computeLoadingIcon:function(){return this.icon||(0,_ui.getIcon)().LOADING},computeLoadingText:function(){var e=this.text;return _xeUtils.default.isString(e)?e:(0,_ui.getI18n)("vxe.loading.text")}}),watch:{value:function(){this.handleInit()}},methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$loading:this},t))},emitModel:function(e){this.$emit("input",e),this.$emit("modelValue",e)},handleInit:function(){var e=this.reactData;e.initialized||(e.initialized=!!e.initialized)},renderVN:function(e){var t=this,i=t.$scopedSlots,n=t.value,o=t.showIcon,r=t.status,u=t.reactData.initialized,a=t.computeSize,l=i.default,c=i.text,i=i.icon,s=t.computeLoadingIcon,d=t.computeLoadingText;return u||n?e("div",{class:["vxe-loading",_defineProperty(_defineProperty(_defineProperty({},"size--".concat(a),a),"theme--".concat(r),r),"is--visible",n)]},l?[e("div",{class:"vxe-loading--wrapper"},(0,_vn.getSlotVNs)(l({})))]:[e("div",{class:"vxe-loading--chunk"},[o&&(i||s)?e("div",{class:"vxe-loading--icon"},i?(0,_vn.getSlotVNs)(i({})):[e("i",{class:s})]):e("div",{class:"vxe-loading--spinner"}),c||d?e("div",{class:"vxe-loading--text"},c?(0,_vn.getSlotVNs)(c({})):"".concat(d)):null])]):(0,_ui.renderEmptyElement)(t)}},render:function(e){return this.renderVN(e)}});
|
package/lib/menu/src/menu.js
CHANGED
|
@@ -93,6 +93,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
93
93
|
$menu: $xeMenu
|
|
94
94
|
}, params));
|
|
95
95
|
},
|
|
96
|
+
emitModel: function emitModel(value) {
|
|
97
|
+
var $xeMenu = this;
|
|
98
|
+
$xeMenu.$emit('input', value);
|
|
99
|
+
$xeMenu.$emit('modelValue', value);
|
|
100
|
+
},
|
|
96
101
|
getMenuTitle: function getMenuTitle(item) {
|
|
97
102
|
return "".concat(item.title || item.name);
|
|
98
103
|
},
|
|
@@ -192,8 +197,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
192
197
|
if (routerLink) {
|
|
193
198
|
var value = item.itemKey;
|
|
194
199
|
reactData.activeName = value;
|
|
195
|
-
$xeMenu
|
|
196
|
-
$xeMenu.$emit('modelValue', value);
|
|
200
|
+
$xeMenu.emitModel(value);
|
|
197
201
|
} else {
|
|
198
202
|
if (hasChild) {
|
|
199
203
|
$xeMenu.handleClickIconCollapse(evnt, item);
|
package/lib/menu/src/menu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_index=_interopRequireDefault(require("../../loading/index"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,collapsed:{type:Boolean,default:null},loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return(0,_ui.getConfig)().image.size||(0,_ui.getConfig)().size}}},inject:{$xeLayoutAside:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{activeName:null,menuList:[],itemHeight:1}}},computed:Object.assign(Object.assign({},{}),{computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!e&&e.collapsed}}),watch:{value:function(e){this.reactData.activeName=e},options:function(){this.updateMenuConfig(),this.updateActiveMenu(!0)},"reactData.activeName":function(){this.updateActiveMenu(!0)}},methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$menu:this},t))},getMenuTitle:function(e){return"".concat(e.title||e.name)},updateItemHeight:function(){var e=this.reactData,t=this.$refs.refWrapperElem,t=t?t.children:[];t.length&&(e.itemHeight=t[0].offsetHeight)},getExpandChildSize:function(e){var t=this,i=0;return e.isExpand&&e.childList.forEach(function(e){i+=t.getExpandChildSize(e)+1}),i},updateStyle:function(){var t=this,i=t.reactData;_xeUtils.default.eachTree(i.menuList,function(e){e.hasChild&&e.isExpand?e.childHeight=t.getExpandChildSize(e)*i.itemHeight:e.childHeight=0},{children:"childList"})},updateActiveMenu:function(l){var e=this.reactData,
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_index=_interopRequireDefault(require("../../loading/index"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeMenu",mixins:[_ui.globalMixins.sizeMixin,_ui.globalMixins.permissionMixin],props:{value:[String,Number],expandAll:Boolean,collapsed:{type:Boolean,default:null},loading:Boolean,options:{type:Array,default:function(){return[]}},size:{type:String,default:function(){return(0,_ui.getConfig)().image.size||(0,_ui.getConfig)().size}}},inject:{$xeLayoutAside:{default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{activeName:null,menuList:[],itemHeight:1}}},computed:Object.assign(Object.assign({},{}),{computeIsCollapsed:function(){var e=this.$xeLayoutAside,t=this.collapsed;return _xeUtils.default.isBoolean(t)?t:!!e&&e.collapsed}}),watch:{value:function(e){this.reactData.activeName=e},options:function(){this.updateMenuConfig(),this.updateActiveMenu(!0)},"reactData.activeName":function(){this.updateActiveMenu(!0)}},methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$menu:this},t))},emitModel:function(e){this.$emit("input",e),this.$emit("modelValue",e)},getMenuTitle:function(e){return"".concat(e.title||e.name)},updateItemHeight:function(){var e=this.reactData,t=this.$refs.refWrapperElem,t=t?t.children:[];t.length&&(e.itemHeight=t[0].offsetHeight)},getExpandChildSize:function(e){var t=this,i=0;return e.isExpand&&e.childList.forEach(function(e){i+=t.getExpandChildSize(e)+1}),i},updateStyle:function(){var t=this,i=t.reactData;_xeUtils.default.eachTree(i.menuList,function(e){e.hasChild&&e.isExpand?e.childHeight=t.getExpandChildSize(e)*i.itemHeight:e.childHeight=0},{children:"childList"})},updateActiveMenu:function(l){var e=this.reactData,o=e.activeName;_xeUtils.default.eachTree(e.menuList,function(e,t,i,n,a,r){e.itemKey===o?(r.forEach(function(e){e.isActive=!0,l&&(e.isExpand=!0)}),e.isExactActive=!0):(e.isExactActive=!1,e.isActive=!1)},{children:"childList"})},updateMenuConfig:function(){var e=this.reactData,t=this.options,r=this.expandAll;e.menuList=_xeUtils.default.mapTree(t,function(e,t,i,n,a){return Object.assign(Object.assign({},e),{parentKey:a?a.name||n.slice(0,n.length-1).join(","):"",level:n.length,itemKey:e.name||n.join(","),isExactActive:!1,isActive:!1,isExpand:_xeUtils.default.isBoolean(e.expanded)?e.expanded:!!r,hasChild:e.children&&0<e.children.length,childHeight:0})},{children:"children",mapChildren:"childList"})},handleClickIconCollapse:function(e,t){var i=t.hasChild,n=t.isExpand;i&&(e.stopPropagation(),e.preventDefault(),t.isExpand=!n,this.updateItemHeight(),this.updateStyle())},handleClickMenu:function(e,t){var i=this.reactData,n=t.routerLink,a=t.hasChild;n?(n=t.itemKey,i.activeName=n,this.emitModel(n)):a&&this.handleClickIconCollapse(e,t),this.dispatchEvent("click",{menu:t},e)},renderMenuTitle:function(e,t){var i=this,n=t.icon,a=t.isExpand,r=t.hasChild,l=i.getMenuTitle(t);return[e("span",{class:"vxe-menu--item-link-icon"},n?[e("i",{class:n})]:[]),e("span",{class:"vxe-menu--item-link-title",attrs:{title:l}},l),r?e("span",{class:"vxe-menu--item-link-collapse",on:{click:function(e){i.handleClickIconCollapse(e,t)}}},[e("i",{class:a?(0,_ui.getIcon)().MENU_ITEM_EXPAND_OPEN:(0,_ui.getIcon)().MENU_ITEM_EXPAND_CLOSE})]):(0,_ui.renderEmptyElement)(i)]},renderChildren:function(t,i){var n=this,e=i.itemKey,a=i.level,r=i.hasChild,l=i.isActive,o=i.isExactActive,u=i.isExpand,s=i.routerLink,c=i.childList,d=n.computeIsCollapsed;return i.permissionCode&&!_ui.permission.checkVisible(i.permissionCode)?(0,_ui.renderEmptyElement)(n):t("div",{key:e,class:["vxe-menu--item-wrapper","vxe-menu--item-level".concat(a),{"is--exact-active":o,"is--active":l,"is--expand":!d&&u}]},[s?t("router-link",{class:"vxe-menu--item-link",props:{to:s},on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)):t("div",{class:"vxe-menu--item-link",on:{click:function(e){n.handleClickMenu(e,i)}}},n.renderMenuTitle(t,i)),r?t("div",{class:"vxe-menu--item-group",style:{}},c.map(function(e){return n.renderChildren(t,e)})):(0,_ui.renderEmptyElement)(n)])},renderVN:function(t){var i=this,e=i.reactData,n=i.loading,e=e.menuList,a=i.computeSize,r=i.computeIsCollapsed;return t("div",{ref:"refElem",class:["vxe-menu",_defineProperty(_defineProperty(_defineProperty({},"size--".concat(a),a),"is--collapsed",r),"is--loading",n)]},[t("div",{ref:"refWrapperElem",class:"vxe-menu--item-list"},e.map(function(e){return i.renderChildren(t,e)})),t(_index.default,{class:"vxe-list-view--loading",props:{value:n}})])}},mounted:function(){var e=this;this.$nextTick(function(){e.updateItemHeight()})},created:function(){this.reactData.activeName=this.value,this.updateMenuConfig(),this.updateActiveMenu(!0)},render:function(e){return this.renderVN(e)}});
|
package/lib/modal/src/modal.js
CHANGED
|
@@ -320,6 +320,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
320
320
|
$modal: $xeModal
|
|
321
321
|
}, params));
|
|
322
322
|
},
|
|
323
|
+
emitModel: function emitModel(value) {
|
|
324
|
+
var $xeModal = this;
|
|
325
|
+
$xeModal.$emit('input', value);
|
|
326
|
+
$xeModal.$emit('modelValue', value);
|
|
327
|
+
},
|
|
323
328
|
open: function open() {
|
|
324
329
|
var $xeModal = this;
|
|
325
330
|
return $xeModal.openModal();
|
|
@@ -506,8 +511,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
506
511
|
$xeModal.dispatchEvent('before-hide', params, null);
|
|
507
512
|
setTimeout(function () {
|
|
508
513
|
reactData.visible = false;
|
|
509
|
-
$xeModal
|
|
510
|
-
$xeModal.$emit('modelValue', false);
|
|
514
|
+
$xeModal.emitModel(false);
|
|
511
515
|
$xeModal.dispatchEvent('hide', params, null);
|
|
512
516
|
}, 200);
|
|
513
517
|
$xeModal.removeBodyLockScroll();
|
|
@@ -847,8 +851,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
847
851
|
var params = {
|
|
848
852
|
type: type
|
|
849
853
|
};
|
|
850
|
-
$xeModal
|
|
851
|
-
$xeModal.$emit('modelValue', true);
|
|
854
|
+
$xeModal.emitModel(true);
|
|
852
855
|
$xeModal.dispatchEvent('show', params, null);
|
|
853
856
|
});
|
|
854
857
|
}, 10);
|