@wcardinal/wcardinal-ui 0.154.0 → 0.155.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-application-layer-options.d.ts +3 -4
- package/dist/types/wcardinal/ui/d-base-background.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-base-border.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-base-corner.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-base-outline.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-base-padding.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-chart-series-base-coordinate-container.d.ts +1 -2
- package/dist/types/wcardinal/ui/d-color-gradient-point-observable.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-diagram-canvas-data-map.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-diagram-canvas-id-map.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +2 -3
- package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +2 -3
- package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +8 -8
- package/dist/types/wcardinal/ui/d-input-and-label.d.ts +4 -5
- package/dist/types/wcardinal/ui/d-on-options.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-pagination-button-last.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-button-next.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-button-page.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-button-previous.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-button-top.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-dots.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination-page.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-pagination.d.ts +137 -44
- package/dist/types/wcardinal/ui/d-picker-color-gradient-view.d.ts +4 -5
- package/dist/types/wcardinal/ui/d-scalar-expression.d.ts +68 -66
- package/dist/types/wcardinal/ui/d-table-data-list-filter.d.ts +1 -2
- package/dist/types/wcardinal/ui/d-table-data-list-selection.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-table-data-selection.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-table-data-tree-filter.d.ts +1 -2
- package/dist/types/wcardinal/ui/d-table-data-tree-selection-impl.d.ts +1 -3
- package/dist/types/wcardinal/ui/index.d.ts +11 -3
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtimes.d.ts +4 -5
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-value-change-color.d.ts +5 -6
- package/dist/types/wcardinal/ui/shape/e-shape-capabilities.d.ts +1 -3
- package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-acceptor-impl.d.ts +1 -2
- package/dist/types/wcardinal/ui/shape/e-shape-deserializers.d.ts +2 -6
- package/dist/types/wcardinal/ui/shape/e-shape-runtimes.d.ts +2 -3
- package/dist/types/wcardinal/ui/shape/e-shape-text.d.ts +1 -3
- package/dist/types/wcardinal/ui/shape/e-shape-uploadeds.d.ts +1 -3
- package/dist/types/wcardinal/ui/shape/variant/create-line-of-any-uploaded.d.ts +1 -2
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-last.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-next.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-page.d.ts +9 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-previous.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-top.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.d.ts +10 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.d.ts +13 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination.d.ts +2 -1
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark.d.ts +2 -9
- package/dist/types/wcardinal/ui/theme/dark/index.d.ts +7 -3
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-last.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-next.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-page.d.ts +9 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-previous.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-top.d.ts +8 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dots.d.ts +10 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-page.d.ts +13 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination.d.ts +2 -1
- package/dist/types/wcardinal/ui/theme/white/d-theme-white.d.ts +2 -9
- package/dist/types/wcardinal/ui/theme/white/index.d.ts +7 -3
- package/dist/types/wcardinal/ui/util/dynamic-atlas.d.ts +2 -6
- package/dist/types/wcardinal/ui/util/dynamic-font-atlas-characters.d.ts +1 -3
- package/dist/types/wcardinal/ui/util/dynamic-sdf-font-atlases.d.ts +1 -3
- package/dist/types/wcardinal/ui/util/format-node/{format-noder-d.d.ts → format-node-rd.d.ts} +0 -0
- package/dist/types/wcardinal/ui/util/format-node/index.d.ts +31 -0
- package/dist/types/wcardinal/ui/util/index.d.ts +5 -0
- package/dist/types/wcardinal/ui/util/util-name.d.ts +1 -3
- package/dist/types/wcardinal/ui/util/util-svg-atlas-builder.d.ts +4 -12
- package/dist/wcardinal/ui/d-application-layer-options.js.map +1 -1
- package/dist/wcardinal/ui/d-base-background.js.map +1 -1
- package/dist/wcardinal/ui/d-base-border.js.map +1 -1
- package/dist/wcardinal/ui/d-base-corner.js.map +1 -1
- package/dist/wcardinal/ui/d-base-outline.js.map +1 -1
- package/dist/wcardinal/ui/d-base-padding.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-series-base-coordinate-container.js.map +1 -1
- package/dist/wcardinal/ui/d-color-gradient-point-observable.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-data-map.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-id-map.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
- package/dist/wcardinal/ui/d-input-and-label.js.map +1 -1
- package/dist/wcardinal/ui/d-on-options.js.map +1 -1
- package/dist/wcardinal/ui/d-pagination-button-last.js +18 -0
- package/dist/wcardinal/ui/d-pagination-button-last.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-button-next.js +18 -0
- package/dist/wcardinal/ui/d-pagination-button-next.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-button-page.js +18 -0
- package/dist/wcardinal/ui/d-pagination-button-page.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-button-previous.js +18 -0
- package/dist/wcardinal/ui/d-pagination-button-previous.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-button-top.js +18 -0
- package/dist/wcardinal/ui/d-pagination-button-top.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-dots.js +18 -0
- package/dist/wcardinal/ui/d-pagination-dots.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination-page.js +18 -0
- package/dist/wcardinal/ui/d-pagination-page.js.map +1 -0
- package/dist/wcardinal/ui/d-pagination.js +455 -212
- package/dist/wcardinal/ui/d-pagination.js.map +1 -1
- package/dist/wcardinal/ui/d-picker-color-gradient-view.js.map +1 -1
- package/dist/wcardinal/ui/d-scalar-expression.js +107 -79
- package/dist/wcardinal/ui/d-scalar-expression.js.map +1 -1
- package/dist/wcardinal/ui/d-table-data-list-filter.js.map +1 -1
- package/dist/wcardinal/ui/d-table-data-list-selection.js.map +1 -1
- package/dist/wcardinal/ui/d-table-data-selection.js.map +1 -1
- package/dist/wcardinal/ui/d-table-data-tree-filter.js.map +1 -1
- package/dist/wcardinal/ui/d-table-data-tree-selection-impl.js.map +1 -1
- package/dist/wcardinal/ui/index.js +11 -3
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-value-change-color.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-capabilities.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-acceptor-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-deserializers.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-runtimes.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-text.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-uploadeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-line-of-any-uploaded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/to-image-element.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-last.js +28 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-last.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-next.js +27 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-next.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-page.js +24 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-page.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-previous.js +27 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-previous.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-top.js +28 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-top.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js +36 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js +35 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-page.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination.js +5 -2
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/index.js +7 -3
- package/dist/wcardinal/ui/theme/dark/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-pagination.js +14 -6
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-pagination.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-last.js +28 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-last.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-next.js +27 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-next.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-page.js +24 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-page.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-previous.js +27 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-previous.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-top.js +28 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-top.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js +36 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js +35 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-page.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination.js +5 -2
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/index.js +7 -3
- package/dist/wcardinal/ui/theme/white/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-pagination.js +14 -6
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-pagination.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-atlas.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-characters.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-sdf-font-atlases.js.map +1 -1
- package/dist/wcardinal/ui/util/format-node/{format-noder-d.js → format-node-rd.js} +1 -1
- package/dist/wcardinal/ui/util/format-node/{format-noder-d.js.map → format-node-rd.js.map} +1 -1
- package/dist/wcardinal/ui/util/format-node/index.js +36 -0
- package/dist/wcardinal/ui/util/format-node/index.js.map +1 -0
- package/dist/wcardinal/ui/util/index.js +5 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/number-formatter-impl.js +1 -1
- package/dist/wcardinal/ui/util/number-formatter-impl.js.map +1 -1
- package/dist/wcardinal/ui/util/util-name.js.map +1 -1
- package/dist/wcardinal/ui/util/util-svg-atlas-builder.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +163 -39
- 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 +163 -39
- 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 +999 -446
- package/dist/wcardinal-ui.js +675 -370
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +3 -3
- package/dist/types/wcardinal/ui/d-pagination-dots-button.d.ts +0 -8
- package/dist/types/wcardinal/ui/d-pagination-dynamic-buttons.d.ts +0 -21
- package/dist/types/wcardinal/ui/d-pagination-navigation-button.d.ts +0 -8
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots-button.d.ts +0 -9
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dynamic-buttons.d.ts +0 -6
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-navigation-button.d.ts +0 -4
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dots-button.d.ts +0 -9
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dynamic-buttons.d.ts +0 -6
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-navigation-button.d.ts +0 -4
- package/dist/wcardinal/ui/d-pagination-dots-button.js +0 -18
- package/dist/wcardinal/ui/d-pagination-dots-button.js.map +0 -1
- package/dist/wcardinal/ui/d-pagination-dynamic-buttons.js +0 -81
- package/dist/wcardinal/ui/d-pagination-dynamic-buttons.js.map +0 -1
- package/dist/wcardinal/ui/d-pagination-navigation-button.js +0 -18
- package/dist/wcardinal/ui/d-pagination-navigation-button.js.map +0 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots-button.js +0 -24
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots-button.js.map +0 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dynamic-buttons.js +0 -18
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dynamic-buttons.js.map +0 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-navigation-button.js +0 -32
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-navigation-button.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots-button.js +0 -24
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots-button.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dynamic-buttons.js +0 -18
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dynamic-buttons.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-navigation-button.js +0 -32
- package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-navigation-button.js.map +0 -1
|
@@ -3,269 +3,512 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { __extends } from "tslib";
|
|
6
|
-
import { DButton } from "./d-button";
|
|
7
6
|
import { DLayoutHorizontal } from "./d-layout-horizontal";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { DPaginationDots } from "./d-pagination-dots";
|
|
8
|
+
import { DPaginationButtonLast } from "./d-pagination-button-last";
|
|
9
|
+
import { DPaginationButtonNext } from "./d-pagination-button-next";
|
|
10
|
+
import { DPaginationButtonPage } from "./d-pagination-button-page";
|
|
11
|
+
import { DPaginationButtonPrevious } from "./d-pagination-button-previous";
|
|
12
|
+
import { DPaginationButtonTop } from "./d-pagination-button-top";
|
|
13
|
+
import { isNumber } from "./util/is-number";
|
|
14
|
+
import { DPaginationPage } from "./d-pagination-page";
|
|
15
|
+
import { DLayoutSpace } from "./d-layout-space";
|
|
11
16
|
var DPagination = /** @class */ (function (_super) {
|
|
12
17
|
__extends(DPagination, _super);
|
|
13
|
-
function DPagination() {
|
|
14
|
-
|
|
18
|
+
function DPagination(options) {
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
|
+
var _this = _super.call(this, options) || this;
|
|
21
|
+
if (options != null) {
|
|
22
|
+
_this._size = (_b = (_a = options.size) !== null && _a !== void 0 ? _a : options.total) !== null && _b !== void 0 ? _b : 10;
|
|
23
|
+
_this._value = (_d = (_c = options.value) !== null && _c !== void 0 ? _c : options.selected) !== null && _d !== void 0 ? _d : 0;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
_this._size = 10;
|
|
27
|
+
_this._value = 0;
|
|
28
|
+
}
|
|
29
|
+
var buttonTop = _this.buttonTop;
|
|
30
|
+
var buttonPrevious = _this.buttonPrevious;
|
|
31
|
+
if (buttonTop != null) {
|
|
32
|
+
_this.addChild(buttonTop);
|
|
33
|
+
}
|
|
34
|
+
if (buttonPrevious != null) {
|
|
35
|
+
_this.addChild(buttonPrevious);
|
|
36
|
+
}
|
|
37
|
+
if (buttonTop != null || buttonPrevious != null) {
|
|
38
|
+
_this.addChild(_this.newSpace());
|
|
39
|
+
}
|
|
40
|
+
var buttonPages0 = _this.buttonPages0;
|
|
41
|
+
var buttonPages0Length = buttonPages0.length;
|
|
42
|
+
_this.addChild(buttonPages0[buttonPages0Length - 1]);
|
|
43
|
+
_this.addChild(_this.dots0);
|
|
44
|
+
for (var i = buttonPages0Length - 2; 0 <= i; --i) {
|
|
45
|
+
_this.addChild(buttonPages0[i]);
|
|
46
|
+
}
|
|
47
|
+
_this.addChild(_this.page);
|
|
48
|
+
var buttonPages1 = _this.buttonPages1;
|
|
49
|
+
var buttonPages1Length = buttonPages1.length;
|
|
50
|
+
for (var i = 0, imax = buttonPages1Length - 1; i < imax; ++i) {
|
|
51
|
+
_this.addChild(buttonPages1[i]);
|
|
52
|
+
}
|
|
53
|
+
_this.addChild(_this.dots1);
|
|
54
|
+
_this.addChild(buttonPages1[buttonPages1Length - 1]);
|
|
55
|
+
var buttonNext = _this.buttonNext;
|
|
56
|
+
var buttonLast = _this.buttonLast;
|
|
57
|
+
if (buttonNext != null || buttonLast != null) {
|
|
58
|
+
_this.addChild(_this.newSpace());
|
|
59
|
+
}
|
|
60
|
+
if (buttonNext != null) {
|
|
61
|
+
_this.addChild(buttonNext);
|
|
62
|
+
}
|
|
63
|
+
if (buttonLast != null) {
|
|
64
|
+
_this.addChild(buttonLast);
|
|
65
|
+
}
|
|
66
|
+
_this.update();
|
|
67
|
+
return _this;
|
|
15
68
|
}
|
|
16
|
-
DPagination.prototype.
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.DEFAULT_SELECTED = 0; // set default selected index page is page 0
|
|
21
|
-
// get total pages
|
|
22
|
-
this._total = options.total;
|
|
23
|
-
// get selected page
|
|
24
|
-
this._selected = (_a = options.selected) !== null && _a !== void 0 ? _a : this.DEFAULT_SELECTED;
|
|
25
|
-
// get button options
|
|
26
|
-
var button = options.button;
|
|
27
|
-
this._buttonOptions = {
|
|
28
|
-
first: !!(button === null || button === void 0 ? void 0 : button.first),
|
|
29
|
-
last: !!(button === null || button === void 0 ? void 0 : button.last),
|
|
30
|
-
width: button === null || button === void 0 ? void 0 : button.width
|
|
31
|
-
};
|
|
32
|
-
this.initButtons(this.getButtonWidth());
|
|
33
|
-
this.listenButtonClicked();
|
|
34
|
-
this.on("resize", function () {
|
|
35
|
-
_this._numberPageButtonVisible = _this.toNumberVisible();
|
|
36
|
-
_this.update();
|
|
69
|
+
DPagination.prototype.newSpace = function () {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
return new DLayoutSpace({
|
|
72
|
+
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()
|
|
37
73
|
});
|
|
38
74
|
};
|
|
75
|
+
Object.defineProperty(DPagination.prototype, "value", {
|
|
76
|
+
/**
|
|
77
|
+
* Returns a value that is an index of a current page.
|
|
78
|
+
*
|
|
79
|
+
* @returns a value that is an index of a selected page.
|
|
80
|
+
*/
|
|
81
|
+
get: function () {
|
|
82
|
+
return this._value;
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Sets a value that is an index of a current page.
|
|
86
|
+
*
|
|
87
|
+
* @param value a value that is an index of a page
|
|
88
|
+
*/
|
|
89
|
+
set: function (value) {
|
|
90
|
+
if (0 <= value && value < this._size && this._value !== value) {
|
|
91
|
+
this._value = value;
|
|
92
|
+
this.update();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
enumerable: false,
|
|
96
|
+
configurable: true
|
|
97
|
+
});
|
|
39
98
|
Object.defineProperty(DPagination.prototype, "selected", {
|
|
40
99
|
/**
|
|
41
|
-
*
|
|
100
|
+
* Returns an index of the selected page.
|
|
42
101
|
*
|
|
43
|
-
* @returns index of selected page.
|
|
102
|
+
* @returns an index of the selected page.
|
|
103
|
+
* @deprecated in favor of {@link value}.
|
|
44
104
|
*/
|
|
45
105
|
get: function () {
|
|
46
|
-
return this.
|
|
106
|
+
return this.value;
|
|
47
107
|
},
|
|
48
108
|
/**
|
|
49
|
-
*
|
|
109
|
+
* Selects a page.
|
|
50
110
|
*
|
|
51
|
-
* @param
|
|
111
|
+
* @param index an index of a page
|
|
112
|
+
* @deprecated in favor of {@link #value}.
|
|
52
113
|
*/
|
|
53
|
-
set: function (
|
|
54
|
-
|
|
55
|
-
|
|
114
|
+
set: function (index) {
|
|
115
|
+
this.value = index;
|
|
116
|
+
},
|
|
117
|
+
enumerable: false,
|
|
118
|
+
configurable: true
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(DPagination.prototype, "size", {
|
|
121
|
+
/**
|
|
122
|
+
* Returns a number of total pages.
|
|
123
|
+
*
|
|
124
|
+
* @returns a number of total pages.
|
|
125
|
+
*/
|
|
126
|
+
get: function () {
|
|
127
|
+
return this._size;
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Sets a number of total pages.
|
|
131
|
+
*
|
|
132
|
+
* @param size a number of pages
|
|
133
|
+
*/
|
|
134
|
+
set: function (size) {
|
|
135
|
+
if (0 <= size && this._size !== size) {
|
|
136
|
+
this._size = size;
|
|
137
|
+
if (size === 0) {
|
|
138
|
+
this._value = -1;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this._value = Math.max(0, Math.min(this._size - 1, this._value));
|
|
142
|
+
}
|
|
143
|
+
this.update();
|
|
56
144
|
}
|
|
57
|
-
this._selected = selected;
|
|
58
|
-
this.update();
|
|
59
145
|
},
|
|
60
146
|
enumerable: false,
|
|
61
147
|
configurable: true
|
|
62
148
|
});
|
|
63
149
|
Object.defineProperty(DPagination.prototype, "total", {
|
|
64
150
|
/**
|
|
65
|
-
*
|
|
151
|
+
* Returns a number of total pages.
|
|
66
152
|
*
|
|
67
|
-
* @returns number of total pages.
|
|
153
|
+
* @returns a number of total pages.
|
|
154
|
+
* @deprecated in favor of {@link size}
|
|
68
155
|
*/
|
|
69
156
|
get: function () {
|
|
70
|
-
return this.
|
|
157
|
+
return this.size;
|
|
71
158
|
},
|
|
72
159
|
/**
|
|
73
|
-
*
|
|
160
|
+
* Sets a number of total pages.
|
|
74
161
|
*
|
|
75
|
-
* @param total number of
|
|
162
|
+
* @param total a number of pages
|
|
163
|
+
* @deprecated in favor of {@link size}
|
|
76
164
|
*/
|
|
77
165
|
set: function (total) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
166
|
+
this.size = total;
|
|
167
|
+
},
|
|
168
|
+
enumerable: false,
|
|
169
|
+
configurable: true
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(DPagination.prototype, "dots0", {
|
|
172
|
+
get: function () {
|
|
173
|
+
var result = this._dots0;
|
|
174
|
+
if (result == null) {
|
|
175
|
+
result = this.newDots();
|
|
176
|
+
this._dots0 = result;
|
|
84
177
|
}
|
|
178
|
+
return result;
|
|
85
179
|
},
|
|
86
180
|
enumerable: false,
|
|
87
181
|
configurable: true
|
|
88
182
|
});
|
|
89
|
-
DPagination.prototype
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
183
|
+
Object.defineProperty(DPagination.prototype, "dots1", {
|
|
184
|
+
get: function () {
|
|
185
|
+
var result = this._dots1;
|
|
186
|
+
if (result == null) {
|
|
187
|
+
result = this.newDots();
|
|
188
|
+
this._dots1 = result;
|
|
95
189
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
190
|
+
return result;
|
|
191
|
+
},
|
|
192
|
+
enumerable: false,
|
|
193
|
+
configurable: true
|
|
194
|
+
});
|
|
195
|
+
DPagination.prototype.newDots = function () {
|
|
196
|
+
return new DPaginationDots();
|
|
197
|
+
};
|
|
198
|
+
Object.defineProperty(DPagination.prototype, "buttonLast", {
|
|
199
|
+
get: function () {
|
|
200
|
+
var result = this._buttonLast;
|
|
201
|
+
if (result === undefined) {
|
|
202
|
+
result = this.newButtonLast();
|
|
203
|
+
this._buttonLast = result;
|
|
101
204
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
205
|
+
return result;
|
|
206
|
+
},
|
|
207
|
+
enumerable: false,
|
|
208
|
+
configurable: true
|
|
209
|
+
});
|
|
210
|
+
DPagination.prototype.newButtonLast = function () {
|
|
211
|
+
var _this = this;
|
|
212
|
+
var _a, _b;
|
|
213
|
+
var last = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.last;
|
|
214
|
+
if (last !== null && last !== false && last !== undefined) {
|
|
215
|
+
var result = new DPaginationButtonLast(last !== true ? last : undefined);
|
|
216
|
+
result.on("active", function () {
|
|
217
|
+
_this.onButtonLastActive();
|
|
218
|
+
});
|
|
219
|
+
return result;
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
};
|
|
223
|
+
DPagination.prototype.onButtonLastActive = function () {
|
|
224
|
+
this.moveTo(this._size - 1);
|
|
225
|
+
};
|
|
226
|
+
DPagination.prototype.moveTo = function (index) {
|
|
227
|
+
if (0 <= index && index < this._size && this._value !== index) {
|
|
228
|
+
var oldIndex = this._value;
|
|
229
|
+
this._value = index;
|
|
230
|
+
this.emit("change", index, oldIndex, this);
|
|
231
|
+
this.update();
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
Object.defineProperty(DPagination.prototype, "buttonNext", {
|
|
235
|
+
get: function () {
|
|
236
|
+
var result = this._buttonNext;
|
|
237
|
+
if (result === undefined) {
|
|
238
|
+
result = this.newButtonNext();
|
|
239
|
+
this._buttonNext = result;
|
|
122
240
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
241
|
+
return result;
|
|
242
|
+
},
|
|
243
|
+
enumerable: false,
|
|
244
|
+
configurable: true
|
|
245
|
+
});
|
|
246
|
+
DPagination.prototype.newButtonNext = function () {
|
|
247
|
+
var _this = this;
|
|
248
|
+
var _a, _b;
|
|
249
|
+
var next = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.next;
|
|
250
|
+
if (next !== null && next !== false) {
|
|
251
|
+
var result = new DPaginationButtonNext(next !== true ? next : undefined);
|
|
252
|
+
result.on("active", function () {
|
|
253
|
+
_this.onButtonNextActive();
|
|
254
|
+
});
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
};
|
|
259
|
+
DPagination.prototype.onButtonNextActive = function () {
|
|
260
|
+
this.moveTo(this._value + 1);
|
|
261
|
+
};
|
|
262
|
+
Object.defineProperty(DPagination.prototype, "buttonPrevious", {
|
|
263
|
+
get: function () {
|
|
264
|
+
var result = this._buttonPrevious;
|
|
265
|
+
if (result === undefined) {
|
|
266
|
+
result = this.newButtonPrevious();
|
|
267
|
+
this._buttonPrevious = result;
|
|
128
268
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
269
|
+
return result;
|
|
270
|
+
},
|
|
271
|
+
enumerable: false,
|
|
272
|
+
configurable: true
|
|
273
|
+
});
|
|
274
|
+
DPagination.prototype.newButtonPrevious = function () {
|
|
275
|
+
var _this = this;
|
|
276
|
+
var _a, _b;
|
|
277
|
+
var previous = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.previous;
|
|
278
|
+
if (previous !== null && previous !== false) {
|
|
279
|
+
var result = new DPaginationButtonPrevious(previous !== true ? previous : undefined);
|
|
280
|
+
result.on("active", function () {
|
|
281
|
+
_this.onButtonPreviousActive();
|
|
282
|
+
});
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
return null;
|
|
286
|
+
};
|
|
287
|
+
DPagination.prototype.onButtonPreviousActive = function () {
|
|
288
|
+
this.moveTo(this._value - 1);
|
|
289
|
+
};
|
|
290
|
+
Object.defineProperty(DPagination.prototype, "buttonTop", {
|
|
291
|
+
get: function () {
|
|
292
|
+
var result = this._buttonTop;
|
|
293
|
+
if (result === undefined) {
|
|
294
|
+
result = this.newButtonTop();
|
|
295
|
+
this._buttonTop = result;
|
|
134
296
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
this
|
|
142
|
-
|
|
297
|
+
return result;
|
|
298
|
+
},
|
|
299
|
+
enumerable: false,
|
|
300
|
+
configurable: true
|
|
301
|
+
});
|
|
302
|
+
DPagination.prototype.newButtonTop = function () {
|
|
303
|
+
var _this = this;
|
|
304
|
+
var _a, _b;
|
|
305
|
+
var top = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.top;
|
|
306
|
+
if (top !== null && top !== false && top !== undefined) {
|
|
307
|
+
var result = new DPaginationButtonTop(top !== true ? top : undefined);
|
|
308
|
+
result.on("active", function () {
|
|
309
|
+
_this.onButtonTopActive();
|
|
310
|
+
});
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
143
314
|
};
|
|
144
|
-
DPagination.prototype.
|
|
315
|
+
DPagination.prototype.onButtonTopActive = function () {
|
|
316
|
+
this.moveTo(0);
|
|
317
|
+
};
|
|
318
|
+
DPagination.prototype.newButtonPage = function () {
|
|
145
319
|
var _this = this;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
_this.onClickPageButton(btn);
|
|
320
|
+
var _a, _b;
|
|
321
|
+
var result = new DPaginationButtonPage((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.page);
|
|
322
|
+
result.on("active", function () {
|
|
323
|
+
_this.onButtonPageActive(result);
|
|
151
324
|
});
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
});
|
|
161
|
-
this._nextBtn.on("active", function (btn) {
|
|
162
|
-
if (_this.selected !== _this._total + 1) {
|
|
163
|
-
_this.selected = _this._selected + 1;
|
|
325
|
+
return result;
|
|
326
|
+
};
|
|
327
|
+
Object.defineProperty(DPagination.prototype, "buttonPages0", {
|
|
328
|
+
get: function () {
|
|
329
|
+
var result = this._buttonPages0;
|
|
330
|
+
if (result == null) {
|
|
331
|
+
result = this.newButtonPages0();
|
|
332
|
+
this._buttonPages0 = result;
|
|
164
333
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
334
|
+
return result;
|
|
335
|
+
},
|
|
336
|
+
enumerable: false,
|
|
337
|
+
configurable: true
|
|
338
|
+
});
|
|
339
|
+
DPagination.prototype.newButtonPages0 = function () {
|
|
340
|
+
return [
|
|
341
|
+
this.newButtonPage(),
|
|
342
|
+
this.newButtonPage(),
|
|
343
|
+
this.newButtonPage(),
|
|
344
|
+
this.newButtonPage()
|
|
345
|
+
];
|
|
346
|
+
};
|
|
347
|
+
Object.defineProperty(DPagination.prototype, "buttonPages1", {
|
|
348
|
+
get: function () {
|
|
349
|
+
var result = this._buttonPages1;
|
|
350
|
+
if (result == null) {
|
|
351
|
+
result = this.newButtonPages1();
|
|
352
|
+
this._buttonPages1 = result;
|
|
169
353
|
}
|
|
170
|
-
|
|
354
|
+
return result;
|
|
355
|
+
},
|
|
356
|
+
enumerable: false,
|
|
357
|
+
configurable: true
|
|
358
|
+
});
|
|
359
|
+
DPagination.prototype.newButtonPages1 = function () {
|
|
360
|
+
return [
|
|
361
|
+
this.newButtonPage(),
|
|
362
|
+
this.newButtonPage(),
|
|
363
|
+
this.newButtonPage(),
|
|
364
|
+
this.newButtonPage()
|
|
365
|
+
];
|
|
171
366
|
};
|
|
172
|
-
DPagination.prototype
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var numberButtonsInRight = 0;
|
|
179
|
-
this.updateStaticButtons();
|
|
180
|
-
// Number displayed buttons from first button to selected button when select center button of all buttons.
|
|
181
|
-
// Not including selected button.
|
|
182
|
-
var numberButtonsFirstToCenter = Math.ceil((this._numberPageButtonVisible - 1) * 0.5);
|
|
183
|
-
var numberButtonsCenterToEnd = Math.floor((this._numberPageButtonVisible - 1) * 0.5);
|
|
184
|
-
if (this._selected < numberButtonsFirstToCenter) {
|
|
185
|
-
numberButtonsInLeft = this._selected;
|
|
186
|
-
numberButtonsInRight = this._numberPageButtonVisible - numberButtonsInLeft - 1;
|
|
187
|
-
}
|
|
188
|
-
else if (this._selected + numberButtonsCenterToEnd > this._total - 1) {
|
|
189
|
-
numberButtonsInRight = this._total - 1 - this.selected;
|
|
190
|
-
numberButtonsInLeft = this._numberPageButtonVisible - numberButtonsInRight - 1;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
numberButtonsInLeft = numberButtonsFirstToCenter;
|
|
194
|
-
numberButtonsInRight = numberButtonsCenterToEnd;
|
|
195
|
-
}
|
|
196
|
-
if (this._selected <= numberButtonsInLeft) {
|
|
197
|
-
startDynamic = 1;
|
|
198
|
-
dotsLeft = false;
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
startDynamic = this._selected - numberButtonsInLeft + 2;
|
|
202
|
-
dotsLeft = true;
|
|
203
|
-
}
|
|
204
|
-
if (this._selected + numberButtonsInRight >= this._total - 1) {
|
|
205
|
-
endDynamic = this._total - 2;
|
|
206
|
-
dotsRight = false;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
endDynamic = this._selected + numberButtonsInRight - 2;
|
|
210
|
-
dotsRight = true;
|
|
211
|
-
}
|
|
212
|
-
this._dynamicPageBtns.update({
|
|
213
|
-
start: startDynamic,
|
|
214
|
-
end: endDynamic,
|
|
215
|
-
selected: this._selected,
|
|
216
|
-
button: {
|
|
217
|
-
width: this.getButtonWidth(),
|
|
218
|
-
dotsLeft: dotsLeft,
|
|
219
|
-
dotsRight: dotsRight
|
|
367
|
+
Object.defineProperty(DPagination.prototype, "page", {
|
|
368
|
+
get: function () {
|
|
369
|
+
var result = this._page;
|
|
370
|
+
if (result == null) {
|
|
371
|
+
result = this.newPage();
|
|
372
|
+
this._page = result;
|
|
220
373
|
}
|
|
221
|
-
|
|
374
|
+
return result;
|
|
375
|
+
},
|
|
376
|
+
enumerable: false,
|
|
377
|
+
configurable: true
|
|
378
|
+
});
|
|
379
|
+
DPagination.prototype.newPage = function () {
|
|
380
|
+
var _a;
|
|
381
|
+
return new DPaginationPage((_a = this._options) === null || _a === void 0 ? void 0 : _a.page);
|
|
222
382
|
};
|
|
223
|
-
DPagination.prototype.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this._lastPageBtn.show();
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
this._lastPageBtn.hide();
|
|
383
|
+
DPagination.prototype.onButtonPageActive = function (button) {
|
|
384
|
+
var text = button.text;
|
|
385
|
+
if (isNumber(text)) {
|
|
386
|
+
this.moveTo(text - 1);
|
|
387
|
+
if (button.state.isFocused) {
|
|
388
|
+
button.state.isHovered = false;
|
|
389
|
+
this.page.focus();
|
|
390
|
+
}
|
|
235
391
|
}
|
|
236
|
-
var isFirst = this._selected === this.DEFAULT_SELECTED;
|
|
237
|
-
var isLast = this._selected === this._total - 1 || this._total === 0;
|
|
238
|
-
this._firstPageBtn.state.isActive = isFirst;
|
|
239
|
-
this._lastPageBtn.state.isActive = isLast;
|
|
240
|
-
this._goFirstBtn.state.isDisabled = isFirst;
|
|
241
|
-
this._previousBtn.state.isDisabled = isFirst;
|
|
242
|
-
this._nextBtn.state.isDisabled = isLast;
|
|
243
|
-
this._goLastBtn.state.isDisabled = isLast;
|
|
244
|
-
};
|
|
245
|
-
DPagination.prototype.getButtonWidth = function () {
|
|
246
|
-
return this._buttonOptions.width ? this._buttonOptions.width : this.theme.getButtonWidth();
|
|
247
392
|
};
|
|
248
|
-
DPagination.prototype.
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
393
|
+
DPagination.prototype.update = function () {
|
|
394
|
+
var size = this._size;
|
|
395
|
+
var value = this._value;
|
|
396
|
+
if (size <= 0) {
|
|
397
|
+
var buttonTop = this.buttonTop;
|
|
398
|
+
if (buttonTop != null) {
|
|
399
|
+
buttonTop.state.isEnabled = false;
|
|
400
|
+
}
|
|
401
|
+
var buttonPrevious = this.buttonPrevious;
|
|
402
|
+
if (buttonPrevious != null) {
|
|
403
|
+
buttonPrevious.state.isEnabled = false;
|
|
404
|
+
}
|
|
405
|
+
this.dots0.hide();
|
|
406
|
+
var buttonPages0 = this.buttonPages0;
|
|
407
|
+
for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
|
|
408
|
+
buttonPages0[i].hide();
|
|
409
|
+
}
|
|
410
|
+
this.page.hide();
|
|
411
|
+
var buttonPages1 = this.buttonPages1;
|
|
412
|
+
for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
|
|
413
|
+
buttonPages1[i].hide();
|
|
414
|
+
}
|
|
415
|
+
this.dots1.hide();
|
|
416
|
+
var buttonNext = this.buttonNext;
|
|
417
|
+
if (buttonNext != null) {
|
|
418
|
+
buttonNext.state.isEnabled = false;
|
|
419
|
+
}
|
|
420
|
+
var buttonLast = this.buttonLast;
|
|
421
|
+
if (buttonLast) {
|
|
422
|
+
buttonLast.state.isEnabled = false;
|
|
423
|
+
}
|
|
255
424
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
425
|
+
else {
|
|
426
|
+
var from = value - 2;
|
|
427
|
+
var to = value + 2;
|
|
428
|
+
if (from < 0) {
|
|
429
|
+
to = to - from;
|
|
430
|
+
from = 0;
|
|
431
|
+
}
|
|
432
|
+
else if (size <= to) {
|
|
433
|
+
var delta = to - size + 1;
|
|
434
|
+
to -= delta;
|
|
435
|
+
from -= delta;
|
|
436
|
+
}
|
|
437
|
+
var top_1 = false;
|
|
438
|
+
if (0 < from) {
|
|
439
|
+
top_1 = true;
|
|
440
|
+
from = Math.min(from + 1, value);
|
|
441
|
+
}
|
|
442
|
+
var last = false;
|
|
443
|
+
if (to < size - 1) {
|
|
444
|
+
last = true;
|
|
445
|
+
to = Math.max(to - 1, value);
|
|
446
|
+
}
|
|
447
|
+
var buttonTop = this.buttonTop;
|
|
448
|
+
if (buttonTop != null) {
|
|
449
|
+
buttonTop.state.isEnabled = 0 < value;
|
|
450
|
+
}
|
|
451
|
+
var buttonPrevious = this.buttonPrevious;
|
|
452
|
+
if (buttonPrevious != null) {
|
|
453
|
+
buttonPrevious.state.isEnabled = 0 < value;
|
|
454
|
+
}
|
|
455
|
+
if (top_1) {
|
|
456
|
+
this.dots0.show();
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.dots0.hide();
|
|
460
|
+
}
|
|
461
|
+
var buttonPages0 = this.buttonPages0;
|
|
462
|
+
for (var i = 0, imax = buttonPages0.length; i < imax; ++i) {
|
|
463
|
+
var index = value - i - 1;
|
|
464
|
+
var buttonPage = buttonPages0[i];
|
|
465
|
+
if (from <= index && index <= to) {
|
|
466
|
+
buttonPage.text = index + 1;
|
|
467
|
+
buttonPage.show();
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
if (top_1 && i === imax - 1) {
|
|
471
|
+
buttonPage.text = 1;
|
|
472
|
+
buttonPage.show();
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
buttonPage.hide();
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
this.page.text = value + 1;
|
|
480
|
+
var buttonPages1 = this.buttonPages1;
|
|
481
|
+
for (var i = 0, imax = buttonPages1.length; i < imax; ++i) {
|
|
482
|
+
var index = value + i + 1;
|
|
483
|
+
var buttonPage = buttonPages1[i];
|
|
484
|
+
if (from <= index && index <= to) {
|
|
485
|
+
buttonPage.text = index + 1;
|
|
486
|
+
buttonPage.show();
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
if (last && i === imax - 1) {
|
|
490
|
+
buttonPage.text = size;
|
|
491
|
+
buttonPage.show();
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
buttonPage.hide();
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (last) {
|
|
499
|
+
this.dots1.show();
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
this.dots1.hide();
|
|
503
|
+
}
|
|
504
|
+
var buttonNext = this.buttonNext;
|
|
505
|
+
if (buttonNext != null) {
|
|
506
|
+
buttonNext.state.isEnabled = value < size - 1;
|
|
507
|
+
}
|
|
508
|
+
var buttonLast = this.buttonLast;
|
|
509
|
+
if (buttonLast != null) {
|
|
510
|
+
buttonLast.state.isEnabled = value < size - 1;
|
|
511
|
+
}
|
|
269
512
|
}
|
|
270
513
|
};
|
|
271
514
|
DPagination.prototype.getType = function () {
|