@wcardinal/wcardinal-ui 0.309.0 → 0.310.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 (119) hide show
  1. package/README.md +1 -1
  2. package/dist/types/wcardinal/ui/d-base-state-and-value.d.ts +4 -0
  3. package/dist/types/wcardinal/ui/d-base-state-matcher.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/d-base-state-set-blinker-datum-impl.d.ts +5 -0
  5. package/dist/types/wcardinal/ui/d-base-state-set-blinker-impl.d.ts +8 -0
  6. package/dist/types/wcardinal/ui/d-base-state-set-blinker.d.ts +3 -0
  7. package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +51 -18
  8. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum-impl.d.ts +17 -0
  9. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum.d.ts +6 -0
  10. package/dist/types/wcardinal/ui/d-base-state-set-sub-impl.d.ts +15 -0
  11. package/dist/types/wcardinal/ui/d-base-state-set-sub.d.ts +6 -0
  12. package/dist/types/wcardinal/ui/d-base-state-set-ticker-datum-impl.d.ts +5 -0
  13. package/dist/types/wcardinal/ui/d-base-state-set-ticker-impl.d.ts +8 -0
  14. package/dist/types/wcardinal/ui/d-base-state-set-ticker.d.ts +3 -0
  15. package/dist/types/wcardinal/ui/d-base-state-set.d.ts +38 -8
  16. package/dist/types/wcardinal/ui/d-base.d.ts +23 -1
  17. package/dist/types/wcardinal/ui/d-chart-axis-base-guide-container.d.ts +21 -0
  18. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +6 -0
  19. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +5 -0
  20. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +4 -0
  21. package/dist/types/wcardinal/ui/d-chart-axis-guide-container.d.ts +14 -0
  22. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.d.ts +41 -0
  23. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape.d.ts +80 -0
  24. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple.d.ts +32 -0
  25. package/dist/types/wcardinal/ui/d-chart-axis-guide.d.ts +14 -0
  26. package/dist/types/wcardinal/ui/d-chart-axis.d.ts +2 -0
  27. package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +7 -4
  28. package/dist/types/wcardinal/ui/d-dynamic-text-measure-result.d.ts +3 -0
  29. package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +4 -3
  30. package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +16 -1
  31. package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +7 -6
  32. package/dist/types/wcardinal/ui/d-links.d.ts +2 -1
  33. package/dist/types/wcardinal/ui/d-text-base.d.ts +1 -0
  34. package/dist/types/wcardinal/ui/index.d.ts +18 -0
  35. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-text-base.d.ts +1 -0
  36. package/dist/types/wcardinal/ui/theme/white/d-theme-white-text-base.d.ts +1 -0
  37. package/dist/types/wcardinal/ui/util/util-font.d.ts +2 -0
  38. package/dist/wcardinal/ui/d-base-state-and-value.js +2 -0
  39. package/dist/wcardinal/ui/d-base-state-and-value.js.map +1 -0
  40. package/dist/wcardinal/ui/d-base-state-matcher.js +2 -0
  41. package/dist/wcardinal/ui/d-base-state-matcher.js.map +1 -0
  42. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js +17 -0
  43. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js.map +1 -0
  44. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js +16 -0
  45. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js.map +1 -0
  46. package/dist/wcardinal/ui/d-base-state-set-blinker.js +2 -0
  47. package/dist/wcardinal/ui/d-base-state-set-blinker.js.map +1 -0
  48. package/dist/wcardinal/ui/d-base-state-set-impl.js +298 -129
  49. package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
  50. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js +75 -0
  51. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js.map +1 -0
  52. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js +2 -0
  53. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js.map +1 -0
  54. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js +73 -0
  55. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js.map +1 -0
  56. package/dist/wcardinal/ui/d-base-state-set-sub.js +2 -0
  57. package/dist/wcardinal/ui/d-base-state-set-sub.js.map +1 -0
  58. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js +17 -0
  59. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js.map +1 -0
  60. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js +16 -0
  61. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js.map +1 -0
  62. package/dist/wcardinal/ui/d-base-state-set-ticker.js +2 -0
  63. package/dist/wcardinal/ui/d-base-state-set-ticker.js.map +1 -0
  64. package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
  65. package/dist/wcardinal/ui/d-base.js +34 -2
  66. package/dist/wcardinal/ui/d-base.js.map +1 -1
  67. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js +75 -0
  68. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js.map +1 -0
  69. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -0
  70. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  71. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  72. package/dist/wcardinal/ui/d-chart-axis-base.js +23 -1
  73. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  74. package/dist/wcardinal/ui/d-chart-axis-guide-container.js +2 -0
  75. package/dist/wcardinal/ui/d-chart-axis-guide-container.js.map +1 -0
  76. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +328 -0
  77. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -0
  78. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js +2 -0
  79. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js.map +1 -0
  80. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +123 -0
  81. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -0
  82. package/dist/wcardinal/ui/d-chart-axis-guide.js +2 -0
  83. package/dist/wcardinal/ui/d-chart-axis-guide.js.map +1 -0
  84. package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
  85. package/dist/wcardinal/ui/d-dynamic-text-geometry.js +17 -10
  86. package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
  87. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js +22 -0
  88. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js.map +1 -1
  89. package/dist/wcardinal/ui/d-dynamic-text-measure.js +14 -10
  90. package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
  91. package/dist/wcardinal/ui/d-dynamic-text-style.js +107 -6
  92. package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
  93. package/dist/wcardinal/ui/d-dynamic-text.js +52 -29
  94. package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
  95. package/dist/wcardinal/ui/d-links.js +18 -1
  96. package/dist/wcardinal/ui/d-links.js.map +1 -1
  97. package/dist/wcardinal/ui/d-text-base.js +6 -3
  98. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  99. package/dist/wcardinal/ui/index.js +18 -0
  100. package/dist/wcardinal/ui/index.js.map +1 -1
  101. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js +2 -2
  102. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js.map +1 -1
  103. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js +3 -0
  104. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js.map +1 -1
  105. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js +3 -0
  106. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js.map +1 -1
  107. package/dist/wcardinal/ui/util/util-font.js +18 -11
  108. package/dist/wcardinal/ui/util/util-font.js.map +1 -1
  109. package/dist/wcardinal-ui-theme-dark.js +4 -1
  110. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  111. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  112. package/dist/wcardinal-ui-theme-white.js +4 -1
  113. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  114. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  115. package/dist/wcardinal-ui.cjs.js +1403 -275
  116. package/dist/wcardinal-ui.js +1397 -275
  117. package/dist/wcardinal-ui.min.js +2 -2
  118. package/dist/wcardinal-ui.min.js.map +1 -1
  119. 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 Set();
