dce-reactkit 3.7.2-beta.1 → 3.7.4
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/cjs/index.js +161 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Modal.d.ts +1 -0
- package/dist/cjs/types/components/Shimmer.d.ts +13 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.d.ts +13 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +1 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.d.ts +13 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +1 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +10 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +1 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.d.ts +11 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +1 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.d.ts +13 -0
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +7 -1
- package/dist/esm/index.js +157 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Modal.d.ts +1 -0
- package/dist/esm/types/components/Shimmer.d.ts +13 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.d.ts +13 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +1 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.d.ts +13 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +1 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +10 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +1 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.d.ts +11 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +1 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.d.ts +13 -0
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +1 -0
- package/dist/esm/types/index.d.ts +7 -1
- package/dist/index.d.ts +62 -1
- package/package.json +1 -1
- package/src/components/Modal.tsx +4 -1
- package/src/components/Shimmer.tsx +153 -0
- package/src/helpers/asyncArrayFunctions/everyAsync.test.ts +114 -0
- package/src/helpers/asyncArrayFunctions/everyAsync.ts +51 -0
- package/src/helpers/asyncArrayFunctions/filterAsync.test.ts +126 -0
- package/src/helpers/asyncArrayFunctions/filterAsync.ts +50 -0
- package/src/helpers/asyncArrayFunctions/forEachAsync.test.ts +136 -0
- package/src/helpers/asyncArrayFunctions/forEachAsync.ts +40 -0
- package/src/helpers/asyncArrayFunctions/mapAsync.test.ts +125 -0
- package/src/helpers/asyncArrayFunctions/mapAsync.ts +46 -0
- package/src/helpers/asyncArrayFunctions/someAsync.test.ts +92 -0
- package/src/helpers/asyncArrayFunctions/someAsync.ts +49 -0
- package/src/helpers/canReviewLogs.ts +1 -1
- package/src/helpers/getTimeInfoInET.ts +3 -3
- package/src/index.ts +12 -0
package/dist/cjs/index.js
CHANGED
|
@@ -484,7 +484,7 @@ const Modal = (props) => {
|
|
|
484
484
|
/*------------------------------------------------------------------------*/
|
|
485
485
|
var _a;
|
|
486
486
|
/* -------------- Props ------------- */
|
|
487
|
-
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
|
|
487
|
+
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, } = props;
|
|
488
488
|
/* -------------- State ------------- */
|
|
489
489
|
// True if animation is in use
|
|
490
490
|
const [animatingIn, setAnimatingIn] = React.useState(true);
|
|
@@ -621,7 +621,7 @@ const Modal = (props) => {
|
|
|
621
621
|
React__default["default"].createElement("h5", { className: "modal-title", style: {
|
|
622
622
|
fontWeight: 'bold',
|
|
623
623
|
} }, title),
|
|
624
|
-
onClose && (React__default["default"].createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
|
|
624
|
+
(onClose && !dontShowXButton) && (React__default["default"].createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
|
|
625
625
|
backgroundColor: (isDarkModeOn()
|
|
626
626
|
? 'white'
|
|
627
627
|
: undefined),
|
|
@@ -1611,8 +1611,7 @@ const getTimeInfoInET = (dateOrTimestamp) => {
|
|
|
1611
1611
|
d = dateOrTimestamp;
|
|
1612
1612
|
}
|
|
1613
1613
|
const str = d.toLocaleString('en-US', // Using US encoding (it's the only one installed on containers)
|
|
1614
|
-
{ timeZone: 'America/New_York' }
|
|
1615
|
-
);
|
|
1614
|
+
{ timeZone: 'America/New_York' });
|
|
1616
1615
|
// Parse the string for the date/time info
|
|
1617
1616
|
const [dateStr, timeStr] = str.split(', '); // Format: MM/DD/YYYY, HH:MM:SS AM
|
|
1618
1617
|
const [monthStr, dayStr, yearStr] = dateStr.split('/'); // Format: MM/DD/YYYY
|
|
@@ -1623,7 +1622,7 @@ const getTimeInfoInET = (dateOrTimestamp) => {
|
|
|
1623
1622
|
const month = Number.parseInt(monthStr, 10);
|
|
1624
1623
|
const day = Number.parseInt(dayStr, 10);
|
|
1625
1624
|
const minute = Number.parseInt(minStr, 10);
|
|
1626
|
-
|
|
1625
|
+
const hour12 = Number.parseInt(hourStr, 10);
|
|
1627
1626
|
// Convert from am/pm to 24hr
|
|
1628
1627
|
const isAM = ending.toLowerCase().includes('am');
|
|
1629
1628
|
const isPM = !isAM;
|
|
@@ -42722,7 +42721,7 @@ const initLogCollection = (Collection) => {
|
|
|
42722
42721
|
/* -------------------------------- Cache ------------------------------- */
|
|
42723
42722
|
/*------------------------------------------------------------------------*/
|
|
42724
42723
|
// Cache user's ability
|
|
42725
|
-
let canReview
|
|
42724
|
+
let canReview;
|
|
42726
42725
|
/*------------------------------------------------------------------------*/
|
|
42727
42726
|
/* -------------------------------- Main -------------------------------- */
|
|
42728
42727
|
/*------------------------------------------------------------------------*/
|
|
@@ -43275,6 +43274,157 @@ const useForceRender = (useReducer) => {
|
|
|
43275
43274
|
};
|
|
43276
43275
|
};
|
|
43277
43276
|
|
|
43277
|
+
/**
|
|
43278
|
+
* Run the operator function on each item in the array, returning true if
|
|
43279
|
+
* the operator function returns true for every item in the array
|
|
43280
|
+
* @author Gabe Abrams
|
|
43281
|
+
* @param operatorFunction the operator function to apply. If it returns true
|
|
43282
|
+
* for every item, this function will return true
|
|
43283
|
+
* @returns true if the operator function returns true for every item in the array
|
|
43284
|
+
*/
|
|
43285
|
+
const everyAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43286
|
+
// Create break logic
|
|
43287
|
+
let done = false;
|
|
43288
|
+
/**
|
|
43289
|
+
* Break the loop (checking stops here)
|
|
43290
|
+
* @author Gabe Abrams
|
|
43291
|
+
*/
|
|
43292
|
+
const breakNow = () => {
|
|
43293
|
+
done = true;
|
|
43294
|
+
};
|
|
43295
|
+
// Loop through each item, checking
|
|
43296
|
+
for (let i = 0; i < array.length && !done; i++) {
|
|
43297
|
+
const passed = yield operatorFunction(array[i], i, {
|
|
43298
|
+
breakNow,
|
|
43299
|
+
array,
|
|
43300
|
+
});
|
|
43301
|
+
// Check if this one failed or if loop was broken
|
|
43302
|
+
if (!passed || done) {
|
|
43303
|
+
return false;
|
|
43304
|
+
}
|
|
43305
|
+
}
|
|
43306
|
+
// Return true because none returned false
|
|
43307
|
+
return true;
|
|
43308
|
+
});
|
|
43309
|
+
|
|
43310
|
+
/**
|
|
43311
|
+
* Run the operator function on each item in the array, returning a new array
|
|
43312
|
+
* that only contains the items that pass the filter
|
|
43313
|
+
* @author Gabe Abrams
|
|
43314
|
+
* @param operatorFunction the operator function to apply. If it returns true
|
|
43315
|
+
* for an item, the item will be included in the returned array
|
|
43316
|
+
* @returns the filtered array
|
|
43317
|
+
*/
|
|
43318
|
+
const filterAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43319
|
+
// Create break logic
|
|
43320
|
+
let done = false;
|
|
43321
|
+
/**
|
|
43322
|
+
* Break the loop (filtering stops here)
|
|
43323
|
+
* @author Gabe Abrams
|
|
43324
|
+
*/
|
|
43325
|
+
const breakNow = () => {
|
|
43326
|
+
done = true;
|
|
43327
|
+
};
|
|
43328
|
+
// Loop through each item, filtering
|
|
43329
|
+
const output = [];
|
|
43330
|
+
for (let i = 0; i < array.length && !done; i++) {
|
|
43331
|
+
const included = yield operatorFunction(array[i], i, {
|
|
43332
|
+
breakNow,
|
|
43333
|
+
array,
|
|
43334
|
+
});
|
|
43335
|
+
if (included && !done) {
|
|
43336
|
+
output.push(array[i]);
|
|
43337
|
+
}
|
|
43338
|
+
}
|
|
43339
|
+
// Return results
|
|
43340
|
+
return output;
|
|
43341
|
+
});
|
|
43342
|
+
|
|
43343
|
+
/**
|
|
43344
|
+
* Run the operator function on each item in the array
|
|
43345
|
+
* @author Gabe Abrams
|
|
43346
|
+
* @param operatorFunction the operator function to apply
|
|
43347
|
+
*/
|
|
43348
|
+
const forEachAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43349
|
+
// Create break logic
|
|
43350
|
+
let done = false;
|
|
43351
|
+
/**
|
|
43352
|
+
* Break the loop
|
|
43353
|
+
* @author Gabe Abrams
|
|
43354
|
+
*/
|
|
43355
|
+
const breakNow = () => {
|
|
43356
|
+
done = true;
|
|
43357
|
+
};
|
|
43358
|
+
// Loop through each item
|
|
43359
|
+
for (let i = 0; i < array.length && !done; i++) {
|
|
43360
|
+
yield operatorFunction(array[i], i, {
|
|
43361
|
+
breakNow,
|
|
43362
|
+
array,
|
|
43363
|
+
});
|
|
43364
|
+
}
|
|
43365
|
+
});
|
|
43366
|
+
|
|
43367
|
+
/**
|
|
43368
|
+
* Run the operator function on each item in the array, collecting all results
|
|
43369
|
+
* @author Gabe Abrams
|
|
43370
|
+
* @param operatorFunction the operator function to apply
|
|
43371
|
+
* @returns the array of results
|
|
43372
|
+
*/
|
|
43373
|
+
const mapAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43374
|
+
// Create break logic
|
|
43375
|
+
let done = false;
|
|
43376
|
+
/**
|
|
43377
|
+
* Break the loop
|
|
43378
|
+
* @author Gabe Abrams
|
|
43379
|
+
*/
|
|
43380
|
+
const breakNow = () => {
|
|
43381
|
+
done = true;
|
|
43382
|
+
};
|
|
43383
|
+
// Loop through each item, collecting results
|
|
43384
|
+
const results = [];
|
|
43385
|
+
for (let i = 0; i < array.length && !done; i++) {
|
|
43386
|
+
const result = yield operatorFunction(array[i], i, {
|
|
43387
|
+
breakNow,
|
|
43388
|
+
array,
|
|
43389
|
+
});
|
|
43390
|
+
results.push(result);
|
|
43391
|
+
}
|
|
43392
|
+
// Return results
|
|
43393
|
+
return results;
|
|
43394
|
+
});
|
|
43395
|
+
|
|
43396
|
+
/**
|
|
43397
|
+
* Run the operator function on each item in the array, returning true if
|
|
43398
|
+
* the operator function returns true for any item in the array
|
|
43399
|
+
* @author Gabe Abrams
|
|
43400
|
+
* @param operatorFunction the operator function to apply. If it returns true
|
|
43401
|
+
* for any item, this function will return true
|
|
43402
|
+
* @returns true if the operator function returns true for any item in the array
|
|
43403
|
+
*/
|
|
43404
|
+
const someAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43405
|
+
// Create break logic
|
|
43406
|
+
let done = false;
|
|
43407
|
+
/**
|
|
43408
|
+
* Break the loop (checking stops here)
|
|
43409
|
+
* @author Gabe Abrams
|
|
43410
|
+
*/
|
|
43411
|
+
const breakNow = () => {
|
|
43412
|
+
done = true;
|
|
43413
|
+
};
|
|
43414
|
+
// Loop through each item, checking
|
|
43415
|
+
for (let i = 0; i < array.length && !done; i++) {
|
|
43416
|
+
const passed = yield operatorFunction(array[i], i, {
|
|
43417
|
+
breakNow,
|
|
43418
|
+
array,
|
|
43419
|
+
});
|
|
43420
|
+
if (passed && !done) {
|
|
43421
|
+
return true;
|
|
43422
|
+
}
|
|
43423
|
+
}
|
|
43424
|
+
// Return false because none returned true
|
|
43425
|
+
return false;
|
|
43426
|
+
});
|
|
43427
|
+
|
|
43278
43428
|
/**
|
|
43279
43429
|
* Days of the week
|
|
43280
43430
|
* @author Gabe Abrams
|
|
@@ -43341,8 +43491,11 @@ exports.ceilToNumDecimals = ceilToNumDecimals;
|
|
|
43341
43491
|
exports.combineClassNames = combineClassNames;
|
|
43342
43492
|
exports.compareArraysByProp = compareArraysByProp;
|
|
43343
43493
|
exports.confirm = confirm;
|
|
43494
|
+
exports.everyAsync = everyAsync;
|
|
43344
43495
|
exports.extractProp = extractProp;
|
|
43496
|
+
exports.filterAsync = filterAsync;
|
|
43345
43497
|
exports.floorToNumDecimals = floorToNumDecimals;
|
|
43498
|
+
exports.forEachAsync = forEachAsync;
|
|
43346
43499
|
exports.forceNumIntoBounds = forceNumIntoBounds;
|
|
43347
43500
|
exports.genCSV = genCSV;
|
|
43348
43501
|
exports.genCommaList = genCommaList;
|
|
@@ -43363,6 +43516,7 @@ exports.isMobileOrTablet = isMobileOrTablet;
|
|
|
43363
43516
|
exports.leaveToURL = leaveToURL;
|
|
43364
43517
|
exports.logClientEvent = logClientEvent;
|
|
43365
43518
|
exports.makeLinksClickable = makeLinksClickable;
|
|
43519
|
+
exports.mapAsync = mapAsync;
|
|
43366
43520
|
exports.onlyKeepLetters = onlyKeepLetters;
|
|
43367
43521
|
exports.padDecimalZeros = padDecimalZeros;
|
|
43368
43522
|
exports.padZerosLeft = padZerosLeft;
|
|
@@ -43371,6 +43525,7 @@ exports.prefixWithAOrAn = prefixWithAOrAn;
|
|
|
43371
43525
|
exports.roundToNumDecimals = roundToNumDecimals;
|
|
43372
43526
|
exports.setClientEventMetadataPopulator = setClientEventMetadataPopulator;
|
|
43373
43527
|
exports.showFatalError = showFatalError;
|
|
43528
|
+
exports.someAsync = someAsync;
|
|
43374
43529
|
exports.startMinWait = startMinWait;
|
|
43375
43530
|
exports.stringsToHumanReadableList = stringsToHumanReadableList;
|
|
43376
43531
|
exports.stubServerEndpoint = stubServerEndpoint;
|