@wcardinal/wcardinal-ui 0.432.0 → 0.433.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-diagram-canvas-editor-snap.d.ts +7 -5
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.d.ts +0 -1
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.d.ts +0 -1
- package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js +22 -24
- package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js +13 -4
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js +13 -4
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +14 -5
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +14 -5
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +14 -5
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +14 -5
- package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +14 -5
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +14 -5
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +49 -33
- package/dist/wcardinal-ui.js +23 -25
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.433.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -56317,9 +56317,21 @@ var loadThemeWhiteEnUsDiagram = function () {
|
|
|
56317
56317
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56318
56318
|
* SPDX-License-Identifier: Apache-2.0
|
|
56319
56319
|
*/
|
|
56320
|
-
var
|
|
56320
|
+
var toGridScale$1 = function (scale) {
|
|
56321
|
+
if (scale <= 0 || 1 <= scale) {
|
|
56322
|
+
return 1;
|
|
56323
|
+
}
|
|
56324
|
+
var target = 1 / scale;
|
|
56325
|
+
var result = 1;
|
|
56326
|
+
while (result < target && result < Number.MAX_SAFE_INTEGER) {
|
|
56327
|
+
result <<= 1;
|
|
56328
|
+
}
|
|
56329
|
+
return result;
|
|
56330
|
+
};
|
|
56331
|
+
var toGridSize$1 = function (grid, width, height, scale) {
|
|
56321
56332
|
var canvas = Math.max(width, height);
|
|
56322
56333
|
if (0 < grid) {
|
|
56334
|
+
grid *= toGridScale$1(scale);
|
|
56323
56335
|
var minimum = canvas / 1000;
|
|
56324
56336
|
for (var i = 0; i < 10 && grid < minimum; ++i) {
|
|
56325
56337
|
grid *= 10;
|
|
@@ -56375,9 +56387,6 @@ var DThemeWhiteDiagramCanvasEditor = /** @class */ (function (_super) {
|
|
|
56375
56387
|
DThemeWhiteDiagramCanvasEditor.prototype.getSnapGridSize = function () {
|
|
56376
56388
|
return toGridSize$1;
|
|
56377
56389
|
};
|
|
56378
|
-
DThemeWhiteDiagramCanvasEditor.prototype.isSnapGridAdaptive = function () {
|
|
56379
|
-
return true;
|
|
56380
|
-
};
|
|
56381
56390
|
DThemeWhiteDiagramCanvasEditor.prototype.getSnapTargetColor = function () {
|
|
56382
56391
|
return DThemeWhiteConstants.HIGHLIGHT_COLOR;
|
|
56383
56392
|
};
|
|
@@ -66853,9 +66862,21 @@ var loadThemeDarkEnUsDiagram = function () {
|
|
|
66853
66862
|
* Copyright (C) 2019 Toshiba Corporation
|
|
66854
66863
|
* SPDX-License-Identifier: Apache-2.0
|
|
66855
66864
|
*/
|
|
66856
|
-
var
|
|
66865
|
+
var toGridScale = function (scale) {
|
|
66866
|
+
if (scale <= 0 || 1 <= scale) {
|
|
66867
|
+
return 1;
|
|
66868
|
+
}
|
|
66869
|
+
var target = 1 / scale;
|
|
66870
|
+
var result = 1;
|
|
66871
|
+
while (result < target && result < Number.MAX_SAFE_INTEGER) {
|
|
66872
|
+
result <<= 1;
|
|
66873
|
+
}
|
|
66874
|
+
return result;
|
|
66875
|
+
};
|
|
66876
|
+
var toGridSize = function (grid, width, height, scale) {
|
|
66857
66877
|
var canvas = Math.max(width, height);
|
|
66858
66878
|
if (0 < grid) {
|
|
66879
|
+
grid *= toGridScale(scale);
|
|
66859
66880
|
var minimum = canvas / 1000;
|
|
66860
66881
|
for (var i = 0; i < 10 && grid < minimum; ++i) {
|
|
66861
66882
|
grid *= 10;
|
|
@@ -66911,9 +66932,6 @@ var DThemeDarkDiagramCanvasEditor = /** @class */ (function (_super) {
|
|
|
66911
66932
|
DThemeDarkDiagramCanvasEditor.prototype.getSnapGridSize = function () {
|
|
66912
66933
|
return toGridSize;
|
|
66913
66934
|
};
|
|
66914
|
-
DThemeDarkDiagramCanvasEditor.prototype.isSnapGridAdaptive = function () {
|
|
66915
|
-
return true;
|
|
66916
|
-
};
|
|
66917
66935
|
DThemeDarkDiagramCanvasEditor.prototype.getSnapTargetColor = function () {
|
|
66918
66936
|
return DThemeDarkConstants.HIGHLIGHT_COLOR;
|
|
66919
66937
|
};
|
|
@@ -87324,25 +87342,26 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
|
|
|
87324
87342
|
parent.addChildAt(container, parent.children.length - 1);
|
|
87325
87343
|
// Grid
|
|
87326
87344
|
this._grid = this.toGrid(theme, options.grid);
|
|
87327
|
-
this.
|
|
87345
|
+
this._gridParentWidth = parent.width;
|
|
87346
|
+
this._gridParentHeight = parent.height;
|
|
87347
|
+
this._gridParentScale = parent.scale.x;
|
|
87348
|
+
this._gridSize = this.newGridSize();
|
|
87328
87349
|
// Target
|
|
87329
87350
|
this._target = this.toTarget(theme, options.target);
|
|
87330
87351
|
}
|
|
87331
87352
|
DDiagramCanvasEditorSnap.prototype.toGrid = function (theme, options) {
|
|
87332
|
-
var _a
|
|
87353
|
+
var _a;
|
|
87333
87354
|
if (options != null) {
|
|
87334
87355
|
return {
|
|
87335
87356
|
major: this.toGridMajor(theme, options.major),
|
|
87336
87357
|
minor: this.toGridMinor(theme, options.minor),
|
|
87337
|
-
size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
|
|
87338
|
-
adaptive: (_b = options.adaptive) !== null && _b !== void 0 ? _b : theme.isSnapGridAdaptive()
|
|
87358
|
+
size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
|
|
87339
87359
|
};
|
|
87340
87360
|
}
|
|
87341
87361
|
return {
|
|
87342
87362
|
major: this.toGridMajor(theme),
|
|
87343
87363
|
minor: this.toGridMinor(theme),
|
|
87344
|
-
size: theme.getSnapGridSize()
|
|
87345
|
-
adaptive: theme.isSnapGridAdaptive()
|
|
87364
|
+
size: theme.getSnapGridSize()
|
|
87346
87365
|
};
|
|
87347
87366
|
};
|
|
87348
87367
|
DDiagramCanvasEditorSnap.prototype.toGridMajor = function (theme, options) {
|
|
@@ -87413,25 +87432,23 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
|
|
|
87413
87432
|
return this._controller.serialize();
|
|
87414
87433
|
};
|
|
87415
87434
|
DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
|
|
87416
|
-
this.
|
|
87435
|
+
this._gridParentWidth = newWidth;
|
|
87436
|
+
this._gridParentHeight = newHeight;
|
|
87437
|
+
this.updateGridSize();
|
|
87417
87438
|
};
|
|
87418
87439
|
DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
|
|
87419
|
-
|
|
87420
|
-
|
|
87421
|
-
|
|
87440
|
+
this._gridParentScale = newX;
|
|
87441
|
+
this.updateGridSize();
|
|
87442
|
+
};
|
|
87443
|
+
DDiagramCanvasEditorSnap.prototype.updateGridSize = function () {
|
|
87444
|
+
var gridSize = this.newGridSize();
|
|
87445
|
+
if (this._gridSize !== gridSize) {
|
|
87446
|
+
this._gridSize = gridSize;
|
|
87422
87447
|
this._isDirty = true;
|
|
87423
87448
|
}
|
|
87424
87449
|
};
|
|
87425
|
-
DDiagramCanvasEditorSnap.prototype.
|
|
87426
|
-
|
|
87427
|
-
return 1;
|
|
87428
|
-
}
|
|
87429
|
-
var target = 1 / sx;
|
|
87430
|
-
var result = 1;
|
|
87431
|
-
while (result < target && result < Number.MAX_SAFE_INTEGER) {
|
|
87432
|
-
result <<= 1;
|
|
87433
|
-
}
|
|
87434
|
-
return result;
|
|
87450
|
+
DDiagramCanvasEditorSnap.prototype.newGridSize = function () {
|
|
87451
|
+
return this._grid.size(this._controller.grid.size, this._gridParentWidth, this._gridParentHeight, this._gridParentScale);
|
|
87435
87452
|
};
|
|
87436
87453
|
DDiagramCanvasEditorSnap.prototype.onRender = function () {
|
|
87437
87454
|
if (this._isDirty) {
|
|
@@ -87440,14 +87457,13 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
|
|
|
87440
87457
|
}
|
|
87441
87458
|
};
|
|
87442
87459
|
DDiagramCanvasEditorSnap.prototype.updateAll = function () {
|
|
87443
|
-
var parent = this._parent;
|
|
87444
87460
|
var container = this._container;
|
|
87445
87461
|
var controller = this._controller;
|
|
87446
87462
|
var isGridVisible = controller.grid.visible;
|
|
87447
87463
|
var isTargetVisible = controller.target.visible;
|
|
87448
87464
|
if (isGridVisible || isTargetVisible) {
|
|
87449
|
-
var w =
|
|
87450
|
-
var h =
|
|
87465
|
+
var w = this._gridParentWidth;
|
|
87466
|
+
var h = this._gridParentHeight;
|
|
87451
87467
|
var wh = 0.5 * w;
|
|
87452
87468
|
var hh = 0.5 * h;
|
|
87453
87469
|
var TOP = EShapeBarPosition.TOP;
|
|
@@ -87460,7 +87476,7 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
|
|
|
87460
87476
|
var major = grid.major;
|
|
87461
87477
|
var minor = grid.minor;
|
|
87462
87478
|
var interval = major.interval;
|
|
87463
|
-
var size =
|
|
87479
|
+
var size = this._gridSize;
|
|
87464
87480
|
for (var x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {
|
|
87465
87481
|
var style = ix % interval === 0 ? major : minor;
|
|
87466
87482
|
this.update(container, shapes, index, x, hh, TOP, w, h, style);
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.433.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -66157,25 +66157,26 @@
|
|
|
66157
66157
|
parent.addChildAt(container, parent.children.length - 1);
|
|
66158
66158
|
// Grid
|
|
66159
66159
|
this._grid = this.toGrid(theme, options.grid);
|
|
66160
|
-
this.
|
|
66160
|
+
this._gridParentWidth = parent.width;
|
|
66161
|
+
this._gridParentHeight = parent.height;
|
|
66162
|
+
this._gridParentScale = parent.scale.x;
|
|
66163
|
+
this._gridSize = this.newGridSize();
|
|
66161
66164
|
// Target
|
|
66162
66165
|
this._target = this.toTarget(theme, options.target);
|
|
66163
66166
|
}
|
|
66164
66167
|
DDiagramCanvasEditorSnap.prototype.toGrid = function (theme, options) {
|
|
66165
|
-
var _a
|
|
66168
|
+
var _a;
|
|
66166
66169
|
if (options != null) {
|
|
66167
66170
|
return {
|
|
66168
66171
|
major: this.toGridMajor(theme, options.major),
|
|
66169
66172
|
minor: this.toGridMinor(theme, options.minor),
|
|
66170
|
-
size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
|
|
66171
|
-
adaptive: (_b = options.adaptive) !== null && _b !== void 0 ? _b : theme.isSnapGridAdaptive()
|
|
66173
|
+
size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
|
|
66172
66174
|
};
|
|
66173
66175
|
}
|
|
66174
66176
|
return {
|
|
66175
66177
|
major: this.toGridMajor(theme),
|
|
66176
66178
|
minor: this.toGridMinor(theme),
|
|
66177
|
-
size: theme.getSnapGridSize()
|
|
66178
|
-
adaptive: theme.isSnapGridAdaptive()
|
|
66179
|
+
size: theme.getSnapGridSize()
|
|
66179
66180
|
};
|
|
66180
66181
|
};
|
|
66181
66182
|
DDiagramCanvasEditorSnap.prototype.toGridMajor = function (theme, options) {
|
|
@@ -66246,25 +66247,23 @@
|
|
|
66246
66247
|
return this._controller.serialize();
|
|
66247
66248
|
};
|
|
66248
66249
|
DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
|
|
66249
|
-
this.
|
|
66250
|
+
this._gridParentWidth = newWidth;
|
|
66251
|
+
this._gridParentHeight = newHeight;
|
|
66252
|
+
this.updateGridSize();
|
|
66250
66253
|
};
|
|
66251
66254
|
DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
|
|
66252
|
-
|
|
66253
|
-
|
|
66254
|
-
|
|
66255
|
+
this._gridParentScale = newX;
|
|
66256
|
+
this.updateGridSize();
|
|
66257
|
+
};
|
|
66258
|
+
DDiagramCanvasEditorSnap.prototype.updateGridSize = function () {
|
|
66259
|
+
var gridSize = this.newGridSize();
|
|
66260
|
+
if (this._gridSize !== gridSize) {
|
|
66261
|
+
this._gridSize = gridSize;
|
|
66255
66262
|
this._isDirty = true;
|
|
66256
66263
|
}
|
|
66257
66264
|
};
|
|
66258
|
-
DDiagramCanvasEditorSnap.prototype.
|
|
66259
|
-
|
|
66260
|
-
return 1;
|
|
66261
|
-
}
|
|
66262
|
-
var target = 1 / sx;
|
|
66263
|
-
var result = 1;
|
|
66264
|
-
while (result < target && result < Number.MAX_SAFE_INTEGER) {
|
|
66265
|
-
result <<= 1;
|
|
66266
|
-
}
|
|
66267
|
-
return result;
|
|
66265
|
+
DDiagramCanvasEditorSnap.prototype.newGridSize = function () {
|
|
66266
|
+
return this._grid.size(this._controller.grid.size, this._gridParentWidth, this._gridParentHeight, this._gridParentScale);
|
|
66268
66267
|
};
|
|
66269
66268
|
DDiagramCanvasEditorSnap.prototype.onRender = function () {
|
|
66270
66269
|
if (this._isDirty) {
|
|
@@ -66273,14 +66272,13 @@
|
|
|
66273
66272
|
}
|
|
66274
66273
|
};
|
|
66275
66274
|
DDiagramCanvasEditorSnap.prototype.updateAll = function () {
|
|
66276
|
-
var parent = this._parent;
|
|
66277
66275
|
var container = this._container;
|
|
66278
66276
|
var controller = this._controller;
|
|
66279
66277
|
var isGridVisible = controller.grid.visible;
|
|
66280
66278
|
var isTargetVisible = controller.target.visible;
|
|
66281
66279
|
if (isGridVisible || isTargetVisible) {
|
|
66282
|
-
var w =
|
|
66283
|
-
var h =
|
|
66280
|
+
var w = this._gridParentWidth;
|
|
66281
|
+
var h = this._gridParentHeight;
|
|
66284
66282
|
var wh = 0.5 * w;
|
|
66285
66283
|
var hh = 0.5 * h;
|
|
66286
66284
|
var TOP = EShapeBarPosition.TOP;
|
|
@@ -66293,7 +66291,7 @@
|
|
|
66293
66291
|
var major = grid.major;
|
|
66294
66292
|
var minor = grid.minor;
|
|
66295
66293
|
var interval = major.interval;
|
|
66296
|
-
var size =
|
|
66294
|
+
var size = this._gridSize;
|
|
66297
66295
|
for (var x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {
|
|
66298
66296
|
var style = ix % interval === 0 ? major : minor;
|
|
66299
66297
|
this.update(container, shapes, index, x, hh, TOP, w, h, style);
|