@wcardinal/wcardinal-ui 0.339.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 (26) hide show
  1. package/dist/types/wcardinal/ui/d-pagination.d.ts +15 -3
  2. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.d.ts +6 -0
  3. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dots.d.ts +6 -0
  5. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-page.d.ts +1 -0
  6. package/dist/wcardinal/ui/d-pagination.js +355 -110
  7. package/dist/wcardinal/ui/d-pagination.js.map +1 -1
  8. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js +15 -3
  9. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js.map +1 -1
  10. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js +4 -0
  11. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js.map +1 -1
  12. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js +15 -3
  13. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js.map +1 -1
  14. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js +4 -0
  15. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js.map +1 -1
  16. package/dist/wcardinal-ui-theme-dark.js +17 -4
  17. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  18. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  19. package/dist/wcardinal-ui-theme-white.js +17 -4
  20. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  21. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  22. package/dist/wcardinal-ui.cjs.js +386 -116
  23. package/dist/wcardinal-ui.js +354 -110
  24. package/dist/wcardinal-ui.min.js +2 -2
  25. package/dist/wcardinal-ui.min.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.339.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
 
@@ -53989,9 +53989,9 @@ var DThemeWhitePagination = /** @class */ (function (_super) {
53989
53989
  */
53990
53990
  /* eslint-disable prettier/prettier */
53991
53991
  DThemeWhiteAtlas.add("pagination_dots", 21, 21, "<g>" +
53992
- "<circle cx=\"2\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53993
- "<circle cx=\"10.5\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
53994
- "<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\" />" +
53995
53995
  "</g>");
53996
53996
  /* eslint-enable prettier/prettier */
53997
53997
  var DThemeWhitePaginationDots = /** @class */ (function (_super) {
@@ -54005,6 +54005,9 @@ var DThemeWhitePaginationDots = /** @class */ (function (_super) {
54005
54005
  DThemeWhitePaginationDots.prototype.getHeight = function () {
54006
54006
  return 30;
54007
54007
  };
54008
+ DThemeWhitePaginationDots.prototype.getInteractive = function () {
54009
+ return DBaseInteractive.NONE;
54010
+ };
54008
54011
  DThemeWhitePaginationDots.prototype.newState = function (state) {
54009
54012
  _super.prototype.newState.call(this, state);
54010
54013
  state.isFocusable = false;
@@ -54012,6 +54015,12 @@ var DThemeWhitePaginationDots = /** @class */ (function (_super) {
54012
54015
  DThemeWhitePaginationDots.prototype.getImageSource = function (state) {
54013
54016
  return DThemeWhiteAtlas.mappings.pagination_dots;
54014
54017
  };
54018
+ DThemeWhitePaginationDots.prototype.getImageAlignHorizontal = function () {
54019
+ return DAlignHorizontal.CENTER;
54020
+ };
54021
+ DThemeWhitePaginationDots.prototype.getImageAlignWith = function () {
54022
+ return DAlignWith.BORDER;
54023
+ };
54015
54024
  return DThemeWhitePaginationDots;
54016
54025
  }(DThemeWhiteImageBase));
54017
54026
 
@@ -54151,6 +54160,10 @@ var DThemeWhitePaginationPage = /** @class */ (function (_super) {
54151
54160
  DThemeWhitePaginationPage.prototype.getHeight = function () {
54152
54161
  return 30;
54153
54162
  };
54163
+ DThemeWhitePaginationPage.prototype.newState = function (state) {
54164
+ _super.prototype.newState.call(this, state);
54165
+ state.isFocusable = false;
54166
+ };
54154
54167
  DThemeWhitePaginationPage.prototype.getTextStyleClipping = function () {
54155
54168
  return false;
54156
54169
  };
@@ -63249,9 +63262,9 @@ var DThemeDarkPagination = /** @class */ (function (_super) {
63249
63262
  */
63250
63263
  /* eslint-disable prettier/prettier */
63251
63264
  DThemeDarkAtlas.add("pagination_dots", 21, 21, "<g>" +
63252
- "<circle cx=\"2\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63253
- "<circle cx=\"10.5\" cy=\"15\" r=\"1.1\" fill=\"#fff\" stroke=\"none\" />" +
63254
- "<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\" />" +
63255
63268
  "</g>");
63256
63269
  /* eslint-enable prettier/prettier */
63257
63270
  var DThemeDarkPaginationDots = /** @class */ (function (_super) {
@@ -63265,6 +63278,9 @@ var DThemeDarkPaginationDots = /** @class */ (function (_super) {
63265
63278
  DThemeDarkPaginationDots.prototype.getHeight = function () {
63266
63279
  return 30;
63267
63280
  };
63281
+ DThemeDarkPaginationDots.prototype.getInteractive = function () {
63282
+ return DBaseInteractive.NONE;
63283
+ };
63268
63284
  DThemeDarkPaginationDots.prototype.newState = function (state) {
63269
63285
  _super.prototype.newState.call(this, state);
63270
63286
  state.isFocusable = false;
@@ -63272,6 +63288,12 @@ var DThemeDarkPaginationDots = /** @class */ (function (_super) {
63272
63288
  DThemeDarkPaginationDots.prototype.getImageSource = function (state) {
63273
63289
  return DThemeDarkAtlas.mappings.pagination_dots;
63274
63290
  };
63291
+ DThemeDarkPaginationDots.prototype.getImageAlignHorizontal = function () {
63292
+ return DAlignHorizontal.CENTER;
63293
+ };
63294
+ DThemeDarkPaginationDots.prototype.getImageAlignWith = function () {
63295
+ return DAlignWith.BORDER;
63296
+ };
63275
63297
  return DThemeDarkPaginationDots;
63276
63298
  }(DThemeDarkImageBase));
63277
63299
 
@@ -63411,6 +63433,10 @@ var DThemeDarkPaginationPage = /** @class */ (function (_super) {
63411
63433
  DThemeDarkPaginationPage.prototype.getHeight = function () {
63412
63434
  return 30;
63413
63435
  };
63436
+ DThemeDarkPaginationPage.prototype.newState = function (state) {
63437
+ _super.prototype.newState.call(this, state);
63438
+ state.isFocusable = false;
63439
+ };
63414
63440
  DThemeDarkPaginationPage.prototype.getTextStyleClipping = function () {
63415
63441
  return false;
63416
63442
  };
@@ -85188,21 +85214,22 @@ var DPagination = /** @class */ (function (_super) {
85188
85214
  _this._value = 0;
85189
85215
  }
85190
85216
  var buttonTop = _this.buttonTop;
85191
- var buttonPrevious = _this.buttonPrevious;
85192
85217
  if (buttonTop != null) {
85193
85218
  _this.addChild(buttonTop);
85194
85219
  }
85220
+ var buttonPrevious = _this.buttonPrevious;
85195
85221
  if (buttonPrevious != null) {
85196
85222
  _this.addChild(buttonPrevious);
85197
85223
  }
85198
- if (buttonTop != null || buttonPrevious != null) {
85199
- _this.addChild(_this.newSpace());
85224
+ var spaceLeft = _this.spaceLeft;
85225
+ if (spaceLeft != null) {
85226
+ _this.addChild(spaceLeft);
85200
85227
  }
85201
85228
  var buttonPages0 = _this.buttonPages0;
85202
85229
  var buttonPages0Length = buttonPages0.length;
85203
- _this.addChild(buttonPages0[buttonPages0Length - 1]);
85230
+ _this.addChild(buttonPages0[0]);
85204
85231
  _this.addChild(_this.dots0);
85205
- for (var i = buttonPages0Length - 2; 0 <= i; --i) {
85232
+ for (var i = 1; i < buttonPages0Length; ++i) {
85206
85233
  _this.addChild(buttonPages0[i]);
85207
85234
  }
85208
85235
  _this.addChild(_this.page);
@@ -85213,26 +85240,20 @@ var DPagination = /** @class */ (function (_super) {
85213
85240
  }
85214
85241
  _this.addChild(_this.dots1);
85215
85242
  _this.addChild(buttonPages1[buttonPages1Length - 1]);
85216
- var buttonNext = _this.buttonNext;
85217
- var buttonLast = _this.buttonLast;
85218
- if (buttonNext != null || buttonLast != null) {
85219
- _this.addChild(_this.newSpace());
85243
+ var spaceRight = _this.spaceRight;
85244
+ if (spaceRight != null) {
85245
+ _this.addChild(spaceRight);
85220
85246
  }
85247
+ var buttonNext = _this.buttonNext;
85221
85248
  if (buttonNext != null) {
85222
85249
  _this.addChild(buttonNext);
85223
85250
  }
85251
+ var buttonLast = _this.buttonLast;
85224
85252
  if (buttonLast != null) {
85225
85253
  _this.addChild(buttonLast);
85226
85254
  }
85227
- _this.update();
85228
85255
  return _this;
85229
85256
  }
85230
- DPagination.prototype.newSpace = function () {
85231
- var _a, _b, _c;
85232
- return new DLayoutSpace({
85233
- 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()
85234
- });
85235
- };
85236
85257
  Object.defineProperty(DPagination.prototype, "value", {
85237
85258
  /**
85238
85259
  * Returns a value that is an index of a current page.
@@ -85250,7 +85271,8 @@ var DPagination = /** @class */ (function (_super) {
85250
85271
  set: function (value) {
85251
85272
  if (0 <= value && value < this._size && this._value !== value) {
85252
85273
  this._value = value;
85253
- this.update();
85274
+ this.toDirty();
85275
+ DApplications.update(this);
85254
85276
  }
85255
85277
  },
85256
85278
  enumerable: false,
@@ -85301,7 +85323,8 @@ var DPagination = /** @class */ (function (_super) {
85301
85323
  else {
85302
85324
  this._value = Math.max(0, Math.min(this._size - 1, this._value));
85303
85325
  }
85304
- this.update();
85326
+ this.toDirty();
85327
+ DApplications.update(this);
85305
85328
  }
85306
85329
  },
85307
85330
  enumerable: false,
@@ -85389,7 +85412,8 @@ var DPagination = /** @class */ (function (_super) {
85389
85412
  var oldIndex = this._value;
85390
85413
  this._value = index;
85391
85414
  this.emit("change", index, oldIndex, this);
85392
- this.update();
85415
+ this.toDirty();
85416
+ DApplications.update(this);
85393
85417
  }
85394
85418
  };
85395
85419
  Object.defineProperty(DPagination.prototype, "buttonNext", {
@@ -85505,6 +85529,16 @@ var DPagination = /** @class */ (function (_super) {
85505
85529
  this.newButtonPage()
85506
85530
  ];
85507
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
+ };
85508
85542
  Object.defineProperty(DPagination.prototype, "buttonPages1", {
85509
85543
  get: function () {
85510
85544
  var result = this._buttonPages1;
@@ -85525,6 +85559,16 @@ var DPagination = /** @class */ (function (_super) {
85525
85559
  this.newButtonPage()
85526
85560
  ];
85527
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
+ };
85528
85572
  Object.defineProperty(DPagination.prototype, "page", {
85529
85573
  get: function () {
85530
85574
  var result = this._page;
@@ -85551,121 +85595,347 @@ var DPagination = /** @class */ (function (_super) {
85551
85595
  }
85552
85596
  }
85553
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
+ };
85554
85658
  DPagination.prototype.update = function () {
85555
85659
  var size = this._size;
85556
85660
  var value = this._value;
85557
85661
  if (size <= 0) {
85558
- var buttonTop = this.buttonTop;
85559
- if (buttonTop != null) {
85560
- buttonTop.state.isEnabled = false;
85561
- }
85562
- var buttonPrevious = this.buttonPrevious;
85563
- if (buttonPrevious != null) {
85564
- buttonPrevious.state.isEnabled = false;
85565
- }
85566
- this.hideDots(this.dots0);
85567
- var buttonPages0 = this.buttonPages0;
85568
- for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85569
- 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);
85570
85667
  }
85571
- this.hidePage(this.page);
85572
- var buttonPages1 = this.buttonPages1;
85573
- for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85574
- this.hidePage(buttonPages1[i]);
85668
+ else {
85669
+ this.doUpdate1(value, size);
85575
85670
  }
85576
- this.hideDots(this.dots1);
85577
- var buttonNext = this.buttonNext;
85578
- if (buttonNext != null) {
85579
- 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;
85580
85719
  }
85581
- var buttonLast = this.buttonLast;
85582
- if (buttonLast) {
85583
- 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;
85584
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);
85585
85750
  }
85586
85751
  else {
85587
- var from = value - 2;
85588
- var to = value + 2;
85589
- if (from < 0) {
85590
- to = to - from;
85591
- from = 0;
85592
- }
85593
- else if (size <= to) {
85594
- var delta = to - size + 1;
85595
- to -= delta;
85596
- from -= delta;
85597
- }
85598
- var top_1 = false;
85599
- if (0 < from) {
85600
- top_1 = true;
85601
- from = Math.min(from + 1, value);
85602
- }
85603
- var last = false;
85604
- if (to < size - 1) {
85605
- last = true;
85606
- to = Math.max(to - 1, value);
85607
- }
85608
- var buttonTop = this.buttonTop;
85609
- if (buttonTop != null) {
85610
- buttonTop.state.isEnabled = 0 < value;
85611
- }
85612
- var buttonPrevious = this.buttonPrevious;
85613
- if (buttonPrevious != null) {
85614
- buttonPrevious.state.isEnabled = 0 < value;
85615
- }
85616
- if (top_1) {
85617
- 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);
85618
85762
  }
85619
85763
  else {
85620
- this.hideDots(this.dots0);
85621
- }
85622
- var buttonPages0 = this.buttonPages0;
85623
- for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
85624
- var index = value - i - 1;
85625
- var buttonPage = buttonPages0[i];
85626
- if (from <= index && index <= to && 0 <= index) {
85627
- 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
+ }
85628
85800
  }
85629
85801
  else {
85630
- if (top_1 && i === imax - 1) {
85631
- 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);
85632
85823
  }
85633
85824
  else {
85634
- this.hidePage(buttonPage);
85825
+ this.doUpdate2(value, size, 4, 4, 0, 0);
85635
85826
  }
85636
85827
  }
85637
85828
  }
85638
- this.showPage(this.page, value);
85639
- var buttonPages1 = this.buttonPages1;
85640
- for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
85641
- var index = value + i + 1;
85642
- var buttonPage = buttonPages1[i];
85643
- if (from <= index && index <= to && index < size) {
85644
- 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
+ }
85645
85852
  }
85646
- else {
85647
- if (last && i === imax - 1) {
85648
- 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);
85649
85894
  }
85650
85895
  else {
85651
- this.hidePage(buttonPage);
85896
+ this.hidePage(buttonPages1[i]);
85652
85897
  }
85653
85898
  }
85654
- }
85655
- if (last) {
85656
- this.showDots(this.dots1, to + 1, size - 2);
85657
- }
85658
- else {
85659
85899
  this.hideDots(this.dots1);
85660
- }
85661
- var buttonNext = this.buttonNext;
85662
- if (buttonNext != null) {
85663
- buttonNext.state.isEnabled = value < size - 1;
85664
- }
85665
- var buttonLast = this.buttonLast;
85666
- if (buttonLast != null) {
85667
- buttonLast.state.isEnabled = value < size - 1;
85668
- }
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;
85669
85939
  }
85670
85940
  };
85671
85941
  DPagination.prototype.showPage = function (button, index) {