@wcardinal/wcardinal-ui 0.207.0 → 0.209.1
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/dist/types/wcardinal/ui/shape/e-shape-data-mapper-impl.d.ts +2 -8
- package/dist/types/wcardinal/ui/shape/e-shape-data-mapper.d.ts +1 -1
- package/dist/wcardinal/ui/shape/e-shape-data-mapper-impl.js +50 -84
- package/dist/wcardinal/ui/shape/e-shape-data-mapper-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-data-mapper.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +53 -87
- package/dist/wcardinal-ui.js +53 -87
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { EShapeDataMapper } from "./e-shape-data-mapper";
|
|
2
2
|
import { EShapeDataValue } from "./e-shape-data-value";
|
|
3
3
|
export declare class EShapeDataMapperImpl implements EShapeDataMapper {
|
|
4
|
-
protected static SEPARATOR: string;
|
|
5
4
|
protected static WILDCARD: string;
|
|
5
|
+
protected static SPANS: number[];
|
|
6
6
|
protected _sources: string[] | null;
|
|
7
|
-
protected _sourceIndices: number[];
|
|
8
|
-
protected _targetIndices: number[];
|
|
9
|
-
protected _targetIndicesLength: number;
|
|
10
7
|
constructor(source?: string | null);
|
|
11
|
-
map(value: EShapeDataValue, destinations: string[] | null, initial: string):
|
|
8
|
+
map(value: EShapeDataValue, destinations: string[] | null, initial: string): boolean;
|
|
12
9
|
protected newSources(source?: string | null): string[] | null;
|
|
13
|
-
protected newValueId(destinations: string[], target: string, targetIndices: number[]): string | null;
|
|
14
|
-
protected calcTargetIndices(target: string): void;
|
|
15
|
-
protected newSourceIndices(sources: string[] | null): number[];
|
|
16
10
|
static split(target?: string | null): string[] | null;
|
|
17
11
|
}
|
|
@@ -3,5 +3,5 @@ import { EShapeDataValue } from "./e-shape-data-value";
|
|
|
3
3
|
* An EShape data mapper.
|
|
4
4
|
*/
|
|
5
5
|
export interface EShapeDataMapper {
|
|
6
|
-
map(target: EShapeDataValue, destination: string[] | null, initial: string):
|
|
6
|
+
map(target: EShapeDataValue, destination: string[] | null, initial: string): boolean;
|
|
7
7
|
}
|
|
@@ -4,118 +4,84 @@
|
|
|
4
4
|
*/
|
|
5
5
|
var EShapeDataMapperImpl = /** @class */ (function () {
|
|
6
6
|
function EShapeDataMapperImpl(source) {
|
|
7
|
-
|
|
8
|
-
this._sources = sources;
|
|
9
|
-
this._sourceIndices = this.newSourceIndices(sources);
|
|
10
|
-
this._targetIndices = [];
|
|
11
|
-
this._targetIndicesLength = 0;
|
|
7
|
+
this._sources = this.newSources(source);
|
|
12
8
|
}
|
|
13
9
|
EShapeDataMapperImpl.prototype.map = function (value, destinations, initial) {
|
|
14
10
|
var sources = this._sources;
|
|
15
11
|
if (sources == null) {
|
|
16
|
-
return;
|
|
12
|
+
return false;
|
|
17
13
|
}
|
|
18
14
|
var valueId = value.id;
|
|
19
15
|
var target = valueId.toLowerCase();
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (sourcesLength + 1 !== targetIndicesLength) {
|
|
25
|
-
return;
|
|
16
|
+
var first = sources[0];
|
|
17
|
+
var firstLength = first.length;
|
|
18
|
+
if (firstLength !== 0 && target.indexOf(first) !== 0) {
|
|
19
|
+
return false;
|
|
26
20
|
}
|
|
27
|
-
|
|
21
|
+
var spans = EShapeDataMapperImpl.SPANS;
|
|
22
|
+
spans[0] = 0;
|
|
23
|
+
spans[1] = firstLength;
|
|
24
|
+
var sourcesLength = sources.length;
|
|
25
|
+
var targetLength = target.length;
|
|
26
|
+
for (var i = 1; i < sourcesLength; ++i) {
|
|
27
|
+
var ispan = i << 1;
|
|
28
28
|
var source = sources[i];
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var sourceLength = source.length;
|
|
30
|
+
if (sourceLength === 0) {
|
|
31
|
+
spans[ispan] = targetLength;
|
|
32
|
+
spans[ispan + 1] = targetLength;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
var index = target.indexOf(source, spans[ispan - 1]);
|
|
36
|
+
if (index < 0) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
spans[ispan] = index;
|
|
40
|
+
spans[ispan + 1] = index + sourceLength;
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
|
-
//
|
|
43
|
+
// Update the ID
|
|
37
44
|
if (destinations != null) {
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
var destinationsLength = destinations.length;
|
|
46
|
+
var id = "";
|
|
47
|
+
for (var i = 0, imax = sourcesLength; i < imax; ++i) {
|
|
48
|
+
var id0 = i < destinationsLength ? destinations[i] : sources[i];
|
|
49
|
+
var ispan = i << 1;
|
|
50
|
+
var s0 = spans[ispan + 1];
|
|
51
|
+
var s1 = spans[ispan + 2];
|
|
52
|
+
var id1 = target.substring(s0, i + 1 < imax ? s1 : targetLength);
|
|
53
|
+
id += id0 + id1;
|
|
41
54
|
}
|
|
55
|
+
value.id = id;
|
|
42
56
|
}
|
|
43
|
-
//
|
|
57
|
+
// Update the initial value
|
|
44
58
|
if (0 < initial.length) {
|
|
45
59
|
value.initial = initial;
|
|
46
60
|
}
|
|
61
|
+
return true;
|
|
47
62
|
};
|
|
48
63
|
EShapeDataMapperImpl.prototype.newSources = function (source) {
|
|
49
|
-
if (source == null
|
|
64
|
+
if (source == null) {
|
|
50
65
|
return null;
|
|
51
66
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var result = "";
|
|
56
|
-
var delimiter = "";
|
|
57
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
58
|
-
var separator = EShapeDataMapperImpl.SEPARATOR;
|
|
59
|
-
var sourceIndices = this._sourceIndices;
|
|
60
|
-
var sourceIndicesLength = sourceIndices.length;
|
|
61
|
-
var index = sourceIndicesLength;
|
|
62
|
-
for (var i = 0, imax = destinations.length; i < imax; ++i) {
|
|
63
|
-
var d = destinations[imax - 1 - i];
|
|
64
|
-
if (d === wildcard) {
|
|
65
|
-
index -= 1;
|
|
66
|
-
if (0 <= index) {
|
|
67
|
-
var sourceIndex = sourceIndices[index];
|
|
68
|
-
var targetIndex0 = targetIndices[sourceIndex];
|
|
69
|
-
var targetIndex1 = targetIndices[sourceIndex + 1];
|
|
70
|
-
result = target.substring(targetIndex0 + 1, targetIndex1) + delimiter + result;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
result = d + delimiter + result;
|
|
78
|
-
}
|
|
79
|
-
delimiter = separator;
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
|
-
EShapeDataMapperImpl.prototype.calcTargetIndices = function (target) {
|
|
84
|
-
var targetIndices = this._targetIndices;
|
|
85
|
-
var size = 1;
|
|
86
|
-
targetIndices[0] = -1;
|
|
87
|
-
var index0 = -1;
|
|
88
|
-
var index1 = -1;
|
|
89
|
-
while (0 <= (index1 = target.indexOf(EShapeDataMapperImpl.SEPARATOR, index0 + 1))) {
|
|
90
|
-
targetIndices[size] = index1;
|
|
91
|
-
index0 = index1;
|
|
92
|
-
size += 1;
|
|
93
|
-
}
|
|
94
|
-
targetIndices[size] = target.length;
|
|
95
|
-
size += 1;
|
|
96
|
-
this._targetIndicesLength = size;
|
|
97
|
-
};
|
|
98
|
-
EShapeDataMapperImpl.prototype.newSourceIndices = function (sources) {
|
|
99
|
-
var result = [];
|
|
100
|
-
if (sources != null) {
|
|
101
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
102
|
-
for (var i = 0, imax = sources.length; i < imax; ++i) {
|
|
103
|
-
var s = sources[i];
|
|
104
|
-
if (s === wildcard) {
|
|
105
|
-
result.push(i);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
67
|
+
var trimmed = source.trim();
|
|
68
|
+
if (trimmed.length <= 0) {
|
|
69
|
+
return null;
|
|
108
70
|
}
|
|
109
|
-
return
|
|
71
|
+
return trimmed.toLowerCase().split(EShapeDataMapperImpl.WILDCARD);
|
|
110
72
|
};
|
|
111
73
|
EShapeDataMapperImpl.split = function (target) {
|
|
112
|
-
if (target == null
|
|
74
|
+
if (target == null) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
var trimmed = target.trim();
|
|
78
|
+
if (trimmed.length <= 0) {
|
|
113
79
|
return null;
|
|
114
80
|
}
|
|
115
|
-
return
|
|
81
|
+
return trimmed.split(this.WILDCARD);
|
|
116
82
|
};
|
|
117
|
-
EShapeDataMapperImpl.SEPARATOR = ".";
|
|
118
83
|
EShapeDataMapperImpl.WILDCARD = "*";
|
|
84
|
+
EShapeDataMapperImpl.SPANS = [];
|
|
119
85
|
return EShapeDataMapperImpl;
|
|
120
86
|
}());
|
|
121
87
|
export { EShapeDataMapperImpl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-data-mapper-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-mapper-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;
|
|
1
|
+
{"version":3,"file":"e-shape-data-mapper-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-mapper-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;IAKC,8BAAY,MAAsB;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,kCAAG,GA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O,IAAI,CAAC;SACZ;QACD,IAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;IAEa,0BAAK,GAAnB,UAAoB,MAAsB;QACzC,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,OAAO,IAAI,CAAC;SACZ;QACD,IAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;IAtFgB,6BAAQ,GAAG,GAAG,CAAC;IACf,0BAAK,GAAa,EAAE,CAAC;IAsFvC,2BAAC;CAAA,AAxFD,IAwFC;SAxFY,oBAAoB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeDataMapper } from \"./e-shape-data-mapper\";\nimport { EShapeDataValue } from \"./e-shape-data-value\";\n\nexport class EShapeDataMapperImpl implements EShapeDataMapper {\n\tprotected static WILDCARD = \"*\";\n\tprotected static SPANS: number[] = [];\n\tprotected _sources: string[] | null;\n\n\tconstructor(source?: string | null) {\n\t\tthis._sources = this.newSources(source);\n\t}\n\n\tmap(value: EShapeDataValue, destinations: string[] | null, initial: string): boolean {\n\t\tconst sources = this._sources;\n\t\tif (sources == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst valueId = value.id;\n\t\tconst target = valueId.toLowerCase();\n\t\tconst first = sources[0];\n\t\tconst firstLength = first.length;\n\t\tif (firstLength !== 0 && target.indexOf(first) !== 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst spans = EShapeDataMapperImpl.SPANS;\n\t\tspans[0] = 0;\n\t\tspans[1] = firstLength;\n\t\tconst sourcesLength = sources.length;\n\t\tconst targetLength = target.length;\n\t\tfor (let i = 1; i < sourcesLength; ++i) {\n\t\t\tconst ispan = i << 1;\n\t\t\tconst source = sources[i];\n\t\t\tconst sourceLength = source.length;\n\t\t\tif (sourceLength === 0) {\n\t\t\t\tspans[ispan] = targetLength;\n\t\t\t\tspans[ispan + 1] = targetLength;\n\t\t\t} else {\n\t\t\t\tconst index = target.indexOf(source, spans[ispan - 1]);\n\t\t\t\tif (index < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tspans[ispan] = index;\n\t\t\t\tspans[ispan + 1] = index + sourceLength;\n\t\t\t}\n\t\t}\n\n\t\t// Update the ID\n\t\tif (destinations != null) {\n\t\t\tconst destinationsLength = destinations.length;\n\t\t\tlet id = \"\";\n\t\t\tfor (let i = 0, imax = sourcesLength; i < imax; ++i) {\n\t\t\t\tconst id0 = i < destinationsLength ? destinations[i] : sources[i];\n\t\t\t\tconst ispan = i << 1;\n\t\t\t\tconst s0 = spans[ispan + 1];\n\t\t\t\tconst s1 = spans[ispan + 2];\n\t\t\t\tconst id1 = target.substring(s0, i + 1 < imax ? s1 : targetLength);\n\t\t\t\tid += id0 + id1;\n\t\t\t}\n\t\t\tvalue.id = id;\n\t\t}\n\n\t\t// Update the initial value\n\t\tif (0 < initial.length) {\n\t\t\tvalue.initial = initial;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected newSources(source?: string | null): string[] | null {\n\t\tif (source == null) {\n\t\t\treturn null;\n\t\t}\n\t\tconst trimmed = source.trim();\n\t\tif (trimmed.length <= 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn trimmed.toLowerCase().split(EShapeDataMapperImpl.WILDCARD);\n\t}\n\n\tpublic static split(target?: string | null): string[] | null {\n\t\tif (target == null) {\n\t\t\treturn null;\n\t\t}\n\t\tconst trimmed = target.trim();\n\t\tif (trimmed.length <= 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn trimmed.split(this.WILDCARD);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-data-mapper.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeDataValue } from \"./e-shape-data-value\";\n\n/**\n * An EShape data mapper.\n */\nexport interface EShapeDataMapper {\n\tmap(target: EShapeDataValue, destination: string[] | null, initial: string):
|
|
1
|
+
{"version":3,"file":"e-shape-data-mapper.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-data-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeDataValue } from \"./e-shape-data-value\";\n\n/**\n * An EShape data mapper.\n */\nexport interface EShapeDataMapper {\n\tmap(target: EShapeDataValue, destination: string[] | null, initial: string): boolean;\n}\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.209.1
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -15523,118 +15523,84 @@ var DDiagramBaseControllerOpenType = {
|
|
|
15523
15523
|
*/
|
|
15524
15524
|
var EShapeDataMapperImpl = /** @class */ (function () {
|
|
15525
15525
|
function EShapeDataMapperImpl(source) {
|
|
15526
|
-
|
|
15527
|
-
this._sources = sources;
|
|
15528
|
-
this._sourceIndices = this.newSourceIndices(sources);
|
|
15529
|
-
this._targetIndices = [];
|
|
15530
|
-
this._targetIndicesLength = 0;
|
|
15526
|
+
this._sources = this.newSources(source);
|
|
15531
15527
|
}
|
|
15532
15528
|
EShapeDataMapperImpl.prototype.map = function (value, destinations, initial) {
|
|
15533
15529
|
var sources = this._sources;
|
|
15534
15530
|
if (sources == null) {
|
|
15535
|
-
return;
|
|
15531
|
+
return false;
|
|
15536
15532
|
}
|
|
15537
15533
|
var valueId = value.id;
|
|
15538
15534
|
var target = valueId.toLowerCase();
|
|
15539
|
-
|
|
15540
|
-
var
|
|
15541
|
-
|
|
15542
|
-
|
|
15543
|
-
if (sourcesLength + 1 !== targetIndicesLength) {
|
|
15544
|
-
return;
|
|
15535
|
+
var first = sources[0];
|
|
15536
|
+
var firstLength = first.length;
|
|
15537
|
+
if (firstLength !== 0 && target.indexOf(first) !== 0) {
|
|
15538
|
+
return false;
|
|
15545
15539
|
}
|
|
15546
|
-
|
|
15540
|
+
var spans = EShapeDataMapperImpl.SPANS;
|
|
15541
|
+
spans[0] = 0;
|
|
15542
|
+
spans[1] = firstLength;
|
|
15543
|
+
var sourcesLength = sources.length;
|
|
15544
|
+
var targetLength = target.length;
|
|
15545
|
+
for (var i = 1; i < sourcesLength; ++i) {
|
|
15546
|
+
var ispan = i << 1;
|
|
15547
15547
|
var source = sources[i];
|
|
15548
|
-
var
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
return;
|
|
15548
|
+
var sourceLength = source.length;
|
|
15549
|
+
if (sourceLength === 0) {
|
|
15550
|
+
spans[ispan] = targetLength;
|
|
15551
|
+
spans[ispan + 1] = targetLength;
|
|
15553
15552
|
}
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15553
|
+
else {
|
|
15554
|
+
var index = target.indexOf(source, spans[ispan - 1]);
|
|
15555
|
+
if (index < 0) {
|
|
15556
|
+
return false;
|
|
15557
|
+
}
|
|
15558
|
+
spans[ispan] = index;
|
|
15559
|
+
spans[ispan + 1] = index + sourceLength;
|
|
15560
15560
|
}
|
|
15561
15561
|
}
|
|
15562
|
-
//
|
|
15562
|
+
// Update the ID
|
|
15563
|
+
if (destinations != null) {
|
|
15564
|
+
var destinationsLength = destinations.length;
|
|
15565
|
+
var id = "";
|
|
15566
|
+
for (var i = 0, imax = sourcesLength; i < imax; ++i) {
|
|
15567
|
+
var id0 = i < destinationsLength ? destinations[i] : sources[i];
|
|
15568
|
+
var ispan = i << 1;
|
|
15569
|
+
var s0 = spans[ispan + 1];
|
|
15570
|
+
var s1 = spans[ispan + 2];
|
|
15571
|
+
var id1 = target.substring(s0, i + 1 < imax ? s1 : targetLength);
|
|
15572
|
+
id += id0 + id1;
|
|
15573
|
+
}
|
|
15574
|
+
value.id = id;
|
|
15575
|
+
}
|
|
15576
|
+
// Update the initial value
|
|
15563
15577
|
if (0 < initial.length) {
|
|
15564
15578
|
value.initial = initial;
|
|
15565
15579
|
}
|
|
15580
|
+
return true;
|
|
15566
15581
|
};
|
|
15567
15582
|
EShapeDataMapperImpl.prototype.newSources = function (source) {
|
|
15568
|
-
if (source == null
|
|
15583
|
+
if (source == null) {
|
|
15569
15584
|
return null;
|
|
15570
15585
|
}
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
var result = "";
|
|
15575
|
-
var delimiter = "";
|
|
15576
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
15577
|
-
var separator = EShapeDataMapperImpl.SEPARATOR;
|
|
15578
|
-
var sourceIndices = this._sourceIndices;
|
|
15579
|
-
var sourceIndicesLength = sourceIndices.length;
|
|
15580
|
-
var index = sourceIndicesLength;
|
|
15581
|
-
for (var i = 0, imax = destinations.length; i < imax; ++i) {
|
|
15582
|
-
var d = destinations[imax - 1 - i];
|
|
15583
|
-
if (d === wildcard) {
|
|
15584
|
-
index -= 1;
|
|
15585
|
-
if (0 <= index) {
|
|
15586
|
-
var sourceIndex = sourceIndices[index];
|
|
15587
|
-
var targetIndex0 = targetIndices[sourceIndex];
|
|
15588
|
-
var targetIndex1 = targetIndices[sourceIndex + 1];
|
|
15589
|
-
result = target.substring(targetIndex0 + 1, targetIndex1) + delimiter + result;
|
|
15590
|
-
}
|
|
15591
|
-
else {
|
|
15592
|
-
return null;
|
|
15593
|
-
}
|
|
15594
|
-
}
|
|
15595
|
-
else {
|
|
15596
|
-
result = d + delimiter + result;
|
|
15597
|
-
}
|
|
15598
|
-
delimiter = separator;
|
|
15599
|
-
}
|
|
15600
|
-
return result;
|
|
15601
|
-
};
|
|
15602
|
-
EShapeDataMapperImpl.prototype.calcTargetIndices = function (target) {
|
|
15603
|
-
var targetIndices = this._targetIndices;
|
|
15604
|
-
var size = 1;
|
|
15605
|
-
targetIndices[0] = -1;
|
|
15606
|
-
var index0 = -1;
|
|
15607
|
-
var index1 = -1;
|
|
15608
|
-
while (0 <= (index1 = target.indexOf(EShapeDataMapperImpl.SEPARATOR, index0 + 1))) {
|
|
15609
|
-
targetIndices[size] = index1;
|
|
15610
|
-
index0 = index1;
|
|
15611
|
-
size += 1;
|
|
15612
|
-
}
|
|
15613
|
-
targetIndices[size] = target.length;
|
|
15614
|
-
size += 1;
|
|
15615
|
-
this._targetIndicesLength = size;
|
|
15616
|
-
};
|
|
15617
|
-
EShapeDataMapperImpl.prototype.newSourceIndices = function (sources) {
|
|
15618
|
-
var result = [];
|
|
15619
|
-
if (sources != null) {
|
|
15620
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
15621
|
-
for (var i = 0, imax = sources.length; i < imax; ++i) {
|
|
15622
|
-
var s = sources[i];
|
|
15623
|
-
if (s === wildcard) {
|
|
15624
|
-
result.push(i);
|
|
15625
|
-
}
|
|
15626
|
-
}
|
|
15586
|
+
var trimmed = source.trim();
|
|
15587
|
+
if (trimmed.length <= 0) {
|
|
15588
|
+
return null;
|
|
15627
15589
|
}
|
|
15628
|
-
return
|
|
15590
|
+
return trimmed.toLowerCase().split(EShapeDataMapperImpl.WILDCARD);
|
|
15629
15591
|
};
|
|
15630
15592
|
EShapeDataMapperImpl.split = function (target) {
|
|
15631
|
-
if (target == null
|
|
15593
|
+
if (target == null) {
|
|
15594
|
+
return null;
|
|
15595
|
+
}
|
|
15596
|
+
var trimmed = target.trim();
|
|
15597
|
+
if (trimmed.length <= 0) {
|
|
15632
15598
|
return null;
|
|
15633
15599
|
}
|
|
15634
|
-
return
|
|
15600
|
+
return trimmed.split(this.WILDCARD);
|
|
15635
15601
|
};
|
|
15636
|
-
EShapeDataMapperImpl.SEPARATOR = ".";
|
|
15637
15602
|
EShapeDataMapperImpl.WILDCARD = "*";
|
|
15603
|
+
EShapeDataMapperImpl.SPANS = [];
|
|
15638
15604
|
return EShapeDataMapperImpl;
|
|
15639
15605
|
}());
|
|
15640
15606
|
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.209.1
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -15520,118 +15520,84 @@
|
|
|
15520
15520
|
*/
|
|
15521
15521
|
var EShapeDataMapperImpl = /** @class */ (function () {
|
|
15522
15522
|
function EShapeDataMapperImpl(source) {
|
|
15523
|
-
|
|
15524
|
-
this._sources = sources;
|
|
15525
|
-
this._sourceIndices = this.newSourceIndices(sources);
|
|
15526
|
-
this._targetIndices = [];
|
|
15527
|
-
this._targetIndicesLength = 0;
|
|
15523
|
+
this._sources = this.newSources(source);
|
|
15528
15524
|
}
|
|
15529
15525
|
EShapeDataMapperImpl.prototype.map = function (value, destinations, initial) {
|
|
15530
15526
|
var sources = this._sources;
|
|
15531
15527
|
if (sources == null) {
|
|
15532
|
-
return;
|
|
15528
|
+
return false;
|
|
15533
15529
|
}
|
|
15534
15530
|
var valueId = value.id;
|
|
15535
15531
|
var target = valueId.toLowerCase();
|
|
15536
|
-
|
|
15537
|
-
var
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
if (sourcesLength + 1 !== targetIndicesLength) {
|
|
15541
|
-
return;
|
|
15532
|
+
var first = sources[0];
|
|
15533
|
+
var firstLength = first.length;
|
|
15534
|
+
if (firstLength !== 0 && target.indexOf(first) !== 0) {
|
|
15535
|
+
return false;
|
|
15542
15536
|
}
|
|
15543
|
-
|
|
15537
|
+
var spans = EShapeDataMapperImpl.SPANS;
|
|
15538
|
+
spans[0] = 0;
|
|
15539
|
+
spans[1] = firstLength;
|
|
15540
|
+
var sourcesLength = sources.length;
|
|
15541
|
+
var targetLength = target.length;
|
|
15542
|
+
for (var i = 1; i < sourcesLength; ++i) {
|
|
15543
|
+
var ispan = i << 1;
|
|
15544
15544
|
var source = sources[i];
|
|
15545
|
-
var
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
return;
|
|
15545
|
+
var sourceLength = source.length;
|
|
15546
|
+
if (sourceLength === 0) {
|
|
15547
|
+
spans[ispan] = targetLength;
|
|
15548
|
+
spans[ispan + 1] = targetLength;
|
|
15550
15549
|
}
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15550
|
+
else {
|
|
15551
|
+
var index = target.indexOf(source, spans[ispan - 1]);
|
|
15552
|
+
if (index < 0) {
|
|
15553
|
+
return false;
|
|
15554
|
+
}
|
|
15555
|
+
spans[ispan] = index;
|
|
15556
|
+
spans[ispan + 1] = index + sourceLength;
|
|
15557
15557
|
}
|
|
15558
15558
|
}
|
|
15559
|
-
//
|
|
15559
|
+
// Update the ID
|
|
15560
|
+
if (destinations != null) {
|
|
15561
|
+
var destinationsLength = destinations.length;
|
|
15562
|
+
var id = "";
|
|
15563
|
+
for (var i = 0, imax = sourcesLength; i < imax; ++i) {
|
|
15564
|
+
var id0 = i < destinationsLength ? destinations[i] : sources[i];
|
|
15565
|
+
var ispan = i << 1;
|
|
15566
|
+
var s0 = spans[ispan + 1];
|
|
15567
|
+
var s1 = spans[ispan + 2];
|
|
15568
|
+
var id1 = target.substring(s0, i + 1 < imax ? s1 : targetLength);
|
|
15569
|
+
id += id0 + id1;
|
|
15570
|
+
}
|
|
15571
|
+
value.id = id;
|
|
15572
|
+
}
|
|
15573
|
+
// Update the initial value
|
|
15560
15574
|
if (0 < initial.length) {
|
|
15561
15575
|
value.initial = initial;
|
|
15562
15576
|
}
|
|
15577
|
+
return true;
|
|
15563
15578
|
};
|
|
15564
15579
|
EShapeDataMapperImpl.prototype.newSources = function (source) {
|
|
15565
|
-
if (source == null
|
|
15580
|
+
if (source == null) {
|
|
15566
15581
|
return null;
|
|
15567
15582
|
}
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
var result = "";
|
|
15572
|
-
var delimiter = "";
|
|
15573
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
15574
|
-
var separator = EShapeDataMapperImpl.SEPARATOR;
|
|
15575
|
-
var sourceIndices = this._sourceIndices;
|
|
15576
|
-
var sourceIndicesLength = sourceIndices.length;
|
|
15577
|
-
var index = sourceIndicesLength;
|
|
15578
|
-
for (var i = 0, imax = destinations.length; i < imax; ++i) {
|
|
15579
|
-
var d = destinations[imax - 1 - i];
|
|
15580
|
-
if (d === wildcard) {
|
|
15581
|
-
index -= 1;
|
|
15582
|
-
if (0 <= index) {
|
|
15583
|
-
var sourceIndex = sourceIndices[index];
|
|
15584
|
-
var targetIndex0 = targetIndices[sourceIndex];
|
|
15585
|
-
var targetIndex1 = targetIndices[sourceIndex + 1];
|
|
15586
|
-
result = target.substring(targetIndex0 + 1, targetIndex1) + delimiter + result;
|
|
15587
|
-
}
|
|
15588
|
-
else {
|
|
15589
|
-
return null;
|
|
15590
|
-
}
|
|
15591
|
-
}
|
|
15592
|
-
else {
|
|
15593
|
-
result = d + delimiter + result;
|
|
15594
|
-
}
|
|
15595
|
-
delimiter = separator;
|
|
15596
|
-
}
|
|
15597
|
-
return result;
|
|
15598
|
-
};
|
|
15599
|
-
EShapeDataMapperImpl.prototype.calcTargetIndices = function (target) {
|
|
15600
|
-
var targetIndices = this._targetIndices;
|
|
15601
|
-
var size = 1;
|
|
15602
|
-
targetIndices[0] = -1;
|
|
15603
|
-
var index0 = -1;
|
|
15604
|
-
var index1 = -1;
|
|
15605
|
-
while (0 <= (index1 = target.indexOf(EShapeDataMapperImpl.SEPARATOR, index0 + 1))) {
|
|
15606
|
-
targetIndices[size] = index1;
|
|
15607
|
-
index0 = index1;
|
|
15608
|
-
size += 1;
|
|
15609
|
-
}
|
|
15610
|
-
targetIndices[size] = target.length;
|
|
15611
|
-
size += 1;
|
|
15612
|
-
this._targetIndicesLength = size;
|
|
15613
|
-
};
|
|
15614
|
-
EShapeDataMapperImpl.prototype.newSourceIndices = function (sources) {
|
|
15615
|
-
var result = [];
|
|
15616
|
-
if (sources != null) {
|
|
15617
|
-
var wildcard = EShapeDataMapperImpl.WILDCARD;
|
|
15618
|
-
for (var i = 0, imax = sources.length; i < imax; ++i) {
|
|
15619
|
-
var s = sources[i];
|
|
15620
|
-
if (s === wildcard) {
|
|
15621
|
-
result.push(i);
|
|
15622
|
-
}
|
|
15623
|
-
}
|
|
15583
|
+
var trimmed = source.trim();
|
|
15584
|
+
if (trimmed.length <= 0) {
|
|
15585
|
+
return null;
|
|
15624
15586
|
}
|
|
15625
|
-
return
|
|
15587
|
+
return trimmed.toLowerCase().split(EShapeDataMapperImpl.WILDCARD);
|
|
15626
15588
|
};
|
|
15627
15589
|
EShapeDataMapperImpl.split = function (target) {
|
|
15628
|
-
if (target == null
|
|
15590
|
+
if (target == null) {
|
|
15591
|
+
return null;
|
|
15592
|
+
}
|
|
15593
|
+
var trimmed = target.trim();
|
|
15594
|
+
if (trimmed.length <= 0) {
|
|
15629
15595
|
return null;
|
|
15630
15596
|
}
|
|
15631
|
-
return
|
|
15597
|
+
return trimmed.split(this.WILDCARD);
|
|
15632
15598
|
};
|
|
15633
|
-
EShapeDataMapperImpl.SEPARATOR = ".";
|
|
15634
15599
|
EShapeDataMapperImpl.WILDCARD = "*";
|
|
15600
|
+
EShapeDataMapperImpl.SPANS = [];
|
|
15635
15601
|
return EShapeDataMapperImpl;
|
|
15636
15602
|
}());
|
|
15637
15603
|
|