@sprinklrjs/spaceweb 14.13.0 → 14.13.2

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.
@@ -30,7 +30,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
30
30
  } | undefined;
31
31
  selected?: boolean | undefined;
32
32
  startEnhancer?: import("../list/types").Enhancer<ListItemSharedProps>;
33
- tooltipContent?: React.ReactNode | import("../baseui/popover").StatefulContentRenderProp;
33
+ tooltipContent?: React.ReactNode | import("../baseui/popover").ContentRenderProp;
34
34
  } & Record<string, any>> | undefined;
35
35
  Popover?: import("../overrides").Override<Omit<import("../baseui/popover").PopoverProps, "children" | "overrides" | "placement" | "triggerType"> & {
36
36
  overrides?: ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprinklrjs/spaceweb",
3
- "version": "14.13.0",
3
+ "version": "14.13.2",
4
4
  "description": "Components for SpaceWeb",
5
5
  "main": "index.js",
6
6
  "module": "./esm/index.js",
@@ -100,7 +100,7 @@
100
100
  "ts-node": "^10.4.0"
101
101
  },
102
102
  "peerDependencies": {
103
- "@sprinklrjs/spaceweb-themes": "14.13.0",
103
+ "@sprinklrjs/spaceweb-themes": "14.13.2",
104
104
  "react": ">=17.0.2 <19.0.0",
105
105
  "react-dom": ">=17.0.2 <19.0.0"
106
106
  }
@@ -5,6 +5,7 @@ export type SelectLocale = {
5
5
  selectPlaceholder: string;
6
6
  clearOptionLabel: string;
7
7
  selectedValuesPrefix: string;
8
+ selectedMultiValuesPrefix: string;
8
9
  item: string;
9
10
  items: string;
10
11
  collapsibleMenuDescription: string;
@@ -67,7 +67,7 @@ export declare const CollapsibleSelectMenu: ({ overrides, value, items: groupedI
67
67
  } | undefined;
68
68
  selected?: boolean | undefined;
69
69
  startEnhancer?: import("../../list/types").Enhancer<import("../../list").ListItemSharedProps>;
70
- tooltipContent?: ReactNode | import("../../baseui/popover").StatefulContentRenderProp;
70
+ tooltipContent?: ReactNode | import("../../baseui/popover").ContentRenderProp;
71
71
  } & Record<string, any>> | undefined;
72
72
  Popover?: import("../../overrides").Override<Omit<import("../../baseui/popover").PopoverProps, "children" | "overrides" | "placement" | "triggerType"> & {
73
73
  overrides?: ({
@@ -38,7 +38,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
38
38
  } | undefined;
39
39
  selected?: boolean | undefined;
40
40
  startEnhancer?: import("../../list/types").Enhancer<import("../../list").ListItemSharedProps>;
41
- tooltipContent?: React.ReactNode | import("../../baseui/popover").StatefulContentRenderProp;
41
+ tooltipContent?: React.ReactNode | import("../../baseui/popover").ContentRenderProp;
42
42
  } & Record<string, any>> | undefined;
43
43
  Popover?: Override<Omit<import("../../baseui/popover").PopoverProps, "children" | "overrides" | "placement" | "triggerType"> & {
44
44
  overrides?: ({
@@ -45,7 +45,7 @@ exports.StyledInput = (0, style_1.styled)('input', 'bg-transparent border-none i
45
45
  });
46
46
  var StyledOverlayContentContainer = (0, style_1.styled)('div', 'overflow-auto rounded-inherit w-[--sw-width]');
47
47
  exports.StyledOverlayContentContainer = StyledOverlayContentContainer;
48
- var getCommaSeparatedValues = function (value, limitTags, labelKey, locale) {
48
+ var getCommaSeparatedValues = function (value, limitTags, labelKey, locale, multi) {
49
49
  if (limitTags === void 0) { limitTags = Number(Infinity); }
50
50
  var _limitTags = limitTags < 0 ? Number(Infinity) : limitTags;
51
51
  var commaSeparatedValues = value === null || value === void 0 ? void 0 : value.slice(0, _limitTags).map(function (val) { return val[labelKey]; });
@@ -54,16 +54,26 @@ var getCommaSeparatedValues = function (value, limitTags, labelKey, locale) {
54
54
  commaSeparatedValues.push("".concat("+".concat(extraTagNumber, " ").concat(extraTagNumber === 1 ? locale.select.item : locale.select.items)));
55
55
  }
56
56
  var _commaSeparatedValues = commaSeparatedValues === null || commaSeparatedValues === void 0 ? void 0 : commaSeparatedValues.join(',');
57
- return value && value.length > 0
58
- ? "".concat((0, i18n_interpolation_1.default)(locale.select.selectedValuesPrefix, { values: _commaSeparatedValues }), ".")
59
- : '';
57
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
58
+ return '';
59
+ }
60
+ if (multi) {
61
+ var count = value.length;
62
+ var countLabel = count === 1 ? locale.select.item : locale.select.items;
63
+ return "".concat((0, i18n_interpolation_1.default)(locale.select.selectedMultiValuesPrefix, {
64
+ count: String(count),
65
+ countLabel: countLabel,
66
+ values: _commaSeparatedValues,
67
+ }), ".");
68
+ }
69
+ return "".concat((0, i18n_interpolation_1.default)(locale.select.selectedValuesPrefix, { values: _commaSeparatedValues }), ".");
60
70
  };
61
71
  var InputContainer = function (_a) {
62
72
  var _b;
63
73
  var size = _a.size, $value = _a.$value, $labelKey = _a.$labelKey, placeholder = _a.placeholder, $limitTags = _a.$limitTags, props = tslib_1.__rest(_a, ["size", "$value", "$labelKey", "placeholder", "$limitTags"]);
64
74
  var locale = (0, locale_1.useLocale)();
65
75
  var listboxId = (0, SelectIdsContext_1.useSelectIds)().listboxId;
66
- var commaSeparatedValues = getCommaSeparatedValues($value, $limitTags, $labelKey, locale);
76
+ var commaSeparatedValues = getCommaSeparatedValues($value, $limitTags, $labelKey, locale, props.$multi);
67
77
  var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
68
78
  var selectedValuesId = (0, useUniqueId_1.default)();
69
79
  var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
@@ -83,7 +93,7 @@ var Input = (0, react_1.forwardRef)(function (_a, ref) {
83
93
  var placeholder = _a.placeholder, $value = _a.$value, $labelKey = _a.$labelKey, _c = _a.$limitTags, $limitTags = _c === void 0 ? Number(Infinity) : _c, props = tslib_1.__rest(_a, ["placeholder", "$value", "$labelKey", "$limitTags"]);
84
94
  var locale = (0, locale_1.useLocale)();
85
95
  var _d = (0, SelectIdsContext_1.useSelectIds)(), listboxId = _d.listboxId, inputId = _d.inputId;
86
- var commaSeparatedValues = getCommaSeparatedValues($value, $limitTags, $labelKey, locale);
96
+ var commaSeparatedValues = getCommaSeparatedValues($value, $limitTags, $labelKey, locale, props.$multi);
87
97
  var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
88
98
  var selectedValuesId = (0, useUniqueId_1.default)();
89
99
  var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;