14
+ this._local = new Map();
11
15
  this._parent = null;
12
16
  }
13
- DBaseStateSetImpl.prototype.is = function (state) {
14
- return this._local.has(state);
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.in = function (state) {
17
- return this.is(state) || this.under(state);
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.on = function (state) {
20
- var _a, _b;
21
- return (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.is(state)) !== null && _b !== void 0 ? _b : false;
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.under = function (state) {
24
- var _a, _b;
25
- return (_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.in(state)) !== null && _b !== void 0 ? _b : false;
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
- return !this._local.has(added);
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 (this.checkAdded(state)) {
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.add(state);
109
+ this._local.set(state, value);
46
110
  this.end();
47
111
  }
48
112
  return this;
49
113
  };
50
- DBaseStateSetImpl.prototype.checkAddeds = function (states) {
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
- if (!local.has(states[i])) {
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 (stateOrStates) {
60
- var states = isString(stateOrStates)
61
- ? arguments // eslint-disable-line prefer-rest-params
62
- : stateOrStates;
63
- if (this.checkAddeds(states)) {
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
- local.add(states[i]);
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.checkRemoveds = function (states) {
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.removeAll = function (stateOrStatesOrMatcher) {
94
- var _this = this;
198
+ DBaseStateSetImpl.prototype.checkRemovedsObject = function (states) {
95
199
  var local = this._local;
96
- if (isFunction(stateOrStatesOrMatcher)) {
97
- var isDirty_1 = false;
98
- local.forEach(function (state) {
99
- if (stateOrStatesOrMatcher(state)) {
100
- if (!isDirty_1) {
101
- isDirty_1 = true;
102
- _this.begin();
103
- }
104
- local.delete(state);
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
- var states = isString(stateOrStatesOrMatcher)
113
- ? arguments // eslint-disable-line prefer-rest-params
114
- : stateOrStatesOrMatcher;
115
- if (this.checkRemoveds(states)) {
116
- this.begin();
117
- for (var i = 0, imax = states.length; i < imax; ++i) {
118
- local.delete(states[i]);
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
- this.end();
240
+ local.delete(state);
121
241
  }
242
+ });
243
+ if (isDirty) {
244
+ this.end();
122
245
  }
123
246
  return this;
124
247
  };
125
- DBaseStateSetImpl.prototype.clear = function () {
126
- var local = this._local;
127
- if (0 < local.size) {
248
+ DBaseStateSetImpl.prototype.removeAllString = function (states) {
249
+ if (this.checkRemovedsString(states)) {
128
250
  this.begin();
129
- local.clear();
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 (stateOrAdded, isOnOrRemoved) {
135
- if (isOnOrRemoved === true) {
136
- if (stateOrAdded != null) {
137
- this.add(stateOrAdded);
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 (isOnOrRemoved === false) {
141
- if (stateOrAdded != null) {
142
- this.remove(stateOrAdded);
276
+ else if (second === false) {
277
+ if (first != null) {
278
+ this.remove(first);
143
279
  }
144
280
  }
145
- else {
146
- var added = stateOrAdded;
147
- var removed = isOnOrRemoved;
148
- if (added != null) {
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
- else {
157
- this.add(added);
286
+ }
287
+ else if (third === false) {
288
+ if (first != null) {
289
+ this.remove(first);
158
290
  }
159
291
  }
160
- else if (removed != null) {
161
- this.remove(removed);
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.setAll = function (statesOrAddeds, isOnOrRemoveds) {
167
- if (isOnOrRemoveds === true) {
168
- if (statesOrAddeds != null) {
169
- this.addAll(statesOrAddeds);
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 (isOnOrRemoveds === false) {
173
- if (statesOrAddeds != null) {
174
- this.removeAll(statesOrAddeds);
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
- var addeds = statesOrAddeds;
179
- var removeds = isOnOrRemoveds;
180
- if (addeds != null) {
181
- if (removeds != null) {
182
- if (this.checkAddeds(addeds) || this.checkRemoveds(removeds)) {
183
- this.begin();
184
- var local = this._local;
185
- for (var i = 0, imax = addeds.length; i < imax; ++i) {
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(addeds);
342
+ this.addAll(first);
196
343
  }
197
344
  }
198
- else if (removeds != null) {
199
- this.removeAll(removeds);
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.add(value);
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(value);
989
+ this._local.forEach(function (value, state) {
990
+ states.push(state);
822
991
  });
823
992
  return {
824
993
  local: states