react-core-ts 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,522 @@
1
+ body * {
2
+ box-sizing: border-box;
3
+ }
4
+ :root {
5
+ --grey-dark: #4a4a4a;
6
+ --grey-light: #d3d3d3;
7
+ --blue-navy: #001f3f;
8
+ --input-disabled: #a9a9a9;
9
+ --error-light: #f08080;
10
+ --error-extra-light: #fddede;
11
+ --success: #28a745;
12
+ --success-light: #d4edda;
13
+ --blue-light: #add8e6;
14
+ }
15
+ :root {
16
+ --blue-navy: #001f3f;
17
+ --table-hover: #your-hover-color; /* Replace with your actual color code */
18
+ }
19
+
20
+ .custom-spinner {
21
+ width: 24px !important; /* w-6 */
22
+ height: 24px; /* h-6 */
23
+ color: transparent; /* text-table-hover */
24
+ fill: var(--blue-navy); /* fill-blue-navy */
25
+ animation: spin 1s linear infinite; /* animate-spin */
26
+ width: 15px;
27
+ position: relative;
28
+ top: 1px;
29
+ }
30
+
31
+ @keyframes spin {
32
+ 0% {
33
+ transform: rotate(0deg);
34
+ }
35
+ 100% {
36
+ transform: rotate(360deg);
37
+ }
38
+ }
39
+
40
+ .textfield,
41
+ .textfield-big {
42
+ outline: none;
43
+ color: var(--grey-dark);
44
+ border-color: var(--grey-light);
45
+ background-color: white;
46
+ }
47
+
48
+ .textfield:focus,
49
+ .textfield-big:focus {
50
+ border-color: var(--blue-navy);
51
+ }
52
+
53
+ .textfield:disabled,
54
+ .textfield-big:disabled {
55
+ color: var(--input-disabled);
56
+ }
57
+
58
+ .textfield-error,
59
+ .textfield-big-error {
60
+ outline: none;
61
+ color: var(--error-light) !important;
62
+ border-color: var(--error-light) !important;
63
+ background-color: var(--error-extra-light) !important ;
64
+ }
65
+
66
+ .textfield-error::placeholder,
67
+ .textfield-big-error::placeholder {
68
+ color: var(--error-light);
69
+ }
70
+
71
+ .textfield-success {
72
+ outline: none;
73
+ color: var(--success);
74
+ border-color: var(--success);
75
+ background-color: var(--success-light);
76
+ }
77
+
78
+ .textfield-success:focus {
79
+ ring-width: 0;
80
+ }
81
+
82
+ .textfield-success::placeholder {
83
+ color: var(--success);
84
+ }
85
+
86
+ .textfield-editable {
87
+ outline: none;
88
+ color: var(--grey-dark);
89
+ border-color: var(--blue-navy);
90
+ background-color: var(--blue-light);
91
+ }
92
+
93
+ .textfield-editable::placeholder {
94
+ color: var(--grey-dark);
95
+ }
96
+
97
+ .qbs-autocomplete-suggestions {
98
+ position: absolute;
99
+ height: auto;
100
+ width: 100%;
101
+ padding: 8px; /* Corresponding to p-1.5 in Tailwind */
102
+ z-index: 99;
103
+ margin-top: 4px;
104
+ margin-bottom: 0;
105
+ border-radius: 8px;
106
+ background: #fff;
107
+ box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
108
+ }
109
+ .qbs-autocomplete-suggestions.bottom {
110
+ top: 100%; /* Position below the input */
111
+ /* Other styling */
112
+ }
113
+
114
+ .qbs-autocomplete-suggestions.top {
115
+ bottom: 100%; /* Position above the input */
116
+ /* Other styling */
117
+ }
118
+ .qbs-autocomplete-suggestions-item {
119
+ cursor: pointer;
120
+ padding: 6px 8px;
121
+ border-radius: 6px;
122
+ color: #222;
123
+ font-size: 14px;
124
+ font-weight: 500;
125
+ line-height: 20px; /* 142.857% */
126
+ width: 100%;
127
+ display: flex;
128
+ align-items: start;
129
+ gap: 8px;
130
+ }
131
+ .qbs-autocomplete-suggestions-item:hover {
132
+ background: #f8f8f8;
133
+ border-radius: 6px;
134
+ }
135
+
136
+ /* When value.id is equal to suggestion.id */
137
+ .is-selected {
138
+ border-radius: 6px;
139
+ background: var(--neutrals-grey-20, #f4f4f4);
140
+ }
141
+
142
+ /* When value.id is NOT equal to suggestion.id */
143
+ .qbs-autocomplete-suggestions-item .is-not-selected:hover {
144
+ background-color: #f1f5f9; /* Replace with actual color code for 'hover:bg-table-hover' */
145
+ }
146
+
147
+ .qbs-autocomplete-notfound {
148
+ cursor: pointer;
149
+ padding: 6px 8px;
150
+ border-radius: 6px;
151
+ font-size: 12px;
152
+ font-weight: 500;
153
+ }
154
+
155
+ .qbs-autocomplete-close-icon {
156
+ position: absolute;
157
+ top: calc(50% - 7px);
158
+ right: 2px; /* right-1 */
159
+ padding-left: 0.25rem; /* px-1 */
160
+ padding-right: 0.25rem; /* px-1 */
161
+ display: flex;
162
+ justify-content: center;
163
+ align-items: center;
164
+ background-color: white; /* bg-white */
165
+ }
166
+ .qbs-textfield-default {
167
+ width: 100%;
168
+ position: relative;
169
+ padding-right: 8px;
170
+ min-height: 36px;
171
+ height: 36px;
172
+ border-radius: 6px;
173
+ padding-left: 8px;
174
+ border: 1px solid #d6d8dc;
175
+ background: #fff;
176
+ box-sizing: border-box;
177
+ font-size: 14px;
178
+ font-style: normal;
179
+ font-weight: 500;
180
+ line-height: 20px;
181
+ color: #313131;
182
+ }
183
+
184
+ .qbs-textfield-default::placeholder {
185
+ font-size: 14px;
186
+ font-style: normal;
187
+ font-weight: 500;
188
+ line-height: 20px;
189
+ }
190
+
191
+ .qbs-autocomplete-close-icon button:focus-within {
192
+ outline: none;
193
+ }
194
+
195
+ .fullWidth {
196
+ width: 100%;
197
+ }
198
+
199
+ .autoWidth {
200
+ width: auto;
201
+ }
202
+ .icon-button {
203
+ background: transparent;
204
+ border: none;
205
+ display: inline-flex;
206
+ cursor: pointer;
207
+ padding: 0px 1px;
208
+ }
209
+ .labels {
210
+ font-size: 12px;
211
+ }
212
+ .dropdown-search-input {
213
+ min-width: -webkit-fill-available;
214
+ border-radius: 6px;
215
+ border: 1px solid var(--border-card-color-default, #d6d8dc);
216
+ background: var(--surface-input-bg-color-default, #fff);
217
+ color: #313131;
218
+ font-size: 14px;
219
+ height: 36px;
220
+ padding: 0px 8px;
221
+ font-style: normal;
222
+ font-weight: 500;
223
+ line-height: 20px;
224
+ padding-left: 32px;
225
+ }
226
+ .qbs-autocomplete-suggestions-sub {
227
+ position: relative;
228
+ overflow: auto;
229
+ max-height: 192px;
230
+ top: 0;
231
+ display: flex;
232
+ flex-direction: column;
233
+ gap: 4px;
234
+ }
235
+ .qbs-autocomplete-listitem-container {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: 0px;
239
+ }
240
+ ul {
241
+ list-style-type: none;
242
+ }
243
+
244
+ .react-core-ts-search-container {
245
+ display: flex;
246
+ align-items: center;
247
+ gap: var(--spacing-4, 4px);
248
+ align-self: stretch;
249
+ margin-bottom: 4px;
250
+ }
251
+ .selected-item {
252
+ display: flex;
253
+ align-items: center;
254
+ justify-content: space-between;
255
+ padding: 3px 6px;
256
+ margin: 0;
257
+ background-color: #e0e0e0;
258
+ color: #333;
259
+ border-radius: 6px;
260
+ border: 1px solid rgba(231, 100, 88, 0.1);
261
+ background: rgba(231, 100, 88, 0.1);
262
+ font-size: 12px;
263
+ font-style: normal;
264
+ font-weight: 500;
265
+ line-height: 16px;
266
+ color: #e76458;
267
+ gap: 6px;
268
+ height: 22px;
269
+ }
270
+
271
+ .remove-item-btn {
272
+ background-color: transparent;
273
+ border: none;
274
+ color: #e76458;
275
+ cursor: pointer;
276
+ }
277
+
278
+ .remove-item-btn:hover {
279
+ color: #e76458;
280
+ }
281
+
282
+ .selected-items-container {
283
+ display: flex;
284
+ gap: 12px;
285
+ align-items: center;
286
+ position: absolute;
287
+ left: 8px;
288
+ z-index: 99;
289
+ top: 6.5px;
290
+ flex-wrap: wrap;
291
+ }
292
+
293
+ .selected-item-more {
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: center;
297
+ padding: 3px 8px;
298
+ margin: 0;
299
+ border-radius: 6px;
300
+ background: #c63a3a;
301
+ font-size: 12px;
302
+ font-style: normal;
303
+ font-weight: 500;
304
+ line-height: 16px;
305
+ color: #fff;
306
+ height: 22px;
307
+ }
308
+
309
+ .loadMoreSection {
310
+ margin: 0;
311
+ cursor: pointer;
312
+ display: flex;
313
+ justify-content: start;
314
+ padding: 8px;
315
+ }
316
+ .loadMoreSection p {
317
+ color: #336cfc;
318
+ font-size: 14px;
319
+ font-style: normal;
320
+ font-weight: 500;
321
+ line-height: 20px;
322
+ margin: 0;
323
+ }
324
+ ::-webkit-scrollbar-track {
325
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
326
+ border-radius: 0px;
327
+ background-color: transparent;
328
+ }
329
+
330
+ ::-webkit-scrollbar {
331
+ width: 6px;
332
+ height: 4px;
333
+ background-color: transparent;
334
+ }
335
+
336
+ ::-webkit-scrollbar-thumb {
337
+ border-radius: 100px;
338
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
339
+ background-color: #ddd;
340
+ }
341
+
342
+ .qbs-autocomplete-suggestions-item.is-selected {
343
+ color: #e76458;
344
+ background: #f8f8f8;
345
+ }
346
+
347
+ span.dropdown-search-icon {
348
+ position: absolute;
349
+ left: 8px;
350
+ top: 10px;
351
+ }
352
+
353
+ .dropdown-search-input:focus {
354
+ outline: none;
355
+ border: 1px solid #222;
356
+ }
357
+
358
+ .qbs-autocomplete-checkbox-container {
359
+ gap: 8px;
360
+ padding: 6px 8px;
361
+ align-items: start;
362
+ }
363
+
364
+ .qbs-autocomplete-checkbox-container .qbs-autocomplete-suggestions-item {
365
+ padding: 0;
366
+ pointer-events: none;
367
+ }
368
+
369
+ .qbs-autocomplete-checkbox-container:hover {
370
+ background: #f8f8f8;
371
+ border-radius: 6px;
372
+ }
373
+
374
+ .qbs-autocomplete-checkbox-container.is-selected {
375
+ background: #f8f8f8;
376
+ border-radius: 6px;
377
+ }
378
+
379
+ .qbs-autocomplete-checkbox {
380
+ position: relative;
381
+ display: flex;
382
+ align-items: center;
383
+ justify-content: center;
384
+ }
385
+
386
+ .qbs-autocomplete-checkbox input {
387
+ opacity: 0;
388
+ }
389
+
390
+ .qbs-autocomplete-checkbox input ~ label {
391
+ position: absolute;
392
+ border-radius: 3px;
393
+ border: 1px solid #999696;
394
+ width: 16px;
395
+ height: 16px;
396
+ top: 3px;
397
+ transition: all 0.2s ease;
398
+ cursor: pointer;
399
+ }
400
+
401
+ .qbs-autocomplete-checkbox input ~ label svg {
402
+ opacity: 0;
403
+ transition: all 0.2s ease;
404
+ position: absolute;
405
+ left: 3px;
406
+ top: 3px;
407
+ width: 9px;
408
+ height: 9px;
409
+ }
410
+
411
+ .qbs-autocomplete-checkbox input:checked ~ label {
412
+ transition: all 0.2s ease;
413
+ border-radius: 3px;
414
+ background: #e76458;
415
+ border-color: #e76458;
416
+ }
417
+ .qbs-autocomplete-checkbox input:checked ~ label svg {
418
+ opacity: 1;
419
+ transition: all 0.2s ease;
420
+ }
421
+
422
+ .action_label {
423
+ font-size: 14px;
424
+ color: #4c7ad6;
425
+ }
426
+ /* Tooltip.css */
427
+ /* .tooltip-wrapper {
428
+ position: relative;
429
+ display: inline-block;
430
+ }
431
+
432
+ .tooltip-content {
433
+ visibility: hidden;
434
+ width: max-content;
435
+ background-color: black;
436
+ color: white;
437
+ text-align: center;
438
+ max-width: 150px;
439
+ padding: 5px 10px;
440
+ border-radius: 6px;
441
+ position: absolute;
442
+ z-index: 1;
443
+ bottom: 125%;
444
+ left: 50%;
445
+ transform: translateX(-50%);
446
+ transition: visibility 0.2s ease-in-out;
447
+ }
448
+
449
+ .tooltip-content::after {
450
+ content: '';
451
+ position: absolute;
452
+ top: 100%;
453
+ left: 50%;
454
+ margin-left: -5px;
455
+ border-width: 5px;
456
+ border-style: solid;
457
+ border-color: black transparent transparent transparent;
458
+ }
459
+
460
+ .tooltip-wrapper:hover .tooltip-content {
461
+ visibility: visible;
462
+ } */
463
+ .qbs-table-tooltip {
464
+ position: relative;
465
+ display: contents;
466
+ cursor: pointer;
467
+ }
468
+
469
+ .qbs-table-tooltip .tooltiptext {
470
+ visibility: hidden;
471
+ background-color: #000;
472
+ color: #fff;
473
+ text-align: center;
474
+ padding: 6px;
475
+ border-radius: 4px;
476
+ position: absolute;
477
+ z-index: 9999;
478
+ opacity: 0;
479
+ transition: opacity 0.3s;
480
+ font-size: 14px;
481
+ font-style: normal;
482
+ font-weight: 400;
483
+ line-height: 16px;
484
+ max-width: 300px;
485
+ }
486
+
487
+ .qbs-table-tooltip.up .tooltiptext {
488
+ bottom: 125%;
489
+ left: 0%;
490
+ }
491
+
492
+ .qbs-table-tooltip.down .tooltiptext {
493
+ top: 125%;
494
+ right: 0px;
495
+ left: auto;
496
+ }
497
+
498
+ .qbs-table-tooltip:hover .tooltiptext {
499
+ visibility: visible;
500
+ opacity: 1;
501
+ }
502
+
503
+ .qbs-table-tooltip .tooltiptext::after {
504
+ content: '';
505
+ position: absolute;
506
+ border-width: 5px;
507
+ border-style: solid;
508
+ }
509
+
510
+ .qbs-table-tooltip.up .tooltiptext::after {
511
+ top: 100%;
512
+ left: 50%;
513
+ margin-left: -5px;
514
+ border-color: #000 transparent transparent transparent;
515
+ }
516
+
517
+ .qbs-table-tooltip.down .tooltiptext::after {
518
+ bottom: 100%;
519
+ left: 50%;
520
+ margin-left: -5px;
521
+ border-color: transparent transparent #000 transparent;
522
+ }
@@ -0,0 +1 @@
1
+ @import './components/autocomplete.css';
@@ -0,0 +1,10 @@
1
+ type ValueProps = {
2
+ [key: string]: string;
3
+ };
4
+ type UseSuggestionsType = (getData: (key?: string, next?: number) => Promise<ValueProps[]>, initialData?: ValueProps[], dropOpen?: boolean, asyncFetch?: boolean, paginationEnabled?: boolean, initialLoad?: boolean, inputValue?: string, isMultiple?: boolean, setNextPage?: (value: number) => void, selectedItems?: any[]) => {
5
+ suggestions: ValueProps[];
6
+ isLoading: boolean;
7
+ handlePickSuggestions: (value?: string, next?: number, append?: boolean) => Promise<void>;
8
+ };
9
+ export declare const useSuggestions: UseSuggestionsType;
10
+ export {};
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ 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) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.useSuggestions = void 0;
49
+ var react_1 = require("react");
50
+ var useSuggestions = function (getData, initialData, dropOpen, asyncFetch, paginationEnabled, initialLoad, inputValue, isMultiple, setNextPage, selectedItems) {
51
+ if (initialData === void 0) { initialData = []; }
52
+ if (dropOpen === void 0) { dropOpen = false; }
53
+ if (asyncFetch === void 0) { asyncFetch = false; }
54
+ if (paginationEnabled === void 0) { paginationEnabled = false; }
55
+ if (initialLoad === void 0) { initialLoad = false; }
56
+ if (inputValue === void 0) { inputValue = ''; }
57
+ if (selectedItems === void 0) { selectedItems = []; }
58
+ var _a = (0, react_1.useState)(initialData), suggestions = _a[0], setSuggestions = _a[1];
59
+ var _b = (0, react_1.useState)(false), isLoading = _b[0], setIsLoading = _b[1];
60
+ var handlePickSuggestions = function (value, nextPage, appendData) { return __awaiter(void 0, void 0, void 0, function () {
61
+ var data, newSuggestions, error_1;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0:
65
+ setIsLoading(true);
66
+ _a.label = 1;
67
+ case 1:
68
+ _a.trys.push([1, 3, 4, 5]);
69
+ return [4 /*yield*/, (asyncFetch || initialLoad
70
+ ? getData(value, nextPage)
71
+ : Promise.resolve(initialData))];
72
+ case 2:
73
+ data = _a.sent();
74
+ if (!data || (data === null || data === void 0 ? void 0 : data.length) === 0) {
75
+ setNextPage(undefined);
76
+ }
77
+ newSuggestions = appendData ? __spreadArray(__spreadArray([], suggestions, true), data, true) : data;
78
+ setSuggestions(newSuggestions);
79
+ return [3 /*break*/, 5];
80
+ case 3:
81
+ error_1 = _a.sent();
82
+ console.error('Error fetching data:', error_1);
83
+ return [3 /*break*/, 5];
84
+ case 4:
85
+ setIsLoading(false);
86
+ return [7 /*endfinally*/];
87
+ case 5: return [2 /*return*/];
88
+ }
89
+ });
90
+ }); };
91
+ (0, react_1.useEffect)(function () {
92
+ if (dropOpen) {
93
+ if (!isMultiple && (!inputValue || suggestions.length === 0)) {
94
+ setNextPage(1);
95
+ handlePickSuggestions('', paginationEnabled ? 1 : undefined);
96
+ }
97
+ else if (isMultiple &&
98
+ (suggestions.length === 0 ||
99
+ !selectedItems ||
100
+ (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0)) {
101
+ handlePickSuggestions('', paginationEnabled ? 1 : undefined);
102
+ }
103
+ }
104
+ }, [dropOpen]);
105
+ return { suggestions: suggestions, isLoading: isLoading, handlePickSuggestions: handlePickSuggestions };
106
+ };
107
+ exports.useSuggestions = useSuggestions;
108
+ //# sourceMappingURL=autosuggestions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autosuggestions.js","sourceRoot":"","sources":["../../src/utilities/autosuggestions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4C;AA4BrC,IAAM,cAAc,GAAuB,UAChD,OAAO,EACP,WAAgB,EAChB,QAAgB,EAChB,UAAkB,EAClB,iBAAyB,EACzB,WAAmB,EACnB,UAAe,EACf,UAAU,EACV,WAAW,EACX,aAAkB;IARlB,4BAAA,EAAA,gBAAgB;IAChB,yBAAA,EAAA,gBAAgB;IAChB,2BAAA,EAAA,kBAAkB;IAClB,kCAAA,EAAA,yBAAyB;IACzB,4BAAA,EAAA,mBAAmB;IACnB,2BAAA,EAAA,eAAe;IAGf,8BAAA,EAAA,kBAAkB;IAEZ,IAAA,KAAgC,IAAA,gBAAQ,EAAe,WAAW,CAAC,EAAlE,WAAW,QAAA,EAAE,cAAc,QAAuC,CAAC;IACpE,IAAA,KAA4B,IAAA,gBAAQ,EAAU,KAAK,CAAC,EAAnD,SAAS,QAAA,EAAE,YAAY,QAA4B,CAAC;IAE3D,IAAM,qBAAqB,GAAG,UAC5B,KAAc,EACd,QAAiB,EACjB,UAAoB;;;;;oBAEpB,YAAY,CAAC,IAAI,CAAC,CAAC;;;;oBAEJ,qBAAM,CAAC,UAAU,IAAI,WAAW;4BAC3C,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;4BAC1B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,EAAA;;oBAF3B,IAAI,GAAG,SAEoB;oBACjC,IAAI,CAAC,IAAI,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,MAAK,CAAC,EAAE;wBAC/B,WAAW,CAAC,SAAS,CAAC,CAAC;qBACxB;oBACK,cAAc,GAAG,UAAU,CAAC,CAAC,iCAAK,WAAW,SAAK,IAAI,QAAE,CAAC,CAAC,IAAI,CAAC;oBACrE,cAAc,CAAC,cAAc,CAAC,CAAC;;;;oBAE/B,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,OAAK,CAAC,CAAC;;;oBAE7C,YAAY,CAAC,KAAK,CAAC,CAAC;;;;;SAEvB,CAAC;IAEF,IAAA,iBAAS,EAAC;QACR,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;gBAC5D,WAAW,CAAC,CAAC,CAAC,CAAC;gBACf,qBAAqB,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aAC9D;iBAAM,IACL,UAAU;gBACV,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;oBACvB,CAAC,aAAa;oBACd,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,MAAK,CAAC,CAAC,EAC9B;gBACA,qBAAqB,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aAC9D;SACF;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,EAAE,WAAW,aAAA,EAAE,SAAS,WAAA,EAAE,qBAAqB,uBAAA,EAAE,CAAC;AAC3D,CAAC,CAAC;AAtDW,QAAA,cAAc,kBAsDzB"}
@@ -0,0 +1 @@
1
+ export declare function debounce<F extends (...args: any[]) => any>(fn: F, delay: number): (...args: Parameters<F>) => void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debounce = void 0;
4
+ function debounce(fn, delay) {
5
+ var timerId = null;
6
+ return function () {
7
+ var args = [];
8
+ for (var _i = 0; _i < arguments.length; _i++) {
9
+ args[_i] = arguments[_i];
10
+ }
11
+ if (timerId) {
12
+ clearTimeout(timerId);
13
+ }
14
+ timerId = setTimeout(function () {
15
+ fn.apply(void 0, args);
16
+ timerId = null;
17
+ }, delay);
18
+ };
19
+ }
20
+ exports.debounce = debounce;
21
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/utilities/debounce.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CACtB,EAAK,EACL,KAAa;IAEb,IAAI,OAAO,GAA0B,IAAI,CAAC;IAC1C,OAAO;QAAC,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAC5B,IAAI,OAAO,EAAE;YACX,YAAY,CAAC,OAAO,CAAC,CAAC;SACvB;QACD,OAAO,GAAG,UAAU,CAAC;YACnB,EAAE,eAAI,IAAI,EAAE;YACZ,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC"}
@@ -0,0 +1 @@
1
+ export declare function deepEqual(value1: any, value2: any): boolean;