@wcardinal/wcardinal-ui 0.467.0 → 0.467.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.
Files changed (31) hide show
  1. package/dist/types/wcardinal/ui/shape/variant/hit-test-fill.d.ts +2 -0
  2. package/dist/types/wcardinal/ui/shape/variant/hit-test-rectangle-rounded.d.ts +1 -0
  3. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded-legacy.js +2 -2
  4. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded-legacy.js.map +1 -1
  5. package/dist/wcardinal/ui/shape/variant/hit-test-circle.js +3 -29
  6. package/dist/wcardinal/ui/shape/variant/hit-test-circle.js.map +1 -1
  7. package/dist/wcardinal/ui/shape/variant/hit-test-fill.js +33 -0
  8. package/dist/wcardinal/ui/shape/variant/hit-test-fill.js.map +1 -0
  9. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle-rounded.js +120 -97
  10. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle-rounded.js.map +1 -1
  11. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle.js +3 -29
  12. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle.js.map +1 -1
  13. package/dist/wcardinal/ui/shape/variant/hit-test-triangle.js +3 -29
  14. package/dist/wcardinal/ui/shape/variant/hit-test-triangle.js.map +1 -1
  15. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  16. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  17. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  18. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark.js +1 -1
  20. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  21. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  22. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  23. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  24. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  25. package/dist/wcardinal-ui-theme-white.js +1 -1
  26. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  27. package/dist/wcardinal-ui.cjs.js +160 -183
  28. package/dist/wcardinal-ui.js +160 -183
  29. package/dist/wcardinal-ui.min.js +2 -2
  30. package/dist/wcardinal-ui.min.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.467.0
2
+ Winter Cardinal UI v0.467.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -8470,6 +8470,38 @@
8470
8470
  return EShapePrimitive;
8471
8471
  }(EShapeBase));
8472
8472
 
