vxe-gantt 3.0.0-beta.2 → 3.0.0-beta.4
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/es/gantt/src/gantt-view.js +63 -62
- package/es/gantt/src/gantt.js +11 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.js +10 -1
- package/lib/gantt/src/gantt-view.js +63 -62
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +12 -8
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +87 -71
- package/lib/index.umd.min.js +1 -1
- 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 +17 -1
- package/lib/ui/src/vn.min.js +1 -0
- package/package.json +1 -1
- package/packages/gantt/src/gantt-view.ts +71 -69
- package/packages/gantt/src/gantt.ts +15 -6
- package/packages/ui/src/vn.ts +13 -0
package/lib/ui/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _log = require("./src/log");
|
|
|
15
15
|
var setConfig = _core.VxeUI.setConfig,
|
|
16
16
|
setIcon = _core.VxeUI.setIcon,
|
|
17
17
|
checkVersion = _core.VxeUI.checkVersion;
|
|
18
|
-
_core.VxeUI.ganttVersion = "3.0.0-beta.
|
|
18
|
+
_core.VxeUI.ganttVersion = "3.0.0-beta.4";
|
|
19
19
|
setConfig({
|
|
20
20
|
gantt: {
|
|
21
21
|
// size: null,
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.default=void 0;var _core=require("@vxe-ui/core"),_log=require("./src/log"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,checkVersion=_core.VxeUI.checkVersion,iconPrefix=(_core.VxeUI.ganttVersion="3.0.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.default=void 0;var _core=require("@vxe-ui/core"),_log=require("./src/log"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,checkVersion=_core.VxeUI.checkVersion,iconPrefix=(_core.VxeUI.ganttVersion="3.0.0-beta.4",setConfig({gantt:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:null,result:"result",total:"page.total",message:"message"}},taskSplitConfig:{enabled:!0,resize:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0}}}),"vxe-icon-"),_default=(setIcon({GANTT_VIEW_LEFT_OPEN:iconPrefix+"arrow-left",GANTT_VIEW_LEFT_CLOSE:iconPrefix+"arrow-right",GANTT_VIEW_RIGHT_OPEN:iconPrefix+"arrow-right",GANTT_VIEW_RIGHT_CLOSE:iconPrefix+"arrow-left"}),checkVersion(_core.VxeUI.tableVersion,3,18)||(0,_log.errLog)("vxe.error.errorVersion",["vxe-table@".concat(_core.VxeUI.tableVersion||"?"),"vxe-table v3.18+"]),exports.default=_core.VxeUI);
|
package/lib/ui/src/log.js
CHANGED
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.warnLog = exports.errLog = void 0;
|
|
7
7
|
var _core = require("@vxe-ui/core");
|
|
8
8
|
var log = _core.VxeUI.log;
|
|
9
|
-
var version = "gantt v".concat("3.0.0-beta.
|
|
9
|
+
var version = "gantt v".concat("3.0.0-beta.4");
|
|
10
10
|
var warnLog = exports.warnLog = log.create('warn', version);
|
|
11
11
|
var errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),log=_core.VxeUI.log,version="gantt v".concat("3.0.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),log=_core.VxeUI.log,version="gantt v".concat("3.0.0-beta.4"),warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/lib/ui/src/vn.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSlotVNs = getSlotVNs;
|
|
7
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function getSlotVNs(vns) {
|
|
10
|
+
if (vns === null || vns === undefined) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
if (_xeUtils.default.isArray(vns)) {
|
|
14
|
+
return vns;
|
|
15
|
+
}
|
|
16
|
+
return [vns];
|
|
17
|
+
}
|
package/lib/ui/src/vn.min.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSlotVNs=getSlotVNs;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getSlotVNs(e){return null==e?[]:_xeUtils.default.isArray(e)?e:[e]}
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ function createInternalData (): GanttViewInternalData {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const maxYHeight = 5e6
|
|
45
|
-
const maxXWidth = 5e6
|
|
45
|
+
// const maxXWidth = 5e6
|
|
46
46
|
|
|
47
47
|
function handleParseColumn ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
48
48
|
const $xeGantt = $xeGanttView.$xeGantt
|
|
@@ -361,61 +361,61 @@ function handleLazyRecalculate ($xeGanttView: VxeGanttViewConstructor & VxeGantt
|
|
|
361
361
|
return $xeGanttView.$nextTick()
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
function updateScrollXSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
364
|
+
// function updateScrollXSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
365
|
+
// const reactData = $xeGanttView.reactData
|
|
366
|
+
// const internalData = $xeGanttView.internalData
|
|
367
|
+
|
|
368
|
+
// const { scrollXLoad, scrollXWidth } = reactData
|
|
369
|
+
// const { elemStore } = internalData
|
|
370
|
+
// const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
371
|
+
// const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
372
|
+
|
|
373
|
+
// let xSpaceLeft = 0
|
|
374
|
+
|
|
375
|
+
// let clientWidth = 0
|
|
376
|
+
// if (bodyScrollElem) {
|
|
377
|
+
// clientWidth = bodyScrollElem.clientWidth
|
|
378
|
+
// }
|
|
379
|
+
// // 虚拟渲染
|
|
380
|
+
// let isScrollXBig = false
|
|
381
|
+
// let ySpaceWidth = scrollXWidth
|
|
382
|
+
// if (scrollXWidth > maxXWidth) {
|
|
383
|
+
// // 触右
|
|
384
|
+
// if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
|
|
385
|
+
// xSpaceLeft = maxXWidth - bodyTableElem.clientWidth
|
|
386
|
+
// } else {
|
|
387
|
+
// xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth))
|
|
388
|
+
// }
|
|
389
|
+
// ySpaceWidth = maxXWidth
|
|
390
|
+
// isScrollXBig = true
|
|
391
|
+
// }
|
|
392
|
+
|
|
393
|
+
// if (bodyTableElem) {
|
|
394
|
+
// bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
|
|
395
|
+
// }
|
|
396
|
+
|
|
397
|
+
// const layoutList = ['header', 'body', 'footer']
|
|
398
|
+
// layoutList.forEach(layout => {
|
|
399
|
+
// const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
|
|
400
|
+
// if (xSpaceElem) {
|
|
401
|
+
// xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : ''
|
|
402
|
+
// }
|
|
403
|
+
// })
|
|
404
|
+
|
|
405
|
+
// reactData.scrollXLeft = xSpaceLeft
|
|
406
|
+
// reactData.scrollXWidth = ySpaceWidth
|
|
407
|
+
// reactData.isScrollXBig = isScrollXBig
|
|
408
|
+
|
|
409
|
+
// const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem as HTMLDivElement
|
|
410
|
+
// if (scrollXSpaceEl) {
|
|
411
|
+
// scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
412
|
+
// }
|
|
413
|
+
|
|
414
|
+
// calcScrollbar($xeGanttView)
|
|
415
|
+
// return $xeGanttView.$nextTick().then(() => {
|
|
416
|
+
// updateStyle($xeGanttView)
|
|
417
|
+
// })
|
|
418
|
+
// }
|
|
419
419
|
|
|
420
420
|
function updateScrollYSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
421
421
|
const reactData = $xeGanttView.reactData
|
|
@@ -457,17 +457,18 @@ function updateScrollYSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttVie
|
|
|
457
457
|
scrollYTop = 0
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
const bodyChartWrapperElem = getRefElem(elemStore['main-chart-wrapper'])
|
|
460
461
|
if (bodyTableElem) {
|
|
461
462
|
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
|
|
462
463
|
}
|
|
464
|
+
if (bodyChartWrapperElem) {
|
|
465
|
+
bodyChartWrapperElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
|
|
466
|
+
}
|
|
463
467
|
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
ySpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
469
|
-
}
|
|
470
|
-
})
|
|
468
|
+
const bodyYSpaceElem = getRefElem(elemStore['main-body-ySpace'])
|
|
469
|
+
if (bodyYSpaceElem) {
|
|
470
|
+
bodyYSpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
471
|
+
}
|
|
471
472
|
|
|
472
473
|
const scrollYSpaceEl = $xeGanttView.$refs.refScrollYSpaceElem as HTMLDivElement
|
|
473
474
|
if (scrollYSpaceEl) {
|
|
@@ -552,9 +553,9 @@ export default defineVxeComponent({
|
|
|
552
553
|
// 是否启用了纵向 Y 可视渲染方式加载
|
|
553
554
|
scrollYLoad: false,
|
|
554
555
|
// 是否存在纵向滚动条
|
|
555
|
-
overflowY:
|
|
556
|
+
overflowY: true,
|
|
556
557
|
// 是否存在横向滚动条
|
|
557
|
-
overflowX:
|
|
558
|
+
overflowX: true,
|
|
558
559
|
// 纵向滚动条的宽度
|
|
559
560
|
scrollbarWidth: 0,
|
|
560
561
|
// 横向滚动条的高度
|
|
@@ -789,15 +790,16 @@ export default defineVxeComponent({
|
|
|
789
790
|
handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, currTopNum, wrapperEl.scrollLeft)
|
|
790
791
|
}
|
|
791
792
|
},
|
|
792
|
-
|
|
793
|
+
updateScrollYSpace () {
|
|
793
794
|
const $xeGanttView = this
|
|
794
795
|
|
|
795
|
-
return
|
|
796
|
+
return updateScrollYSpace($xeGanttView)
|
|
796
797
|
},
|
|
797
|
-
|
|
798
|
+
updateScrollYStatus (sYLoad: boolean) {
|
|
798
799
|
const $xeGanttView = this
|
|
800
|
+
const reactData = $xeGanttView.reactData
|
|
799
801
|
|
|
800
|
-
|
|
802
|
+
reactData.scrollYLoad = sYLoad
|
|
801
803
|
},
|
|
802
804
|
handleGlobalResizeEvent () {
|
|
803
805
|
const $xeGanttView = this
|
|
@@ -4,15 +4,16 @@ import { VxeUI } from '@vxe-ui/core'
|
|
|
4
4
|
import XEUtils from 'xe-utils'
|
|
5
5
|
import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils'
|
|
6
6
|
import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit, addClass, removeClass } from '../../ui/src/dom'
|
|
7
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
7
8
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
8
9
|
import GanttViewComponent from './gantt-view'
|
|
9
10
|
import { VxeTable as VxeTableComponent } from 'vxe-table'
|
|
10
11
|
|
|
11
12
|
import type { ValueOf, VxeFormInstance, VxeFormItemProps, VxePagerInstance, VxePagerDefines, VxeComponentStyleType, VxeComponentSizeType, VxeFormDefines, VxeFormItemPropTypes } from 'vxe-pc-ui'
|
|
12
13
|
import type { VxeTableMethods, VxeToolbarPropTypes, VxeTableProps, VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeToolbarInstance, TableInternalData, VxeTablePropTypes, VxeGridPropTypes } from 'vxe-table'
|
|
13
|
-
import type { VxeGanttEmits, GanttReactData, GanttInternalData, VxeGanttPropTypes, VxeGanttViewInstance, VxeGanttDefines } from '../../../types'
|
|
14
|
+
import type { VxeGanttEmits, GanttReactData, GanttInternalData, VxeGanttPropTypes, VxeGanttViewInstance, VxeGanttDefines, VxeGanttConstructor } from '../../../types'
|
|
14
15
|
|
|
15
|
-
const { getConfig, getIcon, getI18n, commands, globalMixins, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement
|
|
16
|
+
const { getConfig, getIcon, getI18n, commands, globalMixins, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI
|
|
16
17
|
|
|
17
18
|
const tableProps = (VxeTableComponent as any).props
|
|
18
19
|
|
|
@@ -21,12 +22,18 @@ const propKeys = Object.keys(tableProps) as (keyof VxeTableProps)[]
|
|
|
21
22
|
|
|
22
23
|
const defaultLayouts: VxeGanttPropTypes.Layouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']]
|
|
23
24
|
|
|
24
|
-
function getTableOns (
|
|
25
|
-
const
|
|
25
|
+
function getTableOns ($xeGantt: VxeGanttConstructor) {
|
|
26
|
+
const _vm = $xeGantt as any
|
|
27
|
+
const $listeners = _vm.$listeners
|
|
28
|
+
|
|
29
|
+
const props = $xeGantt
|
|
30
|
+
|
|
31
|
+
const { proxyConfig } = props
|
|
32
|
+
const proxyOpts = $xeGantt.computeProxyOpts
|
|
26
33
|
const ons: any = {}
|
|
27
34
|
XEUtils.each($listeners, (cb: any, type: any) => {
|
|
28
35
|
ons[type] = (...args: any[]) => {
|
|
29
|
-
|
|
36
|
+
$xeGantt.$emit(type, ...args)
|
|
30
37
|
}
|
|
31
38
|
})
|
|
32
39
|
if (proxyConfig) {
|
|
@@ -100,8 +107,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
100
107
|
},
|
|
101
108
|
provide () {
|
|
102
109
|
const $xeGantt = this
|
|
110
|
+
const $xeGrid = null
|
|
103
111
|
|
|
104
112
|
return {
|
|
113
|
+
$xeGrid,
|
|
105
114
|
$xeGantt
|
|
106
115
|
}
|
|
107
116
|
},
|
|
@@ -1794,7 +1803,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1794
1803
|
h(VxeTableComponent as Component, {
|
|
1795
1804
|
key: 'table',
|
|
1796
1805
|
props: tableProps,
|
|
1797
|
-
on: getTableOns($xeGantt),
|
|
1806
|
+
on: getTableOns($xeGantt as VxeGanttConstructor),
|
|
1798
1807
|
scopedSlots: slots,
|
|
1799
1808
|
ref: 'refTable'
|
|
1800
1809
|
})
|
package/packages/ui/src/vn.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
import type { VxeComponentSlotType } from '../../../types'
|
|
4
|
+
|
|
5
|
+
export function getSlotVNs (vns: VxeComponentSlotType | VxeComponentSlotType[] | undefined) {
|
|
6
|
+
if (vns === null || vns === undefined) {
|
|
7
|
+
return []
|
|
8
|
+
}
|
|
9
|
+
if (XEUtils.isArray(vns)) {
|
|
10
|
+
return vns
|
|
11
|
+
}
|
|
12
|
+
return [vns]
|
|
13
|
+
}
|