@wcardinal/wcardinal-ui 0.361.0 → 0.363.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/d-button-select.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-diagram-editor.d.ts +13 -1
- package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable-impl.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-function.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-dialog-select.d.ts +34 -24
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.d.ts +2 -2
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-editor.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog-select.d.ts +2 -2
- package/dist/types/wcardinal/ui/util/index.d.ts +0 -1
- package/dist/wcardinal/ui/d-button-select.js +1 -1
- package/dist/wcardinal/ui/d-button-select.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-editor.js +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-editor.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-editor.js +10 -5
- package/dist/wcardinal/ui/d-diagram-editor.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-dismissable.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-function.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select.js +60 -102
- package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.js +3 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +4 -6
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-editor.js +3 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-editor.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +4 -6
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +0 -1
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/to-label.js +20 -2
- package/dist/wcardinal/ui/util/to-label.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +8 -9
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +8 -9
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +114 -151
- package/dist/wcardinal-ui.js +75 -118
- 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/util/to-label-with.d.ts +0 -1
- package/dist/wcardinal/ui/util/to-label-with.js +0 -27
- package/dist/wcardinal/ui/util/to-label-with.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.363.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -47278,7 +47278,7 @@
|
|
|
47278
47278
|
* Copyright (C) 2019 Toshiba Corporation
|
|
47279
47279
|
* SPDX-License-Identifier: Apache-2.0
|
|
47280
47280
|
*/
|
|
47281
|
-
var
|
|
47281
|
+
var toLabel$1 = function (target) {
|
|
47282
47282
|
if (target != null) {
|
|
47283
47283
|
if (isString(target)) {
|
|
47284
47284
|
return target;
|
|
@@ -47296,15 +47296,7 @@
|
|
|
47296
47296
|
return target.id;
|
|
47297
47297
|
}
|
|
47298
47298
|
}
|
|
47299
|
-
return
|
|
47300
|
-
};
|
|
47301
|
-
|
|
47302
|
-
/*
|
|
47303
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
47304
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
47305
|
-
*/
|
|
47306
|
-
var toLabel$1 = function (target) {
|
|
47307
|
-
return toLabelWith(target, "");
|
|
47299
|
+
return "";
|
|
47308
47300
|
};
|
|
47309
47301
|
|
|
47310
47302
|
/*
|
|
@@ -55591,8 +55583,17 @@
|
|
|
55591
55583
|
var DDialogSelect = /** @class */ (function (_super) {
|
|
55592
55584
|
__extends(DDialogSelect, _super);
|
|
55593
55585
|
function DDialogSelect(options) {
|
|
55594
|
-
var _this =
|
|
55586
|
+
var _this = this;
|
|
55587
|
+
var _a, _b;
|
|
55588
|
+
_this = _super.call(this, options) || this;
|
|
55589
|
+
// Value
|
|
55595
55590
|
_this._value = null;
|
|
55591
|
+
// Categories
|
|
55592
|
+
var categories = (_b = (_a = options === null || options === void 0 ? void 0 : options.category) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [];
|
|
55593
|
+
_this._categories = categories;
|
|
55594
|
+
if (0 < categories.length) {
|
|
55595
|
+
_this.onCategoriesChange(categories);
|
|
55596
|
+
}
|
|
55596
55597
|
// Controller binding
|
|
55597
55598
|
var transition = new UtilTransition();
|
|
55598
55599
|
var search = _this.search;
|
|
@@ -55675,7 +55676,7 @@
|
|
|
55675
55676
|
Object.defineProperty(DDialogSelect.prototype, "selectCategory", {
|
|
55676
55677
|
get: function () {
|
|
55677
55678
|
var result = this._selectCategory;
|
|
55678
|
-
if (result
|
|
55679
|
+
if (result == null) {
|
|
55679
55680
|
result = this.newSelectCategory();
|
|
55680
55681
|
this._selectCategory = result;
|
|
55681
55682
|
}
|
|
@@ -55686,26 +55687,19 @@
|
|
|
55686
55687
|
});
|
|
55687
55688
|
DDialogSelect.prototype.newSelectCategory = function () {
|
|
55688
55689
|
var _this = this;
|
|
55689
|
-
var
|
|
55690
|
-
|
|
55691
|
-
|
|
55692
|
-
|
|
55693
|
-
|
|
55694
|
-
result.on("change", function (value) {
|
|
55695
|
-
_this.onSelectCategoryChange(value);
|
|
55696
|
-
});
|
|
55697
|
-
return result;
|
|
55698
|
-
}
|
|
55699
|
-
}
|
|
55700
|
-
return null;
|
|
55690
|
+
var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
|
|
55691
|
+
result.on("change", function (value) {
|
|
55692
|
+
_this.onSelectCategoryChange(value);
|
|
55693
|
+
});
|
|
55694
|
+
return result;
|
|
55701
55695
|
};
|
|
55702
55696
|
DDialogSelect.prototype.toSelectCategoryOptions = function (theme, options) {
|
|
55703
55697
|
var result = (options === null || options === void 0 ? void 0 : options.category) || {};
|
|
55704
55698
|
if (result.width === undefined && result.weight === undefined) {
|
|
55705
55699
|
result.width = 140;
|
|
55706
55700
|
}
|
|
55707
|
-
if (result.
|
|
55708
|
-
result.
|
|
55701
|
+
if (result.visible === undefined) {
|
|
55702
|
+
result.visible = false;
|
|
55709
55703
|
}
|
|
55710
55704
|
return result;
|
|
55711
55705
|
};
|
|
@@ -55930,101 +55924,59 @@
|
|
|
55930
55924
|
return "DDialogSelect";
|
|
55931
55925
|
};
|
|
55932
55926
|
DDialogSelect.prototype.onOpen = function () {
|
|
55933
|
-
var _this = this;
|
|
55934
55927
|
_super.prototype.onOpen.call(this);
|
|
55935
55928
|
this.list.selection.clear();
|
|
55936
|
-
|
|
55937
|
-
|
|
55938
|
-
if (this._isCategoryFetched !== true) {
|
|
55939
|
-
this._isCategoryFetched = true;
|
|
55940
|
-
var categoriesOrPromise = this.findCategories();
|
|
55941
|
-
if (categoriesOrPromise == null) {
|
|
55942
|
-
this.search.create([this.input.value, null]);
|
|
55943
|
-
}
|
|
55944
|
-
else if (isArray(categoriesOrPromise)) {
|
|
55945
|
-
this.onCategoryFetched(selectCategory, categoriesOrPromise);
|
|
55946
|
-
}
|
|
55947
|
-
else {
|
|
55948
|
-
categoriesOrPromise.then(function (categories) {
|
|
55949
|
-
_this.onCategoryFetched(selectCategory, categories);
|
|
55950
|
-
});
|
|
55951
|
-
}
|
|
55952
|
-
}
|
|
55953
|
-
else {
|
|
55954
|
-
this.search.create([this.input.value, selectCategory.value]);
|
|
55955
|
-
}
|
|
55929
|
+
if (0 < this._categories.length) {
|
|
55930
|
+
this.search.create([this.input.value, this.selectCategory.value]);
|
|
55956
55931
|
}
|
|
55957
55932
|
else {
|
|
55958
55933
|
this.search.create([this.input.value]);
|
|
55959
55934
|
}
|
|
55960
55935
|
};
|
|
55961
|
-
DDialogSelect.prototype
|
|
55962
|
-
|
|
55963
|
-
|
|
55964
|
-
|
|
55965
|
-
|
|
55966
|
-
|
|
55967
|
-
|
|
55968
|
-
|
|
55969
|
-
|
|
55970
|
-
|
|
55971
|
-
|
|
55972
|
-
|
|
55973
|
-
|
|
55974
|
-
|
|
55975
|
-
|
|
55976
|
-
|
|
55977
|
-
|
|
55978
|
-
}
|
|
55979
|
-
|
|
55980
|
-
|
|
55981
|
-
|
|
55982
|
-
|
|
55983
|
-
|
|
55984
|
-
|
|
55985
|
-
|
|
55986
|
-
};
|
|
55987
|
-
DDialogSelect.prototype.newToCategoryId = function () {
|
|
55988
|
-
var options = this._options;
|
|
55989
|
-
if (options != null) {
|
|
55990
|
-
var category = options.category;
|
|
55991
|
-
if (category != null) {
|
|
55992
|
-
var toId = category.toId;
|
|
55993
|
-
if (toId != null) {
|
|
55994
|
-
return toId;
|
|
55995
|
-
}
|
|
55936
|
+
Object.defineProperty(DDialogSelect.prototype, "categories", {
|
|
55937
|
+
get: function () {
|
|
55938
|
+
return this._categories;
|
|
55939
|
+
},
|
|
55940
|
+
set: function (categories) {
|
|
55941
|
+
this._categories = categories;
|
|
55942
|
+
this.onCategoriesChange(categories);
|
|
55943
|
+
},
|
|
55944
|
+
enumerable: false,
|
|
55945
|
+
configurable: true
|
|
55946
|
+
});
|
|
55947
|
+
DDialogSelect.prototype.onCategoriesChange = function (categories) {
|
|
55948
|
+
var _a, _b, _c, _d, _e;
|
|
55949
|
+
var selectCategory = this.selectCategory;
|
|
55950
|
+
if (0 < categories.length) {
|
|
55951
|
+
var items = [];
|
|
55952
|
+
var theme = this.theme;
|
|
55953
|
+
var options = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.dismiss) !== null && _c !== void 0 ? _c : {};
|
|
55954
|
+
if ((_d = options.enable) !== null && _d !== void 0 ? _d : theme.isCategoryDismissable()) {
|
|
55955
|
+
items.push({
|
|
55956
|
+
value: null,
|
|
55957
|
+
text: {
|
|
55958
|
+
value: (_e = options.label) !== null && _e !== void 0 ? _e : theme.getCategoryDismissLabel()
|
|
55959
|
+
}
|
|
55960
|
+
});
|
|
55996
55961
|
}
|
|
55997
|
-
|
|
55998
|
-
|
|
55999
|
-
|
|
56000
|
-
|
|
56001
|
-
|
|
56002
|
-
|
|
56003
|
-
|
|
56004
|
-
|
|
56005
|
-
if (options != null) {
|
|
56006
|
-
var category = options.category;
|
|
56007
|
-
if (category != null) {
|
|
56008
|
-
var toLabel = category.toLabel;
|
|
56009
|
-
if (toLabel != null) {
|
|
56010
|
-
return toLabel;
|
|
56011
|
-
}
|
|
55962
|
+
for (var i = 0, imax = categories.length; i < imax; ++i) {
|
|
55963
|
+
var category = categories[i];
|
|
55964
|
+
items.push({
|
|
55965
|
+
value: category.id,
|
|
55966
|
+
text: {
|
|
55967
|
+
value: category.label
|
|
55968
|
+
}
|
|
55969
|
+
});
|
|
56012
55970
|
}
|
|
55971
|
+
selectCategory.menu = new DMenu({
|
|
55972
|
+
fit: true,
|
|
55973
|
+
items: items
|
|
55974
|
+
});
|
|
55975
|
+
selectCategory.show();
|
|
56013
55976
|
}
|
|
56014
|
-
|
|
56015
|
-
|
|
56016
|
-
return theme.toCategoryLabel(category);
|
|
56017
|
-
};
|
|
56018
|
-
};
|
|
56019
|
-
DDialogSelect.prototype.findCategories = function () {
|
|
56020
|
-
var options = this._options;
|
|
56021
|
-
if (options != null) {
|
|
56022
|
-
var controller = options.controller;
|
|
56023
|
-
if (controller != null && controller.getCategories != null) {
|
|
56024
|
-
return controller.getCategories();
|
|
56025
|
-
}
|
|
55977
|
+
else {
|
|
55978
|
+
selectCategory.hide();
|
|
56026
55979
|
}
|
|
56027
|
-
return null;
|
|
56028
55980
|
};
|
|
56029
55981
|
DDialogSelect.prototype.onOk = function (value) {
|
|
56030
55982
|
this.emit("select", value, this);
|
|
@@ -56102,7 +56054,7 @@
|
|
|
56102
56054
|
dialog = options;
|
|
56103
56055
|
}
|
|
56104
56056
|
else {
|
|
56105
|
-
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE,
|
|
56057
|
+
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY_ID>.
|
|
56106
56058
|
dialog = new DDialogSelect(options);
|
|
56107
56059
|
}
|
|
56108
56060
|
this._dialog = dialog;
|
|
@@ -63387,6 +63339,7 @@
|
|
|
63387
63339
|
label: this.label,
|
|
63388
63340
|
width: this.width,
|
|
63389
63341
|
height: this.height,
|
|
63342
|
+
category: this.category,
|
|
63390
63343
|
summary: this.summary,
|
|
63391
63344
|
description: this.description,
|
|
63392
63345
|
background: {
|
|
@@ -64810,16 +64763,21 @@
|
|
|
64810
64763
|
this.emit("deleted", null, this);
|
|
64811
64764
|
return Promise.resolve(null);
|
|
64812
64765
|
};
|
|
64813
|
-
DDiagramEditor.prototype.create = function (
|
|
64766
|
+
DDiagramEditor.prototype.create = function (options) {
|
|
64814
64767
|
return this.set({
|
|
64815
64768
|
version: DDiagramSerializedVersion,
|
|
64816
64769
|
id: undefined,
|
|
64817
|
-
name: name,
|
|
64818
|
-
|
|
64819
|
-
|
|
64770
|
+
name: options.name,
|
|
64771
|
+
label: options.label,
|
|
64772
|
+
width: options.width,
|
|
64773
|
+
height: options.height,
|
|
64774
|
+
category: options.category,
|
|
64775
|
+
summary: options.summary,
|
|
64776
|
+
description: options.description,
|
|
64777
|
+
background: options.background,
|
|
64820
64778
|
resources: [],
|
|
64821
64779
|
data: [],
|
|
64822
|
-
layers: [[
|
|
64780
|
+
layers: [[this.theme.getBaseLayerLabel()]],
|
|
64823
64781
|
items: [],
|
|
64824
64782
|
snap: undefined
|
|
64825
64783
|
});
|
|
@@ -76355,7 +76313,6 @@
|
|
|
76355
76313
|
toEnum: toEnum,
|
|
76356
76314
|
toId: toId,
|
|
76357
76315
|
toIndexOf: toIndexOf,
|
|
76358
|
-
toLabelWith: toLabelWith,
|
|
76359
76316
|
toLabel: toLabel$1,
|
|
76360
76317
|
toMerged: toMerged,
|
|
76361
76318
|
toPadded: toPadded,
|