@wcardinal/wcardinal-ui 0.309.0 → 0.310.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/types/wcardinal/ui/d-base-state-and-value.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-base-state-matcher.d.ts +1 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker-datum-impl.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker-impl.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-base-state-set-blinker.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +51 -18
- package/dist/types/wcardinal/ui/d-base-state-set-sub-datum-impl.d.ts +17 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub-datum.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub-impl.d.ts +15 -0
- package/dist/types/wcardinal/ui/d-base-state-set-sub.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker-datum-impl.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker-impl.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-base-state-set-ticker.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-base-state-set.d.ts +38 -8
- package/dist/types/wcardinal/ui/d-base.d.ts +23 -1
- package/dist/types/wcardinal/ui/d-chart-axis-base-guide-container.d.ts +21 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-container.d.ts +14 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.d.ts +41 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape.d.ts +80 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide-simple.d.ts +32 -0
- package/dist/types/wcardinal/ui/d-chart-axis-guide.d.ts +14 -0
- package/dist/types/wcardinal/ui/d-chart-axis.d.ts +2 -0
- package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +7 -4
- package/dist/types/wcardinal/ui/d-dynamic-text-measure-result.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +4 -3
- package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +16 -1
- package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +7 -6
- package/dist/types/wcardinal/ui/d-links.d.ts +2 -1
- package/dist/types/wcardinal/ui/d-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/index.d.ts +18 -0
- package/dist/types/wcardinal/ui/shape/index.d.ts +2 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-text-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-font.d.ts +2 -0
- package/dist/wcardinal/ui/d-base-state-and-value.js +2 -0
- package/dist/wcardinal/ui/d-base-state-and-value.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-matcher.js +2 -0
- package/dist/wcardinal/ui/d-base-state-matcher.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js +17 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js +16 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-blinker.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-impl.js +298 -129
- package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js +75 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-datum.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-impl.js +73 -0
- package/dist/wcardinal/ui/d-base-state-set-sub-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-sub.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-sub.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js +17 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js +16 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker.js +2 -0
- package/dist/wcardinal/ui/d-base-state-set-ticker.js.map +1 -0
- package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
- package/dist/wcardinal/ui/d-base.js +34 -2
- package/dist/wcardinal/ui/d-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js +75 -0
- package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -0
- package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js +23 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-guide-container.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-container.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +328 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +123 -0
- package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis-guide.js +2 -0
- package/dist/wcardinal/ui/d-chart-axis-guide.js.map +1 -0
- package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js +17 -10
- package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure-result.js +22 -0
- package/dist/wcardinal/ui/d-dynamic-text-measure-result.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-measure.js +14 -10
- package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text-style.js +107 -6
- package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
- package/dist/wcardinal/ui/d-dynamic-text.js +52 -29
- package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
- package/dist/wcardinal/ui/d-links.js +18 -1
- package/dist/wcardinal/ui/d-links.js.map +1 -1
- package/dist/wcardinal/ui/d-text-base.js +6 -3
- package/dist/wcardinal/ui/d-text-base.js.map +1 -1
- package/dist/wcardinal/ui/index.js +18 -0
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js +2 -2
- package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +2 -0
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js +3 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js +3 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js.map +1 -1
- package/dist/wcardinal/ui/util/util-font.js +18 -11
- package/dist/wcardinal/ui/util/util-font.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +4 -1
- 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 +4 -1
- 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 +1404 -275
- package/dist/wcardinal-ui.js +1398 -275
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,26 +3,88 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { DBaseState } from "./d-base-state";
|
|
6
|
+
import { DBaseStateSetBlinkerImpl } from "./d-base-state-set-blinker-impl";
|
|
7
|
+
import { DBaseStateSetTickerImpl } from "./d-base-state-set-ticker-impl";
|
|
8
|
+
import { isArray } from "./util/is-array";
|
|
6
9
|
import { isFunction } from "./util/is-function";
|
|
10
|
+
import { isNumber } from "./util/is-number";
|
|
7
11
|
import { isString } from "./util/is-string";
|
|
8
12
|
var DBaseStateSetImpl = /** @class */ (function () {
|
|
9
13
|
function DBaseStateSetImpl() {
|
|
10
|
-
this._local = new
|
|
14
|
+
this._local = new Map();
|
|
11
15
|
this._parent = null;
|
|
12
16
|
}
|
|
13
|
-
DBaseStateSetImpl.prototype
|
|
14
|
-
|
|
17
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
|
|
18
|
+
get: function () {
|
|
19
|
+
return this._local;
|
|
20
|
+
},
|
|
21
|
+
enumerable: false,
|
|
22
|
+
configurable: true
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
|
|
25
|
+
get: function () {
|
|
26
|
+
return this._parent;
|
|
27
|
+
},
|
|
28
|
+
set: function (parent) {
|
|
29
|
+
if (this._parent !== parent) {
|
|
30
|
+
this.begin();
|
|
31
|
+
this._parent = parent;
|
|
32
|
+
this.end();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
|
|
39
|
+
this._parent = oldState;
|
|
40
|
+
this.begin();
|
|
41
|
+
this._parent = newState;
|
|
42
|
+
this.end();
|
|
15
43
|
};
|
|
16
|
-
DBaseStateSetImpl.prototype
|
|
17
|
-
|
|
44
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "blinker", {
|
|
45
|
+
get: function () {
|
|
46
|
+
var result = this._blinker;
|
|
47
|
+
if (result == null) {
|
|
48
|
+
result = this.newBlinker();
|
|
49
|
+
this._blinker = result;
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
},
|
|
53
|
+
enumerable: false,
|
|
54
|
+
configurable: true
|
|
55
|
+
});
|
|
56
|
+
DBaseStateSetImpl.prototype.newBlinker = function () {
|
|
57
|
+
return new DBaseStateSetBlinkerImpl(this);
|
|
18
58
|
};
|
|
19
|
-
DBaseStateSetImpl.prototype
|
|
20
|
-
|
|
21
|
-
|
|
59
|
+
Object.defineProperty(DBaseStateSetImpl.prototype, "ticker", {
|
|
60
|
+
get: function () {
|
|
61
|
+
var result = this._ticker;
|
|
62
|
+
if (result == null) {
|
|
63
|
+
result = this.newTicker();
|
|
64
|
+
this._ticker = result;
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
DBaseStateSetImpl.prototype.newTicker = function () {
|
|
72
|
+
return new DBaseStateSetTickerImpl(this);
|
|
22
73
|
};
|
|
23
|
-
DBaseStateSetImpl.prototype.
|
|
24
|
-
var
|
|
25
|
-
return
|
|
74
|
+
DBaseStateSetImpl.prototype.is = function (state, value) {
|
|
75
|
+
var v = this._local.get(state);
|
|
76
|
+
return v !== undefined && (value === undefined || value === v);
|
|
77
|
+
};
|
|
78
|
+
DBaseStateSetImpl.prototype.in = function (state, value) {
|
|
79
|
+
return this.is(state, value) || this.under(state, value);
|
|
80
|
+
};
|
|
81
|
+
DBaseStateSetImpl.prototype.on = function (state, value) {
|
|
82
|
+
var parent = this._parent;
|
|
83
|
+
return parent != null && parent.is(state, value);
|
|
84
|
+
};
|
|
85
|
+
DBaseStateSetImpl.prototype.under = function (state, value) {
|
|
86
|
+
var parent = this._parent;
|
|
87
|
+
return parent != null && parent.in(state, value);
|
|
26
88
|
};
|
|
27
89
|
DBaseStateSetImpl.prototype.lock = function (callOnChange) {
|
|
28
90
|
return this;
|
|
@@ -36,35 +98,78 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
36
98
|
DBaseStateSetImpl.prototype.end = function () {
|
|
37
99
|
return this;
|
|
38
100
|
};
|
|
39
|
-
DBaseStateSetImpl.prototype.checkAdded = function (added) {
|
|
40
|
-
|
|
101
|
+
DBaseStateSetImpl.prototype.checkAdded = function (added, value) {
|
|
102
|
+
var v = this._local.get(added);
|
|
103
|
+
return v === undefined || v !== value;
|
|
41
104
|
};
|
|
42
|
-
DBaseStateSetImpl.prototype.add = function (state) {
|
|
43
|
-
if (
|
|
105
|
+
DBaseStateSetImpl.prototype.add = function (state, value) {
|
|
106
|
+
if (value === void 0) { value = null; }
|
|
107
|
+
if (this.checkAdded(state, value)) {
|
|
44
108
|
this.begin();
|
|
45
|
-
this._local.
|
|
109
|
+
this._local.set(state, value);
|
|
46
110
|
this.end();
|
|
47
111
|
}
|
|
48
112
|
return this;
|
|
49
113
|
};
|
|
50
|
-
DBaseStateSetImpl.prototype.
|
|
114
|
+
DBaseStateSetImpl.prototype.checkAddedsString = function (states) {
|
|
115
|
+
var local = this._local;
|
|
116
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
117
|
+
var v = local.get(states[i]);
|
|
118
|
+
if (v === undefined || v !== null) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
};
|
|
124
|
+
DBaseStateSetImpl.prototype.checkAddedsObject = function (states) {
|
|
51
125
|
var local = this._local;
|
|
52
126
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
53
|
-
|
|
127
|
+
var state = states[i];
|
|
128
|
+
var v = local.get(state.state);
|
|
129
|
+
if (v === undefined || v !== state.value) {
|
|
54
130
|
return true;
|
|
55
131
|
}
|
|
56
132
|
}
|
|
57
133
|
return false;
|
|
58
134
|
};
|
|
59
|
-
DBaseStateSetImpl.prototype.addAll = function (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (
|
|
135
|
+
DBaseStateSetImpl.prototype.addAll = function (first) {
|
|
136
|
+
if (isString(first)) {
|
|
137
|
+
return this.addAllString(arguments); // eslint-disable-line prefer-rest-params
|
|
138
|
+
}
|
|
139
|
+
else if (isArray(first)) {
|
|
140
|
+
if (0 < first.length) {
|
|
141
|
+
var element = first[0];
|
|
142
|
+
if (isString(element)) {
|
|
143
|
+
return this.addAllString(first);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return this.addAllObject(first);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
return this.addAllObject(arguments); // eslint-disable-line prefer-rest-params
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
DBaseStateSetImpl.prototype.addAllString = function (states) {
|
|
156
|
+
if (this.checkAddedsString(states)) {
|
|
157
|
+
this.begin();
|
|
158
|
+
var local = this._local;
|
|
159
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
160
|
+
local.set(states[i], null);
|
|
161
|
+
}
|
|
162
|
+
this.end();
|
|
163
|
+
}
|
|
164
|
+
return this;
|
|
165
|
+
};
|
|
166
|
+
DBaseStateSetImpl.prototype.addAllObject = function (states) {
|
|
167
|
+
if (this.checkAddedsObject(states)) {
|
|
64
168
|
this.begin();
|
|
65
169
|
var local = this._local;
|
|
66
170
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
67
|
-
|
|
171
|
+
var state = states[i];
|
|
172
|
+
local.set(state.state, state.value);
|
|
68
173
|
}
|
|
69
174
|
this.end();
|
|
70
175
|
}
|
|
@@ -81,7 +186,7 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
81
186
|
}
|
|
82
187
|
return this;
|
|
83
188
|
};
|
|
84
|
-
DBaseStateSetImpl.prototype.
|
|
189
|
+
DBaseStateSetImpl.prototype.checkRemovedsString = function (states) {
|
|
85
190
|
var local = this._local;
|
|
86
191
|
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
87
192
|
if (local.has(states[i])) {
|
|
@@ -90,120 +195,211 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
90
195
|
}
|
|
91
196
|
return false;
|
|
92
197
|
};
|
|
93
|
-
DBaseStateSetImpl.prototype.
|
|
94
|
-
var _this = this;
|
|
198
|
+
DBaseStateSetImpl.prototype.checkRemovedsObject = function (states) {
|
|
95
199
|
var local = this._local;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
200
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
201
|
+
if (local.has(states[i].state)) {
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
};
|
|
207
|
+
DBaseStateSetImpl.prototype.removeAll = function (first) {
|
|
208
|
+
if (isFunction(first)) {
|
|
209
|
+
return this.removeAllMatcher(first);
|
|
210
|
+
}
|
|
211
|
+
else if (isString(first)) {
|
|
212
|
+
return this.removeAllString(arguments); // eslint-disable-line prefer-rest-params
|
|
213
|
+
}
|
|
214
|
+
else if (isArray(first)) {
|
|
215
|
+
if (0 < first.length) {
|
|
216
|
+
var element = first[0];
|
|
217
|
+
if (isString(element)) {
|
|
218
|
+
return this.removeAllString(first);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
return this.removeAllObject(first);
|
|
105
222
|
}
|
|
106
|
-
});
|
|
107
|
-
if (isDirty_1) {
|
|
108
|
-
this.end();
|
|
109
223
|
}
|
|
224
|
+
return this;
|
|
110
225
|
}
|
|
111
226
|
else {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
227
|
+
return this.removeAllObject(arguments); // eslint-disable-line prefer-rest-params
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
DBaseStateSetImpl.prototype.removeAllMatcher = function (matcher) {
|
|
231
|
+
var _this = this;
|
|
232
|
+
var isDirty = false;
|
|
233
|
+
var local = this._local;
|
|
234
|
+
local.forEach(function (value, state) {
|
|
235
|
+
if (matcher(state)) {
|
|
236
|
+
if (!isDirty) {
|
|
237
|
+
isDirty = true;
|
|
238
|
+
_this.begin();
|
|
119
239
|
}
|
|
120
|
-
|
|
240
|
+
local.delete(state);
|
|
121
241
|
}
|
|
242
|
+
});
|
|
243
|
+
if (isDirty) {
|
|
244
|
+
this.end();
|
|
122
245
|
}
|
|
123
246
|
return this;
|
|
124
247
|
};
|
|
125
|
-
DBaseStateSetImpl.prototype.
|
|
126
|
-
|
|
127
|
-
if (0 < local.size) {
|
|
248
|
+
DBaseStateSetImpl.prototype.removeAllString = function (states) {
|
|
249
|
+
if (this.checkRemovedsString(states)) {
|
|
128
250
|
this.begin();
|
|
129
|
-
local.
|
|
251
|
+
var local = this._local;
|
|
252
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
253
|
+
local.delete(states[i]);
|
|
254
|
+
}
|
|
255
|
+
this.end();
|
|
256
|
+
}
|
|
257
|
+
return this;
|
|
258
|
+
};
|
|
259
|
+
DBaseStateSetImpl.prototype.removeAllObject = function (states) {
|
|
260
|
+
if (this.checkRemovedsObject(states)) {
|
|
261
|
+
this.begin();
|
|
262
|
+
var local = this._local;
|
|
263
|
+
for (var i = 0, imax = states.length; i < imax; ++i) {
|
|
264
|
+
local.delete(states[i].state);
|
|
265
|
+
}
|
|
130
266
|
this.end();
|
|
131
267
|
}
|
|
132
268
|
return this;
|
|
133
269
|
};
|
|
134
|
-
DBaseStateSetImpl.prototype.set = function (
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
this.add(
|
|
270
|
+
DBaseStateSetImpl.prototype.set = function (first, second, third) {
|
|
271
|
+
if (second === true) {
|
|
272
|
+
if (first != null) {
|
|
273
|
+
this.add(first);
|
|
138
274
|
}
|
|
139
275
|
}
|
|
140
|
-
else if (
|
|
141
|
-
if (
|
|
142
|
-
this.remove(
|
|
276
|
+
else if (second === false) {
|
|
277
|
+
if (first != null) {
|
|
278
|
+
this.remove(first);
|
|
143
279
|
}
|
|
144
280
|
}
|
|
145
|
-
else {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (removed != null) {
|
|
150
|
-
if (this.checkAdded(added) || this.checkRemoved(removed)) {
|
|
151
|
-
this.begin();
|
|
152
|
-
this._local.add(added).delete(removed);
|
|
153
|
-
this.end();
|
|
154
|
-
}
|
|
281
|
+
else if (second == null || isNumber(second)) {
|
|
282
|
+
if (third === true) {
|
|
283
|
+
if (first != null) {
|
|
284
|
+
this.add(first, second);
|
|
155
285
|
}
|
|
156
|
-
|
|
157
|
-
|
|
286
|
+
}
|
|
287
|
+
else if (third === false) {
|
|
288
|
+
if (first != null) {
|
|
289
|
+
this.remove(first);
|
|
158
290
|
}
|
|
159
291
|
}
|
|
160
|
-
else
|
|
161
|
-
this.
|
|
292
|
+
else {
|
|
293
|
+
return this.doSet(first, second, third);
|
|
162
294
|
}
|
|
163
295
|
}
|
|
296
|
+
else {
|
|
297
|
+
return this.doSet(first, null, second);
|
|
298
|
+
}
|
|
164
299
|
return this;
|
|
165
300
|
};
|
|
166
|
-
DBaseStateSetImpl.prototype.
|
|
167
|
-
if (
|
|
168
|
-
if (
|
|
169
|
-
this.
|
|
301
|
+
DBaseStateSetImpl.prototype.doSet = function (added, value, removed) {
|
|
302
|
+
if (added != null) {
|
|
303
|
+
if (removed != null) {
|
|
304
|
+
if (this.checkAdded(added, value) || this.checkRemoved(removed)) {
|
|
305
|
+
this.begin();
|
|
306
|
+
this._local.set(added, value).delete(removed);
|
|
307
|
+
this.end();
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
this.add(added, value);
|
|
170
312
|
}
|
|
171
313
|
}
|
|
172
|
-
else if (
|
|
173
|
-
|
|
174
|
-
|
|
314
|
+
else if (removed != null) {
|
|
315
|
+
this.remove(removed);
|
|
316
|
+
}
|
|
317
|
+
return this;
|
|
318
|
+
};
|
|
319
|
+
DBaseStateSetImpl.prototype.setAll = function (first, second) {
|
|
320
|
+
if (second === true) {
|
|
321
|
+
if (first != null) {
|
|
322
|
+
this.addAll(first);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
else if (second === false) {
|
|
326
|
+
if (first != null) {
|
|
327
|
+
this.removeAll(first);
|
|
175
328
|
}
|
|
176
329
|
}
|
|
177
330
|
else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
local.add(addeds[i]);
|
|
187
|
-
}
|
|
188
|
-
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
189
|
-
local.delete(removeds[i]);
|
|
190
|
-
}
|
|
191
|
-
this.end();
|
|
331
|
+
if (first != null && 0 < first.length) {
|
|
332
|
+
if (second != null && 0 < second.length) {
|
|
333
|
+
var added = first[0];
|
|
334
|
+
if (isString(added)) {
|
|
335
|
+
return this.setAllString(first, second);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
return this.setAllObject(first, second);
|
|
192
339
|
}
|
|
193
340
|
}
|
|
194
341
|
else {
|
|
195
|
-
this.addAll(
|
|
342
|
+
this.addAll(first);
|
|
196
343
|
}
|
|
197
344
|
}
|
|
198
|
-
else if (
|
|
199
|
-
this.removeAll(
|
|
345
|
+
else if (second != null) {
|
|
346
|
+
this.removeAll(second);
|
|
200
347
|
}
|
|
201
348
|
}
|
|
202
349
|
return this;
|
|
203
350
|
};
|
|
351
|
+
DBaseStateSetImpl.prototype.setAllString = function (addeds, removeds) {
|
|
352
|
+
if (this.checkAddedsString(addeds) || this.checkRemovedsString(removeds)) {
|
|
353
|
+
this.begin();
|
|
354
|
+
var local = this._local;
|
|
355
|
+
for (var i = 0, imax = addeds.length; i < imax; ++i) {
|
|
356
|
+
local.set(addeds[i], null);
|
|
357
|
+
}
|
|
358
|
+
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
359
|
+
local.delete(removeds[i]);
|
|
360
|
+
}
|
|
361
|
+
this.end();
|
|
362
|
+
}
|
|
363
|
+
return this;
|
|
364
|
+
};
|
|
365
|
+
DBaseStateSetImpl.prototype.setAllObject = function (addeds, removeds) {
|
|
366
|
+
if (this.checkAddedsObject(addeds) || this.checkRemovedsString(removeds)) {
|
|
367
|
+
this.begin();
|
|
368
|
+
var local = this._local;
|
|
369
|
+
for (var i = 0, imax = addeds.length; i < imax; ++i) {
|
|
370
|
+
var added = addeds[i];
|
|
371
|
+
local.set(added.state, added.value);
|
|
372
|
+
}
|
|
373
|
+
for (var i = 0, imax = removeds.length; i < imax; ++i) {
|
|
374
|
+
local.delete(removeds[i]);
|
|
375
|
+
}
|
|
376
|
+
this.end();
|
|
377
|
+
}
|
|
378
|
+
return this;
|
|
379
|
+
};
|
|
380
|
+
DBaseStateSetImpl.prototype.clear = function () {
|
|
381
|
+
var local = this._local;
|
|
382
|
+
if (0 < local.size) {
|
|
383
|
+
this.begin();
|
|
384
|
+
local.clear();
|
|
385
|
+
this.end();
|
|
386
|
+
}
|
|
387
|
+
return this;
|
|
388
|
+
};
|
|
389
|
+
DBaseStateSetImpl.prototype.valueOf = function (state, def) {
|
|
390
|
+
var result = this._local.get(state);
|
|
391
|
+
if (result !== undefined) {
|
|
392
|
+
return result;
|
|
393
|
+
}
|
|
394
|
+
var parent = this._parent;
|
|
395
|
+
if (parent != null) {
|
|
396
|
+
return parent.valueOf(state, def);
|
|
397
|
+
}
|
|
398
|
+
return def;
|
|
399
|
+
};
|
|
204
400
|
DBaseStateSetImpl.prototype.each = function (iteratee) {
|
|
205
|
-
this._local.forEach(function (state) {
|
|
206
|
-
iteratee(state);
|
|
401
|
+
this._local.forEach(function (value, state) {
|
|
402
|
+
iteratee(state, value);
|
|
207
403
|
});
|
|
208
404
|
return this;
|
|
209
405
|
};
|
|
@@ -215,41 +411,14 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
215
411
|
this.begin();
|
|
216
412
|
var local_1 = this._local;
|
|
217
413
|
local_1.clear();
|
|
218
|
-
other.local.forEach(function (value) {
|
|
219
|
-
local_1.
|
|
414
|
+
other.local.forEach(function (value, state) {
|
|
415
|
+
local_1.set(state, value);
|
|
220
416
|
});
|
|
221
417
|
this._parent = other.parent;
|
|
222
418
|
this.end();
|
|
223
419
|
}
|
|
224
420
|
return this;
|
|
225
421
|
};
|
|
226
|
-
Object.defineProperty(DBaseStateSetImpl.prototype, "local", {
|
|
227
|
-
get: function () {
|
|
228
|
-
return this._local;
|
|
229
|
-
},
|
|
230
|
-
enumerable: false,
|
|
231
|
-
configurable: true
|
|
232
|
-
});
|
|
233
|
-
Object.defineProperty(DBaseStateSetImpl.prototype, "parent", {
|
|
234
|
-
get: function () {
|
|
235
|
-
return this._parent;
|
|
236
|
-
},
|
|
237
|
-
set: function (parent) {
|
|
238
|
-
if (this._parent !== parent) {
|
|
239
|
-
this.begin();
|
|
240
|
-
this._parent = parent;
|
|
241
|
-
this.end();
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
enumerable: false,
|
|
245
|
-
configurable: true
|
|
246
|
-
});
|
|
247
|
-
DBaseStateSetImpl.prototype.onParentChange = function (newState, oldState) {
|
|
248
|
-
this._parent = oldState;
|
|
249
|
-
this.begin();
|
|
250
|
-
this._parent = newState;
|
|
251
|
-
this.end();
|
|
252
|
-
};
|
|
253
422
|
Object.defineProperty(DBaseStateSetImpl.prototype, "isHovered", {
|
|
254
423
|
get: function () {
|
|
255
424
|
return this.is(DBaseState.HOVERED);
|
|
@@ -817,8 +986,8 @@ var DBaseStateSetImpl = /** @class */ (function () {
|
|
|
817
986
|
});
|
|
818
987
|
DBaseStateSetImpl.prototype.toObject = function () {
|
|
819
988
|
var states = [];
|
|
820
|
-
this._local.forEach(function (value) {
|
|
821
|
-
states.push(
|
|
989
|
+
this._local.forEach(function (value, state) {
|
|
990
|
+
states.push(state);
|
|
822
991
|
});
|
|
823
992
|
return {
|
|
824
993
|
local: states
|