@spaced-out/ui-design-system 0.5.13-beta.1 → 0.5.13
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/CHANGELOG.md +8 -0
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.d.ts +1 -0
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js +2 -0
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts +2 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabDropdown.js +19 -2
- package/lib/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/lib/components/ButtonTabs/ButtonTabs.d.ts.map +1 -1
- package/lib/components/ButtonTabs/ButtonTabs.js +19 -4
- package/lib/components/Charts/ChartWrapper/ChartWrapper.d.ts +1 -0
- package/lib/components/Charts/ChartWrapper/ChartWrapper.d.ts.map +1 -1
- package/lib/components/Charts/ChartWrapper/ChartWrapper.js +37 -5
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts +2 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts.map +1 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.js +2 -0
- package/lib/components/Charts/DonutChart/DonutChart.d.ts +2 -1
- package/lib/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
- package/lib/components/Charts/DonutChart/DonutChart.js +2 -0
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts +2 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts.map +1 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.js +2 -0
- package/lib/components/Charts/LineChart/LineChart.d.ts +2 -1
- package/lib/components/Charts/LineChart/LineChart.d.ts.map +1 -1
- package/lib/components/Charts/LineChart/LineChart.js +2 -0
- package/lib/components/Charts/SankeyChart/SankeyChart.d.ts +2 -1
- package/lib/components/Charts/SankeyChart/SankeyChart.d.ts.map +1 -1
- package/lib/components/Charts/SankeyChart/SankeyChart.js +2 -0
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts +2 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts.map +1 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.js +2 -0
- package/lib/components/Charts/StackedBarChart/StackedBarChart.d.ts +2 -1
- package/lib/components/Charts/StackedBarChart/StackedBarChart.d.ts.map +1 -1
- package/lib/components/Charts/StackedBarChart/StackedBarChart.js +2 -0
- package/lib/components/Combobox/Combobox.d.ts +1 -0
- package/lib/components/Combobox/Combobox.d.ts.map +1 -1
- package/lib/components/Combobox/Combobox.js +45 -3
- package/lib/components/DateRangePicker/Calendar.d.ts +2 -1
- package/lib/components/DateRangePicker/Calendar.d.ts.map +1 -1
- package/lib/components/DateRangePicker/Calendar.js +24 -2
- package/lib/components/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/lib/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangePicker.js +4 -2
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts +1 -0
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.js +104 -14
- package/lib/components/DateRangePicker/Day.d.ts +2 -1
- package/lib/components/DateRangePicker/Day.d.ts.map +1 -1
- package/lib/components/DateRangePicker/Day.js +11 -1
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts +1 -0
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.d.ts.map +1 -1
- package/lib/components/FilterButtonOverlay/FilterButtonOverlay.js +18 -1
- package/lib/components/FocusManager/FocusManager.d.ts +2 -1
- package/lib/components/FocusManager/FocusManager.d.ts.map +1 -1
- package/lib/components/FocusManager/FocusManager.js +8 -0
- package/lib/components/InfinitePagination/InfinitePagination.d.ts +1 -0
- package/lib/components/InfinitePagination/InfinitePagination.d.ts.map +1 -1
- package/lib/components/InfinitePagination/InfinitePagination.js +20 -3
- package/lib/components/InlineDropdown/InlineDropdown.d.ts +1 -0
- package/lib/components/InlineDropdown/InlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/InlineDropdown.js +27 -2
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts +2 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.d.ts.map +1 -1
- package/lib/components/InlineDropdown/SimpleInlineDropdown.js +2 -0
- package/lib/components/OptionButton/OptionButton.d.ts +1 -0
- package/lib/components/OptionButton/OptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/OptionButton.js +20 -2
- package/lib/components/OptionButton/SimpleOptionButton.d.ts +2 -1
- package/lib/components/OptionButton/SimpleOptionButton.d.ts.map +1 -1
- package/lib/components/OptionButton/SimpleOptionButton.js +2 -0
- package/lib/components/Pagination/Pagination.d.ts +2 -0
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +33 -3
- package/lib/components/Pagination/PaginationItem.d.ts.map +1 -1
- package/lib/components/Pagination/PaginationItem.js +31 -5
- package/lib/components/Table/Cell.d.ts +13 -7
- package/lib/components/Table/Cell.d.ts.map +1 -1
- package/lib/components/Table/Cell.js +40 -9
- package/lib/components/Table/DefaultRow.d.ts +5 -2
- package/lib/components/Table/DefaultRow.d.ts.map +1 -1
- package/lib/components/Table/DefaultRow.js +59 -6
- package/lib/components/Table/DefaultTableHeader.d.ts +2 -0
- package/lib/components/Table/DefaultTableHeader.d.ts.map +1 -1
- package/lib/components/Table/DefaultTableHeader.js +17 -2
- package/lib/components/Table/StaticTable.d.ts.map +1 -1
- package/lib/components/Table/StaticTable.js +45 -11
- package/lib/components/Table/Table.d.ts +1 -0
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.docs.d.ts +11 -0
- package/lib/components/Table/Table.docs.d.ts.map +1 -1
- package/lib/components/Table/Table.docs.js +11 -0
- package/lib/components/Table/Table.js +6 -3
- package/lib/components/Table/TableActionBar.d.ts +8 -3
- package/lib/components/Table/TableActionBar.d.ts.map +1 -1
- package/lib/components/Table/TableActionBar.js +16 -3
- package/lib/components/Table/TableBottomBar.d.ts +2 -1
- package/lib/components/Table/TableBottomBar.d.ts.map +1 -1
- package/lib/components/Table/TableBottomBar.js +6 -1
- package/lib/components/Table/TableTopBar.d.ts +2 -1
- package/lib/components/Table/TableTopBar.d.ts.map +1 -1
- package/lib/components/Table/TableTopBar.js +6 -1
- package/lib/components/Tabs/Tab/Tab.d.ts +1 -0
- package/lib/components/Tabs/Tab/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab/Tab.js +9 -1
- package/lib/components/Tabs/TabList/TabDropdown.d.ts +2 -1
- package/lib/components/Tabs/TabList/TabDropdown.d.ts.map +1 -1
- package/lib/components/Tabs/TabList/TabDropdown.js +21 -4
- package/lib/components/Tabs/TabList/TabList.d.ts +1 -0
- package/lib/components/Tabs/TabList/TabList.d.ts.map +1 -1
- package/lib/components/Tabs/TabList/TabList.js +20 -5
- package/lib/components/TokenListInput/TokenListInput.d.ts +1 -0
- package/lib/components/TokenListInput/TokenListInput.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenListInput.js +56 -7
- package/lib/components/TokenListInput/TokenValueChips.d.ts +2 -0
- package/lib/components/TokenListInput/TokenValueChips.d.ts.map +1 -1
- package/lib/components/TokenListInput/TokenValueChips.js +12 -3
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Combobox = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
+
var _qa = require("../../utils/qa");
|
|
9
10
|
var _Dropdown = require("../Dropdown");
|
|
10
11
|
var _Input = require("../Input");
|
|
11
12
|
var _Text = require("../Text");
|
|
@@ -57,7 +58,8 @@ const Combobox = exports.Combobox = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
57
58
|
onDropdownContainerClick,
|
|
58
59
|
dropdownName,
|
|
59
60
|
dropdownPlaceholder,
|
|
60
|
-
dropdownBoxRef
|
|
61
|
+
dropdownBoxRef,
|
|
62
|
+
testId
|
|
61
63
|
} = props;
|
|
62
64
|
const inputRef = React.useRef(null);
|
|
63
65
|
const dropdownRef = React.useRef(null);
|
|
@@ -104,15 +106,31 @@ const Combobox = exports.Combobox = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
104
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
105
107
|
ref: ref,
|
|
106
108
|
className: (0, _classify.default)(_ComboboxModule.default.wrapper, classNames?.wrapper),
|
|
109
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
110
|
+
base: testId,
|
|
111
|
+
slot: 'root'
|
|
112
|
+
}),
|
|
107
113
|
children: [Boolean(label) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
114
|
className: _ComboboxModule.default.info,
|
|
115
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
116
|
+
base: testId,
|
|
117
|
+
slot: 'label'
|
|
118
|
+
}),
|
|
109
119
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
110
120
|
className: _ComboboxModule.default.infoContent,
|
|
111
121
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.FormLabelSmall, {
|
|
112
122
|
color: "secondary",
|
|
123
|
+
testId: (0, _qa.generateTestId)({
|
|
124
|
+
base: testId,
|
|
125
|
+
slot: 'label-text'
|
|
126
|
+
}),
|
|
113
127
|
children: label ?? ''
|
|
114
128
|
}), "\xA0", required && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.FormLabelSmall, {
|
|
115
129
|
color: "danger",
|
|
130
|
+
testId: (0, _qa.generateTestId)({
|
|
131
|
+
base: testId,
|
|
132
|
+
slot: 'required'
|
|
133
|
+
}),
|
|
116
134
|
children: "*"
|
|
117
135
|
})]
|
|
118
136
|
})
|
|
@@ -122,6 +140,10 @@ const Combobox = exports.Combobox = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
122
140
|
}, classNames?.box),
|
|
123
141
|
onClick: !(disabled || locked) ? onContainerClick : undefined,
|
|
124
142
|
ref: boxRef,
|
|
143
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
144
|
+
base: testId,
|
|
145
|
+
slot: 'box'
|
|
146
|
+
}),
|
|
125
147
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
|
|
126
148
|
ref: dropdownRef,
|
|
127
149
|
menu: menu,
|
|
@@ -147,7 +169,11 @@ const Combobox = exports.Combobox = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
147
169
|
onBlur: onDropdownBlur,
|
|
148
170
|
onKeyDown: onDropdownKeyDown,
|
|
149
171
|
onContainerClick: onDropdownContainerClick,
|
|
150
|
-
name: dropdownName
|
|
172
|
+
name: dropdownName,
|
|
173
|
+
testId: (0, _qa.generateTestId)({
|
|
174
|
+
base: testId,
|
|
175
|
+
slot: 'dropdown'
|
|
176
|
+
})
|
|
151
177
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.Input, {
|
|
152
178
|
ref: inputRef,
|
|
153
179
|
boxRef: inputBoxRef,
|
|
@@ -182,15 +208,31 @@ const Combobox = exports.Combobox = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
182
208
|
maxLength: maxLength,
|
|
183
209
|
pattern: pattern,
|
|
184
210
|
min: min,
|
|
185
|
-
max: max
|
|
211
|
+
max: max,
|
|
212
|
+
testId: (0, _qa.generateTestId)({
|
|
213
|
+
base: testId,
|
|
214
|
+
slot: 'input'
|
|
215
|
+
})
|
|
186
216
|
})]
|
|
187
217
|
}), (Boolean(helperText) || error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
188
218
|
className: _ComboboxModule.default.info,
|
|
219
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
220
|
+
base: testId,
|
|
221
|
+
slot: 'helper'
|
|
222
|
+
}),
|
|
189
223
|
children: error && errorText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
190
224
|
color: "danger",
|
|
225
|
+
testId: (0, _qa.generateTestId)({
|
|
226
|
+
base: testId,
|
|
227
|
+
slot: 'error'
|
|
228
|
+
}),
|
|
191
229
|
children: errorText
|
|
192
230
|
}) : typeof helperText === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
193
231
|
color: disabled ? 'disabled' : 'secondary',
|
|
232
|
+
testId: (0, _qa.generateTestId)({
|
|
233
|
+
base: testId,
|
|
234
|
+
slot: 'helper-text'
|
|
235
|
+
}),
|
|
194
236
|
children: helperText
|
|
195
237
|
}) : helperText
|
|
196
238
|
})]
|
|
@@ -16,7 +16,8 @@ interface CalendarProps {
|
|
|
16
16
|
};
|
|
17
17
|
today: string;
|
|
18
18
|
t: ((key: string, fallback: string) => string) | null | undefined;
|
|
19
|
+
testId?: string;
|
|
19
20
|
}
|
|
20
|
-
export declare const Calendar: ({ value, minDate, maxDate, handlers, hoverDay, dateRange, inHoverRange, today, t, }: CalendarProps) => React.JSX.Element;
|
|
21
|
+
export declare const Calendar: ({ value, minDate, maxDate, handlers, hoverDay, dateRange, inHoverRange, today, t, testId, }: CalendarProps) => React.JSX.Element;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAwB1D,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,QAAQ,EAAE;QACR,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,eAAe,EAAE,CACf,MAAM,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,EAC9C,MAAM,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,KAC/D,IAAI,CAAC;KACX,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,GAAI,6FAWtB,aAAa,sBA4Df,CAAC"}
|
|
@@ -8,6 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _moment = _interopRequireDefault(require("moment"));
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
10
|
var _dateRangePicker = require("../../utils/date-range-picker");
|
|
11
|
+
var _qa = require("../../utils/qa");
|
|
11
12
|
var _Day = require("./Day");
|
|
12
13
|
var _Text = require("../Text");
|
|
13
14
|
var _CalendarModule = _interopRequireDefault(require("./Calendar.module.css"));
|
|
@@ -24,19 +25,36 @@ const Calendar = _ref => {
|
|
|
24
25
|
dateRange,
|
|
25
26
|
inHoverRange,
|
|
26
27
|
today,
|
|
27
|
-
t
|
|
28
|
+
t,
|
|
29
|
+
testId
|
|
28
30
|
} = _ref;
|
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
30
32
|
className: _CalendarModule.default.calendar,
|
|
33
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
34
|
+
base: testId,
|
|
35
|
+
slot: `calendar-${value}`
|
|
36
|
+
}),
|
|
31
37
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
32
38
|
className: _CalendarModule.default.calendarRow,
|
|
39
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
40
|
+
base: testId,
|
|
41
|
+
slot: 'weekdays'
|
|
42
|
+
}),
|
|
33
43
|
children: _utils.WEEKDAYS.map(day => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
34
44
|
className: _CalendarModule.default.calendarRowItem,
|
|
35
45
|
color: _Text.TEXT_COLORS.tertiary,
|
|
46
|
+
testId: (0, _qa.generateTestId)({
|
|
47
|
+
base: testId,
|
|
48
|
+
slot: `weekday-${day}`
|
|
49
|
+
}),
|
|
36
50
|
children: (0, _dateRangePicker.getTranslation)(t, day)
|
|
37
51
|
}, day))
|
|
38
52
|
}), (0, _utils.getDaysInMonth)(value).map((week, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
53
|
className: _CalendarModule.default.calendarRow,
|
|
54
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
55
|
+
base: testId,
|
|
56
|
+
slot: `week-${index}`
|
|
57
|
+
}),
|
|
40
58
|
children: week.map(date => {
|
|
41
59
|
const isRangeValid = (0, _utils.isStartDateEndDateSame)(dateRange);
|
|
42
60
|
const isStart = (0, _utils.isStartOfRange)(dateRange, date);
|
|
@@ -58,7 +76,11 @@ const Calendar = _ref => {
|
|
|
58
76
|
highlighted: highlighted && !isRangeValid,
|
|
59
77
|
startOfRange: isStart && !isRangeValid,
|
|
60
78
|
value: dateValue.date().toString(),
|
|
61
|
-
hoverDay: hoverDay
|
|
79
|
+
hoverDay: hoverDay,
|
|
80
|
+
testId: (0, _qa.generateTestId)({
|
|
81
|
+
base: testId,
|
|
82
|
+
slot: `day-${date}`
|
|
83
|
+
})
|
|
62
84
|
}, date);
|
|
63
85
|
})
|
|
64
86
|
}, week[index]))]
|
|
@@ -16,6 +16,7 @@ export interface DateRangePickerProps {
|
|
|
16
16
|
endDateLabel?: string;
|
|
17
17
|
t?: ((key: string, fallback: string) => string) | null | undefined;
|
|
18
18
|
locale?: string;
|
|
19
|
+
testId?: string;
|
|
19
20
|
}
|
|
20
21
|
export declare const DateRangePicker: Flow.AbstractComponent<DateRangePickerProps, HTMLDivElement>;
|
|
21
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAEV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAyBnB,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAClD,oBAAoB,EACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAEV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAyBnB,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAClD,oBAAoB,EACpB,cAAc,CAgKf,CAAC"}
|
|
@@ -28,7 +28,8 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/React.forwardRef(
|
|
|
28
28
|
startDateLabel,
|
|
29
29
|
endDateLabel,
|
|
30
30
|
t,
|
|
31
|
-
locale
|
|
31
|
+
locale,
|
|
32
|
+
testId
|
|
32
33
|
} = _ref;
|
|
33
34
|
const localTimezone = _momentTimezone.default.tz.guess();
|
|
34
35
|
const {
|
|
@@ -137,6 +138,7 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/React.forwardRef(
|
|
|
137
138
|
startDateLabel: startDateLabel,
|
|
138
139
|
endDateLabel: endDateLabel,
|
|
139
140
|
t: t,
|
|
140
|
-
locale: locale
|
|
141
|
+
locale: locale,
|
|
142
|
+
testId: testId
|
|
141
143
|
});
|
|
142
144
|
});
|
|
@@ -27,6 +27,7 @@ interface DateRangeWrapperProps {
|
|
|
27
27
|
endDateLabel?: string;
|
|
28
28
|
t?: ((key: string, fallback: string) => string) | null | undefined;
|
|
29
29
|
locale?: string;
|
|
30
|
+
testId?: string;
|
|
30
31
|
}
|
|
31
32
|
export declare const DateRangeWrapper: Flow.AbstractComponent<DateRangeWrapperProps, HTMLDivElement>;
|
|
32
33
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangeWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAGrD,OAAO,KAAK,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAChE,OAAO,EAML,OAAO,EACP,iBAAiB,EAClB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"DateRangeWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangeWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAGrD,OAAO,KAAK,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAChE,OAAO,EAML,OAAO,EACP,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAgDnB,UAAU,qBAAqB;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE;QACR,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,eAAe,EAAE,CACf,MAAM,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,EAC9C,MAAM,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,KAC/D,IAAI,CAAC;KACX,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAoGD,eAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,CACnD,qBAAqB,EACrB,cAAc,CA4Pf,CAAC"}
|
|
@@ -9,6 +9,7 @@ var _moment = _interopRequireDefault(require("moment"));
|
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
10
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
11
11
|
var _dateRangePicker = require("../../utils/date-range-picker");
|
|
12
|
+
var _qa = require("../../utils/qa");
|
|
12
13
|
var _Button = require("../Button");
|
|
13
14
|
var _Card = require("../Card");
|
|
14
15
|
var _Calendar = require("./Calendar");
|
|
@@ -33,7 +34,8 @@ const CalendarHeader = _ref => {
|
|
|
33
34
|
onClickNext,
|
|
34
35
|
nextDisabled,
|
|
35
36
|
prevDisabled,
|
|
36
|
-
onClickPrevious
|
|
37
|
+
onClickPrevious,
|
|
38
|
+
testId
|
|
37
39
|
} = _ref;
|
|
38
40
|
const availableYears = (0, _utils.generateAvailableYears)({
|
|
39
41
|
marker,
|
|
@@ -53,6 +55,10 @@ const CalendarHeader = _ref => {
|
|
|
53
55
|
const MONTHS = (0, _utils.getMonths)(t);
|
|
54
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
55
57
|
className: _DateRangeWrapperModule.default.calendarHeader,
|
|
58
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
59
|
+
base: testId,
|
|
60
|
+
slot: `header-${marker}`
|
|
61
|
+
}),
|
|
56
62
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.ClickableIcon, {
|
|
57
63
|
ariaLabel: (0, _dateRangePicker.getTranslation)(t, 'Select Previous Month'),
|
|
58
64
|
size: "small",
|
|
@@ -61,7 +67,11 @@ const CalendarHeader = _ref => {
|
|
|
61
67
|
[_DateRangeWrapperModule.default.disabledIcon]: prevDisabled
|
|
62
68
|
}),
|
|
63
69
|
onClick: () => !prevDisabled && onClickPrevious(),
|
|
64
|
-
color: prevDisabled ? 'disabled' : 'secondary'
|
|
70
|
+
color: prevDisabled ? 'disabled' : 'secondary',
|
|
71
|
+
testId: (0, _qa.generateTestId)({
|
|
72
|
+
base: testId,
|
|
73
|
+
slot: `prev-button-${marker}`
|
|
74
|
+
})
|
|
65
75
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
|
|
66
76
|
size: "small",
|
|
67
77
|
disabled: !availableMonths.length || (0, _dateRangePicker.isAfter)(minDate, maxDate),
|
|
@@ -73,7 +83,11 @@ const CalendarHeader = _ref => {
|
|
|
73
83
|
setMonth((0, _utils.getMonthEndDate)(_moment.default.utc(date).set('M', Number(event.key))));
|
|
74
84
|
},
|
|
75
85
|
dropdownInputText: MONTHS[_moment.default.utc(date).month()].label,
|
|
76
|
-
scrollMenuToBottom: true
|
|
86
|
+
scrollMenuToBottom: true,
|
|
87
|
+
testId: (0, _qa.generateTestId)({
|
|
88
|
+
base: testId,
|
|
89
|
+
slot: `month-dropdown-${marker}`
|
|
90
|
+
})
|
|
77
91
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
|
|
78
92
|
disabled: !availableYears.length || (0, _dateRangePicker.isAfter)(minDate, maxDate),
|
|
79
93
|
menu: {
|
|
@@ -85,7 +99,11 @@ const CalendarHeader = _ref => {
|
|
|
85
99
|
setMonth((0, _utils.getMonthEndDate)(_moment.default.utc(date).set('y', Number(event.key))));
|
|
86
100
|
},
|
|
87
101
|
dropdownInputText: _moment.default.utc(date).year().toString(),
|
|
88
|
-
scrollMenuToBottom: true
|
|
102
|
+
scrollMenuToBottom: true,
|
|
103
|
+
testId: (0, _qa.generateTestId)({
|
|
104
|
+
base: testId,
|
|
105
|
+
slot: `year-dropdown-${marker}`
|
|
106
|
+
})
|
|
89
107
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.ClickableIcon, {
|
|
90
108
|
size: "small",
|
|
91
109
|
ariaLabel: (0, _dateRangePicker.getTranslation)(t, 'Select Next Month'),
|
|
@@ -94,7 +112,11 @@ const CalendarHeader = _ref => {
|
|
|
94
112
|
[_DateRangeWrapperModule.default.disabledIcon]: nextDisabled
|
|
95
113
|
}),
|
|
96
114
|
onClick: () => !nextDisabled && onClickNext(),
|
|
97
|
-
color: nextDisabled ? 'disabled' : 'secondary'
|
|
115
|
+
color: nextDisabled ? 'disabled' : 'secondary',
|
|
116
|
+
testId: (0, _qa.generateTestId)({
|
|
117
|
+
base: testId,
|
|
118
|
+
slot: `next-button-${marker}`
|
|
119
|
+
})
|
|
98
120
|
})]
|
|
99
121
|
});
|
|
100
122
|
};
|
|
@@ -120,7 +142,8 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
120
142
|
startDateLabel,
|
|
121
143
|
endDateLabel,
|
|
122
144
|
t,
|
|
123
|
-
locale
|
|
145
|
+
locale,
|
|
146
|
+
testId
|
|
124
147
|
} = _ref2;
|
|
125
148
|
const canNavigateCloser = _moment.default.utc(rangeStartMonth).year() !== _moment.default.utc(rangeEndMonth).year() || Math.abs(_moment.default.utc(rangeStartMonth).month() - _moment.default.utc(rangeEndMonth).month()) > 1;
|
|
126
149
|
const handleApplyClick = () => {
|
|
@@ -149,7 +172,8 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
149
172
|
minDate,
|
|
150
173
|
maxDate,
|
|
151
174
|
today,
|
|
152
|
-
t
|
|
175
|
+
t,
|
|
176
|
+
testId
|
|
153
177
|
};
|
|
154
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusManager.FocusManager, {
|
|
155
179
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.Card, {
|
|
@@ -157,24 +181,48 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
157
181
|
wrapper: (0, _classify.default)(_DateRangeWrapperModule.default.dateRangeWrapper, cardWrapperClass)
|
|
158
182
|
},
|
|
159
183
|
ref: ref,
|
|
184
|
+
testId: (0, _qa.generateTestId)({
|
|
185
|
+
base: testId,
|
|
186
|
+
slot: 'card'
|
|
187
|
+
}),
|
|
160
188
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.CardHeader, {
|
|
161
189
|
className: _DateRangeWrapperModule.default.cardHeader,
|
|
190
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
191
|
+
base: testId,
|
|
192
|
+
slot: 'header'
|
|
193
|
+
}),
|
|
162
194
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
163
195
|
className: _DateRangeWrapperModule.default.selectedDate,
|
|
164
196
|
color: _Text.TEXT_COLORS.secondary,
|
|
197
|
+
testId: (0, _qa.generateTestId)({
|
|
198
|
+
base: testId,
|
|
199
|
+
slot: 'start-date-label'
|
|
200
|
+
}),
|
|
165
201
|
children: `${startDateLabel || (0, _dateRangePicker.getTranslation)(t, 'Start Date')}: ${(0, _dateRangePicker.getFormattedDate)(_utils.MARKERS.DATE_RANGE_START, dateRange, locale)}`
|
|
166
202
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
167
203
|
name: "minus",
|
|
168
204
|
size: _Icon.ICON_SIZE.small,
|
|
169
205
|
type: _Icon.ICON_TYPE.regular,
|
|
170
|
-
color: _Text.TEXT_COLORS.secondary
|
|
206
|
+
color: _Text.TEXT_COLORS.secondary,
|
|
207
|
+
testId: (0, _qa.generateTestId)({
|
|
208
|
+
base: testId,
|
|
209
|
+
slot: 'separator-icon'
|
|
210
|
+
})
|
|
171
211
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
172
212
|
className: _DateRangeWrapperModule.default.selectedDate,
|
|
173
213
|
color: _Text.TEXT_COLORS.secondary,
|
|
214
|
+
testId: (0, _qa.generateTestId)({
|
|
215
|
+
base: testId,
|
|
216
|
+
slot: 'end-date-label'
|
|
217
|
+
}),
|
|
174
218
|
children: `${endDateLabel || (0, _dateRangePicker.getTranslation)(t, 'End Date')}: ${(0, _dateRangePicker.getFormattedDate)(_utils.MARKERS.DATE_RANGE_END, dateRange, locale)}`
|
|
175
219
|
})]
|
|
176
220
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
177
221
|
className: _DateRangeWrapperModule.default.calendarMenuContainer,
|
|
222
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
223
|
+
base: testId,
|
|
224
|
+
slot: 'calendar-menu-container'
|
|
225
|
+
}),
|
|
178
226
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarHeader, {
|
|
179
227
|
t: t,
|
|
180
228
|
marker: _utils.MARKERS.DATE_RANGE_START,
|
|
@@ -187,7 +235,8 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
187
235
|
minDate: minDate,
|
|
188
236
|
maxDate: maxDate,
|
|
189
237
|
onClickNext: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_START, _utils.NAVIGATION_ACTION.NEXT),
|
|
190
|
-
onClickPrevious: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_START, _utils.NAVIGATION_ACTION.PREV)
|
|
238
|
+
onClickPrevious: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_START, _utils.NAVIGATION_ACTION.PREV),
|
|
239
|
+
testId: testId
|
|
191
240
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarHeader, {
|
|
192
241
|
t: t,
|
|
193
242
|
marker: _utils.MARKERS.DATE_RANGE_END,
|
|
@@ -200,25 +249,50 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
200
249
|
minDate: minDate,
|
|
201
250
|
maxDate: maxDate,
|
|
202
251
|
onClickNext: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_END, _utils.NAVIGATION_ACTION.NEXT),
|
|
203
|
-
onClickPrevious: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_END, _utils.NAVIGATION_ACTION.PREV)
|
|
252
|
+
onClickPrevious: () => onMonthNavigate(_utils.MARKERS.DATE_RANGE_END, _utils.NAVIGATION_ACTION.PREV),
|
|
253
|
+
testId: testId
|
|
204
254
|
})]
|
|
205
255
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.CardContent, {
|
|
206
256
|
className: _DateRangeWrapperModule.default.dateRangeCalendars,
|
|
257
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
258
|
+
base: testId,
|
|
259
|
+
slot: 'calendars'
|
|
260
|
+
}),
|
|
207
261
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Calendar.Calendar, {
|
|
208
262
|
marker: _utils.MARKERS.DATE_RANGE_START,
|
|
209
263
|
value: rangeStartMonth,
|
|
210
|
-
...commonProps
|
|
264
|
+
...commonProps,
|
|
265
|
+
testId: (0, _qa.generateTestId)({
|
|
266
|
+
base: testId,
|
|
267
|
+
slot: 'start-calendar'
|
|
268
|
+
})
|
|
211
269
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
212
|
-
className: _DateRangeWrapperModule.default.divider
|
|
270
|
+
className: _DateRangeWrapperModule.default.divider,
|
|
271
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
272
|
+
base: testId,
|
|
273
|
+
slot: 'divider'
|
|
274
|
+
})
|
|
213
275
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Calendar.Calendar, {
|
|
214
276
|
marker: _utils.MARKERS.DATE_RANGE_END,
|
|
215
277
|
value: rangeEndMonth,
|
|
216
|
-
...commonProps
|
|
278
|
+
...commonProps,
|
|
279
|
+
testId: (0, _qa.generateTestId)({
|
|
280
|
+
base: testId,
|
|
281
|
+
slot: 'end-calendar'
|
|
282
|
+
})
|
|
217
283
|
})]
|
|
218
284
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.CardFooter, {
|
|
219
285
|
className: _DateRangeWrapperModule.default.cardFooter,
|
|
286
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
287
|
+
base: testId,
|
|
288
|
+
slot: 'footer'
|
|
289
|
+
}),
|
|
220
290
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardTitle, {
|
|
221
291
|
className: _DateRangeWrapperModule.default.timezoneDropdownContainer,
|
|
292
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
293
|
+
base: testId,
|
|
294
|
+
slot: 'timezone-container'
|
|
295
|
+
}),
|
|
222
296
|
children: !hideTimezone && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
|
|
223
297
|
menu: {
|
|
224
298
|
selectedKeys: [timezone],
|
|
@@ -239,18 +313,34 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
239
313
|
box: _DateRangeWrapperModule.default.timezoneDropdown
|
|
240
314
|
},
|
|
241
315
|
onChange: event => setTimezone(event.key),
|
|
242
|
-
size: "small"
|
|
316
|
+
size: "small",
|
|
317
|
+
testId: (0, _qa.generateTestId)({
|
|
318
|
+
base: testId,
|
|
319
|
+
slot: 'timezone-dropdown'
|
|
320
|
+
})
|
|
243
321
|
})
|
|
244
322
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.CardActions, {
|
|
323
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
324
|
+
base: testId,
|
|
325
|
+
slot: 'actions'
|
|
326
|
+
}),
|
|
245
327
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
246
328
|
type: "ghost",
|
|
247
329
|
onClick: onCancel,
|
|
248
330
|
size: "small",
|
|
331
|
+
testId: (0, _qa.generateTestId)({
|
|
332
|
+
base: testId,
|
|
333
|
+
slot: 'cancel-button'
|
|
334
|
+
}),
|
|
249
335
|
children: (0, _dateRangePicker.getTranslation)(t, 'Cancel')
|
|
250
336
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
251
337
|
onClick: handleApplyClick,
|
|
252
338
|
size: "small",
|
|
253
339
|
disabled: !(dateRange.startDate && dateRange.endDate),
|
|
340
|
+
testId: (0, _qa.generateTestId)({
|
|
341
|
+
base: testId,
|
|
342
|
+
slot: 'apply-button'
|
|
343
|
+
}),
|
|
254
344
|
children: (0, _dateRangePicker.getTranslation)(t, 'Apply')
|
|
255
345
|
})]
|
|
256
346
|
})]
|
|
@@ -11,7 +11,8 @@ interface DayProps {
|
|
|
11
11
|
startOfRange: boolean;
|
|
12
12
|
onClick: () => void;
|
|
13
13
|
onHover: () => void;
|
|
14
|
+
testId?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const Day: ({ date, value, filled, onHover, onClick, disabled, hoverDay, outlined, endOfRange, highlighted, startOfRange, }: DayProps) => React.JSX.Element;
|
|
16
|
+
export declare const Day: ({ date, value, filled, onHover, onClick, disabled, hoverDay, outlined, endOfRange, highlighted, startOfRange, testId, }: DayProps) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
17
18
|
//# sourceMappingURL=Day.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Day.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/Day.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Day.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/Day.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,eAAO,MAAM,GAAG,GAAI,yHAajB,QAAQ,sBA0BV,CAAC"}
|
|
@@ -7,6 +7,7 @@ exports.Day = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _moment = _interopRequireDefault(require("moment"));
|
|
9
9
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
10
|
+
var _qa = require("../../utils/qa");
|
|
10
11
|
var _Button = require("../Button");
|
|
11
12
|
var _Text = require("../Text");
|
|
12
13
|
var _DayModule = _interopRequireDefault(require("./Day.module.css"));
|
|
@@ -34,7 +35,8 @@ const Day = _ref => {
|
|
|
34
35
|
outlined,
|
|
35
36
|
endOfRange,
|
|
36
37
|
highlighted,
|
|
37
|
-
startOfRange
|
|
38
|
+
startOfRange,
|
|
39
|
+
testId
|
|
38
40
|
} = _ref;
|
|
39
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.UnstyledButton, {
|
|
40
42
|
tabIndex: disabled ? -1 : 0,
|
|
@@ -45,6 +47,10 @@ const Day = _ref => {
|
|
|
45
47
|
onMouseOver: onHover,
|
|
46
48
|
onClick: onClick,
|
|
47
49
|
onKeyUp: onHover,
|
|
50
|
+
testId: (0, _qa.generateTestId)({
|
|
51
|
+
base: testId,
|
|
52
|
+
slot: `day-button-${date}`
|
|
53
|
+
}),
|
|
48
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodyMedium, {
|
|
49
55
|
color: getTextColor(disabled, filled),
|
|
50
56
|
className: (0, _classify.default)(_DayModule.default.calendarRowItem, {
|
|
@@ -52,6 +58,10 @@ const Day = _ref => {
|
|
|
52
58
|
[_DayModule.default.calendarRowItemFilled]: !disabled && filled,
|
|
53
59
|
[_DayModule.default.calendarRowItemOutlined]: outlined
|
|
54
60
|
}),
|
|
61
|
+
testId: (0, _qa.generateTestId)({
|
|
62
|
+
base: testId,
|
|
63
|
+
slot: `day-text-${date}`
|
|
64
|
+
}),
|
|
55
65
|
children: value
|
|
56
66
|
})
|
|
57
67
|
});
|
|
@@ -24,6 +24,7 @@ export interface FilterButtonOverlayProps extends Omit<NewButtonProps, 'classNam
|
|
|
24
24
|
buttonSize?: ButtonSize;
|
|
25
25
|
elevation?: ElevationType;
|
|
26
26
|
buttonIsFluid?: boolean;
|
|
27
|
+
testId?: string;
|
|
27
28
|
}
|
|
28
29
|
export declare const FilterButtonOverlay: Flow.AbstractComponent<FilterButtonOverlayProps, HTMLDivElement>;
|
|
29
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterButtonOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FilterButtonOverlay/FilterButtonOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterButtonOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FilterButtonOverlay/FilterButtonOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAKhD,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAKxE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAM1D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CACpC,WAAW,EACX;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CACF,CAAC;AAEF,MAAM,WAAW,wBACf,SAAQ,IAAI,CACV,cAAc,EACZ,YAAY,GACZ,UAAU,GACV,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,MAAM,GACN,aAAa,GACb,YAAY,GACZ,WAAW,GACX,eAAe,CAClB;IACD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAC5B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,iBAAiB,CACtD,wBAAwB,EACxB,cAAc,CAuHf,CAAC"}
|
|
@@ -10,6 +10,7 @@ var _hooks = require("../../hooks");
|
|
|
10
10
|
var _space = require("../../styles/variables/_space");
|
|
11
11
|
var _utils = require("../../utils");
|
|
12
12
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
13
|
+
var _qa = require("../../utils/qa");
|
|
13
14
|
var _Button = require("../Button");
|
|
14
15
|
var _ButtonDropdown = require("../ButtonDropdown");
|
|
15
16
|
var _Tooltip = require("../Tooltip");
|
|
@@ -30,6 +31,7 @@ const FilterButtonOverlay = exports.FilterButtonOverlay = /*#__PURE__*/React.for
|
|
|
30
31
|
buttonIsFluid,
|
|
31
32
|
buttonSize,
|
|
32
33
|
elevation = 'modal',
|
|
34
|
+
testId,
|
|
33
35
|
...restProps
|
|
34
36
|
} = _ref;
|
|
35
37
|
const {
|
|
@@ -58,7 +60,10 @@ const FilterButtonOverlay = exports.FilterButtonOverlay = /*#__PURE__*/React.for
|
|
|
58
60
|
triggerRef
|
|
59
61
|
} = _ref2;
|
|
60
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
61
|
-
"data-testid":
|
|
63
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
64
|
+
base: testId,
|
|
65
|
+
slot: 'root'
|
|
66
|
+
}),
|
|
62
67
|
className: (0, _classify.default)({
|
|
63
68
|
[_FilterButtonOverlayModule.default.isFluid]: buttonIsFluid
|
|
64
69
|
}, classNames?.wrapper),
|
|
@@ -72,6 +77,10 @@ const FilterButtonOverlay = exports.FilterButtonOverlay = /*#__PURE__*/React.for
|
|
|
72
77
|
},
|
|
73
78
|
isFluid: buttonIsFluid,
|
|
74
79
|
size: buttonSize,
|
|
80
|
+
testId: (0, _qa.generateTestId)({
|
|
81
|
+
base: testId,
|
|
82
|
+
slot: 'button'
|
|
83
|
+
}),
|
|
75
84
|
children: buttonLabel
|
|
76
85
|
}), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.FloatingPortal, {
|
|
77
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.FloatingFocusManager, {
|
|
@@ -81,6 +90,10 @@ const FilterButtonOverlay = exports.FilterButtonOverlay = /*#__PURE__*/React.for
|
|
|
81
90
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
82
91
|
ref: (0, _utils.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
83
92
|
className: _FilterButtonOverlayModule.default.overlayContainer,
|
|
93
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
94
|
+
base: testId,
|
|
95
|
+
slot: 'overlay'
|
|
96
|
+
}),
|
|
84
97
|
style: {
|
|
85
98
|
display: 'flex',
|
|
86
99
|
position: strategy,
|
|
@@ -102,6 +115,10 @@ const FilterButtonOverlay = exports.FilterButtonOverlay = /*#__PURE__*/React.for
|
|
|
102
115
|
[_FilterButtonOverlayModule.default.small]: size === 'small',
|
|
103
116
|
[_FilterButtonOverlayModule.default.medium]: size === 'medium'
|
|
104
117
|
}, classNames?.overlayContainer),
|
|
118
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
119
|
+
base: testId,
|
|
120
|
+
slot: 'content'
|
|
121
|
+
}),
|
|
105
122
|
children: children
|
|
106
123
|
})
|
|
107
124
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { FloatingFocusManagerProps } from '@floating-ui/react';
|
|
3
|
+
import { FloatingPortal } from '@floating-ui/react';
|
|
3
4
|
type ClassNames = Readonly<{
|
|
4
5
|
wrapper?: string;
|
|
5
6
|
}>;
|
|
@@ -20,6 +21,6 @@ export interface FocusManagerProps {
|
|
|
20
21
|
modal?: boolean;
|
|
21
22
|
testId?: string;
|
|
22
23
|
}
|
|
24
|
+
export { FloatingPortal };
|
|
23
25
|
export declare const FocusManager: (props: FocusManagerProps) => React.JSX.Element;
|
|
24
|
-
export {};
|
|
25
26
|
//# sourceMappingURL=FocusManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusManager.d.ts","sourceRoot":"","sources":["../../../src/components/FocusManager/FocusManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"FocusManager.d.ts","sourceRoot":"","sources":["../../../src/components/FocusManager/FocusManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAEL,cAAc,EAEf,MAAM,oBAAoB,CAAC;AAQ5B,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,mBAAmB,sBAE/D,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,OAAO,yBAAyB,sBACM,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,OAAO,EAAC,cAAc,EAAC,CAAC;AAExB,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,sBA+BpD,CAAC"}
|