8473
+ var hitTestFill = function (x, y, ax, ay, fill) {
8474
+ if (fill.enable) {
8475
+ var percent = Math.max(0, Math.min(1, fill.percent));
8476
+ if (1 <= percent) {
8477
+ return true;
8478
+ }
8479
+ switch (fill.direction) {
8480
+ case EShapeFillDirection.TOP:
8481
+ if (y + ay <= percent * (2 * ay)) {
8482
+ return true;
8483
+ }
8484
+ break;
8485
+ case EShapeFillDirection.RIGHT:
8486
+ if ((1 - percent) * (2 * ax) <= x + ax) {
8487
+ return true;
8488
+ }
8489
+ break;
8490
+ case EShapeFillDirection.BOTTOM:
8491
+ if ((1 - percent) * (2 * ay) <= y + ay) {
8492
+ return true;
8493
+ }
8494
+ break;
8495
+ case EShapeFillDirection.LEFT:
8496
+ if (x + ax <= percent * (2 * ax)) {
8497
+ return true;
8498
+ }
8499
+ break;
8500
+ }
8501
+ }
8502
+ return false;
8503
+ };
8504
+
8473
8505
  /*
8474
8506
  * Copyright (C) 2019 Toshiba Corporation
8475
8507
  * SPDX-License-Identifier: Apache-2.0
@@ -8507,34 +8539,8 @@
8507
8539
  if (!hitTestCircleFilled(x, y, ax, ay)) {
8508
8540
  return false;
8509
8541
  }
8510
- var fill = shape.fill;
8511
- if (fill.enable) {
8512
- var percent = Math.max(0, Math.min(1, fill.percent));
8513
- if (1 <= percent) {
8514
- return true;
8515
- }
8516
- switch (fill.direction) {
8517
- case EShapeFillDirection.TOP:
8518
- if (y + ay <= percent * (2 * ay)) {
8519
- return true;
8520
- }
8521
- break;
8522
- case EShapeFillDirection.RIGHT:
8523
- if ((1 - percent) * (2 * ax) <= x + ax) {
8524
- return true;
8525
- }
8526
- break;
8527
- case EShapeFillDirection.BOTTOM:
8528
- if ((1 - percent) * (2 * ay) <= y + ay) {
8529
- return true;
8530
- }
8531
- break;
8532
- case EShapeFillDirection.LEFT:
8533
- if (x + ax <= percent * (2 * ax)) {
8534
- return true;
8535
- }
8536
- break;
8537
- }
8542
+ if (hitTestFill(x, y, ax, ay, shape.fill)) {
8543
+ return true;
8538
8544
  }
8539
8545
  return hitTestCircleStroke(x, y, ax, ay, sw, ss);
8540
8546
  };
@@ -8608,34 +8614,8 @@
8608
8614
  if (!hitTestBBox(x, y, ax, ay)) {
8609
8615
  return false;
8610
8616
  }
8611
- var fill = shape.fill;
8612
- if (fill.enable) {
8613
- var percent = Math.max(0, Math.min(1, fill.percent));
8614
- if (1 <= percent) {
8615
- return true;
8616
- }
8617
- switch (fill.direction) {
8618
- case EShapeFillDirection.TOP:
8619
- if (y + ay <= percent * (2 * ay)) {
8620
- return true;
8621
- }
8622
- break;
8623
- case EShapeFillDirection.RIGHT:
8624
- if ((1 - percent) * (2 * ax) <= x + ax) {
8625
- return true;
8626
- }
8627
- break;
8628
- case EShapeFillDirection.BOTTOM:
8629
- if ((1 - percent) * (2 * ay) <= y + ay) {
8630
- return true;
8631
- }
8632
- break;
8633
- case EShapeFillDirection.LEFT:
8634
- if (x + ax <= percent * (2 * ax)) {
8635
- return true;
8636
- }
8637
- break;
8638
- }
8617
+ if (hitTestFill(x, y, ax, ay, shape.fill)) {
8618
+ return true;
8639
8619
  }
8640
8620
  return hitTestRectangleStroke(shape, x, y, ax, ay, sw, ss);
8641
8621
  };
@@ -8685,34 +8665,8 @@
8685
8665
  if (!hitTestTriangleFilled(x, y, a, -ay, +ay)) {
8686
8666
  return false;
8687
8667
  }
8688
- var fill = shape.fill;
8689
- if (fill.enable) {
8690
- var percent = Math.max(0, Math.min(1, fill.percent));
8691
- if (1 <= percent) {
8692
- return true;
8693
- }
8694
- switch (fill.direction) {
8695
- case EShapeFillDirection.TOP:
8696
- if (y + ay <= percent * (2 * ay)) {
8697
- return true;
8698
- }
8699
- break;
8700
- case EShapeFillDirection.RIGHT:
8701
- if ((1 - percent) * (2 * ax) <= x + ax) {
8702
- return true;
8703
- }
8704
- break;
8705
- case EShapeFillDirection.BOTTOM:
8706
- if ((1 - percent) * (2 * ay) <= y + ay) {
8707
- return true;
8708
- }
8709
- break;
8710
- case EShapeFillDirection.LEFT:
8711
- if (x + ax <= percent * (2 * ax)) {
8712
- return true;
8713
- }
8714
- break;
8715
- }
8668
+ if (hitTestFill(x, y, ax, ay, shape.fill)) {
8669
+ return true;
8716
8670
  }
8717
8671
  return hitTestTriangleStroke(x, y, a, ax, ay, sw, ss);
8718
8672
  };
@@ -43179,7 +43133,7 @@
43179
43133
  * Copyright (C) 2019 Toshiba Corporation
43180
43134
  * SPDX-License-Identifier: Apache-2.0
43181
43135
  */
43182
- var hitTestRectangleRounded_ = function (x, y, ax, ay, r, corner) {
43136
+ var hitTestRectangleRoundedFilled = function (x, y, ax, ay, r, corner) {
43183
43137
  var bx0 = -ax + r;
43184
43138
  if (x <= bx0) {
43185
43139
  var by0 = -ay + r;
@@ -43232,116 +43186,138 @@
43232
43186
  }
43233
43187
  }
43234
43188
  };
