@wcardinal/wcardinal-ui 0.376.3 → 0.377.0
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/index.d.ts +0 -2
- package/dist/wcardinal/ui/shape/index.js +0 -2
- package/dist/wcardinal/ui/shape/index.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 +1 -326
- package/dist/wcardinal-ui.js +1 -326
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/shape/e-shape-deleter.d.ts +0 -7
- package/dist/types/wcardinal/ui/shape/e-shape-search.d.ts +0 -71
- package/dist/wcardinal/ui/shape/e-shape-deleter.js +0 -124
- package/dist/wcardinal/ui/shape/e-shape-deleter.js.map +0 -1
- package/dist/wcardinal/ui/shape/e-shape-search.js +0 -203
- package/dist/wcardinal/ui/shape/e-shape-search.js.map +0 -1
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.377.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -45637,329 +45637,6 @@
|
|
|
45637
45637
|
return EShapeDataValueExtensions;
|
|
45638
45638
|
}());
|
|
45639
45639
|
|
|
45640
|
-
/*
|
|
45641
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
45642
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
45643
|
-
*/
|
|
45644
|
-
/**
|
|
45645
|
-
* {@link EShape} search utility.
|
|
45646
|
-
*/
|
|
45647
|
-
var EShapeSearch = /** @class */ (function () {
|
|
45648
|
-
function EShapeSearch() {
|
|
45649
|
-
}
|
|
45650
|
-
/**
|
|
45651
|
-
* Returns indices of the given shapes.
|
|
45652
|
-
*
|
|
45653
|
-
* @param shapes shapes
|
|
45654
|
-
* @return indices
|
|
45655
|
-
*/
|
|
45656
|
-
EShapeSearch.toIndices = function (shapes) {
|
|
45657
|
-
var result = [];
|
|
45658
|
-
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
45659
|
-
result.push(shapes[i].index);
|
|
45660
|
-
}
|
|
45661
|
-
return result;
|
|
45662
|
-
};
|
|
45663
|
-
/**
|
|
45664
|
-
* Returns a depth of the given shape.
|
|
45665
|
-
*
|
|
45666
|
-
* @param shape a shape
|
|
45667
|
-
* @return a depth
|
|
45668
|
-
*/
|
|
45669
|
-
EShapeSearch.toDepth = function (shape) {
|
|
45670
|
-
var result = 0;
|
|
45671
|
-
var parent = shape.parent;
|
|
45672
|
-
while (parent instanceof EShapeBase) {
|
|
45673
|
-
result += 1;
|
|
45674
|
-
parent = parent.parent;
|
|
45675
|
-
}
|
|
45676
|
-
return result;
|
|
45677
|
-
};
|
|
45678
|
-
/**
|
|
45679
|
-
* Returns a deepest shape on the path to the given shapes.
|
|
45680
|
-
*
|
|
45681
|
-
* @param shapeA a shape
|
|
45682
|
-
* @param shapeB a shape
|
|
45683
|
-
* @return a found shape
|
|
45684
|
-
*/
|
|
45685
|
-
EShapeSearch.toSharedParent = function (shapeA, shapeB) {
|
|
45686
|
-
var depthA = this.toDepth(shapeA);
|
|
45687
|
-
var depthB = this.toDepth(shapeB);
|
|
45688
|
-
if (depthA < depthB) {
|
|
45689
|
-
var parent_1 = shapeA.parent;
|
|
45690
|
-
while (parent_1 instanceof EShapeBase) {
|
|
45691
|
-
if (this.isParent(shapeB, parent_1)) {
|
|
45692
|
-
return parent_1;
|
|
45693
|
-
}
|
|
45694
|
-
parent_1 = parent_1.parent;
|
|
45695
|
-
}
|
|
45696
|
-
return parent_1;
|
|
45697
|
-
}
|
|
45698
|
-
else {
|
|
45699
|
-
var parent_2 = shapeB.parent;
|
|
45700
|
-
while (parent_2 instanceof EShapeBase) {
|
|
45701
|
-
if (this.isParent(shapeA, parent_2)) {
|
|
45702
|
-
return parent_2;
|
|
45703
|
-
}
|
|
45704
|
-
parent_2 = parent_2.parent;
|
|
45705
|
-
}
|
|
45706
|
-
return parent_2;
|
|
45707
|
-
}
|
|
45708
|
-
};
|
|
45709
|
-
/**
|
|
45710
|
-
* Returns a shape on the path to the given shape whose parent is equals to the given parent.
|
|
45711
|
-
* If there is no such shape, returns a root shape on the path.
|
|
45712
|
-
*
|
|
45713
|
-
* @param shape a shape
|
|
45714
|
-
* @param parent a parent
|
|
45715
|
-
* @returns a found shape
|
|
45716
|
-
*/
|
|
45717
|
-
EShapeSearch.toOfParent = function (shape, parent) {
|
|
45718
|
-
var shapeParent = shape.parent;
|
|
45719
|
-
while (shapeParent !== parent && shapeParent instanceof EShapeBase) {
|
|
45720
|
-
shape = shapeParent;
|
|
45721
|
-
shapeParent = shapeParent.parent;
|
|
45722
|
-
}
|
|
45723
|
-
return shape;
|
|
45724
|
-
};
|
|
45725
|
-
/**
|
|
45726
|
-
* Returns true if the given target is on the path to the given shape.
|
|
45727
|
-
*
|
|
45728
|
-
* @param shape a shape
|
|
45729
|
-
* @param target a check target
|
|
45730
|
-
* @return true if the given target is on the path to the given shape
|
|
45731
|
-
*/
|
|
45732
|
-
EShapeSearch.isParent = function (shape, target) {
|
|
45733
|
-
var parent = shape.parent;
|
|
45734
|
-
while (parent instanceof EShapeBase) {
|
|
45735
|
-
if (parent === target) {
|
|
45736
|
-
return true;
|
|
45737
|
-
}
|
|
45738
|
-
parent = parent.parent;
|
|
45739
|
-
}
|
|
45740
|
-
return false;
|
|
45741
|
-
};
|
|
45742
|
-
/**
|
|
45743
|
-
* Returns a selected shape on the path to the given shape.
|
|
45744
|
-
* If there are more than one selected shapes, returns a deepest selected shape.
|
|
45745
|
-
*
|
|
45746
|
-
* @param shape a shape
|
|
45747
|
-
* @return a found selected shape or null
|
|
45748
|
-
*/
|
|
45749
|
-
EShapeSearch.toSelected = function (shape) {
|
|
45750
|
-
var target = shape;
|
|
45751
|
-
while (target instanceof EShapeBase) {
|
|
45752
|
-
if (target.selected) {
|
|
45753
|
-
return target;
|
|
45754
|
-
}
|
|
45755
|
-
target = target.parent;
|
|
45756
|
-
}
|
|
45757
|
-
return null;
|
|
45758
|
-
};
|
|
45759
|
-
EShapeSearch.findChildById = function (shape, id, recursively) {
|
|
45760
|
-
var children = shape.children;
|
|
45761
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
45762
|
-
var child = children[i];
|
|
45763
|
-
if (child.id === id) {
|
|
45764
|
-
return child;
|
|
45765
|
-
}
|
|
45766
|
-
if (recursively === true) {
|
|
45767
|
-
var result = EShapeSearch.findChildById(child, id, recursively);
|
|
45768
|
-
if (result != null) {
|
|
45769
|
-
return result;
|
|
45770
|
-
}
|
|
45771
|
-
}
|
|
45772
|
-
}
|
|
45773
|
-
return null;
|
|
45774
|
-
};
|
|
45775
|
-
EShapeSearch.findChildByType = function (shape, type, recursively) {
|
|
45776
|
-
var children = shape.children;
|
|
45777
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
45778
|
-
var child = children[i];
|
|
45779
|
-
if (child.type === type) {
|
|
45780
|
-
return child;
|
|
45781
|
-
}
|
|
45782
|
-
if (recursively === true) {
|
|
45783
|
-
var result = EShapeSearch.findChildByType(child, type, recursively);
|
|
45784
|
-
if (result != null) {
|
|
45785
|
-
return result;
|
|
45786
|
-
}
|
|
45787
|
-
}
|
|
45788
|
-
}
|
|
45789
|
-
return null;
|
|
45790
|
-
};
|
|
45791
|
-
EShapeSearch.findChild = function (shape, matcher, recursively) {
|
|
45792
|
-
var children = shape.children;
|
|
45793
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
45794
|
-
var child = children[i];
|
|
45795
|
-
if (matcher(child)) {
|
|
45796
|
-
return child;
|
|
45797
|
-
}
|
|
45798
|
-
if (recursively === true) {
|
|
45799
|
-
var result = EShapeSearch.findChild(child, matcher, recursively);
|
|
45800
|
-
if (result != null) {
|
|
45801
|
-
return result;
|
|
45802
|
-
}
|
|
45803
|
-
}
|
|
45804
|
-
}
|
|
45805
|
-
return null;
|
|
45806
|
-
};
|
|
45807
|
-
EShapeSearch.findChildrenByType = function (shape, type, recursively, result) {
|
|
45808
|
-
result = result || [];
|
|
45809
|
-
var children = shape.children;
|
|
45810
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
45811
|
-
var child = children[i];
|
|
45812
|
-
if (child.type === type) {
|
|
45813
|
-
result.push(child);
|
|
45814
|
-
}
|
|
45815
|
-
if (recursively === true) {
|
|
45816
|
-
EShapeSearch.findChildrenByType(child, type, recursively, result);
|
|
45817
|
-
}
|
|
45818
|
-
}
|
|
45819
|
-
return result;
|
|
45820
|
-
};
|
|
45821
|
-
EShapeSearch.findChildren = function (shape, matcher, recursively, result) {
|
|
45822
|
-
result = result || [];
|
|
45823
|
-
var children = shape.children;
|
|
45824
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
45825
|
-
var child = children[i];
|
|
45826
|
-
if (matcher(child)) {
|
|
45827
|
-
result.push(child);
|
|
45828
|
-
}
|
|
45829
|
-
if (recursively === true) {
|
|
45830
|
-
EShapeSearch.findChildren(child, matcher, recursively, result);
|
|
45831
|
-
}
|
|
45832
|
-
}
|
|
45833
|
-
return result;
|
|
45834
|
-
};
|
|
45835
|
-
EShapeSearch.COMPARATOR_INDEX = function (a, b) {
|
|
45836
|
-
return a.index - b.index;
|
|
45837
|
-
};
|
|
45838
|
-
return EShapeSearch;
|
|
45839
|
-
}());
|
|
45840
|
-
|
|
45841
|
-
/*
|
|
45842
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
45843
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
45844
|
-
*/
|
|
45845
|
-
var EShapeDeleter = /** @class */ (function () {
|
|
45846
|
-
function EShapeDeleter() {
|
|
45847
|
-
}
|
|
45848
|
-
EShapeDeleter.addAll = function (shapes, result) {
|
|
45849
|
-
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
45850
|
-
var shape = shapes[i];
|
|
45851
|
-
result.add(shape);
|
|
45852
|
-
this.addAll(shape.children, result);
|
|
45853
|
-
}
|
|
45854
|
-
return result;
|
|
45855
|
-
};
|
|
45856
|
-
EShapeDeleter.delete = function (parent, shapes, generateListOfDetachedShapes) {
|
|
45857
|
-
var _a;
|
|
45858
|
-
var children = parent.children;
|
|
45859
|
-
var length = children.length;
|
|
45860
|
-
// Update indices
|
|
45861
|
-
var exceptions = ((_a = EShapeDeleter.EXCEPTIONS) !== null && _a !== void 0 ? _a : (EShapeDeleter.EXCEPTIONS = new Set()));
|
|
45862
|
-
for (var i = 0; i < length; ++i) {
|
|
45863
|
-
var child = children[i];
|
|
45864
|
-
if (child.selected) {
|
|
45865
|
-
child.index = length + i;
|
|
45866
|
-
exceptions.add(child);
|
|
45867
|
-
this.addAll(child.children, exceptions);
|
|
45868
|
-
}
|
|
45869
|
-
else {
|
|
45870
|
-
child.index = i;
|
|
45871
|
-
}
|
|
45872
|
-
}
|
|
45873
|
-
// Sort
|
|
45874
|
-
children.sort(EShapeSearch.COMPARATOR_INDEX);
|
|
45875
|
-
// Detach
|
|
45876
|
-
if (generateListOfDetachedShapes === true) {
|
|
45877
|
-
for (var i = length - 1; 0 <= i; --i) {
|
|
45878
|
-
var child = children[i];
|
|
45879
|
-
if (child.selected) {
|
|
45880
|
-
child.index -= length;
|
|
45881
|
-
child.parent = null;
|
|
45882
|
-
child.selected = false;
|
|
45883
|
-
child.uploaded = undefined;
|
|
45884
|
-
child.onDetach(exceptions);
|
|
45885
|
-
}
|
|
45886
|
-
else {
|
|
45887
|
-
exceptions.clear();
|
|
45888
|
-
var size = children.length - (i + 1);
|
|
45889
|
-
if (0 < size) {
|
|
45890
|
-
var result = children.splice(i + 1, size);
|
|
45891
|
-
if (shapes != null) {
|
|
45892
|
-
shapes.length = 0;
|
|
45893
|
-
}
|
|
45894
|
-
parent.onChildTransformChange();
|
|
45895
|
-
parent.toDirty();
|
|
45896
|
-
return result;
|
|
45897
|
-
}
|
|
45898
|
-
else {
|
|
45899
|
-
if (shapes != null) {
|
|
45900
|
-
shapes.length = 0;
|
|
45901
|
-
}
|
|
45902
|
-
return null;
|
|
45903
|
-
}
|
|
45904
|
-
}
|
|
45905
|
-
}
|
|
45906
|
-
exceptions.clear();
|
|
45907
|
-
if (0 < children.length) {
|
|
45908
|
-
var result = children.splice(0, children.length);
|
|
45909
|
-
if (shapes != null) {
|
|
45910
|
-
shapes.length = 0;
|
|
45911
|
-
}
|
|
45912
|
-
parent.onChildTransformChange();
|
|
45913
|
-
parent.toDirty();
|
|
45914
|
-
return result;
|
|
45915
|
-
}
|
|
45916
|
-
else {
|
|
45917
|
-
if (shapes != null) {
|
|
45918
|
-
shapes.length = 0;
|
|
45919
|
-
}
|
|
45920
|
-
return null;
|
|
45921
|
-
}
|
|
45922
|
-
}
|
|
45923
|
-
else {
|
|
45924
|
-
for (var i = length - 1; 0 <= i; --i) {
|
|
45925
|
-
var child = children[i];
|
|
45926
|
-
if (child.selected) {
|
|
45927
|
-
child.parent = null;
|
|
45928
|
-
child.selected = false;
|
|
45929
|
-
child.uploaded = undefined;
|
|
45930
|
-
child.onDetach(exceptions);
|
|
45931
|
-
}
|
|
45932
|
-
else {
|
|
45933
|
-
exceptions.clear();
|
|
45934
|
-
children.length = i + 1;
|
|
45935
|
-
if (shapes != null) {
|
|
45936
|
-
shapes.length = 0;
|
|
45937
|
-
}
|
|
45938
|
-
parent.onChildTransformChange();
|
|
45939
|
-
parent.toDirty();
|
|
45940
|
-
return null;
|
|
45941
|
-
}
|
|
45942
|
-
}
|
|
45943
|
-
exceptions.clear();
|
|
45944
|
-
if (0 < children.length) {
|
|
45945
|
-
children.length = 0;
|
|
45946
|
-
if (shapes != null) {
|
|
45947
|
-
shapes.length = 0;
|
|
45948
|
-
}
|
|
45949
|
-
parent.onChildTransformChange();
|
|
45950
|
-
parent.toDirty();
|
|
45951
|
-
}
|
|
45952
|
-
else {
|
|
45953
|
-
if (shapes != null) {
|
|
45954
|
-
shapes.length = 0;
|
|
45955
|
-
}
|
|
45956
|
-
}
|
|
45957
|
-
return null;
|
|
45958
|
-
}
|
|
45959
|
-
};
|
|
45960
|
-
return EShapeDeleter;
|
|
45961
|
-
}());
|
|
45962
|
-
|
|
45963
45640
|
/*
|
|
45964
45641
|
* Copyright (C) 2019 Toshiba Corporation
|
|
45965
45642
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -76418,7 +76095,6 @@
|
|
|
76418
76095
|
EShapeDataValueState: EShapeDataValueState,
|
|
76419
76096
|
EShapeDataValueType: EShapeDataValueType,
|
|
76420
76097
|
EShapeDefaults: EShapeDefaults,
|
|
76421
|
-
EShapeDeleter: EShapeDeleter,
|
|
76422
76098
|
EShapeDeserializers: EShapeDeserializers,
|
|
76423
76099
|
EShapeOnDeserializeds: EShapeOnDeserializeds,
|
|
76424
76100
|
EShapeEditor: EShapeEditor,
|
|
@@ -76444,7 +76120,6 @@
|
|
|
76444
76120
|
EShapeRuntimeImpl: EShapeRuntimeImpl,
|
|
76445
76121
|
EShapeRuntimeReset: EShapeRuntimeReset,
|
|
76446
76122
|
EShapeRuntimes: EShapeRuntimes,
|
|
76447
|
-
EShapeSearch: EShapeSearch,
|
|
76448
76123
|
EShapeStateSetImplObservable: EShapeStateSetImplObservable,
|
|
76449
76124
|
EShapeState: EShapeState,
|
|
76450
76125
|
EShapeStrokeSide: EShapeStrokeSide,
|