@dfsj/components 3.1.0 → 3.1.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/CHANGELOG.md +21 -3
- package/dist/components/Boards/index.d.ts +2 -2
- package/dist/components/Boards/src/Boards.vue.d.ts +21 -0
- package/dist/components/Boards/src/Boards.vue2.js +132 -31
- package/dist/components/Boards/src/props.d.ts +20 -0
- package/dist/components/Boards/src/props.js +19 -1
- package/dist/components/Editor/src/Editor.vue2.js +2 -3
- package/dist/components/Form/src/Form.vue2.js +16 -4
- package/dist/components/Modal/src/BasicModal.vue.d.ts +37 -2
- package/dist/components/Modal/src/BasicModal.vue2.js +11 -11
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +9 -0
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +17 -10
- package/dist/components/Modal/src/hooks/useModalDrag.js +2 -7
- package/dist/components/Modal/src/props.d.ts +18 -1
- package/dist/components/Modal/src/props.js +4 -0
- package/dist/components/Modal/src/utils/index.js +2 -2
- package/dist/components/NodeAxis/index.d.ts +6 -0
- package/dist/components/NodeAxis/src/AbstractNodeProvider.d.ts +15 -0
- package/dist/components/NodeAxis/src/AbstractNodeProvider.js +23 -0
- package/dist/components/NodeAxis/src/BCanvasNodeRender.d.ts +19 -0
- package/dist/components/NodeAxis/src/CanvasNodeRender.d.ts +28 -0
- package/dist/components/NodeAxis/src/CanvasNodeRender.js +400 -0
- package/dist/components/NodeAxis/src/NodeAxis.d.ts +12 -0
- package/dist/components/NodeAxis/src/NodeAxis.vue.d.ts +17 -0
- package/dist/components/NodeAxis/src/NodeAxis.vue.js +5 -0
- package/dist/components/NodeAxis/src/NodeAxis.vue2.js +68 -0
- package/dist/components/NodeAxis/src/NodeModel.d.ts +24 -0
- package/dist/components/NodeAxis/src/NodeModel.js +64 -0
- package/dist/components/NodeAxis/src/NodeProvider.d.ts +15 -0
- package/dist/components/NodeAxis/src/NodeRender.d.ts +17 -0
- package/dist/components/NodeAxis/src/NodeRender.js +30 -0
- package/dist/components/NodeAxis/src/NullLayerProvider.d.ts +23 -0
- package/dist/components/NodeAxis/src/NullLayerProvider.js +88 -0
- package/dist/components/NodeAxis/src/NullProvider.d.ts +17 -0
- package/dist/components/NodeAxis/src/NullProvider.js +67 -0
- package/dist/components/NodeAxis/src/TimerNodePlayer.d.ts +19 -0
- package/dist/components/NodeAxis/src/TimerNodePlayer.js +150 -0
- package/dist/components/NodeAxis/src/config/node-axis.options.d.ts +54 -0
- package/dist/components/NodeAxis/src/config/node-axis.options.js +56 -0
- package/dist/components/NodeAxis/src/enum/index.d.ts +15 -0
- package/dist/components/NodeAxis/src/enum/index.js +20 -0
- package/dist/components/NodeAxis/src/interface/NodePlayer.d.ts +9 -0
- package/dist/components/NodeAxis/src/interface/NodeProvider.d.ts +15 -0
- package/dist/components/NodeAxis/src/utils/assign.d.ts +1 -0
- package/dist/components/NodeAxis/src/utils/assign.js +43 -0
- package/dist/components/Stateful/src/Stateful.vue2.js +15 -8
- package/dist/components/Visual/index.d.ts +3 -0
- package/dist/components/Visual/src/BufferLayerPlayer.d.ts +27 -0
- package/dist/components/Visual/src/BufferLayerPlayer.js +293 -0
- package/dist/components/Visual/src/ResolvableLayerProvider.d.ts +36 -0
- package/dist/components/Visual/src/ResolvableLayerProvider.js +255 -0
- package/dist/components/Visual/src/config/default.manager.d.ts +6 -0
- package/dist/components/Visual/src/config/default.manager.js +7 -0
- package/dist/components/Visual/src/config/default.provider.d.ts +17 -0
- package/dist/components/Visual/src/config/default.provider.js +18 -0
- package/dist/components/Visual/src/interface/Disposable.d.ts +3 -0
- package/dist/components/Visual/src/interface/LayerFactory.d.ts +5 -0
- package/dist/components/Visual/src/interface/LayerManager.d.ts +8 -0
- package/dist/components/Visual/src/interface/LayerPlayer.d.ts +10 -0
- package/dist/components/Visual/src/interface/LayerProvider.d.ts +7 -0
- package/dist/components/Visual/src/interface/LayerResolver.d.ts +13 -0
- package/dist/components/Visual/src/mapping.d.ts +5 -0
- package/dist/components/Visual/src/mapping.js +7 -0
- package/dist/components/Visual/src/resolvers/IntervalResolver.d.ts +30 -0
- package/dist/components/Visual/src/resolvers/IntervalResolver.js +170 -0
- package/dist/components/Visual/src/resolvers/tools.resolver.d.ts +4 -0
- package/dist/components/Visual/src/resolvers/tools.resolver.js +145 -0
- package/dist/components/Visual/src/utils/NodeMath.d.ts +13 -0
- package/dist/components/Visual/src/utils/NodeMath.js +101 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/dist/index.min.css +3 -3
- package/dist/node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js +175 -4
- package/dist/node_modules/.pnpm/@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js +8 -2
- package/package.json +7 -5
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var render = {
|
|
2
|
+
background: null,
|
|
3
|
+
width: 360,
|
|
4
|
+
height: 45,
|
|
5
|
+
jump: true,
|
|
6
|
+
draggable: true,
|
|
7
|
+
translation: true,
|
|
8
|
+
edgeAdjust: "50%",
|
|
9
|
+
overlay: {
|
|
10
|
+
enabled: true,
|
|
11
|
+
empty: "暂无数据..."
|
|
12
|
+
},
|
|
13
|
+
track: {
|
|
14
|
+
left: 10,
|
|
15
|
+
top: "50%",
|
|
16
|
+
right: 10,
|
|
17
|
+
height: 7,
|
|
18
|
+
color: "rgba(233,233,233,0.7)"
|
|
19
|
+
},
|
|
20
|
+
node: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
size: 10,
|
|
23
|
+
count: 7,
|
|
24
|
+
minCount: 3,
|
|
25
|
+
color: "#fff",
|
|
26
|
+
outlineWidth: 0.5,
|
|
27
|
+
outlineColor: "#1ab7ff",
|
|
28
|
+
shadow: ""
|
|
29
|
+
},
|
|
30
|
+
cursor: {
|
|
31
|
+
size: 15,
|
|
32
|
+
color: "#1ab7ff",
|
|
33
|
+
outlineWidth: 0.5,
|
|
34
|
+
outlineColor: "#027BE3"
|
|
35
|
+
},
|
|
36
|
+
scale: {
|
|
37
|
+
enabled: false,
|
|
38
|
+
limit: [0, 100]
|
|
39
|
+
},
|
|
40
|
+
progress: {
|
|
41
|
+
enabled: true,
|
|
42
|
+
color: "rgba(66,63,68,0.6)"
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
enabled: true,
|
|
46
|
+
top: "75%",
|
|
47
|
+
font: "14px blob arial",
|
|
48
|
+
color: "#333"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var play = {
|
|
52
|
+
interval: 1500,
|
|
53
|
+
loop: false
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { play, render };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum Extensible {
|
|
2
|
+
NONE = 0,
|
|
3
|
+
HEAD = 1,
|
|
4
|
+
TAIL = 2,
|
|
5
|
+
ALL = 3
|
|
6
|
+
}
|
|
7
|
+
export declare enum Direction {
|
|
8
|
+
FORWARD = 1,
|
|
9
|
+
BACKWARD = -1
|
|
10
|
+
}
|
|
11
|
+
export declare enum TimeModes {
|
|
12
|
+
DAILY = "daily",
|
|
13
|
+
INTERVAL = "interval",
|
|
14
|
+
STATISTIC = "statistic"
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var Extensible;
|
|
2
|
+
(function (Extensible) {
|
|
3
|
+
Extensible[Extensible["NONE"] = 0] = "NONE";
|
|
4
|
+
Extensible[Extensible["HEAD"] = 1] = "HEAD";
|
|
5
|
+
Extensible[Extensible["TAIL"] = 2] = "TAIL";
|
|
6
|
+
Extensible[Extensible["ALL"] = 3] = "ALL";
|
|
7
|
+
})(Extensible || (Extensible = {}));
|
|
8
|
+
var Direction;
|
|
9
|
+
(function (Direction) {
|
|
10
|
+
Direction[Direction["FORWARD"] = 1] = "FORWARD";
|
|
11
|
+
Direction[Direction["BACKWARD"] = -1] = "BACKWARD";
|
|
12
|
+
})(Direction || (Direction = {}));
|
|
13
|
+
var TimeModes;
|
|
14
|
+
(function (TimeModes) {
|
|
15
|
+
TimeModes["DAILY"] = "daily";
|
|
16
|
+
TimeModes["INTERVAL"] = "interval";
|
|
17
|
+
TimeModes["STATISTIC"] = "statistic";
|
|
18
|
+
})(TimeModes || (TimeModes = {}));
|
|
19
|
+
|
|
20
|
+
export { Direction, Extensible, TimeModes };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default class NodeProvider {
|
|
2
|
+
get extent(): any;
|
|
3
|
+
get count(): any;
|
|
4
|
+
get sections(): any;
|
|
5
|
+
get extensible(): any;
|
|
6
|
+
color(index: any): void;
|
|
7
|
+
extract(range: any, split: any, nodes: any): void;
|
|
8
|
+
scale(offset: any, range: any, length: any, direction: any): void;
|
|
9
|
+
format(index: any, type: any): void;
|
|
10
|
+
yield(): void;
|
|
11
|
+
activate(action: any): void;
|
|
12
|
+
extends(direction: any, minimum: any): void;
|
|
13
|
+
reset(): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assign(target: any | any[], ...sources: any): any | any[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _typeof from '@babel/runtime/helpers/typeof';
|
|
2
|
+
|
|
3
|
+
function ordinary(object) {
|
|
4
|
+
if (_typeof(object) !== 'object' || object === null) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
if (Object.getPrototypeOf(object) === null) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
var proto = object;
|
|
11
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
12
|
+
proto = Object.getPrototypeOf(proto);
|
|
13
|
+
}
|
|
14
|
+
return Object.getPrototypeOf(object) === proto;
|
|
15
|
+
}
|
|
16
|
+
function clone(target, source) {
|
|
17
|
+
for (var key in source) {
|
|
18
|
+
var older = target[key],
|
|
19
|
+
newer = source[key];
|
|
20
|
+
if (older === newer && newer != null) continue;
|
|
21
|
+
if (newer && ordinary(newer)) {
|
|
22
|
+
target[key] = clone(ordinary(older) ? older : {}, newer);
|
|
23
|
+
} else if (newer && Array.isArray(newer)) {
|
|
24
|
+
target[key] = clone(Array.isArray(older) ? older : [], newer);
|
|
25
|
+
} else {
|
|
26
|
+
target[key] = newer;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
}
|
|
31
|
+
function assign(target) {
|
|
32
|
+
if (target == null) {
|
|
33
|
+
return target;
|
|
34
|
+
}
|
|
35
|
+
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
36
|
+
sources[_key - 1] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
return sources.reduce(function (last, source) {
|
|
39
|
+
return clone(last, source);
|
|
40
|
+
}, target);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { assign as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createCommentVNode } from 'vue';
|
|
2
2
|
import { isObject } from '../../../utils/is.js';
|
|
3
3
|
import '../../Icon/src/Icon.vue.js';
|
|
4
4
|
import { statefulProps } from './props.js';
|
|
@@ -25,20 +25,27 @@ var script = defineComponent({
|
|
|
25
25
|
}
|
|
26
26
|
return props.value ? props.states[props.value] : null;
|
|
27
27
|
});
|
|
28
|
+
var getStyle = computed(function () {
|
|
29
|
+
var _state$value;
|
|
30
|
+
return {
|
|
31
|
+
color: (_state$value = state.value) === null || _state$value === void 0 ? void 0 : _state$value.color
|
|
32
|
+
};
|
|
33
|
+
});
|
|
28
34
|
return function (_ctx, _cache) {
|
|
29
|
-
var _state$
|
|
35
|
+
var _state$value2, _state$value3, _state$value4, _state$value5, _state$value6, _state$value7;
|
|
30
36
|
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
31
37
|
"class": normalizeClass(["stateful--content h-full w-full", [_ctx.contentClass, {
|
|
32
38
|
cover: !!state.value
|
|
33
39
|
}]])
|
|
34
|
-
}, [renderSlot(_ctx.$slots, "default")], 2), state.value ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [(openBlock(), createBlock(resolveDynamicComponent(((_state$
|
|
40
|
+
}, [renderSlot(_ctx.$slots, "default")], 2), state.value ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [(openBlock(), createBlock(resolveDynamicComponent(((_state$value2 = state.value) === null || _state$value2 === void 0 ? void 0 : _state$value2.tag) == 'Icon' ? script$1 : (_state$value3 = state.value) === null || _state$value3 === void 0 ? void 0 : _state$value3.tag), {
|
|
35
41
|
"class": "cover--icon",
|
|
36
|
-
icon: (_state$
|
|
37
|
-
color: (_state$
|
|
38
|
-
size: ((_state$
|
|
42
|
+
icon: (_state$value4 = state.value) === null || _state$value4 === void 0 ? void 0 : _state$value4.image,
|
|
43
|
+
color: (_state$value5 = state.value) === null || _state$value5 === void 0 ? void 0 : _state$value5.color,
|
|
44
|
+
size: ((_state$value6 = state.value) === null || _state$value6 === void 0 ? void 0 : _state$value6.size) || '28'
|
|
39
45
|
}, null, 8, ["icon", "color", "size"])), createElementVNode("div", {
|
|
40
|
-
"class":
|
|
41
|
-
|
|
46
|
+
"class": "cover--text",
|
|
47
|
+
style: normalizeStyle(getStyle.value)
|
|
48
|
+
}, toDisplayString((_state$value7 = state.value) === null || _state$value7 === void 0 ? void 0 : _state$value7.label), 5)])])) : createCommentVNode("v-if", true)]);
|
|
42
49
|
};
|
|
43
50
|
}
|
|
44
51
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Layer } from "./types";
|
|
2
|
+
import LayerPlayer from "./interface/LayerPlayer";
|
|
3
|
+
import LayerProvider from "./interface/LayerProvider";
|
|
4
|
+
import { Visual } from "./types";
|
|
5
|
+
import LayerManager from "./interface/LayerManager";
|
|
6
|
+
export default class BufferLayerPlayer implements LayerPlayer {
|
|
7
|
+
protected manager: LayerManager;
|
|
8
|
+
protected provider: LayerProvider;
|
|
9
|
+
protected options: any;
|
|
10
|
+
protected queue: Layer[];
|
|
11
|
+
protected index: number;
|
|
12
|
+
protected cursor: number;
|
|
13
|
+
protected center: number;
|
|
14
|
+
protected last: Layer;
|
|
15
|
+
constructor(manager: LayerManager, provider: LayerProvider, options?: Visual.PlayerOptions);
|
|
16
|
+
backward(): Promise<void>;
|
|
17
|
+
forward(): Promise<void>;
|
|
18
|
+
jump(index: any): void;
|
|
19
|
+
visible(value: boolean): Promise<void>;
|
|
20
|
+
status(index: any): string;
|
|
21
|
+
update(index: any): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
protected get(index: any): Promise<Layer>;
|
|
25
|
+
protected ready(index: any): Promise<void>;
|
|
26
|
+
protected render(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
2
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
3
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
4
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
|
+
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
+
import def from './config/default.manager.js';
|
|
7
|
+
|
|
8
|
+
var BufferLayerPlayer = /*#__PURE__*/function () {
|
|
9
|
+
function BufferLayerPlayer(manager, provider, options) {
|
|
10
|
+
_classCallCheck(this, BufferLayerPlayer);
|
|
11
|
+
_defineProperty(this, "manager", void 0);
|
|
12
|
+
_defineProperty(this, "provider", void 0);
|
|
13
|
+
_defineProperty(this, "options", void 0);
|
|
14
|
+
_defineProperty(this, "queue", []);
|
|
15
|
+
_defineProperty(this, "index", 0);
|
|
16
|
+
_defineProperty(this, "cursor", 0);
|
|
17
|
+
_defineProperty(this, "center", 0);
|
|
18
|
+
_defineProperty(this, "last", null);
|
|
19
|
+
this.manager = manager;
|
|
20
|
+
this.provider = provider;
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.options = Object.assign({}, def, options);
|
|
23
|
+
this.manager.remove(this.queue);
|
|
24
|
+
this.queue.length = 0;
|
|
25
|
+
}
|
|
26
|
+
_createClass(BufferLayerPlayer, [{
|
|
27
|
+
key: "backward",
|
|
28
|
+
value: function () {
|
|
29
|
+
var _backward = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
30
|
+
var index, cursor;
|
|
31
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
index = this.index;
|
|
35
|
+
cursor = this.cursor;
|
|
36
|
+
if (!(index === 0 && cursor === 0)) {
|
|
37
|
+
_context.next = 4;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
return _context.abrupt("return");
|
|
41
|
+
case 4:
|
|
42
|
+
if (!(index === 0 || cursor > this.center)) {
|
|
43
|
+
_context.next = 8;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
this.cursor--;
|
|
47
|
+
_context.next = 16;
|
|
48
|
+
break;
|
|
49
|
+
case 8:
|
|
50
|
+
_context.t0 = this.queue;
|
|
51
|
+
_context.next = 11;
|
|
52
|
+
return this.get(--this.index);
|
|
53
|
+
case 11:
|
|
54
|
+
_context.t1 = _context.sent;
|
|
55
|
+
_context.t0.splice.call(_context.t0, 0, 0, _context.t1);
|
|
56
|
+
_context.next = 15;
|
|
57
|
+
return this.manager.addition(this.queue[0]);
|
|
58
|
+
case 15:
|
|
59
|
+
if (this.queue.length > this.options.buffer) {
|
|
60
|
+
this.manager.remove(this.queue.pop());
|
|
61
|
+
}
|
|
62
|
+
case 16:
|
|
63
|
+
this.render();
|
|
64
|
+
case 17:
|
|
65
|
+
case "end":
|
|
66
|
+
return _context.stop();
|
|
67
|
+
}
|
|
68
|
+
}, _callee, this);
|
|
69
|
+
}));
|
|
70
|
+
function backward() {
|
|
71
|
+
return _backward.apply(this, arguments);
|
|
72
|
+
}
|
|
73
|
+
return backward;
|
|
74
|
+
}()
|
|
75
|
+
}, {
|
|
76
|
+
key: "forward",
|
|
77
|
+
value: function () {
|
|
78
|
+
var _forward = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
79
|
+
var size, index, count;
|
|
80
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
81
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
size = this.queue.length;
|
|
84
|
+
index = this.index;
|
|
85
|
+
count = this.provider.count;
|
|
86
|
+
if (!(index + size >= count && this.cursor >= size)) {
|
|
87
|
+
_context2.next = 5;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
return _context2.abrupt("return");
|
|
91
|
+
case 5:
|
|
92
|
+
if (!(this.cursor < this.center || index + size >= count)) {
|
|
93
|
+
_context2.next = 9;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
this.cursor++;
|
|
97
|
+
_context2.next = 17;
|
|
98
|
+
break;
|
|
99
|
+
case 9:
|
|
100
|
+
_context2.t0 = this.queue;
|
|
101
|
+
_context2.next = 12;
|
|
102
|
+
return this.get(size + this.index++);
|
|
103
|
+
case 12:
|
|
104
|
+
_context2.t1 = _context2.sent;
|
|
105
|
+
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
106
|
+
_context2.next = 16;
|
|
107
|
+
return this.manager.addition(this.queue[this.queue.length - 1]);
|
|
108
|
+
case 16:
|
|
109
|
+
this.manager.remove(this.queue.shift());
|
|
110
|
+
case 17:
|
|
111
|
+
this.render();
|
|
112
|
+
case 18:
|
|
113
|
+
case "end":
|
|
114
|
+
return _context2.stop();
|
|
115
|
+
}
|
|
116
|
+
}, _callee2, this);
|
|
117
|
+
}));
|
|
118
|
+
function forward() {
|
|
119
|
+
return _forward.apply(this, arguments);
|
|
120
|
+
}
|
|
121
|
+
return forward;
|
|
122
|
+
}()
|
|
123
|
+
}, {
|
|
124
|
+
key: "jump",
|
|
125
|
+
value: function jump(index) {
|
|
126
|
+
var size = this.queue.length;
|
|
127
|
+
if (size === 0) {
|
|
128
|
+
this.ready(index);
|
|
129
|
+
} else if (index - this.index === -1) {
|
|
130
|
+
this.backward();
|
|
131
|
+
} else if (index - (this.index + this.cursor) === 1) {
|
|
132
|
+
this.forward();
|
|
133
|
+
} else if (index - this.index === size) {
|
|
134
|
+
this.forward();
|
|
135
|
+
} else if (index >= this.index && index < this.index + size) {
|
|
136
|
+
this.cursor = index - this.index;
|
|
137
|
+
this.render();
|
|
138
|
+
} else {
|
|
139
|
+
this.clear();
|
|
140
|
+
this.ready(index);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "visible",
|
|
145
|
+
value: function () {
|
|
146
|
+
var _visible = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(value) {
|
|
147
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
148
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
149
|
+
case 0:
|
|
150
|
+
if (value === false) {
|
|
151
|
+
this.manager.remove(this.queue);
|
|
152
|
+
}
|
|
153
|
+
if (!(value === true)) {
|
|
154
|
+
_context3.next = 4;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
_context3.next = 4;
|
|
158
|
+
return this.manager.addition(this.queue);
|
|
159
|
+
case 4:
|
|
160
|
+
case "end":
|
|
161
|
+
return _context3.stop();
|
|
162
|
+
}
|
|
163
|
+
}, _callee3, this);
|
|
164
|
+
}));
|
|
165
|
+
function visible(_x) {
|
|
166
|
+
return _visible.apply(this, arguments);
|
|
167
|
+
}
|
|
168
|
+
return visible;
|
|
169
|
+
}()
|
|
170
|
+
}, {
|
|
171
|
+
key: "status",
|
|
172
|
+
value: function status(index) {
|
|
173
|
+
return this.manager.query(this.queue[index + this.cursor], "status");
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "update",
|
|
177
|
+
value: function update(index) {
|
|
178
|
+
this.manager.remove(this.queue);
|
|
179
|
+
this.queue.length = 0;
|
|
180
|
+
this.ready(index || this.index);
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "clear",
|
|
184
|
+
value: function clear() {
|
|
185
|
+
this.manager.remove(this.queue);
|
|
186
|
+
this.queue.length = 0;
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "dispose",
|
|
190
|
+
value: function dispose() {
|
|
191
|
+
this.clear();
|
|
192
|
+
this.queue = null;
|
|
193
|
+
this.options = null;
|
|
194
|
+
this.manager = null;
|
|
195
|
+
this.provider = null;
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "get",
|
|
199
|
+
value: function () {
|
|
200
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(index) {
|
|
201
|
+
var _this$provider, _this$manager, _this$manager2, _this$manager3;
|
|
202
|
+
var layer, opacity;
|
|
203
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
204
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
_context4.next = 2;
|
|
207
|
+
return (_this$provider = this.provider) === null || _this$provider === void 0 ? void 0 : _this$provider.get(index);
|
|
208
|
+
case 2:
|
|
209
|
+
layer = _context4.sent;
|
|
210
|
+
opacity = (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.query(layer, "opacity");
|
|
211
|
+
(_this$manager2 = this.manager) === null || _this$manager2 === void 0 || _this$manager2.modify(layer, "$opacity", opacity);
|
|
212
|
+
(_this$manager3 = this.manager) === null || _this$manager3 === void 0 || _this$manager3.modify(layer, "opacity", 0);
|
|
213
|
+
return _context4.abrupt("return", layer);
|
|
214
|
+
case 7:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context4.stop();
|
|
217
|
+
}
|
|
218
|
+
}, _callee4, this);
|
|
219
|
+
}));
|
|
220
|
+
function get(_x2) {
|
|
221
|
+
return _get.apply(this, arguments);
|
|
222
|
+
}
|
|
223
|
+
return get;
|
|
224
|
+
}()
|
|
225
|
+
}, {
|
|
226
|
+
key: "ready",
|
|
227
|
+
value: function () {
|
|
228
|
+
var _ready = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(index) {
|
|
229
|
+
var _this$queue2, _this$manager4;
|
|
230
|
+
var max, i, _this$queue;
|
|
231
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
232
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
233
|
+
case 0:
|
|
234
|
+
max = Math.min(this.provider.count, index + this.options.buffer);
|
|
235
|
+
i = index;
|
|
236
|
+
case 2:
|
|
237
|
+
if (!(i < max)) {
|
|
238
|
+
_context5.next = 13;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
_context5.t0 = (_this$queue = this.queue) === null || _this$queue === void 0;
|
|
242
|
+
if (_context5.t0) {
|
|
243
|
+
_context5.next = 10;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
_context5.t1 = _this$queue;
|
|
247
|
+
_context5.next = 8;
|
|
248
|
+
return this.get(i);
|
|
249
|
+
case 8:
|
|
250
|
+
_context5.t2 = _context5.sent;
|
|
251
|
+
_context5.t1.push.call(_context5.t1, _context5.t2);
|
|
252
|
+
case 10:
|
|
253
|
+
i++;
|
|
254
|
+
_context5.next = 2;
|
|
255
|
+
break;
|
|
256
|
+
case 13:
|
|
257
|
+
this.index = index;
|
|
258
|
+
this.cursor = 0;
|
|
259
|
+
this.center = ((_this$queue2 = this.queue) === null || _this$queue2 === void 0 ? void 0 : _this$queue2.length) >> 1;
|
|
260
|
+
_context5.next = 18;
|
|
261
|
+
return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.addition(this.queue);
|
|
262
|
+
case 18:
|
|
263
|
+
this.render();
|
|
264
|
+
case 19:
|
|
265
|
+
case "end":
|
|
266
|
+
return _context5.stop();
|
|
267
|
+
}
|
|
268
|
+
}, _callee5, this);
|
|
269
|
+
}));
|
|
270
|
+
function ready(_x3) {
|
|
271
|
+
return _ready.apply(this, arguments);
|
|
272
|
+
}
|
|
273
|
+
return ready;
|
|
274
|
+
}()
|
|
275
|
+
}, {
|
|
276
|
+
key: "render",
|
|
277
|
+
value: function render() {
|
|
278
|
+
var queue = this.queue;
|
|
279
|
+
var cursor = this.cursor;
|
|
280
|
+
if (this.last && this.last !== queue[cursor]) {
|
|
281
|
+
this.manager.modify(this.last, "opacity", 0);
|
|
282
|
+
}
|
|
283
|
+
if (!queue || (queue === null || queue === void 0 ? void 0 : queue.length) <= 0) return;
|
|
284
|
+
if ((this.last = queue[cursor]) != null) {
|
|
285
|
+
var opacity = this.manager.query(queue[cursor], "$opacity");
|
|
286
|
+
this.manager.modify(queue[cursor], "opacity", opacity);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}]);
|
|
290
|
+
return BufferLayerPlayer;
|
|
291
|
+
}();
|
|
292
|
+
|
|
293
|
+
export { BufferLayerPlayer as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import AbstractNodeProvider from "../../NodeAxis/src/AbstractNodeProvider";
|
|
2
|
+
import { NodeAxis } from "../../NodeAxis/src/types";
|
|
3
|
+
import { Layer } from "./types";
|
|
4
|
+
import LayerFactory from "./interface/LayerFactory";
|
|
5
|
+
import LayerResolver from "./interface/LayerResolver";
|
|
6
|
+
import { Visual } from "./types";
|
|
7
|
+
export default class ResolvableLayerProvider extends AbstractNodeProvider {
|
|
8
|
+
protected factory: LayerFactory;
|
|
9
|
+
protected interceptor: Function;
|
|
10
|
+
protected config: any;
|
|
11
|
+
protected cache: any[];
|
|
12
|
+
protected total: number;
|
|
13
|
+
protected marks: NodeAxis.Section[];
|
|
14
|
+
protected init: NodeAxis.Extent;
|
|
15
|
+
protected back: NodeAxis.Extent;
|
|
16
|
+
protected options: any;
|
|
17
|
+
protected extended: number;
|
|
18
|
+
protected nodes: LayerResolver[];
|
|
19
|
+
constructor(factory: LayerFactory, data: any, injection: any, interceptor?: Function, config?: any);
|
|
20
|
+
protected read(options: any, injection: any): void;
|
|
21
|
+
protected findNode(index: any, accept?: any[]): any[];
|
|
22
|
+
protected makeSections(): void;
|
|
23
|
+
get(index: number): Promise<Layer>;
|
|
24
|
+
getNodeInfo(index: number): Visual.NodeInfo;
|
|
25
|
+
get extent(): NodeAxis.Extent;
|
|
26
|
+
get count(): number;
|
|
27
|
+
get sections(): NodeAxis.Section[];
|
|
28
|
+
get extensible(): number;
|
|
29
|
+
color(index: number): string;
|
|
30
|
+
format(index: number, type: NodeAxis.Format): string;
|
|
31
|
+
formatByInject(index: number, type: NodeAxis.Format, finalFormat: string): string;
|
|
32
|
+
find(query: Visual.Condition): number;
|
|
33
|
+
extends(direction: number, minimum: number): Promise<number> | number;
|
|
34
|
+
reset(): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|