dce-reactkit 3.6.9 → 3.6.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/cjs/index.js CHANGED
@@ -43304,6 +43304,30 @@ const makeLinksClickable = (text, opts) => {
43304
43304
  return elements;
43305
43305
  };
43306
43306
 
43307
+ /**
43308
+ * Merges a list of class names into a class name, intelligently handling spaces
43309
+ * @author Gabe Abrams
43310
+ * @param classNames the list of class names to merge
43311
+ * @returns the merged class name
43312
+ */
43313
+ const combineClassNames = (classNames) => {
43314
+ return (classNames
43315
+ // Trim whitespace
43316
+ .map((className) => {
43317
+ return className.trim();
43318
+ })
43319
+ // Remove empty class names
43320
+ .filter((className) => {
43321
+ return className.length > 0;
43322
+ })
43323
+ // Change multiple spaces for just one space
43324
+ .map((className) => {
43325
+ return className.replace(/\s+/g, ' ');
43326
+ })
43327
+ // Join with spaces
43328
+ .join(' '));
43329
+ };
43330
+
43307
43331
  /**
43308
43332
  * Days of the week
43309
43333
  * @author Gabe Abrams
@@ -43367,6 +43391,7 @@ exports.alert = alert;
43367
43391
  exports.avg = avg;
43368
43392
  exports.canReviewLogs = canReviewLogs;
43369
43393
  exports.ceilToNumDecimals = ceilToNumDecimals;
43394
+ exports.combineClassNames = combineClassNames;
43370
43395
  exports.compareArraysByProp = compareArraysByProp;
43371
43396
  exports.confirm = confirm;
43372
43397
  exports.extractProp = extractProp;