@skyux/list-builder-common 5.7.2 → 6.0.0-beta.2
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/esm2020/index.mjs +12 -0
- package/esm2020/lib/helpers.mjs +60 -0
- package/esm2020/lib/rxstate/async-item.mjs +11 -0
- package/esm2020/lib/rxstate/async-list.mjs +13 -0
- package/esm2020/lib/rxstate/helpers.mjs +12 -0
- package/esm2020/lib/rxstate/state-dispatcher.mjs +7 -0
- package/esm2020/lib/rxstate/state-node.mjs +37 -0
- package/esm2020/lib/rxstate/state-orchestrator.mjs +39 -0
- package/esm2020/lib/state/items/item.model.mjs +15 -0
- package/esm2020/lib/state/sort/field-selector.model.mjs +13 -0
- package/esm2020/skyux-list-builder-common.mjs +5 -0
- package/fesm2015/{skyux-list-builder-common.js → skyux-list-builder-common.mjs} +1 -1
- package/fesm2015/skyux-list-builder-common.mjs.map +1 -0
- package/fesm2020/skyux-list-builder-common.mjs +210 -0
- package/fesm2020/skyux-list-builder-common.mjs.map +1 -0
- package/package.json +25 -9
- package/bundles/skyux-list-builder-common.umd.js +0 -567
- package/esm2015/index.js +0 -12
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/helpers.js +0 -60
- package/esm2015/lib/helpers.js.map +0 -1
- package/esm2015/lib/rxstate/async-item.js +0 -11
- package/esm2015/lib/rxstate/async-item.js.map +0 -1
- package/esm2015/lib/rxstate/async-list.js +0 -13
- package/esm2015/lib/rxstate/async-list.js.map +0 -1
- package/esm2015/lib/rxstate/helpers.js +0 -12
- package/esm2015/lib/rxstate/helpers.js.map +0 -1
- package/esm2015/lib/rxstate/state-dispatcher.js +0 -7
- package/esm2015/lib/rxstate/state-dispatcher.js.map +0 -1
- package/esm2015/lib/rxstate/state-node.js +0 -37
- package/esm2015/lib/rxstate/state-node.js.map +0 -1
- package/esm2015/lib/rxstate/state-orchestrator.js +0 -39
- package/esm2015/lib/rxstate/state-orchestrator.js.map +0 -1
- package/esm2015/lib/state/items/item.model.js +0 -15
- package/esm2015/lib/state/items/item.model.js.map +0 -1
- package/esm2015/lib/state/sort/field-selector.model.js +0 -13
- package/esm2015/lib/state/sort/field-selector.model.js.map +0 -1
- package/esm2015/skyux-list-builder-common.js +0 -5
- package/esm2015/skyux-list-builder-common.js.map +0 -1
- package/fesm2015/skyux-list-builder-common.js.map +0 -1
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/list-builder-common', ['exports', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["list-builder-common"] = {}), global.rxjs, global.rxjs.operators));
|
|
5
|
-
})(this, (function (exports, rxjs, operators) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var ListItemModel = /** @class */ (function () {
|
|
8
|
-
function ListItemModel(id, data, isSelected) {
|
|
9
|
-
if (id === undefined) {
|
|
10
|
-
throw new Error('All list item models require an ID');
|
|
11
|
-
}
|
|
12
|
-
this.id = id;
|
|
13
|
-
if (data !== undefined) {
|
|
14
|
-
this.data = data;
|
|
15
|
-
}
|
|
16
|
-
if (isSelected !== undefined) {
|
|
17
|
-
this.isSelected = isSelected;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return ListItemModel;
|
|
21
|
-
}());
|
|
22
|
-
|
|
23
|
-
var ListSortFieldSelectorModel = /** @class */ (function () {
|
|
24
|
-
function ListSortFieldSelectorModel(data) {
|
|
25
|
-
/**
|
|
26
|
-
* Indicates whether to sort in descending order.
|
|
27
|
-
*/
|
|
28
|
-
this.descending = false;
|
|
29
|
-
if (data) {
|
|
30
|
-
this.fieldSelector = data.fieldSelector;
|
|
31
|
-
this.descending = data.descending;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return ListSortFieldSelectorModel;
|
|
35
|
-
}());
|
|
36
|
-
|
|
37
|
-
/** @internal */
|
|
38
|
-
function getData(item, selector) {
|
|
39
|
-
if (!selector) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
var resultFieldParts = selector.split('.');
|
|
43
|
-
if (resultFieldParts.length > 0 && resultFieldParts[0] === '') {
|
|
44
|
-
resultFieldParts.shift();
|
|
45
|
-
}
|
|
46
|
-
var result = item;
|
|
47
|
-
/* istanbul ignore else */
|
|
48
|
-
if (resultFieldParts.length > 0) {
|
|
49
|
-
for (var index = 0; index < resultFieldParts.length; index++) {
|
|
50
|
-
var part = resultFieldParts[index];
|
|
51
|
-
/* tslint:disable:no-null-keyword */
|
|
52
|
-
/* istanbul ignore else */
|
|
53
|
-
if (result[part] === null || result[part] === undefined) {
|
|
54
|
-
result = null;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
/* tslint:enable:no-null-keyword */
|
|
58
|
-
result = result[part];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
/** @internal */
|
|
64
|
-
function compare(value1, value2) {
|
|
65
|
-
/* tslint:disable:no-null-keyword */
|
|
66
|
-
if (value1 === null) {
|
|
67
|
-
return 1;
|
|
68
|
-
}
|
|
69
|
-
else if (value2 === null) {
|
|
70
|
-
return -1;
|
|
71
|
-
}
|
|
72
|
-
/* tslint:enable:no-null-keyword */
|
|
73
|
-
if (value1 && typeof value1 === 'string') {
|
|
74
|
-
value1 = value1.toLowerCase();
|
|
75
|
-
}
|
|
76
|
-
if (value2 && typeof value2 === 'string') {
|
|
77
|
-
value2 = value2.toLowerCase();
|
|
78
|
-
}
|
|
79
|
-
if (value1 === value2) {
|
|
80
|
-
return 0;
|
|
81
|
-
}
|
|
82
|
-
return value1 > value2 ? 1 : -1;
|
|
83
|
-
}
|
|
84
|
-
/*
|
|
85
|
-
Taken directly from rxjs's internal utility to determine whether an object is an Obserable.
|
|
86
|
-
See: https://github.com/ReactiveX/rxjs/blob/master/src/internal/util/isObservable.ts
|
|
87
|
-
*/
|
|
88
|
-
/** @internal */
|
|
89
|
-
function isObservable(obj) {
|
|
90
|
-
/* istanbul ignore next */
|
|
91
|
-
return (!!obj &&
|
|
92
|
-
(obj instanceof rxjs.Observable ||
|
|
93
|
-
(typeof obj.lift === 'function' && typeof obj.subscribe === 'function')));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @internal
|
|
98
|
-
*/
|
|
99
|
-
var AsyncItem = /** @class */ (function () {
|
|
100
|
-
function AsyncItem(item, lastUpdate, loading) {
|
|
101
|
-
if (item === void 0) { item = {}; }
|
|
102
|
-
if (lastUpdate === void 0) { lastUpdate = null; }
|
|
103
|
-
if (loading === void 0) { loading = false; }
|
|
104
|
-
this.item = item;
|
|
105
|
-
this.lastUpdate = lastUpdate;
|
|
106
|
-
this.loading = loading;
|
|
107
|
-
}
|
|
108
|
-
return AsyncItem;
|
|
109
|
-
}());
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @internal
|
|
113
|
-
*/
|
|
114
|
-
var AsyncList = /** @class */ (function () {
|
|
115
|
-
/* tslint:disable:no-null-keyword */
|
|
116
|
-
function AsyncList(items, lastUpdate, loading, count) {
|
|
117
|
-
if (items === void 0) { items = []; }
|
|
118
|
-
if (lastUpdate === void 0) { lastUpdate = null; }
|
|
119
|
-
if (loading === void 0) { loading = false; }
|
|
120
|
-
if (count === void 0) { count = items.length; }
|
|
121
|
-
this.items = items;
|
|
122
|
-
this.lastUpdate = lastUpdate;
|
|
123
|
-
this.loading = loading;
|
|
124
|
-
this.count = count;
|
|
125
|
-
}
|
|
126
|
-
return AsyncList;
|
|
127
|
-
}());
|
|
128
|
-
|
|
129
|
-
/** @internal */
|
|
130
|
-
function getValue(property, callback) {
|
|
131
|
-
if (property instanceof rxjs.Observable) {
|
|
132
|
-
property.subscribe(function (value) { return callback(value); });
|
|
133
|
-
return property;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return callback(property);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/*! *****************************************************************************
|
|
141
|
-
Copyright (c) Microsoft Corporation.
|
|
142
|
-
|
|
143
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
144
|
-
purpose with or without fee is hereby granted.
|
|
145
|
-
|
|
146
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
147
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
148
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
149
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
150
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
151
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
152
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
153
|
-
***************************************************************************** */
|
|
154
|
-
/* global Reflect, Promise */
|
|
155
|
-
var extendStatics = function (d, b) {
|
|
156
|
-
extendStatics = Object.setPrototypeOf ||
|
|
157
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
158
|
-
function (d, b) { for (var p in b)
|
|
159
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
160
|
-
d[p] = b[p]; };
|
|
161
|
-
return extendStatics(d, b);
|
|
162
|
-
};
|
|
163
|
-
function __extends(d, b) {
|
|
164
|
-
if (typeof b !== "function" && b !== null)
|
|
165
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
166
|
-
extendStatics(d, b);
|
|
167
|
-
function __() { this.constructor = d; }
|
|
168
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
169
|
-
}
|
|
170
|
-
var __assign = function () {
|
|
171
|
-
__assign = Object.assign || function __assign(t) {
|
|
172
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
173
|
-
s = arguments[i];
|
|
174
|
-
for (var p in s)
|
|
175
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
176
|
-
t[p] = s[p];
|
|
177
|
-
}
|
|
178
|
-
return t;
|
|
179
|
-
};
|
|
180
|
-
return __assign.apply(this, arguments);
|
|
181
|
-
};
|
|
182
|
-
function __rest(s, e) {
|
|
183
|
-
var t = {};
|
|
184
|
-
for (var p in s)
|
|
185
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
186
|
-
t[p] = s[p];
|
|
187
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
188
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
189
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
190
|
-
t[p[i]] = s[p[i]];
|
|
191
|
-
}
|
|
192
|
-
return t;
|
|
193
|
-
}
|
|
194
|
-
function __decorate(decorators, target, key, desc) {
|
|
195
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
196
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
197
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
198
|
-
else
|
|
199
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
200
|
-
if (d = decorators[i])
|
|
201
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
202
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
203
|
-
}
|
|
204
|
-
function __param(paramIndex, decorator) {
|
|
205
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
206
|
-
}
|
|
207
|
-
function __metadata(metadataKey, metadataValue) {
|
|
208
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
209
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
210
|
-
}
|
|
211
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
212
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
213
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
214
|
-
function fulfilled(value) { try {
|
|
215
|
-
step(generator.next(value));
|
|
216
|
-
}
|
|
217
|
-
catch (e) {
|
|
218
|
-
reject(e);
|
|
219
|
-
} }
|
|
220
|
-
function rejected(value) { try {
|
|
221
|
-
step(generator["throw"](value));
|
|
222
|
-
}
|
|
223
|
-
catch (e) {
|
|
224
|
-
reject(e);
|
|
225
|
-
} }
|
|
226
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
227
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
function __generator(thisArg, body) {
|
|
231
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
232
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
233
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
234
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
235
|
-
function step(op) {
|
|
236
|
-
if (f)
|
|
237
|
-
throw new TypeError("Generator is already executing.");
|
|
238
|
-
while (_)
|
|
239
|
-
try {
|
|
240
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
241
|
-
return t;
|
|
242
|
-
if (y = 0, t)
|
|
243
|
-
op = [op[0] & 2, t.value];
|
|
244
|
-
switch (op[0]) {
|
|
245
|
-
case 0:
|
|
246
|
-
case 1:
|
|
247
|
-
t = op;
|
|
248
|
-
break;
|
|
249
|
-
case 4:
|
|
250
|
-
_.label++;
|
|
251
|
-
return { value: op[1], done: false };
|
|
252
|
-
case 5:
|
|
253
|
-
_.label++;
|
|
254
|
-
y = op[1];
|
|
255
|
-
op = [0];
|
|
256
|
-
continue;
|
|
257
|
-
case 7:
|
|
258
|
-
op = _.ops.pop();
|
|
259
|
-
_.trys.pop();
|
|
260
|
-
continue;
|
|
261
|
-
default:
|
|
262
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
263
|
-
_ = 0;
|
|
264
|
-
continue;
|
|
265
|
-
}
|
|
266
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
267
|
-
_.label = op[1];
|
|
268
|
-
break;
|
|
269
|
-
}
|
|
270
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
271
|
-
_.label = t[1];
|
|
272
|
-
t = op;
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
if (t && _.label < t[2]) {
|
|
276
|
-
_.label = t[2];
|
|
277
|
-
_.ops.push(op);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
if (t[2])
|
|
281
|
-
_.ops.pop();
|
|
282
|
-
_.trys.pop();
|
|
283
|
-
continue;
|
|
284
|
-
}
|
|
285
|
-
op = body.call(thisArg, _);
|
|
286
|
-
}
|
|
287
|
-
catch (e) {
|
|
288
|
-
op = [6, e];
|
|
289
|
-
y = 0;
|
|
290
|
-
}
|
|
291
|
-
finally {
|
|
292
|
-
f = t = 0;
|
|
293
|
-
}
|
|
294
|
-
if (op[0] & 5)
|
|
295
|
-
throw op[1];
|
|
296
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
300
|
-
if (k2 === undefined)
|
|
301
|
-
k2 = k;
|
|
302
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
303
|
-
}) : (function (o, m, k, k2) {
|
|
304
|
-
if (k2 === undefined)
|
|
305
|
-
k2 = k;
|
|
306
|
-
o[k2] = m[k];
|
|
307
|
-
});
|
|
308
|
-
function __exportStar(m, o) {
|
|
309
|
-
for (var p in m)
|
|
310
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
311
|
-
__createBinding(o, m, p);
|
|
312
|
-
}
|
|
313
|
-
function __values(o) {
|
|
314
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
315
|
-
if (m)
|
|
316
|
-
return m.call(o);
|
|
317
|
-
if (o && typeof o.length === "number")
|
|
318
|
-
return {
|
|
319
|
-
next: function () {
|
|
320
|
-
if (o && i >= o.length)
|
|
321
|
-
o = void 0;
|
|
322
|
-
return { value: o && o[i++], done: !o };
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
326
|
-
}
|
|
327
|
-
function __read(o, n) {
|
|
328
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
329
|
-
if (!m)
|
|
330
|
-
return o;
|
|
331
|
-
var i = m.call(o), r, ar = [], e;
|
|
332
|
-
try {
|
|
333
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
334
|
-
ar.push(r.value);
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
e = { error: error };
|
|
338
|
-
}
|
|
339
|
-
finally {
|
|
340
|
-
try {
|
|
341
|
-
if (r && !r.done && (m = i["return"]))
|
|
342
|
-
m.call(i);
|
|
343
|
-
}
|
|
344
|
-
finally {
|
|
345
|
-
if (e)
|
|
346
|
-
throw e.error;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return ar;
|
|
350
|
-
}
|
|
351
|
-
/** @deprecated */
|
|
352
|
-
function __spread() {
|
|
353
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
354
|
-
ar = ar.concat(__read(arguments[i]));
|
|
355
|
-
return ar;
|
|
356
|
-
}
|
|
357
|
-
/** @deprecated */
|
|
358
|
-
function __spreadArrays() {
|
|
359
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
360
|
-
s += arguments[i].length;
|
|
361
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
362
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
363
|
-
r[k] = a[j];
|
|
364
|
-
return r;
|
|
365
|
-
}
|
|
366
|
-
function __spreadArray(to, from, pack) {
|
|
367
|
-
if (pack || arguments.length === 2)
|
|
368
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
369
|
-
if (ar || !(i in from)) {
|
|
370
|
-
if (!ar)
|
|
371
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
372
|
-
ar[i] = from[i];
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
376
|
-
}
|
|
377
|
-
function __await(v) {
|
|
378
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
379
|
-
}
|
|
380
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
381
|
-
if (!Symbol.asyncIterator)
|
|
382
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
383
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
384
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
385
|
-
function verb(n) { if (g[n])
|
|
386
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
387
|
-
function resume(n, v) { try {
|
|
388
|
-
step(g[n](v));
|
|
389
|
-
}
|
|
390
|
-
catch (e) {
|
|
391
|
-
settle(q[0][3], e);
|
|
392
|
-
} }
|
|
393
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
394
|
-
function fulfill(value) { resume("next", value); }
|
|
395
|
-
function reject(value) { resume("throw", value); }
|
|
396
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
397
|
-
resume(q[0][0], q[0][1]); }
|
|
398
|
-
}
|
|
399
|
-
function __asyncDelegator(o) {
|
|
400
|
-
var i, p;
|
|
401
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
402
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
403
|
-
}
|
|
404
|
-
function __asyncValues(o) {
|
|
405
|
-
if (!Symbol.asyncIterator)
|
|
406
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
407
|
-
var m = o[Symbol.asyncIterator], i;
|
|
408
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
409
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
410
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
411
|
-
}
|
|
412
|
-
function __makeTemplateObject(cooked, raw) {
|
|
413
|
-
if (Object.defineProperty) {
|
|
414
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
cooked.raw = raw;
|
|
418
|
-
}
|
|
419
|
-
return cooked;
|
|
420
|
-
}
|
|
421
|
-
;
|
|
422
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
423
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
424
|
-
}) : function (o, v) {
|
|
425
|
-
o["default"] = v;
|
|
426
|
-
};
|
|
427
|
-
function __importStar(mod) {
|
|
428
|
-
if (mod && mod.__esModule)
|
|
429
|
-
return mod;
|
|
430
|
-
var result = {};
|
|
431
|
-
if (mod != null)
|
|
432
|
-
for (var k in mod)
|
|
433
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
434
|
-
__createBinding(result, mod, k);
|
|
435
|
-
__setModuleDefault(result, mod);
|
|
436
|
-
return result;
|
|
437
|
-
}
|
|
438
|
-
function __importDefault(mod) {
|
|
439
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
440
|
-
}
|
|
441
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
442
|
-
if (kind === "a" && !f)
|
|
443
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
444
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
445
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
446
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
447
|
-
}
|
|
448
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
449
|
-
if (kind === "m")
|
|
450
|
-
throw new TypeError("Private method is not writable");
|
|
451
|
-
if (kind === "a" && !f)
|
|
452
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
453
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
454
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
455
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* @internal
|
|
460
|
-
*/
|
|
461
|
-
var StateDispatcher = /** @class */ (function (_super) {
|
|
462
|
-
__extends(StateDispatcher, _super);
|
|
463
|
-
function StateDispatcher() {
|
|
464
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
465
|
-
}
|
|
466
|
-
return StateDispatcher;
|
|
467
|
-
}(rxjs.Subject));
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* @internal
|
|
471
|
-
*/
|
|
472
|
-
var StateNode = /** @class */ (function (_super) {
|
|
473
|
-
__extends(StateNode, _super);
|
|
474
|
-
function StateNode(initialState, dispatcher) {
|
|
475
|
-
var _this = _super.call(this, initialState) || this;
|
|
476
|
-
_this.initialState = initialState;
|
|
477
|
-
_this.dispatcher = dispatcher;
|
|
478
|
-
_this.stateMap = {};
|
|
479
|
-
return _this;
|
|
480
|
-
}
|
|
481
|
-
StateNode.prototype.register = function (stateKey, orchestrator) {
|
|
482
|
-
this.stateMap[stateKey] = orchestrator;
|
|
483
|
-
return this;
|
|
484
|
-
};
|
|
485
|
-
StateNode.prototype.reset = function () {
|
|
486
|
-
this.next(this.initialState);
|
|
487
|
-
};
|
|
488
|
-
StateNode.prototype.begin = function () {
|
|
489
|
-
var _this = this;
|
|
490
|
-
var stateKeys = Object.keys(this.stateMap);
|
|
491
|
-
var init = this.initialState;
|
|
492
|
-
var orchestrators = stateKeys.map(function (key) { return new _this.stateMap[key]().scan(init[key], _this.dispatcher); });
|
|
493
|
-
rxjs.zip
|
|
494
|
-
.apply(this, orchestrators)
|
|
495
|
-
.pipe(operators.map(function (s) {
|
|
496
|
-
var result = {};
|
|
497
|
-
for (var i = 0; i < stateKeys.length; i++) {
|
|
498
|
-
var key = stateKeys[i];
|
|
499
|
-
result[key] = s[i];
|
|
500
|
-
}
|
|
501
|
-
return result;
|
|
502
|
-
}))
|
|
503
|
-
.subscribe(function (s) { return _this.next(s); });
|
|
504
|
-
};
|
|
505
|
-
return StateNode;
|
|
506
|
-
}(rxjs.BehaviorSubject));
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* @internal
|
|
510
|
-
*/
|
|
511
|
-
var StateOrchestrator = /** @class */ (function () {
|
|
512
|
-
function StateOrchestrator() {
|
|
513
|
-
this.registeredActions = [];
|
|
514
|
-
this.registeredCallbacks = [];
|
|
515
|
-
}
|
|
516
|
-
StateOrchestrator.prototype.register = function (action, callback) {
|
|
517
|
-
if (this.registeredActions.indexOf(action) === -1) {
|
|
518
|
-
this.registeredActions.push(action);
|
|
519
|
-
this.registeredCallbacks.push(callback);
|
|
520
|
-
}
|
|
521
|
-
return this;
|
|
522
|
-
};
|
|
523
|
-
StateOrchestrator.prototype.scan = function (initialState, actions) {
|
|
524
|
-
var _this = this;
|
|
525
|
-
/* tslint:disable-next-line:no-null-keyword */
|
|
526
|
-
if (initialState == null) {
|
|
527
|
-
throw new Error('Initial state for an orchestrator should never be null. Check your StateNode definition and registrations.');
|
|
528
|
-
}
|
|
529
|
-
return actions.pipe(operators.scan(function (state, action) {
|
|
530
|
-
for (var i = 0; i < _this.registeredActions.length; i++) {
|
|
531
|
-
var a = _this.registeredActions[i];
|
|
532
|
-
// length is seemingly arbitrary but it's a stopgap to prevent checking via constructor name when code is minified
|
|
533
|
-
if (action instanceof a ||
|
|
534
|
-
(a.name.length > 4 && action.constructor.name === a.name)) {
|
|
535
|
-
return _this.registeredCallbacks[i].apply(_this, [
|
|
536
|
-
state,
|
|
537
|
-
action,
|
|
538
|
-
initialState,
|
|
539
|
-
]);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
return state;
|
|
543
|
-
}, initialState));
|
|
544
|
-
};
|
|
545
|
-
return StateOrchestrator;
|
|
546
|
-
}());
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Generated bundle index. Do not edit.
|
|
550
|
-
*/
|
|
551
|
-
|
|
552
|
-
exports.AsyncItem = AsyncItem;
|
|
553
|
-
exports.AsyncList = AsyncList;
|
|
554
|
-
exports.ListItemModel = ListItemModel;
|
|
555
|
-
exports.ListSortFieldSelectorModel = ListSortFieldSelectorModel;
|
|
556
|
-
exports.StateDispatcher = StateDispatcher;
|
|
557
|
-
exports.StateNode = StateNode;
|
|
558
|
-
exports.StateOrchestrator = StateOrchestrator;
|
|
559
|
-
exports.compare = compare;
|
|
560
|
-
exports.getData = getData;
|
|
561
|
-
exports.getValue = getValue;
|
|
562
|
-
exports.isObservable = isObservable;
|
|
563
|
-
|
|
564
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
565
|
-
|
|
566
|
-
}));
|
|
567
|
-
//# sourceMappingURL=skyux-list-builder-common.umd.js.map
|
package/esm2015/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './lib/state/items/item.model';
|
|
2
|
-
export * from './lib/state/sort/field-selector.model';
|
|
3
|
-
export * from './lib/helpers';
|
|
4
|
-
// The following exports were migrated from `microedge-rxstate`.
|
|
5
|
-
// See: https://github.com/blackbaud/microedge-rxstate
|
|
6
|
-
export * from './lib/rxstate/async-item';
|
|
7
|
-
export * from './lib/rxstate/async-list';
|
|
8
|
-
export * from './lib/rxstate/helpers';
|
|
9
|
-
export * from './lib/rxstate/state-dispatcher';
|
|
10
|
-
export * from './lib/rxstate/state-node';
|
|
11
|
-
export * from './lib/rxstate/state-orchestrator';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/esm2015/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/list-builder-common/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,eAAe,CAAC;AAE9B,gEAAgE;AAChE,sDAAsD;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './lib/state/items/item.model';\nexport * from './lib/state/sort/field-selector.model';\nexport * from './lib/helpers';\n\n// The following exports were migrated from `microedge-rxstate`.\n// See: https://github.com/blackbaud/microedge-rxstate\nexport * from './lib/rxstate/async-item';\nexport * from './lib/rxstate/async-list';\nexport * from './lib/rxstate/helpers';\nexport * from './lib/rxstate/state-dispatcher';\nexport * from './lib/rxstate/state-node';\nexport * from './lib/rxstate/state-orchestrator';\n"]}
|
package/esm2015/lib/helpers.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
/** @internal */
|
|
3
|
-
export function getData(item, selector) {
|
|
4
|
-
if (!selector) {
|
|
5
|
-
return undefined;
|
|
6
|
-
}
|
|
7
|
-
const resultFieldParts = selector.split('.');
|
|
8
|
-
if (resultFieldParts.length > 0 && resultFieldParts[0] === '') {
|
|
9
|
-
resultFieldParts.shift();
|
|
10
|
-
}
|
|
11
|
-
let result = item;
|
|
12
|
-
/* istanbul ignore else */
|
|
13
|
-
if (resultFieldParts.length > 0) {
|
|
14
|
-
for (let index = 0; index < resultFieldParts.length; index++) {
|
|
15
|
-
const part = resultFieldParts[index];
|
|
16
|
-
/* tslint:disable:no-null-keyword */
|
|
17
|
-
/* istanbul ignore else */
|
|
18
|
-
if (result[part] === null || result[part] === undefined) {
|
|
19
|
-
result = null;
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
/* tslint:enable:no-null-keyword */
|
|
23
|
-
result = result[part];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
/** @internal */
|
|
29
|
-
export function compare(value1, value2) {
|
|
30
|
-
/* tslint:disable:no-null-keyword */
|
|
31
|
-
if (value1 === null) {
|
|
32
|
-
return 1;
|
|
33
|
-
}
|
|
34
|
-
else if (value2 === null) {
|
|
35
|
-
return -1;
|
|
36
|
-
}
|
|
37
|
-
/* tslint:enable:no-null-keyword */
|
|
38
|
-
if (value1 && typeof value1 === 'string') {
|
|
39
|
-
value1 = value1.toLowerCase();
|
|
40
|
-
}
|
|
41
|
-
if (value2 && typeof value2 === 'string') {
|
|
42
|
-
value2 = value2.toLowerCase();
|
|
43
|
-
}
|
|
44
|
-
if (value1 === value2) {
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
|
-
return value1 > value2 ? 1 : -1;
|
|
48
|
-
}
|
|
49
|
-
/*
|
|
50
|
-
Taken directly from rxjs's internal utility to determine whether an object is an Obserable.
|
|
51
|
-
See: https://github.com/ReactiveX/rxjs/blob/master/src/internal/util/isObservable.ts
|
|
52
|
-
*/
|
|
53
|
-
/** @internal */
|
|
54
|
-
export function isObservable(obj) {
|
|
55
|
-
/* istanbul ignore next */
|
|
56
|
-
return (!!obj &&
|
|
57
|
-
(obj instanceof Observable ||
|
|
58
|
-
(typeof obj.lift === 'function' && typeof obj.subscribe === 'function')));
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../libs/components/list-builder-common/src/lib/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,gBAAgB;AAChB,MAAM,UAAU,OAAO,CAAC,IAAS,EAAE,QAAgB;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7D,gBAAgB,CAAC,KAAK,EAAE,CAAC;KAC1B;IAED,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,0BAA0B;IAC1B,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAC5D,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACrC,oCAAoC;YACpC,0BAA0B;YAC1B,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE;gBACvD,MAAM,GAAG,IAAI,CAAC;gBACd,MAAM;aACP;YACD,mCAAmC;YAEnC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;SACvB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,OAAO,CAAC,MAAW,EAAE,MAAW;IAC9C,oCAAoC;IACpC,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,MAAM,KAAK,IAAI,EAAE;QAC1B,OAAO,CAAC,CAAC,CAAC;KACX;IACD,mCAAmC;IAEnC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACxC,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;KAC/B;IAED,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACxC,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;KAC/B;IACD,IAAI,MAAM,KAAK,MAAM,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,OAAO,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;EAGE;AACF,gBAAgB;AAChB,MAAM,UAAU,YAAY,CAAI,GAAQ;IACtC,0BAA0B;IAC1B,OAAO,CACL,CAAC,CAAC,GAAG;QACL,CAAC,GAAG,YAAY,UAAU;YACxB,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["import { Observable } from 'rxjs';\n\n/** @internal */\nexport function getData(item: any, selector: string): any {\n if (!selector) {\n return undefined;\n }\n\n const resultFieldParts = selector.split('.');\n if (resultFieldParts.length > 0 && resultFieldParts[0] === '') {\n resultFieldParts.shift();\n }\n\n let result = item;\n\n /* istanbul ignore else */\n if (resultFieldParts.length > 0) {\n for (let index = 0; index < resultFieldParts.length; index++) {\n const part = resultFieldParts[index];\n /* tslint:disable:no-null-keyword */\n /* istanbul ignore else */\n if (result[part] === null || result[part] === undefined) {\n result = null;\n break;\n }\n /* tslint:enable:no-null-keyword */\n\n result = result[part];\n }\n }\n\n return result;\n}\n\n/** @internal */\nexport function compare(value1: any, value2: any) {\n /* tslint:disable:no-null-keyword */\n if (value1 === null) {\n return 1;\n } else if (value2 === null) {\n return -1;\n }\n /* tslint:enable:no-null-keyword */\n\n if (value1 && typeof value1 === 'string') {\n value1 = value1.toLowerCase();\n }\n\n if (value2 && typeof value2 === 'string') {\n value2 = value2.toLowerCase();\n }\n if (value1 === value2) {\n return 0;\n }\n\n return value1 > value2 ? 1 : -1;\n}\n\n/*\n Taken directly from rxjs's internal utility to determine whether an object is an Obserable.\n See: https://github.com/ReactiveX/rxjs/blob/master/src/internal/util/isObservable.ts\n*/\n/** @internal */\nexport function isObservable<T>(obj: any): obj is Observable<T> {\n /* istanbul ignore next */\n return (\n !!obj &&\n (obj instanceof Observable ||\n (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'))\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-item.js","sourceRoot":"","sources":["../../../../../../../libs/components/list-builder-common/src/lib/rxstate/async-item.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,SAAS;IACpB,YACS,OAAU,EAAO,EACjB,aAAkB,IAAI,EACtB,UAAU,KAAK;QAFf,SAAI,GAAJ,IAAI,CAAa;QACjB,eAAU,GAAV,UAAU,CAAY;QACtB,YAAO,GAAP,OAAO,CAAQ;IACrB,CAAC;CACL","sourcesContent":["/**\n * @internal\n */\nexport class AsyncItem<T> {\n constructor(\n public item: T = {} as T,\n public lastUpdate: any = null,\n public loading = false\n ) {}\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export class AsyncList {
|
|
5
|
-
/* tslint:disable:no-null-keyword */
|
|
6
|
-
constructor(items = [], lastUpdate = null, loading = false, count = items.length) {
|
|
7
|
-
this.items = items;
|
|
8
|
-
this.lastUpdate = lastUpdate;
|
|
9
|
-
this.loading = loading;
|
|
10
|
-
this.count = count;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=async-list.js.map
|