@unifiedsoftware/react-components 1.0.8 → 1.0.10
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/index.d.mts +97 -7
- package/dist/index.d.ts +97 -7
- package/dist/index.js +1175 -98
- package/dist/index.mjs +1160 -74
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,1088 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop2 in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop2))
|
|
11
|
+
__defNormalProp(a, prop2, b[prop2]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop2 of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop2))
|
|
15
|
+
__defNormalProp(a, prop2, b[prop2]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/utils.js
|
|
22
|
+
var isPresent = function(value2) {
|
|
23
|
+
return value2 !== null && value2 !== void 0;
|
|
24
|
+
};
|
|
25
|
+
var isBlank = function(value2) {
|
|
26
|
+
return value2 === null || value2 === void 0;
|
|
27
|
+
};
|
|
28
|
+
var isArray = function(value2) {
|
|
29
|
+
return Array.isArray(value2);
|
|
30
|
+
};
|
|
31
|
+
var isFunction = function(value2) {
|
|
32
|
+
return typeof value2 === "function";
|
|
33
|
+
};
|
|
34
|
+
var isString = function(value2) {
|
|
35
|
+
return typeof value2 === "string";
|
|
36
|
+
};
|
|
37
|
+
var isNullOrEmptyString = function(value2) {
|
|
38
|
+
return isBlank(value2) || value2.trim().length === 0;
|
|
39
|
+
};
|
|
40
|
+
var isNotNullOrEmptyString = function(value2) {
|
|
41
|
+
return !isNullOrEmptyString(value2);
|
|
42
|
+
};
|
|
43
|
+
var isNumeric = function(value2) {
|
|
44
|
+
return !isNaN(value2 - parseFloat(value2));
|
|
45
|
+
};
|
|
46
|
+
var isDate = function(value2) {
|
|
47
|
+
return value2 && value2.getTime;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-descriptor.interface.js
|
|
51
|
+
var isCompositeFilterDescriptor = function(source) {
|
|
52
|
+
return isPresent(source.filters);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/funcs.js
|
|
56
|
+
var ifElse = function(predicate, right, left) {
|
|
57
|
+
return function(value2) {
|
|
58
|
+
return predicate(value2) ? right(value2) : left(value2);
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
var compose = function() {
|
|
62
|
+
var args = [];
|
|
63
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
64
|
+
args[_i] = arguments[_i];
|
|
65
|
+
}
|
|
66
|
+
return function(data) {
|
|
67
|
+
return args.reduceRight(function(acc, curr) {
|
|
68
|
+
return curr(acc);
|
|
69
|
+
}, data);
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
var constant = function(x) {
|
|
73
|
+
return function() {
|
|
74
|
+
return x;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filter-serialization.common.js
|
|
79
|
+
var toUTC = function(date) {
|
|
80
|
+
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
81
|
+
};
|
|
82
|
+
var isDateValue = function(x) {
|
|
83
|
+
return isDate(x.value);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter.operators.js
|
|
87
|
+
var operatorMap = function(key) {
|
|
88
|
+
return {
|
|
89
|
+
"!=": "neq",
|
|
90
|
+
"<": "lt",
|
|
91
|
+
"<=": "lte",
|
|
92
|
+
"==": "eq",
|
|
93
|
+
">": "gt",
|
|
94
|
+
">=": "gte",
|
|
95
|
+
equal: "eq",
|
|
96
|
+
equals: "eq",
|
|
97
|
+
equalto: "eq",
|
|
98
|
+
ge: "gte",
|
|
99
|
+
greater: "gt",
|
|
100
|
+
greaterthan: "gt",
|
|
101
|
+
greaterthanequal: "gte",
|
|
102
|
+
isempty: "isempty",
|
|
103
|
+
isequalto: "eq",
|
|
104
|
+
isgreaterthan: "gt",
|
|
105
|
+
isgreaterthanorequalto: "gte",
|
|
106
|
+
islessthan: "lt",
|
|
107
|
+
islessthanorequalto: "lte",
|
|
108
|
+
isnotempty: "isnotempty",
|
|
109
|
+
isnotequalto: "neq",
|
|
110
|
+
isnull: "isnull",
|
|
111
|
+
le: "lte",
|
|
112
|
+
less: "lt",
|
|
113
|
+
lessthan: "lt",
|
|
114
|
+
lessthanequal: "lte",
|
|
115
|
+
ne: "neq",
|
|
116
|
+
notequal: "neq",
|
|
117
|
+
notequals: "neq",
|
|
118
|
+
notequalto: "neq",
|
|
119
|
+
notsubstringof: "doesnotcontain"
|
|
120
|
+
}[key.toLowerCase()] || key;
|
|
121
|
+
};
|
|
122
|
+
var normalizeOperator = function(descriptor) {
|
|
123
|
+
if (descriptor.filters) {
|
|
124
|
+
descriptor.filters = descriptor.filters.map(function(filter2) {
|
|
125
|
+
var result = Object.assign({}, filter2);
|
|
126
|
+
if (!isCompositeFilterDescriptor(filter2) && isString(filter2.operator)) {
|
|
127
|
+
result.operator = operatorMap(filter2.operator);
|
|
128
|
+
}
|
|
129
|
+
if (isCompositeFilterDescriptor(filter2)) {
|
|
130
|
+
normalizeOperator(result);
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
var normalizeDescriptor = function(descriptor) {
|
|
137
|
+
if (!isCompositeFilterDescriptor(descriptor)) {
|
|
138
|
+
return {
|
|
139
|
+
filters: isArray(descriptor) ? descriptor : [descriptor],
|
|
140
|
+
logic: "and"
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return Object.assign({}, descriptor);
|
|
144
|
+
};
|
|
145
|
+
var normalizeFilters = function(descriptor) {
|
|
146
|
+
if (isPresent(descriptor)) {
|
|
147
|
+
descriptor = normalizeDescriptor(descriptor);
|
|
148
|
+
normalizeOperator(descriptor);
|
|
149
|
+
}
|
|
150
|
+
return descriptor;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/odata.operators.js
|
|
154
|
+
var emptyString = constant("");
|
|
155
|
+
|
|
156
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/accessor.js
|
|
157
|
+
var getterCache = {};
|
|
158
|
+
var FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
|
|
159
|
+
getterCache["undefined"] = function(obj) {
|
|
160
|
+
return obj;
|
|
161
|
+
};
|
|
162
|
+
var getter = function(field, safe) {
|
|
163
|
+
var key = field + safe;
|
|
164
|
+
if (getterCache[key]) {
|
|
165
|
+
return getterCache[key];
|
|
166
|
+
}
|
|
167
|
+
var fields = [];
|
|
168
|
+
field.replace(FIELD_REGEX, function(_, index, indexAccessor, field2) {
|
|
169
|
+
fields.push(isPresent(index) ? index : indexAccessor || field2);
|
|
170
|
+
return void 0;
|
|
171
|
+
});
|
|
172
|
+
getterCache[key] = function(obj) {
|
|
173
|
+
var result = obj;
|
|
174
|
+
for (var idx = 0; idx < fields.length; idx++) {
|
|
175
|
+
result = result[fields[idx]];
|
|
176
|
+
if (!isPresent(result) && safe) {
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
181
|
+
};
|
|
182
|
+
return getterCache[key];
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/mvc/operators.js
|
|
186
|
+
var pairwise = function(key) {
|
|
187
|
+
return function(value2) {
|
|
188
|
+
return [key, value2];
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
var empty = function() {
|
|
192
|
+
return null;
|
|
193
|
+
};
|
|
194
|
+
var isNotEmptyArray = function(value2) {
|
|
195
|
+
return isPresent(value2) && isArray(value2) && value2.length > 0;
|
|
196
|
+
};
|
|
197
|
+
var has = function(accessor) {
|
|
198
|
+
return function(value2) {
|
|
199
|
+
return isPresent(accessor(value2));
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
var isNotEmpty = function(accessor) {
|
|
203
|
+
return function(value2) {
|
|
204
|
+
return isNotEmptyArray(accessor(value2));
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
var runOrEmpty = function(predicate, fn) {
|
|
208
|
+
return ifElse(predicate, fn, empty);
|
|
209
|
+
};
|
|
210
|
+
var calcPage = function(_a) {
|
|
211
|
+
var skip3 = _a.skip, take3 = _a.take;
|
|
212
|
+
return Math.floor((skip3 || 0) / take3) + 1;
|
|
213
|
+
};
|
|
214
|
+
var formatDescriptors = function(accessor, formatter) {
|
|
215
|
+
return function(state) {
|
|
216
|
+
return accessor(state).map(formatter).join("~");
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
var removeAfter = function(what) {
|
|
220
|
+
return function(str) {
|
|
221
|
+
return str.slice(0, str.indexOf(what));
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
var replace = function(patterns) {
|
|
225
|
+
return compose.apply(void 0, patterns.map(function(_a) {
|
|
226
|
+
var left = _a[0], right = _a[1];
|
|
227
|
+
return function(s) {
|
|
228
|
+
return s.replace(new RegExp(left, "g"), right);
|
|
229
|
+
};
|
|
230
|
+
}));
|
|
231
|
+
};
|
|
232
|
+
var sanitizeDateLiterals = replace([['"', ""], [":", "-"]]);
|
|
233
|
+
var removeAfterDot = removeAfter(".");
|
|
234
|
+
var directionFormatter = function(_a) {
|
|
235
|
+
var field = _a.field, _b = _a.dir, dir = _b === void 0 ? "asc" : _b;
|
|
236
|
+
return field + "-" + dir;
|
|
237
|
+
};
|
|
238
|
+
var aggregateFormatter = function(_a) {
|
|
239
|
+
var field = _a.field, aggregate = _a.aggregate;
|
|
240
|
+
return field + "-" + aggregate;
|
|
241
|
+
};
|
|
242
|
+
var take = getter("take");
|
|
243
|
+
var aggregates = getter("aggregates");
|
|
244
|
+
var skip = getter("skip");
|
|
245
|
+
var group = getter("group");
|
|
246
|
+
var sort = getter("sort", true);
|
|
247
|
+
var formatSort = formatDescriptors(sort, directionFormatter);
|
|
248
|
+
var formatGroup = formatDescriptors(group, directionFormatter);
|
|
249
|
+
var formatAggregates = formatDescriptors(aggregates, aggregateFormatter);
|
|
250
|
+
var prefixDateValue = function(value2) {
|
|
251
|
+
return "datetime'" + value2 + "'";
|
|
252
|
+
};
|
|
253
|
+
var formatDateValue = compose(prefixDateValue, removeAfterDot, sanitizeDateLiterals, JSON.stringify, toUTC);
|
|
254
|
+
var formatDate = function(_a) {
|
|
255
|
+
var field = _a.field, value2 = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator;
|
|
256
|
+
return {
|
|
257
|
+
value: formatDateValue(value2),
|
|
258
|
+
field,
|
|
259
|
+
ignoreCase,
|
|
260
|
+
operator
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
var normalizeSort = function(state) {
|
|
264
|
+
return Object.assign({}, state, {
|
|
265
|
+
sort: (sort(state) || []).filter(function(_a) {
|
|
266
|
+
var dir = _a.dir;
|
|
267
|
+
return isNotNullOrEmptyString(dir);
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
var transformSkip = compose(pairwise("page"), calcPage);
|
|
272
|
+
var transformTake = compose(pairwise("pageSize"), take);
|
|
273
|
+
var transformGroup = compose(pairwise("group"), formatGroup);
|
|
274
|
+
var transformSort = compose(pairwise("sort"), formatSort);
|
|
275
|
+
var transformAggregates = compose(pairwise("aggregate"), formatAggregates);
|
|
276
|
+
var serializePage = runOrEmpty(has(skip), transformSkip);
|
|
277
|
+
var serializePageSize = runOrEmpty(has(take), transformTake);
|
|
278
|
+
var serializeGroup = runOrEmpty(isNotEmpty(group), transformGroup);
|
|
279
|
+
var serializeAggregates = runOrEmpty(has(aggregates), transformAggregates);
|
|
280
|
+
var serializeSort = compose(runOrEmpty(isNotEmpty(sort), transformSort), normalizeSort);
|
|
281
|
+
var filterFormatter = function(_a) {
|
|
282
|
+
var field = _a.field, operator = _a.operator, value2 = _a.value;
|
|
283
|
+
return field + "~" + operator + "~" + value2;
|
|
284
|
+
};
|
|
285
|
+
var dateFormatter = ifElse(isDateValue, compose(filterFormatter, formatDate), filterFormatter);
|
|
286
|
+
|
|
287
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/mvc/deserialization.js
|
|
288
|
+
var set = function(field, target, value2) {
|
|
289
|
+
target[field] = value2;
|
|
290
|
+
return target;
|
|
291
|
+
};
|
|
292
|
+
var toCamelCase = function(str) {
|
|
293
|
+
return str.replace(/(^[A-Z])/g, function(_, g1) {
|
|
294
|
+
return g1.toLowerCase();
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
var prop = function(fieldName) {
|
|
298
|
+
return function(obj) {
|
|
299
|
+
var value2 = obj[fieldName];
|
|
300
|
+
if (isPresent(value2)) {
|
|
301
|
+
return value2;
|
|
302
|
+
}
|
|
303
|
+
return obj[toCamelCase(fieldName)];
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
var member = prop("Member");
|
|
307
|
+
var aggregateMethodName = prop("AggregateMethodName");
|
|
308
|
+
var value = prop("Value");
|
|
309
|
+
var convert = function(mapper) {
|
|
310
|
+
return function(values) {
|
|
311
|
+
return Object.keys(values).reduce(mapper.bind(null, values), {});
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
var translateAggregate = convert(function(source, acc, field) {
|
|
315
|
+
return set(field.toLowerCase(), acc, source[field]);
|
|
316
|
+
});
|
|
317
|
+
var translateAggregates = convert(function(source, acc, field) {
|
|
318
|
+
return set(field, acc, translateAggregate(source[field]));
|
|
319
|
+
});
|
|
320
|
+
var valueOrDefault = function(value2, defaultValue) {
|
|
321
|
+
return isPresent(value2) ? value2 : defaultValue;
|
|
322
|
+
};
|
|
323
|
+
var normalizeGroup = function(group2) {
|
|
324
|
+
return {
|
|
325
|
+
aggregates: group2.Aggregates || group2.aggregates,
|
|
326
|
+
field: group2.Member || group2.member || group2.field,
|
|
327
|
+
hasSubgroups: group2.HasSubgroups || group2.hasSubgroups || false,
|
|
328
|
+
items: group2.Items || group2.items,
|
|
329
|
+
value: valueOrDefault(group2.Key, valueOrDefault(group2.key, group2.value))
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
var translateGroup = compose(function(_a) {
|
|
333
|
+
var field = _a.field, hasSubgroups = _a.hasSubgroups, value2 = _a.value, aggregates2 = _a.aggregates, items = _a.items;
|
|
334
|
+
return {
|
|
335
|
+
aggregates: translateAggregates(aggregates2),
|
|
336
|
+
field,
|
|
337
|
+
items: hasSubgroups ? items.map(translateGroup) : items,
|
|
338
|
+
value: value2
|
|
339
|
+
};
|
|
340
|
+
}, normalizeGroup);
|
|
341
|
+
|
|
342
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/transducers.js
|
|
343
|
+
var map = function(transform) {
|
|
344
|
+
return function(reduce) {
|
|
345
|
+
return function(acc, curr, index) {
|
|
346
|
+
return reduce(acc, transform(curr, index));
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/grouping/aggregate.operators.js
|
|
352
|
+
var identity2 = map(function(x) {
|
|
353
|
+
return x;
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-no-eval.js
|
|
357
|
+
var logic = {
|
|
358
|
+
"or": {
|
|
359
|
+
concat: function(acc, fn) {
|
|
360
|
+
return function(a) {
|
|
361
|
+
return acc(a) || fn(a);
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
identity: function() {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"and": {
|
|
369
|
+
concat: function(acc, fn) {
|
|
370
|
+
return function(a) {
|
|
371
|
+
return acc(a) && fn(a);
|
|
372
|
+
};
|
|
373
|
+
},
|
|
374
|
+
identity: function() {
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
var operatorsMap = {
|
|
380
|
+
contains: function(a, b) {
|
|
381
|
+
return (a || "").indexOf(b) >= 0;
|
|
382
|
+
},
|
|
383
|
+
doesnotcontain: function(a, b) {
|
|
384
|
+
return (a || "").indexOf(b) === -1;
|
|
385
|
+
},
|
|
386
|
+
doesnotendwith: function(a, b) {
|
|
387
|
+
return (a || "").indexOf(b, (a || "").length - (b || "").length) < 0;
|
|
388
|
+
},
|
|
389
|
+
doesnotstartwith: function(a, b) {
|
|
390
|
+
return (a || "").lastIndexOf(b, 0) === -1;
|
|
391
|
+
},
|
|
392
|
+
endswith: function(a, b) {
|
|
393
|
+
return (a || "").indexOf(b, (a || "").length - (b || "").length) >= 0;
|
|
394
|
+
},
|
|
395
|
+
eq: function(a, b) {
|
|
396
|
+
return a === b;
|
|
397
|
+
},
|
|
398
|
+
gt: function(a, b) {
|
|
399
|
+
return a > b;
|
|
400
|
+
},
|
|
401
|
+
gte: function(a, b) {
|
|
402
|
+
return a >= b;
|
|
403
|
+
},
|
|
404
|
+
isempty: function(a) {
|
|
405
|
+
return a === "";
|
|
406
|
+
},
|
|
407
|
+
isnotempty: function(a) {
|
|
408
|
+
return a !== "";
|
|
409
|
+
},
|
|
410
|
+
isnotnull: function(a) {
|
|
411
|
+
return isPresent(a);
|
|
412
|
+
},
|
|
413
|
+
isnull: function(a) {
|
|
414
|
+
return isBlank(a);
|
|
415
|
+
},
|
|
416
|
+
lt: function(a, b) {
|
|
417
|
+
return a < b;
|
|
418
|
+
},
|
|
419
|
+
lte: function(a, b) {
|
|
420
|
+
return a <= b;
|
|
421
|
+
},
|
|
422
|
+
neq: function(a, b) {
|
|
423
|
+
return a != b;
|
|
424
|
+
},
|
|
425
|
+
startswith: function(a, b) {
|
|
426
|
+
return (a || "").lastIndexOf(b, 0) === 0;
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
var dateRegExp = /^\/Date\((.*?)\)\/$/;
|
|
430
|
+
var convertValue = function(value2, ignoreCase) {
|
|
431
|
+
if (value2 != null && isString(value2)) {
|
|
432
|
+
var date = dateRegExp.exec(value2);
|
|
433
|
+
if (date) {
|
|
434
|
+
return (/* @__PURE__ */ new Date(+date[1])).getTime();
|
|
435
|
+
} else if (ignoreCase) {
|
|
436
|
+
return value2.toLowerCase();
|
|
437
|
+
}
|
|
438
|
+
} else if (value2 != null && isDate(value2)) {
|
|
439
|
+
return value2.getTime();
|
|
440
|
+
}
|
|
441
|
+
return value2;
|
|
442
|
+
};
|
|
443
|
+
var typedGetter = function(prop2, value2, ignoreCase) {
|
|
444
|
+
if (!isPresent(value2)) {
|
|
445
|
+
return prop2;
|
|
446
|
+
}
|
|
447
|
+
var acc = prop2;
|
|
448
|
+
if (isString(value2)) {
|
|
449
|
+
var date = dateRegExp.exec(value2);
|
|
450
|
+
if (date) {
|
|
451
|
+
value2 = /* @__PURE__ */ new Date(+date[1]);
|
|
452
|
+
} else {
|
|
453
|
+
acc = function(a) {
|
|
454
|
+
var x = prop2(a);
|
|
455
|
+
if (typeof x === "string" && ignoreCase) {
|
|
456
|
+
return x.toLowerCase();
|
|
457
|
+
} else {
|
|
458
|
+
return isNumeric(x) ? x + "" : x;
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (isDate(value2)) {
|
|
464
|
+
return function(a) {
|
|
465
|
+
var x = acc(a);
|
|
466
|
+
return isDate(x) ? x.getTime() : x;
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
return acc;
|
|
470
|
+
};
|
|
471
|
+
var transformFilter = function(_a) {
|
|
472
|
+
var field = _a.field, ignoreCase = _a.ignoreCase, value2 = _a.value, operator = _a.operator;
|
|
473
|
+
field = !isPresent(field) ? function(a) {
|
|
474
|
+
return a;
|
|
475
|
+
} : field;
|
|
476
|
+
ignoreCase = isPresent(ignoreCase) ? ignoreCase : true;
|
|
477
|
+
var itemProp = typedGetter(isFunction(field) ? field : getter(field, true), value2, ignoreCase);
|
|
478
|
+
value2 = convertValue(value2, ignoreCase);
|
|
479
|
+
var op = isFunction(operator) ? operator : operatorsMap[operator];
|
|
480
|
+
return function(a) {
|
|
481
|
+
return op(itemProp(a), value2, ignoreCase);
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
var transformCompositeFilter = function(filter2) {
|
|
485
|
+
var combiner = logic[filter2.logic];
|
|
486
|
+
return filter2.filters.filter(isPresent).map(function(x) {
|
|
487
|
+
return isCompositeFilterDescriptor(x) ? transformCompositeFilter(x) : transformFilter(x);
|
|
488
|
+
}).reduce(combiner.concat, combiner.identity);
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filtering/filter-expression.factory.js
|
|
492
|
+
var compileFilter = function(descriptor) {
|
|
493
|
+
if (!descriptor || descriptor.filters.length === 0) {
|
|
494
|
+
return function() {
|
|
495
|
+
return true;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
return transformCompositeFilter(descriptor);
|
|
499
|
+
};
|
|
500
|
+
var filterBy = function(data, descriptor) {
|
|
501
|
+
if (!isPresent(descriptor) || isCompositeFilterDescriptor(descriptor) && descriptor.filters.length === 0) {
|
|
502
|
+
return data;
|
|
503
|
+
}
|
|
504
|
+
return data.filter(compileFilter(normalizeFilters(descriptor)));
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/grouping/group.operators.js
|
|
508
|
+
var identity3 = map(function(x) {
|
|
509
|
+
return x;
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// ../../../node_modules/@progress/kendo-data-query/dist/es/filtering/operators.enum.js
|
|
513
|
+
var FilterOperator;
|
|
514
|
+
(function(FilterOperator2) {
|
|
515
|
+
FilterOperator2["Contains"] = "contains";
|
|
516
|
+
FilterOperator2["DoesNotContain"] = "doesnotcontain";
|
|
517
|
+
FilterOperator2["DoesNotEndWith"] = "doesnotendwith";
|
|
518
|
+
FilterOperator2["DoesNotStartWith"] = "doesnotstartwith";
|
|
519
|
+
FilterOperator2["EndsWith"] = "endswith";
|
|
520
|
+
FilterOperator2["EqualTo"] = "eq";
|
|
521
|
+
FilterOperator2["GreaterThan"] = "gt";
|
|
522
|
+
FilterOperator2["GreaterThanOrEqual"] = "gte";
|
|
523
|
+
FilterOperator2["IsEmpty"] = "isempty";
|
|
524
|
+
FilterOperator2["IsNotEmpty"] = "isnotempty";
|
|
525
|
+
FilterOperator2["IsNotNull"] = "isnotnull";
|
|
526
|
+
FilterOperator2["IsNull"] = "isnull";
|
|
527
|
+
FilterOperator2["LessThan"] = "lt";
|
|
528
|
+
FilterOperator2["LessThanOrEqual"] = "lte";
|
|
529
|
+
FilterOperator2["NotEqualTo"] = "neq";
|
|
530
|
+
FilterOperator2["StartsWith"] = "startswith";
|
|
531
|
+
})(FilterOperator || (FilterOperator = {}));
|
|
532
|
+
|
|
533
|
+
// src/components/Select/SelectClient.tsx
|
|
534
|
+
import {
|
|
535
|
+
ComboBox
|
|
536
|
+
} from "@progress/kendo-react-dropdowns";
|
|
537
|
+
import { useEffect, useRef, useState } from "react";
|
|
538
|
+
import { jsx } from "react/jsx-runtime";
|
|
539
|
+
var SelectClient = ({
|
|
540
|
+
value: valueProp,
|
|
541
|
+
data: propData,
|
|
542
|
+
filter: filterProp,
|
|
543
|
+
keyField: keyField2 = "key",
|
|
544
|
+
textField: textField3 = "text",
|
|
545
|
+
placeholder,
|
|
546
|
+
virtual,
|
|
547
|
+
filterable,
|
|
548
|
+
disabled,
|
|
549
|
+
loading,
|
|
550
|
+
className,
|
|
551
|
+
onChange,
|
|
552
|
+
onFilterChange
|
|
553
|
+
}) => {
|
|
554
|
+
const [value2, setValue] = useState(valueProp);
|
|
555
|
+
const [filter2, setFilter] = useState(filterProp);
|
|
556
|
+
const handleChange = (event) => {
|
|
557
|
+
const value3 = event.target.value || null;
|
|
558
|
+
if (valueProp !== void 0) {
|
|
559
|
+
onChange(value3);
|
|
560
|
+
} else {
|
|
561
|
+
setValue(value3);
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
565
|
+
const filteredData = useRef([]);
|
|
566
|
+
const [state, setState] = useState({
|
|
567
|
+
skip: 0,
|
|
568
|
+
total: propData.total,
|
|
569
|
+
subsetData: propData.items.slice(0, pageSize3)
|
|
570
|
+
});
|
|
571
|
+
const handleFilterChange = (event) => {
|
|
572
|
+
if (pageSize3) {
|
|
573
|
+
filteredData.current = filterBy(propData.items.slice(), event.filter);
|
|
574
|
+
const data = filteredData.current.slice(0, pageSize3);
|
|
575
|
+
setState({
|
|
576
|
+
subsetData: data,
|
|
577
|
+
skip: 0,
|
|
578
|
+
total: filteredData.current.length
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
const filter3 = event.filter.value;
|
|
582
|
+
if (filterProp !== void 0) {
|
|
583
|
+
onFilterChange == null ? void 0 : onFilterChange(filter3);
|
|
584
|
+
} else {
|
|
585
|
+
setFilter(filter3);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
const handlePageChange = (event) => {
|
|
589
|
+
if (pageSize3) {
|
|
590
|
+
const skip3 = event.page.skip;
|
|
591
|
+
const take3 = event.page.take;
|
|
592
|
+
const newSubsetData = filteredData.current.slice(skip3, skip3 + take3);
|
|
593
|
+
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip: skip3 }));
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
useEffect(() => {
|
|
597
|
+
if (valueProp !== void 0) {
|
|
598
|
+
setValue(valueProp);
|
|
599
|
+
}
|
|
600
|
+
}, [valueProp]);
|
|
601
|
+
useEffect(() => {
|
|
602
|
+
setFilter(filterProp);
|
|
603
|
+
}, [filterProp]);
|
|
604
|
+
useEffect(() => {
|
|
605
|
+
if (pageSize3) {
|
|
606
|
+
filteredData.current = propData.items.slice();
|
|
607
|
+
}
|
|
608
|
+
}, [propData]);
|
|
609
|
+
return /* @__PURE__ */ jsx(
|
|
610
|
+
ComboBox,
|
|
611
|
+
{
|
|
612
|
+
value: value2,
|
|
613
|
+
data: pageSize3 ? state.subsetData : propData.items,
|
|
614
|
+
placeholder,
|
|
615
|
+
dataItemKey: keyField2,
|
|
616
|
+
textField: textField3,
|
|
617
|
+
filterable,
|
|
618
|
+
filter: filter2,
|
|
619
|
+
virtual: pageSize3 ? {
|
|
620
|
+
total: state.total,
|
|
621
|
+
pageSize: pageSize3,
|
|
622
|
+
skip: state.skip
|
|
623
|
+
} : void 0,
|
|
624
|
+
disabled,
|
|
625
|
+
loading,
|
|
626
|
+
className,
|
|
627
|
+
onChange: handleChange,
|
|
628
|
+
onFilterChange: handleFilterChange,
|
|
629
|
+
onPageChange: handlePageChange
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
};
|
|
633
|
+
var SelectClient_default = SelectClient;
|
|
634
|
+
|
|
635
|
+
// src/components/Select/SelectServer.tsx
|
|
636
|
+
import {
|
|
637
|
+
ComboBox as ComboBox2
|
|
638
|
+
} from "@progress/kendo-react-dropdowns";
|
|
639
|
+
import { cloneElement, useCallback, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
640
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
641
|
+
var textField = "ContactName";
|
|
642
|
+
var emptyItem = { [textField]: "loading ...", CustomerID: 0 };
|
|
643
|
+
var pageSize = 10;
|
|
644
|
+
var loadingData = [];
|
|
645
|
+
while (loadingData.length < pageSize) {
|
|
646
|
+
loadingData.push(__spreadValues({}, emptyItem));
|
|
647
|
+
}
|
|
648
|
+
var SelectServer = ({
|
|
649
|
+
data: dataProp,
|
|
650
|
+
value: valueProp,
|
|
651
|
+
keyField: keyField2 = "key",
|
|
652
|
+
textField: textField3 = "text",
|
|
653
|
+
placeholder,
|
|
654
|
+
virtual,
|
|
655
|
+
filterable,
|
|
656
|
+
filter: filterProp = "",
|
|
657
|
+
disabled,
|
|
658
|
+
loading,
|
|
659
|
+
className,
|
|
660
|
+
onChange,
|
|
661
|
+
onDataChange,
|
|
662
|
+
onFilterChange,
|
|
663
|
+
getData,
|
|
664
|
+
renderItem
|
|
665
|
+
}) => {
|
|
666
|
+
var _a;
|
|
667
|
+
const dataCaching = useRef2([]);
|
|
668
|
+
const pendingRequest = useRef2();
|
|
669
|
+
const requestStarted = useRef2(false);
|
|
670
|
+
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
671
|
+
const [loadingData3, setLoadingData] = useState2([]);
|
|
672
|
+
const [data, setData] = useState2(dataProp.items);
|
|
673
|
+
const [total, setTotal] = useState2(0);
|
|
674
|
+
const [value2, setValue] = useState2(valueProp);
|
|
675
|
+
const [filter2, setFilter] = useState2(filterProp);
|
|
676
|
+
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
677
|
+
const skipRef = useRef2(0);
|
|
678
|
+
const resetCach = () => {
|
|
679
|
+
dataCaching.current.length = 0;
|
|
680
|
+
};
|
|
681
|
+
const requestData = useCallback((state) => {
|
|
682
|
+
const { skip: skip3 } = state;
|
|
683
|
+
if (requestStarted.current) {
|
|
684
|
+
clearTimeout(pendingRequest.current);
|
|
685
|
+
pendingRequest.current = setTimeout(() => {
|
|
686
|
+
requestData(state);
|
|
687
|
+
}, 50);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
requestStarted.current = true;
|
|
691
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
692
|
+
items.forEach((item, index) => {
|
|
693
|
+
dataCaching.current[index + skip3] = item;
|
|
694
|
+
});
|
|
695
|
+
if (skip3 === skipRef.current) {
|
|
696
|
+
setData(items);
|
|
697
|
+
setTotal(total2);
|
|
698
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
699
|
+
}
|
|
700
|
+
requestStarted.current = false;
|
|
701
|
+
}).catch(() => {
|
|
702
|
+
requestStarted.current = false;
|
|
703
|
+
});
|
|
704
|
+
}, []);
|
|
705
|
+
const handleFilterChange = useCallback((event) => {
|
|
706
|
+
const filter3 = event.filter.value;
|
|
707
|
+
if (filterProp !== void 0) {
|
|
708
|
+
onFilterChange == null ? void 0 : onFilterChange(filter3);
|
|
709
|
+
} else {
|
|
710
|
+
setFilter(filter3);
|
|
711
|
+
}
|
|
712
|
+
resetCach();
|
|
713
|
+
requestData({ skip: 0, filter: filter3 });
|
|
714
|
+
setData(loadingData3);
|
|
715
|
+
skipRef.current = 0;
|
|
716
|
+
}, []);
|
|
717
|
+
const shouldRequestData = useCallback((skip3) => {
|
|
718
|
+
for (let i = 0; i < pageSize3; i++) {
|
|
719
|
+
if (!dataCaching.current[skip3 + i]) {
|
|
720
|
+
return true;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return false;
|
|
724
|
+
}, []);
|
|
725
|
+
const getCachedData = useCallback((skip3) => {
|
|
726
|
+
const data2 = [];
|
|
727
|
+
for (let i = 0; i < pageSize3; i++) {
|
|
728
|
+
data2.push(dataCaching.current[i + skip3] || emptyItem3);
|
|
729
|
+
}
|
|
730
|
+
return data2;
|
|
731
|
+
}, []);
|
|
732
|
+
const pageChange = useCallback(
|
|
733
|
+
(event) => {
|
|
734
|
+
if (filter2 !== void 0) {
|
|
735
|
+
const newSkip = event.page.skip;
|
|
736
|
+
if (shouldRequestData(newSkip)) {
|
|
737
|
+
requestData({ skip: newSkip, filter: filter2 });
|
|
738
|
+
}
|
|
739
|
+
const data2 = getCachedData(newSkip);
|
|
740
|
+
setData(data2);
|
|
741
|
+
skipRef.current = newSkip;
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
[getCachedData, requestData, shouldRequestData, filter2]
|
|
745
|
+
);
|
|
746
|
+
const handleChange = useCallback((event) => {
|
|
747
|
+
const value3 = event.target.value;
|
|
748
|
+
if (value3 && value3[textField3] === emptyItem3[textField3]) {
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
if (valueProp !== void 0) {
|
|
752
|
+
onChange(value3);
|
|
753
|
+
} else {
|
|
754
|
+
setValue(value3);
|
|
755
|
+
}
|
|
756
|
+
}, []);
|
|
757
|
+
const handleItemRender = (li, itemProps) => {
|
|
758
|
+
const itemChildren = renderItem == null ? void 0 : renderItem(itemProps.dataItem);
|
|
759
|
+
if (!itemChildren)
|
|
760
|
+
return cloneElement(li, li.props);
|
|
761
|
+
return cloneElement(li, li.props, itemChildren);
|
|
762
|
+
};
|
|
763
|
+
useEffect2(() => {
|
|
764
|
+
const pageSize4 = 10;
|
|
765
|
+
const loadingData4 = [];
|
|
766
|
+
while (loadingData4.length < pageSize4) {
|
|
767
|
+
loadingData4.push(emptyItem3);
|
|
768
|
+
}
|
|
769
|
+
setLoadingData(loadingData4);
|
|
770
|
+
}, []);
|
|
771
|
+
useEffect2(() => {
|
|
772
|
+
if (valueProp !== void 0) {
|
|
773
|
+
setValue(valueProp);
|
|
774
|
+
}
|
|
775
|
+
}, [valueProp]);
|
|
776
|
+
useEffect2(() => {
|
|
777
|
+
if (filterProp !== void 0) {
|
|
778
|
+
setFilter(filterProp);
|
|
779
|
+
}
|
|
780
|
+
}, [filterProp]);
|
|
781
|
+
useEffect2(() => {
|
|
782
|
+
requestData({ skip: 0, filter: filter2 });
|
|
783
|
+
return () => {
|
|
784
|
+
resetCach();
|
|
785
|
+
};
|
|
786
|
+
}, [filter2, requestData]);
|
|
787
|
+
useEffect2(() => {
|
|
788
|
+
setData(dataProp.items);
|
|
789
|
+
}, [dataProp]);
|
|
790
|
+
return /* @__PURE__ */ jsx2(
|
|
791
|
+
ComboBox2,
|
|
792
|
+
{
|
|
793
|
+
data,
|
|
794
|
+
value: value2,
|
|
795
|
+
placeholder,
|
|
796
|
+
dataItemKey: keyField2,
|
|
797
|
+
textField: textField3,
|
|
798
|
+
filterable,
|
|
799
|
+
onFilterChange: handleFilterChange,
|
|
800
|
+
virtual: {
|
|
801
|
+
pageSize: pageSize3,
|
|
802
|
+
skip: skipRef.current,
|
|
803
|
+
total
|
|
804
|
+
},
|
|
805
|
+
disabled,
|
|
806
|
+
loading,
|
|
807
|
+
className,
|
|
808
|
+
onChange: handleChange,
|
|
809
|
+
onPageChange: pageChange,
|
|
810
|
+
itemRender: handleItemRender
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
};
|
|
814
|
+
var SelectServer_default = SelectServer;
|
|
815
|
+
|
|
816
|
+
// src/components/Select/Select.tsx
|
|
817
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
818
|
+
var Select = (props) => {
|
|
819
|
+
return props.filterMode === "client" ? /* @__PURE__ */ jsx3(SelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx3(SelectServer_default, __spreadValues({}, props));
|
|
820
|
+
};
|
|
821
|
+
var Select_default = Select;
|
|
822
|
+
|
|
823
|
+
// src/components/MultiSelect/MultiSelectClient.tsx
|
|
824
|
+
import {
|
|
825
|
+
MultiSelect
|
|
826
|
+
} from "@progress/kendo-react-dropdowns";
|
|
827
|
+
import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
|
|
828
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
829
|
+
var textField2 = "text";
|
|
830
|
+
var keyField = "key";
|
|
831
|
+
var emptyItem2 = { [textField2]: "loading ...", [keyField]: 0 };
|
|
832
|
+
var pageSize2 = 10;
|
|
833
|
+
var loadingData2 = [];
|
|
834
|
+
while (loadingData2.length < pageSize2) {
|
|
835
|
+
loadingData2.push(__spreadValues({}, emptyItem2));
|
|
836
|
+
}
|
|
837
|
+
var SelectClient2 = ({
|
|
838
|
+
data: dataProp,
|
|
839
|
+
value: valueProp,
|
|
840
|
+
keyField: keyField2 = "key",
|
|
841
|
+
textField: textField3 = "text",
|
|
842
|
+
placeholder,
|
|
843
|
+
virtual,
|
|
844
|
+
filterable,
|
|
845
|
+
filter: filterProp,
|
|
846
|
+
disabled,
|
|
847
|
+
loading,
|
|
848
|
+
className,
|
|
849
|
+
onChange,
|
|
850
|
+
onFilterChange
|
|
851
|
+
}) => {
|
|
852
|
+
const [value2, setValue] = useState3(valueProp);
|
|
853
|
+
const [filter2, setFilter] = useState3(filterProp);
|
|
854
|
+
const handleChange = (event) => {
|
|
855
|
+
onChange(event.target.value);
|
|
856
|
+
};
|
|
857
|
+
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
858
|
+
const filteredData = useRef3([]);
|
|
859
|
+
const [state, setState] = useState3({
|
|
860
|
+
skip: 0,
|
|
861
|
+
total: dataProp.total,
|
|
862
|
+
subsetData: dataProp.items.slice(0, pageSize3)
|
|
863
|
+
});
|
|
864
|
+
const handleFilterChange = (event) => {
|
|
865
|
+
if (pageSize3) {
|
|
866
|
+
filteredData.current = filterBy(dataProp.items.slice(), event.filter);
|
|
867
|
+
const data = filteredData.current.slice(0, pageSize3);
|
|
868
|
+
setState({
|
|
869
|
+
subsetData: data,
|
|
870
|
+
skip: 0,
|
|
871
|
+
total: filteredData.current.length
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
onFilterChange == null ? void 0 : onFilterChange(event.filter.value);
|
|
875
|
+
};
|
|
876
|
+
const pageChange = (event) => {
|
|
877
|
+
if (pageSize3) {
|
|
878
|
+
const skip3 = event.page.skip;
|
|
879
|
+
const take3 = event.page.take;
|
|
880
|
+
const newSubsetData = filteredData.current.slice(skip3, skip3 + take3);
|
|
881
|
+
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip: skip3 }));
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
useEffect3(() => {
|
|
885
|
+
setValue(valueProp);
|
|
886
|
+
}, [valueProp]);
|
|
887
|
+
useEffect3(() => {
|
|
888
|
+
setFilter(filterProp);
|
|
889
|
+
}, [filterProp]);
|
|
890
|
+
useEffect3(() => {
|
|
891
|
+
if (pageSize3) {
|
|
892
|
+
filteredData.current = dataProp.items.slice();
|
|
893
|
+
}
|
|
894
|
+
}, [dataProp]);
|
|
895
|
+
return /* @__PURE__ */ jsx4(
|
|
896
|
+
MultiSelect,
|
|
897
|
+
{
|
|
898
|
+
value: value2,
|
|
899
|
+
data: pageSize3 ? state.subsetData : dataProp.items,
|
|
900
|
+
placeholder,
|
|
901
|
+
dataItemKey: keyField2,
|
|
902
|
+
textField: textField3,
|
|
903
|
+
filterable,
|
|
904
|
+
filter: filter2,
|
|
905
|
+
virtual: pageSize3 ? {
|
|
906
|
+
total: state.total,
|
|
907
|
+
pageSize: pageSize3,
|
|
908
|
+
skip: state.skip
|
|
909
|
+
} : void 0,
|
|
910
|
+
disabled,
|
|
911
|
+
loading,
|
|
912
|
+
className,
|
|
913
|
+
onChange: handleChange,
|
|
914
|
+
onFilterChange: handleFilterChange,
|
|
915
|
+
onPageChange: pageChange
|
|
916
|
+
}
|
|
917
|
+
);
|
|
918
|
+
};
|
|
919
|
+
var MultiSelectClient_default = SelectClient2;
|
|
920
|
+
|
|
921
|
+
// src/components/MultiSelect/MultiSelectServer.tsx
|
|
922
|
+
import {
|
|
923
|
+
MultiSelect as MultiSelect2
|
|
924
|
+
} from "@progress/kendo-react-dropdowns";
|
|
925
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef4, useState as useState4 } from "react";
|
|
926
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
927
|
+
var MultiSelectServer = ({
|
|
928
|
+
data: dataProp,
|
|
929
|
+
value: valueProp,
|
|
930
|
+
keyField: keyField2 = "key",
|
|
931
|
+
textField: textField3 = "text",
|
|
932
|
+
placeholder,
|
|
933
|
+
virtual,
|
|
934
|
+
filterable,
|
|
935
|
+
filter: filterProp = "",
|
|
936
|
+
disabled,
|
|
937
|
+
loading,
|
|
938
|
+
className,
|
|
939
|
+
onDataChange,
|
|
940
|
+
onChange,
|
|
941
|
+
onFilterChange,
|
|
942
|
+
getData
|
|
943
|
+
}) => {
|
|
944
|
+
var _a;
|
|
945
|
+
const dataCaching = useRef4([]);
|
|
946
|
+
const pendingRequest = useRef4();
|
|
947
|
+
const requestStarted = useRef4(false);
|
|
948
|
+
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
949
|
+
const [loadingData3, setLoadingData] = useState4([]);
|
|
950
|
+
const [data, setData] = useState4(dataProp.items);
|
|
951
|
+
const [total, setTotal] = useState4(0);
|
|
952
|
+
const [value2, setValue] = useState4(valueProp);
|
|
953
|
+
const [filter2, setFilter] = useState4(filterProp);
|
|
954
|
+
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
955
|
+
const skipRef = useRef4(0);
|
|
956
|
+
const resetCach = () => {
|
|
957
|
+
dataCaching.current.length = 0;
|
|
958
|
+
};
|
|
959
|
+
const requestData = useCallback2((state) => {
|
|
960
|
+
if (requestStarted.current) {
|
|
961
|
+
clearTimeout(pendingRequest.current);
|
|
962
|
+
pendingRequest.current = setTimeout(() => {
|
|
963
|
+
requestData(state);
|
|
964
|
+
}, 50);
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
requestStarted.current = true;
|
|
968
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
969
|
+
const { skip: skip3 } = state;
|
|
970
|
+
items.forEach((item, index) => {
|
|
971
|
+
dataCaching.current[index + skip3] = item;
|
|
972
|
+
});
|
|
973
|
+
if (skip3 === skipRef.current) {
|
|
974
|
+
setData(items);
|
|
975
|
+
setTotal(total2);
|
|
976
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
977
|
+
}
|
|
978
|
+
requestStarted.current = false;
|
|
979
|
+
}).catch(() => {
|
|
980
|
+
requestStarted.current = false;
|
|
981
|
+
});
|
|
982
|
+
}, []);
|
|
983
|
+
const handleFilterChange = useCallback2((event) => {
|
|
984
|
+
const filter3 = event.filter.value;
|
|
985
|
+
resetCach();
|
|
986
|
+
requestData({ skip: 0, filter: filter3 });
|
|
987
|
+
setData(loadingData3);
|
|
988
|
+
skipRef.current = 0;
|
|
989
|
+
setFilter(filter3);
|
|
990
|
+
onFilterChange == null ? void 0 : onFilterChange(filter3);
|
|
991
|
+
}, []);
|
|
992
|
+
const shouldRequestData = useCallback2((skip3) => {
|
|
993
|
+
for (let i = 0; i < pageSize3; i++) {
|
|
994
|
+
if (!dataCaching.current[skip3 + i]) {
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
return false;
|
|
999
|
+
}, []);
|
|
1000
|
+
const getCachedData = useCallback2((skip3) => {
|
|
1001
|
+
const data2 = [];
|
|
1002
|
+
for (let i = 0; i < pageSize3; i++) {
|
|
1003
|
+
data2.push(dataCaching.current[i + skip3] || emptyItem3);
|
|
1004
|
+
}
|
|
1005
|
+
return data2;
|
|
1006
|
+
}, []);
|
|
1007
|
+
const pageChange = useCallback2(
|
|
1008
|
+
(event) => {
|
|
1009
|
+
const newSkip = event.page.skip;
|
|
1010
|
+
if (shouldRequestData(newSkip)) {
|
|
1011
|
+
requestData({ skip: newSkip, filter: filter2 });
|
|
1012
|
+
}
|
|
1013
|
+
const data2 = getCachedData(newSkip);
|
|
1014
|
+
setData(data2);
|
|
1015
|
+
skipRef.current = newSkip;
|
|
1016
|
+
},
|
|
1017
|
+
[getCachedData, requestData, shouldRequestData, filter2]
|
|
1018
|
+
);
|
|
1019
|
+
const handleChange = useCallback2((event) => {
|
|
1020
|
+
const value3 = event.target.value;
|
|
1021
|
+
if (value3 && value3[textField3] === emptyItem3[textField3]) {
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
setValue(value3);
|
|
1025
|
+
onChange(value3);
|
|
1026
|
+
}, []);
|
|
1027
|
+
useEffect4(() => {
|
|
1028
|
+
const pageSize4 = 10;
|
|
1029
|
+
const loadingData4 = [];
|
|
1030
|
+
while (loadingData4.length < pageSize4) {
|
|
1031
|
+
loadingData4.push(emptyItem3);
|
|
1032
|
+
}
|
|
1033
|
+
setLoadingData(loadingData4);
|
|
1034
|
+
}, []);
|
|
1035
|
+
useEffect4(() => {
|
|
1036
|
+
setData(dataProp.items);
|
|
1037
|
+
}, [dataProp]);
|
|
1038
|
+
useEffect4(() => {
|
|
1039
|
+
setValue(valueProp);
|
|
1040
|
+
}, [valueProp]);
|
|
1041
|
+
useEffect4(() => {
|
|
1042
|
+
setFilter(filterProp);
|
|
1043
|
+
}, [filterProp]);
|
|
1044
|
+
useEffect4(() => {
|
|
1045
|
+
requestData({ skip: 0, filter: filter2 });
|
|
1046
|
+
return () => {
|
|
1047
|
+
resetCach();
|
|
1048
|
+
};
|
|
1049
|
+
}, [filter2, requestData]);
|
|
1050
|
+
return /* @__PURE__ */ jsx5(
|
|
1051
|
+
MultiSelect2,
|
|
1052
|
+
{
|
|
1053
|
+
data,
|
|
1054
|
+
value: value2,
|
|
1055
|
+
placeholder,
|
|
1056
|
+
dataItemKey: keyField2,
|
|
1057
|
+
textField: textField3,
|
|
1058
|
+
filterable,
|
|
1059
|
+
onFilterChange: handleFilterChange,
|
|
1060
|
+
virtual: {
|
|
1061
|
+
pageSize: pageSize3,
|
|
1062
|
+
skip: skipRef.current,
|
|
1063
|
+
total
|
|
1064
|
+
},
|
|
1065
|
+
disabled,
|
|
1066
|
+
loading,
|
|
1067
|
+
className,
|
|
1068
|
+
onChange: handleChange,
|
|
1069
|
+
onPageChange: pageChange
|
|
1070
|
+
}
|
|
1071
|
+
);
|
|
1072
|
+
};
|
|
1073
|
+
var MultiSelectServer_default = MultiSelectServer;
|
|
1074
|
+
|
|
1075
|
+
// src/components/MultiSelect/MultiSelect.tsx
|
|
1076
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1077
|
+
var MultiSelect3 = (props) => {
|
|
1078
|
+
return props.filterMode === "client" ? /* @__PURE__ */ jsx6(MultiSelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx6(MultiSelectServer_default, __spreadValues({}, props));
|
|
1079
|
+
};
|
|
1080
|
+
var MultiSelect_default = MultiSelect3;
|
|
1081
|
+
|
|
1
1082
|
// src/components/DropdownEnumList.tsx
|
|
2
1083
|
import { DropDownList } from "@progress/kendo-react-dropdowns";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
1084
|
+
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
1085
|
+
import { Fragment, jsx as jsx7 } from "react/jsx-runtime";
|
|
5
1086
|
function parsearDataForComboBox(array, key, text, itemAll = false) {
|
|
6
1087
|
const dataForComboBox = [];
|
|
7
1088
|
if (itemAll)
|
|
@@ -36,16 +1117,16 @@ function EnumToArray(typeEnum, replaceGuionForSpace = true, description) {
|
|
|
36
1117
|
return values;
|
|
37
1118
|
}
|
|
38
1119
|
var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) => {
|
|
39
|
-
const [
|
|
40
|
-
const [data, setData] =
|
|
41
|
-
|
|
1120
|
+
const [value2, setValue] = useState5("");
|
|
1121
|
+
const [data, setData] = useState5([]);
|
|
1122
|
+
useEffect5(() => {
|
|
42
1123
|
setData(
|
|
43
1124
|
parsearDataForComboBox(EnumToArray(dataEnum, true, description), "value", "label", false).sort(
|
|
44
1125
|
(a, b) => Number(a.key) - Number(b.key)
|
|
45
1126
|
)
|
|
46
1127
|
);
|
|
47
1128
|
}, []);
|
|
48
|
-
|
|
1129
|
+
useEffect5(() => {
|
|
49
1130
|
if (data.length > 0) {
|
|
50
1131
|
setValue(data.filter((x) => x.key == defaultValue)[0]);
|
|
51
1132
|
}
|
|
@@ -54,7 +1135,7 @@ var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) =>
|
|
|
54
1135
|
onChange(e);
|
|
55
1136
|
setValue(e);
|
|
56
1137
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7(
|
|
58
1139
|
DropDownList,
|
|
59
1140
|
{
|
|
60
1141
|
className: "d-inline-block align-middle mr-2",
|
|
@@ -69,23 +1150,23 @@ var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) =>
|
|
|
69
1150
|
style: {
|
|
70
1151
|
width: `${width}px`
|
|
71
1152
|
},
|
|
72
|
-
defaultValue:
|
|
1153
|
+
defaultValue: value2
|
|
73
1154
|
}
|
|
74
1155
|
) });
|
|
75
1156
|
};
|
|
76
1157
|
|
|
77
1158
|
// src/contexts/BreadCrumbContext.tsx
|
|
78
1159
|
import { useLocalStorage } from "@unifiedsoftware/react-ui";
|
|
79
|
-
import { createContext, useState as
|
|
80
|
-
import { jsx as
|
|
1160
|
+
import { createContext, useState as useState6 } from "react";
|
|
1161
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
81
1162
|
var BreadCrumbContext = createContext({});
|
|
82
1163
|
var BreadCrumbContextProvider = ({ children }) => {
|
|
83
1164
|
const [active, setActive] = useLocalStorage("@active", "");
|
|
84
1165
|
const [path, setPath] = useLocalStorage("@path", "/");
|
|
85
1166
|
const [goBack, setGoBack] = useLocalStorage("@goBack", false);
|
|
86
1167
|
const [pathChild, setPathChild] = useLocalStorage("@pathChild", "");
|
|
87
|
-
const [routes, setRoutes] =
|
|
88
|
-
return /* @__PURE__ */
|
|
1168
|
+
const [routes, setRoutes] = useState6([]);
|
|
1169
|
+
return /* @__PURE__ */ jsx8(
|
|
89
1170
|
BreadCrumbContext.Provider,
|
|
90
1171
|
{
|
|
91
1172
|
value: {
|
|
@@ -106,51 +1187,51 @@ var BreadCrumbContextProvider = ({ children }) => {
|
|
|
106
1187
|
};
|
|
107
1188
|
|
|
108
1189
|
// src/contexts/DrawerContext.tsx
|
|
109
|
-
import { createContext as createContext2, useState as
|
|
110
|
-
import { jsx as
|
|
1190
|
+
import { createContext as createContext2, useState as useState7 } from "react";
|
|
1191
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
111
1192
|
var DrawerContext = createContext2({});
|
|
112
1193
|
var DrawerContextProvider = ({ children }) => {
|
|
113
|
-
const [active, setActive] =
|
|
114
|
-
return /* @__PURE__ */
|
|
1194
|
+
const [active, setActive] = useState7(false);
|
|
1195
|
+
return /* @__PURE__ */ jsx9(DrawerContext.Provider, { value: { active, setActive }, children });
|
|
115
1196
|
};
|
|
116
1197
|
|
|
117
1198
|
// src/contexts/HistoryContext.tsx
|
|
118
1199
|
import { useLocalStorage as useLocalStorage2 } from "@unifiedsoftware/react-ui";
|
|
119
1200
|
import { createContext as createContext3 } from "react";
|
|
120
|
-
import { jsx as
|
|
1201
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
121
1202
|
var HistoryContext = createContext3({});
|
|
122
1203
|
var HistoryContextProvider = ({ children }) => {
|
|
123
1204
|
const [list, setList] = useLocalStorage2("@list_paths", []);
|
|
124
|
-
const updateList = (
|
|
1205
|
+
const updateList = (value2) => {
|
|
125
1206
|
setList(
|
|
126
1207
|
(prev) => prev.concat({
|
|
127
|
-
path:
|
|
128
|
-
name:
|
|
1208
|
+
path: value2.path,
|
|
1209
|
+
name: value2.name,
|
|
129
1210
|
date: /* @__PURE__ */ new Date()
|
|
130
1211
|
})
|
|
131
1212
|
);
|
|
132
1213
|
};
|
|
133
|
-
return /* @__PURE__ */
|
|
1214
|
+
return /* @__PURE__ */ jsx10(HistoryContext.Provider, { value: { list, updateList }, children });
|
|
134
1215
|
};
|
|
135
1216
|
|
|
136
1217
|
// src/contexts/SidebarMainContext.tsx
|
|
137
|
-
import { createContext as createContext4, useState as
|
|
138
|
-
import { jsx as
|
|
1218
|
+
import { createContext as createContext4, useState as useState8 } from "react";
|
|
1219
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
139
1220
|
var SidebarMainContext = createContext4({});
|
|
140
1221
|
var SidebarMainContextProvider = ({ children }) => {
|
|
141
|
-
const [open, setOpen] =
|
|
142
|
-
return /* @__PURE__ */
|
|
1222
|
+
const [open, setOpen] = useState8(true);
|
|
1223
|
+
return /* @__PURE__ */ jsx11(SidebarMainContext.Provider, { value: { open, setOpen }, children });
|
|
143
1224
|
};
|
|
144
1225
|
|
|
145
1226
|
// src/contexts/GlobalProvider.tsx
|
|
146
|
-
import { jsx as
|
|
1227
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
147
1228
|
function GlobalProvider({ children }) {
|
|
148
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsx12(HistoryContextProvider, { children: /* @__PURE__ */ jsx12(BreadCrumbContextProvider, { children: /* @__PURE__ */ jsx12(SidebarMainContextProvider, { children: /* @__PURE__ */ jsx12(DrawerContextProvider, { children }) }) }) });
|
|
149
1230
|
}
|
|
150
1231
|
|
|
151
1232
|
// src/layout/AppBreadcrumb.tsx
|
|
152
1233
|
import { Link as Link3, useRouter } from "@unifiedsoftware/react-router";
|
|
153
|
-
import { useContext, useEffect as
|
|
1234
|
+
import { useContext, useEffect as useEffect6 } from "react";
|
|
154
1235
|
import { MdClose } from "react-icons/md";
|
|
155
1236
|
import { VscChevronRight } from "react-icons/vsc";
|
|
156
1237
|
|
|
@@ -234,7 +1315,11 @@ var MenuTitle = styled2.p`
|
|
|
234
1315
|
import styled3 from "styled-components";
|
|
235
1316
|
var Navbar = styled3.nav`
|
|
236
1317
|
background: ${(props) => {
|
|
237
|
-
return !props
|
|
1318
|
+
return !props.$gradient ? ` linear-gradient(
|
|
1319
|
+
90.03deg,
|
|
1320
|
+
#92190e 80.71%,
|
|
1321
|
+
#f0b92c 107.21%
|
|
1322
|
+
) !important` : `#92190e`;
|
|
238
1323
|
}};
|
|
239
1324
|
z-index: 10;
|
|
240
1325
|
width: 100%;
|
|
@@ -339,7 +1424,7 @@ var ItemSidebar = styled5.div`
|
|
|
339
1424
|
}
|
|
340
1425
|
`;
|
|
341
1426
|
var SidebarNavigation = styled5.nav`
|
|
342
|
-
position: ${({ fixed = true }) => fixed ? "fixed" : "static"};
|
|
1427
|
+
position: ${({ $fixed = true }) => $fixed ? "fixed" : "static"};
|
|
343
1428
|
top: 0;
|
|
344
1429
|
left: 0;
|
|
345
1430
|
min-height: 100vh;
|
|
@@ -349,14 +1434,13 @@ var SidebarNavigation = styled5.nav`
|
|
|
349
1434
|
background: white;
|
|
350
1435
|
font-family: 'Inter', sans-serif;
|
|
351
1436
|
padding: 0;
|
|
352
|
-
width: ${({ fixed = true, active = true }) => fixed ? active ? "270px" : "0px" : "auto"};
|
|
1437
|
+
width: ${({ $fixed = true, $active = true }) => $fixed ? $active ? "270px" : "0px" : "auto"};
|
|
353
1438
|
z-index: 11;
|
|
354
1439
|
transition: width 0.2s ease-in-out;
|
|
355
|
-
|
|
356
1440
|
overflow: hidden;
|
|
357
1441
|
height: 100vh;
|
|
358
1442
|
overflow-y: auto;
|
|
359
|
-
box-shadow: ${({ shadow = true }) => shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
|
|
1443
|
+
box-shadow: ${({ $shadow = true }) => $shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
|
|
360
1444
|
|
|
361
1445
|
&::-webkit-scrollbar {
|
|
362
1446
|
display: none !important;
|
|
@@ -511,7 +1595,7 @@ var ConfigurationOption = styled5.nav`
|
|
|
511
1595
|
|
|
512
1596
|
font-family: 'Inter', sans-serif;
|
|
513
1597
|
padding: 0;
|
|
514
|
-
width: ${(props) => props
|
|
1598
|
+
width: ${(props) => props.$active ? "300px" : "0px"};
|
|
515
1599
|
z-index: 11;
|
|
516
1600
|
transition: width 0.2s ease-in-out;
|
|
517
1601
|
overflow: hidden !important;
|
|
@@ -546,7 +1630,7 @@ var Main = styled6.main`
|
|
|
546
1630
|
padding: 10px 60px;
|
|
547
1631
|
position: relative;
|
|
548
1632
|
padding-left: ${(props) => {
|
|
549
|
-
return props
|
|
1633
|
+
return props.$activeDrawer ? `300px` : `30px`;
|
|
550
1634
|
}};
|
|
551
1635
|
@media (max-width: 470px) {
|
|
552
1636
|
padding: 10px 10px;
|
|
@@ -574,46 +1658,46 @@ var CloseIcon = styled6.button`
|
|
|
574
1658
|
`;
|
|
575
1659
|
|
|
576
1660
|
// src/layout/AppBreadcrumb.tsx
|
|
577
|
-
import { jsx as
|
|
1661
|
+
import { jsx as jsx13, jsxs } from "react/jsx-runtime";
|
|
578
1662
|
var AppBreadCrumb = ({ title, paths }) => {
|
|
579
1663
|
const { setRoutes } = useContext(BreadCrumbContext);
|
|
580
|
-
|
|
1664
|
+
useEffect6(() => {
|
|
581
1665
|
if (!(paths == null ? void 0 : paths.length))
|
|
582
1666
|
return;
|
|
583
1667
|
setRoutes(paths != null ? paths : []);
|
|
584
1668
|
}, []);
|
|
585
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ jsx13(BreadCrumbTitle, { children: title != null ? title : "Home" });
|
|
586
1670
|
};
|
|
587
1671
|
var AppBreadCrumbNav = ({ paths }) => {
|
|
588
1672
|
const router = useRouter();
|
|
589
1673
|
const { active, path, routes, setRoutes } = useContext(BreadCrumbContext);
|
|
590
1674
|
const { updateList } = useContext(HistoryContext);
|
|
591
|
-
|
|
1675
|
+
useEffect6(() => {
|
|
592
1676
|
updateList({ name: active, path });
|
|
593
1677
|
}, [path, active]);
|
|
594
|
-
|
|
1678
|
+
useEffect6(() => {
|
|
595
1679
|
setRoutes(paths != null ? paths : []);
|
|
596
1680
|
}, [paths]);
|
|
597
1681
|
return /* @__PURE__ */ jsxs(Breadcrumb, { children: [
|
|
598
1682
|
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center", children: [
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
routes.length > 0 && /* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ jsx13(Link3, { href: "/", className: "link", children: "HOME" }),
|
|
1684
|
+
routes.length > 0 && /* @__PURE__ */ jsx13(VscChevronRight, { color: "black" }),
|
|
601
1685
|
routes.length > 0 ? routes.map((i, idx, arr) => {
|
|
602
1686
|
if (i.route === -1) {
|
|
603
1687
|
return /* @__PURE__ */ jsxs("span", { className: "link", onClick: () => router.back(), children: [
|
|
604
1688
|
i.title,
|
|
605
1689
|
" ",
|
|
606
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */
|
|
1690
|
+
idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx13(VscChevronRight, { color: "black" })
|
|
607
1691
|
] }, idx);
|
|
608
1692
|
}
|
|
609
1693
|
return /* @__PURE__ */ jsxs(Link3, { href: i.route, className: "link", children: [
|
|
610
1694
|
i.title,
|
|
611
1695
|
" ",
|
|
612
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */
|
|
1696
|
+
idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx13(VscChevronRight, { color: "black" })
|
|
613
1697
|
] }, idx);
|
|
614
1698
|
}) : ""
|
|
615
1699
|
] }),
|
|
616
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ jsx13(
|
|
617
1701
|
CloseIcon,
|
|
618
1702
|
{
|
|
619
1703
|
onClick: () => {
|
|
@@ -624,21 +1708,21 @@ var AppBreadCrumbNav = ({ paths }) => {
|
|
|
624
1708
|
}
|
|
625
1709
|
router.push(`${routes && routes[(routes == null ? void 0 : routes.length) - 2].route}`);
|
|
626
1710
|
},
|
|
627
|
-
children: /* @__PURE__ */
|
|
1711
|
+
children: /* @__PURE__ */ jsx13(MdClose, { fontSize: 20 })
|
|
628
1712
|
}
|
|
629
1713
|
)
|
|
630
1714
|
] });
|
|
631
1715
|
};
|
|
632
1716
|
|
|
633
1717
|
// src/layout/AppLoader.tsx
|
|
634
|
-
import { useEffect as
|
|
1718
|
+
import { useEffect as useEffect7 } from "react";
|
|
635
1719
|
import ReactDOM from "react-dom";
|
|
636
|
-
import { jsx as
|
|
1720
|
+
import { jsx as jsx14, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
637
1721
|
var LoaderGrid = () => {
|
|
638
1722
|
const Loader = /* @__PURE__ */ jsxs2("div", { className: "k-loading-mask", children: [
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx14("span", { className: "k-loading-text", children: "Loading" }),
|
|
1724
|
+
/* @__PURE__ */ jsx14("div", { className: "k-loading-image" }),
|
|
1725
|
+
/* @__PURE__ */ jsx14("div", { className: "k-loading-color" })
|
|
642
1726
|
] });
|
|
643
1727
|
const gridContent = document && document.querySelector(".k-grid-content");
|
|
644
1728
|
const reportContent = document && document.querySelector(".loading-report");
|
|
@@ -648,11 +1732,11 @@ var AppLoader = (props) => {
|
|
|
648
1732
|
const { type = "grid", parent, minDuration } = props;
|
|
649
1733
|
const parentEl = type === "grid" ? document.querySelector(parent != null ? parent : ".k-grid-container") : parent ? document.querySelector(parent) : null;
|
|
650
1734
|
const Loading = /* @__PURE__ */ jsxs2("div", { className: `${type}-loading k-loading-mask`, children: [
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsx14("span", { className: "k-loading-text", children: "Loading" }),
|
|
1736
|
+
/* @__PURE__ */ jsx14("div", { className: "k-loading-image" }),
|
|
1737
|
+
/* @__PURE__ */ jsx14("div", { className: "k-loading-color" })
|
|
654
1738
|
] });
|
|
655
|
-
|
|
1739
|
+
useEffect7(() => {
|
|
656
1740
|
if (type === "button") {
|
|
657
1741
|
const loadingEl = document.createElement("div");
|
|
658
1742
|
loadingEl.className = "icon button-loading k-loading-mask";
|
|
@@ -691,7 +1775,7 @@ var AppLoader = (props) => {
|
|
|
691
1775
|
import { Dropdown } from "react-bootstrap";
|
|
692
1776
|
import { BsArrowsFullscreen } from "react-icons/bs";
|
|
693
1777
|
import { FiCheckCircle, FiFilter, FiPlusSquare, FiRefreshCcw, FiSave } from "react-icons/fi";
|
|
694
|
-
import { jsx as
|
|
1778
|
+
import { jsx as jsx15, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
695
1779
|
var NavOptions = ({
|
|
696
1780
|
exportExcel,
|
|
697
1781
|
customButtons,
|
|
@@ -703,14 +1787,14 @@ var NavOptions = ({
|
|
|
703
1787
|
}) => {
|
|
704
1788
|
return /* @__PURE__ */ jsxs3(MenuOptions, { children: [
|
|
705
1789
|
onCreate && /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: onCreate, children: [
|
|
706
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsx15(FiPlusSquare, { className: "icon" }),
|
|
707
1791
|
" ",
|
|
708
|
-
/* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: "New" })
|
|
709
1793
|
] }),
|
|
710
1794
|
onRefresh && /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: onRefresh, children: [
|
|
711
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ jsx15(FiRefreshCcw, { className: "icon" }),
|
|
712
1796
|
" ",
|
|
713
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: "Refresh" })
|
|
714
1798
|
] }),
|
|
715
1799
|
exportExcel && exportExcel.length > 0 && /* @__PURE__ */ jsxs3(Dropdown, { className: "button-option", children: [
|
|
716
1800
|
/* @__PURE__ */ jsxs3(
|
|
@@ -720,8 +1804,8 @@ var NavOptions = ({
|
|
|
720
1804
|
className: "p-2 bg-light text-dark border-0 font-weight-bold",
|
|
721
1805
|
title: "Export to Excel",
|
|
722
1806
|
children: [
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ jsx15(FiSave, { className: "icon" }),
|
|
1808
|
+
/* @__PURE__ */ jsx15(
|
|
725
1809
|
"span",
|
|
726
1810
|
{
|
|
727
1811
|
style: {
|
|
@@ -735,45 +1819,45 @@ var NavOptions = ({
|
|
|
735
1819
|
]
|
|
736
1820
|
}
|
|
737
1821
|
),
|
|
738
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ jsx15(Dropdown.Menu, { children: exportExcel.map((item, index) => {
|
|
739
1823
|
return /* @__PURE__ */ jsxs3(Dropdown.Item, { onClick: item.onAction, children: [
|
|
740
|
-
/* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ jsx15("i", { className: `${item.classNameIcon} mr-2` }),
|
|
741
1825
|
" ",
|
|
742
1826
|
item.title
|
|
743
1827
|
] }, index);
|
|
744
1828
|
}) })
|
|
745
1829
|
] }),
|
|
746
1830
|
onSelect && /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: onSelect, children: [
|
|
747
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsx15(FiCheckCircle, { className: "icon" }),
|
|
748
1832
|
" ",
|
|
749
|
-
/* @__PURE__ */
|
|
1833
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: "Select All" })
|
|
750
1834
|
] }),
|
|
751
1835
|
onClear && /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: onClear, children: [
|
|
752
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ jsx15(FiFilter, { className: "icon" }),
|
|
753
1837
|
" ",
|
|
754
|
-
/* @__PURE__ */
|
|
1838
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: "Clear Filters" })
|
|
755
1839
|
] }),
|
|
756
1840
|
onExpandScreen && /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: onExpandScreen, children: [
|
|
757
|
-
/* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ jsx15(BsArrowsFullscreen, { className: "icon" }),
|
|
758
1842
|
" ",
|
|
759
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: "Full Page" })
|
|
760
1844
|
] }),
|
|
761
1845
|
customButtons == null ? void 0 : customButtons.map((custom, index) => {
|
|
762
1846
|
if (custom.render) {
|
|
763
1847
|
return custom.render;
|
|
764
1848
|
}
|
|
765
1849
|
return /* @__PURE__ */ jsxs3("button", { className: "button-option", onClick: custom.onAction, children: [
|
|
766
|
-
custom.Icon !== void 0 && /* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
1850
|
+
custom.Icon !== void 0 && /* @__PURE__ */ jsx15(custom.Icon, { className: "icon" }),
|
|
1851
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: custom.title })
|
|
768
1852
|
] }, index);
|
|
769
1853
|
})
|
|
770
1854
|
] });
|
|
771
1855
|
};
|
|
772
1856
|
|
|
773
1857
|
// src/layout/title.tsx
|
|
774
|
-
import { jsx as
|
|
1858
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
775
1859
|
var Title = ({ title }) => {
|
|
776
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsx16(TitlePage, { children: title != null ? title : "Home" });
|
|
777
1861
|
};
|
|
778
1862
|
export {
|
|
779
1863
|
AppBreadCrumb,
|
|
@@ -797,8 +1881,10 @@ export {
|
|
|
797
1881
|
MenuItem as MenuItems,
|
|
798
1882
|
MenuOptions,
|
|
799
1883
|
MenuTitle,
|
|
1884
|
+
MultiSelect_default as MultiSelect,
|
|
800
1885
|
NavOptions,
|
|
801
1886
|
Navbar,
|
|
1887
|
+
Select_default as Select,
|
|
802
1888
|
SidebarMainContext,
|
|
803
1889
|
SidebarMainContextProvider,
|
|
804
1890
|
SidebarNavigation,
|