@wcardinal/wcardinal-ui 0.338.0 → 0.340.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.
Files changed (29) hide show
  1. package/dist/types/wcardinal/ui/d-pagination.d.ts +15 -3
  2. package/dist/types/wcardinal/ui/shape/e-shape-capability.d.ts +12 -0
  3. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.d.ts +6 -0
  4. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.d.ts +1 -0
  5. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dots.d.ts +6 -0
  6. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-page.d.ts +1 -0
  7. package/dist/wcardinal/ui/d-pagination.js +355 -110
  8. package/dist/wcardinal/ui/d-pagination.js.map +1 -1
  9. package/dist/wcardinal/ui/shape/e-shape-capability.js +17 -2
  10. package/dist/wcardinal/ui/shape/e-shape-capability.js.map +1 -1
  11. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js +15 -3
  12. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js.map +1 -1
  13. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js +4 -0
  14. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js.map +1 -1
  15. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js +15 -3
  16. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js.map +1 -1
  17. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js +4 -0
  18. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js.map +1 -1
  19. package/dist/wcardinal-ui-theme-dark.js +17 -4
  20. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  21. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  22. package/dist/wcardinal-ui-theme-white.js +17 -4
  23. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  24. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  25. package/dist/wcardinal-ui.cjs.js +403 -118
  26. package/dist/wcardinal-ui.js +371 -112
  27. package/dist/wcardinal-ui.min.js +2 -2
  28. package/dist/wcardinal-ui.min.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.338.0
2
+ Winter Cardinal UI v0.340.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -4464,13 +4464,16 @@ var CURSOR$1 = 0x20000;
4464
4464
  var ORDER_IN_LAYER = 0x40000;
4465
4465
  var CHILDREN$1 = 0x80000;
4466
4466
  var DATA_MAPPING = 0x100000;
4467
+ var LINE = 0x200000;
4468
+ var LINE_TAIL = 0x400000;
4469
+ var LINE_HEAD = 0x800000;
4467
4470
  var COORDINATE = POSITION | WIDTH$1 | HEIGHT$1 | ROTATION$1 | SKEW;
4468
- var SHAPE = REPLACING | GROUPING | FILL$1 | STROKE$1;
4471
+ var SHAPE = REPLACING | GROUPING | FILL$1 | STROKE$1 | LINE | LINE_TAIL | LINE_HEAD;
4469
4472
  var LAYER = ORDER_IN_LAYER;
4470
4473
  var PRIMITIVE = ID | COORDINATE | SHAPE | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
4471
4474
  var GROUP = PRIMITIVE | UNGROUPING;
4472
4475
  var EMBEDDED = ID | COORDINATE | REPLACING | GROUPING | TEXT$2 | DATA | ACTION | LAYER | DATA_MAPPING;
4473
- var CONNECTOR = ID | REPLACING | FILL$1 | STROKE$1 | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
4476
+ var CONNECTOR = ID | REPLACING | FILL$1 | STROKE$1 | LINE | LINE_TAIL | LINE_HEAD | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
4474
4477
  var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
