dce-reactkit 3.6.10 → 3.6.11
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 +33 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/MultiSwitch.d.ts +1 -0
- package/dist/esm/index.js +33 -25
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/MultiSwitch.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/components/MultiSwitch.tsx +16 -2
package/dist/cjs/index.js
CHANGED
|
@@ -41173,10 +41173,35 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41173
41173
|
messageAfterItems)));
|
|
41174
41174
|
};
|
|
41175
41175
|
|
|
41176
|
+
/**
|
|
41177
|
+
* Merges a list of class names into a class name, intelligently handling spaces
|
|
41178
|
+
* @author Gabe Abrams
|
|
41179
|
+
* @param classNames the list of class names to merge
|
|
41180
|
+
* @returns the merged class name
|
|
41181
|
+
*/
|
|
41182
|
+
const combineClassNames = (classNames) => {
|
|
41183
|
+
return (classNames
|
|
41184
|
+
// Trim whitespace
|
|
41185
|
+
.map((className) => {
|
|
41186
|
+
return className.trim();
|
|
41187
|
+
})
|
|
41188
|
+
// Remove empty class names
|
|
41189
|
+
.filter((className) => {
|
|
41190
|
+
return className.length > 0;
|
|
41191
|
+
})
|
|
41192
|
+
// Change multiple spaces for just one space
|
|
41193
|
+
.map((className) => {
|
|
41194
|
+
return className.replace(/\s+/g, ' ');
|
|
41195
|
+
})
|
|
41196
|
+
// Join with spaces
|
|
41197
|
+
.join(' '));
|
|
41198
|
+
};
|
|
41199
|
+
|
|
41176
41200
|
/**
|
|
41177
41201
|
* A switch with multiple options for selection
|
|
41178
41202
|
* @author Alessandra De Lucas
|
|
41179
41203
|
* @author Gabe Abrams
|
|
41204
|
+
* @author Austen Money
|
|
41180
41205
|
*/
|
|
41181
41206
|
/* ------------- Actions ------------ */
|
|
41182
41207
|
// Types of actions
|
|
@@ -41335,7 +41360,14 @@ const MultiSwitch = (props) => {
|
|
|
41335
41360
|
/* --------------- Main UI -------------- */
|
|
41336
41361
|
/*----------------------------------------*/
|
|
41337
41362
|
const optionElements = options.map((option) => {
|
|
41338
|
-
|
|
41363
|
+
const isSelected = (option.id === selectedOptionId);
|
|
41364
|
+
const isHovered = (option.id === hoveredOptionId);
|
|
41365
|
+
return (React__default["default"].createElement("button", { type: "button", key: option.id, className: combineClassNames([
|
|
41366
|
+
'MultiSwitch-option-button',
|
|
41367
|
+
(isHovered ? 'MultiSwitch-option-button-hovered' : ''),
|
|
41368
|
+
`MultiSwitch-option-button-with-id-${idify(option.id)}`,
|
|
41369
|
+
`MultiSwitch-option-button-is${isSelected ? '' : '-not'}-selected`,
|
|
41370
|
+
]), "aria-label": (isSelected
|
|
41339
41371
|
? `option "${option.label}", currently selected`
|
|
41340
41372
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
41341
41373
|
// Remove hover
|
|
@@ -43304,30 +43336,6 @@ const makeLinksClickable = (text, opts) => {
|
|
|
43304
43336
|
return elements;
|
|
43305
43337
|
};
|
|
43306
43338
|
|
|
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
|
-
|
|
43331
43339
|
/**
|
|
43332
43340
|
* Days of the week
|
|
43333
43341
|
* @author Gabe Abrams
|