43235
- var hitTestRectangleRounded = function (shape, x, y, ax, ay, sw, ss) {
43189
+ var hitTestRectangleRoundedStroke = function (shape, x, y, ax, ay, sw, ss, r, corner) {
43190
+ var s = sw * ss;
43191
+ var wx = Math.max(0.0, ax - s);
43192
+ var wy = Math.max(0.0, ay - s);
43193
+ var wr = Math.max(0.0, r - s);
43194
+ if (!hitTestRectangleRoundedFilled(x, y, wx, wy, wr, corner)) {
43195
+ var strokeSide = shape.stroke.side;
43196
+ if (strokeSide === EShapeStrokeSide.ALL) {
43197
+ return true;
43198
+ }
43199
+ else {
43200
+ if (x <= -wx + wr) {
43201
+ var hasLeftSide = !!(strokeSide & EShapeStrokeSide.LEFT);
43202
+ if (y <= -wy + wr) {
43203
+ var hasTopSide = !!(strokeSide & EShapeStrokeSide.TOP);
43204
+ if (hasTopSide && hasLeftSide) {
43205
+ return true;
43206
+ }
43207
+ else if (hasTopSide) {
43208
+ return -wx <= y;
43209
+ }
43210
+ else if (hasLeftSide) {
43211
+ return x <= -wx;
43212
+ }
43213
+ else {
43214
+ return false;
43215
+ }
43216
+ }
43217
+ else if (+wy - wr <= y) {
43218
+ var hasBottomSide = !!(strokeSide & EShapeStrokeSide.BOTTOM);
43219
+ if (hasBottomSide && hasLeftSide) {
43220
+ return true;
43221
+ }
43222
+ else if (hasBottomSide) {
43223
+ return +wx <= y;
43224
+ }
43225
+ else if (hasLeftSide) {
43226
+ return x <= -wx;
43227
+ }
43228
+ else {
43229
+ return false;
43230
+ }
43231
+ }
43232
+ else {
43233
+ return hasLeftSide;
43234
+ }
43235
+ }
43236
+ else if (+wx - wr <= x) {
43237
+ var hasRightSide = !!(strokeSide & EShapeStrokeSide.RIGHT);
43238
+ if (y <= -wy + wr) {
43239
+ var hasTopSide = !!(strokeSide & EShapeStrokeSide.TOP);
43240
+ if (hasTopSide && hasRightSide) {
43241
+ return true;
43242
+ }
43243
+ else if (hasTopSide) {
43244
+ return -wx <= y;
43245
+ }
43246
+ else if (hasRightSide) {
43247
+ return +wx <= x;
43248
+ }
43249
+ else {
43250
+ return false;
43251
+ }
43252
+ }
43253
+ else if (+wy - wr <= y) {
43254
+ var hasBottomSide = !!(strokeSide & EShapeStrokeSide.BOTTOM);
43255
+ if (hasBottomSide && hasRightSide) {
43256
+ return true;
43257
+ }
43258
+ else if (hasBottomSide) {
43259
+ return +wx <= y;
43260
+ }
43261
+ else if (hasRightSide) {
43262
+ return +wx <= x;
43263
+ }
43264
+ else {
43265
+ return false;
43266
+ }
43267
+ }
43268
+ else {
43269
+ return hasRightSide;
43270
+ }
43271
+ }
43272
+ else {
43273
+ if (y <= -wy + wr) {
43274
+ return !!(strokeSide & EShapeStrokeSide.TOP);
43275
+ }
43276
+ else if (+wy - wr <= y) {
43277
+ return !!(strokeSide & EShapeStrokeSide.BOTTOM);
43278
+ }
43279
+ else {
43280
+ return false;
43281
+ }
43282
+ }
43283
+ }
43284
+ }
43285
+ return false;
43286
+ };
43287
+ var hitTestRectangleRoundedLegacy = function (shape, x, y, ax, ay, sw, ss) {
43236
43288
  var fill = shape.fill;
43237
43289
  if (fill.enable || 0 < sw) {
43238
43290
  var r = shape.radius * Math.min(ax, ay);
43239
43291
  var corner = shape.corner;
43240
- if (hitTestRectangleRounded_(x, y, ax, ay, r, corner)) {
43292
+ if (hitTestRectangleRoundedFilled(x, y, ax, ay, r, corner)) {
43241
43293
  if (fill.enable) {
43242
43294
  return true;
43243
43295
  }
43244
43296
  else {
43245
- var s = sw * ss;
43246
- var wx = Math.max(0.0, ax - s);
43247
- var wy = Math.max(0.0, ay - s);
43248
- var wr = Math.max(0.0, r - s);
43249
- if (!hitTestRectangleRounded_(x, y, wx, wy, wr, corner)) {
43250
- var strokeSide = shape.stroke.side;
43251
- if (strokeSide === EShapeStrokeSide.ALL) {
43252
- return true;
43253
- }
43254
- else {
43255
- if (x <= -wx + wr) {
43256
- var hasLeftSide = !!(strokeSide & EShapeStrokeSide.LEFT);
43257
- if (y <= -wy + wr) {
43258
- var hasTopSide = !!(strokeSide & EShapeStrokeSide.TOP);
43259
- if (hasTopSide && hasLeftSide) {
43260
- return true;
43261
- }
43262
- else if (hasTopSide) {
43263
- return -wx <= y;
43264
- }
43265
- else if (hasLeftSide) {
43266
- return x <= -wx;
43267
- }
43268
- else {
43269
- return false;
43270
- }
43271
- }
43272
- else if (+wy - wr <= y) {
43273
- var hasBottomSide = !!(strokeSide & EShapeStrokeSide.BOTTOM);
43274
- if (hasBottomSide && hasLeftSide) {
43275
- return true;
43276
- }
43277
- else if (hasBottomSide) {
43278
- return +wx <= y;
43279
- }
43280
- else if (hasLeftSide) {
43281
- return x <= -wx;
43282
- }
43283
- else {
43284
- return false;
43285
- }
43286
- }
43287
- else {
43288
- return hasLeftSide;
43289
- }
43290
- }
43291
- else if (+wx - wr <= x) {
43292
- var hasRightSide = !!(strokeSide & EShapeStrokeSide.RIGHT);
43293
- if (y <= -wy + wr) {
43294
- var hasTopSide = !!(strokeSide & EShapeStrokeSide.TOP);
43295
- if (hasTopSide && hasRightSide) {
43296
- return true;
43297
- }
43298
- else if (hasTopSide) {
43299
- return -wx <= y;
43300
- }
43301
- else if (hasRightSide) {
43302
- return +wx <= x;
43303
- }
43304
- else {
43305
- return false;
43306
- }
43307
- }
43308
- else if (+wy - wr <= y) {
43309
- var hasBottomSide = !!(strokeSide & EShapeStrokeSide.BOTTOM);
43310
- if (hasBottomSide && hasRightSide) {
43311
- return true;
43312
- }
43313
- else if (hasBottomSide) {
43314
- return +wx <= y;
43315
- }
43316
- else if (hasRightSide) {
43317
- return +wx <= x;
43318
- }
43319
- else {
43320
- return false;
43321
- }
43322
- }
43323
- else {
43324
- return hasRightSide;
43325
- }
43326
- }
43327
- else {
43328
- if (y <= -wy + wr) {
43329
- return !!(strokeSide & EShapeStrokeSide.TOP);
43330
- }
43331
- else if (+wy - wr <= y) {
43332
- return !!(strokeSide & EShapeStrokeSide.BOTTOM);
43333
- }
43334
- else {
43335
- return false;
43336
- }
43337
- }
43338
- }
43297
+ if (hitTestRectangleRoundedStroke(shape, x, y, ax, ay, sw, ss, r, corner)) {
43298
+ return true;
43339
43299
  }
43340
43300
  }
43341
43301
  }
43342
43302
  }
43343
43303
  return false;
43344
43304
  };
43305
+ var hitTestRectangleRounded = function (shape, x, y, ax, ay, sw, ss) {
43306
+ var fill = shape.fill;
43307
+ if (fill.enable || 0 < sw) {
43308
+ var r = shape.radius * Math.min(ax, ay);
43309
+ var corner = shape.corner;
43310
+ if (hitTestRectangleRoundedFilled(x, y, ax, ay, r, corner)) {
43311
+ if (hitTestFill(x, y, ax, ay, fill)) {
43312
+ return true;
43313
+ }
43314
+ if (hitTestRectangleRoundedStroke(shape, x, y, ax, ay, sw, ss, r, corner)) {
43315
+ return true;
43316
+ }
43317
+ }
43318
+ }
43319
+ return false;
43320
+ };
43345
43321
 
43346
43322
  /*
43347
43323
  * Copyright (C) 2019 Toshiba Corporation
@@ -51873,7 +51849,7 @@
51873
51849
  };
51874
51850
  EShapeRectangleRoundedLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
51875
51851
  if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
51876
- return hitTestRectangleRounded(this, x, y, ax, ay, sw, ss);
51852
+ return hitTestRectangleRoundedLegacy(this, x, y, ax, ay, sw, ss);
51877
51853
  }
51878
51854
  return false;
51879
51855
  };
@@ -88734,6 +88710,7 @@
88734
88710
  hitTestCircleLegacy: hitTestCircleLegacy,
88735
88711
  hitTestCircle: hitTestCircle,
88736
88712
  hitTestSemicircle: hitTestSemicircle,
88713
+ hitTestRectangleRoundedLegacy: hitTestRectangleRoundedLegacy,
88737
88714
  hitTestRectangleRounded: hitTestRectangleRounded,
88738
88715
  hitTestRectangleLegacy: hitTestRectangleLegacy,
88739
88716
  hitTestRectangle: hitTestRectangle,