@sprinklrjs/spaceweb 14.12.3 → 14.13.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.
- package/asyncSelect/hooks/useBaseAsyncSelect.js +2 -2
- package/classNames/index.d.ts +11 -1
- package/classNames/index.js +12 -6
- package/date-picker/DateInput.js +59 -9
- package/esm/asyncSelect/hooks/useBaseAsyncSelect.js +2 -2
- package/esm/classNames/index.d.ts +11 -1
- package/esm/classNames/index.js +11 -1
- package/esm/date-picker/DateInput.js +59 -9
- package/esm/select/overrides.d.ts +3 -5
- package/esm/select/overrides.js +4 -3
- package/esm/style/_parseStyleProp.js +2 -2
- package/esm/tabs/styled-components.d.ts +3 -3
- package/esm/tabs/styled-components.js +4 -1
- package/esm/tabs/tab.js +2 -0
- package/esm/time-range-picker/RangeSelectorContainer.js +3 -1
- package/esm/types.d.ts +1 -1
- package/package.json +3 -3
- package/select/overrides.d.ts +3 -5
- package/select/overrides.js +4 -4
- package/style/_parseStyleProp.js +2 -2
- package/tabs/styled-components.d.ts +3 -3
- package/tabs/styled-components.js +4 -1
- package/tabs/tab.js +2 -0
- package/time-range-picker/RangeSelectorContainer.js +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types.d.ts +1 -1
|
@@ -257,9 +257,9 @@ var useBaseAsyncSelect = function (params) {
|
|
|
257
257
|
var updateOptions = (0, react_1.useCallback)(function (getUpdatedOptions) {
|
|
258
258
|
var updatedOptions = getUpdatedOptions(options);
|
|
259
259
|
setOptions(updatedOptions);
|
|
260
|
-
setAllOptionsMap((0, keyBy_1.default)((0, utils_1.normalizeOptions)(updatedOptions)));
|
|
260
|
+
setAllOptionsMap((0, keyBy_1.default)((0, utils_1.normalizeOptions)(updatedOptions), valueKey));
|
|
261
261
|
sortedOptionsRef.current = updatedOptions;
|
|
262
|
-
}, [options]);
|
|
262
|
+
}, [options, valueKey]);
|
|
263
263
|
var updateResultCountMap = (0, react_1.useCallback)(function (getUpdatedResultCountMap) { return setResultCountMap(getUpdatedResultCountMap(resultCountMap)); }, [resultCountMap, setResultCountMap]);
|
|
264
264
|
return tslib_1.__assign(tslib_1.__assign({}, restSelectProps), { options: options, isLoading: isLoading, value: selectedOptions, controlRef: controlRef, inputRef: combinedRef, overrides: mergedOverrides, noResultsMsg: adaptedNoResultsMsg, createOption: createOption, onInputChange: _onInputChange, valueKey: valueKey, labelKey: labelKey, type: restSelectProps.type, groupConfigWithCount: groupConfigWithCount, onChange: onChange, onOpen: (0, react_1.useCallback)(function () {
|
|
265
265
|
moveSelectedOptionsToTop &&
|
package/classNames/index.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import baseClassnames from 'classnames';
|
|
2
|
+
/**
|
|
3
|
+
* classNames is a merging utility for class names.
|
|
4
|
+
* When importing, please import as `cx` or `classNames`.
|
|
5
|
+
* @warning This is NOT the same as the `css` themes utility.
|
|
6
|
+
* `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
|
|
7
|
+
* `cx` **cannot** handle these, and will not work with functions or StyleObjects!
|
|
8
|
+
* @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
|
|
9
|
+
*/
|
|
10
|
+
declare const documentedClassnames: typeof baseClassnames;
|
|
11
|
+
export default documentedClassnames;
|
package/classNames/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
var classnames_1 = require("classnames");
|
|
8
|
-
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
5
|
+
/**
|
|
6
|
+
* classNames is a merging utility for class names.
|
|
7
|
+
* When importing, please import as `cx` or `classNames`.
|
|
8
|
+
* @warning This is NOT the same as the `css` themes utility.
|
|
9
|
+
* `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
|
|
10
|
+
* `cx` **cannot** handle these, and will not work with functions or StyleObjects!
|
|
11
|
+
* @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
|
|
12
|
+
*/
|
|
13
|
+
var documentedClassnames = classnames_1.default;
|
|
14
|
+
exports.default = documentedClassnames;
|
package/date-picker/DateInput.js
CHANGED
|
@@ -102,15 +102,31 @@ function (_a) {
|
|
|
102
102
|
}, [date, minDate, maxDate, dateHelpers]);
|
|
103
103
|
var updateDate = function (nextDate) {
|
|
104
104
|
if ((0, exports.isDateValid)(nextDate)) {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if (date) {
|
|
106
|
+
onChange(dateHelpers.setDate(date, nextDate));
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
var monthNum = Number(month);
|
|
110
|
+
var yearNum = Number(year);
|
|
111
|
+
if ((0, exports.isMonthValid)(monthNum) &&
|
|
112
|
+
yearNum >= minYear &&
|
|
113
|
+
yearNum <= maxYear &&
|
|
114
|
+
nextDate <= (0, getDaysInMonth_1.default)(new Date(yearNum, monthNum - 1))) {
|
|
115
|
+
onChange(new Date(yearNum, monthNum - 1, nextDate));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
107
118
|
}
|
|
108
119
|
else {
|
|
109
120
|
setDay(date ? dateHelpers.formatDate(date, 'dd') : '');
|
|
110
121
|
}
|
|
111
122
|
};
|
|
112
123
|
var dateBlur = function (_event) {
|
|
113
|
-
|
|
124
|
+
if (date) {
|
|
125
|
+
setDay(dateHelpers.formatDate(date, 'dd'));
|
|
126
|
+
}
|
|
127
|
+
else if (!(0, exports.isDateValid)(Number(day))) {
|
|
128
|
+
setDay('');
|
|
129
|
+
}
|
|
114
130
|
};
|
|
115
131
|
// Match main: derive a number via Number(raw), not parseInt. For mask partials like "1_",
|
|
116
132
|
// Number returns NaN so we do not commit; parseInt("1_") === 1 incorrectly committed day 1.
|
|
@@ -139,15 +155,31 @@ function (_a) {
|
|
|
139
155
|
};
|
|
140
156
|
var updateMonth = function (nextMonth) {
|
|
141
157
|
if ((0, exports.isMonthValid)(nextMonth)) {
|
|
142
|
-
|
|
143
|
-
|
|
158
|
+
if (date) {
|
|
159
|
+
onChange(dateHelpers.setMonth(date, nextMonth - 1));
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
var dayNum = Number(day);
|
|
163
|
+
var yearNum = Number(year);
|
|
164
|
+
if ((0, exports.isDateValid)(dayNum) &&
|
|
165
|
+
yearNum >= minYear &&
|
|
166
|
+
yearNum <= maxYear &&
|
|
167
|
+
dayNum <= (0, getDaysInMonth_1.default)(new Date(yearNum, nextMonth - 1))) {
|
|
168
|
+
onChange(new Date(yearNum, nextMonth - 1, dayNum));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
144
171
|
}
|
|
145
172
|
else {
|
|
146
173
|
setMonth(date ? dateHelpers.formatDate(date, 'MM') : '');
|
|
147
174
|
}
|
|
148
175
|
};
|
|
149
176
|
var monthBlur = function (_event) {
|
|
150
|
-
|
|
177
|
+
if (date) {
|
|
178
|
+
setMonth(dateHelpers.formatDate(date, 'MM'));
|
|
179
|
+
}
|
|
180
|
+
else if (!(0, exports.isMonthValid)(Number(month))) {
|
|
181
|
+
setMonth('');
|
|
182
|
+
}
|
|
151
183
|
};
|
|
152
184
|
// Same rules as dayChange: Number(raw) rejects partial mask values like "1_".
|
|
153
185
|
var monthChange = function (event) {
|
|
@@ -176,15 +208,33 @@ function (_a) {
|
|
|
176
208
|
// year
|
|
177
209
|
var updateYear = function (nextYear) {
|
|
178
210
|
if (nextYear >= minYear && nextYear <= maxYear) {
|
|
179
|
-
|
|
180
|
-
|
|
211
|
+
if (date) {
|
|
212
|
+
onChange(dateHelpers.setYear(date, nextYear));
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
var dayNum = Number(day);
|
|
216
|
+
var monthNum = Number(month);
|
|
217
|
+
if ((0, exports.isDateValid)(dayNum) &&
|
|
218
|
+
(0, exports.isMonthValid)(monthNum) &&
|
|
219
|
+
dayNum <= (0, getDaysInMonth_1.default)(new Date(nextYear, monthNum - 1))) {
|
|
220
|
+
onChange(new Date(nextYear, monthNum - 1, dayNum));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
181
223
|
}
|
|
182
224
|
else {
|
|
183
225
|
setYear(date ? dateHelpers.getYear(date) : '');
|
|
184
226
|
}
|
|
185
227
|
};
|
|
186
228
|
var yearBlur = function (_event) {
|
|
187
|
-
|
|
229
|
+
if (date) {
|
|
230
|
+
setYear(dateHelpers.formatDate(date, 'yyyy'));
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
var yearNum = Number(year);
|
|
234
|
+
if (!(yearNum >= minYear && yearNum <= maxYear)) {
|
|
235
|
+
setYear('');
|
|
236
|
+
}
|
|
237
|
+
}
|
|
188
238
|
};
|
|
189
239
|
var yearChange = function (event) {
|
|
190
240
|
setYear(event.target.value);
|
|
@@ -254,9 +254,9 @@ export var useBaseAsyncSelect = function (params) {
|
|
|
254
254
|
var updateOptions = useCallback(function (getUpdatedOptions) {
|
|
255
255
|
var updatedOptions = getUpdatedOptions(options);
|
|
256
256
|
setOptions(updatedOptions);
|
|
257
|
-
setAllOptionsMap(_keyBy(normalizeOptions(updatedOptions)));
|
|
257
|
+
setAllOptionsMap(_keyBy(normalizeOptions(updatedOptions), valueKey));
|
|
258
258
|
sortedOptionsRef.current = updatedOptions;
|
|
259
|
-
}, [options]);
|
|
259
|
+
}, [options, valueKey]);
|
|
260
260
|
var updateResultCountMap = useCallback(function (getUpdatedResultCountMap) { return setResultCountMap(getUpdatedResultCountMap(resultCountMap)); }, [resultCountMap, setResultCountMap]);
|
|
261
261
|
return __assign(__assign({}, restSelectProps), { options: options, isLoading: isLoading, value: selectedOptions, controlRef: controlRef, inputRef: combinedRef, overrides: mergedOverrides, noResultsMsg: adaptedNoResultsMsg, createOption: createOption, onInputChange: _onInputChange, valueKey: valueKey, labelKey: labelKey, type: restSelectProps.type, groupConfigWithCount: groupConfigWithCount, onChange: onChange, onOpen: useCallback(function () {
|
|
262
262
|
moveSelectedOptionsToTop &&
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import baseClassnames from 'classnames';
|
|
2
|
+
/**
|
|
3
|
+
* classNames is a merging utility for class names.
|
|
4
|
+
* When importing, please import as `cx` or `classNames`.
|
|
5
|
+
* @warning This is NOT the same as the `css` themes utility.
|
|
6
|
+
* `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
|
|
7
|
+
* `cx` **cannot** handle these, and will not work with functions or StyleObjects!
|
|
8
|
+
* @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
|
|
9
|
+
*/
|
|
10
|
+
declare const documentedClassnames: typeof baseClassnames;
|
|
11
|
+
export default documentedClassnames;
|
package/esm/classNames/index.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import baseClassnames from 'classnames';
|
|
2
|
+
/**
|
|
3
|
+
* classNames is a merging utility for class names.
|
|
4
|
+
* When importing, please import as `cx` or `classNames`.
|
|
5
|
+
* @warning This is NOT the same as the `css` themes utility.
|
|
6
|
+
* `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
|
|
7
|
+
* `cx` **cannot** handle these, and will not work with functions or StyleObjects!
|
|
8
|
+
* @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
|
|
9
|
+
*/
|
|
10
|
+
var documentedClassnames = baseClassnames;
|
|
11
|
+
export default documentedClassnames;
|
|
@@ -97,15 +97,31 @@ function (_a) {
|
|
|
97
97
|
}, [date, minDate, maxDate, dateHelpers]);
|
|
98
98
|
var updateDate = function (nextDate) {
|
|
99
99
|
if (isDateValid(nextDate)) {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
if (date) {
|
|
101
|
+
onChange(dateHelpers.setDate(date, nextDate));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
var monthNum = Number(month);
|
|
105
|
+
var yearNum = Number(year);
|
|
106
|
+
if (isMonthValid(monthNum) &&
|
|
107
|
+
yearNum >= minYear &&
|
|
108
|
+
yearNum <= maxYear &&
|
|
109
|
+
nextDate <= getDaysInMonth(new Date(yearNum, monthNum - 1))) {
|
|
110
|
+
onChange(new Date(yearNum, monthNum - 1, nextDate));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
102
113
|
}
|
|
103
114
|
else {
|
|
104
115
|
setDay(date ? dateHelpers.formatDate(date, 'dd') : '');
|
|
105
116
|
}
|
|
106
117
|
};
|
|
107
118
|
var dateBlur = function (_event) {
|
|
108
|
-
|
|
119
|
+
if (date) {
|
|
120
|
+
setDay(dateHelpers.formatDate(date, 'dd'));
|
|
121
|
+
}
|
|
122
|
+
else if (!isDateValid(Number(day))) {
|
|
123
|
+
setDay('');
|
|
124
|
+
}
|
|
109
125
|
};
|
|
110
126
|
// Match main: derive a number via Number(raw), not parseInt. For mask partials like "1_",
|
|
111
127
|
// Number returns NaN so we do not commit; parseInt("1_") === 1 incorrectly committed day 1.
|
|
@@ -134,15 +150,31 @@ function (_a) {
|
|
|
134
150
|
};
|
|
135
151
|
var updateMonth = function (nextMonth) {
|
|
136
152
|
if (isMonthValid(nextMonth)) {
|
|
137
|
-
|
|
138
|
-
|
|
153
|
+
if (date) {
|
|
154
|
+
onChange(dateHelpers.setMonth(date, nextMonth - 1));
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
var dayNum = Number(day);
|
|
158
|
+
var yearNum = Number(year);
|
|
159
|
+
if (isDateValid(dayNum) &&
|
|
160
|
+
yearNum >= minYear &&
|
|
161
|
+
yearNum <= maxYear &&
|
|
162
|
+
dayNum <= getDaysInMonth(new Date(yearNum, nextMonth - 1))) {
|
|
163
|
+
onChange(new Date(yearNum, nextMonth - 1, dayNum));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
139
166
|
}
|
|
140
167
|
else {
|
|
141
168
|
setMonth(date ? dateHelpers.formatDate(date, 'MM') : '');
|
|
142
169
|
}
|
|
143
170
|
};
|
|
144
171
|
var monthBlur = function (_event) {
|
|
145
|
-
|
|
172
|
+
if (date) {
|
|
173
|
+
setMonth(dateHelpers.formatDate(date, 'MM'));
|
|
174
|
+
}
|
|
175
|
+
else if (!isMonthValid(Number(month))) {
|
|
176
|
+
setMonth('');
|
|
177
|
+
}
|
|
146
178
|
};
|
|
147
179
|
// Same rules as dayChange: Number(raw) rejects partial mask values like "1_".
|
|
148
180
|
var monthChange = function (event) {
|
|
@@ -171,15 +203,33 @@ function (_a) {
|
|
|
171
203
|
// year
|
|
172
204
|
var updateYear = function (nextYear) {
|
|
173
205
|
if (nextYear >= minYear && nextYear <= maxYear) {
|
|
174
|
-
|
|
175
|
-
|
|
206
|
+
if (date) {
|
|
207
|
+
onChange(dateHelpers.setYear(date, nextYear));
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
var dayNum = Number(day);
|
|
211
|
+
var monthNum = Number(month);
|
|
212
|
+
if (isDateValid(dayNum) &&
|
|
213
|
+
isMonthValid(monthNum) &&
|
|
214
|
+
dayNum <= getDaysInMonth(new Date(nextYear, monthNum - 1))) {
|
|
215
|
+
onChange(new Date(nextYear, monthNum - 1, dayNum));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
176
218
|
}
|
|
177
219
|
else {
|
|
178
220
|
setYear(date ? dateHelpers.getYear(date) : '');
|
|
179
221
|
}
|
|
180
222
|
};
|
|
181
223
|
var yearBlur = function (_event) {
|
|
182
|
-
|
|
224
|
+
if (date) {
|
|
225
|
+
setYear(dateHelpers.formatDate(date, 'yyyy'));
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
var yearNum = Number(year);
|
|
229
|
+
if (!(yearNum >= minYear && yearNum <= maxYear)) {
|
|
230
|
+
setYear('');
|
|
231
|
+
}
|
|
232
|
+
}
|
|
183
233
|
};
|
|
184
234
|
var yearChange = function (event) {
|
|
185
235
|
setYear(event.target.value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import type { ClassName, ClassNameStyleFn, Styles } from '../types';
|
|
3
3
|
import type { SharedProps } from './types';
|
|
4
4
|
export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...restProps }: {
|
|
@@ -6,7 +6,7 @@ export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...r
|
|
|
6
6
|
$isOpen: any;
|
|
7
7
|
title: any;
|
|
8
8
|
overrides: any;
|
|
9
|
-
}) =>
|
|
9
|
+
}) => ReactElement;
|
|
10
10
|
export declare const getSearchIconContainerStyles: ClassName;
|
|
11
11
|
export declare const getSearchIconStyles: ClassNameStyleFn<SharedProps>;
|
|
12
12
|
export declare const getControlContainerStyles: ClassName;
|
|
@@ -18,9 +18,7 @@ export declare const OverlaySelectPopoverOverride: ({ content, children: inputCo
|
|
|
18
18
|
closePopover: any;
|
|
19
19
|
setStickySentinelRef: any;
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export declare const SingleValueTombstone: (
|
|
22
|
-
$selectSize: any;
|
|
23
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const SingleValueTombstone: import("react").ForwardRefExoticComponent<Pick<SharedProps, "$selectSize"> & import("react").RefAttributes<HTMLElement>>;
|
|
24
22
|
export declare const selectMenuOverrides: {
|
|
25
23
|
readonly Menu: {
|
|
26
24
|
readonly props: {
|
package/esm/select/overrides.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
|
|
4
5
|
import ChevronDown from '../icon/components/chevron-down';
|
|
5
6
|
import { borderRadius as borderRadiusLongHandHelper } from '../helpers/longHandHelpers';
|
|
@@ -159,17 +160,17 @@ export var OverlaySelectPopoverOverride = function (_a) {
|
|
|
159
160
|
var content = _a.content, inputContainer = _a.children, closePopover = _a.closePopover, setStickySentinelRef = _a.setStickySentinelRef;
|
|
160
161
|
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: setStickySentinelRef }), inputContainer, typeof content === 'function' ? content({ closeMenu: closePopover }) : content] }));
|
|
161
162
|
};
|
|
162
|
-
export var SingleValueTombstone = function (_a) {
|
|
163
|
+
export var SingleValueTombstone = forwardRef(function (_a, ref) {
|
|
163
164
|
var $selectSize = _a.$selectSize;
|
|
164
165
|
var theme = useStyle().theme;
|
|
165
166
|
var defaultHeightClass = $selectSize === 'xxxs' ? 'h-4' : 'h-4.5';
|
|
166
167
|
var inputSizeTheme = getComponentSizeTheme(theme, 'input', $selectSize, getDefaultSize(theme));
|
|
167
|
-
return (_jsx(StyledTombstone, { "data-testid": "single-value-tombstone", className: [
|
|
168
|
+
return (_jsx(StyledTombstone, { ref: ref, "data-testid": "single-value-tombstone", className: [
|
|
168
169
|
"w-24 rounded-8 ".concat(defaultHeightClass),
|
|
169
170
|
//@ts-ignore -- theme override
|
|
170
171
|
(inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight) ? { height: inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight } : {},
|
|
171
172
|
] }));
|
|
172
|
-
};
|
|
173
|
+
});
|
|
173
174
|
export var selectMenuOverrides = {
|
|
174
175
|
Menu: {
|
|
175
176
|
props: {
|
|
@@ -19,10 +19,10 @@ var resolveStyleObjects = function (flattenStyles, _a) {
|
|
|
19
19
|
utils: utils,
|
|
20
20
|
styletronCss: styletronCss,
|
|
21
21
|
props: props,
|
|
22
|
-
}), 2),
|
|
22
|
+
}), 2), classNames_1 = _c[0], styletronClassNames_1 = _c[1];
|
|
23
23
|
// save computation if `debugCssInJs` is not enabled
|
|
24
24
|
return [
|
|
25
|
-
"".concat(mergedClassnames, " ").concat(
|
|
25
|
+
"".concat(mergedClassnames, " ").concat(classNames_1),
|
|
26
26
|
utils.debugCssInJs ? "".concat(cssInJsClassNames, " ").concat(styletronClassNames_1) : cssInJsClassNames,
|
|
27
27
|
];
|
|
28
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SharedPropsTabs } from './types';
|
|
2
|
-
import type { ClassName,
|
|
1
|
+
import type { SharedPropsTab, SharedPropsTabs } from './types';
|
|
2
|
+
import type { ClassName, StyleFn } from '../types';
|
|
3
3
|
export declare const tabsStyles: (_: any, { $variant, $position }: SharedPropsTabs) => string;
|
|
4
4
|
export declare const tabStyle: ClassName;
|
|
5
|
-
export declare const tabUnderlineStyles:
|
|
5
|
+
export declare const tabUnderlineStyles: StyleFn<SharedPropsTab>;
|
|
6
6
|
export declare const StyledTabsPanel: import("../style").StyledComponent;
|
|
7
7
|
export declare const StyledRoot: import("../style").StyledComponent;
|
|
8
8
|
export declare const StyledIconContainer: import("../style").StyledComponent;
|
|
@@ -35,6 +35,7 @@ export var tabStyle = function (_, _a) {
|
|
|
35
35
|
$position === 'top' ? 'mx-4' : '',
|
|
36
36
|
$position === 'left' ? 'mt-3 mb-3' : '',
|
|
37
37
|
$position === 'right' ? 'mt-3 mb-3' : '',
|
|
38
|
+
// @ts-ignore -- theme overrides
|
|
38
39
|
getTabStyleOverride,
|
|
39
40
|
];
|
|
40
41
|
}
|
|
@@ -48,6 +49,7 @@ export var tabStyle = function (_, _a) {
|
|
|
48
49
|
$position === 'top' ? 'mx-4' : '',
|
|
49
50
|
$position === 'left' ? 'mt-3 mb-3' : '',
|
|
50
51
|
$position === 'right' ? 'mt-3 mb-3' : '',
|
|
52
|
+
// @ts-ignore -- theme overrides
|
|
51
53
|
getTabStyleOverride,
|
|
52
54
|
];
|
|
53
55
|
}
|
|
@@ -61,7 +63,6 @@ export var tabStyle = function (_, _a) {
|
|
|
61
63
|
});
|
|
62
64
|
};
|
|
63
65
|
// Adds an underline element for selected tab
|
|
64
|
-
// @ts-ignore -- '::after' pseudo-element is not in type CSSProperties but is valid here
|
|
65
66
|
export var tabUnderlineStyles = function (_a, _b) {
|
|
66
67
|
var theme = _a.theme;
|
|
67
68
|
var $variant = _b.$variant, $position = _b.$position, $selected = _b.$selected, $disabled = _b.$disabled;
|
|
@@ -79,8 +80,10 @@ export var tabUnderlineStyles = function (_a, _b) {
|
|
|
79
80
|
},
|
|
80
81
|
}); };
|
|
81
82
|
if ($variant === 'default' && $position === 'top') {
|
|
83
|
+
// eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
|
|
82
84
|
if ($selected)
|
|
83
85
|
return __assign(__assign({}, underlineStyle(theme.spr.borderQuinary)), { __useCssInJs: 1 });
|
|
86
|
+
// eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
|
|
84
87
|
if (!$disabled)
|
|
85
88
|
return { ':hover': underlineStyle(theme.spr.borderQuaternary), __useCssInJs: 1 };
|
|
86
89
|
}
|
package/esm/tabs/tab.js
CHANGED
|
@@ -26,6 +26,8 @@ var Tab = function (props) {
|
|
|
26
26
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
27
27
|
}, [onChange, onClick, tabId]);
|
|
28
28
|
var _className = useMemo(function () { return [resetStyles, tabStyle, className]; }, [className]);
|
|
29
|
+
// eslint-disable-next-line @sprinklrjs/no-ts-ignores -- No current alternatives
|
|
30
|
+
// @ts-ignore -- CSS-in-JS -- Styletron styles used for the underline
|
|
29
31
|
var _style = useMemo(function () { return [tabUnderlineStyles, style]; }, [style]);
|
|
30
32
|
return (_jsx(TabComp, __assign({ "data-spaceweb": "tab", role: "tab", "aria-selected": _selected,
|
|
31
33
|
// id should not be passed to DOM.
|
|
@@ -114,7 +114,9 @@ var RangeSelectorContainer = function (_a) {
|
|
|
114
114
|
fill: theme.spr.clrRed,
|
|
115
115
|
});
|
|
116
116
|
} }), _jsx(Typography, __assign({ className: "my-0", variant: "bs3" }, { children: errMsg }))] }))) : null;
|
|
117
|
-
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3,
|
|
117
|
+
return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3,
|
|
118
|
+
// @ts-ignore -- CSS-in-JS
|
|
119
|
+
className: [cx({ 'items-center': monthsShown !== 1 }), { maxWidth: 'fit-content' }] }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? (_jsx(Button, __assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : (_jsx(Button, __assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), _jsx(Button, __assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
118
120
|
};
|
|
119
121
|
RangeSelectorContainer.displayName = 'RangeSelectorContainer';
|
|
120
122
|
export default RangeSelectorContainer;
|
package/esm/types.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export type StyleUtils = ThemeContext & {
|
|
|
90
90
|
getStyle: GetStyle;
|
|
91
91
|
px2rem: Px2Rem;
|
|
92
92
|
};
|
|
93
|
-
export type ClassNameStyleFn<P = any> = (utils: StyleUtils, props: P) =>
|
|
93
|
+
export type ClassNameStyleFn<P = any> = (utils: StyleUtils, props: P) => ClassName;
|
|
94
94
|
/**
|
|
95
95
|
* ClassName type for Spaceweb's components
|
|
96
96
|
* See: https://frontend.sprinklr.com/spaceweb/guides/styling#styled
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprinklrjs/spaceweb",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.13.1",
|
|
4
4
|
"description": "Components for SpaceWeb",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"body-scroll-lock": "3.1.5",
|
|
39
39
|
"card-validator": "^6.2.0",
|
|
40
40
|
"class-variance-authority": "^0.7.0",
|
|
41
|
-
"classnames": "2.
|
|
41
|
+
"classnames": "^2.5.1",
|
|
42
42
|
"csstype": "^3.0.2",
|
|
43
43
|
"date-fns": "^2.6.0",
|
|
44
44
|
"date-fns-tz": "^1.2.2",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"ts-node": "^10.4.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@sprinklrjs/spaceweb-themes": "14.
|
|
103
|
+
"@sprinklrjs/spaceweb-themes": "14.13.1",
|
|
104
104
|
"react": ">=17.0.2 <19.0.0",
|
|
105
105
|
"react-dom": ">=17.0.2 <19.0.0"
|
|
106
106
|
}
|
package/select/overrides.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import type { ClassName, ClassNameStyleFn, Styles } from '../types';
|
|
3
3
|
import type { SharedProps } from './types';
|
|
4
4
|
export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...restProps }: {
|
|
@@ -6,7 +6,7 @@ export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...r
|
|
|
6
6
|
$isOpen: any;
|
|
7
7
|
title: any;
|
|
8
8
|
overrides: any;
|
|
9
|
-
}) =>
|
|
9
|
+
}) => ReactElement;
|
|
10
10
|
export declare const getSearchIconContainerStyles: ClassName;
|
|
11
11
|
export declare const getSearchIconStyles: ClassNameStyleFn<SharedProps>;
|
|
12
12
|
export declare const getControlContainerStyles: ClassName;
|
|
@@ -18,9 +18,7 @@ export declare const OverlaySelectPopoverOverride: ({ content, children: inputCo
|
|
|
18
18
|
closePopover: any;
|
|
19
19
|
setStickySentinelRef: any;
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export declare const SingleValueTombstone: (
|
|
22
|
-
$selectSize: any;
|
|
23
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const SingleValueTombstone: import("react").ForwardRefExoticComponent<Pick<SharedProps, "$selectSize"> & import("react").RefAttributes<HTMLElement>>;
|
|
24
22
|
export declare const selectMenuOverrides: {
|
|
25
23
|
readonly Menu: {
|
|
26
24
|
readonly props: {
|
package/select/overrides.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.selectMenuOverrides = exports.SingleValueTombstone = exports.OverlaySelectPopoverOverride = exports.getValueTypography = exports.getValueContainerStyles = exports.getControlContainerStyles = exports.getSearchIconStyles = exports.getSearchIconContainerStyles = exports.SelectArrow = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
6
7
|
var themeHelpers_1 = require("../helpers/themeHelpers");
|
|
7
8
|
var chevron_down_1 = tslib_1.__importDefault(require("../icon/components/chevron-down"));
|
|
8
9
|
var longHandHelpers_1 = require("../helpers/longHandHelpers");
|
|
@@ -165,18 +166,17 @@ var OverlaySelectPopoverOverride = function (_a) {
|
|
|
165
166
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, { ref: setStickySentinelRef }), inputContainer, typeof content === 'function' ? content({ closeMenu: closePopover }) : content] }));
|
|
166
167
|
};
|
|
167
168
|
exports.OverlaySelectPopoverOverride = OverlaySelectPopoverOverride;
|
|
168
|
-
|
|
169
|
+
exports.SingleValueTombstone = (0, react_1.forwardRef)(function (_a, ref) {
|
|
169
170
|
var $selectSize = _a.$selectSize;
|
|
170
171
|
var theme = (0, style_1.useStyle)().theme;
|
|
171
172
|
var defaultHeightClass = $selectSize === 'xxxs' ? 'h-4' : 'h-4.5';
|
|
172
173
|
var inputSizeTheme = (0, themeHelpers_1.getComponentSizeTheme)(theme, 'input', $selectSize, (0, themeHelpers_1.getDefaultSize)(theme));
|
|
173
|
-
return ((0, jsx_runtime_1.jsx)(StyledTombstone_1.StyledTombstone, { "data-testid": "single-value-tombstone", className: [
|
|
174
|
+
return ((0, jsx_runtime_1.jsx)(StyledTombstone_1.StyledTombstone, { ref: ref, "data-testid": "single-value-tombstone", className: [
|
|
174
175
|
"w-24 rounded-8 ".concat(defaultHeightClass),
|
|
175
176
|
//@ts-ignore -- theme override
|
|
176
177
|
(inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight) ? { height: inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight } : {},
|
|
177
178
|
] }));
|
|
178
|
-
};
|
|
179
|
-
exports.SingleValueTombstone = SingleValueTombstone;
|
|
179
|
+
});
|
|
180
180
|
exports.selectMenuOverrides = {
|
|
181
181
|
Menu: {
|
|
182
182
|
props: {
|
package/style/_parseStyleProp.js
CHANGED
|
@@ -22,10 +22,10 @@ var resolveStyleObjects = function (flattenStyles, _a) {
|
|
|
22
22
|
utils: utils,
|
|
23
23
|
styletronCss: styletronCss,
|
|
24
24
|
props: props,
|
|
25
|
-
}), 2),
|
|
25
|
+
}), 2), classNames_1 = _c[0], styletronClassNames_1 = _c[1];
|
|
26
26
|
// save computation if `debugCssInJs` is not enabled
|
|
27
27
|
return [
|
|
28
|
-
"".concat(mergedClassnames, " ").concat(
|
|
28
|
+
"".concat(mergedClassnames, " ").concat(classNames_1),
|
|
29
29
|
utils.debugCssInJs ? "".concat(cssInJsClassNames, " ").concat(styletronClassNames_1) : cssInJsClassNames,
|
|
30
30
|
];
|
|
31
31
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SharedPropsTabs } from './types';
|
|
2
|
-
import type { ClassName,
|
|
1
|
+
import type { SharedPropsTab, SharedPropsTabs } from './types';
|
|
2
|
+
import type { ClassName, StyleFn } from '../types';
|
|
3
3
|
export declare const tabsStyles: (_: any, { $variant, $position }: SharedPropsTabs) => string;
|
|
4
4
|
export declare const tabStyle: ClassName;
|
|
5
|
-
export declare const tabUnderlineStyles:
|
|
5
|
+
export declare const tabUnderlineStyles: StyleFn<SharedPropsTab>;
|
|
6
6
|
export declare const StyledTabsPanel: import("../style").StyledComponent;
|
|
7
7
|
export declare const StyledRoot: import("../style").StyledComponent;
|
|
8
8
|
export declare const StyledIconContainer: import("../style").StyledComponent;
|
|
@@ -39,6 +39,7 @@ var tabStyle = function (_, _a) {
|
|
|
39
39
|
$position === 'top' ? 'mx-4' : '',
|
|
40
40
|
$position === 'left' ? 'mt-3 mb-3' : '',
|
|
41
41
|
$position === 'right' ? 'mt-3 mb-3' : '',
|
|
42
|
+
// @ts-ignore -- theme overrides
|
|
42
43
|
getTabStyleOverride,
|
|
43
44
|
];
|
|
44
45
|
}
|
|
@@ -52,6 +53,7 @@ var tabStyle = function (_, _a) {
|
|
|
52
53
|
$position === 'top' ? 'mx-4' : '',
|
|
53
54
|
$position === 'left' ? 'mt-3 mb-3' : '',
|
|
54
55
|
$position === 'right' ? 'mt-3 mb-3' : '',
|
|
56
|
+
// @ts-ignore -- theme overrides
|
|
55
57
|
getTabStyleOverride,
|
|
56
58
|
];
|
|
57
59
|
}
|
|
@@ -66,7 +68,6 @@ var tabStyle = function (_, _a) {
|
|
|
66
68
|
};
|
|
67
69
|
exports.tabStyle = tabStyle;
|
|
68
70
|
// Adds an underline element for selected tab
|
|
69
|
-
// @ts-ignore -- '::after' pseudo-element is not in type CSSProperties but is valid here
|
|
70
71
|
var tabUnderlineStyles = function (_a, _b) {
|
|
71
72
|
var theme = _a.theme;
|
|
72
73
|
var $variant = _b.$variant, $position = _b.$position, $selected = _b.$selected, $disabled = _b.$disabled;
|
|
@@ -84,8 +85,10 @@ var tabUnderlineStyles = function (_a, _b) {
|
|
|
84
85
|
},
|
|
85
86
|
}); };
|
|
86
87
|
if ($variant === 'default' && $position === 'top') {
|
|
88
|
+
// eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
|
|
87
89
|
if ($selected)
|
|
88
90
|
return tslib_1.__assign(tslib_1.__assign({}, underlineStyle(theme.spr.borderQuinary)), { __useCssInJs: 1 });
|
|
91
|
+
// eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
|
|
89
92
|
if (!$disabled)
|
|
90
93
|
return { ':hover': underlineStyle(theme.spr.borderQuaternary), __useCssInJs: 1 };
|
|
91
94
|
}
|
package/tabs/tab.js
CHANGED
|
@@ -28,6 +28,8 @@ var Tab = function (props) {
|
|
|
28
28
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
29
29
|
}, [onChange, onClick, tabId]);
|
|
30
30
|
var _className = (0, react_1.useMemo)(function () { return [helpers_2.resetStyles, styled_components_1.tabStyle, className]; }, [className]);
|
|
31
|
+
// eslint-disable-next-line @sprinklrjs/no-ts-ignores -- No current alternatives
|
|
32
|
+
// @ts-ignore -- CSS-in-JS -- Styletron styles used for the underline
|
|
31
33
|
var _style = (0, react_1.useMemo)(function () { return [styled_components_1.tabUnderlineStyles, style]; }, [style]);
|
|
32
34
|
return ((0, jsx_runtime_1.jsx)(TabComp, tslib_1.__assign({ "data-spaceweb": "tab", role: "tab", "aria-selected": _selected,
|
|
33
35
|
// id should not be passed to DOM.
|