4475
4478
  var EShapeCapability = {
4476
4479
  NONE: NONE,
@@ -4562,6 +4565,18 @@ var EShapeCapability = {
4562
4565
  * Allows shape children to be modified.
4563
4566
  */
4564
4567
  CHILDREN: CHILDREN$1,
4568
+ /**
4569
+ * Allows shape line to be modified.
4570
+ */
4571
+ LINE: LINE,
4572
+ /**
4573
+ * Allows shape line tail to be modified.
4574
+ */
4575
+ LINE_TAIL: LINE_TAIL,
4576
+ /**
4577
+ * Allows shape line head to be modified.
4578
+ */
4579
+ LINE_HEAD: LINE_HEAD,
4565
4580
  COORDINATE: COORDINATE,
4566
4581
  SHAPE: SHAPE,
4567
4582
  LAYER: LAYER,
@@ -53974,9 +53989,9 @@ var DThemeWhitePagination = /** @class */ (function (_super) {
53974
53989
  */
53975
53990
  /* eslint-disable prettier/prettier */
53976
53991
  DThemeWhiteAtlas.add("pagination_dots", 21, 21, "<g>" +
53977
- "<circle cx=\"2\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53978
- "<circle cx=\"10.5\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53979
- "<circle cx=\"19\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53992
+ "<circle cx=\"2\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53993
+ "<circle cx=\"10.5\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53994
+ "<circle cx=\"19\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53980
53995
  "</g>");
53981
53996
  /* eslint-enable prettier/prettier */
53982
53997
  var DThemeWhitePaginationDots = /** @class */ (function (_super) {
@@ -53990,6 +54005,9 @@ var DThemeWhitePaginationDots = /** @class */ (function (_super) {
53990
54005
  DThemeWhitePaginationDots.prototype.getHeight = function () {
53991
54006
  return 30;
53992
54007
  };
54008
+ DThemeWhitePaginationDots.prototype.getInteractive = function () {
54009
+ return DBaseInteractive.NONE;
54010
+ };
53993
54011
  DThemeWhitePaginationDots.prototype.newState = function (state) {
53994
54012
  _super.prototype.newState.call(this, state);
53995
54013
  state.isFocusable = false;
@@ -53997,6 +54015,12 @@ var DThemeWhitePaginationDots = /** @class */ (function (_super) {
53997
54015
  DThemeWhitePaginationDots.prototype.getImageSource = function (state) {
53998
54016
  return DThemeWhiteAtlas.mappings.pagination_dots;
53999
54017
  };
54018
+ DThemeWhitePaginationDots.prototype.getImageAlignHorizontal = function () {
54019
+ return DAlignHorizontal.CENTER;
54020
+ };
54021
+ DThemeWhitePaginationDots.prototype.getImageAlignWith = function () {
54022
+ return DAlignWith.BORDER;
54023
+ };
54000
54024
  return DThemeWhitePaginationDots;
54001
54025
  }(DThemeWhiteImageBase));
54002
54026
 
@@ -54136,6 +54160,10 @@ var DThemeWhitePaginationPage = /** @class */ (function (_super) {
54136
54160
  DThemeWhitePaginationPage.prototype.getHeight = function () {
54137
54161
  return 30;
54138
54162
  };
54163
+ DThemeWhitePaginationPage.prototype.newState = function (state) {
54164
+ _super.prototype.newState.call(this, state);
54165
+ state.isFocusable = false;
54166
+ };
54139
54167
  DThemeWhitePaginationPage.prototype.getTextStyleClipping = function () {
54140
54168
  return false;
54141
54169
  };
@@ -63234,9 +63262,9 @@ var DThemeDarkPagination = /** @class */ (function (_super) {
63234
63262
  */
63235
63263
  /* eslint-disable prettier/prettier */
63236
63264
  DThemeDarkAtlas.add("pagination_dots", 21, 21, "<g>" +
63237
- "<circle cx=\"2\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63238
- "<circle cx=\"10.5\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63239
- "<circle cx=\"19\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63265
+ "<circle cx=\"2\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63266
+ "<circle cx=\"10.5\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63267
+ "<circle cx=\"19\" cy=\"11\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63240
63268
  "</g>");
63241
63269
  /* eslint-enable prettier/prettier */
63242
63270
  var DThemeDarkPaginationDots = /** @class */ (function (_super) {
@@ -63250,6 +63278,9 @@ var DThemeDarkPaginationDots = /** @class */ (function (_super) {
63250
63278
  DThemeDarkPaginationDots.prototype.getHeight = function () {
63251
63279
  return 30;
63252
63280
  };
63281
+ DThemeDarkPaginationDots.prototype.getInteractive = function () {
63282
+ return DBaseInteractive.NONE;
63283
+ };
63253
63284
  DThemeDarkPaginationDots.prototype.newState = function (state) {
63254
63285
  _super.prototype.newState.call(this, state);
63255
63286
  state.isFocusable = false;
@@ -63257,6 +63288,12 @@ var DThemeDarkPaginationDots = /** @class */ (function (_super) {
63257
63288
  DThemeDarkPaginationDots.prototype.getImageSource = function (state) {
63258
63289
  return DThemeDarkAtlas.mappings.pagination_dots;
63259
63290
  };
63291
+ DThemeDarkPaginationDots.prototype.getImageAlignHorizontal = function () {
63292
+ return DAlignHorizontal.CENTER;
63293
+ };
63294
+ DThemeDarkPaginationDots.prototype.getImageAlignWith = function () {
63295
+ return DAlignWith.BORDER;
63296
+ };
63260
63297
  return DThemeDarkPaginationDots;
63261
63298
  }(DThemeDarkImageBase));
63262
63299
 
@@ -63396,6 +63433,10 @@ var DThemeDarkPaginationPage = /** @class */ (function (_super) {
63396
63433
  DThemeDarkPaginationPage.prototype.getHeight = function () {
63397
63434
  return 30;
63398
63435
  };
63436
+ DThemeDarkPaginationPage.prototype.newState = function (state) {
63437
+ _super.prototype.newState.call(this, state);
63438
+ state.isFocusable = false;
63439
+ };
63399
63440
  DThemeDarkPaginationPage.prototype.getTextStyleClipping = function () {
63400
63441
  return false;
63401
63442
  };
@@ -85173,21 +85214,22 @@ var DPagination = /** @class */ (function (_super) {
85173
85214
  _this._value = 0;
85174
85215
  }
85175
85216
  var buttonTop = _this.buttonTop;
85176
- var buttonPrevious = _this.buttonPrevious;
85177
85217
  if (buttonTop != null) {
85178
85218
  _this.addChild(buttonTop);
85179
85219
  }
85220
+ var buttonPrevious = _this.buttonPrevious;
85180
85221
  if (buttonPrevious != null) {
85181
85222
  _this.addChild(buttonPrevious);
85182
85223
  }
85183
- if (buttonTop != null || buttonPrevious != null) {
85184
- _this.addChild(_this.newSpace());
85224
+ var spaceLeft = _this.spaceLeft;
85225
+ if (spaceLeft != null) {
85226
+ _this.addChild(spaceLeft);
85185
85227
  }
85186
85228
  var buttonPages0 = _this.buttonPages0;
85187
85229
  var buttonPages0Length = buttonPages0.length;
85188
- _this.addChild(buttonPages0[buttonPages0Length - 1]);
85230
+ _this.addChild(buttonPages0[0]);
85189
85231
  _this.addChild(_this.dots0);
85190
- for (var i = buttonPages0Length - 2; 0 <= i; --i) {
85232
+ for (var i = 1; i < buttonPages0Length; ++i) {
85191
85233
  _this.addChild(buttonPages0[i]);
85192
85234
  }
85193
85235
  _this.addChild(_this.page);
@@ -85198,26 +85240,20 @@ var DPagination = /** @class */ (function (_super) {
85198
85240
  }
85199
85241
  _this.addChild(_this.dots1);
85200
85242
  _this.addChild(buttonPages1[buttonPages1Length - 1]);
85201
- var buttonNext = _this.buttonNext;
85202
- var buttonLast = _this.buttonLast;
85203
- if (buttonNext != null || buttonLast != null) {
85204
- _this.addChild(_this.newSpace());
85243
+ var spaceRight = _this.spaceRight;
85244
+ if (spaceRight != null) {
85245
+ _this.addChild(spaceRight);
85205
85246
  }
85247
+ var buttonNext = _this.buttonNext;
85206
85248
  if (buttonNext != null) {
85207
85249
  _this.addChild(buttonNext);
85208
85250
  }
85251
+ var buttonLast = _this.buttonLast;
85209
85252
  if (buttonLast != null) {
85210
85253
  _this.addChild(buttonLast);
85211
85254
  }
85212
- _this.update();
85213
85255
  return _this;
85214
85256
  }
85215
- DPagination.prototype.newSpace = function () {
85216
- var _a, _b, _c;
85217
- return new DLayoutSpace({
85218
- width: (_c = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.space) !== null && _c !== void 0 ? _c : this.theme.getButtonSpace()
85219
- });
85220
- };
85221
85257
  Object.defineProperty(DPagination.prototype, "value", {
85222
85258
  /**
85223
85259
  * Returns a value that is an index of a current page.
@@ -85235,7 +85271,8 @@ var DPagination = /** @class */ (function (_super) {
85235
85271
  set: function (value) {
85236
85272
  if (0 <= value && value < this._size && this._value !== value) {
85237
85273
  this._value = value;
85238
- this.update();
85274
+ this.toDirty();
85275
+ DApplications.update(this);
85239
85276
  }
85240
85277
  },
85241
85278
  enumerable: false,
@@ -85286,7 +85323,8 @@ var DPagination = /** @class */ (function (_super) {
85286
85323
  else {
85287
85324
  this._value = Math.max(0, Math.min(this._size - 1, this._value));
85288
85325
  }
85289
- this.update();
85326
+ this.toDirty();
85327
+ DApplications.update(this);
85290
85328
  }
85291
85329
  },
85292
85330
  enumerable: false,
@@ -85374,7 +85412,8 @@ var DPagination = /** @class */ (function (_super) {
85374
85412
  var oldIndex = this._value;
85375
85413
  this._value = index;
85376
85414
  this.emit("change", index, oldIndex, this);
85377
- this.update();
85415
+ this.toDirty();
85416
+ DApplications.update(this);
85378
85417
  }
85379
85418
  };
85380
85419
  Object.defineProperty(DPagination.prototype, "buttonNext", {
@@ -85490,6 +85529,16 @@ var DPagination = /** @class */ (function (_super) {
85490
85529
  this.newButtonPage()
85491
85530
  ];
85492
85531
  };
85532
+ DPagination.prototype.allocButtonPages0 = function (size) {
85533
+ var buttonPages0 = this.buttonPages0;
85534
+ var buttonPages0Length = buttonPages0.length;
85535
+ var index = this.getChildIndex(buttonPages0[buttonPages0Length - 1]) + 1;
85536
+ for (var i = 0, imax = size - buttonPages0Length; i < imax; ++i) {
85537
+ var buttonPage = this.newButtonPage();
85538
+ this.addChildAt(buttonPage, index + i);
85539
+ buttonPages0.push(buttonPage);
85540
+ }
85541
+ };
85493
85542
  Object.defineProperty(DPagination.prototype, "buttonPages1", {
85494
85543
  get: function () {
85495
85544
  var result = this._buttonPages1;
@@ -85510,6 +85559,16 @@ var DPagination = /** @class */ (function (_super) {
85510
85559
  this.newButtonPage()
85511
85560
  ];
85512
85561
  };
85562
+ DPagination.prototype.allocButtonPages1 = function (size) {
85563
+ var buttonPages1 = this.buttonPages1;
85564
+ var buttonPages1Length = buttonPages1.length;
85565
+ var index = this.getChildIndex(buttonPages1[0]);
85566
+ for (var i = 0, imax = size - buttonPages1Length; i < imax; ++i) {
85567
+ var buttonPage = this.newButtonPage();
85568
+ this.addChildAt(buttonPage, index);
85569
+ buttonPages1.unshift(buttonPage);
85570
+ }
85571
+ };
85513
85572
  Object.defineProperty(DPagination.prototype, "page", {
85514
85573
  get: function () {
85515
85574
  var result = this._page;
@@ -85536,121 +85595,347 @@ var DPagination = /** @class */ (function (_super) {
85536
85595
  }
85537
85596
  }
85538
85597
  };
85598
+ Object.defineProperty(DPagination.prototype, "spaceLeft", {
85599
+ get: function () {
85600
+ var result = this._spaceLeft;
85601
+ if (result === undefined) {
85602
+ result = this.newSpaceLeft();
85603
+ this._spaceLeft = result;
85604
+ }
85605
+ return result;
85606
+ },
85607
+ enumerable: false,
85608
+ configurable: true
85609
+ });
85610
+ DPagination.prototype.newSpaceLeft = function () {
85611
+ if (this.buttonTop != null || this.buttonPrevious != null) {
85612
+ return this.newSpace();
85613
+ }
85614
+ return null;
85615
+ };
85616
+ Object.defineProperty(DPagination.prototype, "spaceRight", {
85617
+ get: function () {
85618
+ var result = this._spaceRight;
85619
+ if (result === undefined) {
85620
+ result = this.newSpaceRight();
85621
+ this._spaceRight = result;
85622
+ }
85623
+ return result;
85624
+ },
85625
+ enumerable: false,
85626
+ configurable: true
85627
+ });
85628
+ DPagination.prototype.newSpaceRight = function () {
85629
+ if (this.buttonLast != null || this.buttonNext != null) {
85630
+ return this.newSpace();
85631
+ }
85632
+ return null;
85633
+ };
85634
+ DPagination.prototype.newSpace = function () {
85635
+ var _a, _b;
85636
+ var space = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.space;
85637
+ if (space !== null && space !== false) {
85638
+ if (space === true || space === undefined) {
85639
+ return new DLayoutSpace({
85640
+ weight: 1
85641
+ });
85642
+ }
85643
+ else if (isNumber(space)) {
85644
+ return new DLayoutSpace({
85645
+ width: space
85646
+ });
85647
+ }
85648
+ else {
85649
+ return new DLayoutSpace(space);
85650
+ }
85651
+ }
85652
+ return null;
85653
+ };
85654
+ DPagination.prototype.onReflow = function () {
85655
+ this.update();
85656
+ _super.prototype.onReflow.call(this);
85657
+ };
85539
85658
  DPagination.prototype.update = function () {
85540
85659
  var size = this._size;
85541
85660
  var value = this._value;
85542
85661
  if (size <= 0) {
85543
- var buttonTop = this.buttonTop;
85544
- if (buttonTop != null) {
85545
- buttonTop.state.isEnabled = false;
85546
- }
85547
- var buttonPrevious = this.buttonPrevious;
85548
- if (buttonPrevious != null) {
85549
- buttonPrevious.state.isEnabled = false;
85550
- }
85551
- this.hideDots(this.dots0);
85552
- var buttonPages0 = this.buttonPages0;
85553
- for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85554
- this.hidePage(buttonPages0[i]);
85662
+ this.doUpdate0(value, size);
85663
+ }
85664
+ else {
85665
+ if (this._auto.width.isOn) {
85666
+ this.doUpdate2(value, size, 0, 0, 0, 0);
85555
85667
  }
85556
- this.hidePage(this.page);
85557
- var buttonPages1 = this.buttonPages1;
85558
- for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85559
- this.hidePage(buttonPages1[i]);
85668
+ else {
85669
+ this.doUpdate1(value, size);
85560
85670
  }
85561
- this.hideDots(this.dots1);
85562
- var buttonNext = this.buttonNext;
85563
- if (buttonNext != null) {
85564
- buttonNext.state.isEnabled = false;
85671
+ }
85672
+ };
85673
+ DPagination.prototype.doUpdate0 = function (value, size) {
85674
+ var buttonTop = this.buttonTop;
85675
+ if (buttonTop != null) {
85676
+ buttonTop.state.isEnabled = false;
85677
+ }
85678
+ var buttonPrevious = this.buttonPrevious;
85679
+ if (buttonPrevious != null) {
85680
+ buttonPrevious.state.isEnabled = false;
85681
+ }
85682
+ this.hideDots(this.dots0);
85683
+ var buttonPages0 = this.buttonPages0;
85684
+ for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85685
+ this.hidePage(buttonPages0[i]);
85686
+ }
85687
+ this.hidePage(this.page);
85688
+ var buttonPages1 = this.buttonPages1;
85689
+ for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85690
+ this.hidePage(buttonPages1[i]);
85691
+ }
85692
+ this.hideDots(this.dots1);
85693
+ var buttonNext = this.buttonNext;
85694
+ if (buttonNext != null) {
85695
+ buttonNext.state.isEnabled = false;
85696
+ }
85697
+ var buttonLast = this.buttonLast;
85698
+ if (buttonLast) {
85699
+ buttonLast.state.isEnabled = false;
85700
+ }
85701
+ };
85702
+ DPagination.prototype.doUpdate1 = function (value, size) {
85703
+ var required = 0;
85704
+ var nrequired = 0;
85705
+ var buttonTop = this.buttonTop;
85706
+ if (buttonTop != null) {
85707
+ required += buttonTop.width;
85708
+ nrequired += 1;
85709
+ }
85710
+ var buttonPrevious = this.buttonPrevious;
85711
+ if (buttonPrevious != null) {
85712
+ required += buttonPrevious.width;
85713
+ nrequired += 1;
85714
+ }
85715
+ var spaceLeft = this.spaceLeft;
85716
+ if (spaceLeft != null) {
85717
+ if (spaceLeft.weight < 0) {
85718
+ required += spaceLeft.width;
85565
85719
  }
85566
- var buttonLast = this.buttonLast;
85567
- if (buttonLast) {
85568
- buttonLast.state.isEnabled = false;
85720
+ nrequired += 1;
85721
+ }
85722
+ var page = this.page;
85723
+ required += page.width;
85724
+ nrequired += 1;
85725
+ var spaceRight = this.spaceRight;
85726
+ if (spaceRight != null) {
85727
+ if (spaceRight.weight < 0) {
85728
+ required += spaceRight.width;
85569
85729
  }
85730
+ nrequired += 1;
85731
+ }
85732
+ var buttonNext = this.buttonNext;
85733
+ if (buttonNext != null) {
85734
+ required += buttonNext.width;
85735
+ nrequired += 1;
85736
+ }
85737
+ var buttonLast = this.buttonLast;
85738
+ if (buttonLast) {
85739
+ required += buttonLast.width;
85740
+ nrequired += 1;
85741
+ }
85742
+ var marginHorizontal = this._margin.horizontal;
85743
+ if (2 <= nrequired) {
85744
+ required += (nrequired - 1) * marginHorizontal;
85745
+ }
85746
+ var padding = this.padding;
85747
+ var space = this.width - (padding.getLeft() + padding.getRight());
85748
+ if (space <= required) {
85749
+ this.doUpdate2(value, size, 4, 4, 0, 0);
85570
85750
  }
85571
85751
  else {
85572
- var from = value - 2;
85573
- var to = value + 2;
85574
- if (from < 0) {
85575
- to = to - from;
85576
- from = 0;
85577
- }
85578
- else if (size <= to) {
85579
- var delta = to - size + 1;
85580
- to -= delta;
85581
- from -= delta;
85582
- }
85583
- var top_1 = false;
85584
- if (0 < from) {
85585
- top_1 = true;
85586
- from = Math.min(from + 1, value);
85587
- }
85588
- var last = false;
85589
- if (to < size - 1) {
85590
- last = true;
85591
- to = Math.max(to - 1, value);
85592
- }
85593
- var buttonTop = this.buttonTop;
85594
- if (buttonTop != null) {
85595
- buttonTop.state.isEnabled = 0 < value;
85596
- }
85597
- var buttonPrevious = this.buttonPrevious;
85598
- if (buttonPrevious != null) {
85599
- buttonPrevious.state.isEnabled = 0 < value;
85600
- }
85601
- if (top_1) {
85602
- this.showDots(this.dots0, 1, from - 1);
85752
+ var buttonPages0 = this.buttonPages0;
85753
+ var buttonPage0Width = buttonPages0[0].width;
85754
+ var nrequired0 = value;
85755
+ var required0 = nrequired0 * (buttonPage0Width + marginHorizontal);
85756
+ var buttonPages1 = this.buttonPages1;
85757
+ var buttonPage1Width = buttonPages1[0].width;
85758
+ var nrequired1 = size - (value + 1);
85759
+ var required1 = nrequired1 * (buttonPage1Width + marginHorizontal);
85760
+ if (required + required0 + required1 <= space) {
85761
+ this.doUpdate2(value, size, 0, 0, 0, 0);
85603
85762
  }
85604
85763
  else {
85605
- this.hideDots(this.dots0);
85606
- }
85607
- var buttonPages0 = this.buttonPages0;
85608
- for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85609
- var index = value - i - 1;
85610
- var buttonPage = buttonPages0[i];
85611
- if (from <= index && index <= to && 0 <= index) {
85612
- this.showPage(buttonPage, index);
85764
+ var dots1 = this.dots1;
85765
+ var dots1Width = dots1.width;
85766
+ var dots0 = this.dots0;
85767
+ var dots0Width = dots0.width;
85768
+ var m0 = marginHorizontal + buttonPage0Width;
85769
+ var m1 = marginHorizontal + buttonPage1Width;
85770
+ var required0n = dots0Width + m0;
85771
+ var required1n = dots1Width + m1;
85772
+ var required0m = required0n + m0;
85773
+ var required1m = required1n + m1;
85774
+ if (required0 <= required1) {
85775
+ if (3 <= nrequired1 && required + required0 + required1m <= space) {
85776
+ var n1 = Math.floor((space - (required + required0 + required1m)) / m1);
85777
+ this.doUpdate2(value, size, 0, 1, 0, n1);
85778
+ }
85779
+ else if (2 <= nrequired1 && required + required0 + required1n <= space) {
85780
+ this.doUpdate2(value, size, 0, 2, 0, 0);
85781
+ }
85782
+ else if (3 <= nrequired0 &&
85783
+ 2 <= nrequired1 &&
85784
+ required + required0m + required1n <= space) {
85785
+ this.doUpdate2(value, size, 1, 2, 0, 0);
85786
+ }
85787
+ else if (2 <= nrequired0 &&
85788
+ 2 <= nrequired1 &&
85789
+ required + required0n + required1n <= space) {
85790
+ this.doUpdate2(value, size, 2, 2, 0, 0);
85791
+ }
85792
+ else if (1 <= nrequired0 &&
85793
+ 1 <= nrequired1 &&
85794
+ required + dots0Width + dots1Width <= space) {
85795
+ this.doUpdate2(value, size, 3, 3, 0, 0);
85796
+ }
85797
+ else {
85798
+ this.doUpdate2(value, size, 4, 4, 0, 0);
85799
+ }
85613
85800
  }
85614
85801
  else {
85615
- if (top_1 && i === imax - 1) {
85616
- this.showPage(buttonPage, 0);
85802
+ if (3 <= nrequired0 && required + required0m + required1 <= space) {
85803
+ var n0 = Math.floor((space - (required + required0m + required1)) / m0);
85804
+ this.doUpdate2(value, size, 1, 0, n0, 0);
85805
+ }
85806
+ else if (2 <= nrequired0 && required + required0n + required1 <= space) {
85807
+ this.doUpdate2(value, size, 2, 0, 0, 0);
85808
+ }
85809
+ else if (2 <= nrequired0 &&
85810
+ 3 <= nrequired1 &&
85811
+ required + required0n + required1m <= space) {
85812
+ this.doUpdate2(value, size, 2, 1, 0, 0);
85813
+ }
85814
+ else if (2 <= nrequired0 &&
85815
+ 2 <= nrequired1 &&
85816
+ required + required0n + required1n <= space) {
85817
+ this.doUpdate2(value, size, 2, 2, 0, 0);
85818
+ }
85819
+ else if (1 <= nrequired0 &&
85820
+ 1 <= nrequired1 &&
85821
+ required + dots0Width + dots1Width <= space) {
85822
+ this.doUpdate2(value, size, 3, 3, 0, 0);
85617
85823
  }
85618
85824
  else {
85619
- this.hidePage(buttonPage);
85825
+ this.doUpdate2(value, size, 4, 4, 0, 0);
85620
85826
  }
85621
85827
  }
85622
85828
  }
85623
- this.showPage(this.page, value);
85624
- var buttonPages1 = this.buttonPages1;
85625
- for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85626
- var index = value + i + 1;
85627
- var buttonPage = buttonPages1[i];
85628
- if (from <= index && index <= to && index < size) {
85629
- this.showPage(buttonPage, index);
85829
+ }
85830
+ };
85831
+ DPagination.prototype.doUpdate2 = function (value, size, left, right, nleft1, nright1) {
85832
+ var buttonTop = this.buttonTop;
85833
+ if (buttonTop != null) {
85834
+ buttonTop.state.isEnabled = 0 < value;
85835
+ }
85836
+ var buttonPrevious = this.buttonPrevious;
85837
+ if (buttonPrevious != null) {
85838
+ buttonPrevious.state.isEnabled = 0 < value;
85839
+ }
85840
+ var buttonPages0 = this.buttonPages0;
85841
+ switch (left) {
85842
+ case 0:
85843
+ this.hideDots(this.dots0);
85844
+ this.allocButtonPages0(value);
85845
+ for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85846
+ if (i < value) {
85847
+ this.showPage(buttonPages0[i], i);
85848
+ }
85849
+ else {
85850
+ this.hidePage(buttonPages0[i]);
85851
+ }
85630
85852
  }
85631
- else {
85632
- if (last && i === imax - 1) {
85633
- this.showPage(buttonPage, size - 1);
85853
+ break;
85854
+ case 1:
85855
+ this.showDots(this.dots0, 1, value - 2);
85856
+ this.allocButtonPages0(2 + nleft1);
85857
+ this.showPage(buttonPages0[0], 0);
85858
+ for (var i = 1, imax = buttonPages0.length - nleft1 - 1; i < imax; ++i) {
85859
+ this.hidePage(buttonPages0[i]);
85860
+ }
85861
+ for (var i = 0, imax = 1 + nleft1; i < imax; ++i) {
85862
+ this.showPage(buttonPages0[buttonPages0.length - imax + i], value - 1 - (imax - 1) + i);
85863
+ }
85864
+ break;
85865
+ case 2:
85866
+ this.showDots(this.dots0, 0, value - 2);
85867
+ for (var i = 0, imax = buttonPages0.length - 1; i < imax; ++i) {
85868
+ this.hidePage(buttonPages0[i]);
85869
+ }
85870
+ this.showPage(buttonPages0[buttonPages0.length - 1], value - 1);
85871
+ break;
85872
+ case 3:
85873
+ this.showDots(this.dots0, 0, value - 1);
85874
+ for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85875
+ this.hidePage(buttonPages0[i]);
85876
+ }
85877
+ break;
85878
+ case 4:
85879
+ this.hideDots(this.dots0);
85880
+ for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85881
+ this.hidePage(buttonPages0[i]);
85882
+ }
85883
+ break;
85884
+ }
85885
+ this.showPage(this.page, value);
85886
+ var buttonPages1 = this.buttonPages1;
85887
+ switch (right) {
85888
+ case 0:
85889
+ this.allocButtonPages1(size - (value + 1));
85890
+ for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85891
+ var j = value + 1 + i;
85892
+ if (j < size) {
85893
+ this.showPage(buttonPages1[i], j);
85634
85894
  }
85635
85895
  else {
85636
- this.hidePage(buttonPage);
85896
+ this.hidePage(buttonPages1[i]);
85637
85897
  }
85638
85898
  }
85639
- }
85640
- if (last) {
85641
- this.showDots(this.dots1, to + 1, size - 2);
85642
- }
85643
- else {
85644
85899
  this.hideDots(this.dots1);
85645
- }
85646
- var buttonNext = this.buttonNext;
85647
- if (buttonNext != null) {
85648
- buttonNext.state.isEnabled = value < size - 1;
85649
- }
85650
- var buttonLast = this.buttonLast;
85651
- if (buttonLast != null) {
85652
- buttonLast.state.isEnabled = value < size - 1;
85653
- }
85900
+ break;
85901
+ case 1:
85902
+ this.allocButtonPages1(2 + nright1);
85903
+ for (var i = 0, imax = 1 + nright1; i < imax; ++i) {
85904
+ this.showPage(buttonPages1[i], value + 1 + i);
85905
+ }
85906
+ for (var i = 1 + nright1, imax = buttonPages1.length - 1; i < imax; ++i) {
85907
+ this.hidePage(buttonPages1[i]);
85908
+ }
85909
+ this.showPage(buttonPages1[buttonPages1.length - 1], size - 1);
85910
+ this.showDots(this.dots1, value + 2, size - 2);
85911
+ break;
85912
+ case 2:
85913
+ this.showPage(buttonPages1[0], value + 1);
85914
+ for (var i = 1, imax = buttonPages1.length; i < imax; ++i) {
85915
+ this.hidePage(buttonPages1[i]);
85916
+ }
85917
+ this.showDots(this.dots1, value + 2, size - 1);
85918
+ break;
85919
+ case 3:
85920
+ for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85921
+ this.hidePage(buttonPages1[i]);
85922
+ }
85923
+ this.showDots(this.dots1, value + 1, size - 1);
85924
+ break;
85925
+ case 4:
85926
+ for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85927
+ this.hidePage(buttonPages1[i]);
85928
+ }
85929
+ this.hideDots(this.dots1);
85930
+ break;
85931
+ }
85932
+ var buttonNext = this.buttonNext;
85933
+ if (buttonNext != null) {
85934
+ buttonNext.state.isEnabled = value < size - 1;
85935
+ }
85936
+ var buttonLast = this.buttonLast;
85937
+ if (buttonLast != null) {
85938
+ buttonLast.state.isEnabled = value < size - 1;
85654
85939
  }
85655
85940
  };
85656
85941
  DPagination.prototype.showPage = function (button, index) {